Skip to content

Commit

Permalink
sync model with ccpp version
Browse files Browse the repository at this point in the history
  • Loading branch information
uturuncoglu committed Dec 21, 2023
1 parent eb2e047 commit f25293d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/ccpp/noahmpdrv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ subroutine noahmpdrv_run &
integer :: iopt_pedo = 1 ! option for pedotransfer function
integer :: iopt_crop = 0 ! option for crop model
integer :: iopt_gla = 2 ! option for glacier treatment
integer :: iopt_z0m = 2 ! option for z0m treatment
integer :: iopt_z0m = 1 ! option for z0m treatment

!
! --- local inputs to noah-mp and glacier subroutines; listed in order in noah-mp call
Expand Down
5 changes: 3 additions & 2 deletions drivers/ccpp/physcons.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

!> This module contains some of the most frequently used math and physics
!! constants for GCM models.
module physcons
module physcons
!
use machine, only: kind_phys, kind_dyn
!
Expand All @@ -44,7 +44,7 @@ module physcons
!> \name Math constants
! real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 !< pi
real(kind=kind_phys),parameter:: con_pi =4.0d0*atan(1.0d0) !< pi
real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0_kind_phys !< square root of 2
real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0_kind_phys !< square root of 2
real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0_kind_phys !< quare root of 3

!> \name Geophysics/Astronomy constants
Expand Down Expand Up @@ -97,6 +97,7 @@ module physcons
real(kind=kind_phys),parameter:: con_dldt =con_cvap-con_cliq
real(kind=kind_phys),parameter:: con_xpona =-con_dldt/con_rv
real(kind=kind_phys),parameter:: con_xponb =-con_dldt/con_rv+con_hvap/(con_rv*con_ttp)
real(kind=kind_phys),parameter:: con_1ovg = 1._kind_phys/con_g

!> \name Other Physics/Chemistry constants (source: 2002 CODATA)
real(kind=kind_phys),parameter:: con_c =2.99792458e+8_kind_phys !< speed of light (\f$m/s\f$)
Expand Down
2 changes: 1 addition & 1 deletion src/module_sf_noahmp_glacier.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2652,7 +2652,7 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in

!to obtain equilibrium state of snow in glacier region

if(sneqv > mwd) then ! 100 mm -> maximum water depth
if(sneqv > mwd .and. isnow /= 0) then ! 100 mm -> maximum water depth
bdsnow = snice(0) / dzsnso(0)
snoflow = (sneqv - mwd)
snice(0) = snice(0) - snoflow
Expand Down
15 changes: 9 additions & 6 deletions src/module_sf_noahmplsm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in
! thermal properties of soil, snow, lake, and frozen soil

call thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , & !in
dt ,snowh ,snice ,snliq , & !in
dt ,snowh ,snice ,snliq , shdfac, & !in
smc ,sh2o ,tg ,stc ,ur , & !in
lat ,z0m ,zlvl ,vegtyp , & !in
df ,hcpct ,snicev ,snliqv ,epore , & !out
Expand Down Expand Up @@ -2463,7 +2463,7 @@ end subroutine energy

!>\ingroup NoahMP_LSM
subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , & !in
dt ,snowh ,snice ,snliq , & !in
dt ,snowh ,snice ,snliq , shdfac, & !in
smc ,sh2o ,tg ,stc ,ur , & !in
lat ,z0m ,zlvl ,vegtyp , & !in
df ,hcpct ,snicev ,snliqv ,epore , & !out
Expand All @@ -2480,6 +2480,7 @@ subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso ,
real (kind=kind_phys) , intent(in) :: dt !< time step [s]
real (kind=kind_phys), dimension(-nsnow+1: 0), intent(in) :: snice !< snow ice mass (kg/m2)
real (kind=kind_phys), dimension(-nsnow+1: 0), intent(in) :: snliq !< snow liq mass (kg/m2)
real (kind=kind_phys) , intent(in) :: shdfac !< green vegetation fraction [0.0-1.0]
real (kind=kind_phys), dimension(-nsnow+1:nsoil), intent(in) :: dzsnso !< thickness of snow/soil layers [m]
real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: smc !< soil moisture (ice + liq.) [m3/m3]
real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: sh2o !< liquid soil moisture [m3/m3]
Expand Down Expand Up @@ -2539,6 +2540,7 @@ subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso ,
! not in use because of the separation of the canopy layer from the ground.
! but this may represent the effects of leaf litter (niu comments)
! df1 = df1 * exp (sbeta * shdfac)
df(1) = df(1) * exp (sbeta * shdfac)

! compute lake thermal properties
! (no consideration of turbulent mixing for this version)
Expand Down Expand Up @@ -4888,7 +4890,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , &
end if
endif ! 4

! use sfc_diag to calculate t2mv and q2v for opt_sfc=1&3
! use sfc_diag to calculate t2mb and q2b for opt_sfc=1&3
if(opt_diag ==3) then
if(opt_sfc == 1 .or. opt_sfc == 3) then

Expand Down Expand Up @@ -5823,7 +5825,8 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl,

elseif (opt_trs == chen09) then

z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg))
! z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg))
z0m_out = fveg * z0m + (1.0 - fveg) * z0mg
czil = 10.0 ** (- 0.4 * parameters%hvt)

reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c
Expand Down Expand Up @@ -5873,15 +5876,15 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl,

z0h_out = z0m_out

elseif (opt_trs == tessel) then
elseif (opt_trs == chen09 .or. opt_trs == tessel) then

if (vegtyp <= 5) then
z0h_out = z0m_out
else
z0h_out = z0m_out * 0.01
endif

elseif (opt_trs == blumel99 .or. opt_trs == chen09) then
elseif (opt_trs == blumel99) then

reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c
if (reyn > 2.0) then
Expand Down

0 comments on commit f25293d

Please sign in to comment.