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

Ccpp release 3 work #100

Merged
merged 46 commits into from
May 30, 2019
Merged

Ccpp release 3 work #100

merged 46 commits into from
May 30, 2019

Conversation

grantfirl
Copy link
Collaborator

@grantfirl grantfirl commented May 14, 2019

This PR constitutes initial preparation for the third CCPP release. The major work was to:

  1. fix how ozone and h2o production and loss was handled (issues Clean up how ozone and h2o data is handled #70 and More cleanup for ozone, h2o, aerosols, and ICCN #94; notes in comment below)
  2. work with the GSD suite (notes in comment below)
  3. update the code to work with the latest ccpp-framework and ccpp-physics
  4. add a python run script (written by @climbfuji with mods by @grantfirl)
  5. open logfiles for writing in gmtb_scm
  6. update the example Theia batch script to SLURM

Other notes:

  • moved physics namelists from scm/etc/case_config directory to ccpp/physics_namelists directory since they are more closely associated with the physics SDFs (also updated to latest corresponding values from FV3)
  • SDFs in ccpp/suites correspond to GFS_v15, GFS_v15plus, CPT_v0, and GSD_v0 (plus *_prescribed_surface versions of each)
  • the NETCDF environment variable must be set prior to running cmake (changed from using fragile NETCDF installation cmake finder module)
  • ccpp_init() call in scm/src/gmtb_scm.F90 expects only the suite name as an argument now (due to changes in ccpp-framework)
  • many changes to scm/src/GFS_typedefs.F90 and gmtb_scm_type_defs.f90 to account for changes to ccpp-physics since the last update and the fractional landmask (note below)

New method for running:
In the run directory, execute:
./run_gmtb_scm.py -c CASE_NAME [-s suite_name] [-n physics_namelist_path] [-g flag to invoke through gdb]

  • the case_name is the only required argument
  • if no suite_name is specified, the default value (SCM_GFS_v15) is used
  • specified suite names must correspond to the names of the suites in the SDFs
  • a default_namelists.py file exists to map SDFs->input namelists, but a user can specify a non-default namelist
  • the output directory path is created from the case name and the suite name automatically unless specified in the case_config file
  • there is no need to specify *_prescribed_surface in the suite name; if sfc_flux_spec is true in the case configuration file, a suite with *_prescribed_surface will automatically be substituted

grantfirl added 11 commits May 1, 2019 21:45
…n oz_phys or oz_phys_2015; add ozone and h2o data files to repo
… call now expects the name of a suite (rather than a path/filename), modified case_configurations namelists to contains names of suites in the physics_suite variable; modified the string passed into ccpp_init() in gmtb_scm.F90; added code to link SDFs from the directory where they are stored to the run directory
…uire that NETCDF environment variable is set (and not using custom CMake find); add SIONLIB to CMakeLists; change me and master to 0 (from 1) to work with SIONLIB stuff in Thompson init
…riables to GFS_typedefs for cellular automata, changes to Init_parm, and lheatstrg
…d SCM host metadata to work with latest ccpp-physics
… couple of compilation errors in GFS_typedefs.F90; fix type in gmtb_scm_physical_constants.f90
grantfirl added 6 commits May 14, 2019 12:06
…ove 'hrrr' from GSD suite; uncomment Tiedtke scheme from prebuild
…s; rename/modify input namelists to reflect values in FV3 and use new suite names; rename and modify case configuration files to use new namelists and suite names; edit 'physics_test' plot configuration file; add MYNN section to GFS_typedefs.F90/control_initialize; add section to gmtb_scm_type_defs.f90/physics_associated for setting fractional landmask fractions
…named case configuration files for arm_sgp_summer_1997_A as a test of prescribed surface suites; added plot_config file to plot
… experiment_config since it contains both information for setting up a case and information for specifiying physics; associated minor code changes to handle path changes
@grantfirl
Copy link
Collaborator Author

Associated PR:
NCAR/ccpp-physics#247

@grantfirl
Copy link
Collaborator Author

grantfirl commented May 20, 2019

Notes on ozone/h2o forcing work:

  • staged 3 data files related to ozone and h2o production and loss (from FV3) into scm/data/GFS_physics_data
  • updated GFS_typedefs.F90 to handle ozone and h2o forcing data like FV3 (also links the appropriate ozone file depending on the ozone scheme chosen)
  • simplified gmtb_scm_setup.F90/GFS_suite_setup for ozone (removed code that was no longer needed)
  • GFS_phys_time_vary_init and GFS_phys_time_vary_run now work like FV3

Note: Since the ozone/h2o production/loss data now works like FV3 (passed via internal module variables), this can only work with multiple independent SCM columns (potentially using different physics) if all independent columns are using the same ozone scheme (and the same ozone production/loss data)

@grantfirl
Copy link
Collaborator Author

grantfirl commented May 20, 2019

Notes on working with GSD suite:

  • On @grantfirl machine, calculating tables for the Thompson MP scheme was taking > 1 day of wall clock time to complete. Since @climbfuji updated the code to be able to read previously calculated data tables for the Thompson MP scheme, reading the tables in (either the binary files or the SION-created file) works much more quickly for running with the Thompson MP scheme in the SCM.
  • SIONlib support was added through adding a stanza to scm/src/CMakeLists.txt; to use SIONlib with SCM, set the SIONLIB environment variable to the path where it is installed prior to running cmake (also copy the .sl file for the Thompson tables into the bin directory before running); address issue Enable SIONlib support in SCM #44
  • If not using SIONlib, binary files (generated on Theia with ifort v18) are available for use with the Thompson scheme. The following files should be downloaded into scm/data/GFS_physics_data prior to running cmake:
    https://dtcenter.org/GMTB/freezeH2O.dat
    https://dtcenter.org/GMTB/qr_acr_qg.dat
    https://dtcenter.org/GMTB/qr_acr_qs.dat

@grantfirl
Copy link
Collaborator Author

grantfirl commented May 20, 2019

The fractional landmask changes from FV3 were integrated into the SCM code. These changes will be reverted in an upcoming PR. This will affect many SDFs, scm/src/GFS_typedefs.F90, scm/src/gmtb_scm_type_defs.f90 (both CCPP metadata and a section in physics%associate that set the fractional landmask fractions).

UPDATE on 5/29/19: these changes will not be reverted anymore.

climbfuji and others added 10 commits May 22, 2019 16:22
…ts; edited ccpp_prebuild_config.py and CCPP metadata to correctly pass in needed variables to Thompson MP to turn ltaerosol on without crashing
Python model run script to simplify Fortran code
…iguration; the run script must be run with a case name; if a suite is specified, it is used, otherwise, a default SDF is chosen; suites run with a default namelist unless specified; the output_dir is constructed automatically unless specified in the case configuration file
…sed in GFS_typedefs.F90 and module_gfdl_cloud_microphys.F90); fixes writing of 'fort.2' to run dir
@grantfirl grantfirl force-pushed the ccpp_release_3_work branch from 9018bde to 8adb1a7 Compare May 29, 2019 20:18
@@ -11,8 +11,8 @@
import sys
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this file will need to be updated to work with the new run script if we want to release this functionality.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this be a follow-up PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, although timing (before/after release) is TBD. A followup PR that will be useful for restoring this functionality in a cleaner way (using your run script) is forthcoming.

@@ -1,15 +1,17 @@
&gfs_physics_nml
fhzero = 6.
h2o_phys = .true.
ldiag3d = .false.
fhcyc = 24.
ldiag3d = .true.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not exactly sure why this is needed, but either way it's not a big deal (unallocated variables otherwise?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ya, the SCM output expects that tendencies are allocated, and they are only allocated in GFS_typedefs if ldiag3d is true.

lradar = .false.
ltaerosol = .true.
lradar = .true.
ttendlim = -999.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The best value we have at GSD at the moment is between 0.005 and 0.008. The FV3 regression tests are using 0.005 since the last PR was merged (https://github.com/NCAR/NEMSfv3gfs/pull/166). Not sure what we should do, keep it as is because it's apparently working without the limiter turned on (have you tried multiple test cases with the GSD suite)? Physically more correct is -999. because it doesn't modify the answer coming out of the microphysics.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that it should probably be consistent with whatever is used in FV3 going forward, although it might be worth a special note in the namelist saying that it can be turned off with -999. I did run all cases with it off, and it didn't crash, although I didn't look carefully at the output either. I'll change it in a followup PR to be consistent with FV3 and other namelist changes if they're coming down the pike.

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Great work, only a few minor comments that shouldn't prevent this PR from going in. See also NCAR/ccpp-physics#247 (review).

@grantfirl grantfirl merged commit 95140c7 into NCAR:master May 30, 2019
@grantfirl grantfirl deleted the ccpp_release_3_work branch June 11, 2019 21:37
@grantfirl grantfirl restored the ccpp_release_3_work branch June 11, 2019 21:37
@grantfirl grantfirl deleted the ccpp_release_3_work branch June 11, 2019 21:37
dustinswales pushed a commit to dustinswales/ccpp-scm that referenced this pull request May 16, 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