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

Lsm upgrades for p8c #873

Merged
merged 43 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4cbea92
set up option for thermal roughness
Jan 30, 2022
22de66b
change czil
Jan 31, 2022
10fa17e
canopy height dependant czil
Feb 16, 2022
b90d4e2
add canopy heat storage and gvf impact on thermal conductivity
HelinWei-NOAA Mar 7, 2022
ae7ac42
add sfcdif3 as a separate subroutine
barlage Mar 7, 2022
c50f50a
change fveg to shdfac in sfcdif3 vege call
barlage Mar 7, 2022
53c0c7a
move trs options to sfcdif3
barlage Mar 7, 2022
f093f77
fix missing czil1 in vege_flux
barlage Mar 7, 2022
13a1d14
add some clean up to energy
barlage Mar 8, 2022
ebb4fa1
add some groundwater mods from ncar code
barlage Mar 8, 2022
b6e0573
Merge pull request #17 from barlage/sfcdif3_subroutine
HelinWei-NOAA Mar 8, 2022
41cf4ec
gvf impact on thermal conductivity limited to the first soil layer
HelinWei-NOAA Mar 8, 2022
b43c030
Merge pull request #18 from barlage/sfcdif3_subroutine
HelinWei-NOAA Mar 8, 2022
c1d813e
correct the reference height
HelinWei-NOAA Mar 8, 2022
2ae3f48
Merge branch 'NCAR:main' into lsm_upgrades_for_p8c
HelinWei-NOAA Mar 9, 2022
11b50ca
to read new hig-res ice climatology data
HelinWei-NOAA Mar 9, 2022
4ed3982
replace fveg by lai/laimax to be used for dependent
HelinWei-NOAA Mar 10, 2022
8e1b316
simplify the code with internal function maxval
HelinWei-NOAA Mar 10, 2022
70507a0
to avoid exception floating point
HelinWei-NOAA Mar 10, 2022
d33598b
revert the df1 change due to some negative impact on surface temperature
HelinWei-NOAA Mar 11, 2022
3095d71
correct the condition to avoid a divide by zero exception
HelinWei-NOAA Mar 14, 2022
27ea849
further refinement of the impact of vegetation on zvfun
HelinWei-NOAA Mar 15, 2022
c722905
replace shdfac by fveg for zvfun
HelinWei-NOAA Mar 16, 2022
4284846
modify the eddy diffusivity for heat at the top of the canopy
wzzheng90 Mar 18, 2022
4aa59df
Noah MP driver and meta changes for MYNN
RongqianYang-NOAA Mar 18, 2022
c58e849
Noah MP glacier changes for MYNN
RongqianYang-NOAA Mar 18, 2022
56142b2
Noah MP non-glacier changes for MYNN
RongqianYang-NOAA Mar 18, 2022
f3af80f
tuning cd/lm parameter
wzzheng90 Mar 20, 2022
96f58e0
tuning cd/lm parameter
wzzheng90 Mar 20, 2022
7fa7223
revert back to shdfac in gvfun calculation due to occasional model crash
HelinWei-NOAA Mar 20, 2022
99c241b
Merge branch 'NCAR:main' into lsm_upgrades_for_p8c
HelinWei-NOAA Mar 20, 2022
779b323
modify a table of cwp parameter
wzzheng90 Mar 21, 2022
09e4f95
modify a table of cwp parameter
wzzheng90 Mar 21, 2022
0b7879c
modify a table of cwp parameter
wzzheng90 Mar 21, 2022
109dcdf
modify a table of cwp parameter
wzzheng90 Mar 21, 2022
c8d6545
Merge pull request #21 from wzzheng90/soil_veg_atm_coupling
HelinWei-NOAA Mar 21, 2022
726f4a6
Driver update, opt_trs=4 over vegetation, and z0hover bare soil etc.
RongqianYang-NOAA Mar 23, 2022
81a326a
put a upper/lower limit on cwpc
HelinWei-NOAA Mar 24, 2022
02a4c05
Merge branch 'lsm_upgrades_MYNN_for_p8c' into lsm_upgrades_for_p8c
RongqianYang-NOAA Mar 24, 2022
7a16e21
Revert "Lsm upgrades mynn for p8c"
HelinWei-NOAA Mar 24, 2022
2150803
Merge pull request #22 from HelinWei-NOAA/revert-20-lsm_upgrades_MYNN…
HelinWei-NOAA Mar 24, 2022
bf92390
Merge branch 'NCAR:main' into lsm_upgrades_for_p8c
HelinWei-NOAA Mar 25, 2022
8f3c084
fix the missing value of fv in vege_flux
HelinWei-NOAA Mar 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions physics/module_sf_noahmp_glacier.f90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module noahmp_glacier_globals
INTEGER :: OPT_GLA != 1 !(suggested 1)

INTEGER :: OPT_SFC != 1 !(suggested 1)
INTEGER :: OPT_TRS != 1 !(suggested 2)

! adjustable parameters for snow processes

Expand Down Expand Up @@ -1129,8 +1130,10 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso
real (kind=kind_phys) :: b !< temporary calculation
real (kind=kind_phys) :: t, tdc !< kelvin to degree celsius with limit -50 to +50
real (kind=kind_phys), dimension( 1:nsoil) :: sice !< soil ice
real (kind=kind_phys) :: czil !< calculate roughness length of heat

tdc(t) = min( 50., max(-50.,(t-tfrz)) )
czil=0.1

! -----------------------------------------------------------------
! initialization variables that do not depend on stability iteration
Expand All @@ -1155,10 +1158,18 @@ subroutine glacier_flux (nsoil ,nsnow ,emg ,isnow ,df ,dzsnso
fv = ur*vkc/log(zlvli/z0m)
reyni = fv*z0m/(1.5e-05) !introduction of fv dependent z0h for the iter

if (reyni .gt. 2.0) then
z0h = z0m/exp(2.46*(reyni)**0.25 - log(7.4)) !Brutsaert 1982
else
z0h = z0m/exp(-log(0.397)) !Brusaert 1982, table 4
if (opt_trs == 1) then
z0h = z0m
elseif (opt_trs == 2) then
z0h = z0m*exp(-czil*0.4*258.2*sqrt(fv*z0m))
elseif (opt_trs == 3) then
z0h = z0m*0.1
elseif (opt_trs == 4) then
if (reyni .gt. 2.0) then
z0h = z0m/exp(2.46*(reyni)**0.25 - log(7.4)) !Brutsaert 1982
else
z0h = z0m/exp(-log(0.397)) !Brusaert 1982, table 4
endif
endif

z0h_total = z0h
Expand Down Expand Up @@ -3328,7 +3339,8 @@ end subroutine error_glacier
! ==================================================================================================

!>\ingroup NoahMP_LSM
subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iopt_gla, iopt_sfc)
subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iopt_gla,&
iopt_sfc, iopt_trs)

implicit none

Expand All @@ -3339,6 +3351,7 @@ subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iop
!! 1 -> semi-implicit; 2 -> full implicit (original noah)
integer, intent(in) :: iopt_gla !< glacier option (1->phase change; 2->simple)
integer, intent(in) :: iopt_sfc !< sfc scheme option
integer, intent(in) :: iopt_trs !< thermal roughness option

! -------------------------------------------------------------------------------------------------

Expand All @@ -3348,6 +3361,7 @@ subroutine noahmp_options_glacier(iopt_alb ,iopt_snf ,iopt_tbot, iopt_stc, iop
opt_stc = iopt_stc
opt_gla = iopt_gla
opt_sfc = iopt_sfc
opt_trs = iopt_trs

end subroutine noahmp_options_glacier

Expand Down
765 changes: 345 additions & 420 deletions physics/module_sf_noahmplsm.f90

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions physics/noahmp_tables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,11 @@ module noahmp_tables

!
real :: cwpvt_table(mvt) !< empirical canopy wind parameter
data ( cwpvt_table (i),i=1,mvt) / 0.18, 0.67, 0.18, 0.67, 0.29, 1.00, &
& 2.00, 1.30, 1.00, 5.00, 1.17, 1.67, &
& 1.67, 1.67, 0.18, 0.18, 0.18, 0.67, &
& 1.00, 0.18, 0.00, 0.00, 0.00, 0.00, &
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 /
data ( cwpvt_table (i),i=1,mvt) / 0.09, 0.335, 0.09, 0.335, 0.145, 0.50, &
& 1.00, 0.65, 0.50, 2.50, 0.585, 0.835, &
& 0.835, 0.835, 0.09, 0.09, 0.09, 0.335, &
& 0.50, 0.09, 0.00, 0.00, 0.00, 0.00, &
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 /


real :: wrrat_table(mvt) !< wood to non-wood ratio
Expand Down
12 changes: 11 additions & 1 deletion physics/sfc_diag_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end subroutine sfc_diag_post_finalize
!!
#endif
subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con_epsm1, pgr,&
t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, &
t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, &
wind10mmax, u10mmax, v10mmax, dpt2m, errmsg, errflg)

use machine, only: kind_phys
Expand All @@ -29,6 +29,7 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con
logical , dimension(:), intent(in) :: dry
real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m
real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax
real(kind=kind_phys), dimension(:), intent(inout) :: t2mmp, q2mp
real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m

character(len=*), intent(out) :: errmsg
Expand All @@ -41,6 +42,15 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con
errmsg = ''
errflg = 0

! if (lsm == lsm_noahmp) then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was this used for testing? Does it still need to be here, or can this code be removed and the subroutine interface reverted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using these two from the Noah-MP is still an option in the future. So we want to put them back from the our last PR.

! do i=1,im
! if(dry(i)) then
! t2m(i) = t2mmp(i)
! q2m(i) = q2mp(i)
! endif
! enddo
! endif

if (lssav) then
do i=1,im
tmpmax(i) = max(tmpmax(i),t2m(i))
Expand Down
16 changes: 16 additions & 0 deletions physics/sfc_diag_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@
type = real
kind = kind_phys
intent = in
[t2mmp]
standard_name = temperature_at_2m_from_noahmp
long_name = 2 meter temperature from noahmp
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = out
[q2mp]
standard_name = specific_humidity_at_2m_from_noahmp
long_name = 2 meter specific humidity from noahmp
units = kg kg-1
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = out
[t2m]
standard_name = air_temperature_at_2m
long_name = 2 meter temperature
Expand Down
14 changes: 8 additions & 6 deletions physics/sfc_noahmp_drv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ subroutine noahmpdrv_run &
shdmin, shdmax, snoalb, sfalb, flag_iter,con_g, &
idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, &
iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, &
iopt_stc, xlatin, xcoszin, iyrlen, julian, garea, &
iopt_stc, iopt_trs,xlatin, xcoszin, iyrlen, julian, garea, &
rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, &
con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, &
con_fvirt, con_rd, con_hfus, thsfc_loc, &
Expand Down Expand Up @@ -213,6 +213,7 @@ subroutine noahmpdrv_run &
integer , intent(in) :: iopt_snf ! option for partitioning precipitation into rainfall & snowfall
integer , intent(in) :: iopt_tbot ! option for lower boundary condition of soil temperature
integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1)
integer , intent(in) :: iopt_trs ! option for thermal roughness scheme
real(kind=kind_phys), dimension(:) , intent(in) :: xlatin ! latitude
real(kind=kind_phys), dimension(:) , intent(in) :: xcoszin ! cosine of zenith angle
integer , intent(in) :: iyrlen ! year length [days]
Expand Down Expand Up @@ -700,8 +701,8 @@ subroutine noahmpdrv_run &

call noahmp_options(idveg ,iopt_crs, iopt_btr , iopt_run, iopt_sfc, &
iopt_frz, iopt_inf , iopt_rad, iopt_alb, &
iopt_snf, iopt_tbot, iopt_stc, &
iopt_rsf, iopt_soil, iopt_pedo, iopt_crop )
iopt_snf, iopt_tbot, iopt_stc, iopt_rsf, &
iopt_soil,iopt_pedo, iopt_crop,iopt_trs )

if ( vegetation_category == isice_table ) then

Expand All @@ -714,7 +715,8 @@ subroutine noahmpdrv_run &
ice_flag = -1
temperature_soil_bot = min(temperature_soil_bot,263.15)

call noahmp_options_glacier(iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_gla, iopt_sfc )
call noahmp_options_glacier(iopt_alb, iopt_snf, iopt_tbot, iopt_stc, iopt_gla, &
iopt_sfc ,iopt_trs)

call noahmp_glacier ( &
i_location ,1 ,cosine_zenith ,nsnow , &
Expand Down Expand Up @@ -921,7 +923,7 @@ subroutine noahmpdrv_run &
snowc (i) = snow_cover_fraction
sncovr1 (i) = snow_cover_fraction

! qsurf (i) = spec_humidity_surface
qsurf (i) = spec_humidity_surface
tsurf (i) = tskin(i)

tvxy (i) = temperature_leaf
Expand Down Expand Up @@ -996,7 +998,7 @@ subroutine noahmpdrv_run &
cmm (i) = cmxy(i) * wind(i)

snwdph (i) = snow_depth * 1000.0 ! convert from m to mm; wait after the stability call
qsurf (i) = q1(i) + evap(i)/(con_hvap*density*ch(i)*wind(i))
! qsurf (i) = q1(i) + evap(i)/(con_hvap*density*ch(i)*wind(i))

!
! --- change units for output
Expand Down
7 changes: 7 additions & 0 deletions physics/sfc_noahmp_drv.meta
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,13 @@
dimensions = ()
type = integer
intent = in
[iopt_trs]
standard_name = control_for_land_surface_scheme_surface_thermal_roughness
long_name = choice for surface thermal roughness option (see noahmp module for definition)
units = index
dimensions = ()
type = integer
intent = in
[xlatin]
standard_name = latitude
long_name = latitude
Expand Down
2 changes: 1 addition & 1 deletion physics/sfcsub.F
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module sfccyc_module
integer, parameter :: kpdalf(2)=(/214,217/)
!
real (kind=kind_io8), parameter :: ten=10.0, one=1.0, zero=0.0
integer, parameter :: xdata=5000, ydata=2500, mdata=xdata*ydata
integer, parameter :: xdata=7200, ydata=3600, mdata=xdata*ydata
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
integer :: veg_type_landice
integer :: soil_type_landice
integer :: num_threads
Expand Down