Skip to content

Commit

Permalink
Feature/lndp noahmp2 : add land perturbation scheme for Noah-MP fract…
Browse files Browse the repository at this point in the history
…ional veg (#513)

Updates to allow land perturbation scheme to be applied for Noah-MP.

Main code changes:
-added lsm_noahmp model option to lndp_type==2 land perturbation scheme (fv3-atm, stochastic_physics)
-updated comments
-cleaned up the namelists to make the different options clearer. Removed misleading lndp_each_step variable from gfs_physics_nml, and replaced it with "lndp_model_type" in the nam_sfcperts namelist for the different forecast types (cycling DA, short forecasts, perturbing only initial conditions) (fv3-atm, stochastic_physics, ufs-weather-model)
NOTE: see note below, re: specification of smc perturbation for RAP/HRRR/etc (lndp_model_type==2)
-revised code in stochastic_physics_wrapper to only allocate arrays that will be used when passed into lndp_apply_perts (fv3-atm)
-deleted unused albedo arrays in stochastic_physics_wrapper and lndp_apply_perts (fv3-atm, stochastic_physics)
-fixed bug causing precision errors when calculating the soil moisture ice content (often ~0.0; stochastic_physics)
-fixed bug in which lndp_apply_perts wasn't called for nscyc = 0. (fv3-atm)
-increased max_nvar_lndp at Jeff Ator's request (fv3-atm)
-added a new test for the Noah-MP and lndp==2 combination (ufs-weather-model)
  • Loading branch information
ClaraDraper-NOAA authored Apr 28, 2022
1 parent 38720ac commit 9018acf
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 135 deletions.
27 changes: 11 additions & 16 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1161,27 +1161,25 @@ module GFS_typedefs
logical :: do_shum
logical :: do_skeb
integer :: skeb_npass
integer :: lndp_type
integer :: lndp_type ! integer indicating land perturbation scheme type:
! 0 - none
! 1 - scheme from Gehne et al, MWR, 2019. (Noah only, not maintained?)
! 2 - scheme from Draper, JHM, 2021.
real(kind=kind_phys) :: sppt_amp ! pjp cloud perturbations
integer :: n_var_lndp
logical :: lndp_each_step ! flag to indicate that land perturbations are applied at every time step,
! otherwise they are applied only after gcycle is run
character(len=3) , pointer :: lndp_var_list(:) ! dimension here must match n_var_max_lndp in stochy_nml_def
real(kind=kind_phys), pointer :: lndp_prt_list(:) ! dimension here must match n_var_max_lndp in stochy_nml_def
! also previous code had dimension 5 for each pert, to allow
! multiple patterns. It wasn't fully coded (and wouldn't have worked
! with nlndp>1, so I just dropped it). If we want to code it properly,
! we'd need to make this dim(6,5).
! next two are duplicated here to support lndp_type=1. If delete that scheme, could remove from GFS defs?
character(len=3) , pointer :: lndp_var_list(:)
real(kind=kind_phys), pointer :: lndp_prt_list(:)
logical :: do_spp ! Overall flag to turn on SPP or not
integer :: spp_pbl
integer :: spp_sfc
integer :: spp_mp
integer :: spp_rad
integer :: spp_gwd
integer :: n_var_spp
character(len=3) , pointer :: spp_var_list(:) ! dimension here must match n_var_spp in stochy_nml_def
real(kind=kind_phys), pointer :: spp_prt_list(:) ! dimension here must match n_var_spp in stochy_nml_def
real(kind=kind_phys), pointer :: spp_stddev_cutoff(:) ! dimension here must match n_var_spp in stochy_nml_def
character(len=3) , pointer :: spp_var_list(:)
real(kind=kind_phys), pointer :: spp_prt_list(:)
real(kind=kind_phys), pointer :: spp_stddev_cutoff(:)

!--- tracer handling
character(len=32), pointer :: tracer_names(:) !< array of initialized tracers from dynamic core
Expand Down Expand Up @@ -3233,7 +3231,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer :: skeb_npass = 11
integer :: lndp_type = 0
integer :: n_var_lndp = 0
logical :: lndp_each_step = .false.
integer :: n_var_spp = 0
integer :: spp_pbl = 0
integer :: spp_sfc = 0
Expand Down Expand Up @@ -3334,7 +3331,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
dlqf, rbcr, shoc_parm, psauras, prauras, wminras, &
do_sppt, do_shum, do_skeb, &
do_spp, n_var_spp, &
lndp_type, n_var_lndp, lndp_each_step, &
lndp_type, n_var_lndp, &
pert_mp,pert_clds,pert_radtend, &
!--- Rayleigh friction
prslrd0, ral_ts, ldiag_ugwp, do_ugwp, do_tofd, &
Expand Down Expand Up @@ -4137,7 +4134,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!--- stochastic surface perturbation options
Model%lndp_type = lndp_type
Model%n_var_lndp = n_var_lndp
Model%lndp_each_step = lndp_each_step
Model%do_spp = do_spp
Model%n_var_spp = n_var_spp

Expand Down Expand Up @@ -5742,7 +5738,6 @@ subroutine control_print(Model)
print *, ' do_skeb : ', Model%do_skeb
print *, ' lndp_type : ', Model%lndp_type
print *, ' n_var_lndp : ', Model%n_var_lndp
print *, ' lndp_each_step : ', Model%lndp_each_step
print *, ' do_spp : ', Model%do_spp
print *, ' n_var_spp : ', Model%n_var_spp
print *, ' '
Expand Down
16 changes: 3 additions & 13 deletions ccpp/driver/GFS_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2363,26 +2363,16 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop

if (Model%lndp_type /= 0) then
idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'sfc_wts1'
ExtDiag(idx)%axes = 3
ExtDiag(idx)%name = 'sfc_wts'
ExtDiag(idx)%desc = 'perturbation amplitude'
ExtDiag(idx)%unit = 'none'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%sfc_wts(:,1)
ExtDiag(idx)%data(nb)%var3 => Coupling(nb)%sfc_wts(:,:)
enddo

idx = idx + 1
ExtDiag(idx)%axes = 2
ExtDiag(idx)%name = 'sfc_wts2'
ExtDiag(idx)%desc = 'perturbation amplitude'
ExtDiag(idx)%unit = 'none'
ExtDiag(idx)%mod_name = 'gfs_phys'
allocate (ExtDiag(idx)%data(nblks))
do nb = 1,nblks
ExtDiag(idx)%data(nb)%var2 => Coupling(nb)%sfc_wts(:,2)
enddo
endif

if (Model%do_ca) then
Expand Down
Loading

0 comments on commit 9018acf

Please sign in to comment.