Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/eamxx/cime_config/eamxx_buildnml.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def perform_consistency_checks(case, xml):
>>> case = MockCase({'ATM_NCPL':'24', 'REST_N':2, 'REST_OPTION':'nsteps'})
>>> perform_consistency_checks(case,xml)
Traceback (most recent call last):
CIME.utils.CIMEError: ERROR: rrtmgp::rad_frequency incompatible with restart frequency.
CIME.utils.CIMEError: ERROR: rrtmgp::rad_frequency (3 steps) incompatible with restart frequency (2 steps).
Please, ensure restart happens on a step when rad is ON
>>> case = MockCase({'ATM_NCPL':'24', 'REST_N':10800, 'REST_OPTION':'nseconds'})
>>> perform_consistency_checks(case,xml)
Expand Down Expand Up @@ -970,7 +970,7 @@ def create_input_data_list_file(case,caseroot):
permissions = stat.filemode(file_stat.st_mode)

except Exception as e:
raise RuntimeError(f"Error retrieving file info for '{file_path}': {e}")
raise RuntimeError(f"Error retrieving file info for '{file_path}': {e}") from e

curr_user = getpass.getuser()
user_info = pwd.getpwnam(curr_user)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$CIMEROOT/../components/eamxx/scripts/atmchange --all internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
./xmlchange POSTRUN_SCRIPT="$CIMEROOT/../components/eamxx/scripts/check-hashes-ers"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_SMALL_KERNELS On'
$CIMEROOT/../components/eamxx/scripts/atmchange --all internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_P3_SMALL_KERNELS On'
$CIMEROOT/../components/eamxx/scripts/atmchange --all internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
./xmlchange --append SCREAM_CMAKE_OPTIONS='SCREAM_SHOC_SMALL_KERNELS On'
$CIMEROOT/../components/eamxx/scripts/atmchange --all internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
$CIMEROOT/../components/eamxx/scripts/atmchange ANY::internal_diagnostics_level=1 atmosphere_processes::internal_diagnostics_level=0 -b
25 changes: 22 additions & 3 deletions components/eamxx/docs/user/model_input.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ scoped name, which allows `atmchange` to uniquely identify the XML node to modif
$ ./atmquery homme::number_of_subcycles
namelist_defaults::atmosphere_processes::homme::number_of_subcycles: 1
$ ./atmchange number_of_subcycles=10
ERROR: number_of_subcycles is ambiguous (use --all to change all matches), matches:
ERROR: internal_diagnostics_level is ambiguous. Use ANY in the node path to allow multiple matches. Matches:
namelist_defaults::atmosphere_processes::number_of_subcycles
namelist_defaults::atmosphere_processes::sc_import::number_of_subcycles
namelist_defaults::atmosphere_processes::homme::number_of_subcycles
Expand All @@ -157,6 +157,7 @@ ERROR: number_of_subcycles is ambiguous (use --all to change all matches), match
namelist_defaults::atmosphere_processes::physics::mac_aero_mic::tms::number_of_subcycles
namelist_defaults::atmosphere_processes::physics::mac_aero_mic::shoc::number_of_subcycles
namelist_defaults::atmosphere_processes::physics::mac_aero_mic::cldFraction::number_of_subcycles
namelist_defaults::atmosphere_processes::physics::mac_aero_mic::spa::internal_diagnostics_level
namelist_defaults::atmosphere_processes::physics::mac_aero_mic::p3::number_of_subcycles
namelist_defaults::atmosphere_processes::physics::rrtmgp::number_of_subcycles
namelist_defaults::atmosphere_processes::sc_export::number_of_subcycles
Expand All @@ -167,7 +168,7 @@ $ ./atmquery homme::number_of_subcycles
```

In some cases, the user may be interested in changing _all_ nodes with a given name. In that case,
the `--all` flag can be used:
you can use 'ANY' as a node name:

```shell
$ ./atmquery --grep number_of_subcycles
Expand All @@ -183,7 +184,7 @@ $ ./atmquery --grep number_of_subcycles
p3::number_of_subcycles: 1
rrtmgp::number_of_subcycles: 1
sc_export::number_of_subcycles: 1
$ ./atmchange --all number_of_subcycles=3
$ ./atmchange ANY::number_of_subcycles=3
Regenerating /path/to/namelist_scream.xml. Manual edits will be lost.
$ ./atmquery --grep number_of_subcycles
atmosphere_processes::number_of_subcycles: 3
Expand All @@ -199,6 +200,24 @@ $ ./atmquery --grep number_of_subcycles
rrtmgp::number_of_subcycles: 3
sc_export::number_of_subcycles: 3
```
In addition, "ANY" can be used in a "scoped" string, to limit the set of matches:
```shell
$ ./atmchange mac_aero_mic::ANY::number_of_subcycles=1
Regenerating /path/to/namelist_scream.xml. Manual edits will be lost.
$ ./atmquery --grep number_of_subcycles
atmosphere_processes::number_of_subcycles: 3
sc_import::number_of_subcycles: 3
homme::number_of_subcycles: 3
physics::number_of_subcycles: 3
mac_aero_mic::number_of_subcycles: 1
tms::number_of_subcycles: 1
shoc::number_of_subcycles: 1
cldFraction::number_of_subcycles: 1
spa::number_of_subcycles: 1
p3::number_of_subcycles: 1
rrtmgp::number_of_subcycles: 3
sc_export::number_of_subcycles: 3
```

Since the XML file stores constraints on the parameter value (like its type or valid values), attempting to use the
wrong type will cause an error:
Expand Down
Loading