Skip to content

Commit 7adb963

Browse files
ldfowler58mgduda
authored andcommitted
* In ./src/core_atmosphere/physics:
-> in ./physics_mmm, added the first version of the CCPP-compliant parameterization of the YSU planetary boundary layer (PBL; bl_ysu.F). modified Makefile accordingly. -> in ./physics_wrf, modified module_bl_ysu.F to call bl_ysu.F. modified Makefile accordingly. -> in mpas_atmphys_driver_pbl.F, change the call to subroutine ysu to reflect changes made in module_bl_ysu.F, mainly adding an error flag and an error message for CCPP compliance. modifed Makefile to compile the physics_mmm sub-directory.
1 parent a85431a commit 7adb963

5 files changed

Lines changed: 2050 additions & 1621 deletions

File tree

src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module mpas_atmphys_driver_pbl
6060
! * for the mynn parameterization, change the definition of dx_p to match that used in other physics
6161
! parameterizations.
6262
! Laura D. Fowler (laura@ucar.edu) / 2016-10-18.
63-
! * updated the call to subroutine ysu in comjunction with updating module_bl_ysu.F from WRF version 3.6.1 to
63+
! * updated the call to subroutine ysu in conjunction with updating module_bl_ysu.F from WRF version 3.6.1 to
6464
! WRF version 3.8.1
6565
! Laura D. Fowler (laura@ucar.edu) / 2016-10-27.
6666
! * since we removed the local variable pbl_scheme from mpas_atmphys_vars.F, now defines pbl_scheme as a pointer
@@ -69,6 +69,10 @@ module mpas_atmphys_driver_pbl
6969
! * after updating module_bl_ysu.F to WRF version 4.0.3, corrected call to subroutine ysu to output diagnostics of
7070
! exchange coefficients exch_h and exch_m.
7171
! Laura D. Fowler (laura@ucar.edu) / 2019-03-12.
72+
! * updated the call to subroutine ysu after updating the YSU PBL scheme to that in WRF 4.4.1. added the flags
73+
! errmsg and errflg in the call to subroutine ysu for compliance with the CCPP framework. also removed local
74+
! variable regime_p which is no longer needed in the call to subroutine ysu.
75+
! Laura D. Fowler (laura@ucar.edu) / 2023-05-15.
7276

7377

7478
contains
@@ -124,7 +128,6 @@ subroutine allocate_pbl(configs)
124128
if(.not.allocated(ctopo2_p)) allocate(ctopo2_p(ims:ime,jms:jme) )
125129
if(.not.allocated(psih_p) ) allocate(psih_p(ims:ime,jms:jme) )
126130
if(.not.allocated(psim_p) ) allocate(psim_p(ims:ime,jms:jme) )
127-
if(.not.allocated(regime_p)) allocate(regime_p(ims:ime,jms:jme) )
128131
if(.not.allocated(u10_p) ) allocate(u10_p(ims:ime,jms:jme) )
129132
if(.not.allocated(v10_p) ) allocate(v10_p(ims:ime,jms:jme) )
130133
if(.not.allocated(exch_p) ) allocate(exch_p(ims:ime,kms:kme,jms:jme))
@@ -212,7 +215,6 @@ subroutine deallocate_pbl(configs)
212215
if(allocated(ctopo2_p)) deallocate(ctopo2_p)
213216
if(allocated(psih_p) ) deallocate(psih_p )
214217
if(allocated(psim_p) ) deallocate(psim_p )
215-
if(allocated(regime_p)) deallocate(regime_p)
216218
if(allocated(u10_p) ) deallocate(u10_p )
217219
if(allocated(v10_p) ) deallocate(v10_p )
218220
if(allocated(exch_p) ) deallocate(exch_p )
@@ -274,7 +276,7 @@ subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,it
274276

275277
!local pointers for YSU scheme:
276278
logical,pointer:: config_ysu_pblmix
277-
real(kind=RKIND),dimension(:),pointer:: br,fh,fm,regime,u10,v10
279+
real(kind=RKIND),dimension(:),pointer:: br,fh,fm,u10,v10
278280
real(kind=RKIND),dimension(:,:),pointer:: rthratenlw,rthratensw
279281

280282
!local pointers for MYNN scheme:
@@ -325,7 +327,6 @@ subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,it
325327
call mpas_pool_get_array(diag_physics,'br' ,br )
326328
call mpas_pool_get_array(diag_physics,'fm' ,fm )
327329
call mpas_pool_get_array(diag_physics,'fh' ,fh )
328-
call mpas_pool_get_array(diag_physics,'regime',regime)
329330
call mpas_pool_get_array(diag_physics,'u10' ,u10 )
330331
call mpas_pool_get_array(diag_physics,'v10' ,v10 )
331332

@@ -341,7 +342,6 @@ subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,it
341342
br_p(i,j) = br(i)
342343
psim_p(i,j) = fm(i)
343344
psih_p(i,j) = fh(i)
344-
regime_p(i,j) = regime(i)
345345
u10_p(i,j) = u10(i)
346346
v10_p(i,j) = v10(i)
347347
!initialization for YSU PBL scheme:
@@ -598,10 +598,18 @@ subroutine driver_pbl(itimestep,configs,mesh,sfc_input,diag_physics,tend_physics
598598
integer:: initflag
599599
integer:: i,k,j
600600

601+
!CCPP-compliant flags:
602+
character(len=StrKIND):: errmsg
603+
integer:: errflg
604+
601605
!-----------------------------------------------------------------------------------------------------------------
602606
!call mpas_log_write('')
603607
!call mpas_log_write('--- enter subroutine driver_pbl:')
604608

609+
!initialization of CCPP-compliant flags:
610+
errmsg = ' '
611+
errflg = 0
612+
605613
call mpas_pool_get_config(configs,'config_do_restart',config_do_restart)
606614
call mpas_pool_get_config(configs,'config_pbl_scheme',pbl_scheme )
607615

@@ -614,14 +622,14 @@ subroutine driver_pbl(itimestep,configs,mesh,sfc_input,diag_physics,tend_physics
614622
pbl_select: select case (trim(pbl_scheme))
615623

616624
case("bl_ysu")
617-
call mpas_timer_start('YSU')
625+
call mpas_timer_start('bl_ysu')
618626
call ysu ( &
619627
p3d = pres_hyd_p , p3di = pres2_hyd_p , psfc = psfc_p , &
620-
th3d = th_p , t3d = t_p , dz8w = dz_p , &
621-
pi3d = pi_p , u3d = u_p , v3d = v_p , &
622-
qv3d = qv_p , qc3d = qc_p , qi3d = qi_p , &
623-
rublten = rublten_p , rvblten = rvblten_p , rthblten = rthblten_p , &
624-
rqvblten = rqvblten_p , rqcblten = rqcblten_p , rqiblten = rqiblten_p , &
628+
t3d = t_p , dz8w = dz_p , pi3d = pi_p , &
629+
u3d = u_p , v3d = v_p , qv3d = qv_p , &
630+
qc3d = qc_p , qi3d = qi_p , rublten = rublten_p , &
631+
rvblten = rvblten_p , rthblten = rthblten_p , rqvblten = rqvblten_p , &
632+
rqcblten = rqcblten_p , rqiblten = rqiblten_p , flag_qc = f_qc , &
625633
flag_qi = f_qi , cp = cp , g = gravity , &
626634
rovcp = rcp , rd = R_d , rovg = rdg , &
627635
ep1 = ep_1 , ep2 = ep_2 , karman = karman , &
@@ -633,13 +641,14 @@ subroutine driver_pbl(itimestep,configs,mesh,sfc_input,diag_physics,tend_physics
633641
exch_m = kzm_p , wstar = wstar_p , delta = delta_p , &
634642
uoce = uoce_p , voce = voce_p , rthraten = rthraten_p , &
635643
u10 = u10_p , v10 = v10_p , ctopo = ctopo_p , &
636-
ctopo2 = ctopo2_p , regime = regime_p , &
644+
ctopo2 = ctopo2_p , flag_bep = flag_bep , idiff = idiff , &
637645
ysu_topdown_pblmix = ysu_pblmix , &
646+
errmsg = errmsg , errflg = errflg , &
638647
ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
639648
ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , &
640649
its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte &
641650
)
642-
call mpas_timer_stop('YSU')
651+
call mpas_timer_stop('bl_ysu')
643652

644653
case("bl_mynn")
645654
call mpas_timer_start('MYNN_pbl')

src/core_atmosphere/physics/mpas_atmphys_vars.F

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ module mpas_atmphys_vars
114114
! input of "observed" 2D seaice albedos. In conjunction with this update, we also change the initialization of
115115
! albsi from albbck to seaice_albedo_default.
116116
! Laura D. Fowler (laura@ucar.edu) / 2022-05-10.
117+
! * added the local parameters flag_bep and idiff in the call to subroutine ysu to update the YSU PBL scheme to
118+
! that of WRF version 4.4.1.
119+
! Laura D. Fowler (laura@ucar.edu) / 2023-05-15.
117120

118121

119122
!=================================================================================================================
@@ -348,6 +351,14 @@ module mpas_atmphys_vars
348351
!... variables and arrays related to parameterization of pbl:
349352
!=================================================================================================================
350353

354+
logical,parameter:: &
355+
flag_bep = .false. !flag to use BEP/BEP+BEM for use in the YSU PBL scheme (with urban physics). since we do
356+
!not run urban physics, flag_bep is always set to false.
357+
358+
integer,parameter:: &
359+
idiff = 0 !BEP/BEM+BEM diffusion flag for use in the YSU PBL scheme (with urban physics). since we
360+
!do not run urban physics, idiff is set to zero.
361+
351362
integer:: ysu_pblmix
352363

353364
integer,dimension(:,:),allocatable:: &

src/core_atmosphere/physics/physics_mmm/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ dummy:
66
echo "****** compiling physics_mmm ******"
77

88
OBJS = \
9-
bl_gwdo.o
9+
bl_gwdo.o \
10+
bl_ysu.o
1011

1112
physics_mmm: $(OBJS)
1213
ar -ru ./../libphys.a $(OBJS)

0 commit comments

Comments
 (0)