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

NoahMP CCPP-compliancy #305

Merged
merged 22 commits into from
Sep 19, 2019
Merged

NoahMP CCPP-compliancy #305

merged 22 commits into from
Sep 19, 2019

Conversation

grantfirl
Copy link
Collaborator

@grantfirl grantfirl commented Aug 24, 2019

Description of changes in ccpp-physics only:

  • added NoahMP scheme files to repo
  • added metadata file for NoahMP entry point
  • minimal CCPP-compliancy stuff (put in module, init/run/finalize)
  • fix some units of surface-related variables (some variables were being converted in GFS_diag so that they had non-canonical units within the CCPP; changed so that conversion is no longer necessary and they have the correct units in the CCPP)
  • add errmsg and errflg for CCPP error handling
  • ifdef WRF error handling out
  • set errmsg, errflg and returns throughout internal NoahMP calling structure
  • send physical constants through the argument list (but see issue NoahMP uses internal constants rather than those provided from host #318 )
  • correct standard name and description of the 'solhr' variable
  • call set_soilveg in noahmpdrv_init (Note: this is also done in lsm_noah_init -- need to do something in common so as not to repeat?)

Interstitials:

  • move calculation of sncovr from FV3GFS_io.F90; this was needed not only because it should not have been done in an I/O routine, but there was a conflict with the namelist_soilveg module from non-CCPP code being used erroneously in the CCPP.
  • this calculation was moved to GFS_phys_time_vary_run because 1) it cannot go into an *_init subroutine since it was originally called after the ccpp_phys_init stage and 2) it needs to be calculated before radiation is called since sncovr is used in radiation (through the GFS sfcprop DDT); this is done during the first time step only!
  • see closed PR Move calculation of sncovr from FV3/io/FV3GFS_io.F90 to ccpp/physics/physics/GFS_phys_time_vary.XYZ.F90 #315 for full details (all changes from that PR were included in this one)
  • remove GFS DDT from GFS_time_vary_pre.F90 and do calculation of julian day there (in run) since it is not domain-dependent
  • move the t2m and q2m "override" into sfc_diag_post
  • calculate precipitation rates used in NoahMP in sfc_noahmp_pre.F90 (but see issue Precipitation rates for NoahMP are likely being calculated in the wrong place #319 )

@grantfirl
Copy link
Collaborator Author

Associated PRs:
NEMSfv3gfs: https://github.com/NCAR/NEMSfv3gfs/pull/227
FV3: https://github.com/NCAR/FV3/pull/192
ccpp-physics: #305

@grantfirl
Copy link
Collaborator Author

Status: Compiles successfully using Theia/Intel, but no attempt to run RTs yet.

@@ -0,0 +1,72 @@
!> \file noahmp_pre.F90
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@climbfuji This code for calculating julian day and the year length was in GFS_physics_driver.F90, so I initially put this code in a NoahMP-specific interstitial scheme, but thinking a bit more, this code does not depend on location (only time), so why couldn't it be put in GFS_time_vary_pre_run where other time-related quantities are calculated to save some CPU cycles?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This sounds like a reasonable idea to me!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, thanks, I'll do that.

…y_pre_run; update GFS_time_vary_pre_run.fv3.F90 to new metadata and remove DDT dependency

if(lsm == lsm_noahmp) then
!GJF* These calculations were originally in GFS_physics_driver.F90 for
! NoahMP. They were moved to this routine since they only depends
Copy link
Collaborator

Choose a reason for hiding this comment

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

I will correct the typo "they only depends" to "they only depend" in my collect-and-test PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For the record - done.

tbot ,zbot ,zsnso ,dzsnso , & !in
tg ,stc ,snowh ,sneqv ,sneqvo ,sh2o , & !inout
smc ,snice ,snliq ,albold ,cm ,ch , & !inout
#ifdef CCPP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just wondering why we need ifdef CCPP in a CCPP physics scheme? Do you want to keep this for comparing it/merging our with code from other/the authoritative repositories/repository?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The ifdef CCPP in all of the code in ccpp-physics for NoahMP was an attempt to try to anticipate these changes going back to an authoritative repo outside of CCPP so that the code could continue to be used as-is outside of the CCPP.

if(fveg <= 0.05) fveg = 0.05
else
write(*,*) "-------- fatal called in sflx -----------"
#ifdef CCPP
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very nice, thanks for making those code changes.

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.

A massive amount of work. I did not check every line in this PR (8439 lines of code in one file alone - nature can't be this complicated).

I left a few notes for the future.

I will pull this PR into a new PR that collects MYJ, NoahMP and other developments and tests them together.

@grantfirl
Copy link
Collaborator Author

Issues #318 and #319 should be addressed in a followup PR sometime when a change in baseline is acceptable.

@climbfuji climbfuji merged commit 69c215f into NCAR:gmtb/develop Sep 19, 2019
hannahcbarnes pushed a commit to hannahcbarnes/ccpp-physics that referenced this pull request Aug 3, 2022
NCAR#305)

* Introduction of CA domain definition.
* Read/Write and restart capability of CA
* Change namelist control parameter so that CA time and space scales are adjusted for various resolutions given the same CA namelist input.
* Significant cleaning of old ideas.
* Improved coupling to cumulus convection.
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