From 3f4245f511c5090285eea72e7b81c40e060762f7 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 2 Jul 2026 11:43:08 -0600 Subject: [PATCH 1/3] Update rules for logical/control variables based on proposal in issue #101 --- StandardNamesRules.rst | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/StandardNamesRules.rst b/StandardNamesRules.rst index 9212b6a..5ec7c01 100644 --- a/StandardNamesRules.rst +++ b/StandardNamesRules.rst @@ -195,9 +195,29 @@ Terminology relevant, the net ionization charge should be included as a prefix (in words, because +/- are not valid standard name characters); e.g. ``number_density_of_plus_1_ionized_he`` -#. For control-oriented variables, if the variable is a Fortran logical, - use flag_for ``_X``. If it is any other data type, use control_for ``_X``. All flags - should be Fortran logicals. +#. For control-oriented variables, there are a few different prefixes that should be used depending on + the use case for that specific variable: + + +-------------------+-----------+-----------------------------------------------------------------------------------------------+ + | **Prefix** | **Type** | **Use case** | **Example** | + +===================+===========+=================================+=============================================================+ + | `flag_for_` | `logical` | A flag indicating some state or | `flag_for_mpi_root` indicates whether or not the code is | + | | | condition is true or false | running on the MPI root process | + +-------------------+-----------+-------------------------------- +-------------------------------------------------------------+ + | `do_` | `logical` | A flag whose value directs some | `do_chemical_tracer_diagnostics` indicates to a physics | + | | | behavior | scheme that it should compute chemical tracer diagnostics | + +-------------------+-----------+---------------------------------+-------------------------------------------------------------+ + | `identifier_for_` | `integer` | A parameter indicating some | `identifier_for_noah_land_surface_scheme` is an integer | + | | | state or condition | identifying the Noah land surface model | + +-------------------+-----------+---------------------------------+-------------------------------------------------------------+ + | `control_for_` | `integer` | A control whose value directs | `control_for_land_surface_scheme` is an integer identifying | + | | | some behavior | the land surface scheme type | + +-------------------+-----------+---------------------------------+-------------------------------------------------------------+ + | `index_of_` | `integer` | An index entry for an array | `index_of_ice_vegetation_category` is an index describing | + | | | | the location of the ice vegetation category in the array of | + | | | | vegetation categories | + +-------------------+-----------+---------------------------------+-------------------------------------------------------------+ + #. **Disallowed terms:** A few terms are disallowed as standard name components for various reasons; mostly due to ambiguity. From ce304f91a3f4d1ef1ade98f19fdd114a5b3f7b95 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 2 Jul 2026 11:49:19 -0600 Subject: [PATCH 2/3] Update names for new rules --- Metadata-standard-names.md | 16 ++++++++-------- Metadata-standard-names.yaml | 32 ++++++++++++++++---------------- standard_names.xml | 24 ++++++++++++------------ 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/Metadata-standard-names.md b/Metadata-standard-names.md index 1d7cab8..5cec658 100644 --- a/Metadata-standard-names.md +++ b/Metadata-standard-names.md @@ -375,6 +375,8 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `integer`: units = 1 * `equation_of_time`: Apparent solar time minus mean solar time * `real`: units = radian +* `flag_for_first_timestep`: Indicates whether the current timestep is the first timestep + * `logical`: units = flag * `forecast_julian_day`: Forecast julian day * `real`: units = days * `forecast_time_in_seconds`: Forecast time in seconds @@ -385,8 +387,6 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `real`: units = h * `index_of_timestep`: Index of timestep * `integer`: units = index -* `is_first_timestep`: Is first timestep - * `logical`: units = flag * `number_of_days_in_current_year`: Number of days in current year * `integer`: units = days * `time_elapsed_since_diagnostics_reset`: Time elapsed since diagnostics reset @@ -472,6 +472,8 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `real`: units = m s-1 * `eastward_wind_at_surface`: Wind vector component closest to surface, positive when directed eastward * `real`: units = m s-1 +* `flag_for_initialized_physics_grid`: Flag to indicate if physics grid is initialized + * `logical`: units = flag * `geopotential_at_interfaces`: Geopotential at interfaces * `real`: units = m2 s-2 * `geopotential_at_surface`: Geopotential at surface @@ -492,8 +494,6 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `horizontal_velocity_potential_of_air`: Scalar potential of the horizontal wind * Equivalent CF name: `atmosphere_horizontal_velocity_potential` * `real`: units = m2 s-1 -* `is_initialized_physics_grid`: Flag to indicate if physics grid is initialized - * `logical`: units = flag * `largest_model_top_pressure_that_allows_molecular_diffusion`: Largest model top pressure that allows molecular diffusion * `real`: units = Pa * `ln_air_pressure`: Ln air pressure @@ -1303,8 +1303,6 @@ Variables that indicate or control some action. * `integer`: units = 1 * `control_for_vertical_index_direction`: control flag for direction of vertical index; 0 indicates index from toa to surface, 1 indicates index from surface to toa * `integer`: units = 1 -* `disable_precipitation_radiative_effect`: Disable precipitation radiative effect - * `logical`: units = flag * `do_aerosol_physics`: Do aerosol physics * `logical`: units = flag * `do_allow_supersaturation_after_sedimentation`: Do allow supersaturation after sedimentation @@ -1347,6 +1345,8 @@ Variables that indicate or control some action. * `logical`: units = flag * `do_diagnostics`: Do diagnostics * `logical`: units = flag +* `do_disable_precipitation_radiative_effect`: Do disable precipitation radiative effect + * `logical`: units = flag * `do_dominant_precipitation_type_partition`: Do dominant precipitation type partition * `logical`: units = flag * `do_flip`: Flag indicating whether to flip vertical coordinate @@ -1551,6 +1551,8 @@ Variables that indicate or control some action. * `logical`: units = flag * `do_ysu_pbl_scheme`: Do Yonsei University (YSU) planetary boundary layer scheme * `logical`: units = flag +* `flag_for_restart`: Flag indicating whether or not this is a restart run + * `logical`: units = flag * `identifier_for_2018_scale_aware_tke_moist_edmf_pbl`: Identifier for 2018 scale-aware turbulent kinetic energy moist eddy-diffusivity/mass-flux planetary boundary layer scheme * `integer`: units = 1 * `identifier_for_2019_scale_aware_tke_moist_edmf_pbl`: Identifier for 2019 scale-aware turbulent kinetic energy moist eddy-diffusivity/mass-flux planetary boundary layer scheme @@ -1609,8 +1611,6 @@ Variables that indicate or control some action. * `integer`: units = 1 * `identifier_for_zhao_carr_pdf_microphysics_scheme`: Identifier for Zhao-Carr probability density function microphysics scheme * `integer`: units = 1 -* `is_restart`: Is restart - * `logical`: units = flag ## Indices Values indicating the index of some array or other data structure * `cumulative_max_vertical_index_at_cloud_base_between_sw_radiation_calls`: Cumulative maximum vertical index at cloud base between shortwave radiation calls diff --git a/Metadata-standard-names.yaml b/Metadata-standard-names.yaml index 72cff48..a94ca35 100644 --- a/Metadata-standard-names.yaml +++ b/Metadata-standard-names.yaml @@ -711,6 +711,10 @@ section: description: Apparent solar time minus mean solar time type: real units: radian + - name: flag_for_first_timestep + description: Indicates whether the current timestep is the first timestep + type: logical + units: flag - name: forecast_julian_day description: Forecast julian day type: real @@ -731,10 +735,6 @@ section: description: Index of timestep type: integer units: index - - name: is_first_timestep - description: Is first timestep - type: logical - units: flag - name: number_of_days_in_current_year description: Number of days in current year type: integer @@ -906,6 +906,10 @@ section: eastward type: real units: m s-1 + - name: flag_for_initialized_physics_grid + description: Flag to indicate if physics grid is initialized + type: logical + units: flag - name: geopotential_at_interfaces description: Geopotential at interfaces type: real @@ -944,10 +948,6 @@ section: description: Scalar potential of the horizontal wind type: real units: m2 s-1 - - name: is_initialized_physics_grid - description: Flag to indicate if physics grid is initialized - type: logical - units: flag - name: largest_model_top_pressure_that_allows_molecular_diffusion description: Largest model top pressure that allows molecular diffusion type: real @@ -2642,10 +2642,6 @@ section: toa to surface, 1 indicates index from surface to toa type: integer units: 1 - - name: disable_precipitation_radiative_effect - description: Disable precipitation radiative effect - type: logical - units: flag - name: do_aerosol_physics description: Do aerosol physics type: logical @@ -2730,6 +2726,10 @@ section: description: Do diagnostics type: logical units: flag + - name: do_disable_precipitation_radiative_effect + description: Do disable precipitation radiative effect + type: logical + units: flag - name: do_dominant_precipitation_type_partition description: Do dominant precipitation type partition type: logical @@ -3158,6 +3158,10 @@ section: description: Do Yonsei University (YSU) planetary boundary layer scheme type: logical units: flag + - name: flag_for_restart + description: Flag indicating whether or not this is a restart run + type: logical + units: flag - name: identifier_for_2018_scale_aware_tke_moist_edmf_pbl description: Identifier for 2018 scale-aware turbulent kinetic energy moist eddy-diffusivity/mass-flux planetary boundary layer scheme @@ -3279,10 +3283,6 @@ section: scheme type: integer units: 1 - - name: is_restart - description: Is restart - type: logical - units: flag - name: Indices comment: Values indicating the index of some array or other data structure standard_names: diff --git a/standard_names.xml b/standard_names.xml index c3a41db..a3c058f 100644 --- a/standard_names.xml +++ b/standard_names.xml @@ -529,6 +529,9 @@ real + + logical + real @@ -544,9 +547,6 @@ integer - - logical - integer @@ -672,6 +672,9 @@ real + + logical + real @@ -701,9 +704,6 @@ atmosphere_horizontal_velocity_potential real - - logical - real @@ -1901,9 +1901,6 @@ integer - - logical - logical @@ -1967,6 +1964,9 @@ logical + + logical + logical @@ -2273,6 +2273,9 @@ logical + + logical + integer @@ -2360,9 +2363,6 @@ integer - - logical -
From 87cc8cbe420f701f729d37d3bc7f5eac65db9137 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 7 Jul 2026 15:09:51 -0600 Subject: [PATCH 3/3] Prefer "is_" over "flag_for_" per PR review --- Metadata-standard-names.md | 16 ++++++++-------- Metadata-standard-names.yaml | 32 ++++++++++++++++---------------- StandardNamesRules.rst | 9 +++++---- standard_names.xml | 24 ++++++++++++------------ 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/Metadata-standard-names.md b/Metadata-standard-names.md index 5cec658..17540bf 100644 --- a/Metadata-standard-names.md +++ b/Metadata-standard-names.md @@ -375,8 +375,6 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `integer`: units = 1 * `equation_of_time`: Apparent solar time minus mean solar time * `real`: units = radian -* `flag_for_first_timestep`: Indicates whether the current timestep is the first timestep - * `logical`: units = flag * `forecast_julian_day`: Forecast julian day * `real`: units = days * `forecast_time_in_seconds`: Forecast time in seconds @@ -387,6 +385,8 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `real`: units = h * `index_of_timestep`: Index of timestep * `integer`: units = index +* `is_first_timestep`: Indicates whether the current timestep is the first timestep + * `logical`: units = flag * `number_of_days_in_current_year`: Number of days in current year * `integer`: units = days * `time_elapsed_since_diagnostics_reset`: Time elapsed since diagnostics reset @@ -472,8 +472,6 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `real`: units = m s-1 * `eastward_wind_at_surface`: Wind vector component closest to surface, positive when directed eastward * `real`: units = m s-1 -* `flag_for_initialized_physics_grid`: Flag to indicate if physics grid is initialized - * `logical`: units = flag * `geopotential_at_interfaces`: Geopotential at interfaces * `real`: units = m2 s-2 * `geopotential_at_surface`: Geopotential at surface @@ -494,6 +492,8 @@ Variables defining or relating to timing, dates, calendar, and related concepts * `horizontal_velocity_potential_of_air`: Scalar potential of the horizontal wind * Equivalent CF name: `atmosphere_horizontal_velocity_potential` * `real`: units = m2 s-1 +* `is_initialized_physics_grid`: Flag to indicate if physics grid is initialized + * `logical`: units = flag * `largest_model_top_pressure_that_allows_molecular_diffusion`: Largest model top pressure that allows molecular diffusion * `real`: units = Pa * `ln_air_pressure`: Ln air pressure @@ -1099,12 +1099,12 @@ Variables related to the compute environment, properties of variables, input/out * `character`: units = none * `filename_of_rrtmgp_shortwave_k_distribution`: File name of Rapid Radiative Transfer Model for General circulation model applications - Parallel (RRTMGP) shortwave k-distribution * `character`: units = none -* `flag_for_mpi_root`: Flag for MPI root process - * `logical`: units = flag * `iounit_of_log`: Iounit of log * `integer`: units = 1 * `iounit_of_namelist`: Iounit of namelist * `integer`: units = 1 +* `is_mpi_root`: Flag for MPI root process + * `logical`: units = flag * `log_output_unit`: Fortran logical unit for output log file * `integer`: units = 1 * `map_of_block_column_number_to_global_i_index`: Map of block column number to global i index @@ -1551,8 +1551,6 @@ Variables that indicate or control some action. * `logical`: units = flag * `do_ysu_pbl_scheme`: Do Yonsei University (YSU) planetary boundary layer scheme * `logical`: units = flag -* `flag_for_restart`: Flag indicating whether or not this is a restart run - * `logical`: units = flag * `identifier_for_2018_scale_aware_tke_moist_edmf_pbl`: Identifier for 2018 scale-aware turbulent kinetic energy moist eddy-diffusivity/mass-flux planetary boundary layer scheme * `integer`: units = 1 * `identifier_for_2019_scale_aware_tke_moist_edmf_pbl`: Identifier for 2019 scale-aware turbulent kinetic energy moist eddy-diffusivity/mass-flux planetary boundary layer scheme @@ -1611,6 +1609,8 @@ Variables that indicate or control some action. * `integer`: units = 1 * `identifier_for_zhao_carr_pdf_microphysics_scheme`: Identifier for Zhao-Carr probability density function microphysics scheme * `integer`: units = 1 +* `is_restart`: Flag indicating whether or not this is a restart run + * `logical`: units = flag ## Indices Values indicating the index of some array or other data structure * `cumulative_max_vertical_index_at_cloud_base_between_sw_radiation_calls`: Cumulative maximum vertical index at cloud base between shortwave radiation calls diff --git a/Metadata-standard-names.yaml b/Metadata-standard-names.yaml index a94ca35..8b5152c 100644 --- a/Metadata-standard-names.yaml +++ b/Metadata-standard-names.yaml @@ -711,10 +711,6 @@ section: description: Apparent solar time minus mean solar time type: real units: radian - - name: flag_for_first_timestep - description: Indicates whether the current timestep is the first timestep - type: logical - units: flag - name: forecast_julian_day description: Forecast julian day type: real @@ -735,6 +731,10 @@ section: description: Index of timestep type: integer units: index + - name: is_first_timestep + description: Indicates whether the current timestep is the first timestep + type: logical + units: flag - name: number_of_days_in_current_year description: Number of days in current year type: integer @@ -906,10 +906,6 @@ section: eastward type: real units: m s-1 - - name: flag_for_initialized_physics_grid - description: Flag to indicate if physics grid is initialized - type: logical - units: flag - name: geopotential_at_interfaces description: Geopotential at interfaces type: real @@ -948,6 +944,10 @@ section: description: Scalar potential of the horizontal wind type: real units: m2 s-1 + - name: is_initialized_physics_grid + description: Flag to indicate if physics grid is initialized + type: logical + units: flag - name: largest_model_top_pressure_that_allows_molecular_diffusion description: Largest model top pressure that allows molecular diffusion type: real @@ -2221,10 +2221,6 @@ section: model applications - Parallel (RRTMGP) shortwave k-distribution type: character units: none - - name: flag_for_mpi_root - description: Flag for MPI root process - type: logical - units: flag - name: iounit_of_log description: Iounit of log type: integer @@ -2233,6 +2229,10 @@ section: description: Iounit of namelist type: integer units: 1 + - name: is_mpi_root + description: Flag for MPI root process + type: logical + units: flag - name: log_output_unit description: Fortran logical unit for output log file type: integer @@ -3158,10 +3158,6 @@ section: description: Do Yonsei University (YSU) planetary boundary layer scheme type: logical units: flag - - name: flag_for_restart - description: Flag indicating whether or not this is a restart run - type: logical - units: flag - name: identifier_for_2018_scale_aware_tke_moist_edmf_pbl description: Identifier for 2018 scale-aware turbulent kinetic energy moist eddy-diffusivity/mass-flux planetary boundary layer scheme @@ -3283,6 +3279,10 @@ section: scheme type: integer units: 1 + - name: is_restart + description: Flag indicating whether or not this is a restart run + type: logical + units: flag - name: Indices comment: Values indicating the index of some array or other data structure standard_names: diff --git a/StandardNamesRules.rst b/StandardNamesRules.rst index 5ec7c01..6a1373f 100644 --- a/StandardNamesRules.rst +++ b/StandardNamesRules.rst @@ -201,8 +201,8 @@ Terminology +-------------------+-----------+-----------------------------------------------------------------------------------------------+ | **Prefix** | **Type** | **Use case** | **Example** | +===================+===========+=================================+=============================================================+ - | `flag_for_` | `logical` | A flag indicating some state or | `flag_for_mpi_root` indicates whether or not the code is | - | | | condition is true or false | running on the MPI root process | + | `is_` | `logical` | A flag indicating some state or | `is_mpi_root` indicates whether or not the code is running | + | | | condition is true or false | on the MPI root process | +-------------------+-----------+-------------------------------- +-------------------------------------------------------------+ | `do_` | `logical` | A flag whose value directs some | `do_chemical_tracer_diagnostics` indicates to a physics | | | | behavior | scheme that it should compute chemical tracer diagnostics | @@ -455,7 +455,9 @@ Prefixes | upper_bound_of | unfiltered | nonnegative -| flag_for +| is +| do +| identifier_for | control_for | number_of | index_of @@ -478,7 +480,6 @@ Infixes ^^^^^^^ | directory_for ``_X`` _source_code -| flag_for_reading ``_X`` _from_input Suffixes ^^^^^^^^ diff --git a/standard_names.xml b/standard_names.xml index a3c058f..9fbb94e 100644 --- a/standard_names.xml +++ b/standard_names.xml @@ -529,9 +529,6 @@ real - - logical - real @@ -547,6 +544,9 @@ integer + + logical + integer @@ -672,9 +672,6 @@ real - - logical - real @@ -704,6 +701,9 @@ atmosphere_horizontal_velocity_potential real + + logical + real @@ -1596,15 +1596,15 @@ character - - logical - integer integer + + logical + integer @@ -2273,9 +2273,6 @@ logical - - logical - integer @@ -2363,6 +2360,9 @@ integer + + logical +