Skip to content

Commit 37f1cb3

Browse files
jherweheldfowler58
authored andcommitted
Add the Pleim surface layer scheme to MPAS-A
This EPA_PXsfclay commit will add the Pleim surface layer scheme (Pleim, 2006) to MPAS-A as a new "config_sfclayer_scheme" option called "sf_pxsfclay". The Pleim surface layer scheme code (module_sf_pxsfclay.F) was migrated from WRFV4.4.1 with only minor changes and has been generalized to work with either MPAS or WRF. Note that this implementation of the Pleim surface layer in MPAS-A does not yet support fractional sea ice, in contrast to the other available surface layer schemes. The Pleim surface layer works with any LSM or PBL scheme, but is normally used in conjunction with the PX LSM and the ACM2 PBL. Refer to the description in the WRF-ARW technical document available at https://opensky.ucar.edu/islandora/object/opensky:2898 for an overview of the physics behind this option. New file: src/core_atmosphere/physics/physics_wrf/module_sf_pxsfclay.F Modified files: Makefile src/core_atmosphere/Registry.xml src/core_atmosphere/physics/mpas_atmphys_control.F src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F src/core_atmosphere/physics/physics_wrf/Makefile These EPA_PXsfclay code changes to MPAS-A are based on the 22 August 2022 "develop" branch of MPAS v7.3. Reference: Pleim, J. E., 2006: A simple, efficient solution of flux-profile relationships in the atmospheric surface layer, J. Appl. Meteor. Climatol., 45, 341347, https://doi.org/10.1175/JAM2339.1.
1 parent 4c3682e commit 37f1cb3

6 files changed

Lines changed: 707 additions & 13 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ intel-mpi: # BUILDTARGET Intel compiler suite with Intel MPI library
360360
"CC_SERIAL = icc" \
361361
"CXX_SERIAL = icpc" \
362362
"FFLAGS_PROMOTION = -real-size 64" \
363-
"FFLAGS_OPT = -O3 -convert big_endian -free -align array64byte" \
364-
"CFLAGS_OPT = -O3" \
365-
"CXXFLAGS_OPT = -O3" \
363+
"FFLAGS_OPT = -O3 -xBROADWELL -fma -fp-model precise -traceback -no-wrap-margin -convert big_endian -free -align array64byte" \
364+
"CFLAGS_OPT = -O3 -xBROADWELL -fma -fp-model precise -traceback" \
365+
"CXXFLAGS_OPT = -O3 -xBROADWELL -fma -fp-model precise -traceback" \
366366
"LDFLAGS_OPT = -O3" \
367-
"FFLAGS_DEBUG = -g -convert big_endian -free -CU -CB -check all -fpe0 -traceback" \
367+
"FFLAGS_DEBUG = -g -convert big_endian -free -CU -CB -check all -fpe0 -traceback -no-wrap-margin" \
368368
"CFLAGS_DEBUG = -g -traceback" \
369369
"CXXFLAGS_DEBUG = -g -traceback" \
370370
"LDFLAGS_DEBUG = -g -fpe0 -traceback" \
@@ -779,7 +779,7 @@ ifneq "$(LAPACK)" ""
779779
endif
780780

781781
RM = rm -f
782-
CPP = cpp -P -traditional
782+
CPP = ${CXX_SERIAL} -E # Modified for use with the Intel C++ compiler
783783
RANLIB = ranlib
784784

785785
ifdef CORE
@@ -998,7 +998,7 @@ ifeq "$(findstring clean, $(MAKECMDGOALS))" "clean" # CHECK FOR CLEAN TARGET
998998
override AUTOCLEAN=false
999999
endif # END OF CLEAN TARGET CHECK
10001000

1001-
VER=$(shell git describe --dirty 2> /dev/null)
1001+
VER="v7.3.develop.EPA_PXsfclay" # Hard-coded specific version identifier
10021002
#override CPPFLAGS += -DMPAS_GIT_VERSION=$(VER)
10031003

10041004
ifeq "$(findstring v, $(VER))" "v"

src/core_atmosphere/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,7 @@
20692069
<nml_option name="config_sfclayer_scheme" type="character" default_value="suite" in_defaults="false"
20702070
units="-"
20712071
description="configuration for surface layer-scheme"
2072-
possible_values="`suite',`sf_monin_obukhov',`sf_mynn',`off'"/>
2072+
possible_values="`suite',`sf_monin_obukhov',`sf_mynn',`sf_pxsfclay',`off'"/>
20732073

20742074
<nml_option name="config_gfconv_closure_deep" type="integer" default_value="0" in_defaults="false"
20752075
units="-"

src/core_atmosphere/physics/mpas_atmphys_control.F

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ module mpas_atmphys_control
5959
! Laura D. Fowler (laura@ucar.edu) / 2016-03-31.
6060
! * added the options sf_mynn and bl_mynn and for the MYNN parameterization from WRF version 3.6.1.
6161
! Laura D. Fowler (laura@ucar.edu) / 2016-04-11.
62+
! * added Pleim surface layer scheme option sf_pxsfclay.
63+
! Robert Gilliam (gilliam.robert@epa.gov) / 2016-09-19.
6264
! * added the option cu_ntiedtke for the "new" Tiedtke parameterization of convection from WRF version 3.8.1.
6365
! Laura D. Fowler (laura@ucar.edu) / 2016-09-19.
6466
! * added the physics suite "convection_scale_aware" (see below for the physics options used in the suite).
@@ -259,15 +261,16 @@ subroutine physics_namelist_check(configs)
259261
endif
260262

261263
!surface-layer scheme:
262-
if(.not. (config_sfclayer_scheme .eq. 'off' .or. &
263-
config_sfclayer_scheme .eq. 'sf_mynn' .or. &
264-
config_sfclayer_scheme .eq. 'sf_monin_obukhov' .or. &
265-
config_sfclayer_scheme .eq. 'sf_monin_obukhov_rev')) then
264+
if(.not. (config_sfclayer_scheme .eq. 'off' .or. &
265+
config_sfclayer_scheme .eq. 'sf_mynn' .or. &
266+
config_sfclayer_scheme .eq. 'sf_monin_obukhov' .or. &
267+
config_sfclayer_scheme .eq. 'sf_monin_obukhov_rev' .or. &
268+
config_sfclayer_scheme .eq. 'sf_pxsfclay')) then
266269

267270
write(mpas_err_message,'(A,A10)') 'illegal value for surface layer scheme: ', &
268271
trim(config_sfclayer_scheme)
269272
call physics_error_fatal(mpas_err_message)
270-
else
273+
else if(config_sfclayer_scheme .ne. 'sf_pxsfclay') then
271274
if(config_pbl_scheme == 'bl_mynn') then
272275
config_sfclayer_scheme = 'sf_mynn'
273276
elseif(config_pbl_scheme == 'bl_ysu') then

src/core_atmosphere/physics/mpas_atmphys_driver_sfclayer.F

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module mpas_atmphys_driver_sfclayer
1515
use mpas_atmphys_vars
1616

1717
use module_sf_mynn,only: sfclay_mynn
18+
use module_sf_pxsfclay
1819
use module_sf_sfclay
1920
use module_sf_sfclayrev,only: sfclayrev
2021
use sf_mynn,only: sf_mynn_init
@@ -48,7 +49,8 @@ module mpas_atmphys_driver_sfclayer
4849
!
4950
! WRF physics called from driver_sfclayer:
5051
! ----------------------------------------
51-
! * module_sf_sfclay: Monin-Obukhov surface layer scheme.
52+
! * module_sf_sfclay : Monin-Obukhov surface layer scheme.
53+
! * module_sf_pxsfclay : PX surface layer scheme.
5254
!
5355
! add-ons and modifications to sourcecode:
5456
! ----------------------------------------
@@ -73,6 +75,8 @@ module mpas_atmphys_driver_sfclayer
7375
! Laura D. Fowler (laura@ucar.edu) / 2016-03-25.
7476
! * added the implementation of the MYNN surface layer scheme from WRF 3.6.1.
7577
! Laura D. Fowler (laura@ucar.edu) / 2016-03-30.
78+
! * added PX surface layer (pxsfclay) option.
79+
! Jon Pleim (pleim.jon@epa.gov) and Hosein Foroutan (hosein@vt.edu) / 2016-05-04.
7680
! * added the calculation of surface layer variables over seaice cells when config_frac_seaice is set to true.
7781
! Laura D. Fowler (laura@ucar.edu) / 2016-10-03.
7882
! * changed the definition of dx_p to match that used in other physics parameterizations.
@@ -220,6 +224,8 @@ subroutine allocate_sfclayer(configs)
220224
if(.not.allocated(ch_sea)) allocate(ch_sea(ims:ime,jms:jme))
221225
endif
222226

227+
case("sf_pxsfclay")
228+
223229
case default
224230

225231
end select sfclayer_select
@@ -342,6 +348,8 @@ subroutine deallocate_sfclayer(configs)
342348
if(allocated(ch_sea)) deallocate(ch_sea)
343349
endif
344350

351+
case("sf_pxsfclay")
352+
345353
case default
346354

347355
end select sfclayer_select
@@ -585,6 +593,8 @@ subroutine sfclayer_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
585593
enddo
586594
enddo
587595

596+
case("sf_pxsfclay")
597+
588598
case default
589599

590600
end select sfclayer_select
@@ -789,6 +799,8 @@ subroutine sfclayer_to_MPAS(configs,sfc_input,diag_physics,its,ite)
789799
enddo
790800
endif
791801

802+
case("sf_pxsfclay")
803+
792804
case default
793805

794806
end select sfclayer_select
@@ -829,6 +841,9 @@ subroutine init_sfclayer(configs)
829841
case("sf_mynn")
830842
call sf_mynn_init(errmsg,errflg)
831843

844+
case("sf_pxsfclay")
845+
call pxsfclayinit(allowed_to_read)
846+
832847
case default
833848

834849
end select sfclayer_select
@@ -1082,6 +1097,59 @@ subroutine driver_sfclayer(itimestep,configs,mesh,diag_physics,sfc_input,its,ite
10821097
endif
10831098
call mpas_timer_stop('sf_mynn')
10841099

1100+
case("sf_pxsfclay")
1101+
call mpas_timer_start('PX_sfclay')
1102+
call pxsfclay( &
1103+
p3d = pres_hyd_p , psfc = psfc_p , t3d = t_p , &
1104+
u3d = u_p , v3d = v_p , qv3d = qv_p , &
1105+
dz8w = dz_p , cp = cp , g = gravity , &
1106+
rovcp = rcp , R = R_d , xlv = xlv , &
1107+
chs = chs_p , chs2 = chs2_p , cqs2 = cqs2_p , &
1108+
cpm = cpm_p , znt = znt_p , ust = ust_p , &
1109+
pblh = hpbl_p , mavail = mavail_p , zol = zol_p , &
1110+
mol = mol_p , regime = regime_p , psim = psim_p , &
1111+
psih = psih_p , th3d = th_p , &
1112+
xland = xland_p , hfx = hfx_p , qfx = qfx_p , &
1113+
lh = lh_p , tsk = tsk_p , flhc = flhc_p , &
1114+
ta2 = t2m_p , th2 = th2m_p , qa2 = q2_p , &
1115+
flqc = flqc_p , qgh = qgh_p , qsfc = qsfc_p , &
1116+
rmol = rmol_p , u10 = u10_p , v10 = v10_p , &
1117+
gz1oz0 = gz1oz0_p , wspd = wspd_p , br = br_p , &
1118+
isfflx = isfflx , dx = dx_p , svp1 = svp1 , &
1119+
svp2 = svp2 , svp3 = svp3 , svpt0 = svpt0 , &
1120+
ep1 = ep_1 , ep2 = ep_2 , karman = karman , &
1121+
ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
1122+
ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
1123+
its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
1124+
)
1125+
! Note that fractional sea-ice is currently not supported by PX.
1126+
! if(config_frac_seaice) then
1127+
! call pxsfclay( &
1128+
! p3d = pres_hyd_p , psfc = psfc_p , t3d = t_p , &
1129+
! u3d = u_p , v3d = v_p , qv3d = qv_p , &
1130+
! dz8w = dz_p , cp = cp , g = gravity , &
1131+
! rovcp = rcp , R = R_d , xlv = xlv , &
1132+
! chs = chs_sea , chs2 = chs2_sea , cqs2 = cqs2_sea , &
1133+
! cpm = cpm_sea , znt = znt_sea , ust = ust_sea , &
1134+
! pblh = hpbl_p , mavail = mavail_sea , zol = zol_sea , &
1135+
! mol = mol_sea , regime = regime_sea , psim = psim_sea , &
1136+
! psih = psih_sea , th3d = th_p , &
1137+
! xland = xland_sea , hfx = hfx_sea , qfx = qfx_sea , &
1138+
! lh = lh_sea , tsk = tsk_sea , flhc = flhc_sea , &
1139+
! ta2 = t2m_sea , th2 = th2m_sea , qa2 = q2_sea , &
1140+
! flqc = flqc_sea , qgh = qgh_sea , qsfc = qsfc_sea , &
1141+
! rmol = rmol_sea , u10 = u10_sea , v10 = v10_sea , &
1142+
! gz1oz0 = gz1oz0_sea , wspd = wspd_sea , br = br_sea , &
1143+
! isfflx = isfflx , dx = dx_p , svp1 = svp1 , &
1144+
! svp2 = svp2 , svp3 = svp3 , svpt0 = svpt0 , &
1145+
! ep1 = ep_1 , ep2 = ep_2 , karman = karman , &
1146+
! ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
1147+
! ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
1148+
! its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
1149+
! )
1150+
! endif
1151+
call mpas_timer_stop('PX_sfclay')
1152+
10851153
case default
10861154

10871155
end select sfclayer_select

src/core_atmosphere/physics/physics_wrf/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ OBJS = \
3838
module_sf_noah_seaice.o \
3939
module_sf_noah_seaice_drv.o \
4040
module_sf_oml.o \
41+
module_sf_pxsfclay.o \
4142
module_sf_sfclay.o \
4243
module_sf_sfclayrev.o \
4344
module_sf_urban.o \

0 commit comments

Comments
 (0)