From 34c326c0c041a86cc253cf76ccc7d874a571c766 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 21 Jan 2021 19:32:26 -0700 Subject: [PATCH] Update develop from NOAA-GSL: RUC ice, MYNN sfclay, stochastic land perturbations (#239) * Update .gitmodules and submodule pointers for ccpp-framework and ccpp-physics for gsl/develop branch * RUC ice for gsl/develop (replaces #54 and #56) (#60) Implementation of RUC LSM ice model in CCPP * Fix bug in gfsphysics/GFS_layer/GFS_typedefs.F90 from merge * Remove lsm_ruc_sfc_sice from suite FV3_GSD_v0_unified_ugwp_suite and update submodule pointer for ccpp-physics * Remove sfc_sice from ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite.xml * Update gsl/develop from develop 2020/12/08 (#61) * Fix for updating stochastic physics on separate time-step. (#199) This bug fix allows the random patterns in the stochastic physics persist the for a period of time (defined as SKEBINT,SPPTINT, etc.) before calculating new patterns. The fix is to move the allocation of the saved variables into the init section of stochastic_physics_wrapper, and remove the deallocates in the run section. * Bug fixes in (1) running with frac_grid=T and GFDL MP and (2) restarting with frac_grid=T (#204) * -- Pointing to Moorthi's modifications in ccpp/physics, which fixed the crash when running GFDL MP with frac_grid=T; -- Not setting fice to zero in order to leave lake ice untouched; -- Restart in the coupled model with the default physics is reproducible, if bad water temperature is only filtered at initial time; Co-authored-with: Shrinivas Moorthi Co-authored-with: Denise Worthen * Revert change to .gitmodules and update submodule pointer for ccpp-physics * Update submodule pointer for ccpp-physics - MYNN surface layer updates and bugfixes (#63) * Land stochastic perturbations (wrapper PR for #65) (#68) * Move initialization of stochastic physics after the physics initialization in CCPP. * Add albedo variables to land perturbations with lndp_type=2 option. Change to accommodate soil perturbations with RUC LSM. * Max/min soil moisture variables are introduced via GFS_Control_type variables instead of through the use of namelist_soilveg*. This is a more flexible way for different LSMs. * Added pores and resid variables for max/min soil moisture to GFS_typedefs.f90. * Remove tracer_sanitizer from all suites and from CCPP prebuild config * Add namelist option to apply land surface perturbations at every time step, clean up stochastic_physics/stochastic_physics_wrapper.F90 * Stochastic land perturbations: add roughness length over land to the perturbed variables (#70) * Added roughness length over land to the perturbed variables. * Bugfix in gfsphysics/GFS_layer/GFS_typedefs.F90: remove Diag%cldcov, in particular the reset call because the variable is not allocated * Update .gitmodules and submodule pointer for GFDL_atmos_cubed_sphere for code review and testing * Revert change to .gitmodules for ccpp-physics, update submodule pointer for ccpp-physics * Revert change to .gitmodules and update submodule pointer for GFDL_atmos_cubed_sphere Co-authored-by: DomHeinzeller <58610420+DomHeinzeller@users.noreply.github.com> Co-authored-by: Phil Pegion <38869668+pjpegion@users.noreply.github.com> Co-authored-by: shansun6 <48043606+shansun6@users.noreply.github.com> Co-authored-by: tanyasmirnova --- atmos_model.F90 | 9 +- ccpp/config/ccpp_prebuild_config.py | 2 - ccpp/data/GFS_typedefs.F90 | 147 ++++++++++-------- ccpp/data/GFS_typedefs.meta | 80 +++++++--- ccpp/driver/GFS_diagnostics.F90 | 12 +- ccpp/physics | 2 +- ccpp/suites/suite_FV3_GSD_SAR.xml | 3 - ccpp/suites/suite_FV3_GSD_noah.xml | 1 - ccpp/suites/suite_FV3_GSD_v0.xml | 4 - ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml | 3 - ccpp/suites/suite_FV3_GSD_v0_drag_suite.xml | 3 - ccpp/suites/suite_FV3_GSD_v0_mynnsfc.xml | 3 - .../suite_FV3_GSD_v0_unified_ugwp_suite.xml | 3 - ccpp/suites/suite_FV3_HRRR.xml | 3 - ccpp/suites/suite_FV3_RAP.xml | 3 - io/FV3GFS_io.F90 | 85 ++++++---- .../stochastic_physics_wrapper.F90 | 121 +++++++++++--- 17 files changed, 312 insertions(+), 172 deletions(-) diff --git a/atmos_model.F90 b/atmos_model.F90 index 8e5761926..3730da692 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -553,11 +553,6 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) GFS_Data%Tbd, GFS_Data%Cldprop, GFS_Data%Radtend, & GFS_Data%Intdiag, Init_parm) - -!--- Initialize stochastic physics pattern generation / cellular automata for first time step - call stochastic_physics_wrapper(GFS_control, GFS_data, Atm_block, ierr) - if (ierr/=0) call mpp_error(FATAL, 'Call to stochastic_physics_wrapper failed') - Atmos%Diag => GFS_Diag Atm(mygrid)%flagstruct%do_skeb = GFS_control%do_skeb @@ -606,6 +601,10 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) call CCPP_step (step="physics_init", nblks=Atm_block%nblks, ierr=ierr) if (ierr/=0) call mpp_error(FATAL, 'Call to CCPP physics_init step failed') +!--- Initialize stochastic physics pattern generation / cellular automata for first time step + call stochastic_physics_wrapper(GFS_control, GFS_data, Atm_block, ierr) + if (ierr/=0) call mpp_error(FATAL, 'Call to stochastic_physics_wrapper failed') + !--- set the initial diagnostic timestamp diag_time = Time if (output_1st_tstep_rst) then diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index fee70b40e..d79b1df36 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -161,7 +161,6 @@ 'ccpp/physics/physics/ozphys_2015.f', 'ccpp/physics/physics/precpd.f', 'ccpp/physics/physics/phys_tend.F90', - 'ccpp/physics/physics/tracer_sanitizer.F90', 'ccpp/physics/physics/radlw_main.F90', 'ccpp/physics/physics/radsw_main.F90', 'ccpp/physics/physics/rascnv.F90', @@ -173,7 +172,6 @@ 'ccpp/physics/physics/sfc_diag.f', 'ccpp/physics/physics/sfc_diag_post.F90', 'ccpp/physics/physics/sfc_drv_ruc.F90', - 'ccpp/physics/physics/lsm_ruc_sfc_sice_interstitial.F90', 'ccpp/physics/physics/sfc_cice.f', 'ccpp/physics/physics/sfc_diff.f', 'ccpp/physics/physics/sfc_drv.f', diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 5cc2e2333..14d5d31f4 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -242,7 +242,8 @@ module GFS_typedefs real (kind=kind_phys), pointer :: semisbase(:) => null() !< background surface emissivity !--- In (radiation only) - real (kind=kind_phys), pointer :: sncovr (:) => null() !< snow cover in fraction + real (kind=kind_phys), pointer :: sncovr (:) => null() !< snow cover in fraction over land + real (kind=kind_phys), pointer :: sncovr_ice (:) => null() !< snow cover in fraction over ice (RUC LSM only) real (kind=kind_phys), pointer :: snoalb (:) => null() !< maximum snow albedo in fraction real (kind=kind_phys), pointer :: alvsf (:) => null() !< mean vis albedo with strong cosz dependency real (kind=kind_phys), pointer :: alnsf (:) => null() !< mean nir albedo with strong cosz dependency @@ -347,20 +348,22 @@ module GFS_typedefs real (kind=kind_phys), pointer :: qrain (:) => null() !< nst_fld%qrain sensible heat flux due to rainfall (watts) ! Soil properties for RUC LSM (number of levels different from NOAH 4-layer model) - real (kind=kind_phys), pointer :: wetness(:) => null() !< normalized soil wetness for lsm - real (kind=kind_phys), pointer :: sh2o(:,:) => null() !< volume fraction of unfrozen soil moisture for lsm - real (kind=kind_phys), pointer :: keepsmfr(:,:) => null() !< RUC LSM: frozen moisture in soil - real (kind=kind_phys), pointer :: smois(:,:) => null() !< volumetric fraction of soil moisture for lsm - real (kind=kind_phys), pointer :: tslb(:,:) => null() !< soil temperature for land surface model - real (kind=kind_phys), pointer :: flag_frsoil(:,:) => null() !< RUC LSM: flag for frozen soil physics + real (kind=kind_phys), pointer :: wetness(:) => null() !< normalized soil wetness for lsm + real (kind=kind_phys), pointer :: sh2o(:,:) => null() !< volume fraction of unfrozen soil moisture for lsm + real (kind=kind_phys), pointer :: keepsmfr(:,:) => null() !< RUC LSM: frozen moisture in soil + real (kind=kind_phys), pointer :: smois(:,:) => null() !< volumetric fraction of soil moisture for lsm + real (kind=kind_phys), pointer :: tslb(:,:) => null() !< soil temperature for land surface model + real (kind=kind_phys), pointer :: flag_frsoil(:,:) => null() !< RUC LSM: flag for frozen soil physics ! - real (kind=kind_phys), pointer :: clw_surf(:) => null() !< RUC LSM: moist cloud water mixing ratio at surface - real (kind=kind_phys), pointer :: qwv_surf(:) => null() !< RUC LSM: water vapor mixing ratio at surface - real (kind=kind_phys), pointer :: cndm_surf(:) => null() !< RUC LSM: surface condensation mass - real (kind=kind_phys), pointer :: rhofr(:) => null() !< RUC LSM: density of frozen precipitation - real (kind=kind_phys), pointer :: tsnow(:) => null() !< RUC LSM: snow temperature at the bottom of the first soil layer - real (kind=kind_phys), pointer :: snowfallac(:) => null() !< ruc lsm diagnostics - real (kind=kind_phys), pointer :: acsnow(:) => null() !< ruc lsm diagnostics + real (kind=kind_phys), pointer :: clw_surf_land(:) => null() !< RUC LSM: moist cloud water mixing ratio at surface over land + real (kind=kind_phys), pointer :: clw_surf_ice(:) => null() !< RUC LSM: moist cloud water mixing ratio at surface over ice + real (kind=kind_phys), pointer :: qwv_surf_land(:) => null() !< RUC LSM: water vapor mixing ratio at surface over land + real (kind=kind_phys), pointer :: qwv_surf_ice(:) => null() !< RUC LSM: water vapor mixing ratio at surface over ice + real (kind=kind_phys), pointer :: rhofr(:) => null() !< RUC LSM: density of frozen precipitation + real (kind=kind_phys), pointer :: tsnow_land(:) => null() !< RUC LSM: snow temperature at the bottom of the first snow layer over land + real (kind=kind_phys), pointer :: tsnow_ice(:) => null() !< RUC LSM: snow temperature at the bottom of the first snow layer over ice + real (kind=kind_phys), pointer :: snowfallac_land(:) => null() !< ruc lsm diagnostics over land + real (kind=kind_phys), pointer :: snowfallac_ice(:) => null() !< ruc lsm diagnostics over ice ! MYNN surface layer real (kind=kind_phys), pointer :: ustm (:) => null() !u* including drag @@ -773,11 +776,13 @@ module GFS_typedefs integer :: isot !< isot = 0 => Zobler soil type ( 9 category) !< isot = 1 => STATSGO soil type (19 category, AKA 'STAS'(?)) !< isot = 2 => STAS-RUC soil type (19 category, NOAH WRFv4 only) - integer :: kice=2 !< number of layers in sice + integer :: kice !< number of layers in sice integer :: lsoil_lsm !< number of soil layers internal to land surface model integer :: lsnow_lsm !< maximum number of snow layers internal to land surface model integer :: lsnow_lsm_lbound!< lower bound for snow arrays, depending on lsnow_lsm - real(kind=kind_phys), pointer :: zs(:) => null() !< depth of soil levels for land surface model + real(kind=kind_phys), pointer :: zs(:) => null() !< depth of soil levels for land surface model + real(kind=kind_phys), pointer :: pores(:) => null() !< max soil moisture for a given soil type for land surface model + real(kind=kind_phys), pointer :: resid(:) => null() !< min soil moisture for a given soil type for land surface model logical :: rdlai !< read LAI from input file (for RUC LSM or NOAH LSM WRFv4) logical :: ua_phys !< flag for using University of Arizona? extension to NOAH LSM WRFv4 logical :: usemonalb !< flag to read surface diffused shortwave albedo from input file for NOAH LSM WRFv4 @@ -1057,6 +1062,8 @@ module GFS_typedefs integer :: skeb_npass integer :: lndp_type 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) :: lndp_var_list(6) ! dimension here must match n_var_max_lndp in stochy_nml_def real(kind=kind_phys) :: lndp_prt_list(6) ! dimension here must match n_var_max_lndp in stochy_nml_def ! also previous code had dimension 5 for each pert, to allow @@ -1357,7 +1364,7 @@ module GFS_typedefs !--- Out (radiation only) real (kind=kind_phys), pointer :: htrsw (:,:) => null() !< swh total sky sw heating rate in k/sec real (kind=kind_phys), pointer :: htrlw (:,:) => null() !< hlw total sky lw heating rate in k/sec - real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo + real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo real (kind=kind_phys), pointer :: coszen(:) => null() !< mean cos of zenith angle over rad call period real (kind=kind_phys), pointer :: tsflw (:) => null() !< surface air temp during lw calculation in k @@ -1540,7 +1547,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: upd_mf (:,:) => null() !< instantaneous convective updraft mass flux real (kind=kind_phys), pointer :: dwn_mf (:,:) => null() !< instantaneous convective downdraft mass flux real (kind=kind_phys), pointer :: det_mf (:,:) => null() !< instantaneous convective detrainment mass flux - real (kind=kind_phys), pointer :: cldcov (:,:) => null() !< instantaneous 3D cloud fraction !--- F-A MP scheme real (kind=kind_phys), pointer :: train (:,:) => null() !< accumulated stratiform T tendency (K s-1) real (kind=kind_phys), pointer :: cldfra (:,:) => null() !< instantaneous 3D cloud fraction @@ -1694,13 +1700,11 @@ module GFS_typedefs real (kind=kind_phys), pointer :: cld1d(:) => null() !< real (kind=kind_phys), pointer :: clouds(:,:,:) => null() !< real (kind=kind_phys), pointer :: clw(:,:,:) => null() !< - real (kind=kind_phys), pointer :: clw_surf(:) => null() !< real (kind=kind_phys), pointer :: clx(:,:) => null() !< real (kind=kind_phys), pointer :: cmc(:) => null() !< real (kind=kind_phys), pointer :: cmm_ice(:) => null() !< real (kind=kind_phys), pointer :: cmm_land(:) => null() !< real (kind=kind_phys), pointer :: cmm_ocean(:) => null() !< - real (kind=kind_phys), pointer :: cndm_surf(:) => null() !< real (kind=kind_phys), pointer :: cnv_dqldt(:,:) => null() !< real (kind=kind_phys), pointer :: cnv_fice(:,:) => null() !< real (kind=kind_phys), pointer :: cnv_mfd(:,:) => null() !< @@ -1946,7 +1950,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: tsfc_land_save(:) => null() !< real (kind=kind_phys), pointer :: tsfc_ocean(:) => null() !< real (kind=kind_phys), pointer :: tsfg(:) => null() !< - real (kind=kind_phys), pointer :: tsnow(:) => null() !< real (kind=kind_phys), pointer :: tsurf(:) => null() !< real (kind=kind_phys), pointer :: tsurf_ice(:) => null() !< real (kind=kind_phys), pointer :: tsurf_land(:) => null() !< @@ -2263,7 +2266,6 @@ subroutine sfcprop_create (Sfcprop, IM, Model) Sfcprop%hprime = clear_val !--- In (radiation only) - allocate (Sfcprop%sncovr (IM)) allocate (Sfcprop%snoalb (IM)) allocate (Sfcprop%alvsf (IM)) allocate (Sfcprop%alnsf (IM)) @@ -2272,7 +2274,6 @@ subroutine sfcprop_create (Sfcprop, IM, Model) allocate (Sfcprop%facsf (IM)) allocate (Sfcprop%facwf (IM)) - Sfcprop%sncovr = clear_val Sfcprop%snoalb = clear_val Sfcprop%alvsf = clear_val Sfcprop%alnsf = clear_val @@ -2317,6 +2318,9 @@ subroutine sfcprop_create (Sfcprop, IM, Model) allocate (Sfcprop%hice (IM)) allocate (Sfcprop%weasd (IM)) allocate (Sfcprop%sncovr (IM)) + if (Model%lsm == Model%lsm_ruc) then + allocate (Sfcprop%sncovr_ice (IM)) + end if allocate (Sfcprop%canopy (IM)) allocate (Sfcprop%ffmm (IM)) allocate (Sfcprop%ffhh (IM)) @@ -2330,6 +2334,9 @@ subroutine sfcprop_create (Sfcprop, IM, Model) Sfcprop%hice = clear_val Sfcprop%weasd = clear_val Sfcprop%sncovr = clear_val + if (Model%lsm == Model%lsm_ruc) then + Sfcprop%sncovr_ice = clear_val + end if Sfcprop%canopy = clear_val Sfcprop%ffmm = clear_val Sfcprop%ffhh = clear_val @@ -2507,33 +2514,37 @@ subroutine sfcprop_create (Sfcprop, IM, Model) if (Model%lsm == Model%lsm_ruc) then ! For land surface models with different numbers of levels than the four NOAH levels - allocate (Sfcprop%wetness (IM)) - allocate (Sfcprop%sh2o (IM,Model%lsoil_lsm)) - allocate (Sfcprop%keepsmfr (IM,Model%lsoil_lsm)) - allocate (Sfcprop%smois (IM,Model%lsoil_lsm)) - allocate (Sfcprop%tslb (IM,Model%lsoil_lsm)) - allocate (Sfcprop%flag_frsoil (IM,Model%lsoil_lsm)) - allocate (Sfcprop%clw_surf (IM)) - allocate (Sfcprop%qwv_surf (IM)) - allocate (Sfcprop%cndm_surf (IM)) - allocate (Sfcprop%rhofr (IM)) - allocate (Sfcprop%tsnow (IM)) - allocate (Sfcprop%snowfallac (IM)) - allocate (Sfcprop%acsnow (IM)) + allocate (Sfcprop%wetness (IM)) + allocate (Sfcprop%sh2o (IM,Model%lsoil_lsm)) + allocate (Sfcprop%keepsmfr (IM,Model%lsoil_lsm)) + allocate (Sfcprop%smois (IM,Model%lsoil_lsm)) + allocate (Sfcprop%tslb (IM,Model%lsoil_lsm)) + allocate (Sfcprop%flag_frsoil (IM,Model%lsoil_lsm)) + allocate (Sfcprop%clw_surf_land (IM)) + allocate (Sfcprop%clw_surf_ice (IM)) + allocate (Sfcprop%qwv_surf_land (IM)) + allocate (Sfcprop%qwv_surf_ice (IM)) + allocate (Sfcprop%rhofr (IM)) + allocate (Sfcprop%tsnow_land (IM)) + allocate (Sfcprop%tsnow_ice (IM)) + allocate (Sfcprop%snowfallac_land (IM)) + allocate (Sfcprop%snowfallac_ice (IM)) ! - Sfcprop%wetness = clear_val - Sfcprop%sh2o = clear_val - Sfcprop%keepsmfr = clear_val - Sfcprop%smois = clear_val - Sfcprop%tslb = clear_val - Sfcprop%clw_surf = clear_val - Sfcprop%qwv_surf = clear_val - Sfcprop%cndm_surf = clear_val - Sfcprop%flag_frsoil = clear_val - Sfcprop%rhofr = clear_val - Sfcprop%tsnow = clear_val - Sfcprop%snowfallac = clear_val - Sfcprop%acsnow = clear_val + Sfcprop%wetness = clear_val + Sfcprop%sh2o = clear_val + Sfcprop%keepsmfr = clear_val + Sfcprop%smois = clear_val + Sfcprop%tslb = clear_val + Sfcprop%clw_surf_land = clear_val + Sfcprop%clw_surf_ice = clear_val + Sfcprop%qwv_surf_land = clear_val + Sfcprop%qwv_surf_ice = clear_val + Sfcprop%flag_frsoil = clear_val + Sfcprop%rhofr = clear_val + Sfcprop%tsnow_land = clear_val + Sfcprop%tsnow_ice = clear_val + Sfcprop%snowfallac_land = clear_val + Sfcprop%snowfallac_ice = clear_val ! if (Model%rdlai) then allocate (Sfcprop%xlaixy (IM)) @@ -3055,6 +3066,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & integer :: iopt_thcnd = 1 !< option to treat thermal conductivity in Noah LSM (new in 3.8) !< = 1, original (default) !< = 2, McCumber and Pielke for silt loam and sandy loam + integer :: kice = 2 !< number of layers in ice; default is 2 (GFS sice) integer :: ivegsrc = 2 !< ivegsrc = 0 => USGS, !< ivegsrc = 1 => IGBP (20 category) !< ivegsrc = 2 => UMD (13 category) @@ -3331,8 +3343,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & logical :: do_shum = .false. logical :: do_skeb = .false. integer :: skeb_npass = 11 - integer :: lndp_type = 0 - integer :: n_var_lndp = 0 + integer :: lndp_type = 0 + integer :: n_var_lndp = 0 + logical :: lndp_each_step = .false. !--- aerosol scavenging factors character(len=20) :: fscav_aero(20) = 'default' @@ -3373,7 +3386,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- max hourly avg_max_length, & !--- land/surface model control - lsm, lsoil, lsoil_lsm, lsnow_lsm, rdlai, & + lsm, lsoil, lsoil_lsm, lsnow_lsm, kice, rdlai, & nmtvr, ivegsrc, use_ufo, iopt_thcnd, ua_phys, usemonalb, & aoasis, fasdas, & ! Noah MP options @@ -3405,7 +3418,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & do_deep, jcap, & cs_parm, flgmin, cgwf, ccwf, cdmbgwd, sup, ctei_rm, crtrh, & dlqf, rbcr, shoc_parm, psauras, prauras, wminras, & - do_sppt, do_shum, do_skeb, lndp_type, n_var_lndp, & + do_sppt, do_shum, do_skeb, & + lndp_type, n_var_lndp, lndp_each_step, & !--- Rayleigh friction prslrd0, ral_ts, ldiag_ugwp, do_ugwp, do_tofd, & ! --- Ferrier-Aligo @@ -3816,6 +3830,14 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & allocate (Model%zs(Model%lsoil_lsm)) Model%zs = clear_val end if + ! Set number of ice model layers + Model%kice = kice + + ! Allocate variable for min/max soil moisture for a given soil type + allocate (Model%pores(30)) + allocate (Model%resid(30)) + Model%pores = clear_val + Model%resid = clear_val ! if (lsnow_lsm /= 3) then write(0,*) 'Logic error: NoahMP expects the maximum number of snow layers to be exactly 3 (see sfc_noahmp_drv.f)' @@ -4043,6 +4065,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%do_skeb = do_skeb Model%lndp_type = lndp_type Model%n_var_lndp = n_var_lndp + Model%lndp_each_step = lndp_each_step !--- cellular automata options Model%nca = nca @@ -4893,6 +4916,9 @@ subroutine control_print(Model) print *, ' usemonalb : ', Model%usemonalb print *, ' aoasis : ', Model%aoasis print *, ' fasdas : ', Model%fasdas + print *, ' kice : ', Model%kice + print *, ' shape(pores) : ', shape(Model%pores) + print *, ' shape(resid) : ', shape(Model%resid) print *, ' ivegsrc : ', Model%ivegsrc print *, ' isot : ', Model%isot @@ -5047,7 +5073,8 @@ subroutine control_print(Model) print *, ' do_shum : ', Model%do_shum print *, ' do_skeb : ', Model%do_skeb print *, ' lndp_type : ', Model%lndp_type - print *, ' n_var_lndp : ', Model%n_var_lndp + print *, ' n_var_lndp : ', Model%n_var_lndp + print *, ' lndp_each_step : ', Model%lndp_each_step print *, ' ' print *, 'cellular automata' print *, ' nca : ', Model%nca @@ -5575,7 +5602,6 @@ subroutine diag_create (Diag, IM, Model) ! allocate (Diag%upd_mf (IM,Model%levs)) ! allocate (Diag%dwn_mf (IM,Model%levs)) ! allocate (Diag%det_mf (IM,Model%levs)) -! allocate (Diag%cldcov (IM,Model%levs)) endif !vay-2018 @@ -5770,9 +5796,6 @@ subroutine diag_rad_zero(Diag, Model) Diag%topfsw%upfx0 = zero Diag%topflw%upfxc = zero Diag%topflw%upfx0 = zero - if (Model%ldiag3d) then - Diag%cldcov = zero - endif end subroutine diag_rad_zero @@ -5914,11 +5937,11 @@ subroutine diag_phys_zero (Diag, Model, linit, iauwindow_center) Diag%dv3dt = zero Diag%dt3dt = zero if (Model%qdiag3d) then - Diag%dq3dt = zero + Diag%dq3dt = zero +! Diag%upd_mf = zero +! Diag%dwn_mf = zero +! Diag%det_mf = zero endif -! Diag%upd_mf = zero -! Diag%dwn_mf = zero -! Diag%det_mf = zero endif ! diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index c8a686295..171c8ac4c 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -613,6 +613,14 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys +[sncovr_ice] + standard_name = surface_snow_area_fraction_over_ice + long_name = surface snow area fraction over ice + units = frac + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) [snoalb] standard_name = upper_bound_on_max_albedo_over_deep_snow long_name = maximum snow albedo @@ -1273,27 +1281,35 @@ dimensions = (horizontal_loop_extent,soil_vertical_dimension_for_land_surface_model) type = real kind = kind_phys - active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) -[clw_surf] - standard_name = cloud_condensed_water_mixing_ratio_at_surface - long_name = moist cloud water mixing ratio at surface + active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) +[clw_surf_land] + standard_name = cloud_condensed_water_mixing_ratio_at_surface_over_land + long_name = moist cloud water mixing ratio at surface over land units = kg kg-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) -[qwv_surf] - standard_name = water_vapor_mixing_ratio_at_surface - long_name = water vapor mixing ratio at surface + active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) +[clw_surf_ice] + standard_name = cloud_condensed_water_mixing_ratio_at_surface_over_ice + long_name = moist cloud water mixing ratio at surface over ice units = kg kg-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) -[cndm_surf] - standard_name = surface_condensation_mass - long_name = surface condensation mass - units = kg m-2 +[qwv_surf_land] + standard_name = water_vapor_mixing_ratio_at_surface_over_land + long_name = water vapor mixing ratio at surface over land + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) +[qwv_surf_ice] + standard_name = water_vapor_mixing_ratio_at_surface_over_ice + long_name = water vapor mixing ratio at surface over ice + units = kg kg-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys @@ -1314,25 +1330,33 @@ type = real kind = kind_phys active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) -[tsnow] - standard_name = snow_temperature_bottom_first_layer - long_name = snow temperature at the bottom of the first snow layer +[tsnow_land] + standard_name = snow_temperature_bottom_first_layer_over_land + long_name = snow temperature at the bottom of the first snow layer over land + units = K + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) +[tsnow_ice] + standard_name = snow_temperature_bottom_first_layer_over_ice + long_name = snow temperature at the bottom of the first snow layer over ice units = K dimensions = (horizontal_loop_extent) type = real kind = kind_phys active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) -[snowfallac] - standard_name = total_accumulated_snowfall +[snowfallac_land] + standard_name = total_accumulated_snowfall_over_land long_name = run-total snow accumulation on the ground units = kg m-2 dimensions = (horizontal_loop_extent) type = real kind = kind_phys - active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) -[acsnow] - standard_name = accumulated_water_equivalent_of_frozen_precip - long_name = snow water equivalent of run-total frozen precip + active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) +[snowfallac_ice] + standard_name = total_accumulated_snowfall_over_ice + long_name = run-total snow accumulation on the ice units = kg m-2 dimensions = (horizontal_loop_extent) type = real @@ -3295,6 +3319,20 @@ type = real kind = kind_phys active = (flag_for_land_surface_scheme == flag_for_ruc_land_surface_scheme) +[pores] + standard_name = maximum_soil_moisture_content_for_land_surface_model + long_name = maximum soil moisture for a given soil type for land surface model + units = m + dimensions = (30) + type = real + kind = kind_phys +[resid] + standard_name = minimum_soil_moisture_content_for_land_surface_model + long_name = minimum soil moisture for a given soil type for land surface model + units = m + dimensions = (30) + type = real + kind = kind_phys [rdlai] standard_name = flag_for_reading_leaf_area_index_from_input long_name = flag for reading leaf area index from initial conditions diff --git a/ccpp/driver/GFS_diagnostics.F90 b/ccpp/driver/GFS_diagnostics.F90 index 13274056c..3f9bafde7 100644 --- a/ccpp/driver/GFS_diagnostics.F90 +++ b/ccpp/driver/GFS_diagnostics.F90 @@ -3023,24 +3023,24 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop if (Model%lsm == Model%lsm_ruc) then idx = idx + 1 ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'snowfall_acc' - ExtDiag(idx)%desc = 'total accumulated frozen precipitation' + ExtDiag(idx)%name = 'snowfall_acc_land' + ExtDiag(idx)%desc = 'total accumulated frozen precipitation over land' ExtDiag(idx)%unit = 'kg m-2' ExtDiag(idx)%mod_name = 'gfs_sfc' allocate (ExtDiag(idx)%data(nblks)) do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%snowfallac(:) + ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%snowfallac_land(:) enddo idx = idx + 1 ExtDiag(idx)%axes = 2 - ExtDiag(idx)%name = 'swe_snowfall_acc' - ExtDiag(idx)%desc = 'accumulated water equivalent of frozen precipitation' + ExtDiag(idx)%name = 'snowfall_acc_ice' + ExtDiag(idx)%desc = 'total accumulated frozen precipitation over ice' ExtDiag(idx)%unit = 'kg m-2' ExtDiag(idx)%mod_name = 'gfs_sfc' allocate (ExtDiag(idx)%data(nblks)) do nb = 1,nblks - ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%acsnow(:) + ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%snowfallac_ice(:) enddo endif diff --git a/ccpp/physics b/ccpp/physics index 13b888979..469cb9051 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 13b8889797519883e473879188c3cd68b887eff1 +Subproject commit 469cb905176e83bb01d9ecaaaaff1ab34d358cc3 diff --git a/ccpp/suites/suite_FV3_GSD_SAR.xml b/ccpp/suites/suite_FV3_GSD_SAR.xml index 08541847a..29f6d3707 100644 --- a/ccpp/suites/suite_FV3_GSD_SAR.xml +++ b/ccpp/suites/suite_FV3_GSD_SAR.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_GSD_noah.xml b/ccpp/suites/suite_FV3_GSD_noah.xml index 4d7d4e00f..42d55a5e4 100644 --- a/ccpp/suites/suite_FV3_GSD_noah.xml +++ b/ccpp/suites/suite_FV3_GSD_noah.xml @@ -79,7 +79,6 @@ mp_thompson_post GFS_MP_generic_post cu_gf_driver_post - maximum_hourly_diagnostics diff --git a/ccpp/suites/suite_FV3_GSD_v0.xml b/ccpp/suites/suite_FV3_GSD_v0.xml index 06c4d7dcd..0d6531d19 100644 --- a/ccpp/suites/suite_FV3_GSD_v0.xml +++ b/ccpp/suites/suite_FV3_GSD_v0.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 @@ -81,7 +78,6 @@ mp_thompson_post GFS_MP_generic_post cu_gf_driver_post - maximum_hourly_diagnostics diff --git a/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml b/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml index 2d4ac468e..76f22cfed 100644 --- a/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml +++ b/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml @@ -55,9 +55,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_GSD_v0_drag_suite.xml b/ccpp/suites/suite_FV3_GSD_v0_drag_suite.xml index 7d55abfd2..21d45de21 100644 --- a/ccpp/suites/suite_FV3_GSD_v0_drag_suite.xml +++ b/ccpp/suites/suite_FV3_GSD_v0_drag_suite.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_GSD_v0_mynnsfc.xml b/ccpp/suites/suite_FV3_GSD_v0_mynnsfc.xml index b3b629550..d19d991f2 100644 --- a/ccpp/suites/suite_FV3_GSD_v0_mynnsfc.xml +++ b/ccpp/suites/suite_FV3_GSD_v0_mynnsfc.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite.xml b/ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite.xml index 8a717abc3..8a8d69b88 100644 --- a/ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite.xml +++ b/ccpp/suites/suite_FV3_GSD_v0_unified_ugwp_suite.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_HRRR.xml b/ccpp/suites/suite_FV3_HRRR.xml index 4487b8e27..c74fe17f8 100644 --- a/ccpp/suites/suite_FV3_HRRR.xml +++ b/ccpp/suites/suite_FV3_HRRR.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/ccpp/suites/suite_FV3_RAP.xml b/ccpp/suites/suite_FV3_RAP.xml index 9440efa69..da3fe46bf 100644 --- a/ccpp/suites/suite_FV3_RAP.xml +++ b/ccpp/suites/suite_FV3_RAP.xml @@ -45,9 +45,6 @@ sfc_nst sfc_nst_post lsm_ruc - lsm_ruc_sfc_sice_pre - sfc_sice - lsm_ruc_sfc_sice_post GFS_surface_loop_control_part2 diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 92c18507e..9fa3bca70 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -505,9 +505,9 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta if (Model%lsm == Model%lsm_ruc .and. warm_start) then if(Model%rdlai) then - nvar_s2r = 7 + nvar_s2r = 11 else - nvar_s2r = 6 + nvar_s2r = 10 end if nvar_s3 = 5 else @@ -833,13 +833,17 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta sfc_name2(nvar_s2m+47) = 'rechxy' else if (Model%lsm == Model%lsm_ruc .and. warm_start) then sfc_name2(nvar_s2m+19) = 'wetness' - sfc_name2(nvar_s2m+20) = 'clw_surf' - sfc_name2(nvar_s2m+21) = 'qwv_surf' - sfc_name2(nvar_s2m+22) = 'tsnow' - sfc_name2(nvar_s2m+23) = 'snowfall_acc' - sfc_name2(nvar_s2m+24) = 'swe_snowfall_acc' + sfc_name2(nvar_s2m+20) = 'clw_surf_land' + sfc_name2(nvar_s2m+21) = 'clw_surf_ice' + sfc_name2(nvar_s2m+22) = 'qwv_surf_land' + sfc_name2(nvar_s2m+23) = 'qwv_surf_ice' + sfc_name2(nvar_s2m+24) = 'tsnow_land' + sfc_name2(nvar_s2m+25) = 'tsnow_ice' + sfc_name2(nvar_s2m+26) = 'snowfall_acc_land' + sfc_name2(nvar_s2m+27) = 'snowfall_acc_ice' + sfc_name2(nvar_s2m+28) = 'sncovr_ice' if (Model%rdlai) then - sfc_name2(nvar_s2m+25) = 'lai' + sfc_name2(nvar_s2m+29) = 'lai' endif else if (Model%lsm == Model%lsm_ruc .and. Model%rdlai) then sfc_name2(nvar_s2m+19) = 'lai' @@ -1097,17 +1101,21 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta if (Model%lsm == Model%lsm_ruc .and. warm_start) then !--- Extra RUC variables - Sfcprop(nb)%wetness(ix) = sfc_var2(i,j,nvar_s2m+19) - Sfcprop(nb)%clw_surf(ix) = sfc_var2(i,j,nvar_s2m+20) - Sfcprop(nb)%qwv_surf(ix) = sfc_var2(i,j,nvar_s2m+21) - Sfcprop(nb)%tsnow(ix) = sfc_var2(i,j,nvar_s2m+22) - Sfcprop(nb)%snowfallac(ix) = sfc_var2(i,j,nvar_s2m+23) - Sfcprop(nb)%acsnow(ix) = sfc_var2(i,j,nvar_s2m+24) + Sfcprop(nb)%wetness(ix) = sfc_var2(i,j,nvar_s2m+19) + Sfcprop(nb)%clw_surf_land(ix) = sfc_var2(i,j,nvar_s2m+20) + Sfcprop(nb)%clw_surf_ice(ix) = sfc_var2(i,j,nvar_s2m+21) + Sfcprop(nb)%qwv_surf_land(ix) = sfc_var2(i,j,nvar_s2m+22) + Sfcprop(nb)%qwv_surf_ice(ix) = sfc_var2(i,j,nvar_s2m+23) + Sfcprop(nb)%tsnow_land(ix) = sfc_var2(i,j,nvar_s2m+24) + Sfcprop(nb)%tsnow_ice(ix) = sfc_var2(i,j,nvar_s2m+25) + Sfcprop(nb)%snowfallac_land(ix) = sfc_var2(i,j,nvar_s2m+26) + Sfcprop(nb)%snowfallac_ice(ix) = sfc_var2(i,j,nvar_s2m+27) + Sfcprop(nb)%sncovr_ice(ix) = sfc_var2(i,j,nvar_s2m+28) if (Model%rdlai) then - Sfcprop(nb)%xlaixy(ix) = sfc_var2(i,j,nvar_s2m+25) + Sfcprop(nb)%xlaixy(ix) = sfc_var2(i,j,nvar_s2m+29) endif else if (Model%lsm == Model%lsm_ruc .and. Model%rdlai) then - Sfcprop(nb)%xlaixy(ix) = sfc_var2(i,j,nvar_s2m+19) + Sfcprop(nb)%xlaixy(ix) = sfc_var2(i,j,nvar_s2m+19) elseif (Model%lsm == Model%lsm_noahmp) then !--- Extra Noah MP variables Sfcprop(nb)%snowxy(ix) = sfc_var2(i,j,nvar_s2m+19) @@ -1206,7 +1214,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta !--- if sncovr does not exist in the restart, need to create it if (sfc_var2(i,j,32) < -9990.0_r8) then - if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing sncovr') + if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing sncovr') !--- compute sncovr from existing variables !--- code taken directly from read_fix.f !$omp parallel do default(shared) private(nb, ix, vegtyp, rsnow) @@ -1225,6 +1233,13 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain, warm_sta endif enddo enddo + !--- For RUC LSM: create sncovr_ice from sncovr + if (Model%lsm == Model%lsm_ruc) then + if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - fill sncovr_ice with sncovr') + do nb = 1, Atm_block%nblks + Sfcprop(nb)%sncovr_ice(:) = Sfcprop(nb)%sncovr(:) + end do + endif endif ! if (Model%frac_grid) then @@ -1648,9 +1663,9 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta nvar2o = 18 if (Model%lsm == Model%lsm_ruc) then if (Model%rdlai) then - nvar2r = 7 + nvar2r = 11 else - nvar2r = 6 + nvar2r = 10 endif nvar3 = 5 else @@ -1774,13 +1789,17 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta sfc_name2(nvar2m+18) = 'qrain' if (Model%lsm == Model%lsm_ruc) then sfc_name2(nvar2m+19) = 'wetness' - sfc_name2(nvar2m+20) = 'clw_surf' - sfc_name2(nvar2m+21) = 'qwv_surf' - sfc_name2(nvar2m+22) = 'tsnow' - sfc_name2(nvar2m+23) = 'snowfall_acc' - sfc_name2(nvar2m+24) = 'swe_snowfall_acc' + sfc_name2(nvar2m+20) = 'clw_surf_land' + sfc_name2(nvar2m+21) = 'clw_surf_ice' + sfc_name2(nvar2m+22) = 'qwv_surf_land' + sfc_name2(nvar2m+23) = 'qwv_surf_ice' + sfc_name2(nvar2m+24) = 'tsnow_land' + sfc_name2(nvar2m+25) = 'tsnow_ice' + sfc_name2(nvar2m+26) = 'snowfall_acc_land' + sfc_name2(nvar2m+27) = 'snowfall_acc_ice' + sfc_name2(nvar2m+28) = 'sncovr_ice' if (Model%rdlai) then - sfc_name2(nvar2m+25) = 'lai' + sfc_name2(nvar2m+29) = 'lai' endif else if(Model%lsm == Model%lsm_noahmp) then ! Only needed when Noah MP LSM is used - 29 2D @@ -1979,13 +1998,17 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta if (Model%lsm == Model%lsm_ruc) then !--- Extra RUC variables sfc_var2(i,j,nvar2m+19) = Sfcprop(nb)%wetness(ix) - sfc_var2(i,j,nvar2m+20) = Sfcprop(nb)%clw_surf(ix) - sfc_var2(i,j,nvar2m+21) = Sfcprop(nb)%qwv_surf(ix) - sfc_var2(i,j,nvar2m+22) = Sfcprop(nb)%tsnow(ix) - sfc_var2(i,j,nvar2m+23) = Sfcprop(nb)%snowfallac(ix) - sfc_var2(i,j,nvar2m+24) = Sfcprop(nb)%acsnow(ix) + sfc_var2(i,j,nvar2m+20) = Sfcprop(nb)%clw_surf_land(ix) + sfc_var2(i,j,nvar2m+21) = Sfcprop(nb)%clw_surf_ice(ix) + sfc_var2(i,j,nvar2m+22) = Sfcprop(nb)%qwv_surf_land(ix) + sfc_var2(i,j,nvar2m+23) = Sfcprop(nb)%qwv_surf_ice(ix) + sfc_var2(i,j,nvar2m+24) = Sfcprop(nb)%tsnow_land(ix) + sfc_var2(i,j,nvar2m+25) = Sfcprop(nb)%tsnow_ice(ix) + sfc_var2(i,j,nvar2m+26) = Sfcprop(nb)%snowfallac_land(ix) + sfc_var2(i,j,nvar2m+27) = Sfcprop(nb)%snowfallac_ice(ix) + sfc_var2(i,j,nvar2m+28) = Sfcprop(nb)%sncovr_ice(ix) if (Model%rdlai) then - sfc_var2(i,j,nvar2m+25) = Sfcprop(nb)%xlaixy(ix) + sfc_var2(i,j,nvar2m+29) = Sfcprop(nb)%xlaixy(ix) endif else if (Model%lsm == Model%lsm_noahmp) then !--- Extra Noah MP variables diff --git a/stochastic_physics/stochastic_physics_wrapper.F90 b/stochastic_physics/stochastic_physics_wrapper.F90 index 5a3701aa8..479270a9f 100644 --- a/stochastic_physics/stochastic_physics_wrapper.F90 +++ b/stochastic_physics/stochastic_physics_wrapper.F90 @@ -13,10 +13,25 @@ module stochastic_physics_wrapper_mod real(kind=kind_phys), dimension(:,:,:), allocatable, save :: skebv_wts real(kind=kind_phys), dimension(:,:,:), allocatable, save :: sfc_wts + integer, save :: lsoil = -999 real(kind=kind_phys), dimension(:,:,:), allocatable, save :: smc real(kind=kind_phys), dimension(:,:,:), allocatable, save :: stc real(kind=kind_phys), dimension(:,:,:), allocatable, save :: slc + ! real(kind=kind_phys), dimension(:,:), allocatable, save :: vfrac + !albedo + real(kind=kind_phys), dimension(:,:), allocatable, save :: snoalb + real(kind=kind_phys), dimension(:,:), allocatable, save :: alvsf + real(kind=kind_phys), dimension(:,:), allocatable, save :: alnsf + real(kind=kind_phys), dimension(:,:), allocatable, save :: alvwf + real(kind=kind_phys), dimension(:,:), allocatable, save :: alnwf + real(kind=kind_phys), dimension(:,:), allocatable, save :: facsf + real(kind=kind_phys), dimension(:,:), allocatable, save :: facwf + !emissivity + real(kind=kind_phys), dimension(:,:), allocatable, save :: semis + !roughness length for land + real(kind=kind_phys), dimension(:,:), allocatable, save :: zorll + real(kind=kind_phys), dimension(:,:), allocatable, save :: stype ! For cellular automata @@ -58,7 +73,6 @@ subroutine stochastic_physics_wrapper (GFS_Control, GFS_Data, Atm_block, ierr) use cellular_automata_global_mod, only: cellular_automata_global use cellular_automata_sgs_mod, only: cellular_automata_sgs use lndp_apply_perts_mod, only: lndp_apply_perts - use namelist_soilveg, only: maxsmc implicit none @@ -108,11 +122,25 @@ subroutine stochastic_physics_wrapper (GFS_Control, GFS_Data, Atm_block, ierr) allocate(sfc_wts(1:Atm_block%nblks,maxval(GFS_Control%blksz),1:GFS_Control%n_var_lndp)) end if if (GFS_Control%lndp_type .EQ. 2) then ! save wts, and apply lndp scheme - allocate(smc(1:Atm_block%nblks,maxval(GFS_Control%blksz),GFS_Control%lsoil)) - allocate(slc(1:Atm_block%nblks,maxval(GFS_Control%blksz),GFS_Control%lsoil)) - allocate(stc(1:Atm_block%nblks,maxval(GFS_Control%blksz),GFS_Control%lsoil)) + if (GFS_Control%lsm == GFS_Control%lsm_noah) then + lsoil = GFS_Control%lsoil + elseif (GFS_Control%lsm == GFS_Control%lsm_ruc) then + lsoil = GFS_Control%lsoil_lsm + endif + allocate(smc(1:Atm_block%nblks,maxval(GFS_Control%blksz),lsoil)) + allocate(slc(1:Atm_block%nblks,maxval(GFS_Control%blksz),lsoil)) + allocate(stc(1:Atm_block%nblks,maxval(GFS_Control%blksz),lsoil)) allocate(stype(1:Atm_block%nblks,maxval(GFS_Control%blksz))) allocate(vfrac(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(snoalb(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(alvsf(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(alnsf(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(alvwf(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(alnwf(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(facsf(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(facwf(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(semis(1:Atm_block%nblks,maxval(GFS_Control%blksz))) + allocate(zorll(1:Atm_block%nblks,maxval(GFS_Control%blksz))) endif do nb=1,Atm_block%nblks @@ -171,31 +199,78 @@ subroutine stochastic_physics_wrapper (GFS_Control, GFS_Data, Atm_block, ierr) do nb=1,Atm_block%nblks stype(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%stype(:) - smc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%smc(:,:) - slc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%slc(:,:) - stc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%stc(:,:) vfrac(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%vfrac(:) + snoalb(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%snoalb(:) + alvsf(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%alvsf(:) + alnsf(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%alnsf(:) + alvwf(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%alvwf(:) + alnwf(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%alnwf(:) + facsf(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%facsf(:) + facwf(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%facwf(:) + semis(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Radtend%semis(:) + zorll(nb,1:GFS_Control%blksz(nb)) = GFS_Data(nb)%Sfcprop%zorll(:) end do - ! determine whether land paramaters have been over-written - if (mod(GFS_Control%kdt,GFS_Control%nscyc) == 1) then ! logic copied from GFS_driver - param_update_flag = .true. + if (GFS_Control%lsm == GFS_Control%lsm_noah) then + do nb=1,Atm_block%nblks + smc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%smc(:,:) + slc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%slc(:,:) + stc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%stc(:,:) + end do + elseif (GFS_Control%lsm == GFS_Control%lsm_ruc) then + do nb=1,Atm_block%nblks + smc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%smois(:,:) + slc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%sh2o(:,:) + stc(nb,1:GFS_Control%blksz(nb),:) = GFS_Data(nb)%Sfcprop%tslb(:,:) + end do + endif + + ! determine whether land paramaters have been over-written to + ! trigger applying perturbations (logic copied from GFS_driver), + ! or if perturbations should be applied at every time step + if (mod(GFS_Control%kdt,GFS_Control%nscyc) == 1 ) then + param_update_flag = .true. else - param_update_flag = .false. + param_update_flag = .false. endif - call lndp_apply_perts( GFS_Control%blksz, GFS_Control%lsm, GFS_Control%lsoil, GFS_Control%dtf, & - GFS_Control%n_var_lndp, GFS_Control%lndp_var_list, GFS_Control%lndp_prt_list, & - sfc_wts, xlon, xlat, stype, maxsmc,param_update_flag, smc, slc,stc, vfrac, ierr) + + call lndp_apply_perts(GFS_Control%blksz, GFS_Control%lsm, GFS_Control%lsm_noah, GFS_Control%lsm_ruc, lsoil, & + GFS_Control%dtf, GFS_Control%kdt, GFS_Control%lndp_each_step, & + GFS_Control%n_var_lndp, GFS_Control%lndp_var_list, GFS_Control%lndp_prt_list, & + sfc_wts, xlon, xlat, stype, GFS_Control%pores, GFS_Control%resid,param_update_flag, & + smc, slc, stc, vfrac, alvsf, alnsf, alvwf, alnwf, facsf, facwf, snoalb, semis, zorll, ierr) if (ierr/=0) then write(6,*) 'call to GFS_apply_lndp failed' return endif + do nb=1,Atm_block%nblks - GFS_Data(nb)%Sfcprop%smc(:,:) = smc(nb,1:GFS_Control%blksz(nb),:) - GFS_Data(nb)%Sfcprop%slc(:,:) = slc(nb,1:GFS_Control%blksz(nb),:) - GFS_Data(nb)%Sfcprop%stc(:,:) = stc(nb,1:GFS_Control%blksz(nb),:) - GFS_Data(nb)%Sfcprop%vfrac(:) = vfrac(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%vfrac(:) = vfrac(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%snoalb(:) = snoalb(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%alvsf(:) = alvsf(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%alnsf(:) = alnsf(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%alvwf(:) = alvwf(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%alnwf(:) = alnwf(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%facsf(:) = facsf(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%facwf(:) = facwf(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Radtend%semis(:) = semis(nb,1:GFS_Control%blksz(nb)) + GFS_Data(nb)%Sfcprop%zorll(:) = zorll(nb,1:GFS_Control%blksz(nb)) enddo + + if (GFS_Control%lsm == GFS_Control%lsm_noah) then + do nb=1,Atm_block%nblks + GFS_Data(nb)%Sfcprop%smc(:,:) = smc(nb,1:GFS_Control%blksz(nb),:) + GFS_Data(nb)%Sfcprop%slc(:,:) = slc(nb,1:GFS_Control%blksz(nb),:) + GFS_Data(nb)%Sfcprop%stc(:,:) = stc(nb,1:GFS_Control%blksz(nb),:) + enddo + elseif (GFS_Control%lsm == GFS_Control%lsm_ruc) then + do nb=1,Atm_block%nblks + GFS_Data(nb)%Sfcprop%smois(:,:) = smc(nb,1:GFS_Control%blksz(nb),:) + GFS_Data(nb)%Sfcprop%sh2o(:,:) = slc(nb,1:GFS_Control%blksz(nb),:) + GFS_Data(nb)%Sfcprop%tslb(:,:) = stc(nb,1:GFS_Control%blksz(nb),:) + enddo + endif + endif ! lndp block end if @@ -313,6 +388,7 @@ subroutine stochastic_physics_wrapper_end (GFS_Control) if (allocated(skebv_wts)) deallocate(skebv_wts) end if if ( GFS_Control%lndp_type .EQ. 2 ) then ! this scheme updates through forecast + lsoil = -999 if (allocated(sfc_wts)) deallocate(sfc_wts) end if if (GFS_Control%lndp_type .EQ. 2) then ! save wts, and apply lndp scheme @@ -321,6 +397,15 @@ subroutine stochastic_physics_wrapper_end (GFS_Control) if (allocated(stc)) deallocate(stc) if (allocated(stype)) deallocate(stype) if (allocated(vfrac)) deallocate(vfrac) + if (allocated(snoalb)) deallocate(snoalb) + if (allocated(alvsf)) deallocate(alvsf) + if (allocated(alnsf)) deallocate(alnsf) + if (allocated(alvwf)) deallocate(alvwf) + if (allocated(alnwf)) deallocate(alnwf) + if (allocated(facsf)) deallocate(facsf) + if (allocated(facwf)) deallocate(facwf) + if (allocated(semis)) deallocate(semis) + if (allocated(zorll)) deallocate(zorll) endif call finalize_stochastic_physics() endif