Skip to content
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

Update scm_vgrid and UI #307

Merged
merged 9 commits into from
Apr 11, 2022
Merged

Update scm_vgrid and UI #307

merged 9 commits into from
Apr 11, 2022

Conversation

grantfirl
Copy link
Collaborator

@grantfirl grantfirl commented Mar 10, 2022

This pull request addresses the following issues and discussions:

Objective 1: update the vertical grid code to match the latest FV3 code and improve vertical coordinate usability

  • update scm_vgrid.F90 to match changes in FV3's fv_eta.F90
  • like FV3, put hard-coded ak/bk coefficients in fv_eta.h and bring the file in via include
  • remove old get_GFS_vgrid code -- not needed anymore since one can read files containing ak/bk coefficients in get_FV3_vgrid
  • remove "model_name" case configuration namelist variable since it is no longer needed; only get_FV3_vgrid should ever need to be called
  • remove n_levels from case config files (will use the default value unless one passes in an argument to the run script)
  • modify the run_scm.py script to take arguments of --levels, --npz_type, and --vert_coord_file
  • modify the multi_run_scm.py script to take the same arguments and pass them through to run_scm.py
  • set default npz_type to '' and --levels to 127 in scm_input.F90
  • set the path to the vertical coordinate date directory (for file reads) in run_scm.py

Implications:

  • Change the number of vertical levels by specifying them via the --levels (or -l) argument of the run_scm.py script (or multi_run_scm.py script); the default is now 127 levels
  • Set the --npz_type argument of the run scripts to use any of the npz_type options in scm_vgrid.F90; the default is npz_type = ''
  • To read in the ak/bk coefficients, set the npz_type command line argument to 'input', put a file with format specified in scm_vgrid.F90 into data/vert_coord_data, and specify the name of the file via the command line argument --vert_coord_file

Objective 2: Since we needed to modify all case configuration files, use this opportunity to clean up all unnecessary case configuration namelist options

  • remove n_columns option (since only 1 works right now anyway)
  • remove time_scheme (since we only really need to use Forward-Euler timestepping for forcing)
  • move dt, n_itt_out, and n_itt_diag to command line arguments for the run script since these aren't really tied to the cases anyway (should make it easier to modify these values on the fly)
  • set default values for n_itt_out and n_itt_diag in run_scm.py
  • set default value of dt according to the suite (since this is usually a function of the physics, or should be)
  • add a maximum value of dt according to the suite (and exit if user tries to use one bigger than the max)
  • remove 'output' namelist variable (user won't need to change the name of the file if run directories are correctly set up)
  • move 'case_data_dir' to a run script command line argument; the default is set to data/processed_case_input (where case data is currently stored), but setting the command line argument will tell the run script where to look for the data if it is elsewhere (e.g., in data/DEPHY-SCM)

Objective 3: Clean up suite defaults

  • remove default_tracers.py and default_namelists.py
  • add suite_info.py with new 'suite' class and default suite-based information

Objective 4: Add flexibility for output location

  • separate the build directory and run directory by default
  • modify the run script to set up a run directory outside the build directory (scm/run by default), controlled by the --run_dir command line argument
  • modify rt.sh to work with the changes in run_scm.py
  • add --runtime_mult command line argument to run script to replace running all SCM regression tests for a hard-coded number of seconds. This variable (if less than 1) reduces the runtime for each case, which is useful for regression testing.
  • require users to set SCM_ROOT environment variable to point to the top level ccpp-scm directory prior to running run_scm.py in order facilitate maximally-flexible run directory (and output) location

…ll need to add more passthrough args for multi_run_scm.py and check operation of rt.sh; also update all case configuration files to get rid of unused namelist vars
…c variables; edit rt.sh to work with new run script; add runtime_mult argument
@grantfirl grantfirl marked this pull request as ready for review March 14, 2022 21:43
Copy link
Collaborator

@mkavulich mkavulich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been quite the learning experience! Please feel free to argue against any suggested changes that you don't feel are appropriate, this has been my first time really digging in to the depths of the SCM in detail. And let me know if you have any follow-up questions.

scm/src/run_scm.py Show resolved Hide resolved
scm/src/suite_info.py Show resolved Hide resolved
test/rt.sh Outdated Show resolved Hide resolved
scm/src/suite_info.py Outdated Show resolved Hide resolved
scm/src/run_scm.py Outdated Show resolved Hide resolved
scm/src/scm_input.F90 Show resolved Hide resolved
scm/src/run_scm.py Show resolved Hide resolved
scm/src/run_scm.py Outdated Show resolved Hide resolved
scm/src/run_scm.py Show resolved Hide resolved
test/rt.sh Outdated Show resolved Hide resolved
@grantfirl
Copy link
Collaborator Author

@mkavulich Thanks for the review. I've addressed the comments. Would you mind taking another look?

Copy link
Collaborator

@mkavulich mkavulich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I forgot to hit the "Approve" button earlier! Thanks for your comments and answering my questions.

@grantfirl grantfirl merged commit ee2dc88 into NCAR:main Apr 11, 2022
mkavulich pushed a commit that referenced this pull request May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants