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

Add support for Stochastically Perturbed Parameterizations (SPP) in FV3 #820

Merged
merged 40 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b996662
Add SPP option to several physics parameterizations
Nov 11, 2021
0947372
bug fixes
Nov 22, 2021
a6453ae
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
Nov 23, 2021
9fcd6da
checkout dtc/ccpp branch (not main), for rte-rrtmgp
Nov 23, 2021
12f92fb
remove optional keyword from metadata files
Nov 23, 2021
a851742
specific commit hash for rte-rrtmgp
Nov 23, 2021
d5414d2
Add spp args to gwd call, when called directly (vs unified gwd)
Nov 23, 2021
e74b9b6
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
Dec 9, 2021
f2a2e7d
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
JeffBeck-NOAA Dec 27, 2021
5523ff7
Add missing drag_suite.F90 SPP code
JeffBeck-NOAA Dec 28, 2021
c2e8bbf
Requested changes from code review.
JeffBeck-NOAA Dec 28, 2021
fbdad7e
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
JeffBeck-NOAA Dec 28, 2021
307a507
Fix dimension-related bug.
JeffBeck-NOAA Dec 28, 2021
e44b9aa
Changes for PR modification requests
JeffBeck-NOAA Jan 12, 2022
8d599bc
Fix bug in SPP implementation
JeffBeck-NOAA Jan 13, 2022
6f89824
Perturb cloud* instead of effr*_inout
JeffBeck-NOAA Jan 14, 2022
81d556c
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
JeffBeck-NOAA Jan 14, 2022
9c90b47
Change spp_gwd from logical to integer
JeffBeck-NOAA Jan 14, 2022
a7b9875
MYNN SFC perturbation pattern name fix
JeffBeck-NOAA Jan 14, 2022
dd419a3
Remove initialization of pattern_spp_sfc=0
JeffBeck-NOAA Jan 14, 2022
d466eb1
Updates to standard names and units
JeffBeck-NOAA Jan 16, 2022
f685e20
Fix varmax field dimensions
JeffBeck-NOAA Jan 18, 2022
34f79e7
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
JeffBeck-NOAA Jan 20, 2022
73eb0f3
Add dimensions to SPP variables
JeffBeck-NOAA Jan 20, 2022
9650294
Update dimensions of SPP fields
JeffBeck-NOAA Jan 20, 2022
63c5f96
Update dimensions for two SPP fields
JeffBeck-NOAA Jan 20, 2022
9560a79
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
JeffBeck-NOAA Feb 11, 2022
070a9cd
change units of surface_stochastic_weights_from_coupled_process from …
grantfirl Feb 11, 2022
959c7e1
Merge pull request #1 from grantfirl/feature/stoch_spp_gjf
JeffBeck-NOAA Feb 11, 2022
308b0b3
Remove misplaced file.
JeffBeck-NOAA Feb 16, 2022
295cd27
Merge branch 'main' of https://github.com/NCAR/ccpp-physics into feat…
JeffBeck-NOAA Feb 16, 2022
def0e78
Update spp_mp to equal 7 in if statement.
JeffBeck-NOAA Feb 17, 2022
372febe
edit module_mp_thompson.F90 to remove optional keyword for rand_pert …
Feb 21, 2022
1e02fc8
Merge pull request #2 from grantfirl/feature/stoch_spp_gjf
JeffBeck-NOAA Feb 21, 2022
eef1e23
Loop over i,j instead of i,1 for rand_pert field.
JeffBeck-NOAA Feb 21, 2022
ac7cde7
Revert dimensions changes to rand_pert.
JeffBeck-NOAA Feb 21, 2022
14ca01e
Revert dimension changes to rand_pert.
JeffBeck-NOAA Feb 21, 2022
f07475c
Merge branch 'feature/stoch_spp' of https://github.com/JeffBeck-NOAA/…
JeffBeck-NOAA Feb 21, 2022
88d0dd3
change optional and explicitly-shaped SPP arrays to non-optional and …
grantfirl Feb 21, 2022
f77322b
Merge pull request #3 from grantfirl/feature/stoch_spp_gjf
JeffBeck-NOAA Feb 22, 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
26 changes: 25 additions & 1 deletion physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
gasvmr_ccl4, gasvmr_cfc113, aerodp, clouds6, clouds7, clouds8, &
clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, &
faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, &
errmsg, errflg)
spp_wts_rad, do_spp, errmsg, errflg)

use machine, only: kind_phys

Expand Down Expand Up @@ -104,6 +104,9 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
uni_cld, effr_in, do_mynnedmf, &
lmfshal, lmfdeep2, pert_clds

logical, intent(in) :: do_spp
real(kind_phys), intent(in) :: spp_wts_rad(:,:)

real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp
real(kind=kind_phys), intent(in) :: con_eps, epsm1, fvirt, rog, rocp, con_rd

Expand Down Expand Up @@ -1076,6 +1079,27 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
enddo
enddo

! --- add spp
if ( do_spp .ne. 0 ) then

do k=1,lm
if (k < levs) then
do i=1,im
effrl_inout(i,k) = effrl_inout(i,k) - spp_wts_rad(i,k) * effrl_inout(i,k)
effri_inout(i,k) = effri_inout(i,k) - spp_wts_rad(i,k) * effri_inout(i,k)
effrs_inout(i,k) = effrs_inout(i,k) - spp_wts_rad(i,k) * effrs_inout(i,k)
enddo
else
do i=1,im
effrl_inout(i,k) = effrl_inout(i,k) - spp_wts_rad(i,levs) * effrl_inout(i,k)
effri_inout(i,k) = effri_inout(i,k) - spp_wts_rad(i,levs) * effri_inout(i,k)
effrs_inout(i,k) = effrs_inout(i,k) - spp_wts_rad(i,levs) * effrs_inout(i,k)
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
enddo
endif
enddo

endif

! mg, sfc-perts
! --- scale random patterns for surface perturbations with
! perturbation size
Expand Down
15 changes: 15 additions & 0 deletions physics/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,21 @@
type = real
kind = kind_phys
intent = out
[spp_wts_rad]
standard_name = weights_for_stochastic_spp_rad_perturbation
long_name = weights for stochastic spp rad perturbation
units = none
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = in
[do_spp]
standard_name = flag_for_stochastic_spp_option
long_name = flag for stochastic spp option
units = flag
dimensions = ()
type = logical
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
45 changes: 33 additions & 12 deletions physics/drag_suite.F90
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ subroutine drag_suite_run( &
& do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, &
& dtend, dtidx, index_of_process_orographic_gwd, &
& index_of_temperature, index_of_x_wind, &
& index_of_y_wind, ldiag3d, errmsg, errflg)
& index_of_y_wind, ldiag3d, &
& spp_wts_gwd, do_spp, errmsg, errflg)

! ********************************************************************
! -----> I M P L E M E N T A T I O N V E R S I O N <----------
Expand Down Expand Up @@ -365,6 +366,11 @@ subroutine drag_suite_run( &
real(kind=kind_phys), dimension(im,km) :: zl ! = PHIL/g

!SPP
real(kind=kind_phys), dimension(im) :: var_stoch, varss_stoch, &
varmax_ss_stoch, varmax_fd_stoch
real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:)
logical, intent(in) :: do_spp

real(kind=kind_phys), dimension(im) :: rstoch

!Output:
Expand Down Expand Up @@ -595,6 +601,21 @@ subroutine drag_suite_run( &
endif
enddo

! SPP, if do_spp is false, no perturbations are applied.
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
if ( do_spp ) then
do i = its,im
var_stoch(i) = var(i) + var(i)*0.75*spp_wts_gwd(i,1)
varss_stoch(i) = varss(i) + varss(i)*0.75*spp_wts_gwd(i,1)
varmax_ss_stoch(i) = varmax_ss + varmax_ss*0.75*spp_wts_gwd(i,1)
varmax_fd_stoch(i) = varmax_fd + varmax_fd*0.75*spp_wts_gwd(i,1)
JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
enddo
else
var_stoch = var
varss_stoch = varss
varmax_ss_stoch = varmax_ss
varmax_fd_stoch = varmax_fd
endif

!--- calculate length of grid for flow-blocking drag
!
do i=1,im
Expand Down Expand Up @@ -711,7 +732,7 @@ subroutine drag_suite_run( &
! determine reference level: maximum of 2*var and pbl heights
!
do i = its,im
zlowtop(i) = 2. * var(i)
zlowtop(i) = 2. * var_stoch(i)
enddo
!
do i = its,im
Expand Down Expand Up @@ -867,7 +888,7 @@ subroutine drag_suite_run( &
!
ldrag(i) = ldrag(i) .or. bnv2(i,1).le.0.0
ldrag(i) = ldrag(i) .or. ulow(i).eq.1.0
ldrag(i) = ldrag(i) .or. var(i) .le. 0.0
ldrag(i) = ldrag(i) .or. var_stoch(i) .le. 0.0
!
! set all ri low level values to the low level value
!
Expand All @@ -877,7 +898,7 @@ subroutine drag_suite_run( &
!
if (.not.ldrag(i)) then
bnv(i) = sqrt( bnv2(i,1) )
fr(i) = bnv(i) * rulow(i) * 2. * var(i) * od(i)
fr(i) = bnv(i) * rulow(i) * 2. * var_stoch(i) * od(i)
fr(i) = min(fr(i),frmax)
xn(i) = ubar(i) * rulow(i)
yn(i) = vbar(i) * rulow(i)
Expand Down Expand Up @@ -961,7 +982,7 @@ subroutine drag_suite_run( &
exit
ENDIF
enddo
if((xland(i)-1.5).le.0. .and. 2.*varss(i).le.hpbl(i))then
if((xland(i)-1.5).le.0. .and. 2.*varss_stoch(i).le.hpbl(i))then
if(br1(i).gt.0. .and. thvx(i,kpbl2)-thvx(i,kts) > 0.)then
cleff_ss = sqrt(dxy(i)**2 + dxyp(i)**2) ! WRF
! cleff_ss = 3. * max(dx(i),cleff_ss)
Expand All @@ -980,8 +1001,8 @@ subroutine drag_suite_run( &
!tauwavex0=0.5*XNBV*xlinv(i)*(2*MIN(varss(i),75.))**2*ro(i,kts)*u1(i,kpbl(i))
!tauwavex0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*u1(i,kpbl2)
!tauwavex0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*u1(i,3)
var_temp = MIN(varss(i),varmax_ss) + &
MAX(0.,beta_ss*(varss(i)-varmax_ss))
var_temp = MIN(varss_stoch(i),varmax_ss_stoch(i)) + &
MAX(0.,beta_ss*(varss_stoch(i)-varmax_ss_stoch(i)))
! Note: This is a semi-implicit treatment of the time differencing
var_temp2 = 0.5*XNBV*xlinv(i)*(2.*var_temp)**2*ro(i,kvar) ! this is greater than zero
tauwavex0=var_temp2*u1(i,kvar)/(1.+var_temp2*deltim)
Expand All @@ -995,8 +1016,8 @@ subroutine drag_suite_run( &
!tauwavey0=0.5*XNBV*xlinv(i)*(2*MIN(varss(i),75.))**2*ro(i,kts)*v1(i,kpbl(i))
!tauwavey0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*v1(i,kpbl2)
!tauwavey0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*v1(i,3)
var_temp = MIN(varss(i),varmax_ss) + &
MAX(0.,beta_ss*(varss(i)-varmax_ss))
var_temp = MIN(varss_stoch(i),varmax_ss_stoch(i)) + &
MAX(0.,beta_ss*(varss_stoch(i)-varmax_ss_stoch(i)))
! Note: This is a semi-implicit treatment of the time differencing
var_temp2 = 0.5*XNBV*xlinv(i)*(2.*var_temp)**2*ro(i,kvar) ! this is greater than zero
tauwavey0=var_temp2*v1(i,kvar)/(1.+var_temp2*deltim)
Expand Down Expand Up @@ -1060,16 +1081,16 @@ subroutine drag_suite_run( &

IF ((xland(i)-1.5) .le. 0.) then
!(IH*kflt**n1)**-1 = (0.00102*0.00035**-1.9)**-1 = 0.00026615161
var_temp = MIN(varss(i),varmax_fd) + &
MAX(0.,beta_fd*(varss(i)-varmax_fd))
var_temp = MIN(varss_stoch(i),varmax_fd_stoch(i)) + &
MAX(0.,beta_fd*(varss_stoch(i)-varmax_fd_stoch(i)))
var_temp = MIN(var_temp, 250.)
a1=0.00026615161*var_temp**2
! a1=0.00026615161*MIN(varss(i),varmax)**2
! a1=0.00026615161*(0.5*varss(i))**2
! k1**(n1-n2) = 0.003**(-1.9 - -2.8) = 0.003**0.9 = 0.005363
a2=a1*0.005363
! Revise e-folding height based on PBL height and topographic std. dev. -- M. Toy 3/12/2018
H_efold = max(2*varss(i),hpbl(i))
H_efold = max(2*varss_stoch(i),hpbl(i))
H_efold = min(H_efold,1500.)
DO k=kts,km
wsp=SQRT(u1(i,k)**2 + v1(i,k)**2)
Expand Down
15 changes: 15 additions & 0 deletions physics/drag_suite.meta
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,21 @@
dimensions = ()
type = logical
intent = in
[spp_wts_gwd]
standard_name = weights_for_stochastic_spp_gwd_perturbation
long_name = weights for stochastic spp gwd perturbation
units = none
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = in
[do_spp]
standard_name = flag_for_stochastic_spp_option
long_name = flag for stochastic spp option
units = flag
dimensions = ()
type = logical
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
23 changes: 15 additions & 8 deletions physics/module_MYNNPBL_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SUBROUTINE mynnedmf_wrapper_run( &
& icloud_bl, do_mynnsfclay, &
& imp_physics, imp_physics_gfdl, &
& imp_physics_thompson, imp_physics_wsm6, &
& ltaerosol, lprnt, huge, errmsg, errflg )
& ltaerosol, spp_wts_pbl, do_spp, lprnt, huge, errmsg, errflg )

! should be moved to inside the mynn:
use machine , only : kind_phys
Expand Down Expand Up @@ -195,6 +195,7 @@ SUBROUTINE mynnedmf_wrapper_run( &
! NAMELIST OPTIONS (INPUT):
LOGICAL, INTENT(IN) :: bl_mynn_tkeadvect, ltaerosol, &
lprnt, do_mynnsfclay, &
do_spp, &
flag_for_pbl_generic_tend
INTEGER, INTENT(IN) :: &
& bl_mynn_cloudpdf, &
Expand All @@ -220,8 +221,8 @@ SUBROUTINE mynnedmf_wrapper_run( &

!MISC CONFIGURATION OPTIONS
INTEGER, PARAMETER :: &
& spp_pbl=0, &
& bl_mynn_mixscalars=1
& bl_mynn_mixscalars=1, &
& levflag=2
REAL, PARAMETER :: &
& closure=2.6 !2.5, 2.6 or 3.0
LOGICAL :: &
Expand All @@ -231,7 +232,8 @@ SUBROUTINE mynnedmf_wrapper_run( &
LOGICAL, PARAMETER :: cycling = .false.
INTEGER, PARAMETER :: param_first_scalar = 1
INTEGER :: &
& p_qc, p_qr, p_qi, p_qs, p_qg, p_qnc, p_qni
& spp_pbl, &
& p_qc, p_qr, p_qi, p_qs, p_qg, p_qnc, p_qni

!MYNN-1D
REAL(kind=kind_phys), intent(in) :: delt, dtf
Expand Down Expand Up @@ -275,15 +277,17 @@ SUBROUTINE mynnedmf_wrapper_run( &
& Tsq, Qsq, Cov, exch_h, exch_m
real(kind=kind_phys), dimension(:), intent(in) :: xmu
real(kind=kind_phys), dimension(:,:), intent(in) :: htrsw, htrlw
! spp_wts_pbl only allocated if do_spp == .true.
real(kind_phys), dimension(:,:), intent(in) :: spp_wts_pbl

!LOCAL
real(kind=kind_phys), dimension(im,levs) :: &
& sqv,sqc,sqi,qnc,qni,ozone,qnwfa,qnifa, &
& dz, w, p, rho, th, qv, &
& RUBLTEN, RVBLTEN, RTHBLTEN, RQVBLTEN, &
& RQCBLTEN, RQNCBLTEN, RQIBLTEN, RQNIBLTEN, &
& RQNWFABLTEN, RQNIFABLTEN, &
& dqke,qWT,qSHEAR,qBUOY,qDISS, &
& pattern_spp_pbl
& dqke,qWT,qSHEAR,qBUOY,qDISS
real(kind=kind_phys), allocatable :: old_ozone(:,:)

!MYNN-CHEM arrays
Expand Down Expand Up @@ -525,9 +529,12 @@ SUBROUTINE mynnedmf_wrapper_run( &
! qi(i,k)=qi(i,k)/(1.0 - qvsh(i,k))
rho(i,k)=prsl(i,k)/(r_d*t3d(i,k))
w(i,k) = -omega(i,k)/(rho(i,k)*g)
pattern_spp_pbl(i,k)=0.0
enddo
enddo
if ( do_spp ) then
spp_pbl=1
endif

JeffBeck-NOAA marked this conversation as resolved.
Show resolved Hide resolved
do i=1,im
if (slmsk(i)==1. .or. slmsk(i)==2.) then !sea/land/ice mask (=0/1/2) in FV3
xland(i)=1.0 !but land/water = (1/2) in SFCLAY_mynn
Expand Down Expand Up @@ -703,7 +710,7 @@ SUBROUTINE mynnedmf_wrapper_run( &
& ,det_thl3D=det_thl,det_sqv3D=det_sqv &
& ,nupdraft=nupdraft,maxMF=maxMF & !output
& ,ktop_plume=ktop_plume & !output
& ,spp_pbl=spp_pbl,pattern_spp_pbl=pattern_spp_pbl & !input
& ,spp_pbl=spp_pbl,pattern_spp_pbl=spp_wts_pbl & !input
& ,RTHRATEN=htrlw & !input
& ,FLAG_QI=flag_qi,FLAG_QNI=flag_qni & !input
& ,FLAG_QC=flag_qc,FLAG_QNC=flag_qnc & !input
Expand Down
15 changes: 15 additions & 0 deletions physics/module_MYNNPBL_wrapper.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,21 @@
dimensions = ()
type = logical
intent = in
[spp_wts_pbl]
standard_name = weights_for_stochastic_spp_pbl_perturbation
long_name = weights for stochastic spp pbl perturbation
units = none
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = in
[do_spp]
standard_name = flag_for_stochastic_spp_option
long_name = flag for stochastic spp option
units = flag
dimensions = ()
type = logical
intent = in
[lprnt]
standard_name = flag_print
long_name = control flag for diagnostic print out
Expand Down
16 changes: 11 additions & 5 deletions physics/module_MYNNSFC_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ SUBROUTINE mynnsfc_wrapper_run( &
& FLHC, FLQC, &
& U10, V10, TH2, T2, Q2, &
& wstar, CHS2, CQS2, &
& spp_wts_sfc, do_spp, &
! & CP, G, ROVCP, R, XLV, &
! & SVP1, SVP2, SVP3, SVPT0, &
! & EP1,EP2,KARMAN, &
Expand Down Expand Up @@ -143,7 +144,6 @@ SUBROUTINE mynnsfc_wrapper_run( &

!MISC CONFIGURATION OPTIONS
INTEGER, PARAMETER :: &
& spp_pbl = 0, &
& isftcflx = 0, & !control: 0
& iz0tlnd = 0, & !control: 0
& isfflx = 1
Expand All @@ -155,12 +155,15 @@ SUBROUTINE mynnsfc_wrapper_run( &
integer, intent(in) :: ivegsrc
integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean
logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han)
logical, intent(in) :: do_spp ! flag for using SPP perturbations

real(kind=kind_phys), intent(in) :: delt

!Input data
integer, dimension(:), intent(in) :: vegtype
real(kind=kind_phys), dimension(:), intent(in) :: &
& sigmaf,shdmax,z0pert,ztpert
real(kind_phys), dimension(:,:), intent(in) :: spp_wts_sfc

real(kind=kind_phys), dimension(:,:), &
& intent(in) :: phii
Expand Down Expand Up @@ -207,10 +210,10 @@ SUBROUTINE mynnsfc_wrapper_run( &
& cpm, qgh, qfx, snowh_wat

real(kind=kind_phys), dimension(im,levs) :: &
& pattern_spp_pbl, dz, th, qv
& dz, th, qv

!MYNN-1D
INTEGER :: k, i
INTEGER :: k, i, spp_sfc
INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, &
& IMS,IME,JMS,JME,KMS,KME, &
& ITS,ITE,JTS,JTE,KTS,KTE
Expand All @@ -234,9 +237,12 @@ SUBROUTINE mynnsfc_wrapper_run( &
th(i,k)=t3d(i,k)/exner(i,k)
!qc(i,k)=MAX(qgrs(i,k,ntcw),0.0)
qv(i,k)=qvsh(i,k)/(1.0 - qvsh(i,k))
pattern_spp_pbl(i,k)=0.0
enddo
enddo
if ( do_spp ) then
spp_sfc=1
endif

do i=1,im
if (slmsk(i)==1. .or. slmsk(i)==2.)then !sea/land/ice mask (=0/1/2) in FV3
xland(i)=1.0 !but land/water = (1/2) in SFCLAY_mynn
Expand Down Expand Up @@ -330,7 +336,7 @@ SUBROUTINE mynnsfc_wrapper_run( &
QGH=qgh,QSFC=qsfc, &
U10=u10,V10=v10,TH2=th2,T2=t2,Q2=q2, &
GZ1OZ0=GZ1OZ0,WSPD=wspd,wstar=wstar, &
spp_pbl=spp_pbl,pattern_spp_pbl=pattern_spp_pbl, &
spp_pbl=spp_sfc,pattern_spp_pbl=spp_wts_sfc, &
ids=1,ide=im, jds=1,jde=1, kds=1,kde=levs, &
ims=1,ime=im, jms=1,jme=1, kms=1,kme=levs, &
its=1,ite=im, jts=1,jte=1, kts=1,kte=levs )
Expand Down
Loading