Skip to content

Commit a76e8b9

Browse files
authored
Changes after rename of CCPPStandardNames --> ESMStandardNames (#98)
- Remove references to CCPP except where relevant - Cherry-pick changes to tools/write_standard_name_table.py from release branch that allows for subsections in standard names and markdown table - Group CCPP-specific variables into a dedicated section - Change some long_name descriptions to remove CCPP-specific wording - A few more details in README.md
1 parent 0e5ae18 commit a76e8b9

File tree

8 files changed

+98
-84
lines changed

8 files changed

+98
-84
lines changed

Metadata-standard-names.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CCPP Standard Name Library
1+
# Earth System Modeling Standard Name Library
22
#### Table of Contents
33
* [dimensions](#dimensions)
44
* [constants](#constants)
@@ -8,9 +8,8 @@
88
* [diagnostics](#diagnostics)
99
* [atmospheric_composition](#atmospheric_composition)
1010
* [atmospheric_composition: GOCART aerosols](#atmospheric_composition-gocart-aerosols)
11-
* [emissions: Community Emissions Data System (CEDS)](#emissions-community-emissions-data-system-ceds)
12-
* [required framework-provided variables](#required-framework-provided-variables)
13-
* [optional framework-provided variables](#optional-framework-provided-variables)
11+
* [emissions](#emissions)
12+
* [Application-specific variables](#application-specific-variables)
1413
* [system variables](#system-variables)
1514
* [GFS_typedefs_GFS_control_type](#gfs_typedefs_gfs_control_type)
1615
* [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
6261
* `integer`: units = index
6362
* `vertical_index_at_top_interface`: Vertical index at top interface
6463
* `integer`: units = index
65-
* `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.
64+
* `number_of_openmp_threads`: Total number of thread blocks OpenMP (shared-memory) parallel threads.
6665
* `integer`: units = count
67-
* `ccpp_thread_number`: Number of current thread block. This variable may only be used during CCPP run phase
68-
* `integer`: units = index
6966
## constants
7067
* `avogadro_number`: Avogadro number
7168
* `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
452449
* `real(kind=kind_phys)`: units = m-1
453450
* `volume_extinction_in_air_due_to_aerosol_particles_lambda3`: Aerosol extinction at wavelength3
454451
* `real(kind=kind_phys)`: units = m-1
455-
## emissions: Community Emissions Data System (CEDS)
452+
## emissions
453+
Emissions variables, contributed for the Community Emissions Data System (CEDS)
456454
* `emissions_of_co_due_to_anthropogenic`: Carbon monoxide emissions from anthropogenic sources, total
457455
* `real(kind=kind_phys)`: units = kg m-2 s-1
458456
* `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
507505
* `real(kind=kind_phys)`: units = kg m-2 s-1
508506
* `emissions_of_hcho_due_to_anthropogenic_waste`: Formaldehyde emissions from anthropogenic waste disposal and handling
509507
* `real(kind=kind_phys)`: units = kg m-2 s-1
510-
## required framework-provided variables
508+
## Application-specific variables
509+
Variable names only for use with a specific application
510+
### required framework-provided variables
511511
Required CCPP framework-provided variables
512512
* `ccpp_error_message`: Error message for error handling in CCPP
513513
* `character(kind=len=512)`: units = none
514514
* `ccpp_error_code`: Error code for error handling in CCPP
515515
* `integer(kind=)`: units = 1
516-
## optional framework-provided variables
516+
### optional framework-provided variables
517517
Optional CCPP framework-provided variables
518518
* `scheme_name`: CCPP physics scheme name
519519
* `character(kind=len=64)`: units = none
@@ -525,6 +525,12 @@ Optional CCPP framework-provided variables
525525
* `real(kind=kind_phys)`: units = none
526526
* `number_of_ccpp_constituents`: Number of constituents managed by CCPP Framework
527527
* `integer(kind=)`: units = count
528+
* `ccpp_block_count`: Ccpp block count
529+
* `integer(kind=)`: units = count
530+
* `ccpp_block_sizes`: Ccpp block sizes
531+
* `integer(kind=)`: units = count
532+
* `ccpp_thread_number`: Number of current thread block. This variable may only be used during CCPP run phase
533+
* `integer`: units = index
528534
## system variables
529535
Variables related to the compute environment
530536
* `flag_for_mpi_root`: Flag for MPI root
@@ -556,10 +562,6 @@ Variables related to the compute environment
556562
* `real(kind=kind_phys)`: units = m2 s-1
557563
* `sigma_pressure_hybrid_coordinate_b_coefficient`: Sigma pressure hybrid coordinate b coefficient
558564
* `real(kind=kind_phys)`: units = 1
559-
* `ccpp_block_count`: Ccpp block count
560-
* `integer(kind=)`: units = count
561-
* `ccpp_block_sizes`: Ccpp block sizes
562-
* `integer(kind=)`: units = count
563565
* `cellular_automata_finer_grid`: Cellular automata finer grid
564566
* `integer(kind=)`: units = count
565567
* `cellular_automata_lifetime`: Cellular automata lifetime

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
# CCPPStandardNames
1+
# ESMStandardNames
22

3-
The CCPPStandardNames Repository contains community-accepted CCPP
3+
The Earth System Modeling Standard Names Repository contains community-accepted
44
Standard Names, publishing tools, and search tools.
55

66
A Markdown file describing the standard names
7-
[is included](https://github.com/ESCOMP/CCPPStandardNames/blob/master/Metadata-standard-names.md).
7+
[is included](https://github.com/ESCOMP/ESMStandardNames/blob/main/Metadata-standard-names.md).
8+
Rules governing the designation and format of standard names can be found in [StandardNamesRules.rst](https://github.com/ESCOMP/ESMStandardNames/blob/main/StandardNamesRules.rst)
89

9-
To regenerate the standard name Markdown file, run:
10+
Edits to standard names should be made in the xml file, using the included python tools to generate
11+
the human-readable standard name Markdown file:
1012
```
1113
tools/write_standard_name_table.py standard_names.xml
1214
```

StandardNamesRules.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44
<br />
55

66
*******************
7-
CCPP Standard Names
7+
Earth System Modeling Standard Names
88
*******************
99

1010
This document contains information about the rules used to create Standard Names
11-
for use with the Common Community Physics Package (CCPP). It describes the
11+
for use with Earth System Models. It describes the
1212

13-
* CCPP Standard Name rules
13+
* ESM Standard Name rules
1414
* Standard Name qualifiers
1515
* Other common standard name components
1616
* Acronyms, abbreviations, and aliases
1717
* Units
1818

1919
.. _Rules
2020
21-
CCPP Standard Name Rules
21+
ESM Standard Name Rules
2222
========================
2323

2424
#. Standard names should be identical to those from the latest version

standard_names.xml

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<standard_names name="CCPP Standard Name Library" version="1.0">
1+
<standard_names name="Earth System Modeling Standard Name Library" version="1.0">
22
<section name="dimensions"
33
comment="Dimension standard names may come in sets of six
44
related standard names for each dimension:\n
@@ -69,13 +69,9 @@
6969
<type units="index">integer</type>
7070
</standard_name>
7171
<standard_name name="number_of_openmp_threads"
72-
long_name="Total number of thread blocks which the host model may use to call CCPP physics run groups during the CCPP run phase.">
72+
long_name="Total number of thread blocks OpenMP (shared-memory) parallel threads.">
7373
<type units="count">integer</type>
7474
</standard_name>
75-
<standard_name name="ccpp_thread_number"
76-
long_name="Number of current thread block. This variable may only be used during CCPP run phase">
77-
<type units="index">integer</type>
78-
</standard_name>
7975
</section>
8076
<section name="constants">
8177
<standard_name name="avogadro_number">
@@ -791,7 +787,8 @@
791787
<type kind="kind_phys" units="m-1">real</type>
792788
</standard_name>
793789
</section>
794-
<section name="emissions: Community Emissions Data System (CEDS)">
790+
<section name="emissions"
791+
comment="Emissions variables, contributed for the Community Emissions Data System (CEDS)">
795792
<standard_name name="emissions_of_co_due_to_anthropogenic"
796793
long_name="Carbon monoxide emissions from anthropogenic sources, total">
797794
<type kind="kind_phys" units="kg m-2 s-1">real</type>
@@ -901,39 +898,52 @@
901898
<type kind="kind_phys" units="kg m-2 s-1">real</type>
902899
</standard_name>
903900
</section>
904-
<section name="required framework-provided variables"
905-
comment="Required CCPP framework-provided variables">
906-
<standard_name name="ccpp_error_message"
907-
long_name="Error message for error handling in CCPP">
908-
<type kind="len=512" units="none">character</type>
909-
</standard_name>
910-
<standard_name name="ccpp_error_code"
911-
long_name="Error code for error handling in CCPP">
912-
<type kind="" units="1">integer</type>
913-
</standard_name>
914-
</section>
915-
<section name="optional framework-provided variables"
916-
comment="Optional CCPP framework-provided variables">
917-
<standard_name name="scheme_name"
918-
long_name="CCPP physics scheme name">
919-
<type kind="len=64" units="none">character</type>
920-
</standard_name>
921-
<standard_name name="ccpp_constituent_properties"
922-
long_name="CCPP Constituent Properties">
923-
<type kind="" units="none">ccpp_constituent_prop_ptr_t</type>
924-
</standard_name>
925-
<standard_name name="ccpp_constituents"
926-
long_name="Array of constituents managed by CCPP Framework">
927-
<type kind="kind_phys" units="none">real</type>
928-
</standard_name>
929-
<standard_name name="ccpp_constituent_minimum_values"
930-
long_name="CCPP constituent minimum values">
931-
<type kind="kind_phys" units="none">real</type>
932-
</standard_name>
933-
<standard_name name="number_of_ccpp_constituents"
934-
long_name="Number of constituents managed by CCPP Framework">
935-
<type kind="" units="count">integer</type>
936-
</standard_name>
901+
<section name="Application-specific variables"
902+
comment="Variable names only for use with a specific application">
903+
<section name="required framework-provided variables"
904+
comment="Required CCPP framework-provided variables">
905+
<standard_name name="ccpp_error_message"
906+
long_name="Error message for error handling in CCPP">
907+
<type kind="len=512" units="none">character</type>
908+
</standard_name>
909+
<standard_name name="ccpp_error_code"
910+
long_name="Error code for error handling in CCPP">
911+
<type kind="" units="1">integer</type>
912+
</standard_name>
913+
</section>
914+
<section name="optional framework-provided variables"
915+
comment="Optional CCPP framework-provided variables">
916+
<standard_name name="scheme_name"
917+
long_name="CCPP physics scheme name">
918+
<type kind="len=64" units="none">character</type>
919+
</standard_name>
920+
<standard_name name="ccpp_constituent_properties"
921+
long_name="CCPP Constituent Properties">
922+
<type kind="" units="none">ccpp_constituent_prop_ptr_t</type>
923+
</standard_name>
924+
<standard_name name="ccpp_constituents"
925+
long_name="Array of constituents managed by CCPP Framework">
926+
<type kind="kind_phys" units="none">real</type>
927+
</standard_name>
928+
<standard_name name="ccpp_constituent_minimum_values"
929+
long_name="CCPP constituent minimum values">
930+
<type kind="kind_phys" units="none">real</type>
931+
</standard_name>
932+
<standard_name name="number_of_ccpp_constituents"
933+
long_name="Number of constituents managed by CCPP Framework">
934+
<type kind="" units="count">integer</type>
935+
</standard_name>
936+
<standard_name name="ccpp_block_count">
937+
<type kind="" units="count">integer</type>
938+
</standard_name>
939+
<standard_name name="ccpp_block_sizes">
940+
<type kind="" units="count">integer</type>
941+
</standard_name>
942+
<standard_name name="ccpp_thread_number"
943+
long_name="Number of current thread block. This variable may only be used during CCPP run phase">
944+
<type units="index">integer</type>
945+
</standard_name>
946+
</section>
937947
</section>
938948
<section name="system variables"
939949
comment="Variables related to the compute environment">
@@ -983,12 +993,6 @@
983993
<standard_name name="sigma_pressure_hybrid_coordinate_b_coefficient">
984994
<type kind="kind_phys" units="1">real</type>
985995
</standard_name>
986-
<standard_name name="ccpp_block_count">
987-
<type kind="" units="count">integer</type>
988-
</standard_name>
989-
<standard_name name="ccpp_block_sizes">
990-
<type kind="" units="count">integer</type>
991-
</standard_name>
992996
<standard_name name="cellular_automata_finer_grid">
993997
<type kind="" units="count">integer</type>
994998
</standard_name>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from collections import OrderedDict
3838

3939
################################################
40-
#Add CCPP framework (lib) modules to python path
40+
# Add lib modules to python path
4141
################################################
4242

4343
_CURR_DIR = os.path.dirname(os.path.abspath(__file__))

tools/check_name_rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import re
1111

1212
################################################
13-
#Add CCPP framework (lib) modules to python path
13+
# Add lib modules to python path
1414
################################################
1515

1616
_CURR_DIR = os.path.dirname(os.path.abspath(__file__))

tools/check_xml_unique.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import copy
1212

1313
################################################
14-
#Add CCPP framework (lib) modules to python path
14+
# Add lib modules to python path
1515
################################################
1616

1717
_CURR_DIR = os.path.dirname(os.path.abspath(__file__))

tools/write_standard_name_table.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import re
1313

1414
################################################
15-
#Add CCPP framework (lib) modules to python path
15+
# Add lib modules to python path
1616
################################################
1717

1818
_CURR_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -63,21 +63,20 @@ def convert_text_to_link(text_str):
6363
def standard_name_to_long_name(prop_dict, context=None):
6464
########################################################################
6565
"""Translate a standard_name to its default long_name
66-
Note: This code is copied from the CCPP Framework.
6766
>>> standard_name_to_long_name({'standard_name':'cloud_optical_depth_layers_from_0p55mu_to_0p99mu'})
6867
'Cloud optical depth layers from 0.55mu to 0.99mu'
6968
>>> standard_name_to_long_name({'local_name':'foo'}) #doctest: +IGNORE_EXCEPTION_DETAIL
7069
Traceback (most recent call last):
71-
CCPPError: No standard name to convert foo to long name
70+
KeyError: No standard name to convert foo to long name
7271
>>> standard_name_to_long_name({}) #doctest: +IGNORE_EXCEPTION_DETAIL
7372
Traceback (most recent call last):
74-
CCPPError: No standard name to convert to long name
73+
KeyError: No standard name to convert to long name
7574
>>> standard_name_to_long_name({'local_name':'foo'}, context=ParseContext(linenum=3, filename='foo.F90')) #doctest: +IGNORE_EXCEPTION_DETAIL
7675
Traceback (most recent call last):
77-
CCPPError: No standard name to convert foo to long name at foo.F90:3
76+
KeyError: No standard name to convert foo to long name at foo.F90:3
7877
>>> standard_name_to_long_name({}, context=ParseContext(linenum=3, filename='foo.F90')) #doctest: +IGNORE_EXCEPTION_DETAIL
7978
Traceback (most recent call last):
80-
CCPPError: No standard name to convert to long name at foo.F90:3
79+
KeyError: No standard name to convert to long name at foo.F90:3
8180
"""
8281
# We assume that standar_name has been checked for validity
8382
# 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):
104103
# end if
105104
ctxt = context_string(context)
106105
emsg = 'No standard name to convert{} to long name{}'
107-
raise CCPPError(emsg.format(lname, ctxt))
106+
raise KeyError(emsg.format(lname, ctxt))
108107
# end if
109108
return long_name
110109

@@ -129,7 +128,7 @@ def parse_command_line(args, description):
129128
def convert_xml_to_markdown(root, library_name, snl):
130129
###############################################################################
131130
snl.write('# {}\n'.format(library_name))
132-
# Write a table of contents
131+
# Write a table of contents for top-level sections
133132
snl.write('#### Table of Contents\n')
134133
for section in root:
135134
sec_name = section.get('name')
@@ -138,15 +137,19 @@ def convert_xml_to_markdown(root, library_name, snl):
138137
# end for
139138
snl.write('\n')
140139
for section in root:
140+
parse_section(snl, section)
141+
142+
###############################################################################
143+
def parse_section(snl, sec, level='##'):
144+
###############################################################################
141145
# Step through the sections
142-
sec_name = section.get('name')
143-
sec_comment = section.get('comment')
144-
snl.write('## {}\n'.format(sec_name))
146+
sec_name = sec.get('name')
147+
sec_comment = sec.get('comment')
148+
snl.write(f'{level} {sec_name}\n')
145149
if sec_comment is not None:
146150
# First, squeeze out the spacing
147151
while sec_comment.find(' ') >= 0:
148152
sec_comment = sec_comment.replace(' ', ' ')
149-
# end while
150153
while sec_comment:
151154
sec_comment = sec_comment.lstrip()
152155
cind = sec_comment.find('\\n')
@@ -159,7 +162,10 @@ def convert_xml_to_markdown(root, library_name, snl):
159162
# end if
160163
# end while
161164
# end if
162-
for std_name in section:
165+
for std_name in sec:
166+
if std_name.tag == 'section':
167+
parse_section(snl, std_name, level + '#')
168+
continue
163169
stdn_name = std_name.get('name')
164170
stdn_longname = std_name.get('long_name')
165171
if stdn_longname is None:

0 commit comments

Comments
 (0)