diff --git a/CMakeLists.txt b/CMakeLists.txt index 639030cfc..0af2ea9a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ target_link_libraries(fv3core PRIVATE fms) target_link_libraries(fv3core PRIVATE gfsphysics) target_link_libraries(fv3core PRIVATE ipd) -target_include_directories(fv3core PRIVATE ${ESMF_MOD}) +target_include_directories(fv3core PRIVATE atmos_cubed_sphere ${ESMF_MOD}) # end of fv3core diff --git a/atmos_cubed_sphere b/atmos_cubed_sphere index 042143177..9e1c85631 160000 --- a/atmos_cubed_sphere +++ b/atmos_cubed_sphere @@ -1 +1 @@ -Subproject commit 0421431778c48913eeb82d3f14d61092a867f0f5 +Subproject commit 9e1c856314356366bc41a86231575de04c4f8b47 diff --git a/atmos_model.F90 b/atmos_model.F90 index 534204fb7..8637ed838 100644 --- a/atmos_model.F90 +++ b/atmos_model.F90 @@ -78,7 +78,7 @@ module atmos_model_mod use atmosphere_mod, only: atmosphere_scalar_field_halo use atmosphere_mod, only: atmosphere_get_bottom_layer use atmosphere_mod, only: set_atmosphere_pelist -use atmosphere_mod, only: Atm, mytile +use atmosphere_mod, only: Atm, mygrid use block_control_mod, only: block_control_type, define_blocks_packed use DYCORE_typedefs, only: DYCORE_data_type, DYCORE_diag_type #ifdef CCPP @@ -626,8 +626,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) Init_parm%area => Atmos%area Init_parm%tracer_names => tracer_names #ifdef CCPP - Init_parm%restart = Atm(mytile)%flagstruct%warm_start - Init_parm%hydrostatic = Atm(mytile)%flagstruct%hydrostatic + Init_parm%restart = Atm(mygrid)%flagstruct%warm_start + Init_parm%hydrostatic = Atm(mygrid)%flagstruct%hydrostatic #endif #ifdef INTERNAL_FILE_NML @@ -688,7 +688,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) endif endif - Atm(mytile)%flagstruct%do_skeb = IPD_Control%do_skeb + Atm(mygrid)%flagstruct%do_skeb = IPD_Control%do_skeb ! initialize the IAU module call iau_initialize (IPD_Control,IAU_data,Init_parm) @@ -709,7 +709,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step) call FV3GFS_diag_register (IPD_Diag, Time, Atm_block, IPD_Control, Atmos%lon, Atmos%lat, Atmos%axes) call IPD_initialize_rst (IPD_Control, IPD_Data, IPD_Diag, IPD_Restart, Init_parm) #ifdef CCPP - call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain, Atm(mytile)%flagstruct%warm_start) + call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain, Atm(mygrid)%flagstruct%warm_start) #else call FV3GFS_restart_read (IPD_Data, IPD_Restart, Atm_block, IPD_Control, Atmos%domain) #endif diff --git a/ccpp/build_ccpp.sh b/ccpp/build_ccpp.sh index 8d8ef89ce..fe1f64fe7 100755 --- a/ccpp/build_ccpp.sh +++ b/ccpp/build_ccpp.sh @@ -6,7 +6,7 @@ set -eu # List of valid/tested machines VALID_MACHINES=( wcoss_cray wcoss_dell_p3 gaea.intel jet.intel \ hera.intel hera.gnu orion.intel \ - cheyenne.intel cheyenne.intel-impi cheyenne.gnu cheyenne.pgi endeavor.intel \ + cheyenne.intel cheyenne.intel-impi cheyenne.gnu endeavor.intel \ stampede.intel supermuc_phase2.intel macosx.gnu \ linux.intel linux.gnu linux.pgi ) diff --git a/ccpp/framework b/ccpp/framework index e883bb0f0..9578bf9b3 160000 --- a/ccpp/framework +++ b/ccpp/framework @@ -1 +1 @@ -Subproject commit e883bb0f0245af4cf37084ceb2d692fb90f3ef43 +Subproject commit 9578bf9b34ee92dfcbba69fac283195264211efb diff --git a/ccpp/physics b/ccpp/physics index 783ccf99a..10eaa1afb 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 783ccf99af3c0cb79d45935f917b239216873352 +Subproject commit 10eaa1afb58fc28b6d72da57b93225e95e0b1eb2 diff --git a/ccpp/set_compilers.sh b/ccpp/set_compilers.sh index 8efe19dfe..23143a672 100755 --- a/ccpp/set_compilers.sh +++ b/ccpp/set_compilers.sh @@ -74,14 +74,6 @@ case "$MACHINE_ID" in export F77=mpif77 export F90=mpif90 ;; - cheyenne.pgi) - export CPP="mpicc -E" - export CC=mpicc - export CXX=mpicxx - export FC=mpif90 - export F77=mpif77 - export F90=mpif90 - ;; endeavor.intel) export CC=mpiicc export CXX=mpiicpc diff --git a/gfsphysics/GFS_layer/GFS_diagnostics.F90 b/gfsphysics/GFS_layer/GFS_diagnostics.F90 index 21b85eb91..8620a1576 100644 --- a/gfsphysics/GFS_layer/GFS_diagnostics.F90 +++ b/gfsphysics/GFS_layer/GFS_diagnostics.F90 @@ -13,7 +13,7 @@ module GFS_diagnostics GFS_stateout_type, GFS_sfcprop_type, & GFS_coupling_type, GFS_grid_type, & GFS_tbd_type, GFS_cldprop_type, & - GFS_radtend_type, GFS_diag_type, & + GFS_radtend_type, GFS_diag_type, & GFS_init_type implicit none private @@ -3059,6 +3059,22 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%tsfc(:) enddo + if (Model%frac_grid) then + do num = 1,Model%kice + write (xtra,'(i1)') num + idx = idx + 1 + ExtDiag(idx)%axes = 2 + ExtDiag(idx)%name = 'tiice'//trim(xtra) + ExtDiag(idx)%desc = 'internal ice temperature layer ' // trim(xtra) + ExtDiag(idx)%unit = 'K' + ExtDiag(idx)%mod_name = 'gfs_sfc' + allocate (ExtDiag(idx)%data(nblks)) + do nb = 1,nblks + ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%tiice(:,num) + enddo + enddo + end if + idx = idx + 1 ExtDiag(idx)%axes = 2 ExtDiag(idx)%name = 'tg3' diff --git a/gfsphysics/GFS_layer/GFS_physics_driver.F90 b/gfsphysics/GFS_layer/GFS_physics_driver.F90 index cd7121fa1..14911d13f 100644 --- a/gfsphysics/GFS_layer/GFS_physics_driver.F90 +++ b/gfsphysics/GFS_layer/GFS_physics_driver.F90 @@ -2389,7 +2389,7 @@ subroutine GFS_physics_driver & call satmedmfvdifq(ix, im, levs, nvdiff, ntcw, ntiw, ntke, & dvdt, dudt, dtdt, dqdt, & Statein%ugrs, Statein%vgrs, Statein%tgrs, Statein%qgrs, & - Radtend%htrsw, Radtend%htrlw, xmu, garea, & + Radtend%htrsw, Radtend%htrlw, xmu, garea, islmsk, snowd3, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, & Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & @@ -2642,7 +2642,7 @@ subroutine GFS_physics_driver & call satmedmfvdifq(ix, im, levs, nvdiff, ntcw, ntiwx, ntkev, & dvdt, dudt, dtdt, dvdftra, & Statein%ugrs, Statein%vgrs, Statein%tgrs, vdftra, & - Radtend%htrsw, Radtend%htrlw, xmu, garea, & + Radtend%htrsw, Radtend%htrlw, xmu, garea, islmsk, snowd3, & Statein%prsik(1,1), rb, Sfcprop%zorl, Diag%u10m, Diag%v10m, & Sfcprop%ffmm, Sfcprop%ffhh, Sfcprop%tsfc, hflxq, evapq, & stress, wind, kpbl, Statein%prsi, del, Statein%prsl, & diff --git a/gfsphysics/GFS_layer/GFS_typedefs.F90 b/gfsphysics/GFS_layer/GFS_typedefs.F90 index face75dda..967a4cc64 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.F90 +++ b/gfsphysics/GFS_layer/GFS_typedefs.F90 @@ -240,6 +240,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: tsfco (:) => null() !< sst in K real (kind=kind_phys), pointer :: tsfcl (:) => null() !< surface land temperature in K real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction + real (kind=kind_phys), pointer :: tiice(:,:) => null() !< internal ice temperature real (kind=kind_phys), pointer :: snowd (:) => null() !< snow depth water equivalent in mm ; same as snwdph real (kind=kind_phys), pointer :: zorl (:) => null() !< composite surface roughness in cm real (kind=kind_phys), pointer :: zorlo (:) => null() !< ocean surface roughness in cm @@ -773,6 +774,7 @@ module GFS_typedefs integer :: lsm_noahmp=2 !< flag for NOAH land surface model integer :: lsm_ruc=3 !< flag for RUC land surface model integer :: lsoil !< number of soil layers + integer :: kice=2 !< number of layers in sice #ifdef CCPP 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 @@ -861,6 +863,7 @@ module GFS_typedefs integer :: imfshalcnv_samf = 2 !< flag for SAMF scale- & aerosol-aware mass-flux shallow convection scheme integer :: imfshalcnv_gf = 3 !< flag for scale- & aerosol-aware Grell-Freitas scheme (GSD) integer :: imfshalcnv_ntiedtke = 4 !< flag for new Tiedtke scheme (CAPS) + logical :: hwrf_samfdeep !< flag for HWRF SAMF deepcnv scheme (HWRF) #endif integer :: imfdeepcnv !< flag for mass-flux deep convection scheme !< 1: July 2010 version of SAS conv scheme @@ -874,6 +877,7 @@ module GFS_typedefs integer :: imfdeepcnv_samf = 2 !< flag for SAMF scale- & aerosol-aware mass-flux deep convection scheme integer :: imfdeepcnv_gf = 3 !< flag for scale- & aerosol-aware Grell-Freitas scheme (GSD) integer :: imfdeepcnv_ntiedtke = 4 !< flag for new Tiedtke scheme (CAPS) + logical :: hwrf_samfshal !< flag for HWRF SAMF shalcnv scheme (HWRF) #endif integer :: isatmedmf !< flag for scale-aware TKE-based moist edmf scheme !< 0: initial version of satmedmf (Nov. 2018) @@ -979,7 +983,6 @@ module GFS_typedefs !< nstf_name(5) : zsea2 in mm !--- fractional grid logical :: frac_grid !< flag for fractional grid - logical :: frac_grid_off !< flag for using fractional grid logical :: ignore_lake !< flag for ignoring lakes real(kind=kind_phys) :: min_lakeice !< minimum lake ice value real(kind=kind_phys) :: min_seaice !< minimum sea ice value @@ -2209,6 +2212,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model) allocate (Sfcprop%tsfco (IM)) allocate (Sfcprop%tsfcl (IM)) allocate (Sfcprop%tisfc (IM)) + allocate (Sfcprop%tiice (IM,Model%kice)) allocate (Sfcprop%snowd (IM)) allocate (Sfcprop%zorl (IM)) allocate (Sfcprop%zorlo (IM)) @@ -2225,6 +2229,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model) Sfcprop%tsfco = clear_val Sfcprop%tsfcl = clear_val Sfcprop%tisfc = clear_val + Sfcprop%tiice = clear_val Sfcprop%snowd = clear_val Sfcprop%zorl = clear_val Sfcprop%zorlo = clear_val @@ -3119,6 +3124,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< 1: updated version of satmedmf (as of May 2019) logical :: do_deep = .true. !< whether to do deep convection #ifdef CCPP + logical :: hwrf_samfdeep = .false. !< flag for HWRF SAMF deepcnv scheme + logical :: hwrf_samfshal = .false. !< flag for HWRF SAMF shalcnv scheme logical :: do_mynnedmf = .false. !< flag for MYNN-EDMF logical :: do_mynnsfclay = .false. !< flag for MYNN Surface Layer Scheme ! DH* TODO - move to MYNN namelist section @@ -3215,7 +3222,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !< nstf_name(5) : zsea2 in mm !--- fractional grid logical :: frac_grid = .false. !< flag for fractional grid - logical :: frac_grid_off = .true. !< flag for using fractional grid logical :: ignore_lake = .true. !< flag for ignoring lakes real(kind=kind_phys) :: min_lakeice = 0.15d0 !< minimum lake ice value real(kind=kind_phys) :: min_seaice = 1.0d-11 !< minimum sea ice value @@ -3359,6 +3365,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & gwd_opt, & ! *DH do_myjsfc, do_myjpbl, & + hwrf_samfdeep, hwrf_samfshal, & #endif h2o_phys, pdfcld, shcnvcw, redrag, hybedmf, satmedmf, & shinhong, do_ysu, dspheat, lheatstrg, cnvcld, & @@ -3382,7 +3389,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- near surface sea temperature model nst_anl, lsea, nstf_name, & frac_grid, min_lakeice, min_seaice, min_lake_height, & - frac_grid_off, ignore_lake, & + ignore_lake, & !--- surface layer sfc_z0_type, & ! vertical diffusion @@ -3820,6 +3827,19 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%shoc_parm = shoc_parm Model%shocaftcnv = shocaftcnv Model%shoc_cld = shoc_cld +#ifdef CCPP +!HWRF physics suite + if (hwrf_samfdeep .and. imfdeepcnv/=2) then + write(*,*) 'Logic error: hwrf_samfdeep requires imfdeepcnv=2' + stop + end if + if (hwrf_samfshal .and. imfshalcnv/=2) then + write(*,*) 'Logic error: hwrf_samfshal requires imfshalcnv=2' + stop + end if + Model%hwrf_samfdeep = hwrf_samfdeep + Model%hwrf_samfshal = hwrf_samfshal +#endif #ifdef CCPP if (oz_phys .and. oz_phys_2015) then write(*,*) 'Logic error: can only use one ozone physics option (oz_phys or oz_phys_2015), not both. Exiting.' @@ -3930,7 +3950,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- fractional grid Model%frac_grid = frac_grid - Model%frac_grid_off = frac_grid_off Model%ignore_lake = ignore_lake Model%min_lakeice = min_lakeice Model%min_seaice = min_seaice @@ -4314,7 +4333,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & endif print *,' nst_anl=',Model%nst_anl,' use_ufo=',Model%use_ufo,' frac_grid=',Model%frac_grid,& - ' frac_grid_off=',frac_grid_off,' ignore_lake=',ignore_lake + ' ignore_lake=',ignore_lake print *,' min_lakeice=',Model%min_lakeice,' min_seaice=',Model%min_seaice, & 'min_lake_height=',Model%min_lake_height if (Model%nstf_name(1) > 0 ) then diff --git a/gfsphysics/GFS_layer/GFS_typedefs.meta b/gfsphysics/GFS_layer/GFS_typedefs.meta index a6d1c7ba3..337b3fce8 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.meta +++ b/gfsphysics/GFS_layer/GFS_typedefs.meta @@ -498,6 +498,13 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys +[tiice] + standard_name = internal_ice_temperature + long_name = sea ice internal temperature + units = K + dimensions = (horizontal_dimension,ice_vertical_dimension) + type = real + kind = kind_phys [snowd] standard_name = surface_snow_thickness_water_equivalent long_name = water equivalent snow depth @@ -2835,6 +2842,12 @@ units = flag dimensions = () type = integer +[kice] + standard_name = ice_vertical_dimension + long_name = vertical loop extent for ice levels, start at 1 + units = count + dimensions = () + type = integer [lsoil] standard_name = soil_vertical_dimension long_name = number of soil layers @@ -3167,6 +3180,18 @@ units = flag dimensions = () type = integer +[hwrf_samfdeep] + standard_name = flag_for_hwrf_samfdeepcnv_scheme + long_name = flag for hwrf samfdeepcnv scheme + units = flag + dimensions = () + type = logical +[hwrf_samfshal] + standard_name = flag_for_hwrf_samfshalcnv_scheme + long_name = flag for hwrf samfshalcnv scheme + units = flag + dimensions = () + type = logical [isatmedmf] standard_name = choice_of_scale_aware_TKE_moist_EDMF_PBL long_name = choice of scale-aware TKE moist EDMF PBL scheme diff --git a/gfsphysics/physics/GFS_debug.F90 b/gfsphysics/physics/GFS_debug.F90 index 1914d97f7..57bcc0f45 100644 --- a/gfsphysics/physics/GFS_debug.F90 +++ b/gfsphysics/physics/GFS_debug.F90 @@ -20,6 +20,7 @@ module GFS_diagtoscreen interface print_var module procedure print_logic_0d + module procedure print_logic_1d module procedure print_int_0d module procedure print_int_1d module procedure print_real_0d @@ -106,6 +107,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, do impi=0,mpisize-1 do iomp=0,ompsize-1 if (mpirank==impi .and. omprank==iomp) then + call print_var(mpirank,omprank, blkno, 'Model%kdt' , Model%kdt) ! Sfcprop call print_var(mpirank,omprank, blkno, 'Sfcprop%slmsk' , Sfcprop%slmsk) call print_var(mpirank,omprank, blkno, 'Sfcprop%oceanfrac', Sfcprop%oceanfrac) @@ -544,6 +546,30 @@ subroutine print_int_0d(mpirank,omprank,blkno,name,var) end subroutine print_int_0d + subroutine print_logic_1d(mpirank,omprank,blkno,name,var) + + use machine, only: kind_phys + + implicit none + + integer, intent(in) :: mpirank, omprank, blkno + character(len=*), intent(in) :: name + logical, intent(in) :: var(:) + + integer :: i + +#ifdef PRINT_SUM + write(0,'(2a,3i6,2i8)') 'XXX: ', trim(name), mpirank, omprank, blkno, size(var), count(var) +#elif defined(PRINT_CHKSUM) + write(0,'(2a,3i6,2i8)') 'XXX: ', trim(name), mpirank, omprank, blkno, size(var), count(var) +#else + do i=ISTART,min(IEND,size(var(:))) + write(0,'(2a,3i6,i6,1x,l)') 'XXX: ', trim(name), mpirank, omprank, blkno, i, var(i) + end do +#endif + + end subroutine print_logic_1d + subroutine print_int_1d(mpirank,omprank,blkno,name,var) use machine, only: kind_phys diff --git a/gfsphysics/physics/radsw_datatb.f b/gfsphysics/physics/radsw_datatb.f index ba57d075f..9188d889f 100644 --- a/gfsphysics/physics/radsw_datatb.f +++ b/gfsphysics/physics/radsw_datatb.f @@ -2552,7 +2552,7 @@ module module_radsw_sflux ! !> band index (3rd index in array sfluxref described below) integer, dimension(nblow:nbhgh), public :: ibx - data layreffr/ 18,30, 6, 3, 3, 8, 2, 6, 1, 2, 0,32,58,49 / + data layreffr/ 18,30, 6, 3, 3, 8, 2, 6, 1, 2, 0,32,42,49 / data ix1 / 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 3, 0 / data ix2 / 5, 2, 5, 2, 0, 2, 6, 0, 6, 0, 0, 0, 6, 0 / data ibx / 1, 1, 1, 2, 2, 3, 4, 3, 5, 4, 5, 6, 2, 7 / diff --git a/gfsphysics/physics/samfdeepcnv.f b/gfsphysics/physics/samfdeepcnv.f index 7de9a4c90..25a17d5f4 100644 --- a/gfsphysics/physics/samfdeepcnv.f +++ b/gfsphysics/physics/samfdeepcnv.f @@ -217,7 +217,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, parameter(clamd=0.03,tkemx=0.65,tkemn=0.05) parameter(dtke=tkemx-tkemn) parameter(dbeta=0.1) - parameter(cthk=200.,dthk=25.) + parameter(cthk=150.,dthk=25.) parameter(cinpcrmx=180.,cinpcrmn=120.) ! parameter(cinacrmx=-120.,cinacrmn=-120.) parameter(cinacrmx=-120.,cinacrmn=-80.) @@ -1191,9 +1191,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, ! k = kbcon(i) dp = 1000. * del(i,k) - xmbmax(i) = dp / (2. * g * dt2) -! -! xmbmax(i) = dp / (g * dt2) + xmbmax(i) = dp / (g * dt2) ! ! mbdt(i) = 0.1 * dp / g ! diff --git a/gfsphysics/physics/satmedmfvdifq.f b/gfsphysics/physics/satmedmfvdifq.f index 478e909f0..77ac36b97 100644 --- a/gfsphysics/physics/satmedmfvdifq.f +++ b/gfsphysics/physics/satmedmfvdifq.f @@ -19,7 +19,8 @@ ! !---------------------------------------------------------------------- subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, - & dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu,garea, +!wz & dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu,garea, + & dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu,garea,islimsk,snwdph, & psk,rbsoil,zorl,u10m,v10m,fm,fh, & tsea,heat,evap,stress,spd1,kpbl, & prsi,del,prsl,prslk,phii,phil,delt, @@ -38,6 +39,10 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, !---------------------------------------------------------------------- integer ix, im, km, ntrac, ntcw, ntiw, ntke integer kpbl(im), kinver(im) +! +!wz + integer islimsk(im) + real(kind=kind_phys), dimension(im,3), intent(in) :: snwdph ! real(kind=kind_phys) delt, xkzm_m, xkzm_h, xkzm_s, dspfac, & bl_upfr, bl_dnfr @@ -156,6 +161,8 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, & zlup, zldn, bsum, & tem, tem1, tem2, & ptem, ptem0, ptem1, ptem2 +!wz + real(kind=kind_phys) xkzm_mp, xkzm_hp ! real(kind=kind_phys) ck0, ck1, ch0, ch1, ce0, rchck ! @@ -173,7 +180,7 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, parameter(gamcrt=3.,gamcrq=0.,sfcfrac=0.1) parameter(vk=0.4,rimin=-100.) parameter(rbcr=0.25,zolcru=-0.02,tdzmin=1.e-3) - parameter(rlmn=30.,rlmn1=5.,rlmn2=15.) + parameter(rlmn=30.,rlmn1=5.,rlmn2=10.) parameter(rlmx=300.,elmx=300.) parameter(prmin=0.25,prmax=4.0) parameter(pr0=1.0,prtke=1.0,prscu=0.67) @@ -183,7 +190,7 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, parameter(aphi5=5.,aphi16=16.) parameter(elmfac=1.0,elefac=1.0,cql=100.) parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=5000.) - parameter(qlcr=3.5e-5,zstblmax=2500.,xkzinv=0.15) + parameter(qlcr=3.5e-5,zstblmax=2500.,xkzinv=0.1) parameter(h1=0.33333333) parameter(ck0=0.4,ck1=0.15,ch0=0.4,ch1=0.15) parameter(ce0=0.4) @@ -254,17 +261,37 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, ! xkzm_hx = 0.01 + (xkzm_h - 0.01)/(xkgdx-5.) * (gdx-5.) ! xkzm_mx = 0.01 + (xkzm_h - 0.01)/(xkgdx-5.) * (gdx-5.) ! +!wz do i=1,im + xkzm_mp = xkzm_m + xkzm_hp = xkzm_h +! + if( islimsk(i) == 1 .and. snwdph(i,1) > 10.0 ) then ! over land + if (rbsoil(i) > 0. .and. rbsoil(i) <= 0.25) then + xkzm_mp = xkzm_m * (1.0 - rbsoil(i)/0.25)**2 + + & 0.1 * (1.0 - (1.0-rbsoil(i)/0.25)**2) + xkzm_hp = xkzm_h * (1.0 - rbsoil(i)/0.25)**2 + + & 0.1 * (1.0 - (1.0-rbsoil(i)/0.25)**2) + else if (rbsoil(i) > 0.25) then + xkzm_mp = 0.1 + xkzm_hp = 0.1 + endif + endif +!# kx1(i) = 1 tx1(i) = 1.0 / prsi(i,1) tx2(i) = tx1(i) if(gdx(i) >= xkgdx) then - xkzm_hx(i) = xkzm_h - xkzm_mx(i) = xkzm_m +!wz xkzm_hx(i) = xkzm_h +!wz xkzm_mx(i) = xkzm_m + xkzm_hx(i) = xkzm_hp + xkzm_mx(i) = xkzm_mp else tem = 1. / (xkgdx - 5.) - tem1 = (xkzm_h - 0.01) * tem - tem2 = (xkzm_m - 0.01) * tem +!wz tem1 = (xkzm_h - 0.01) * tem +!wz tem2 = (xkzm_m - 0.01) * tem + tem1 = (xkzm_hp - 0.01) * tem + tem2 = (xkzm_mp - 0.01) * tem ptem = gdx(i) - 5. xkzm_hx(i) = 0.01 + tem1 * ptem xkzm_mx(i) = 0.01 + tem2 * ptem @@ -699,7 +726,7 @@ subroutine satmedmfvdifq(ix,im,km,ntrac,ntcw,ntiw,ntke, ! tem1 = (tvx(i,k+1)-tvx(i,k)) * rdzt(i,k) ! if(tem1 > 1.e-5) then tem1 = tvx(i,k+1)-tvx(i,k) - if(tem1 > 0.) then + if(tem1 > 0. .and. islimsk(i) /= 1 ) then xkzo(i,k) = min(xkzo(i,k), xkzinv) xkzmo(i,k) = min(xkzmo(i,k), xkzinv) rlmnz(i,k) = min(rlmnz(i,k), rlmn2) diff --git a/gfsphysics/physics/sfc_diff.f b/gfsphysics/physics/sfc_diff.f index 5874c01c1..22bfe4289 100644 --- a/gfsphysics/physics/sfc_diff.f +++ b/gfsphysics/physics/sfc_diff.f @@ -139,17 +139,12 @@ subroutine sfc_diff(im,ps,t1,q1,z1, wind, !intent(in) z0max = max(z0max, 1.0e-6) ! czilc = 10.0 ** (- (0.40/0.07) * z0) ! fei's canopy height dependance of czil -! czilc = 0.8 - -! tem1 = 1.0 - sigmaf(i) -! ztmax = z0max*exp( - tem1*tem1 -! & * czilc*ca*sqrt(ustar(i,1)*(0.01/1.5e-05))) -! - czilc = 10.0 ** (- 4. * z0max) ! Trier et al. (2011, WAF) - ztmax = z0max * exp( - czilc * ca - & * 258.2 * sqrt(ustar(i,1)*z0max) ) - + czilc = 0.8 + tem1 = 1.0 - sigmaf(i) + ztmax = z0max*exp( - tem1*tem1 + & * czilc*ca*sqrt(ustar(i,1)*(0.01/1.5e-05))) + ! mg, sfc-perts: add surface perturbations to ztmax/z0max ratio over land if (ztpert(i) /= 0.0) then ztmax = ztmax * (10.**ztpert(i)) @@ -183,16 +178,11 @@ subroutine sfc_diff(im,ps,t1,q1,z1, wind, !intent(in) ! czilc = 10.0 ** (- (0.40/0.07) * z0) ! fei's canopy height ! dependance of czil -! czilc = 0.8 + czilc = 0.8 -! tem1 = 1.0 - sigmaf(i) -! ztmax = z0max*exp( - tem1*tem1 -! & * czilc*ca*sqrt(ustar(i,2)*(0.01/1.5e-05))) -! - czilc = 10.0 ** (- 4. * z0max) ! Trier et al. (2011, WAF) - ztmax = z0max * exp( - czilc * ca - & * 258.2 * sqrt(ustar(i,2)*z0max) ) -! + tem1 = 1.0 - sigmaf(i) + ztmax = z0max*exp( - tem1*tem1 + & * czilc*ca*sqrt(ustar(i,2)*(0.01/1.5e-05))) ztmax = max(ztmax, 1.0e-6) ! call stability diff --git a/io/FV3GFS_io.F90 b/io/FV3GFS_io.F90 index 3065fbff2..4b2738b23 100644 --- a/io/FV3GFS_io.F90 +++ b/io/FV3GFS_io.F90 @@ -82,7 +82,7 @@ module FV3GFS_io_mod !--- GFDL FMS restart containers character(len=32), allocatable, dimension(:) :: oro_name2, sfc_name2, sfc_name3 - real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: oro_var2, sfc_var2, phy_var2 + real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: oro_var2, sfc_var2, phy_var2, sfc_var3ice character(len=32), allocatable, dimension(:) :: oro_ls_ss_name real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: oro_ls_var, oro_ss_var real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: sfc_var3, phy_var3 @@ -94,7 +94,7 @@ module FV3GFS_io_mod integer :: tot_diag_idx = 0 integer :: total_outputlevel = 0 integer :: isco,ieco,jsco,jeco,levo,num_axes_phys - integer :: fhzero, ncld, nsoil, imp_physics, landsfcmdl + integer :: fhzero, ncld, nsoil, imp_physics, landsfcmdl, k real(4) :: dtp logical :: lprecip_accu character(len=64) :: Sprecip_accu @@ -198,9 +198,9 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) ntr = size(IPD_Data(1)%Statein%qgrs,3) if(Model%lsm == Model%lsm_noahmp) then - nsfcprop2d = 149 + nsfcprop2d = 151 else - nsfcprop2d = 100 + nsfcprop2d = 102 endif allocate (temp2d(isc:iec,jsc:jec,nsfcprop2d+Model%ntot3d+Model%nctp)) @@ -326,8 +326,10 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) temp2d(i,j,82) = IPD_Data(nb)%Radtend%sfcflw(ix)%upfx0 temp2d(i,j,83) = IPD_Data(nb)%Radtend%sfcflw(ix)%dnfxc temp2d(i,j,84) = IPD_Data(nb)%Radtend%sfcflw(ix)%dnfx0 + temp2d(i,j,85) = IPD_Data(nb)%Sfcprop%tiice(ix,1) + temp2d(i,j,86) = IPD_Data(nb)%Sfcprop%tiice(ix,2) - idx_opt = 85 + idx_opt = 87 if (Model%lsm == Model%lsm_noahmp) then temp2d(i,j,idx_opt) = IPD_Data(nb)%Sfcprop%snowxy(ix) temp2d(i,j,idx_opt+1) = IPD_Data(nb)%Sfcprop%tvxy(ix) @@ -379,7 +381,7 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block) temp2d(i,j,idx_opt+46) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,2) temp2d(i,j,idx_opt+47) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,3) temp2d(i,j,idx_opt+48) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,4) - idx_opt = 134 + idx_opt = 136 endif if (Model%nstf_name(1) > 0) then @@ -609,7 +611,6 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) call mpp_error(NOTE,'reading topographic/orographic information from INPUT/oro_data.tile*.nc') call restore_state(Oro_restart) - Model%frac_grid = .false. !--- copy data into GFS containers do nb = 1, Atm_block%nblks !--- 2D variables @@ -642,22 +643,11 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) enddo enddo - if (nint(oro_var2(1,1,18)) == -9999._kind_phys) then ! lakefrac doesn't exist in the restart, need to create it - if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - will computing lakefrac') - Model%frac_grid = .false. - elseif (Model%frac_grid_off) then - Model%frac_grid = .false. - else - Model%frac_grid = .true. - endif - - if (Model%me == Model%master ) write(0,*)' resetting Model%frac_grid=',Model%frac_grid - !--- deallocate containers and free restart container deallocate(oro_name2, oro_var2) call free_restart_type(Oro_restart) - +#ifdef CCPP !--- Modify/read-in additional orographic static fields for GSL drag suite if (Model%gwd_opt==3 .or. Model%gwd_opt==33) then if (.not. allocated(oro_ls_ss_name)) then @@ -732,16 +722,16 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) call free_restart_type(Oro_ls_restart) call free_restart_type(Oro_ss_restart) end if - +#endif !--- SURFACE FILE if (.not. allocated(sfc_name2)) then !--- allocate the various containers needed for restarts #ifdef CCPP allocate(sfc_name2(nvar_s2m+nvar_s2o+nvar_s2mp+nvar_s2r)) - allocate(sfc_name3(nvar_s3+nvar_s3mp)) + allocate(sfc_name3(0:nvar_s3+nvar_s3mp)) - allocate(sfc_var2(nx,ny,nvar_s2m+nvar_s2o+nvar_s2mp+nvar_s2r)) + allocate(sfc_var2(nx,ny,nvar_s2m+nvar_s2o+nvar_s2mp+nvar_s2r),sfc_var3ice(nx,ny,Model%kice)) if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp .or. (.not.warm_start)) then allocate(sfc_var3(nx,ny,Model%lsoil,nvar_s3)) else if (Model%lsm == Model%lsm_ruc) then @@ -749,13 +739,14 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) end if #else allocate(sfc_name2(nvar_s2m+nvar_s2o+nvar_s2mp)) - allocate(sfc_name3(nvar_s3+nvar_s3mp)) + allocate(sfc_name3(0:nvar_s3+nvar_s3mp)) allocate(sfc_var2(nx,ny,nvar_s2m+nvar_s2o+nvar_s2mp)) allocate(sfc_var3(nx,ny,Model%lsoil,nvar_s3)) #endif sfc_var2 = -9999._kind_phys sfc_var3 = -9999._kind_phys + sfc_var3ice= -9999._kind_phys ! if (Model%lsm == Model%lsm_noahmp) then allocate(sfc_var3sn(nx,ny,-2:0,4:6)) @@ -801,8 +792,8 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) !--- variables below here are optional sfc_name2(32) = 'sncovr' if(Model%cplflx) then - sfc_name2(33) = 'tsfcl' !temp on land portion of a cell - sfc_name2(34) = 'zorll' !zorl on land portion of a cell + sfc_name2(33) = 'tsfcl' !temp on land portion of a cell + sfc_name2(34) = 'zorll' !zorl on land portion of a cell end if !--- NSSTM inputs only needed when (nstf_name(1) > 0) .and. (nstf_name(2)) == 0) @@ -949,6 +940,12 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) endif #endif !--- register the 3D fields + if (Model%frac_grid) then + sfc_name3(0) = 'tiice' + var3_p => sfc_var3ice(:,:,:) + id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(0), var3_p, domain=fv_domain, mandatory=.false.) + end if + do num = 1,nvar_s3 var3_p => sfc_var3(:,:,:,num) id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(num), var3_p, domain=fv_domain) @@ -1171,6 +1168,10 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) Sfcprop(nb)%flag_frsoil(ix,lsoil) = sfc_var3(i,j,lsoil,5) !--- flag_frsoil enddo end if + + do k = 1,Model%kice + Sfcprop(nb)%tiice(ix,k)= sfc_var3ice(i,j,k) !--- internal ice temp + enddo #else !--- 3D variables do lsoil = 1,Model%lsoil @@ -1239,7 +1240,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) enddo endif - if(Model%cplflx .or. Model%frac_grid) then + if (Model%cplflx .or. Model%frac_grid) then if (nint(sfc_var2(1,1,33)) == -9999) then if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing tsfcl') do nb = 1, Atm_block%nblks @@ -1259,6 +1260,18 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain) endif endif +#ifdef CCPP + if (nint(sfc_var3ice(1,1,1)) == -9999) then + if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing tiice') + do nb = 1, Atm_block%nblks + do ix = 1, Atm_block%blksz(nb) + Sfcprop(nb)%tiice(ix,1) = Sfcprop(nb)%stc(ix,1) !--- initialize internal ice temp from soil temp at layer 1 + Sfcprop(nb)%tiice(ix,2) = Sfcprop(nb)%stc(ix,2) !--- initialize internal ice temp from soil temp at layer 2 + enddo + enddo + endif + +#endif !#endif if(Model%frac_grid) then ! 3-way composite @@ -1645,7 +1658,7 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta !--- allocate the various containers needed for restarts #ifdef CCPP allocate(sfc_name2(nvar2m+nvar2o+nvar2mp+nvar2r)) - allocate(sfc_name3(nvar3+nvar3mp)) + allocate(sfc_name3(0:nvar3+nvar3mp)) allocate(sfc_var2(nx,ny,nvar2m+nvar2o+nvar2mp+nvar2r)) if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp) then allocate(sfc_var3(nx,ny,Model%lsoil,nvar3)) @@ -1654,7 +1667,7 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta endif #else allocate(sfc_name2(nvar2m+nvar2o+nvar2mp)) - allocate(sfc_name3(nvar3+nvar3mp)) + allocate(sfc_name3(0:nvar3+nvar3mp)) allocate(sfc_var2(nx,ny,nvar2m+nvar2o+nvar2mp)) allocate(sfc_var3(nx,ny,Model%lsoil,nvar3)) #endif @@ -1846,6 +1859,12 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta #endif !--- register the 3D fields + if (Model%frac_grid) then + sfc_name3(0) = 'tiice' + var3_p => sfc_var3ice(:,:,:) + id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(0), var3_p, domain=fv_domain) + end if + do num = 1,nvar3 var3_p => sfc_var3(:,:,:,num) id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(num), var3_p, domain=fv_domain) @@ -1985,6 +2004,10 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta endif #ifdef CCPP + do k = 1,Model%kice + sfc_var3ice(i,j,k) = Sfcprop(nb)%tiice(ix,k) !--- internal ice temperature + end do + if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp) then !--- 3D variables do lsoil = 1,Model%lsoil