Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/core_atmosphere/Externals.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[MMM-physics]
local_path = ./physics_mmm
protocol = git
repo_url = https://github.com/NCAR/MMM-physics.git
tag = 20250616-MPASv8.3
repo_url = https://github.com/songyou184/MMM-physics.git
branch =MMM2026-SFCLAY
required = True

[GSL_UGWP]
Expand Down
8 changes: 8 additions & 0 deletions src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,14 @@
units="s"
description="Relaxation time to initial values in 1-d OML"
possible_values="Non-negative real values"/>
<nml_option name="config_kim_tofd" type="logical" default_value="true" in_defaults="true"
units="-"
description="Tubulent orographic form drag (tofd) in kim_gwdo scheme"
possible_values="true. or .false."/>
<nml_option name="config_tofd_factor" type="real" default_value="0.003" in_defaults="false"
units="-"
description="Factor in kim_tofd scheme"
possible_values="Non-negative real values"/>
</nml_record>

<var_struct name="diag_physics" time_levs="1">
Expand Down
18 changes: 15 additions & 3 deletions src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ subroutine allocate_sfclayer(configs)
if(.not.allocated(v10_p) ) allocate(v10_p(ims:ime,jms:jme) )
if(.not.allocated(wspd_p) ) allocate(wspd_p(ims:ime,jms:jme) )
if(.not.allocated(xland_p) ) allocate(xland_p(ims:ime,jms:jme) )
if(.not.allocated(var2d_p) ) allocate(var2d_p(ims:ime,jms:jme) )
if(.not.allocated(zol_p) ) allocate(zol_p(ims:ime,jms:jme) )
if(.not.allocated(znt_p) ) allocate(znt_p(ims:ime,jms:jme) )

Expand Down Expand Up @@ -277,6 +278,7 @@ subroutine deallocate_sfclayer(configs)
if(allocated(v10_p) ) deallocate(v10_p )
if(allocated(wspd_p) ) deallocate(wspd_p )
if(allocated(xland_p) ) deallocate(xland_p )
if(allocated(var2d_p) ) deallocate(var2d_p )
if(allocated(zol_p) ) deallocate(zol_p )
if(allocated(znt_p) ) deallocate(znt_p )

Expand Down Expand Up @@ -369,7 +371,7 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)

real(kind=RKIND),pointer:: len_disp
real(kind=RKIND),dimension(:),pointer:: meshDensity
real(kind=RKIND),dimension(:),pointer:: skintemp,sst,xice,xland
real(kind=RKIND),dimension(:),pointer:: skintemp,sst,xice,xland,var2d
real(kind=RKIND),dimension(:),pointer:: hpbl,mavail
real(kind=RKIND),dimension(:),pointer:: br,cpm,chs,chs2,cqs2,flhc,flqc,gz1oz0,hfx,qfx, &
qgh,qsfc,lh,mol,psim,psih,regime,rmol,ust,ustm, &
Expand All @@ -393,6 +395,7 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
call mpas_pool_get_array(diag_physics,'mavail' ,mavail )
call mpas_pool_get_array(sfc_input ,'skintemp',skintemp)
call mpas_pool_get_array(sfc_input ,'xland' ,xland )
call mpas_pool_get_array(sfc_input ,'var2d' ,var2d )

!inout variables:
call mpas_pool_get_array(diag_physics,'br' ,br )
Expand Down Expand Up @@ -427,6 +430,7 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
mavail_p(i,j) = mavail(i)
tsk_p(i,j) = skintemp(i)
xland_p(i,j) = xland(i)
var2d_p(i,j) = var2d(i)

!inout variables:
br_p(i,j) = br(i)
Expand Down Expand Up @@ -852,12 +856,14 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite

!local pointers:
logical,pointer:: config_do_restart,config_frac_seaice
logical,pointer:: config_kim_tofd
character(len=StrKIND),pointer:: sfclayer_scheme
real(kind=RKIND),dimension(:),pointer:: areaCell

!local variables:
integer:: initflag
real(kind=RKIND):: dx
real(kind=RKIND), pointer :: tofd_factor

!CCPP-compliant flags:
character(len=StrKIND):: errmsg
Expand All @@ -874,6 +880,8 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite
call mpas_pool_get_config(configs,'config_do_restart' ,config_do_restart )
call mpas_pool_get_config(configs,'config_frac_seaice' ,config_frac_seaice)
call mpas_pool_get_config(configs,'config_sfclayer_scheme',sfclayer_scheme )
call mpas_pool_get_config(configs,'config_kim_tofd' ,config_kim_tofd )
call mpas_pool_get_config(configs,'config_tofd_factor' ,tofd_factor)

call mpas_pool_get_array(mesh,'areaCell',areaCell)

Expand Down Expand Up @@ -963,7 +971,9 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite
xland = xland_p , hfx = hfx_p , qfx = qfx_p , &
lh = lh_p , tsk = tsk_p , flhc = flhc_p , &
flqc = flqc_p , qgh = qgh_p , qsfc = qsfc_p , &
rmol = rmol_p , u10 = u10_p , v10 = v10_p , &
rmol = rmol_p , var2d = var2d_p , u10 = u10_p , &
if_kim_tofd = config_kim_tofd, tofd_factor = tofd_factor , &
v10 = v10_p , &
th2 = th2m_p , t2 = t2m_p , q2 = q2_p , &
gz1oz0 = gz1oz0_p , wspd = wspd_p , br = br_p , &
isfflx = isfflx , dx = dx_p , svp1 = svp1 , &
Expand Down Expand Up @@ -993,7 +1003,9 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite
xland = xland_sea , hfx = hfx_sea , qfx = qfx_sea , &
lh = lh_sea , tsk = tsk_sea , flhc = flhc_sea , &
flqc = flqc_sea , qgh = qgh_sea , qsfc = qsfc_sea , &
rmol = rmol_sea , u10 = u10_sea , v10 = v10_sea , &
rmol = rmol_sea , var2d = var2d_p , u10 = u10_sea , &
if_kim_tofd = config_kim_tofd, tofd_factor = tofd_factor , &
v10 = v10_sea , &
th2 = th2m_sea , t2 = t2m_sea , q2 = q2_sea , &
gz1oz0 = gz1oz0_sea , wspd = wspd_sea , br = br_sea , &
isfflx = isfflx , dx = dx_p , svp1 = svp1 , &
Expand Down
12 changes: 9 additions & 3 deletions src/core_atmosphere/physics/physics_wrf/module_sf_sfclayrev.F
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ subroutine sfclayrev(u3d,v3d,t3d,qv3d,p3d,dz8w, &
znt,ust,pblh,mavail,zol,mol,regime,psim,psih, &
fm,fh, &
xland,hfx,qfx,lh,tsk,flhc,flqc,qgh,qsfc,rmol, &
u10,v10,th2,t2,q2, &
var2d,u10,v10,th2,t2,q2, &
gz1oz0,wspd,br,isfflx,dx, &
svp1,svp2,svp3,svpt0,ep1,ep2, &
karman,p1000mb,lakemask, &
if_kim_tofd,tofd_factor, &
ids,ide,jds,jde,kds,kde, &
ims,ime,jms,jme,kms,kme, &
its,ite,jts,jte,kts,kte, &
Expand All @@ -45,9 +46,12 @@ subroutine sfclayrev(u3d,v3d,t3d,qv3d,p3d,dz8w, &
real(kind=kind_phys),intent(in):: ep1,ep2,karman
real(kind=kind_phys),intent(in):: p1000mb
real(kind=kind_phys),intent(in):: cp,g,rovcp,r,xlv
real(kind=kind_phys),intent(in):: tofd_factor
logical ,intent(in):: if_kim_tofd

real(kind=kind_phys),intent(in),dimension(ims:ime,jms:jme):: &
dx, &
var2d, &
mavail, &
pblh, &
psfc, &
Expand Down Expand Up @@ -125,7 +129,7 @@ subroutine sfclayrev(u3d,v3d,t3d,qv3d,p3d,dz8w, &
dz_hv,u_hv,v_hv,qv_hv,p_hv,t_hv

real(kind=kind_phys),dimension(its:ite):: &
lh_hv,u10_hv,v10_hv,th2_hv,t2_hv,q2_hv
lh_hv,var2d_hv,u10_hv,v10_hv,th2_hv,t2_hv,q2_hv
real(kind=kind_phys),dimension(its:ite):: &
ck_hv,cka_hv,cd_hv,cda_hv

Expand Down Expand Up @@ -157,6 +161,7 @@ subroutine sfclayrev(u3d,v3d,t3d,qv3d,p3d,dz8w, &
xland_hv(i) = xland(i,j)
lakemask_hv(i) = lakemask(i,j)
water_depth_hv(i) = water_depth(i,j)
var2d_hv(i) = var2d(i,j)

do k = kts,kte
dz_hv(i,k) = dz8w(i,k,j)
Expand Down Expand Up @@ -209,8 +214,9 @@ subroutine sfclayrev(u3d,v3d,t3d,qv3d,p3d,dz8w, &
rmol=rmol_hv,znt=znt_hv,ust=ust_hv,mavail=mavail_hv, &
zol=zol_hv,mol=mol_hv,regime=regime_hv,psim=psim_hv, &
psih=psih_hv,fm=fm_hv,fh=fh_hv,xland=xland_hv,lakemask=lakemask_hv, &
hfx=hfx_hv,qfx=qfx_hv,tsk=tsk_hv,u10=u10_hv, &
hfx=hfx_hv,qfx=qfx_hv,tsk=tsk_hv,varf=var2d_hv,u10=u10_hv, &
v10=v10_hv,th2=th2_hv,t2=t2_hv,q2=q2_hv,flhc=flhc_hv, &
if_kim_tofd=if_kim_tofd,tofd_factor=tofd_factor, &
flqc=flqc_hv,qgh=qgh_hv,qsfc=qsfc_hv,lh=lh_hv, &
gz1oz0=gz1oz0_hv,wspd=wspd_hv,br=br_hv,isfflx=l_isfflx,dx=dx_hv, &
svp1=svp1,svp2=svp2,svp3=svp3,svpt0=svpt0,ep1=ep1,ep2=ep2,karman=karman, &
Expand Down