-
Notifications
You must be signed in to change notification settings - Fork 32
Adding some information on Standard Names for dimensions in metadata files #80
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
Open
mkavulich
wants to merge
2
commits into
NCAR:main
Choose a base branch
from
mkavulich:add_dimensions_info
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -338,14 +338,7 @@ After the ``ccpp-arg-table``, there should be a metadata entry for every input a | |
|
|
||
| .. note:: The ``intent`` argument is only valid in ``scheme`` metadata tables, as it is not applicable to the other ``types``. | ||
|
|
||
| * ``dimensions`` indicates the dimensionality of the variable. The dimensions attribute should be empty parentheses for scalars, or indicate the start and end of each dimension of an array with an appropriate standard name; see the `ESM Standard Names documentation <https://github.com/ESCOMP/ESMStandardNames/blob/main/Metadata-standard-names.md#dimensions>`__. ``ccpp_constant_one`` is the assumed start for any dimension which only has a single value. Some examples are listed here: | ||
|
|
||
| .. code-block:: fortran | ||
|
|
||
| dimensions = () | ||
| dimensions = (ccpp_constant_one:horizontal_loop_extent, vertical_level_dimension) | ||
| dimensions = (horizontal_dimension,vertical_dimension) | ||
| dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) | ||
| * ``dimensions`` indicates the dimensionality of the variable. See :numref:`Section %s <SchemeDimensionOptions>` for details. | ||
|
|
||
| * ``type`` indicates the variable type. Can be ``character``, ``integer``, ``real``, ``complex``, ``logical``, ``ddt``, or a custom type defined by the host. Custom types must be listed under ``TYPEDEFS_NEW_METADATA`` in the prebuild configuration file. | ||
|
|
||
|
|
@@ -374,12 +367,48 @@ After the ``ccpp-arg-table``, there should be a metadata entry for every input a | |
| .. warning:: | ||
| The ``pointer`` and ``rank`` attributes are deprecated and no longer allowed in CCPP | ||
|
|
||
| .. _HorizontalDimensionOptionsSchemes: | ||
| .. _SchemeDimensionOptions: | ||
|
|
||
| ``horizontal_dimension`` vs. ``horizontal_loop_extent`` | ||
| Horizontal, vertical, and other dimensions | ||
| ------------------------------------------------------- | ||
| The dimensions attribute in metadata should indicate both the dimensionality of the data, as well as the breakdown of data among parallel processes. It should be empty parentheses for scalars, or indicate the start and end of each dimension of an array with an appropriate standard name as listed in the `ESM Standard Names documentation <https://github.com/ESCOMP/ESMStandardNames/blob/main/Metadata-standard-names.md#dimensions>`__. ``ccpp_constant_one`` is the assumed start for any dimension which only has a single value. Some examples are listed here: | ||
|
|
||
| .. code-block:: fortran | ||
|
|
||
| dimensions = () | ||
| dimensions = (ccpp_constant_one:horizontal_loop_extent, vertical_level_dimension) | ||
| dimensions = (horizontal_dimension,vertical_dimension) | ||
| dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) | ||
|
|
||
| The standard names used for dimensions may come in sets of six related standard names for each dimension: | ||
|
|
||
| :: | ||
|
|
||
| [dim_name]_dimension -- The full dimension size | ||
| [dim_name]_loop_extent -- Size of dim for current call | ||
| [dim_name]_begin - Start index for dimension | ||
| [dim_name]_end - End index for dimension | ||
| [dim_name]_index - Single index for dimension | ||
| [dim_name]_selection - Array of selected indices for | ||
| dimension | ||
|
|
||
| Note that the cap generator may substitute among standard names in this category in order to | ||
| properly call suite parts and individual schemes. In the substitutions below, the name on | ||
| the left is the standard_name in the dimensions field of the caller while the name(s) on the right | ||
| is (are) the standard name(s) of the callee (in the form used in the subroutine call). | ||
|
|
||
| :: | ||
|
|
||
| [dim_name]_dimension ==> 1:[dim_name]_loop_extent | ||
| [dim_name]_loop_extent ==> 1:[dim_name]_loop_extent | ||
| [dim_name]_begin:[dim_name]_end ==> 1:[dim_name]_loop_extent | ||
| [dim_name]_begin:[dim_name]_end ==> 1:[dim_name]_dimension | ||
|
|
||
| Also note that horizontal_dimension should be used in ``xxx_[timestep_]init`` and ``xxx_[timestep_]final`` routines, | ||
| but not in xxx_run routines. Currently, the only dimension which supports all | ||
| six dimension types is horizontal_dimension. | ||
|
Comment on lines
+408
to
+409
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. I don't really understand what you mean with the last sentence, but I don't it's correct and it should probably be removed. |
||
|
|
||
| It is important to understand the difference between these metadata dimension names. | ||
| **It is important to understand the difference between ``horizontal_dimension`` vs. ``horizontal_loop_extent``.** | ||
|
|
||
| * ``horizontal_dimension`` refers to all (horizontal) grid columns that an MPI process owns/is responsible for, and that are passed to the physics in the *init*, *timestep_init*, *timestep_finalize*, and *finalize* phases. | ||
|
|
||
|
|
||
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.
I know what you mean (because I wrote ccpp-prebuild), but for most people this will be confusing and scary. We need to explain that the left side (slices of the entire array allocated by the host model) in the CCPP run phase are sent to the CCPP physics scheme for parallel processing using OpenMP threading, and that schemes require the horizontal "dimension" for the current call to run from 1 to the length of the slice. I hope you can explain that better; some of it may already be explained in the next section (It is important to understand the difference between horizontal_dimension vs. horizontal_loop_extent), in which case we should refer to that section.