-
Notifications
You must be signed in to change notification settings - Fork 65
Allow different Fortran source directory #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,6 +64,7 @@ | |
| relative_path = <relative path> | ||
| dependencies = <dependencies> | ||
| module = <module name> # only needed if module name differs from filename | ||
| source_path = <relative source directory of Fortran source (if different)> | ||
| dynamic_constituent_routine = <routine name> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops! I know this is unrelated to your changes, but can you remove this residual dynamic constituents line left by me? |
||
|
|
||
| [ccpp-arg-table] | ||
|
|
@@ -357,19 +358,20 @@ class MetadataTable(): | |
| __table_start = re.compile(r"(?i)\s*\[\s*ccpp-table-properties\s*\]") | ||
|
|
||
| def __init__(self, run_env, table_name_in=None, table_type_in=None, | ||
| dependencies=None, relative_path=None, | ||
| dependencies=None, relative_path=None, source_path=None, | ||
| known_ddts=None, var_dict=None, module=None, parse_object=None, | ||
| skip_ddt_check=False): | ||
| """Initialize a MetadataTable, either with a name, <table_name_in>, and | ||
| type, <table_type_in>, or with information from a file (<parse_object>). | ||
| if <parse_object> is None, <dependencies> and <relative_path> are | ||
| also stored. | ||
| if <parse_object> is None, <dependencies>, <relative_path>, and | ||
| are <source_path> are also stored. | ||
| If <var_dict> and / or module are passed (not allowed with | ||
| <parse_object), then a single MetadataSection is added with | ||
| that information. | ||
| """ | ||
| self.__pobj = parse_object | ||
| self.__dependencies = dependencies | ||
| self.__fortran_src_path = source_path | ||
| self.__module_name = module | ||
| self.__relative_path = relative_path | ||
| self.__sections = [] | ||
|
|
@@ -428,6 +430,10 @@ def __init__(self, run_env, table_name_in=None, table_type_in=None, | |
| perr = "module not allowed as argument when reading file" | ||
| raise ParseInternalError(perr) | ||
| # end if | ||
| if source_path is not None: | ||
| perr = "source_path not allowed as argument when reading file" | ||
| raise ParseInternalError(perr) | ||
| # end if | ||
| if known_ddts is None: | ||
| known_ddts = [] | ||
| # end if | ||
|
|
@@ -441,6 +447,9 @@ def __init__(self, run_env, table_name_in=None, table_type_in=None, | |
| for ind, dep in enumerate(self.__dependencies): | ||
| self.__dependencies[ind] = os.path.abspath(os.path.join(path, dep)) | ||
| # end for | ||
| if self.__fortran_src_path: | ||
| self.__fortran_src_path = os.path.join(path, self.__fortran_src_path) | ||
| # end if | ||
| # end if | ||
|
|
||
| def __init_from_file(self, known_ddts, run_env, skip_ddt_check=False): | ||
|
|
@@ -451,6 +460,8 @@ def __init_from_file(self, known_ddts, run_env, skip_ddt_check=False): | |
| skip_rest_of_section = False | ||
| self.__dependencies = [] # Default is no dependencies | ||
| self.__module_name = self.__pobj.default_module_name() | ||
| my_dirname = os.path.dirname(self.__pobj.filename) | ||
| self.__fortran_src_path = my_dirname | ||
| # Process lines until the end of the file or start of the next table. | ||
| while ((curr_line is not None) and | ||
| (not MetadataTable.table_start(curr_line))): | ||
|
|
@@ -496,6 +507,8 @@ def __init_from_file(self, known_ddts, run_env, skip_ddt_check=False): | |
| self.__module_name = value | ||
| elif key == 'relative_path': | ||
| self.__relative_path = value | ||
| elif key == 'source_path': | ||
| self.__fortran_src_path = os.path.join(my_dirname, value) | ||
| else: | ||
| tok_type = "metadata table start property" | ||
| self.__pobj.add_syntax_err(tok_type, token=key) | ||
|
|
@@ -583,6 +596,11 @@ def relative_path(self): | |
| """Return the relative path for the table's dependencies""" | ||
| return self.__relative_path | ||
|
|
||
| @property | ||
| def fortran_source_path(self): | ||
| """Return the Fortran source path for this table""" | ||
| return self.__fortran_src_path | ||
|
|
||
| @property | ||
| def run_env(self): | ||
| """Return this table's CCPPFrameworkEnv object""" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for fixing this!