diff --git a/Metadata-standard-names.md b/Metadata-standard-names.md index 4228546..0e30f86 100644 --- a/Metadata-standard-names.md +++ b/Metadata-standard-names.md @@ -1,4 +1,4 @@ -# CCPP Standard Name Library +# Earth System Modeling Standard Name Library #### Table of Contents * [dimensions](#dimensions) * [constants](#constants) @@ -8,9 +8,8 @@ * [diagnostics](#diagnostics) * [atmospheric_composition](#atmospheric_composition) * [atmospheric_composition: GOCART aerosols](#atmospheric_composition-gocart-aerosols) -* [emissions: Community Emissions Data System (CEDS)](#emissions-community-emissions-data-system-ceds) -* [required framework-provided variables](#required-framework-provided-variables) -* [optional framework-provided variables](#optional-framework-provided-variables) +* [emissions](#emissions) +* [Application-specific variables](#application-specific-variables) * [system variables](#system-variables) * [GFS_typedefs_GFS_control_type](#gfs_typedefs_gfs_control_type) * [GFS_typedefs_GFS_interstitial_type](#gfs_typedefs_gfs_interstitial_type) @@ -62,10 +61,8 @@ Currently, the only dimension which supports all six dimension types is horizont * `integer`: units = index * `vertical_index_at_top_interface`: Vertical index at top interface * `integer`: units = index -* `number_of_openmp_threads`: Total number of thread blocks which the host model may use to call CCPP physics run groups during the CCPP run phase. +* `number_of_openmp_threads`: Total number of thread blocks OpenMP (shared-memory) parallel threads. * `integer`: units = count -* `ccpp_thread_number`: Number of current thread block. This variable may only be used during CCPP run phase - * `integer`: units = index ## constants * `avogadro_number`: Avogadro number * `real(kind=kind_phys)`: units = molecules mol-1 @@ -452,7 +449,8 @@ Note that appending '_on_previous_timestep' to standard_names in this section yi * `real(kind=kind_phys)`: units = m-1 * `volume_extinction_in_air_due_to_aerosol_particles_lambda3`: Aerosol extinction at wavelength3 * `real(kind=kind_phys)`: units = m-1 -## emissions: Community Emissions Data System (CEDS) +## emissions +Emissions variables, contributed for the Community Emissions Data System (CEDS) * `emissions_of_co_due_to_anthropogenic`: Carbon monoxide emissions from anthropogenic sources, total * `real(kind=kind_phys)`: units = kg m-2 s-1 * `emissions_of_no_due_to_anthropogenic`: Nitric oxide emissions from anthropogenic sources, total @@ -507,13 +505,15 @@ Note that appending '_on_previous_timestep' to standard_names in this section yi * `real(kind=kind_phys)`: units = kg m-2 s-1 * `emissions_of_hcho_due_to_anthropogenic_waste`: Formaldehyde emissions from anthropogenic waste disposal and handling * `real(kind=kind_phys)`: units = kg m-2 s-1 -## required framework-provided variables +## Application-specific variables +Variable names only for use with a specific application +### required framework-provided variables Required CCPP framework-provided variables * `ccpp_error_message`: Error message for error handling in CCPP * `character(kind=len=512)`: units = none * `ccpp_error_code`: Error code for error handling in CCPP * `integer(kind=)`: units = 1 -## optional framework-provided variables +### optional framework-provided variables Optional CCPP framework-provided variables * `scheme_name`: CCPP physics scheme name * `character(kind=len=64)`: units = none @@ -525,6 +525,12 @@ Optional CCPP framework-provided variables * `real(kind=kind_phys)`: units = none * `number_of_ccpp_constituents`: Number of constituents managed by CCPP Framework * `integer(kind=)`: units = count +* `ccpp_block_count`: Ccpp block count + * `integer(kind=)`: units = count +* `ccpp_block_sizes`: Ccpp block sizes + * `integer(kind=)`: units = count +* `ccpp_thread_number`: Number of current thread block. This variable may only be used during CCPP run phase + * `integer`: units = index ## system variables Variables related to the compute environment * `flag_for_mpi_root`: Flag for MPI root @@ -556,10 +562,6 @@ Variables related to the compute environment * `real(kind=kind_phys)`: units = m2 s-1 * `sigma_pressure_hybrid_coordinate_b_coefficient`: Sigma pressure hybrid coordinate b coefficient * `real(kind=kind_phys)`: units = 1 -* `ccpp_block_count`: Ccpp block count - * `integer(kind=)`: units = count -* `ccpp_block_sizes`: Ccpp block sizes - * `integer(kind=)`: units = count * `cellular_automata_finer_grid`: Cellular automata finer grid * `integer(kind=)`: units = count * `cellular_automata_lifetime`: Cellular automata lifetime diff --git a/README.md b/README.md index 1cc2fdb..d9ef1d2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ -# CCPPStandardNames +# ESMStandardNames -The CCPPStandardNames Repository contains community-accepted CCPP +The Earth System Modeling Standard Names Repository contains community-accepted Standard Names, publishing tools, and search tools. A Markdown file describing the standard names -[is included](https://github.com/ESCOMP/CCPPStandardNames/blob/master/Metadata-standard-names.md). +[is included](https://github.com/ESCOMP/ESMStandardNames/blob/main/Metadata-standard-names.md). +Rules governing the designation and format of standard names can be found in [StandardNamesRules.rst](https://github.com/ESCOMP/ESMStandardNames/blob/main/StandardNamesRules.rst) -To regenerate the standard name Markdown file, run: +Edits to standard names should be made in the xml file, using the included python tools to generate +the human-readable standard name Markdown file: ``` tools/write_standard_name_table.py standard_names.xml ``` diff --git a/StandardNamesRules.rst b/StandardNamesRules.rst index 5f2a9cd..8964187 100644 --- a/StandardNamesRules.rst +++ b/StandardNamesRules.rst @@ -4,13 +4,13 @@
******************* -CCPP Standard Names +Earth System Modeling Standard Names ******************* This document contains information about the rules used to create Standard Names -for use with the Common Community Physics Package (CCPP). It describes the +for use with Earth System Models. It describes the -* CCPP Standard Name rules +* ESM Standard Name rules * Standard Name qualifiers * Other common standard name components * Acronyms, abbreviations, and aliases @@ -18,7 +18,7 @@ for use with the Common Community Physics Package (CCPP). It describes the .. _Rules -CCPP Standard Name Rules +ESM Standard Name Rules ======================== #. Standard names should be identical to those from the latest version diff --git a/standard_names.xml b/standard_names.xml index a16ec7f..02907ed 100644 --- a/standard_names.xml +++ b/standard_names.xml @@ -1,4 +1,4 @@ - +
integer + long_name="Total number of thread blocks OpenMP (shared-memory) parallel threads."> integer - - integer -
@@ -791,7 +787,8 @@ real
-
+
real @@ -901,39 +898,52 @@ real
-
- - character - - - integer - -
-
- - character - - - ccpp_constituent_prop_ptr_t - - - real - - - real - - - integer - +
+
+ + character + + + integer + +
+
+ + character + + + ccpp_constituent_prop_ptr_t + + + real + + + real + + + integer + + + integer + + + integer + + + integer + +
@@ -983,12 +993,6 @@ real - - integer - - - integer - integer diff --git a/tools/meta_stdname_check.py b/tools/ccpp_meta_stdname_check.py similarity index 99% rename from tools/meta_stdname_check.py rename to tools/ccpp_meta_stdname_check.py index d343027..c4a8cc4 100755 --- a/tools/meta_stdname_check.py +++ b/tools/ccpp_meta_stdname_check.py @@ -37,7 +37,7 @@ from collections import OrderedDict ################################################ -#Add CCPP framework (lib) modules to python path +#Add lib modules to python path ################################################ _CURR_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/tools/check_name_rules.py b/tools/check_name_rules.py index 2a67336..f681aeb 100755 --- a/tools/check_name_rules.py +++ b/tools/check_name_rules.py @@ -10,7 +10,7 @@ import re ################################################ -#Add CCPP framework (lib) modules to python path +#Add lib modules to python path ################################################ _CURR_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/tools/check_xml_unique.py b/tools/check_xml_unique.py index 20d7ce9..6b195b1 100755 --- a/tools/check_xml_unique.py +++ b/tools/check_xml_unique.py @@ -11,7 +11,7 @@ import copy ################################################ -#Add CCPP framework (lib) modules to python path +#Add lib modules to python path ################################################ _CURR_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/tools/write_standard_name_table.py b/tools/write_standard_name_table.py index c89d794..55077f8 100755 --- a/tools/write_standard_name_table.py +++ b/tools/write_standard_name_table.py @@ -12,7 +12,7 @@ import re ################################################ -#Add CCPP framework (lib) modules to python path +#Add lib) modules to python path ################################################ _CURR_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -63,21 +63,20 @@ def convert_text_to_link(text_str): def standard_name_to_long_name(prop_dict, context=None): ######################################################################## """Translate a standard_name to its default long_name - Note: This code is copied from the CCPP Framework. >>> standard_name_to_long_name({'standard_name':'cloud_optical_depth_layers_from_0p55mu_to_0p99mu'}) 'Cloud optical depth layers from 0.55mu to 0.99mu' >>> standard_name_to_long_name({'local_name':'foo'}) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): - CCPPError: No standard name to convert foo to long name + KeyError: No standard name to convert foo to long name >>> standard_name_to_long_name({}) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): - CCPPError: No standard name to convert to long name + KeyError: No standard name to convert to long name >>> standard_name_to_long_name({'local_name':'foo'}, context=ParseContext(linenum=3, filename='foo.F90')) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): - CCPPError: No standard name to convert foo to long name at foo.F90:3 + KeyError: No standard name to convert foo to long name at foo.F90:3 >>> standard_name_to_long_name({}, context=ParseContext(linenum=3, filename='foo.F90')) #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): - CCPPError: No standard name to convert to long name at foo.F90:3 + KeyError: No standard name to convert to long name at foo.F90:3 """ # We assume that standar_name has been checked for validity # Make the first char uppercase and replace each underscore with a space @@ -104,7 +103,7 @@ def standard_name_to_long_name(prop_dict, context=None): # end if ctxt = context_string(context) emsg = 'No standard name to convert{} to long name{}' - raise CCPPError(emsg.format(lname, ctxt)) + raise KeyError(emsg.format(lname, ctxt)) # end if return long_name @@ -129,7 +128,7 @@ def parse_command_line(args, description): def convert_xml_to_markdown(root, library_name, snl): ############################################################################### snl.write('# {}\n'.format(library_name)) - # Write a table of contents + # Write a table of contents for top-level sections snl.write('#### Table of Contents\n') for section in root: sec_name = section.get('name') @@ -138,15 +137,19 @@ def convert_xml_to_markdown(root, library_name, snl): # end for snl.write('\n') for section in root: + parse_section(snl, section) + +############################################################################### +def parse_section(snl, sec, level='##'): +############################################################################### # Step through the sections - sec_name = section.get('name') - sec_comment = section.get('comment') - snl.write('## {}\n'.format(sec_name)) + sec_name = sec.get('name') + sec_comment = sec.get('comment') + snl.write(f'{level} {sec_name}\n') if sec_comment is not None: # First, squeeze out the spacing while sec_comment.find(' ') >= 0: sec_comment = sec_comment.replace(' ', ' ') - # end while while sec_comment: sec_comment = sec_comment.lstrip() cind = sec_comment.find('\\n') @@ -159,7 +162,10 @@ def convert_xml_to_markdown(root, library_name, snl): # end if # end while # end if - for std_name in section: + for std_name in sec: + if std_name.tag == 'section': + parse_section(snl, std_name, level + '#') + continue stdn_name = std_name.get('name') stdn_longname = std_name.get('long_name') if stdn_longname is None: @@ -187,7 +193,6 @@ def convert_xml_to_markdown(root, library_name, snl): # end for # end for # end for - ############################################################################### def main_func(): ###############################################################################