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

Move Noah MP init to CCPP and update Noah MP code #575

Merged
merged 15 commits into from Mar 3, 2021

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Feb 21, 2021

This PR does several things:

  1. Move the Noah MP initialization of surface fields from fv3atm (io/FV3GFS_io.F90) to CCPP from @climbfuji. This was done consistently with the previous move of the Noah initialization to GFS_phys_time_vary for the following two reasons:

    • several of the Noah MP fields may be required by other physics that run before Noah MP (order in the suite definition file)
    • per issue Reorganization of "time_vary" interstitials #549, we are looking at reorganizing the entire time_vary group in the near future anyway
  2. Updates to Noah MP and Noah MP - radiation coupling from @HelinWei-NOAA

  3. Contains the changes from Initialize ice flux in CMEPSA bug fix. "flag_cice" used to be a proxy for "not 1st time step cold… #563 (Initialize ice flux in CMEPSA bug fix) from @shansun6

Associated PRs:

#575
NOAA-EMC/fv3atm#249
ufs-community/ufs-weather-model#425

For regression testing, see ufs-community/ufs-weather-model#425.

ShanSunNOAA and others added 6 commits February 4, 2021 04:28
… start" in NEMS, but is no longer the case in CMEPS. It is now replaced by "kdt>1". This will change results in all coupled models.

Co-authored-by: ben.green@noaa.gov
…dard names in physics/GFS_phys_time_vary.fv3.meta and physics/sfc_noahmp_drv.meta
@climbfuji climbfuji changed the title Move Noah MP init to CCPP Move Noah MP init to CCPP and update Noah MP code Feb 21, 2021
tgxy(ix) = tsfcl(ix)
tahxy(ix) = tsfcl(ix)

if (snowd(ix) > 0.01 .and. tsfcl(ix) > con_t0c ) tvxy(ix) = con_t0c
Copy link
Collaborator

Choose a reason for hiding this comment

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

should these various float factors be set to _kind_phys at this time? Or we can address this when this gets moved to the noahmp module later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@barlage I made this change for all reals used in the NoahMP init in commit f2d2b12 - do you want to check if this is what you had in mind, please?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@climbfuji looks good to me

@@ -725,7 +735,7 @@ module noahmp_tables
real :: refkdt_table = 3.0 !parameter in the surface runoff parameterization
real :: frzk_table =0.15 !frozen ground parameter
real :: zbot_table = -8.0 !depth [m] of lower boundary soil temperature
real :: czil_table = 0.075 !parameter used in the calculation of the roughness length for heat
real :: czil_table = 0.01 !parameter used in the calculation of the roughness length for heat
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HelinWei-NOAA currently, this isn't used for the noahmp options we use, but this is too low, probably should have been 0.1

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this isn't used now, we can change those values with the future PR for Rongqian's sfcdiff modification.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Anything you want me to change?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@climbfuji see PR to your branch

real(kind=kind_phys), parameter :: a4 = 35.86
real(kind=kind_phys), parameter :: a23m4 = a2*(a3-a4)

real, parameter :: undefined = -1.e36 ! TODO change to smaller value
Copy link
Collaborator

Choose a reason for hiding this comment

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

@climbfuji @HelinWei-NOAA I didn't realize all these noahmp updates were going in at this time; there are a few unfinished TODOs in here, they should not cause any problems but we will want to address them in a follow-up PR, if not now.

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, so no changes to make for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@climbfuji Dom - is there a ccpp undefined value? I would like to change this to a lower magnitude value because it causes problems when using nco to calculate totals. If there is a ccpp value we can use it or I will set it to a smaller value.

Copy link
Collaborator

Choose a reason for hiding this comment

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

should we set it to the missing_value = 9.99e20_r8 used in other places?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I essentially did that here:

barlage@98f53cf

@@ -0,0 +1,1529 @@
#define CCPP
Copy link
Collaborator

Choose a reason for hiding this comment

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

@HelinWei-NOAA I see this doesn't use the new name for this file. Was that intentional?

Copy link
Collaborator

Choose a reason for hiding this comment

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

just try to be consistent with other drivers: sfc_drv_ruc.F90, sfc_drv.f, sfc_sice.f,sfc_ocean.F, and sfc_nst.f. All start with sfc

Copy link
Collaborator

Choose a reason for hiding this comment

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

then we should probably call it sfc_drv_noahmp

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@barlage can you please clarify? I see

!>  \file sfc_noahmp_drv.F90

which is consistent with the name of the file. Or did you want to rename the file althogether? Or do when we move to your external repository?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@climbfuji sorry for the cryptic message; when I first did the driver rewrite, I had a different name for this file but Helin changed it. I was trying to make the naming follow some logic but there are several other cases where names are not logical so let's just keep it for now.

@HelinWei-NOAA
Copy link
Collaborator

HelinWei-NOAA commented Feb 25, 2021 via email

@climbfuji
Copy link
Collaborator Author

climbfuji commented Feb 25, 2021 via email

@climbfuji
Copy link
Collaborator Author

@barlage @HelinWei-NOAA @shansun6 Can I please ask you to look at the code changes again and approve, if satisfied? It's our turn in the commit queue today. @shansun6 I pulled your PR #563 into this PR. Thanks!

@ShanSunNOAA
Copy link
Collaborator

ShanSunNOAA commented Mar 1, 2021 via email

real, parameter :: rw = 461.269 !gas constant for water vapor (j/kg/k)
real, parameter :: denh2o = 1000. !density of water (kg/m3)
real, parameter :: denice = 917. !density of ice (kg/m3)
real (kind=kind_phys), parameter :: grav = 9.80616 !acceleration due to gravity (m/s2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unless there is a good reason for NoahMP to be defining its own physical constants, they should come through the CCPP where possible.

real, parameter :: rw = 461.269 !gas constant for water vapor (j/kg/k)
real, parameter :: denh2o = 1000. !density of water (kg/m3)
real, parameter :: denice = 917. !density of ice (kg/m3)
real (kind=kind_phys), parameter :: grav = 9.80616 !acceleration due to gravity (m/s2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comment WRT physical constants. Perhaps can be addressed in a followup PR at some point if all the testing has already been done.

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, these will need to go in an issue and become a follow-up PRs, baselines already created on a few platforms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Recorded here: #582

Copy link
Collaborator

Choose a reason for hiding this comment

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

This physics code will be tied to the Noah-MP repository in the future #551 so CCPP will not have any control of this. We would need to work with the Noah-MP community to resolve this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We'll need to make sure that there are ways to set the constants via the argument list when using Noah MP in CCPP, and at the same time cater for other options. There are ways to do this, it's not a problem. But we cannot have each scheme define its own (and maybe slightly different) gravitational acceleration, pi, ...

Copy link
Collaborator

@grantfirl grantfirl Mar 1, 2021

Choose a reason for hiding this comment

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

To be clear, I'm talking about a subset of the physical constants defined here. In particular, grav, sb, vkc, tfrz, hsub, hvap, hfus, cwat, cice, cpair, rair, rw, and denh2o are all defined by existing CCPP host models. And by "going through the CCPP", I'm referring to physics using physical constants defined by the host model so that all physics using them can use a consistent set. Otherwise, if every scheme has its own value of gravity, specific heats, etc., this introduces a lot of inconsistencies. If other users of the NoahMP repository require the scheme to define its own physical constants, then we need to figure out a solution that works for everybody. One solution would be to define a NoahMP specific constants module. If using the CCPP, during the init phase of the scheme, we could pass in the physical constants from the host and set the constants in the NoahMP-specific constants module inside. If NOT using the CCPP, one could use pre-defined values in the NoahMP-specific module and not overwrite them in the init phase.

@SMoorthi-emc
Copy link
Collaborator

This is not good. there has to be a unified way of specifying constants. Every component cannot have it's own physical constants defined. This is bad.

@climbfuji
Copy link
Collaborator Author

This is not good. there has to be a unified way of specifying constants. Every component cannot have it's own physical constants defined. This is bad.

Agreed, and it will be fixed. It also violates the CCPP requirements.

@barlage
Copy link
Collaborator

barlage commented Mar 1, 2021

Let's move this discussion to #582.

@climbfuji climbfuji merged commit fb731c5 into NCAR:master Mar 3, 2021
@climbfuji climbfuji deleted the noahmp_init_in_ccpp branch June 27, 2022 03:20
HelinWei-NOAA pushed a commit to HelinWei-NOAA/ccpp-physics that referenced this pull request Feb 26, 2023
)

* update ccpp-physics hash: update surface net heat fluxes for AQM coupling
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.

None yet

6 participants