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 initialization of surface related variables #217

Merged
merged 14 commits into from
Dec 8, 2020

Conversation

grantfirl
Copy link
Collaborator

@grantfirl grantfirl commented Dec 3, 2020

This PR accomplishes the following:

This represents a major rewrite of surface variable initialization to address the above issues and make future maintenance easier.

UFS_IC_generator.py

  • reads in ALL variables from surface file (as opposed to only some) following what is done in FV3GFS_io.F90; if variables are not present in the file, it will still write out the variable with values equal to a user-configurable missing value
  • handles all Noah LSM, RUC LSM, NoahMP LSM, and NSST variables
  • handles new fractional landmask and lake variables in the 'oro' files
  • outputs all variables (including missing ones)

gmtb_scm_input.F90

  • reads in all new variables output by UFS_IC_generator.py
  • utilizes new NetCDF_read_var module to handle missing data

gmtb_scm_type_defs.F90

  • removes redundant variables in the 'state' DDT introduced when UFS ICs were originally added
  • adds new variables to 'input' DDT only
  • new "set" type-bound procedure for the physics DDT (should be used only for initialization of physics variables that doesn't happen in the ccpp_physics_init stage; should NOT be used for variables that are associated with pointers that can be modified/forced outside of the physics by the SCM)
  • updated "associate" type-bound procedure of physics DDT to only have pointer association for variables that get modified/forced by SCM (specifically surface temperature logic)
  • new "set" routine conditionally sets Sfcprop variables, depending on missing data (will STOP if variables are required but missing)
  • includes logic from FV3/io/FV3GFS_io.F90 to deriving surface variables (related to fractional landmask, lake, NSST, NoahMP, and RUC LSM)
  • includes NoahMP "cold start" logic when NoahMP is active and Noah LSM input data is present, but NoahMP input data is missing

gmtb_scm_utils.F90

  • new NetCDF read module with generic interfaces for reading variables or setting to missing
  • new module for quality controlling variables or stopping if encountering missing values for required variables

gmtb_scm.F90

  • includes call to new physics%set routine after the physics%associate call

… in new variables in gmtb_scm_input (using new subroutines); have not propagated new variables outside of the input subroutine yet though
… for surface variables (set physics vars directly from input, rather than using the state DDT as a middleman; read in all new variables; separate setting of physics variables between physics_associate and physics_set, the former is used for variables that the SCM forcing may change outside of physics and use pointers, while the latter merely sets the initial values of variables
…or checking for missing data; add code to handle missing data (abort or not) in physics_set (only got through scalar variables as of this commit)
…ug in gmtb_scm_input related specified surface fluxes; fix associating surface_skin_temperature with forcing temperature for specified surface flux cases; update plot_config to use data from supported suites
…le pointer; update GFS_typedefs.[F90/meta] for latest ccpp/physics; add metadata for newly required physical constant; fix logic for testing for missing data for stc/slc/smc
@grantfirl
Copy link
Collaborator Author

Testing was done for:

  • existing specified surface flux cases (fixes issue noticed by @wangevine)
  • existing cases with simple ocean
  • existing UFS IC cases (also tested with IC files that have fractional landmask and lake data, but not RUC data yet)

Note to GSL folks @climbfuji @tanyasmirnova This PR should pave the way for testing with the RUC LSM. If there are FV3 IC files somewhere (after processing by global_chgres) that have RUC LSM variables, I could test it.

@climbfuji
Copy link
Collaborator

climbfuji commented Dec 7, 2020 via email

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.

I don't claim to understand or to have reviewed line by line the surface initialization, but at least I didn't see anything obviously wrong. Some of the new netCDF routines could have been collapsed into fewer by using elemental functions/subroutines, but the current implementation is fine.

scm/src/gmtb_scm.F90 Outdated Show resolved Hide resolved
scm/src/CMakeLists.txt Outdated Show resolved Hide resolved
@grantfirl grantfirl merged commit ca4c3bc into NCAR:master Dec 8, 2020
dustinswales pushed a commit to dustinswales/ccpp-scm that referenced this pull request May 16, 2022
Update initialization of surface related variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants