From 0a71797cac0a52a9b50bd28ab39baae5dfb79772 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Mon, 10 Apr 2023 13:21:54 -0500 Subject: [PATCH 01/81] Adds support for 3-moment rain/graupel/hail in NSSL microphysics scheme Also other various bug fixes etc. --- physics/module_mp_nssl_2mom.F90 | 4774 +++++++++++++++++++++++++++---- physics/mp_nssl.F90 | 78 +- physics/mp_nssl.meta | 38 + 3 files changed, 4371 insertions(+), 519 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index d190e94b4..f2f9707fb 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -1,7 +1,14 @@ !> \file module_mp_nssl_2mom.F90 + + + + + + + !--------------------------------------------------------------------- -! code snapshot: "Feb 24 2022" at "14:27:57" +! code snapshot: "Apr 10 2023" at "13:17:29" !--------------------------------------------------------------------- !--------------------------------------------------------------------- ! IMPORTANT: Best results are attained using the 5th-order WENO (Weighted Essentially Non-Oscillatory) advection option (4) for scalars: @@ -19,17 +26,14 @@ ! WENO references: Jiang and Shu, 1996, J. Comp. Phys. v. 126, 202-223; Shu 2003, Int. J. Comp. Fluid Dyn. v. 17 107-118; ! !>\ingroup mod_mp_nssl2m -!! This module provides a 2-moment bulk microphysics scheme described by -!! Mansell, Zeigler, and Bruning (2010, JAS) -!! -!! This module provides a 2-moment bulk microphysics scheme based on a combination of -!! Straka and Mansell (2005, JAM) and Zeigler (1985, JAS) and modified/upgraded in -!! in Mansell, Zeigler, and Bruning (2010, JAS). Two-moment adaptive sedimentation +!! This module provides a 1/2/3-moment bulk microphysics scheme based on a combination of +!! Straka and Mansell (2005, JAM) and Zeigler (1985, JAS) and modified/upgraded in +!! in Mansell, Zeigler, and Bruning (2010, JAS). Two-moment adaptive sedimentation !! follows Mansell (2010, JAS), using parameter infall = 4. !! !! Added info on graupel density and soaking is in Mansell and Ziegler (2013, JAS) !! -!! Average graupel particle density is predicted, which affects fall speed as well. +!! Average graupel particle density is predicted, which affects fall speed as well. !! Hail density prediction is by default disabled in this version, but may be enabled !! at some point if there is interest. !! @@ -37,19 +41,19 @@ !! !! Microphysics References: !! -!! Mansell, E. R., C. L. Ziegler, and E. C. Bruning, 2010: Simulated electrification of a small +!! Mansell, E. R., C. L. Ziegler, and E. C. Bruning, 2010: Simulated electrification of a small !! thunderstorm with two-moment bulk microphysics. J. Atmos. Sci., 67, 171-194, doi:10. 1175/2009JAS2965.1. !! -!! Mansell, E. R. and C. L. Ziegler, 2013: Aerosol effects on simulated storm electrification and -!! precipitation in a two-moment bulk microphysics model. J. Atmos. Sci., 70 (7), 2032-2050, +!! Mansell, E. R. and C. L. Ziegler, 2013: Aerosol effects on simulated storm electrification and +!! precipitation in a two-moment bulk microphysics model. J. Atmos. Sci., 70 (7), 2032-2050, !! doi:10.1175/JAS-D-12-0264.1. !! -!! Ziegler, C. L., 1985: Retrieval of thermal and microphysical variables in observed convective storms. +!! Ziegler, C. L., 1985: Retrieval of thermal and microphysical variables in observed convective storms. !! Part I: Model development and preliminary testing. J. Atmos. Sci., 42, 1487-1509. !! !! Sedimentation reference: !! -!! Mansell, E. R., 2010: On sedimentation and advection in multimoment bulk microphysics. +!! Mansell, E. R., 2010: On sedimentation and advection in multimoment bulk microphysics. !! J. Atmos. Sci., 67, 3084-3094, doi:10.1175/2010JAS3341.1. ! ! Possible parameters to adjust: @@ -63,9 +67,9 @@ ! Fierro, A. O., E.R. Mansell, C. Ziegler and D. R. MacGorman 2013: The ! implementation of an explicit charging and discharge lightning scheme ! within the WRF-ARW model: Benchmark simulations of a continental squall line, a -! tropical cyclone and a winter storm. Monthly Weather Review, Volume 141, 2390-2415 +! tropical cyclone and a winter storm. Monthly Weather Review, Volume 141, 2390-2415 ! -! Mansell et al. 2005: Charge structure and lightning sensitivity in a simulated +! Mansell et al. 2005: Charge structure and lightning sensitivity in a simulated ! multicell thunderstorm. J. Geophys. Res., 110, D12101, doi:10.1029/2004JD005287 ! ! Note: Some parameters below apply to unreleased features. @@ -74,7 +78,7 @@ !--------------------------------------------------------------------- ! Sept. 2021: ! Fixes: -! Restored previous formulation of snow reflectivity, as it was realized that the last change incorrectly assumed a fixed +! Restored previous formulation of snow reflectivity, as it was realized that the last change incorrectly assumed a fixed ! density independent of size. Generally lower snow reflectivity values as a result (no effect on microphysics) ! Other: ! Generic fall speed coeffecients (axx,bxx) to accomodate future frozen drops category (no effect) @@ -234,8 +238,9 @@ MODULE module_mp_nssl_2mom real , private :: qcmincwrn = 2.0e-3 ! qc threshold for autonconversion (LFO; for 10ICE use qminrncw for ircnw != 5) real , private :: cwdiap = 20.0e-6 ! threshold diameter of cloud drops (Ferrier 1994 autoconversion) real , private :: cwdisp = 0.15 ! assume droplet dispersion parameter (can be 0.3 for maritime) - real , private :: ccn = 0.6e+09 ! set in namelist!! Central plains CCN value - real , public :: qccn ! ccn "mixing ratio" + real , private :: ccn = 0.6e+09 ! set in namelist!! Central plains CCN value + real , private :: ccnuf = 0 ! set in namelist!! Central plains CCN value + real , public :: qccn, qccnuf ! ccn "mixing ratio" real , private :: old_qccn = -1.0 integer, private :: iauttim = 1 ! 10-ice rain delay flag real , private :: auttim = 300. ! 10-ice rain delay time @@ -245,12 +250,17 @@ MODULE module_mp_nssl_2mom ! NMM WRF core does not have special boundary conditions for CCN, therefore set invertccn to true logical, parameter :: invertccn = .true. ! =true for base state of ccn=0, =false for ccn initialized in the base state #else - logical, parameter :: invertccn = .false. ! =true for base state of ccn=0, =false for ccn initialized in the base state + logical, private :: invertccn = .false. ! =true for base state of ccn=0, =false for ccn initialized in the base state #endif logical :: switchccn = .false. real :: old_cccn = -1.0 logical :: restoreccn = .true. ! whether or not to nudge CCN back to base state (qccn) (only applies if CCNA is NOT predicted) real :: ccntimeconst = 3600. ! time constant for CCN restore (either for CCNA or when restoreccn = true) + real, private :: restoreccnfrac = 1.0 ! fraction of evaporated droplets that restore CCN + real :: ufccntimeconst = 6.*3600. ! time constant for UFCCN decay (Blossey et al. 2018) + real :: ufbackground = 0.1e9 ! background ccnuf value (Blossey et al.) + logical :: decayufccn = .false. + integer :: i_uf_or_ccn = 0 ! 0 = ship adds UF; 1 = treat UF as regular ccn (add to qccn) ! sedimentation flags ! itfall -> 0 = 1st order fallout (other options removed) @@ -259,6 +269,7 @@ MODULE module_mp_nssl_2mom integer, private :: itfall = 0 integer, private :: iscfall = 1 integer, private :: irfall = -1 + integer, private :: isfall = 2 ! default limit with method II (more restrictive) logical, private :: do_accurate_sedimentation = .true. ! if true, recalculate fall speeds on sub time steps; (more expensive) ! if false, reuse fall speeds on multiple steps (can have a noticeable speedup) ! Mainly is an issue for small dz near the surface. @@ -269,6 +280,7 @@ MODULE module_mp_nssl_2mom ! 3 -> uses number-wgt for N and Z-weighted correction for N (Method I in Mansell, 2010 JAS) ! 4 -> Hybrid of 2 and 3: Uses minimum N from each method (z-wgt and m-wgt corrections) (Method I+II in Mansell, 2010 JAS) ! 5 -> uses number-wgt for N and uses average of N-wgt and q-wgt instead of Max. + integer :: imydiagalpha = 0 ! apply MY diagnostic shape parameter for fall speeds (1=for fall speed only; 2=also for microphysics rates) real, private :: rainfallfac = 1.0 ! factor to adjust rain fall speed (single moment only) real, private :: icefallfac = 1.5 ! factor to adjust ice fall speed real, private :: snowfallfac = 1.25 ! factor to adjust snow fall speed @@ -277,6 +289,9 @@ MODULE module_mp_nssl_2mom integer, private :: icefallopt = 3 ! 1= default, 2 = Ferrier ice fall speed; 3 = adjusted Ferrier (slightly high Vt) integer, private :: icdx = 3 ! (graupel) 0=Ferrier; 1=leave drag coef. cd fixed; 2=vary by density, 4=set by user with cdxmin,cdxmax,etc. integer, private :: icdxhl = 3 ! (hail) 0=Ferrier; 1=leave drag coef. cd fixed; 2=vary by density, 4=set by user with cdxmin,cdxmax,etc. + real :: axh = 75.7149, bxh = 0.5 + real :: axf = 75.7149, bxf = 0.5 + real :: axhl = 206.984, bxhl = 0.6384 real , private :: cdhmin = 0.45, cdhmax = 0.8 ! defaults for graupel (icdx=4) real , private :: cdhdnmin = 500., cdhdnmax = 800.0 ! defaults for graupel (icdx=4) real , private :: cdhlmin = 0.45, cdhlmax = 0.6 ! defaults for hail (icdx=4) @@ -310,7 +325,7 @@ MODULE module_mp_nssl_2mom integer, private :: irimtim = 0 ! future use ! integer, private :: infdo = 1 ! 1 = calculate number-weighted fall speeds - integer, private :: irimdenopt = 1 ! = 1 for default Macklin; = 2 for experimental Cober and List (1993) + integer, private :: irimdenopt = 1 ! = 1 for default Heymsfield and Pflaum (1985); = 2 for experimental Cober and List (1993); = 3 Macklin real , private :: rimc1 = 300.0, rimc2 = 0.44 ! rime density coeff. and power (Default Heymsfield and Pflaum, 1985) real , private :: rimc3 = 170.0 ! minimum rime density real :: rimc4 = 900.0 ! maximum rime density @@ -347,6 +362,7 @@ MODULE module_mp_nssl_2mom ! 0,2, 5.00e-10, 1, 0, 0, 0 : itype1,itype2,cimas0,icfn,ihrn,ibfc,iacr integer, private :: itype1 = 0, itype2 = 2 ! controls Hallett-Mossop process + integer, private :: in_freeze_rain_first = 0 ! =1 use IN to freezed rain drops (if none, then freeze droplets) integer, private :: icenucopt = 1 ! =1 Meyers/Ferrier primary ice nucleation; =2 Thompson/Cooper, =3 Phillips (Meyers/Demott), =4 DeMott (2010) real, private :: naer = 1.0e6 ! background large aerosol conc. for DeMott integer, private :: icfn = 2 ! contact freezing: 0 = off; 1 = hack (ok for single moment); 2 = full Cotton/Meyers version @@ -357,7 +373,9 @@ MODULE module_mp_nssl_2mom integer, private :: iremoveqwfrz = 1 ! Whether to remove (=1) or not (=0) the newly-frozen cloud droplets (ibfc=1) from the CWC used for charge separation integer, private :: iacr = 2 ! Flag for drop contact freezing with crytals ! (0=off; 1=drops > 500micron diameter; 2 = > 300micron) + integer, private :: icrcev = 1 ! 1 = old crcev; 2 = crcev scaled by vtrain ratio (num/mass); 3 = set to zero integer, private :: icracr = 1 ! Flag to turn rain self-collection on/off (=0 to turn off) + integer, private :: icracrthresh = 1 ! For rain self-coll. thresh. use: 1 = mean diam of 2mm; 2 = rain median volume diam of 1.9mm integer, private :: ibfr = 2 ! Flag for Bigg freezing conversion of freezing drops to graupel ! (1=min graupel size is vr1mm; 2=use min size of dfrz, 5= as for 2 and apply dbz conservation) integer, private :: ibiggopt = 2 ! 1 = old Bigg; 2 = experimental Bigg (only for imurain = 1, however) @@ -413,11 +431,14 @@ MODULE module_mp_nssl_2mom ! set eii1 = 0 to get a constant value of eii0 real , private :: eii0hl = 0.2 ,eii1hl = 0.0 ! hail-crystal coll. eff. parameters: eii0hl*exp(eii1hl*min(temcg(mgs),0.0)) ! set eii1hl = 0 to get a constant value of eii0hl + real, private :: ewi_dcmin = 15.0e-06 ! minimum droplet diameter for nonzero ewi + real, private :: ewi_dimin = 30.0e-06 ! minimum ice crystal diameter for nonzero ewi real , private :: eri0 = 0.1 ! rain efficiency to collect ice crystals real , private :: eri_cimin = 10.e-6 ! minimum ice crystal diameter for collection by rain real , private :: esi0 = 0.1 ! linear factor in snow-ice collection efficiency real , private :: ehs0 = 0.1, ehs1 = 0.1 ! graupel-snow coll. eff. parameters: ehs0*exp(ehs1*min(temcg(mgs),0.0)) ! set ehs1 = 0 to get a constant value of ehs0 + integer :: iessopt = 1 ! 1 = Original (no factor); 2 = factor based on wvel; 3 = factor based on SSI real , private :: ess0 = 0.5, ess1 = 0.05 ! snow aggregation coefficients: ess0*exp(ess1*min(temcg(mgs),0.0)) ! set ess1 = 0 to get a constant value of ess0 real , private :: esstem1 = -15. ! lower temperature where snow aggregation turns on @@ -452,11 +473,13 @@ MODULE module_mp_nssl_2mom ! 0 = no condensation on rain; 1 = bulk condensation on rain integer, parameter, private :: icond = 1 ! (Z only) icond = 1 calculates ice deposition (crystals and snow) BEFORE droplet condensation ! icond = 2 does not work (intended to calc. dep in loop with droplet cond.) + integer, private :: iqis0 = 2 ! = 1 for normal qis; = 2 to set qis to use T = 0C when T > 0C real , private :: dfrz = 0.15e-3 ! 0.25e-3 ! minimum diameter of frozen drops from Bigg freezing (used for vfrz) for iacr > 1 ! and for ciacrf for iacr=4 real , private :: dmlt = 3.0e-3 ! maximum diameter for rain melting from graupel and hail real , private :: dshd = 1.0e-3 ! nominal diameter for rain drops shed from graupel/hail + integer, private :: ivshdgs = 1 ! 0 = use 1mm for all shedding (non-mixedphase); 1 = use vshdgs with sheddiam integer, private :: ished2cld = 0 ! 1: Send shed liquid (from wet growth) to cloud droplets integer, private :: ihmlt = 2 ! 1=old melting with vmlt; 2=new melting using mean volume diam of graupel/hail @@ -480,6 +503,7 @@ MODULE module_mp_nssl_2mom real, private :: qhdpvdn = -1. real, private :: qhacidn = -1. + integer, private :: iraintypes = 0 logical, private :: mixedphase = .false. ! .false.=off, true=on to include mixed phase graupel integer, private :: imixedphase = 0 logical, private :: qsdenmod = .false. ! true = modify snow density by linear interpolation of snow and rain density @@ -514,14 +538,19 @@ MODULE module_mp_nssl_2mom integer, private :: ihlcnh = 1 ! which graupel -> hail conversion to use ! 1 = Milbrandt and Yau (2005) using Ziegler 1985 wet growth diameter ! 2 = Straka and Mansell (2005) conversion using size threshold + ! 3 = Conversion using wet growth diameter real, private :: hlcnhdia = 1.e-3 ! threshold diameter for graupel -> hail conversion for ihlcnh = 1 option. real, private :: hlcnhqmin = 0.1e-3 ! minimum graupel mass content for graupel -> hail conversion (ihlcnh = 1) real , private :: hldia1 = 20.0e-3 ! threshold diameter for graupel -> hail conversion for ihlcnh = 2 option. + integer :: incwet = 0 ! flag to do wet growth only on D > D_wet integer, private :: iusedw = 0 ! flag to use experimental wet growth ice diameter for gr -> hl conversion (=1 turns on) - real , private :: dwmin = 0.0 ! Minimum diameter with iusedw (can stay at 0 or be set to something larger) + real , private :: dwmin = 5.0e-3 ! Minimum diameter with iusedw (can stay at 0 or be set to something larger) + real , private :: dwetmin = 5.0e-3 ! Minimum diameter with iusedw (can stay at 0 or be set to something larger) real , private :: dwtempmin = 242. ! lowest temperature to allow wet growth conversion to hail real , private :: dwehwmin = 0. ! Minimum ehw to use to find wet growth diameter (if > ehw0, then wet growth diam becomes smaller) real , private :: dg0thresh = 0.15 ! graupel wet growth diameter above which we say do not bother + integer :: ifddenfac = 0 ! = 1 to use density threshold to count FD as GR when converting to HL + real :: fddenthresh = 500. ! if ifddenfac > 0, then hail from FD with lower density are considered to come from graupel integer :: icvhl2h = 0 ! allow conversion of hail back to graupel when hail density gets close to minimum allowed integer, private :: imurain = 1 ! 3 for gamma-volume, 1 for gamma-diameter DSD for rain. @@ -538,6 +567,8 @@ MODULE module_mp_nssl_2mom ! = 1 use mean diameter for breakup ! = 2 use maximum mass diameter for breakup ! = 3 use mass-weighted diameter for breakup + integer :: iraintailbreak = 0 ! 1 = on + real :: draintail = 8.e-3 ! starting size for rain breakup integer, private :: dmrauto = 0 ! = -1 no limiter on crcnw ! = 0 limit crcnw when qr > 1.2*L (Cohard-Pinty 2002) @@ -595,9 +626,12 @@ MODULE module_mp_nssl_2mom integer, private :: ibinnum = 2 ! number of bins for melting of smaller ice (for ibinhmlr = 1) integer, private :: iqhacrmlr = 1 ! turn on/off qhacrmlr integer, private :: iqhlacrmlr = 1 ! turn on/off qhlacrmlr + integer, private :: iqhacwshr = 1 ! turn on/off qhacw for T > 0 + integer, private :: iqhlacwshr = 1 ! turn on/off qhlacw for T > 0 real, private :: binmlrmxdia = 40.e-3 ! threshold diameter (graupel/hail) to switch bin-bulk melting to use standard chmlr real, private :: binmlrzrrfac = 1.0 ! factor for reflectivity change ice that sheds while melting real, private :: snowmeltdia = 0 ! If nonzero, sets the size of rain drops from melting snow. + real, private :: alphasmlr0 = 14.0 ! shape parameter for drops formed from melting/shedding snow real, private :: delta_alphamlr = 0.5 ! offset from alphamax at which melting does not further collapse the shape parameter integer :: iqvsopt = 0 ! =0 use old default for tabqvs; =1 use Bolton formulation (Rogers and Yau) @@ -739,6 +773,7 @@ MODULE module_mp_nssl_2mom real da1 (lc:lqmx) ! collection coefficients from Seifert 2005 real bb (lc:lqmx) + ! put ipelec here for now.... integer :: ipelec = 0 integer :: isaund = 0 @@ -764,7 +799,7 @@ MODULE module_mp_nssl_2mom double precision, parameter :: dgam = 0.01, dgami = 100. double precision gmoi(0:ngm0) ! ,gmod(0:ngm1,0:ngm2),gmdi(0:ngm1,0:ngm2) - integer, parameter :: nqiacralpha = 240 !480 ! 240 ! 120 ! 15 + integer, parameter :: nqiacralpha = 300 !480 ! 240 ! 120 ! 15 integer, parameter :: nqiacrratio = 100 ! 500 !50 ! 25 ! real, parameter :: maxratiolu = 25. real, parameter :: maxratiolu = 100. ! 25. @@ -782,6 +817,10 @@ MODULE module_mp_nssl_2mom ! real :: ziacrratio(0:nqiacrratio,0:nqiacralpha) ! double precision :: gamxinflu(0:nqiacrratio,0:nqiacralpha,12,2) ! last index for graupel (1) or hail (2) +! for 3-moment collection coefficients + real, save :: dab0lu(ialpstart:nqiacralpha,ialpstart:nqiacralpha,lc:lqmx,lc:lqmx) ! collection coefficients from Seifert 2005 + real, save :: dab1lu(ialpstart:nqiacralpha,ialpstart:nqiacralpha,lc:lqmx,lc:lqmx) ! collection coefficients from Seifert 2005 + integer, parameter :: ngdnmm = 9 real :: mmgraupvt(ngdnmm,3) ! Milbrandt and Morrison (2013) fall speed coefficients for graupel/hail @@ -914,6 +953,7 @@ MODULE module_mp_nssl_2mom real :: tfrcbw real :: tfrcbi real :: rovcp + real, public :: rdorv = 0.622 real, parameter :: poo = 1.0e+05 real, parameter :: advisc0 = 1.832e-05 ! reference dynamic viscosity (SMT; see Beard & Pruppacher 71) @@ -955,7 +995,7 @@ MODULE module_mp_nssl_2mom ! Note to users: Many of these options are for development and not guaranteed to perform well. ! Some may not be functional depending on the version of the code. -! Some may be useful for ensemble physics diversity. Feel free to contact me if you have questions +! Some may be useful for ensemble physics diversity. Feel free to contact Ted Mansell if you have questions ! in that regard. NAMELIST /nssl_mp_params/ & ndebug, ncdebug,& @@ -965,7 +1005,7 @@ MODULE module_mp_nssl_2mom idbzci, & vtmaxsed, & itfall,iscfall, & - infall, & + infall,irfall,isfall, & rssflg, & sssflg, & hssflg, & @@ -976,13 +1016,15 @@ MODULE module_mp_nssl_2mom icnuclimit, & irenuc, & restoreccn, ccntimeconst, cck, & + decayufccn, ufccntimeconst, & switchccn, old_cccn, & ciintmx, & itype1, itype2, & - icenucopt, & + icenucopt, in_freeze_rain_first, & naer, & icfn, & ibfc, iacr, icracr, & + icracrthresh, & cwfrz2snowfrac, cwfrz2snowratio, & ibfr, & ibiggopt, & @@ -998,7 +1040,7 @@ MODULE module_mp_nssl_2mom eri_cimin, & eii0hl, eii1hl, & ehs0, ehs1, & - ess0, ess1, & + ess0, ess1, iessopt, & esstem1,esstem2, & ircnw, qminrncw,& ! single-moment only iglcnvi, & @@ -1024,6 +1066,7 @@ MODULE module_mp_nssl_2mom hailfallfac, & icefallopt, & icdx,icdxhl, & + axh,bxh,axf,bxf,axhl,bxhl, & cdhmin, cdhmax, & cdhdnmin, cdhdnmax, & cdhlmin, cdhlmax, & @@ -1133,12 +1176,12 @@ SUBROUTINE nssl_2mom_init_const( & real, intent(in) :: con_g, con_rd, con_cp, con_rv, & con_t0c, con_cliq, con_csol, con_eps - cp608 = con_eps ! 0.608 ! constant used in conversion of T to Tv gr = con_g tfr = con_t0c cp = con_cp rd = con_rd rw = con_rv + rdorv = con_eps cpl = con_cliq ! 4190.0 cpigb = con_csol ! 2106.0 cpi = 1./cp @@ -1157,6 +1200,7 @@ END SUBROUTINE nssl_2mom_init_const !! NSSL MP setup routine (sets local options and array indices) SUBROUTINE nssl_2mom_init( & & ims,ime, jms,jme, kms,kme, nssl_params, ipctmp, mixphase,ihvol,idoniconlytmp, & + & igvol, & & nssl_graupelfallfac, & & nssl_hailfallfac, & & nssl_ehw0, & @@ -1165,7 +1209,13 @@ SUBROUTINE nssl_2mom_init( & & nssl_icdxhl, & & nssl_icefallfac, & & nssl_snowfallfac, & + & nssl_cccn, & + & nssl_ufccn, & + & nssl_alphah, & + & nssl_alphahl, & + & nssl_alphar, & & errmsg, errflg, & + & infileunit, & & myrank, mpiroot & ) @@ -1177,22 +1227,30 @@ SUBROUTINE nssl_2mom_init( & & nssl_ehw0, & & nssl_ehlw0, & & nssl_icefallfac, & - & nssl_snowfallfac + & nssl_snowfallfac, & + & nssl_cccn, & + & nssl_alphah, & + & nssl_alphahl, & + & nssl_alphar integer, intent(in), optional :: & - & nssl_icdx, & - & nssl_icdxhl, myrank, mpiroot + & nssl_icdx, igvol, & + & nssl_icdxhl, myrank, mpiroot, & + & nssl_ufccn + + integer, intent(in),optional :: infileunit ! CCPP error handling character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg - integer, intent(in) :: ims,ime, jms,jme, kms,kme - real, intent(in), dimension(20) :: nssl_params + integer, intent(in), optional :: ims,ime, jms,jme, kms,kme + real, intent(in), dimension(20), optional :: nssl_params integer, intent(in) :: ipctmp,mixphase,ihvol logical, optional, intent(in) :: idoniconlytmp + integer :: igvol_local = 1 logical :: wrote_namelist = .false. logical :: wrf_dm_on_monitor @@ -1202,22 +1260,31 @@ SUBROUTINE nssl_2mom_init( & integer :: i,il,j,l integer :: ltmp integer :: isub - real :: bxh,bxhl + real :: bxh1,bxhl1 real :: alp,ratio double precision :: x,y,y2,y7 logical :: turn_on_ccna, turn_on_cina + integer :: iufccn = 0 integer :: istat + + real :: alpjj, alpii, xnuii, xnujj + integer :: ii, jj errmsg = '' errflg = 0 turn_on_ccna = .false. turn_on_cina = .false. + + IF ( present( igvol ) ) THEN + igvol_local = igvol + ENDIF ! ! set some global values from namelist input ! + IF ( present( nssl_params ) ) THEN ccn = Abs( nssl_params(1) ) alphah = nssl_params(2) alphahl = nssl_params(3) @@ -1228,8 +1295,16 @@ SUBROUTINE nssl_2mom_init( & rho_qh = nssl_params(8) rho_qhl = nssl_params(9) rho_qs = nssl_params(10) - alphar = nssl_params(14) - + IF ( Nint(nssl_params(13)) == 1 ) THEN + ! hack to switch CCN field to CCNA (activated ccn) +! invertccn = .true. + turn_on_ccna = .true. + irenuc = 7 + ENDIF + ccnuf = Abs( nssl_params(14) ) + IF ( present(nssl_ufccn) ) iufccn = nssl_ufccn + + ENDIF ! ipelec = Nint(nssl_params(11)) ! isaund = Nint(nssl_params(12)) IF ( present(nssl_graupelfallfac) ) graupelfallfac = nssl_graupelfallfac @@ -1240,14 +1315,12 @@ SUBROUTINE nssl_2mom_init( & IF ( present(nssl_icdxhl) ) icdxhl = nssl_icdxhl IF ( present(nssl_icefallfac) ) icefallfac = nssl_icefallfac IF ( present(nssl_snowfallfac) ) snowfallfac = nssl_snowfallfac + IF ( present(nssl_cccn) ) ccn = nssl_cccn + IF ( present(nssl_alphah) ) alphah = nssl_alphah + IF ( present(nssl_alphahl) ) alphahl = nssl_alphahl + IF ( present(nssl_alphar) ) alphar = nssl_alphar - IF ( Nint(nssl_params(13)) == 1 ) THEN - ! hack to switch CCN field to CCNA (activated ccn) -! invertccn = .true. - turn_on_ccna = .true. - irenuc = 7 - ENDIF @@ -1275,6 +1348,15 @@ SUBROUTINE nssl_2mom_init( & + IF ( iufccn > 0 ) THEN ! make sure to use option that uses UF ccn + irenuc = 7 + IF ( ccnuf <= 0.0 ) decayufccn = .true. ! assume surface emission and need decay + IF ( i_uf_or_ccn > 0 ) THEN + ufbackground = 0.0 + ccntimeconst = ufccntimeconst + ENDIF + ENDIF + IF ( irenuc >= 5 ) THEN turn_on_ccna = .true. ENDIF @@ -1300,7 +1382,7 @@ SUBROUTINE nssl_2mom_init( & ! dfrz = Max( dfrz, 0.5e-3 ) ENDIF IF ( ihvol == -2 .or. ihvol == 2 ) THEN ! ice crystals are turned off - ! a value of -3 means to turn off ice crystals but turn on hail + ! a value of 2? means to turn off ice crystals but turn on hail renucfrac = 1.0 ffrzs = 1.0 ! idoci = 0 ! try this later @@ -1335,29 +1417,42 @@ SUBROUTINE nssl_2mom_init( & bx(lr) = 0.85 ax(lr) = 1647.81 fx(lr) = 135.477 + IF ( icdx == 6 ) THEN bx(lh) = 0.6 ! Milbrandt and Morrison (2013) for density of 550. ax(lh) = 157.71 - ELSEIF ( icdx > 0 ) THEN +! ELSEIF ( icdx == 1 ) THEN +! bx(lh) = bxh +! ax(lh) = axh + ELSEIF ( icdx > 1 ) THEN bx(lh) = 0.5 ax(lh) = 75.7149 - ELSE - bx(lh) = 0.37 ! 0.6 ! Ferrier 1994 + ELSEIF ( icdx == 0 ) THEN + bx(lh) = 0.37 ! 0.6 ! Ferrier 1994 graupel ax(lh) = 19.3 + ELSE ! icdx < 0 +! ax(lh) = 206.984 ! Ferrier 1994 hail/frozen drops +! bx(lh) = 0.6384 + bx(lh) = bxh + ax(lh) = axh ENDIF + ! bx(lh) = 0.6 IF ( lhl .gt. 1 ) THEN IF ( icdxhl == 6 ) THEN bx(lhl) = 0.593 ! Milbrandt and Morrison (2013) for density of 750. ax(lhl) = 179.36 + ELSEIF (icdxhl == 0 ) THEN + ax(lhl) = 206.984 ! Ferrier 1994 + bx(lhl) = 0.6384 ELSEIF (icdxhl > 0 ) THEN - bx(lhl) = 0.5 - ax(lhl) = 75.7149 + bx(lhl) = 0.5 + ax(lhl) = 75.7149 ELSE - ax(lhl) = 206.984 ! Ferrier 1994 - bx(lhl) = 0.6384 + bx(lhl) = bxhl + ax(lhl) = axhl ENDIF ENDIF @@ -1373,8 +1468,8 @@ SUBROUTINE nssl_2mom_init( & ! Uses incomplete gamma functions ! The terms with bxh or bxhl will be off if the actual bxh or bxhl is different from the base value (icdx=6 option) - bxh = bx(lh) - bxhl = bx(Max(lh,lhl)) + bxh1 = bx(lh) + bxhl1 = bx(Max(lh,lhl)) ! DO j = 0,nqiacralpha DO j = ialpstart,nqiacralpha @@ -1390,9 +1485,9 @@ SUBROUTINE nssl_2mom_init( & ! graupel (.,.,.,1) gamxinflu(i,j,1,1) = x/y gamxinflu(i,j,2,1) = gamxinfdp( 2.0+alp, ratio )/y - gamxinflu(i,j,3,1) = gamxinfdp( 2.5+alp+0.5*bxh, ratio )/y + gamxinflu(i,j,3,1) = gamxinfdp( 2.5+alp+0.5*bxh1, ratio )/y gamxinflu(i,j,5,1) = (gamma_dpr(5.0+alp) - gamxinfdp( 5.0+alp, ratio ))/y - gamxinflu(i,j,6,1) = (gamma_dpr(5.5+alp+0.5*bxh) - gamxinfdp( 5.5+alp+0.5*bxh, ratio ))/y + gamxinflu(i,j,6,1) = (gamma_dpr(5.5+alp+0.5*bxh1) - gamxinfdp( 5.5+alp+0.5*bxh1, ratio ))/y gamxinflu(i,j,9,1) = gamxinfdp( 1.0+alp, ratio )/y gamxinflu(i,j,10,1)= gamxinfdp( 4.0+alp, ratio )/y @@ -1401,9 +1496,9 @@ SUBROUTINE nssl_2mom_init( & ! hail (.,.,.,2) gamxinflu(i,j,1,2) = gamxinflu(i,j,1,1) gamxinflu(i,j,2,2) = gamxinflu(i,j,2,1) - gamxinflu(i,j,3,2) = gamxinfdp( 2.5+alp+0.5*bxhl, ratio )/y + gamxinflu(i,j,3,2) = gamxinfdp( 2.5+alp+0.5*bxhl1, ratio )/y gamxinflu(i,j,5,2) = gamxinflu(i,j,5,1) - gamxinflu(i,j,6,2) = (gamma_dpr(5.5+alp+0.5*bxhl) - gamxinfdp( 5.5+alp+0.5*bxhl, ratio ))/y + gamxinflu(i,j,6,2) = (gamma_dpr(5.5+alp+0.5*bxhl1) - gamxinfdp( 5.5+alp+0.5*bxhl1, ratio ))/y gamxinflu(i,j,9,2) = gamxinflu(i,j,9,1) gamxinflu(i,j,10,2)= gamxinflu(i,j,10,1) @@ -1411,16 +1506,16 @@ SUBROUTINE nssl_2mom_init( & ! gamxinflu(i,j,7,1) = gamxinfdp( alp - 1., ratio )/y gamxinflu(i,j,7,1) = (gamma_dpr(alp - 1.) - gamxinfdp( alp - 1., ratio ))/y ! gamxinflu(i,j,8,1) = gamxinfdp( alp - 0.5 + 0.5*bxh, ratio )/y - gamxinflu(i,j,8,1) = (gamma_dpr(alp - 0.5 + 0.5*bxh) - gamxinfdp( alp - 0.5 + 0.5*bxh, ratio ))/y -! gamxinflu(i,j,8,2) = gamxinfdp( alp - 0.5 + 0.5*bxhl, ratio )/y - gamxinflu(i,j,8,2) = (gamma_dpr(alp - 0.5 + 0.5*bxhl) - gamxinfdp( alp - 0.5 + 0.5*bxhl, ratio ))/y + gamxinflu(i,j,8,1) = (gamma_dpr(alp - 0.5 + 0.5*bxh1) - gamxinfdp( alp - 0.5 + 0.5*bxh1, ratio ))/y +! gamxinflu(i,j,8,2) = gamxinfdp( alp - 0.5 + 0.5*bxhl1, ratio )/y + gamxinflu(i,j,8,2) = (gamma_dpr(alp - 0.5 + 0.5*bxhl1) - gamxinfdp( alp - 0.5 + 0.5*bxhl1, ratio ))/y ELSE ! gamxinflu(i,j,7,1) = gamxinfdp( .1, ratio )/y gamxinflu(i,j,7,1) = (gamma_dpr(0.1) - gamxinfdp( 0.1, ratio ) )/y -! gamxinflu(i,j,8,1) = gamxinfdp( 1.1 - 0.5 + 0.5*bxh, ratio )/y -! gamxinflu(i,j,8,2) = gamxinfdp( 1.1 - 0.5 + 0.5*bxhl, ratio )/y - gamxinflu(i,j,8,1) = (gamma_dpr(1.1 - 0.5 + 0.5*bxh) - gamxinfdp( 1.1 - 0.5 + 0.5*bxh, ratio ) )/y - gamxinflu(i,j,8,2) = (gamma_dpr(1.1 - 0.5 + 0.5*bxhl) - gamxinfdp( 1.1 - 0.5 + 0.5*bxhl, ratio ) )/y +! gamxinflu(i,j,8,1) = gamxinfdp( 1.1 - 0.5 + 0.5*bxh1, ratio )/y +! gamxinflu(i,j,8,2) = gamxinfdp( 1.1 - 0.5 + 0.5*bxhl1, ratio )/y + gamxinflu(i,j,8,1) = (gamma_dpr(1.1 - 0.5 + 0.5*bxh1) - gamxinfdp( 1.1 - 0.5 + 0.5*bxh1, ratio ) )/y + gamxinflu(i,j,8,2) = (gamma_dpr(1.1 - 0.5 + 0.5*bxhl1) - gamxinfdp( 1.1 - 0.5 + 0.5*bxhl1, ratio ) )/y ENDIF gamxinflu(i,j,7,2) = gamxinflu(i,j,7,1) @@ -1457,6 +1552,7 @@ SUBROUTINE nssl_2mom_init( & isub = Min( 0, Max(-1,ihvol) ) ! is -1 or 0 lccn = 0 + lccnuf = 0 lccna = 0 lnc = 0 lnr = 0 @@ -1490,21 +1586,29 @@ SUBROUTINE nssl_2mom_init( & lhl = 0 ENDIF ELSEIF ( ipconc == 5 ) THEN - lccn = lhab+1 ! 9 - lnc = lhab+2 ! 10 - lnr = lhab+3 ! 11 - lni = lhab+4 !12 - lns = lhab+5 !13 - lnh = lhab+6 !14 + ltmp = lhab + IF ( iufccn > 0 ) THEN + ltmp = ltmp+1 + lccnuf = ltmp + denscale(lccnuf) = 1 + ENDIF + lccn= ltmp+1 ! 9 + lnc = ltmp+2 ! 10 + lnr = ltmp+3 ! 11 + lni = ltmp+4 !12 + lns = ltmp+5 !13 + lnh = ltmp+6 !14 ltmp = lnh IF ( ihvol >= 0 ) THEN ltmp = ltmp + 1 lnhl = ltmp ! lhab+7 ! 15 ENDIF + IF ( igvol_local >= 1 ) THEN ltmp = ltmp + 1 lvh = ltmp ! lhab+8 + isub ! 16 + isub ! isub adjusts to 15 if hail is off ! ltmp = lvh - denscale(lccn:lvh) = 1 + ENDIF + denscale(lccn:ltmp) = 1 IF ( ihvol >= 1 ) THEN ltmp = ltmp + 1 lvhl = ltmp @@ -1523,24 +1627,30 @@ SUBROUTINE nssl_2mom_init( & ! ltmp = lhlw ENDIF ELSEIF ( ipconc >= 6 ) THEN - errmsg = 'NSSL microphysics has not been compiled for 3-moment. Sorry.' - errflg = 1 - return - lccn = lhab+1 ! 9 - lnc = lhab+2 ! 10 - lnr = lhab+3 ! 11 - lni = lhab+4 !12 - lns = lhab+5 !13 - lnh = lhab+6 !14 + ltmp = lhab + IF ( iufccn > 0 ) THEN + ltmp = ltmp+1 + lccnuf = ltmp + denscale(lccnuf) = 1 + ENDIF + write(0,*) 'nsslwrf: lccnuf = ',lccnuf + lccn= ltmp+1 ! 9 + lnc = ltmp+2 ! 10 + lnr = ltmp+3 ! 11 + lni = ltmp+4 !12 + lns = ltmp+5 !13 + lnh = ltmp+6 !14 ltmp = lnh IF ( lhl > 0 ) THEN ltmp = ltmp + 1 lnhl = ltmp ! lhab+7 ! 15 ENDIF + IF ( igvol_local >= 1 ) THEN ltmp = ltmp + 1 lvh = ltmp ! lhab+8 + isub ! 16 + isub ! isub adjusts to 15 if hail is off + ENDIF ! ltmp = lvh - denscale(lccn:lvh) = 1 + denscale(lccn:ltmp) = 1 IF ( ihvol >= 1 ) THEN ltmp = ltmp + 1 lvhl = ltmp @@ -1825,9 +1935,11 @@ SUBROUTINE nssl_2mom_init( & IF ( lhl .gt. 1 ) ido(lhl) = idohl IF ( irfall .lt. 0 ) irfall = infall + IF ( isfall .lt. 0 ) isfall = infall IF ( lzr > 0 ) irfall = 0 qccn = ccn/rho00 + qccnuf = ccnuf/rho00 IF ( old_cccn > 0.0 ) THEN old_qccn = old_cccn/rho00 ELSE @@ -1981,6 +2093,33 @@ SUBROUTINE nssl_2mom_init( & ENDDO ENDDO + dab0lu(:,:,:,:) = 0.0 + dab1lu(:,:,:,:) = 0.0 + + IF ( ipconc >= 6 ) THEN + DO il = lc,lhab ! collector + DO j = lc,lhab ! collected + IF ( il .ne. j ) THEN + + DO jj = ialpstart,nqiacralpha + alpjj = float(jj)*dqiacralpha + xnujj = (alpjj - 2.)/3. + DO ii = ialpstart,nqiacralpha + alpii = float(ii)*dqiacralpha + xnuii = (alpii - 2.)/3. + + dab0lu(ii,jj,il,j) = delabk(bb(il), bb(j), xnuii, xnujj, xmu(il), xmu(j), 0) + dab1lu(ii,jj,il,j) = delabk(bb(il), bb(j), xnuii, xnujj, xmu(il), xmu(j), 1) + + ENDDO + ENDDO +! write(0,*) 'il, j, dab0, dab1 = ',il, j, dab0(il,j), dab1(il,j) + ENDIF + ENDDO + ENDDO + + ENDIF + gf4br = gamma_sp(4.0+br) gf4ds = gamma_sp(4.0+ds) gf4p5 = gamma_sp(4.0+0.5) @@ -2029,10 +2168,12 @@ END SUBROUTINE nssl_2mom_init !>\ingroup mod_nsslmp !! Driver subroutine that copies state data to local 2D arrays for microphysics calls SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw, chl, & - cn, vhw, vhl, cna, cni, f_cn, f_cna, f_cina, & - zrw, zhw, zhl, & + cn, vhw, vhl, cna, cni, f_cn, f_cna, f_cina, & + cnuf, f_cnuf, & + zrw, zhw, zhl, f_zrw, f_zhw, f_zhl, f_vhw, f_vhl, & qsw, qhw, qhlw, & tt, th, pii, p, w, dn, dz, dtp, itimestep, & + ntmul, ntcnt, lastloop, & RAINNC,RAINNCV, & dx, dy, & axtra, & @@ -2091,7 +2232,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw zrw, zhw, zhl, & qsw, qhw, qhlw, & qi,qhl,ccw,crw,cci,csw,chw,chl,vhw,vhl - real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(inout):: dbz, vzf, cn, cna, cni + logical, optional, intent(in) :: f_zrw, f_zhw, f_zhl, f_vhw, f_vhl ! not used yet + real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(inout):: dbz, vzf, cn, cna, cni, cnuf real, dimension(ims:ime, jms:jme), optional, intent(inout):: compdbz real, dimension(ims:ime, jms:jme), optional, intent(inout):: rscghis_2d, & ! 2D accumulation arrays for vertically-integrated charging rate rscghis_2dp, & ! 2D accumulation arrays for vertically-integrated charging rate (positive only) @@ -2102,8 +2244,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw scr,scw,sci,scs,sch,schl,sciona,sctot ! space charge real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(inout):: & induc,noninduc,noninducp,noninducn ! charging rates: inductive, noninductive (all, positive, negative to graupel) - real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(in) :: elecz ! elecsave = Ez - real, dimension(ims:ime, kms:kme, jms:jme,2),optional, intent(inout) :: scion + real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(in) :: elecz ! elecsave = Ez + real, dimension(ims:ime, kms:kme, jms:jme,2),optional, intent(inout) :: scion real, dimension(ims:ime, kms:kme, jms:jme), intent(in):: p,w,dz,dn real, dimension(ims:ime, kms:kme, jms:jme), intent(in):: pii @@ -2139,7 +2281,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw real, optional, intent(in) :: dx,dy real, intent(in):: dtp integer, intent(in):: itimestep !, ccntype - logical, optional, intent(in) :: diagflag, f_cna, f_cn, f_cina + integer, intent(in), optional :: ntmul, ntcnt + logical, optional, intent(in) :: lastloop + logical, optional, intent(in) :: diagflag, f_cna, f_cn, f_cina, f_cnuf integer, optional, intent(in) :: ipelectmp, ke_diag ! CCPP error handling @@ -2151,6 +2295,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! REAL, DIMENSION(ims:ime, kms:kme, jms:jme), optional,INTENT(INOUT):: qndrop LOGICAL :: flag_qndrop ! wrf-chem LOGICAL :: flag_qnifa , flag_qnwfa + logical :: flag_cnuf = .false. logical :: flag real :: cinchange, t7max,testmax,wmax @@ -2223,6 +2368,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw real :: fach(kts:kte) logical, parameter :: debugdriver = .false. + + integer :: loopcnt, loopmax, outerloopcnt + logical :: lastlooptmp #ifdef MPI @@ -2246,12 +2394,21 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw flag_qndrop = .false. flag_qnifa = .false. flag_qnwfa = .false. + flag_cnuf = .false. IF ( PRESENT ( nssl_progn ) ) flag_qndrop = nssl_progn + IF ( present ( f_cnuf ) ) flag_cnuf = f_cnuf - - + loopmax = 1 + outerloopcnt = 1 + lastlooptmp = .true. + IF ( present( ntmul ) .and. present( ntcnt ) .and. present( lastloop ) ) THEN + loopmax = ntmul + outerloopcnt = ntcnt + lastlooptmp = lastloop + ENDIF + ! --- IF ( present( f_cna ) ) THEN @@ -2365,6 +2522,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ancuten(its:ite,1,kts:kte,:) = 0.0 thproclocal(:,:) = 0.0 + DO jy = jts,jye xfall(:,:,:) = 0.0 @@ -2408,6 +2566,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ELSE an(ix,1,kz,lccn) = cn(ix,kz,jy) ENDIF + IF ( i_uf_or_ccn > 0 .and. lccnuf > 1 ) THEN ! UF ccn are extra regular ccn + an(ix,1,kz,lccn) = an(ix,1,kz,lccn) + cnuf(ix,kz,jy) + ENDIF ELSE IF ( lccna == 0 .and. ( .not. f_cnatmp ) ) THEN an(ix,1,kz,lccn) = qccn - ccw(ix,kz,jy) @@ -2418,6 +2579,14 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDIF ENDIF + IF ( lccnuf > 0 .and. flag_cnuf ) THEN + IF ( i_uf_or_ccn == 0 ) THEN ! UF are UF + an(ix,1,kz,lccnuf) = Max(0.0, cnuf(ix,kz,jy) ) + ELSE ! UF were added to lccn + an(ix,1,kz,lccnuf) = 0.0 + ENDIF + ENDIF + IF ( lccna > 1 ) THEN IF ( present( cna ) .and. f_cnatmp ) THEN an(ix,1,kz,lccna) = cna(ix,kz,jy) @@ -2448,9 +2617,19 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw IF ( lvh > 0 ) an(ix,1,kz,lvh) = vhw(ix,kz,jy) IF ( lvhl > 0 .and. present( vhl ) ) an(ix,1,kz,lvhl) = vhl(ix,kz,jy) + IF ( ipconc >= 6 ) THEN + IF ( lzr > 0 ) an(ix,1,kz,lzr) = zrw(ix,kz,jy)*zscale + IF ( lzh > 0 ) an(ix,1,kz,lzh) = zhw(ix,kz,jy)*zscale + IF ( lzhl > 0 ) an(ix,1,kz,lzhl) = zhl(ix,kz,jy)*zscale + ENDIF + ENDDO + ENDDO + + DO kz = kts,kte + DO ix = its,ite IF ( present( tt ) ) THEN @@ -2458,6 +2637,26 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ELSE t0(ix,1,kz) = th(ix,kz,jy)*pii(ix,kz,jy) ! temperature (Kelvin) ENDIF + t00(ix,1,kz) = 380.0/p(ix,kz,jy) + t77(ix,1,kz) = pii(ix,kz,jy) + dbz2d(ix,1,kz) = 0.0 + vzf2d(ix,1,kz) = 0.0 + ENDDO + ENDDO + + DO ix = its,ite + RAINNCV(ix,jy) = 0.0 + IF ( present( GRPLNCV ) ) GRPLNCV(ix,jy) = 0.0 + IF ( present( HAILNCV ) ) HAILNCV(ix,jy) = 0.0 + IF ( present( SNOWNCV ) ) SNOWNCV(ix,jy) = 0.0 + ENDDO + + DO loopcnt = 1,loopmax + + DO kz = kts,kte + DO ix = its,ite + + t1(ix,1,kz) = 0.0 t2(ix,1,kz) = 0.0 t3(ix,1,kz) = 0.0 @@ -2467,14 +2666,11 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw t7(ix,1,kz) = 0.0 t8(ix,1,kz) = 0.0 t9(ix,1,kz) = 0.0 - t00(ix,1,kz) = 380.0/p(ix,kz,jy) - t77(ix,1,kz) = pii(ix,kz,jy) - dbz2d(ix,1,kz) = 0.0 - vzf2d(ix,1,kz) = 0.0 - dn1(ix,1,kz) = dn(ix,kz,jy) pn(ix,1,kz) = p(ix,kz,jy) wn(ix,1,kz) = w(ix,kz,jy) +! calculate dn1 in case we are substepping: rho = con_eps*prsl/(con_rd*tgrs*(qv_mp+con_eps)) + dn1(ix,1,kz) = rdorv*pn(ix,1,kz)/(rd*t0(ix,1,kz)*(an(ix,1,kz,lv) + rdorv)) ! wmax = Max(wmax,wn(ix,1,kz)) dz2d(ix,1,kz) = dz(ix,kz,jy) dz2dinv(ix,1,kz) = 1./dz(ix,kz,jy) @@ -2544,19 +2740,19 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ELSEIF ( icenucopt == 4 ) THEN ! DeMott 2010 - IF ( t0(ix,jy,kz) < 268.16 .and. t0(ix,jy,kz) > 223.15 .and. ssival > 1.001 ) THEN ! + IF ( t0(ix,1,kz) < 268.16 .and. t0(ix,1,kz) > 223.15 .and. ssival > 1.001 ) THEN ! ! a = 0.0000594, b = 3.33, c = 0.0264, d = 0.0033, ! nint = a*(-Tc)**b * naer**(c*(-Tc) + d) ! nint has units of per (standard) liter, so mult by 1.e3 and scale by dn/rho00 ! naer needs units of cm**-3, so mult by 1.e-6 - ! dp1 = 1.e3*0.0000594*(273.16 - t0(ix,jy,kz))**3.33 * (1.e-6*cin*dn(ix,jy,kz))**(0.0264*(273.16 - t0(ix,jy,kz)) + 0.0033) - dp1 = 1.e3*dn(ix,jy,kz)/rho00*0.0000594*(273.16 - t0(ix,jy,kz))**3.33 * (1.e-6*naer)**(0.0264*(273.16 - t0(ix,jy,kz)) + 0.0033) - t7(ix,jy,kz) = Min(dp1, 1.0d30) + ! dp1 = 1.e3*0.0000594*(273.16 - t0(ix,1,kz))**3.33 * (1.e-6*cin*dn(ix,1,kz))**(0.0264*(273.16 - t0(ix,1,kz)) + 0.0033) + dp1 = 1.e3*dn1(ix,1,kz)/rho00*0.0000594*(273.16 - t0(ix,1,kz))**3.33 * (1.e-6*naer)**(0.0264*(273.16 - t0(ix,1,kz)) + 0.0033) + t7(ix,1,kz) = Min(dp1, 1.0d30) ELSE - t7(ix,jy,kz) = 0.0 + ! t7(ix,1,kz) = 0.0 ENDIF ENDIF ! icenucopt @@ -2583,25 +2779,29 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! transform from number mixing ratios to number conc. + IF ( loopcnt == 1 ) THEN DO il = lnb,na IF ( denscale(il) == 1 ) THEN DO kz = kts,kte DO ix = its,ite - an(ix,1,kz,il) = an(ix,1,kz,il)*dn(ix,kz,jy) + an(ix,1,kz,il) = an(ix,1,kz,il)*dn1(ix,1,kz) ! dn(ix,kz,jy) ENDDO ENDDO ENDIF ENDDO ! il + ENDIF + ! sedimentation xfall(:,:,:) = 0.0 - IF ( .true. ) THEN + +! IF ( .true. ) THEN ! #ifndef CM1 ! for real cases when hydrometeor mixing ratios have been initialized without concentrations - IF ( itimestep == 1 .and. ipconc > 0 ) THEN + IF ( itimestep == 1 .and. ipconc > 0 .and. loopcnt == 1 ) THEN call calcnfromq(nx,ny,nz,an,na,nor,nor,dn1) ENDIF ! IF ( itimestep == 3 .and. ipconc > 0 ) THEN @@ -2611,9 +2811,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw IF ( present(cu_used) .and. & ( present( qrcuten ) .or. present( qscuten ) .or. & - present( qicuten ) .or. present( qccuten ) ) ) THEN + present( qicuten ) .or. present( qccuten ) ) ) THEN !{ - IF ( cu_used == 1 ) THEN + IF ( cu_used == 1 ) THEN !{ DO kz = kts,kte DO ix = its,ite @@ -2627,10 +2827,22 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw call calcnfromcuten(nx,ny,nz,ancuten,an,na,nor,nor,dn1) + DO kz = kts,kte + DO ix = its,ite + + + IF ( ipconc >= 6 ) THEN +! IF ( lzr > 0 ) an(ix,1,kz,lzr) = an(ix,1,kz,lzr) + ancuten(ix,1,kz,lzr) + ENDIF + + ENDDO + ENDDO - ENDIF + ENDIF !} - ENDIF + ENDIF !} + + call sediment1d(dtp,nx,ny,nz,an,na,nor,nor,xfall,dn1,dz2d,dz2dinv, & @@ -2644,10 +2856,12 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw DO ix = its,ite IF ( lhl > 1 ) THEN - RAINNCV(ix,jy) = dtp*dn1(ix,1,1)*(xfall(ix,1,lr) + xfall(ix,1,ls)*1000./xdn0(lr) + & + RAINNCV(ix,jy) = RAINNCV(ix,jy) + & + dtp*dn1(ix,1,1)*(xfall(ix,1,lr) + xfall(ix,1,ls)*1000./xdn0(lr) + & & xfall(ix,1,lh)*1000./xdn0(lr) + xfall(ix,1,lhl)*1000./xdn0(lr) ) ELSE - RAINNCV(ix,jy) = dtp*dn1(ix,1,1)*(xfall(ix,1,lr) + xfall(ix,1,ls)*1000./xdn0(lr) + & + RAINNCV(ix,jy) = RAINNCV(ix,jy) + & + dtp*dn1(ix,1,1)*(xfall(ix,1,lr) + xfall(ix,1,ls)*1000./xdn0(lr) + & & xfall(ix,1,lh)*1000./xdn0(lr) ) ENDIF IF ( present ( rainncw2 ) ) THEN ! rain only @@ -2662,17 +2876,19 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw & xfall(ix,1,lh)*1000./xdn0(lr) ) ENDIF ENDIF - IF ( present( SNOWNCV ) ) SNOWNCV(ix,jy) = dtp*dn1(ix,1,1)*xfall(ix,1,ls)*1000./xdn0(lr) + IF ( present( SNOWNCV ) ) SNOWNCV(ix,jy) = SNOWNCV(ix,jy) + dtp*dn1(ix,1,1)*xfall(ix,1,ls)*1000./xdn0(lr) IF ( present( GRPLNCV ) ) THEN IF ( lhl > 1 .and. .not. present( HAILNC) ) THEN ! if no separate hail accum, then add to graupel - GRPLNCV(ix,jy) = dtp*dn1(ix,1,1)*(xfall(ix,1,lh) + xfall(ix,1,lhl)) *1000./xdn0(lr) + GRPLNCV(ix,jy) = GRPLNCV(ix,jy) + dtp*dn1(ix,1,1)*(xfall(ix,1,lh) + xfall(ix,1,lhl)) *1000./xdn0(lr) ELSE - GRPLNCV(ix,jy) = dtp*dn1(ix,1,1)*xfall(ix,1,lh)*1000./xdn0(lr) + GRPLNCV(ix,jy) = GRPLNCV(ix,jy) + dtp*dn1(ix,1,1)*xfall(ix,1,lh)*1000./xdn0(lr) ENDIF ENDIF - RAINNC(ix,jy) = RAINNC(ix,jy) + RAINNCV(ix,jy) + IF ( loopcnt == loopmax ) RAINNC(ix,jy) = RAINNC(ix,jy) + RAINNCV(ix,jy) - IF ( present (SNOWNC) .and. present (SNOWNCV) ) SNOWNC(ix,jy) = SNOWNC(ix,jy) + SNOWNCV(ix,jy) + IF ( present (SNOWNC) .and. present (SNOWNCV) .and. loopcnt == loopmax ) THEN + SNOWNC(ix,jy) = SNOWNC(ix,jy) + SNOWNCV(ix,jy) + ENDIF IF ( lhl > 1 ) THEN !#ifdef CM1 ! IF ( .true. ) THEN @@ -2680,13 +2896,15 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw IF ( present( HAILNC ) ) THEN !#endif HAILNCV(ix,jy) = dtp*dn1(ix,1,1)*xfall(ix,1,lhl)*1000./xdn0(lr) - HAILNC(ix,jy) = HAILNC(ix,jy) + HAILNCV(ix,jy) + IF ( loopcnt == loopmax ) HAILNC(ix,jy) = HAILNC(ix,jy) + HAILNCV(ix,jy) ! ELSEIF ( present( GRPLNCV ) ) THEN ! if no separate hail accum, then add to graupel ! GRPLNCV(ix,jy) = GRPLNCV(ix,jy) + dtp*dn1(ix,1,1)*xfall(ix,1,lhl)*1000./xdn0(lr) ENDIF ENDIF - IF ( present( GRPLNCV ) ) GRPLNC(ix,jy) = GRPLNC(ix,jy) + GRPLNCV(ix,jy) - IF ( present( SR ) .and. present (SNOWNCV) .and. present(GRPLNCV) ) THEN + IF ( present( GRPLNCV ) .and. loopcnt == loopmax ) THEN + GRPLNC(ix,jy) = GRPLNC(ix,jy) + GRPLNCV(ix,jy) + ENDIF + IF ( present( SR ) .and. present (SNOWNCV) .and. present(GRPLNCV) .and. loopcnt == loopmax ) THEN IF ( present( HAILNC ) ) THEN SR(ix,jy) = (SNOWNCV(ix,jy)+HAILNCV(ix,jy)+GRPLNCV(ix,jy))/(RAINNCV(ix,jy)+1.e-12) ELSE @@ -2695,7 +2913,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDIF ENDDO - ENDIF ! .false. +! ENDIF ! .false. IF ( isedonly /= 1 ) THEN ! call nssl_2mom_gs: main gather-scatter routine to calculate microphysics @@ -2726,6 +2944,13 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw +! recalculate dn1 after temperature changes: rho = con_eps*prsl/(con_rd*tgrs*(qv_mp+con_eps)) + DO kz = kts,kte + DO ix = its,ite + dn1(ix,1,kz) = rdorv*pn(ix,1,kz)/(rd*t0(ix,1,kz)*(an(ix,1,kz,lv) + rdorv)) + ENDDO + ENDDO + ENDIF ! isedonly /= 1 @@ -2741,11 +2966,21 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw & ,axtra2d, makediag & & ,ssat,t00,t77,flag_qndrop) +! recalculate dn1 after temperature changes + DO kz = kts,kte + DO ix = its,ite + dn1(ix,1,kz) = rdorv*pn(ix,1,kz)/(rd*t0(ix,1,kz)*(an(ix,1,kz,lv) + rdorv)) + ENDDO + ENDDO + ENDIF + + ENDDO ! loopcnt=1,loopmax + IF ( present( pcc2 ) .and. makediag ) THEN DO kz = kts,kte DO ix = its,ite @@ -2759,7 +2994,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! compute diagnostic S-band reflectivity if needed - IF ( present( dbz ) .and. makediag ) THEN + IF ( present( dbz ) .and. makediag .and. lastlooptmp ) THEN ! calc dbz IF ( .true. ) THEN @@ -2797,7 +3032,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! Following Greg Thompson, calculation for effective radii. Used by RRTMG LW/SW schemes if enabled in module_physics_init.F IF ( present( has_reqc ).and. present( has_reqi ) .and. present( has_reqs ) .and. & - present( re_cloud ).and. present( re_ice ) .and. present( re_snow ) ) THEN + present( re_cloud ).and. present( re_ice ) .and. present( re_snow ) .and. & + lastlooptmp) THEN IF ( has_reqc.ne.0 .or. has_reqi.ne.0 .or. has_reqs.ne.0) THEN DO kz = kts,kte DO ix = its,ite @@ -2821,10 +3057,10 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw DO kz = kts,kte DO ix = its,ite re_cloud(ix,kz,jy) = MAX(2.51E-6, MIN(t1(ix,1,kz), 50.E-6)) - re_ice(ix,kz,jy) = MAX(10.01E-6, MIN(t2(ix,1,kz), 200.E-6)) + re_ice(ix,kz,jy) = MAX(10.01E-6, MIN(t2(ix,1,kz), 125.E-6)) re_snow(ix,kz,jy) = MAX(25.E-6, MIN(t3(ix,1,kz), 999.E-6)) ! check for case where snow needs to be treated as cloud ice (for rrtmg radiation) - IF ( .not. present(qi) ) re_ice(ix,kz,jy) = MAX(10.E-6, MIN(t3(ix,1,kz), 200.E-6)) + IF ( .not. present(qi) ) re_ice(ix,kz,jy) = MAX(10.E-6, MIN(t3(ix,1,kz), 125.E-6)) ENDDO ENDDO @@ -2849,7 +3085,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw IF ( denscale(il) == 1 ) THEN DO kz = kts,kte DO ix = its,ite - an(ix,1,kz,il) = an(ix,1,kz,il)/dn(ix,kz,jy) + an(ix,1,kz,il) = an(ix,1,kz,il)/dn1(ix,1,kz) ! dn(ix,kz,jy) ENDDO ENDDO ENDIF @@ -2896,6 +3132,21 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDIF ENDIF + IF ( lccnuf > 0 .and. flag_cnuf ) THEN + IF ( i_uf_or_ccn > 0 ) THEN ! UF are ccn and lccnuf is zero, so put cnuf into lccnuf to do decay + an(ix,1,kz,lccnuf) = Max(0.0, cnuf(ix,kz,jy) ) + ENDIF + IF ( decayufccn ) THEN + IF ( an(ix,1,kz,lccnuf) > ufbackground ) THEN + an(ix,1,kz,lccnuf) = an(ix,1,kz,lccnuf) - (an(ix,1,kz,lccnuf) - & + ufbackground)*(1.0 - exp(-dtp/ufccntimeconst)) + ENDIF + ENDIF + cnuf(ix,kz,jy) = an(ix,1,kz,lccnuf) + ENDIF + + + IF ( ipconc >= 5 ) THEN ccw(ix,kz,jy) = an(ix,1,kz,lnc) @@ -2906,6 +3157,11 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw IF ( lhl > 1 ) chl(ix,kz,jy) = an(ix,1,kz,lnhl) ENDIF + IF ( ipconc >= 6 ) THEN + IF ( lzr > 0 ) zrw(ix,kz,jy) = an(ix,1,kz,lzr) *zscaleinv + IF ( lzh > 0 ) zhw(ix,kz,jy) = an(ix,1,kz,lzh) *zscaleinv + IF ( lzhl > 0 ) zhl(ix,kz,jy) = an(ix,1,kz,lzhl)*zscaleinv + ENDIF @@ -2914,6 +3170,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw #if ( WRF_CHEM == 1 ) IF ( has_wetscav ) THEN + IF ( loopmax > 1 ) THEN + ! wrferror not supported + ENDIF IF ( PRESENT( rainprod ) ) rainprod(ix,kz,jy) = rainprod2d(ix,kz) IF ( PRESENT( evapprod ) ) evapprod(ix,kz,jy) = evapprod2d(ix,kz) ENDIF @@ -2923,6 +3182,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDDO ENDDO ! jy + + @@ -3217,7 +3478,7 @@ END FUNCTION GAML02 ! ********************************************************** !>\ingroup mod_nsslmp !! Function calculates fraction of drops larger than 300 microns ( imurain == 3 ) - real FUNCTION GAML02d300(x) + real FUNCTION GAML02d300(x) implicit none integer ig, i, ii, n, np real x @@ -3825,7 +4086,8 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & IF ( il >= lr .and. ( infall .eq. 3 .or. infall .eq. 4 ) .and. ln(il) > 0 ) THEN - IF ( (il .eq. lr .and. irfall .eq. infall .and. lzr < 1) .or. (il .ge. lh .and. lz(il) .lt. 1 ) ) THEN + IF ( (il .eq. lr .and. irfall .eq. infall .and. lzr < 1) .or. & + (il .ge. lh .and. lz(il) .lt. 1 ) .or. (il == ls .and. isfall == infall ) ) THEN call calczgr1d(nx,ny,nz,nor,na,an,ixe,kze, & & z,db1,jgs,ipconc, dnu(il), il, ln(il), qxmin(il), xvmn(il), xvmx(il), lvol(il), xdn0(il), ix ) ENDIF @@ -3850,6 +4112,14 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ENDIF ENDIF +! reflectivity + + IF ( ipconc .ge. 6 ) THEN + IF ( lz(il) .gt. 1 ) THEN + call fallout1d(nx,ny,nz,nor,na,dtptmp,dtfrac,jgs,xvt(1,1,3,il), & + & an,db1,lz(il),0,xfall,dtz1,ix) + ENDIF + ENDIF if (ndebug .gt. 0 ) write(0,*) 'dbg = 3d' @@ -3863,9 +4133,11 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ! to put a lower bound on number conc. ! - IF ( ( infall .eq. 3 .or. infall .eq. 4 ) .and. ( il .eq. lh .or. il .eq. lhl .or. & + IF ( ( infall .eq. 3 .or. infall .eq. 4 ) .and. ( (il == ls .and. isfall .eq. infall ) & + & .or. il .eq. lh .or. il .eq. lhl .or. il == lf .or. & & ( il .eq. lr .and. irfall .eq. infall) ) ) THEN + ! set up for method I+II DO kz = kzb,kze ! DO ix = ixb,ixe tmpn2(ix,jy,kz) = z(ix,kz,il) @@ -3878,7 +4150,7 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ENDDO ELSE - + ! set up for method II only DO kz = kzb,kze ! DO ix = ixb,ixe tmpn(ix,jy,kz) = an(ix,jy,kz,ln(il)) @@ -3907,7 +4179,8 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & xfall0(:,jgs) = 0.0 IF ( ( infall .eq. 3 .or. infall .eq. 4 ) .and. & - & ( il .ge. lh .or. (il .eq. lr .and. irfall .eq. infall) ) ) THEN + & ( il .ge. lh .or. (il .eq. lr .and. irfall .eq. infall) & + .or. (il .eq. ls .and. isfall .eq. infall) ) ) THEN call fallout1d(nx,ny,nz,nor,1,dtptmp,dtfrac,jgs,xvt(1,1,3,il), & & tmpn2,db1,1,0,xfall0,dtz1,ix) call fallout1d(nx,ny,nz,nor,1,dtptmp,dtfrac,jgs,xvt(1,1,1,il), & @@ -3918,12 +4191,12 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ENDIF IF ( ( infall .eq. 3 .or. infall .eq. 4 ) .and. ( (il .eq. lr .and. irfall .eq. infall) & - & .or. il .ge. lh ) ) THEN + & .or. il .ge. lh .or. (il == ls .and. isfall .eq. infall ) ) ) THEN ! "Method I" - dbz correction call calcnfromz1d(nx,ny,nz,nor,na,an,tmpn2,ixe,kze, & & z,db1,jgs,ipconc, dnu(il), il, ln(il), qxmin(il), xvmn(il), xvmx(il),tmpn, & - & lvol(il), rho_qh, infall, ix) + & lvol(il), xdn0(il), infall, ix) ELSEIF ( infall .eq. 5 .and. il .ge. lh .or. ( il == lr .and. irfall == 5 ) ) THEN @@ -3934,7 +4207,7 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ! ENDDO ENDDO - ELSEIF ( .not. (il .eq. lr .and. irfall .eq. 0) ) THEN + ELSEIF ( .not. (il .eq. lr .and. irfall .eq. 0) .and. .not. (il .eq. ls .and. isfall .eq. 0) ) THEN ! "Method II" M-wgt N-fallout correction DO kz = kzb,kze @@ -4120,13 +4393,14 @@ subroutine calczgr1d(nx,ny,nz,nor,na,a,ixe,kze, & integer ix,jy,kz - real vr,qr,nrx,rd,xv,g1,zx,chw,xdn + real vr,qr,nrx,rd,xv,g1,zx,chw,xdn,ynu jy = jgs ix = ixcol - IF ( l .eq. lh .or. l .eq. lhl .or. ( l .eq. lr .and. imurain == 1 ) ) THEN + IF ( l .eq. lh .or. l .eq. lhl .or. ( l .eq. lr .and. imurain == 1 ) & + .or. ( l .eq. ls .and. imusnow == 1 ) ) THEN DO kz = 1,kze @@ -4176,16 +4450,19 @@ subroutine calczgr1d(nx,ny,nz,nor,na,a,ixe,kze, & ENDDO - ELSEIF ( l .eq. lr .and. imurain == 3) THEN + ELSEIF ( (l == ls .and. imusnow == 3) .or. ( l .eq. lr .and. imurain == 3 ) ) THEN - xdn = 1000. + xdn = rho_qx ! 1000. + IF ( l == ls ) ynu = snu + IF ( l == lr ) ynu = rnu DO kz = 1,kze + IF ( a(ix,jy,kz,l) .gt. qmin .and. a(ix,jy,kz,ln) .gt. 1.e-15 ) THEN vr = db(ix,kz)*a(ix,jy,kz,l)/(xdn*a(ix,jy,kz,ln)) -! z(ix,kz,l) = 3.6e18*(rnu+2.0)*a(ix,jy,kz,ln)*vr**2/(rnu+1.0) - z(ix,kz,l) = 3.6*(rnu+2.0)*a(ix,jy,kz,ln)*vr**2/(rnu+1.0) +! z(ix,kz,l) = 3.6e18*(ynu+2.0)*a(ix,jy,kz,ln)*vr**2/(ynu+1.0) + z(ix,kz,l) = 3.6*(ynu+2.0)*a(ix,jy,kz,ln)*vr**2/(ynu+1.0) ! qr = a(ix,jy,kz,lr) ! nrx = a(ix,jy,kz,lnr) @@ -4590,6 +4867,9 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & an(ix,jy,kz,lnr) = nrx ! *dninv ! convert to number mixing ratio + IF ( lzr > 1 ) THEN ! set reflectivity moment + an(ix,jy,kz,lzr) = 36.*g1r*dn(ix,kz)**2*q**2/(pi**2*xdnr**2*nrx) ! *dninv + ENDIF ELSEIF ( an(ix,jy,kz,lr) <= qxmin(lr) .or. & ( an(ix,jy,kz,lnr) <= cxmin .and. an(ix,jy,kz,lr) <= qxmin_init(lr)) ) THEN an(ix,jy,kz,lv) = an(ix,jy,kz,lv) + an(ix,jy,kz,lr) @@ -4651,6 +4931,9 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & an(ix,jy,kz,lvh) = 0.0 ENDIF + IF ( lzh > 1 ) THEN ! set reflectivity moment + an(ix,jy,kz,lzh) = 36.*g1h*dn(ix,kz)**2*q**2/(pi**2*xdnh**2*nrx) ! *dninv + ENDIF ELSEIF ( an(ix,jy,kz,lh) <= qxmin(lh) .or. & ( an(ix,jy,kz,lnh) <= cxmin .and. an(ix,jy,kz,lh) <= qxmin_init(lh)) ) THEN @@ -4680,6 +4963,9 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & an(ix,jy,kz,lnhl) = nrx ! *dninv ! convert to number mixing ratio + IF ( lzhl > 1 ) THEN ! set reflectivity moment + an(ix,jy,kz,lzhl) = 36.*g1hl*dn(ix,kz)**2*q**2/(pi**2*xdnhl**2*nrx) ! *dninv + ENDIF ELSEIF ( an(ix,jy,kz,lhl) <= qxmin(lhl) .or. & ( an(ix,jy,kz,lnhl) <= cxmin .and. an(ix,jy,kz,lhl) <= qxmin_init(lhl)) ) THEN @@ -4859,6 +5145,9 @@ subroutine calcnfromcuten(nx,ny,nz,an,anold,na,nor,norz,dn) anold(ix,jy,kz,lnr) = anold(ix,jy,kz,lnr) + an(ix,jy,kz,lr)/xmass ENDIF + IF ( lzr > 1 ) THEN ! set reflectivity moment + an(ix,jy,kz,lzr) = 36.*g1r*dn(ix,kz)**2*q**2/(pi**2*xdnr**2*nrx) ! *dninv + ENDIF ENDIF ENDIF @@ -4909,6 +5198,9 @@ subroutine calcnfromcuten(nx,ny,nz,an,anold,na,nor,norz,dn) ! ! an(ix,jy,kz,lnh) = nrx ! *dninv ! convert to number mixing ratio ! +! IF ( lzh > 1 ) THEN ! set reflectivity moment +! an(ix,jy,kz,lzh) = 36.*g1h*dn(ix,kz)**2*q**2/(pi**2*xdnh**2*nrx) ! *dninv +! ENDIF ! ENDIF ! ENDIF ! @@ -4932,6 +5224,9 @@ subroutine calcnfromcuten(nx,ny,nz,an,anold,na,nor,norz,dn) ! ! an(ix,jy,kz,lnhl) = nrx ! *dninv ! convert to number mixing ratio ! +! IF ( lzhl > 1 ) THEN ! set reflectivity moment +! an(ix,jy,kz,lzhl) = 36.*g1hl*dn(ix,kz)**2*q**2/(pi**2*xdnhl**2*nrx) ! *dninv +! ENDIF ! ENDIF ! ENDIF @@ -6490,6 +6785,9 @@ SUBROUTINE setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno,cnostmp, & ELSEIF ( icdxhl .eq. 6 ) THEN ! Milbrandt and Morrison (2013) aax = axx(mgs,lhl) bbx = bxx(mgs,lhl) + ELSEIF ( icdxhl <= 0 ) THEN ! + aax = ax(lhl) + bbx = bx(lhl) ENDIF ENDIF ! } @@ -6798,7 +7096,11 @@ subroutine ziegfall1d(nx,ny,nz,nor,norz,na,dtp,jgs,ixcol, & real vtmax real xvbarmax - + + real, parameter :: c1r=19.0, c2r=0.6, c3r=1.8, c4r=17.0 ! rain + real, parameter :: c1h=5.5, c2h=0.7, c3h=4.5, c4h=8.5 ! Graupel + real, parameter :: c1hl=3.7, c2hl=0.3, c3hl=9.0, c4hl=6.5, c5hl=1.0, c6hl=6.5 ! Hail + integer l1, l2 double precision :: dpt1, dpt2 @@ -7074,83 +7376,564 @@ subroutine ziegfall1d(nx,ny,nz,nor,norz,na,dtp,jgs,ixcol, & ELSEIF ( imurain == 3 ) THEN alpha(:,lr) = xnu(lr) ENDIF - - - + IF ( ipconc == 5 .and. imydiagalpha > 0 ) THEN + DO mgs = 1,ngscnt + IF ( qx(mgs,lr) .gt. qxmin(lr) .and. cx(mgs,lr) > cxmin ) THEN + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*cx(mgs,lr)) ! + xdia(mgs,lr,3) = (xv(mgs,lr)*6.0*cwc1)**(1./3.) + alpha(mgs,lr) = Min(alphamax, c1r*tanh(c2r*(xdia(mgs,lr,3)*1000. - c3r)) + c4r) + ENDIF + IF ( qx(mgs,lh) .gt. qxmin(lh) .and. cx(mgs,lh) > cxmin ) THEN + xv(mgs,lh) = rho0(mgs)*qx(mgs,lh)/(xdn(mgs,lh)*cx(mgs,lh)) ! + xdia(mgs,lh,3) = (xv(mgs,lh)*6.*piinv)**(1./3.) ! mwfac*xdia(mgs,lh,1) ! (xv(mgs,lh)*cwc0*6.0)**(1./3.) + alpha(mgs,lh) = Min(alphamax, c1h*tanh(c2h*(xdia(mgs,lh,3)*1000. - c3h)) + c4h) + ENDIF +! alpha(:,lr) = 0. ! 10. +! alpha(:,lh) = 0. ! 10. + IF ( lhl > 0 ) THEN + IF ( qx(mgs,lhl) .gt. qxmin(lhl) .and. cx(mgs,lhl) > cxmin ) THEN + xv(mgs,lhl) = rho0(mgs)*qx(mgs,lhl)/(xdn(mgs,lhl)*cx(mgs,lhl)) ! + xdia(mgs,lhl,3) = (xv(mgs,lhl)*6.*piinv)**(1./3.) + IF ( xdia(mgs,lhl,3) < 0.008 ) THEN + alpha(mgs,lhl) = Min(alphamax, c1hl*tanh(c2hl*(xdia(mgs,lhl,3)*1000. - c3hl)) + c4hl) + ELSE + alpha(mgs,lhl) = Min(alphamax, c5hl*xdia(mgs,lhl,3)*1000. + c6hl) + ENDIF + ENDIF + ENDIF + ENDDO + ENDIF ! -! Set density -! - if (ndebugzf .gt. 0 ) write(0,*) 'ZIEGFALL: call setvtz' +! Set 6th moments ! + IF ( ipconc .ge. 6 .or. lzr > 1) THEN - call setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno,cnostmp, & - & xmas,vtxbar,xdn,xvmn,xvmx,xv,cdx,cdxgs, & - & ipconc,ndebugzf,ngs,nz,kgs,fadvisc, & - & cwmasn,cwmasx,cwradn,cnina,cimn,cimx, & - & itype1,itype2,temcg,infdo,alpha,ildo,axx,bxx) -! & itype1,itype2,temcg,infdo,alpha,ildo,axh,bxh,axhl,bxhl) - - - -! -! put fall speeds into the x-z arrays -! - DO il = l1,l2 - do mgs = 1,ngscnt - - vtmax = 150.0 - - - IF ( vtxbar(mgs,il,2) .gt. vtxbar(mgs,il,1) .or. & - & ( vtxbar(mgs,il,1) .gt. vtxbar(mgs,il,3) .and. vtxbar(mgs,il,3) > 0.0) ) THEN - - - - vtxbar(mgs,il,1) = Max( vtxbar(mgs,il,1), vtxbar(mgs,il,2) ) - vtxbar(mgs,il,3) = Max( vtxbar(mgs,il,3), vtxbar(mgs,il,1) ) + zx(:,:) = 0.0 + +! DO il = lr,lhab + DO il = l1,l2 + + IF ( lz(il) .ge. 1 ) THEN + + DO mgs = 1,ngscnt + zx(mgs,il) = Max(an(igs(mgs),jy,kgs(mgs),lz(il)), 0.0) + ENDDO - ENDIF - - - IF ( vtxbar(mgs,il,1) .gt. vtmax .or. vtxbar(mgs,il,2) .gt. vtmax .or. & - & vtxbar(mgs,il,3) .gt. vtmax ) THEN - - vtxbar(mgs,il,1) = Min(vtmax,vtxbar(mgs,il,1) ) - vtxbar(mgs,il,2) = Min(vtmax,vtxbar(mgs,il,2) ) - vtxbar(mgs,il,3) = Min(vtmax,vtxbar(mgs,il,3) ) -! call commasmpi_abort() - ENDIF + ENDIF + + ENDDO + + ENDIF + - xvt(kgs(mgs),igs(mgs),1,il) = vtxbar(mgs,il,1) - xvt(kgs(mgs),igs(mgs),2,il) = vtxbar(mgs,il,2) - IF ( infdo .ge. 2 ) THEN - xvt(kgs(mgs),igs(mgs),3,il) = vtxbar(mgs,il,3) - ELSE - xvt(kgs(mgs),igs(mgs),3,il) = 0.0 - ENDIF -! xvt(kgs(mgs),igs(mgs),2,il) = xvt(kgs(mgs),igs(mgs),1,il) + +! Find shape parameter rain - enddo - ENDDO + IF ( lz(lr) > 1 .and. (ildo == 0 .or. ildo == lr ) .and. imurain == 3 ) THEN ! { RAIN SHAPE PARAM + il = lr + DO mgs = 1,ngscnt + + IF ( iresetmoments == 1 .or. iresetmoments == il ) THEN +! IF ( .false. .and. zx(mgs,lr) <= zxmin ) THEN + IF ( zx(mgs,lr) <= zxmin ) THEN + qx(mgs,lr) = 0.0 + cx(mgs,lr) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),lr) + an(igs(mgs),jgs,kgs(mgs),lr) = qx(mgs,lr) + an(igs(mgs),jgs,kgs(mgs),ln(lr)) = cx(mgs,lr) +! ELSEIF ( zx(mgs,lr) <= 0.0 .and. cx(mgs,lr) > 0.0 .and. qx(mgs,il) .gt. qxmin(il)) THEN +! write(91,*) 'ZF: overdepletion of Zr: z,c,q = ',zx(mgs,il),cx(mgs,il),qx(mgs,il) + ELSEIF ( cx(mgs,lr) <= cxmin ) THEN + zx(mgs,lr) = 0.0 + qx(mgs,lr) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),lr) + an(igs(mgs),jgs,kgs(mgs),lr) = qx(mgs,lr) + an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) + ENDIF + ENDIF + + + + IF ( qx(mgs,lr) .gt. qxmin(lr) ) THEN - if (ndebugzf .gt. 0 ) write(0,*) 'ZIEGFALL: COPIED FALL SPEEDS' + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*Max(1.0e-11,cx(mgs,lr))) + IF ( xv(mgs,lr) .gt. xvmx(lr) ) THEN +! tmp = cx(mgs,lr) +! xv(mgs,lr) = xvmx(lr) +! cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmx(lr)*xdn(mgs,lr)) +! an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) +! IF ( tmp < cx(mgs,il) ) THEN ! breakup +! g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) +!! zx(mgs,lr) = zx(mgs,lr) + g1*(rho0(mgs)/(1000.))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) +!! an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) +! ENDIF + ELSEIF ( xv(mgs,lr) .lt. xvmn(lr) ) THEN + xv(mgs,lr) = xvmn(lr) + cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmn(lr)*xdn(mgs,lr)) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ENDIF + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! have mass and reflectivity but no concentration, so set concentration, using default alpha + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z = zx(mgs,il) + qr = qx(mgs,il) + + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*1000.*1000) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + chw = cx(mgs,il) + qr = qx(mgs,il) + +! xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(1000.*Max(1.0e-9,cx(mgs,lr))) +! vr = xv(mgs,lr) + +! z = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) +! zx(mgs,il) = z +! an(igs(mgs),jy,kgs(mgs),lz(il)) = z + + zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(xdn(mgs,lr)**2*chw) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? + ! set values according to dBZ of -10, or Z = 0.1 +! write(91,*) 'alpha = ',alpha(mgs,il) + IF ( qx(mgs,il) < 1.e-8 ) THEN + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + ELSE +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*1000.*1000) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ENDIF + ENDIF + + IF ( zx(mgs,lr) > 0.0 ) THEN + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(1000.*Max(1.0e-9,cx(mgs,lr))) + vr = xv(mgs,lr) +! z = 36.*(alpha(kz)+2.0)*a(ix,jy,kz,lnr)*vr**2/((alpha(kz)+1.0)*pi**2) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z = zx(mgs,lr) + +! xv = (db(1,kz)*a(1,1,kz,lr))**2/(a(1,1,kz,lnr)) +! rd = z*(pi/6.*1000.)**2/xv + +! determine shape parameter alpha by iteration + IF ( z .gt. 0.0 ) THEN +! alpha(mgs,lr) = 3. + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + DO i = 1,20 +! IF ( 100.*Abs(alp - alpha(mgs,lr))/Abs(alpha(mgs,lr)) .lt. 1. ) EXIT + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. +! write(0,*) 'i,alp = ',i,alp + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO +! write(0,*) 'kz, alp, alpha(kz) = ',kz,alp,alpha(mgs,lr),qr*1000,z*1.e18,vr,nrx + + +! check for artificial breakup (rain larger than allowed max size) + IF ( xv(mgs,il) .gt. xvmx(il) ) THEN + tmp = cx(mgs,il) + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + IF ( tmp < cx(mgs,il) ) THEN ! breakup + + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + vr = xv(mgs,lr) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z = zx(mgs,lr) + + +! determine shape parameter alpha by iteration + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + DO i = 1,20 + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO + + ENDIF + ENDIF - 9998 continue +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! +! IF ( alpha(mgs,il) <= rnumin .or. alp == rnumin .or. alp == rnumax ) THEN + IF ( .true. .and. (alpha(mgs,il) <= rnumin .or. alp == rnumin .or. alp == rnumax) ) THEN - if (ndebugzf .gt. 0 ) write(0,*) 'ZIEGFALL: DONE WITH LOOP' + IF ( rescale_high_alpha .and. alp >= rnumax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(1./(xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( rescale_low_alphar .and. alp <= rnumin ) THEN - if ( kz .gt. nz-1 ) then - go to 1200 + z = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = z + an(igs(mgs),jy,kgs(mgs),lz(il)) = z + + ENDIF + ENDIF + + ENDIF + ENDIF + + ELSE + + zx(mgs,lr) = 0.0 + cx(mgs,lr) = 0.0 + an(igs(mgs),jgs,kgs(mgs),ln(lr)) = cx(mgs,lr) + an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) + + ENDIF + + ENDDO + ENDIF ! } + + + IF ( ipconc .ge. 6 ) THEN + +! Find shape parameters for graupel,hail + + DO il = lr,lhab + + IF ( lz(il) .gt. 1 .and. (ildo == 0 .or. ildo == il ) .and. ( .not. ( il == lr .and. imurain == 3 )) ) THEN + + DO mgs = 1,ngscnt + + IF ( iresetmoments == 1 .or. iresetmoments == il .or. iresetmoments == -1 ) THEN + IF ( zx(mgs,il) <= zxmin ) THEN ! .and. qx(mgs,il) > 0.05e-3 ) THEN + qx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ELSEIF ( iresetmoments == -1 .and. qx(mgs,il) < qxmin(il) ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( cx(mgs,il) <= cxmin .and. iresetmoments /= -1 ) THEN ! .and. qx(mgs,il) > 0.05e-3 ) THEN +!! write(91,*) 'cx=0; qx,zx = ',1000.*qx(mgs,il),1.e18*zx(mgs,il) + zx(mgs,il) = 0.0 + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + ENDIF + + IF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= cxmin ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + + IF ( qx(mgs,il) .gt. qxmin(il) ) THEN + + xv(mgs,il) = rho0(mgs)*qx(mgs,il)/(xdn(mgs,il)*Max(1.0e-9,cx(mgs,il))) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + + IF ( xv(mgs,il) .lt. xvmn(il) ) THEN +! tmp = cx(mgs,il) + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) +! IF ( tmp < cx(mgs,il) ) THEN ! breakup +! g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & +! & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) +! zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) +! an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) +! +! ENDIF + ENDIF + + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! have mass and reflectivity but no concentration, so set concentration, using default alpha + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(z*(pi*xdn(mgs,il))**2) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > cxmin ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + chw = cx(mgs,il) + qr = qx(mgs,il) +! zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw + zx(mgs,il) = Min(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? +! write(91,*) 'ziegfall: something screwy with moments: il = ',il +! write(91,*) 'q,n,z = ', 1.e3*qx(mgs,il),cx(mgs,il),zx(mgs,il) +! write(91,*) 'alpha = ',alpha(mgs,il) + + IF ( qx(mgs,il) < 1.e-8 ) THEN + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + ELSE +! write(0,*) 'alpha = ',alpha(mgs,il) + ! set values according to dBZ of -10 +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(z*(pi*xdn(mgs,il))**2) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ENDIF + ENDIF + ENDIF + + IF ( qx(mgs,il) .gt. qxmin(il) .and. cx(mgs,il) .gt. 0.0 ) THEN + chw = cx(mgs,il) + qr = qx(mgs,il) + z = zx(mgs,il) + + IF ( zx(mgs,il) .gt. 0. ) THEN + +! rd = z*(pi/6.*1000.)**2*chw/(0.224*(dn(igs(mgs),jy,kgs(mgs))*qr)**2) + rd = z*(pi/6.*xdn(mgs,il))**2*chw/((dn(igs(mgs),jy,kgs(mgs))*qr)**2) + + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rd) - 1.0 + DO i = 1,10 + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rd) - 1.0 +! write(0,*) 'i,alp = ',i,alp + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + + +! check for artificial breakup (graupel/hail larger than allowed max size) + + IF ( imaxdiaopt == 1 ) THEN + xvbarmax = xvmx(il) + ELSEIF ( imaxdiaopt == 2 ) THEN ! test against maximum mass diameter + xvbarmax = xvmx(il) /((3. + alpha(mgs,il))**3/((3. + alpha(mgs,il))*(2. + alpha(mgs,il))*(1. + alpha(mgs,il)))) + ELSEIF ( imaxdiaopt == 3 ) THEN ! test against mass-weighted diameter + xvbarmax = xvmx(il) /((4. + alpha(mgs,il))**3/((3. + alpha(mgs,il))*(2. + alpha(mgs,il))*(1. + alpha(mgs,il)))) + ENDIF + + IF ( xv(mgs,il) .gt. xvbarmax ) THEN + tmp = cx(mgs,il) + xv(mgs,il) = Min( xvbarmax, Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + IF ( tmp < cx(mgs,il) ) THEN ! breakup + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + chw = cx(mgs,il) + qr = qx(mgs,il) + z = zx(mgs,il) + + rd = z*(pi/6.*xdn(mgs,il))**2*chw/((rho0(mgs)*qr)**2) + alp = (6.0+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rd) - 1.0 + DO i = 1,10 + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rd) - 1.0 + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + + ENDIF + ENDIF + +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! + IF ( (rescale_low_alpha .or. rescale_high_alpha ) .and. & + & ( alpha(mgs,il) <= alphamin .or. alp == alphamin .or. alp == alphamax ) ) THEN + + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + + IF ( rescale_high_alpha .and. alp >= alphamax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(6./(pi*xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( rescale_low_alpha .and. alp <= alphamin .and. .not. (il == lh .and. icvhl2h > 0 ) ) THEN + +!! z1 = g1*dn(igs(mgs),jy,kgs(mgs))**2*( 0.224*qr)*qr/chw + z1 = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw + z = z1*(6./(pi*xdn(mgs,il)))**2 + zx(mgs,il) = z + an(igs(mgs),jy,kgs(mgs),lz(il)) = z + ENDIF + ENDIF + ELSE + ENDIF + ENDIF + ENDDO ! mgs + + ENDIF ! lz(il) .gt. 1 + + ENDDO ! il + +! CALL cld_cpu('Z-MOMENT-ZFAll') + + ENDIF + + IF ( lzhl > 1 ) THEN + IF ( lhl .gt. 1 ) THEN + + ENDIF + ENDIF + + + +! +! Set density +! + if (ndebugzf .gt. 0 ) write(0,*) 'ZIEGFALL: call setvtz' +! + + call setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno,cnostmp, & + & xmas,vtxbar,xdn,xvmn,xvmx,xv,cdx,cdxgs, & + & ipconc,ndebugzf,ngs,nz,kgs,fadvisc, & + & cwmasn,cwmasx,cwradn,cnina,cimn,cimx, & + & itype1,itype2,temcg,infdo,alpha,ildo,axx,bxx) +! & itype1,itype2,temcg,infdo,alpha,ildo,axh,bxh,axhl,bxhl) + + + +! +! put fall speeds into the x-z arrays +! + DO il = l1,l2 + do mgs = 1,ngscnt + + vtmax = 150.0 + + + IF ( vtxbar(mgs,il,2) .gt. vtxbar(mgs,il,1) .or. & + & ( vtxbar(mgs,il,1) .gt. vtxbar(mgs,il,3) .and. vtxbar(mgs,il,3) > 0.0) ) THEN + + +! IF ( qx(mgs,il) > 1.e-4 .and. & +! & .not. ( il == lr .and. 1.e3*xdia(mgs,il,3) > 5.0 ) ) THEN +! write(0,*) 'infdo,mgs = ',infdo,lzr,mgs +! write(0,*) 'Moment problem with vtxbar for il at i,j,k = ',il,igs(mgs),jy,kgs(mgs) +! write(0,*) 'nx,ny,nz,ng = ',nx,ny,nz,nor +! write(0,*) 'cwmasn,cwmasx = ',cwmasn,cwmasx +! write(0,*) 'vt1,2,3 = ',vtxbar(mgs,il,1),vtxbar(mgs,il,2),vtxbar(mgs,il,3) +! write(0,*) 'q,n,d = ', 1.e3*qx(mgs,il),cx(mgs,il),1.e3*xdia(mgs,il,3) +! IF ( il .ge. lr .and. lz(il) > 1 ) write(0,*) 'z = ', zx(mgs,il) +! IF ( il .ge. lg .or. il == lr ) THEN +! write(0,*) 'alpha = ',alpha(mgs,il) +! ENDIF +! ENDIF + + vtxbar(mgs,il,1) = Max( vtxbar(mgs,il,1), vtxbar(mgs,il,2) ) + vtxbar(mgs,il,3) = Max( vtxbar(mgs,il,3), vtxbar(mgs,il,1) ) + + ENDIF + + + IF ( vtxbar(mgs,il,1) .gt. vtmax .or. vtxbar(mgs,il,2) .gt. vtmax .or. & + & vtxbar(mgs,il,3) .gt. vtmax ) THEN + +! IF ( ndebugzf >= 0 .and. 1.e3*qx(mgs,il) > 0.1 ) THEN +! write(0,*) 'infdo = ',infdo +! write(0,*) 'Problem with vtxbar for il at i,j,k = ',il,igs(mgs),jy,kgs(mgs) +! write(0,*) 'nx,ny,nz,ng = ',nx,ny,nz,nor +! write(0,*) 'cwmasn,cwmasx = ',cwmasn,cwmasx +! write(0,*) 'vt1,2,3 = ',vtxbar(mgs,il,1),vtxbar(mgs,il,2),vtxbar(mgs,il,3) +! write(0,*) 'q,n,d = ', 1.e3*qx(mgs,il),cx(mgs,il),1.e3*xdia(mgs,il,3) +! IF ( il .ge. lr .and. lz(il) > 1 ) write(0,*) 'z = ', zx(mgs,il) +! IF ( il .ge. lg ) THEN +! write(0,*) 'alpha = ',alpha(mgs,il) +! ENDIF +! ENDIF + vtxbar(mgs,il,1) = Min(vtmax,vtxbar(mgs,il,1) ) + vtxbar(mgs,il,2) = Min(vtmax,vtxbar(mgs,il,2) ) + vtxbar(mgs,il,3) = Min(vtmax,vtxbar(mgs,il,3) ) + +! call commasmpi_abort() + ENDIF + + + xvt(kgs(mgs),igs(mgs),1,il) = vtxbar(mgs,il,1) + xvt(kgs(mgs),igs(mgs),2,il) = vtxbar(mgs,il,2) + IF ( infdo .ge. 2 ) THEN + xvt(kgs(mgs),igs(mgs),3,il) = vtxbar(mgs,il,3) + ELSE + xvt(kgs(mgs),igs(mgs),3,il) = 0.0 + ENDIF + +! xvt(kgs(mgs),igs(mgs),2,il) = xvt(kgs(mgs),igs(mgs),1,il) + + enddo + ENDDO + + + if (ndebugzf .gt. 0 ) write(0,*) 'ZIEGFALL: COPIED FALL SPEEDS' + + + + 9998 continue + + if (ndebugzf .gt. 0 ) write(0,*) 'ZIEGFALL: DONE WITH LOOP' + + if ( kz .gt. nz-1 ) then + go to 1200 else nzmpb = kz end if @@ -7630,6 +8413,8 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & IF ( ipconc .le. 2 ) THEN gtmp(ix,kz) = dadr*an(ix,jy,kz,lr)**(0.25) dtmp(ix,kz) = zrc*gtmp(ix,kz)**7 + ELSEIF ( lzr .gt. 1 ) THEN + dtmp(ix,kz) = 1e18*an(ix,jy,kz,lzr) ELSEIF ( an(ix,jy,kz,lnr) .gt. 1.e-3 ) THEN IF ( imurain == 3 ) THEN vr = db(ix,jy,kz)*an(ix,jy,kz,lr)/(1000.*an(ix,jy,kz,lnr)) @@ -7822,7 +8607,7 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & ELSE ! new form using a mass relationship m = p d^2 (instead of d^3 -- Cox 1988 QJRMS) so that density depends on size ! p = 0.106214 for m = p v^(2/3) - dnsnow = 0.346159*sqrt(an(ix,jy,kz,lns)/(an(ix,jy,kz,ls)*db(ix,jy,kz)) ) + dnsnow = 0.0346159*sqrt(an(ix,jy,kz,lns)/(an(ix,jy,kz,ls)*db(ix,jy,kz)) ) IF ( .true. .or. dnsnow < 900. ) THEN gtmp(ix,kz) = 1.e18*323.3226* 0.106214**2*(ksq*an(ix,jy,kz,ls) + & & (1.-ksq)*qxw)*an(ix,jy,kz,ls)*db(ix,jy,kz)**2*gsnow73/ & @@ -7898,6 +8683,10 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & IF ( izieg .ge. 1 .and. ipconc .ge. 5 ) THEN ltest = .false. + IF ( lzh > 1 ) THEN + IF ( an(ix,jy,kz,lzh) > 0.0 .and. an(ix,jy,kz,lh) > qhmin .and. & + an(ix,jy,kz,lnh) >= cxmin ) ltest = .true. + ENDIF IF ( ltest .or. (an(ix,jy,kz,lh) .ge. qhmin .and. an(ix,jy,kz,lnh) .ge. cxmin )) THEN @@ -7943,6 +8732,9 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & ENDIF IF ( lzh .gt. 1 ) THEN + x = (0.224*qh + 0.776*qxw)/an(ix,jy,kz,lh) ! weighted average of dielectric const + dtmph = 1.e18*x*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + dtmp(ix,kz) = dtmp(ix,kz) + dtmph ELSE g1 = (6.0 + alphah)*(5.0 + alphah)*(4.0 + alphah)/((3.0 + alphah)*(2.0 + alphah)*(1.0 + alphah)) ! zx = g1*(db(ix,jy,kz)*an(ix,jy,kz,lh))**2/chw @@ -8015,6 +8807,10 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & IF ( ipconc .ge. 5 ) THEN ltest = .false. + IF ( lzhl > 1 ) THEN + IF ( an(ix,jy,kz,lzhl) > 0.0 .and. an(ix,jy,kz,lhl) > qhlmin .and. & + an(ix,jy,kz,lnhl) > 0.0 ) ltest = .true. + ENDIF IF ( ltest .or. ( an(ix,jy,kz,lhl) .ge. qhlmin .and. an(ix,jy,kz,lnhl) .gt. 0.) ) THEN !{ chl = an(ix,jy,kz,lnhl) @@ -8038,6 +8834,9 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & ENDIF IF ( lzhl .gt. 1 ) THEN !{ + x = (0.224*an(ix,jy,kz,lhl) + 0.776*qxw)/an(ix,jy,kz,lhl) ! weighted average of dielectric const + dtmphl = 1.e18*x*an(ix,jy,kz,lzhl)*(hldn/rwdn)**2 + dtmp(ix,kz) = dtmp(ix,kz) + dtmphl ELSE !} g1 = (6.0 + alphahl)*(5.0 + alphahl)*(4.0 + alphahl)/((3.0 + alphahl)*(2.0 + alphahl)*(1.0 + alphahl)) @@ -8118,8 +8917,7 @@ subroutine radardd02(nx,ny,nz,nor,na,an,temk, & ! write(0,*) 'Hail,snow c: ',an(ix,jy,kz,lnh),an(ix,jy,kz,lns) ! write(0,*) 'dtmps,dtmph = ',dtmps,dtmph ! ENDIF - - IF ( ndebug>1 .and. .not. dtmp(ix,kz) .lt. 1.e30 .or. dbz(ix,jy,kz) > 190.0 ) THEN + IF ( .not. dtmp(ix,kz) .lt. 1.e30 .or. dbz(ix,jy,kz) > 190.0 ) THEN ! IF ( ix == 31 .and. kz == 20 .and. jy == 23 ) THEN ! write(0,*) 'my_rank = ',my_rank write(0,*) 'ix,jy,kz = ',ix,jy,kz @@ -8190,6 +8988,8 @@ END subroutine radardd02 ! ##################################################################### ! ! Subroutine for explicit cloud condensation and droplet nucleation +! +! 11/30/2022: Fixed droplet evaporation heating term for CM1 eqtset=2 (was only doing eqtset=1) ! SUBROUTINE NUCOND & & (nx,ny,nz,na,jyslab & @@ -8543,6 +9343,7 @@ SUBROUTINE NUCOND & qx(:,:) = 0.0 cx(:,:) = 0.0 + zx(:,:) = 0.0 xv(:,:) = 0.0 xmas(:,:) = 0.0 @@ -8602,6 +9403,7 @@ SUBROUTINE NUCOND & ELSE ! equation set 2 in cm1 tmp = qx(mgs,li)+qx(mgs,ls)+qx(mgs,lh) IF ( lhl > 1 ) tmp = tmp + qx(mgs,lhl) + IF ( lf > 1 ) tmp = tmp + qx(mgs,lf) cvm = cv+cvv*qx(mgs,lv)+cpl*(qx(mgs,lc)+qx(mgs,lr)) & +cpigb*(tmp) cpm = cp+cpv*qx(mgs,lv)+cpl*(qx(mgs,lc)+qx(mgs,lr)) & @@ -8716,6 +9518,237 @@ SUBROUTINE NUCOND & ventrxn(:) = ventrn +! Find shape parameter rain + + IF ( lzr > 1 .and. rcond == 2 ) THEN ! { RAIN SHAPE PARAM + DO mgs = 1,ngscnt + zx(mgs,lr) = Max(an(igs(mgs),jy,kgs(mgs),lzr), 0.0) + ENDDO + +! CALL cld_cpu('Z-MOMENT-1r2') + il = lr + DO mgs = 1,ngscnt + + IF ( zx(mgs,il) <= 0.0 ) THEN + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + qx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ELSEIF ( cx(mgs,il) <= 0.0 ) THEN + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + zx(mgs,il) = 0.0 + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + + IF ( qx(mgs,lr) .gt. qxmin(lr) ) THEN + + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*Max(1.0e-11,cx(mgs,lr))) + IF ( xv(mgs,lr) .gt. xvmx(lr) ) THEN + xv(mgs,lr) = xvmx(lr) + cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmx(lr)*xdn(mgs,lr)) + ELSEIF ( xv(mgs,lr) .lt. xvmn(lr) ) THEN + xv(mgs,lr) = xvmn(lr) + cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmn(lr)*xdn(mgs,lr)) + ENDIF + + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! have mass and reflectivity but no concentration, so set concentration, using default alpha + IF ( imurain == 3 ) THEN + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z1 = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z1*1000.*1000) + ELSE + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + z1 = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z1*1000.*1000) + + ENDIF +! an(igs(mgs),jgs,kgs(mgs),ln(il)) = zx(mgs,il) + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha + IF ( imurain == 3 ) THEN + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + chw = cx(mgs,il) + qr = qx(mgs,il) + zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(chw*1000.*1000) + ELSE + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + chw = cx(mgs,il) + qr = qx(mgs,il) + zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(chw*1000.*1000) + + ENDIF + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? + ! set values according to dBZ of -10, or Z = 0.1 +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + IF ( imurain == 3 ) THEN + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z1 = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z1*1000.*1000) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ELSEIF ( imurain == 1 ) THEN + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z1 = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(z1*(pi*xdn(mgs,il))**2) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + + ENDIF + ENDIF + + IF ( zx(mgs,lr) > 0.0 ) THEN + vr = rho0(mgs)*qx(mgs,lr)/(1000.*cx(mgs,lr)) +! z1 = 36.*(alpha(kz)+2.0)*a(ix,jy,kz,lnr)*vr**2/((alpha(kz)+1.0)*pi**2) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z1 = zx(mgs,lr) + +! xv = (db(1,kz)*a(1,1,kz,lr))**2/(a(1,1,kz,lnr)) +! rd = z1*(pi/6.*1000.)**2/xv + + +! determine shape parameter alpha by iteration + IF ( z1 .gt. 0.0 ) THEN + + IF ( imurain == 3 ) THEN + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z1*pi**2) - 1. +! write(0,*) 'kz, alp, alpha(kz) = ',kz,alp,alpha(kz),rd,z1,xv + DO i = 1,20 + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z1*pi**2) - 1. +! write(0,*) 'i,alp = ',i,alp + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO + + ELSE ! imurain == 1 + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + + rd1 = z1*(pi/6.*xdn(mgs,il))**2*nrx/(rho0(mgs)*qr)**2 + + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rd1) - 1.0 + + DO i = 1,10 + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) + + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rd1) - 1.0 + + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + + ENDIF +! ENDIF + +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! + IF ( imurain == 3 ) THEN + IF ( .true. .and. (alpha(mgs,il) <= rnumin .or. alp == rnumin .or. alp == rnumax) ) THEN + + IF ( rescale_high_alpha .and. alp >= rnumax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z1*(1./(xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( rescale_low_alphar .and. alp <= rnumin ) THEN + + z1 = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = z1 + ENDIF + ENDIF + + ELSEIF ( imurain == 1 ) THEN + + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + + IF ( (rescale_low_alpha .or. rescale_high_alpha ) .and. & + & ( alpha(mgs,il) <= alphamin .or. alp == alphamin .or. alp == alphamax ) ) THEN + + + + IF ( rescale_high_alpha .and. alp >= alphamax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + cx(mgs,il) = g1*rho0(mgs)**2*(qr)*qr/zx(mgs,lr)*(6./(pi*xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( rescale_low_alpha .and. alp <= alphamin ) THEN ! alpha = alphamin, so reset Z to prevent growth in C + z1 = g1*rho0(mgs)**2*(qr)*qr/nrx + z2 = z1*(6./(pi*xdn(mgs,il)))**2 + zx(mgs,il) = z2 + an(igs(mgs),jy,kgs(mgs),lz(il)) = z2 + ENDIF + ENDIF ! imurain + + ENDIF ! z > 0 + + tmp = alpha(mgs,lr) + 4./3. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = alpha(mgs,lr) + 1. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + +! ventrx(mgs) = Gamma(alpha(mgs,lr) + 4./3.)/(alpha(mgs,lr) + 1.)**(1./3.)/Gamma(alpha(mgs,lr) + 1.) + ventrx(mgs) = x/(y*(alpha(mgs,lr) + 1.)**(1./3.)) + + IF ( imurain == 3 .and. izwisventr == 2 ) THEN + + tmp = alpha(mgs,lr) + 1.5 + br/6. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + +! ventrx(mgs) = Gamma(alpha(mgs,lr) + 1.5 + br/6.)/Gamma(alpha(mgs,lr) + 1.) + ventrxn(mgs) = x/(y*(alpha(mgs,lr) + 1.)**((1.+br)/6. + 1./3.)) + + ELSEIF ( imurain == 1 .and. iferwisventr == 2 ) THEN + + tmp = alpha(mgs,lr) + 2.5 + br/2. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + +! ventrx(mgs) = Gamma(alpha(mgs,lr) + 1.5 + br/6.)/Gamma(alpha(mgs,lr) + 1.) + ventrxn(mgs) = x/y + + + ENDIF + + + ENDIF + ENDIF + + ENDIF + + ENDDO +! CALL cld_cpu('Z-MOMENT-1r2') + ENDIF ! } + ! write(0,*) 'NUCOND: Set ssf variables, ssmxinit =',ssmxinit ssmx = 0.0 @@ -8868,9 +9901,9 @@ SUBROUTINE NUCOND & QEVAP= Min( qx(mgs,lc), R1*(qss(mgs)-qvap(mgs)) ) - IF ( qx(mgs,lc) .LT. QEVAP ) THEN ! GO TO 63 + IF ( qx(mgs,lc) <= QEVAP ) THEN ! GO TO 63 qwvp(mgs) = qwvp(mgs) + qx(mgs,lc) - thetap(mgs) = thetap(mgs) - felv(mgs)*qx(mgs,lc)/(cp*pi0(mgs)) + thetap(mgs) = thetap(mgs) - felvcp(mgs)*qx(mgs,lc)/(pi0(mgs)) IF ( io_flag .and. nxtra > 1 ) THEN axtra(igs(mgs),jy,kgs(mgs),1) = -qx(mgs,lc)/dtp ENDIF @@ -8878,13 +9911,13 @@ SUBROUTINE NUCOND & IF ( restoreccn ) THEN IF ( irenuc <= 2 ) THEN IF ( .not. invertccn ) THEN - ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + cx(mgs,lc) ) ) + ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ) ) ELSE - ccnc(mgs) = ccnc(mgs) + cx(mgs,lc) + ccnc(mgs) = ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ENDIF ENDIF IF ( lccna > 1 ) THEN - ccna(mgs) = ccna(mgs) - cx(mgs,lc) + ccna(mgs) = ccna(mgs) - restoreccnfrac*cx(mgs,lc) ENDIF ENDIF cx(mgs,lc) = 0. @@ -8898,13 +9931,13 @@ SUBROUTINE NUCOND & ! ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + cx(mgs,lc) ) ) ! ccnc(mgs) = ccnc(mgs) + cx(mgs,lc) IF ( .not. invertccn ) THEN - ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + cx(mgs,lc) ) ) + ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ) ) ELSE - ccnc(mgs) = ccnc(mgs) + cx(mgs,lc) + ccnc(mgs) = ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ENDIF ENDIF IF ( lccna > 1 ) THEN - ccna(mgs) = ccna(mgs) - cx(mgs,lc) + ccna(mgs) = ccna(mgs) - restoreccnfrac*cx(mgs,lc) ENDIF ENDIF cx(mgs,lc) = 0. @@ -8915,18 +9948,18 @@ SUBROUTINE NUCOND & ! ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + tmp ) ) ! ccnc(mgs) = ccnc(mgs) + tmp IF ( .not. invertccn ) THEN - ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + tmp ) ) + ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + restoreccnfrac*tmp ) ) ELSE - ccnc(mgs) = ccnc(mgs) + tmp + ccnc(mgs) = ccnc(mgs) + restoreccnfrac*tmp ENDIF ENDIF IF ( lccna > 1 ) THEN - ccna(mgs) = ccna(mgs) - tmp + ccna(mgs) = ccna(mgs) - restoreccnfrac*tmp ENDIF ENDIF cx(mgs,lc) = cx(mgs,lc) - tmp ENDIF - thetap(mgs) = thetap(mgs) - felv(mgs)*QEVAP/(CP*pi0(mgs)) + thetap(mgs) = thetap(mgs) - felvcp(mgs)*QEVAP/(pi0(mgs)) IF ( io_flag .and. nxtra > 1 ) THEN axtra(igs(mgs),jy,kgs(mgs),1) = -QEVAP/dtp ENDIF @@ -9208,6 +10241,19 @@ SUBROUTINE NUCOND & !! & dx*dy*dz3d(igs(mgs),jy,kgs(mgs)) + IF ( lzr > 1 .and. rcond == 2 .and. qx(mgs,lr) .gt. qxmin(lr) & + & .and. cx(mgs,lr) .gt. 1.e-9 ) THEN + tmp = qx(mgs,lr)/cx(mgs,lr) + IF ( imurain == 3 ) THEN + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + ELSE + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + + ENDIF + zx(mgs,lr) = zx(mgs,lr) + g1*(rho0(mgs)/(xdn(mgs,lr)))**2*( 2.*( tmp ) * dqr ) + ENDIF + theta(mgs) = thetap(mgs) + theta0(mgs) temg(mgs) = theta(mgs)*f1 ltemq = (temg(mgs)-163.15)/fqsat+1.5 @@ -9468,15 +10514,143 @@ SUBROUTINE NUCOND & ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) - ELSEIF ( irenuc == 5 ) THEN !} { - - ! modification of Phillips Donner Garner 2007 + ELSEIF ( irenuc == 3 ) THEN !} { + ! Phillips Donner Garner 2007 ! if (ndebug .gt. 0) write(0,*) 'ICEZVD_DR: Cloud reNucleation, wvel = ',wvel(mgs) -! CN(mgs) = Min( 0.91*cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp )! *Min(1.0,1./dtp) ! 0.3465 - CN(mgs) = Min( cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp ) +! CN(mgs) = cwccn*Min(ssf(mgs),ssfcut)**cck - - IF ( ccna(mgs) >= cnuc(mgs) ) THEN ! apply limit after all "base" CCN have been depleted +! Need to calculate new ssf since condensation has happened: + temp1 = (theta0(mgs)+thetap(mgs))*pk(mgs) ! t77(ix,jy,kz) + ltemq = Int( (temp1-163.15)/fqsat+1.5 ) + ltemq = Min( nqsat, Max(1,ltemq) ) + + c1= pqs(mgs)*tabqvs(ltemq) + + ssf(mgs) = 0.0 + IF ( c1 > 0. ) THEN + ssf(mgs) = 100.*(qx(mgs,lv)/c1 - 1.0) ! from "new" values + ENDIF + CN(mgs) = cnuc(mgs)*Min(1.0, (ssf(mgs))**cck ) ! + + CN(mgs) = Max( 0.0, CN(mgs) - ccna(mgs) ) ! this was from + ! Philips, Donner et al. 2007, but results in too much limitation of + ! nucleation + CN(mgs) = Min(cn(mgs), ccnc(mgs)) + cn(mgs) = Min(cn(mgs), 0.5*dqc/cwmasn) ! limit the nucleation mass to half of the condensation mass + + cx(mgs,lc) = cx(mgs,lc) + cn(mgs) + + ! 6/13/2016: Phillips et al. appears not to decrement CCN, but only increments CCNa. + ! This would allow an initially non-homogeneous (vertically, e.g.) initial value of CCN/rho_air + ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + + ELSEIF ( irenuc == 4 ) THEN !} { + ! modification of Phillips Donner Garner 2007 +! if (ndebug .gt. 0) write(0,*) 'ICEZVD_DR: Cloud reNucleation, wvel = ',wvel(mgs) +! CN(mgs) = CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp +! cn(mgs) = Min( cn(mgs), cnuc(mgs) ) +! Need to calculate new ssf since condensation has happened: + temp1 = (theta0(mgs)+thetap(mgs))*pk(mgs) ! t77(ix,jy,kz) + ltemq = Int( (temp1-163.15)/fqsat+1.5 ) + ltemq = Min( nqsat, Max(1,ltemq) ) + + c1= pqs(mgs)*tabqvs(ltemq) + IF ( c1 > 0. ) THEN + ssf(mgs) = Max(0.0, 100.*((qv0(mgs) + qwvp(mgs))/c1 - 1.0) ) ! from "new" values + ELSE + ssf(mgs) = 0.0 + ENDIF + CN(mgs) = cnuc(mgs)*Min(ssf2kmax, ssf(mgs)**cck) ! this allows cn(mgs) > cnuc(mgs) + + CN(mgs) = Max( 0.0, CN(mgs) - ccna(mgs) ) ! this was from + ! Philips, Donner et al. 2007, but results in too much limitation of + ! nucleation +! CN(mgs) = Min(cn(mgs), ccnc(mgs)) + cn(mgs) = Min(cn(mgs), 0.5*dqc/cwmasn) ! limit the nucleation mass to half of the condensation mass + + IF ( cn(mgs) > 0.0 ) THEN + cx(mgs,lc) = cx(mgs,lc) + cn(mgs) + ! ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + + dcrit = 2.0*2.5e-7 + + dcloud = 1000.*dcrit**3*Pi/6.*cn(mgs) + qx(mgs,lc) = qx(mgs,lc) + DCLOUD + thetap(mgs) = thetap(mgs) + felvcp(mgs)*DCLOUD/(pi0(mgs)) + qwvp(mgs) = qwvp(mgs) - DCLOUD + ENDIF + ! 6/13/2016: Phillips et al. appears not to decrement CCN, but only increments CCNa. + ! This would allow an initially non-homogeneous (vertically, e.g.) initial value of CCN/rho_air +! ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + + + + ELSEIF ( irenuc == 6 ) THEN !} { + + ! simple Twomey scheme but limit activation to try to do most activation near cloud base, but keep some CCN available for renuclation +! if (ndebug .gt. 0) write(0,*) 'ICEZVD_DR: Cloud reNucleation, wvel = ',wvel(mgs) + cn(mgs) = 0.0 +! IF ( ccna(mgs) < 0.7*cnuc(mgs) .and. ccnc(mgs) > 0.69*cnuc(mgs) - ccna(mgs)) THEN ! here, assume we are near cloud base and use Twomey formulation + IF ( ccna(mgs) < 0.7*cnuc(mgs) ) THEN ! here, assume we are near cloud base and use Twomey formulation + CN(mgs) = Min( 0.9*cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp )! *Min(1.0,1./dtp) ! 0.3465 +! IF ( cn(mgs) + ccna(mgs) > 0.71*cnuc ) THEN + ! prevent this branch from activating more than 70% of CCN + CN(mgs) = Min( CN(mgs), Max(0.0, (0.7*cnuc(mgs) - ccna(mgs) )) ) +! CN(mgs) = Min( CN(mgs), Max(0.0, 0.71*ccnc(mgs) - ccna(mgs) ) ) + + ELSE + ! if a large fraction of CCN have been activated, then assume we are in the cloud interior and use local SSw as in Phillips et al. 2007. + + temp1 = (theta0(mgs)+thetap(mgs))*pk(mgs) ! t77(ix,jy,kz) +! t0(ix,jy,kz) = temp1 + ltemq = Int( (temp1-163.15)/fqsat+1.5 ) + ltemq = Min( nqsat, Max(1,ltemq) ) + +! c1 = t00(igs(mgs),jy,kgs(mgs))*tabqvs(ltemq) + c1= pqs(mgs)*tabqvs(ltemq) + IF ( c1 > 0. ) THEN + ssf(mgs) = Max(0.0, 100.*((qv0(mgs) + qwvp(mgs))/c1 - 1.0) ) ! from "new" values + ELSE + ssf(mgs) = 0.0 + ENDIF + +! CN(mgs) = cnuc(mgs)*Min(0.99, Min(ssf(mgs),ssfcut)**cck ) ! + CN(mgs) = cnuc(mgs)*Min(2.0, Max(0.0,ssf(mgs))**cck ) ! +! CN(mgs) = cnuc(mgs)*Min(ssf(mgs),ssfcut)**cck ! + + + CN(mgs) = Min(0.01*cnuc(mgs), Max( 0.0, CN(mgs) - ccna(mgs) ) ) ! this was from +! cn(mgs) = 0.0 + ENDIF +! ccne = ccnefac*1.e6*(1.e-6*Abs(cwccn))**(2./(2.+cck)) +!!! CN(mgs) = Max( 0.0, CN(mgs) - ccna(mgs) ) ! this was from + ! Philips, Donner et al. 2007, but results in too much limitation of + ! nucleation +! CN(mgs) = Min(cn(mgs), ccnc(mgs)) +! cn(mgs) = Min(cn(mgs), 0.5*dqc/cwmasn) ! limit the nucleation mass to half of the condensation mass + + IF ( cn(mgs) > 0.0 ) THEN + cx(mgs,lc) = cx(mgs,lc) + cn(mgs) + + ! create some small droplets at minimum size (CP 2000), although it adds very little liquid + + dcrit = 2.0*2.5e-7 + + dcloud = 1000.*dcrit**3*Pi/6.*cn(mgs) + qx(mgs,lc) = qx(mgs,lc) + DCLOUD + thetap(mgs) = thetap(mgs) + felvcp(mgs)*DCLOUD/(pi0(mgs)) + qwvp(mgs) = qwvp(mgs) - DCLOUD + ! ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + ENDIF + ELSEIF ( irenuc == 5 ) THEN !} { + + ! modification of Phillips Donner Garner 2007 +! if (ndebug .gt. 0) write(0,*) 'ICEZVD_DR: Cloud reNucleation, wvel = ',wvel(mgs) +! CN(mgs) = Min( 0.91*cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp )! *Min(1.0,1./dtp) ! 0.3465 + CN(mgs) = Min( cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp ) + + + IF ( ccna(mgs) >= cnuc(mgs) ) THEN ! apply limit after all "base" CCN have been depleted temp1 = (theta0(mgs)+thetap(mgs))*pk(mgs) ! t77(ix,jy,kz) ltemq = Int( (temp1-163.15)/fqsat+1.5 ) ltemq = Min( nqsat, Max(1,ltemq) ) @@ -9573,7 +10747,7 @@ SUBROUTINE NUCOND & ! write(0,*) 'k,cn = ',kgs(mgs),cn(mgs),ssf(mgs) ! write(0,*) 'ccn-ccna = ',cnuc(mgs) - ccna(mgs),ccnc(mgs) - ccna(mgs) ! IF ( ccncuf(mgs) > 0.0 .and. cn(mgs) < 1.e-3 .and. ssmax(mgs) > 1.0 ) THEN - IF ( ccncuf(mgs) > 0.0 .and. ssf(mgs) > ssmxuf .and. ssmax(mgs) > ssmxuf ) THEN + IF ( ccncuf(mgs) > 0.0 .and. ssf(mgs) > ssmxuf .and. ( ssmax(mgs) > ssmxuf .or. lss < 1 ) ) THEN CNuf(mgs) = Min( ccncuf(mgs), CCNE0*ccncuf(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp )! *Min(1.0,1./dtp) ! 0.3465 ! IF ( cnuf(mgs) >= 0.0 ) write(0,*) 'cnuf, k = ',cnuf(mgs),ccncuf(mgs),kgs(mgs) ENDIF @@ -9853,6 +11027,10 @@ SUBROUTINE NUCOND & ! qx(mgs,lr) = an(igs(mgs),jy,kgs(mgs),lr) end if + IF ( lzr > 1 .and. rcond == 2 ) THEN + an(igs(mgs),jy,kgs(mgs),lzr) = zx(mgs,lr) + & + & min( an(igs(mgs),jy,kgs(mgs),lzr), 0.0 ) + ENDIF IF ( ipconc .ge. 2 ) THEN @@ -9938,6 +11116,42 @@ SUBROUTINE NUCOND & IF ( lhl .gt. 1 ) THEN + IF ( lzhl .gt. 1 ) THEN + + an(ix,jy,kz,lzhl) = Max(0.0, an(ix,jy,kz,lzhl) ) + + IF ( an(ix,jy,kz,lhl) .ge. frac*qxmin(lhl) .and. rescale_low_alpha ) THEN ! check 6th moment + + IF ( an(ix,jy,kz,lnhl) .gt. 0.0 ) THEN + + IF ( lvhl .gt. 1 ) THEN + IF ( an(ix,jy,kz,lvhl) .gt. 0.0 ) THEN + hwdn = dn(ix,jy,kz)*an(ix,jy,kz,lhl)/an(ix,jy,kz,lvhl) + ELSE + hwdn = xdn0(lhl) + ENDIF + hwdn = Max( xdnmn(lhl), hwdn ) + ELSE + hwdn = xdn0(lhl) + ENDIF + + chw = an(ix,jy,kz,lnhl) + g1 = (6.0+alphamin)*(5.0+alphamin)*(4.0+alphamin)/ & + & ((3.0+alphamin)*(2.0+alphamin)*(1.0+alphamin)) + z1 = g1*dn(ix,jy,kz)**2*( an(ix,jy,kz,lhl) )*an(ix,jy,kz,lhl)/chw + z1 = z1*(6./(pi*hwdn))**2 + ELSE + z1 = 0.0 + ENDIF + + an(ix,jy,kz,lzhl) = Min( z1, an(ix,jy,kz,lzhl) ) + + IF ( an(ix,jy,kz,lnhl) .lt. 1.e-5 ) THEN +! an(ix,jy,kz,lzhl) = 0.9*an(ix,jy,kz,lzhl) + ENDIF + ENDIF + + ENDIF !lzhl if ( an(ix,jy,kz,lhl) .lt. frac*qxmin(lhl) .or. zerocx(lhl) ) then @@ -10038,6 +11252,42 @@ SUBROUTINE NUCOND & + IF ( lzh .gt. 1 ) THEN + + an(ix,jy,kz,lzh) = Max(0.0, an(ix,jy,kz,lzh) ) + + IF ( .false. .and. an(ix,jy,kz,lh) .ge. frac*qxmin(lh) .and. rescale_low_alpha ) THEN + + IF ( an(ix,jy,kz,lnh) .gt. 0.0 ) THEN + + IF ( lvh .gt. 1 ) THEN + IF ( an(ix,jy,kz,lvh) .gt. 0.0 ) THEN + hwdn = dn(ix,jy,kz)*an(ix,jy,kz,lh)/an(ix,jy,kz,lvh) + ELSE + hwdn = xdn0(lh) + ENDIF + hwdn = Max( xdnmn(lh), hwdn ) + ELSE + hwdn = xdn0(lh) + ENDIF + + chw = an(ix,jy,kz,lnh) + g1 = (6.0+alphamin)*(5.0+alphamin)*(4.0+alphamin)/ & + & ((3.0+alphamin)*(2.0+alphamin)*(1.0+alphamin)) + z1 = g1*dn(ix,jy,kz)**2*( an(ix,jy,kz,lh) )*an(ix,jy,kz,lh)/chw + z1 = z1*(6./(pi*hwdn))**2 + ELSE + z1 = 0.0 + ENDIF + + an(ix,jy,kz,lzh) = Min( z1, an(ix,jy,kz,lzh) ) + + IF ( an(ix,jy,kz,lnh) .lt. 1.e-5 ) THEN +! an(ix,jy,kz,lzh) = 0.9*an(ix,jy,kz,lzh) + ENDIF + ENDIF + + ENDIF if ( an(ix,jy,kz,lh) .lt. frac*qxmin(lh) .or. zerocx(lh) ) then @@ -10198,6 +11448,9 @@ SUBROUTINE NUCOND & end if + IF ( lzr > 1 ) THEN + an(ix,jy,kz,lzr) = Max(0.0, an(ix,jy,kz,lzr) ) + ENDIF if ( an(ix,jy,kz,lr) .lt. frac*qxmin(lr) .or. zerocx(lr) & & ) then @@ -10208,6 +11461,10 @@ SUBROUTINE NUCOND & an(ix,jy,kz,lnr) = 0.0 ENDIF + IF ( lzr > 1 ) THEN + an(ix,jy,kz,lzr) = 0.0 + ENDIF + end if ! @@ -10265,12 +11522,14 @@ SUBROUTINE NUCOND & & an(ix,jy,kz,lccn) + Max(0.0,an(ix,jy,kz,lnc)) ENDIF an(ix,jy,kz,lnc) = 0.0 + IF ( lccn > 1 ) an(ix,jy,kz,lccn) = Max( 0.0, an(ix,jy,kz,lccn) ) IF ( lccna > 0 ) THEN ! apply exponential decay to activated CCN to restore to environmental value + IF ( restoreccn ) THEN tmp = an(ix,jy,kz,li) + an(ix,jy,kz,ls) IF ( an(ix,jy,kz,lccna) > 1. .and. tmp < qxmin(li) ) an(ix,jy,kz,lccna) = an(ix,jy,kz,lccna)*Exp(-dtp/ccntimeconst) - + ENDIF ELSEIF ( lccn > 1 .and. restoreccn ) THEN ! in this case, we are treating the ccn field as ccna tmp = an(ix,jy,kz,li) + an(ix,jy,kz,ls) @@ -10425,6 +11684,7 @@ subroutine nssl_2mom_gs & real rainprod2d(-nor+1:nx+nor,-norz+ng1:nz+norz) real evapprod2d(-nor+1:nx+nor,-norz+ng1:nz+norz) + logical lrescalelow(lc:lhab) real tkediss(-nor+1:nx+nor,-norz+ng1:nz+norz) real axtra(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz,nxtra) @@ -10633,7 +11893,8 @@ subroutine nssl_2mom_gs & real ex1, ft, rhoinv(ngs) double precision ec0(ngs) - real ac1,bc, taus, c1,d1,e1,f1,p380,tmp,tmp1,tmp2,tmp3,tmp4,tmp5,temp3 ! , sstdy, super + real ac1,bc, taus, c1,d1,e1,f1,p380,tmp,tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,temp3 ! , sstdy, super + real :: flim real dw,dwr double precision :: tmpz, tmpzmlt real ratio, delx, dely @@ -10714,7 +11975,7 @@ subroutine nssl_2mom_gs & real temgx(ngs),temcgx(ngs) real qvs(ngs),qis(ngs),qss(ngs),pqs(ngs) real elv(ngs),elf(ngs),els(ngs) - real tsqr(ngs),ssi(ngs),ssw(ngs) + real tsqr(ngs),ssi(ngs),ssw(ngs),ssi0(ngs) real qcwtmp(ngs),qtmp,qtot(ngs) real qcond(ngs) real ctmp, sctmp @@ -10729,6 +11990,7 @@ subroutine nssl_2mom_gs & parameter ( rwradmn = 50.e-6 ) real dh0 real dg0(ngs),df0(ngs) + real dhwet(ngs),dhlwet(ngs),dfwet(ngs) real clionpmx,clionnmx parameter (clionpmx=1.e9,clionnmx=1.e9) ! Takahashi 84 @@ -10736,7 +11998,7 @@ subroutine nssl_2mom_gs & ! other arrays real fwet1(ngs),fwet2(ngs) - real fmlt1(ngs),fmlt2(ngs) + real fmlt1(ngs),fmlt2(ngs),fmlt1e(ngs) real fvds(ngs),fvce(ngs),fiinit(ngs) real fvent(ngs),fraci(ngs),fracl(ngs) ! @@ -10760,6 +12022,7 @@ subroutine nssl_2mom_gs & ! real :: sfm1(ngs),sfm2(ngs) real :: gfm1(ngs),gfm2(ngs) + real :: ffm1(ngs),ffm2(ngs) real :: hfm1(ngs),hfm2(ngs) logical :: wetsfc(ngs),wetsfchl(ngs),wetsfcf(ngs) @@ -10800,6 +12063,10 @@ subroutine nssl_2mom_gs & real :: alpha(ngs,lc:lhab) real :: dab0lh(ngs,lc:lhab,lc:lhab) real :: dab1lh(ngs,lc:lhab,lc:lhab) + real :: zx(ngs,lr:lhab) + real :: zxmxd(ngs,lr:lhab) + real :: g1x(ngs,lr:lhab) + real :: qsimxdep(ngs) ! max sublimation of qi+qs+qis real :: qsimxsub(ngs) ! max depositionof qi+qs+qis @@ -10815,6 +12082,7 @@ subroutine nssl_2mom_gs & real ventrxn(ngs) real g1shr, alphashr real g1mlr, alphamlr + real g1smlr, alphasmlr real massfacshr, massfacmlr real :: qhgt8mm ! ice mass greater than 8mm @@ -10827,6 +12095,8 @@ subroutine nssl_2mom_gs & real, parameter :: srasheym = 0.1389 ! slope fraction from Rasmussen and Heymsfield ! real swvent(ngs),hwvent(ngs),rwvent(ngs),hlvent(ngs),hwventy(ngs),hlventy(ngs),rwventz(ngs) + real hxventtmp + real hlventinc(ngs),hwventinc(ngs) integer, parameter :: ndiam = 10 integer :: numdiam real hwvent0(ndiam+4),hlvent0 ! 0 to d1 @@ -10946,9 +12216,10 @@ subroutine nssl_2mom_gs & real qsacw(ngs) ! ,qwacs(ngs), real qhacw(ngs) ! qwach(ngs), - real :: qhlacw(ngs) ! + real :: qhlacw(ngs), qxacwtmp, qxacrtmp ! real vhacw(ngs), vsacw(ngs), vhlacw(ngs), vhlacr(ngs) + real qfcev(ngs) real qfmul1(ngs),cfmul1(ngs) ! real qsacws(ngs) @@ -10957,7 +12228,7 @@ subroutine nssl_2mom_gs & ! arrays for x-ac-r and r-ac-x; ! real qsacr(ngs),qracs(ngs) - real qhacr(ngs),qhacrmlr(ngs) ! ,qrach(ngs) + real qhacr(ngs),qhacrmlr(ngs),qhacwmlr(ngs) ! ,qrach(ngs) real vhacr(ngs), zhacr(ngs), zhacrf(ngs), zrach(ngs), zrachl(ngs) real qiacr(ngs),qraci(ngs) @@ -10965,7 +12236,7 @@ subroutine nssl_2mom_gs & real qracif(ngs),qiacrf(ngs),qiacrs(ngs),ciacrs(ngs) - real :: qhlacr(ngs),qhlacrmlr(ngs) + real :: qhlacr(ngs),qhlacrmlr(ngs), qhlacwmlr(ngs) real qsacrs(ngs) !,qracss(ngs) ! ! ice - ice interactions @@ -11011,7 +12282,7 @@ subroutine nssl_2mom_gs & real zfmlr(ngs), zfdsv(ngs), zfsbv(ngs), zhlcnf(ngs), zfshr(ngs), zfshrr(ngs) real zhmlrtmp,zhmlr0inf,zhlmlr0inf real zhmlrr(ngs),zhlmlrr(ngs),zhshrr(ngs),zhlshrr(ngs),zfmlrr(ngs) - real zsmlr(ngs), zsmlrr(ngs), zsshr(ngs) + real zsmlr(ngs), zsmlrr(ngs), zsshr(ngs), zsshrr(ngs) real zhcns(ngs), zhcni(ngs) real zhwdn(ngs), zfwdn(ngs) ! change in Z due to density changes real zhldn(ngs) ! change in Z due to density changes @@ -11052,9 +12323,10 @@ subroutine nssl_2mom_gs & ! real :: qhldpv(ngs), qhlsbv(ngs) ! qhlcnv(ngs),qhlevv(ngs), real :: qhlmlr(ngs), qhldsv(ngs), qhlmlrsave(ngs) - real :: qhlwet(ngs), qhldry(ngs), qhlshr(ngs) + real :: qhlwet(ngs), qhldry(ngs), qhlshr(ngs), qxwettmp ! real :: qrfz(ngs),qsfz(ngs),qhfz(ngs),qhlfz(ngs) + real :: qffz(ngs) ! real qhdpv(ngs),qhsbv(ngs) ! qhcnv(ngs),qhevv(ngs), real qhmlr(ngs),qhdsv(ngs),qhcev(ngs),qhcndv(ngs),qhevv(ngs) @@ -11064,6 +12336,7 @@ subroutine nssl_2mom_gs & real qhshh(ngs) !accreted water that remains on graupel real qhmlh(ngs) !melt water that remains on graupel real qhfzh(ngs) !water that freezes on mixed-phase graupel + real qffzf(ngs) !water that freezes on mixed-phase FD real qhlfzhl(ngs) !water that freezes on mixed-phase hail real qhmlrlg(ngs),qhlmlrlg(ngs) ! melting from the larger diameters @@ -11115,6 +12388,7 @@ subroutine nssl_2mom_gs & real qrshr(ngs) real fsw(ngs),fhw(ngs),fhlw(ngs),ffw(ngs) !liquid water fractions real fswmax(ngs),fhwmax(ngs),fhlwmax(ngs) !liquid water fractions + real ffwmax(ngs) real qhcnf(ngs) real :: qhlcnh(ngs) real qhcngh(ngs),qhcngm(ngs),qhcngl(ngs) @@ -11128,7 +12402,7 @@ subroutine nssl_2mom_gs & real ehxr(ngs),ehlr(ngs),egmr(ngs) real eri(ngs),esi(ngs),egli(ngs),eghi(ngs),efi(ngs),efis(ngs) real ehxi(ngs),ehli(ngs),egmi(ngs),ehi(ngs),ehis(ngs),ehlis(ngs) - real ers(ngs),ess(ngs),egls(ngs),eghs(ngs),efs(ngs),ehs(ngs) + real ers(ngs),ess(ngs),egls(ngs),eghs(ngs),efs(ngs),ehs(ngs),ehsfac(ngs) real ehscnv(ngs) real ehxs(ngs),ehls(ngs),egms(ngs),egmip(ngs) @@ -11187,12 +12461,13 @@ subroutine nssl_2mom_gs & real pqgli(ngs),pqghi(ngs),pqfwi(ngs) real pqgmi(ngs),pqhli(ngs) ! ,pqhxi(ngs) real pqiri(ngs),pqipi(ngs) ! pqwai(ngs), - real pqlwsi(ngs),pqlwhi(ngs),pqlwhli(ngs) + real pqlwsi(ngs),pqlwhi(ngs),pqlwhli(ngs),pqlwfi(ngs) real pqlwlghi(ngs),pqlwlghli(ngs) real pqlwlghd(ngs),pqlwlghld(ngs) + real pvhwi(ngs), pvhwd(ngs) real pvfwi(ngs), pvfwd(ngs) @@ -11204,7 +12479,7 @@ subroutine nssl_2mom_gs & real pqgld(ngs),pqghd(ngs),pqfwd(ngs) real pqgmd(ngs),pqhld(ngs) ! ,pqhxd(ngs) real pqird(ngs),pqipd(ngs) ! pqwad(ngs), - real pqlwsd(ngs),pqlwhd(ngs),pqlwhld(ngs) + real pqlwsd(ngs),pqlwhd(ngs),pqlwhld(ngs),pqlwfd(ngs) ! ! real pqxii(ngs,nhab),pqxid(ngs,nhab) ! @@ -11352,7 +12627,7 @@ subroutine nssl_2mom_gs & real frcrglgm, frcrglgh, frcrglfw, frcrglgl1 real frcgmrgl, frcgmrgm, frcgmrgh, frcgmrfw, frcgmrgm1 real frcrgmgl, frcrgmgm, frcrgmgh, frcrgmfw, frcrgmgm1 - real sum, qweps, gf2a, gf4a, dqldt, dqidt, dqdt + real total, qweps, gf2a, gf4a, dqldt, dqidt, dqdt real frcghrgl, frcghrgm, frcghrgh, frcghrfw, frcghrgh1, frcrghgl real frcrghgm, frcrghgh, frcrghfw, frcrghgh1 real a1,a2,a3,a4,a5,a6 @@ -11385,8 +12660,20 @@ subroutine nssl_2mom_gs & real :: term1,term2,term3,term4 real :: qaacw ! combined qsacw-qhacw for WSM6 variation + real, parameter :: c1r=19.0, c2r=0.6, c3r=1.8, c4r=17.0 ! rain + real, parameter :: c1h=5.5, c2h=0.7, c3h=4.5, c4h=8.5 ! Graupel + real, parameter :: c1hl=3.7, c2hl=0.3, c3hl=9.0, c4hl=6.5, c5hl=1.0, c6hl=6.5 ! Hail + +! inline functions for Newton method + real :: galpha, dgalpha + real :: a_in + logical, parameter :: newton = .false. + + galpha(a_in) = ((4. + a_in)*(5. + a_in)*(6. + a_in))/((1. + a_in)*(2. + a_in)*(3. + a_in)) + dgalpha(a_in) = (876. + 1260.*a_in + 621.*a_in**2 + 126.*a_in**3 + 9.*a_in**4)/ & + & (36. + 132.*a_in + 193.*a_in**2 + 144.*a_in**3 + 58.*a_in**4 + 12.*a_in**5 + a_in**6) ! ! #################################################################### ! @@ -11416,6 +12703,11 @@ subroutine nssl_2mom_gs & jstag = 0 kstag = 1 + lrescalelow(:) = rescale_low_alpha + lrescalelow(lr) = rescale_low_alphar .and. rescale_low_alpha + lrescalelow(lh) = rescale_low_alphah .and. rescale_low_alpha + IF ( lf > 1 ) lrescalelow(lf) = rescale_low_alphah .and. rescale_low_alpha + IF ( lhl > 1 ) lrescalelow(lhl) = rescale_low_alphahl .and. rescale_low_alpha ! @@ -11533,11 +12825,18 @@ subroutine nssl_2mom_gs & vmlt = Min(xvmx(lr), 0.523599*(dmlt)**3 ) vshd = Min(xvmx(lr), 0.523599*(dshd)**3 ) - snowmeltmass = pi/6.0 * 1000. * snowmeltdia**3 ! maximum rain particle mass from melting snow (if snowmeltdia > 0) + IF ( snowmeltdia > 0.0 ) THEN + snowmeltmass = pi/6.0 * 1000. * snowmeltdia**3 ! maximum rain particle mass from melting snow (if snowmeltdia > 0) + ENDIF tdtol = 1.0e-05 tfrcbw = tfr - cbw tfrcbi = tfr - cbi + + IF ( mixedphase ) THEN + ibinhmlr = 0 + ibinhlmlr = 0 + ENDIF ! ! ! #ifdef COMMAS @@ -11695,10 +12994,15 @@ subroutine nssl_2mom_gs & temg(1) = t0(ix,jy,kz) temcg(1) = temg(1) - tfr tqvcon = temg(1)-cbw - ltemq = (temg(1)-163.15)/fqsat+1.5 + ltemq = (temg(1)-163.15)/fqsat + 1.5 ltemq = Min( nqsat, Max(1,ltemq) ) qvs(1) = pqs(1)*tabqvs(ltemq) - qis(1) = pqs(1)*tabqis(ltemq) + IF ( iqis0 == 1 .or. temg(1) <= tfr+0.5 ) THEN + qis(1) = pqs(1)*tabqis(ltemq) + ELSE + ltemq = (tfr - 163.15)/fqsat + 1.5 + qis(1) = pqs(1)*tabqis(ltemq) + ENDIF qss(1) = qvs(1) @@ -11793,7 +13097,12 @@ subroutine nssl_2mom_gs & ltemq = (temg(mgs)-163.15)/fqsat+1.5 ltemq = Min( nqsat, Max(1,ltemq) ) qvs(mgs) = pqs(mgs)*tabqvs(ltemq) - qis(mgs) = pqs(mgs)*tabqis(ltemq) + IF ( iqis0 == 1 .or. temg(mgs) <= tfr+0.5 ) THEN + qis(mgs) = pqs(mgs)*tabqis(ltemq) + ELSE + ltemq = (tfr - 163.15)/fqsat + 1.5 + qis(mgs) = pqs(mgs)*tabqis(ltemq) + ENDIF qss(mgs) = qvs(mgs) ! es(mgs) = 6.1078e2*tabqvs(ltemq) ! eis(mgs) = 6.1078e2*tabqis(ltemq) @@ -11834,78 +13143,6 @@ subroutine nssl_2mom_gs & - scx(:,:) = 0.0 -! -! set shape parameters -! - IF ( imurain == 1 ) THEN - alpha(:,lr) = alphar - ELSEIF ( imurain == 3 ) THEN - alpha(:,lr) = xnu(lr) - ENDIF - - alpha(:,li) = xnu(li) - alpha(:,lc) = xnu(lc) - - IF ( imusnow == 1 ) THEN - alpha(:,ls) = alphas - ELSEIF ( imusnow == 3 ) THEN - alpha(:,ls) = xnu(ls) - ENDIF - - DO il = lr,lhab - do mgs = 1,ngscnt - IF ( il .ge. lg ) alpha(mgs,il) = dnu(il) - - - DO ic = lc,lhab - dab0lh(mgs,il,ic) = dab0(il,ic) ! dab0(ic,il) - dab1lh(mgs,il,ic) = dab1(il,ic) ! dab1(ic,il) - ENDDO - ENDDO - end do - - -! DO mgs = 1,ngscnt - DO il = lr,lhab - da0lx(:,il) = da0(il) - ENDDO - da0lh(:) = da0(lh) - da0lr(:) = da0(lr) - da1lr(:) = da1(lr) - da0lc(:) = da0(lc) - da1lc(:) = da1(lc) - - - IF ( lzh < 1 .or. lzhl < 1 ) THEN - rzxhlh(:) = rzhl/rz - ELSEIF ( lzh > 1 .and. lzhl > 1 ) THEN - rzxhlh(:) = 1. - ENDIF - IF ( lzr > 1 ) THEN - rzxh(:) = 1. - rzxhl(:) = 1. - ELSE - rzxh(:) = rz - rzxhl(:) = rzhl - ENDIF - - IF ( imurain == 1 .and. imusnow == 3 .and. lzr < 1 ) THEN - rzxs(:) = rzs - ELSEIF ( imurain == imusnow .or. lzr > 1 ) THEN - rzxs(:) = 1. - ENDIF - ! ENDDO - - IF ( lhl .gt. 1 ) THEN - DO mgs = 1,ngscnt - da0lhl(mgs) = da0(lhl) - ENDDO - ENDIF - - ventrx(:) = ventr - ventrxn(:) = ventrn - gf1palp(:) = gamma_sp(1.0 + alphar) ! ! set concentrations @@ -12076,17 +13313,136 @@ subroutine nssl_2mom_gs & ! -! set factors -! - do mgs = 1,ngscnt -! - ssi(mgs) = qx(mgs,lv)/qis(mgs) - ssw(mgs) = qx(mgs,lv)/qvs(mgs) +! 6th moments ! - tsqr(mgs) = temg(mgs)**2 -! - temgx(mgs) = min(temg(mgs),313.15) - temgx(mgs) = max(temgx(mgs),233.15) + + IF ( ipconc .ge. 6 ) THEN + zx(:,:) = 0.0 + DO il = lr,lhab + IF ( lz(il) .gt. 1 ) THEN + DO mgs = 1,ngscnt + zx(mgs,il) = Max( an(igs(mgs),jy,kgs(mgs),lz(il)), 0.0 ) + ENDDO + ENDIF + ENDDO + + ENDIF + + IF ( ipconc .ge. 6 ) THEN + + IF ( lz(lr) .lt. 1 ) THEN + g1x(:,lr) = (6.0 + alphar)*(5.0 + alphar)*(4.0 + alphar)/ & + & ((3.0 + alphar)*(2.0 + alphar)*(1.0 + alphar)) + + + DO mgs = 1,ngscnt + IF ( cx(mgs,lr) .gt. 0.0 .and. qx(mgs,lr) .gt. qxmin(lr) ) THEN + + vr = rho0(mgs)*qx(mgs,lr)/(1000.*cx(mgs,lr)) + IF ( lzr < 1 ) THEN + IF ( imurain == 3 ) THEN + zx(mgs,lr) = 3.6476*(rnu+2.0)*cx(mgs,lr)*vr**2/(rnu+1.0) + ELSE ! imurain == 1 + zx(mgs,lr) = 3.6476*g1x(mgs,lr)*cx(mgs,lr)*vr**2 + ENDIF + ENDIF + + ENDIF + ENDDO + ENDIF + + ENDIF + + + scx(:,:) = 0.0 +! +! set shape parameters +! + if ( ndebug .gt. 0 .and. my_rank>=0 ) write(0,*) my_rank, 'ICEZVD_GS: dbg = set alpha' + IF ( imurain == 1 ) THEN + alpha(:,lr) = alphar + ELSEIF ( imurain == 3 ) THEN + alpha(:,lr) = xnu(lr) + ENDIF + + alpha(:,li) = xnu(li) + alpha(:,lc) = xnu(lc) + + IF ( imusnow == 1 ) THEN + alpha(:,ls) = alphas + ELSEIF ( imusnow == 3 ) THEN + alpha(:,ls) = xnu(ls) + ENDIF + + if ( ndebug .gt. 0 .and. my_rank>=0 ) write(0,*) my_rank, 'ICEZVD_GS: dbg = set dab' + + DO il = lr,lhab + do mgs = 1,ngscnt + IF ( il .ge. lg ) alpha(mgs,il) = dnu(il) + + + DO ic = lc,lhab + dab0lh(mgs,il,ic) = dab0(il,ic) ! dab0(ic,il) + dab1lh(mgs,il,ic) = dab1(il,ic) ! dab1(ic,il) + ENDDO + end do + ENDDO + + +! DO mgs = 1,ngscnt + DO il = lr,lhab + da0lx(:,il) = da0(il) + ENDDO + da0lh(:) = da0(lh) + da0lr(:) = da0(lr) + da1lr(:) = da1(lr) + da0lc(:) = da0(lc) + da1lc(:) = da1(lc) + + if ( ndebug .gt. 0 .and. my_rank>=0 ) write(0,*) my_rank, 'ICEZVD_GS: dbg = set rz' + + IF ( lzh < 1 .or. lzhl < 1 ) THEN + rzxhlh(:) = rzhl/rz + ELSEIF ( lzh > 1 .and. lzhl > 1 ) THEN + rzxhlh(:) = 1. + ENDIF + IF ( lzr > 1 ) THEN + rzxh(:) = 1. + rzxhl(:) = 1. + ELSE + rzxh(:) = rz + rzxhl(:) = rzhl + ENDIF + + IF ( imurain == 1 .and. imusnow == 3 .and. lzr < 1 ) THEN + rzxs(:) = rzs + ELSEIF ( imurain == imusnow .or. lzr > 1 ) THEN + rzxs(:) = 1. + ENDIF + ! ENDDO + + IF ( lhl .gt. 1 ) THEN + DO mgs = 1,ngscnt + da0lhl(mgs) = da0(lhl) + ENDDO + ENDIF + + ventrx(:) = ventr + ventrxn(:) = ventrn + gf1palp(:) = gamma_sp(1.0 + alphar) + +! +! set factors +! + do mgs = 1,ngscnt +! + ssi(mgs) = qx(mgs,lv)/qis(mgs) + ssw(mgs) = qx(mgs,lv)/qvs(mgs) +! + tsqr(mgs) = temg(mgs)**2 +! + temgx(mgs) = min(temg(mgs),313.15) + temgx(mgs) = max(temgx(mgs),233.15) felv(mgs) = 2500837.367 * (273.15/temgx(mgs))**((0.167)+(3.67e-4)*temgx(mgs)) ! temcgx(mgs) = min(temg(mgs),273.15) @@ -12112,6 +13468,7 @@ subroutine nssl_2mom_gs & tmp = qx(mgs,li)+qx(mgs,ls)+qx(mgs,lh) IF ( lhl > 1 ) tmp = tmp + qx(mgs,lhl) + IF ( lf > 1 ) tmp = tmp + qx(mgs,lf) cvm = cv+cvv*qx(mgs,lv)+cpl*(qx(mgs,lc)+qx(mgs,lr)) & +cpigb*(tmp) @@ -12260,14 +13617,86 @@ subroutine nssl_2mom_gs & end do + IF ( ipconc == 5 .and. imydiagalpha > 1 ) THEN + + DO mgs = 1,ngscnt + !IF ( igs(mgs) == 19 ) write(0,*) 'k,qr,qh,cr,ch = ',kgs(mgs),qx(mgs,lr),cx(mgs,lr),qx(mgs,lh),cx(mgs,lh) + IF ( qx(mgs,lr) .gt. qxmin(lr) .and. cx(mgs,lr) > cxmin ) THEN + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*cx(mgs,lr)) ! + xdia(mgs,lr,3) = (xv(mgs,lr)*6.0*cwc1)**(1./3.) + alpha(mgs,lr) = Min(alphamax, c1r*tanh(c2r*(xdia(mgs,lr,3)*1000. - c3r)) + c4r) + ! IF ( igs(mgs) == 19 ) write(0,*) 'imy: i,k,alpr,xdia = ',igs(mgs),kgs(mgs),alpha(mgs,lr),xdia(mgs,lr,3)*1000. + ENDIF + IF ( qx(mgs,lh) .gt. qxmin(lh) .and. cx(mgs,lh) > cxmin ) THEN + xv(mgs,lh) = rho0(mgs)*qx(mgs,lh)/(xdn(mgs,lh)*cx(mgs,lh)) ! + xdia(mgs,lh,3) = (xv(mgs,lh)*6.*piinv)**(1./3.) ! mwfac*xdia(mgs,lh,1) ! (xv(mgs,lh)*cwc0*6.0)**(1./3.) + alpha(mgs,lh) = Min(alphamax, c1h*tanh(c2h*(xdia(mgs,lh,3)*1000. - c3h)) + c4h) + + ! IF ( igs(mgs) == 19 ) write(0,*) 'imy: i,k,alph,xdia = ',igs(mgs),kgs(mgs),alpha(mgs,lh),xdia(mgs,lh,3)*1000. + il = lh + DO ic = lc,lh-1 ! lhab + i = Nint( alpha(mgs,il)*dqiacralphainv ) + IF ( ic == lc .or. ic == li .or. ic == ls .or. (ic == lr .and. imurain == 3) ) THEN + alp = (3.*alpha(mgs,ic) + 2.) + j = Nint( (3.*alpha(mgs,ic) + 2.)*dqiacralphainv ) + ELSE ! IF ( ic == lr .and. imurain == 1 ) ! rain + alp = alpha(mgs,ic) + j = Nint( alpha(mgs,ic)*dqiacralphainv ) + ENDIF + + dab0lh(mgs,ic,il) = dab0lu(j,i,ic,il) + dab1lh(mgs,ic,il) = dab1lu(j,i,ic,il) + dab0lh(mgs,il,ic) = dab0lu(i,j,il,ic) + dab1lh(mgs,il,ic) = dab1lu(i,j,il,ic) + ENDDO + ENDIF +! alpha(:,lr) = 0. ! 10. +! alpha(:,lh) = 0. ! 10. + IF ( lhl > 0 ) THEN + IF ( qx(mgs,lhl) .gt. qxmin(lhl) .and. cx(mgs,lhl) > cxmin ) THEN + xv(mgs,lhl) = rho0(mgs)*qx(mgs,lhl)/(xdn(mgs,lhl)*cx(mgs,lhl)) ! + xdia(mgs,lhl,3) = (xv(mgs,lhl)*6.*piinv)**(1./3.) + IF ( xdia(mgs,lhl,3) < 0.008 ) THEN + alpha(mgs,lhl) = Min(alphamax, c1hl*tanh(c2hl*(xdia(mgs,lhl,3)*1000. - c3hl)) + c4hl) + ELSE + alpha(mgs,lhl) = Min(alphamax, c5hl*xdia(mgs,lhl,3)*1000. + c6hl) + ENDIF + + il = lhl + DO ic = lc,lh-1 ! lhab + i = Nint( alpha(mgs,il)*dqiacralphainv ) + IF ( ic == lc .or. ic == li .or. ic == ls .or. (ic == lr .and. imurain == 3) ) THEN + alp = (3.*alpha(mgs,ic) + 2.) + j = Nint( (3.*alpha(mgs,ic) + 2.)*dqiacralphainv ) + ELSE ! IF ( ic == lr .and. imurain == 1 ) ! rain + alp = alpha(mgs,ic) + j = Nint( alpha(mgs,ic)*dqiacralphainv ) + ENDIF + + dab0lh(mgs,ic,il) = dab0lu(j,i,ic,il) + dab1lh(mgs,ic,il) = dab1lu(j,i,ic,il) + dab0lh(mgs,il,ic) = dab0lu(i,j,il,ic) + dab1lh(mgs,il,ic) = dab1lu(i,j,il,ic) + ENDDO + + ENDIF + ENDIF + + + + ENDDO + ENDIF + IF ( imurain == 3 ) THEN IF ( lzr > 1 ) THEN alphashr = 0.0 alphamlr = -2.0/3.0 + alphasmlr = -2.0/3.0 ELSE alphashr = xnu(lr) alphamlr = xnu(lr) + alphasmlr = xnu(lr) ENDIF ! massfacshr = ( (2. + 3.*(1. +alphashr) )/( 3.*(1. + alphashr) ) )**(1./3.) ! this is the diameter factor ! massfacmlr = ( (2. + 3.*(1. +alphamlr) )/( 3.*(1. + alphamlr) ) )**(1./3.) @@ -12277,9 +13706,11 @@ subroutine nssl_2mom_gs & IF ( lzr > 1 ) THEN alphashr = 4.0 alphamlr = 4.0 + alphasmlr = alphasmlr0 ELSE alphashr = alphar alphamlr = alphar + alphasmlr = alphar ENDIF ! massfacshr = (3.0 + alphashr)*((3.+alphashr)*(2.+alphashr)*(1. + alphashr) )**(-1./3.) ! this is the diameter factor ! massfacmlr = (3.0 + alphamlr)*((3.+alphamlr)*(2.+alphamlr)*(1. + alphamlr) )**(-1./3.) @@ -12287,110 +13718,819 @@ subroutine nssl_2mom_gs & massfacmlr = (3.0 + alphamlr)**3/((3.+alphamlr)*(2.+alphamlr)*(1. + alphamlr) ) ENDIF +! Find shape parameter rain -! -! set some values for ice nucleation -! - do mgs = 1,ngscnt - kp1 = Min(nz, kgs(mgs)+1 ) -! wvel(mgs) = (0.5)*(w(igs(mgs),jgs,kp1) & -! & +w(igs(mgs),jgs,kgs(mgs))) + g1shr = 1.0 + g1mlr = 1.0 + g1smlr = 1.0 + +! CALL cld_cpu('Z-MOMENT-1') + + ! set base g1x in case rain is not 3-moment + IF ( ipconc >= 6 .and. imurain == 3 ) THEN + il = lr + DO mgs = 1,ngscnt +! g1x(mgs,il) = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + g1x(mgs,il) = (alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)) + ENDDO + ENDIF + IF (lzr > 1 ) THEN + IF ( imurain == 3 ) THEN + g1shr = (alphashr+2.0)/((alphashr+1.0)) + g1mlr = (alphamlr+2.0)/((alphamlr+1.0)) + g1smlr = (alphasmlr+2.0)/((alphasmlr+1.0)) + ELSEIF ( imurain == 1 ) THEN +! g1shr = 36.*(6.0 + alphashr)*(5.0 + alphashr)*(4.0 + alphashr)/ & +! & (pi**2*(3.0 + alphashr)*(2.0 + alphashr)*(1.0 + alphashr)) + g1shr = (6.0 + alphashr)*(5.0 + alphashr)*(4.0 + alphashr)/ & + & ((3.0 + alphashr)*(2.0 + alphashr)*(1.0 + alphashr)) +! g1mlr = 36.*(6.0 + alphamlr)*(5.0 + alphamlr)*(4.0 + alphamlr)/ & +! & (pi**2*(3.0 + alphamlr)*(2.0 + alphamlr)*(1.0 + alphamlr)) + g1mlr = (6.0 + alphamlr)*(5.0 + alphamlr)*(4.0 + alphamlr)/ & + & ((3.0 + alphamlr)*(2.0 + alphamlr)*(1.0 + alphamlr)) + g1smlr = (6.0 + alphasmlr)*(5.0 + alphasmlr)*(4.0 + alphasmlr)/ & + & ((3.0 + alphasmlr)*(2.0 + alphasmlr)*(1.0 + alphasmlr)) + ENDIF + ENDIF + + IF ( lzr > 1 .and. imurain == 3 ) THEN ! { RAIN SHAPE PARAM - wvelkm1(mgs) = (0.5)*(w(igs(mgs),jgs,kgs(mgs)) & - & +w(igs(mgs),jgs,kgsm(mgs))) - cninm(mgs) = t7(igs(mgs),jgs,kgsm(mgs)) - cnina(mgs) = t7(igs(mgs),jgs,kgs(mgs)) - cninp(mgs) = t7(igs(mgs),jgs,kgsp(mgs)) - end do + +! CALL cld_cpu('Z-MOMENT-1r') + il = lr + DO mgs = 1,ngscnt + -! -! Set a couple of cloud variables... -! + IF ( iresetmoments == 1 .or. iresetmoments == il .or. iresetmoments == -1 ) THEN ! .or. qx(mgs,il) <= qxmin(il) THEN + IF ( zx(mgs,il) <= zxmin ) THEN ! .and. qx(mgs,il) > 0.05e-3 THEN +!! write(91,*) 'zx=0; qx,cx = ',1000.*qx(mgs,il),cx(mgs,il) + qx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ELSEIF ( iresetmoments == -1 .and. qx(mgs,il) < qxmin(il) ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( cx(mgs,il) <= cxmin .and. iresetmoments /= -1 ) THEN ! .and. qx(mgs,il) > 0.05e-3 THEN + + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + zx(mgs,lr) = 0.0 + qx(mgs,lr) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),lr) + an(igs(mgs),jgs,kgs(mgs),lr) = qx(mgs,lr) + an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) + ENDIF + ENDIF -! SUBROUTINE setvt(ngscnt,qx,qxmin,cx,rho0,rhovt,xdia,cno, -! : xmas,xdn,xvmn,xvmx,xv,cdx, -! : ipconc,ndebug) -! SUBROUTINE setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno, & -! & xmas,vtxbar,xdn,xvmn,xvmx,xv,cdx, & -! & ipconc1,ndebug1,ngs,nz,kgs,cwnccn,fadvisc, & -! & cwmasn,cwmasx,cwradn,cnina,cimna,cimxa, & -! & itype1a,itype2a,temcg,infdo,alpha) + IF ( .false. .and. zx(mgs,il) <= zxmin .and. cx(mgs,il) <= cxmin ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + + IF ( qx(mgs,lr) .gt. qxmin(lr) ) THEN - infdo = 0 - IF ( rimdenvwgt > 0 ) infdo = 1 + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*Max(1.0e-11,cx(mgs,lr))) + IF ( xv(mgs,lr) .gt. xvmx(lr) ) THEN +! xv(mgs,lr) = xvmx(lr) +! cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmx(lr)*xdn(mgs,lr)) + ELSEIF ( xv(mgs,lr) .lt. xvmn(lr) ) THEN + xv(mgs,lr) = xvmn(lr) + cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmn(lr)*xdn(mgs,lr)) + ENDIF - call setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno,cnostmp, & - & xmas,vtxbar,xdn,xvmn,xvmx,xv,cdx,cdxgs, & - & ipconc,ndebug,ngs,nz,kgs,fadvisc, & - & cwmasn,cwmasx,cwradn,cnina,cimn,cimx, & - & itype1,itype2,temcg,infdo,alpha,0,axx,bxx) ! ,cdh,cdhl) -! & itype1,itype2,temcg,infdo,alpha,0,axh,bxh,axhl,bxhl) ! ,cdh,cdhl) + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! have mass and reflectivity but no concentration, so set concentration, using default alpha + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*xdn(mgs,lr)**2) +! an(igs(mgs),jgs,kgs(mgs),ln(il)) = zx(mgs,il) + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + chw = cx(mgs,il) + qr = qx(mgs,il) + zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(xdn(mgs,lr)**2*chw) + an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? + ! set values according to dBZ of -10, or Z = 0.1 +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*1000.*1000) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ENDIF + + IF ( zx(mgs,lr) > 0.0 ) THEN + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(1000.*cx(mgs,lr)) + vr = xv(mgs,lr) +! z = 36.*(alpha(kz)+2.0)*a(ix,jy,kz,lnr)*vr**2/((alpha(kz)+1.0)*pi**2) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z = zx(mgs,lr) + +! xv = (db(1,kz)*a(1,1,kz,lr))**2/(a(1,1,kz,lnr)) +! rd = z*(pi/6.*1000.)**2/xv + +! determine shape parameter alpha by iteration + IF ( z .gt. 0.0 ) THEN +! alpha(mgs,lr) = 3. + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. +! print*,'kz, alp, alpha(kz) = ',kz,alp,alpha(kz),rd,z,xv + DO i = 1,20 + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO +! check for artificial breakup (rain larger than allowed max size) + IF ( (xv(mgs,il) .gt. xvmx(il) .or. (ioldlimiter >= 2 .and. xv(mgs,il) .gt. xvmx(il)/8.) )) THEN + tmp = cx(mgs,il) + IF ( ioldlimiter >= 2 ) THEN ! MY-style active breakup + x = (6.*rho0(mgs)*qx(mgs,il)/(pi*xdn(mgs,il)*cx(mgs,il)))**(1./3.) + x1 = Max(0.0e-3, x - 3.0e-3) + x2 = Max(0.5, x/6.0e-3) + x3 = x2**3 + cx(mgs,il) = cx(mgs,il)*Max((1.+2.222e3*x1**2), x3) + xv(mgs,il) = xv(mgs,il)/Max((1.+2.222e3*x1**2), x3) + ELSE ! simple cutoff + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + ENDIF + !xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + !cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) - IF ( lwsm6 .and. ipconc == 0 ) THEN - tmp = Max(qxmin(lh), qxmin(ls)) - DO mgs = 1,ngscnt - sum = qx(mgs,lh) + qx(mgs,ls) - IF ( sum > tmp ) THEN - vt2ave(mgs) = (qx(mgs,lh)*vtxbar(mgs,lh,1) + qx(mgs,ls)*vtxbar(mgs,ls,1))/sum - ELSE - vt2ave(mgs) = 0.0 - ENDIF - ENDDO - ENDIF + IF ( tmp < cx(mgs,il) ) THEN ! breakup + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) -! -! Set number concentrations (need xdia from setvt) -! - if ( ndebug .gt. 0 ) write(0,*) 'ICEZVD_GS: Set concentration' - IF ( ipconc .lt. 1 ) THEN - cina(1:ngscnt) = cx(1:ngscnt,li) - ENDIF - if ( ipconc .lt. 5 ) then - do mgs = 1,ngscnt + vr = xv(mgs,lr) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z = zx(mgs,lr) - IF ( ipconc .lt. 3 ) THEN -! cx(mgs,lr) = 0.0 - if ( qx(mgs,lr) .gt. qxmin(lh) ) then -! cx(mgs,lr) = cno(lr)*xdia(mgs,lr,1) -! xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*cx(mgs,lr)) - end if - ENDIF +! determine shape parameter alpha by iteration + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + DO i = 1,20 + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO - IF ( ipconc .lt. 4 ) THEN -! tmp = cx(mgs,ls) -! cx(mgs,ls) = 0.0 - if ( qx(mgs,ls) .gt. qxmin(ls) ) then -! cx(mgs,ls) = cno(ls)*xdia(mgs,ls,1) -! xv(mgs,ls) = rho0(mgs)*qx(mgs,ls)/(xdn(mgs,ls)*cx(mgs,ls)) - end if - ENDIF ! ( ipconc .lt. 4 ) + + ENDIF + ENDIF - IF ( ipconc .lt. 5 ) THEN +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + IF ( .true. .and. (alpha(mgs,il) <= rnumin .or. alp == rnumin .or. alp == rnumax) ) THEN + IF ( rescale_high_alpha .and. alp >= rnumax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(1./(xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( rescale_low_alphar .and. alp <= rnumin ) THEN + z = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = z + an(igs(mgs),jy,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + ENDIF + + ! set g1x to use as G factor later. If alpha is in the range ( rnumin < alpha < rnumax ), then + ! this will be the same as computing G from alpha. If alpha = rnumax, however, it probably means that + ! the moments are not matched correctly, so we compute G from the moments instead so that the dZ/dt rates + ! stay consistent with dN/dt and dq/dt. + IF ( alp >= rnumax - 0.01 ) THEN +! g1x(mgs,il) = 6**2*zx(mgs,il)/(cx(mgs,il)*(pi*xv(mgs,lr))**2) +! g1x(mgs,il) = xdn(mgs,il)*zx(mgs,il)*cx(mgs,il)/((rho0(mgs)*qx(mgs,lr))**2) + g1x(mgs,il) = (pi*xdn(mgs,il))**2*zx(mgs,il)*cx(mgs,il)/((6.*rho0(mgs)*qx(mgs,il))**2) + ELSE + g1x(mgs,il) = g1 + ENDIF + + tmp = alpha(mgs,lr) + 4./3. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = alpha(mgs,lr) + 1. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + gf1palp(mgs) = y -! cx(mgs,lh) = 0.0 - if ( qx(mgs,lh) .gt. qxmin(lh) ) then -! cx(mgs,lh) = cno(lh)*xdia(mgs,lh,1) -! xv(mgs,lh) = Max(xvmn(lh), rho0(mgs)*qx(mgs,lh)/(xdn(mgs,lh)*cx(mgs,lh)) ) -! xdia(mgs,lh,3) = (xv(mgs,lh)*6./pi)**(1./3.) - end if +! ventrx(mgs) = Gamma_sp(alpha(mgs,lr) + 4./3.)/(alpha(mgs,lr) + 1.)**(1./3.)/Gamma_sp(alpha(mgs,lr) + 1.) + ventrx(mgs) = x/(y*(alpha(mgs,lr) + 1.)**(1./3.)) - ENDIF ! ( ipconc .lt. 5 ) + IF ( imurain == 3 .and. izwisventr == 2 ) THEN - end do - end if - - IF ( ipconc .ge. 2 ) THEN - DO mgs = 1,ngscnt - - rb(mgs) = 0.5*xdia(mgs,lc,1)*(1./(1.+alpha(mgs,lc)))**(1./6.) - xl2p(mgs) = Max(0.0d0, 2.7e-2*xdn(mgs,lc)*cx(mgs,lc)*xv(mgs,lc)* & - & ((0.5e20*rb(mgs)**3*xdia(mgs,lc,1))-0.4) ) + tmp = alpha(mgs,lr) + 1.5 + br/6. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + +! ventrx(mgs) = Gamma_sp(alpha(mgs,lr) + 1.5 + br/6.)/Gamma_sp(alpha(mgs,lr) + 1.) + ventrxn(mgs) = x/(y*(alpha(mgs,lr) + 1.)**((1.+br)/6. + 1./3.)) + +! This whole section is imurain == 3, so this branch never runs +! ELSEIF ( imurain == 1 .and. iferwisventr == 2 ) THEN +! +! tmp = alpha(mgs,lr) + 2.5 + br/2. +! i = Int(dgami*(tmp)) +! del = tmp - dgam*i +! x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami +! +!! ventrx(mgs) = Gamma_sp(alpha(mgs,lr) + 1.5 + br/6.)/Gamma_sp(alpha(mgs,lr) + 1.) +! ventrxn(mgs) = x/y + + + ENDIF + + ENDIF + ENDIF + + ENDIF + + ENDDO +! CALL cld_cpu('Z-MOMENT-1r') + ENDIF ! } + + +! Find shape parameters for graupel and hail + IF ( ipconc .ge. 6 ) THEN + + DO il = lr,lhab + + ! set base values of g1x + IF ( (.not. ( il == lr .and. imurain == 3 )) .and. ( il == lr .or. il == lh .or. il == lhl .or. il == lf ) ) THEN + DO mgs = 1,ngscnt + g1x(mgs,il) = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + ENDDO + ENDIF + + IF ( lz(il) .gt. 1 .and. ( .not. ( il == lr .and. imurain == 3 )) ) THEN + + DO mgs = 1,ngscnt + + + IF ( iresetmoments == 1 .or. iresetmoments == il .or. iresetmoments == -1 ) THEN ! .or. qx(mgs,il) <= qxmin(il) ) THEN + IF ( zx(mgs,il) <= zxmin ) THEN ! .and. qx(mgs,il) > 0.05e-3 ) THEN +!! write(91,*) 'zx=0; qx,cx = ',1000.*qx(mgs,il),cx(mgs,il) + qx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + zx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ELSEIF ( iresetmoments == -1 .and. qx(mgs,il) < qxmin(il) ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( cx(mgs,il) <= cxmin .and. iresetmoments /= -1 ) THEN ! .and. qx(mgs,il) > 0.05e-3 ) THEN + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ENDIF + ENDIF + + IF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= cxmin ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + + IF ( qx(mgs,il) .gt. qxmin(il) ) THEN + + xv(mgs,il) = rho0(mgs)*qx(mgs,il)/(xdn(mgs,il)*Max(1.0e-9,cx(mgs,il))) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + + IF ( xv(mgs,il) .lt. xvmn(il) ) THEN + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + ENDIF + + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! have mass and reflectivity but no concentration, so set concentration, using default alpha + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z = zx(mgs,il) + qr = qx(mgs,il) +! cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(z*(pi*xdn(mgs,il))**2) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > cxmin ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha +! g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & +! & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + chw = cx(mgs,il) + qr = qx(mgs,il) +! zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw +! zx(mgs,il) = Min(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) + g1 = (6.0 + alphamax)*(5.0 + alphamax)*(4.0 + alphamax)/ & + & ((3.0 + alphamax)*(2.0 + alphamax)*(1.0 + alphamax)) + zx(mgs,il) = Max(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? + ! set values according to dBZ of -10, or Z = 0.1 +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z = zx(mgs,il) + qr = qx(mgs,il) +! cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(z*(pi*xdn(mgs,il))**2) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ELSE + + chw = cx(mgs,il) + qr = qx(mgs,il) + z = zx(mgs,il) + + IF ( zx(mgs,il) .gt. 0. ) THEN + +! rdi = z*(pi/6.*1000.)**2*chw/((rho0(mgs)*qr)**2) + rdi = z*(pi/6.*xdn(mgs,il))**2*chw/((rho0(mgs)*qr)**2) + +! alp = 1.e18*(6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ +! : ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + alp = (6.0+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 +! print*,'kz, alp, alpha(mgs,il) = ',kz,alp,alpha(mgs,il),rdi,z,xv + alp = Max( alphamin, Min( alphamax, alp ) ) + + IF ( newton ) THEN + DO i = 1,10 + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) + alp = alp + ( galpha(alp) - rdi )/dgalpha(alp) + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + ELSE + DO i = 1,10 +! IF ( 100.*Abs(alp - alpha(mgs,il))/(Abs(alpha(mgs,il))+1.e-5) .lt. 1. ) EXIT + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) +! alp = 1.e18*(6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ +! : ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 +! print*,'i,alp = ',i,alp + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + ENDIF + + +! check for artificial breakup (graupel/hail larger than allowed max size) + IF ( imaxdiaopt == 1 ) THEN + xvbarmax = xvmx(il) + ELSEIF ( imaxdiaopt == 2 ) THEN ! test against maximum mass diameter + xvbarmax = xvmx(il) /((3. + alpha(mgs,il))**3/((3. + alpha(mgs,il))*(2. + alpha(mgs,il))*(1. + alpha(mgs,il)))) + ELSEIF ( imaxdiaopt == 3 ) THEN ! test against mass-weighted diameter + xvbarmax = xvmx(il) /((4. + alpha(mgs,il))**3/((3. + alpha(mgs,il))*(2. + alpha(mgs,il))*(1. + alpha(mgs,il)))) + ELSE + xvbarmax = xvmx(il) + ENDIF + + IF ( xv(mgs,il) .gt. xvbarmax .or. (il == lr .and. ioldlimiter >= 2 .and. xv(mgs,il) .gt. xvmx(il)/8.)) THEN + tmp = cx(mgs,il) + IF( ioldlimiter >= 2 .and. il == lr) THEN ! MY-style drop limiter for rain + x = (6.*rho0(mgs)*qx(mgs,il)/(pi*xdn(mgs,il)*cx(mgs,il)))**(1./3.) + x1 = Max(0.0e-3, x - 3.0e-3) + x2 = Max(0.5, x/6.0e-3) + x3 = x2**3 + cx(mgs,il) = cx(mgs,il)*Max((1.+2.222e3*x1**2), x3) + xv(mgs,il) = xv(mgs,il)/Max((1.+2.222e3*x1**2), x3) + ELSE + xv(mgs,il) = Min( xvbarmax, Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + ENDIF + IF ( tmp < cx(mgs,il) ) THEN ! artificial breakup has happened, so need to adjust reflectivity and find new shape parameter + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + chw = cx(mgs,il) + qr = qx(mgs,il) + z = zx(mgs,il) + + rdi = z*(pi/6.*xdn(mgs,il))**2*chw/((rho0(mgs)*qr)**2) + alp = (6.0+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + DO i = 1,10 + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + + ENDIF + ENDIF + +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + + IF ( ( lrescalelow(il) .or. rescale_high_alpha ) .and. & + & ( alpha(mgs,il) <= alphamin .or. alp == alphamin .or. alp == alphamax ) ) THEN + + + + IF ( rescale_high_alpha .and. alp >= alphamax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(6./(pi*xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( lrescalelow(il) .and. alp <= alphamin .and. .not. (il == lh .and. icvhl2h > 0 ) .and. & + .not. ( il == lr .and. .not. rescale_low_alphar ) ) THEN ! alpha = alphamin, so reset Z to prevent growth in C + wtest = .false. + IF ( irescalerainopt == 0 ) THEN + wtest = .false. + ELSEIF ( irescalerainopt == 1 ) THEN + wtest = qx(mgs,lc) > qxmin(lc) + ELSEIF ( irescalerainopt == 2 ) THEN + wtest = qx(mgs,lc) > qxmin(lc) .and. wvel(mgs) < rescale_wthresh + ELSEIF ( irescalerainopt == 3 ) THEN + wtest = temcg(mgs) > rescale_tempthresh .and. qx(mgs,lc) > qxmin(lc) .and. wvel(mgs) < rescale_wthresh + ENDIF + + IF ( il == lr .and. ( wtest ) ) THEN +! IF ( temcg(mgs) > 0.0 .and. il == lr .and. qx(mgs,lc) > qxmin(lc) ) THEN + ! certain situations where rain number is adjusted instead of Z. Helps avoid rain being 'zapped' by autoconverted + ! drops (i.e., favor preserving Z when alpha tries to go negative) + chw = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(6./(pi*xdn(mgs,il)))**2 ! g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z1 + cx(mgs,il) = chw + an(igs(mgs),jy,kgs(mgs),ln(il)) = chw + ELSE + + ! Usual resetting of reflectivity moment to force consisntency between Q, N, Z, and alpha when alpha = alphamin + z1 = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw + z = z1*(6./(pi*xdn(mgs,il)))**2 + zx(mgs,il) = z + an(igs(mgs),jy,kgs(mgs),lz(il)) = z + ENDIF + ENDIF + ENDIF + + + ! set g1x to use as G factor later. If alpha is in the range ( rnumin < alpha < rnumax ), then + ! this will be the same as computing G from alpha. If alpha = rnumax, however, it probably means that + ! the moments are not matched correctly, so we compute G from the moments instead so that the dZ/dt rates + ! stay consistent with dN/dt and dq/dt. +! g1x(mgs,il) = zx(mgs,il)*chw*(pi*xdn(mgs,il))**2/(6.*qr*dn(igs(mgs),jy,kgs(mgs)))**2 +! g1x(mgs,il) = g1 ! zx(mgs,il)*cx(mgs,il)/(qr)**2 + IF ( alp >= alphamax - 0.5 ) THEN +! g1x(mgs,il) = 6**2*zx(mgs,il)/(cx(mgs,il)*(pi*xv(mgs,lr))**2) +! g1x(mgs,il) = (xdn(mgs,il))**2*zx(mgs,il)*cx(mgs,il)/((rho0(mgs)*qx(mgs,il))**2) + g1x(mgs,il) = (pi*xdn(mgs,il))**2*zx(mgs,il)*cx(mgs,il)/((6.*rho0(mgs)*qx(mgs,il))**2) + ELSE + g1x(mgs,il) = g1 + ENDIF + + ENDIF + +! IF ( ny .eq. 2 ) THEN +! IF ( qr .gt. 1.e-3 ) THEN +! write(0,*) 'alphah at nstep,i,k = ',dtp*(nstep-1),igs(mgs),kgs(mgs),alpha(mgs,il),qr*1000. +! ENDIF +! ENDIF + + + ENDIF ! .true. + + IF ( il == lr ) THEN + +! tmp = alpha(mgs,lr) + 4./3. +! i = Int(dgami*(tmp)) +! del = tmp - dgam*i +! x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami +! +! tmp = alpha(mgs,lr) + 1. +! i = Int(dgami*(tmp)) +! del = tmp - dgam*i +! y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami +! +!! ventrx(mgs) = Gamma_sp(alpha(mgs,lr) + 4./3.)/(alpha(mgs,lr) + 1.)**(1./3.)/Gamma_sp(alpha(mgs,lr) + 1.) +! ventrx(mgs) = x/(y*(alpha(mgs,lr) + 1.)**(1./3.)) + + + tmp = alpha(mgs,lr) + 1. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + gf1palp(mgs) = y + + IF ( iferwisventr == 2 ) THEN + tmp = alpha(mgs,lr) + 2.5 + br/2. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + +! ventrx(mgs) = Gamma_sp(alpha(mgs,lr) + 1.5 + br/6.)/Gamma_sp(alpha(mgs,lr) + 1.) + + ventrxn(mgs) = x/y + + ENDIF + + ENDIF ! il==lr + + + ELSE ! below mass threshold +! g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ +! & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) +! z1 = g1*rho0(mgs)**2*(qr)*qr/chw +! z = 1.e18*z1*(6./(pi*1000.))**2 +! z = z1*(6./(pi*1000.))**2 +! zx(mgs,il) = z +! an(igs(mgs),jy,kgs(mgs),lz(il)) = z + ENDIF ! ( qx(mgs,il) .gt. qxmin(il) ) + + + +! ENDIF + ENDDO ! mgs + +! CALL cld_cpu('Z-DELABK') + +! IF ( il == lr ) THEN +! xnutmp = (alpha(mgs,il) - 2.)/3. +! da0lr(mgs) = delbk(bb(il), xnutmp, xmu(il), 0) +! ENDIF + + IF ( .not. ( il == lr .and. imurain == 3 ) ) THEN +! CALL cld_cpu('Z-DELABK') + DO mgs = 1,ngscnt + IF ( qx(mgs,il) > qxmin(il) ) THEN + xnutmp = (alpha(mgs,il) - 2.)/3. + +! IF ( .true. ) THEN + DO ic = lc,lh-1 ! lhab + IF ( il .ne. ic .and. qx(mgs,ic) .gt. qxmin(ic)) THEN + xnuc = xnu(ic) + IF ( ic == lc .and. idiagnosecnu > 0 ) xnuc = alpha(mgs,lc) ! alpha for droplets is actually nu + IF ( il /= lr .and. ic == lr .and. lzr > 1 ) THEN + IF ( imurain == 3 ) THEN + xnuc = alpha(mgs,lr) ! alpha is nu already + ELSE + xnuc = ( alpha(mgs,lr) - 2. )/3. ! convert alpha to nu + ENDIF + ENDIF + ! delabk(ba,bb,nua,nub,mua,mub,k), where a (il) is collector and b (ic) is collected + IF ( .false. ) THEN + dab0lh(mgs,ic,il) = delabk(bb(ic), bb(il), xnuc, xnutmp, xmu(ic), xmu(il), 0) !dab0(il,ic) + dab1lh(mgs,ic,il) = delabk(bb(ic), bb(il), xnuc, xnutmp, xmu(ic), xmu(il), 1) !dab1(il,ic) + dab0lh(mgs,il,ic) = delabk(bb(il), bb(ic), xnutmp, xnuc, xmu(il), xmu(ic), 0) !dab0(il,ic) + dab1lh(mgs,il,ic) = delabk(bb(il), bb(ic), xnutmp, xnuc, xmu(il), xmu(ic), 1) !dab1(il,ic) + ELSE ! use lookup table -- not interpolating yet because table resolution of 0.05 is good enough + i = Nint( alpha(mgs,il)*dqiacralphainv ) + IF ( ic == lc .or. ic == li .or. ic == ls .or. (ic == lr .and. imurain == 3) ) THEN + alp = (3.*alpha(mgs,ic) + 2.) + j = Nint( (3.*alpha(mgs,ic) + 2.)*dqiacralphainv ) + ELSE ! IF ( ic == lr .and. imurain == 1 ) ! rain + alp = alpha(mgs,ic) + j = Nint( alpha(mgs,ic)*dqiacralphainv ) + ENDIF + + dab0lh(mgs,ic,il) = dab0lu(j,i,ic,il) + dab1lh(mgs,ic,il) = dab1lu(j,i,ic,il) + dab0lh(mgs,il,ic) = dab0lu(i,j,il,ic) + dab1lh(mgs,il,ic) = dab1lu(i,j,il,ic) + +! tmp1 = dab0lu(j,i,ic,il) +! tmp2 = dab1lu(j,i,ic,il) +! tmp3 = dab0lu(i,j,il,ic) +! tmp4 = dab1lu(i,j,il,ic) +! tmp5 = delabk(bb(il), bb(ic), xnutmp, xnuc, xmu(ic), xmu(il), 0) !dab0(il,ic) +! tmp6 = delabk(bb(il), bb(ic), xnutmp, xnuc, xmu(ic), xmu(il), 1) !dab1(il,ic) +! tmp5 = delabk(bb(il), bb(ic), xnutmp, xnuc, xmu(il), xmu(ic), 0) !dab0(il,ic) +! tmp6 = delabk(bb(il), bb(ic), xnutmp, xnuc, xmu(il), xmu(ic), 1) !dab1(il,ic) + + IF ( .false. .and. ny <= 2 ) THEN + write(0,*) + write(0,*) 'bb: ', bb(il), bb(ic), xnutmp, xnuc, xmu(il), xmu(ic) + write(0,*) 'il,ic = ',il,ic,alpha(mgs,il),i,xnuc,alp,j + write(0,*) 'dab0lh,tmp1 = ',dab0lh(mgs,ic,il),tmp1 + write(0,*) 'dab1lh,tmp2 = ',dab1lh(mgs,ic,il),tmp2 + write(0,*) 'dab0lh,tmp3 = ',dab0lh(mgs,il,ic),tmp3,tmp5 + write(0,*) 'dab1lh,tmp4 = ',dab1lh(mgs,il,ic),tmp4,tmp6 + + ENDIF + + ENDIF + + ENDIF + ENDDO + +! ENDIF + + da0lx(mgs,il) = delbk(bb(il), xnutmp, xmu(il), 0) + IF ( il .eq. lh ) THEN + da0lh(mgs) = delbk(bb(il), xnutmp, xmu(il), 0) + IF ( lzr > 1 ) THEN + rzxh(mgs) = 1. + ELSE + rzxh(mgs) = ((4. + alpha(mgs,il))*(5. + alpha(mgs,il))*(6. + alpha(mgs,il))*(1. + xnu(lr)))/ & + & ((1. + alpha(mgs,il))*(2. + alpha(mgs,il))*(3. + alpha(mgs,il))*(2. + xnu(lr))) + ENDIF + + IF ( lzhl < 1 ) THEN + rzxhlh(mgs) = rzxhl(mgs)/(((4. + alpha(mgs,il))*(5. + alpha(mgs,il))*(6. + alpha(mgs,il))*(1. + xnu(lr)))/ & + & ((1. + alpha(mgs,il))*(2. + alpha(mgs,il))*(3. + alpha(mgs,il))*(2. + xnu(lr)))) + ENDIF + ELSEIF ( il .eq. lhl ) THEN + da0lhl(mgs) = delbk(bb(il), xnutmp, xmu(il), 0) + IF ( lzr > 1 ) THEN + rzxhl(mgs) = 1. + ELSE + rzxhl(mgs) = ((4.0 + alpha(mgs,il))*(5. + alpha(mgs,il))*(6. + alpha(mgs,il))*(1. + xnu(lr)))/ & + & ((1. + alpha(mgs,il))*(2. + alpha(mgs,il))*(3. + alpha(mgs,il))*(2. + xnu(lr))) + ENDIF + ELSEIF ( il == lr ) THEN + xnutmp = (alpha(mgs,il) - 2.)/3. + da0lr(mgs) = delbk(bb(il), xnutmp, xmu(il), 0) + da1lr(mgs) = delbk(bb(il), xnutmp, xmu(il), 1) + ENDIF + + ENDIF ! ( qx(mgs,il) > qxmin(il) ) + ENDDO ! mgs +! CALL cld_cpu('Z-DELABK') + ENDIF ! il /= lr + +! CALL cld_cpu('Z-DELABK') + + ENDIF ! lz(il) .gt. 1 + + ENDDO ! il + + ENDIF ! ipconc .ge. 6 + +! CALL cld_cpu('Z-MOMENT-1') + +! +! set some values for ice nucleation +! + do mgs = 1,ngscnt + kp1 = Min(nz, kgs(mgs)+1 ) +! wvel(mgs) = (0.5)*(w(igs(mgs),jgs,kp1) & +! & +w(igs(mgs),jgs,kgs(mgs))) + + + wvelkm1(mgs) = (0.5)*(w(igs(mgs),jgs,kgs(mgs)) & + & +w(igs(mgs),jgs,kgsm(mgs))) + cninm(mgs) = t7(igs(mgs),jgs,kgsm(mgs)) + cnina(mgs) = t7(igs(mgs),jgs,kgs(mgs)) + cninp(mgs) = t7(igs(mgs),jgs,kgsp(mgs)) + end do + +! +! Set a couple of cloud variables... +! + +! SUBROUTINE setvt(ngscnt,qx,qxmin,cx,rho0,rhovt,xdia,cno, +! : xmas,xdn,xvmn,xvmx,xv,cdx, +! : ipconc,ndebug) +! SUBROUTINE setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno, & +! & xmas,vtxbar,xdn,xvmn,xvmx,xv,cdx, & +! & ipconc1,ndebug1,ngs,nz,kgs,cwnccn,fadvisc, & +! & cwmasn,cwmasx,cwradn,cnina,cimna,cimxa, & +! & itype1a,itype2a,temcg,infdo,alpha) + + + infdo = 1 + IF ( rimdenvwgt > 0 ) infdo = 1 + + call setvtz(ngscnt,qx,qxmin,qxw,cx,rho0,rhovt,xdia,cno,cnostmp, & + & xmas,vtxbar,xdn,xvmn,xvmx,xv,cdx,cdxgs, & + & ipconc,ndebug,ngs,nz,kgs,fadvisc, & + & cwmasn,cwmasx,cwradn,cnina,cimn,cimx, & + & itype1,itype2,temcg,infdo,alpha,0,axx,bxx) ! ,cdh,cdhl) +! & itype1,itype2,temcg,infdo,alpha,0,axh,bxh,axhl,bxhl) ! ,cdh,cdhl) + + + IF ( lwsm6 .and. ipconc == 0 ) THEN + tmp = Max(qxmin(lh), qxmin(ls)) + DO mgs = 1,ngscnt + total = qx(mgs,lh) + qx(mgs,ls) + IF ( total > tmp ) THEN + vt2ave(mgs) = (qx(mgs,lh)*vtxbar(mgs,lh,1) + qx(mgs,ls)*vtxbar(mgs,ls,1))/total + ELSE + vt2ave(mgs) = 0.0 + ENDIF + ENDDO + ENDIF + + +! +! Set number concentrations (need xdia from setvt) +! + if ( ndebug .gt. 0 ) write(0,*) 'ICEZVD_GS: Set concentration' + IF ( ipconc .lt. 1 ) THEN + cina(1:ngscnt) = cx(1:ngscnt,li) + ENDIF + if ( ipconc .lt. 5 ) then + do mgs = 1,ngscnt + + + IF ( ipconc .lt. 3 ) THEN +! cx(mgs,lr) = 0.0 + if ( qx(mgs,lr) .gt. qxmin(lh) ) then +! cx(mgs,lr) = cno(lr)*xdia(mgs,lr,1) +! xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*cx(mgs,lr)) + end if + ENDIF + + IF ( ipconc .lt. 4 ) THEN +! tmp = cx(mgs,ls) +! cx(mgs,ls) = 0.0 + if ( qx(mgs,ls) .gt. qxmin(ls) ) then +! cx(mgs,ls) = cno(ls)*xdia(mgs,ls,1) +! xv(mgs,ls) = rho0(mgs)*qx(mgs,ls)/(xdn(mgs,ls)*cx(mgs,ls)) + end if + ENDIF ! ( ipconc .lt. 4 ) + + IF ( ipconc .lt. 5 ) THEN + + +! cx(mgs,lh) = 0.0 + if ( qx(mgs,lh) .gt. qxmin(lh) ) then +! cx(mgs,lh) = cno(lh)*xdia(mgs,lh,1) +! xv(mgs,lh) = Max(xvmn(lh), rho0(mgs)*qx(mgs,lh)/(xdn(mgs,lh)*cx(mgs,lh)) ) +! xdia(mgs,lh,3) = (xv(mgs,lh)*6./pi)**(1./3.) + end if + + ENDIF ! ( ipconc .lt. 5 ) + + end do + end if + + IF ( ipconc .ge. 2 ) THEN + DO mgs = 1,ngscnt + + rb(mgs) = 0.5*xdia(mgs,lc,1)*(1./(1.+alpha(mgs,lc)))**(1./6.) + xl2p(mgs) = Max(0.0d0, 2.7e-2*xdn(mgs,lc)*cx(mgs,lc)*xv(mgs,lc)* & + & ((0.5e20*rb(mgs)**3*xdia(mgs,lc,1))-0.4) ) IF ( rb(mgs) .gt. 3.51e-6 ) THEN ! rh(mgs) = Max( 0.5d0*xdia(mgs,lc,1), 6.3d-4/(1.d6*(rb(mgs) - 3.5d-6)) ) rh(mgs) = Max( 41.d-6, 6.3d-4/(1.d6*(rb(mgs) - 3.5d-6)) ) @@ -12480,6 +14620,17 @@ subroutine nssl_2mom_gs & + IF ( ipconc >= 6 ) THEN + frac = 0.4d0 + zxmxd(:,:) = 0.0 + DO il = lr,lhab + IF ( lz(il) > 0 .or. ( il == lr ) ) THEN + DO mgs = 1,ngscnt + zxmxd(mgs,il) = frac*zx(mgs,il)*dtpinv + ENDDO + ENDIF + ENDDO + ENDIF @@ -12517,10 +14668,10 @@ subroutine nssl_2mom_gs & vshdgs(mgs,il) = vshd ! base value - IF ( qx(mgs,il) > qxmin(il) ) THEN + IF ( qx(mgs,il) > qxmin(il) .and. ivshdgs > 0 ) THEN ! tmpdiam is weighted diameter of d^(shedalp-1), so for shedalp=3, this is the area-weighted diameter or maximum mass diameter. - tmpdiam = (shedalp+alpha(mgs,il))*xdia(mgs,il,1)*( xdn(mgs,il)/917. )**(1./3.) ! erm added density factor for equiv. solid ice sphere 10.12.2015 + tmpdiam = (shedalp+alpha(mgs,il))*xdia(mgs,il,1) ! *( xdn(mgs,il)/917. )**(1./3.) ! erm added density factor for equiv. solid ice sphere 10.12.2015 IF ( tmpdiam > sheddiam0 ) THEN vshdgs(mgs,il) = 0.523599*(1.5e-3)**3/massfacshr ! 1.5mm drops from very large ice @@ -12577,6 +14728,7 @@ subroutine nssl_2mom_gs & ers(mgs) = 0.0 ess(mgs) = 0.0 ehs(mgs) = 0.0 ! used as sticking efficiency, so collection efficiency is ehs*ehsclsn + ehsfac(mgs) = 1.0 ! factor based on ice saturation ehls(mgs) = 0.0 ! used as sticking efficiency, so collection efficiency is ehls*ehlsclsn ehscnv(mgs) = 0.0 ! ehxs(mgs) = 0.0 @@ -12678,7 +14830,7 @@ subroutine nssl_2mom_gs & if ( qx(mgs,li).gt.qxmin(li) .and. qx(mgs,lc).gt.qxmin(lc) ) then - if (xdia(mgs,lc,1).gt.15.0e-06 .and. xdia(mgs,li,1).gt.30.0e-06) then + if (xdia(mgs,lc,1).gt.ewi_dcmin .and. xdia(mgs,li,1).gt.ewi_dimin) then ! erm 5/10/2007 test following change: ! if (xdia(mgs,lc,1).gt.12.0e-06 .and. xdia(mgs,li,1).gt.50.0e-06) then eiw(mgs) = 0.5 @@ -12802,7 +14954,7 @@ subroutine nssl_2mom_gs & ELSE fac = Abs(ess0) - IF ( .true. .and. ess0 < 0.0 ) THEN + IF ( iessopt == 2 ) THEN ! experimental code ! IF ( wvel(mgs) > 2.0 .or. wvel(mgs) < -0.5 .or. ssi(mgs) < 1.0 ) THEN IF ( wvel(mgs) > 2.0 ) THEN ! assume convective cell or downdraft @@ -12810,9 +14962,25 @@ subroutine nssl_2mom_gs & ELSEIF ( wvel(mgs) > 1.0 ) THEN ! transition to stratiform range of values fac = Max(0.0, 2.0 - wvel(mgs))*fac ENDIF + ELSEIF ( iessopt == 3 ) THEN ! factor based on ice supersat + IF ( ssi(mgs) <= 1.0 ) THEN + fac = 0.0 + ehsfac(mgs) = 0.0 + ELSEIF ( ssi(mgs) <= 1.02 ) THEN + fac = fac*(ssi(mgs) - 1.0)/0.02 + ehsfac(mgs) = (ssi(mgs) - 1.0)/0.02 + ENDIF + ELSEIF ( iessopt == 4 ) THEN ! factor based on ice supersat + IF ( ssi(mgs) <= 1.0 ) THEN + fac = 0.1 + ehsfac(mgs) = 0.1 + ELSEIF ( ssi(mgs) <= 1.005 ) THEN + fac = Max(0.1, fac*(ssi(mgs) - 1.0)/0.005) + ehsfac(mgs) = Max(0.1, (ssi(mgs) - 1.0)/0.005) + ENDIF ENDIF - IF ( temcg(mgs) > esstem1 .and. temcg(mgs) < esstem2 ) THEN ! only nonzero for T > -25 + IF ( temcg(mgs) > esstem1 .and. temcg(mgs) < esstem2 ) THEN ! only nonzero for T > esstem1 ess(mgs) = fac*Exp(ess1*(esstem2) )*(temcg(mgs) - esstem1)/(esstem2 - esstem1) ! linear ramp up from zero at esstem1 to value at esstem2 ELSEIF ( temcg(mgs) >= esstem2 ) THEN ess(mgs) = fac*Exp(ess1*Min( temcg(mgs), 0.0 ) ) @@ -12923,7 +15091,11 @@ subroutine nssl_2mom_gs & ELSE ehscnv(mgs) = exp(0.09*min(temcg(mgs),0.0)) ENDIF - if ( qx(mgs,lh).gt.qxmin(lh) .and. qx(mgs,lc) > qxmin(lc) ) then + + IF ( qx(mgs,lh).gt.qxmin(lh) .and. qx(mgs,lc) >= qxmin(lc) ) THEN +! ehsclsn(mgs) = ehs_collsn +! ehs(mgs) = ehscnv(mgs)*ehsfac(mgs)*Min(1.0, Max(0.0,xdn(mgs,lh) - 300.)/300. ) +! ELSEIF ( qx(mgs,lh).gt.qxmin(lh) .and. qx(mgs,lc) >= qxmin(lc) ) then ehsclsn(mgs) = ehs_collsn IF ( xdia(mgs,ls,3) < 40.e-6 ) THEN ehsclsn(mgs) = 0.0 @@ -12933,10 +15105,9 @@ subroutine nssl_2mom_gs & ehsclsn(mgs) = ehs_collsn ENDIF ! ehs(mgs) = ehscnv(mgs)*Min(1.0, Max(0., xdn(mgs,lh) - xdnmn(lh)*1.2)/xdnmn(lh) ) ! shut off qhacs as graupel goes to lowest density - ehs(mgs) = ehscnv(mgs)*Min(1.0, Max(0.0,xdn(mgs,lh) - 300.)/300. ) ! shut off qhacs as graupel goes to low density + ehs(mgs) = ehscnv(mgs)*Min(1.0, Max(0.0,xdn(mgs,lh) - 300.)/300. ) ! shut off qhacs as graupel goes to low density; limits scavenging of snow in bright band ! ehs(mgs) = ehscnv(mgs) ! *Min(1.0, Max(0.0,xdn(mgs,lh) - 300.)/300. ) ! shut off qhacs as graupel goes to low density ehs(mgs) = Min(ehs(mgs),ehsmax) - IF ( qx(mgs,lc) < qxmin(lc) ) ehs(mgs) = 0.0 end if ENDIF ! @@ -12944,7 +15115,7 @@ subroutine nssl_2mom_gs & ehiclsn(mgs) = ehi_collsn ehi(mgs)=eii0*exp(eii1*min(temcg(mgs),0.0)) ehi(mgs) = Min( ehimax, Max( ehi(mgs), ehimin ) ) - if ( temg(mgs) .gt. 273.15 .or. ( qx(mgs,lc) < qxmin(lc)) ) ehi(mgs) = 0.0 +! if ( temg(mgs) .gt. 273.15 .or. ( qx(mgs,lc) < qxmin(lc)) ) ehi(mgs) = 0.0 end if IF ( lis > 1 ) THEN @@ -12952,7 +15123,7 @@ subroutine nssl_2mom_gs & ehisclsn(mgs) = ehi_collsn ehis(mgs)=eii0*exp(eii1*min(temcg(mgs),0.0)) ehis(mgs) = Min( ehimax, Max( ehis(mgs), ehimin ) ) - if ( temg(mgs) .gt. 273.15 .or. ( qx(mgs,lc) < qxmin(lc)) ) ehis(mgs) = 0.0 +! if ( temg(mgs) .gt. 273.15 .or. ( qx(mgs,lc) < qxmin(lc)) ) ehis(mgs) = 0.0 end if ENDIF @@ -13089,6 +15260,7 @@ subroutine nssl_2mom_gs & end do + ! ! ! @@ -13207,6 +15379,7 @@ subroutine nssl_2mom_gs & ENDIF end do ! + IF ( ipconc < 3 ) THEN do mgs = 1,ngscnt qracs(mgs) = 0.0 IF ( ers(mgs) .gt. 0.0 .and. ipconc < 3 ) THEN @@ -13225,6 +15398,7 @@ subroutine nssl_2mom_gs & & , qsmxd(mgs)) ENDIF end do + ENDIF ! ! @@ -13371,6 +15545,7 @@ subroutine nssl_2mom_gs & ! do mgs = 1,ngscnt qhacw(mgs) = 0.0 + qhacwmlr(mgs) = 0.0 rarx(mgs,lh) = 0.0 vhacw(mgs) = 0.0 vhsoak(mgs) = 0.0 @@ -13437,6 +15612,11 @@ subroutine nssl_2mom_gs & ENDIF + qhacwmlr(mgs) = qhacw(mgs) + IF ( temg(mgs) > tfr .and. iqhacwshr == 0 ) THEN + qhacw(mgs) = 0.0 + ENDIF + IF ( lvol(lh) .gt. 1 .or. lhl .gt. 1 ) THEN ! calculate rime density for graupel volume and/or for graupel conversion to hail IF ( temg(mgs) .lt. 273.15) THEN @@ -13466,14 +15646,18 @@ subroutine nssl_2mom_gs & rimdn(mgs,lh) = 1000.*(0.051 + 0.114*tmp - 0.0055*tmp**2) - ELSEIF ( irimdenopt == 3 ) THEN ! Macklin + ELSEIF ( irimdenopt == 3 .or. irimdenopt == 4) THEN ! Macklin (3) or Saunders and Hosseini 2001 tmp = (-((0.5)*(1.e+06)*xdia(mgs,lc,1)) & & *( (1.0-rimdenvwgt)*vtxbar(mgs,lh,1) + rimdenvwgt*vtxbar(mgs,lh,2) ) & & /(temg(mgs)-273.15)) ! tmp = Min( 5.5/0.6, Max( 0.3/0.6, tmp ) ) - rimdn(mgs,lh) = Min(900., Max( 170., 110.*tmp**0.76 ) ) + IF ( irimdenopt == 3 ) THEN + rimdn(mgs,lh) = Min(900., Max( 170., 110.*tmp**0.76 ) ) + ELSEIF ( irimdenopt == 4 ) THEN ! Saunders and Hosseini + rimdn(mgs,lh) = Min(917., Max( 10., 900.0*(1.0 - 0.905**tmp ) ) ) + ENDIF ENDIF ELSE @@ -13687,6 +15871,7 @@ subroutine nssl_2mom_gs & do mgs = 1,ngscnt qhlacw(mgs) = 0.0 + qhlacwmlr(mgs) = 0.0 vhlacw(mgs) = 0.0 vhlsoak(mgs) = 0.0 IF ( lhl > 1 .and. .true.) THEN @@ -13715,10 +15900,15 @@ subroutine nssl_2mom_gs & qhlacw(mgs) = Min( qhlacw(mgs), 0.5*qx(mgs,lc)*dtpinv ) + qhlacwmlr(mgs) = qhlacw(mgs) + IF ( temg(mgs) > tfr .and. iqhlacwshr == 0 ) THEN + qhlacw(mgs) = 0.0 + ENDIF + IF ( lvol(lhl) .gt. 1 ) THEN IF ( temg(mgs) .lt. 273.15) THEN - IF ( irimdenopt == 1 ) THEN ! Rasmussen and Heymsfeld (1985) + IF ( irimdenopt == 1 ) THEN ! Heymsfeld and Pflaum (1985) rimdn(mgs,lhl) = rimc1*(-((0.5)*(1.e+06)*xdia(mgs,lc,1)) & & *((0.60)*( (1.0-rimdenvwgt)*vtxbar(mgs,lhl,1) + rimdenvwgt*vtxbar(mgs,lhl,2) )) & & /(temg(mgs)-273.15))**(rimc2) @@ -13732,13 +15922,17 @@ subroutine nssl_2mom_gs & rimdn(mgs,lhl) = 1000.*(0.051 + 0.114*tmp - 0.005*tmp**2) - ELSEIF ( irimdenopt == 3 ) THEN ! Macklin + ELSEIF ( irimdenopt == 3 .or. irimdenopt == 4) THEN ! Macklin (3) or Saunders and Hosseini 2001 tmp = -0.5*(1.e+06)*xdia(mgs,lc,1) & & *( (1.0-rimdenvwgt)*vtxbar(mgs,lhl,1) + rimdenvwgt*vtxbar(mgs,lhl,2) ) & & /(temg(mgs)-273.15) ! tmp = Min( 5.5/0.6, Max( 0.3/0.6, tmp ) ) - rimdn(mgs,lhl) = Min(900., Max( 170., 110.*tmp**0.76 ) ) + IF ( irimdenopt == 3 ) THEN + rimdn(mgs,lhl) = Min(900., Max( 170., 110.*tmp**0.76 ) ) + ELSEIF ( irimdenopt == 4 ) THEN ! Saunders and Hosseini + rimdn(mgs,lhl) = Min(917., Max( 10., 900.0*(1.0 - 0.905**tmp ) ) ) + ENDIF ENDIF ELSE @@ -14053,7 +16247,7 @@ subroutine nssl_2mom_gs & frach = 0.5 *(1. + Tanh(0.2e12 *( xvfrz - 1.15*xvbiggsnow))) qiacrs(mgs) = (1.-frach)*qiacr(mgs) - ciacrs(mgs) = (1.-frach)*ciacr(mgs) ! *rzxh(mgs) + ciacrs(mgs) = (1.-frach)*ciacrf(mgs) ! *rzxh(mgs) ENDIF ENDIF @@ -14083,7 +16277,7 @@ subroutine nssl_2mom_gs & tmp = xv(mgs,ls)/(xvmx(ls)*Max(1.,100./Min(100.,xdn(mgs,ls)))) ! fraction of max snow mass IF ( tmp .lt. essfrac1 ) THEN ec0(mgs) = 1.0 - ELSEIF ( tmp .gt. essfrac2 ) THEN + ELSEIF ( tmp .ge. essfrac2 ) THEN ec0(mgs) = 0.0 ELSE ec0(mgs) = (essfrac2 - tmp)/(essfrac2 - essfrac1) @@ -14160,7 +16354,21 @@ subroutine nssl_2mom_gs & ec0(mgs) = 2.e9 IF ( qx(mgs,lr) .gt. qxmin(lr) ) THEN rwrad = 0.5*xdia(mgs,lr,3) - IF ( xdia(mgs,lr,3) .gt. 2.0e-3 .or. icracr <= 0 ) THEN + + + ! check median volume diameter + IF ( icracrthresh > 1 ) THEN + IF ( imurain == 1 ) THEN + tmp = (3.67+alpha(mgs,lr))*xdia(mgs,lr,1) ! median volume diameter; units of mm (Ulbrich 1983, JCAM) + ELSE ! imurain == 3, + tmp = (1.678+alpha(mgs,lr))**(1./3.)*xdia(mgs,lr,1) ! units of mm (using method of Ulbrich 1983. See ventillation_stuff.nb) + ENDIF + ELSE + tmp = xdia(mgs,lr,3) - 0.1e-3 + ENDIF + +! IF ( xdia(mgs,lr,3) .gt. 2.0e-3 .or. icracr <= 0 ) THEN + IF ( tmp .gt. 1.9e-3 .or. icracr <= 0 ) THEN ec0(mgs) = 0.0 cracr(mgs) = 0.0 ELSE @@ -14242,6 +16450,7 @@ subroutine nssl_2mom_gs & ! if (ndebug .gt. 0 ) write(0,*) 'ICEZVD_GS: conc 22kk' chaci(:) = 0.0 + chaci0(:) = 0.0 if ( ipconc .ge. 1 .or. ipelec .ge. 1 ) then do mgs = 1,ngscnt IF ( ehi(mgs) .gt. 0.0 .or. ( ehiclsn(mgs) > 0.0 .and. ipelec > 0 )) THEN @@ -14292,6 +16501,7 @@ subroutine nssl_2mom_gs & ! if (ndebug .gt. 0 ) write(0,*) 'ICEZVD_GS: conc 22nn' chacs(:) = 0.0 + chacs0(:) = 0.0 if ( ipconc .ge. 1 .or. ipelec .ge. 1 ) then do mgs = 1,ngscnt IF ( ehs(mgs) .gt. 0 ) THEN @@ -14534,6 +16744,45 @@ subroutine nssl_2mom_gs & IF ( crcnw(mgs) < 1.e-30 ) qrcnw(mgs) = 0.0 + IF ( lzr > 1 .and. qrcnw(mgs) > 0.0 ) THEN +! vr = rho0(mgs)*qrcnw(mgs)/(1000.*crcnw(mgs)) +! zrcnw(mgs) = 36.*(xnu(lr)+2.0)*crcnw(mgs)*vr**2/((xnu(lr)+1.0)*pi**2) + ! DTD: If rain exists at a grid point already either use the alpha-preserving Z-rate eqn. (dmrauto == 1) + ! or a mass-weighted average of the alpha-preserving Z-rate eqn. and the init. rate eqn. (dmrauto == 2) + ! or the original initiation rate equation (dmrauto == 0). Not sure if this is the correct way to go but seems to work ok. + IF (qx(mgs,lr) .gt. qxmin(lr) .and. ( dmrauto == 1 .or. dmrauto ==2 ) ) THEN + tmp3 = qx(mgs,lr)/cx(mgs,lr) + tmp4 = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2* & + & ( 2.*tmp3 * qrcnw(mgs) - tmp3**2 * crcnw(mgs) ) + if (imurain == 3) then + vr = rho0(mgs)*qrcnw(mgs)/(1000.) + tmp3 = 36.*(xnu(lc)+2.0)*vr**2/(crcnw(mgs)*(xnu(lc)+1.0)*pi**2) + else + tmp3 = galpharaut*(6.*rho0(mgs)*qrcnw(mgs)/(pi*xdn0(lr)))**2/crcnw(mgs) + endif + IF ( dmrauto == 1 ) THEN ! Preserve alpha + zrcnw(mgs) = tmp4 + ELSEIF ( dmrauto == 2 ) THEN ! Mass-weighted average + zrcnw(mgs) = (tmp3*qrcnw(mgs)+tmp4*qx(mgs,lr))/(qrcnw(mgs)+qx(mgs,lr)) + ENDIF + else ! original formulation + IF ( imurain == 3 ) THEN + vr = rho0(mgs)*qrcnw(mgs)/(1000.) ! crcnw(mgs) not divided here but is in next line, cancels one factor in the numerator + zrcnw(mgs) = 36.*(xnu(lc)+2.0)*vr**2/(crcnw(mgs)*(xnu(lc)+1.0)*pi**2) + ELSE ! rain in gamma of diameter + IF ( dmropt <= 1 .or. dmropt >= 4 .or. ( qx(mgs,lr) < qxmin(lr) .and. cx(mgs,lr) < cxmin ) ) THEN + zrcnw(mgs) = galpharaut*(6.*rho0(mgs)*qrcnw(mgs)/(pi*xdn0(lr)))**2/crcnw(mgs) + ELSE + tmp3 = qx(mgs,lr)/cx(mgs,lr) + zrcnw(mgs) = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2* & + & ( 2.*tmp3 * qrcnw(mgs) - tmp3**2 * crcnw(mgs) ) + ENDIF +! vr = rho0(mgs)*qrcnw(mgs)/(1000.) ! crcnw(mgs) not divided here but is in next line, cancels one factor in the numerator +! zrcnw(mgs) = 36.*(xnu(lc)+2.0)*vr**2/(crcnw(mgs)*(xnu(lc)+1.0)*pi**2) + ENDIF + endif +! z = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) + ENDIF ! IF ( crcnw(mgs) .gt. cautn(mgs) .and. crcnw(mgs) .gt. 1.0 ) ! : THEN ! write(0,*) 'crcnw,cautn ',crcnw(mgs)/cautn(mgs), @@ -14744,6 +16993,15 @@ subroutine nssl_2mom_gs & ELSE !{ + IF ( lzr > 1 ) THEN + ! interpolate along x, i.e., ratio; + tmp1 = ziacrratio(i,j) + delx*dqiacrratioinv*(ziacrratio(ip1,j) - ziacrratio(i,j)) + tmp2 = ziacrratio(i,jp1) + delx*dqiacrratioinv*(ziacrratio(ip1,jp1) - ziacrratio(i,jp1)) + + ! interpolate along alpha; + + zrfrz(mgs) = (tmp1 + dely*dqiacralphainv*(tmp2 - tmp1))*zx(mgs,lr)*dtpinv + ENDIF IF ( ibiggsmallrain > 0 .and. xv(mgs,lr) < 2.*xvmn(lr) .and. ( ibiggsnow == 1 .or. ibiggsnow == 3 ) ) THEN ! IF ( ibiggsmallrain > 0 .and. xv(mgs,lr) < xvbiggsnow .and. ( ibiggsnow == 1 .or. ibiggsnow == 3 ) ) THEN @@ -14753,6 +17011,10 @@ subroutine nssl_2mom_gs & crfrzs(mgs) = crfrz(mgs) qrfrzs(mgs) = qrfrz(mgs) + IF ( lzr > 1 ) THEN + zrfrzs(mgs) = zrfrz(mgs) + zrfrzf(mgs) = 0. + ENDIF ELSEIF ( dbigg < Max( biggsnowdiam, Max(dfrz,dhmn)) .and. ( ibiggsnow == 1 .or. ibiggsnow == 3 ) ) THEN ! { convert some to snow or ice crystals ! temporarily store qrfrz and crfrz in snow terms and caclulate new crfrzf, qrfrzf, and zrfrzf. Leave crfrz etc. alone! @@ -14764,6 +17026,10 @@ subroutine nssl_2mom_gs & crfrzf(mgs) = 0.0 qrfrzf(mgs) = 0.0 + IF ( lzr > 1 ) THEN + zrfrzs(mgs) = zrfrz(mgs) + zrfrzf(mgs) = 0. + ENDIF ELSE !{ ! recalculate using dhmn for ratio @@ -14803,10 +17069,23 @@ subroutine nssl_2mom_gs & crfrzs(mgs) = crfrzs(mgs) - crfrzf(mgs) qrfrzs(mgs) = qrfrzs(mgs) - qrfrzf(mgs) + IF ( lzr > 1 ) THEN + zrfrzs(mgs) = zrfrz(mgs) + ! interpolate along x, i.e., ratio; + tmp1 = ziacrratio(i,j) + delx*dqiacrratioinv*(ziacrratio(ip1,j) - ziacrratio(i,j)) + tmp2 = ziacrratio(i,jp1) + delx*dqiacrratioinv*(ziacrratio(ip1,jp1) - ziacrratio(i,jp1)) + + ! interpolate along alpha; + + zrfrzf(mgs) = (tmp1 + dely*dqiacralphainv*(tmp2 - tmp1))*zx(mgs,lr)*dtpinv + zrfrzs(mgs) = zrfrzs(mgs) - zrfrzf(mgs) + zrfrzf(mgs) = (1000./900.)**2*zrfrzf(mgs) + ENDIF ENDIF ! } ELSE crfrzs(mgs) = 0.0 qrfrzs(mgs) = 0.0 + zrfrzs(mgs) = 0.0 ENDIF ! } ENDIF !} @@ -14819,6 +17098,10 @@ subroutine nssl_2mom_gs & crfrz(mgs) = fac*crfrz(mgs) crfrzs(mgs) = fac*crfrzs(mgs) crfrzf(mgs) = fac*crfrzf(mgs) + IF ( lzr > 1 ) THEN + zrfrz(mgs) = fac*zrfrz(mgs) + zrfrzf(mgs) = fac*zrfrzf(mgs) + ENDIF ENDIF ENDIF !} @@ -15364,7 +17647,15 @@ subroutine nssl_2mom_gs & x = 1. + alpha(mgs,lr) IF ( lzr > 1 ) THEN ! 3 moment -! + tmp = 1. + alpr ! alpha(mgs,lr) + i = Int(dgami*(tmp)) + del = tmp - dgam*i + g1palp = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = 2.5 + alpha(mgs,lr) + 0.5*bx(lr) + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = (gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami)/g1palp ! ratio of gamma functions ELSE y = ventrxn(mgs) ENDIF @@ -15381,6 +17672,12 @@ subroutine nssl_2mom_gs & & Sqrt(ax(lr)*rhovt(mgs))*(vent1/vent2) +! rwventz(mgs) = & +! & 0.78*x + & +! & 0.308*fvent(mgs)*y* & +! & Sqrt(ax(lr)*rhovt(mgs))*(vent1/vent2) + + ELSEIF ( iferwisventr == 2 ) THEN ! Following Wisner et al. (1972) but using gamma of volume. Note that Ferrier rain fall speed does not integrate with gamma of volume, so using Vr = ar*d^br @@ -15392,6 +17689,22 @@ subroutine nssl_2mom_gs & & *(xdia(mgs,lr,1)**((1.0+br)/2.0)) ) + alpr = Min(alpharmax,alpha(mgs,lr) ) + + tmp = alpr + 5.5 + br/2. + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + +! rwventz(mgs) = & +! & 0.78*(4. + alpha(mgs,lr))*(3. + alpha(mgs,lr))*(2. + alpha(mgs,lr))*(1. + alpha(mgs,lr)) + & + rwventz(mgs) = & + & 0.78*(4. + alpr)*(3. + alpr)*(2. + alpr)*(1. + alpr) + & + & 0.308*fvent(mgs)* & + & Sqrt(ax(lr)*rhovt(mgs))*(y/gf1palp(mgs))*(xdia(mgs,lr,1)**((1.0+br)/2.0)) + + + ENDIF ! iferwisventr @@ -15554,6 +17867,8 @@ subroutine nssl_2mom_gs & & -ftka(mgs)*temcg(mgs)/rho0(mgs) ) & & / (felf(mgs)) fmlt2(mgs) = -fcw(mgs)*temcg(mgs)/felf(mgs) + fmlt1e(mgs) = (2.0*pi)* & + & ( felv(mgs)*fwvdf(mgs)*(qss0(mgs)-qx(mgs,lv)) ) / (felf(mgs)) end do ! ! Vapor Deposition constants @@ -15581,6 +17896,7 @@ subroutine nssl_2mom_gs & qhlmlrlg(:) = 0.0 ENDIF qhfzh(:) = 0.0 + qffzf(:) = 0.0 qhlfzhl(:) = 0.0 qhfzhlg(:) = 0.0 qhlfzhllg(:) = 0.0 @@ -15591,6 +17907,7 @@ subroutine nssl_2mom_gs & zsmlr(:) = 0.0 zhmlr(:) = 0.0 zhmlrr(:) = 0.0 + zsmlrr(:) = 0.0 zhshr(:) = 0.0 zhlmlr(:) = 0.0 zhlshr(:) = 0.0 @@ -15642,7 +17959,7 @@ subroutine nssl_2mom_gs & qhmlr(mgs) = & & meltfac*min( & & fmlt1(mgs)*cx(mgs,lh)*hwvent(mgs)*xdia(mgs,lh,1) & - & + fmlt2(mgs)*(qhacrmlr(mgs)+qhacw(mgs)) & + & + fmlt2(mgs)*(qhacrmlr(mgs)+qhacwmlr(mgs)) & & , 0.0 ) ELSEIF ( ibinhmlr == 1 ) THEN ! use incomplete gamma functions to approximate the bin results @@ -15674,13 +17991,13 @@ subroutine nssl_2mom_gs & qhlmlr(mgs) = & & meltfac*min( & & fmlt1(mgs)*cx(mgs,lhl)*hlvent(mgs)*xdia(mgs,lhl,1) & - & + fmlt2(mgs)*(qhlacrmlr(mgs)+qhlacw(mgs)) & + & + fmlt2(mgs)*(qhlacrmlr(mgs)+qhlacwmlr(mgs)) & & , 0.0 ) ELSEIF ( ibinhlmlr == 1 ) THEN ! use incomplete gamma functions to approximate the bin results -! #ifdef Z3MOM -! #if (defined Z3MOM) && defined( COMMAS ) || defined( COMMASTMP ) +! #ifdef 1 +! #if (defined 1) && defined( COMMAS ) || defined( COMMASTMP ) ELSEIF ( ibinhlmlr == -1 ) THEN ! OLD VERSION use incomplete gamma functions to approximate the bin results @@ -15711,7 +18028,7 @@ subroutine nssl_2mom_gs & chmlr(mgs) = max( chmlr(mgs), Min( -chmxd(mgs), -0.95*cx(mgs,lh)*dtpinv ) ) ENDIF ! qhmlr(mgs) = max( max( qhmlr(mgs), -qhmxd(mgs) ) , -0.5*qx(mgs,lh)*dtpinv ) !limits to 1/2 qh or max depletion - qhmlh(mgs) = 0. + qhmlh(mgs) = 0. ! not used ! Rasmussen and Heymsfield say melt water remains on graupel up to 9 mm before shedding @@ -15789,7 +18106,26 @@ subroutine nssl_2mom_gs & + IF ( lzr .gt. 1 .and. qx(mgs,ls) > qxmin(ls) ) THEN + tmp = qx(mgs,ls)/cx(mgs,ls) +! alp = Max( -0.8, alpha(mgs,lh) ) + alp = xnu(ls) + g1 = 36.*(alp+2.0)/((alp+1.0)*pi**2) + + zsmlr(mgs) = g1*(rho0(mgs)/(xdn(mgs,ls)))**2*( tmp * qsmlr(mgs) ) +! zhmlr(mgs) = (xdn0(lr)/(xdn(mgs,lh)))**2*( zx(mgs,lh) * qhmlr(mgs) ) + + ENDIF + IF ( chmlr(mgs) < 0.0 .and. (ibinhmlr < 1 .or. lzh < 1) ) THEN ! { already done if ibinhmlr > 0 + IF ( lzr .gt. 1 .and. lzh < 1 .and. qx(mgs,lh) > qxmin(lh) ) THEN ! Only compute if rain is 3-moment but graupel is not, otherwise is computed later + tmp = qx(mgs,lh)/cx(mgs,lh) + alp = alpha(mgs,lh) + g1 = g1x(mgs,lh) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + + zhmlr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*tmp * qhmlr(mgs) - tmp**2 * chmlr(mgs) ) + + ENDIF IF ( ibinhmlr == 0 .or. lzh < 1 ) THEN IF ( ihmlt .eq. 1 ) THEN @@ -15895,6 +18231,17 @@ subroutine nssl_2mom_gs & ENDIF !} + IF ( lzhl .gt. 1 .and. ibinhlmlr <= 0 ) THEN + IF ( cx(mgs,lhl) > 0.0 ) THEN + + tmp = qx(mgs,lhl)/cx(mgs,lhl) + alp = alpha(mgs,lhl) +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + g1 = g1x(mgs,lhl) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + + zhlmlr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( tmp * qhlmlr(mgs) ) + ENDIF + ENDIF ENDIF ! } ENDIF ! }.not. mixedphase @@ -15932,6 +18279,7 @@ subroutine nssl_2mom_gs & ENDDO ! ! + qhdsv(:) = 0.0 qhldsv(:) = 0.0 do mgs = 1,ngscnt @@ -15941,6 +18289,7 @@ subroutine nssl_2mom_gs & & fvds(mgs)*cx(mgs,li)*civent(mgs)*cicap(mgs)*depfac qsdsv(mgs) = & & fvds(mgs)*cx(mgs,ls)*swvent(mgs)*swcap(mgs)*depfac + ! IF ( ny .eq. 2 .and. igs(mgs) .eq. 302 .and. temg(mgs) .le. tfrh+10 .and. qx(mgs,lv) .gt. qis(mgs) ! : .and. qx(mgs,li) .gt. qxmin(li) ) THEN ! write(0,*) 'qidsv = ',nstep,kgs(mgs),qidsv(mgs),temg(mgs)-tfrh,100.*(qx(mgs,lv)/qis(mgs) - 1.),1.e6*xdia(mgs,li,1), @@ -16177,20 +18526,41 @@ subroutine nssl_2mom_gs & ! end of qlimit + qhcev(:) = 0.0 + chcev(:) = 0.0 + qhlcev(:) = 0.0 + chlcev(:) = 0.0 + qfcev(:) = 0.0 + do mgs = 1,ngscnt qisbv(mgs) = 0.0 qssbv(mgs) = 0.0 qidpv(mgs) = 0.0 qsdpv(mgs) = 0.0 + qhsbv(mgs) = 0.0 + qscev(mgs) = 0.0 + cscev(mgs) = 0.0 IF ( icond .eq. 1 .or. temg(mgs) .le. tfrh & - & .or. (qx(mgs,lr) .le. qxmin(lr) .and. qx(mgs,lc) .le. qxmin(lc)) ) THEN + & .or. (qx(mgs,lr) .le. qxmin(lr) .and. qx(mgs,lc) .le. qxmin(lc)) ) THEN ! last condition (qr qxmin(lhl) ) THEN + IF ( temg(mgs) < tfr .or. .not. qhlmlr(mgs) < 0.0 ) THEN qhlsbv(mgs) = max( min(qhldsv(mgs), 0.0), -qxmxd(mgs,lhl) ) qhldpv(mgs) = Max(qhldsv(mgs), 0.0) + ENDIF + IF ( qhlmlr(mgs) < 0.0 .and. .not. mixedphase ) THEN + ! Liquid is forming, so find the evaporation that was subtracted from melting (if it is not condensing) + qhlcev(mgs) = evapfac* & + & 2.0*pi*(qx(mgs,lv)-qss0(mgs))*cx(mgs,lhl)*xdia(mgs,lhl,1)*hlvent(mgs)/(qss0(mgs)*(fav(mgs)+fbv(mgs))) + + qhlcev(mgs) = max(qhlcev(mgs), -qhlmxd(mgs)) + + ENDIF + ENDIF ENDIF temp1 = qidpv(mgs) + qsdpv(mgs) + qhdpv(mgs) + qhldpv(mgs) @@ -16345,6 +18742,10 @@ subroutine nssl_2mom_gs & end if end do + + + + ! ! ! compute dry growth rate of snow, graupel, and hail @@ -16382,19 +18783,27 @@ subroutine nssl_2mom_gs & ! IF ( dnu(lh) .ne. 0. ) THEN ! qhwet(mgs) = qhdry(mgs) ! ELSE + IF ( incwet == 0 ) THEN qhwet(mgs) = & & ( xdia(mgs,lh,1)*hwvent(mgs)*cx(mgs,lh)*fwet1(mgs) & & + fwet2(mgs)*(qhaci(mgs) + qhacs(mgs)) ) qhwet(mgs) = max( 0.0, qhwet(mgs)) + ELSE + ENDIF + ! ENDIF qhlwet(mgs) = 0.0 IF ( lhl .gt. 1 ) THEN - qhlwet(mgs) = & - & ( xdia(mgs,lhl,1)*hlvent(mgs)*cx(mgs,lhl)*fwet1(mgs) & - & + fwet2(mgs)*(qhlaci(mgs) + qhlacs(mgs)) ) - qhlwet(mgs) = max( 0.0, qhlwet(mgs)) + IF ( incwet == 0 ) THEN + qhlwet(mgs) = & + & ( xdia(mgs,lhl,1)*hlvent(mgs)*cx(mgs,lhl)*fwet1(mgs) & + & + fwet2(mgs)*(qhlaci(mgs) + qhlacs(mgs)) ) + qhlwet(mgs) = max( 0.0, qhlwet(mgs)) + + ELSE + ENDIF ! incwet ENDIF ELSE @@ -16407,6 +18816,7 @@ subroutine nssl_2mom_gs & ! qhlwet(mgs) = qhldry(mgs) end do + ! ! shedding rate ! @@ -16466,7 +18876,7 @@ subroutine nssl_2mom_gs & qhshr(mgs) = -qhdry(mgs) qhlshr(mgs) = -qhldry(mgs) ELSE ! new and correct - + ! note that the qxacr terms should be zero here, so shedding at T > 0 is all from the droplets qsshr(mgs) = - qsacr(mgs) - qsacw(mgs) ! -qsdry(mgs) qhlshr(mgs) = - qhlacw(mgs) - qhlacr(mgs) ! -qhldry(mgs) qhshr(mgs) = - qhacw(mgs) - qhacr(mgs) ! -qhdry(mgs) @@ -16802,7 +19212,94 @@ subroutine nssl_2mom_gs & ltest = xdia(mgs,lh,1)*(4. + alpha(mgs,lh)) > Abs( hlcnhdia ) ! test on mass-weighted diameter ENDIF - dg0(mgs) = -1. + IF ( iusedw == 0 .and. ihlcnh == 1 ) THEN + dg0(mgs) = -1. + ELSE + IF (((qhacw(mgs) + qhacr(mgs))*dtp > qxmin(lh) .and. qx(mgs,lh) > hlcnhqmin .and. temg(mgs) .le. tfr-2.0 & + .and. temg(mgs) .gt. dwtempmin ) .or. ( wetgrowth(mgs) .and. qx(mgs,lh) > hlcnhqmin ) ) THEN + dw = 0.01*( Exp( -temcg(mgs)/( 1.1e4 * rho0(mgs)*ehw(mgs)*qx(mgs,lc) - 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 ) ) - 1.0 ) + dwr = 0.01*( Exp( -temcg(mgs)/( 1.1e4 * rho0(mgs)*(ehw(mgs)*qx(mgs,lc)+ehr(mgs)*qx(mgs,lr)) - & + 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 ) ) - 1.0 ) + d = dwr + IF ( dwr < 0.2 .and. dwr > 0.0 ) THEN + fventh = sqrtrhovt*(fpndl(mgs)**(1./3.)) * (fakvisc(mgs))**(-0.5) + fventm = sqrtrhovt*(fschm(mgs)**(1./3.)) * (fakvisc(mgs))**(-0.5) + sqrtrhovt = Sqrt( rhovt(mgs) ) + ltemq = (tfr-163.15)/fqsat+1.5 + qvs0 = pqs(mgs)*tabqvs(ltemq) + denomdp = felf(mgs) + fcw(mgs)*temcg(mgs) + denominvdp = 1.d0/(felf(mgs) + fcw(mgs)*temcg(mgs)) + +! write(91,*) 'dw,dwr,temcg = ',100.*dw,100.*dwr,temcg(mgs) + h1 = ( -ftka(mgs)*temcg(mgs) - felv(mgs)*fwvdf(mgs)*rho0(mgs)*(qx(mgs,lv) - qvs0) ) + h2 = ehi(mgs)*qx(mgs,li)*rho0(mgs)*fci(mgs)*temcg(mgs) + h3 = Max(dwehwmin, ehw(mgs))*qx(mgs,lc) + h4 = ehr(mgs)* qx(mgs,lr) + ! iterate to find minimum diameter for wet growth. Start with value of dwr + DO n = 1,10 + dold = d + vth = axx(mgs,lh)*d**bxx(mgs,lh) + x2 = fventh*sqrtrhovt*Sqrt(d*vth) + IF ( x2 > 1.4 ) THEN + ah = 0.78 + 0.308*x2 ! heat ventillation + ELSE + ah = 1.0 + 0.108*x2**2 ! mass ventillation (Beard and Pruppacher 1971, eq. 9) + ENDIF + + IF ( .false. ) THEN ! this option includes 'am' separate from ah, which makes only small differences. Otherwise equivalent to second option + x1 = fventm*sqrtrhovt*Sqrt(d*vth) + IF ( x1 > 1.4 ) THEN + am = 0.78 + 0.308*x1 ! mass ventillation (Beard and Pruppacher 1971, eq. 8) + ELSE + am = 1.0 + 0.108*x1**2 ! mass ventillation (Beard and Pruppacher 1971, eq. 9) + ENDIF + + d = 8.*denominvdp*( am*felv(mgs)*fwvdf(mgs)*rho0(mgs)*(qvs0 - qx(mgs,lv)) - ah*ftka(mgs)*temcg(mgs) )/ & + (dtp* ( ( Max(0.001,vth - vtxbar(mgs,lc,1))*h3 + & + Max(0.001,vth - vtxbar(mgs,lr,1))*h4) *rho0(mgs) + & + Max(0.001,vth - vtxbar(mgs,li,1))*h2*denominvdp)) + + ELSE + + d = 8.*ah*h1*dtpinv/ & + ( ( Max(0.001,vth - vtxbar(mgs,lc,1))*h3 + & + Max(0.001,vth - vtxbar(mgs,lr,1))*h4) *rho0(mgs)*denomdp + & + Max(0.001,vth - vtxbar(mgs,li,1))*h2) + ENDIF +! write(0,*) 'iter,d,dwr = ',n,d,dwr +! write(91,*) 'parts = ',( -ah*ftka*temcg - ah*felv*fwvdf*dn(i,j,k)*(qvamb - qvs0) ),( Max(0.001,vth - 0.01*vwmw)*ehw* qcmks*dn(i,j,k)/denominv + Max(0.001,vth - 0.01*vimw)*ehi*qimks*dn(i,j,k)*fci*temcg) +!! write(91,*) 'partsr = ',( -ah*ftka*temcg - ah*felv*fwvdf*dn(i,j,k)*(qvamb - qvs0) ),( ( Max(0.001,vth - 0.01*vwmw)*ehw* qcmks + Max(0.001,vth - 0.01*vrmw)*ehr* qrmks) *dn(i,j,k)/denominv + & +!! Max(0.001,vth - 0.01*vimw)*ehi*qimks*dn(i,j,k)*fci*temcg) +! write(91,*) 'parts2 = ',vth + + IF ( Abs(dold - d)/dold < 0.05 .or. ( n > 3 .and. d > dg0thresh ) ) EXIT + + ENDDO + ENDIF + + dg0(mgs) = Max( d, dwmin ) +! IF ( .false. .and. ny == 2 .and. dwr < 0.5 .and. dwr > 0. ) THEN +! write(0,*) 'i,k,dg0 = ',igs(mgs), kgs(mgs), dg0(mgs) +! write(0,*) 'h1,h2,h3,h4 = ',h1,h2,h3,h4 +! write(0,*) 'dw,dwr = ',dw,dwr +! write(0,*) 'wetgrowth = ',wetgrowth(mgs) +! write(0,*) 'temc,Dh, Dhl = ',temcg(mgs),xdia(mgs,lh,3),xdia(mgs,lhl,3) +! ENDIF + ELSE + dg0(mgs) = dg0thresh + 0.0001 + ENDIF + + IF ( ihlcnh == 3 .and. (qhacw(mgs) + qhacr(mgs))*dtp > qxmin(lh) .and. qx(mgs,lh) > hlcnhqmin & + .and. temg(mgs) .le. tfr-2.0 ) THEN + ! set a secondary condition on to capture large graupel that is riming but not in wet growth + dg0(mgs) = Min( dg0(mgs), dg0thresh - 0.0001 ) + ENDIF + + ENDIF +! write(0,*) 'notwet growth graupel,hail,Dw,Dwr = ',wetgrowth(mgs) , wetgrowthhl(mgs), dh0 ,tmp,tmp1 +! write(0,*) 'temc,Dh, Dhl = ',temcg(mgs),xdia(mgs,lh,3),xdia(mgs,lhl,3) +! write(0,*) 'qc,qi = ', qx(mgs,lc) , qx(mgs,li) + wtest = (dg0(mgs) > 0.0 .and. dg0(mgs) < dg0thresh ) @@ -16874,12 +19371,142 @@ subroutine nssl_2mom_gs & ELSEIF ( ihlcnh == 3 ) THEN !{ + IF ( wtest .and. & + ( qhacw(mgs)*dtp > qxmin(lh) .and. temg(mgs) .lt. tfr-2. .and. qx(mgs,lh) > hlcnhqmin ) ) THEN + ! convert number, mass, and reflectivity for d > dw + IF ( ipconc == 5 ) THEN + ! dg0(mgs) = Min( dg0(mgs), hldia1 ) + !dg0(mgs) = hldia1 + ENDIF + + ratio = Min( maxratiolu, dg0(mgs)/xdia(mgs,lh,1) ) + + + ! mass + tmp2 = gaminterp(ratio,alpha(mgs,lh),4,1) + IF ( ipconc == 5 ) THEN + ! tmp2 = Min( 0.25, tmp2 ) + ENDIF + qxd1 = qx(mgs,lh)*(tmp2) + qhlcnh(mgs) = dtpinv*qxd1 + flim = 1.0 +! tmp3 = Min( dtp*(qfacw(mgs) + qfacr(mgs) ), qxmxd(mgs,lf) ) + tmp3 = qxmxd(mgs,lh) + IF (qxd1 > tmp3 ) THEN + flim = tmp3/(qxd1) + qhlcnh(mgs) = flim*qhlcnh(mgs) + ENDIF + + + + IF ( ( qxd1 > qxmin(lhl) .and. ipconc > 5 ) .or. ( qxd1 > 10.*qxmin(lhl) .and. ipconc == 5) ) THEN + + ! number + tmp = gaminterp(ratio,alpha(mgs,lh),1,1) + IF ( ipconc == 5 ) THEN + ! tmp = Min( 0.2, tmp ) + ENDIF + cxd1 = flim*cx(mgs,lh)*( tmp) + chlcnh(mgs) = dtpinv*cxd1 + chlcnhhl(mgs) = chlcnh(mgs) + + IF ( qx(mgs,lhl) > qxmin(lhl) .and. dmhlopt > 0 ) THEN + dh0 = rho0(mgs)*qhlcnh(mgs)/chlcnhhl(mgs) + IF ( dh0 < xmas(mgs,lhl) ) THEN + ! dh0 = ( qxd1*dh0 + qx(mgs,lhl)*xmas(mgs,lhl))/( qxd1 + qx(mgs,lhl)) ! weighted average + dh0 = (( qxd1*dh0**(1./3.) + qx(mgs,lhl)*xmas(mgs,lhl)**(1./3.))/( qxd1 + qx(mgs,lhl)))**3 ! weighted average + chlcnhhl(mgs) = Min( chlcnhhl(mgs), rho0(mgs)*qhlcnh(mgs)/dh0 ) + ELSE +! dh0 = Max( dh0, xmas(mgs,lhl) ) ! when enough hail is established, do not dilute the size + ENDIF + ENDIF + + + ! reflectivity + IF ( lzh > 1 .and. lzhl > 1 ) THEN + tmp3 = gaminterp(ratio,alpha(mgs,lh),11,1) + zxd1 = flim*zx(mgs,lh)*(tmp3) + zhlcnh(mgs) = dtpinv*zxd1 + ELSE + zxd1 = 0 + ENDIF + + ELSE + qhlcnh(mgs) = 0.0 + ENDIF + +! IF ( cxd1 < 0.0 .or. qxd1 < 0.0 ) THEN +! write(0,*) 'cxd1,qxd1 = ',cxd1,qxd1 +! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio +! ENDIF + +! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio +! write(0,*) 'qhlcnh,qh = ',qhlcnh(mgs),qx(mgs,lh),qxd1 +! write(0,*) 'chlcnh,ch = ',chlcnh(mgs),cx(mgs,lh),cxd1 +! write(0,*) 'zhlcnh,zh = ',zhlcnh(mgs),zx(mgs,lh),zxd1 +! write(0,*) 'tmp1,2,3 = ',tmp,tmp2,tmp3 + + vhlcnh(mgs) = rho0(mgs)*qhlcnh(mgs)/xdn(mgs,lh) + vhlcnhl(mgs) = rho0(mgs)*qhlcnh(mgs)/Max(xdnmn(lhl), xdn(mgs,lh)) + + ENDIF + + ENDIF !} ENDDO ELSEIF ( ihlcnh == 2 ) THEN ! 10-ice type conversion +! +! Staka and Mansell (2005) type conversion +! +! hldia1 is set in micro_module and namelist +! IF ( .true. ) THEN + + ! convert number, mass, and reflectivity for d > hldia1, + ! regardless of wet growth status, but as long as riming > 0 + DO mgs = 1,ngscnt + IF ( qhacw(mgs)*dtp > qxmin(lh) .and. temg(mgs) .lt. tfr-2. .and. qx(mgs,lh) > qxmin(lh) ) THEN + ratio = Min( maxratiolu, hldia1/xdia(mgs,lh,1) ) + + ! number + tmp = gaminterp(ratio,alpha(mgs,lh),1,1) + cxd1 = cx(mgs,lh)*( tmp) + chlcnh(mgs) = dtpinv*cxd1 + chlcnhhl(mgs) = chlcnh(mgs) + + ! mass + tmp2 = gaminterp(ratio,alpha(mgs,lh),4,1) + qxd1 = qx(mgs,lh)*(tmp2) + qhlcnh(mgs) = dtpinv*qxd1 + + ! reflectivity + IF ( lzh > 1 .and. lzhl > 1 ) THEN + tmp3 = gaminterp(ratio,alpha(mgs,lh),11,1) + zxd1 = zx(mgs,lh)*(tmp3) + zhlcnh(mgs) = dtpinv*zxd1 + ELSE + zxd1 = 0 + ENDIF +! IF ( cxd1 < 0.0 .or. qxd1 < 0.0 ) THEN +! write(0,*) 'cxd1,qxd1 = ',cxd1,qxd1 +! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio +! ENDIF + +! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio +! write(0,*) 'qhlcnh,qh = ',qhlcnh(mgs),qx(mgs,lh),qxd1 +! write(0,*) 'chlcnh,ch = ',chlcnh(mgs),cx(mgs,lh),cxd1 +! write(0,*) 'zhlcnh,zh = ',zhlcnh(mgs),zx(mgs,lh),zxd1 +! write(0,*) 'tmp1,2,3 = ',tmp,tmp2,tmp3 + + vhlcnh(mgs) = rho0(mgs)*qhlcnh(mgs)/xdn(mgs,lh) + vhlcnhl(mgs) = rho0(mgs)*qhlcnh(mgs)/Max(xdnmn(lhl), xdn(mgs,lh)) + + ENDIF + + ENDDO +! ENDIF ELSEIF ( ihlcnh == 0 ) THEN do mgs = 1,ngscnt @@ -17115,6 +19742,10 @@ subroutine nssl_2mom_gs & ciacrf(mgs) = qrzfac(mgs)*ciacrf(mgs) ciacrs(mgs) = qrzfac(mgs)*ciacrs(mgs) +! IF ( lzh .gt. 1 ) THEN +! zrfrzf(mgs) = 3.6476*rho0(mgs)**2*(alpha(mgs,lr)+2.)/(xdn0(lr)**2*(alpha(mgs,lr)+1.)) * & +! ( 2.*tmp * qrfrzf(mgs) - tmp**2 * crfrzf(mgs) ) +! ENDIF vrfrzf(mgs) = qrzfac(mgs)*vrfrzf(mgs) viacrf(mgs) = qrzfac(mgs)*viacrf(mgs) @@ -17154,7 +19785,13 @@ subroutine nssl_2mom_gs & IF ( qrcev(mgs) .lt. 0. .and. lnr > 1 ) THEN ! qrcev(mgs) = -qrmxd(mgs) ! crcev(mgs) = (rho0(mgs)/(xmas(mgs,lr)+1.e-20))*qrcev(mgs) - crcev(mgs) = (cx(mgs,lr)/(qx(mgs,lr)))*qrcev(mgs) + IF ( icrcev == 1 ) THEN + crcev(mgs) = (cx(mgs,lr)/(qx(mgs,lr)))*qrcev(mgs) + ELSEIF ( icrcev == 2 ) THEN + crcev(mgs) = (cx(mgs,lr)/(qx(mgs,lr)))*qrcev(mgs)*vtxbar(mgs,lr,2)/vtxbar(mgs,lr,1) + ELSE + crcev(mgs) = 0.0 + ENDIF ELSE crcev(mgs) = 0.0 ENDIF @@ -17166,12 +19803,6 @@ subroutine nssl_2mom_gs & ! ! evaporation/condensation of wet graupel and snow ! - qscev(:) = 0.0 - cscev(:) = 0.0 - qhcev(:) = 0.0 - chcev(:) = 0.0 - qhlcev(:) = 0.0 - chlcev(:) = 0.0 IF ( lhwlg > 1 ) THEN qhcevlg(:) = 0.0 chcevlg(:) = 0.0 @@ -17181,6 +19812,7 @@ subroutine nssl_2mom_gs & chlcevlg(:) = 0.0 ENDIF + ! ! ! @@ -18140,6 +20772,7 @@ subroutine nssl_2mom_gs & pqwvi(mgs) = & & -Min(0.0, qrcev(mgs)) & & -Min(0.0, qhcev(mgs)) & + & -Min(0.0, qfcev(mgs)) & & -Min(0.0, qhlcev(mgs)) & & -Min(0.0, qscev(mgs)) & ! > +il5(mgs)*(-qhsbv(mgs) - qhlsbv(mgs) ) & @@ -18150,6 +20783,7 @@ subroutine nssl_2mom_gs & pqwvd(mgs) = & & -Max(0.0, qrcev(mgs)) & & -Max(0.0, qhcev(mgs)) & + & -Max(0.0, qfcev(mgs)) & & -Max(0.0, qhlcev(mgs)) & & -Max(0.0, qscev(mgs)) & & +il5(mgs)*(-qiint(mgs) & @@ -18366,7 +21000,8 @@ subroutine nssl_2mom_gs & qrcev(mgs) = frac*qrcev(mgs) qhlacr(mgs) = frac*qhlacr(mgs) vhlacr(mgs) = frac*vhlacr(mgs) -! qhcev(mgs) = frac*qhcev(mgs) + qhcev(mgs) = frac*qhcev(mgs) + qhlcev(mgs) = frac*qhlcev(mgs) IF ( warmonly < 0.5 ) THEN @@ -18412,6 +21047,8 @@ subroutine nssl_2mom_gs & ! STOP ENDIF + + end do IF ( warmonly < 0.5 ) THEN @@ -18440,7 +21077,7 @@ subroutine nssl_2mom_gs & & -qhcns(mgs) & & +(1-il5(mgs))*qsmlr(mgs) + qsshr(mgs) & !null at this point when wet snow included ! > +il5(mgs)*(qssbv(mgs)) & - & + (qssbv(mgs)) & + & + qssbv(mgs) & & + Min(0.0, qscev(mgs)) & & -qsmul(mgs) @@ -18534,74 +21171,656 @@ subroutine nssl_2mom_gs & ENDIF - end do - - ENDIF ! lhl + end do + + ENDIF ! lhl + + ELSEIF ( warmonly < 0.8 ) THEN +! +! Graupel +! + do mgs = 1,ngscnt + pqhwi(mgs) = & + & +il5(mgs)*ifrzg*(qrfrzf(mgs) ) & + & +il5(mgs)*(qhdpv(mgs)) & + & +qhacr(mgs)+qhacw(mgs) + pqhwd(mgs) = & + & qhshr(mgs) & !null at this point when wet graupel included + & - qhlcnh(mgs) & + & - qhmul1(mgs) & + & - qsplinter(mgs) - qsplinter2(mgs) & + & +(1-il5(mgs))*qhmlr(mgs) !null at this point when wet graupel included + end do + +! +! Hail +! + IF ( lhl .gt. 1 ) THEN + + do mgs = 1,ngscnt + pqhli(mgs) = & + & +il5(mgs)*(qhldpv(mgs) ) & ! + (1.0-ifrzg)*(qiacrf(mgs)+qrfrzf(mgs) + qracif(mgs))) & + & +il5(mgs)*(1.0-ifrzg)*(qrfrzf(mgs) ) & + & +qhlacr(mgs)+qhlacw(mgs) & +! & +qhlacs(mgs)+qhlaci(mgs) & + & + qhlcnh(mgs) + pqhld(mgs) = & + & qhlshr(mgs) & + & +(1-il5(mgs))*qhlmlr(mgs) & +! > +il5(mgs)*qhlsbv(mgs) & + & + qhlsbv(mgs) & + & -qhlmul1(mgs) - qhcnhl(mgs) + + end do + + ENDIF ! lhl + + ENDIF ! warmonly + +! +! Liquid water on snow and graupel +! + + vhmlr(:) = 0.0 + vhlmlr(:) = 0.0 + vhfzh(:) = 0.0 + vhlfzhl(:) = 0.0 + + IF ( mixedphase ) THEN + ELSE ! set arrays for non-mixedphase graupel + +! vhshdr(:) = 0.0 + vhmlr(:) = qhmlr(:) ! not actually volume, but treated as q in rate equation +! vhsoak(:) = 0.0 + +! vhlshdr(:) = 0.0 + vhlmlr(:) = qhlmlr(:) ! not actually volume, but treated as q in rate equation +! vhlmlr(:) = rho0(:)*qhlmlr(:)/xdn(:,lhl) +! vhlsoak(:) = 0.0 + + ENDIF ! mixedphase + + + +! +! Graupel reflectivity +! + if (ndebug .gt. 0 .and. my_rank>=0 ) write(0,*) my_rank, 'graupel reflectivity' + + do mgs = 1,ngscnt + +! zhmlr(mgs) = 0.0 +! zhshr(mgs) = 0.0 +! zhmlrr(mgs) = 0.0 +! zhshrr(mgs) = 0.0 + zhdsv(mgs) = 0.0 +! IF ( lf < 1 ) THEN + IF ( ffrzh > 0.0 ) THEN + ziacr(mgs) = 0.0 + ziacrf(mgs) = 0.0 + ENDIF +! ENDIF + zhcns(mgs) = 0.0 + zhcni(mgs) = 0.0 + zhacs(mgs) = 0.0 + zhaci(mgs) = 0.0 + + ENDDO + + IF ( lzh .gt. 1 ) THEN ! + do mgs = 1,ngscnt + + + IF ( qx(mgs,lh) .gt. qxmin(lh) .and. cx(mgs,lh) .gt. 0.0 ) THEN + tmp = qx(mgs,lh)/cx(mgs,lh) + alp = Max( alphamin, alpha(mgs,lh) ) +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + g1 = g1x(mgs,lh) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) +! g1r = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + + zhaci(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( tmp ) * qhaci(mgs) ) + zhacs(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( tmp ) * qhacs(mgs) ) + + IF ( .not. mixedphase .and. ibinhmlr < 1 ) THEN + zhmlr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*tmp * qhmlr(mgs) - tmp**2 * chmlr(mgs) ) + ENDIF + + zhshr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*tmp * qhshr(mgs) - tmp**2 * chshr(mgs) ) + +! IF ( lzr > 0 .and. qhshr(mgs) /= 0.0 .and. chshrr(mgs) /= 0.0 .and. ibinhmlr < 1 ) THEN + IF ( lzr > 0 .and. qhshr(mgs) /= 0.0 .and. chshrr(mgs) /= 0.0 ) THEN +! IF ( temg(mgs) > tfr + 2.0 ) THEN +! zhshrr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( 2.*tmp * qhshr(mgs) - tmp**2 * chshrr(mgs) ) +! IF ( zhshrr(mgs) > 0. ) THEN +! zhshrr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( 2.*tmp * qhshr(mgs) - tmp**2 * chshr(mgs) ) +! ENDIF +! z1 = g1shr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhshr(mgs)**2/ chshrr(mgs) ) ! should this be g1shr? +! zhshrr(mgs) = Max( z1, zhshrr(mgs)) +! ELSE +! zhshrr(mgs) = g1shr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhshr(mgs)**2/ chshrr(mgs) ) + + + IF ( temg(mgs) >= tfr ) THEN + ! zhshrr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn0(lr)))**2*( 2.*tmp * qhshr(mgs) - tmp**2 * chshrr(mgs) ) + ! IF ( zhshrr(mgs) > 0.0 ) THEN + ! zhshrr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn0(lr)))**2*( 2.*tmp * qhshr(mgs) - tmp**2 * chshr(mgs) ) + ! ENDIF + IF ( (shedalp + alpha(mgs,lh))*xdia(mgs,lh,1) < sheddiam ) THEN ! if not shedding small drops, then use alpha of hail + z1 = g1*(6.0*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhshr(mgs)**2/ chshrr(mgs) ) + ELSE + z1 = g1shr*(6.0*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhshr(mgs)**2/ chshrr(mgs) ) ! should this be g1shr? + ENDIF + zhshrr(mgs) = z1 +! z1 = g1mlr*(rho0(mgs)/(xdn(mgs,lr)))**2*( qhshr(mgs)**2/ chshrr(mgs) ) ! should this be g1shr? +! zhshrr(mgs) = Max( z1, zhshrr(mgs)) + ELSE + zhshrr(mgs) = g1shr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhshr(mgs)**2/ chshrr(mgs) ) + ENDIF + + zhshrr(mgs) = Min( 0.0, zhshrr(mgs) ) + ENDIF + + IF ( zhshr(mgs) > 0.0 ) THEN + write(0,*) 'Problem with zhshr! zhshr,qhshr,chshr = ',zhshr(mgs),qhshr(mgs),chshr(mgs) + write(0,*) 'g1,tmp, qx,cx,zx = ',g1,tmp,qx(mgs,lh),cx(mgs,lh),zx(mgs,lh) + write(0,*) ( 2.*tmp * qhshr(mgs) - tmp**2 * chshr(mgs) ), 2.*tmp * qhshr(mgs), - tmp**2 * chshr(mgs) + write(0,*) 'temcg = ',temcg(mgs),'chshr recalc = ',(cx(mgs,lh)/(qx(mgs,lh)+1.e-20))*qhshr(mgs) + + STOP + ENDIF + + +! zhshr(mgs) = (xdn0(lr)/(xdn(mgs,lh)))**2*( zx(mgs,lh) * qhshr(mgs) ) + + qtmp = qhdpv(mgs) + qhcev(mgs) + ctmp = chdpv(mgs) + chcev(mgs) + + zhdsv(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( tmp ) * qtmp - tmp**2 * ctmp ) + + alp = Max( alphahacx, alpha(mgs,lh) ) +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + g1 = g1x(mgs,lh) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + + IF ( .true. ) THEN ! { + IF ( qhacr(mgs) .gt. 0.0 ) THEN +! zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( qx(mgs,lh)/cx(mgs,lh)) * qhacr(mgs) ) + +! g1r = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) +! zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( qx(mgs,lh)/cx(mgs,lh)) * qhacr(mgs) ) + zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( qx(mgs,lh)/cx(mgs,lh)) * qhacr(mgs) ) +! zhacrf(mgs) = g1*zhacr + + +! z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( (qx(mgs,lh)+dtp*qhacr(mgs))**2)/(cx(mgs,lh)) + + IF ( z > zx(mgs,lh) ) THEN +! zhacr(mgs) = (z - zx(mgs,lh))*dtpinv + ELSE +! zhacr(mgs) = 0.0 + ENDIF + ENDIF + +! zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( tmp ) * qhacr(mgs) ) +! zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( tmp ) * qhacr(mgs) - tmp**2 * chacr(mgs) ) + +! alp = Max( 1.0, alpha(mgs,lh)+1. ) +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/ +! : ((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + IF ( qhacw(mgs) .gt. 0.0 ) THEN +! zhacw(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( qx(mgs,lh)/cx(mgs,lh)) * qhacw(mgs) ) + zhacw(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( qx(mgs,lh)/cx(mgs,lh)) * qhacw(mgs) ) + +! z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( (qx(mgs,lh)+dtp*(qhacw(mgs)-qhmul1(mgs)))**2)/(cx(mgs,lh)) + IF ( z > zx(mgs,lh) ) THEN +! zhacw(mgs) = (z - zx(mgs,lh))*dtpinv + ENDIF + ENDIF + + ELSE ! } { ! this is not used because of the 'true' above + + IF ( qhacw(mgs) .gt. 0.0 .or. qhacr(mgs) .gt. 0.0 ) THEN + z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( (qx(mgs,lh)+dtp*(qhacr(mgs) + qhacw(mgs)-qhmul1(mgs)))**2)/(cx(mgs,lh)) +! zhacw(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( qx(mgs,lh)/cx(mgs,lh)) * qhacw(mgs) ) + IF ( z > zx(mgs,lh) ) THEN + zhacw(mgs) = (z - zx(mgs,lh))*dtpinv + ENDIF + ENDIF + + ENDIF ! } + + IF ( qhlcnh(mgs) .gt. 0.0 .and. ihlcnh < 2 ) THEN + zhlcnh(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( tmp ) * qhlcnh(mgs) - tmp**2 * chlcnh(mgs) ) + ENDIF + ENDIF +! qsplinter(mgs) + IF ( ffrzh*qiacrf(mgs) .gt. 0.0 .and. cx(mgs,lr) .gt. 0.0 .and. qx(mgs,lr) .gt. qxmin(lr) ) THEN + tmp = qx(mgs,lr)/cx(mgs,lr) +! alp = 3.0 +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + IF ( imurain == 3 ) THEN + ! note that 3.6476 = (6/pi)**2 + ziacr(mgs) = 3.6476*rho0(mgs)**2*(alpha(mgs,lr)+2.)/(xdn0(lr)**2*(alpha(mgs,lr)+1.))* & + & ( 2.*tmp * qiacrf(mgs) - tmp**2 * ciacrf(mgs) ) + ELSE ! imurain == 1 + ziacr(mgs) = 3.6476*rho0(mgs)**2*g1x(mgs,lr)/(xdn0(lr)**2)* & + & ( 2.*tmp * qiacrf(mgs) - tmp**2 * ciacrf(mgs) ) + ENDIF + ziacr(mgs) = Min( ziacr(mgs), zxmxd(mgs,lr) ) +! ziacrf(mgs) = (xdn(mgs,lr)/xdn(mgs,lh))**2 * ziacr(mgs) + ziacrf(mgs) = (xdn(mgs,lr)/xdnmx(lh))**2 * ziacr(mgs) +! z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*tmp * (qiacrf(mgs) - qsplinter(mgs)) - tmp**2 * ciacrf(mgs) ) +! ziacrf(mgs) = Min( ziacrf(mgs), z ) + ENDIF + + + + IF ( ffrzh*qrfrzf(mgs) .gt. 0.0 .and. cx(mgs,lr) .gt. 0.0 ) THEN + tmp = qx(mgs,lr)/cx(mgs,lr) +! alp = 3.0 +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + IF ( imurain == 3 ) THEN + zrfrz(mgs) = 3.6476*rho0(mgs)**2*(alpha(mgs,lr)+2.)/(xdn0(lr)**2*(alpha(mgs,lr)+1.)) * & + & ( 2.*tmp * qrfrzf(mgs) - tmp**2 * crfrzf(mgs) ) + zrfrzf(mgs) = (xdn(mgs,lr)/xdn(mgs,lh))**2 * zrfrz(mgs) + ELSEIF ( imurain == 1 .and. ibiggopt /= 2 ) THEN +! zrfrz(mgs) = 3.6476*rho0(mgs)**2*g1x(mgs,lr)/(xdn0(lr)**2) * & +! & ( 2.*tmp * qrfrzf(mgs) - tmp**2 * crfrz(mgs) ) + zrfrz(mgs) = 3.6476*rho0(mgs)**2*g1x(mgs,lr)/(xdn0(lr)**2) * & + & ( 2.*tmp * qrfrz(mgs) - tmp**2 * crfrz(mgs) ) + zrfrzf(mgs) = 3.6476*rho0(mgs)**2*g1x(mgs,lr)/(rhofrz**2) * & + & ( 2.*tmp * qrfrzf(mgs) - tmp**2 * crfrzf(mgs) ) + ENDIF + zrfrz(mgs) = Min( zrfrz(mgs), Max(0.4,qrfrz(mgs)/qx(mgs,lr))*zx(mgs,lr)*dtpinv ) +! zrfrzf(mgs) = (xdn(mgs,lr)/xdn(mgs,lh))**2 * zrfrz(mgs) +! zrfrzf(mgs) = (xdn(mgs,lr)/xdnmx(lh))**2 * zrfrz(mgs) +! z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*tmp * (qrfrzf(mgs)-qsplinter2(mgs)) - tmp**2 * crfrzf(mgs) ) +! zrfrzf(mgs) = Min( zrfrzf(mgs), z ) + ! change this to be alpha=0? + ENDIF + + IF ( lhl > 1 .and. qhcnhl(mgs) .gt. 0.0 ) THEN + tmp = qx(mgs,lhl)/cx(mgs,lhl) + zhcnhl(mgs) = g1x(mgs,lhl)*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*( tmp ) * qhcnhl(mgs) - tmp**2 * chcnhl(mgs) ) + + ENDIF + + IF ( qhcns(mgs) > 0.0 .and. chcns(mgs) > 0.0 .and. cx(mgs,ls) > cxmin .and. vhcns(mgs) > 0 ) THEN + tmp = qx(mgs,ls)/cx(mgs,ls) + r = rho0(mgs)*qhcns(mgs)/vhcns(mgs) ! density of new graupel particles + IF ( imusnow == 3 ) THEN + zhcns(mgs) = 3.6476*rho0(mgs)**2*(alpha(mgs,ls)+2.)/(r**2*(alpha(mgs,ls)+1.)) * & + & ( 2.*tmp * qhcns(mgs) - tmp**2 * chcns(mgs) ) + ELSE + write(0,*) 'Value of imusnow not valid. Must be 3 (fix me for =1). imusnow = ',imusnow + STOP + ENDIF + ENDIF + + IF ( qhcni(mgs) > 0.0 .and. chcni(mgs) > 0.0 .and. cx(mgs,li) > cxmin .and. vhcni(mgs) > 0 ) THEN + tmp = qx(mgs,li)/cx(mgs,li) + r = rho0(mgs)*qhcni(mgs)/vhcni(mgs) ! density of new graupel particles + zhcni(mgs) = 3.6476*rho0(mgs)**2*(alpha(mgs,li)+2.)/(r**2*(alpha(mgs,li)+1.)) * & + & ( 2.*tmp * qhcni(mgs) - tmp**2 * chcni(mgs) ) + ENDIF + + + pzhwi(mgs) = & + & +ifrzg*ffrzh*(zrfrzf(mgs) & + & +il5(mgs)*ifiacrg*(ziacrf(mgs) ) ) & +! : + zhcnsh(mgs) + zhcnih(mgs) & + & + zhacw(mgs) & + & + zhacr(mgs) & + & + zhcnhl(mgs) & + & + zhacs(mgs) & + & + zhaci(mgs) & + & + f2h*zhcni(mgs) + f2h*zhcns(mgs) & + & + Max( 0.0, zhdsv(mgs) ) + + pzhwd(mgs) = 0.0 & + & + (1-il5(mgs))*zhmlr(mgs) & + & + zhshr(mgs) & +! > + il5(mgs)*chsbv(mgs) & + & + Min( 0.0, zhdsv(mgs) ) & + & - il5(mgs)*zhlcnh(mgs) + + + IF ( igs(mgs) == 44 .and. kgs(mgs) == 23 .or. dtp*( pqhwi(mgs) + pqhwd(mgs) ) > qxmin(lh) ) THEN +! write(0,*) 'i,k,time = ',igs(mgs),kgs(mgs),time_real +! write(0,*) 'pzhwi,d = ',pzhwi(mgs),pzhwd(mgs),dtp*( pzhwi(mgs) + pzhwd(mgs) ),zx(mgs,lh) +! write(0,*) 'pqhwi,d = ',pqhwi(mgs),pqhwd(mgs),dtp*( pqhwi(mgs) + pqhwd(mgs) ),qx(mgs,lh) +! write(0,*) 'pchwi,d = ',pchwi(mgs),pchwd(mgs),dtp*( pchwi(mgs) + pchwd(mgs) ),cx(mgs,lh) + ENDIF + + +! IF ( zhcnhl(mgs) < 0.0 ) THEN +! write(0,*) 'Problem with zhcnhl! zhcnhl,qhcnhl,chcnhl = ',zhcnhl(mgs),qhcnhl(mgs),chcnhl(mgs) +! write(0,*) 'g1,tmp = ',g1x(mgs,lhl),tmp +! write(0,*) ( 2.*( tmp ) * qhcnhl(mgs) - tmp**2 * chcnhl(mgs) ) +! +!! STOP +! ENDIF + end do + + if (ndebug .gt. 0 .and. my_rank>=0 ) write(0,*) my_rank, 'end graupel reflectivity' + + ENDIF + +! +! Hail reflectivity +! + + do mgs = 1,ngscnt + + zhldsv(mgs) = 0.0 + zhlacr(mgs) = 0.0 + zhlacw(mgs) = 0.0 + + ENDDO + + IF ( lzhl .gt. 1 .or. ( lzr > 1 .and. lnhl > 1 ) ) THEN ! also run for 2-moment hail for 3-moment rain sources + + if (ndebug .gt. 0 .and. my_rank>=0 ) write(0,*) my_rank, 'hail reflectivity' + + do mgs = 1,ngscnt + + IF ( qx(mgs,lhl) .gt. qxmin(lhl) .and. cx(mgs,lhl) .gt. 0.0 ) THEN + tmp = qx(mgs,lhl)/cx(mgs,lhl) + alp = Max( alphamin, alpha(mgs,lhl) ) +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + g1 = g1x(mgs,lhl) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + + IF ( .not. mixedphase .and. qhlmlr(mgs) /= 0.0 .and. chlmlr(mgs) /= 0.0 .and. ibinhlmlr < 1 ) THEN + zhlmlr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*tmp * qhlmlr(mgs) - tmp**2 * chlmlr(mgs) ) + ENDIF + + zhlshr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*tmp * qhlshr(mgs) - tmp**2 * chlshr(mgs) ) + IF ( lzr > 1 .and. qhlshr(mgs) /= 0.0 .and. chlshrr(mgs) /= 0.0 ) THEN + IF ( temg(mgs) >= tfr ) THEN + ! zhlshrr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn0(lr)))**2*( 2.*tmp * qhlshr(mgs) - tmp**2 * chlshrr(mgs) ) + ! IF ( zhlshrr(mgs) > 0.0 ) THEN + ! zhlshrr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn0(lr)))**2*( 2.*tmp * qhlshr(mgs) - tmp**2 * chlshr(mgs) ) + ! ENDIF + IF ( (shedalp + alpha(mgs,lhl))*xdia(mgs,lhl,1) < sheddiam ) THEN ! if not shedding small drops, then use alpha of hail + z1 = g1*(6.0*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhlshr(mgs)**2/ chlshrr(mgs) ) + ELSE + z1 = g1shr*(6.0*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhlshr(mgs)**2/ chlshrr(mgs) ) ! should this be g1shr? + ENDIF + zhlshrr(mgs) = z1 +! z1 = g1mlr*(rho0(mgs)/(xdn(mgs,lr)))**2*( qhlshr(mgs)**2/ chlshrr(mgs) ) ! should this be g1shr? +! zhlshrr(mgs) = Max( z1, zhlshrr(mgs)) + ELSE + zhlshrr(mgs) = g1shr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhlshr(mgs)**2/ chlshrr(mgs) ) + ENDIF + + zhlshrr(mgs) = Min( 0.0, zhlshrr(mgs) ) + ENDIF + + IF ( zhlshr(mgs) > 0.0 ) THEN + write(0,*) 'Problem with zhlshr! zhlshr,qhlshr,chlshr = ',zhlshr(mgs),qhlshr(mgs),chlshr(mgs) + write(0,*) 'g1,tmp, qx,cx,zx = ',g1,tmp,qx(mgs,lhl),cx(mgs,lhl),zx(mgs,lhl) + write(0,*) ( 2.*tmp * qhlshr(mgs) - tmp**2 * chlshr(mgs) ), 2.*tmp * qhlshr(mgs), - tmp**2 * chlshr(mgs) + write(0,*) 'temcg = ',temcg(mgs),'chlshr recalc = ',(cx(mgs,lhl)/(qx(mgs,lhl)+1.e-20))*qhlshr(mgs) + + STOP + ENDIF +! zhlshr(mgs) = Min( 0.0, zhlshr(mgs) ) + +! zhlshr(mgs) = (xdn0(lr)/(xdn(mgs,lhl)))**2*( zx(mgs,lhl) * qhlshr(mgs) ) + + qtmp = qhldpv(mgs) + qhlcev(mgs) + ctmp = chldpv(mgs) + chlcev(mgs) + + zhldsv(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*( tmp ) * qtmp - tmp**2 * ctmp ) + + alp = Max( alphahacx, alpha(mgs,lhl) ) +! g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + g1 = g1x(mgs,lhl) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + + IF ( .true. ) THEN ! { + IF ( qhlacr(mgs) .gt. 0.0 ) THEN +! z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( (qx(mgs,lhl)+dtp*qhlacr(mgs))**2)/(cx(mgs,lhl)) + zhlacr(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*( tmp ) * qhlacr(mgs) ) +! zhlacr(mgs) = Min( zxmxd(mgs,lr), zhlacr(mgs) ) + +! IF ( z > zx(mgs,lhl) ) THEN +! zhlacr(mgs) = (z - zx(mgs,lhl))*dtpinv +! ELSE +! zhlacr(mgs) = 0.0 +! ENDIF + ENDIF + +! zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( tmp ) * qhacr(mgs) ) +! zhacr(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( tmp ) * qhacr(mgs) - tmp**2 * chacr(mgs) ) + + IF ( qhlacw(mgs) .gt. 0.0 ) THEN + alp = Max( 3.0, alpha(mgs,lhl)+1. ) + g1 = (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + +! z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( (qx(mgs,lhl)+dtp*(qhlacw(mgs)-qhlmul1(mgs)))**2)/(cx(mgs,lhl)) +! zhlacw(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( qx(mgs,lhl)/cx(mgs,lhl)) * qhlacw(mgs) ) + zhlacw(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*tmp * qhlacw(mgs) ) + +! IF ( z > zx(mgs,lhl) ) THEN +! zhlacw(mgs) = (z - zx(mgs,lhl))*dtpinv +! ENDIF + g1 = g1x(mgs,lhl) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) + ENDIF + + ELSE ! } .false. { + + IF ( qhlacw(mgs) .gt. 0.0 .or. qhlacr(mgs) .gt. 0.0 ) THEN + z = g1*(6.*rho0(mgs)/(pi*1000.))**2*( (qx(mgs,lhl)+dtp*(qhlacr(mgs) + qhlacw(mgs)-qhlmul1(mgs)))**2)/(cx(mgs,lhl)) +! zhlacw(mgs) = g1*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*( qx(mgs,lhl)/cx(mgs,lhl)) * qhlacw(mgs) ) + IF ( z > zx(mgs,lhl) ) THEN + zhlacw(mgs) = (z - zx(mgs,lhl))*dtpinv + ENDIF + ENDIF + + ENDIF ! } + + ENDIF +! qsplinter(mgs) + + IF ( lzhl > 1 ) THEN + pzhli(mgs) = ffrzh*(((1.0-ifrzg)*zrfrzf(mgs) & + & +il5(mgs)*(1.0-ifiacrg)*ziacrf(mgs) )) & + & + il5(mgs)*zhlcnh(mgs) & + & + zhlacw(mgs) & + & + zhlacr(mgs) & +! : + zhlacs(mgs) & + & + Max( 0.0, zhldsv(mgs) ) + + pzhld(mgs) = 0.0 & + & + (1-il5(mgs))*zhlmlr(mgs) & + & + zhlshr(mgs) & + & - zhcnhl(mgs) & + & + Min( 0.0, zhldsv(mgs) ) + + + IF ( .not. ( -1.0 < pzhli(mgs) .and. pzhli(mgs) < 1.e20 ) ) THEN + write(iunit,*) 'Problem with pzhli!' + write(iunit,*) 'zhlcnh,zhlacw,zhlacr,zhldsv = ',zhlcnh(mgs),zhlacw(mgs),zhlacr(mgs),zhldsv(mgs) + ENDIF + + IF ( .not. ( -1.0e20 < pzhld(mgs) .and. pzhld(mgs) < 1. ) ) THEN + write(iunit,*) 'Problem with pzhld!' + write(iunit,*) 'zhlmlr,zhlshr,zhldsv = ',zhlmlr(mgs),zhlshr(mgs),zhldsv(mgs) + ENDIF + + ENDIF ! lzhl > 1 + + end do + + ENDIF + +! +! rain reflectivity +! + if (ndebug .gt. 0 ) write(0,*) 'WARMZIEG: dbg = 11' + + IF ( lzr .gt. 1 ) THEN ! + + DO mgs = 1,ngscnt + + zracw(mgs) = 0.0 + zracr(mgs) = 0.0 + zrcev(mgs) = 0.0 + zrach(mgs) = 0.0 + zrachl(mgs) = 0.0 + zsshr(mgs) = 0.0 + zsshrr(mgs) = 0.0 + zsmlr(mgs) = 0.0 + zsmlrr(mgs) = 0.0 + + IF ( qx(mgs,ls) .gt. qxmin(ls) .and. ( csmlr(mgs) /= 0.0 .or. csshr(mgs) /= 0.0 .or. & + csmlrr(mgs) /= 0.0 .or. csshrr(mgs) /= 0.0) ) THEN !{ + tmp = qx(mgs,ls)/cx(mgs,ls) + g1 = 36.*(xnu(ls)+2.0)/((xnu(ls)+1.0)*pi**2) + IF ( .not. mixedphase ) THEN + zsmlr(mgs) = (xdn(mgs,ls)/xdn(mgs,lr))**2*g1*(rho0(mgs)/(xdn(mgs,ls)))**2* & + & ( 2.*tmp * qsmlr(mgs) - tmp**2 * csmlr(mgs) ) + + IF ( csmlrr(mgs) /= 0.0 ) THEN + z1 = g1smlr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qsmlr(mgs)**2/ csmlrr(mgs) ) + zsmlrr(mgs) = z1 + ENDIF + ENDIF + +! zsshr(mgs) = (xdn(mgs,ls)/xdn(mgs,lr))**2*g1*(rho0(mgs)/(xdn(mgs,ls)))**2* & +! & ( 2.*tmp * qsshr(mgs) - tmp**2 * csshr(mgs) ) + + IF ( csshrr(mgs) /= 0.0 ) THEN + z1 = g1smlr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qsshr(mgs)**2/ csshrr(mgs) ) + zsshrr(mgs) = z1 + ENDIF + + ENDIF !} + + IF ( .not. mixedphase ) THEN !{ + IF ( zhmlr(mgs) < 0.0 .and. chmlrr(mgs) /= 0.0 .and. ibinhmlr == 0 ) THEN !{ + tmp = qx(mgs,lh)/cx(mgs,lh) +! zhmlrr(mgs) = Min(0.0, (xdn(mgs,lh)/xdn(mgs,lr))**2 * & +! & g1x(mgs,lh)*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*tmp * qhmlr(mgs) - tmp**2 * chmlrr(mgs) ) ) + +! IF ( zhmlrr(mgs) >= 0. ) THEN +! zhmlrr(mgs) = (xdn(mgs,lh)/xdn(mgs,lr))**2 * zhmlr(mgs) +! ENDIF + IF ( (shedalp + alpha(mgs,lh))*xdia(mgs,lh,1) < sheddiam ) THEN ! if not shedding small drops, then use alpha of graupel + z1 = g1x(mgs,lh)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhmlr(mgs)**2/ chmlrr(mgs) ) + ELSE ! assume drops are shed off, so use either alpha for shedding or graupel alpha, whichever gives the lower g-factor (i.e., larger alpha) + z1 = Min(g1x(mgs,lh),g1shr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhmlr(mgs)**2/ chmlrr(mgs) ) + ENDIF + zhmlrr(mgs) = z1 +! z1 = g1mlr*(rho0(mgs)/(xdn(mgs,lr)))**2*( qhmlr(mgs)**2/ chmlrr(mgs) ) +! zhmlrr(mgs) = Max( z1, zhmlrr(mgs)) + ENDIF !} + + +! zhshrr(mgs) = (xdn(mgs,lh)/xdn(mgs,lr))**2 * zhshr(mgs) + + IF ( lhl > 1 .and. qhlmlr(mgs) /= 0 .and. ibinhlmlr == 0) THEN + tmp = qx(mgs,lhl)/cx(mgs,lhl) +! zhlmlrr(mgs) = Min(0.0, (xdn(mgs,lhl)/xdn(mgs,lr))**2 * & +! & g1x(mgs,lhl)*(6.*rho0(mgs)/(pi*xdn(mgs,lhl)))**2*( 2.*tmp * qhlmlr(mgs) - tmp**2 * chlmlrr(mgs) ) ) + +! IF ( zhlmlrr(mgs) >= 0. ) THEN ! should be negative, if not, then use alternate calculation +! zhlmlrr(mgs) = (xdn(mgs,lhl)/xdn(mgs,lr))**2 * zhlmlr(mgs) +! ENDIF + + IF ( (shedalp + alpha(mgs,lhl))*xdia(mgs,lhl,1) < sheddiam ) THEN ! if not shedding small drops, then use alpha of hail + z1 = g1x(mgs,lhl)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhlmlr(mgs)**2/ chlmlrr(mgs) ) + ELSE ! assume drops are shed off, so use either alpha for shedding or graupel alpha, whichever gives the lower g-factor (i.e., larger alpha) + z1 = Min(g1x(mgs,lhl),g1shr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhlmlr(mgs)**2/ chlmlrr(mgs) ) +! z1 = g1shr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qhlmlr(mgs)**2/ chlmlrr(mgs) ) + ENDIF + zhlmlrr(mgs) = z1 + +! z1 = g1mlr*(rho0(mgs)/(xdn(mgs,lr)))**2*( qhlmlr(mgs)**2/ chlmlrr(mgs) ) +! zhlmlrr(mgs) = Max( z1, zhlmlrr(mgs)) +! zhlmlr(mgs) = +! zhlshrr(mgs) = (xdn(mgs,lhl)/xdn(mgs,lr))**2 * zhlshr(mgs) + ENDIF + + ENDIF ! } + + IF ( qx(mgs,lr) .gt. qxmin(lr) .and. cx(mgs,lr) .gt. 0.0 ) THEN + + tmp = qx(mgs,lr)/cx(mgs,lr) + g1 = g1x(mgs,lr) ! 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + + + IF ( qracw(mgs) > 0.0 .and. cx(mgs,lr) > 0.0 ) THEN + zracw(mgs) = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*1000.))**2*( 2.*tmp * qracw(mgs) ) + ENDIF + + IF ( cracr(mgs) > 0.0 .and. cx(mgs,lr) > 0.0 ) THEN + zracr(mgs) = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*1000.))**2*( tmp**2 * cracr(mgs) ) + ENDIF + + qtmp = qrcev(mgs) + ctmp = crcev(mgs) + +! IF ( .false. .or. iferwisventr == 2 ) THEN +! zrcev(mgs) = Min(0.0, (12./(pii*xdn(mgs,lr)))*xdia(mgs,lr,1)**3*fvce(mgs)*rwcap(mgs)*rwventz(mgs) ) +! ELSE + zrcev(mgs) = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( 2.*( tmp ) * qtmp - tmp**2 * ctmp ) + + + IF ( iferwisventr == 2 ) THEN + vent1 = Min(0.0, (12./(pii*xdn(mgs,lr)))*xdia(mgs,lr,1)**3*fvce(mgs)*rwcap(mgs)*rwventz(mgs)) + zrcev(mgs) = Max( zrcev(mgs), vent1 ) + ENDIF +! IF ( ny == 2 .and. igs(mgs) == 20 ) THEN +! write(0,*) 'k,zrcevold,new,maxdep : ',kgs(mgs),zrcev(mgs),vent1,-zxmxd(mgs,lr),alpha(mgs,lr),cx(mgs,lr) +! ENDIF + + +! ENDIF + zrcev(mgs) = Max( zrcev(mgs), -zxmxd(mgs,lr) ) - ELSEIF ( warmonly < 0.8 ) THEN -! -! Graupel -! - do mgs = 1,ngscnt - pqhwi(mgs) = & - & +il5(mgs)*ifrzg*(qrfrzf(mgs) ) & - & +il5(mgs)*(qhdpv(mgs)) & - & +qhacr(mgs)+qhacw(mgs) - pqhwd(mgs) = & - & qhshr(mgs) & !null at this point when wet graupel included - & - qhlcnh(mgs) & - & - qhmul1(mgs) & - & - qsplinter(mgs) - qsplinter2(mgs) & - & +(1-il5(mgs))*qhmlr(mgs) !null at this point when wet graupel included - end do + IF ( qhacr(mgs) > 0.0 ) THEN + zrach(mgs) = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2* & + & ( 2.*( qx(mgs,lr)/cx(mgs,lr)) * qhacr(mgs) - tmp**2 * chacr(mgs) ) + zrach(mgs) = Min( zrach(mgs), zxmxd(mgs,lr) ) + + ENDIF -! -! Hail -! - IF ( lhl .gt. 1 ) THEN + IF ( lhl > 1 .and. qhlacr(mgs) > 0.0 ) THEN + zrachl(mgs) = g1x(mgs,lr)*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2* & + & ( 2.*( qx(mgs,lr)/cx(mgs,lr)) * qhlacr(mgs) - tmp**2 * chlacr(mgs) ) + zrachl(mgs) = Min( zrachl(mgs), zxmxd(mgs,lr) ) + ENDIF - do mgs = 1,ngscnt - pqhli(mgs) = & - & +il5(mgs)*(qhldpv(mgs) ) & ! + (1.0-ifrzg)*(qiacrf(mgs)+qrfrzf(mgs) + qracif(mgs))) & - & +il5(mgs)*(1.0-ifrzg)*(qrfrzf(mgs) ) & - & +qhlacr(mgs)+qhlacw(mgs) & -! & +qhlacs(mgs)+qhlaci(mgs) & - & + qhlcnh(mgs) - pqhld(mgs) = & - & qhlshr(mgs) & - & +(1-il5(mgs))*qhlmlr(mgs) & -! > +il5(mgs)*qhlsbv(mgs) & - & + qhlsbv(mgs) & - & -qhlmul1(mgs) - qhcnhl(mgs) - end do + + ENDIF - ENDIF ! lhl + pzrwi(mgs) = zrcnw(mgs) + zracw(mgs) + zracr(mgs) & + & + Max( 0.,zrcev(mgs) ) & + & - (1-il5(mgs))*zsmlrr(mgs) & + & - zsshrr(mgs) & + & - (1-il5(mgs))*zhmlrr(mgs) & + & - zhshrr(mgs) & + & - (1-il5(mgs))*zhlmlrr(mgs) & + & - zhlshrr(mgs) - ENDIF ! warmonly -! -! Liquid water on snow and graupel -! + pzrwd(mgs) = 0.0 & + & + Min(0.,zrcev(mgs) ) & + & - zrach(mgs) & + & - zrachl(mgs) & + & - zrfrz(mgs) & + & - il5(mgs)*(ziacr(mgs) ) - vhmlr(:) = 0.0 - vhlmlr(:) = 0.0 - vhfzh(:) = 0.0 - vhlfzhl(:) = 0.0 - IF ( mixedphase ) THEN - ELSE ! set arrays for non-mixedphase graupel - -! vhshdr(:) = 0.0 - vhmlr(:) = qhmlr(:) ! not actually volume, but treated as q in rate equation -! vhsoak(:) = 0.0 + IF ( zx(mgs,lr) + dtp*(pzrwi(mgs)+pzrwd(mgs)) <= 0.0 & + .and. qx(mgs,lr) > qxmin(lr) ) THEN + pzrwd(mgs) = -zx(mgs,lr)*dtpinv - pzrwi(mgs) + ENDIF -! vhlshdr(:) = 0.0 - vhlmlr(:) = qhlmlr(:) ! not actually volume, but treated as q in rate equation -! vhlmlr(:) = rho0(:)*qhlmlr(:)/xdn(:,lhl) -! vhlsoak(:) = 0.0 + ENDDO - ENDIF ! mixedphase + ENDIF @@ -18678,6 +21897,33 @@ subroutine nssl_2mom_gs & ! > + rho0(mgs)*qhshr(mgs)/xdn(mgs,lh) !xdn(mgs,lr) ! ENDIF + IF ( lzh > 1 .and. qx(mgs,lh) > qxmin(lh) ) THEN +! Calculate change in reflectivity due to density changes + + xdn_new = rho0(mgs)*(qx(mgs,lh) + dtp*(pqhwi(mgs) + pqhwd(mgs) ))/ & + & (vx(mgs,lh) + dtp*(pvhwi(mgs) + pvhwd(mgs)) ) + + IF ( mixedphase ) THEN + IF ( qxw(mgs,lh) .gt. 0.0 ) THEN + dnmx = xdnmx(lr) + ELSE + dnmx = xdnmx(lh) + ENDIF + ELSE + dnmx = xdnmx(lh) + ENDIF + + xdn_new = Max( Min( xdn_new, dnmx ), xdnmn(lh) ) + + drhodt = (xdn_new - xdn(mgs,lh))*dtpinv + + zhwdn(mgs) = -2.*g1x(mgs,lh)*(rho0(mgs)*qx(mgs,lh)*6.*pii )**2/(cx(mgs,lh)*xdn(mgs,lh)**3)*drhodt + + pzhwi(mgs) = pzhwi(mgs) + Max(0.0, zhwdn(mgs)) + pzhwd(mgs) = pzhwd(mgs) + Min(0.0, zhwdn(mgs)) + + + ENDIF IF ( .false. .and. ny .eq. 2 .and. kgs(mgs) .eq. 9 .and. igs(mgs) .eq. 19 ) THEN write(iunit,*) @@ -18760,6 +22006,32 @@ subroutine nssl_2mom_gs & & + rho0(mgs)*(1-il5(mgs))*vhlmlr(mgs)/xdn(mgs,lhl) & & + vhlshdr(mgs) - vhlsoak(mgs) + IF ( lzhl > 1 .and. qx(mgs,lhl) > qxmin(lhl) ) THEN +! Calculate change in reflectivity due to density changes + + xdn_new = rho0(mgs)*(qx(mgs,lhl) + dtp*(pqhli(mgs) + pqhld(mgs) ))/ & + & (vx(mgs,lhl) + dtp*(pvhli(mgs) + pvhld(mgs)) ) + + IF ( mixedphase ) THEN + IF ( qxw(mgs,lhl) .gt. 0.0 ) THEN + dnmx = xdnmx(lr) + ELSE + dnmx = xdnmx(lhl) + ENDIF + ELSE + dnmx = xdnmx(lhl) + ENDIF + xdn_new = Max( Min( xdn_new, dnmx ), xdnmn(lhl) ) + + drhodt = (xdn_new - xdn(mgs,lhl))*dtpinv + + zhldn(mgs) = -2.*g1x(mgs,lhl)*(rho0(mgs)*qx(mgs,lhl)*6.*pii )**2/(cx(mgs,lhl)*xdn(mgs,lhl)**3)*drhodt + + pzhli(mgs) = pzhli(mgs) + Max(0.0, zhldn(mgs)) + pzhld(mgs) = pzhld(mgs) + Min(0.0, zhldn(mgs)) + + + ENDIF ENDDO @@ -18989,7 +22261,7 @@ subroutine nssl_2mom_gs & write(iunit,*) -qracs(mgs)*(1-il2(mgs)) , qhacs(mgs) , qhlacs(mgs) write(iunit,*) -qhcns(mgs) write(iunit,*) +(1-il5(mgs))*qsmlr(mgs) , qsshr(mgs) - write(iunit,*) (qssbv(mgs)) + write(iunit,*) qssbv(mgs) write(iunit,*) Min(0.0, qscev(mgs)) write(iunit,*) -qsmul(mgs) ! @@ -19061,33 +22333,37 @@ subroutine nssl_2mom_gs & IF ( warmonly < 0.5 ) THEN pfrz(mgs) = & & (1-il5(mgs))* & - & (qhmlr(mgs)+qsmlr(mgs)+qhlmlr(mgs)) & !+qhmlh(mgs)) & - & +il5(mgs)*(qhfzh(mgs)+qsfzs(mgs)+qhlfzhl(mgs)) & + & (qhmlr(mgs)+ & + & qsmlr(mgs)+qhlmlr(mgs)) & !+qhmlh(mgs)) & & +il5(mgs)*(1-imixedphase)*( & & qsacw(mgs)+qhacw(mgs) + qhlacw(mgs) & & +qsacr(mgs)+qhacr(mgs) + qhlacr(mgs) & & +qsshr(mgs) & & +qhshr(mgs) & - & +qhlshr(mgs) +qrfrz(mgs)+qiacr(mgs) & + & +qhlshr(mgs) & + & +qrfrz(mgs)+qiacr(mgs) & & ) & & +il5(mgs)*(qwfrz(mgs) & & +qwctfz(mgs)+qiihr(mgs) & & +qiacw(mgs)) pmlt(mgs) = & & (1-il5(mgs))* & - & (qhmlr(mgs)+qsmlr(mgs)+qhlmlr(mgs)) !+qhmlh(mgs)) + & (qhmlr(mgs)+qsmlr(mgs)+ & + & qhlmlr(mgs)) !+qhmlh(mgs)) ! NOTE: psub is sum of sublimation and deposition psub(mgs) = & & il5(mgs)*( & & + qsdpv(mgs) + qhdpv(mgs) & & + qhldpv(mgs) & & + qidpv(mgs) + qisbv(mgs) ) & - & + qssbv(mgs) + qhsbv(mgs) + qhlsbv(mgs) & + & + qssbv(mgs) + qhsbv(mgs) & + & + qhlsbv(mgs) & & +il5(mgs)*(qiint(mgs)) pvap(mgs) = & - & qrcev(mgs) + qhcev(mgs) + qscev(mgs) + qhlcev(mgs) + & qrcev(mgs) + qhcev(mgs) + qscev(mgs) + qhlcev(mgs) + qfcev(mgs) pevap(mgs) = & - & Min(0.0,qrcev(mgs)) + Min(0.0,qhcev(mgs)) + Min(0.0,qscev(mgs)) + Min(0.0,qhlcev(mgs)) + & Min(0.0,qrcev(mgs)) + Min(0.0,qhcev(mgs)) + Min(0.0,qscev(mgs)) + Min(0.0,qhlcev(mgs)) & + + Min(0.0,qfcev(mgs)) ! NOTE: pdep is the deposition part only pdep(mgs) = & & il5(mgs)*( & @@ -19115,7 +22391,7 @@ subroutine nssl_2mom_gs & & + qidpv(mgs) + qisbv(mgs) ) & & +il5(mgs)*(qiint(mgs)) pvap(mgs) = & - & qrcev(mgs) + qhcev(mgs) + qhlcev(mgs) ! + qscev(mgs) + & qrcev(mgs) + qhcev(mgs) + qhlcev(mgs) + qfcev(mgs) ELSE pfrz(mgs) = 0.0 psub(mgs) = 0.0 @@ -19143,6 +22419,8 @@ subroutine nssl_2mom_gs & ! ! do mgs = 1,ngscnt + + qwvp(mgs) = qwvp(mgs) + & & dtp*(pqwvi(mgs)+pqwvd(mgs)) qx(mgs,lc) = qx(mgs,lc) + & @@ -19155,6 +22433,7 @@ subroutine nssl_2mom_gs & & dtp*(pqswi(mgs)+pqswd(mgs)) qx(mgs,lh) = qx(mgs,lh) + & & dtp*(pqhwi(mgs)+pqhwd(mgs)) + IF ( lhl .gt. 1 ) THEN qx(mgs,lhl) = qx(mgs,lhl) + & & dtp*(pqhli(mgs)+pqhld(mgs)) @@ -19224,6 +22503,27 @@ subroutine nssl_2mom_gs & + ENDIF + ENDIF + IF ( ipconc .ge. 6 ) THEN + IF ( lzr .gt. 1 ) THEN + zx(mgs,lr) = zx(mgs,lr) + & + & dtp*(pzrwi(mgs)+pzrwd(mgs)) + ENDIF + IF ( lzs .gt. 1 ) THEN + zx(mgs,ls) = zx(mgs,ls) + & + & dtp*(pzswi(mgs)+pzswd(mgs)) + ENDIF + IF ( lzh .gt. 1 ) THEN + zx(mgs,lh) = zx(mgs,lh) + & + & dtp*(pzhwi(mgs)+pzhwd(mgs)) + ENDIF + IF ( lzhl .gt. 1 ) THEN + zx(mgs,lhl) = zx(mgs,lhl) + & + & dtp*(pzhli(mgs)+pzhld(mgs)) +! IF ( pchli(mgs) .ne. 0. .or. pchld(mgs) .ne. 0 ) THEN +! write(0,*) 'dr: cx,pchli,pchld = ', cx(mgs,lhl),pchli(mgs),pchld(mgs), igs(mgs),kgs(mgs) +! ENDIF ENDIF ENDIF end do @@ -19775,6 +23075,29 @@ subroutine nssl_2mom_gs & ENDIF + + + +! +! 6th moments +! + + IF ( ipconc .ge. 6 ) THEN + DO il = lr,lhab + IF ( lz(il) .gt. 1 ) THEN + IF ( lf > 1 .and. il == lf ) THEN + lfsave(mgs,3) = an(igs(mgs),jy,kgs(mgs),lz(il)) + lfsave(mgs,4) = zx(mgs,il) + ENDIF + + an(igs(mgs),jy,kgs(mgs),lz(il)) = zx(mgs,il) + & + & min( an(igs(mgs),jy,kgs(mgs),lz(il)), 0.0 ) + zx(mgs,il) = an(igs(mgs),jy,kgs(mgs),lz(il)) + + ENDIF + ENDDO + + ENDIF ! end do ! @@ -19839,6 +23162,447 @@ subroutine nssl_2mom_gs & ENDIF !} ENDDO ! mgs + ELSE ! } { is three-moment, so have to adjust Z if size is too large + IF ( il == lr .and. imurain == 3 ) THEN ! { { RAIN + +! rdmx = +! rdmn = + + DO mgs = 1,ngscnt + + + IF ( iresetmoments == 1 .or. iresetmoments == il ) THEN + IF ( zx(mgs,lr) <= zxmin ) THEN + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + qx(mgs,lr) = 0.0 + cx(mgs,lr) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),lr) + an(igs(mgs),jgs,kgs(mgs),lr) = qx(mgs,lr) + an(igs(mgs),jgs,kgs(mgs),ln(lr)) = cx(mgs,lr) + ELSEIF ( cx(mgs,lr) <= cxmin ) THEN + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + zx(mgs,lr) = 0.0 + qx(mgs,lr) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),lr) + an(igs(mgs),jgs,kgs(mgs),lr) = qx(mgs,lr) + an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) + ENDIF + ENDIF + + IF ( qx(mgs,lr) .gt. qxmin(lr) ) THEN + + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*Max(1.0e-11,cx(mgs,lr))) + IF ( xv(mgs,lr) .gt. xvmx(lr) ) THEN +! xv(mgs,lr) = xvmx(lr) +! cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmx(lr)*xdn(mgs,lr)) + ELSEIF ( xv(mgs,lr) .lt. xvmn(lr) ) THEN + xv(mgs,lr) = xvmn(lr) + cx(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xvmn(lr)*xdn(mgs,lr)) + ENDIF + + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! have mass and reflectivity but no concentration, so set concentration, using default alpha + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*xdn(mgs,lr)**2) +! an(igs(mgs),jgs,kgs(mgs),ln(il)) = zx(mgs,il) + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + chw = cx(mgs,il) + qr = qx(mgs,il) + zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(xdn(mgs,lr)**2*chw) + an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? + ! set values according to dBZ of -10, or Z = 0.1 +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + z = zx(mgs,il) + qr = qx(mgs,il) + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*1000.*1000) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ENDIF + + IF ( zx(mgs,lr) > 0.0 ) THEN + xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(1000.*cx(mgs,lr)) + vr = xv(mgs,lr) +! z = 36.*(alpha(kz)+2.0)*a(ix,jy,kz,lnr)*vr**2/((alpha(kz)+1.0)*pi**2) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z = zx(mgs,lr) + +! xv = (db(1,kz)*a(1,1,kz,lr))**2/(a(1,1,kz,lnr)) +! rd = z*(pi/6.*1000.)**2/xv + +! determine shape parameter alpha by iteration + IF ( z .gt. 0.0 ) THEN +! alpha(mgs,lr) = 3. + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. +! write(0,*) 'kz, alp, alpha(kz) = ',kz,alp,alpha(kz),rd,z,xv + DO i = 1,20 + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO + +! check for artificial breakup (rain larger than allowed max size) + IF ( xv(mgs,il) .gt. xvmx(il) .or. (ioldlimiter == 2 .and. xv(mgs,il) .gt. xvmx(il)/8.) ) THEN + tmp = cx(mgs,il) +! write(0,*) 'MY limiter: xv: ',xv(mgs,il), xv(mgs,il)/(xvmx(il)/8.) +! STOP + IF ( ioldlimiter == 2 ) THEN ! MY-style active breakup + x = (6.*rho0(mgs)*qx(mgs,il)/(pi*xdn(mgs,il)*cx(mgs,il)))**(1./3.) + x1 = Max(0.0e-3, x - 3.0e-3) + x2 = Max(0.5, x/6.0e-3) + x3 = x2**3 + cx(mgs,il) = cx(mgs,il)*Max((1.+2.222e3*x1**2), x3) + xv(mgs,il) = xv(mgs,il)/Max((1.+2.222e3*x1**2), x3) + ELSE ! simple cutoff + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + ENDIF + !xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + !cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + + + IF ( tmp < cx(mgs,il) ) THEN ! breakup + + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + vr = xv(mgs,lr) + qr = qx(mgs,lr) + nrx = cx(mgs,lr) + z = zx(mgs,lr) + + +! determine shape parameter alpha by iteration + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + DO i = 1,20 + IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT + alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) + alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. + alp = Max( rnumin, Min( rnumax, alp ) ) + ENDDO + + + ENDIF + ENDIF + +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! + g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) + IF ( .true. .and. (alpha(mgs,il) <= rnumin .or. alp == rnumin .or. alp == rnumax) ) THEN + + IF ( rescale_high_alpha .and. alp >= rnumax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(1./(xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( rescale_low_alphar .and. alp <= rnumin ) THEN + z = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) + zx(mgs,il) = z + an(igs(mgs),jy,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + ENDIF + + + + ENDIF + ENDIF + + ENDIF + + ENDDO +! CALL cld_cpu('Z-MOMENT-1r') + + + ELSEIF ( il == lh .or. il == lhl .or. il == lf .or. (il == lr .and. imurain == 1 )) THEN ! } { Rain, GRAUPEL OR HAIL + + + + DO mgs = 1,ngscnt + + IF ( lf > 1 .and. il == lf ) THEN + lfsave(mgs,5) = an(igs(mgs),jy,kgs(mgs),ln(il)) + lfsave(mgs,6) = cx(mgs,il) + ENDIF + + IF ( il == lhl .and. lnhlf > 1 ) THEN + IF ( cx(mgs,lhl) > cxmin ) THEN + frac = chxf(mgs,lhl)/cx(mgs,lhl) + ELSE + frac = 0.0 + ENDIF + ENDIF + + IF ( il == lh .and. lnhf > 1 ) THEN + IF ( cx(mgs,lh) > cxmin ) THEN + frach = chxf(mgs,lh)/cx(mgs,lh) + ELSE + frach = 0.0 + ENDIF + ENDIF + + + + IF ( iresetmoments == 1 .or. iresetmoments == il .or. iresetmoments == -1 ) THEN ! { .or. qx(mgs,il) <= qxmin(il) + IF ( zx(mgs,il) <= zxmin ) THEN ! .and. qx(mgs,il) > 0.05e-3 +!! write(91,*) 'zx=0; qx,cx = ',1000.*qx(mgs,il),cx(mgs,il) + qx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + ELSEIF ( iresetmoments == -1 .and. qx(mgs,il) < qxmin(il) ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( cx(mgs,il) <= cxmin .and. iresetmoments /= -1 ) THEN ! .and. qx(mgs,il) > 0.05e-3 + qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) + zx(mgs,il) = 0.0 + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + ELSE + IF ( zx(mgs,il) < 0.0 ) THEN ! .and. qx(mgs,il) > 0.05e-3 + zx(mgs,il) = 0.0 + ENDIF + ENDIF !} + + + IF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= cxmin ) THEN + zx(mgs,il) = 0.0 + cx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),lv) = an(igs(mgs),jgs,kgs(mgs),lv) + an(igs(mgs),jgs,kgs(mgs),il) + qx(mgs,il) = 0.0 + an(igs(mgs),jgs,kgs(mgs),il) = qx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + ENDIF + + IF ( qx(mgs,il) .gt. qxmin(il) ) THEN !{ + + xv(mgs,il) = rho0(mgs)*qx(mgs,il)/(xdn(mgs,il)*Max(1.0e-9,cx(mgs,il))) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + + IF ( xv(mgs,il) .lt. xvmn(il) ) THEN + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + ENDIF + + IF ( zx(mgs,il) > 0.0 .and. cx(mgs,il) <= 0.0 ) THEN !{ +! have mass and reflectivity but no concentration, so set concentration, using default alpha + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z = zx(mgs,il) + qr = qx(mgs,il) +! cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(z*(pi*xdn(mgs,il))**2) + + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN +! have mass and concentration but no reflectivity, so set reflectivity, using default alpha +! g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & +! & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + chw = cx(mgs,il) + qr = qx(mgs,il) +! zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw +! zx(mgs,il) = Min(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) + g1 = (6.0 + alphamax)*(5.0 + alphamax)*(4.0 + alphamax)/ & + & ((3.0 + alphamax)*(2.0 + alphamax)*(1.0 + alphamax)) + zx(mgs,il) = Max(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN +! How did this happen? + ! set values according to dBZ of -10, or Z = 0.1 +! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 + +! write(0,*) 'GS: moment problem! il,c,z,q = ',il,cx(mgs,il),zx(mgs,il),qx(mgs,il) + + zx(mgs,il) = 1.e-19/0.224*(xdn0(lr)/xdn0(il))**2 + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + z = zx(mgs,il) + qr = qx(mgs,il) +! cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(z*(pi*xdn(mgs,il))**2) + an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) + +! write(0,*) 'GS: moment problem! reset il,c,z,q = ',il,cx(mgs,il),zx(mgs,il),qx(mgs,il) + + ELSE + ! have all valid moments, so find shape parameter + chw = cx(mgs,il) + qr = qx(mgs,il) + z = zx(mgs,il) + + IF ( zx(mgs,il) .gt. 0. ) THEN !{ + +! rdi = z*(pi/6.*1000.)**2*chw/((rho0(mgs)*qr)**2) + rdi = z*(pi/6.*xdn(mgs,il))**2*chw/((rho0(mgs)*qr)**2) + +! alp = 1.e18*(6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ +! : ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + alp = (6.0+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 +! print*,'kz, alp, alpha(mgs,il) = ',kz,alp,alpha(mgs,il),rdi,z,xv + DO i = 1,10 +! IF ( 100.*Abs(alp - alpha(mgs,il))/(Abs(alpha(mgs,il))+1.e-5) .lt. 1. ) EXIT + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) +! alp = 1.e18*(6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ +! : ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 +! print*,'i,alp = ',i,alp + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + +! check for artificial breakup (graupel/hail larger than allowed max size) + IF ( xv(mgs,il) .gt. xvmx(il) ) THEN !{ + tmp = cx(mgs,il) + + + xv(mgs,il) = Min( xvmx(il), Max( xvmn(il),xv(mgs,il) ) ) + xmas(mgs,il) = xv(mgs,il)*xdn(mgs,il) + cx(mgs,il) = rho0(mgs)*qx(mgs,il)/(xmas(mgs,il)) + IF ( tmp < cx(mgs,il) ) THEN ! breakup + g1 = 36.*(6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))*pi**2) + zx(mgs,il) = zx(mgs,il) + g1*(rho0(mgs)/xdn(mgs,il))**2*( (qx(mgs,il)/tmp)**2 * (tmp-cx(mgs,il)) ) + an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) + + chw = cx(mgs,il) + qr = qx(mgs,il) + z = zx(mgs,il) + + rdi = z*(pi/6.*xdn(mgs,il))**2*chw/((rho0(mgs)*qr)**2) + alp = (6.0+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + DO i = 1,10 + IF ( Abs(alp - alpha(mgs,il)) .lt. 0.01 ) EXIT + alpha(mgs,il) = Max( alphamin, Min( alphamax, alp ) ) + alp = (6.+alpha(mgs,il))*(5.0+alpha(mgs,il))*(4.0+alpha(mgs,il))/ & + & ((3.0+alpha(mgs,il))*(2.0+alpha(mgs,il))*rdi) - 1.0 + alp = Max( alphamin, Min( alphamax, alp ) ) + ENDDO + + + ENDIF + ENDIF !} + +! +! Check whether the shape parameter is at or less than the minimum, and if it is, reset the +! concentration or reflectivity to match (prevents reflectivity from being out of balance with Q and N) +! + g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & + & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) + + IF ( ( lrescalelow(il) .or. rescale_high_alpha ) .and. & + & ( alpha(mgs,il) <= alphamin .or. alp == alphamin .or. alp == alphamax ) ) THEN !{ + + IF ( rescale_high_alpha .and. alp >= alphamax - 0.01 ) THEN ! reset c at high alpha to prevent growth in Z + cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(6./(pi*xdn(mgs,il)))**2 + an(igs(mgs),jy,kgs(mgs),ln(il)) = cx(mgs,il) + + ELSEIF ( lrescalelow(il) .and. alp <= alphamin .and. .not. (il == lh .and. icvhl2h > 0 ) .and. & + .not. ( il == lr .and. .not. rescale_low_alphar ) ) THEN ! alpha = alphamin, so reset Z to prevent growth in C + + wtest = .false. + IF ( irescalerainopt == 0 ) THEN + wtest = .false. + ELSEIF ( irescalerainopt == 1 ) THEN + wtest = qx(mgs,lc) > qxmin(lc) + ELSEIF ( irescalerainopt == 2 ) THEN + wtest = qx(mgs,lc) > qxmin(lc) .and. wvel(mgs) < rescale_wthresh + ELSEIF ( irescalerainopt == 3 ) THEN + wtest = temcg(mgs) > rescale_tempthresh .and. qx(mgs,lc) > qxmin(lc) .and. wvel(mgs) < rescale_wthresh + ENDIF + + IF ( il == lr .and. ( wtest .or. .not. rescale_low_alphar ) ) THEN + ! certain situations where rain number is adjusted instead of Z. Helps avoid rain being 'zapped' by autoconverted + ! drops (i.e., favor preserving Z when alpha tries to go negative) + chw = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z*(6./(pi*xdn(mgs,il)))**2 ! g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z1 + cx(mgs,il) = chw + an(igs(mgs),jy,kgs(mgs),ln(il)) = chw + ELSE + ! Usual resetting of reflectivity moment to force consisntency between Q, N, Z, and alpha when alpha = alphamin + z1 = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw + z = z1*(6./(pi*xdn(mgs,il)))**2 + zx(mgs,il) = z + an(igs(mgs),jy,kgs(mgs),lz(il)) = z + ENDIF + +! z1 = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw +! z = z1*(6./(pi*xdn(mgs,il)))**2 +! zx(mgs,il) = z +! an(igs(mgs),jy,kgs(mgs),lz(il)) = z + ENDIF + + ENDIF !} + + + ENDIF !} + + + ENDIF ! !} + + + + ENDIF !} + + IF ( il == lhl .and. lnhlf > 1 ) THEN + ! update chxf in case cx has changed + chxf(mgs,lhl) = frac*cx(mgs,lhl) + ENDIF + IF ( il == lh .and. lnhf > 1 ) THEN + ! update chxf in case cx has changed + chxf(mgs,lh) = frach*cx(mgs,lh) + ENDIF + + +! IF ( lf > 0 .and. il == lf .and. kgs(mgs) <= 20 .and. ( cx(mgs,lf) + dtp*( pcfwi(mgs) + pcfwd(mgs) ) > 200. .or. cx(mgs,lf) > 400. )) THEN +! write(0,*) 'ix,jy, kz, cf = ',igs(mgs)+ixbeg,jy+jybeg,kgs(mgs), an(igs(mgs),jy,kgs(mgs),ln(lf)),lfsave(mgs,5),lfsave(mgs,6) +! write(0,*) 'qold,qxold,zold,zxold = ',lfsave(mgs,1),lfsave(mgs,2),lfsave(mgs,3),lfsave(mgs,4) +! write(0,*) 'cf_new,pcfwi,pcfwd = ',cx(mgs,lf),cx(mgs,lf) + dtp*( pcfwi(mgs) + pcfwd(mgs) ),pcfwi(mgs) + pcfwd(mgs) +! +! ENDIF + + ENDDO ! mgs + +! CALL cld_cpu('Z-DELABK') + + +! CALL cld_cpu('Z-DELABK') + + + + + ENDIF ! } } ENDIF ! }} ENDIF ! } diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index 4e0e323ce..9c7951542 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -32,7 +32,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & imp_physics, imp_physics_nssl, & nssl_cccn, nssl_alphah, nssl_alphahl, & nssl_alphar, nssl_ehw0_in, nssl_ehlw0_in, & - nssl_ccn_on, nssl_hail_on, nssl_invertccn ) + nssl_ccn_on, nssl_hail_on, nssl_invertccn, nssl_3moment ) use module_mp_nssl_2mom, only: nssl_2mom_init, nssl_2mom_init_const @@ -54,12 +54,12 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & integer, intent(in) :: imp_physics_nssl real(kind_phys), intent(in) :: nssl_cccn, nssl_alphah, nssl_alphahl real(kind_phys), intent(in) :: nssl_alphar, nssl_ehw0_in, nssl_ehlw0_in - logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_invertccn + logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_invertccn, nssl_3moment ! Local variables: dimensions used in nssl_init integer :: ims,ime, jms,jme, kms,kme, nx, nz, i,k real :: nssl_params(20) - integer :: ihailv + integer :: ihailv,ipc ! Initialize the CCPP error handling variables @@ -104,9 +104,9 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & nssl_params(:) = 0.0 - nssl_params(1) = nssl_cccn - nssl_params(2) = nssl_alphah - nssl_params(3) = nssl_alphahl + ! nssl_params(1) = nssl_cccn ! use direct interface instead + ! nssl_params(2) = nssl_alphah ! use direct interface instead + ! nssl_params(3) = nssl_alphahl ! use direct interface instead nssl_params(4) = 4.e5 ! nssl_cnoh -- not used for 2-moment nssl_params(5) = 4.e4 ! nssl_cnohl-- not used for 2-moment nssl_params(6) = 4.e5 ! nssl_cnor-- not used for 2-moment @@ -114,10 +114,6 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & nssl_params(8) = 500. ! nssl_rho_qh nssl_params(9) = 800. ! nssl_rho_qhl nssl_params(10) = 100. ! nssl_rho_qs - nssl_params(11) = 0 ! nssl_ipelec_tmp - nssl_params(12) = 11 ! nssl_isaund - nssl_params(13) = 0 ! 1= turn on cccna; 0 = turn off - nssl_params(14) = nssl_alphar nssl_qccn = nssl_cccn/1.225 ! if (mpirank==mpiroot) then @@ -129,10 +125,21 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & ELSE ihailv = -1 ENDIF + + IF ( nssl_3moment ) THEN + ipc = 8 + ELSE + ipc = 5 + ENDIF ! write(0,*) 'call nssl_2mom_init' - CALL nssl_2mom_init(ims,ime, jms,jme, kms,kme,nssl_params,ipctmp=5,mixphase=0, & - ihvol=ihailv,nssl_ehw0=nssl_ehw0_in,nssl_ehlw0=nssl_ehlw0_in,errmsg=errmsg,errflg=errflg,myrank=mpirank,mpiroot=mpiroot) + CALL nssl_2mom_init(ims,ime, jms,jme, kms,kme,nssl_params,ipctmp=ipc,mixphase=0, & + ihvol=ihailv,nssl_ehw0=nssl_ehw0_in,nssl_ehlw0=nssl_ehlw0_in,errmsg=errmsg, & + nssl_alphar=nssl_alphar, & + nssl_alphah=nssl_alphah, & + nssl_alphahl=nssl_alphahl, & + nssl_cccn=nssl_cccn, & + errflg=errflg,myrank=mpirank,mpiroot=mpiroot) ! For restart runs, the init is done here if (restart) then @@ -161,6 +168,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & ! spechum, cccn, qc, qr, qi, qs, qh, qhl, & spechum, cccn, cccna, qc, qr, qi, qs, qh, qhl, & ccw, crw, cci, csw, chw, chl, vh, vhl, & + zrw, zhw, zhl, & tgrs, prslk, prsl, phii, omega, dtp, & prcp, rain, graupel, ice, snow, sr, & refl_10cm, do_radar_ref, first_time_step, restart, & @@ -168,7 +176,8 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & nleffr, nieffr, nseffr, nreffr, & imp_physics, convert_dry_rho, & imp_physics_nssl, nssl_ccn_on, & - nssl_hail_on, nssl_invertccn, ntccn, ntccna, & + nssl_hail_on, nssl_invertccn, nssl_3moment, & + ntccn, ntccna, & errflg, errmsg) use module_mp_nssl_2mom, only: calcnfromq, na @@ -197,6 +206,9 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & real(kind_phys), intent(inout) :: chl(:,:) !(1:ncol,1:nlev) hail number real(kind_phys), intent(inout) :: vh (:,:) !(1:ncol,1:nlev) graupel volume real(kind_phys), intent(inout) :: vhl(:,:) !(1:ncol,1:nlev) hail volume + real(kind_phys), intent(inout) :: zrw(:,:) !(1:ncol,1:nlev) rain reflectivity + real(kind_phys), intent(inout) :: zhw(:,:) !(1:ncol,1:nlev) graupel reflectivity + real(kind_phys), intent(inout) :: zhl(:,:) !(1:ncol,1:nlev) hail reflectivity ! State variables and timestep information real(kind_phys), intent(inout) :: tgrs (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(in ) :: prsl (:,:) !(1:ncol,1:nlev) @@ -223,7 +235,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & integer, intent(in) :: nleffr, nieffr, nseffr, nreffr integer, intent(in) :: imp_physics integer, intent(in) :: imp_physics_nssl - logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_invertccn + logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_invertccn, nssl_3moment integer, intent(in) :: ntccn, ntccna integer, intent(out) :: errflg @@ -256,6 +268,9 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & ! create temporaries for hail in case it does not exist !real(kind_phys) :: chl_mp(1:ncol,1:nlev) !< kg-1 (number mixing ratio) real(kind_phys) :: vhl_mp(1:ncol,1:nlev) !< m3 kg-1 (volume mixing ratio) + real(kind_phys) :: zrw_mp(1:ncol,1:nlev) !< m6 kg-1 (reflectivity) + real(kind_phys) :: zhw_mp(1:ncol,1:nlev) !< m6 kg-1 (reflectivity) + real(kind_phys) :: zhl_mp(1:ncol,1:nlev) !< m6 kg-1 (reflectivity) ! Vertical velocity and level width real(kind_phys) :: w(1:ncol,1:nlev) !< m s-1 real(kind_phys) :: dz(1:ncol,1:nlev) !< m @@ -342,10 +357,17 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & ns_mp = csw/(1.0_kind_phys-spechum) nh_mp = chw/(1.0_kind_phys-spechum) vh_mp = vh/(1.0_kind_phys-spechum) + IF ( nssl_3moment ) THEN + zrw_mp = zrw/(1.0_kind_phys-spechum) + zhw_mp = zhw/(1.0_kind_phys-spechum) + ENDIF IF ( nssl_hail_on ) THEN qhl_mp = qhl/(1.0_kind_phys-spechum) nhl_mp = chl/(1.0_kind_phys-spechum) vhl_mp = vhl/(1.0_kind_phys-spechum) + IF ( nssl_3moment ) THEN + zhl_mp = zhl/(1.0_kind_phys-spechum) + ENDIF ENDIF ELSE ! qv_mp = spechum ! /(1.0_kind_phys-spechum) @@ -361,10 +383,18 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & ni_mp = cci ns_mp = csw nh_mp = chw + vh_mp = vh + IF ( nssl_3moment ) THEN + zrw_mp = zrw + zhw_mp = zhw + ENDIF IF ( nssl_hail_on ) THEN qhl_mp = qhl ! /(1.0_kind_phys-spechum) nhl_mp = chl vhl_mp = vhl + IF ( nssl_3moment ) THEN + zhl_mp = zhl + ENDIF ENDIF ENDIF @@ -593,6 +623,9 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & VHW=vh_mp, & VHL=vhl_mp, & cn=cn_mp, & + ZRW=zrw_mp, & + ZHW=zhw_mp, & + ZHL=zhl_mp, & ! cna=cna_mp, f_cna=( ntccna > 0 ), & ! for future use cna=cna_mp, f_cna=.false. , & PII=prslk, & @@ -645,6 +678,9 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & CHL=nhl_mp, & VHW=vh_mp, & VHL=vhl_mp, & + ZRW=zrw_mp, & + ZHW=zhw_mp, & + ZHL=zhl_mp, & ! cn=cccn, & PII=prslk, & P=prsl, & @@ -750,10 +786,17 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & csw = ns_mp/(1.0_kind_phys+qv_mp) chw = nh_mp/(1.0_kind_phys+qv_mp) vh = vh_mp/(1.0_kind_phys+qv_mp) + IF ( nssl_3moment ) THEN + zrw = zrw_mp/(1.0_kind_phys+qv_mp) + zhw = zhw_mp/(1.0_kind_phys+qv_mp) + ENDIF IF ( nssl_hail_on ) THEN qhl = qhl_mp/(1.0_kind_phys+qv_mp) chl = nhl_mp/(1.0_kind_phys+qv_mp) vhl = vhl_mp/(1.0_kind_phys+qv_mp) + IF ( nssl_3moment ) THEN + zhl = zhl_mp/(1.0_kind_phys+qv_mp) + ENDIF ENDIF ELSE ! spechum = qv_mp ! /(1.0_kind_phys+qv_mp) @@ -770,10 +813,17 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & csw = ns_mp chw = nh_mp vh = vh_mp + IF ( nssl_3moment ) THEN + zrw = zrw_mp + zhw = zhw_mp + ENDIF IF ( nssl_hail_on ) THEN qhl = qhl_mp ! /(1.0_kind_phys+qv_mp) chl = nhl_mp vhl = vhl_mp + IF ( nssl_3moment ) THEN + zhl = zhl_mp + ENDIF ENDIF ENDIF diff --git a/physics/mp_nssl.meta b/physics/mp_nssl.meta index c7e398f0a..e628b0ff0 100644 --- a/physics/mp_nssl.meta +++ b/physics/mp_nssl.meta @@ -210,6 +210,13 @@ dimensions = () type = logical intent = in +[nssl_3moment] + standard_name = nssl_3moment + long_name = 3-moment activation flag in NSSL microphysics scheme + units = flag + dimensions = () + type = logical + intent = in ######################################################################## [ccpp-arg-table] name = mp_nssl_run @@ -387,6 +394,30 @@ type = real kind = kind_phys intent = inout +[zrw] + standard_name = reflectivity_of_rain_of_new_state + long_name = rain reflectivity + units = m6 kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[zhw] + standard_name = reflectivity_of_graupel_of_new_state + long_name = graupel reflectivity + units = m6 kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[zhl] + standard_name = reflectivity_of_hail_of_new_state + long_name = hail reflectivity + units = m6 kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout [tgrs] standard_name = air_temperature_of_new_state long_name = model layer mean temperature @@ -614,6 +645,13 @@ dimensions = () type = logical intent = in +[nssl_3moment] + standard_name = nssl_3moment + long_name = 3-moment activation flag in NSSL microphysics scheme + units = flag + dimensions = () + type = logical + intent = in [ntccn] standard_name = index_of_cloud_condensation_nuclei_number_concentration_in_tracer_concentration_array long_name = tracer index for cloud condensation nuclei number concentration From 4e7ca4ebfd25441c67f8fe4c36c26ee76ffa6b09 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Sat, 15 Apr 2023 19:47:21 -0500 Subject: [PATCH 02/81] Added NSSL 3-moment variables to pre/post tracer arrays --- physics/GFS_DCNV_generic_post.F90 | 8 +++-- physics/GFS_DCNV_generic_post.meta | 21 +++++++++++++ physics/GFS_DCNV_generic_pre.F90 | 7 +++-- physics/GFS_DCNV_generic_pre.meta | 21 +++++++++++++ physics/GFS_PBL_generic_post.F90 | 29 +++++++++++++----- physics/GFS_PBL_generic_post.meta | 28 +++++++++++++++++ physics/GFS_PBL_generic_pre.F90 | 49 +++++++++++++++++++----------- physics/GFS_PBL_generic_pre.meta | 28 +++++++++++++++++ 8 files changed, 162 insertions(+), 29 deletions(-) diff --git a/physics/GFS_DCNV_generic_post.F90 b/physics/GFS_DCNV_generic_post.F90 index 51a228122..3b69849a7 100644 --- a/physics/GFS_DCNV_generic_post.F90 +++ b/physics/GFS_DCNV_generic_post.F90 @@ -15,7 +15,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gq0, save_q, & cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, flag_for_dcnv_generic_tend, & ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, & - ntgnc, nthl, nthnc, nthv, ntgv, ntsigma, ntrac,clw, & + ntgnc, nthl, nthnc, nthv, ntgv, ntrz, ntgz, nthz, ntsigma, ntrac,clw, & satmedmf, trans_trac, errmsg, errflg) @@ -44,8 +44,9 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, & index_of_x_wind, index_of_y_wind, ntqv - integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, & - ntgnc, nthl, nthnc, nthv, ntgv, ntsigma, ntrac + integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, & + ntgnc, nthl, nthnc, nthv, ntgv, ntrz, ntgz, nthz, & + ntsigma, ntrac real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw @@ -112,6 +113,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. & n /= nthl .and. n /= nthnc .and. n /= nthv .and. & + n /= ntrz .and. n /= ntgz .and. n /= nthz .and. & n /= ntgv .and. n /= ntsigma) then tracers = tracers + 1 idtend = dtidx(100+n,index_of_process_dcnv) diff --git a/physics/GFS_DCNV_generic_post.meta b/physics/GFS_DCNV_generic_post.meta index 8428752ce..191e83a3a 100644 --- a/physics/GFS_DCNV_generic_post.meta +++ b/physics/GFS_DCNV_generic_post.meta @@ -454,6 +454,27 @@ dimensions = () type = integer intent = in +[ntrz] + standard_name = index_of_reflectivity_of_rain_in_tracer_concentration_array + long_name = tracer index for rain reflectivity + units = index + dimensions = () + type = integer + intent = in +[ntgz] + standard_name = index_of_reflectivity_of_graupel_in_tracer_concentration_array + long_name = tracer index for graupel reflectivity + units = index + dimensions = () + type = integer + intent = in +[nthz] + standard_name = index_of_reflectivity_of_hail_in_tracer_concentration_array + long_name = tracer index for hail reflectivity + units = index + dimensions = () + type = integer + intent = in [clw] standard_name = convective_transportable_tracers long_name = array to contain cloud water and other convective trans. tracers diff --git a/physics/GFS_DCNV_generic_pre.F90 b/physics/GFS_DCNV_generic_pre.F90 index b31daf5d6..1dd3aafc7 100644 --- a/physics/GFS_DCNV_generic_pre.F90 +++ b/physics/GFS_DCNV_generic_pre.F90 @@ -13,7 +13,8 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc gu0, gv0, gt0, gq0, nsamftrac, ntqv, & save_u, save_v, save_t, save_q, clw, & ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, & - ntgnc, nthl, nthnc, nthv, ntgv,ntsigma, & + ntgnc, nthl, nthnc, nthv, ntgv, & + ntrz, ntgz, nthz, ntsigma, & cscnv, satmedmf, trans_trac, ras, ntrac, & dtidx, index_of_process_dcnv, errmsg, errflg) @@ -22,7 +23,8 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc implicit none integer, intent(in) :: im, levs, nsamftrac, ntqv, index_of_process_dcnv, dtidx(:,:), & - ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc,nthl,nthnc,nthv,ntgv,ntsigma + ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl,ntrac,ntgnc,nthl,nthnc,nthv,ntgv, & + ntrz, ntgz, nthz, ntsigma logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm real(kind=kind_phys), dimension(:,:), intent(in) :: gu0 real(kind=kind_phys), dimension(:,:), intent(in) :: gv0 @@ -68,6 +70,7 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc n /= ntrw .and. n /= ntsw .and. n /= ntrnc .and. & n /= ntsnc .and. n /= ntgl .and. n /= ntgnc .and. & n /= nthl .and. n /= nthnc .and. n /= nthv .and. & + n /= ntrz .and. n /= ntgz .and. n /= nthz .and. & n /= ntgv .and. n/= ntsigma) then tracers = tracers + 1 if(dtidx(100+n,index_of_process_dcnv)>0) then diff --git a/physics/GFS_DCNV_generic_pre.meta b/physics/GFS_DCNV_generic_pre.meta index ee2050926..a9008436e 100644 --- a/physics/GFS_DCNV_generic_pre.meta +++ b/physics/GFS_DCNV_generic_pre.meta @@ -267,6 +267,27 @@ dimensions = () type = integer intent = in +[ntrz] + standard_name = index_of_reflectivity_of_rain_in_tracer_concentration_array + long_name = tracer index for rain reflectivity + units = index + dimensions = () + type = integer + intent = in +[ntgz] + standard_name = index_of_reflectivity_of_graupel_in_tracer_concentration_array + long_name = tracer index for graupel reflectivity + units = index + dimensions = () + type = integer + intent = in +[nthz] + standard_name = index_of_reflectivity_of_hail_in_tracer_concentration_array + long_name = tracer index for hail reflectivity + units = index + dimensions = () + type = integer + intent = in [clw] standard_name = convective_transportable_tracers long_name = array to contain cloud water and other convective trans. tracers diff --git a/physics/GFS_PBL_generic_post.F90 b/physics/GFS_PBL_generic_post.F90 index 0d13dc5d8..a4e5f172a 100644 --- a/physics/GFS_PBL_generic_post.F90 +++ b/physics/GFS_PBL_generic_post.F90 @@ -10,9 +10,9 @@ module GFS_PBL_generic_post !! subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, & ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev,nqrimef, & - trans_aero, ntchs, ntchm, ntccn, nthl, nthnc, ntgv, nthv, & + trans_aero, ntchs, ntchm, ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, & - imp_physics_fer_hires, imp_physics_nssl, nssl_ccn_on, ltaerosol, mraerosol, nssl_hail_on, & + imp_physics_fer_hires, imp_physics_nssl, nssl_ccn_on, ltaerosol, mraerosol, nssl_hail_on, nssl_3moment, & cplflx, cplaqm, cplchm, lssav, flag_for_pbl_generic_tend, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, & shinhong, do_ysu, dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dtend, dtidx, index_of_temperature, index_of_x_wind, index_of_y_wind, & @@ -30,12 +30,12 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, integer, parameter :: kp = kind_phys integer, intent(in) :: im, levs, nvdiff, ntrac, ntchs, ntchm, kdt integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef - integer, intent(in) :: ntccn, nthl, nthnc, ntgv, nthv + integer, intent(in) :: ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz logical, intent(in) :: trans_aero integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires integer, intent(in) :: imp_physics_nssl - logical, intent(in) :: nssl_ccn_on, nssl_hail_on + logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_3moment logical, intent(in) :: ltaerosol, cplflx, cplaqm, cplchm, lssav, ldiag3d, lsidea, use_med_flux, mraerosol logical, intent(in) :: hybedmf, do_shoc, satmedmf, shinhong, do_ysu @@ -270,8 +270,16 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqdt(i,k,ntgv) = dvdftra(i,k,14) dqdt(i,k,nthv) = dvdftra(i,k,15) dqdt(i,k,ntoz) = dvdftra(i,k,16) + n = 16 IF ( nssl_ccn_on ) THEN - dqdt(i,k,ntccn) = dvdftra(i,k,17) + dqdt(i,k,ntccn) = dvdftra(i,k,n+1) + n = n+1 + ENDIF + IF ( nssl_3moment ) THEN + dqdt(i,k,ntrz) = dvdftra(i,k,n+1) + dqdt(i,k,ntgz) = dvdftra(i,k,n+2) + dqdt(i,k,nthz) = dvdftra(i,k,n+3) + n = n+3 ENDIF enddo enddo @@ -292,9 +300,16 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, dqdt(i,k,ntsnc) = dvdftra(i,k,10) dqdt(i,k,ntgnc) = dvdftra(i,k,11) dqdt(i,k,ntgv) = dvdftra(i,k,12) - dqdt(i,k,ntoz) = dvdftra(i,k,13) + dqdt(i,k,ntoz) = dvdftra(i,k,13) + n = 13 IF ( nssl_ccn_on ) THEN - dqdt(i,k,ntccn) = dvdftra(i,k,14) + dqdt(i,k,ntccn) = dvdftra(i,k,n+1) + n = n+1 + ENDIF + IF ( nssl_3moment ) THEN + dqdt(i,k,ntrz) = dvdftra(i,k,n+1) + dqdt(i,k,ntgz) = dvdftra(i,k,n+2) + n = n+2 ENDIF enddo enddo diff --git a/physics/GFS_PBL_generic_post.meta b/physics/GFS_PBL_generic_post.meta index b20142991..a53acbc64 100644 --- a/physics/GFS_PBL_generic_post.meta +++ b/physics/GFS_PBL_generic_post.meta @@ -211,6 +211,27 @@ dimensions = () type = integer intent = in +[ntrz] + standard_name = index_of_reflectivity_of_rain_in_tracer_concentration_array + long_name = tracer index for rain reflectivity + units = index + dimensions = () + type = integer + intent = in +[ntgz] + standard_name = index_of_reflectivity_of_graupel_in_tracer_concentration_array + long_name = tracer index for graupel reflectivity + units = index + dimensions = () + type = integer + intent = in +[nthz] + standard_name = index_of_reflectivity_of_hail_in_tracer_concentration_array + long_name = tracer index for hail reflectivity + units = index + dimensions = () + type = integer + intent = in [imp_physics] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme @@ -295,6 +316,13 @@ dimensions = () type = logical intent = in +[nssl_3moment] + standard_name = nssl_3moment + long_name = 3-moment activation flag in NSSL microphysics scheme + units = flag + dimensions = () + type = logical + intent = in [cplflx] standard_name = flag_for_surface_flux_coupling long_name = flag controlling cplflx collection (default off) diff --git a/physics/GFS_PBL_generic_pre.F90 b/physics/GFS_PBL_generic_pre.F90 index b9f7bb880..d8ed0f8fc 100644 --- a/physics/GFS_PBL_generic_pre.F90 +++ b/physics/GFS_PBL_generic_pre.F90 @@ -12,10 +12,10 @@ module GFS_PBL_generic_pre subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index, & ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, & ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef, trans_aero, ntchs, ntchm, & - ntccn, nthl, nthnc, ntgv, nthv, & + ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, & imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires, imp_physics_nssl, & - ltaerosol, mraerosol, nssl_ccn_on, nssl_hail_on, & + ltaerosol, mraerosol, nssl_ccn_on, nssl_hail_on, nssl_3moment, & hybedmf, do_shoc, satmedmf, qgrs, vdftra, save_u, save_v, save_t, save_q, & flag_for_pbl_generic_tend, ldiag3d, qdiag3d, lssav, ugrs, vgrs, tgrs, errmsg, errflg) @@ -29,13 +29,13 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index, integer, intent(in) :: im, levs, nvdiff, ntrac integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev, nqrimef,ntchs, ntchm - integer, intent(in) :: ntccn, nthl, nthnc, ntgv, nthv + integer, intent(in) :: ntccn, nthl, nthnc, ntgv, nthv, ntrz, ntgz, nthz logical, intent(in) :: trans_aero, ldiag3d, qdiag3d, lssav integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: ltaerosol, hybedmf, do_shoc, satmedmf, flag_for_pbl_generic_tend, mraerosol integer, intent(in) :: imp_physics_nssl - logical, intent(in) :: nssl_hail_on, nssl_ccn_on + logical, intent(in) :: nssl_hail_on, nssl_ccn_on, nssl_3moment real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs @@ -215,15 +215,23 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index, vdftra(i,k,7) = qgrs(i,k,nthl) vdftra(i,k,8) = qgrs(i,k,ntlnc) vdftra(i,k,9) = qgrs(i,k,ntinc) - vdftra(i,k,10) = qgrs(i,k,ntrnc) - vdftra(i,k,11) = qgrs(i,k,ntsnc) - vdftra(i,k,12) = qgrs(i,k,ntgnc) - vdftra(i,k,13) = qgrs(i,k,nthnc) - vdftra(i,k,14) = qgrs(i,k,ntgv) - vdftra(i,k,15) = qgrs(i,k,nthv) - vdftra(i,k,16) = qgrs(i,k,ntoz) + vdftra(i,k,10) = qgrs(i,k,ntrnc) + vdftra(i,k,11) = qgrs(i,k,ntsnc) + vdftra(i,k,12) = qgrs(i,k,ntgnc) + vdftra(i,k,13) = qgrs(i,k,nthnc) + vdftra(i,k,14) = qgrs(i,k,ntgv) + vdftra(i,k,15) = qgrs(i,k,nthv) + vdftra(i,k,16) = qgrs(i,k,ntoz) + n = 16 IF ( nssl_ccn_on ) THEN - vdftra(i,k,17) = qgrs(i,k,ntccn) + vdftra(i,k,n+1) = qgrs(i,k,ntccn) + n = n+1 + ENDIF + IF ( nssl_3moment ) THEN + vdftra(i,k,n+1) = qgrs(i,k,ntrz) + vdftra(i,k,n+2) = qgrs(i,k,ntgz) + vdftra(i,k,n+3) = qgrs(i,k,nthz) + n = n+3 ENDIF enddo enddo @@ -241,12 +249,19 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, rtg_ozone_index, vdftra(i,k,7) = qgrs(i,k,ntlnc) vdftra(i,k,8) = qgrs(i,k,ntinc) vdftra(i,k,9) = qgrs(i,k,ntrnc) - vdftra(i,k,10) = qgrs(i,k,ntsnc) - vdftra(i,k,11) = qgrs(i,k,ntgnc) - vdftra(i,k,12) = qgrs(i,k,ntgv) - vdftra(i,k,13) = qgrs(i,k,ntoz) + vdftra(i,k,10) = qgrs(i,k,ntsnc) + vdftra(i,k,11) = qgrs(i,k,ntgnc) + vdftra(i,k,12) = qgrs(i,k,ntgv) + vdftra(i,k,13) = qgrs(i,k,ntoz) + n = 13 IF ( nssl_ccn_on ) THEN - vdftra(i,k,14) = qgrs(i,k,ntccn) + vdftra(i,k,n+1) = qgrs(i,k,ntccn) + n = n+1 + ENDIF + IF ( nssl_3moment ) THEN + vdftra(i,k,n+1) = qgrs(i,k,ntrz) + vdftra(i,k,n+2) = qgrs(i,k,ntgz) + n = n+2 ENDIF enddo enddo diff --git a/physics/GFS_PBL_generic_pre.meta b/physics/GFS_PBL_generic_pre.meta index a09b34b48..995fac565 100644 --- a/physics/GFS_PBL_generic_pre.meta +++ b/physics/GFS_PBL_generic_pre.meta @@ -217,6 +217,27 @@ dimensions = () type = integer intent = in +[ntrz] + standard_name = index_of_reflectivity_of_rain_in_tracer_concentration_array + long_name = tracer index for rain reflectivity + units = index + dimensions = () + type = integer + intent = in +[ntgz] + standard_name = index_of_reflectivity_of_graupel_in_tracer_concentration_array + long_name = tracer index for graupel reflectivity + units = index + dimensions = () + type = integer + intent = in +[nthz] + standard_name = index_of_reflectivity_of_hail_in_tracer_concentration_array + long_name = tracer index for hail reflectivity + units = index + dimensions = () + type = integer + intent = in [imp_physics] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme @@ -301,6 +322,13 @@ dimensions = () type = logical intent = in +[nssl_3moment] + standard_name = nssl_3moment + long_name = 3-moment activation flag in NSSL microphysics scheme + units = flag + dimensions = () + type = logical + intent = in [hybedmf] standard_name = flag_for_hybrid_edmf_pbl_scheme long_name = flag for hybrid edmf pbl scheme (moninedmf) From 7956ada51d49617acc7f1e03c0381dfafbf2ba25 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Tue, 18 Apr 2023 16:48:30 -0500 Subject: [PATCH 03/81] Turn off unneeded print statement --- physics/module_mp_nssl_2mom.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index f2f9707fb..cac1218a9 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -1326,7 +1326,7 @@ SUBROUTINE nssl_2mom_init( & - IF ( .false. ) THEN ! set to true to enable internal namelist read + IF ( .true. ) THEN ! set to true to enable internal namelist read open(15,file='input.nml',status='old',form='formatted',action='read') rewind(15) read(15,NML=nssl_mp_params,iostat=istat) @@ -1633,7 +1633,7 @@ SUBROUTINE nssl_2mom_init( & lccnuf = ltmp denscale(lccnuf) = 1 ENDIF - write(0,*) 'nsslwrf: lccnuf = ',lccnuf + lccn= ltmp+1 ! 9 lnc = ltmp+2 ! 10 lnr = ltmp+3 ! 11 From f020a3a2ab44048bb9725639d1924a50c97a089c Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 27 Apr 2023 07:37:58 -0600 Subject: [PATCH 04/81] bug fix for rain evaporation due to inconsistent usage of air density on multiple lines --- physics/module_mp_thompson.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index b828c9ab0..3844498d1 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -3716,13 +3716,13 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & lamr = 1./ilamr(k) !> - Rapidly eliminate near zero values when low humidity (<95%) if (qv(k)/qvs(k) .lt. 0.95 .AND. rr(k)*orho.le.1.E-8) then - prv_rev(k) = rr(k)*orho*odts + prv_rev(k) = rr(k)*odts else prv_rev(k) = t1_evap*diffu(k)*(-ssatw(k))*N0_r(k)*rvs & * (t1_qr_ev*ilamr(k)**cre(10) & + t2_qr_ev*vsc2(k)*rhof2(k)*((lamr+0.5*fv_r)**(-cre(11)))) - rate_max = MIN((rr(k)*orho*odts), (qvs(k)-qv(k))*odts) - prv_rev(k) = MIN(DBLE(rate_max), prv_rev(k)*orho) + rate_max = MIN((rr(k)*odts), (qvs(k)-qv(k))*rho(k)*odts) + prv_rev(k) = MIN(DBLE(rate_max*orho), prv_rev(k)*orho) !..TEST: G. Thompson 10 May 2013 !> - Reduce the rain evaporation in same places as melting graupel occurs. From c7f6d31bec5957c11e49662ebe8a36cf39c63de4 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Thu, 4 May 2023 10:23:44 -0600 Subject: [PATCH 05/81] three small fixes: max ice size bin made smaller (since snow min size was increased prev); make fewer explicit rain drop breakup from collisions with graupel when T above 0C; fix so snow/graupel only sublimate when not melting --- physics/module_mp_thompson.F90 | 44 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index b828c9ab0..38ee79dfa 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -708,9 +708,9 @@ SUBROUTINE thompson_init(is_aerosol_aware_in, & dtc(n) = (Dc(n) - Dc(n-1)) enddo -!> - Create bins of cloud ice (from min diameter up to 5x min snow size) +!> - Create bins of cloud ice (from min diameter up to 2x min snow size) xDx(1) = D0i*1.0d0 - xDx(nbi+1) = 5.0d0*D0s + xDx(nbi+1) = 2.0d0*D0s do n = 2, nbi xDx(n) = DEXP(DFLOAT(n-1)/DFLOAT(nbi) & *DLOG(xDx(nbi+1)/xDx(1)) +DLOG(xDx(1))) @@ -2822,7 +2822,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & prr_rcg(k) = MIN(DBLE(rg(k)*odts), prr_rcg(k)) prg_rcg(k) = -prr_rcg(k) !> - Put in explicit drop break-up due to collisions. - pnr_rcg(k) = -5.*tnr_gacr(idx_g1,idx_g,idx_r1,idx_r) ! RAIN2M + pnr_rcg(k) = -1.5*tnr_gacr(idx_g1,idx_g,idx_r1,idx_r) ! RAIN2M endif endif endif @@ -3053,16 +3053,14 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & if (prr_sml(k) .gt. 0.) then prr_sml(k) = prr_sml(k) + 4218.*olfus*tempc & * (prr_rcs(k)+prs_scw(k)) - endif - prr_sml(k) = MIN(DBLE(rs(k)*odts), MAX(0.D0, prr_sml(k))) - pnr_sml(k) = smo0(k)/rs(k)*prr_sml(k) * 10.0**(-0.25*tempc) ! RAIN2M - pnr_sml(k) = MIN(DBLE(smo0(k)*odts), pnr_sml(k)) - - if (ssati(k).lt. 0.) then - prs_sde(k) = C_cube*t1_subl*diffu(k)*ssati(k)*rvs & - * (t1_qs_sd*smo1(k) & - + t2_qs_sd*rhof2(k)*vsc2(k)*smof(k)) - prs_sde(k) = MAX(DBLE(-rs(k)*odts), prs_sde(k)) + prr_sml(k) = MIN(DBLE(rs(k)*odts), prr_sml(k)) + pnr_sml(k) = smo0(k)/rs(k)*prr_sml(k) * 10.0**(-0.25*tempc) ! RAIN2M + pnr_sml(k) = MIN(DBLE(smo0(k)*odts), pnr_sml(k)) + elseif (ssati(k).lt. 0.) then + prs_sde(k) = C_cube*t1_subl*diffu(k)*ssati(k)*rvs & + * (t1_qs_sd*smo1(k) & + + t2_qs_sd*rhof2(k)*vsc2(k)*smof(k)) + prs_sde(k) = MAX(DBLE(-rs(k)*odts), prs_sde(k)) endif endif @@ -3070,17 +3068,15 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & prr_gml(k) = (tempc*tcond(k)-lvap0*diffu(k)*delQvs(k)) & * N0_g(k)*(t1_qg_me*ilamg(k)**cge(10) & + t2_qg_me*rhof2(k)*vsc2(k)*ilamg(k)**cge(11)) -!-GT prr_gml(k) = prr_gml(k) + 4218.*olfus*tempc & -!-GT * (prr_rcg(k)+prg_gcw(k)) - prr_gml(k) = MIN(DBLE(rg(k)*odts), MAX(0.D0, prr_gml(k))) - pnr_gml(k) = N0_g(k)*cgg(2)*ilamg(k)**cge(2) / rg(k) & ! RAIN2M - * prr_gml(k) * 10.0**(-0.5*tempc) - - if (ssati(k).lt. 0.) then - prg_gde(k) = C_cube*t1_subl*diffu(k)*ssati(k)*rvs & - * N0_g(k) * (t1_qg_sd*ilamg(k)**cge(10) & - + t2_qg_sd*vsc2(k)*rhof2(k)*ilamg(k)**cge(11)) - prg_gde(k) = MAX(DBLE(-rg(k)*odts), prg_gde(k)) + if (prr_gml(k) .gt. 0.) then + prr_gml(k) = MIN(DBLE(rg(k)*odts), prr_gml(k)) + pnr_gml(k) = N0_g(k)*cgg(2)*ilamg(k)**cge(2) / rg(k) & ! RAIN2M + * prr_gml(k) * 10.0**(-0.5*tempc) + elseif (ssati(k).lt. 0.) then + prg_gde(k) = C_cube*t1_subl*diffu(k)*ssati(k)*rvs & + * N0_g(k) * (t1_qg_sd*ilamg(k)**cge(10) & + + t2_qg_sd*vsc2(k)*rhof2(k)*ilamg(k)**cge(11)) + prg_gde(k) = MAX(DBLE(-rg(k)*odts), prg_gde(k)) endif endif From 4c60a2f50b163cb52495c3815a41ade7e536de39 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Tue, 23 May 2023 14:00:52 -0600 Subject: [PATCH 06/81] Reorganize NRL ozone physics scheme into CCPP phases. Make scheme (memory) stateless. --- physics/GFS_phys_time_vary.fv3.F90 | 80 ++----- physics/GFS_phys_time_vary.fv3.meta | 76 +----- physics/GFS_phys_time_vary.scm.F90 | 68 ++---- physics/GFS_phys_time_vary.scm.meta | 76 +----- physics/GFS_rrtmg_pre.F90 | 11 +- physics/GFS_rrtmg_pre.meta | 30 +++ physics/GFS_rrtmg_setup.F90 | 7 +- physics/GFS_rrtmg_setup.meta | 21 ++ physics/ozinterp.f90 | 212 ----------------- physics/ozne_def.f | 24 -- physics/ozne_def.meta | 29 --- physics/ozphys_2015.F90 | 343 ++++++++++++++++++++++++++++ physics/ozphys_2015.f | 190 --------------- physics/ozphys_2015.meta | 203 ++++++++++++++-- physics/radiation_gases.f | 13 +- 15 files changed, 635 insertions(+), 748 deletions(-) delete mode 100644 physics/ozinterp.f90 delete mode 100644 physics/ozne_def.f delete mode 100644 physics/ozne_def.meta create mode 100644 physics/ozphys_2015.F90 delete mode 100644 physics/ozphys_2015.f diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 42f2bbc15..334228afe 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -2,7 +2,7 @@ !! Contains code related to GFS physics suite setup (physics part of time_vary_step) !>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update -!! This module contains GFS physics time vary subroutines including ozone, stratospheric water vapor, +!! This module contains GFS physics time vary subroutines including stratospheric water vapor, !! aerosol, IN&CCN and surface properties updates. module GFS_phys_time_vary @@ -14,9 +14,6 @@ module GFS_phys_time_vary use mersenne_twister, only: random_setseed, random_number - use ozne_def, only : levozp, oz_coeff, oz_lat, oz_pres, oz_time, ozplin - use ozinterp, only : read_o3data, setindxoz, ozinterpol - use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol @@ -66,9 +63,9 @@ module GFS_phys_time_vary !>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm !> @{ subroutine GFS_phys_time_vary_init ( & - me, master, ntoz, h2o_phys, iaerclm, iccn, iaermdl, iflip, im, levs, & + me, master, h2o_phys, iaerclm, iccn, iaermdl, iflip, im, levs, & nx, ny, idate, xlat_d, xlon_d, & - jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & + jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, imap, jmap, & do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, & @@ -85,15 +82,15 @@ subroutine GFS_phys_time_vary_init ( implicit none ! Interface variables - integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs, iaermdl + integer, intent(in) :: me, master, iccn, iflip, im, nx, ny, levs, iaermdl logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhour real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:) - integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:) - real(kind_phys), intent(in) :: ozpl(:,:,:), h2opl(:,:,:) + integer, intent(inout) :: jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(inout) :: ddy_h(:) + real(kind_phys), intent(in) :: h2opl(:,:,:) integer, intent(inout) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(inout) :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(out) :: aer_nm(:,:,:) @@ -196,13 +193,12 @@ subroutine GFS_phys_time_vary_init ( jamax=-999 !$OMP parallel num_threads(nthrds) default(none) & -!$OMP shared (me,master,ntoz,h2o_phys,im,nx,ny,levs,idate) & +!$OMP shared (me,master,h2o_phys,im,nx,ny,levs,idate) & !$OMP shared (xlat_d,xlon_d,imap,jmap,errmsg,errflg) & -!$OMP shared (levozp,oz_coeff,oz_pres,ozpl) & !$OMP shared (levh2o,h2o_coeff,h2o_pres,h2opl) & !$OMP shared (iamin, iamax, jamin, jamax) & !$OMP shared (iaerclm,iaermdl,ntrcaer,aer_nm,iflip,iccn) & -!$OMP shared (jindx1_o3,jindx2_o3,ddy_o3,jindx1_h,jindx2_h,ddy_h) & +!$OMP shared (jindx1_h,jindx2_h,ddy_h) & !$OMP shared (jindx1_aer,jindx2_aer,ddy_aer,iindx1_aer,iindx2_aer,ddx_aer) & !$OMP shared (jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci,ddx_ci) & !$OMP shared (do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau,ddy_j2tau) & @@ -212,32 +208,12 @@ subroutine GFS_phys_time_vary_init ( !$OMP sections -!$OMP section -!> - Call read_o3data() to read ozone data - call read_o3data (ntoz, me, master) - - ! Consistency check that the hardcoded values for levozp and - ! oz_coeff in GFS_typedefs.F90 match what is set by read_o3data - ! in GFS_typedefs.F90: allocate (Tbd%ozpl (IM,levozp,oz_coeff)) - if (size(ozpl, dim=2).ne.levozp) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "levozp from read_o3data does not match value in GFS_typedefs.F90: ", & - levozp, " /= ", size(ozpl, dim=2) - errflg = 1 - end if - if (size(ozpl, dim=3).ne.oz_coeff) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "oz_coeff from read_o3data does not match value in GFS_typedefs.F90: ", & - oz_coeff, " /= ", size(ozpl, dim=3) - errflg = 1 - end if - !$OMP section !> - Call read_h2odata() to read stratospheric water vapor data call read_h2odata (h2o_phys, me, master) ! Consistency check that the hardcoded values for levh2o and - ! h2o_coeff in GFS_typedefs.F90 match what is set by read_o3data + ! h2o_coeff in GFS_typedefs.F90 match what is set by read_h2odata ! in GFS_typedefs.F90: allocate (Tbd%h2opl (IM,levh2o,h2o_coeff)) if (size(h2opl, dim=2).ne.levh2o) then write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & @@ -295,12 +271,6 @@ subroutine GFS_phys_time_vary_init ( !$OMP sections -!$OMP section -!> - Call setindxoz() to initialize ozone data - if (ntoz > 0) then - call setindxoz (im, xlat_d, jindx1_o3, jindx2_o3, ddy_o3) - endif - !$OMP section !> - Call setindxh2o() to initialize stratospheric water vapor data if (h2o_phys) then @@ -708,8 +678,8 @@ end subroutine GFS_phys_time_vary_init !> @{ subroutine GFS_phys_time_vary_timestep_init ( & me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, & - imfdeepcnv, cal_pre, random_clds, nscyc, ntoz, h2o_phys, iaerclm, iccn, clstp, & - jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & + imfdeepcnv, cal_pre, random_clds, nscyc, h2o_phys, iaerclm, iccn, clstp, & + jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, fn_nml, & imap, jmap, prsl, seed0, rann, nthrds, nx, ny, nsst, tile_num, nlunit, lsoil, lsoil_lsm,& @@ -724,14 +694,14 @@ subroutine GFS_phys_time_vary_timestep_init ( ! Interface variables integer, intent(in) :: me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, & - nsswr, imfdeepcnv, iccn, nscyc, ntoz, iflip + nsswr, imfdeepcnv, iccn, nscyc, iflip integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhswr, fhour logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm real(kind_phys), intent(out) :: clstp - integer, intent(in) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(in) :: ddy_o3(:), ddy_h(:) - real(kind_phys), intent(inout) :: ozpl(:,:,:), h2opl(:,:,:) + integer, intent(in) :: jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(in) :: ddy_h(:) + real(kind_phys), intent(inout) :: h2opl(:,:,:) integer, intent(in) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(in) :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(inout) :: aer_nm(:,:,:) @@ -788,8 +758,8 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP parallel num_threads(nthrds) default(none) & !$OMP shared(kdt,nsswr,lsswr,clstp,imfdeepcnv,cal_pre,random_clds) & !$OMP shared(fhswr,fhour,seed0,cnx,cny,nrcm,wrk,rannie,rndval) & -!$OMP shared(rann,im,isc,jsc,imap,jmap,ntoz,me,idate,jindx1_o3,jindx2_o3) & -!$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & +!$OMP shared(rann,im,isc,jsc,imap,jmap,me,idate) & +!$OMP shared(h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & !$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & !$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & !$OMP shared(ddy_j2tau,tau_amf,iflip) & @@ -842,14 +812,6 @@ subroutine GFS_phys_time_vary_timestep_init ( endif ! imfdeepcnv, cal_re, random_clds -!$OMP section -!> - Call ozinterpol() to make ozone interpolation - if (ntoz > 0) then - call ozinterpol (me, im, idate, fhour, & - jindx1_o3, jindx2_o3, & - ozpl, ddy_o3) - endif - !$OMP section !> - Call h2ointerpol() to make stratospheric water vapor data interpolation if (h2o_phys) then @@ -944,12 +906,6 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg) if (.not.is_initialized) return - ! Deallocate ozone arrays - if (allocated(oz_lat) ) deallocate(oz_lat) - if (allocated(oz_pres) ) deallocate(oz_pres) - if (allocated(oz_time) ) deallocate(oz_time) - if (allocated(ozplin) ) deallocate(ozplin) - ! Deallocate h2o arrays if (allocated(h2o_lat) ) deallocate(h2o_lat) if (allocated(h2o_pres)) deallocate(h2o_pres) diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index ce8c6c54b..654b5afd8 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -2,7 +2,7 @@ name = GFS_phys_time_vary type = scheme dependencies = aerclm_def.F,aerinterp.F90,gcycle.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f - dependencies = namelist_soilveg.f,set_soilveg.f,ozinterp.f90,ozne_def.f,sfcsub.F,cires_tauamf_data.F90,noahmp_tables.f90 + dependencies = namelist_soilveg.f,set_soilveg.f,sfcsub.F,cires_tauamf_data.F90,noahmp_tables.f90 ######################################################################## [ccpp-arg-table] @@ -23,13 +23,6 @@ dimensions = () type = integer intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -116,36 +109,6 @@ type = real kind = kind_phys intent = in -[jindx1_o3] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = inout -[jindx2_o3] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = inout -[ddy_o3] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = inout -[ozpl] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) - type = real - kind = kind_phys - intent = in [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -1077,13 +1040,6 @@ dimensions = () type = integer intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -1113,36 +1069,6 @@ type = real kind = kind_phys intent = out -[jindx1_o3] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[jindx2_o3] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[ddy_o3] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in -[ozpl] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) - type = real - kind = kind_phys - intent = inout [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index 74b34e974..97460ac98 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -2,7 +2,7 @@ !! Contains code related to GFS physics suite setup (physics part of time_vary_step) !>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update -!! This module contains GFS physics time vary subroutines including ozone, stratospheric water vapor, +!! This module contains GFS physics time vary subroutines including, stratospheric water vapor, !! aerosol, IN&CCN and surface properties updates. !> @{ module GFS_phys_time_vary @@ -11,9 +11,6 @@ module GFS_phys_time_vary use mersenne_twister, only: random_setseed, random_number - use ozne_def, only : levozp, oz_coeff, oz_lat, oz_pres, oz_time, ozplin - use ozinterp, only : read_o3data, setindxoz, ozinterpol - use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol @@ -61,8 +58,8 @@ module GFS_phys_time_vary !>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm !! @{ subroutine GFS_phys_time_vary_init ( & - me, master, ntoz, h2o_phys, iaerclm, iccn, iflip, im, nx, ny, idate, xlat_d, xlon_d, & - jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & + me, master, h2o_phys, iaerclm, iccn, iflip, im, nx, ny, idate, xlat_d, xlon_d, & + jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, imap, jmap, & do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, & @@ -79,15 +76,15 @@ subroutine GFS_phys_time_vary_init ( implicit none ! Interface variables - integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny + integer, intent(in) :: me, master, iccn, iflip, im, nx, ny logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhour real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:) - integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:) - real(kind_phys), intent(in) :: ozpl(:,:,:), h2opl(:,:,:) + integer, intent(inout) :: jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(inout) :: ddy_h(:) + real(kind_phys), intent(in) :: h2opl(:,:,:) integer, intent(inout) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(inout) :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(in) :: aer_nm(:,:,:) @@ -189,30 +186,11 @@ subroutine GFS_phys_time_vary_init ( jamin=999 jamax=-999 -!> - Call read_o3data() to read ozone data - call read_o3data (ntoz, me, master) - - ! Consistency check that the hardcoded values for levozp and - ! oz_coeff in GFS_typedefs.F90 match what is set by read_o3data - ! in GFS_typedefs.F90: allocate (Tbd%ozpl (IM,levozp,oz_coeff)) - if (size(ozpl, dim=2).ne.levozp) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "levozp from read_o3data does not match value in GFS_typedefs.F90: ", & - levozp, " /= ", size(ozpl, dim=2) - errflg = 1 - end if - if (size(ozpl, dim=3).ne.oz_coeff) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & - "oz_coeff from read_o3data does not match value in GFS_typedefs.F90: ", & - oz_coeff, " /= ", size(ozpl, dim=3) - errflg = 1 - end if - !> - Call read_h2odata() to read stratospheric water vapor data call read_h2odata (h2o_phys, me, master) ! Consistency check that the hardcoded values for levh2o and - ! h2o_coeff in GFS_typedefs.F90 match what is set by read_o3data + ! h2o_coeff in GFS_typedefs.F90 match what is set by read_h2odata ! in GFS_typedefs.F90: allocate (Tbd%h2opl (IM,levh2o,h2o_coeff)) if (size(h2opl, dim=2).ne.levh2o) then write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & @@ -266,11 +244,6 @@ subroutine GFS_phys_time_vary_init ( !> - Initialize soil vegetation (needed for sncovr calculation further down) call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) -!> - Call setindxoz() to initialize ozone data - if (ntoz > 0) then - call setindxoz (im, xlat_d, jindx1_o3, jindx2_o3, ddy_o3) - endif - !> - Call setindxh2o() to initialize stratospheric water vapor data if (h2o_phys) then call setindxh2o (im, xlat_d, jindx1_h, jindx2_h, ddy_h) @@ -652,8 +625,8 @@ end subroutine GFS_phys_time_vary_init !! @{ subroutine GFS_phys_time_vary_timestep_init ( & me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, & - imfdeepcnv, cal_pre, random_clds, ntoz, h2o_phys, iaerclm, iccn, clstp, & - jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & + imfdeepcnv, cal_pre, random_clds, h2o_phys, iaerclm, iccn, clstp, & + jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, & imap, jmap, prsl, seed0, rann, do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau,& @@ -663,14 +636,14 @@ subroutine GFS_phys_time_vary_timestep_init ( ! Interface variables integer, intent(in) :: me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, & - nsswr, imfdeepcnv, iccn, ntoz, iflip + nsswr, imfdeepcnv, iccn, iflip integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhswr, fhour logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm real(kind_phys), intent(out) :: clstp - integer, intent(in) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(in) :: ddy_o3(:), ddy_h(:) - real(kind_phys), intent(inout) :: ozpl(:,:,:), h2opl(:,:,:) + integer, intent(in) :: jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(in) :: ddy_h(:) + real(kind_phys), intent(inout) :: h2opl(:,:,:) integer, intent(in) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(in) :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(inout) :: aer_nm(:,:,:) @@ -748,13 +721,6 @@ subroutine GFS_phys_time_vary_timestep_init ( endif ! imfdeepcnv, cal_re, random_clds -!> - Call ozinterpol() to make ozone interpolation - if (ntoz > 0) then - call ozinterpol (me, im, idate, fhour, & - jindx1_o3, jindx2_o3, & - ozpl, ddy_o3) - endif - !> - Call h2ointerpol() to make stratospheric water vapor data interpolation if (h2o_phys) then call h2ointerpol (me, im, idate, fhour, & @@ -844,12 +810,6 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg) if (.not.is_initialized) return - ! Deallocate ozone arrays - if (allocated(oz_lat) ) deallocate(oz_lat) - if (allocated(oz_pres) ) deallocate(oz_pres) - if (allocated(oz_time) ) deallocate(oz_time) - if (allocated(ozplin) ) deallocate(ozplin) - ! Deallocate h2o arrays if (allocated(h2o_lat) ) deallocate(h2o_lat) if (allocated(h2o_pres)) deallocate(h2o_pres) diff --git a/physics/GFS_phys_time_vary.scm.meta b/physics/GFS_phys_time_vary.scm.meta index 8b59e4bed..21d1f2736 100644 --- a/physics/GFS_phys_time_vary.scm.meta +++ b/physics/GFS_phys_time_vary.scm.meta @@ -2,7 +2,7 @@ name = GFS_phys_time_vary type = scheme dependencies = aerclm_def.F,aerinterp.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f - dependencies = namelist_soilveg.f,set_soilveg.f,ozinterp.f90,ozne_def.f,cires_tauamf_data.F90,noahmp_tables.f90 + dependencies = namelist_soilveg.f,set_soilveg.f,cires_tauamf_data.F90,noahmp_tables.f90 ######################################################################## [ccpp-arg-table] @@ -23,13 +23,6 @@ dimensions = () type = integer intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -102,36 +95,6 @@ type = real kind = kind_phys intent = in -[jindx1_o3] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = inout -[jindx2_o3] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = inout -[ddy_o3] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = inout -[ozpl] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) - type = real - kind = kind_phys - intent = in [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -1056,13 +1019,6 @@ dimensions = () type = logical intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -1092,36 +1048,6 @@ type = real kind = kind_phys intent = out -[jindx1_o3] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[jindx2_o3] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[ddy_o3] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in -[ozpl] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) - type = real - kind = kind_phys - intent = inout [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index c45bec3e3..ae88ca0fc 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -45,7 +45,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& gasvmr_ccl4, gasvmr_cfc113, aerodp,ext550, clouds6, clouds7, clouds8, & clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, & faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, & - aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, errmsg, errflg) + aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, latsozp, levozp, & + blatc, dphiozc, errmsg, errflg) use machine, only: kind_phys @@ -101,7 +102,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& imp_physics_mg, imp_physics_wsm6, & imp_physics_nssl, & imp_physics_fer_hires, & - yearlen, icloud, iaermdl, iaerflg + yearlen, icloud, iaermdl, iaerflg, & + latsozp, levozp integer, intent(in) :: & iovr, & ! choice of cloud-overlap method @@ -132,7 +134,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& integer, intent(in) :: spp_rad real(kind_phys), intent(in) :: spp_wts_rad(:,:) - real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp, dcorr_con + real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp, dcorr_con, blatc, dphiozc real(kind=kind_phys), intent(in) :: con_eps, epsm1, fvirt, rog, rocp, con_rd, con_pi, con_g, con_ttp, con_thgni real(kind=kind_phys), dimension(:), intent(in) :: xlat_d, xlat, xlon, & @@ -429,8 +431,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& enddo enddo else ! climatological ozone - call getozn (prslk1, xlat, im, lmk, top_at_1, & ! --- inputs - olyr) ! --- outputs + call getozn (prslk1, xlat, im, lmk, top_at_1, latsozp, levozp, blatc, dphiozc, olyr) endif ! end_if_ntoz !> - Call coszmn(), to compute cosine of zenith angle (only when SW is called) diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta index d7feaeb3f..88363ef18 100644 --- a/physics/GFS_rrtmg_pre.meta +++ b/physics/GFS_rrtmg_pre.meta @@ -1496,6 +1496,36 @@ dimensions = () type = integer intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in +[levozp] + standard_name = number_of_levels_in_ozone_data + long_name = number of levels in ozone data + units = count + dimensions = () + type = integer + intent = in +[dphiozc] + standard_name = ozone_data_parameter_1 + long_name = ozone data parameter 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[blatc] + standard_name = ozone_data_parameter_2 + long_name = ozone data parameter 2 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 384d5252d..30917b961 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -44,7 +44,7 @@ subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & iaermdl, iaerflg, aeros_file, con_pi, con_t0c, con_c, con_boltz, & con_plnk, con_solr_2008, con_solr_2002, con_g, con_rd, co2usr_file, & co2cyc_file, rad_hr_units, inc_minor_gas, icliq_lw, isubcsw, isubclw,& - iswmode, ipsd0, ltp, lextop, errmsg, errflg) + iswmode, latsozp, levozp, timeozp, ipsd0, ltp, lextop, errmsg, errflg) ! ================= subprogram documentation block ================ ! ! ! ! subprogram: GFS_rrtmg_setup_init - a subprogram to initialize radiation ! @@ -155,7 +155,8 @@ subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & integer, intent(in) :: levr, ictm, isol, ico2, iaer, ntcw, num_p3d, & ltp, npdf3d, ntoz, iovr, iovr_rand, iovr_maxrand, iovr_max, & iovr_dcorr, iovr_exp, iovr_exprand, icliq_sw, imp_physics, & - iflip, me, rad_hr_units, icliq_lw, isubcsw, isubclw, iswmode + iflip, me, rad_hr_units, icliq_lw, isubcsw, isubclw, iswmode, & + latsozp, levozp, timeozp integer, intent(in) :: idate(:) logical, intent(in) :: lcrick, lcnorm, lnoprec, do_RRTMGP, lalw1bd, & inc_minor_gas, lextop @@ -219,7 +220,7 @@ subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & call aer_init ( levr, me, iaermdl, iaerflg, lalw1bd, aeros_file, & con_pi, con_t0c, con_c, con_boltz, con_plnk, errflg, errmsg) call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, ntoz, & - con_pi, errflg, errmsg) + con_pi, latsozp, levozp, timeozp, errflg, errmsg) call cld_init ( si, levr, imp_physics, me, con_g, con_rd, errflg, errmsg) call rlwinit ( me, rad_hr_units, inc_minor_gas, icliq_lw, isubcsw, & iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, & diff --git a/physics/GFS_rrtmg_setup.meta b/physics/GFS_rrtmg_setup.meta index adf6d8750..42b999c82 100644 --- a/physics/GFS_rrtmg_setup.meta +++ b/physics/GFS_rrtmg_setup.meta @@ -173,6 +173,27 @@ dimensions = () type = integer intent = in +[levozp] + standard_name = number_of_levels_in_ozone_data + long_name = number of levels in ozone data + units = count + dimensions = () + type = integer + intent = in +[timeozp] + standard_name = number_of_times_in_ozone_data + long_name = number of times in ozone data + units = count + dimensions = () + type = integer + intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in [icliq_sw] standard_name = control_for_shortwave_radiation_liquid_clouds long_name = sw optical property for liquid clouds diff --git a/physics/ozinterp.f90 b/physics/ozinterp.f90 deleted file mode 100644 index 5b3149d61..000000000 --- a/physics/ozinterp.f90 +++ /dev/null @@ -1,212 +0,0 @@ -!>\file ozinterp.f90 -!! This file contains ozone climatology interpolation subroutines. - -!>\ingroup mod_GFS_phys_time_vary -!! This module contains subroutines of reading and interpolating ozone coefficients. -module ozinterp - - implicit none - - private - - public :: read_o3data, setindxoz, ozinterpol - -contains - - SUBROUTINE read_o3data (ntoz, me, master) - use machine, only: kind_phys - use ozne_def -!--- in/out - integer, intent(in) :: ntoz - integer, intent(in) :: me - integer, intent(in) :: master -!--- locals - integer :: i, n, k - real(kind=4), allocatable, dimension(:) :: oz_lat4, oz_pres4 - real(kind=4), allocatable, dimension(:) :: oz_time4, tempin - real(kind=4) :: blatc4 - - if (ntoz <= 0) then ! Diagnostic ozone - rewind (kozc) - read (kozc,end=101) latsozc, levozc, timeozc, blatc4 - 101 if (levozc < 10 .or. levozc > 100) then - rewind (kozc) - levozc = 17 - latsozc = 18 - blatc = -85.0 - else - blatc = blatc4 - endif - latsozp = 2 - levozp = 1 - timeoz = 1 - oz_coeff = 0 - dphiozc = -(blatc+blatc)/(latsozc-1) - return - endif - - open(unit=kozpl,file='global_o3prdlos.f77', form='unformatted', convert='big_endian') - -!--- read in indices -!--- - read (kozpl) oz_coeff, latsozp, levozp, timeoz - if (me == master) then - write(*,*) 'Reading in o3data from global_o3prdlos.f77 ' - write(*,*) ' oz_coeff = ', oz_coeff - write(*,*) ' latsozp = ', latsozp - write(*,*) ' levozp = ', levozp - write(*,*) ' timeoz = ', timeoz - endif - -!--- read in data -!--- oz_lat - latitude of data (-90 to 90) -!--- oz_pres - vertical pressure level (mb) -!--- oz_time - time coordinate (days) -!--- - allocate (oz_lat(latsozp), oz_pres(levozp),oz_time(timeoz+1)) - allocate (oz_lat4(latsozp), oz_pres4(levozp),oz_time4(timeoz+1)) - rewind (kozpl) - read (kozpl) oz_coeff, latsozp, levozp, timeoz, oz_lat4, oz_pres4, oz_time4 - oz_pres(:) = oz_pres4(:) -!--- convert pressure levels from mb to ln(Pa) - oz_pres(:) = log(100.0*oz_pres(:)) - oz_lat(:) = oz_lat4(:) - oz_time(:) = oz_time4(:) - deallocate (oz_lat4, oz_pres4, oz_time4) - -!--- read in ozplin which is in order of (lattitudes, ozone levels, coeff number, time) -!--- assume latitudes is on a uniform gaussian grid -!--- - allocate (tempin(latsozp)) - allocate (ozplin(latsozp,levozp,oz_coeff,timeoz)) - DO i=1,timeoz - DO n=1,oz_coeff - DO k=1,levozp - READ(kozpl) tempin - ozplin(:,k,n,i) = tempin(:) - ENDDO - ENDDO - ENDDO - deallocate (tempin) - - close(kozpl) - - END SUBROUTINE read_o3data -! -!********************************************************************** -! - SUBROUTINE setindxoz(npts,dlat,jindx1,jindx2,ddy) -! - USE MACHINE, ONLY: kind_phys - USE OZNE_DEF, ONLY: jo3 => latsozp, oz_lat -! - implicit none -! - integer npts, JINDX1(npts),JINDX2(npts) - real(kind=kind_phys) dlat(npts),DDY(npts) -! - integer i,j,lat -! - DO J=1,npts - jindx2(j) = jo3 + 1 - do i=1,jo3 - if (dlat(j) < oz_lat(i)) then - jindx2(j) = i - exit - endif - enddo - jindx1(j) = max(jindx2(j)-1,1) - jindx2(j) = min(jindx2(j),jo3) - if (jindx2(j) .ne. jindx1(j)) then - DDY(j) = (dlat(j) - oz_lat(jindx1(j))) & - / (oz_lat(jindx2(j)) - oz_lat(jindx1(j))) - else - ddy(j) = 1.0 - endif -! print *,' j=',j,' dlat=',dlat(j),' jindx12=',jindx1(j), & -! jjindx2(j),' oz_lat=',oz_lat(jindx1(j)), & -! oz_lat(jindx2(j)),' ddy=',ddy(j) - ENDDO - - RETURN - END SUBROUTINE setindxoz -! -!********************************************************************** -! - SUBROUTINE ozinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ozplout,ddy) -! - USE MACHINE, ONLY : kind_phys - USE OZNE_DEF - implicit none - integer iday,j,j1,j2,l,npts,nc,n1,n2 - real(kind=kind_phys) fhour,tem, tx1, tx2 -! - - integer JINDX1(npts), JINDX2(npts) - integer me, idate(4), IDAT(8),JDAT(8) -! - real(kind=kind_phys) DDY(npts) - real(kind=kind_phys) ozplout(npts,levozp,oz_coeff) - real(kind=kind_phys) rjday - integer jdow, jdoy, jday - real(8) rinc(5) - real(4) rinc4(5) - integer w3kindreal,w3kindint -! - IDAT=0 - IDAT(1)=IDATE(4) - IDAT(2)=IDATE(2) - IDAT(3)=IDATE(3) - IDAT(5)=IDATE(1) - RINC=0. - RINC(2)=FHOUR - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL W3MOVDAT(RINC4,IDAT,JDAT) - else - CALL W3MOVDAT(RINC,IDAT,JDAT) - endif -! - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jdat,jdow,jdoy,jday) - rjday = jdoy + jdat(5) / 24. - IF (RJDAY < oz_time(1)) RJDAY = RJDAY + 365. -! - n2 = timeoz + 1 - do j=2,timeoz - if (rjday < oz_time(j)) then - n2 = j - exit - endif - enddo - n1 = n2 - 1 -! -! if (me == 0) print *,' n1=',n1,' n2=',n2,' rjday=',rjday -! &,'oz_time=',oz_time(n1),oz_time(n2) -! - - tx1 = (oz_time(n2) - rjday) / (oz_time(n2) - oz_time(n1)) - tx2 = 1.0 - tx1 - - if (n2 > timeoz) n2 = n2 - timeoz -! - do nc=1,oz_coeff - DO L=1,levozp - DO J=1,npts - J1 = JINDX1(J) - J2 = JINDX2(J) - TEM = 1.0 - DDY(J) - ozplout(j,L,nc) = & - tx1*(TEM*ozplin(J1,L,nc,n1)+DDY(J)*ozplin(J2,L,nc,n1)) & - + tx2*(TEM*ozplin(J1,L,nc,n2)+DDY(J)*ozplin(J2,L,nc,n2)) - ENDDO - ENDDO - enddo -! - RETURN - END SUBROUTINE ozinterpol - -end module ozinterp diff --git a/physics/ozne_def.f b/physics/ozne_def.f deleted file mode 100644 index 8f3af6240..000000000 --- a/physics/ozne_def.f +++ /dev/null @@ -1,24 +0,0 @@ -!>\file ozne_def.f -!! This file contains the ozone array definition used in ozone physics. - -!>\ingroup mod_GFS_phys_time_vary -!! This module defines arrays in Ozone scheme. - module ozne_def - -!> \section arg_table_ozne_def -!! \htmlinclude ozne_def.html -!! - - use machine , only : kind_phys - implicit none - - integer, parameter :: kozpl=28, kozc=48 - - integer latsozp, levozp, timeoz, latsozc, levozc, timeozc - &, oz_coeff - real (kind=kind_phys) blatc, dphiozc - real (kind=kind_phys), allocatable :: oz_lat(:), oz_pres(:) - &, oz_time(:) - real (kind=kind_phys), allocatable :: ozplin(:,:,:,:) - - end module ozne_def diff --git a/physics/ozne_def.meta b/physics/ozne_def.meta deleted file mode 100644 index 3cad9c14d..000000000 --- a/physics/ozne_def.meta +++ /dev/null @@ -1,29 +0,0 @@ -[ccpp-table-properties] - name = ozne_def - type = module - dependencies = machine.F - -[ccpp-arg-table] - name = ozne_def - type = module - -[levozp] - standard_name = vertical_dimension_of_ozone_forcing_data - long_name = number of vertical layers in ozone forcing data - units = count - dimensions = () - type = integer -[oz_coeff] - standard_name = number_of_coefficients_in_ozone_forcing_data - long_name = number of coefficients in ozone forcing data - units = index - dimensions = () - type = integer -[oz_pres] - standard_name = natural_log_of_ozone_forcing_data_pressure_levels - long_name = natural log of ozone forcing data pressure levels in Pa - units = 1 - dimensions = (vertical_dimension_of_ozone_forcing_data) - type = real - kind = kind_phys - active = (index_of_ozone_mixing_ratio_in_tracer_concentration_array>0) diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 new file mode 100644 index 000000000..17f2178a4 --- /dev/null +++ b/physics/ozphys_2015.F90 @@ -0,0 +1,343 @@ +! ########################################################################################### +!> \file ozphys_2015.F90 +!! +! ########################################################################################### +module ozphys_2015 + use machine , only : kind_phys + implicit none + public ozphys_2015_init, ozphys_2015_timestep_init, ozphys_2015_run +contains + +! ########################################################################################### +!>\defgroup GFS_ozphys_2015 GFS Ozone Photochemistry (2015) Module +!! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. +!> @{ +!> \section arg_table_ozphys_2015_init Argument Table +!! \htmlinclude ozphys_2015_init.html +!! +! ########################################################################################### + subroutine ozphys_2015_init(oz_phys_2015, nPts, latsozp, oz_lat, dlat, jindx1, jindx2, & + ddy, errmsg, errflg) + ! Inputs + logical, intent(in) :: & + oz_phys_2015 ! Control flag for NRL 2015 ozone physics scheme + integer, intent(in) :: & + nPts, & ! Horizontal dimension + latsozp ! Number of latitudes in ozone data + real(kind_phys), intent(in), dimension(:) :: & + oz_lat, & ! Latitudes of ozone data + dlat ! Latitudes of grid + ! Outputs + integer, intent(out), dimension(:) :: & + jindx1, & ! Interpolation index (low) for ozone data + jindx2 ! Interpolation index (high) for ozone data + real(kind_phys), intent(out), dimension(:) :: & + ddy ! Interpolation high index for ozone data + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + ! Local + integer i,j + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Sanity check + if (.not.oz_phys_2015) then + write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' + errflg = 1 + return + endif + + ! Set indices + do j=1,nPts + jindx2(j) = latsozp + 1 + do i=1,latsozp + if (dlat(j) < oz_lat(i)) then + jindx2(j) = i + exit + endif + enddo + jindx1(j) = max(jindx2(j)-1,1) + jindx2(j) = min(jindx2(j),latsozp) + if (jindx2(j) .ne. jindx1(j)) then + ddy(j) = (dlat(j) - oz_lat(jindx1(j))) / (oz_lat(jindx2(j)) - oz_lat(jindx1(j))) + else + ddy(j) = 1.0 + endif + enddo + + end subroutine ozphys_2015_init + +! ########################################################################################### +!> \section arg_table_ozphys_2015_timestep_init Argument Table +!! \htmlinclude ozphys_2015_timestep_init.html +!! +! ########################################################################################### + subroutine ozphys_2015_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp, levozp, & + oz_coeff, timeoz, ozplin, oz_time, oz_pres, oz_lat, ddy, ozplout, errmsg, errflg) + ! Inputs + integer, intent(in) :: & + nPts, & ! Horizontal dimension + latsozp, & ! Number of latitudes in ozone data + levozp, & ! Number of levels in ozone data + oz_coeff, & ! Number of coefficients in ozone data + timeoz ! Number of times in ozone data + integer, intent(in),dimension(:) :: & + idate, & ! Initial date with different size and ordering + jindx1, & ! Interpolation index (low) for ozone + jindx2 ! Interpolation index (high) for ozone + real(kind_phys), intent(in) :: & + fhour ! Forecast hour + real(kind_phys), intent(in), dimension(:) :: & + ddy, & ! Interpolation high index for ozone data + oz_lat, & ! Latitudes for ozone data + oz_pres, & ! Levels for ozone data + oz_time ! Time for ozone data + real(kind_phys), intent(in), dimension(:,:,:,:) :: & + ozplin ! Ozone data + + ! Outputs + real(kind_phys), intent(out), dimension(:,:,:) :: & + ozplout ! Ozone forcing data + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + ! Local + integer :: idat(8),jdat(8),iday,j,j1,j2,l,nc,n1,n2,jdow,jdoy,& + jday,w3kindreal,w3kindint + real(kind_phys) :: tem, tx1, tx2, rjday + real(8) :: rinc(5) + real(4) :: rinc4(5) + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! + idat=0 + idat(1)=idate(4) + idat(2)=idate(2) + idat(3)=idate(3) + idat(5)=idate(1) + rinc=0. + rinc(2)=fhour + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + rinc4=rinc + CALL w3movdat(rinc4,idat,jdat) + else + CALL w3movdat(rinc,idat,jdat) + endif + ! + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jdat,jdow,jdoy,jday) + rjday = jdoy + jdat(5) / 24. + IF (RJDAY < oz_time(1)) RJDAY = RJDAY + 365. + ! + n2 = timeoz + 1 + do j=2,timeoz + if (rjday < oz_time(j)) then + n2 = j + exit + endif + enddo + n1 = n2 - 1 + + tx1 = (oz_time(n2) - rjday) / (oz_time(n2) - oz_time(n1)) + tx2 = 1.0 - tx1 + + if (n2 > timeoz) n2 = n2 - timeoz + ! + do nc=1,oz_coeff + do L=1,levozp + do J=1,npts + J1 = jindx1(J) + J2 = jindx2(J) + TEM = 1.0 - ddy(J) + ozplout(j,L,nc) = tx1*(TEM*ozplin(J1,L,nc,n1)+ddy(J)*ozplin(J2,L,nc,n1)) & + + tx2*(TEM*ozplin(J1,L,nc,n2)+ddy(J)*ozplin(J2,L,nc,n2)) + enddo + enddo + enddo + + ! + return + + end subroutine ozphys_2015_timestep_init + +! ########################################################################################### +!> The operational GFS currently parameterizes ozone production and +!! destruction based on monthly mean coefficients ( +!! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval +!! Research Laboratory through CHEM2D chemistry model +!! (McCormack et al. (2006) \cite mccormack_et_al_2006). +!! \section arg_table_ozphys_2015_run Argument Table +!! \htmlinclude ozphys_2015_run.html +!! +!> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm +!> - This code assumes that both prsl and po3 are from bottom to top +!! as are all other variables. +!> - This code is specifically for NRL parameterization and +!! climatological T and O3 are in location 5 and 6 of prdout array +!!\author June 2015 - Shrinivas Moorthi +! ########################################################################################### + subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_coeff, & + delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss, & + index_of_process_ozmix, index_of_process_temp, index_of_process_overhead_ozone, & + con_g, errmsg, errflg) + + ! Inputs + logical, intent(in) :: & + ldiag3d + real(kind_phys),intent(in) :: & + con_g + integer, intent(in) :: & + im, & ! + levs, & ! + ko3, & ! + pl_coeff, & ! + ntoz, & ! + index_of_process_prod_loss, & ! + index_of_process_ozmix, & ! + index_of_process_temp, & + index_of_process_overhead_ozone + integer, intent(in), dimension(:,:) :: & + dtidx ! + real(kind_phys), intent(in) :: & + dt ! + real(kind_phys), intent(in), dimension(:) :: & + po3 ! + real(kind_phys), intent(in), dimension(:,:) :: & + prsl, & ! + tin, & ! + delp ! + real(kind_phys), intent(in), dimension(:,:,:) :: & + prdout ! + + ! In/Outs + real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & + dtend ! + + ! Outputs + real(kind=kind_phys), intent(inout), dimension(:,:) :: & + oz ! + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + ! Locals + integer :: k, kmax, kmin, l, i, j + integer, dimension(4) :: idtend + logical, dimension(im) :: flg + real :: gravi + real(kind_phys) :: pmax, pmin, tem, temp + real(kind_phys), dimension(im) :: wk1, wk2, wk3, ozib + real(kind_phys), dimension(im,pl_coeff) :: prod + real(kind_phys), dimension(im,levs) :: ozi + real(kind_phys), dimension(im,levs+1) :: colo3, coloz + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Are UFS diagnostic tendencies requested? If so, set up bookeeping indices... + if(ldiag3d) then + idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 + idtend(2) = dtidx(100+ntoz,index_of_process_ozmix) ! was ozp2 + idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 + idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 + else + idtend=0 + endif + + ! Temporaries + ozi = oz + gravi=1.0/con_g + + colo3(:,levs+1) = 0.0 + coloz(:,levs+1) = 0.0 + + do l=levs,1,-1 + pmin = 1.0e10 + pmax = -1.0e10 + + do i=1,im + wk1(i) = log(prsl(i,l)) + pmin = min(wk1(i), pmin) + pmax = max(wk1(i), pmax) + prod(i,:) = 0.0 + enddo + kmax = 1 + kmin = 1 + do k=1,ko3-1 + if (pmin < po3(k)) kmax = k + if (pmax < po3(k)) kmin = k + enddo + ! + do k=kmin,kmax + temp = 1.0 / (po3(k) - po3(k+1)) + do i=1,im + flg(i) = .false. + if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1)) then + flg(i) = .true. + wk2(i) = (wk1(i) - po3(k+1)) * temp + wk3(i) = 1.0 - wk2(i) + endif + enddo + do j=1,pl_coeff + do i=1,im + if (flg(i)) then + prod(i,j) = wk2(i) * prdout(i,k,j) + wk3(i) * prdout(i,k+1,j) + endif + enddo + enddo + enddo + + do j=1,pl_coeff + do i=1,im + if (wk1(i) < po3(ko3)) then + prod(i,j) = prdout(i,ko3,j) + endif + if (wk1(i) >= po3(1)) then + prod(i,j) = prdout(i,1,j) + endif + enddo + enddo + do i=1,im + colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l)*gravi + coloz(i,l) = coloz(i,l+1) + prod(i,6) * delp(i,l)*gravi + prod(i,2) = min(prod(i,2), 0.0) + enddo + do i=1,im + ozib(i) = ozi(i,l) ! no filling + tem = prod(i,1) - prod(i,2) * prod(i,6) + prod(i,3) * (tin(i,l) - prod(i,5)) & + + prod(i,4) * (colo3(i,l)-coloz(i,l)) + oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) + enddo + if(idtend(1)>=1) then + dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + (prod(:,1)-prod(:,2)*prod(:,6))*dt + endif + if(idtend(2)>=1) then + dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + (oz(:,l) - ozib(:)) + endif + if(idtend(3)>=1) then + dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + prod(:,3)*(tin(:,l)-prod(:,5))*dt + endif + if(idtend(4)>=1) then + dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + prod(:,4) * (colo3(:,l)-coloz(:,l))*dt + endif + enddo + + return + end subroutine ozphys_2015_run +!> @} +end module ozphys_2015 diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f deleted file mode 100644 index 85c79f733..000000000 --- a/physics/ozphys_2015.f +++ /dev/null @@ -1,190 +0,0 @@ -!> \file ozphys_2015.f -!! This file is ozone sources and sinks. - - - module ozphys_2015 - - contains - -!>\defgroup GFS_ozphys_2015 GFS Ozone Photochemistry (2015) Module -!! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. -!> @{ -!> \section arg_table_ozphys_2015_init Argument Table -!! \htmlinclude ozphys_2015_init.html -!! - subroutine ozphys_2015_init(oz_phys_2015, errmsg, errflg) - - implicit none - logical, intent(in) :: oz_phys_2015 - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not.oz_phys_2015) then - write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' - errflg = 1 - return - endif - - end subroutine ozphys_2015_init - -!> The operational GFS currently parameterizes ozone production and -!! destruction based on monthly mean coefficients ( -!! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval -!! Research Laboratory through CHEM2D chemistry model -!! (McCormack et al. (2006) \cite mccormack_et_al_2006). -!! \section arg_table_ozphys_2015_run Argument Table -!! \htmlinclude ozphys_2015_run.html -!! -!> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm -!> - This code assumes that both prsl and po3 are from bottom to top -!! as are all other variables. -!> - This code is specifically for NRL parameterization and -!! climatological T and O3 are in location 5 and 6 of prdout array -!!\author June 2015 - Shrinivas Moorthi - subroutine ozphys_2015_run ( & - & im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_coeff, & - & delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss& - & , index_of_process_ozmix, index_of_process_temp, & - & index_of_process_overhead_ozone, con_g, me, errmsg, errflg) -! -! - use machine , only : kind_phys - implicit none -! - real(kind=kind_phys),intent(in) :: con_g - real :: gravi - integer, intent(in) :: im, levs, ko3, pl_coeff,me - real(kind=kind_phys), intent(in) :: po3(:), & - & prsl(:,:), tin(:,:), & - & delp(:,:), & - & prdout(:,:,:), dt - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), ntoz, & - & index_of_process_prod_loss, index_of_process_ozmix, & - & index_of_process_temp, index_of_process_overhead_ozone - real(kind=kind_phys), intent(inout) :: oz(im,levs) - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - integer k,kmax,kmin,l,i,j, idtend(4) - logical ldiag3d, flg(im), qdiag3d - real(kind=kind_phys) pmax, pmin, tem, temp - real(kind=kind_phys) wk1(im), wk2(im), wk3(im),prod(im,pl_coeff), & - & ozib(im), colo3(im,levs+1), coloz(im,levs+1),& - & ozi(im,levs) -! - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 - idtend(2) = dtidx(100+ntoz,index_of_process_ozmix) ! was ozp2 - idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 - idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 - else - idtend=0 - endif - -!ccpp: save input oz in ozi - ozi = oz - gravi=1.0/con_g - - colo3(:,levs+1) = 0.0 - coloz(:,levs+1) = 0.0 -! - do l=levs,1,-1 - pmin = 1.0e10 - pmax = -1.0e10 -! - do i=1,im - wk1(i) = log(prsl(i,l)) - pmin = min(wk1(i), pmin) - pmax = max(wk1(i), pmax) - prod(i,:) = 0.0 - enddo - kmax = 1 - kmin = 1 - do k=1,ko3-1 - if (pmin < po3(k)) kmax = k - if (pmax < po3(k)) kmin = k - enddo -! - do k=kmin,kmax - temp = 1.0 / (po3(k) - po3(k+1)) - do i=1,im - flg(i) = .false. - if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1)) then - flg(i) = .true. - wk2(i) = (wk1(i) - po3(k+1)) * temp - wk3(i) = 1.0 - wk2(i) - endif - enddo - do j=1,pl_coeff - do i=1,im - if (flg(i)) then - prod(i,j) = wk2(i) * prdout(i,k,j) - & + wk3(i) * prdout(i,k+1,j) - endif - enddo - enddo - enddo -! - do j=1,pl_coeff - do i=1,im - if (wk1(i) < po3(ko3)) then - prod(i,j) = prdout(i,ko3,j) - endif - if (wk1(i) >= po3(1)) then - prod(i,j) = prdout(i,1,j) - endif - enddo - enddo - do i=1,im - colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l)*gravi - coloz(i,l) = coloz(i,l+1) + prod(i,6) * delp(i,l)*gravi - prod(i,2) = min(prod(i,2), 0.0) - enddo -! write(1000+me,*) ' colo3=',colo3(1,l),' coloz=',coloz(1,l) -! &,' l=',l - do i=1,im - ozib(i) = ozi(i,l) ! no filling - tem = prod(i,1) - prod(i,2) * prod(i,6) - & + prod(i,3) * (tin(i,l) - prod(i,5)) - & + prod(i,4) * (colo3(i,l)-coloz(i,l)) - -! if (me .eq. 0) print *,'ozphys_2015 tem=',tem,' prod=',prod(i,:) -! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) - -!ccpp ozo(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) - oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) - enddo - if(idtend(1)>=1) then - dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 - & (prod(:,1)-prod(:,2)*prod(:,6))*dt - endif - if(idtend(2)>=1) then - dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 - & (oz(:,l) - ozib(:)) - endif - if(idtend(3)>=1) then - dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 - & prod(:,3)*(tin(:,l)-prod(:,5))*dt - endif - if(idtend(4)>=1) then - dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 - & prod(:,4) * (colo3(:,l)-coloz(:,l))*dt - endif - enddo ! vertical loop -! - return - end subroutine ozphys_2015_run - -!> @} - - end module ozphys_2015 diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 8bce7defe..59621b386 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -7,6 +7,20 @@ [ccpp-arg-table] name = ozphys_2015_init type = scheme +[nPts] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in [oz_phys_2015] standard_name = flag_for_nrl_2015_ozone_scheme long_name = flag for new (2015) ozone physics @@ -14,6 +28,176 @@ dimensions = () type = logical intent = in +[oz_lat] + standard_name = ozone_data_latitude + long_name = ozone data latitude + units = deg + dimensions = (number_of_latitudes_in_ozone_data) + type = real + kind = kind_phys + intent = in +[dlat] + standard_name = latitude_in_degree + long_name = latitude in degree north + units = degree_north + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in +[jindx1] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out +[jindx2] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = out +[ddy] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + +######################################################################## +[ccpp-arg-table] + name = ozphys_2015_timestep_init + type = scheme +[nPts] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in +[idate] + standard_name = date_and_time_at_model_initialization_in_united_states_order + long_name = initial date with different size and ordering + units = none + dimensions = (4) + type = integer + intent = in +[fhour] + standard_name = forecast_time + long_name = current forecast time + units = h + dimensions = () + type = real + kind = kind_phys + intent = in +[jindx1] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[jindx2] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in +[levozp] + standard_name = number_of_levels_in_ozone_data + long_name = number of levels in ozone data + units = count + dimensions = () + type = integer + intent = in +[oz_coeff] + standard_name = number_of_coefficients_in_ozone_data + long_name = number of coefficients in ozone data + units = count + dimensions = () + type = integer + intent = in +[timeoz] + standard_name = number_of_times_in_ozone_data + long_name = number of times in ozone data + units = count + dimensions = () + type = integer + intent = in +[ozplin] + standard_name = ozone_data + long_name = ozone data + units = 1 + dimensions = (number_of_latitudes_in_ozone_data,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data,number_of_times_in_ozone_data) + type = real + kind = kind_phys + intent = in +[oz_time] + standard_name = ozone_data_time + long_name = ozone data time + units = none + dimensions = (13) + type = real + kind = kind_phys + intent = in +[oz_pres] + standard_name = ozone_data_level_pressure + long_name = ozone data level pressure + units = Pa + dimensions = (number_of_levels_in_ozone_data) + type = real + kind = kind_phys + intent = in +[oz_lat] + standard_name = ozone_data_latitude + long_name = ozone data latitude + units = deg + dimensions = (number_of_latitudes_in_ozone_data) + type = real + kind = kind_phys + intent = in +[ddy] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in +[ozplout] + standard_name = ozone_forcing + long_name = ozone forcing data + units = mixed + dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + type = real + kind = kind_phys + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -49,7 +233,7 @@ type = integer intent = in [ko3] - standard_name = vertical_dimension_of_ozone_forcing_data + standard_name = number_of_levels_in_ozone_data long_name = number of vertical layers in ozone forcing data units = count dimensions = () @@ -80,10 +264,10 @@ kind = kind_phys intent = in [po3] - standard_name = natural_log_of_ozone_forcing_data_pressure_levels + standard_name = natural_log_of_ozone_data_pressure_levels long_name = natural log of ozone forcing data pressure levels units = 1 - dimensions = (vertical_dimension_of_ozone_forcing_data) + dimensions = (number_of_levels_in_ozone_data) type = real kind = kind_phys intent = in @@ -99,14 +283,14 @@ standard_name = ozone_forcing long_name = ozone forcing data units = mixed - dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) + dimensions = (horizontal_loop_extent,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) type = real kind = kind_phys intent = in [pl_coeff] - standard_name = number_of_coefficients_in_ozone_forcing_data + standard_name = number_of_coefficients_in_ozone_data long_name = number of coefficients in ozone forcing data - units = index + units = count dimensions = () type = integer intent = in @@ -183,13 +367,6 @@ type = real kind = kind_phys intent = in -[me] - standard_name = mpi_rank - long_name = rank of the current MPI task - units = index - dimensions = () - type = integer - intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/radiation_gases.f b/physics/radiation_gases.f index ccc3b598a..5f017598f 100644 --- a/physics/radiation_gases.f +++ b/physics/radiation_gases.f @@ -142,9 +142,6 @@ module module_radiation_gases use machine, only : kind_phys, kind_io4 use funcphys, only : fpkapx - use ozne_def, only : JMR => latsozc, LOZ => levozc, & - & blte => blatc, dlte=> dphiozc, & - & timeozc => timeozc use module_iounitdef, only : NIO3CLM, NICO2CN ! implicit none @@ -233,7 +230,7 @@ module module_radiation_gases !>\section gas_init_gen gas_init General Algorithm !----------------------------------- subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & - & ictmflg, ioznflg, con_pi, errflg, errmsg) + & ictmflg, ioznflg, con_pi, JMR, LOZ, timeozc, errflg, errmsg) ! =================================================================== ! ! ! @@ -283,8 +280,10 @@ subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & ! --- inputs: integer, intent(in) :: me, ictmflg, ioznflg, ico2flg + integer, intent(in) :: JMR, LOZ, timeozc character(len=26),intent(in) :: co2usr_file,co2cyc_file real(kind=kind_phys), intent(in) :: con_pi + ! --- output: character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1115,7 +1114,8 @@ end subroutine getgases !! ratio (g/g) !>\section getozn_gen getozn General Algorithm !----------------------------------- - subroutine getozn( prslk,xlat, IMAX, LM, top_at_1, o3mmr) + subroutine getozn( prslk,xlat, IMAX, LM, top_at_1, JMR, LOZ, blte,& + & dlte, o3mmr) ! =================================================================== ! ! ! @@ -1144,7 +1144,8 @@ subroutine getozn( prslk,xlat, IMAX, LM, top_at_1, o3mmr) implicit none ! --- inputs: - integer, intent(in) :: IMAX, LM + integer, intent(in) :: IMAX, LM, JMR, LOZ + real(kind=kind_phys), intent(in) :: blte, dlte logical, intent(in) :: top_at_1 real (kind=kind_phys), intent(in) :: prslk(:,:), xlat(:) From 70b9d7e5ddaf8a4308415ea601a1f8366f62e9d1 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 25 May 2023 10:27:12 -0600 Subject: [PATCH 07/81] RRTMGP changes for refactored NRL ozone physics. --- physics/GFS_rrtmgp_pre.F90 | 13 +++++++--- physics/GFS_rrtmgp_pre.meta | 30 ++++++++++++++++++++++ physics/GFS_rrtmgp_setup.F90 | 13 +++++----- physics/GFS_rrtmgp_setup.meta | 21 ++++++++++++++++ physics/ozphys_2015.F90 | 47 ++++++++++++++++++----------------- 5 files changed, 91 insertions(+), 33 deletions(-) diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index 009eb8c38..e9cbc3d23 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -117,7 +117,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl vmr_n2o, vmr_co2, tsfg, tsfa, qs_lay, q_lay, tv_lay, & relhum, deltaZ, deltaZc, deltaP, active_gases_array, & tsfc_radtime, coszen, coszdg, top_at_1, iSFC, iTOA, nDay, idxday, semis, & - sfc_emiss_byband, ico2, con_pi, errmsg, errflg) + sfc_emiss_byband, ico2, latsozp, levozp, blatc, dphiozc, con_pi, errmsg, errflg) ! Inputs integer, intent(in) :: & @@ -125,13 +125,17 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl nCol, & ! Number of horizontal grid points nLev, & ! Number of vertical layers ico2, & ! Flag for co2 radiation scheme - i_o3 ! Index into tracer array for ozone + i_o3, & ! Index into tracer array for ozone + latsozp, & ! + levozp logical, intent(in) :: & doSWrad, & ! Call SW radiation? doLWrad ! Call LW radiation real(kind_phys), intent(in) :: & fhswr, & ! Frequency of SW radiation call. - fhlwr ! Frequency of LW radiation call. + fhlwr, & ! Frequency of LW radiation call. + blatc, & ! + dphiozc real(kind_phys), intent(in) :: & con_g, & ! Physical constant: gravitational constant con_rd, & ! Physical constant: gas-constant for dry air @@ -350,7 +354,8 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl enddo ! OR Use climatological ozone data else - call getozn (prslk(1:NCOL,:), xlat, nCol, nLev, top_at_1, o3_lay) + call getozn (prslk(1:NCOL,:), xlat, nCol, nLev, top_at_1, latsozp, levozp, blatc, & + dphiozc, o3_lay) endif ! ####################################################################################### diff --git a/physics/GFS_rrtmgp_pre.meta b/physics/GFS_rrtmgp_pre.meta index abb07b825..47980b513 100644 --- a/physics/GFS_rrtmgp_pre.meta +++ b/physics/GFS_rrtmgp_pre.meta @@ -503,6 +503,36 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in +[levozp] + standard_name = number_of_levels_in_ozone_data + long_name = number of levels in ozone data + units = count + dimensions = () + type = integer + intent = in +[dphiozc] + standard_name = ozone_data_parameter_1 + long_name = ozone data parameter 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[blatc] + standard_name = ozone_data_parameter_2 + long_name = ozone data parameter 2 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index 76db14279..7b5479e60 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -37,9 +37,10 @@ module GFS_rrtmgp_setup subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, & imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, & imp_physics_zhao_carr_pdf, imp_physics_mg, si, levr, ictm, isol, ico2, iaer, & - ntcw, ntoz, iovr, isubc_sw, isubc_lw, lalw1bd, idate, me, aeros_file, & - iaermdl, iaerflg, con_pi, con_t0c, con_c, con_boltz, con_plnk, solar_file, & - con_solr_2008, con_solr_2002, co2usr_file, co2cyc_file, ipsd0, errmsg, errflg) + ntcw, ntoz, iovr, latsozp, levozp, timeozp, isubc_sw, isubc_lw, lalw1bd, idate, & + me, aeros_file, iaermdl, iaerflg, con_pi, con_t0c, con_c, con_boltz, con_plnk, & + solar_file, con_solr_2008, con_solr_2002, co2usr_file, co2cyc_file, ipsd0, & + errmsg, errflg) ! Inputs logical, intent(in) :: do_RRTMGP @@ -57,8 +58,7 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, real(kind_phys), dimension(:), intent(in) :: & si integer, intent(in) :: levr, ictm, isol, ico2, iaer, & - ntcw, ntoz, iovr, isubc_sw, isubc_lw, & - me + ntcw, ntoz, iovr, isubc_sw, isubc_lw, latsozp, levozp, timeozp, me logical, intent(in) :: & lalw1bd integer, intent(in), dimension(:) :: & @@ -129,7 +129,8 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, call sol_init ( me, isol, solar_file, con_solr_2008, con_solr_2002, con_pi ) call aer_init ( levr, me, iaermdl, iaerflg, lalw1bd, aeros_file, con_pi, con_t0c, & con_c, con_boltz, con_plnk, errflg, errmsg) - call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, ntoz, con_pi, errflg, errmsg ) + call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, ntoz, con_pi, latsozp, & + levozp, timeozp, errflg, errmsg ) if ( me == 0 ) then print *,' return from rad_initialize (GFS_rrtmgp_setup_init) - after calling radinit' diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/GFS_rrtmgp_setup.meta index c4f7cfaa5..567294d4a 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/GFS_rrtmgp_setup.meta @@ -266,6 +266,27 @@ dimensions = () type = integer intent = inout +[levozp] + standard_name = number_of_levels_in_ozone_data + long_name = number of levels in ozone data + units = count + dimensions = () + type = integer + intent = in +[timeozp] + standard_name = number_of_times_in_ozone_data + long_name = number of times in ozone data + units = count + dimensions = () + type = integer + intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in [iaermdl] standard_name = control_for_aerosol_radiation_scheme long_name = control of aerosol scheme in radiation diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index 17f2178a4..4e73a5262 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -83,7 +83,7 @@ subroutine ozphys_2015_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp integer, intent(in) :: & nPts, & ! Horizontal dimension latsozp, & ! Number of latitudes in ozone data - levozp, & ! Number of levels in ozone data + levozp, & ! Number of vertical layers in ozone data oz_coeff, & ! Number of coefficients in ozone data timeoz ! Number of times in ozone data integer, intent(in),dimension(:) :: & @@ -188,6 +188,7 @@ end subroutine ozphys_2015_timestep_init !> - This code is specifically for NRL parameterization and !! climatological T and O3 are in location 5 and 6 of prdout array !!\author June 2015 - Shrinivas Moorthi +!!\author May 2023 - Dustin Swales ! ########################################################################################### subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_coeff, & delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss, & @@ -196,43 +197,43 @@ subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_c ! Inputs logical, intent(in) :: & - ldiag3d + ldiag3d ! Flag to output GFS diagnostic tendencies real(kind_phys),intent(in) :: & - con_g + con_g ! Physical constant: Gravitational acceleration (ms-2) integer, intent(in) :: & - im, & ! - levs, & ! - ko3, & ! - pl_coeff, & ! - ntoz, & ! - index_of_process_prod_loss, & ! - index_of_process_ozmix, & ! - index_of_process_temp, & - index_of_process_overhead_ozone + im, & ! Horizontal dimension + levs, & ! Number of vertical layers + ko3, & ! Number of vertical layers in ozone forcing data + pl_coeff, & ! Number of coefficients in ozone forcing data + ntoz, & ! Index for ozone mixing ratio + index_of_process_prod_loss, & ! Index for process in diagnostic tendency output + index_of_process_ozmix, & ! Index for process in diagnostic tendency output + index_of_process_temp, & ! Index for process in diagnostic tendency output + index_of_process_overhead_ozone ! Index for process in diagnostic tendency output integer, intent(in), dimension(:,:) :: & - dtidx ! + dtidx ! Bookkeeping indices for GFS diagnostic tendencies real(kind_phys), intent(in) :: & - dt ! + dt ! Physics timestep (seconds) real(kind_phys), intent(in), dimension(:) :: & - po3 ! + po3 ! Natural log of ozone forcing data pressure levels real(kind_phys), intent(in), dimension(:,:) :: & - prsl, & ! - tin, & ! - delp ! + prsl, & ! Air-pressure (Pa) + tin, & ! Temperature of new-state (K) + delp ! Difference between mid-layer pressures (Pa) real(kind_phys), intent(in), dimension(:,:,:) :: & - prdout ! + prdout ! Ozone forcing data ! In/Outs real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & - dtend ! + dtend ! Diagnostic tendencies for state variables ! Outputs real(kind=kind_phys), intent(inout), dimension(:,:) :: & - oz ! + oz ! Ozone concentration updated by physics character(len=*), intent(out) :: & - errmsg ! CCPP error message + errmsg ! CCPP error message integer, intent(out) :: & - errflg ! CCPP error flag + errflg ! CCPP error flag ! Locals integer :: k, kmax, kmin, l, i, j From 6ff8689d3e1ed9ccaec7c09db6d8b12f633e59c1 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 25 May 2023 11:34:29 -0600 Subject: [PATCH 08/81] Revert change to CI test from NCAR->UWM merge --- .github/workflows/ci_fv3_ccpp_prebuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_fv3_ccpp_prebuild.yml b/.github/workflows/ci_fv3_ccpp_prebuild.yml index b23c9977e..a5c2f8092 100644 --- a/.github/workflows/ci_fv3_ccpp_prebuild.yml +++ b/.github/workflows/ci_fv3_ccpp_prebuild.yml @@ -24,7 +24,7 @@ jobs: run: echo "GIT_REMOTE_HASH=`git rev-parse HEAD`" >> $GITHUB_ENV - name: Checkout latest fv3atm - run: git clone https://github.com/NCAR/fv3atm.git + run: git clone https://github.com/NOAA-EMC/fv3atm.git - name: Initialize submodules run: | From 3682e476db2e1899f58f1ae4ace8996438ba6a3f Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Wed, 14 Jun 2023 13:23:10 -0600 Subject: [PATCH 09/81] Rollback changes to rain evaporation --- physics/module_mp_thompson.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 9ef110b63..38ee79dfa 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -3712,13 +3712,13 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & lamr = 1./ilamr(k) !> - Rapidly eliminate near zero values when low humidity (<95%) if (qv(k)/qvs(k) .lt. 0.95 .AND. rr(k)*orho.le.1.E-8) then - prv_rev(k) = rr(k)*odts + prv_rev(k) = rr(k)*orho*odts else prv_rev(k) = t1_evap*diffu(k)*(-ssatw(k))*N0_r(k)*rvs & * (t1_qr_ev*ilamr(k)**cre(10) & + t2_qr_ev*vsc2(k)*rhof2(k)*((lamr+0.5*fv_r)**(-cre(11)))) - rate_max = MIN((rr(k)*odts), (qvs(k)-qv(k))*rho(k)*odts) - prv_rev(k) = MIN(DBLE(rate_max*orho), prv_rev(k)*orho) + rate_max = MIN((rr(k)*orho*odts), (qvs(k)-qv(k))*odts) + prv_rev(k) = MIN(DBLE(rate_max), prv_rev(k)*orho) !..TEST: G. Thompson 10 May 2013 !> - Reduce the rain evaporation in same places as melting graupel occurs. From 9859339985948e4d1fe2c721f7fab7830101dd72 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 15 Jun 2023 11:17:35 -0600 Subject: [PATCH 10/81] Some changes --- physics/GFS_rrtmg_pre.F90 | 6 +++--- physics/GFS_rrtmg_pre.meta | 12 ++++++------ physics/GFS_rrtmgp_pre.F90 | 8 ++++---- physics/GFS_rrtmgp_pre.meta | 12 ++++++------ physics/ozphys_2015.F90 | 7 ++++--- physics/ozphys_2015.meta | 8 -------- 6 files changed, 23 insertions(+), 30 deletions(-) diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index ae88ca0fc..cf9bbb6aa 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -45,7 +45,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& gasvmr_ccl4, gasvmr_cfc113, aerodp,ext550, clouds6, clouds7, clouds8, & clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, & faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, & - aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, latsozp, levozp, & + aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, latsozc, levozc, & blatc, dphiozc, errmsg, errflg) use machine, only: kind_phys @@ -103,7 +103,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& imp_physics_nssl, & imp_physics_fer_hires, & yearlen, icloud, iaermdl, iaerflg, & - latsozp, levozp + latsozc, levozc integer, intent(in) :: & iovr, & ! choice of cloud-overlap method @@ -431,7 +431,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& enddo enddo else ! climatological ozone - call getozn (prslk1, xlat, im, lmk, top_at_1, latsozp, levozp, blatc, dphiozc, olyr) + call getozn (prslk1, xlat, im, lmk, top_at_1, latsozc, levozc, blatc, dphiozc, olyr) endif ! end_if_ntoz !> - Call coszmn(), to compute cosine of zenith angle (only when SW is called) diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta index 88363ef18..3b4d35c6d 100644 --- a/physics/GFS_rrtmg_pre.meta +++ b/physics/GFS_rrtmg_pre.meta @@ -1496,16 +1496,16 @@ dimensions = () type = integer intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data +[latsozc] + standard_name = number_of_latitudes_in_ozone_climotology_data + long_name = number of latitude in ozone climotology data units = count dimensions = () type = integer intent = in -[levozp] - standard_name = number_of_levels_in_ozone_data - long_name = number of levels in ozone data +[levozc] + standard_name = number_of_levels_in_ozone_climotology_data + long_name = number of levels in ozone climotology data units = count dimensions = () type = integer diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index e9cbc3d23..dd72a6a1c 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -117,7 +117,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl vmr_n2o, vmr_co2, tsfg, tsfa, qs_lay, q_lay, tv_lay, & relhum, deltaZ, deltaZc, deltaP, active_gases_array, & tsfc_radtime, coszen, coszdg, top_at_1, iSFC, iTOA, nDay, idxday, semis, & - sfc_emiss_byband, ico2, latsozp, levozp, blatc, dphiozc, con_pi, errmsg, errflg) + sfc_emiss_byband, ico2, latsozc, levozc, blatc, dphiozc, con_pi, errmsg, errflg) ! Inputs integer, intent(in) :: & @@ -126,8 +126,8 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl nLev, & ! Number of vertical layers ico2, & ! Flag for co2 radiation scheme i_o3, & ! Index into tracer array for ozone - latsozp, & ! - levozp + latsozc, & ! + levozc logical, intent(in) :: & doSWrad, & ! Call SW radiation? doLWrad ! Call LW radiation @@ -354,7 +354,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl enddo ! OR Use climatological ozone data else - call getozn (prslk(1:NCOL,:), xlat, nCol, nLev, top_at_1, latsozp, levozp, blatc, & + call getozn (prslk(1:NCOL,:), xlat, nCol, nLev, top_at_1, latsozc, levozc, blatc, & dphiozc, o3_lay) endif diff --git a/physics/GFS_rrtmgp_pre.meta b/physics/GFS_rrtmgp_pre.meta index 47980b513..1a96eee1b 100644 --- a/physics/GFS_rrtmgp_pre.meta +++ b/physics/GFS_rrtmgp_pre.meta @@ -503,16 +503,16 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout -[latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data +[latsozc] + standard_name = number_of_latitudes_in_ozone_climotology_data + long_name = number of latitude in ozone climotology data units = count dimensions = () type = integer intent = in -[levozp] - standard_name = number_of_levels_in_ozone_data - long_name = number of levels in ozone data +[levozc] + standard_name = number_of_levels_in_ozone_climotology_data + long_name = number of levels in ozone climotology data units = count dimensions = () type = integer diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index 4e73a5262..fda87611c 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -3,7 +3,7 @@ !! ! ########################################################################################### module ozphys_2015 - use machine , only : kind_phys + use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec implicit none public ozphys_2015_init, ozphys_2015_timestep_init, ozphys_2015_run contains @@ -78,7 +78,7 @@ end subroutine ozphys_2015_init !! ! ########################################################################################### subroutine ozphys_2015_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp, levozp, & - oz_coeff, timeoz, ozplin, oz_time, oz_pres, oz_lat, ddy, ozplout, errmsg, errflg) + oz_coeff, timeoz, ozplin, oz_time, oz_lat, ddy, ozplout, errmsg, errflg) ! Inputs integer, intent(in) :: & nPts, & ! Horizontal dimension @@ -95,7 +95,6 @@ subroutine ozphys_2015_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp real(kind_phys), intent(in), dimension(:) :: & ddy, & ! Interpolation high index for ozone data oz_lat, & ! Latitudes for ozone data - oz_pres, & ! Levels for ozone data oz_time ! Time for ozone data real(kind_phys), intent(in), dimension(:,:,:,:) :: & ozplin ! Ozone data @@ -114,6 +113,8 @@ subroutine ozphys_2015_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp real(kind_phys) :: tem, tx1, tx2, rjday real(8) :: rinc(5) real(4) :: rinc4(5) + !real(kind_dbl_prec) :: rinc(5) + !real(kind_sngl_prec) :: rinc4(5) ! Initialize CCPP error handling variables errmsg = '' diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 59621b386..eab24baf1 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -166,14 +166,6 @@ type = real kind = kind_phys intent = in -[oz_pres] - standard_name = ozone_data_level_pressure - long_name = ozone data level pressure - units = Pa - dimensions = (number_of_levels_in_ozone_data) - type = real - kind = kind_phys - intent = in [oz_lat] standard_name = ozone_data_latitude long_name = ozone data latitude From 0c01b39356ede6fb4c653a4d76fc7c6fa50c18b3 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Wed, 5 Jul 2023 13:24:02 -0600 Subject: [PATCH 11/81] bug fix the snow and graupel melting terms set to zero when sublimation happens instead of melting --- physics/module_mp_thompson.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 59f2f8a65..41cdb7e94 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -3057,6 +3057,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & pnr_sml(k) = smo0(k)/rs(k)*prr_sml(k) * 10.0**(-0.25*tempc) ! RAIN2M pnr_sml(k) = MIN(DBLE(smo0(k)*odts), pnr_sml(k)) elseif (ssati(k).lt. 0.) then + prr_sml(k) = 0.0 prs_sde(k) = C_cube*t1_subl*diffu(k)*ssati(k)*rvs & * (t1_qs_sd*smo1(k) & + t2_qs_sd*rhof2(k)*vsc2(k)*smof(k)) @@ -3073,6 +3074,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & pnr_gml(k) = N0_g(k)*cgg(2)*ilamg(k)**cge(2) / rg(k) & ! RAIN2M * prr_gml(k) * 10.0**(-0.5*tempc) elseif (ssati(k).lt. 0.) then + prr_gml(k) = 0.0 prg_gde(k) = C_cube*t1_subl*diffu(k)*ssati(k)*rvs & * N0_g(k) * (t1_qg_sd*ilamg(k)**cge(10) & + t2_qg_sd*vsc2(k)*rhof2(k)*ilamg(k)**cge(11)) From 2b6a7a4e9bce9f33c122f8df14521a2d985e3985 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Thu, 8 Jun 2023 09:21:49 -0600 Subject: [PATCH 12/81] Initiate SRW v3.0.0 SciDoc --- physics/clm_lake.f90 | 1128 ++++++++--------- physics/docs/ccppsrw3_doxyfile | 557 ++++++++ physics/docs/library.bib | 160 ++- physics/docs/pdftxt/CLM_LAKE.txt | 59 + physics/docs/pdftxt/CU_GF_deep.txt | 32 +- physics/docs/pdftxt/GFS_NOAHMP.txt | 18 +- physics/docs/pdftxt/GFS_UGWPv0.txt | 46 + physics/docs/pdftxt/GFS_v16_suite.txt | 4 +- physics/docs/pdftxt/HRRR_suite.txt | 2 +- physics/docs/pdftxt/NoahMP.txt | 41 - physics/docs/pdftxt/RAP_suite.txt | 2 +- .../docs/pdftxt/RE300/FV3_GFS_v16_input.nml | 335 +++++ physics/docs/pdftxt/RE300/FV3_HRRR_input.nml | 293 +++++ physics/docs/pdftxt/RE300/FV3_RAP_input.nml | 300 +++++ .../pdftxt/RE300/FV3_RRFS_v1beta_input.nml | 285 +++++ .../docs/pdftxt/RE300/FV3_WoFS_v0_input.nml | 291 +++++ .../namelists/input.nml.develop.FV3_GFS_v16 | 330 +++++ .../namelists/input.nml.develop.FV3_HRRR | 293 +++++ .../RE300/namelists/input.nml.develop.FV3_RAP | 300 +++++ .../input.nml.develop.FV3_RRFS_v1beta | 285 +++++ .../namelists/input.nml.develop.FV3_WoFS_v0 | 291 +++++ .../RE300/namelists/input.nml.v21.FV3_GFS_v16 | 336 +++++ .../RE300/namelists/input.nml.v21.FV3_HRRR | 299 +++++ .../namelists/input.nml.v21.FV3_RRFS_v1beta | 291 +++++ .../RE300/namelists/input.nml.v21.FV3_WoFS_v0 | 297 +++++ .../docs/pdftxt/RE300/suite_FV3_GFS_v16.xml | 94 ++ physics/docs/pdftxt/RE300/suite_FV3_HRRR.xml | 82 ++ physics/docs/pdftxt/RE300/suite_FV3_RAP.xml | 90 ++ .../pdftxt/RE300/suite_FV3_RRFS_v1beta.xml | 84 ++ .../docs/pdftxt/RE300/suite_FV3_WoFS_v0.xml | 80 ++ physics/docs/pdftxt/RUCLSM.txt | 93 +- physics/docs/pdftxt/SRW_all_shemes_list.txt | 3 + physics/docs/pdftxt/SRW_mainpage.txt | 5 +- physics/docs/pdftxt/THOMPSON.txt | 9 + 34 files changed, 6132 insertions(+), 683 deletions(-) create mode 100644 physics/docs/ccppsrw3_doxyfile create mode 100644 physics/docs/pdftxt/CLM_LAKE.txt delete mode 100644 physics/docs/pdftxt/NoahMP.txt create mode 100644 physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml create mode 100644 physics/docs/pdftxt/RE300/FV3_HRRR_input.nml create mode 100644 physics/docs/pdftxt/RE300/FV3_RAP_input.nml create mode 100644 physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml create mode 100644 physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_GFS_v16 create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_HRRR create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RAP create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RRFS_v1beta create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_WoFS_v0 create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta create mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 create mode 100644 physics/docs/pdftxt/RE300/suite_FV3_GFS_v16.xml create mode 100644 physics/docs/pdftxt/RE300/suite_FV3_HRRR.xml create mode 100644 physics/docs/pdftxt/RE300/suite_FV3_RAP.xml create mode 100644 physics/docs/pdftxt/RE300/suite_FV3_RRFS_v1beta.xml create mode 100644 physics/docs/pdftxt/RE300/suite_FV3_WoFS_v0.xml diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 4fc4112ce..1728d28b5 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -1,4 +1,4 @@ -!> \file clm_lake.F90 +!> \file clm_lake.f90 !! Contains code related to the CLM lake model !! !! This lake scheme was taken from module_sf_lake in WRF 4.3.1, and @@ -7,7 +7,7 @@ !! The original documentation said: !! !! The lake scheme was retrieved from the Community Land Model version 4.5 -!! (Oleson et al. 2013) with some modifications by Gu et al. (2013). It is a +!! (Oleson et al. (2013) \cite Oleson2013) with some modifications by Gu et al. (2015) \cite Gu2015. It is a !! one-dimensional mass and energy balance scheme with 20-25 model layers, !! including up to 5 snow layers on the lake ice, 10 water layers, and 10 soil !! layers on the lake bottom. The lake scheme is used with actual lake points and @@ -15,15 +15,8 @@ !! lake points and lake depth in WRF (lake_min_elev and lakedepth_default). !! The lake scheme is independent of a land surface scheme and therefore !! can be used with any land surface scheme embedded in WRF. The lake scheme -!! developments and evaluations were included in Subin et al. (2012) and Gu et al. (2013) -!! -!! Subin et al. 2012: Improved lake model for climate simulations, J. Adv. Model. -!! -!! Earth Syst., 4, M02001. DOI:10.1029/2011MS000072; -!! -!! Gu et al. 2013: Calibration and validation of lake surface temperature simulations -!! -!! with the coupled WRF-Lake model. Climatic Change, 1-13, 10.1007/s10584-013-0978-y. +!! developments and evaluations were included in Subin et al. (2012) \cite Subin_2012 +!! and Gu et al. (2015) \cite Gu2015 . MODULE clm_lake @@ -46,26 +39,26 @@ MODULE clm_lake logical, parameter :: PERGRO = .false. logical, parameter :: USE_ETALAKE = .false. - real(kind_lake), parameter :: ETALAKE = 1.1925*50**(-0.424) ! Set this to your desired value if USE_ETALAKE=.true. + real(kind_lake), parameter :: ETALAKE = 1.1925*50**(-0.424) !< Set this to your desired value if USE_ETALAKE=.true. ! Level counts must be consistent with model (GFS_typedefs.F90) - integer, parameter :: nlevsoil = 10 ! number of soil layers - integer, parameter :: nlevlake = 10 ! number of lake layers - integer, parameter :: nlevsnow = 5 ! maximum number of snow layers - real(kind_lake), parameter :: scalez = 0.025_kind_lake ! Soil layer thickness discretization (m) + integer, parameter :: nlevsoil = 10 !< number of soil layers + integer, parameter :: nlevlake = 10 !< number of lake layers + integer, parameter :: nlevsnow = 5 !< maximum number of snow layers + real(kind_lake), parameter :: scalez = 0.025_kind_lake !< Soil layer thickness discretization (m) - integer,parameter :: lbp = 1 ! pft-index bounds + integer,parameter :: lbp = 1 !< pft-index bounds integer,parameter :: ubp = 1 - integer,parameter :: lbc = 1 ! column-index bounds + integer,parameter :: lbc = 1 !< column-index bounds integer,parameter :: ubc = 1 - integer,parameter :: num_shlakec = 1 ! number of columns in lake filter - integer,parameter :: filter_shlakec(1) = 1 ! lake filter (columns) - integer,parameter :: num_shlakep = 1 ! number of pfts in lake filter - integer,parameter :: filter_shlakep(1) = 1 ! lake filter (pfts) + integer,parameter :: num_shlakec = 1 !< number of columns in lake filter + integer,parameter :: filter_shlakec(1) = 1 !< lake filter (columns) + integer,parameter :: num_shlakep = 1 !< number of pfts in lake filter + integer,parameter :: filter_shlakep(1) = 1 !< lake filter (pfts) integer,parameter :: pcolumn(1) = 1 integer,parameter :: pgridcell(1) = 1 - integer,parameter :: cgridcell(1) = 1 ! gridcell index of column - integer,parameter :: clandunit(1) = 1 ! landunit index of column + integer,parameter :: cgridcell(1) = 1 !< gridcell index of column + integer,parameter :: clandunit(1) = 1 !< landunit index of column integer,parameter :: begg = 1 integer,parameter :: endg = 1 @@ -80,44 +73,44 @@ MODULE clm_lake logical,parameter :: lakpoi(1) = .true. !Initialize physical constants not available from model: - real(kind_lake), parameter :: tcrit = 2.5 !critical temperature to determine rain or snow - real(kind_lake), parameter :: tkwat = 0.6 !thermal conductivity of water [W/m/k] - real(kind_lake), parameter :: tkice = 2.290 !thermal conductivity of ice [W/m/k] - real(kind_lake), parameter :: tkairc = 0.023 !thermal conductivity of air [W/m/k] - real(kind_lake), parameter :: snow_bd = 250 !constant snow bulk density (only used in special case here) [kg/m^3] + real(kind_lake), parameter :: tcrit = 2.5 !< critical temperature to determine rain or snow + real(kind_lake), parameter :: tkwat = 0.6 !< thermal conductivity of water [W/m/k] + real(kind_lake), parameter :: tkice = 2.290 !< thermal conductivity of ice [W/m/k] + real(kind_lake), parameter :: tkairc = 0.023 !< thermal conductivity of air [W/m/k] + real(kind_lake), parameter :: snow_bd = 250 !< constant snow bulk density (only used in special case here) [kg/m^3] ! Constants that are copied from model values by clm_lake_init: - real(kind_lake) :: pi !ratio of the circumference of a circle to its diameter - real(kind_lake) :: vkc !von Karman constant [-] - real(kind_lake) :: grav !gravity constant [m/s2] - real(kind_lake) :: sb !stefan-boltzmann constant [W/m2/K4] - real(kind_lake) :: tfrz !freezing temperature [K] - real(kind_lake) :: denh2o !density of liquid water [kg/m3] - real(kind_lake) :: denice !density of ice [kg/m3] - real(kind_lake) :: cpice !Specific heat of ice [J/kg-K] - real(kind_lake) :: cpliq !Specific heat of water [J/kg-K] - real(kind_lake) :: hfus !Latent heat of fusion for ice [J/kg] - real(kind_lake) :: hvap !Latent heat of evap for water [J/kg] - real(kind_lake) :: hsub !Latent heat of sublimation [J/kg] - real(kind_lake) :: invhvap !1/hvap [kg/J] - real(kind_lake) :: invhsub !1/hsub [kg/J] - real(kind_lake) :: rair !gas constant for dry air [J/kg/K] - real(kind_lake) :: cpair !specific heat of dry air [J/kg/K] - real(kind_lake) :: con_eps !ratio of gas constants of air and water vapor [unitless] - real(kind_lake) :: one_minus_con_eps !1 - con_eps [unitless] - real(kind_lake) :: con_fvirt !1/con_eps - 1 [unitless] + real(kind_lake) :: pi !< ratio of the circumference of a circle to its diameter + real(kind_lake) :: vkc !< von Karman constant [-] + real(kind_lake) :: grav !< gravity constant [m/s2] + real(kind_lake) :: sb !< stefan-boltzmann constant [W/m2/K4] + real(kind_lake) :: tfrz !< freezing temperature [K] + real(kind_lake) :: denh2o !< density of liquid water [kg/m3] + real(kind_lake) :: denice !< density of ice [kg/m3] + real(kind_lake) :: cpice !< Specific heat of ice [J/kg-K] + real(kind_lake) :: cpliq !< Specific heat of water [J/kg-K] + real(kind_lake) :: hfus !< Latent heat of fusion for ice [J/kg] + real(kind_lake) :: hvap !< Latent heat of evap for water [J/kg] + real(kind_lake) :: hsub !< Latent heat of sublimation [J/kg] + real(kind_lake) :: invhvap !< 1/hvap [kg/J] + real(kind_lake) :: invhsub !< 1/hsub [kg/J] + real(kind_lake) :: rair !< gas constant for dry air [J/kg/K] + real(kind_lake) :: cpair !< specific heat of dry air [J/kg/K] + real(kind_lake) :: con_eps !< ratio of gas constants of air and water vapor [unitless] + real(kind_lake) :: one_minus_con_eps !< 1 - con_eps [unitless] + real(kind_lake) :: con_fvirt !< 1/con_eps - 1 [unitless] - real(kind_lake), public, parameter :: spval = 1.e36 !special value for missing data (ocean) - real(kind_lake), parameter :: depth_c = 50. !below the level t_lake3d will be 277.0 !mchen - real(kind_lake), parameter :: zero_h2o = 1e-12 !lower mixing ratio is is treated as zero + real(kind_lake), public, parameter :: spval = 1.e36 !< special value for missing data (ocean) + real(kind_lake), parameter :: depth_c = 50. !< below the level t_lake3d will be 277.0 !mchen + real(kind_lake), parameter :: zero_h2o = 1e-12 !< lower mixing ratio is is treated as zero ! These are tunable constants - real(kind_lake), parameter :: wimp = 0.05 !Water impermeable if porosity less than wimp - real(kind_lake), parameter :: ssi = 0.033 !Irreducible water saturation of snow - real(kind_lake), parameter :: cnfac = 0.5 !Crank Nicholson factor between 0 and 1 + real(kind_lake), parameter :: wimp = 0.05 !< Water impermeable if porosity less than wimp + real(kind_lake), parameter :: ssi = 0.033 !< Irreducible water saturation of snow + real(kind_lake), parameter :: cnfac = 0.5 !< Crank Nicholson factor between 0 and 1 ! Initialize water type constants - integer,parameter :: istsoil = 1 !soil "water" type + integer,parameter :: istsoil = 1 !tgs - 7nov19 - salinity effect on freezing point (Tanya, Stan, Trevor). + !! The Great Salt Lake (GSL), Utah lat/long (39.5-42.0,-111.5- -117.7). + !! The GSL's salinity is 270 ppt above ~41.22 N with freezing point of -24 C, + !! and 150 ppt south of ~41.22 N with freezing point -10 C (info from Trevor Alcott). + !! The fresh-water Willard Bay should be excluded from the box around the Great Salt + !! Lake: lat/long 41.3539, -112.102, HRRR i,j = 494,667 (info from Stan and Trevor). + !! + !! 1jun2020: reset the GSL freezing point to be -5 C, + !! and add a check (after call to LakeMain) to keep the lake ice free for the whole year. if ((xlon_d.gt.-117.7 .and. xlon_d.lt.-111.5) .and. & ! excludes Willard Bay .not. (xlon_d.gt.-112.104 .and. xlon_d.lt.-112.100))then @@ -800,69 +793,69 @@ SUBROUTINE LakeMain(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, & !I integer, intent(inout) :: errflg character(*), intent(inout) :: errmsg - real(kind_lake),intent(in) :: dtime ! timestep - real(kind_lake),intent(in) :: xlat_d, xlon_d ! grid location for debugging - real(kind_lake),intent(in) :: forc_t(1) ! atmospheric temperature (Kelvin) - real(kind_lake),intent(in) :: forc_pbot(1) ! atm bottom level pressure (Pa) - real(kind_lake),intent(in) :: forc_psrf(1) ! atmospheric surface pressure (Pa) - real(kind_lake),intent(in) :: forc_hgt(1) ! atmospheric reference height (m) - real(kind_lake),intent(in) :: forc_hgt_q(1) ! observational height of humidity [m] - real(kind_lake),intent(in) :: forc_hgt_t(1) ! observational height of temperature [m] - real(kind_lake),intent(in) :: forc_hgt_u(1) ! observational height of wind [m] - real(kind_lake),intent(in) :: forc_q(1) ! atmospheric specific humidity (kg/kg) - real(kind_lake),intent(in) :: forc_u(1) ! atmospheric wind speed in east direction (m/s) - real(kind_lake),intent(in) :: forc_v(1) ! atmospheric wind speed in north direction (m/s) + real(kind_lake),intent(in) :: dtime !< timestep + real(kind_lake),intent(in) :: xlat_d, xlon_d !< grid location for debugging + real(kind_lake),intent(in) :: forc_t(1) !< atmospheric temperature (Kelvin) + real(kind_lake),intent(in) :: forc_pbot(1) !< atm bottom level pressure (Pa) + real(kind_lake),intent(in) :: forc_psrf(1) !< atmospheric surface pressure (Pa) + real(kind_lake),intent(in) :: forc_hgt(1) !< atmospheric reference height (m) + real(kind_lake),intent(in) :: forc_hgt_q(1) !< observational height of humidity [m] + real(kind_lake),intent(in) :: forc_hgt_t(1) !< observational height of temperature [m] + real(kind_lake),intent(in) :: forc_hgt_u(1) !< observational height of wind [m] + real(kind_lake),intent(in) :: forc_q(1) !< atmospheric specific humidity (kg/kg) + real(kind_lake),intent(in) :: forc_u(1) !< atmospheric wind speed in east direction (m/s) + real(kind_lake),intent(in) :: forc_v(1) !< atmospheric wind speed in north direction (m/s) ! real(kind_lake),intent(in) :: forc_rho(1) ! density (kg/m**3) - real(kind_lake),intent(in) :: forc_lwrad(1) ! downward infrared (longwave) radiation (W/m**2) - real(kind_lake),intent(in) :: prec(1) ! snow or rain rate [mm/s] - real(kind_lake),intent(in) :: sabg(1) ! solar radiation absorbed by ground (W/m**2) - real(kind_lake),intent(in) :: lat(1) ! latitude (radians) - real(kind_lake),intent(in) :: z_lake(1,nlevlake) ! layer depth for lake (m) - real(kind_lake),intent(in) :: dz_lake(1,nlevlake) ! layer thickness for lake (m) - real(kind_lake),intent(out) :: ustar_out(1) ! friction velocity [m/s] - real(kind_lake), intent(in) :: lakedepth(1) ! column lake depth (m) + real(kind_lake),intent(in) :: forc_lwrad(1) !< downward infrared (longwave) radiation (W/m**2) + real(kind_lake),intent(in) :: prec(1) !< snow or rain rate [mm/s] + real(kind_lake),intent(in) :: sabg(1) !< solar radiation absorbed by ground (W/m**2) + real(kind_lake),intent(in) :: lat(1) !< latitude (radians) + real(kind_lake),intent(in) :: z_lake(1,nlevlake) !< layer depth for lake (m) + real(kind_lake),intent(in) :: dz_lake(1,nlevlake) !< layer thickness for lake (m) + real(kind_lake),intent(out) :: ustar_out(1) !< friction velocity [m/s] + real(kind_lake), intent(in) :: lakedepth(1) !< column lake depth (m) !!!!!!!!!!!!!!!!tep(in),hydro(in) ! real(kind_lake), intent(in) :: watsat(1,1:nlevsoil) ! volumetric soil water at saturation (porosity) !!!!!!!!!!!!!!!!hydro - logical , intent(in) :: do_capsnow(1) ! true => do snow capping - real(kind_lake), intent(in) :: watsat(1,nlevsoil) ! volumetric soil water at saturation (porosity) - real(kind_lake), intent(in) :: tksatu(1,nlevsoil) ! thermal conductivity, saturated soil [W/m-K] - real(kind_lake), intent(in) :: tkmg(1,nlevsoil) ! thermal conductivity, soil minerals [W/m-K] - real(kind_lake), intent(in) :: tkdry(1,nlevsoil) ! thermal conductivity, dry soil (W/m/Kelvin) - real(kind_lake), intent(in) :: csol(1,nlevsoil) ! heat capacity, soil solids (J/m**3/Kelvin) + logical , intent(in) :: do_capsnow(1) !< true => do snow capping + real(kind_lake), intent(in) :: watsat(1,nlevsoil) !< volumetric soil water at saturation (porosity) + real(kind_lake), intent(in) :: tksatu(1,nlevsoil) !< thermal conductivity, saturated soil [W/m-K] + real(kind_lake), intent(in) :: tkmg(1,nlevsoil) !< thermal conductivity, soil minerals [W/m-K] + real(kind_lake), intent(in) :: tkdry(1,nlevsoil) !< thermal conductivity, dry soil (W/m/Kelvin) + real(kind_lake), intent(in) :: csol(1,nlevsoil) !< heat capacity, soil solids (J/m**3/Kelvin) !in&out - real(kind_lake),intent(inout) :: h2osoi_vol(1,-nlevsnow+1:nlevsoil) ! volumetric soil water (0<=h2osoi_vol<=watsat)[m3/m3] - real(kind_lake),intent(inout) :: t_grnd(1) ! ground temperature (Kelvin) - real(kind_lake),intent(inout) :: h2osno(1) ! snow water (mm H2O) - real(kind_lake),intent(inout) :: snowdp(1) ! snow height (m) - real(kind_lake),intent(inout) :: z(1,-nlevsnow+1:nlevsoil) ! layer depth for snow & soil (m) - real(kind_lake),intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) ! layer thickness for soil or snow (m) - real(kind_lake),intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) ! soil (or snow) temperature (Kelvin) - real(kind_lake),intent(inout) :: t_lake(1,nlevlake) ! lake temperature (Kelvin) - integer ,intent(inout) :: snl(1) ! number of snow layers - real(kind_lake),intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) ! liquid water (kg/m2) - real(kind_lake),intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) ! ice lens (kg/m2) - real(kind_lake),intent(inout) :: savedtke1(1) ! top level eddy conductivity from previous timestep (W/m.K) - real(kind_lake),intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) ! interface level below a "z" level (m) - real(kind_lake),intent(inout) :: lake_icefrac(1,nlevlake) ! mass fraction of lake layer that is frozen + real(kind_lake),intent(inout) :: h2osoi_vol(1,-nlevsnow+1:nlevsoil) !< volumetric soil water (0<=h2osoi_vol<=watsat)[m3/m3] + real(kind_lake),intent(inout) :: t_grnd(1) !< ground temperature (Kelvin) + real(kind_lake),intent(inout) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake),intent(inout) :: snowdp(1) !< snow height (m) + real(kind_lake),intent(inout) :: z(1,-nlevsnow+1:nlevsoil) !< layer depth for snow & soil (m) + real(kind_lake),intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !< layer thickness for soil or snow (m) + real(kind_lake),intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil (or snow) temperature (Kelvin) + real(kind_lake),intent(inout) :: t_lake(1,nlevlake) !< lake temperature (Kelvin) + integer ,intent(inout) :: snl(1) !< number of snow layers + real(kind_lake),intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) + real(kind_lake),intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake),intent(inout) :: savedtke1(1) !< top level eddy conductivity from previous timestep (W/m.K) + real(kind_lake),intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) !< interface level below a "z" level (m) + real(kind_lake),intent(inout) :: lake_icefrac(1,nlevlake) !< mass fraction of lake layer that is frozen !out: - real(kind_lake),intent(out) :: eflx_gnet(1) !net heat flux into ground (W/m**2) - real(kind_lake),intent(out) :: eflx_lwrad_net(1) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(kind_lake),intent(out) :: eflx_sh_tot(1) ! total sensible heat flux (W/m**2) [+ to atm] - real(kind_lake),intent(out) :: eflx_lh_tot(1) ! total latent heat flux (W/m8*2) [+ to atm] - real(kind_lake),intent(out) :: t_ref2m(1) ! 2 m height surface air temperature (Kelvin) - real(kind_lake),intent(out) :: q_ref2m(1) ! 2 m height surface specific humidity (kg/kg) - real(kind_lake),intent(out) :: taux(1) ! wind (shear) stress: e-w (kg/m/s**2) - real(kind_lake),intent(out) :: tauy(1) ! wind (shear) stress: n-s (kg/m/s**2) - real(kind_lake),intent(out) :: ram1(1) ! aerodynamical resistance (s/m) - ! for calculation of decay of eddy diffusivity with depth - ! Change the type variable to pass back to WRF. - real(kind_lake),intent(out) :: z0mg(1) ! roughness length over ground, momentum (m( + real(kind_lake),intent(out) :: eflx_gnet(1) !< net heat flux into ground (W/m**2) + real(kind_lake),intent(out) :: eflx_lwrad_net(1) !< net infrared (longwave) rad (W/m**2) [+ = to atm] + real(kind_lake),intent(out) :: eflx_sh_tot(1) !< total sensible heat flux (W/m**2) [+ to atm] + real(kind_lake),intent(out) :: eflx_lh_tot(1) !< total latent heat flux (W/m8*2) [+ to atm] + real(kind_lake),intent(out) :: t_ref2m(1) !< 2 m height surface air temperature (Kelvin) + real(kind_lake),intent(out) :: q_ref2m(1) !< 2 m height surface specific humidity (kg/kg) + real(kind_lake),intent(out) :: taux(1) !< wind (shear) stress: e-w (kg/m/s**2) + real(kind_lake),intent(out) :: tauy(1) !< wind (shear) stress: n-s (kg/m/s**2) + real(kind_lake),intent(out) :: ram1(1) !< aerodynamical resistance (s/m) + !! for calculation of decay of eddy diffusivity with depth + !! Change the type variable to pass back to WRF. + real(kind_lake),intent(out) :: z0mg(1) !< roughness length over ground, momentum (m( !local output @@ -989,6 +982,13 @@ SUBROUTINE LakeMain(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, & !I END SUBROUTINE LakeMain + ! DESCRIPTION: + !> Calculates lake temperatures and surface fluxes for shallow lakes. + !! + !! Shallow lakes have variable depth, possible snow layers above, freezing & thawing of lake water, + !! and soil layers with active temperature and gas diffusion below. + !! + !! WARNING: This subroutine assumes lake columns have one and only one pft. SUBROUTINE ShalLakeFluxes(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, & !i forc_hgt_t,forc_hgt_u,forc_q, & forc_u,forc_v,forc_lwrad,forc_snow, & @@ -1001,18 +1001,10 @@ SUBROUTINE ShalLakeFluxes(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, eflx_lh_grnd,t_veg,t_ref2m,q_ref2m,taux,tauy, & ram1,ws,ks,eflx_gnet,z0mg,ustar_out,errmsg,errflg,xlat_d,xlon_d) !============================================================================== - ! DESCRIPTION: - ! Calculates lake temperatures and surface fluxes for shallow lakes. - ! - ! Shallow lakes have variable depth, possible snow layers above, freezing & thawing of lake water, - ! and soil layers with active temperature and gas diffusion below. - ! - ! WARNING: This subroutine assumes lake columns have one and only one pft. - ! ! REVISION HISTORY: - ! Created by Zack Subin, 2009 - ! Reedited by Hongping Gu, 2010 - ! Updated for CCPP by Sam Trahan, 2022 + ! - Created by Zack Subin, 2009 + ! - Reedited by Hongping Gu, 2010 + ! - Updated for CCPP by Sam Trahan, 2022 !============================================================================== ! implicit none @@ -1021,62 +1013,62 @@ SUBROUTINE ShalLakeFluxes(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, !in: - integer, intent(inout) :: errflg - character(len=*), intent(inout) :: errmsg - real(kind_lake),intent(in) :: xlat_d,xlon_d - real(kind_lake),intent(in) :: forc_t(1) ! atmospheric temperature (Kelvin) - real(kind_lake),intent(in) :: forc_pbot(1) ! atmospheric pressure (Pa) - real(kind_lake),intent(in) :: forc_psrf(1) ! atmospheric surface pressure (Pa) - real(kind_lake),intent(in) :: forc_hgt(1) ! atmospheric reference height (m) - real(kind_lake),intent(in) :: forc_hgt_q(1) ! observational height of humidity [m] - real(kind_lake),intent(in) :: forc_hgt_t(1) ! observational height of temperature [m] - real(kind_lake),intent(in) :: forc_hgt_u(1) ! observational height of wind [m] - real(kind_lake),intent(in) :: forc_q(1) ! atmospheric specific humidity (kg/kg) - real(kind_lake),intent(in) :: forc_u(1) ! atmospheric wind speed in east direction (m/s) - real(kind_lake),intent(in) :: forc_v(1) ! atmospheric wind speed in north direction (m/s) - real(kind_lake),intent(in) :: forc_lwrad(1) ! downward infrared (longwave) radiation (W/m**2) + integer, intent(inout) :: errflg !< + character(len=*), intent(inout) :: errmsg !< + real(kind_lake),intent(in) :: xlat_d,xlon_d !< + real(kind_lake),intent(in) :: forc_t(1) !< atmospheric temperature (Kelvin) + real(kind_lake),intent(in) :: forc_pbot(1) !< atmospheric pressure (Pa) + real(kind_lake),intent(in) :: forc_psrf(1) !< atmospheric surface pressure (Pa) + real(kind_lake),intent(in) :: forc_hgt(1) !< atmospheric reference height (m) + real(kind_lake),intent(in) :: forc_hgt_q(1) !< observational height of humidity [m] + real(kind_lake),intent(in) :: forc_hgt_t(1) !< observational height of temperature [m] + real(kind_lake),intent(in) :: forc_hgt_u(1) !< observational height of wind [m] + real(kind_lake),intent(in) :: forc_q(1) !< atmospheric specific humidity (kg/kg) + real(kind_lake),intent(in) :: forc_u(1) !< atmospheric wind speed in east direction (m/s) + real(kind_lake),intent(in) :: forc_v(1) !< atmospheric wind speed in north direction (m/s) + real(kind_lake),intent(in) :: forc_lwrad(1) !< downward infrared (longwave) radiation (W/m**2) ! real(kind_lake),intent(in) :: forc_rho(1) ! density (kg/m**3) - real(kind_lake),intent(in) :: forc_snow(1) ! snow rate [mm/s] - real(kind_lake),intent(in) :: forc_rain(1) ! rain rate [mm/s] - real(kind_lake),intent(in) :: h2osno(1) ! snow water (mm H2O) - real(kind_lake),intent(in) :: snowdp(1) ! snow height (m) - real(kind_lake),intent(in) :: sabg(1) ! solar radiation absorbed by ground (W/m**2) - real(kind_lake),intent(in) :: lat(1) ! latitude (radians) - real(kind_lake),intent(in) :: dz(1,-nlevsnow+1:nlevsoil) ! layer thickness for soil or snow (m) - real(kind_lake),intent(in) :: dz_lake(1,nlevlake) ! layer thickness for lake (m) - real(kind_lake),intent(in) :: t_soisno(1,-nlevsnow+1:nlevsoil) ! soil (or snow) temperature (Kelvin) - real(kind_lake),intent(in) :: t_lake(1,nlevlake) ! lake temperature (Kelvin) - integer ,intent(in) :: snl(1) ! number of snow layers - real(kind_lake),intent(in) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) ! liquid water (kg/m2) - real(kind_lake),intent(in) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) ! ice lens (kg/m2) - real(kind_lake),intent(in) :: savedtke1(1) ! top level eddy conductivity from previous timestep (W/m.K) + real(kind_lake),intent(in) :: forc_snow(1) !< snow rate [mm/s] + real(kind_lake),intent(in) :: forc_rain(1) !< rain rate [mm/s] + real(kind_lake),intent(in) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake),intent(in) :: snowdp(1) !< snow height (m) + real(kind_lake),intent(in) :: sabg(1) !< solar radiation absorbed by ground (W/m**2) + real(kind_lake),intent(in) :: lat(1) !< latitude (radians) + real(kind_lake),intent(in) :: dz(1,-nlevsnow+1:nlevsoil) !< layer thickness for soil or snow (m) + real(kind_lake),intent(in) :: dz_lake(1,nlevlake) !< layer thickness for lake (m) + real(kind_lake),intent(in) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil (or snow) temperature (Kelvin) + real(kind_lake),intent(in) :: t_lake(1,nlevlake) !< lake temperature (Kelvin) + integer ,intent(in) :: snl(1) !< number of snow layers + real(kind_lake),intent(in) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) + real(kind_lake),intent(in) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake),intent(in) :: savedtke1(1) !< top level eddy conductivity from previous timestep (W/m.K) !inout: - real(kind_lake),intent(inout) :: t_grnd(1) ! ground temperature (Kelvin) + real(kind_lake),intent(inout) :: t_grnd(1) !< ground temperature (Kelvin) !out: - real(kind_lake),intent(out):: ustar_out(1) ! friction velocity [m/s] - real(kind_lake),intent(out):: qflx_prec_grnd(1) ! water onto ground including canopy runoff [kg/(m2 s)] - real(kind_lake),intent(out):: qflx_evap_soi(1) ! soil evaporation (mm H2O/s) (+ = to atm) - real(kind_lake),intent(out):: qflx_evap_tot(1) ! qflx_evap_soi + qflx_evap_veg + qflx_tran_veg - real(kind_lake),intent(out):: eflx_sh_grnd(1) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(kind_lake),intent(out):: eflx_lwrad_out(1) ! emitted infrared (longwave) radiation (W/m**2) - real(kind_lake),intent(out):: eflx_lwrad_net(1) ! net infrared (longwave) rad (W/m**2) [+ = to atm] - real(kind_lake),intent(out):: eflx_soil_grnd(1) ! soil heat flux (W/m**2) [+ = into soil] - real(kind_lake),intent(out):: eflx_sh_tot(1) ! total sensible heat flux (W/m**2) [+ to atm] - real(kind_lake),intent(out):: eflx_lh_tot(1) ! total latent heat flux (W/m8*2) [+ to atm] - real(kind_lake),intent(out):: eflx_lh_grnd(1) ! ground evaporation heat flux (W/m**2) [+ to atm] - real(kind_lake),intent(out):: t_veg(1) ! vegetation temperature (Kelvin) - real(kind_lake),intent(out):: t_ref2m(1) ! 2 m height surface air temperature (Kelvin) - real(kind_lake),intent(out):: q_ref2m(1) ! 2 m height surface specific humidity (kg/kg) - real(kind_lake),intent(out):: taux(1) ! wind (shear) stress: e-w (kg/m/s**2) - real(kind_lake),intent(out):: tauy(1) ! wind (shear) stress: n-s (kg/m/s**2) - real(kind_lake),intent(out):: ram1(1) ! aerodynamical resistance (s/m) - real(kind_lake),intent(out):: ws(1) ! surface friction velocity (m/s) - real(kind_lake),intent(out):: ks(1) ! coefficient passed to ShalLakeTemperature - ! for calculation of decay of eddy diffusivity with depth - real(kind_lake),intent(out):: eflx_gnet(1) !net heat flux into ground (W/m**2) - ! Change the type variable to pass back to WRF. - real(kind_lake),intent(out):: z0mg(1) ! roughness length over ground, momentum (m( + real(kind_lake),intent(out):: ustar_out(1) !< friction velocity [m/s] + real(kind_lake),intent(out):: qflx_prec_grnd(1) !< water onto ground including canopy runoff [kg/(m2 s)] + real(kind_lake),intent(out):: qflx_evap_soi(1) !< soil evaporation (mm H2O/s) (+ = to atm) + real(kind_lake),intent(out):: qflx_evap_tot(1) !< qflx_evap_soi + qflx_evap_veg + qflx_tran_veg + real(kind_lake),intent(out):: eflx_sh_grnd(1) !< sensible heat flux from ground (W/m**2) [+ to atm] + real(kind_lake),intent(out):: eflx_lwrad_out(1) !< emitted infrared (longwave) radiation (W/m**2) + real(kind_lake),intent(out):: eflx_lwrad_net(1) !< net infrared (longwave) rad (W/m**2) [+ = to atm] + real(kind_lake),intent(out):: eflx_soil_grnd(1) !< soil heat flux (W/m**2) [+ = into soil] + real(kind_lake),intent(out):: eflx_sh_tot(1) !< total sensible heat flux (W/m**2) [+ to atm] + real(kind_lake),intent(out):: eflx_lh_tot(1) !< total latent heat flux (W/m8*2) [+ to atm] + real(kind_lake),intent(out):: eflx_lh_grnd(1) !< ground evaporation heat flux (W/m**2) [+ to atm] + real(kind_lake),intent(out):: t_veg(1) !< vegetation temperature (Kelvin) + real(kind_lake),intent(out):: t_ref2m(1) !< 2 m height surface air temperature (Kelvin) + real(kind_lake),intent(out):: q_ref2m(1) !< 2 m height surface specific humidity (kg/kg) + real(kind_lake),intent(out):: taux(1) !< wind (shear) stress: e-w (kg/m/s**2) + real(kind_lake),intent(out):: tauy(1) !< wind (shear) stress: n-s (kg/m/s**2) + real(kind_lake),intent(out):: ram1(1) !< aerodynamical resistance (s/m) + real(kind_lake),intent(out):: ws(1) !< surface friction velocity (m/s) + real(kind_lake),intent(out):: ks(1) !< coefficient passed to ShalLakeTemperature + !! for calculation of decay of eddy diffusivity with depth + real(kind_lake),intent(out):: eflx_gnet(1) !< net heat flux into ground (W/m**2) + !! Change the type variable to pass back to WRF. + real(kind_lake),intent(out):: z0mg(1) !< roughness length over ground, momentum (m( @@ -1566,22 +1558,22 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! watsat, tksatu, tkmg, tkdry, csol, dtime, & frac_iceold,qflx_snomelt,imelt,errmsg,errflg) !======================================================================================================= - ! !DESCRIPTION: - ! Calculates temperatures in the 20-25 layer column of (possible) snow, - ! lake water, and soil beneath lake. - ! Snow and soil temperatures are determined as in SoilTemperature, except - ! for appropriate boundary conditions at the top of the snow (the flux is fixed - ! to be the ground heat flux calculated in ShalLakeFluxes), the bottom of the snow - ! (adjacent to top lake layer), and the top of the soil (adjacent to the bottom - ! lake layer). Also, the soil is assumed to be always fully saturated (ShalLakeHydrology - ! will have to insure this). The whole column is solved simultaneously as one tridiagonal matrix. - ! Lake temperatures are determined from the Hostetler model as before, except now: - ! i) Lake water layers can freeze by any fraction and release latent heat; thermal - ! and mechanical properties are adjusted for ice fraction. - ! ii) Convective mixing (though not eddy diffusion) still occurs for frozen lakes. - ! iii) No sunlight is absorbed in the lake if there are snow layers. - ! iv) Light is allowed to reach the top soil layer (where it is assumed to be completely absorbed). - ! v) Lakes have variable depth, set ultimately in surface data set but now in initShalLakeMod. + ! DESCRIPTION: + !< Calculates temperatures in the 20-25 layer column of (possible) snow, + !! lake water, and soil beneath lake. + !! Snow and soil temperatures are determined as in SoilTemperature, except + !! for appropriate boundary conditions at the top of the snow (the flux is fixed + !! to be the ground heat flux calculated in ShalLakeFluxes), the bottom of the snow + !! (adjacent to top lake layer), and the top of the soil (adjacent to the bottom + !! lake layer). Also, the soil is assumed to be always fully saturated (ShalLakeHydrology + !! will have to insure this). The whole column is solved simultaneously as one tridiagonal matrix. + !! Lake temperatures are determined from the Hostetler model as before, except now: + !!\n i) Lake water layers can freeze by any fraction and release latent heat; thermal + !! and mechanical properties are adjusted for ice fraction. + !!\n ii) Convective mixing (though not eddy diffusion) still occurs for frozen lakes. + !!\n iii) No sunlight is absorbed in the lake if there are snow layers. + !!\n iv) Light is allowed to reach the top soil layer (where it is assumed to be completely absorbed). + !!\n v) Lakes have variable depth, set ultimately in surface data set but now in initShalLakeMod. ! ! Eddy + molecular diffusion: ! d ts d d ts 1 ds @@ -1652,49 +1644,49 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! implicit none !in: - integer, intent(inout) :: errflg - real(kind_lake), intent(in) :: watsat(1,nlevsoil) ! volumetric soil water at saturation (porosity) - real(kind_lake), intent(in) :: tksatu(1,nlevsoil) ! thermal conductivity, saturated soil [W/m-K] - real(kind_lake), intent(in) :: tkmg(1,nlevsoil) ! thermal conductivity, soil minerals [W/m-K] - real(kind_lake), intent(in) :: tkdry(1,nlevsoil) ! thermal conductivity, dry soil (W/m/Kelvin) - real(kind_lake), intent(in) :: csol(1,nlevsoil) ! heat capacity, soil solids (J/m**3/Kelvin) - character(*), intent(inout) :: errmsg - real(kind_lake), intent(in) :: t_grnd(1) ! ground temperature (Kelvin) - real(kind_lake), intent(inout) :: h2osno(1) ! snow water (mm H2O) - real(kind_lake), intent(in) :: sabg(1) ! solar radiation absorbed by ground (W/m**2) - real(kind_lake), intent(in) :: dz(1,-nlevsnow + 1:nlevsoil) ! layer thickness for snow & soil (m) - real(kind_lake), intent(in) :: dz_lake(1,nlevlake) ! layer thickness for lake (m) - real(kind_lake), intent(in) :: z(1,-nlevsnow+1:nlevsoil) ! layer depth for snow & soil (m) - real(kind_lake), intent(in) :: zi(1,-nlevsnow+0:nlevsoil) ! interface level below a "z" level (m) - ! the other z and dz variables - real(kind_lake), intent(in) :: z_lake(1,nlevlake) ! layer depth for lake (m) - real(kind_lake), intent(in) :: ws(1) ! surface friction velocity (m/s) - real(kind_lake), intent(in) :: ks(1) ! coefficient passed to ShalLakeTemperature - ! for calculation of decay of eddy diffusivity with depth - integer , intent(in) :: snl(1) ! negative of number of snow layers - real(kind_lake), intent(inout) :: eflx_gnet(1) ! net heat flux into ground (W/m**2) at the surface interface - real(kind_lake), intent(in) :: lakedepth(1) ! column lake depth (m) + integer, intent(inout) :: errflg !< + real(kind_lake), intent(in) :: watsat(1,nlevsoil) !< volumetric soil water at saturation (porosity) + real(kind_lake), intent(in) :: tksatu(1,nlevsoil) !< thermal conductivity, saturated soil [W/m-K] + real(kind_lake), intent(in) :: tkmg(1,nlevsoil) !< thermal conductivity, soil minerals [W/m-K] + real(kind_lake), intent(in) :: tkdry(1,nlevsoil) !< thermal conductivity, dry soil (W/m/Kelvin) + real(kind_lake), intent(in) :: csol(1,nlevsoil) !< heat capacity, soil solids (J/m**3/Kelvin) + character(*), intent(inout) :: errmsg !< + real(kind_lake), intent(in) :: t_grnd(1) !< ground temperature (Kelvin) + real(kind_lake), intent(inout) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake), intent(in) :: sabg(1) !< solar radiation absorbed by ground (W/m**2) + real(kind_lake), intent(in) :: dz(1,-nlevsnow + 1:nlevsoil) !< layer thickness for snow & soil (m) + real(kind_lake), intent(in) :: dz_lake(1,nlevlake) !< layer thickness for lake (m) + real(kind_lake), intent(in) :: z(1,-nlevsnow+1:nlevsoil) !< layer depth for snow & soil (m) + real(kind_lake), intent(in) :: zi(1,-nlevsnow+0:nlevsoil) !< interface level below a "z" level (m) + !! the other z and dz variables + real(kind_lake), intent(in) :: z_lake(1,nlevlake) !< layer depth for lake (m) + real(kind_lake), intent(in) :: ws(1) !< surface friction velocity (m/s) + real(kind_lake), intent(in) :: ks(1) !< coefficient passed to ShalLakeTemperature + !! for calculation of decay of eddy diffusivity with depth + integer , intent(in) :: snl(1) !< negative of number of snow layers + real(kind_lake), intent(inout) :: eflx_gnet(1) !< net heat flux into ground (W/m**2) at the surface interface + real(kind_lake), intent(in) :: lakedepth(1) !< column lake depth (m) ! real(kind_lake), intent(in) :: watsat(1,nlevsoil) ! volumetric soil water at saturation (porosity) - real(kind_lake), intent(inout) :: snowdp(1) !snow height (m) - real(kind_lake), intent(in) :: dtime !timestep + real(kind_lake), intent(inout) :: snowdp(1) !< snow height (m) + real(kind_lake), intent(in) :: dtime !< timestep !out: - real(kind_lake), intent(out) :: eflx_sh_grnd(1) ! sensible heat flux from ground (W/m**2) [+ to atm] - real(kind_lake), intent(out) :: eflx_sh_tot(1) ! total sensible heat flux (W/m**2) [+ to atm] - real(kind_lake), intent(out) :: eflx_soil_grnd(1) ! heat flux into snow / lake (W/m**2) [+ = into soil] - ! Here this includes the whole lake radiation absorbed. - !real(kind_lake), intent(out) :: qmelt(1) ! snow melt [mm/s] [temporary] + real(kind_lake), intent(out) :: eflx_sh_grnd(1) !< sensible heat flux from ground (W/m**2) [+ to atm] + real(kind_lake), intent(out) :: eflx_sh_tot(1) !< total sensible heat flux (W/m**2) [+ to atm] + real(kind_lake), intent(out) :: eflx_soil_grnd(1) !< heat flux into snow / lake (W/m**2) [+ = into soil] + !! Here this includes the whole lake radiation absorbed. + !real(kind_lake), intent(out) :: qmelt(1) !< snow melt [mm/s] [temporary] - real(kind_lake), intent(inout) :: t_lake(1,nlevlake) ! lake temperature (Kelvin) - real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) ! soil (or snow) temperature (Kelvin) - real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) ! liquid water (kg/m2) [for snow & soil layers] - real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) ! ice lens (kg/m2) [for snow & soil layers] - real(kind_lake), intent(inout) :: lake_icefrac(1,nlevlake) ! mass fraction of lake layer that is frozen - real(kind_lake), intent(out) :: savedtke1(1) ! top level thermal conductivity (W/mK) - real(kind_lake), intent(out) :: frac_iceold(1,-nlevsnow+1:nlevsoil) ! fraction of ice relative to the tot water - real(kind_lake), intent(out) :: qflx_snomelt(1) !snow melt (mm H2O /s) - integer, intent(out) :: imelt(1,-nlevsnow+1:nlevsoil) !flag for melting (=1), freezing (=2), Not=0 (new) + real(kind_lake), intent(inout) :: t_lake(1,nlevlake) !< lake temperature (Kelvin) + real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil (or snow) temperature (Kelvin) + real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) [for snow & soil layers] + real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) [for snow & soil layers] + real(kind_lake), intent(inout) :: lake_icefrac(1,nlevlake) !< mass fraction of lake layer that is frozen + real(kind_lake), intent(out) :: savedtke1(1) !< top level thermal conductivity (W/mK) + real(kind_lake), intent(out) :: frac_iceold(1,-nlevsnow+1:nlevsoil) !< fraction of ice relative to the tot water + real(kind_lake), intent(out) :: qflx_snomelt(1) !< snow melt (mm H2O /s) + integer, intent(out) :: imelt(1,-nlevsnow+1:nlevsoil) !< flag for melting (=1), freezing (=2), Not=0 (new) ! OTHER LOCAL VARIABLES: @@ -2540,52 +2532,48 @@ end subroutine ShalLakeTemperature ! ! ROUTINE: SoilThermProp_Lake ! - ! !INTERFACE: + ! INTERFACE: + ! DESCRIPTION: + !> Calculation of thermal conductivities and heat capacities of + !! snow/soil layers + !!\n (1) The volumetric heat capacity is calculated as a linear combination + !! in terms of the volumetric fraction of the constituent phases. + !! + !!\n (2) The thermal conductivity of soil is computed from the algorithm of + !! Johansen (as reported by Farouki 1981), and of snow is from the + !! formulation used in SNTHERM (Jordan 1991). + !! The thermal conductivities at the interfaces between two neighboring + !! layers (j, j+1) are derived from an assumption that the flux across + !! the interface is equal to that from the node j to the interface and the + !! flux from the interface to the node j+1. + !! + !! For lakes, the proper soil layers (not snow) should always be saturated. subroutine SoilThermProp_Lake (snl,dz,zi,z,t_soisno,h2osoi_liq,h2osoi_ice, & watsat, tksatu, tkmg, tkdry, csol, tk, cv, tktopsoillay,errmsg,errflg) - ! - ! !DESCRIPTION: - ! Calculation of thermal conductivities and heat capacities of - ! snow/soil layers - ! (1) The volumetric heat capacity is calculated as a linear combination - ! in terms of the volumetric fraction of the constituent phases. - ! - ! (2) The thermal conductivity of soil is computed from the algorithm of - ! Johansen (as reported by Farouki 1981), and of snow is from the - ! formulation used in SNTHERM (Jordan 1991). - ! The thermal conductivities at the interfaces between two neighboring - ! layers (j, j+1) are derived from an assumption that the flux across - ! the interface is equal to that from the node j to the interface and the - ! flux from the interface to the node j+1. - ! - ! For lakes, the proper soil layers (not snow) should always be saturated. - ! - ! !USES: - implicit none !in - integer, intent(inout) :: errflg - character(*), intent(inout) :: errmsg - integer , intent(in) :: snl(1) ! number of snow layers - ! real(kind_lake), intent(in) :: h2osno(1) ! snow water (mm H2O) - real(kind_lake), intent(in) :: watsat(1,nlevsoil) ! volumetric soil water at saturation (porosity) - real(kind_lake), intent(in) :: tksatu(1,nlevsoil) ! thermal conductivity, saturated soil [W/m-K] - real(kind_lake), intent(in) :: tkmg(1,nlevsoil) ! thermal conductivity, soil minerals [W/m-K] - real(kind_lake), intent(in) :: tkdry(1,nlevsoil) ! thermal conductivity, dry soil (W/m/Kelvin) - real(kind_lake), intent(in) :: csol(1,nlevsoil) ! heat capacity, soil solids (J/m**3/Kelvin) - real(kind_lake), intent(in) :: dz(1,-nlevsnow+1:nlevsoil) ! layer thickness (m) - real(kind_lake), intent(in) :: zi(1,-nlevsnow+0:nlevsoil) ! interface level below a "z" level (m) - real(kind_lake), intent(in) :: z(1,-nlevsnow+1:nlevsoil) ! layer depth (m) - real(kind_lake), intent(in) :: t_soisno(1,-nlevsnow+1:nlevsoil) ! soil temperature (Kelvin) - real(kind_lake), intent(in) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) ! liquid water (kg/m2) - real(kind_lake), intent(in) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) ! ice lens (kg/m2) + integer, intent(inout) :: errflg + character(*), intent(inout) :: errmsg + integer , intent(in) :: snl(1) !< number of snow layers + ! real(kind_lake), intent(in) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake), intent(in) :: watsat(1,nlevsoil) !< volumetric soil water at saturation (porosity) + real(kind_lake), intent(in) :: tksatu(1,nlevsoil) !< thermal conductivity, saturated soil [W/m-K] + real(kind_lake), intent(in) :: tkmg(1,nlevsoil) !< thermal conductivity, soil minerals [W/m-K] + real(kind_lake), intent(in) :: tkdry(1,nlevsoil) !< thermal conductivity, dry soil (W/m/Kelvin) + real(kind_lake), intent(in) :: csol(1,nlevsoil) !< heat capacity, soil solids (J/m**3/Kelvin) + real(kind_lake), intent(in) :: dz(1,-nlevsnow+1:nlevsoil) !< layer thickness (m) + real(kind_lake), intent(in) :: zi(1,-nlevsnow+0:nlevsoil) !< interface level below a "z" level (m) + real(kind_lake), intent(in) :: z(1,-nlevsnow+1:nlevsoil) !< layer depth (m) + real(kind_lake), intent(in) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil temperature (Kelvin) + real(kind_lake), intent(in) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) + real(kind_lake), intent(in) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) !out - real(kind_lake), intent(out) :: cv(lbc:ubc,-nlevsnow+1:nlevsoil) ! heat capacity [J/(m2 K)] - real(kind_lake), intent(out) :: tk(lbc:ubc,-nlevsnow+1:nlevsoil) ! thermal conductivity [W/(m K)] - real(kind_lake), intent(out) :: tktopsoillay(lbc:ubc) ! thermal conductivity [W/(m K)] + real(kind_lake), intent(out) :: cv(lbc:ubc,-nlevsnow+1:nlevsoil) !< heat capacity [J/(m2 K)] + real(kind_lake), intent(out) :: tk(lbc:ubc,-nlevsnow+1:nlevsoil) !< thermal conductivity [W/(m K)] + real(kind_lake), intent(out) :: tktopsoillay(lbc:ubc) !< thermal conductivity [W/(m K)] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !CALLED FROM: ! subroutine ShalLakeTemperature in this module. @@ -2754,6 +2742,24 @@ end subroutine SoilThermProp_Lake ! ROUTINE: PhaseChange_Lake ! ! !INTERFACE: + + ! DESCRIPTION: + !> Calculation of the phase change within snow, soil, & lake layers: + !!\n (1) Check the conditions for which the phase change may take place, + !! i.e., the layer temperature is great than the freezing point + !! and the ice mass is not equal to zero (i.e. melting), + !! or the layer temperature is less than the freezing point + !! and the liquid water mass is greater than the allowable supercooled + !! (i.e. freezing). + !!\n (2) Assess the amount of phase change from the energy excess (or deficit) + !! after setting the layer temperature to freezing point, depending on + !! how much water or ice is available. + !!\n (3) Re-adjust the ice and liquid mass, and the layer temperature: either to + !! the freezing point if enough water or ice is available to fully compensate, + !! or to a remaining temperature. + !! + !! The specific heats are assumed constant. Potential cycling errors resulting from + !! this assumption will be trapped at the end of ShalLakeTemperature. subroutine PhaseChange_Lake (snl,h2osno,dz,dz_lake, & !i t_soisno,h2osoi_liq,h2osoi_ice, & !i&o lake_icefrac,t_lake, snowdp, & !i&o @@ -2761,28 +2767,12 @@ subroutine PhaseChange_Lake (snl,h2osno,dz,dz_lake, & !i cv, cv_lake, & !i&o lhabs) !o !============================================================================================= - ! !DESCRIPTION: - ! Calculation of the phase change within snow, soil, & lake layers: - ! (1) Check the conditions for which the phase change may take place, - ! i.e., the layer temperature is great than the freezing point - ! and the ice mass is not equal to zero (i.e. melting), - ! or the layer temperature is less than the freezing point - ! and the liquid water mass is greater than the allowable supercooled - ! (i.e. freezing). - ! (2) Assess the amount of phase change from the energy excess (or deficit) - ! after setting the layer temperature to freezing point, depending on - ! how much water or ice is available. - ! (3) Re-adjust the ice and liquid mass, and the layer temperature: either to - ! the freezing point if enough water or ice is available to fully compensate, - ! or to a remaining temperature. - ! The specific heats are assumed constant. Potential cycling errors resulting from - ! this assumption will be trapped at the end of ShalLakeTemperature. - ! !CALLED FROM: + !CALLED FROM: ! subroutine ShalLakeTemperature in this module ! - ! !REVISION HISTORY: - ! 04/2009 Zack Subin: Initial code - ! June 2022 Sam Trahan: Modified for CCPP + !REVISION HISTORY: + ! - 04/2009 Zack Subin: Initial code + ! - June 2022 Sam Trahan: Modified for CCPP !============================================================================================== ! !USES: ! @@ -2790,29 +2780,29 @@ subroutine PhaseChange_Lake (snl,h2osno,dz,dz_lake, & !i implicit none !in: - integer , intent(in) :: snl(1) !number of snow layers - real(kind_lake), intent(inout) :: h2osno(1) !snow water (mm H2O) - real(kind_lake), intent(in) :: dz(1,-nlevsnow+1:nlevsoil) !layer thickness (m) - real(kind_lake), intent(in) :: dz_lake(1,nlevlake) !lake layer thickness (m) + integer , intent(in) :: snl(1) !< number of snow layers + real(kind_lake), intent(inout) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake), intent(in) :: dz(1,-nlevsnow+1:nlevsoil) !< layer thickness (m) + real(kind_lake), intent(in) :: dz_lake(1,nlevlake) !< lake layer thickness (m) ! Needed in case snow height is less than critical value. !inout: - real(kind_lake), intent(inout) :: snowdp(1) !snow height (m) - real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !soil temperature (Kelvin) - real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !liquid water (kg/m2) - real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !ice lens (kg/m2) - real(kind_lake), intent(inout) :: lake_icefrac(1,nlevlake) ! mass fraction of lake layer that is frozen - real(kind_lake), intent(inout) :: t_lake(1,nlevlake) ! lake temperature (Kelvin) + real(kind_lake), intent(inout) :: snowdp(1) !< snow height (m) + real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil temperature (Kelvin) + real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) + real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake), intent(inout) :: lake_icefrac(1,nlevlake) !< mass fraction of lake layer that is frozen + real(kind_lake), intent(inout) :: t_lake(1,nlevlake) !< lake temperature (Kelvin) !out: - real(kind_lake), intent(out) :: qflx_snomelt(1) !snow melt (mm H2O /s) - real(kind_lake), intent(out) :: eflx_snomelt(1) !snow melt heat flux (W/m**2) - integer, intent(out) :: imelt(1,-nlevsnow+1:nlevsoil) !flag for melting (=1), freezing (=2), Not=0 (new) + real(kind_lake), intent(out) :: qflx_snomelt(1) !< snow melt (mm H2O /s) + real(kind_lake), intent(out) :: eflx_snomelt(1) !< snow melt heat flux (W/m**2) + integer, intent(out) :: imelt(1,-nlevsnow+1:nlevsoil) !< flag for melting (=1), freezing (=2), Not=0 (new) !What's the sign of this? Is it just output? - real(kind_lake), intent(inout) :: cv(lbc:ubc,-nlevsnow+1:nlevsoil) ! heat capacity [J/(m2 K)] - real(kind_lake), intent(inout) :: cv_lake (lbc:ubc,1:nlevlake) ! heat capacity [J/(m2 K)] - real(kind_lake), intent(out):: lhabs(lbc:ubc) ! total per-column latent heat abs. (J/m^2) + real(kind_lake), intent(inout) :: cv(lbc:ubc,-nlevsnow+1:nlevsoil) !< heat capacity [J/(m2 K)] + real(kind_lake), intent(inout) :: cv_lake (lbc:ubc,1:nlevlake) !< heat capacity [J/(m2 K)] + real(kind_lake), intent(out):: lhabs(lbc:ubc) !< total per-column latent heat abs. (J/m^2) ! OTHER LOCAL VARIABLES: @@ -2972,7 +2962,19 @@ subroutine PhaseChange_Lake (snl,h2osno,dz,dz_lake, & !i end subroutine PhaseChange_Lake - + ! DESCRIPTION: + !> Calculation of Shallow Lake Hydrology. Full hydrology of snow layers is + !! done. However, there is no infiltration, and the water budget is balanced with + !! qflx_qrgwl. Lake water mass is kept constant. The soil is simply maintained at + !! volumetric saturation if ice melting frees up pore space. Likewise, if the water + !! portion alone at some point exceeds pore capacity, it is reduced. This is consistent + !! with the possibility of initializing the soil layer with excess ice. The only + !! real error with that is that the thermal conductivity will ignore the excess ice + !! (and accompanying thickness change). + !! + !! If snow layers are present over an unfrozen lake, and the top layer of the lake + !! is capable of absorbing the latent heat without going below freezing, + !! the snow-water is runoff and the latent heat is subtracted from the lake. subroutine ShalLakeHydrology(dz_lake,forc_rain,forc_snow, & !i begwb,qflx_evap_tot,forc_t,do_capsnow, & t_grnd,qflx_evap_soi, & @@ -2991,19 +2993,6 @@ subroutine ShalLakeHydrology(dz_lake,forc_rain,forc_snow, & dtime,errmsg,errflg) !================================================================================== - ! !DESCRIPTION: - ! Calculation of Shallow Lake Hydrology. Full hydrology of snow layers is - ! done. However, there is no infiltration, and the water budget is balanced with - ! qflx_qrgwl. Lake water mass is kept constant. The soil is simply maintained at - ! volumetric saturation if ice melting frees up pore space. Likewise, if the water - ! portion alone at some point exceeds pore capacity, it is reduced. This is consistent - ! with the possibility of initializing the soil layer with excess ice. The only - ! real error with that is that the thermal conductivity will ignore the excess ice - ! (and accompanying thickness change). - ! - ! If snow layers are present over an unfrozen lake, and the top layer of the lake - ! is capable of absorbing the latent heat without going below freezing, - ! the snow-water is runoff and the latent heat is subtracted from the lake. ! ! WARNING: This subroutine assumes lake columns have one and only one pft. ! @@ -3034,79 +3023,79 @@ subroutine ShalLakeHydrology(dz_lake,forc_rain,forc_snow, & integer, intent(inout) :: errflg character(*), intent(inout) :: errmsg - real(kind_lake) :: watsat(1,nlevsoil) ! volumetric soil water at saturation (porosity) - real(kind_lake) :: tksatu(1,nlevsoil) ! thermal conductivity, saturated soil [W/m-K] - real(kind_lake) :: tkmg(1,nlevsoil) ! thermal conductivity, soil minerals [W/m-K] - real(kind_lake) :: tkdry(1,nlevsoil) ! thermal conductivity, dry soil (W/m/Kelvin) - real(kind_lake) :: csol(1,nlevsoil) ! heat capacity, soil solids (J/m**3/Kelvin) - - ! integer , intent(in) :: clandunit(1) ! column's landunit - ! integer , intent(in) :: ityplun(1) ! landunit type - real(kind_lake), intent(in) :: dtime ! timestep - real(kind_lake), intent(in) :: dz_lake(1,nlevlake) ! layer thickness for lake (m) - real(kind_lake), intent(in) :: forc_rain(1) ! rain rate [mm/s] - real(kind_lake), intent(in) :: forc_snow(1) ! snow rate [mm/s] - real(kind_lake), intent(in) :: qflx_evap_tot(1) ! qflx_evap_soi + qflx_evap_veg + qflx_tran_veg - real(kind_lake), intent(in) :: forc_t(1) ! atmospheric temperature (Kelvin) - - !real(kind_lake), intent(in),optional :: flfall(1) ! fraction of liquid water within falling precipitation (unused) - - logical , intent(in) :: do_capsnow(1) ! true => do snow capping - real(kind_lake), intent(in) :: t_grnd(1) ! ground temperature (Kelvin) - real(kind_lake), intent(in) :: qflx_evap_soi(1) ! soil evaporation (mm H2O/s) (+ = to atm) - real(kind_lake), intent(in) :: qflx_snomelt(1) !snow melt (mm H2O /s) - integer, intent(in) :: imelt(1,-nlevsnow+1:nlevsoil) !flag for melting (=1), freezing (=2), Not=0 + real(kind_lake) :: watsat(1,nlevsoil) !< volumetric soil water at saturation (porosity) + real(kind_lake) :: tksatu(1,nlevsoil) !< thermal conductivity, saturated soil [W/m-K] + real(kind_lake) :: tkmg(1,nlevsoil) !< thermal conductivity, soil minerals [W/m-K] + real(kind_lake) :: tkdry(1,nlevsoil) !< thermal conductivity, dry soil (W/m/Kelvin) + real(kind_lake) :: csol(1,nlevsoil) !< heat capacity, soil solids (J/m**3/Kelvin) + + ! integer , intent(in) :: clandunit(1) !< column's landunit + ! integer , intent(in) :: ityplun(1) !< landunit type + real(kind_lake), intent(in) :: dtime !< timestep + real(kind_lake), intent(in) :: dz_lake(1,nlevlake) !< layer thickness for lake (m) + real(kind_lake), intent(in) :: forc_rain(1) !< rain rate [mm/s] + real(kind_lake), intent(in) :: forc_snow(1) !< snow rate [mm/s] + real(kind_lake), intent(in) :: qflx_evap_tot(1) !< qflx_evap_soi + qflx_evap_veg + qflx_tran_veg + real(kind_lake), intent(in) :: forc_t(1) !< atmospheric temperature (Kelvin) + + !real(kind_lake), intent(in),optional :: flfall(1) !< fraction of liquid water within falling precipitation (unused) + + logical , intent(in) :: do_capsnow(1) !< true => do snow capping + real(kind_lake), intent(in) :: t_grnd(1) !< ground temperature (Kelvin) + real(kind_lake), intent(in) :: qflx_evap_soi(1) !< soil evaporation (mm H2O/s) (+ = to atm) + real(kind_lake), intent(in) :: qflx_snomelt(1) !< snow melt (mm H2O /s) + integer, intent(in) :: imelt(1,-nlevsnow+1:nlevsoil) !< flag for melting (=1), freezing (=2), Not=0 !inout: - real(kind_lake), intent(inout) :: begwb(1) ! water mass begining of the time step + real(kind_lake), intent(inout) :: begwb(1) !< water mass begining of the time step ! inout: - real(kind_lake), intent(inout) :: z(1,-nlevsnow+1:nlevsoil) ! layer depth (m) - real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) ! layer thickness depth (m) - real(kind_lake), intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) ! interface depth (m) - integer , intent(inout) :: snl(1) ! number of snow layers - real(kind_lake), intent(inout) :: h2osno(1) ! snow water (mm H2O) - real(kind_lake), intent(inout) :: snowdp(1) ! snow height (m) - real(kind_lake), intent(inout) :: lake_icefrac(1,nlevlake) ! mass fraction of lake layer that is frozen - real(kind_lake), intent(inout) :: t_lake(1,nlevlake) ! lake temperature (Kelvin) - - real(kind_lake), intent(inout) :: frac_iceold(1,-nlevsnow+1:nlevsoil) ! fraction of ice relative to the tot water + real(kind_lake), intent(inout) :: z(1,-nlevsnow+1:nlevsoil) !< layer depth (m) + real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !< layer thickness depth (m) + real(kind_lake), intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) !< interface depth (m) + integer , intent(inout) :: snl(1) !< number of snow layers + real(kind_lake), intent(inout) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake), intent(inout) :: snowdp(1) !< snow height (m) + real(kind_lake), intent(inout) :: lake_icefrac(1,nlevlake) !< mass fraction of lake layer that is frozen + real(kind_lake), intent(inout) :: t_lake(1,nlevlake) !< lake temperature (Kelvin) + + real(kind_lake), intent(inout) :: frac_iceold(1,-nlevsnow+1:nlevsoil) !< fraction of ice relative to the tot water ! out: - real(kind_lake), intent(out) :: endwb(1) ! water mass end of the time step - real(kind_lake), intent(out) :: snowage(1) ! non dimensional snow age [-] - real(kind_lake), intent(out) :: snowice(1) ! average snow ice lens - real(kind_lake), intent(out) :: snowliq(1) ! average snow liquid water - real(kind_lake), intent(out) :: t_snow(1) ! vertically averaged snow temperature - real(kind_lake), intent(out) :: t_soisno(1,-nlevsnow+1:nlevsoil) ! snow temperature (Kelvin) - real(kind_lake), intent(out) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) ! ice lens (kg/m2) - real(kind_lake), intent(out) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) ! liquid water (kg/m2) - real(kind_lake), intent(out) :: h2osoi_vol(1,-nlevsnow+1:nlevsoil) ! volumetric soil water (0<=h2osoi_vol<=watsat)[m3/m3] - real(kind_lake), intent(out) :: qflx_drain(1) ! sub-surface runoff (mm H2O /s) - real(kind_lake), intent(out) :: qflx_surf(1) ! surface runoff (mm H2O /s) - real(kind_lake), intent(out) :: qflx_infl(1) ! infiltration (mm H2O /s) - real(kind_lake), intent(out) :: qflx_qrgwl(1) ! qflx_surf at glaciers, wetlands, lakes - real(kind_lake), intent(out) :: qcharge(1) ! aquifer recharge rate (mm/s) - real(kind_lake), intent(out) :: qflx_prec_grnd(1) ! water onto ground including canopy runoff [kg/(m2 s)] - real(kind_lake), intent(out) :: qflx_snowcap(1) ! excess precipitation due to snow capping (mm H2O /s) [+] - real(kind_lake), intent(out) :: qflx_snowcap_col(1) ! excess precipitation due to snow capping (mm H2O /s) [+] - real(kind_lake), intent(out) :: qflx_snow_grnd_pft(1) ! snow on ground after interception (mm H2O/s) [+] - real(kind_lake), intent(out) :: qflx_snow_grnd_col(1) ! snow on ground after interception (mm H2O/s) [+] - real(kind_lake), intent(out) :: qflx_rain_grnd(1) ! rain on ground after interception (mm H2O/s) [+] - real(kind_lake), intent(out) :: qflx_evap_tot_col(1) !pft quantity averaged to the column (assuming one pft) - real(kind_lake) ,intent(out) :: soilalpha(1) !factor that reduces ground saturated specific humidity (-) - real(kind_lake), intent(out) :: zwt(1) !water table depth - real(kind_lake), intent(out) :: fcov(1) !fractional area with water table at surface - real(kind_lake), intent(out) :: rootr_column(1,1:nlevsoil) !effective fraction of roots in each soil layer - real(kind_lake), intent(out) :: qflx_evap_grnd(1) ! ground surface evaporation rate (mm H2O/s) [+] - real(kind_lake), intent(out) :: qflx_sub_snow(1) ! sublimation rate from snow pack (mm H2O /s) [+] - real(kind_lake), intent(out) :: qflx_dew_snow(1) ! surface dew added to snow pack (mm H2O /s) [+] - real(kind_lake), intent(out) :: qflx_dew_grnd(1) ! ground surface dew formation (mm H2O /s) [+] - real(kind_lake), intent(out) :: qflx_rain_grnd_col(1) !rain on ground after interception (mm H2O/s) [+] + real(kind_lake), intent(out) :: endwb(1) !< water mass end of the time step + real(kind_lake), intent(out) :: snowage(1) !< non dimensional snow age [-] + real(kind_lake), intent(out) :: snowice(1) !< average snow ice lens + real(kind_lake), intent(out) :: snowliq(1) !< average snow liquid water + real(kind_lake), intent(out) :: t_snow(1) !< vertically averaged snow temperature + real(kind_lake), intent(out) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< snow temperature (Kelvin) + real(kind_lake), intent(out) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake), intent(out) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) + real(kind_lake), intent(out) :: h2osoi_vol(1,-nlevsnow+1:nlevsoil) !< volumetric soil water (0<=h2osoi_vol<=watsat)[m3/m3] + real(kind_lake), intent(out) :: qflx_drain(1) !< sub-surface runoff (mm H2O /s) + real(kind_lake), intent(out) :: qflx_surf(1) !< surface runoff (mm H2O /s) + real(kind_lake), intent(out) :: qflx_infl(1) !< infiltration (mm H2O /s) + real(kind_lake), intent(out) :: qflx_qrgwl(1) !< qflx_surf at glaciers, wetlands, lakes + real(kind_lake), intent(out) :: qcharge(1) !< aquifer recharge rate (mm/s) + real(kind_lake), intent(out) :: qflx_prec_grnd(1) !< water onto ground including canopy runoff [kg/(m2 s)] + real(kind_lake), intent(out) :: qflx_snowcap(1) !< excess precipitation due to snow capping (mm H2O /s) [+] + real(kind_lake), intent(out) :: qflx_snowcap_col(1) !< excess precipitation due to snow capping (mm H2O /s) [+] + real(kind_lake), intent(out) :: qflx_snow_grnd_pft(1) !< snow on ground after interception (mm H2O/s) [+] + real(kind_lake), intent(out) :: qflx_snow_grnd_col(1) !< snow on ground after interception (mm H2O/s) [+] + real(kind_lake), intent(out) :: qflx_rain_grnd(1) !< rain on ground after interception (mm H2O/s) [+] + real(kind_lake), intent(out) :: qflx_evap_tot_col(1) !< pft quantity averaged to the column (assuming one pft) + real(kind_lake) ,intent(out) :: soilalpha(1) !< factor that reduces ground saturated specific humidity (-) + real(kind_lake), intent(out) :: zwt(1) !< water table depth + real(kind_lake), intent(out) :: fcov(1) !< fractional area with water table at surface + real(kind_lake), intent(out) :: rootr_column(1,1:nlevsoil) !< effective fraction of roots in each soil layer + real(kind_lake), intent(out) :: qflx_evap_grnd(1) !< ground surface evaporation rate (mm H2O/s) [+] + real(kind_lake), intent(out) :: qflx_sub_snow(1) !< sublimation rate from snow pack (mm H2O /s) [+] + real(kind_lake), intent(out) :: qflx_dew_snow(1) !< surface dew added to snow pack (mm H2O /s) [+] + real(kind_lake), intent(out) :: qflx_dew_grnd(1) !< ground surface dew formation (mm H2O /s) [+] + real(kind_lake), intent(out) :: qflx_rain_grnd_col(1) !< rain on ground after interception (mm H2O/s) [+] ! Block of biogeochem currently not used. real(kind_lake), pointer :: sucsat(:,:) ! minimum soil suction (mm) @@ -3644,25 +3633,25 @@ subroutine ShalLakeHydrology(dz_lake,forc_rain,forc_snow, & end subroutine ShalLakeHydrology +! DESCRIPTION: +!> Computes saturation mixing ratio and the change in saturation +!! mixing ratio with respect to temperature. subroutine QSat (T, p, es, esdT, qs, qsdT) ! - ! !DESCRIPTION: - ! Computes saturation mixing ratio and the change in saturation - ! mixing ratio with respect to temperature. ! Reference: Polynomial approximations from: ! Piotr J. Flatau, et al.,1992: Polynomial fits to saturation ! vapor pressure. Journal of Applied Meteorology, 31, 1507-1513. ! - ! !USES: + ! USES: ! - ! !ARGUMENTS: + ! ARGUMENTS: implicit none - real(kind_lake), intent(in) :: T ! temperature (K) - real(kind_lake), intent(in) :: p ! surface atmospheric pressure (pa) - real(kind_lake), intent(out) :: es ! vapor pressure (pa) - real(kind_lake), intent(out) :: esdT ! d(es)/d(T) - real(kind_lake), intent(out) :: qs ! humidity (kg/kg) - real(kind_lake), intent(out) :: qsdT ! d(qs)/d(T) + real(kind_lake), intent(in) :: T !< temperature (K) + real(kind_lake), intent(in) :: p !< surface atmospheric pressure (pa) + real(kind_lake), intent(out) :: es !< vapor pressure (pa) + real(kind_lake), intent(out) :: esdT !< d(es)/d(T) + real(kind_lake), intent(out) :: qs !< humidity (kg/kg) + real(kind_lake), intent(out) :: qsdT !< d(qs)/d(T) ! ! !CALLED FROM: ! subroutine Biogeophysics1 in module Biogeophysics1Mod @@ -3762,21 +3751,21 @@ end subroutine QSat subroutine Tridiagonal (lbc, ubc, lbj, ubj, jtop, numf, filter, & a, b, c, r, u) ! - ! !DESCRIPTION: - ! Tridiagonal matrix solution + ! DESCRIPTION: + !< Tridiagonal matrix solution ! - ! !ARGUMENTS: + ! ARGUMENTS: implicit none - integer , intent(in) :: lbc, ubc ! lbinning and ubing column indices - integer , intent(in) :: lbj, ubj ! lbinning and ubing level indices - integer , intent(in) :: jtop(lbc:ubc) ! top level for each column - integer , intent(in) :: numf ! filter dimension - integer , intent(in) :: filter(1:numf) ! filter - real(kind_lake), intent(in) :: a(lbc:ubc, lbj:ubj) ! "a" left off diagonal of tridiagonal matrix - real(kind_lake), intent(in) :: b(lbc:ubc, lbj:ubj) ! "b" diagonal column for tridiagonal matrix - real(kind_lake), intent(in) :: c(lbc:ubc, lbj:ubj) ! "c" right off diagonal tridiagonal matrix - real(kind_lake), intent(in) :: r(lbc:ubc, lbj:ubj) ! "r" forcing term of tridiagonal matrix - real(kind_lake), intent(inout) :: u(lbc:ubc, lbj:ubj) ! solution + integer , intent(in) :: lbc, ubc !< lbinning and ubing column indices + integer , intent(in) :: lbj, ubj !< lbinning and ubing level indices + integer , intent(in) :: jtop(lbc:ubc) !< top level for each column + integer , intent(in) :: numf !< filter dimension + integer , intent(in) :: filter(1:numf) !< filter + real(kind_lake), intent(in) :: a(lbc:ubc, lbj:ubj) !< "a" left off diagonal of tridiagonal matrix + real(kind_lake), intent(in) :: b(lbc:ubc, lbj:ubj) !< "b" diagonal column for tridiagonal matrix + real(kind_lake), intent(in) :: c(lbc:ubc, lbj:ubj) !< "c" right off diagonal tridiagonal matrix + real(kind_lake), intent(in) :: r(lbc:ubc, lbj:ubj) !< "r" forcing term of tridiagonal matrix + real(kind_lake), intent(inout) :: u(lbc:ubc, lbj:ubj) !< solution ! ! !CALLED FROM: ! subroutine BiogeophysicsLake in module BiogeophysicsLakeMod @@ -3841,6 +3830,17 @@ subroutine Tridiagonal (lbc, ubc, lbj, ubj, jtop, numf, filter, & end subroutine Tridiagonal + ! DESCRIPTION: + !> Evaluate the change of snow mass and the snow water onto soil. + !! Water flow within snow is computed by an explicit and non-physical + !! based scheme, which permits a part of liquid water over the holding + !! capacity (a tentative value is used, i.e. equal to 0.033*porosity) to + !! percolate into the underlying layer. Except for cases where the + !! porosity of one of the two neighboring layers is less than 0.05, zero + !! flow is assumed. The water flow out of the bottom of the snow pack will + !! participate as the input of the soil water and runoff. This subroutine + !! uses a filter for columns containing snow which must be constructed prior + !! to being called. subroutine SnowWater(lbc, ubc, num_snowc, filter_snowc, & !i num_nosnowc, filter_nosnowc, & !i snl,do_capsnow,qflx_snomelt,qflx_rain_grnd, & !i @@ -3849,18 +3849,6 @@ subroutine SnowWater(lbc, ubc, num_snowc, filter_snowc, & !i h2osoi_ice,h2osoi_liq, & !i&o qflx_top_soil) !o !=============================================================================== - ! !DESCRIPTION: - ! Evaluate the change of snow mass and the snow water onto soil. - ! Water flow within snow is computed by an explicit and non-physical - ! based scheme, which permits a part of liquid water over the holding - ! capacity (a tentative value is used, i.e. equal to 0.033*porosity) to - ! percolate into the underlying layer. Except for cases where the - ! porosity of one of the two neighboring layers is less than 0.05, zero - ! flow is assumed. The water flow out of the bottom of the snow pack will - ! participate as the input of the soil water and runoff. This subroutine - ! uses a filter for columns containing snow which must be constructed prior - ! to being called. - ! ! !REVISION HISTORY: ! 15 September 1999: Yongjiu Dai; Initial code ! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision @@ -3873,32 +3861,32 @@ subroutine SnowWater(lbc, ubc, num_snowc, filter_snowc, & !i implicit none !in: - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_snowc ! number of snow points in column filter - integer, intent(in) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer, intent(in) :: num_nosnowc ! number of non-snow points in column filter - integer, intent(in) :: filter_nosnowc(ubc-lbc+1) ! column filter for non-snow points - - integer , intent(in) :: snl(1) !number of snow layers - logical , intent(in) :: do_capsnow(1) !true => do snow capping - real(kind_lake), intent(in) :: dtime !timestep - real(kind_lake), intent(in) :: qflx_snomelt(1) !snow melt (mm H2O /s) - real(kind_lake), intent(in) :: qflx_rain_grnd(1) !rain on ground after interception (mm H2O/s) [+] - real(kind_lake), intent(in) :: qflx_sub_snow(1) !sublimation rate from snow pack (mm H2O /s) [+] - real(kind_lake), intent(in) :: qflx_evap_grnd(1) !ground surface evaporation rate (mm H2O/s) [+] - real(kind_lake), intent(in) :: qflx_dew_snow(1) !surface dew added to snow pack (mm H2O /s) [+] - real(kind_lake), intent(in) :: qflx_dew_grnd(1) !ground surface dew formation (mm H2O /s) [+] - real(kind_lake), intent(in) :: dz(1,-nlevsnow+1:nlevsoil) !layer depth (m) + integer, intent(in) :: lbc, ubc !< column bounds + integer, intent(in) :: num_snowc !< number of snow points in column filter + integer, intent(in) :: filter_snowc(ubc-lbc+1) !< column filter for snow points + integer, intent(in) :: num_nosnowc !< number of non-snow points in column filter + integer, intent(in) :: filter_nosnowc(ubc-lbc+1) !< column filter for non-snow points + + integer , intent(in) :: snl(1) !< number of snow layers + logical , intent(in) :: do_capsnow(1) !< true => do snow capping + real(kind_lake), intent(in) :: dtime !< timestep + real(kind_lake), intent(in) :: qflx_snomelt(1) !< snow melt (mm H2O /s) + real(kind_lake), intent(in) :: qflx_rain_grnd(1) !< rain on ground after interception (mm H2O/s) [+] + real(kind_lake), intent(in) :: qflx_sub_snow(1) !< sublimation rate from snow pack (mm H2O /s) [+] + real(kind_lake), intent(in) :: qflx_evap_grnd(1) !< ground surface evaporation rate (mm H2O/s) [+] + real(kind_lake), intent(in) :: qflx_dew_snow(1) !< surface dew added to snow pack (mm H2O /s) [+] + real(kind_lake), intent(in) :: qflx_dew_grnd(1) !< ground surface dew formation (mm H2O /s) [+] + real(kind_lake), intent(in) :: dz(1,-nlevsnow+1:nlevsoil) !< layer depth (m) !inout: - real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !ice lens (kg/m2) - real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !liquid water (kg/m2) + real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) !out: - real(kind_lake), intent(out) :: qflx_top_soil(1) !net water input into soil from top (mm/s) + real(kind_lake), intent(out) :: qflx_top_soil(1) !< net water input into soil from top (mm/s) ! OTHER LOCAL VARIABLES: @@ -4006,6 +3994,13 @@ subroutine SnowWater(lbc, ubc, num_snowc, filter_snowc, & !i end subroutine SnowWater +!> Determine the change in snow layer thickness due to compaction and +!! settling. +!! Three metamorphisms of changing snow characteristics are implemented, +!! i.e., destructive, overburden, and melt. The treatments of the former +!! two are from SNTHERM.89 and SNTHERM.99 (1991, 1999). The contribution +!! due to melt metamorphism is simply taken as a ratio of snow ice +!! fraction after the melting versus before the melting. subroutine SnowCompaction(lbc, ubc, num_snowc, filter_snowc, &!i snl,imelt,frac_iceold,t_soisno, &!i h2osoi_ice,h2osoi_liq,dtime, &!i @@ -4013,15 +4008,6 @@ subroutine SnowCompaction(lbc, ubc, num_snowc, filter_snowc, &!i !================================================================================ - ! !DESCRIPTION: - ! Determine the change in snow layer thickness due to compaction and - ! settling. - ! Three metamorphisms of changing snow characteristics are implemented, - ! i.e., destructive, overburden, and melt. The treatments of the former - ! two are from SNTHERM.89 and SNTHERM.99 (1991, 1999). The contribution - ! due to melt metamorphism is simply taken as a ratio of snow ice - ! fraction after the melting versus before the melting. - ! ! CALLED FROM: ! subroutine Hydrology2 in module Hydrology2Mod ! @@ -4037,20 +4023,20 @@ subroutine SnowCompaction(lbc, ubc, num_snowc, filter_snowc, &!i implicit none !in: - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_snowc ! number of column snow points in column filter - integer, intent(in) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer, intent(in) :: snl(1) !number of snow layers - integer, intent(in) :: imelt(1,-nlevsnow+1:nlevsoil) !flag for melting (=1), freezing (=2), Not=0 - real(kind_lake), intent(in) :: dtime - real(kind_lake), intent(in) :: frac_iceold(1,-nlevsnow+1:nlevsoil) !fraction of ice relative to the tot water - real(kind_lake), intent(in) :: t_soisno(1,-nlevsnow+1:nlevsoil) !soil temperature (Kelvin) - real(kind_lake), intent(in) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !ice lens (kg/m2) - real(kind_lake), intent(in) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !liquid water (kg/m2) + integer, intent(in) :: lbc, ubc !< column bounds + integer, intent(in) :: num_snowc !< number of column snow points in column filter + integer, intent(in) :: filter_snowc(ubc-lbc+1) !< column filter for snow points + integer, intent(in) :: snl(1) !< number of snow layers + integer, intent(in) :: imelt(1,-nlevsnow+1:nlevsoil) !< flag for melting (=1), freezing (=2), Not=0 + real(kind_lake), intent(in) :: dtime !< + real(kind_lake), intent(in) :: frac_iceold(1,-nlevsnow+1:nlevsoil) !< fraction of ice relative to the tot water + real(kind_lake), intent(in) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil temperature (Kelvin) + real(kind_lake), intent(in) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake), intent(in) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) !inout: - real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !layer depth (m) + real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !< layer depth (m) ! OTHER LOCAL VARIABLES: @@ -4137,21 +4123,24 @@ subroutine SnowCompaction(lbc, ubc, num_snowc, filter_snowc, &!i end subroutine SnowCompaction +!> Combine snow layers that are less than a minimum thickness or mass +!! If the snow element thickness or mass is less than a prescribed minimum, +!! then it is combined with a neighboring element. subroutine CombineSnowLayers(lbc, ubc, & !i num_snowc, filter_snowc, & !i&o snl,h2osno,snowdp,dz,zi, & !i&o t_soisno,h2osoi_ice,h2osoi_liq, & !i&o z) !o !========================================================================== - ! !DESCRIPTION: + ! DESCRIPTION: ! Combine snow layers that are less than a minimum thickness or mass ! If the snow element thickness or mass is less than a prescribed minimum, ! then it is combined with a neighboring element. The subroutine ! clm\_combo.f90 then executes the combination of mass and energy. - ! !CALLED FROM: + ! CALLED FROM: ! subroutine Hydrology2 in module Hydrology2Mod ! - ! !REVISION HISTORY: + ! REVISION HISTORY: ! 15 September 1999: Yongjiu Dai; Initial code ! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision ! 2/28/02, Peter Thornton: Migrated to new data structures. @@ -4162,25 +4151,25 @@ subroutine CombineSnowLayers(lbc, ubc, & !i ! !ARGUMENTS: implicit none !in: - integer, intent(in) :: lbc, ubc ! column bounds + integer, intent(in) :: lbc, ubc !< column bounds ! integer, intent(in) :: clandunit(1) !landunit index for each column ! integer, intent(in) :: ityplun(1) !landunit type !inout: - integer, intent(inout) :: num_snowc ! number of column snow points in column filter - integer, intent(inout) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer , intent(inout) :: snl(1) !number of snow layers - real(kind_lake), intent(inout) :: h2osno(1) !snow water (mm H2O) - real(kind_lake), intent(inout) :: snowdp(1) !snow height (m) - real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !layer depth (m) - real(kind_lake), intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) !interface level below a "z" level (m) - real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !soil temperature (Kelvin) - real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !ice lens (kg/m2) - real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !liquid water (kg/m2) + integer, intent(inout) :: num_snowc !< number of column snow points in column filter + integer, intent(inout) :: filter_snowc(ubc-lbc+1) !< column filter for snow points + integer , intent(inout) :: snl(1) !< number of snow layers + real(kind_lake), intent(inout) :: h2osno(1) !< snow water (mm H2O) + real(kind_lake), intent(inout) :: snowdp(1) !< snow height (m) + real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !< layer depth (m) + real(kind_lake), intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) !< interface level below a "z" level (m) + real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil temperature (Kelvin) + real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) !out: - real(kind_lake), intent(out) :: z(1,-nlevsnow+1:nlevsoil) !layer thickness (m) + real(kind_lake), intent(out) :: z(1,-nlevsnow+1:nlevsoil) !< layer thickness (m) ! !EOP ! @@ -4359,6 +4348,8 @@ subroutine CombineSnowLayers(lbc, ubc, & !i end subroutine CombineSnowLayers +! DESCRIPTION: +!> Subdivides snow layers if they exceed their prescribed maximum thickness. subroutine DivideSnowLayers(lbc, ubc, & !i num_snowc, filter_snowc, & !i&o snl,dz,zi,t_soisno, & !i&o @@ -4367,8 +4358,6 @@ subroutine DivideSnowLayers(lbc, ubc, & !i !============================================================================ - ! !DESCRIPTION: - ! Subdivides snow layers if they exceed their prescribed maximum thickness. ! !CALLED FROM: ! subroutine Hydrology2 in module Hydrology2Mod ! @@ -4384,22 +4373,22 @@ subroutine DivideSnowLayers(lbc, ubc, & !i implicit none !in: - integer, intent(in) :: lbc, ubc ! column bounds + integer, intent(in) :: lbc, ubc !< column bounds !inout: - integer, intent(inout) :: num_snowc ! number of column snow points in column filter - integer, intent(inout) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer , intent(inout) :: snl(1) !number of snow layers - real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !layer depth (m) - real(kind_lake), intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) !interface level below a "z" level (m) - real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !soil temperature (Kelvin) - real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !ice lens (kg/m2) - real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !liquid water (kg/m2) + integer, intent(inout) :: num_snowc !< number of column snow points in column filter + integer, intent(inout) :: filter_snowc(ubc-lbc+1) !< column filter for snow points + integer , intent(inout) :: snl(1) !< number of snow layers + real(kind_lake), intent(inout) :: dz(1,-nlevsnow+1:nlevsoil) !< layer depth (m) + real(kind_lake), intent(inout) :: zi(1,-nlevsnow+0:nlevsoil) !< interface level below a "z" level (m) + real(kind_lake), intent(inout) :: t_soisno(1,-nlevsnow+1:nlevsoil) !< soil temperature (Kelvin) + real(kind_lake), intent(inout) :: h2osoi_ice(1,-nlevsnow+1:nlevsoil) !< ice lens (kg/m2) + real(kind_lake), intent(inout) :: h2osoi_liq(1,-nlevsnow+1:nlevsoil) !< liquid water (kg/m2) !out: - real(kind_lake), intent(out) :: z(1,-nlevsnow+1:nlevsoil) !layer thickness (m) + real(kind_lake), intent(out) :: z(1,-nlevsnow+1:nlevsoil) !< layer thickness (m) @@ -4587,11 +4576,13 @@ subroutine DivideSnowLayers(lbc, ubc, & !i end subroutine DivideSnowLayers +!> Combines two elements and returns the following combined +!! variables: dz, t, wliq, wice. subroutine Combo(dz, wliq, wice, t, dz2, wliq2, wice2, t2) ! - ! !DESCRIPTION: - ! Combines two elements and returns the following combined - ! variables: dz, t, wliq, wice. + ! DESCRIPTION: + !> Combines two elements and returns the following combined + !! variables: dz, t, wliq, wice. ! The combined temperature is based on the equation: ! the sum of the enthalpies of the two elements = ! that of the combined element. @@ -4600,14 +4591,14 @@ subroutine Combo(dz, wliq, wice, t, dz2, wliq2, wice2, t2) ! ! !ARGUMENTS: implicit none - real(kind_lake), intent(in) :: dz2 ! nodal thickness of 2 elements being combined [m] - real(kind_lake), intent(in) :: wliq2 ! liquid water of element 2 [kg/m2] - real(kind_lake), intent(in) :: wice2 ! ice of element 2 [kg/m2] - real(kind_lake), intent(in) :: t2 ! nodal temperature of element 2 [K] - real(kind_lake), intent(inout) :: dz ! nodal thickness of 1 elements being combined [m] - real(kind_lake), intent(inout) :: wliq ! liquid water of element 1 - real(kind_lake), intent(inout) :: wice ! ice of element 1 [kg/m2] - real(kind_lake), intent(inout) :: t ! nodel temperature of elment 1 [K] + real(kind_lake), intent(in) :: dz2 !< nodal thickness of 2 elements being combined [m] + real(kind_lake), intent(in) :: wliq2 !< liquid water of element 2 [kg/m2] + real(kind_lake), intent(in) :: wice2 !< ice of element 2 [kg/m2] + real(kind_lake), intent(in) :: t2 !< nodal temperature of element 2 [K] + real(kind_lake), intent(inout) :: dz !< nodal thickness of 1 elements being combined [m] + real(kind_lake), intent(inout) :: wliq !< liquid water of element 1 + real(kind_lake), intent(inout) :: wice !< ice of element 1 [kg/m2] + real(kind_lake), intent(inout) :: t !< nodel temperature of elment 1 [K] ! ! !CALLED FROM: ! subroutine CombineSnowLayers in this module @@ -4653,26 +4644,27 @@ subroutine Combo(dz, wliq, wice, t, dz2, wliq2, wice2, t2) end subroutine Combo +!> Constructs snow filter for use in vectorized loops for snow hydrology. subroutine BuildSnowFilter(lbc, ubc, num_nolakec, filter_nolakec,snl, & !i num_snowc, filter_snowc, & !o num_nosnowc, filter_nosnowc) !o ! - ! !DESCRIPTION: - ! Constructs snow filter for use in vectorized loops for snow hydrology. + ! DESCRIPTION: + !> Constructs snow filter for use in vectorized loops for snow hydrology. ! ! !USES: ! use clmtype ! ! !ARGUMENTS: implicit none - integer, intent(in) :: lbc, ubc ! column bounds - integer, intent(in) :: num_nolakec ! number of column non-lake points in column filter - integer, intent(in) :: filter_nolakec(ubc-lbc+1) ! column filter for non-lake points - integer, intent(in) :: snl(1) ! number of snow layers - integer, intent(out) :: num_snowc ! number of column snow points in column filter - integer, intent(out) :: filter_snowc(ubc-lbc+1) ! column filter for snow points - integer, intent(out) :: num_nosnowc ! number of column non-snow points in column filter - integer, intent(out) :: filter_nosnowc(ubc-lbc+1) ! column filter for non-snow points + integer, intent(in) :: lbc, ubc !< column bounds + integer, intent(in) :: num_nolakec !< number of column non-lake points in column filter + integer, intent(in) :: filter_nolakec(ubc-lbc+1) !< column filter for non-lake points + integer, intent(in) :: snl(1) !< number of snow layers + integer, intent(out) :: num_snowc !< number of column snow points in column filter + integer, intent(out) :: filter_snowc(ubc-lbc+1) !< column filter for snow points + integer, intent(out) :: num_nosnowc !< number of column non-snow points in column filter + integer, intent(out) :: filter_nosnowc(ubc-lbc+1) !< column filter for non-snow points ! ! !CALLED FROM: ! subroutine Hydrology2 in Hydrology2Mod @@ -4710,7 +4702,13 @@ subroutine BuildSnowFilter(lbc, ubc, num_nolakec, filter_nolakec,snl, & !i end subroutine BuildSnowFilter - + ! DESCRIPTION: + !> Calculation of the friction velocity, relation for potential + !! temperature and humidity profiles of surface boundary layer. + !! The scheme is based on the work of Zeng et al. (1998): + !! Intercomparison of bulk aerodynamic algorithms for the computation + !! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, + !! Vol. 11, 2628-2644. subroutine FrictionVelocity(pgridcell,forc_hgt,forc_hgt_u, & !i forc_hgt_t,forc_hgt_q, & !i lbp, ubp, fn, filterp, & !i @@ -4721,15 +4719,7 @@ subroutine FrictionVelocity(pgridcell,forc_hgt,forc_hgt_u, & !i fm) !i&o !============================================================================= - ! !DESCRIPTION: - ! Calculation of the friction velocity, relation for potential - ! temperature and humidity profiles of surface boundary layer. - ! The scheme is based on the work of Zeng et al. (1998): - ! Intercomparison of bulk aerodynamic algorithms for the computation - ! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, - ! Vol. 11, 2628-2644. - ! - ! !REVISION HISTORY: + ! REVISION HISTORY: ! 15 September 1999: Yongjiu Dai; Initial code ! 15 December 1999: Paul Houser and Jon Radakovich; F90 Revision ! 12/19/01, Peter Thornton @@ -4746,35 +4736,35 @@ subroutine FrictionVelocity(pgridcell,forc_hgt,forc_hgt_u, & !i !in: - integer , intent(in) :: pgridcell(1) ! pft's gridcell index - real(kind_lake), intent(in) :: forc_hgt(1) ! atmospheric reference height (m) - real(kind_lake), intent(in) :: forc_hgt_u(1) ! observational height of wind [m] - real(kind_lake), intent(in) :: forc_hgt_t(1) ! observational height of temperature [m] - real(kind_lake), intent(in) :: forc_hgt_q(1) ! observational height of humidity [m] - integer , intent(in) :: lbp, ubp ! pft array bounds - integer , intent(in) :: fn ! number of filtered pft elements - integer , intent(in) :: filterp(fn) ! pft filter - real(kind_lake), intent(in) :: displa(lbp:ubp) ! displacement height (m) - real(kind_lake), intent(in) :: z0m(lbp:ubp) ! roughness length over vegetation, momentum [m] - real(kind_lake), intent(in) :: z0h(lbp:ubp) ! roughness length over vegetation, sensible heat [m] - real(kind_lake), intent(in) :: z0q(lbp:ubp) ! roughness length over vegetation, latent heat [m] - real(kind_lake), intent(in) :: obu(lbp:ubp) ! monin-obukhov length (m) - integer, intent(in) :: iter ! iteration number - real(kind_lake), intent(in) :: ur(lbp:ubp) ! wind speed at reference height [m/s] - real(kind_lake), intent(in) :: um(lbp:ubp) ! wind speed including the stablity effect [m/s] + integer , intent(in) :: pgridcell(1) !< pft's gridcell index + real(kind_lake), intent(in) :: forc_hgt(1) !< atmospheric reference height (m) + real(kind_lake), intent(in) :: forc_hgt_u(1) !< observational height of wind [m] + real(kind_lake), intent(in) :: forc_hgt_t(1) !< observational height of temperature [m] + real(kind_lake), intent(in) :: forc_hgt_q(1) !< observational height of humidity [m] + integer , intent(in) :: lbp, ubp !< pft array bounds + integer , intent(in) :: fn !< number of filtered pft elements + integer , intent(in) :: filterp(fn) !< pft filter + real(kind_lake), intent(in) :: displa(lbp:ubp) !< displacement height (m) + real(kind_lake), intent(in) :: z0m(lbp:ubp) !< roughness length over vegetation, momentum [m] + real(kind_lake), intent(in) :: z0h(lbp:ubp) !< roughness length over vegetation, sensible heat [m] + real(kind_lake), intent(in) :: z0q(lbp:ubp) !< roughness length over vegetation, latent heat [m] + real(kind_lake), intent(in) :: obu(lbp:ubp) !< monin-obukhov length (m) + integer, intent(in) :: iter !< iteration number + real(kind_lake), intent(in) :: ur(lbp:ubp) !< wind speed at reference height [m/s] + real(kind_lake), intent(in) :: um(lbp:ubp) !< wind speed including the stablity effect [m/s] !out: - real(kind_lake), intent(out) :: ustar(lbp:ubp) ! friction velocity [m/s] - real(kind_lake), intent(out) :: temp1(lbp:ubp) ! relation for potential temperature profile - real(kind_lake), intent(out) :: temp12m(lbp:ubp) ! relation for potential temperature profile applied at 2-m - real(kind_lake), intent(out) :: temp2(lbp:ubp) ! relation for specific humidity profile - real(kind_lake), intent(out) :: temp22m(lbp:ubp) ! relation for specific humidity profile applied at 2-m - real(kind_lake), intent(out) :: u10(1) ! 10-m wind (m/s) (for dust model) - real(kind_lake), intent(out) :: fv(1) ! friction velocity (m/s) (for dust model) + real(kind_lake), intent(out) :: ustar(lbp:ubp) !< friction velocity [m/s] + real(kind_lake), intent(out) :: temp1(lbp:ubp) !< relation for potential temperature profile + real(kind_lake), intent(out) :: temp12m(lbp:ubp) !< relation for potential temperature profile applied at 2-m + real(kind_lake), intent(out) :: temp2(lbp:ubp) !< relation for specific humidity profile + real(kind_lake), intent(out) :: temp22m(lbp:ubp) !< relation for specific humidity profile applied at 2-m + real(kind_lake), intent(out) :: u10(1) !< 10-m wind (m/s) (for dust model) + real(kind_lake), intent(out) :: fv(1) !< friction velocity (m/s) (for dust model) !inout: - real(kind_lake), intent(inout) :: fm(lbp:ubp) ! needed for DGVM only to diagnose 10m wind + real(kind_lake), intent(inout) :: fm(lbp:ubp) !< needed for DGVM only to diagnose 10m wind ! OTHER LOCAL VARIABLES: @@ -4990,8 +4980,8 @@ end subroutine FrictionVelocity ! !INTERFACE: real(kind_lake) function StabilityFunc1(zeta) ! - ! !DESCRIPTION: - ! Stability function for rib < 0. + ! DESCRIPTION: + !> Stability function for rib < 0. ! ! !USES: ! use shr_const_mod, only: SHR_CONST_PI @@ -4999,7 +4989,7 @@ real(kind_lake) function StabilityFunc1(zeta) ! ! !ARGUMENTS: implicit none - real(kind_lake), intent(in) :: zeta ! dimensionless height used in Monin-Obukhov theory + real(kind_lake), intent(in) :: zeta !< dimensionless height used in Monin-Obukhov theory ! ! !CALLED FROM: ! subroutine FrictionVelocity in this module @@ -5033,7 +5023,7 @@ end function StabilityFunc1 real(kind_lake) function StabilityFunc2(zeta) ! ! !DESCRIPTION: - ! Stability function for rib < 0. + !> Stability function for rib < 0. ! ! !USES: !Removed by Zack Subin, 7/9/08 @@ -5041,7 +5031,7 @@ real(kind_lake) function StabilityFunc2(zeta) ! ! !ARGUMENTS: implicit none - real(kind_lake), intent(in) :: zeta ! dimensionless height used in Monin-Obukhov theory + real(kind_lake), intent(in) :: zeta !< dimensionless height used in Monin-Obukhov theory ! ! !CALLED FROM: ! subroutine FrictionVelocity in this module @@ -5071,23 +5061,23 @@ end function StabilityFunc2 subroutine MoninObukIni (ur, thv, dthv, zldis, z0m, um, obu) ! ! !DESCRIPTION: - ! Initialization of the Monin-Obukhov length. - ! The scheme is based on the work of Zeng et al. (1998): - ! Intercomparison of bulk aerodynamic algorithms for the computation - ! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, - ! Vol. 11, 2628-2644. + !> Initialization of the Monin-Obukhov length. + !! The scheme is based on the work of Zeng et al. (1998): + !! Intercomparison of bulk aerodynamic algorithms for the computation + !! of sea surface fluxes using TOGA CORE and TAO data. J. Climate, + !! Vol. 11, 2628-2644. ! ! !USES: ! ! !ARGUMENTS: implicit none - real(kind_lake), intent(in) :: ur ! wind speed at reference height [m/s] - real(kind_lake), intent(in) :: thv ! virtual potential temperature (kelvin) - real(kind_lake), intent(in) :: dthv ! diff of vir. poten. temp. between ref. height and surface - real(kind_lake), intent(in) :: zldis ! reference height "minus" zero displacement heght [m] - real(kind_lake), intent(in) :: z0m ! roughness length, momentum [m] - real(kind_lake), intent(out) :: um ! wind speed including the stability effect [m/s] - real(kind_lake), intent(out) :: obu ! monin-obukhov length (m) + real(kind_lake), intent(in) :: ur !< wind speed at reference height [m/s] + real(kind_lake), intent(in) :: thv !< virtual potential temperature (kelvin) + real(kind_lake), intent(in) :: dthv !< diff of vir. poten. temp. between ref. height and surface + real(kind_lake), intent(in) :: zldis !< reference height "minus" zero displacement heght [m] + real(kind_lake), intent(in) :: z0m !< roughness length, momentum [m] + real(kind_lake), intent(out) :: um !< wind speed including the stability effect [m/s] + real(kind_lake), intent(out) :: obu !< monin-obukhov length (m) ! ! !CALLED FROM: ! subroutine BareGroundFluxes in module BareGroundFluxesMod.F90 @@ -5256,12 +5246,12 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, sand3d, clay3d, tg3, clm_lakedepth, & km, me, master, errmsg, errflg) - ! Some fields in lakeini are not available during initialization, - ! so clm_lake_init cannot complete the initialization. What is not - ! in clm_lake_init, is initialized in lakeini on points where - ! use_lake_model(i)>0. The clm_lake_initialized(i) guards against - ! initializing a point twice. For that to work, - ! clm_lake_initialized must be a restart variable. + !> Some fields in lakeini are not available during initialization, + !! so clm_lake_init cannot complete the initialization. What is not + !! in clm_lake_init, is initialized in lakeini on points where + !! use_lake_model(i)>0. The clm_lake_initialized(i) guards against + !! initializing a point twice. For that to work, + !! clm_lake_initialized must be a restart variable. !============================================================================== ! This subroutine was first edited by Hongping Gu for coupling diff --git a/physics/docs/ccppsrw3_doxyfile b/physics/docs/ccppsrw3_doxyfile new file mode 100644 index 000000000..b1cc3138c --- /dev/null +++ b/physics/docs/ccppsrw3_doxyfile @@ -0,0 +1,557 @@ +# Doxyfile 1.9.3 + +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "CCPP SciDoc for UFS-SRW v3.0.0" +PROJECT_NUMBER = "SRW v3.0.0" +PROJECT_BRIEF = "Common Community Physics Package Developed at DTC" +PROJECT_LOGO = img/dtc_logo.png +OUTPUT_DIRECTORY = doc +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = NO +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +JAVADOC_BANNER = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +PYTHON_DOCSTRING = YES +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = YES +TAB_SIZE = 4 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = YES +OPTIMIZE_OUTPUT_VHDL = NO +OPTIMIZE_OUTPUT_SLICE = NO +EXTENSION_MAPPING = .f=FortranFree \ + .F=FortranFree \ + .F90=FortranFree \ + .f90=FortranFree +MARKDOWN_SUPPORT = YES +TOC_INCLUDE_HEADINGS = 5 +AUTOLINK_SUPPORT = YES +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = YES +GROUP_NESTED_COMPOUNDS = NO +SUBGROUPING = YES +INLINE_GROUPED_CLASSES = NO +INLINE_SIMPLE_STRUCTS = NO +TYPEDEF_HIDES_STRUCT = YES +LOOKUP_CACHE_SIZE = 0 +NUM_PROC_THREADS = 1 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PACKAGE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +EXTRACT_ANON_NSPACES = YES +RESOLVE_UNNAMED_PARAMS = YES +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = YES +CASE_SENSE_NAMES = NO +HIDE_SCOPE_NAMES = NO +HIDE_COMPOUND_REFERENCE= NO +SHOW_HEADERFILE = YES +SHOW_INCLUDE_FILES = NO +SHOW_GROUPED_MEMB_INC = NO +FORCE_LOCAL_INCLUDES = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_MEMBERS_CTORS_1ST = NO +SORT_GROUP_NAMES = NO +SORT_BY_SCOPE_NAME = NO +STRICT_PROTO_MATCHING = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = YES +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = NO +SHOW_FILES = NO +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +LAYOUT_FILE = ccpp_dox_layout.xml +CITE_BIB_FILES = library.bib + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = NO +WARN_IF_DOC_ERROR = YES +WARN_IF_INCOMPLETE_DOC = YES +WARN_NO_PARAMDOC = NO +WARN_AS_ERROR = NO +WARN_FORMAT = +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +INPUT = pdftxt/SRW_mainpage.txt \ + pdftxt/SRW_all_shemes_list.txt \ + pdftxt/GFS_v16_suite.txt \ + pdftxt/HRRR_suite.txt \ + pdftxt/RAP_suite.txt \ + pdftxt/RRFS_v1beta_suite.txt \ + pdftxt/WoFS_v0_suite.txt \ + pdftxt/RRFS_SGSCLOUD.txt \ + pdftxt/GFS_RRTMG.txt \ + pdftxt/GFS_SFCLYR.txt \ + pdftxt/MYNN_SFCLAYER.txt \ + pdftxt/GFS_NSST.txt \ + pdftxt/GFS_OCEAN.txt \ + pdftxt/GFS_NOAH.txt \ + pdftxt/GFS_SFCSICE.txt \ + pdftxt/GFS_SATMEDMFVDIFQ.txt \ + pdftxt/GFS_NOAHMP.txt \ + pdftxt/GFS_UGWPv0.txt \ + pdftxt/GFS_drag_suite.txt \ + pdftxt/GFS_GWDPS.txt \ + pdftxt/GFS_OZPHYS.txt \ + pdftxt/GFS_H2OPHYS.txt \ + pdftxt/GFS_SAMFdeep.txt \ + pdftxt/GFS_SAMFshal.txt \ + pdftxt/GFDL_cloud.txt \ + pdftxt/NSSLMICRO.txt \ + pdftxt/MYNN_EDMF.txt \ + pdftxt/CU_GF_deep.txt \ + pdftxt/RUCLSM.txt \ + pdftxt/THOMPSON.txt \ + pdftxt/suite_input.nml.txt \ + pdftxt/CLM_LAKE.txt \ + pdftxt/GFS_SPP.txt \ + ../fv_sat_adj.F90 \ + ../GFS_time_vary_pre.fv3.F90 \ + ../GFS_rad_time_vary.fv3.F90 \ + ../GFS_phys_time_vary.fv3.F90 \ + ../get_prs_fv3.F90 \ + ../get_phi_fv3.F90 \ + ../ozne_def.f \ + ../ozinterp.f90 \ + ../h2o_def.f \ + ../h2ointerp.f90 \ + ../aerclm_def.F \ + ../aerinterp.F90 \ + ../iccn_def.F \ + ../iccninterp.F90 \ + ../sfcsub.F \ + ../gcycle.F90 \ + ../GFS_suite_interstitial_1.F90 \ + ../GFS_suite_interstitial_2.F90 \ + ../GFS_suite_interstitial_3.F90 \ + ../GFS_suite_interstitial_4.F90 \ + ../GFS_suite_interstitial_5.F90 \ + ../GFS_suite_interstitial_phys_reset.F90 \ + ../GFS_suite_interstitial_rad_reset.F90 \ + ../GFS_suite_stateout_reset.F90 \ + ../GFS_suite_stateout_update.F90 \ + ../GFS_surface_composites_inter.F90 \ + ../GFS_surface_composites_pre.F90 \ + ../GFS_surface_composites_post.F90 \ + ../GFS_surface_loop_control_part1.F90 \ + ../GFS_surface_loop_control_part2.F90 \ + ../GFS_radiation_surface.F90 \ + ../GFS_rrtmg_pre.F90 \ + ../GFS_rrtmg_post.F90 \ + ../GFS_rrtmg_setup.F90 \ + ../rad_sw_pre.F90 \ + ../sgscloud_radpre.F90 \ + ../sgscloud_radpost.F90 \ + ../radsw_main.F90 \ + ../rrtmg_sw_post.F90 \ + ../rrtmg_lw_pre.F90 \ + ../radlw_main.F90 \ + ../rrtmg_lw_post.F90 \ + ../radiation_aerosols.f \ + ../radiation_astronomy.f \ + ../radiation_clouds.f \ + ../radiation_cloud_overlap.F90 \ + ../radiation_gases.f \ + ../radiation_surface.f \ + ../radlw_param.f \ + ../radlw_datatb.f \ + ../radsw_param.f \ + ../radsw_datatb.f \ + ../GFS_cloud_diagnostics.F90 \ + ../dcyc2t3.f \ + ../sfc_diff.f \ + ../sfc_diag.f \ + ../sfc_diag_post.F90 \ + ../sfc_nst.f \ + ../sfc_nst_pre.f \ + ../sfc_nst_post.f \ + ../sfc_ocean.F \ + ../clm_lake.f90 \ + ../module_nst_model.f90 \ + ../module_nst_parameters.f90 \ + ../module_nst_water_prop.f90 \ + ../lsm_noah.f \ + ../sflx.f \ + ../namelist_soilveg.f \ + ../set_soilveg.f \ + ../noahmpdrv.F90 \ + ../module_sf_noahmplsm.f90 \ + ../module_sf_noahmp_glacier.f90 \ + ../noahmp_tables.f90 \ + ../GFS_surface_generic_pre.F90 \ + ../GFS_surface_generic_post.F90 \ + ../surface_perturbation.F90 \ + ../GFS_DCNV_generic_pre.F90 \ + ../GFS_DCNV_generic_post.F90 \ + ../GFS_SCNV_generic_pre.F90 \ + ../GFS_SCNV_generic_post.F90 \ + ../sfc_sice.f \ + ../satmedmfvdifq.F \ + ../mfpbltq.f \ + ../mfscuq.f \ + ../tridi.f \ + ../GFS_GWD_generic_pre.F90 \ + ../GFS_GWD_generic_post.F90 \ + ../unified_ugwp.F90 \ + ../drag_suite.F90 \ + ../cires_tauamf_data.F90 \ + ../cires_orowam2017.f \ + ../cires_ugwp.F90 \ + ../cires_ugwp_initialize.F90 \ + ../cires_ugwp_module.F90 \ + ../cires_ugwp_post.F90 \ + ../cires_ugwp_triggers.F90 \ + ../cires_ugwp_module.F90 \ + ../gwdps.f \ + ../ugwp_driver_v0.F \ + ../ozphys_2015.f \ + ../h2ophys.f \ + ../samfdeepcnv.f \ + ../samfshalcnv.f \ + ../progsigma_calc.f90 \ + ../cnvc90.f \ + ../module_bfmicrophysics.f \ + ../gfdl_cloud_microphys.F90 \ + ../module_gfdl_cloud_microphys.F90 \ + ../GFS_MP_generic_pre.F90 \ + ../GFS_MP_generic_post.F90 \ + ../GFS_PBL_generic_common.F90 \ + ../GFS_PBL_generic_pre.F90 \ + ../GFS_PBL_generic_post.F90 \ + ../calpreciptype.f90 \ + ../GFS_stochastics.F90 \ + ../cu_gf_driver.F90 \ + ../cu_gf_driver_pre.F90 \ + ../cu_gf_deep.F90 \ + ../cu_gf_sh.F90 \ + ../cu_gf_driver_post.F90 \ + ../mynnedmf_wrapper.F90 \ + ../module_bl_mynn.F90 \ + ../bl_mynn_common.f90 \ + ../mynnsfc_wrapper.F90 \ + ../module_sf_mynn.F90 \ + ../lsm_ruc.F90 \ + ../module_sf_ruclsm.F90 \ + ../namelist_soilveg_ruc.F90 \ + ../set_soilveg_ruc.F90 \ + ../module_soil_pre.F90 \ + ../mp_thompson_pre.F90 \ + ../module_mp_thompson_make_number_concentrations.F90 \ + ../mp_thompson.F90 \ + ../module_mp_thompson.F90 \ + ../module_mp_radar.F90 \ + ../mp_thompson_post.F90 \ + ../mp_nssl.F90 \ + ../module_mp_nssl_2mom.F90 \ + ../funcphys.f90 \ + ../physcons.F90 \ + ../radcons.f90 \ + ../mersenne_twister.f \ + ../maximum_hourly_diagnostics.F90 \ + ../phys_tend.F90 + +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.f \ + *.F \ + *.F90 \ + *.f90 \ + *.nml \ + *.txt +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = pdftxt/RE300 \ + doc/html +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = img +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +FILTER_SOURCE_PATTERNS = +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +SOURCE_TOOLTIPS = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +CLANG_ASSISTED_PARSING = NO +CLANG_ADD_INC_PATHS = YES +CLANG_OPTIONS = +CLANG_DATABASE_PATH = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +ALPHABETICAL_INDEX = NO +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = _doxygen/header.html +HTML_FOOTER = _doxygen/footer.html +HTML_STYLESHEET = +HTML_EXTRA_STYLESHEET = _doxygen/doxygen-awesome.css \ + _doxygen/doxygen-awesome-sidebar-only.css \ + _doxygen/doxygen-awesome-sidebar-only-darkmode-toggle.css \ + _doxygen/doxygen-awesome-ccpp.css +HTML_EXTRA_FILES = _doxygen/doxygen-awesome-darkmode-toggle.js \ + _doxygen/doxygen-awesome-ccpp.js +HTML_COLORSTYLE_HUE = 209 +HTML_COLORSTYLE_SAT = 255 +HTML_COLORSTYLE_GAMMA = 113 +HTML_TIMESTAMP = NO +HTML_DYNAMIC_MENUS = YES +HTML_DYNAMIC_SECTIONS = NO +HTML_INDEX_NUM_ENTRIES = 100 +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_FEEDURL = +DOCSET_BUNDLE_ID = org.doxygen.Project +DOCSET_PUBLISHER_ID = org.doxygen.Publisher +DOCSET_PUBLISHER_NAME = Publisher +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +GENERATE_QHP = NO +QCH_FILE = +QHP_NAMESPACE = org.doxygen.Project +QHP_VIRTUAL_FOLDER = doc +QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = +QHG_LOCATION = +GENERATE_ECLIPSEHELP = NO +ECLIPSE_DOC_ID = org.doxygen.Project +DISABLE_INDEX = YES +GENERATE_TREEVIEW = YES +FULL_SIDEBAR = NO +ENUM_VALUES_PER_LINE = 4 +TREEVIEW_WIDTH = 335 +EXT_LINKS_IN_WINDOW = NO +OBFUSCATE_EMAILS = YES +HTML_FORMULA_FORMAT = SVG +FORMULA_FONTSIZE = 10 +FORMULA_TRANSPARENT = YES +FORMULA_MACROFILE = +USE_MATHJAX = YES +MATHJAX_VERSION = MathJax_2 +MATHJAX_FORMAT = HTML-CSS +#MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2 +MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 +MATHJAX_EXTENSIONS = +MATHJAX_CODEFILE = +SEARCHENGINE = YES +SERVER_BASED_SEARCH = NO +EXTERNAL_SEARCH = NO +SEARCHENGINE_URL = +SEARCHDATA_FILE = searchdata.xml +EXTERNAL_SEARCH_ID = +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +LATEX_MAKEINDEX_CMD = makeindex +COMPACT_LATEX = YES +PAPER_TYPE = a4 +EXTRA_PACKAGES = amsmath +LATEX_HEADER = +LATEX_FOOTER = +LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_FILES = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = YES +LATEX_BIB_STYLE = plainnat +LATEX_TIMESTAMP = NO +LATEX_EMOJI_DIRECTORY = + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_SUBDIR = +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +GENERATE_XML = NO +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +XML_NS_MEMB_FILE_SCOPE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +GENERATE_DOCBOOK = NO +DOCBOOK_OUTPUT = docbook + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +ENABLE_PREPROCESSING = NO +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = CCPP \ + MULTI_GASES \ + 0 +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- + +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +EXTERNAL_PAGES = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +DIA_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +DOT_NUM_THREADS = 0 +DOT_FONTNAME = Source Sans Pro +DOT_FONTSIZE = +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = YES +UML_LIMIT_NUM_FIELDS = 10 +DOT_UML_DETAILS = NO +DOT_WRAP_THRESHOLD = 17 +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = YES +CALLER_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DIR_GRAPH_MAX_DEPTH = 1 +DOT_IMAGE_FORMAT = SVG +INTERACTIVE_SVG = NO +DOT_PATH = /Users/man.zhang/homebrew/bin/dot +DOTFILE_DIRS = +MSCFILE_DIRS = +DIAFILE_DIRS = +PLANTUML_JAR_PATH = +PLANTUML_CFG_FILE = +PLANTUML_INCLUDE_PATH = +DOT_GRAPH_MAX_NODES = 1000 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = YES +DOT_MULTI_TARGETS = YES +GENERATE_LEGEND = YES +DOT_CLEANUP = YES diff --git a/physics/docs/library.bib b/physics/docs/library.bib index b6109b12c..7c01fbc65 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,13 +1,159 @@ %% This BibTeX bibliography file was created using BibDesk. %% https://bibdesk.sourceforge.io/ -%% Created for Man Zhang at 2022-10-13 16:15:17 -0600 +%% Created for Man Zhang at 2023-06-07 10:17:09 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{Lin_2022, + author = {Jialin Lin and Taotao Qian and Peter Bechtold and Georg Grell and Guang J. Zhang and Ping Zhu and Saulo R. Freitas and Hannah Barnes and Jongil Han}, + date-added = {2023-06-07 10:16:46 -0600}, + date-modified = {2023-06-07 10:16:46 -0600}, + doi = {10.1080/07055900.2022.2082915}, + journal = {Atmosphere-Ocean}, + month = {jul}, + number = {3-4}, + pages = {422--476}, + publisher = {Informa {UK} Limited}, + title = {Atmospheric Convection}, + url = {https://doi.org/10.1080%2F07055900.2022.2082915}, + volume = {60}, + year = 2022, + bdsk-url-1 = {https://doi.org/10.1080%2F07055900.2022.2082915}, + bdsk-url-2 = {https://doi.org/10.1080/07055900.2022.2082915}} + +@techreport{He_2023, + author = {He, Cenlin and Valayamkunnath, Prasanth and Barlage, Michael and Chen, Fei and Gochis, David and Cabell, Ryan and Schneider, Tim and Rasmussen, Roy and Niu, Guo-Yue and Yang, Zong-Liang and Niyogi, Dev and Ek, Michael}, + date-added = {2023-06-06 12:37:33 -0600}, + date-modified = {2023-06-06 12:39:16 -0600}, + doi = {10.5065/EW8G-YR95}, + publisher = {NCAR/UCAR}, + title = {The Community Noah-MP Land Surface Modeling System Technical Description Version 5.0}, + url = {https://opensky.ucar.edu/islandora/object/technotes:599}, + year = {2023}, + bdsk-url-1 = {https://opensky.ucar.edu/islandora/object/technotes:599}, + bdsk-url-2 = {https://doi.org/10.5065/EW8G-YR95}} + +@article{Niu_2007, + author = {Guo-Yue Niu and Zong-Liang Yang}, + date-added = {2023-06-05 14:03:26 -0600}, + date-modified = {2023-06-05 14:03:26 -0600}, + doi = {10.1029/2007jd008674}, + journal = {Journal of Geophysical Research}, + month = {nov}, + number = {D21}, + publisher = {American Geophysical Union ({AGU})}, + title = {An observation-based formulation of snow cover fraction and its evaluation over large North American river basins}, + url = {https://doi.org/10.1029%2F2007jd008674}, + volume = {112}, + year = 2007, + bdsk-url-1 = {https://doi.org/10.1029%2F2007jd008674}, + bdsk-url-2 = {https://doi.org/10.1029/2007jd008674}} + +@techreport{Oleson2013, + author = {Oleson, Keith and Lawrence, David and Bonan, Gordon and Drewniak, Beth and Huang, Maoyi and Koven, Charles and Levis, Samuel and Li, Fang and Riley, William and Subin, Zachary and Swenson, Sean and Thornton, Peter and Bozbiyik, Anil and Fisher, Rosie and Heald, Colette and Kluzek, Erik and Lamarque, Jean-Francois and Lawrence, Peter and Leung, L and Lipscomb, William and Muszala, Stefan and Ricciuto, Daniel and Sacks, William and Sun, Ying and Tang, Jinyun and Yang, Zong-Liang}, + date-added = {2023-06-05 09:28:16 -0600}, + date-modified = {2023-06-05 09:30:30 -0600}, + doi = {10.5065/D6RR1W7M}, + keywords = {Land surface model, Climate model, Biogeochemistry, Biogeophysics}, + language = {en}, + publisher = {UCAR/NCAR}, + title = {Technical description of version 4.5 of the Community Land Model (CLM)}, + url = {http://opensky.ucar.edu/islandora/object/technotes:515}, + year = {2013}, + bdsk-url-1 = {http://opensky.ucar.edu/islandora/object/technotes:515}, + bdsk-url-2 = {https://doi.org/10.5065/D6RR1W7M}} + +@article{Kourzeneva_2012, + author = {Ekaterina Kourzeneva and Hermann Asensio and Eric Martin and Stephanie Faroux}, + date-added = {2023-05-30 11:29:07 -0600}, + date-modified = {2023-05-30 11:29:07 -0600}, + doi = {10.3402/tellusa.v64i0.15640}, + journal = {Tellus A: Dynamic Meteorology and Oceanography}, + month = {dec}, + number = {1}, + pages = {15640}, + publisher = {Stockholm University Press}, + title = {Global gridded dataset of lake coverage and lake depth for use in numerical weather prediction and climate modelling}, + url = {https://doi.org/10.3402%2Ftellusa.v64i0.15640}, + volume = {64}, + year = 2012, + bdsk-url-1 = {https://doi.org/10.3402%2Ftellusa.v64i0.15640}, + bdsk-url-2 = {https://doi.org/10.3402/tellusa.v64i0.15640}} + +@article{Gu2015, + abstract = {A one-dimensional (1-D) physically based lake model was coupled to the Weather Research and Forecasting (WRF) model version 3.2 developed by the National Center for Atmospheric Research to dynamically simulate physical processes of lakes and their effects on weather and climate at local and regional scales. Our study area is focused on the Great Lakes. This coupled model realistically reproduces the lake surface temperature (LST) at a buoy station in a shallow lake (Lake Erie) while generating strong LST biases ranging from −20 to 20 {\textdegree}C at a buoy station in a deep lake (Lake Superior). Through many sensitivity tests, we find that the biases in the deep lake LST simulations result from the drastic underestimation of heat transfer between the lower and upper parts of the lake through unrealistic eddy diffusion. Additional tests were made to calibrate the eddy diffusivity in WRF-Lake. It is found that when this parameter is multiplied by a factor ranging from 102 to 105 for various lake depths deeper than 15 m, the LST simulations for the deep lake buoy station show good agreement with observations, and the bias range reduces to {\textpm}4 {\textdegree}C. Essentially, the enlarged eddy diffusivity strengthens heat transfer within the lake columns in the deep lake, which is significantly underestimated in the lake model without calibration. Validation simulations with the calibrated eddy diffusivity were carried out for the whole of Lake Superior and Lake Erie. The LST simulations still have a substantial bias reduction when compared with those produced with the original eddy diffusivity, indicating that the calibrated parameter is representative. In addition, the improved 1-D lake model with WRF reasonably reproduces the remotely sensed LST geographic distribution.}, + author = {Gu, Hongping and Jin, Jiming and Wu, Yihua and Ek, Michael B. and Subin, Zachary M.}, + date-added = {2023-05-24 14:45:55 -0600}, + date-modified = {2023-05-24 14:45:55 -0600}, + day = {01}, + doi = {10.1007/s10584-013-0978-y}, + issn = {1573-1480}, + journal = {Climatic Change}, + month = {Apr}, + number = {3}, + pages = {471--483}, + title = {Calibration and validation of lake surface temperature simulations with the coupled WRF-lake model}, + url = {https://link.springer.com/content/pdf/10.1007/s10584-013-0978-y.pdf}, + volume = {129}, + year = {2015}, + bdsk-url-1 = {https://link.springer.com/content/pdf/10.1007/s10584-013-0978-y.pdf}, + bdsk-url-2 = {https://doi.org/10.1007/s10584-013-0978-y}} + +@article{Subin_2012, + author = {Zachary M. Subin and William J. Riley and Dmitrii Mironov}, + date-added = {2023-05-24 14:35:27 -0600}, + date-modified = {2023-05-24 14:35:27 -0600}, + doi = {10.1029/2011ms000072}, + journal = {Journal of Advances in Modeling Earth Systems}, + month = {feb}, + publisher = {American Geophysical Union ({AGU})}, + title = {An improved lake model for climate simulations: Model structure, evaluation, and sensitivity analyses in {CESM}1}, + url = {https://doi.org/10.1029%2F2011ms000072}, + volume = {4}, + year = 2012, + bdsk-url-1 = {https://doi.org/10.1029%2F2011ms000072}, + bdsk-url-2 = {https://doi.org/10.1029/2011ms000072}} + +@article{Lawrence_2019, + author = {David M. Lawrence and Rosie A. Fisher and Charles D. Koven and Keith W. Oleson and Sean C. Swenson and Gordon Bonan and Nathan Collier and Bardan Ghimire and Leo van Kampenhout and Daniel Kennedy and Erik Kluzek and Peter J. Lawrence and Fang Li and Hongyi Li and Danica Lombardozzi and William J. Riley and William J. Sacks and Mingjie Shi and Mariana Vertenstein and William R. Wieder and Chonggang Xu and Ashehad A. Ali and Andrew M. Badger and Gautam Bisht and Michiel van den Broeke and Michael A. Brunke and Sean P. Burns and Jonathan Buzan and Martyn Clark and Anthony Craig and Kyla Dahlin and Beth Drewniak and Joshua B. Fisher and Mark Flanner and Andrew M. Fox and Pierre Gentine and Forrest Hoffman and Gretchen Keppel-Aleks and Ryan Knox and Sanjiv Kumar and Jan Lenaerts and L. Ruby Leung and William H. Lipscomb and Yaqiong Lu and Ashutosh Pandey and Jon D. Pelletier and Justin Perket and James T. Randerson and Daniel M. Ricciuto and Benjamin M. Sanderson and Andrew Slater and Zachary M. Subin and Jinyun Tang and R. Quinn Thomas and Maria Val Martin and Xubin Zeng}, + date-added = {2023-05-24 14:34:12 -0600}, + date-modified = {2023-05-24 14:34:12 -0600}, + doi = {10.1029/2018ms001583}, + journal = {Journal of Advances in Modeling Earth Systems}, + month = {dec}, + number = {12}, + pages = {4245--4287}, + publisher = {American Geophysical Union ({AGU})}, + title = {The Community Land Model Version 5: Description of New Features, Benchmarking, and Impact of Forcing Uncertainty}, + url = {https://doi.org/10.1029%2F2018ms001583}, + volume = {11}, + year = 2019, + bdsk-url-1 = {https://doi.org/10.1029%2F2018ms001583}, + bdsk-url-2 = {https://doi.org/10.1029/2018ms001583}} + +@article{cite-key, + date-added = {2023-05-24 11:18:09 -0600}, + date-modified = {2023-05-24 11:18:09 -0600}} + +@article{gmd-15-6659-2022, + author = {Benjamin, S. G. and Smirnova, T. G. and James, E. P. and Anderson, E. J. and Fujisaki-Manome, A. and Kelley, J. G. W. and Mann, G. E. and Gronewold, A. D. and Chu, P. and Kelley, S. G. T.}, + date-added = {2023-05-24 10:51:47 -0600}, + date-modified = {2023-05-24 10:51:47 -0600}, + doi = {10.5194/gmd-15-6659-2022}, + journal = {Geoscientific Model Development}, + number = {17}, + pages = {6659--6676}, + title = {Inland lake temperature initialization via coupled cycling with atmospheric data assimilation}, + url = {https://gmd.copernicus.org/articles/15/6659/2022/}, + volume = {15}, + year = {2022}, + bdsk-url-1 = {https://gmd.copernicus.org/articles/15/6659/2022/}, + bdsk-url-2 = {https://doi.org/10.5194/gmd-15-6659-2022}} + @article{Chaboureau_2005, author = {Jean-Pierre Chaboureau}, date-added = {2022-10-13 16:14:54 -0600}, @@ -3663,6 +3809,18 @@ @article{tsiringakis_et_al_2017 year = {2017}, bdsk-url-1 = {https://doi.org/10.1002/qj.3021}} +@article{sturm_1997, + author = {Sturm, Matthew and Holmgren, Jon and K{\"o}nig, Max and Morris, Kim}, + doi = {10.3189/S0022143000002781}, + journal = {Journal of Glaciology}, + number = {143}, + pages = {26--41}, + publisher = {Cambridge University Press}, + title = {The thermal conductivity of seasonal snow}, + volume = {43}, + year = {1997}, + bdsk-url-1 = {https://doi.org/10.3189/S0022143000002781}} + @comment{BibDesk Static Groups{ diff --git a/physics/docs/pdftxt/CLM_LAKE.txt b/physics/docs/pdftxt/CLM_LAKE.txt new file mode 100644 index 000000000..c091d2b17 --- /dev/null +++ b/physics/docs/pdftxt/CLM_LAKE.txt @@ -0,0 +1,59 @@ +/** +\page CLM_LAKE_model CLM Lake Model +\section des_clmlake Description + +CLM lake model is a multi-level one-dimensional lake model that has been implemented within the operational 3-km HRRR and +13-km RAP for small lakes (Benjamin et al. (2022) \cite gmd-15-6659-2022). It is the Community Land Model, version 4.5. +Subin et al. (2012) \cite Subin_2012 describe the 1-d CLM lake model as applied within the Community Earth System +Model (CESM) as a component of the overall CESM CLM (Lawrence et al. (2019) \cite Lawrence_2019). Gu et al. (2015) \cite Gu2015 +describe the introduction of the CLM lake model into the WRF model and inital experiments using its 1-d solution for both +lakes Superior (average depth of 147 m) and Erie (average depth of 19 m). + +The atmospheric inputs into the model are temperature, water vapor, horizontal wind components from the lowest atmospheric level +and short-wave and longwave radiative fluxes. The CLM lake model then provides latent heat and sensible heat fluxes back to the +atmosphere. It also computes 2-m temperature/moisture, skin temperature, lake temperature, ice fraction, ice thickness, snow water +equivalent and snow depth. The CLM lake model divides the vertical lake profile into 10 layers driven by wind-driven eddies. The +thickness of the top layer is fixed to 10-cm and the rest of the lake depth is divided evenly into the other 9 layers. Energy +transfer (heat and kinetic energy) occurs between lake layers via eddy and molecular diffusion as a function of the vertical +temperature gradient. The CLM lake model also uses a 10-layer soil model beneath the lake, a multi-layer ice formation model and +up to 5-layer snow-on-ice model. Multiple layers in lake model have the potential to better represent vertical mixing processes +in the lake. + +Testing of the CLM lake model within RAP/HRRR applications showed computational efficiency of the model with no change of even +0.1% in run time. The lake/snow variables have to be continuously transfered within the CLM lake model from one forecast to another, +constrained by the atmospheric data assimilation. The lake-cycling initialization in RAP/HRRR has been effective overall, owing to +accurate houly estimates of near-surface temperature, moisture and winds, and shortwave and longwave estimates provided to the 1-d CLM +lake model every time step (Benjamin et al. (2022) \cite gmd-15-6659-2022). Cycling technique showed improvements over initializing +lake temperatures from the SST analysis, problematic for small water bodies. The improvements are particularly eminent during transition +periods between cold and warm seasons, and in the regions with anomalies in weather conditions. The CLM lake model has the potential +to improve surface prediction in the vicinity of small lakes. + +The CLM lake model requires bathymetry for the lake points in the model domain. Grid points are assigned as lake points when the +fraction of lake coverage in the grid cell exceeds 50% and when this point is disconnected from oceans. The lake water mask is +therefore binary, set to either 1 or 0. This binary approach for models with higher horizontal resolution, for example, 3-km resolution in +the regional application of UFS (RRFS), is capable of capturing the effect of lakes on regional heat and moisture fluxes. + +Lake depths for the RRFS lake configuration (Fig.1) are assigned from a global dataset provided by Kourzeneva et al.(2012) \cite Kourzeneva_2012, +this dataset is referred to as GLOBv3 bathymetry in the UFS_UTL. + +\image html Lake_depths_RRFS3km.png "Figure 1: Lake depths for lakes in the 3-km RRFS domain." width=600 + +To cold-start the CLM lake model in RRFS: +- Use the CLM option in the input.nml +\n - lkm = 1 +\n - iopt_lake = 2 +- Lake temperature is initialized from interpolation between SST at the surface and \f$-4^oC\f$ at 50-m depth +\n - A special case is for the Great Salt Lake, the temperature is limited with +/- 3 K from the bi-weekly climatology +- Temperature for soil under the lake is initialized from bottom lake temperature at the top to the substrate soil temperature at the bottom of soil layer +- Lake ice at the top level is initialized from the GFS ice concentration + +The differences of surface variables from the RRFS 6-h forecast with/without CLM lake model are shown in Figure 2 for 2-m temperature and in Figure 3 for 2-m dewpoint. +\image html diff_t2m_lake_rrfs.png "Figure 2: Differences of 2-m temperature between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 +\image html diff_td2m_lake_rrfs.png "Figure 3: Differences of 2-m dew point between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 + + + +\section intra_clmlake Intraphysics Communication +- \ref arg_table_clm_lake_run + +*/ diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index 92b8c3b7c..f30cb28dc 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -3,26 +3,22 @@ \section gfcu_descrip Description The Grell-Freitas (GF) scheme, as described in Grell and Freitas (2014) \cite grell_and_freitas_2014, -Freitas et al. (2018) \cite freitas_et_al_2018, Freitas et al. (2021) \cite freitas_et_al_2021, and Lin et al. (2022) -(under review) follows the mass flux approach published by Grell (1993) \cite grell_1993. +Freitas et al. (2018) \cite freitas_et_al_2018, Freitas et al. (2021) \cite freitas_et_al_2021, and Lin et al. (2022) \cite Lin_2022 +follows the mass flux approach published by Grell (1993) \cite grell_1993. Further developments by Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 included implementing -stochastics through allowing parameter perturbations. In GF1 scale awareness, and the aerosol dependence through rain generation (following +stochastics through allowing parameter perturbations. In GF scale awareness, and the aerosol dependence through rain generation (following Berry (1968) \cite berry_1968 and evaporation formulations (following Jiang et al. (2010) \cite Jiang_2010 ), depending on the -cloud concentration nuclei at cloud base were added. FG included mixed phase physics impact, momentum transport (as in ECMWF), +cloud concentration nuclei at cloud base were added. GF included mixed phase physics impact, momentum transport, a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction -and transition from shallow, congestus and deep convection regimes. In order for this trimodal size spectrum to be -accurately represented, GF's deep and shallow convective schemes must be run together. -The vertical massflux distribution of shallow, congestus and +and transition from shallow, congestus and deep convection regimes. The vertical massflux distribution of shallow, congestus and deep convection regimes is characterized by Probability Density Functions (PDF's). The three PDF's are meant to represent the average statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived -from the PDF's. The deep convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ), the congestus type convection -as well as the shallow convection are not scale-aware. Aerosol dependence is implemented through dependence of rain generation and +from the PDF's. The deep and congestus convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ), the shallow convection is not scale-aware. Aerosol dependence is implemented through dependence of rain generation and evaporation formulations depending on the cloud concentration nuclei at cloud base (Berry 1968 \cite berry_1968, -Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Aerosol dependence is considered experimental and +Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. Aerosol dependence is considered experimental and is turned off at this point. GF is able to transport tracers. -A paper describing the latest changes and modifications is in process and will be submitted to GMD. \section version_cugf_enh CCPP Physics Updates \version CCPP v6.0.0 @@ -42,6 +38,20 @@ transition as grid spacing decreases into a shallow convection scheme - Coupled to the grid scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated precipitating convective cloud and shallow convective clouds +\version UFS-SRW v3.0.0 +- The choices of closures for deep/mid/shallow convection are now namelist options +- Updates for aerosol-awareness + +\b The \b Implementation \b of \b GF \b in \b RRFS + +- Scale-awareness is turned off when explicit microphysics is not active anywhere in the column +- GF completely is turned off at grid points when MYNN produces shallow convection at that point +- Radar reflectivity considers mass flux PDF as well as whether scale-awareness is turned on at the grid point in equation. + +\b The \b implementation \b of \b GF \b in \b HAFS \b is \b undergoing. + + + \section intra_rough_gf Intraphysics Communication The GF scheme passes cloud hydrometeors to the grid-scale microphysics scheme (\ref THOMPSON ) through detrainment from each convective cloud layer containing convective cloud. The detrained condensate interacts with short- and longwave radiation by diff --git a/physics/docs/pdftxt/GFS_NOAHMP.txt b/physics/docs/pdftxt/GFS_NOAHMP.txt index bc2c58457..83e8c0650 100644 --- a/physics/docs/pdftxt/GFS_NOAHMP.txt +++ b/physics/docs/pdftxt/GFS_NOAHMP.txt @@ -4,21 +4,17 @@ This implementation of the NoahMP Land Surface Model (LSM) is adapted from the version implemented in WRF v3.7 with additions by NOAA EMC staff to work with the UFS Atmosphere model. Authoritative documentation of the NoahMP scheme can be accessed at the following links: -[University of Texas at Austin NoahMP Documentation](http://www.jsg.utexas.edu/noah-mp "University of Texas at Austin NoahMP Documentation") +Technical documentation freely available at He et al. (2023) \cite He_2023. -[NCAR Research Application Laboratory NoahMP Documentation](https://ral.ucar.edu/solutions/products/noah-multiparameterization-land-surface-model-noah-mp-lsm "NCAR RAL NoahMP Documentation") +To cite the technical documentation: He, C., P. Valayamkunnath, M. Barlage, F. Chen, D. Gochis, R. Cabell, T. Schneider, R. Rasmussen, G.-Y. Niu, Z.-L. Yang, D. Niyogi, and M. Ek (2023): The Community Noah-MP Land Surface Modeling System Technical Description Version 5.0, (No. NCAR/TN-575+STR). doi:10.5065/ew8g-yr95 A primary reference for the NoahMP LSM is Niu et al. (2011) \cite niu_et_al_2011. -The CCPP interface to the NoahMP LSM is a driving software layer on top of the actual NoahMP LSM. During the run sequence, code organization is as follows: -+ \ref noahmpdrv_run() calls - + \ref transfer_mp_parameters() - + \ref noahmp_options() - + \ref noahmp_options_glacier() and noahmp_glacier() if over the ice vegetation type (glacier) - + \ref noahmp_sflx() if over other vegetation types - + \ref penman() - -Note that noahmp_glacer() and noahmp_sflx() are the actual NoahMP codes. +\section noahmp_update CCPP Physics Updates +\version UFS-SRW v3.0.0 +- As part of a larger-scale effort to unify how microphysics outputs (in particular snow) are used in the land models and outputs, an addition option for using the unified frozen precipitation fraction in NoahMP was added +- Diagnostic 2-meter temperature and humidity are based on vegetation and bare-ground tiles +- Bug fixes for GFS-based thermal roughness length scheme \section intra_noahmp Intraphysics Communication + \ref arg_table_noahmpdrv_run diff --git a/physics/docs/pdftxt/GFS_UGWPv0.txt b/physics/docs/pdftxt/GFS_UGWPv0.txt index f2b3b143a..1b3f0166f 100644 --- a/physics/docs/pdftxt/GFS_UGWPv0.txt +++ b/physics/docs/pdftxt/GFS_UGWPv0.txt @@ -108,6 +108,52 @@ and dynamical instability of waves described by the linear (Lindzen 1981 \cite lindzen_1981) and nonlinear (Weinstock 1984 \cite weinstock_1984; Hines 1997 \cite hines_1997) saturation theories. +\section ugwp_updates CCPP Physics Updates +\version UFS-SRW v3.0.0 + +We have added optional diagnostic outputs for the various tendencies supplied by the UGWP. They can be switched on by setting the two following input namelist variables equal to “.true.”: \p ldiag3d and \p ldiag_ugwp. + +The optional diagnostic outputs are: +- \b dws3dt_ogw: time-averaged wind speed tendency due to mesoscale gravity wave drag +- \b dws3dt_obl: time-averaged wind speed tendency due to blocking drag +- \b dws3dt_oss: time-averaged wind speed tendency due to small-scale gravity wave drag +- \b dws3dt_ofd: time-averaged wind speed tendency due to turbulent orographic form drag +- \b ldu3dt_ogw: time-averaged x wind tendency due to mesoscale orographic gravity wave drag +- \b ldu3dt_obl: time-averaged x wind tendency due to blocking drag +- \b ldu3dt_oss: time-averaged x wind tendency due to small scale gravity wave drag +- \b ldu3dt_ofd: time-averaged x wind tendency due to form drag +- \b ldu3dt_ngw: time-averaged u momentum tendency due to non-stationary gravity wave drag +- \b ldv3dt_ngw: time-averaged v momentum tendency due to non-stationary gravity wave drag +- \b ldt3dt_ngw: time-averaged temperature tendency due to non-stationary gravity wave drag +- \b dudt_ogw: instantaneous x wind tendency from mesoscale orographic gravity wave drag +- \b dvdt_ogw: instantaneous y wind tendency from mesoscale orographic gravity wave drag +- \b dudt_obl: instantaneous x wind tendency from blocking drag +- \b dvdt_obl: instantaneous y wind tendency from blocking drag +- \b dudt_oss: instantaneous x wind tendency from small scale GWD +- \b dvdt_oss: instantaneous y wind tendency from small scale GWD +- \b dudt_ofd: instantaneous x wind tendency from form drag +- \b dvdt_ofd: instantaneous y wind tendency from form drag +- \b du_ogwcol: instantaneous integrated x momentum flux from mesoscale orographic gravity wave drag +- \b dv_ogwcol: instantaneous integrated y momentum flux from mesoscale orographic gravity wave drag +- \b du_oblcol: instantaneous integrated x momentum flux from blocking drag +- \b dv_oblcol: instantaneous integrated y momentum flux from blocking drag +- \b du_osscol: instantaneous integrated x momentum flux from small scale gwd +- \b dv_osscol: instantaneous integrated y momentum flux from small scale gwd +- \b du_ofdcol: instantaneous integrated x momentum flux from form drag +- \b dv_ofdcol: instantaneous integrated y momentum flux from form drag +- \b du3_ogwcol: time-averaged surface x momentum flux from mesoscale orographic gravity wave drag +- \b dv3_ogwcol: time-averaged surface y momentum flux from mesoscale orographic gravity wave drag +- \b du3_oblcol: time-averaged surface x momentum flux from blocking drag +- \b dv3_oblcol: time-averaged surface y momentum flux from blocking drag +- \b du3_osscol: time-averaged surface x momentum flux from small scale gravity wave drag +- \b dv3_osscol: time-averaged surface y momentum flux from small scale gravity wave drag +- \b du3_ofdcol: time-averaged surface x momentum flux from form drag +- \b dv3_ofdcol: time-averaged surface y momentum flux from form drag + +Note that the relevant diag_table entries for these variables are included in: +ufs-weather-model/tests/parm/diag_table/diag_table_rap + + \section intra_UGWPv0 Intraphysics Communication - \ref arg_table_cires_ugwp_run diff --git a/physics/docs/pdftxt/GFS_v16_suite.txt b/physics/docs/pdftxt/GFS_v16_suite.txt index 11e997bf1..8966d6be8 100644 --- a/physics/docs/pdftxt/GFS_v16_suite.txt +++ b/physics/docs/pdftxt/GFS_v16_suite.txt @@ -25,9 +25,9 @@ National Centers for Environmental Prediction (NCEP) in 2021. The GFS_v16 suite \section gfs16_nml_opt_des Namelist \ref GFDL_cloud namelist options -\snippet RE210/FV3_GFS_v16_input.nml GFDL_CLOUD_MP_NML +\snippet RE300/FV3_GFS_v16_input.nml GFDL_CLOUD_MP_NML Other namelist options -\snippet RE210/FV3_GFS_v16_input.nml GFS_PHYSICS_NML +\snippet RE300/FV3_GFS_v16_input.nml GFS_PHYSICS_NML - nstf_name = \f$[2,0,0,0,0]^1 [2,1,0,0,0]^2\f$ - \f$^1\f$ NSST is on and coupled with spin up off diff --git a/physics/docs/pdftxt/HRRR_suite.txt b/physics/docs/pdftxt/HRRR_suite.txt index c08f50211..d8b529ada 100644 --- a/physics/docs/pdftxt/HRRR_suite.txt +++ b/physics/docs/pdftxt/HRRR_suite.txt @@ -28,6 +28,6 @@ The HRRR suite uses the parameterizations in the following order: \include suite_FV3_HRRR.xml \section hrrr_nml_option Namelist -\snippet RE210/FV3_HRRR_input.nml GFS_PHYSICS_NML +\snippet FV3_HRRR_input.nml GFS_PHYSICS_NML */ diff --git a/physics/docs/pdftxt/NoahMP.txt b/physics/docs/pdftxt/NoahMP.txt deleted file mode 100644 index f42aaaa00..000000000 --- a/physics/docs/pdftxt/NoahMP.txt +++ /dev/null @@ -1,41 +0,0 @@ -/** -\page NoahMP GFS NoahMP Land Surface Model -\section des_noahmp Description - -This implementation of the NoahMP Land Surface Model (LSM) is adapted from the version implemented in WRF v3.7 with additions by NOAA EMC staff to work with the UFS Atmosphere model. Authoritative documentation of the NoahMP scheme can be accessed at the following links: - -[University of Texas at Austin NoahMP Documentation](http://www.jsg.utexas.edu/noah-mp "University of Texas at Austin NoahMP Documentation") - -[NCAR Research Application Laboratory NoahMP Documentation](https://ral.ucar.edu/solutions/products/noah-multiparameterization-land-surface-model-noah-mp-lsm "NCAR RAL NoahMP Documentation") - -A primary reference for the NoahMP LSM is Niu et al. (2011) \cite niu_et_al_2011. - -The CCPP interface to the NoahMP LSM is a driving software layer on top of the actual NoahMP LSM. During the run sequence, code organization is as follows: -+ \ref noahmpdrv_run() calls - + \ref transfer_mp_parameters() - + \ref noahmp_options() - + \ref noahmp_options_glacier() and noahmp_glacier() if over the ice vegetation type (glacier) - + \ref noahmp_sflx() if over other vegetation types - + \ref penman() - -Note that noahmp_glacer() and noahmp_sflx() are the actual NoahMP codes. - -\section Default NoahMP LSM Options used in UFS atmosphere -+ Dynamic Vegetation (opt_dveg): 2 [On] -+ Canopy Stomatal Resistance (opt_crs): 1 [Ball-Berry] -+ Soil Moisture Factor for Stomatal Resistance (opt_btr): 1 [Noah soil moisture] -+ Runoff and Groundwater (opt_run): 1 [topmodel with groundwater (Niu et al. 2007 \cite niu_et_al_2007)] -+ Surface Layer Drag Coeff (opt_sfc): 1 [Monin-Obukhov] -+ Supercooled Liquid Water or Ice Fraction (opt_frz): 1 [no iteration (Niu and Yang, 2006 \cite niu_and_yang_2006)] -+ Frozen Soil Permeability (opt_inf): 1 [linear effects, more permeable (Niu and Yang, 2006, \cite niu_and_yang_2006)] -+ Radiation Transfer (opt_rad): 1 [modified two-stream (gap = f(solar angle, 3d structure ...)<1-fveg)] -+ Ground Snow Surface Albedo (opt_alb): 2 [class] -+ Partitioning Precipitation into Rainfall & Snowfall (opt_snf): 4 [use microphysics output] -+ Lower Boundary Condition of Soil Temperature (opt_tbot): 2 [tbot at zbot (8m) read from a file (original Noah)] -+ Snow/Soil Temperature Time Scheme (only layer 1) (opt_stc): 1 [semi-implicit; flux top boundary condition] - -\section intra_noahmp Intraphysics Communication - + GFS NoahMP LSM Driver (\ref arg_table_noahmpdrv_run) -\section gen_al_noahmp General Algorithm of Driver -+ \ref general_noahmpdrv -*/ diff --git a/physics/docs/pdftxt/RAP_suite.txt b/physics/docs/pdftxt/RAP_suite.txt index 3b16315e7..425bf40ff 100644 --- a/physics/docs/pdftxt/RAP_suite.txt +++ b/physics/docs/pdftxt/RAP_suite.txt @@ -26,6 +26,6 @@ The RAP suite uses the parameterizations in the following order: \include suite_SCM_RAP.xml \section RAP_nml_option Namelist -\snippet RE210/SCM_RAP_input.nml GFS_PHYSICS_NML +\snippet SCM_RAP_input.nml GFS_PHYSICS_NML */ diff --git a/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml b/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml new file mode 100644 index 000000000..23ca37f9c --- /dev/null +++ b/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml @@ -0,0 +1,335 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_GFS_v16' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 27 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + agrid_vel_rst = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.0 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.002 + dnats = 1 + do_sat_adj = .true. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 6 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 450 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 6 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .false. + mountain = .false. + n_split = 6 + n_sponge = 10 + n_zs_filter = 0 + na_init = 0 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_dz = .false. + nudge_qv = .true. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .false. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = '' + reset_eta = .false. + rf_cutoff = 750.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 10.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +!> [GFDL_CLOUD_MP_NML] +&gfdl_cloud_microphysics_nml + c_cracw = 0.8 + c_paut = 0.5 + c_pgacs = 0.01 + c_psaci = 0.05 + ccn_l = 300.0 + ccn_o = 100.0 + const_vg = .false. + const_vi = .false. + const_vr = .false. + const_vs = .false. + de_ice = .false. + do_qa = .true. + do_sedi_heat = .false. + dw_land = 0.16 + dw_ocean = 0.1 + fast_sat_adj = .true. + fix_negative = .true. + icloud_f = 1 + mono_prof = .true. + mp_time = 150.0 + prog_ccn = .false. + qi0_crt = 8e-05 + qi_lim = 1.0 + ql_gen = 0.001 + ql_mlt = 0.001 + qs0_crt = 0.001 + rad_graupel = .true. + rad_rain = .true. + rad_snow = .true. + reiflag = 2 + rh_inc = 0.3 + rh_inr = 0.3 + rh_ins = 0.3 + rthresh = 1e-05 + sedi_transport = .true. + tau_g2v = 900.0 + tau_i2s = 1000.0 + tau_l2v = 225.0 + tau_v2l = 150.0 + use_ccn = .true. + use_ppm = .false. + vg_max = 12.0 + vi_max = 1.0 + vr_max = 12.0 + vs_max = 2.0 + z_slope_ice = .true. + z_slope_liq = .true. +/ +!! [GFDL_CLOUD_MP_NML] + + +!>[GFS_PHYSICS_NML] +&gfs_physics_nml + cal_pre = .false. + cdmbgwd = 4.0, 0.15, 1.0, 1.0 + cnvcld = .true. + cnvgwd = .true. + debug = .false. + do_tofd = .true. + do_ugwp = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 3600.0 + fhswr = 3600.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_inc_files = '' + icliq_sw = 2 + ico2 = 2 + iems = 1 + imfdeepcnv = 2 + imfshalcnv = 2 + imp_physics = 11 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 1 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isatmedmf = 1 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + ldiag_ugwp = .false. + lgfdlmprad = .true. + lheatstrg = .true. + lsm = 1 + lsoil = 4 + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + prautco = 0.00015, 0.00015 + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + psautco = 0.0008, 0.0005 + random_clds = .false. + redrag = .true. + satmedmf = .true. + sfclay_compute_flux = .false. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + use_ufo = .true. +/ +!! [GFS_PHYSICS_NML] + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&mpp_io_nml + deflate_level = 1 + shuffle = 1 +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + landice = .true. + ldebug = .false. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml +/ diff --git a/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml b/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml new file mode 100644 index 000000000..8a7d621f3 --- /dev/null +++ b/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml @@ -0,0 +1,293 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_HRRR' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + nord_tr = 2 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_gsl_drag_ls_bl = .true. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .true. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/FV3_RAP_input.nml b/physics/docs/pdftxt/RE300/FV3_RAP_input.nml new file mode 100644 index 000000000..ef3f44fc5 --- /dev/null +++ b/physics/docs/pdftxt/RE300/FV3_RAP_input.nml @@ -0,0 +1,300 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_RAP' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + nord_tr = 2 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .true. + do_gsl_drag_ls_bl = .true. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = 3 + imfshalcnv = 3 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lndp_type = 0 + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml b/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml new file mode 100644 index 000000000..97a0f1216 --- /dev/null +++ b/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml @@ -0,0 +1,285 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_RRFS_v1beta' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 10 + hord_vt = 6 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 2 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml b/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml new file mode 100644 index 000000000..1236cde3b --- /dev/null +++ b/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml @@ -0,0 +1,291 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_WoFS_v0' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 10 + hord_vt = 6 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 7 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_diagnostics_nml + do_hailcast = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 17 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 1 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nssl_cccn = 600000000.0 + nssl_ccn_on = .true. + nssl_hail_on = .true. + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_GFS_v16 b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_GFS_v16 new file mode 100644 index 000000000..6dac0ecaf --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_GFS_v16 @@ -0,0 +1,330 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_GFS_v16' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 27 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + agrid_vel_rst = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.0 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.002 + dnats = 1 + do_sat_adj = .true. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 6 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 450 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 6 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .false. + mountain = .false. + n_split = 6 + n_sponge = 10 + n_zs_filter = 0 + na_init = 0 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_dz = .false. + nudge_qv = .true. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .false. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = '' + reset_eta = .false. + rf_cutoff = 750.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 10.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfdl_cloud_microphysics_nml + c_cracw = 0.8 + c_paut = 0.5 + c_pgacs = 0.01 + c_psaci = 0.05 + ccn_l = 300.0 + ccn_o = 100.0 + const_vg = .false. + const_vi = .false. + const_vr = .false. + const_vs = .false. + de_ice = .false. + do_qa = .true. + do_sedi_heat = .false. + dw_land = 0.16 + dw_ocean = 0.1 + fast_sat_adj = .true. + fix_negative = .true. + icloud_f = 1 + mono_prof = .true. + mp_time = 150.0 + prog_ccn = .false. + qi0_crt = 8e-05 + qi_lim = 1.0 + ql_gen = 0.001 + ql_mlt = 0.001 + qs0_crt = 0.001 + rad_graupel = .true. + rad_rain = .true. + rad_snow = .true. + reiflag = 2 + rh_inc = 0.3 + rh_inr = 0.3 + rh_ins = 0.3 + rthresh = 1e-05 + sedi_transport = .true. + tau_g2v = 900.0 + tau_i2s = 1000.0 + tau_l2v = 225.0 + tau_v2l = 150.0 + use_ccn = .true. + use_ppm = .false. + vg_max = 12.0 + vi_max = 1.0 + vr_max = 12.0 + vs_max = 2.0 + z_slope_ice = .true. + z_slope_liq = .true. +/ + +&gfs_physics_nml + cal_pre = .false. + cdmbgwd = 4.0, 0.15, 1.0, 1.0 + cnvcld = .true. + cnvgwd = .true. + debug = .false. + do_tofd = .true. + do_ugwp = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 3600.0 + fhswr = 3600.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_inc_files = '' + icliq_sw = 2 + ico2 = 2 + iems = 1 + imfdeepcnv = 2 + imfshalcnv = 2 + imp_physics = 11 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 1 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isatmedmf = 1 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + ldiag_ugwp = .false. + lgfdlmprad = .true. + lheatstrg = .true. + lsm = 1 + lsoil = 4 + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + prautco = 0.00015, 0.00015 + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + psautco = 0.0008, 0.0005 + random_clds = .false. + redrag = .true. + satmedmf = .true. + sfclay_compute_flux = .false. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&mpp_io_nml + deflate_level = 1 + shuffle = 1 +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + landice = .true. + ldebug = .false. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_HRRR b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_HRRR new file mode 100644 index 000000000..8a7d621f3 --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_HRRR @@ -0,0 +1,293 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_HRRR' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + nord_tr = 2 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_gsl_drag_ls_bl = .true. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .true. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RAP b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RAP new file mode 100644 index 000000000..ef3f44fc5 --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RAP @@ -0,0 +1,300 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_RAP' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + nord_tr = 2 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .true. + do_gsl_drag_ls_bl = .true. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = 3 + imfshalcnv = 3 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lndp_type = 0 + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RRFS_v1beta b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RRFS_v1beta new file mode 100644 index 000000000..97a0f1216 --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RRFS_v1beta @@ -0,0 +1,285 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_RRFS_v1beta' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 10 + hord_vt = 6 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 2 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_WoFS_v0 b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_WoFS_v0 new file mode 100644 index 000000000..1236cde3b --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_WoFS_v0 @@ -0,0 +1,291 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_WoFS_v0' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + max_output_fields = 450 + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 12000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 10 + hord_vt = 6 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 7 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_diagnostics_nml + do_hailcast = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 17 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 1 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nssl_cccn = 600000000.0 + nssl_ccn_on = .true. + nssl_hail_on = .true. + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../../../scratch1/NCEPDEV/nems/role.epic/UFS_SRW_data/develop/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 new file mode 100644 index 000000000..6dc85900b --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 @@ -0,0 +1,336 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_GFS_v16' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 27 +/ + +&diag_manager_nml + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 5000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + agrid_vel_rst = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.0 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 1 + do_sat_adj = .true. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 450 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 6 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .false. + mountain = .false. + n_split = 6 + n_sponge = 10 + n_zs_filter = 0 + na_init = 0 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_dz = .false. + nudge_qv = .true. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .false. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = '' + reset_eta = .false. + rf_cutoff = 750.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 10.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfdl_cloud_microphysics_nml + c_cracw = 0.8 + c_paut = 0.5 + c_pgacs = 0.01 + c_psaci = 0.05 + ccn_l = 300.0 + ccn_o = 100.0 + const_vg = .false. + const_vi = .false. + const_vr = .false. + const_vs = .false. + de_ice = .false. + do_qa = .true. + do_sedi_heat = .false. + dw_land = 0.16 + dw_ocean = 0.1 + fast_sat_adj = .true. + fix_negative = .true. + icloud_f = 1 + mono_prof = .true. + mp_time = 150.0 + prog_ccn = .false. + qi0_crt = 8e-05 + qi_lim = 1.0 + ql_gen = 0.001 + ql_mlt = 0.001 + qs0_crt = 0.001 + rad_graupel = .true. + rad_rain = .true. + rad_snow = .true. + reiflag = 2 + rh_inc = 0.3 + rh_inr = 0.3 + rh_ins = 0.3 + rthresh = 1e-05 + sedi_transport = .true. + tau_g2v = 900.0 + tau_i2s = 1000.0 + tau_l2v = 225.0 + tau_v2l = 150.0 + use_ccn = .true. + use_ppm = .false. + vg_max = 12.0 + vi_max = 1.0 + vr_max = 12.0 + vs_max = 2.0 + z_slope_ice = .true. + z_slope_liq = .true. +/ + +&gfs_physics_nml + cal_pre = .false. + cdmbgwd = 4.0, 0.15, 1.0, 1.0 + cnvcld = .true. + cnvgwd = .true. + debug = .false. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + do_tofd = .true. + do_ugwp = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 3600.0 + fhswr = 3600.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_inc_files = '' + icliq_sw = 2 + ico2 = 2 + iems = 1 + imfdeepcnv = 2 + imfshalcnv = 2 + imp_physics = 11 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 1 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isatmedmf = 1 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + ldiag_ugwp = .false. + lgfdlmprad = .true. + lheatstrg = .true. + lndp_type = 0 + lsm = 1 + lsoil = 4 + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsradar_reset = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + prautco = 0.00015, 0.00015 + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + psautco = 0.0008, 0.0005 + random_clds = .false. + redrag = .true. + satmedmf = .true. + sfclay_compute_flux = .false. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&mpp_io_nml + deflate_level = 1 + shuffle = 1 +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + landice = .true. + ldebug = .false. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR new file mode 100644 index 000000000..cd9408a4d --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR @@ -0,0 +1,299 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_HRRR' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 5000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = -5 + hord_mt = 5 + hord_tm = 5 + hord_tr = 10 + hord_vt = 5 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + nord_tr = 2 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_gsl_drag_ls_bl = .true. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lndp_type = 0 + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsradar_reset = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .true. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta new file mode 100644 index 000000000..97e775107 --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta @@ -0,0 +1,291 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_RRFS_v1beta' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 5000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 10 + hord_vt = 6 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 6 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lndp_type = 0 + lradar = .true. + lsm = 2 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsradar_reset = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 new file mode 100644 index 000000000..94cc34d0f --- /dev/null +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 @@ -0,0 +1,297 @@ +&amip_interp_nml + data_set = 'reynolds_oi' + date_out_of_range = 'climo' + interp_oi_sst = .true. + no_anom_sst = .false. + use_ncep_ice = .false. + use_ncep_sst = .true. +/ + +&atmos_model_nml + blocksize = 40 + ccpp_suite = 'FV3_WoFS_v0' + chksum_debug = .false. + dycore_only = .false. +/ + +&cires_ugwp_nml + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_version = 0 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 +/ + +&diag_manager_nml + prepend_date = .false. +/ + +&external_ic_nml + checker_tr = .false. + filtered_terrain = .true. + gfs_dwinds = .true. + levp = 65 + nt_checker = 0 +/ + +&fms_io_nml + checksum_required = .false. + max_files_r = 100 + max_files_w = 100 +/ + +&fms_nml + clock_grain = 'ROUTINE' + domains_stack_size = 5000000 + print_memory_usage = .false. +/ + +&fv_core_nml + a_imp = 1.0 + adjust_dry_mass = .false. + bc_update_interval = 6 + beta = 0.0 + consv_am = .false. + consv_te = 0.0 + d2_bg = 0.0 + d2_bg_k1 = 0.2 + d2_bg_k2 = 0.04 + d4_bg = 0.12 + d_con = 1.0 + d_ext = 0.0 + dddmp = 0.1 + delt_max = 0.008 + dnats = 0 + do_sat_adj = .false. + do_schmidt = .true. + do_vort_damp = .true. + dwind_2d = .false. + dz_min = 2 + external_eta = .true. + external_ic = .true. + fill = .true. + full_zs_filter = .false. + fv_debug = .false. + fv_sg_adj = 300 + gfs_phil = .false. + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 10 + hord_vt = 6 + hydrostatic = .false. + io_layout = 1, 1 + k_split = 2 + ke_bg = 0.0 + kord_mt = 9 + kord_tm = -9 + kord_tr = 9 + kord_wz = 9 + layout = 5, 2 + make_nh = .true. + mountain = .false. + n_split = 5 + n_sponge = 24 + n_zs_filter = 0 + na_init = 1 + ncep_ic = .false. + nggps_ic = .true. + no_dycore = .false. + nord = 3 + npx = 220 + npy = 132 + npz = 64 + nrows_blend = 10 + ntiles = 1 + nudge_qv = .false. + nwat = 7 + p_fac = 0.1 + phys_hydrostatic = .false. + print_freq = 6 + psm_bc = 1 + range_warn = .true. + read_increment = .false. + regional = .true. + regional_bcs_from_gsi = .false. + res_latlon_dynamics = 'fv3_increment.nc' + reset_eta = .false. + rf_cutoff = 2000.0 + stretch_fac = 0.999 + target_lat = 38.5 + target_lon = -97.5 + tau = 5.0 + use_hydro_pressure = .false. + vtdm4 = 0.02 + warm_start = .false. + write_restart_with_bcs = .false. + z_tracer = .true. +/ + +&fv_diagnostics_nml + do_hailcast = .true. +/ + +&fv_grid_nml + grid_file = 'INPUT/grid_spec.nc' +/ + +&gfs_physics_nml + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 17 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lndp_type = 0 + lradar = .true. + lsm = 1 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsradar_reset = 3600 + nssl_cccn = 600000000.0 + nssl_ccn_on = .true. + nssl_hail_on = .true. + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. + sfclay_compute_flux = .false. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. +/ + +&interpolator_nml + interp_method = 'conserve_great_circle' +/ + +&nam_sfcperts +/ + +&nam_sppperts +/ + +&nam_stochy +/ + +&namsfc + fabsl = 99999 + faisl = 99999 + faiss = 99999 + fnacna = '' + fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' + fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' + fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' + fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' + fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' + fnsnoa = '' + fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' + fntsfa = '' + fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' + fnzorc = 'igbp' + fsicl = 99999 + fsics = 99999 + fslpl = 99999 + fsmcl = 99999, 99999, 99999 + fsnol = 99999 + fsnos = 99999 + fsotl = 99999 + ftsfl = 99999 + ftsfs = 90 + fvetl = 99999 + fvmnl = 99999 + fvmxl = 99999 + ldebug = .true. +/ + +&namsfc_dict + fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' + fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' + fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' + fnslpc = '../fix_lam/C403.slope_type.tileX.nc' + fnsotc = '../fix_lam/C403.soil_type.tileX.nc' + fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' + fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' + fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' + fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' +/ + +&surf_map_nml + cd2 = -1 + cd4 = 0.12 + max_slope = 0.4 + n_del2_strong = 0 + n_del2_weak = 2 + n_del4 = 1 + peak_fac = 1.0 + zero_ocean = .false. +/ diff --git a/physics/docs/pdftxt/RE300/suite_FV3_GFS_v16.xml b/physics/docs/pdftxt/RE300/suite_FV3_GFS_v16.xml new file mode 100644 index 000000000..122b937e1 --- /dev/null +++ b/physics/docs/pdftxt/RE300/suite_FV3_GFS_v16.xml @@ -0,0 +1,94 @@ + + + + + + + fv_sat_adj + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + GFS_PBL_generic_pre + satmedmfvdifq + GFS_PBL_generic_post + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + samfdeepcnv + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + samfshalcnv + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + gfdl_cloud_microphys + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/physics/docs/pdftxt/RE300/suite_FV3_HRRR.xml b/physics/docs/pdftxt/RE300/suite_FV3_HRRR.xml new file mode 100644 index 000000000..6ac35db14 --- /dev/null +++ b/physics/docs/pdftxt/RE300/suite_FV3_HRRR.xml @@ -0,0 +1,82 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + lsm_ruc + clm_lake + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + rrfs_smoke_wrapper + mynnedmf_wrapper + rrfs_smoke_postpbl + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_suite_interstitial_4 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/physics/docs/pdftxt/RE300/suite_FV3_RAP.xml b/physics/docs/pdftxt/RE300/suite_FV3_RAP.xml new file mode 100644 index 000000000..f03c1a1e8 --- /dev/null +++ b/physics/docs/pdftxt/RE300/suite_FV3_RAP.xml @@ -0,0 +1,90 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_ruc + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + drag_suite + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_gf_driver_pre + cu_gf_driver + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + cu_gf_driver_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/physics/docs/pdftxt/RE300/suite_FV3_RRFS_v1beta.xml b/physics/docs/pdftxt/RE300/suite_FV3_RRFS_v1beta.xml new file mode 100644 index 000000000..97228c0a6 --- /dev/null +++ b/physics/docs/pdftxt/RE300/suite_FV3_RRFS_v1beta.xml @@ -0,0 +1,84 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + noahmpdrv + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_suite_interstitial_4 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/physics/docs/pdftxt/RE300/suite_FV3_WoFS_v0.xml b/physics/docs/pdftxt/RE300/suite_FV3_WoFS_v0.xml new file mode 100644 index 000000000..1a34ba1a1 --- /dev/null +++ b/physics/docs/pdftxt/RE300/suite_FV3_WoFS_v0.xml @@ -0,0 +1,80 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmg_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmg_pre + GFS_radiation_surface + rad_sw_pre + rrtmg_sw + rrtmg_sw_post + rrtmg_lw_pre + rrtmg_lw + sgscloud_radpost + rrtmg_lw_post + GFS_rrtmg_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + mynnsfc_wrapper + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_MP_generic_pre + mp_nssl + GFS_MP_generic_post + maximum_hourly_diagnostics + phys_tend + + + + + GFS_stochastics + + + + diff --git a/physics/docs/pdftxt/RUCLSM.txt b/physics/docs/pdftxt/RUCLSM.txt index 00b064e5f..461348aa4 100644 --- a/physics/docs/pdftxt/RUCLSM.txt +++ b/physics/docs/pdftxt/RUCLSM.txt @@ -9,11 +9,11 @@ as part of the RAP from 2012 through the present and as part of HRRR from 2014 t processes in the RUC LSM (Smirnova et al. 2016 \cite Smirnova_2016 ) have proven to be physically robust and capable of realistically representing the evolution of soil moisture, soil temperature, and snow in cycled models. Extension of the RAP domain to encompass all of North America and adjacent high-latitude ocean areas necessitated further development of the RUC LSM for application in the tundra permafrost regions and over Arctic -sea ice (Smirnova et al. 2000 \cite Smirnova_2000). Other modifications include refinements in the snow model and a more accurate specification of -albedo, roughness length, and other surface properties. These recent modifications in the RUC LSM are described and evaluated in +sea ice (Smirnova et al. 2000 \cite Smirnova_2000). Other modifications include refinements in the snow model (snow "mosaic" approach, improvements in computation of snow cover fraction and snow thermal conductivity) and a more accurate specification of +albedo, roughness length, and other surface properties. Some of these recent modifications in the RUC LSM are described and evaluated in Smirnova et al. 2016 \cite Smirnova_2016 . -The parameterizations in the RUC LSM describe complicated atmosphere–land surface interactions in an intentionally simplified fashion to avoid +The parameterizations in the RUC LSM describe complicated atmosphere–land surface interactions (Fig.1) in an intentionally simplified fashion to avoid excessive sensitivity to multiple uncertain surface parameters. Nevertheless, the RUC LSM, when coupled with the hourly-assimilating atmospheric model, demonstrated over years of ongoing cycling (Benjamin et al. 2004a,b \cite Benjamin_2004a \cite Benjamin_2004b ; Berbery et al. 1999 \cite Berbery_1999) that it can produce a realistic evolution of hydrologic and time-varying soil fields (i.e., soil moisture and temperature) that cannot be directly @@ -28,88 +28,93 @@ included in phase 2(d) of the Project for the Intercomparison of Land Surface Pr Luo et al. 2003 \cite Luo_2003 ). The RUC LSM was also tested during the Snow Models Intercomparison Project (SnowMIP, SnowMIP2, ESM-SnowMIP), with emphasis on snow parameterizations for both grassland and forest locations in different parts of the world (Etchevers et al. 2002, 2004 \cite Etchevers_2002 \cite Etchevers_2004; Essery et al. 2009 \cite Essery_2009 ; Rutter et al. 2009 \cite Rutter_2009 , -Krinner et al. 2018 \cite Krinner_2018 ). The analysis of RUC LSM performance over 10 reference sites in ESM-SnowMIP rated it on the 5th place +Krinner et al. 2018 \cite Krinner_2018 ). The analysis of RUC LSM performance over 10 reference sites in ESM-SnowMIP rated it on the 4th place among the 26 participating models. The results were published in Menard et al.(2021) \cite Menard_2021 and Essery et al. (2020) \cite essery_et_al_2020. RUC LSM received high rankings in ESM-SnowMIP experiement in terms of multi-year snow cover and surface temperature simulations -for several sites located in different parts of the world (Menard et al.2021 \cite Menard_2021). +for several sites located in different parts of the world (Fig.2, Menard et al.2021 \cite Menard_2021). -RUC LSM is used in several weather prediction models around the world (Austria, New Zealand, Switzerland, RAP/HRRR in US). Recent RUC LSM implementation in the high-resolution model in the Swiss Alps led to some small modifications and adjustments to the snow model. -These adjustments will be available in the next CCPP public release. +RUC LSM is used in several weather prediction models around the world (Austria, New Zealand, Switzerland, RAP/HRRR in US). Recent RUC LSM implementation in the 1km-resolution model over Europe revealed some issues in the snow-covered high terrain (Swiss Alps), and this led to some small modifications and adjustments to the snow model. +These adjustments are available in the current CCPP public release. - -Coupling of the RUC LSM to physically-based stochastic snow model (He et al.(2021) \cite he_et_al_2021) will be implemented in the next public release. +Coupling of the RUC LSM to physically-based stochastic snow model (He et al.(2021) \cite he_et_al_2021) is also available in the current public release. The sensitivity of surface fluxes and turbine-height winds to the RUC LSM parameters has been explored by Geng Xia, NREL. This study will determine the uncertainty range for the selected parameters in the RUC LSM and will be described in the journal paper. ## RUC LSM characteristics that differ from NOAH LSM: -\image html ruc_lsm_veg_soil.png "Figure 1. RUC LSM Vegetation and Soil Model (Courtesy of T.G. Smirnova) " width=900 +\image html ruc_lsm_veg_soil.png "Figure 1: RUC LSM Vegetation and Soil Model (Courtesy of T.G. Smirnova) " width=900 +\image html ruc_ranking.png "Figure 2: Model ranking as a function of normalized root mean square error of snow water equivalent and surface temperature (Courtesy of C. Menard)" width=900 - \b Implicit \b solution of energy and moisture budgets in the layer spanning the ground surface - \b 9 \b soil \b levels with high vertical resolution near surface -RUC LSM has more levels in oil than \ref GFS_NOAH model with higher resolution near the interface with the atmosphere +RUC LSM has more levels in soil than \ref GFS_NOAH model with higher resolution near the interface with the atmosphere - \b Prognostic \b soil moisture variable (\f$\theta-\theta_r\f$) The prognostic variables for soil moisture is volumetric soil moisture content minus residual value of soil moisture which is tied to soil particles and does not participate in moisture transport. - \b Frozen \b soil \b physics algorithm RUC LSM has a different approach to take into account freezing and thawing processes in soil. -- Treatment of \b mixed \b phase \b precipitation -It accounts for mixed phase precipitation provided by \ref THOMPSON used in RAP and HRRR. -- Simple treatment of \b sea \c ice which solves heat diffusion in sea ice and allows evolving snow cover on top of sea ice -- sub-grid-scale \b heterogeneity of surface parameters in RUC LSM +- Treatment of \b mixed \b phase \b precipitation accounts for mixed phase precipitation provided by \ref THOMPSON used in RAP and HRRR. +- Simple treatment of \b sea \b ice which solves heat diffusion in sea ice and allows evolving snow cover on top of sea ice +- Sub-grid-scale \b heterogeneity of surface parameters in RUC LSM (Fig.3). With the certain level of confidence in the skill of the model, the next requirement is to provide land static fields and surface -parameters with the best possible accuracy. RAP and HRRR use the same datasets as \ref GFS_NOAH. But instead of specifying surface -parameters for the dominant soil and land-use category in the grid box, RUC LSM takes into account the sub-grid scale heterogeneity +parameters with the best possible accuracy. RAP and HRRR use the same soil/vegetation calssifications as \ref GFS_NOAH. But in addition to +specifying surface +parameters for the dominant soil and land-use category in the grid box, RUC LSM has an option to take into account the sub-grid scale heterogeneity in the computation of such parameters as roughness length, emissivity, soil porosity, soil heat capacity and others. The difference in -roughness between the mosaic and dominant category presented on figure 2 is positive from contribution of the forests, which helped to -reduce high biases of surface wind speeds in these regions. Roughness lenghth has also seasonal variability in the cropland regions, -which again helped to improve the wind forecasts during the warm season. -\image html ruc_lsm_heterogeneity.png "Figure 2: sub-grid scale heterogeneity of surface parameters in RUC LSM (Courtesy of T.G. Smirnova)" width=900 +roughness between the mosaic and dominant category presented on Figure 3, is positive from contribution of the forests, which helped to +reduce high biases of surface wind speeds in these regions. In the cropland regions, roughness lenghth has also a seasonal variability depending on the growing phase of the plants. This again helped to improve the wind forecasts during the warm season. +Turning on sub-grid-scale heterogeneity option requries: \p mosaic_lu = 1 and \p mosaic_soil = 1 in the namelist, and fractions of soil and vegetation types in a grid cell. +\image html ruc_lsm_heterogeneity.png "Figure 3: sub-grid scale heterogeneity of surface parameters in RUC LSM (Courtesy of T.G. Smirnova)" width=900 -- New: simple irrigation in the cropland area +- New: simple irrigation in the cropland area with \p mosaic_lu = 1 - New: water/snow intercepted by canopy as function of vegetation fraction and leaf area index (LAI) ## RUC snow model characteristics: Snow forms additional two layers on top of soil in RUC LSM -- \b 2-layer \b snow model: when SWE < 1.6 cm - snow layer is combined with top soil layer -- Fractional snow cover (SWE < 3 cm): -- weighted average of snow-covered and snow-free areas to compute snow paramters (roughness, albedo) -- New: "mosaic" approach for patchy snow - - Seperate treatment of energy and moisture budgets for snow-covered and snow-free portions of the grid cell +- \b 2-layer \b snow model: when SWE < 1.6 cm - snow layer is combined with top soil layer; +- Fractional snow cover (SWE < 3 cm); +- Weighted average of snow-covered and snow-free areas to compute snow parameters (roughness, albedo); +- "Mosaic" approach for patchy snow (Fig.4): + - Separate treatment of energy and moisture budgets for snow-covered and snow-free portions of the grid cell - Aggregate solutions at the end of time step - - Reduced cold bias for areas with thin snow -\image html ruc_lsm_mosaic.png "Figure 3: recent development: mosaic approach for patchy snow (Courtesy of T.G. Smirnova) " width=900 -- Iterative snow melting algorithm -- Density of snow on the ground - a function of compaction parameter and snow depth and temperature -- Snow albedo - a function of temperature and snow fraction -- Snow interception by canopy - a function of vegetation fraction and LAI -- Density of falling snow/graupel/ice precipitation + - Outcome: reduced cold bias for areas with thin snow +\image html ruc_lsm_mosaic.png "Figure 4: 'Mosaic' approach for patchy snow (Courtesy of T.G. Smirnova) " width=900 + - New: additional options to compute snow cover fraction (\p isncovr_opt =2 and 3, Niu and Yang (2007) \cite Niu_2007). These options allowed to reduce overprediction of number of grid cells fully covered with snow which further reduced cold-biases over snow. Figure 5 demonstrates that option 3 of snow cover fraction computation (\p isncovr_opt = 3) in the UFS-based regional model matches better the satellite data for the test case on 6 February 2022. +- New: added an option to use of a new formulation of snow thermal conductivity (\p isncond_opt = 2, Sturm et al. (1997) \cite sturm_1997); +\image html sncov_rrfs_ruc.png "Figure 5: Snow cover fraction from MODIS (a,b), Regional UFS-based system (RRFS) original (c), and modified with isncover_opt=3 (d), 6 February 2022. (Courtesy of T.G. Smirnova)" width=900 +- Iterative snow melting algorithm; +- Density of snow on the ground - a function of compaction parameter and snow depth and temperature; +- Snow albedo - a function of temperature and snow fraction; +- Snow interception by canopy - a function of vegetation fraction and leaf area index (LAI); +- Density of falling snow/graupel/ice precipitation (Fig.6) - The density of falling snow/graupel/ice is computed inside RUC LSM using empirical temperature-dependent equations; - Averaged density of frozen precipitation is defined from weighted contribution of each hydrometeor species: \f[ \rho_{fr}=\rho_{sn}*\alpha_{sn}+\rho_{gr}*\alpha_{gr}+\rho_{ice}*\alpha_{ice} + \f] +Where subscripts sn, gr, ice - snow, graupel and ice precipitation, respectively. - The depth of new snow is defined from its liquid equivalent and \f$\rho_{fr}\f$ -\image html ruc_lsm_frozen_precip.png "Figure 4: HRRR 23-h forecasts of snow accumulation, valid 08 UTC, 29 Dec 2015 (Courtesy of T.G. Smirnova)" width=900 +\image html ruc_lsm_frozen_precip.png "Figure 6: HRRR 23-h forecasts of snow accumulation, valid 08 UTC, 29 Dec 2015 (Courtesy of T.G. Smirnova)" width=900 -snow accumulation with variable density is provided as an additional product in the model guidance. Figure 4 shows one example of this product +Snow accumulation with variable density is provided as an additional product in the model guidance. Figure 6 shows one example of this product from the 23-h HRRR forecast for snowstorm on 29 Dec 2015. This product is in the middle panel. The panel on the left uses traditional 10:1 ratio, -and the right panel is oberved snow accumulation. We can see that the new product in the middle here has a better, further north location of maximum -snow accumulation, and high ammounts of snow in the product with 10:1 ratio are trimmed in central and southern Iowa where both observed and model +and the right panel is observed snow accumulation. We can see that the new product in the middle here has a better, further north location of maximum +snow accumulation, and high amounts of snow in the product with 10:1 ratio are trimmed in central and southern Iowa where both observed and model precipitation had a high content of sleet. There is even larger improvement in the Chicago area, where observed and model precipitation were almost totally sleet. \section v6_updates_ruc Physics Updates -\version CCPP V6.0.0 +\version UFS-SRW v3.0.0 - Initialization of land and ice emissivity with consideration of partial snow cover - Initialization of land and ice albedo with consideration of partial snow cover - Initialization of water vapor mixing ratio over land and ice +- Initialization of fractions of soil and vegetation types in a grid cell - Changes in the computation of a flag for sea ice: it is set to true only if \p flag_cice = .false. (uncoupled sea ice model) - Introduced separate variables for sea ice, for example: \p showfallac is replaced with \p snowfallac_ice -- Added accomodation of fractional surface grid (land and ice fractions are possible within the grid cell) -- Introduced solar angle dependence of albedo for snow-free land -- Introduced a SPP option for stochastic perturbations for emissivity, albedo and vegetation fraction -- Bug fix in hydraulic conductivity +- Added accommodation of fractional surface grid (land and ice fractions are possible within the grid cell) +- Solar angle dependence of albedo for snow-free land +- SPP option for stochastic perturbations for emissivity, albedo and vegetation fraction - Based on RRFS testing, the coefficient in the soil resistance formulation (Sakaguchi and Zeng (2009) \cite sakaguchi_and_zeng_2009) -was increased from 0.5 to 0.7 to increase soil resistance to evaporation +was increased from 0.7 to 1.0 to increase soil resistance to evaporation \section intra_ruclsm Intraphysics Communication diff --git a/physics/docs/pdftxt/SRW_all_shemes_list.txt b/physics/docs/pdftxt/SRW_all_shemes_list.txt index bb320008e..db9683579 100644 --- a/physics/docs/pdftxt/SRW_all_shemes_list.txt +++ b/physics/docs/pdftxt/SRW_all_shemes_list.txt @@ -46,6 +46,9 @@ The UFS-SRW App. assembles the parameterizations in suites. - \subpage GFS_OCEAN - \subpage GFS_SFCSICE +\b CLM \b Lake \b Model + - \subpage CLM_LAKE_model + \b Others - \subpage GFS_SPP diff --git a/physics/docs/pdftxt/SRW_mainpage.txt b/physics/docs/pdftxt/SRW_mainpage.txt index 154b1b0eb..59b551d55 100644 --- a/physics/docs/pdftxt/SRW_mainpage.txt +++ b/physics/docs/pdftxt/SRW_mainpage.txt @@ -1,15 +1,16 @@ /** \mainpage Introduction -Welcome to the scientific documentation for the physical parameterizations available in the Unified Forecast System (UFS) Short-Range Weather (SRW) Application version 2.1.0 (available through https://github.com/ufs-community/ufs-srweather-app/) and the suites that can be configured using them. The SRW app targets predictions of atmospheric behavior on a +Welcome to the scientific documentation for the physical parameterizations available in the Unified Forecast System (UFS) Short-Range Weather (SRW) Application version 3.0 (available through https://github.com/ufs-community/ufs-srweather-app/) and the suites that can be configured using them. The SRW app targets predictions of atmospheric behavior on a limited spatial domain and on time scales from less than an hour out to several days. -The CCPP parameterizations are aggregated in suites by the host models. In this release, the UFS Short-Range Weather Application 2.1.0 +The CCPP parameterizations are aggregated in suites by the host models. In this release, the UFS Short-Range Weather Application 3.0 supports suites: - \ref GFS_v16_page - \ref HRRR_suite_page - \ref RRFS_v1beta_page - \ref WoFS_v0_page +- \ref rap_suite_page */ diff --git a/physics/docs/pdftxt/THOMPSON.txt b/physics/docs/pdftxt/THOMPSON.txt index 60a873de9..fed003ebd 100644 --- a/physics/docs/pdftxt/THOMPSON.txt +++ b/physics/docs/pdftxt/THOMPSON.txt @@ -84,6 +84,15 @@ increases numerical stability by applying the subtime step only to sedimentation Two namelist variables control the usage of the semi-Lagrangian sedimentation, \p sedi_semi and \p decfl. \p sedi_semi is set to ‘true’ to activate the method. Decfl is a parameter that needs to avoid deformation of the arriving grids, currently, "10". +\version SRW v3.0.0 + +- The ice generation supersaturation requirement for nonaerosol option is reduced from 0.25 to 0.15. The purpose is to generate more ice in +the upper level and reduce the OLR bias. + +- For the non-aerosol option of the scheme, the cloud number concentration is divided into two parts (over land and others). The number +concentration over the ocean is reduced to a smaller numer (50/L) from its default (100/L). The purpose is to reduce the bias in surface +downward shortwave radiative flux off the coastal regional including the Southeast Pacific. + \section intra_thompson Intraphysics Communication - \ref arg_table_mp_thompson_run From 7ec1eb82fc1f3caccb37e52102840efdfa52c814 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Fri, 9 Jun 2023 11:32:06 -0600 Subject: [PATCH 13/81] Some format and file size adjustments --- physics/docs/pdftxt/HRRR_suite.txt | 1 + physics/docs/pdftxt/RAP_suite.txt | 4 +- .../docs/pdftxt/RE300/FV3_GFS_v16_input.nml | 152 +++++++-------- physics/docs/pdftxt/RE300/FV3_HRRR_input.nml | 164 ++++++++-------- physics/docs/pdftxt/RE300/FV3_RAP_input.nml | 174 ++++++++--------- .../pdftxt/RE300/FV3_RRFS_v1beta_input.nml | 172 ++++++++--------- .../docs/pdftxt/RE300/FV3_WoFS_v0_input.nml | 176 +++++++++--------- physics/docs/pdftxt/SRW_all_shemes_list.txt | 30 ++- physics/docs/pdftxt/SRW_mainpage.txt | 4 +- 9 files changed, 444 insertions(+), 433 deletions(-) diff --git a/physics/docs/pdftxt/HRRR_suite.txt b/physics/docs/pdftxt/HRRR_suite.txt index d8b529ada..33a1eb0b8 100644 --- a/physics/docs/pdftxt/HRRR_suite.txt +++ b/physics/docs/pdftxt/HRRR_suite.txt @@ -17,6 +17,7 @@ The HRRR suite uses the parameterizations in the following order: - \ref SFC_MYNNSFL - \ref GFS_NSST - \ref RUCLSM + - \ref CLM_LAKE_model - \ref MYNNEDMF - \ref GFS_drag_suite - \ref GFS_OZPHYS diff --git a/physics/docs/pdftxt/RAP_suite.txt b/physics/docs/pdftxt/RAP_suite.txt index 425bf40ff..0371050b0 100644 --- a/physics/docs/pdftxt/RAP_suite.txt +++ b/physics/docs/pdftxt/RAP_suite.txt @@ -23,9 +23,9 @@ The RAP suite uses the parameterizations in the following order: - \ref THOMPSON \section sdf_gsdsuite Suite Definition File -\include suite_SCM_RAP.xml +\include suite_FV3_RAP.xml \section RAP_nml_option Namelist -\snippet SCM_RAP_input.nml GFS_PHYSICS_NML +\snippet FV3_RAP_input.nml GFS_PHYSICS_NML */ diff --git a/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml b/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml index 23ca37f9c..6fd84ec22 100644 --- a/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml +++ b/physics/docs/pdftxt/RE300/FV3_GFS_v16_input.nml @@ -179,93 +179,93 @@ rthresh = 1e-05 sedi_transport = .true. tau_g2v = 900.0 - tau_i2s = 1000.0 - tau_l2v = 225.0 - tau_v2l = 150.0 - use_ccn = .true. - use_ppm = .false. - vg_max = 12.0 - vi_max = 1.0 - vr_max = 12.0 - vs_max = 2.0 - z_slope_ice = .true. - z_slope_liq = .true. + tau_i2s = 1000.0 + tau_l2v = 225.0 + tau_v2l = 150.0 + use_ccn = .true. + use_ppm = .false. + vg_max = 12.0 + vi_max = 1.0 + vr_max = 12.0 + vs_max = 2.0 + z_slope_ice = .true. + z_slope_liq = .true. / !! [GFDL_CLOUD_MP_NML] !>[GFS_PHYSICS_NML] &gfs_physics_nml - cal_pre = .false. - cdmbgwd = 4.0, 0.15, 1.0, 1.0 - cnvcld = .true. - cnvgwd = .true. - debug = .false. - do_tofd = .true. - do_ugwp = .false. - dspheat = .true. - effr_in = .true. - fhcyc = 0.0 - fhlwr = 3600.0 - fhswr = 3600.0 - fhzero = 1.0 - h2o_phys = .true. - hybedmf = .false. - iaer = 5111 - ialb = 1 + cal_pre = .false. + cdmbgwd = 4.0, 0.15, 1.0, 1.0 + cnvcld = .true. + cnvgwd = .true. + debug = .false. + do_tofd = .true. + do_ugwp = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 3600.0 + fhswr = 3600.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 iau_inc_files = '' - icliq_sw = 2 - ico2 = 2 - iems = 1 - imfdeepcnv = 2 - imfshalcnv = 2 - imp_physics = 11 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 1 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - iovr = 3 - isatmedmf = 1 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - ldiag3d = .false. - ldiag_ugwp = .false. - lgfdlmprad = .true. - lheatstrg = .true. - lsm = 1 - lsoil = 4 - lwhtr = .true. + icliq_sw = 2 + ico2 = 2 + iems = 1 + imfdeepcnv = 2 + imfshalcnv = 2 + imp_physics = 11 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 1 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isatmedmf = 1 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + ldiag_ugwp = .false. + lgfdlmprad = .true. + lheatstrg = .true. + lsm = 1 + lsoil = 4 + lwhtr = .true. nsfullradar_diag = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. oz_phys_2015 = .true. - pdfcld = .false. - prautco = 0.00015, 0.00015 - pre_rad = .false. + pdfcld = .false. + prautco = 0.00015, 0.00015 + pre_rad = .false. print_diff_pgr = .false. - prslrd0 = 0.0 - psautco = 0.0008, 0.0005 - random_clds = .false. - redrag = .true. - satmedmf = .true. + prslrd0 = 0.0 + psautco = 0.0008, 0.0005 + random_clds = .false. + redrag = .true. + satmedmf = .true. sfclay_compute_flux = .false. - shal_cnv = .true. - swhtr = .true. - trans_trac = .true. - use_ufo = .true. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + use_ufo = .true. / !! [GFS_PHYSICS_NML] diff --git a/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml b/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml index 8a7d621f3..9a89b9a1f 100644 --- a/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml +++ b/physics/docs/pdftxt/RE300/FV3_HRRR_input.nml @@ -140,90 +140,92 @@ grid_file = 'INPUT/grid_spec.nc' / +!>[GFS_PHYSICS_NML] &gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 - bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 1.0 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .false. - do_gsl_drag_ls_bl = .true. - do_gsl_drag_ss = .true. - do_gsl_drag_tofd = .true. - do_mynnedmf = .true. - do_mynnsfclay = .true. - dspheat = .true. - effr_in = .true. - fhcyc = 0.0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - gwd_opt = 3 - h2o_phys = .true. - hybedmf = .false. - iaer = 5111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icliq_sw = 2 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = -1 - imfshalcnv = -1 - imp_physics = 8 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - iovr = 3 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - kice = 9 - ldiag3d = .false. - lheatstrg = .false. - lradar = .true. - lsm = 3 - lsoil = 4 - lsoil_lsm = 9 - ltaerosol = .true. - lwhtr = .true. - nsfullradar_diag = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 + bl_mynn_tkeadvect = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_gsl_drag_ls_bl = .true. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. sfclay_compute_flux = .true. - shal_cnv = .false. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. / +!![GFS_PHYSICS_NML] &interpolator_nml interp_method = 'conserve_great_circle' diff --git a/physics/docs/pdftxt/RE300/FV3_RAP_input.nml b/physics/docs/pdftxt/RE300/FV3_RAP_input.nml index ef3f44fc5..aa80cac21 100644 --- a/physics/docs/pdftxt/RE300/FV3_RAP_input.nml +++ b/physics/docs/pdftxt/RE300/FV3_RAP_input.nml @@ -140,97 +140,99 @@ grid_file = 'INPUT/grid_spec.nc' / +!>[GFS_PHYSICS_NML] &gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 1.0 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .true. + cal_pre = .false. + cdmbgwd = 3.5, 1.0 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .true. do_gsl_drag_ls_bl = .true. - do_gsl_drag_ss = .true. - do_gsl_drag_tofd = .true. - do_mynnedmf = .true. - do_mynnsfclay = .true. - do_shum = .false. - do_skeb = .false. - do_spp = .false. - do_sppt = .false. - dspheat = .true. - effr_in = .true. - fhcyc = 0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - gwd_opt = 3 - h2o_phys = .true. - hybedmf = .false. - iaer = 5111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icliq_sw = 2 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = 3 - imfshalcnv = 3 - imp_physics = 8 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - iovr = 3 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - kice = 9 - ldiag3d = .false. - lheatstrg = .false. - lndp_type = 0 - lradar = .true. - lsm = 3 - lsoil = 4 - lsoil_lsm = 9 - ltaerosol = .true. - lwhtr = .true. - n_var_lndp = 0 - n_var_spp = 0 - nsfullradar_diag = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. + do_gsl_drag_ss = .true. + do_gsl_drag_tofd = .true. + do_mynnedmf = .true. + do_mynnsfclay = .true. + do_shum = .false. + do_skeb = .false. + do_spp = .false. + do_sppt = .false. + dspheat = .true. + effr_in = .true. + fhcyc = 0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + gwd_opt = 3 + h2o_phys = .true. + hybedmf = .false. + iaer = 5111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icliq_sw = 2 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = 3 + imfshalcnv = 3 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + iovr = 3 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + kice = 9 + ldiag3d = .false. + lheatstrg = .false. + lndp_type = 0 + lradar = .true. + lsm = 3 + lsoil = 4 + lsoil_lsm = 9 + ltaerosol = .true. + lwhtr = .true. + n_var_lndp = 0 + n_var_spp = 0 + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. sfclay_compute_flux = .false. - shal_cnv = .true. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. + shal_cnv = .true. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. / +!![GFS_PHYSICS_NML] &interpolator_nml interp_method = 'conserve_great_circle' diff --git a/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml b/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml index 97a0f1216..aff1b47a5 100644 --- a/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml +++ b/physics/docs/pdftxt/RE300/FV3_RRFS_v1beta_input.nml @@ -14,20 +14,22 @@ dycore_only = .false. / +!>[CIRES_UGWP_NML] &cires_ugwp_nml - knob_ugwp_azdir = 2, 4, 4, 4 - knob_ugwp_doaxyz = 1 - knob_ugwp_doheat = 1 - knob_ugwp_dokdis = 1 - knob_ugwp_effac = 1, 1, 1, 1 - knob_ugwp_ndx4lh = 1 - knob_ugwp_solver = 2 - knob_ugwp_source = 1, 1, 0, 0 - knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 knob_ugwp_version = 0 - knob_ugwp_wvspec = 1, 25, 25, 25 - launch_level = 25 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 / +!![CIRES_UGWP_NML] &diag_manager_nml max_output_fields = 450 @@ -139,83 +141,85 @@ grid_file = 'INPUT/grid_spec.nc' / +!>[GFS_PHYSICS_NML] &gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 0.25 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .false. - do_mynnedmf = .true. - do_mynnsfclay = .true. - dspheat = .true. - effr_in = .true. - fhcyc = 0.0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - h2o_phys = .true. - hybedmf = .false. - iaer = 111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = -1 - imfshalcnv = -1 - imp_physics = 8 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - ldiag3d = .false. - lheatstrg = .false. - lradar = .true. - lsm = 2 - lsoil = 4 - lsoil_lsm = 4 - ltaerosol = .true. - lwhtr = .true. - nsfullradar_diag = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 8 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + iopt_trs = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 2 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. sfclay_compute_flux = .false. - shal_cnv = .false. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. / +!![GFS_PHYSICS_NML] &interpolator_nml interp_method = 'conserve_great_circle' diff --git a/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml b/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml index 1236cde3b..70206c335 100644 --- a/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml +++ b/physics/docs/pdftxt/RE300/FV3_WoFS_v0_input.nml @@ -14,20 +14,22 @@ dycore_only = .false. / +!>[CIRES_UGWP_NML] &cires_ugwp_nml - knob_ugwp_azdir = 2, 4, 4, 4 - knob_ugwp_doaxyz = 1 - knob_ugwp_doheat = 1 - knob_ugwp_dokdis = 1 - knob_ugwp_effac = 1, 1, 1, 1 - knob_ugwp_ndx4lh = 1 - knob_ugwp_solver = 2 - knob_ugwp_source = 1, 1, 0, 0 - knob_ugwp_stoch = 0, 0, 0, 0 + knob_ugwp_azdir = 2, 4, 4, 4 + knob_ugwp_doaxyz = 1 + knob_ugwp_doheat = 1 + knob_ugwp_dokdis = 1 + knob_ugwp_effac = 1, 1, 1, 1 + knob_ugwp_ndx4lh = 1 + knob_ugwp_solver = 2 + knob_ugwp_source = 1, 1, 0, 0 + knob_ugwp_stoch = 0, 0, 0, 0 knob_ugwp_version = 0 - knob_ugwp_wvspec = 1, 25, 25, 25 - launch_level = 25 + knob_ugwp_wvspec = 1, 25, 25, 25 + launch_level = 25 / +!![CIRES_UGWP_NML] &diag_manager_nml max_output_fields = 450 @@ -143,85 +145,87 @@ grid_file = 'INPUT/grid_spec.nc' / +!>[GFS_PHYSICS_NML] &gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 + bl_mynn_edmf = 1 + bl_mynn_edmf_mom = 1 bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 0.25 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .false. - do_mynnedmf = .true. - do_mynnsfclay = .true. - dspheat = .true. - effr_in = .true. - fhcyc = 0.0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - h2o_phys = .true. - hybedmf = .false. - iaer = 111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = -1 - imfshalcnv = -1 - imp_physics = 17 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - ldiag3d = .false. - lheatstrg = .false. - lradar = .true. - lsm = 1 - lsoil = 4 - lsoil_lsm = 4 - ltaerosol = .true. - lwhtr = .true. - nsfullradar_diag = 3600 - nssl_cccn = 600000000.0 - nssl_ccn_on = .true. - nssl_hail_on = .true. - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. + cal_pre = .false. + cdmbgwd = 3.5, 0.25 + cnvcld = .false. + cnvgwd = .false. + cplflx = .false. + debug = .false. + do_deep = .false. + do_mynnedmf = .true. + do_mynnsfclay = .true. + dspheat = .true. + effr_in = .true. + fhcyc = 0.0 + fhlwr = 1200.0 + fhswr = 1200.0 + fhzero = 1.0 + h2o_phys = .true. + hybedmf = .false. + iaer = 111 + ialb = 1 + iau_delthrs = 6 + iau_inc_files = '' + iaufhrs = 30 + icloud_bl = 1 + ico2 = 2 + iems = 1 + imfdeepcnv = -1 + imfshalcnv = -1 + imp_physics = 17 + iopt_alb = 2 + iopt_btr = 1 + iopt_crs = 1 + iopt_dveg = 2 + iopt_frz = 1 + iopt_inf = 1 + iopt_rad = 1 + iopt_run = 1 + iopt_sfc = 1 + iopt_snf = 4 + iopt_stc = 1 + iopt_tbot = 2 + isol = 2 + isot = 1 + isubc_lw = 2 + isubc_sw = 2 + ivegsrc = 1 + ldiag3d = .false. + lheatstrg = .false. + lradar = .true. + lsm = 1 + lsoil = 4 + lsoil_lsm = 4 + ltaerosol = .true. + lwhtr = .true. + nsfullradar_diag = 3600 + nssl_cccn = 600000000.0 + nssl_ccn_on = .true. + nssl_hail_on = .true. + nst_anl = .true. + nstf_name = 2, 1, 0, 0, 0 + oz_phys = .false. + oz_phys_2015 = .true. + pdfcld = .false. + pre_rad = .false. + print_diff_pgr = .false. + prslrd0 = 0.0 + random_clds = .false. + redrag = .true. + satmedmf = .false. sfclay_compute_flux = .false. - shal_cnv = .false. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. + shal_cnv = .false. + swhtr = .true. + trans_trac = .true. + ttendlim = -999 + use_ufo = .true. / +!![GFS_PHYSICS_NML] &interpolator_nml interp_method = 'conserve_great_circle' diff --git a/physics/docs/pdftxt/SRW_all_shemes_list.txt b/physics/docs/pdftxt/SRW_all_shemes_list.txt index db9683579..16a1727e6 100644 --- a/physics/docs/pdftxt/SRW_all_shemes_list.txt +++ b/physics/docs/pdftxt/SRW_all_shemes_list.txt @@ -16,6 +16,7 @@ The UFS-SRW App. assembles the parameterizations in suites. - \subpage GFS_NOAH - \subpage RUCLSM - \subpage NoahMP + - \subpage CLM_LAKE_model \b Cumulus \b Parameterizations - \subpage GFS_SAMFdeep @@ -46,9 +47,6 @@ The UFS-SRW App. assembles the parameterizations in suites. - \subpage GFS_OCEAN - \subpage GFS_SFCSICE -\b CLM \b Lake \b Model - - \subpage CLM_LAKE_model - \b Others - \subpage GFS_SPP @@ -70,21 +68,21 @@ to the parameterization. - If the in-core saturation adjustment is used (\p do_sat_adj=.true.), it is invoked at shorter timesteps along with the dynamical solver. -The UFS Short Range Weather Application (SRW App) v2.1.0 supports four physicsphysics suites. +The UFS Short Range Weather Application (SRW App) v3.0.0 supports four physicsphysics suites. -Table 1. Physics suites and primary schemes supported in SRW v2.1.0 +Table 1. Physics suites and primary schemes supported in SRW v3.0.0 \tableofcontents -| Physics suites | GFS_v16 | HRRR | RRFS_v1beta | WoFS_v0 | -|------------------|--------------------|--------------------------------|--------------------|---------------| -|\b Deep \b Cu | \ref GFS_SAMFdeep | \a off | \a off | \a off | -|\b Shallow \b Cu | \ref GFS_SAMFshal | \ref MYNNEDMF | \ref MYNNEDMF | \ref MYNNEDMF | -|\b Microphysics | \ref GFDL_cloud | \ref THOMPSON | \ref THOMPSON | \ref NSSLMICRO_page | -|\b PBL/TURB | \ref GFS_SATMEDMFVDIFQ | \ref MYNNEDMF | \ref MYNNEDMF | \ref MYNNEDMF | -|\b Radiation | \ref GFS_RRTMG | \ref GFS_RRTMG | \ref GFS_RRTMG | \ref GFS_RRTMG | -|\b Surface \b Layer | \ref GFS_SFCLYR | \ref SFC_MYNNSFL | \ref SFC_MYNNSFL | \ref SFC_MYNNSFL | -|\b LSM | \ref GFS_NOAH | \ref RUCLSM | \ref NoahMP | \ref GFS_NOAH | -|\b Gravity \b Wave \b Drag| \ref GFS_UGWP_v0 | \ref GFS_drag_suite | \ref GFS_UGWP_v0 | \ref GFS_UGWP_v0 | -|\b Sea \b Ice | \ref GFS_SFCSICE | \ref RUCLSM | \ref GFS_SFCSICE | \ref GFS_SFCSICE | +| Physics suites | GFS_v16 | HRRR | RRFS_v1beta | WoFS_v0 | RAP | +|--------------------|--------------------|--------------------------------|--------------------|---------------|---------------| +|\b Deep \b Cu | \ref GFS_SAMFdeep | \a off | \a off | \a off | \ref CU_GF | +|\b Shallow \b Cu | \ref GFS_SAMFshal | \ref MYNNEDMF | \ref MYNNEDMF | \ref MYNNEDMF | \ref CU_GF | +|\b Microphysics | \ref GFDL_cloud | \ref THOMPSON | \ref THOMPSON | \ref NSSLMICRO_page | \ref THOMPSON| +|\b PBL/TURB | \ref GFS_SATMEDMFVDIFQ | \ref MYNNEDMF | \ref MYNNEDMF | \ref MYNNEDMF | \ref MYNNEDMF | +|\b Radiation | \ref GFS_RRTMG | \ref GFS_RRTMG | \ref GFS_RRTMG | \ref GFS_RRTMG | \ref GFS_RRTMG | +|\b Surface \b Layer | \ref GFS_SFCLYR | \ref SFC_MYNNSFL | \ref SFC_MYNNSFL | \ref SFC_MYNNSFL | \ref SFC_MYNNSFL | +|\b LSM | \ref GFS_NOAH | \ref RUCLSM and \ref CLM_LAKE_model | \ref NoahMP | \ref GFS_NOAH | \ref RUCLSM | +|\b Gravity \b Wave \b Drag| \ref GFS_UGWP_v0 | \ref GFS_drag_suite | \ref GFS_UGWP_v0 | \ref GFS_UGWP_v0 | \ref GFS_drag_suite | +|\b Ice and \b Snow | \ref GFS_SFCSICE | \ref RUCLSM | \ref GFS_SFCSICE | \ref GFS_SFCSICE | \ref RUCLSM | \tableofcontents diff --git a/physics/docs/pdftxt/SRW_mainpage.txt b/physics/docs/pdftxt/SRW_mainpage.txt index 59b551d55..8b3791c07 100644 --- a/physics/docs/pdftxt/SRW_mainpage.txt +++ b/physics/docs/pdftxt/SRW_mainpage.txt @@ -1,10 +1,10 @@ /** \mainpage Introduction -Welcome to the scientific documentation for the physical parameterizations available in the Unified Forecast System (UFS) Short-Range Weather (SRW) Application version 3.0 (available through https://github.com/ufs-community/ufs-srweather-app/) and the suites that can be configured using them. The SRW app targets predictions of atmospheric behavior on a +Welcome to the scientific documentation for the physical parameterizations available in the Unified Forecast System (UFS) Short-Range Weather (SRW) Application version 3.0.0 (available through https://github.com/ufs-community/ufs-srweather-app/) and the suites that can be configured using them. The SRW app targets predictions of atmospheric behavior on a limited spatial domain and on time scales from less than an hour out to several days. -The CCPP parameterizations are aggregated in suites by the host models. In this release, the UFS Short-Range Weather Application 3.0 +The CCPP parameterizations are aggregated in suites by the host models. In this release, the UFS Short-Range Weather Application 3.0.0 supports suites: - \ref GFS_v16_page - \ref HRRR_suite_page From c901390c8e758f63d1e2122d917579230d1def6d Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Thu, 15 Jun 2023 11:43:23 -0600 Subject: [PATCH 14/81] address some review comments --- physics/docs/pdftxt/CLM_LAKE.txt | 8 +++--- physics/docs/pdftxt/CU_GF_deep.txt | 17 ++++++------- physics/docs/pdftxt/GFS_NOAHMP.txt | 6 ++--- physics/docs/pdftxt/GFS_SAMFdeep.txt | 3 +-- physics/docs/pdftxt/HRRR_suite.txt | 4 +-- physics/docs/pdftxt/RAP_suite.txt | 6 ++--- physics/docs/pdftxt/RRFS_v1beta_suite.txt | 4 +-- physics/docs/pdftxt/RUCLSM.txt | 9 ++++--- physics/docs/pdftxt/SRW_mainpage.txt | 10 +++++++- physics/docs/pdftxt/WoFS_v0_suite.txt | 5 ++-- physics/docs/pdftxt/suite_input.nml.txt | 30 ++++++++++++++++++----- 11 files changed, 63 insertions(+), 39 deletions(-) diff --git a/physics/docs/pdftxt/CLM_LAKE.txt b/physics/docs/pdftxt/CLM_LAKE.txt index c091d2b17..e0a8d9209 100644 --- a/physics/docs/pdftxt/CLM_LAKE.txt +++ b/physics/docs/pdftxt/CLM_LAKE.txt @@ -2,7 +2,7 @@ \page CLM_LAKE_model CLM Lake Model \section des_clmlake Description -CLM lake model is a multi-level one-dimensional lake model that has been implemented within the operational 3-km HRRR and +The Community Land Model (CLM) lake model is a multi-level one-dimensional lake model that has been implemented within the operational 3-km HRRR and 13-km RAP for small lakes (Benjamin et al. (2022) \cite gmd-15-6659-2022). It is the Community Land Model, version 4.5. Subin et al. (2012) \cite Subin_2012 describe the 1-d CLM lake model as applied within the Community Earth System Model (CESM) as a component of the overall CESM CLM (Lawrence et al. (2019) \cite Lawrence_2019). Gu et al. (2015) \cite Gu2015 @@ -31,14 +31,14 @@ to improve surface prediction in the vicinity of small lakes. The CLM lake model requires bathymetry for the lake points in the model domain. Grid points are assigned as lake points when the fraction of lake coverage in the grid cell exceeds 50% and when this point is disconnected from oceans. The lake water mask is therefore binary, set to either 1 or 0. This binary approach for models with higher horizontal resolution, for example, 3-km resolution in -the regional application of UFS (RRFS), is capable of capturing the effect of lakes on regional heat and moisture fluxes. +in the UFS SRW App, is capable of capturing the effect of lakes on regional heat and moisture fluxes. Lake depths for the RRFS lake configuration (Fig.1) are assigned from a global dataset provided by Kourzeneva et al.(2012) \cite Kourzeneva_2012, this dataset is referred to as GLOBv3 bathymetry in the UFS_UTL. \image html Lake_depths_RRFS3km.png "Figure 1: Lake depths for lakes in the 3-km RRFS domain." width=600 -To cold-start the CLM lake model in RRFS: +To cold-start the CLM lake model in the UFS SRW App: - Use the CLM option in the input.nml \n - lkm = 1 \n - iopt_lake = 2 @@ -47,7 +47,7 @@ To cold-start the CLM lake model in RRFS: - Temperature for soil under the lake is initialized from bottom lake temperature at the top to the substrate soil temperature at the bottom of soil layer - Lake ice at the top level is initialized from the GFS ice concentration -The differences of surface variables from the RRFS 6-h forecast with/without CLM lake model are shown in Figure 2 for 2-m temperature and in Figure 3 for 2-m dewpoint. +The differences of surface variables from the experimental RRFS 6-h forecast with/without CLM lake model are shown in Figure 2 for 2-m temperature and in Figure 3 for 2-m dewpoint. \image html diff_t2m_lake_rrfs.png "Figure 2: Differences of 2-m temperature between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 \image html diff_td2m_lake_rrfs.png "Figure 3: Differences of 2-m dew point between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index f30cb28dc..365ba9ae0 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -8,20 +8,18 @@ follows the mass flux approach published by Grell (1993) \cite grell_1993. Further developments by Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 included implementing stochastics through allowing parameter perturbations. In GF scale awareness, and the aerosol dependence through rain generation (following Berry (1968) \cite berry_1968 and evaporation formulations (following Jiang et al. (2010) \cite Jiang_2010 ), depending on the -cloud concentration nuclei at cloud base were added. GF included mixed phase physics impact, momentum transport, +cloud concentration nuclei at cloud base were added. The GF scheme includes mixed phase physics impact, momentum transport, a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction -and transition from shallow, congestus and deep convection regimes. The vertical massflux distribution of shallow, congestus and -deep convection regimes is characterized by Probability Density Functions (PDF's). The three PDF's are meant to represent the average +and transition from shallow, congestus and deep convection regimes. The vertical mass flux distribution of shallow, congestus and +deep convection regimes is characterized by Probability Density Functions (PDFs). The three PDF's are meant to represent the average statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived -from the PDF's. The deep and congestus convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ), the shallow convection is not scale-aware. Aerosol dependence is implemented through dependence of rain generation and +from the PDF's. The deep and congestus convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ). However, the shallow convection is not scale-aware. Aerosol dependence is implemented through dependence of rain generation and evaporation formulations depending on the cloud concentration nuclei at cloud base (Berry 1968 \cite berry_1968, Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. Aerosol dependence is considered experimental and is turned off at this point. GF is able to transport tracers. - -\section version_cugf_enh CCPP Physics Updates -\version CCPP v6.0.0 +\b CCPP \b v6.0.0 \b Updates: - GPU capabilities have been added - Cap suppressing (\p do_cap_suppress) based on radar data assimilation has been added. This is used only for the RAP suite @@ -38,9 +36,10 @@ transition as grid spacing decreases into a shallow convection scheme - Coupled to the grid scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated precipitating convective cloud and shallow convective clouds +\section version_cugf_enh CCPP Physics Updates + \version UFS-SRW v3.0.0 -- The choices of closures for deep/mid/shallow convection are now namelist options -- Updates for aerosol-awareness +- Updates for aerosol-awareness (experimental) \b The \b Implementation \b of \b GF \b in \b RRFS diff --git a/physics/docs/pdftxt/GFS_NOAHMP.txt b/physics/docs/pdftxt/GFS_NOAHMP.txt index 83e8c0650..386ae816c 100644 --- a/physics/docs/pdftxt/GFS_NOAHMP.txt +++ b/physics/docs/pdftxt/GFS_NOAHMP.txt @@ -4,11 +4,9 @@ This implementation of the NoahMP Land Surface Model (LSM) is adapted from the version implemented in WRF v3.7 with additions by NOAA EMC staff to work with the UFS Atmosphere model. Authoritative documentation of the NoahMP scheme can be accessed at the following links: -Technical documentation freely available at He et al. (2023) \cite He_2023. +- Technical documentation freely available at He et al. (2023) \cite He_2023. -To cite the technical documentation: He, C., P. Valayamkunnath, M. Barlage, F. Chen, D. Gochis, R. Cabell, T. Schneider, R. Rasmussen, G.-Y. Niu, Z.-L. Yang, D. Niyogi, and M. Ek (2023): The Community Noah-MP Land Surface Modeling System Technical Description Version 5.0, (No. NCAR/TN-575+STR). doi:10.5065/ew8g-yr95 - -A primary reference for the NoahMP LSM is Niu et al. (2011) \cite niu_et_al_2011. +- A primary reference for the NoahMP LSM is Niu et al. (2011) \cite niu_et_al_2011. \section noahmp_update CCPP Physics Updates \version UFS-SRW v3.0.0 diff --git a/physics/docs/pdftxt/GFS_SAMFdeep.txt b/physics/docs/pdftxt/GFS_SAMFdeep.txt index 346637b3b..d41763c37 100644 --- a/physics/docs/pdftxt/GFS_SAMFdeep.txt +++ b/physics/docs/pdftxt/GFS_SAMFdeep.txt @@ -65,8 +65,7 @@ rain conversion rate, entrainment and detrainment rates, overshooting layers, and maximum allowable cloudbase mass flux (as of June 2018). -\section v6_enh CCPP Physics Updates -\version CCPP v6.0.0 +\b CCPP \b v6.0.0 \b Updates \subsection ca_page Cellular Automata Stochastic Convective Organization Scheme diff --git a/physics/docs/pdftxt/HRRR_suite.txt b/physics/docs/pdftxt/HRRR_suite.txt index 33a1eb0b8..93601b62b 100644 --- a/physics/docs/pdftxt/HRRR_suite.txt +++ b/physics/docs/pdftxt/HRRR_suite.txt @@ -3,10 +3,10 @@ \section HRRR_suite_overview Overview -The HRRR suite contains the parameterizations used in the NOAA operational +The HRRR suite contains the evolving parameterizations used in the NOAA operational High-Resolution Rapid Refresh (HRRR) model, which runs at 3-km resolution. This suite is most applicable for runs at 3-km resolution since it does not -parameterize deep convection. +parameterize deep convection. It is one of the primary suite candidates for RRFS v1 operational implementation. For additional information about the HRRR model, visit: https://rapidrefresh.noaa.gov/hrrr/. diff --git a/physics/docs/pdftxt/RAP_suite.txt b/physics/docs/pdftxt/RAP_suite.txt index 0371050b0..26b9d31f3 100644 --- a/physics/docs/pdftxt/RAP_suite.txt +++ b/physics/docs/pdftxt/RAP_suite.txt @@ -3,9 +3,9 @@ \section rap_suite_overview Overview -The RAP suite contains the parameterizations used in the NOAA operational Rapid Refresh (RAP) model -which runs at 13-km resolution. Currently, the RAP suite is supported in SCM only. For additional -information about the RAP model, visit: https://rapidrefresh.noaa.gov. +The RAP suite contains the evolving parameterizations used in the NOAA operational Rapid Refresh (RAP) model +which runs at 13-km resolution. For additional +information about the RAP model, visit: https://rapidrefresh.noaa.gov. It is one of the primary suite candidates for RRFS v1 operational implementation. The RAP suite uses the parameterizations in the following order: - \ref SGSCLOUD_page diff --git a/physics/docs/pdftxt/RRFS_v1beta_suite.txt b/physics/docs/pdftxt/RRFS_v1beta_suite.txt index 2731e227e..ae400b982 100644 --- a/physics/docs/pdftxt/RRFS_v1beta_suite.txt +++ b/physics/docs/pdftxt/RRFS_v1beta_suite.txt @@ -3,8 +3,8 @@ \section RRFS_v1beta_suite_overview Overview -The RRFS_v1beta suite is the primary suite target for the upcoming operational implementation of -the Rapid Refresh Forecast System (RRFS), which is used in the UFS SRW App. This suite is most +The RRFS_v1beta suite is one of candicates for the future operational implementation of +the Rapid Refresh Forecast System (RRFS), which can be configured using the UFS SRW App. This suite is most applicable for runs at 3-km resolution since it does not parameterize deep convection. diff --git a/physics/docs/pdftxt/RUCLSM.txt b/physics/docs/pdftxt/RUCLSM.txt index 461348aa4..7a39faf84 100644 --- a/physics/docs/pdftxt/RUCLSM.txt +++ b/physics/docs/pdftxt/RUCLSM.txt @@ -10,7 +10,7 @@ processes in the RUC LSM (Smirnova et al. 2016 \cite Smirnova_2016 ) have proven the evolution of soil moisture, soil temperature, and snow in cycled models. Extension of the RAP domain to encompass all of North America and adjacent high-latitude ocean areas necessitated further development of the RUC LSM for application in the tundra permafrost regions and over Arctic sea ice (Smirnova et al. 2000 \cite Smirnova_2000). Other modifications include refinements in the snow model (snow "mosaic" approach, improvements in computation of snow cover fraction and snow thermal conductivity) and a more accurate specification of -albedo, roughness length, and other surface properties. Some of these recent modifications in the RUC LSM are described and evaluated in +albedo, roughness length, and other surface properties. Some of these modifications in the RUC LSM are described and evaluated in Smirnova et al. 2016 \cite Smirnova_2016 . The parameterizations in the RUC LSM describe complicated atmosphere–land surface interactions (Fig.1) in an intentionally simplified fashion to avoid @@ -38,9 +38,10 @@ These adjustments are available in the current CCPP public release. Coupling of the RUC LSM to physically-based stochastic snow model (He et al.(2021) \cite he_et_al_2021) is also available in the current public release. -The sensitivity of surface fluxes and turbine-height winds to the RUC LSM parameters has been explored by Geng Xia, NREL. This study -will determine the uncertainty range for the selected parameters in the RUC LSM and will be described in the journal paper. -## RUC LSM characteristics that differ from NOAH LSM: +The sensitivity of surface fluxes and turbine-height winds to the RUC LSM parameters has been explored by Geng Xia, NREL +to determine the uncertainty range for the selected parameters in the RUC LSM. + +## RUC LSM characteristics that differ from Noah LSM: \image html ruc_lsm_veg_soil.png "Figure 1: RUC LSM Vegetation and Soil Model (Courtesy of T.G. Smirnova) " width=900 \image html ruc_ranking.png "Figure 2: Model ranking as a function of normalized root mean square error of snow water equivalent and surface temperature (Courtesy of C. Menard)" width=900 - \b Implicit \b solution of energy and moisture budgets in the layer spanning the ground surface diff --git a/physics/docs/pdftxt/SRW_mainpage.txt b/physics/docs/pdftxt/SRW_mainpage.txt index 8b3791c07..5e854034c 100644 --- a/physics/docs/pdftxt/SRW_mainpage.txt +++ b/physics/docs/pdftxt/SRW_mainpage.txt @@ -1,7 +1,7 @@ /** \mainpage Introduction -Welcome to the scientific documentation for the physical parameterizations available in the Unified Forecast System (UFS) Short-Range Weather (SRW) Application version 3.0.0 (available through https://github.com/ufs-community/ufs-srweather-app/) and the suites that can be configured using them. The SRW app targets predictions of atmospheric behavior on a +Welcome to the scientific documentation for the physical parameterizations available in the Unified Forecast System (UFS) Short-Range Weather (SRW) Application version 3.0.0 (available through https://github.com/ufs-community/ufs-srweather-app/) and the suites that can be configured using them. The SRW App targets predictions of atmospheric behavior on a limited spatial domain and on time scales from less than an hour out to several days. The CCPP parameterizations are aggregated in suites by the host models. In this release, the UFS Short-Range Weather Application 3.0.0 @@ -12,5 +12,13 @@ supports suites: - \ref WoFS_v0_page - \ref rap_suite_page +\attention Here all supported suites are a recent snapshot of + +the UFS fork for CCPP . In this regard, GFS_v16 Suite is +not the same code as in the operational GFS v16. First of all, the operational GFS_v16 does not use CCPP at all. +Secondly, most of physics schemes hosted in CCPP repository have marched ahead since GFS was updated to version 16.0 on 22 March 2021. +This implication should be also applied to all other suites: as such, RAP/HRRR suites in this release are +the evolving version of the RAP/HRRR physics in operations. + */ diff --git a/physics/docs/pdftxt/WoFS_v0_suite.txt b/physics/docs/pdftxt/WoFS_v0_suite.txt index 8259ab770..4561109fa 100644 --- a/physics/docs/pdftxt/WoFS_v0_suite.txt +++ b/physics/docs/pdftxt/WoFS_v0_suite.txt @@ -4,8 +4,9 @@ \section wofs_v0_suite_overview Overview The WoFS_v0 suite is targeted for use in the upcoming operational implementation -of the NOAA's Warn-on-Forecast System (WoFS). This suite is most applicable for -runs at 3-km resolution since it does not parameterize deep convection. +of the NOAA's Warn-on-Forecast System (WoFS) and for the RRFS ensemble. +This suite is most applicable for runs at 3-km resolution since it does +not parameterize deep convection. The WoFS suite uses the parameterizations in the following order: - \ref SGSCLOUD_page diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index be3785b74..11d33db1c 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -50,9 +50,9 @@ show some variables in the namelist that must match the SDF. do_sfcperts gfs_rrtmg_pre flag for stochastic surface perturbations option .false. imp_physics choice of microphysics scheme choice of microphysics scheme: \n
    -
  • 11: GFDL microphysics scheme
  • 8: Thompson microphysics scheme
  • 10: Morrison-Gettelman microphysics scheme +
  • 11: GFDL microphysics scheme
  • 17: NSSL microphysics scheme with background CCN
  • 18: NSSL microphysics scheme with predicted CCN (compatibility)
@@ -258,7 +258,7 @@ show some variables in the namelist that must match the SDF.
  • true: activate TKE advection .false. -bl_mynn_tkebudget mynnedmf_wrapper flag to activate TKE budget 0 +tke_budget mynnedmf_wrapper flag to activating TKE budget 0 bl_mynn_cloudpdf mynnedmf_wrapper flag to determine which cloud PDF to use \n
    • 0: use Sommeria-Deardorff subgrid cloud PDF @@ -384,6 +384,9 @@ show some variables in the namelist that must match the SDF. t_sub gfdl_cloud_microphys temperature threshold for sublimation. Cloud ice, snow or graupel stops(starts) sublimation when temperature is lower(higher) then \p t_sub 184. mp_print gfdl_cloud_microphys \a .true. to turn on GFDL cloud microphysics debugging print out. (not supported in GFS physics) .false. ltaerosol mp_thompson flag for using aerosol climotology in Thompson MP scheme .false. +mraerosol flag for merra2 aerosol aware .false. +lradar flag for radar reflectivity .false. +nsfullradar_diag seconds between resetting radar reflectivity calculation .-999.0 ttendlim mp_thompson temperature tendency limiter per time step in K/s, set to < 0 to deactivate -999.0 ext_diag_thompson mp_thompson flag for extended diagnostic output from Thompson MP .false. thompson_ext_ndiag3d mp_thompson number of 3d arrays for extended diagnostic output from Thompson MP 37 @@ -394,9 +397,11 @@ show some variables in the namelist that must match the SDF. cnvcld see \a GFS_typedefs.F90 flag for convective cloud .false. lgfdlmprad gfs_rrtmg_pre flag for GFDL mp scheme and radiation consistency .false. nssl_cccn mp_nssl CCN concentration (m^-3) 0.6e9 -nssl_alphar mp_nssl rain PSD shape parameter 0.0 -nssl_alphah mp_nssl graupel PSD shape parameter 0.0 -nssl_alphahl mp_nssl hail PSD shape parameter 1.0 +nssl_alphah mp_nssl graupel shape parameter 0.0 +nssl_alphahl mp_nssl hail shape parameter 1.0 +nssl_alphar mp_nssl shape paramter for rain (imurain=1 only) 0.0 +nssl_ehw0_in mp_nssl constant or max assumed graupel-droplet collection efficiency 0.9 +nssl_ehlw0_in mp_nssl constant or max assumed hail-droplet collection efficiency 0.9 nssl_hail_on mp_nssl NSSL flag to activate the hail category .false. nssl_ccn_on mp_nssl NSSL flag to activate the CCN category .true. nssl_invertccn mp_nssl NSSL flag to treat CCN as activated or unactivated .true. @@ -508,15 +513,20 @@ show some variables in the namelist that must match the SDF.
    • 0: USGS
    • 1: IGBP(20 category): IGBP must be selected if NoahMP is used
    • 2: UMD (13 category) +
    • 3: NLCD40 (40 category, NOAH WRFv4 only) +
    • 4: USGS-RUC (28 category, NOAH WRFv4 only) +
    • 5: MODIS-RUC (21 category, NOAH WRFv4 only)
    2 +nvegcat isot lsm_noah, lsm_ruc, \ref noahmpdrv flag for soil type dataset choice:\n
    • 0: Zobler soil type (9 category)
    • 1: STATSGO soil type (19 category): STATSGO must be selected if NoahMP is used +
    • 2: STAS-RUC soil type (19 category, NOAH WRFv4 only
    0 - +exticeden lsm_noah,lsm_ruc flag for calculating frozen precip ice density outside of the LSM .false. iopt_dveg \ref noahmpdrv options for dynamic vegetation \n
    • 1: off (use table LAI; use FVEG = SHDFAC from input) @@ -613,7 +623,15 @@ show some variables in the namelist that must match the SDF.
    • 4: kb inversed
    2 +mosaic_lu +mosaic_soil +isncond_opt +isncovr_opt \b Parameters \b related \b to \b other \b surface \b scheme \b options +lkm +iopt_lake +lakedepth_threshold +lakefrac_threshold nstf_name(5) sfc_nst NSST related paramters:\n
    • nstf_name(1): 0=NSST off, 1= NSST on but uncoupled, 2= NSST on and coupled From 57f72fbc73b9704a23285867645b8927fedc87fb Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Wed, 5 Jul 2023 14:54:28 -0600 Subject: [PATCH 15/81] Scidoc updates --- physics/cu_gf_deep.F90 | 1 + physics/docs/library.bib | 19 +++++++- physics/docs/pdftxt/CU_GF_deep.txt | 28 +++-------- physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt | 33 ++++++++----- physics/docs/pdftxt/suite_input.nml.txt | 58 ++++++++++++++++------- physics/satmedmfvdifq.F | 12 +++-- 6 files changed, 92 insertions(+), 59 deletions(-) diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 67dd9bd3f..1b30063bd 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -28,6 +28,7 @@ module cu_gf_deep integer, parameter :: autoconv=1 !2 integer, parameter :: aeroevap=1 !3 real(kind=kind_phys), parameter :: scav_factor = 0.5 + real(kind=kind_phys), parameter :: dx_thresh = 6500. !> still 16 ensembles for clousres integer, parameter:: maxens3=16 diff --git a/physics/docs/library.bib b/physics/docs/library.bib index 7c01fbc65..34bb54e8f 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -1,13 +1,30 @@ %% This BibTeX bibliography file was created using BibDesk. %% https://bibdesk.sourceforge.io/ -%% Created for Man Zhang at 2023-06-07 10:17:09 -0600 +%% Created for Man Zhang at 2023-06-28 14:13:48 -0600 %% Saved with string encoding Unicode (UTF-8) +@article{Chen_2022, + author = {Xiaomin Chen and George H. Bryan and Andrew Hazelton and Frank D. Marks and Pat Fitzpatrick}, + date-added = {2023-06-28 14:13:19 -0600}, + date-modified = {2023-06-28 14:13:19 -0600}, + doi = {10.1175/waf-d-21-0168.1}, + journal = {Weather and Forecasting}, + month = {jun}, + number = {6}, + pages = {935--951}, + publisher = {American Meteorological Society}, + title = {Evaluation and Improvement of a {TKE}-Based Eddy-Diffusivity Mass-Flux ({EDMF}) Planetary Boundary Layer Scheme in Hurricane Conditions}, + url = {https://doi.org/10.1175%2Fwaf-d-21-0168.1}, + volume = {37}, + year = 2022, + bdsk-url-1 = {https://doi.org/10.1175%2Fwaf-d-21-0168.1}, + bdsk-url-2 = {https://doi.org/10.1175/waf-d-21-0168.1}} + @article{Lin_2022, author = {Jialin Lin and Taotao Qian and Peter Bechtold and Georg Grell and Guang J. Zhang and Ping Zhu and Saulo R. Freitas and Hannah Barnes and Jongil Han}, date-added = {2023-06-07 10:16:46 -0600}, diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index 365ba9ae0..1a02516f7 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -16,41 +16,25 @@ statistical mass flux characteristic of deep, congestus, and shallow (respective a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived from the PDF's. The deep and congestus convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ). However, the shallow convection is not scale-aware. Aerosol dependence is implemented through dependence of rain generation and evaporation formulations depending on the cloud concentration nuclei at cloud base (Berry 1968 \cite berry_1968, -Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. Aerosol dependence is considered experimental and -is turned off at this point. GF is able to transport tracers. +Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. Aerosol dependence is considered experimental and is turned off at this point. GF is able to transport tracers. +Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added,and they are used only for the RAP suite. -\b CCPP \b v6.0.0 \b Updates: - -- GPU capabilities have been added -- Cap suppressing (\p do_cap_suppress) based on radar data assimilation has been added. This is used only for the RAP suite -- Some fixed parameters have been made scale-aware -- Updated coupling between radiation and convection has been implemented - -\b Operational \b Impacts \b in \b RAP/HRRR - - - Uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes - - Takes parameterization uncertainty into account by allowing parameters from multiple convective schemes which can be perturbed -internally or with temporal and spatial correlation patterns - - For higher resolutions (less than 10 km), in addition to scale awareness as in Arakawa et al. (2011) \cite Arakawa_2011 GF can -transition as grid spacing decreases into a shallow convection scheme - - Coupled to the grid scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated -precipitating convective cloud and shallow convective clouds +The impacts of GF scheme in operational RAP/HRRR include:(a)uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes; +(b)takes parameterization uncertainty into account by allowing parameters from multiple convective schemes which can be perturbed +internally or with temporal and spatial correlation patterns; (c)for higher resolutions (less than 10 km), in addition to scale awareness as in Arakawa et al. (2011) \cite Arakawa_2011 GF can transition as grid spacing decreases into a shallow convection scheme; (d)Coupled to the grid scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated precipitating convective cloud and shallow convective clouds. \section version_cugf_enh CCPP Physics Updates \version UFS-SRW v3.0.0 -- Updates for aerosol-awareness (experimental) \b The \b Implementation \b of \b GF \b in \b RRFS - +- Updates for aerosol-awareness (experimental) - Scale-awareness is turned off when explicit microphysics is not active anywhere in the column - GF completely is turned off at grid points when MYNN produces shallow convection at that point - Radar reflectivity considers mass flux PDF as well as whether scale-awareness is turned on at the grid point in equation. \b The \b implementation \b of \b GF \b in \b HAFS \b is \b undergoing. - - \section intra_rough_gf Intraphysics Communication The GF scheme passes cloud hydrometeors to the grid-scale microphysics scheme (\ref THOMPSON ) through detrainment from each convective cloud layer containing convective cloud. The detrained condensate interacts with short- and longwave radiation by diff --git a/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt b/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt index 4e00d7c3c..3ae1a0234 100644 --- a/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt +++ b/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt @@ -25,27 +25,34 @@ to take into account nonlocal transport by large eddies(mfpbltq.f) - A new mass-flux paramterization for stratocumulus-top-induced turbulence mixing has been introduced (mfscuq.f; previously, it was an eddy diffusion form) - For local turbulence mixing, a TKE closure model is used. - - -\section v6_pbl_enh CCPP Physics Updates -\version CCPP v6.0.0 - -- Wind shear effect in characteristic mixing length calculation is included, which +- Wind shear effect in characteristic mixing length calculation is included, which reduces the mixing length in a strong shear environment such as a hurricane. -- To better predict surface inversion as well as capping inversion near the PBL top, -background diffusivity in the inversion layers is reduced as a function of surface +- To better predict surface inversion as well as capping inversion near the PBL top, +background diffusivity in the inversion layers is reduced as a function of surface roughness and green vegetation fraction. -- To reduce the PBL overgrowth, the PBL updraft overshoot is not only limited by -bulk Richardson number-based-PBL depth, but the virtual potential temperature at -top of the surface layer rather than that at the model first layer is also used as -the near-surface virtual potential temperature in the bulk-Richardson number +- To reduce the PBL overgrowth, the PBL updraft overshoot is not only limited by +bulk Richardson number-based-PBL depth, but the virtual potential temperature at +top of the surface layer rather than that at the model first layer is also used as +the near-surface virtual potential temperature in the bulk-Richardson number computation. This helps to largely suppress the unrealistic widespread popcorn-like precipitation. - Updraft entrainment rates for moisture, hydrometeors, and tracers are increased by about 30%. -- A positive definite total variation diminishing (TVD) mass-flux transport scheme for moisture, hydrometeors, +- A positive definite total variation diminishing (TVD) mass-flux transport scheme for moisture, hydrometeors, and tracers and a method for removing negative tracer mixing ratio values have been implemented. \sa NCEP Office Note 505 \cite https://doi.org/10.25923/cybh-w893 and 506 \cite https://doi.org/10.25923/5051-3r70 + +\section v6_pbl_enh CCPP Physics Updates +\version UFS-SRW v3.0.0 +- To reduce the negative hurricane intensity biases, a parameterization for environmental wind shear effect +is included in the GFS TKE-EDMF PBL and cumulus schemes. In addition, the entrainment rates are enhanced +proportional to the sub-cloud or PBL mean TKE (turbulent kinetic energy) when TKE is larger than a threshold +value. + +- To enhance the underestimated CAPE forecasts in the GFS, the entrainment rate in the TKE-EDMF PBL scheme is +increased as a function of vegetation fraction and surface roughness length. + + \section intra_satmedmfvdifq Intraphysics Communication - \ref arg_table_satmedmfvdifq_run diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index 11d33db1c..e986fc322 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -222,10 +222,13 @@ show some variables in the namelist that must match the SDF. xkzm_h \ref satmedmfvdifq background vertical diffusion for heat and q 1.0d0 xkzm_m \ref satmedmfvdifq background vertical diffusion for momentum 1.0d0 xkzm_s \ref satmedmfvdifq sigma threshold for background mom. diffusion 1.0d0 -dspfac \ref satmedmfvdifq TKE dissipative heating factor 1.0 +dspfac \ref satmedmfvdifq TKE dissipative heating factor 1.0 bl_upfr \ref satmedmfvdifq updraft fraction in boundary layer mass flux scheme 0.13 bl_dnfr \ref satmedmfvdifq downdraft fraction in boundary layer mass flux scheme 0.1 -grav_settling mynnedmf_wrapper flag to activate gravitational settling of cloud droplets as described in Nakanishi (2000) \cite nakanishi_2000 0 +rlmx \ref satmedmfvdifq maximum allowed mixing length in boundary layer mass flux scheme 300. +elmx \ref satmedmfvdifq maximum allowed dissipation mixing length in boundary layer mass flux scheme 300. +sfc_rlm \ref satmedmfvdifq choice of near surface mixing lenghth in boundary layer mass flux scheme 0 +tc_pbl \ref satmedmfvdifq control for TC applications in the PBL scheme 0 bl_mynn_mixlength mynnedmf_wrapper flag for different version of mixing length formulation \n
      • 0: Original form from Nakanishi and Niino (2009) \cite NAKANISHI_2009 . NO scale-awareness is applied to the master mixing length, regardless of "scaleware" setting @@ -518,7 +521,6 @@ show some variables in the namelist that must match the SDF.
      • 5: MODIS-RUC (21 category, NOAH WRFv4 only)
      2 -nvegcat isot lsm_noah, lsm_ruc, \ref noahmpdrv flag for soil type dataset choice:\n
      • 0: Zobler soil type (9 category) @@ -616,22 +618,42 @@ show some variables in the namelist that must match the SDF.
      1 iopt_trs \ref noahmpdrv options for thermal roughness scheme:\n -
        -
      • 1: z0h=z0m -
      • 2: canopy based czil -
      • 3: ec -
      • 4: kb inversed -
      - 2 -mosaic_lu -mosaic_soil -isncond_opt -isncovr_opt +
        +
      • 1: z0h=z0m +
      • 2: canopy based czil +
      • 3: ec +
      • 4: kb inversed +
      + 2 +mosaic_lu \ref lsm_ruc control for use of fractional landuse in RUC land surface model +
        +
      • 1: use of fractional landuse in RUC LSM +
      + 0 +mosaic_soil \ref lsm_ruc control for use of fractional soil in RUC land surface model +
        +
      • 1: use of fractional soil in RUC LSM +
      + 0 +isncond_opt \ref lsm_ruc control for soil thermal conductivity option in RUC land surface model +
        +
      • 1: constant +
      • 2: Sturm et al.(1997) \cite sturm_1997 +
      + 1 +isncovr_opt \ref lsm_ruc control for snow cover fraction option in RUC land surface model +
        +
      • 1: original formulation using threshold snow depth to compute snow fraction +
      • 2: Niu-Yang(2007) \cite Niu_2007 +
      • 3: updated Niu-Yang similar to Noah MP +
      + 1 \b Parameters \b related \b to \b other \b surface \b scheme \b options -lkm -iopt_lake -lakedepth_threshold -lakefrac_threshold +lkm \ref clm_lake 0: no lake; 1: lake; 2: lake&nsst 0 +iopt_lake \ref clm_lake 1: flake; 2: CLM lake 2 +lakedepth_threshold \ref clm_lake lakedepth must be greater than this value to enable a lake model 1.0 +lakefrac_threshold \ref clm_lake lakefrac must be greater than this value to enable a lake model 0.0 +use_lake2m \ref clm_lake use 2m T&Q from CLM lake model .false. nstf_name(5) sfc_nst NSST related paramters:\n
      • nstf_name(1): 0=NSST off, 1= NSST on but uncoupled, 2= NSST on and coupled diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 75925a5f3..73fc4aff8 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -22,7 +22,7 @@ module satmedmfvdifq !! and to reduce the negative wind speed bias in upper troposphere !! !! Incorporate the LES-based changes for TC simulation -!! (Chen et al.,2022, https://doi.org/10.1175/WAF-D-21-0168.1) +!! (Chen et al.,2022 \cite Chen_2022) !! with additional improvements on MF working with Cu schemes !! Xiaomin Chen, 5/2/2022 !! @@ -443,7 +443,9 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & endif enddo ! -! compute a function for green vegetation fraction and surface roughness +!> - Compute a function for green vegetation fraction and surface roughness. +!! Entrainment rate in updraft is a function of vegetation fraction and surface +!! roughness length ! do i = 1,im tem = (sigmaf(i) - vegflo) / (vegfup - vegflo) @@ -745,7 +747,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & endif enddo ! -! compute mean tke within pbl +!> - Compute mean tke within pbl ! do i = 1, im sumx(i) = 0. @@ -766,8 +768,8 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & endif enddo ! -! compute wind shear term as a sink term for updraft and downdraft -! velocity +!> - Compute wind shear term as a sink term for updraft and downdraft +!! velocity ! kps = max(kmpbl, kmscu) do k = 2, kps From 8cd25865431326adcb0baba7cf692124abcea5d7 Mon Sep 17 00:00:00 2001 From: Man Zhang Date: Thu, 13 Jul 2023 10:45:18 -0600 Subject: [PATCH 16/81] narrative description for previous update --- physics/docs/pdftxt/GFS_SAMFdeep.txt | 2 -- physics/docs/pdftxt/THOMPSON.txt | 9 ++++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/physics/docs/pdftxt/GFS_SAMFdeep.txt b/physics/docs/pdftxt/GFS_SAMFdeep.txt index d41763c37..1112cb05c 100644 --- a/physics/docs/pdftxt/GFS_SAMFdeep.txt +++ b/physics/docs/pdftxt/GFS_SAMFdeep.txt @@ -65,8 +65,6 @@ rain conversion rate, entrainment and detrainment rates, overshooting layers, and maximum allowable cloudbase mass flux (as of June 2018). -\b CCPP \b v6.0.0 \b Updates - \subsection ca_page Cellular Automata Stochastic Convective Organization Scheme \b Scientific \b Background diff --git a/physics/docs/pdftxt/THOMPSON.txt b/physics/docs/pdftxt/THOMPSON.txt index fed003ebd..4ad481887 100644 --- a/physics/docs/pdftxt/THOMPSON.txt +++ b/physics/docs/pdftxt/THOMPSON.txt @@ -70,10 +70,8 @@ for the model to provide useful guidance for aircraft icing forecasts - Can account for cloud phase changes and provides a sound physical basis for diagnosing precipitation type reaching the ground -\section v6_enh_thompson CCPP Physics Updates -\version CCPP v6.0.0 -Three mechanisms are available improve the stability of the scheme for weather forecast applications: +Recently, three mechanisms have been implemented to improve the stability of the scheme for weather forecast applications: \a inner \a loop, \a subcycle, and \a semi-Lagrangian \a sedimentation \a of \a rain \a and \a graupel. The inner loop and the subcycle are similar in that the physics time step is subdivided and the scheme is activated more often than others in the physics suite. However, they differ in implementation. @@ -82,9 +80,10 @@ Conversely, the subcycle method is controlled by CCPP Framework through the "sub The two methods should be used exclusively. The Semi-Lagrangian sedimentation of rain and graupel (based on Juang and Hong 2010 \cite Henry_Juang_2010 ) increases numerical stability by applying the subtime step only to sedimentation computation. Two namelist variables control the usage of the semi-Lagrangian sedimentation, \p sedi_semi and \p decfl. -\p sedi_semi is set to ‘true’ to activate the method. Decfl is a parameter that needs to avoid deformation of the arriving grids, currently, "10". +\p sedi_semi is set to ‘true’ to activate the method. \p Decfl is a parameter that needs to avoid deformation of the arriving grids, currently, "10". -\version SRW v3.0.0 +\section v6_enh_thompson CCPP Physics Updates +\version UFS-SRW v3.0.0 - The ice generation supersaturation requirement for nonaerosol option is reduced from 0.25 to 0.15. The purpose is to generate more ice in the upper level and reduce the OLR bias. From 2a56d372655acc6bf0a7da4fa0ccff3beb6727cf Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Fri, 30 Jun 2023 13:39:16 -0600 Subject: [PATCH 17/81] Host large images remotely --- physics/docs/pdftxt/CLM_LAKE.txt | 6 +++--- physics/docs/pdftxt/RUCLSM.txt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/docs/pdftxt/CLM_LAKE.txt b/physics/docs/pdftxt/CLM_LAKE.txt index e0a8d9209..d78244cb2 100644 --- a/physics/docs/pdftxt/CLM_LAKE.txt +++ b/physics/docs/pdftxt/CLM_LAKE.txt @@ -36,7 +36,7 @@ in the UFS SRW App, is capable of capturing the effect of lakes on regional heat Lake depths for the RRFS lake configuration (Fig.1) are assigned from a global dataset provided by Kourzeneva et al.(2012) \cite Kourzeneva_2012, this dataset is referred to as GLOBv3 bathymetry in the UFS_UTL. -\image html Lake_depths_RRFS3km.png "Figure 1: Lake depths for lakes in the 3-km RRFS domain." width=600 +@image html https://user-images.githubusercontent.com/12705538/250180794-76af93a2-a7ba-4e9a-9478-5657198862b8.png "Figure 1: Lake depths for lakes in the 3-km RRFS domain." width=600 To cold-start the CLM lake model in the UFS SRW App: - Use the CLM option in the input.nml @@ -48,8 +48,8 @@ To cold-start the CLM lake model in the UFS SRW App: - Lake ice at the top level is initialized from the GFS ice concentration The differences of surface variables from the experimental RRFS 6-h forecast with/without CLM lake model are shown in Figure 2 for 2-m temperature and in Figure 3 for 2-m dewpoint. -\image html diff_t2m_lake_rrfs.png "Figure 2: Differences of 2-m temperature between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 -\image html diff_td2m_lake_rrfs.png "Figure 3: Differences of 2-m dew point between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 +@image html https://user-images.githubusercontent.com/12705538/250180790-63159300-33f6-4b34-9e9c-b65885213c30.png "Figure 2: Differences of 2-m temperature between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 +@image html https://user-images.githubusercontent.com/12705538/250180787-8fc9a820-5f80-4f06-b50a-88b2d20ebc53.png "Figure 3: Differences of 2-m dew point between the RRFS coupled to the CLM model and the RRFS without CLM." width=600 diff --git a/physics/docs/pdftxt/RUCLSM.txt b/physics/docs/pdftxt/RUCLSM.txt index 7a39faf84..a836e7b93 100644 --- a/physics/docs/pdftxt/RUCLSM.txt +++ b/physics/docs/pdftxt/RUCLSM.txt @@ -43,7 +43,7 @@ to determine the uncertainty range for the selected parameters in the RUC LSM. ## RUC LSM characteristics that differ from Noah LSM: \image html ruc_lsm_veg_soil.png "Figure 1: RUC LSM Vegetation and Soil Model (Courtesy of T.G. Smirnova) " width=900 -\image html ruc_ranking.png "Figure 2: Model ranking as a function of normalized root mean square error of snow water equivalent and surface temperature (Courtesy of C. Menard)" width=900 +@image html https://user-images.githubusercontent.com/12705538/250180784-d50a3d4c-93db-4d8d-b12d-2c0ca22da5c3.png "Figure 2: Model ranking as a function of normalized root mean square error of snow water equivalent and surface temperature (Courtesy of C. Menard)" width=900 - \b Implicit \b solution of energy and moisture budgets in the layer spanning the ground surface - \b 9 \b soil \b levels with high vertical resolution near surface RUC LSM has more levels in soil than \ref GFS_NOAH model with higher resolution near the interface with the atmosphere @@ -80,7 +80,7 @@ Snow forms additional two layers on top of soil in RUC LSM \image html ruc_lsm_mosaic.png "Figure 4: 'Mosaic' approach for patchy snow (Courtesy of T.G. Smirnova) " width=900 - New: additional options to compute snow cover fraction (\p isncovr_opt =2 and 3, Niu and Yang (2007) \cite Niu_2007). These options allowed to reduce overprediction of number of grid cells fully covered with snow which further reduced cold-biases over snow. Figure 5 demonstrates that option 3 of snow cover fraction computation (\p isncovr_opt = 3) in the UFS-based regional model matches better the satellite data for the test case on 6 February 2022. - New: added an option to use of a new formulation of snow thermal conductivity (\p isncond_opt = 2, Sturm et al. (1997) \cite sturm_1997); -\image html sncov_rrfs_ruc.png "Figure 5: Snow cover fraction from MODIS (a,b), Regional UFS-based system (RRFS) original (c), and modified with isncover_opt=3 (d), 6 February 2022. (Courtesy of T.G. Smirnova)" width=900 +@image html https://user-images.githubusercontent.com/12705538/250180782-925303ec-7751-4d7e-be8f-b3f1323f35d4.png "Figure 5: Snow cover fraction from MODIS (a,b), Regional UFS-based system (RRFS) original (c), and modified with isncover_opt=3 (d), 6 February 2022. (Courtesy of T.G. Smirnova)" width=900 - Iterative snow melting algorithm; - Density of snow on the ground - a function of compaction parameter and snow depth and temperature; - Snow albedo - a function of temperature and snow fraction; From 9e35de10adecef6bdb21a53ea6d9e5350384c60c Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 24 Jul 2023 15:03:57 +0000 Subject: [PATCH 18/81] Changes to logging and initialization of the CLM Lake Model. 1. Use ice thickness hice(i) to find the level in the lake where ice is zero. 2. Do not allow lake temperature to be below freezing point if there is no ice. 3. If there is no snow or ice, do not allow surface lake temperature to be below freezing point. These changes fixed the problem with large errors in the energy budget at the beginning of the cold-start run with lakes. 4. Added flag to turn on debug print statements in the CLM lake model. --- physics/clm_lake.f90 | 295 ++++++++++++++++++++++++----------- physics/clm_lake.meta | 14 ++ physics/module_sf_ruclsm.F90 | 2 + 3 files changed, 223 insertions(+), 88 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 4fc4112ce..21843af58 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -42,6 +42,7 @@ MODULE clm_lake integer, parameter, public :: kind_lake = kind_dbl_prec logical :: LAKEDEBUG = .false. ! Enable lots of checks and debug prints and errors + logical :: DEBUG_PRINT = .false. ! Enable lots of checks and debug prints and errors logical, parameter :: PERGRO = .false. @@ -167,7 +168,7 @@ logical function limit_temperature_by_climatology(xlat_d,xlon_positive) .not. (xlon_d.gt.-112.104 .and. xlon_d.lt.-112.100))then if(xlat_d.gt.39.5 .and. xlat_d.lt.41.22) then - if(lakedebug) then + if(debug_print) then print *,'The Great Salt Lake south of 41.22 N, lat,lon',xlat_d,xlon_d endif limit_temperature_by_climatology = .true. @@ -175,7 +176,7 @@ logical function limit_temperature_by_climatology(xlat_d,xlon_positive) elseif(( xlat_d.ge.41.22 .and. xlat_d.lt.42.) .and. .not. & ! excludes Willard Bay (xlat_d.gt.41.352 .and. xlat_d.lt.41.354)) then - if(lakedebug) then + if(debug_print) then print *,'The Great Salt Lake north of 41.22 N xlat_d,xlon_d ',xlat_d,xlon_d endif !print *,'Ice fraction on the GSL ', i,j,lake_icefrac3d(i,:,j) @@ -200,30 +201,31 @@ subroutine is_salty(xlat_d,xlon_positive, cannot_freeze, salty) xlon_d = xlon_positive if(xlon_d>180) xlon_d = xlon_d - 360 + ! for the Great Salt Lake cannot_freeze = limit_temperature_by_climatology(xlat_d,xlon_d) salty = cannot_freeze - other_locations: if(include_all_salty_locations) then ! --- The Mono Lake in California, salinity is 75 ppt with freezing point at ! --- -4.2 C (Stan). The Mono Lake lat/long (37.9-38.2, -119.3 - 118.8) if (xlon_d.gt.-119.3.and. xlon_d.lt.-118.8) then if(xlat_d.gt.37.9 .and. xlat_d.lt.38.2) then salty = .true. - if(lakedebug) then + if(debug_print) then print *,'Salty Mono Lake, i,j',xlat_d,xlon_d endif endif ! xlat_d endif ! xlon_d + other_locations: if(include_all_salty_locations) then ! --- Caspian Sea and Dead Sea are salty too (Sam, Tanya) if ( xlat_d>36.5_kind_phys .and. xlat_d<47.1_kind_phys .and. xlon_d>46.8_kind_phys .and. xlon_d<55.0_kind_phys ) then - if(lakedebug) then + if(debug_print) then print *,'Salty Caspian Sea ',xlat_d,xlon_d endif salty = .true. end if if ( xlon_d>35.3 .and. xlon_d<35.6 .and. xlat_d>31.3 .and. xlat_d<31.8) then - if(lakedebug) then + if(debug_print) then print *,'Salty Dead Sea ',xlat_d,xlon_d endif salty = .true. @@ -239,7 +241,7 @@ end subroutine is_salty !! SUBROUTINE clm_lake_run( & ! Model time and metadata: - im, km, me, master, fhour, IDATE, kdt, & + flag_restart, im, km, me, master, fhour, IDATE, kdt, & ! Configuration and initialization: iopt_lake, iopt_lake_clm, min_lakeice, lakedepth_default, use_lakedepth, & @@ -280,6 +282,7 @@ SUBROUTINE clm_lake_run( & ! ! Model time and metadata: ! + LOGICAL , INTENT (IN) :: flag_restart INTEGER , INTENT (IN) :: im,km,me,master INTEGER, INTENT(IN) :: IDATE(4), kdt REAL(KIND_PHYS), INTENT(IN) :: fhour @@ -300,7 +303,7 @@ SUBROUTINE clm_lake_run( & ! REAL(KIND_PHYS), DIMENSION(:), INTENT(IN):: & tg3, pgr, zlvl, qvcurr, xlat_d, xlon_d, ch, cm, & - dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, & + dlwsfci, dswsfci, oro_lakedepth, wind, rho0, & rainncprv, raincprv REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter @@ -311,7 +314,7 @@ SUBROUTINE clm_lake_run( & ! REAL(KIND_PHYS), DIMENSION(:), INTENT(INOUT) :: & evap_wat, evap_ice, hflx_wat, hflx_ice, gflx_wat, gflx_ice, & - ep1d_water, ep1d_ice, tsurf_water, tsurf_ice, tsfc_wat, tisfc, & + ep1d_water, ep1d_ice, tsurf_water, tsurf_ice, tsfc_wat, tisfc, tsfc, & weasdi, snodi, hice, qss_water, qss_ice, & cmm_water, cmm_ice, chh_water, chh_ice, & uustar_water, uustar_ice, lake_t_snow, albedo, zorlw, & @@ -451,6 +454,7 @@ SUBROUTINE clm_lake_run( & dtime=dtp ! Initialize any uninitialized lake points. + if(.not.flag_restart) then call lakeini(kdt=kdt, ISLTYP=ISLTYP, gt0=gt0, snowd=snowd, weasd=weasd, & lakedepth_default=lakedepth_default, fhour=fhour, & oro_lakedepth=oro_lakedepth, savedtke12d=savedtke12d, snowdp2d=snowdp2d, & @@ -458,7 +462,7 @@ SUBROUTINE clm_lake_run( & lake_icefrac3d=lake_icefrac3d, z_lake3d=z_lake3d, dz_lake3d=dz_lake3d, & t_soisno3d=t_soisno3d, h2osoi_ice3d=h2osoi_ice3d, h2osoi_liq3d=h2osoi_liq3d, & h2osoi_vol3d=h2osoi_vol3d, z3d=z3d, dz3d=dz3d, zi3d=zi3d, watsat3d=watsat3d, & - csol3d=csol3d, tkmg3d=tkmg3d, fice=fice, min_lakeice=min_lakeice, & + csol3d=csol3d, tkmg3d=tkmg3d, fice=fice, hice=hice, min_lakeice=min_lakeice, & tsfc=tsfc, & use_lake_model=use_lake_model, use_lakedepth=use_lakedepth, tkdry3d=tkdry3d, & tksatu3d=tksatu3d, im=im, prsi=prsi, xlat_d=xlat_d, xlon_d=xlon_d, & @@ -480,6 +484,7 @@ SUBROUTINE clm_lake_run( & errflg=1 return endif + endif ! .not. restart lake_points=0 snow_points=0 @@ -498,14 +503,14 @@ SUBROUTINE clm_lake_run( & wght2 = day_of_month/month_length(month) if(wght2<0 .or. wght2>1) then - if(lakedebug) then + if(debug_print) then write(0,*) 'Warning: wght2 is not 0..1: ',wght2 endif wght2 = max(0.0_kind_lake,min(1.0_kind_lake,wght2)) endif wght1 = 1.0_kind_lake - wght2 - if(LAKEDEBUG .and. me==0) then + if(debug_print ) then print *,'month,num1,num2,wght1,wght2',month,num1,num2,wght1,wght2 endif @@ -516,13 +521,13 @@ SUBROUTINE clm_lake_run( & call is_salty(xlat_d(i),xlon_d(i),salty_flag,cannot_freeze_flag) if(salty_flag) then - salty(i) = 1 + salty(i) = 1 ! The Great Salt Lake and Mono Lake else salty(i) = 0 endif if(cannot_freeze_flag) then - cannot_freeze(i) = 1 + cannot_freeze(i) = 1 ! only the Great Salt Lake else cannot_freeze(i) = 0 endif @@ -570,13 +575,7 @@ SUBROUTINE clm_lake_run( & t_grnd(c) = t_grnd2d(i) do k = 1,nlevlake t_lake(c,k) = t_lake3d(i,k) - !-- If T of salty lakes is above the freezing point, keep them ice free - if(salty(i)==1 .and. t_lake(c,k) > tfrz .and. lake_icefrac3d(i,k) > 0.) then - lake_icefrac(c,k) = 0. - else - lake_icefrac(c,k) = lake_icefrac3d(i,k) - endif - !lake_icefrac(c,k) = lake_icefrac3d(i,k) + lake_icefrac(c,k) = lake_icefrac3d(i,k) z_lake(c,k) = z_lake3d(i,k) dz_lake(c,k) = dz_lake3d(i,k) enddo @@ -633,23 +632,29 @@ SUBROUTINE clm_lake_run( & do c = 1,column if(cannot_freeze(i) == 1) then - t_grnd(c) = max(274.5_kind_lake,t_grnd(c)) + ! The Great Salt Lake do k = 1,nlevlake - t_lake(c,k) = max(274.5_kind_lake,t_lake(c,k)) - lake_icefrac(c,k) = 0. + lake_icefrac(c,k) = 0._kind_lake enddo - endif - - if(salty(i)/=0) then - Tclim = tfrz + wght1*saltlk_T(num1) & - + wght2*saltlk_T(num2) - if(lakedebug) print *,'Tclim,tsfc,t_lake3d',i,Tclim,t_grnd(c),t_lake(c,:),t_soisno(c,:) - t_grnd(c) = min(Tclim+3.0_kind_lake,(max(t_grnd(c),Tclim-3.0_kind_lake))) - do k = 1,nlevlake - t_lake(c,k) = min(Tclim+3.0_kind_lake,(max(t_lake(c,k),Tclim-3.0_kind_lake))) - enddo - t_soisno(c,1) = min(Tclim+3.0_kind_lake,(max(t_soisno(c,1),Tclim-3.0_kind_lake))) - if(lakedebug) print *,'After Tclim,tsfc,t_lake3d',i,Tclim,t_grnd(c),t_lake(c,:),t_soisno(c,:) + ! bound lake temperture with the climatology + Tclim = tfrz + wght1*saltlk_T(num1) & + + wght2*saltlk_T(num2) + if(debug_print) print *,'GSL - Tclim,tsfc,t_lake3d',i,Tclim,t_grnd(c),t_lake(c,:),t_soisno(c,:) + t_grnd(c) = min(Tclim+3.0_kind_lake,(max(t_grnd(c),Tclim-3.0_kind_lake))) + do k = 1,nlevlake + t_lake(c,k) = min(Tclim+3.0_kind_lake,(max(t_lake(c,k),Tclim-3.0_kind_lake))) + enddo + t_soisno(c,1) = min(Tclim+3.0_kind_lake,(max(t_soisno(c,1),Tclim-3.0_kind_lake))) + if(debug_print) print *,'GSL - after Tclim,tsfc,t_lake3d',i,Tclim,t_grnd(c),t_lake(c,:),t_soisno(c,:) + elseif(salty(i) == 1) then + ! Mono Lake never freezes, its temperature is above freezing point = -4.2 C + t_grnd(c) = max(tfrz-4.2_kind_lake,t_grnd(c)) + do k = 1,nlevlake + lake_icefrac(c,k) = 0._kind_lake + t_lake(c,k) = max(tfrz-4.2_kind_lake,t_lake(c,k)) + enddo + t_soisno(c,1) = max(tfrz-4.2_kind_lake,t_soisno(c,1)) + if(debug_print) print *,'Mono - tsfc,t_lake3d',i,t_grnd(c),t_lake(c,:),t_soisno(c,:) endif savedtke12d(i) = savedtke1(c) @@ -689,7 +694,10 @@ SUBROUTINE clm_lake_run( & gflx_wat(I) = eflx_gnet(c) ![W/m/m] upward_heat_flux_in_soil_over_water ep1d_water(i) = eflx_lh_tot(c) ![W/m/m] surface_upward_potential_latent_heat_flux_over_water tsurf_water(I) = t_grnd(c) ![K] surface skin temperature after iteration over water + tsurf_ice(i) = t_grnd(i) ! surface_skin_temperature_after_iteration_over_ice tsfc_wat(i) = t_grnd(c) ![K] surface skin temperature over water + tisfc(i) = t_grnd(c) + tsfc(i) = t_grnd(c) lake_t2m(I) = t_ref2m(c) ![K] temperature_at_2m_from_clm_lake lake_q2m(I) = q_ref2m(c) ! [frac] specific_humidity_at_2m_from_clm_lake albedo(i) = ( 0.6 * lake_icefrac3d(i,1) ) + & ! mid_day_surface_albedo_over_lake @@ -716,7 +724,9 @@ SUBROUTINE clm_lake_run( & cmm_water(i) = cm(i)*wind(i) ! surface_drag_wind_speed_for_momentum_in_air_over_water ice_point: if(fice(i)>=min_lakeice) then + ! Icy lake ! Most ice variables are identical to water variables. + if(debug_print) print *,'Icy xlat_d(i),xlon_d(i),frac_ice,frac_grid ',xlat_d(i),xlon_d(i),frac_ice,frac_grid if(frac_ice .or. frac_grid) then evap_ice(i) = evap_wat(i) ! kinematic_surface_upward_latent_heat_flux_over_ice hflx_ice(i) = hflx_wat(i) ! kinematic_surface_upward_sensible_heat_flux_over_ice @@ -728,11 +738,13 @@ SUBROUTINE clm_lake_run( & ! uustar_ice(i) = uustar_water(i) ! surface_friction_velocity_over_ice endif - tsurf_ice(i) = tsurf_water(i) ! surface_skin_temperature_after_iteration_over_ice + tsurf_ice(i) = t_grnd(i) ! surface_skin_temperature_after_iteration_over_ice tisfc(i) = t_grnd(c) ! surface_skin_temperature_over_ice + tsfc(i) = t_grnd(c) ! surface_skin_temperature_over_ice weasdi(i) = h2osno(c) ! water_equivalent_accumulated_snow_depth_over_ice - snodi(i) = snowdp(c) ! surface_snow_thickness_water_equivalent_over_ice - tsurf_ice(i) = t_grnd(c) ! surface_skin_temperature_after_iteration_over_ice + snodi(i) = snowdp(c)*1.e3 ! surface_snow_thickness_water_equivalent_over_ice + weasd(i) = weasdi(i) + snowd(i) = snodi(c) ! surface_snow_thickness_water_equivalent_over_ice ! Ice points are icy: icy(i)=.true. ! flag_nonzero_sea_ice_surface_fraction @@ -754,8 +766,11 @@ SUBROUTINE clm_lake_run( & icy(i)=.false. weasdi(i) = 0 snodi(i) = 0 + weasd(i) = 0 + snowd(i) = 0 tisfc(i) = t_grnd(c) tsurf_ice(i) = tisfc(i) + tsfc(i) = t_grnd(c) hice(i) = 0 fice(i) = 0 endif ice_point @@ -774,7 +789,7 @@ SUBROUTINE clm_lake_run( & endif if_lake_is_here ENDDO lake_top_loop - if(LAKEDEBUG .and. lake_points>0 .and. (kdt<3 .or. mod(kdt,30)==3)) then + if(debug_print .and. lake_points>0 .and. (kdt<3 .or. mod(kdt,30)==3)) then 3082 format('lake points processed in timestep ',I0,' by rank ',I0,' = ',I0,' snow=',I0,' ice=',I0) print 3082,kdt,me,lake_points,snow_points,ice_points endif @@ -956,7 +971,7 @@ SUBROUTINE LakeMain(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, & !I t_lake,t_soisno,h2osoi_liq, & h2osoi_ice,savedtke1, & watsat, tksatu, tkmg, tkdry, csol, dtime, & - frac_iceold,qflx_snomelt,imelt,errmsg,errflg) + frac_iceold,qflx_snomelt,imelt,errmsg,errflg,xlat_d,xlon_d) if(errflg/=0) then return ! State is invalid now, so pass error to caller. endif @@ -1486,7 +1501,7 @@ SUBROUTINE ShalLakeFluxes(forc_t,forc_pbot,forc_psrf,forc_hgt,forc_hgt_q, qflx_evap_tot(p) = qflx_evap_soi(p) eflx_lh_tot(p) = htvp(c)*qflx_evap_soi(p) eflx_lh_grnd(p) = htvp(c)*qflx_evap_soi(p) - if(LAKEDEBUG) then + if(debug_print) then 1604 format('CLM_Lake ShalLakeFluxes: c=',I0,' sensible heat = ',F12.4,' latent heat =',F12.4, & ' ground temp = ', F12.4, ' h2osno = ', F12.4, ' at xlat_d=',F10.3,' xlon_d=',F10.3) print 1604, c, eflx_sh_tot(p), eflx_lh_tot(p), t_grnd(c), h2osno(c),xlat_d,xlon_d @@ -1564,7 +1579,7 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! t_lake,t_soisno,h2osoi_liq, & h2osoi_ice,savedtke1, & watsat, tksatu, tkmg, tkdry, csol, dtime, & - frac_iceold,qflx_snomelt,imelt,errmsg,errflg) + frac_iceold,qflx_snomelt,imelt,errmsg,errflg,xlat_d,xlon_d) !======================================================================================================= ! !DESCRIPTION: ! Calculates temperatures in the 20-25 layer column of (possible) snow, @@ -1652,6 +1667,7 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! implicit none !in: + real(kind_lake),intent(in) :: xlat_d,xlon_d integer, intent(inout) :: errflg real(kind_lake), intent(in) :: watsat(1,nlevsoil) ! volumetric soil water at saturation (porosity) real(kind_lake), intent(in) :: tksatu(1,nlevsoil) ! thermal conductivity, saturated soil [W/m-K] @@ -2015,6 +2031,15 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! + cfus*dz_lake(c,j)*(1._kind_lake-lake_icefrac(c,j)) !& ! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term t_lake_bef(c,j) = t_lake(c,j) + if(debug_print) then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then + print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d + print *,'j,dz_lake(c,j) ', j,dz_lake(c,j) + print*,'cv_lake(c,j),lake_icefrac(c,j),t_lake(c,j),cfus,ocvts(c)', & + cv_lake(c,j),lake_icefrac(c,j),t_lake(c,j),cfus,ocvts(c) + endif + endif end do end do @@ -2030,6 +2055,15 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! ocvts(c) = ocvts(c) + cv(c,j)*(t_soisno(c,j)-tfrz) & + hfus*h2osoi_liq(c,j) !& ! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term + if(debug_print) then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then + print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d + print *,' j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j) + print *,' cv(c,j),t_soisno(c,j),hfus,ocvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ocvts(c) + print *,' h2osno(c)',h2osno(c) + endif + endif if (j == 1 .and. h2osno(c) > 0._kind_lake .and. j == jtop(c)) then ocvts(c) = ocvts(c) - h2osno(c)*hfus end if @@ -2373,9 +2407,9 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! c = filter_shlakec(fc) if (rhow(c,j) > rhow(c,j+1) .or. & (lake_icefrac(c,j) < 1._kind_lake .and. lake_icefrac(c,j+1) > 0._kind_lake) ) then - if(LAKEDEBUG) then + if(debug_print) then if (i==1) then - print *, 'Convective Mixing in column ', c, '.' + print *, 'Convective Ice Mixing in column ', c, 'lake_icefrac(c,j) ',lake_icefrac(c,j),lake_icefrac(c,j+1) endif endif qav(c) = qav(c) + dz_lake(c,i)*(t_lake(c,i)-tfrz) * & @@ -2447,6 +2481,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! rhow(c,i) = (1._kind_lake - lake_icefrac(c,i)) * & 1000._kind_lake*( 1.0_kind_lake - 1.9549e-05_kind_lake*(abs(t_lake(c,i)-277._kind_lake))**1.68_kind_lake ) & + lake_icefrac(c,i)*denice + if (debug_print .and. lake_icefrac(c,j) > 0.)print *,'rhow(c,i),lake_icefrac(c,i),t_lake(c,i)', & + i,rhow(c,i),lake_icefrac(c,i),t_lake(c,i),denice end if end do end do @@ -2462,7 +2498,7 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! c = filter_shlakec(fc) cv_lake(c,j) = dz_lake(c,j) * (cwat*(1._kind_lake-lake_icefrac(c,j)) + cice_eff*lake_icefrac(c,j)) - if (LAKEDEBUG) then + if (debug_print .and. lake_icefrac(c,j) > 0.) then print *,'Lake Ice Fraction, c, level:', c, j, lake_icefrac(c,j) endif end do @@ -2485,6 +2521,15 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! + cfus*dz_lake(c,j)*(1._kind_lake-lake_icefrac(c,j)) !& ! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term fin(c) = fin(c) + phi(c,j) + if(debug_print) then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then + print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d + print *,' new cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c)', & + j,cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c) + print *,' new dz_lake(c,j),fin(c),phi(c,j)',c,dz_lake(c,j),fin(c),phi(c,j) + endif + endif end do end do @@ -2499,6 +2544,15 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! ncvts(c) = ncvts(c) + cv(c,j)*(t_soisno(c,j)-tfrz) & + hfus*h2osoi_liq(c,j) !& ! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term + if(debug_print) then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then + print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d + print *,'new j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j) + print *,'new cv(c,j),t_soisno(c,j),hfus,ncvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ncvts(c) + print *,'new h2osno(c)',h2osno(c) + endif + endif if (j == 1 .and. h2osno(c) > 0._kind_lake .and. j == jtop(c)) then ncvts(c) = ncvts(c) - h2osno(c)*hfus end if @@ -2514,21 +2568,44 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! p = filter_shlakep(fp) c = pcolumn(p) errsoi(c) = (ncvts(c)-ocvts(c)) / dtime - fin(c) - if( (LAKEDEBUG .and. abs(errsoi(c)) < 1._kind_lake) ) then -! .or. (.not.LAKEDEBUG .and. abs(errsoi(c)) < 10._kind_lake)) then + if(debug_print) then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then + print *,'xlat_d,xlon_d',xlat_d,xlon_d + print *,'errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c)', & + errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c) + endif + endif + if( .not.LAKEDEBUG ) then + if (abs(errsoi(c)) < 10._kind_lake) then + eflx_sh_tot(p) = eflx_sh_tot(p) - errsoi(c) + eflx_sh_grnd(p) = eflx_sh_grnd(p) - errsoi(c) + eflx_soil_grnd(p) = eflx_soil_grnd(p) + errsoi(c) + eflx_gnet(p) = eflx_gnet(p) + errsoi(c) + if(debug_print) then + if (abs(errsoi(c)) > 1.e-1_kind_lake) then + print *,'errsoi incorporated at xlat_d,xlon_d',xlat_d,xlon_d + print *,'errsoi incorporated into sensible heat in ShalLakeTemperature: c, (W/m^2):', c, errsoi(c) + end if + endif + errsoi(c) = 0._kind_lake + endif + elseif ( LAKEDEBUG) then + if (abs(errsoi(c)) < 1._kind_lake) then eflx_sh_tot(p) = eflx_sh_tot(p) - errsoi(c) eflx_sh_grnd(p) = eflx_sh_grnd(p) - errsoi(c) eflx_soil_grnd(p) = eflx_soil_grnd(p) + errsoi(c) eflx_gnet(p) = eflx_gnet(p) + errsoi(c) - ! if (abs(errsoi(c)) > 1.e-3_kind_lake) then if (abs(errsoi(c)) > 1.e-1_kind_lake) then print *,'errsoi incorporated into sensible heat in ShalLakeTemperature: c, (W/m^2):', c, errsoi(c) end if errsoi(c) = 0._kind_lake - else if(LAKEDEBUG) then + else print *,'Soil Energy Balance Error at column, ', c, 'G, fintotal, column E tendency = ', & - eflx_gnet(p), fin(c), (ncvts(c)-ocvts(c)) / dtime - end if + eflx_gnet(p), fin(c), (ncvts(c)-ocvts(c)) / dtime,'xlat_d,xlon_d',xlat_d,xlon_d + print *,'ncvts(c),ocvts(c),dtime,errsoi(c)',ncvts(c),ocvts(c),dtime,errsoi(c),'xlat_d,xlon_d',xlat_d,xlon_d + end if + end if ! LAKEDEBUG end do ! This loop assumes only one point per column. @@ -3483,7 +3560,7 @@ subroutine ShalLakeHydrology(dz_lake,forc_rain,forc_snow, & h2osno(c) = 0._kind_lake snl(c) = 0 ! The rest of the bookkeeping for the removed snow will be done below. - if (LAKEDEBUG) then + if (debug_print) then print *,'Snow layers removed above unfrozen lake for column, snowice:', & c, sumsnowice(c) endif @@ -3633,7 +3710,7 @@ subroutine ShalLakeHydrology(dz_lake,forc_rain,forc_snow, & ! Insure water balance using qflx_qrgwl qflx_qrgwl(c) = forc_rain(g) + forc_snow(g) - qflx_evap_tot(p) - (endwb(c)-begwb(c))/dtime - if (LAKEDEBUG) then + if (debug_print) then print *,'c, rain, snow, evap, endwb, begwb, qflx_qrgwl:', & c, forc_rain(g), forc_snow(g), qflx_evap_tot(p), endwb(c), begwb(c), qflx_qrgwl(c) endif @@ -5141,18 +5218,19 @@ end subroutine MoninObukIni !! subroutine clm_lake_init(con_pi,karman,con_g,con_sbc,con_t0c,rhowater,con_csol,con_cliq, & con_hfus,con_hvap,con_rd,con_cp,rholakeice,clm_lake_debug, & - con_eps_model,con_fvirt_model,errmsg,errflg) + clm_debug_print,con_eps_model,con_fvirt_model,errmsg,errflg) implicit none real(kind_phys), intent(in) :: con_pi,karman,con_g,con_sbc,con_t0c, & rhowater,con_csol,con_cliq, con_hfus,con_hvap,con_rd,con_cp, & rholakeice,con_eps_model,con_fvirt_model INTEGER, INTENT(OUT) :: errflg CHARACTER(*), INTENT(OUT) :: errmsg - logical, intent(in) :: clm_lake_debug + logical, intent(in) :: clm_lake_debug,clm_debug_print integer :: i, j LAKEDEBUG = clm_lake_debug - if(LAKEDEBUG) then + DEBUG_PRINT = clm_debug_print + if(debug_print) then write(0,*) 'clm_lake_init' endif @@ -5249,7 +5327,7 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, z_lake3d, dz_lake3d, t_soisno3d, h2osoi_ice3d, & h2osoi_liq3d, h2osoi_vol3d, z3d, dz3d, & zi3d, watsat3d, csol3d, tkmg3d, & - fice, min_lakeice, tsfc, & + fice, hice, min_lakeice, tsfc, & use_lake_model, use_lakedepth, & tkdry3d, tksatu3d, im, prsi, & xlat_d, xlon_d, clm_lake_initialized, & @@ -5276,7 +5354,7 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, INTEGER , INTENT (IN) :: im, me, master, km, kdt REAL(KIND_PHYS), INTENT(IN) :: min_lakeice, fhour - REAL(KIND_PHYS), DIMENSION(IM), INTENT(INOUT):: FICE + REAL(KIND_PHYS), DIMENSION(IM), INTENT(INOUT):: FICE, hice REAL(KIND_PHYS), DIMENSION(IM), INTENT(IN):: TG3, xlat_d, xlon_d REAL(KIND_PHYS), DIMENSION(IM), INTENT(IN):: tsfc REAL(KIND_PHYS), DIMENSION(IM) ,INTENT(INOUT) :: clm_lake_initialized @@ -5343,6 +5421,8 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, integer :: numb_lak ! for debug character*256 :: message real(kind_lake) :: ht + real(kind_lake) :: rhosn + real(kind_lake) :: depth logical :: climatology_limits @@ -5385,45 +5465,45 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, cycle endif - snowdp2d(i) = snowd(i)*1e-3 ! SNOW in kg/m^2 and snowdp in m - h2osno2d(i) = weasd(i) ! mm - snl2d(i) = defval do k = -nlevsnow+1,nlevsoil h2osoi_liq3d(i,k) = defval h2osoi_ice3d(i,k) = defval - t_soisno3d(i,k) = defval + h2osoi_vol3d(i,k) = defval + t_soisno3d(i,k) = defval z3d(i,k) = defval dz3d(i,k) = defval enddo do k = 1,nlevlake - t_lake3d(i,k) = defval + t_lake3d(i,k) = defval lake_icefrac3d(i,k) = defval z_lake3d(i,k) = defval dz_lake3d(i,k) = defval enddo - if(fice(i)>min_lakeice) then - lake_icefrac3d(i,1) = fice(i) - snowdp2d(i) = snowd(i)*1e-3 ! SNOW in kg/m^2 and snowdp in m - h2osno2d(i) = weasd(i) ! mm - else - fice(i) = 0. - snowd(i) = 0. - weasd(i) = 0. - snowdp2d(i) = 0. - h2osno2d(i) = 0. - endif + if (use_lake_model(i) == 1) then + ! for lake points only + z3d(i,:) = 0.0 + dz3d(i,:) = 0.0 + zi3d(i,:) = 0.0 + h2osoi_liq3d(i,:) = 0.0 + h2osoi_ice3d(i,:) = 0.0 + lake_icefrac3d(i,:) = 0.0 + h2osoi_vol3d(i,:) = 0.0 + snl2d(i) = 0.0 + + if(fice(i)>min_lakeice) then + lake_icefrac3d(i,1) = fice(i) + snowdp2d(i) = snowd(i)*1e-3 ! SNOW in kg/m^2 and snowdp in m + h2osno2d(i) = weasd(i) ! mm + else + fice(i) = 0. + snowd(i) = 0. + weasd(i) = 0. + snowdp2d(i) = 0. + h2osno2d(i) = 0. + endif - z3d(i,:) = 0.0 - dz3d(i,:) = 0.0 - zi3d(i,:) = 0.0 - h2osoi_liq3d(i,:) = 0.0 - h2osoi_ice3d(i,:) = 0.0 - lake_icefrac3d(i,:) = 0.0 - h2osoi_vol3d(i,:) = 0.0 - snl2d(i) = 0.0 - ! Soil hydraulic and thermal properties isl = ISLTYP(i) if (isl == 0 ) isl = 14 @@ -5559,19 +5639,45 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, return endif + if(lake_icefrac3d(i,1) > 0.) then + depth = 0. + do k=2,nlevlake + depth = depth + dz_lake3d(i,k) + if(hice(i) >= depth) then + lake_icefrac3d(i,k) = max(0.,lake_icefrac3d(i,1)+(0.-lake_icefrac3d(i,1))/z_lake3d(i,nlevlake)*depth) + else + lake_icefrac3d(i,k) = 0. + endif + end do + endif t_lake3d(i,1) = tsfc(i) t_grnd2d(i) = tsfc(i) + if (lake_icefrac3d(i,1) <= 0.) then + t_lake3d(i,1) = max(tfrz,tsfc(i)) + t_grnd2d(i) = max(tfrz,tsfc(i)) + endif do k = 2, nlevlake if(z_lake3d(i,k).le.depth_c) then - t_lake3d(i,k) = tsfc(i)+(277.0-tsfc(i))/depth_c*z_lake3d(i,k) + t_lake3d(i,k) = tsfc(i)+(277.2_kind_lake-tsfc(i))/depth_c*z_lake3d(i,k) else - t_lake3d(i,k) = 277.0 + t_lake3d(i,k) = 277.2_kind_lake end if + if (lake_icefrac3d(i,k) <= 0.) then + t_lake3d(i,k) = max(tfrz,t_lake3d(i,k)) + endif enddo ! initial t_soisno3d - t_soisno3d(i,1) = t_lake3d(i,nlevlake) + ! in snow + if(snowdp2d(i) > 0.) then + do k = snl2d(i)+1, 0 + t_soisno3d(i,k) =min(tfrz,tsfc(i)) + enddo + endif + + ! in soil + t_soisno3d(i,1) = t_lake3d(i,nlevlake) t_soisno3d(i,nlevsoil) = tg3(i) do k = 2, nlevsoil-1 t_soisno3d(i,k)=t_soisno3d(i,1)+(t_soisno3d(i,nlevsoil)-t_soisno3d(i,1))*dzsoi(k) @@ -5599,6 +5705,17 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, endif enddo + !tgs - in RAP and HRRR applications with cycled snow depth and snow + !water equivalent, the actual snow density could be computed. This is + !not used for now for consistency with the main Lake subroutine, where + !constant snow density (250.) is used. + if(h2osno2d(i).gt.0. .and. snowdp2d(i).gt.0.) then + rhosn = h2osno2d(i)/snowdp2d(i) + else + rhosn = snow_bd ! bdsno=250. + endif + + do k = -nlevsnow+1, 0 if (k > snl2d(i)) then h2osoi_ice3d(i,k) = dz3d(i,k)*snow_bd @@ -5607,10 +5724,12 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, end do clm_lake_initialized(i) = 1 + + endif !if ( use_lakedepth ) then ENDDO do_init - if(LAKEDEBUG .and. init_points>0) then + if(debug_print .and. init_points>0) then print *,'points initialized in clm_lake',init_points end if diff --git a/physics/clm_lake.meta b/physics/clm_lake.meta index bbaaded16..3de543078 100644 --- a/physics/clm_lake.meta +++ b/physics/clm_lake.meta @@ -7,6 +7,13 @@ [ccpp-arg-table] name = clm_lake_run type = scheme +[flag_restart] + standard_name = flag_for_restart + long_name = flag for restart (warmstart) or coldstart + units = flag + dimensions = () + type = logical + intent = in [im] standard_name = horizontal_loop_extent long_name = horizontal loop extent @@ -935,6 +942,13 @@ type = logical active = (control_for_lake_model_selection == 3) intent = in +[clm_debug_print] + standard_name = flag_for_printing_in_clm_lake_model + long_name = flag for printing in clm lake model + units = flag + dimensions = () + type = logical + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 6294bc068..160127e43 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -991,10 +991,12 @@ SUBROUTINE LSMRUC(xlat,xlon, & if(mosaic_lu == 1) then ! greenness factor: between 0 for min greenness and 1 for max greenness. factor = max(zero,min(one,(vegfra(i,j)-shdmin(i,j))/max(one,(shdmax(i,j)-shdmin(i,j))))) + if (debug_print ) then if (abs(xlat-testptlat).lt.0.1 .and. & abs(xlon-testptlon).lt.0.1)then print *,' lat,lon=',xlat,xlon,' factor=',factor endif + endif if((ivgtyp(i,j) == natural .or. ivgtyp(i,j) == crop) .and. factor > 0.75) then ! cropland or grassland, apply irrigation during the growing seaspon when fraction From 1fae3bc76e90a167e9929b28ec451586cdc42da4 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 27 Jul 2023 19:15:15 +0000 Subject: [PATCH 19/81] some missing changes from last commit --- physics/clm_lake.f90 | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 21843af58..c07773a57 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -454,7 +454,6 @@ SUBROUTINE clm_lake_run( & dtime=dtp ! Initialize any uninitialized lake points. - if(.not.flag_restart) then call lakeini(kdt=kdt, ISLTYP=ISLTYP, gt0=gt0, snowd=snowd, weasd=weasd, & lakedepth_default=lakedepth_default, fhour=fhour, & oro_lakedepth=oro_lakedepth, savedtke12d=savedtke12d, snowdp2d=snowdp2d, & @@ -484,7 +483,6 @@ SUBROUTINE clm_lake_run( & errflg=1 return endif - endif ! .not. restart lake_points=0 snow_points=0 @@ -2032,8 +2030,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! ! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term t_lake_bef(c,j) = t_lake(c,j) if(debug_print) then - if (abs(xlat_d-52.1152).lt.0.1 .and. & - abs(xlon_d-260.405).lt.0.1)then + if (abs(xlat_d-51.393).lt.0.1 .and. & + abs(xlon_d-261.117).lt.0.1)then print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,'j,dz_lake(c,j) ', j,dz_lake(c,j) print*,'cv_lake(c,j),lake_icefrac(c,j),t_lake(c,j),cfus,ocvts(c)', & @@ -2056,8 +2054,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! + hfus*h2osoi_liq(c,j) !& ! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term if(debug_print) then - if (abs(xlat_d-52.1152).lt.0.1 .and. & - abs(xlon_d-260.405).lt.0.1)then + if (abs(xlat_d-51.393).lt.0.1 .and. & + abs(xlon_d-261.117).lt.0.1)then print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,' j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j) print *,' cv(c,j),t_soisno(c,j),hfus,ocvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ocvts(c) @@ -2522,8 +2520,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! ! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term fin(c) = fin(c) + phi(c,j) if(debug_print) then - if (abs(xlat_d-52.1152).lt.0.1 .and. & - abs(xlon_d-260.405).lt.0.1)then + if (abs(xlat_d-51.393).lt.0.1 .and. & + abs(xlon_d-261.117).lt.0.1)then print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,' new cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c)', & j,cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c) @@ -2545,8 +2543,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! + hfus*h2osoi_liq(c,j) !& ! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term if(debug_print) then - if (abs(xlat_d-52.1152).lt.0.1 .and. & - abs(xlon_d-260.405).lt.0.1)then + if (abs(xlat_d-51.393).lt.0.1 .and. & + abs(xlon_d-261.117).lt.0.1)then print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,'new j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j) print *,'new cv(c,j),t_soisno(c,j),hfus,ncvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ncvts(c) @@ -2569,8 +2567,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! c = pcolumn(p) errsoi(c) = (ncvts(c)-ocvts(c)) / dtime - fin(c) if(debug_print) then - if (abs(xlat_d-52.1152).lt.0.1 .and. & - abs(xlon_d-260.405).lt.0.1)then + if (abs(xlat_d-51.393).lt.0.1 .and. & + abs(xlon_d-261.117).lt.0.1)then print *,'xlat_d,xlon_d',xlat_d,xlon_d print *,'errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c)', & errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c) @@ -2603,7 +2601,9 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! else print *,'Soil Energy Balance Error at column, ', c, 'G, fintotal, column E tendency = ', & eflx_gnet(p), fin(c), (ncvts(c)-ocvts(c)) / dtime,'xlat_d,xlon_d',xlat_d,xlon_d - print *,'ncvts(c),ocvts(c),dtime,errsoi(c)',ncvts(c),ocvts(c),dtime,errsoi(c),'xlat_d,xlon_d',xlat_d,xlon_d + print *,'errsoi(c),ncvts(c),ocvts(c)',errsoi(c),ncvts(c),ocvts(c),'xlat_d,xlon_d',xlat_d,xlon_d + print *,'lake_icefrac(c,:),h2osno(c)', lake_icefrac(c,:),h2osno(c) + print *,'t_lake(c,:),t_soisno(c,:)',t_lake(c,:),t_soisno(c,:) end if end if ! LAKEDEBUG end do @@ -5653,23 +5653,34 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, t_lake3d(i,1) = tsfc(i) t_grnd2d(i) = tsfc(i) + + ! initial lake temperature if (lake_icefrac3d(i,1) <= 0.) then - t_lake3d(i,1) = max(tfrz,tsfc(i)) - t_grnd2d(i) = max(tfrz,tsfc(i)) + ! no ice + t_lake3d(i,1) = max(tfrz,t_lake3d(i,1)) + t_grnd2d(i) = t_lake3d(i,1) + elseif (lake_icefrac3d(i,1) > 0. .and. lake_icefrac3d(i,1) < 1.) then + ! fractional ice + t_lake3d(i,1) = tfrz endif + do k = 2, nlevlake if(z_lake3d(i,k).le.depth_c) then - t_lake3d(i,k) = tsfc(i)+(277.2_kind_lake-tsfc(i))/depth_c*z_lake3d(i,k) + t_lake3d(i,k) = t_lake3d(i,1)+(277.2_kind_lake-t_lake3d(i,1))/depth_c*z_lake3d(i,k) + if (lake_icefrac3d(i,1) <= 0.) then + ! no ice + t_lake3d(i,k) = max(tfrz,t_lake3d(i,k)) + elseif (lake_icefrac3d(i,1) > 0. .and. lake_icefrac3d(i,1) < 1.) then + ! fractional ice + t_lake3d(i,k) = tfrz + endif else t_lake3d(i,k) = 277.2_kind_lake end if - if (lake_icefrac3d(i,k) <= 0.) then - t_lake3d(i,k) = max(tfrz,t_lake3d(i,k)) - endif enddo ! initial t_soisno3d - ! in snow + ! in snow on ice if(snowdp2d(i) > 0.) then do k = snl2d(i)+1, 0 t_soisno3d(i,k) =min(tfrz,tsfc(i)) From 180c43b9ccd6dc268d79fccfafcb83cf5b4917f6 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 27 Jul 2023 21:09:05 +0000 Subject: [PATCH 20/81] yet more changes missing in prior commits --- physics/clm_lake.f90 | 45 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index c07773a57..262bad4e6 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -2030,8 +2030,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! ! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term t_lake_bef(c,j) = t_lake(c,j) if(debug_print) then - if (abs(xlat_d-51.393).lt.0.1 .and. & - abs(xlon_d-261.117).lt.0.1)then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,'j,dz_lake(c,j) ', j,dz_lake(c,j) print*,'cv_lake(c,j),lake_icefrac(c,j),t_lake(c,j),cfus,ocvts(c)', & @@ -2054,8 +2054,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! + hfus*h2osoi_liq(c,j) !& ! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term if(debug_print) then - if (abs(xlat_d-51.393).lt.0.1 .and. & - abs(xlon_d-261.117).lt.0.1)then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then print *,' ocvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,' j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j) print *,' cv(c,j),t_soisno(c,j),hfus,ocvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ocvts(c) @@ -2520,8 +2520,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! ! + (cwat-cice_eff)*lake_icefrac(c)*tfrz*dz_lake(c,j) !enthalpy reconciliation term fin(c) = fin(c) + phi(c,j) if(debug_print) then - if (abs(xlat_d-51.393).lt.0.1 .and. & - abs(xlon_d-261.117).lt.0.1)then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,' new cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c)', & j,cv_lake(c,j),t_lake(c,j),cfus,lake_icefrac(c,j),ncvts(c),fin(c) @@ -2543,8 +2543,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! + hfus*h2osoi_liq(c,j) !& ! + (cpliq-cpice)*h2osoi_ice(c,j)*tfrz !enthalpy reconciliation term if(debug_print) then - if (abs(xlat_d-51.393).lt.0.1 .and. & - abs(xlon_d-261.117).lt.0.1)then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then print *,' ncvts(c) at xlat_d,xlon_d',xlat_d,xlon_d print *,'new j,jtop(c)',j,jtop(c),'h2osoi_liq(c,j) ',h2osoi_liq(c,j),'h2osoi_ice(c,j)',h2osoi_ice(c,j) print *,'new cv(c,j),t_soisno(c,j),hfus,ncvts(c)',c,j,cv(c,j),t_soisno(c,j),hfus,ncvts(c) @@ -2567,8 +2567,8 @@ SUBROUTINE ShalLakeTemperature(t_grnd,h2osno,sabg,dz,dz_lake,z,zi, & ! c = pcolumn(p) errsoi(c) = (ncvts(c)-ocvts(c)) / dtime - fin(c) if(debug_print) then - if (abs(xlat_d-51.393).lt.0.1 .and. & - abs(xlon_d-261.117).lt.0.1)then + if (abs(xlat_d-52.1152).lt.0.1 .and. & + abs(xlon_d-260.405).lt.0.1)then print *,'xlat_d,xlon_d',xlat_d,xlon_d print *,'errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c)', & errsoi(c),fin(c),ncvts(c),ocvts(c),dtime,lake_icefrac(c,:),h2osno(c) @@ -5653,34 +5653,23 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, t_lake3d(i,1) = tsfc(i) t_grnd2d(i) = tsfc(i) - - ! initial lake temperature if (lake_icefrac3d(i,1) <= 0.) then - ! no ice - t_lake3d(i,1) = max(tfrz,t_lake3d(i,1)) - t_grnd2d(i) = t_lake3d(i,1) - elseif (lake_icefrac3d(i,1) > 0. .and. lake_icefrac3d(i,1) < 1.) then - ! fractional ice - t_lake3d(i,1) = tfrz + t_lake3d(i,1) = max(tfrz,tsfc(i)) + t_grnd2d(i) = max(tfrz,tsfc(i)) endif - do k = 2, nlevlake if(z_lake3d(i,k).le.depth_c) then - t_lake3d(i,k) = t_lake3d(i,1)+(277.2_kind_lake-t_lake3d(i,1))/depth_c*z_lake3d(i,k) - if (lake_icefrac3d(i,1) <= 0.) then - ! no ice - t_lake3d(i,k) = max(tfrz,t_lake3d(i,k)) - elseif (lake_icefrac3d(i,1) > 0. .and. lake_icefrac3d(i,1) < 1.) then - ! fractional ice - t_lake3d(i,k) = tfrz - endif + t_lake3d(i,k) = tsfc(i)+(277.2_kind_lake-tsfc(i))/depth_c*z_lake3d(i,k) else t_lake3d(i,k) = 277.2_kind_lake end if + if (lake_icefrac3d(i,k) <= 0.) then + t_lake3d(i,k) = max(tfrz,t_lake3d(i,k)) + endif enddo ! initial t_soisno3d - ! in snow on ice + ! in snow if(snowdp2d(i) > 0.) then do k = snl2d(i)+1, 0 t_soisno3d(i,k) =min(tfrz,tsfc(i)) From ace56af857fd760e29c50f67850f3620ed2bdda4 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 28 Jul 2023 03:12:46 +0000 Subject: [PATCH 21/81] t_grnd(i) should be t_grnd(c) --- physics/clm_lake.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 262bad4e6..844c4ce71 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -692,7 +692,7 @@ SUBROUTINE clm_lake_run( & gflx_wat(I) = eflx_gnet(c) ![W/m/m] upward_heat_flux_in_soil_over_water ep1d_water(i) = eflx_lh_tot(c) ![W/m/m] surface_upward_potential_latent_heat_flux_over_water tsurf_water(I) = t_grnd(c) ![K] surface skin temperature after iteration over water - tsurf_ice(i) = t_grnd(i) ! surface_skin_temperature_after_iteration_over_ice + tsurf_ice(i) = t_grnd(c) ! surface_skin_temperature_after_iteration_over_ice tsfc_wat(i) = t_grnd(c) ![K] surface skin temperature over water tisfc(i) = t_grnd(c) tsfc(i) = t_grnd(c) From c0c253f9fcec4c871b954533d912b1f3ec28b420 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 28 Jul 2023 15:19:25 +0000 Subject: [PATCH 22/81] fix another typo --- physics/clm_lake.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 844c4ce71..edd9e2bd5 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -736,7 +736,7 @@ SUBROUTINE clm_lake_run( & ! uustar_ice(i) = uustar_water(i) ! surface_friction_velocity_over_ice endif - tsurf_ice(i) = t_grnd(i) ! surface_skin_temperature_after_iteration_over_ice + tsurf_ice(i) = t_grnd(c) ! surface_skin_temperature_after_iteration_over_ice tisfc(i) = t_grnd(c) ! surface_skin_temperature_over_ice tsfc(i) = t_grnd(c) ! surface_skin_temperature_over_ice weasdi(i) = h2osno(c) ! water_equivalent_accumulated_snow_depth_over_ice From 102d664840f70a86cab380295ac518bbcb58cbe4 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Mon, 31 Jul 2023 12:24:02 -0600 Subject: [PATCH 23/81] Some housekeeping: overwrite ccppsrw_doxyfile (no need to keep separate "v3" file), correct misspelled pages "shemes" --> "schemes" --- physics/docs/ccpp_doxyfile | 2 +- physics/docs/ccppsrw3_doxyfile | 557 ------------------ physics/docs/ccppsrw_doxyfile | 14 +- ...emes_list.txt => SRW_all_schemes_list.txt} | 0 ...l_shemes_list.txt => all_schemes_list.txt} | 0 5 files changed, 9 insertions(+), 564 deletions(-) delete mode 100644 physics/docs/ccppsrw3_doxyfile rename physics/docs/pdftxt/{SRW_all_shemes_list.txt => SRW_all_schemes_list.txt} (100%) rename physics/docs/pdftxt/{all_shemes_list.txt => all_schemes_list.txt} (100%) diff --git a/physics/docs/ccpp_doxyfile b/physics/docs/ccpp_doxyfile index 595ba2d85..9beb66ece 100644 --- a/physics/docs/ccpp_doxyfile +++ b/physics/docs/ccpp_doxyfile @@ -115,7 +115,7 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- INPUT = pdftxt/mainpage.txt \ - pdftxt/all_shemes_list.txt \ + pdftxt/all_schemes_list.txt \ pdftxt/GFS_v16_suite.txt \ pdftxt/GFS_v17_p8_suite.txt \ pdftxt/RAP_suite.txt \ diff --git a/physics/docs/ccppsrw3_doxyfile b/physics/docs/ccppsrw3_doxyfile deleted file mode 100644 index b1cc3138c..000000000 --- a/physics/docs/ccppsrw3_doxyfile +++ /dev/null @@ -1,557 +0,0 @@ -# Doxyfile 1.9.3 - -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "CCPP SciDoc for UFS-SRW v3.0.0" -PROJECT_NUMBER = "SRW v3.0.0" -PROJECT_BRIEF = "Common Community Physics Package Developed at DTC" -PROJECT_LOGO = img/dtc_logo.png -OUTPUT_DIRECTORY = doc -CREATE_SUBDIRS = NO -ALLOW_UNICODE_NAMES = NO -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = NO -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -JAVADOC_BANNER = NO -QT_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -PYTHON_DOCSTRING = YES -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = YES -TAB_SIZE = 4 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -OPTIMIZE_FOR_FORTRAN = YES -OPTIMIZE_OUTPUT_VHDL = NO -OPTIMIZE_OUTPUT_SLICE = NO -EXTENSION_MAPPING = .f=FortranFree \ - .F=FortranFree \ - .F90=FortranFree \ - .f90=FortranFree -MARKDOWN_SUPPORT = YES -TOC_INCLUDE_HEADINGS = 5 -AUTOLINK_SUPPORT = YES -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -SIP_SUPPORT = NO -IDL_PROPERTY_SUPPORT = YES -DISTRIBUTE_GROUP_DOC = YES -GROUP_NESTED_COMPOUNDS = NO -SUBGROUPING = YES -INLINE_GROUPED_CLASSES = NO -INLINE_SIMPLE_STRUCTS = NO -TYPEDEF_HIDES_STRUCT = YES -LOOKUP_CACHE_SIZE = 0 -NUM_PROC_THREADS = 1 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -EXTRACT_ALL = YES -EXTRACT_PRIVATE = YES -EXTRACT_PRIV_VIRTUAL = NO -EXTRACT_PACKAGE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = YES -EXTRACT_ANON_NSPACES = YES -RESOLVE_UNNAMED_PARAMS = YES -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = NO -HIDE_SCOPE_NAMES = NO -HIDE_COMPOUND_REFERENCE= NO -SHOW_HEADERFILE = YES -SHOW_INCLUDE_FILES = NO -SHOW_GROUPED_MEMB_INC = NO -FORCE_LOCAL_INCLUDES = NO -INLINE_INFO = YES -SORT_MEMBER_DOCS = NO -SORT_BRIEF_DOCS = NO -SORT_MEMBERS_CTORS_1ST = NO -SORT_GROUP_NAMES = NO -SORT_BY_SCOPE_NAME = NO -STRICT_PROTO_MATCHING = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = YES -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = NO -SHOW_FILES = NO -SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = -LAYOUT_FILE = ccpp_dox_layout.xml -CITE_BIB_FILES = library.bib - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = NO -WARN_IF_DOC_ERROR = YES -WARN_IF_INCOMPLETE_DOC = YES -WARN_NO_PARAMDOC = NO -WARN_AS_ERROR = NO -WARN_FORMAT = -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -INPUT = pdftxt/SRW_mainpage.txt \ - pdftxt/SRW_all_shemes_list.txt \ - pdftxt/GFS_v16_suite.txt \ - pdftxt/HRRR_suite.txt \ - pdftxt/RAP_suite.txt \ - pdftxt/RRFS_v1beta_suite.txt \ - pdftxt/WoFS_v0_suite.txt \ - pdftxt/RRFS_SGSCLOUD.txt \ - pdftxt/GFS_RRTMG.txt \ - pdftxt/GFS_SFCLYR.txt \ - pdftxt/MYNN_SFCLAYER.txt \ - pdftxt/GFS_NSST.txt \ - pdftxt/GFS_OCEAN.txt \ - pdftxt/GFS_NOAH.txt \ - pdftxt/GFS_SFCSICE.txt \ - pdftxt/GFS_SATMEDMFVDIFQ.txt \ - pdftxt/GFS_NOAHMP.txt \ - pdftxt/GFS_UGWPv0.txt \ - pdftxt/GFS_drag_suite.txt \ - pdftxt/GFS_GWDPS.txt \ - pdftxt/GFS_OZPHYS.txt \ - pdftxt/GFS_H2OPHYS.txt \ - pdftxt/GFS_SAMFdeep.txt \ - pdftxt/GFS_SAMFshal.txt \ - pdftxt/GFDL_cloud.txt \ - pdftxt/NSSLMICRO.txt \ - pdftxt/MYNN_EDMF.txt \ - pdftxt/CU_GF_deep.txt \ - pdftxt/RUCLSM.txt \ - pdftxt/THOMPSON.txt \ - pdftxt/suite_input.nml.txt \ - pdftxt/CLM_LAKE.txt \ - pdftxt/GFS_SPP.txt \ - ../fv_sat_adj.F90 \ - ../GFS_time_vary_pre.fv3.F90 \ - ../GFS_rad_time_vary.fv3.F90 \ - ../GFS_phys_time_vary.fv3.F90 \ - ../get_prs_fv3.F90 \ - ../get_phi_fv3.F90 \ - ../ozne_def.f \ - ../ozinterp.f90 \ - ../h2o_def.f \ - ../h2ointerp.f90 \ - ../aerclm_def.F \ - ../aerinterp.F90 \ - ../iccn_def.F \ - ../iccninterp.F90 \ - ../sfcsub.F \ - ../gcycle.F90 \ - ../GFS_suite_interstitial_1.F90 \ - ../GFS_suite_interstitial_2.F90 \ - ../GFS_suite_interstitial_3.F90 \ - ../GFS_suite_interstitial_4.F90 \ - ../GFS_suite_interstitial_5.F90 \ - ../GFS_suite_interstitial_phys_reset.F90 \ - ../GFS_suite_interstitial_rad_reset.F90 \ - ../GFS_suite_stateout_reset.F90 \ - ../GFS_suite_stateout_update.F90 \ - ../GFS_surface_composites_inter.F90 \ - ../GFS_surface_composites_pre.F90 \ - ../GFS_surface_composites_post.F90 \ - ../GFS_surface_loop_control_part1.F90 \ - ../GFS_surface_loop_control_part2.F90 \ - ../GFS_radiation_surface.F90 \ - ../GFS_rrtmg_pre.F90 \ - ../GFS_rrtmg_post.F90 \ - ../GFS_rrtmg_setup.F90 \ - ../rad_sw_pre.F90 \ - ../sgscloud_radpre.F90 \ - ../sgscloud_radpost.F90 \ - ../radsw_main.F90 \ - ../rrtmg_sw_post.F90 \ - ../rrtmg_lw_pre.F90 \ - ../radlw_main.F90 \ - ../rrtmg_lw_post.F90 \ - ../radiation_aerosols.f \ - ../radiation_astronomy.f \ - ../radiation_clouds.f \ - ../radiation_cloud_overlap.F90 \ - ../radiation_gases.f \ - ../radiation_surface.f \ - ../radlw_param.f \ - ../radlw_datatb.f \ - ../radsw_param.f \ - ../radsw_datatb.f \ - ../GFS_cloud_diagnostics.F90 \ - ../dcyc2t3.f \ - ../sfc_diff.f \ - ../sfc_diag.f \ - ../sfc_diag_post.F90 \ - ../sfc_nst.f \ - ../sfc_nst_pre.f \ - ../sfc_nst_post.f \ - ../sfc_ocean.F \ - ../clm_lake.f90 \ - ../module_nst_model.f90 \ - ../module_nst_parameters.f90 \ - ../module_nst_water_prop.f90 \ - ../lsm_noah.f \ - ../sflx.f \ - ../namelist_soilveg.f \ - ../set_soilveg.f \ - ../noahmpdrv.F90 \ - ../module_sf_noahmplsm.f90 \ - ../module_sf_noahmp_glacier.f90 \ - ../noahmp_tables.f90 \ - ../GFS_surface_generic_pre.F90 \ - ../GFS_surface_generic_post.F90 \ - ../surface_perturbation.F90 \ - ../GFS_DCNV_generic_pre.F90 \ - ../GFS_DCNV_generic_post.F90 \ - ../GFS_SCNV_generic_pre.F90 \ - ../GFS_SCNV_generic_post.F90 \ - ../sfc_sice.f \ - ../satmedmfvdifq.F \ - ../mfpbltq.f \ - ../mfscuq.f \ - ../tridi.f \ - ../GFS_GWD_generic_pre.F90 \ - ../GFS_GWD_generic_post.F90 \ - ../unified_ugwp.F90 \ - ../drag_suite.F90 \ - ../cires_tauamf_data.F90 \ - ../cires_orowam2017.f \ - ../cires_ugwp.F90 \ - ../cires_ugwp_initialize.F90 \ - ../cires_ugwp_module.F90 \ - ../cires_ugwp_post.F90 \ - ../cires_ugwp_triggers.F90 \ - ../cires_ugwp_module.F90 \ - ../gwdps.f \ - ../ugwp_driver_v0.F \ - ../ozphys_2015.f \ - ../h2ophys.f \ - ../samfdeepcnv.f \ - ../samfshalcnv.f \ - ../progsigma_calc.f90 \ - ../cnvc90.f \ - ../module_bfmicrophysics.f \ - ../gfdl_cloud_microphys.F90 \ - ../module_gfdl_cloud_microphys.F90 \ - ../GFS_MP_generic_pre.F90 \ - ../GFS_MP_generic_post.F90 \ - ../GFS_PBL_generic_common.F90 \ - ../GFS_PBL_generic_pre.F90 \ - ../GFS_PBL_generic_post.F90 \ - ../calpreciptype.f90 \ - ../GFS_stochastics.F90 \ - ../cu_gf_driver.F90 \ - ../cu_gf_driver_pre.F90 \ - ../cu_gf_deep.F90 \ - ../cu_gf_sh.F90 \ - ../cu_gf_driver_post.F90 \ - ../mynnedmf_wrapper.F90 \ - ../module_bl_mynn.F90 \ - ../bl_mynn_common.f90 \ - ../mynnsfc_wrapper.F90 \ - ../module_sf_mynn.F90 \ - ../lsm_ruc.F90 \ - ../module_sf_ruclsm.F90 \ - ../namelist_soilveg_ruc.F90 \ - ../set_soilveg_ruc.F90 \ - ../module_soil_pre.F90 \ - ../mp_thompson_pre.F90 \ - ../module_mp_thompson_make_number_concentrations.F90 \ - ../mp_thompson.F90 \ - ../module_mp_thompson.F90 \ - ../module_mp_radar.F90 \ - ../mp_thompson_post.F90 \ - ../mp_nssl.F90 \ - ../module_mp_nssl_2mom.F90 \ - ../funcphys.f90 \ - ../physcons.F90 \ - ../radcons.f90 \ - ../mersenne_twister.f \ - ../maximum_hourly_diagnostics.F90 \ - ../phys_tend.F90 - -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.f \ - *.F \ - *.F90 \ - *.f90 \ - *.nml \ - *.txt -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = pdftxt/RE300 \ - doc/html -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = img -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -FILTER_SOURCE_PATTERNS = -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -REFERENCES_LINK_SOURCE = YES -SOURCE_TOOLTIPS = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -CLANG_ASSISTED_PARSING = NO -CLANG_ADD_INC_PATHS = YES -CLANG_OPTIONS = -CLANG_DATABASE_PATH = - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -ALPHABETICAL_INDEX = NO -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = _doxygen/header.html -HTML_FOOTER = _doxygen/footer.html -HTML_STYLESHEET = -HTML_EXTRA_STYLESHEET = _doxygen/doxygen-awesome.css \ - _doxygen/doxygen-awesome-sidebar-only.css \ - _doxygen/doxygen-awesome-sidebar-only-darkmode-toggle.css \ - _doxygen/doxygen-awesome-ccpp.css -HTML_EXTRA_FILES = _doxygen/doxygen-awesome-darkmode-toggle.js \ - _doxygen/doxygen-awesome-ccpp.js -HTML_COLORSTYLE_HUE = 209 -HTML_COLORSTYLE_SAT = 255 -HTML_COLORSTYLE_GAMMA = 113 -HTML_TIMESTAMP = NO -HTML_DYNAMIC_MENUS = YES -HTML_DYNAMIC_SECTIONS = NO -HTML_INDEX_NUM_ENTRIES = 100 -GENERATE_DOCSET = NO -DOCSET_FEEDNAME = "Doxygen generated docs" -DOCSET_FEEDURL = -DOCSET_BUNDLE_ID = org.doxygen.Project -DOCSET_PUBLISHER_ID = org.doxygen.Publisher -DOCSET_PUBLISHER_NAME = Publisher -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -CHM_INDEX_ENCODING = -BINARY_TOC = NO -TOC_EXPAND = NO -GENERATE_QHP = NO -QCH_FILE = -QHP_NAMESPACE = org.doxygen.Project -QHP_VIRTUAL_FOLDER = doc -QHP_CUST_FILTER_NAME = -QHP_CUST_FILTER_ATTRS = -QHP_SECT_FILTER_ATTRS = -QHG_LOCATION = -GENERATE_ECLIPSEHELP = NO -ECLIPSE_DOC_ID = org.doxygen.Project -DISABLE_INDEX = YES -GENERATE_TREEVIEW = YES -FULL_SIDEBAR = NO -ENUM_VALUES_PER_LINE = 4 -TREEVIEW_WIDTH = 335 -EXT_LINKS_IN_WINDOW = NO -OBFUSCATE_EMAILS = YES -HTML_FORMULA_FORMAT = SVG -FORMULA_FONTSIZE = 10 -FORMULA_TRANSPARENT = YES -FORMULA_MACROFILE = -USE_MATHJAX = YES -MATHJAX_VERSION = MathJax_2 -MATHJAX_FORMAT = HTML-CSS -#MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2 -MATHJAX_RELPATH = https://cdn.jsdelivr.net/npm/mathjax@2 -MATHJAX_EXTENSIONS = -MATHJAX_CODEFILE = -SEARCHENGINE = YES -SERVER_BASED_SEARCH = NO -EXTERNAL_SEARCH = NO -SEARCHENGINE_URL = -SEARCHDATA_FILE = searchdata.xml -EXTERNAL_SEARCH_ID = -EXTRA_SEARCH_MAPPINGS = - -#--------------------------------------------------------------------------- -# Configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -GENERATE_LATEX = YES -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -LATEX_MAKEINDEX_CMD = makeindex -COMPACT_LATEX = YES -PAPER_TYPE = a4 -EXTRA_PACKAGES = amsmath -LATEX_HEADER = -LATEX_FOOTER = -LATEX_EXTRA_STYLESHEET = -LATEX_EXTRA_FILES = -PDF_HYPERLINKS = YES -USE_PDFLATEX = YES -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = YES -LATEX_BIB_STYLE = plainnat -LATEX_TIMESTAMP = NO -LATEX_EMOJI_DIRECTORY = - -#--------------------------------------------------------------------------- -# Configuration options related to the RTF output -#--------------------------------------------------------------------------- - -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the man page output -#--------------------------------------------------------------------------- - -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_SUBDIR = -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the XML output -#--------------------------------------------------------------------------- - -GENERATE_XML = NO -XML_OUTPUT = xml -XML_PROGRAMLISTING = YES -XML_NS_MEMB_FILE_SCOPE = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the DOCBOOK output -#--------------------------------------------------------------------------- - -GENERATE_DOCBOOK = NO -DOCBOOK_OUTPUT = docbook - -#--------------------------------------------------------------------------- -# Configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# Configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -ENABLE_PREPROCESSING = NO -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = CCPP \ - MULTI_GASES \ - 0 -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to external references -#--------------------------------------------------------------------------- - -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -EXTERNAL_PAGES = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -DIA_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = YES -DOT_NUM_THREADS = 0 -DOT_FONTNAME = Source Sans Pro -DOT_FONTSIZE = -DOT_FONTPATH = -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = YES -UML_LIMIT_NUM_FIELDS = 10 -DOT_UML_DETAILS = NO -DOT_WRAP_THRESHOLD = 17 -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = NO -CALL_GRAPH = YES -CALLER_GRAPH = YES -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DIR_GRAPH_MAX_DEPTH = 1 -DOT_IMAGE_FORMAT = SVG -INTERACTIVE_SVG = NO -DOT_PATH = /Users/man.zhang/homebrew/bin/dot -DOTFILE_DIRS = -MSCFILE_DIRS = -DIAFILE_DIRS = -PLANTUML_JAR_PATH = -PLANTUML_CFG_FILE = -PLANTUML_INCLUDE_PATH = -DOT_GRAPH_MAX_NODES = 1000 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = YES -DOT_MULTI_TARGETS = YES -GENERATE_LEGEND = YES -DOT_CLEANUP = YES diff --git a/physics/docs/ccppsrw_doxyfile b/physics/docs/ccppsrw_doxyfile index 09ebccf86..5c9c797b5 100644 --- a/physics/docs/ccppsrw_doxyfile +++ b/physics/docs/ccppsrw_doxyfile @@ -1,8 +1,8 @@ # Doxyfile 1.9.3 DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = "CCPP Scidoc for SRW v2.1.0" -PROJECT_NUMBER = "SRW v2.1.0" +PROJECT_NAME = "CCPP SciDoc for UFS-SRW v3.0.0" +PROJECT_NUMBER = "SRW v3.0.0" PROJECT_BRIEF = "Common Community Physics Package Developed at DTC" PROJECT_LOGO = img/dtc_logo.png OUTPUT_DIRECTORY = doc @@ -115,9 +115,10 @@ WARN_LOGFILE = #--------------------------------------------------------------------------- INPUT = pdftxt/SRW_mainpage.txt \ - pdftxt/SRW_all_shemes_list.txt \ + pdftxt/SRW_all_schemes_list.txt \ pdftxt/GFS_v16_suite.txt \ pdftxt/HRRR_suite.txt \ + pdftxt/RAP_suite.txt \ pdftxt/RRFS_v1beta_suite.txt \ pdftxt/WoFS_v0_suite.txt \ pdftxt/RRFS_SGSCLOUD.txt \ @@ -144,6 +145,7 @@ INPUT = pdftxt/SRW_mainpage.txt \ pdftxt/RUCLSM.txt \ pdftxt/THOMPSON.txt \ pdftxt/suite_input.nml.txt \ + pdftxt/CLM_LAKE.txt \ pdftxt/GFS_SPP.txt \ ../fv_sat_adj.F90 \ ../GFS_time_vary_pre.fv3.F90 \ @@ -206,6 +208,7 @@ INPUT = pdftxt/SRW_mainpage.txt \ ../sfc_nst_pre.f \ ../sfc_nst_post.f \ ../sfc_ocean.F \ + ../clm_lake.f90 \ ../module_nst_model.f90 \ ../module_nst_parameters.f90 \ ../module_nst_water_prop.f90 \ @@ -283,7 +286,6 @@ INPUT = pdftxt/SRW_mainpage.txt \ ../mp_nssl.F90 \ ../module_mp_nssl_2mom.F90 \ ../funcphys.f90 \ - ../physparam.f \ ../physcons.F90 \ ../radcons.f90 \ ../mersenne_twister.f \ @@ -302,7 +304,7 @@ EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = -EXAMPLE_PATH = pdftxt/RE210 \ +EXAMPLE_PATH = pdftxt/RE300 \ doc/html EXAMPLE_PATTERNS = EXAMPLE_RECURSIVE = NO @@ -540,7 +542,7 @@ DIRECTORY_GRAPH = YES DIR_GRAPH_MAX_DEPTH = 1 DOT_IMAGE_FORMAT = SVG INTERACTIVE_SVG = NO -DOT_PATH = +DOT_PATH = /Users/man.zhang/homebrew/bin/dot DOTFILE_DIRS = MSCFILE_DIRS = DIAFILE_DIRS = diff --git a/physics/docs/pdftxt/SRW_all_shemes_list.txt b/physics/docs/pdftxt/SRW_all_schemes_list.txt similarity index 100% rename from physics/docs/pdftxt/SRW_all_shemes_list.txt rename to physics/docs/pdftxt/SRW_all_schemes_list.txt diff --git a/physics/docs/pdftxt/all_shemes_list.txt b/physics/docs/pdftxt/all_schemes_list.txt similarity index 100% rename from physics/docs/pdftxt/all_shemes_list.txt rename to physics/docs/pdftxt/all_schemes_list.txt From 0154a658ba4752da9c00f1ab24b1a039787e3a7f Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 10:20:26 -0600 Subject: [PATCH 24/81] Remove old namelists, remove "develop" from names --- ...elop.FV3_GFS_v16 => input.nml.FV3_GFS_v16} | 0 ...ml.develop.FV3_HRRR => input.nml.FV3_HRRR} | 0 ....nml.develop.FV3_RAP => input.nml.FV3_RAP} | 0 ..._RRFS_v1beta => input.nml.FV3_RRFS_v1beta} | 0 ...elop.FV3_WoFS_v0 => input.nml.FV3_WoFS_v0} | 0 .../RE300/namelists/input.nml.v21.FV3_GFS_v16 | 336 ------------------ .../RE300/namelists/input.nml.v21.FV3_HRRR | 299 ---------------- .../namelists/input.nml.v21.FV3_RRFS_v1beta | 291 --------------- .../RE300/namelists/input.nml.v21.FV3_WoFS_v0 | 297 ---------------- 9 files changed, 1223 deletions(-) rename physics/docs/pdftxt/RE300/namelists/{input.nml.develop.FV3_GFS_v16 => input.nml.FV3_GFS_v16} (100%) rename physics/docs/pdftxt/RE300/namelists/{input.nml.develop.FV3_HRRR => input.nml.FV3_HRRR} (100%) rename physics/docs/pdftxt/RE300/namelists/{input.nml.develop.FV3_RAP => input.nml.FV3_RAP} (100%) rename physics/docs/pdftxt/RE300/namelists/{input.nml.develop.FV3_RRFS_v1beta => input.nml.FV3_RRFS_v1beta} (100%) rename physics/docs/pdftxt/RE300/namelists/{input.nml.develop.FV3_WoFS_v0 => input.nml.FV3_WoFS_v0} (100%) delete mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 delete mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR delete mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta delete mode 100644 physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_GFS_v16 b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_GFS_v16 similarity index 100% rename from physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_GFS_v16 rename to physics/docs/pdftxt/RE300/namelists/input.nml.FV3_GFS_v16 diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_HRRR b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_HRRR similarity index 100% rename from physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_HRRR rename to physics/docs/pdftxt/RE300/namelists/input.nml.FV3_HRRR diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RAP b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_RAP similarity index 100% rename from physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RAP rename to physics/docs/pdftxt/RE300/namelists/input.nml.FV3_RAP diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RRFS_v1beta b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_RRFS_v1beta similarity index 100% rename from physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_RRFS_v1beta rename to physics/docs/pdftxt/RE300/namelists/input.nml.FV3_RRFS_v1beta diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_WoFS_v0 b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_WoFS_v0 similarity index 100% rename from physics/docs/pdftxt/RE300/namelists/input.nml.develop.FV3_WoFS_v0 rename to physics/docs/pdftxt/RE300/namelists/input.nml.FV3_WoFS_v0 diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 deleted file mode 100644 index 6dc85900b..000000000 --- a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_GFS_v16 +++ /dev/null @@ -1,336 +0,0 @@ -&amip_interp_nml - data_set = 'reynolds_oi' - date_out_of_range = 'climo' - interp_oi_sst = .true. - no_anom_sst = .false. - use_ncep_ice = .false. - use_ncep_sst = .true. -/ - -&atmos_model_nml - blocksize = 40 - ccpp_suite = 'FV3_GFS_v16' - chksum_debug = .false. - dycore_only = .false. -/ - -&cires_ugwp_nml - knob_ugwp_azdir = 2, 4, 4, 4 - knob_ugwp_doaxyz = 1 - knob_ugwp_doheat = 1 - knob_ugwp_dokdis = 1 - knob_ugwp_effac = 1, 1, 1, 1 - knob_ugwp_ndx4lh = 1 - knob_ugwp_solver = 2 - knob_ugwp_source = 1, 1, 0, 0 - knob_ugwp_stoch = 0, 0, 0, 0 - knob_ugwp_version = 0 - knob_ugwp_wvspec = 1, 25, 25, 25 - launch_level = 27 -/ - -&diag_manager_nml - prepend_date = .false. -/ - -&external_ic_nml - checker_tr = .false. - filtered_terrain = .true. - gfs_dwinds = .true. - levp = 65 - nt_checker = 0 -/ - -&fms_io_nml - checksum_required = .false. - max_files_r = 100 - max_files_w = 100 -/ - -&fms_nml - clock_grain = 'ROUTINE' - domains_stack_size = 5000000 - print_memory_usage = .false. -/ - -&fv_core_nml - a_imp = 1.0 - adjust_dry_mass = .false. - agrid_vel_rst = .false. - bc_update_interval = 6 - beta = 0.0 - consv_am = .false. - consv_te = 0.0 - d2_bg = 0.0 - d2_bg_k1 = 0.2 - d2_bg_k2 = 0.0 - d4_bg = 0.12 - d_con = 1.0 - d_ext = 0.0 - dddmp = 0.1 - delt_max = 0.008 - dnats = 1 - do_sat_adj = .true. - do_schmidt = .true. - do_vort_damp = .true. - dwind_2d = .false. - dz_min = 2 - external_eta = .true. - external_ic = .true. - fill = .true. - full_zs_filter = .false. - fv_debug = .false. - fv_sg_adj = 450 - gfs_phil = .false. - hord_dp = -5 - hord_mt = 5 - hord_tm = 5 - hord_tr = 10 - hord_vt = 5 - hydrostatic = .false. - io_layout = 1, 1 - k_split = 6 - ke_bg = 0.0 - kord_mt = 9 - kord_tm = -9 - kord_tr = 9 - kord_wz = 9 - layout = 5, 2 - make_nh = .false. - mountain = .false. - n_split = 6 - n_sponge = 10 - n_zs_filter = 0 - na_init = 0 - ncep_ic = .false. - nggps_ic = .true. - no_dycore = .false. - nord = 3 - npx = 220 - npy = 132 - npz = 64 - nrows_blend = 10 - ntiles = 1 - nudge_dz = .false. - nudge_qv = .true. - nwat = 6 - p_fac = 0.1 - phys_hydrostatic = .false. - print_freq = 6 - psm_bc = 1 - range_warn = .false. - read_increment = .false. - regional = .true. - regional_bcs_from_gsi = .false. - res_latlon_dynamics = '' - reset_eta = .false. - rf_cutoff = 750.0 - stretch_fac = 0.999 - target_lat = 38.5 - target_lon = -97.5 - tau = 10.0 - use_hydro_pressure = .false. - vtdm4 = 0.02 - warm_start = .false. - write_restart_with_bcs = .false. - z_tracer = .true. -/ - -&fv_grid_nml - grid_file = 'INPUT/grid_spec.nc' -/ - -&gfdl_cloud_microphysics_nml - c_cracw = 0.8 - c_paut = 0.5 - c_pgacs = 0.01 - c_psaci = 0.05 - ccn_l = 300.0 - ccn_o = 100.0 - const_vg = .false. - const_vi = .false. - const_vr = .false. - const_vs = .false. - de_ice = .false. - do_qa = .true. - do_sedi_heat = .false. - dw_land = 0.16 - dw_ocean = 0.1 - fast_sat_adj = .true. - fix_negative = .true. - icloud_f = 1 - mono_prof = .true. - mp_time = 150.0 - prog_ccn = .false. - qi0_crt = 8e-05 - qi_lim = 1.0 - ql_gen = 0.001 - ql_mlt = 0.001 - qs0_crt = 0.001 - rad_graupel = .true. - rad_rain = .true. - rad_snow = .true. - reiflag = 2 - rh_inc = 0.3 - rh_inr = 0.3 - rh_ins = 0.3 - rthresh = 1e-05 - sedi_transport = .true. - tau_g2v = 900.0 - tau_i2s = 1000.0 - tau_l2v = 225.0 - tau_v2l = 150.0 - use_ccn = .true. - use_ppm = .false. - vg_max = 12.0 - vi_max = 1.0 - vr_max = 12.0 - vs_max = 2.0 - z_slope_ice = .true. - z_slope_liq = .true. -/ - -&gfs_physics_nml - cal_pre = .false. - cdmbgwd = 4.0, 0.15, 1.0, 1.0 - cnvcld = .true. - cnvgwd = .true. - debug = .false. - do_shum = .false. - do_skeb = .false. - do_spp = .false. - do_sppt = .false. - do_tofd = .true. - do_ugwp = .false. - dspheat = .true. - effr_in = .true. - fhcyc = 0 - fhlwr = 3600.0 - fhswr = 3600.0 - fhzero = 1.0 - h2o_phys = .true. - hybedmf = .false. - iaer = 5111 - ialb = 1 - iau_inc_files = '' - icliq_sw = 2 - ico2 = 2 - iems = 1 - imfdeepcnv = 2 - imfshalcnv = 2 - imp_physics = 11 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 1 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - iovr = 3 - isatmedmf = 1 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - ldiag3d = .false. - ldiag_ugwp = .false. - lgfdlmprad = .true. - lheatstrg = .true. - lndp_type = 0 - lsm = 1 - lsoil = 4 - lwhtr = .true. - n_var_lndp = 0 - n_var_spp = 0 - nsradar_reset = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - prautco = 0.00015, 0.00015 - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - psautco = 0.0008, 0.0005 - random_clds = .false. - redrag = .true. - satmedmf = .true. - sfclay_compute_flux = .false. - shal_cnv = .true. - swhtr = .true. - trans_trac = .true. - use_ufo = .true. -/ - -&interpolator_nml - interp_method = 'conserve_great_circle' -/ - -&mpp_io_nml - deflate_level = 1 - shuffle = 1 -/ - -&nam_sfcperts -/ - -&nam_sppperts -/ - -&nam_stochy -/ - -&namsfc - fabsl = 99999 - faisl = 99999 - faiss = 99999 - fnacna = '' - fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' - fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' - fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' - fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' - fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' - fnsnoa = '' - fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' - fntsfa = '' - fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' - fnzorc = 'igbp' - fsicl = 99999 - fsics = 99999 - fslpl = 99999 - fsmcl = 99999, 99999, 99999 - fsnol = 99999 - fsnos = 99999 - fsotl = 99999 - ftsfl = 99999 - ftsfs = 90 - fvetl = 99999 - fvmnl = 99999 - fvmxl = 99999 - landice = .true. - ldebug = .false. -/ - -&namsfc_dict - fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' - fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' - fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' - fnslpc = '../fix_lam/C403.slope_type.tileX.nc' - fnsotc = '../fix_lam/C403.soil_type.tileX.nc' - fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' - fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' - fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' -/ - -&surf_map_nml -/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR deleted file mode 100644 index cd9408a4d..000000000 --- a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_HRRR +++ /dev/null @@ -1,299 +0,0 @@ -&amip_interp_nml - data_set = 'reynolds_oi' - date_out_of_range = 'climo' - interp_oi_sst = .true. - no_anom_sst = .false. - use_ncep_ice = .false. - use_ncep_sst = .true. -/ - -&atmos_model_nml - blocksize = 40 - ccpp_suite = 'FV3_HRRR' - chksum_debug = .false. - dycore_only = .false. -/ - -&cires_ugwp_nml - knob_ugwp_azdir = 2, 4, 4, 4 - knob_ugwp_doaxyz = 1 - knob_ugwp_doheat = 1 - knob_ugwp_dokdis = 1 - knob_ugwp_effac = 1, 1, 1, 1 - knob_ugwp_ndx4lh = 1 - knob_ugwp_solver = 2 - knob_ugwp_source = 1, 1, 0, 0 - knob_ugwp_stoch = 0, 0, 0, 0 - knob_ugwp_version = 0 - knob_ugwp_wvspec = 1, 25, 25, 25 - launch_level = 25 -/ - -&diag_manager_nml - prepend_date = .false. -/ - -&external_ic_nml - checker_tr = .false. - filtered_terrain = .true. - gfs_dwinds = .true. - levp = 65 - nt_checker = 0 -/ - -&fms_io_nml - checksum_required = .false. - max_files_r = 100 - max_files_w = 100 -/ - -&fms_nml - clock_grain = 'ROUTINE' - domains_stack_size = 5000000 - print_memory_usage = .false. -/ - -&fv_core_nml - a_imp = 1.0 - adjust_dry_mass = .false. - bc_update_interval = 6 - beta = 0.0 - consv_am = .false. - consv_te = 0.0 - d2_bg = 0.0 - d2_bg_k1 = 0.2 - d2_bg_k2 = 0.04 - d4_bg = 0.12 - d_con = 1.0 - d_ext = 0.0 - dddmp = 0.1 - delt_max = 0.008 - dnats = 0 - do_sat_adj = .false. - do_schmidt = .true. - do_vort_damp = .true. - dwind_2d = .false. - dz_min = 2 - external_eta = .true. - external_ic = .true. - fill = .true. - full_zs_filter = .false. - fv_debug = .false. - fv_sg_adj = 300 - gfs_phil = .false. - hord_dp = -5 - hord_mt = 5 - hord_tm = 5 - hord_tr = 10 - hord_vt = 5 - hydrostatic = .false. - io_layout = 1, 1 - k_split = 2 - ke_bg = 0.0 - kord_mt = 9 - kord_tm = -9 - kord_tr = 9 - kord_wz = 9 - layout = 5, 2 - make_nh = .true. - mountain = .false. - n_split = 5 - n_sponge = 24 - n_zs_filter = 0 - na_init = 1 - ncep_ic = .false. - nggps_ic = .true. - no_dycore = .false. - nord = 3 - nord_tr = 2 - npx = 220 - npy = 132 - npz = 64 - nrows_blend = 10 - ntiles = 1 - nudge_qv = .false. - nwat = 6 - p_fac = 0.1 - phys_hydrostatic = .false. - print_freq = 6 - psm_bc = 1 - range_warn = .true. - read_increment = .false. - regional = .true. - regional_bcs_from_gsi = .false. - res_latlon_dynamics = 'fv3_increment.nc' - reset_eta = .false. - rf_cutoff = 2000.0 - stretch_fac = 0.999 - target_lat = 38.5 - target_lon = -97.5 - tau = 5.0 - use_hydro_pressure = .false. - vtdm4 = 0.02 - warm_start = .false. - write_restart_with_bcs = .false. - z_tracer = .true. -/ - -&fv_grid_nml - grid_file = 'INPUT/grid_spec.nc' -/ - -&gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 - bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 1.0 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .false. - do_gsl_drag_ls_bl = .true. - do_gsl_drag_ss = .true. - do_gsl_drag_tofd = .true. - do_mynnedmf = .true. - do_mynnsfclay = .true. - do_shum = .false. - do_skeb = .false. - do_spp = .false. - do_sppt = .false. - dspheat = .true. - effr_in = .true. - fhcyc = 0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - gwd_opt = 3 - h2o_phys = .true. - hybedmf = .false. - iaer = 5111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icliq_sw = 2 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = -1 - imfshalcnv = -1 - imp_physics = 8 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - iovr = 3 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - kice = 9 - ldiag3d = .false. - lheatstrg = .false. - lndp_type = 0 - lradar = .true. - lsm = 3 - lsoil = 4 - lsoil_lsm = 9 - ltaerosol = .true. - lwhtr = .true. - n_var_lndp = 0 - n_var_spp = 0 - nsradar_reset = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. - sfclay_compute_flux = .true. - shal_cnv = .false. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. -/ - -&interpolator_nml - interp_method = 'conserve_great_circle' -/ - -&nam_sfcperts -/ - -&nam_sppperts -/ - -&nam_stochy -/ - -&namsfc - fabsl = 99999 - faisl = 99999 - faiss = 99999 - fnacna = '' - fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' - fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' - fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' - fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' - fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' - fnsnoa = '' - fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' - fntsfa = '' - fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' - fnzorc = 'igbp' - fsicl = 99999 - fsics = 99999 - fslpl = 99999 - fsmcl = 99999, 99999, 99999 - fsnol = 99999 - fsnos = 99999 - fsotl = 99999 - ftsfl = 99999 - ftsfs = 90 - fvetl = 99999 - fvmnl = 99999 - fvmxl = 99999 - ldebug = .true. -/ - -&namsfc_dict - fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' - fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' - fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' - fnslpc = '../fix_lam/C403.slope_type.tileX.nc' - fnsotc = '../fix_lam/C403.soil_type.tileX.nc' - fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' - fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' - fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' -/ - -&surf_map_nml - cd2 = -1 - cd4 = 0.12 - max_slope = 0.4 - n_del2_strong = 0 - n_del2_weak = 2 - n_del4 = 1 - peak_fac = 1.0 - zero_ocean = .false. -/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta deleted file mode 100644 index 97e775107..000000000 --- a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_RRFS_v1beta +++ /dev/null @@ -1,291 +0,0 @@ -&amip_interp_nml - data_set = 'reynolds_oi' - date_out_of_range = 'climo' - interp_oi_sst = .true. - no_anom_sst = .false. - use_ncep_ice = .false. - use_ncep_sst = .true. -/ - -&atmos_model_nml - blocksize = 40 - ccpp_suite = 'FV3_RRFS_v1beta' - chksum_debug = .false. - dycore_only = .false. -/ - -&cires_ugwp_nml - knob_ugwp_azdir = 2, 4, 4, 4 - knob_ugwp_doaxyz = 1 - knob_ugwp_doheat = 1 - knob_ugwp_dokdis = 1 - knob_ugwp_effac = 1, 1, 1, 1 - knob_ugwp_ndx4lh = 1 - knob_ugwp_solver = 2 - knob_ugwp_source = 1, 1, 0, 0 - knob_ugwp_stoch = 0, 0, 0, 0 - knob_ugwp_version = 0 - knob_ugwp_wvspec = 1, 25, 25, 25 - launch_level = 25 -/ - -&diag_manager_nml - prepend_date = .false. -/ - -&external_ic_nml - checker_tr = .false. - filtered_terrain = .true. - gfs_dwinds = .true. - levp = 65 - nt_checker = 0 -/ - -&fms_io_nml - checksum_required = .false. - max_files_r = 100 - max_files_w = 100 -/ - -&fms_nml - clock_grain = 'ROUTINE' - domains_stack_size = 5000000 - print_memory_usage = .false. -/ - -&fv_core_nml - a_imp = 1.0 - adjust_dry_mass = .false. - bc_update_interval = 6 - beta = 0.0 - consv_am = .false. - consv_te = 0.0 - d2_bg = 0.0 - d2_bg_k1 = 0.2 - d2_bg_k2 = 0.04 - d4_bg = 0.12 - d_con = 1.0 - d_ext = 0.0 - dddmp = 0.1 - delt_max = 0.008 - dnats = 0 - do_sat_adj = .false. - do_schmidt = .true. - do_vort_damp = .true. - dwind_2d = .false. - dz_min = 2 - external_eta = .true. - external_ic = .true. - fill = .true. - full_zs_filter = .false. - fv_debug = .false. - fv_sg_adj = 300 - gfs_phil = .false. - hord_dp = 6 - hord_mt = 6 - hord_tm = 6 - hord_tr = 10 - hord_vt = 6 - hydrostatic = .false. - io_layout = 1, 1 - k_split = 2 - ke_bg = 0.0 - kord_mt = 9 - kord_tm = -9 - kord_tr = 9 - kord_wz = 9 - layout = 5, 2 - make_nh = .true. - mountain = .false. - n_split = 5 - n_sponge = 24 - n_zs_filter = 0 - na_init = 1 - ncep_ic = .false. - nggps_ic = .true. - no_dycore = .false. - nord = 3 - npx = 220 - npy = 132 - npz = 64 - nrows_blend = 10 - ntiles = 1 - nudge_qv = .false. - nwat = 6 - p_fac = 0.1 - phys_hydrostatic = .false. - print_freq = 6 - psm_bc = 1 - range_warn = .true. - read_increment = .false. - regional = .true. - regional_bcs_from_gsi = .false. - res_latlon_dynamics = 'fv3_increment.nc' - reset_eta = .false. - rf_cutoff = 2000.0 - stretch_fac = 0.999 - target_lat = 38.5 - target_lon = -97.5 - tau = 5.0 - use_hydro_pressure = .false. - vtdm4 = 0.02 - warm_start = .false. - write_restart_with_bcs = .false. - z_tracer = .true. -/ - -&fv_grid_nml - grid_file = 'INPUT/grid_spec.nc' -/ - -&gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 - bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 0.25 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .false. - do_mynnedmf = .true. - do_mynnsfclay = .true. - do_shum = .false. - do_skeb = .false. - do_spp = .false. - do_sppt = .false. - dspheat = .true. - effr_in = .true. - fhcyc = 0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - h2o_phys = .true. - hybedmf = .false. - iaer = 111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = -1 - imfshalcnv = -1 - imp_physics = 8 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - iopt_trs = 2 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - ldiag3d = .false. - lheatstrg = .false. - lndp_type = 0 - lradar = .true. - lsm = 2 - lsoil = 4 - lsoil_lsm = 4 - ltaerosol = .true. - lwhtr = .true. - n_var_lndp = 0 - n_var_spp = 0 - nsradar_reset = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. - sfclay_compute_flux = .false. - shal_cnv = .false. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. -/ - -&interpolator_nml - interp_method = 'conserve_great_circle' -/ - -&nam_sfcperts -/ - -&nam_sppperts -/ - -&nam_stochy -/ - -&namsfc - fabsl = 99999 - faisl = 99999 - faiss = 99999 - fnacna = '' - fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' - fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' - fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' - fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' - fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' - fnsnoa = '' - fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' - fntsfa = '' - fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' - fnzorc = 'igbp' - fsicl = 99999 - fsics = 99999 - fslpl = 99999 - fsmcl = 99999, 99999, 99999 - fsnol = 99999 - fsnos = 99999 - fsotl = 99999 - ftsfl = 99999 - ftsfs = 90 - fvetl = 99999 - fvmnl = 99999 - fvmxl = 99999 - ldebug = .true. -/ - -&namsfc_dict - fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' - fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' - fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' - fnslpc = '../fix_lam/C403.slope_type.tileX.nc' - fnsotc = '../fix_lam/C403.soil_type.tileX.nc' - fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' - fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' - fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' -/ - -&surf_map_nml - cd2 = -1 - cd4 = 0.12 - max_slope = 0.4 - n_del2_strong = 0 - n_del2_weak = 2 - n_del4 = 1 - peak_fac = 1.0 - zero_ocean = .false. -/ diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 b/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 deleted file mode 100644 index 94cc34d0f..000000000 --- a/physics/docs/pdftxt/RE300/namelists/input.nml.v21.FV3_WoFS_v0 +++ /dev/null @@ -1,297 +0,0 @@ -&amip_interp_nml - data_set = 'reynolds_oi' - date_out_of_range = 'climo' - interp_oi_sst = .true. - no_anom_sst = .false. - use_ncep_ice = .false. - use_ncep_sst = .true. -/ - -&atmos_model_nml - blocksize = 40 - ccpp_suite = 'FV3_WoFS_v0' - chksum_debug = .false. - dycore_only = .false. -/ - -&cires_ugwp_nml - knob_ugwp_azdir = 2, 4, 4, 4 - knob_ugwp_doaxyz = 1 - knob_ugwp_doheat = 1 - knob_ugwp_dokdis = 1 - knob_ugwp_effac = 1, 1, 1, 1 - knob_ugwp_ndx4lh = 1 - knob_ugwp_solver = 2 - knob_ugwp_source = 1, 1, 0, 0 - knob_ugwp_stoch = 0, 0, 0, 0 - knob_ugwp_version = 0 - knob_ugwp_wvspec = 1, 25, 25, 25 - launch_level = 25 -/ - -&diag_manager_nml - prepend_date = .false. -/ - -&external_ic_nml - checker_tr = .false. - filtered_terrain = .true. - gfs_dwinds = .true. - levp = 65 - nt_checker = 0 -/ - -&fms_io_nml - checksum_required = .false. - max_files_r = 100 - max_files_w = 100 -/ - -&fms_nml - clock_grain = 'ROUTINE' - domains_stack_size = 5000000 - print_memory_usage = .false. -/ - -&fv_core_nml - a_imp = 1.0 - adjust_dry_mass = .false. - bc_update_interval = 6 - beta = 0.0 - consv_am = .false. - consv_te = 0.0 - d2_bg = 0.0 - d2_bg_k1 = 0.2 - d2_bg_k2 = 0.04 - d4_bg = 0.12 - d_con = 1.0 - d_ext = 0.0 - dddmp = 0.1 - delt_max = 0.008 - dnats = 0 - do_sat_adj = .false. - do_schmidt = .true. - do_vort_damp = .true. - dwind_2d = .false. - dz_min = 2 - external_eta = .true. - external_ic = .true. - fill = .true. - full_zs_filter = .false. - fv_debug = .false. - fv_sg_adj = 300 - gfs_phil = .false. - hord_dp = 6 - hord_mt = 6 - hord_tm = 6 - hord_tr = 10 - hord_vt = 6 - hydrostatic = .false. - io_layout = 1, 1 - k_split = 2 - ke_bg = 0.0 - kord_mt = 9 - kord_tm = -9 - kord_tr = 9 - kord_wz = 9 - layout = 5, 2 - make_nh = .true. - mountain = .false. - n_split = 5 - n_sponge = 24 - n_zs_filter = 0 - na_init = 1 - ncep_ic = .false. - nggps_ic = .true. - no_dycore = .false. - nord = 3 - npx = 220 - npy = 132 - npz = 64 - nrows_blend = 10 - ntiles = 1 - nudge_qv = .false. - nwat = 7 - p_fac = 0.1 - phys_hydrostatic = .false. - print_freq = 6 - psm_bc = 1 - range_warn = .true. - read_increment = .false. - regional = .true. - regional_bcs_from_gsi = .false. - res_latlon_dynamics = 'fv3_increment.nc' - reset_eta = .false. - rf_cutoff = 2000.0 - stretch_fac = 0.999 - target_lat = 38.5 - target_lon = -97.5 - tau = 5.0 - use_hydro_pressure = .false. - vtdm4 = 0.02 - warm_start = .false. - write_restart_with_bcs = .false. - z_tracer = .true. -/ - -&fv_diagnostics_nml - do_hailcast = .true. -/ - -&fv_grid_nml - grid_file = 'INPUT/grid_spec.nc' -/ - -&gfs_physics_nml - bl_mynn_edmf = 1 - bl_mynn_edmf_mom = 1 - bl_mynn_tkeadvect = .true. - cal_pre = .false. - cdmbgwd = 3.5, 0.25 - cnvcld = .false. - cnvgwd = .false. - cplflx = .false. - debug = .false. - do_deep = .false. - do_mynnedmf = .true. - do_mynnsfclay = .true. - do_shum = .false. - do_skeb = .false. - do_spp = .false. - do_sppt = .false. - dspheat = .true. - effr_in = .true. - fhcyc = 0 - fhlwr = 1200.0 - fhswr = 1200.0 - fhzero = 1.0 - h2o_phys = .true. - hybedmf = .false. - iaer = 111 - ialb = 1 - iau_delthrs = 6 - iau_inc_files = '' - iaufhrs = 30 - icloud_bl = 1 - ico2 = 2 - iems = 1 - imfdeepcnv = -1 - imfshalcnv = -1 - imp_physics = 17 - iopt_alb = 2 - iopt_btr = 1 - iopt_crs = 1 - iopt_dveg = 2 - iopt_frz = 1 - iopt_inf = 1 - iopt_rad = 1 - iopt_run = 1 - iopt_sfc = 1 - iopt_snf = 4 - iopt_stc = 1 - iopt_tbot = 2 - isol = 2 - isot = 1 - isubc_lw = 2 - isubc_sw = 2 - ivegsrc = 1 - ldiag3d = .false. - lheatstrg = .false. - lndp_type = 0 - lradar = .true. - lsm = 1 - lsoil = 4 - lsoil_lsm = 4 - ltaerosol = .true. - lwhtr = .true. - n_var_lndp = 0 - n_var_spp = 0 - nsradar_reset = 3600 - nssl_cccn = 600000000.0 - nssl_ccn_on = .true. - nssl_hail_on = .true. - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 - oz_phys = .false. - oz_phys_2015 = .true. - pdfcld = .false. - pre_rad = .false. - print_diff_pgr = .false. - prslrd0 = 0.0 - random_clds = .false. - redrag = .true. - satmedmf = .false. - sfclay_compute_flux = .false. - shal_cnv = .false. - swhtr = .true. - trans_trac = .true. - ttendlim = -999 - use_ufo = .true. -/ - -&interpolator_nml - interp_method = 'conserve_great_circle' -/ - -&nam_sfcperts -/ - -&nam_sppperts -/ - -&nam_stochy -/ - -&namsfc - fabsl = 99999 - faisl = 99999 - faiss = 99999 - fnacna = '' - fnaisc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/CFSR.SEAICE.1982.2012.monthly.clim.grb' - fnglac = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_glacier.2x2.grb' - fnmskh = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/seaice_newland.grb' - fnmxic = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_maxice.2x2.grb' - fnsmcc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_soilmgldas.t126.384.190.grb' - fnsnoa = '' - fnsnoc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/global_snoclim.1.875.grb' - fntsfa = '' - fntsfc = '../../../../../../../../../../det/UFS_SRW_App/v2p0/fix/fix_am/RTGSST.1982.2012.monthly.clim.grb' - fnzorc = 'igbp' - fsicl = 99999 - fsics = 99999 - fslpl = 99999 - fsmcl = 99999, 99999, 99999 - fsnol = 99999 - fsnos = 99999 - fsotl = 99999 - ftsfl = 99999 - ftsfs = 90 - fvetl = 99999 - fvmnl = 99999 - fvmxl = 99999 - ldebug = .true. -/ - -&namsfc_dict - fnabsc = '../fix_lam/C403.maximum_snow_albedo.tileX.nc' - fnalbc = '../fix_lam/C403.snowfree_albedo.tileX.nc' - fnalbc2 = '../fix_lam/C403.facsf.tileX.nc' - fnslpc = '../fix_lam/C403.slope_type.tileX.nc' - fnsotc = '../fix_lam/C403.soil_type.tileX.nc' - fntg3c = '../fix_lam/C403.substrate_temperature.tileX.nc' - fnvegc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvetc = '../fix_lam/C403.vegetation_type.tileX.nc' - fnvmnc = '../fix_lam/C403.vegetation_greenness.tileX.nc' - fnvmxc = '../fix_lam/C403.vegetation_greenness.tileX.nc' -/ - -&surf_map_nml - cd2 = -1 - cd4 = 0.12 - max_slope = 0.4 - n_del2_strong = 0 - n_del2_weak = 2 - n_del4 = 1 - peak_fac = 1.0 - zero_ocean = .false. -/ From 8f447558d9638c713be4c5aa285d6d6e4f3f09d6 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 10:40:35 -0600 Subject: [PATCH 25/81] Incorporate changes to FV3_HRRR namelist suggested by Tanya --- .../pdftxt/RE300/namelists/input.nml.FV3_HRRR | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_HRRR b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_HRRR index 8a7d621f3..e30bd44c6 100644 --- a/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_HRRR +++ b/physics/docs/pdftxt/RE300/namelists/input.nml.FV3_HRRR @@ -65,7 +65,7 @@ d2_bg_k1 = 0.2 d2_bg_k2 = 0.04 d4_bg = 0.12 - d_con = 1.0 + d_con = 0.5 d_ext = 0.0 dddmp = 0.1 delt_max = 0.008 @@ -82,11 +82,11 @@ fv_debug = .false. fv_sg_adj = 300 gfs_phil = .false. - hord_dp = -5 - hord_mt = 5 - hord_tm = 5 - hord_tr = 10 - hord_vt = 5 + hord_dp = 6 + hord_mt = 6 + hord_tm = 6 + hord_tr = 8 + hord_vt = 6 hydrostatic = .false. io_layout = 1, 1 k_split = 2 @@ -99,14 +99,14 @@ make_nh = .true. mountain = .false. n_split = 5 - n_sponge = 24 + n_sponge = 9 n_zs_filter = 0 na_init = 1 ncep_ic = .false. nggps_ic = .true. no_dycore = .false. nord = 3 - nord_tr = 2 + nord_tr = 0 npx = 220 npy = 132 npz = 64 @@ -150,6 +150,7 @@ cnvgwd = .false. cplflx = .false. debug = .false. + diag_log = .true. do_deep = .false. do_gsl_drag_ls_bl = .true. do_gsl_drag_ss = .true. @@ -166,14 +167,14 @@ h2o_phys = .true. hybedmf = .false. iaer = 5111 - ialb = 1 + ialb = 2 iau_delthrs = 6 iau_inc_files = '' iaufhrs = 30 icliq_sw = 2 icloud_bl = 1 ico2 = 2 - iems = 1 + iems = 2 imfdeepcnv = -1 imfshalcnv = -1 imp_physics = 8 @@ -191,12 +192,15 @@ iopt_tbot = 2 iopt_trs = 2 iovr = 3 + isncond_opt = 2 + isncovr_opt = 3 isol = 2 isot = 1 isubc_lw = 2 isubc_sw = 2 ivegsrc = 1 kice = 9 + kice = 9 ldiag3d = .false. lheatstrg = .false. lradar = .true. @@ -205,9 +209,9 @@ lsoil_lsm = 9 ltaerosol = .true. lwhtr = .true. + mosaic_lu = 0 + mosaic_soil = 0 nsfullradar_diag = 3600 - nst_anl = .true. - nstf_name = 2, 1, 0, 0, 0 oz_phys = .false. oz_phys_2015 = .true. pdfcld = .false. @@ -220,6 +224,7 @@ sfclay_compute_flux = .true. shal_cnv = .false. swhtr = .true. + thsfc_loc = .false. trans_trac = .true. ttendlim = -999 use_ufo = .true. From aaa02d82af9309ea3df4880ad9d5eb9eb949b25d Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 11:02:55 -0600 Subject: [PATCH 26/81] Address Ligia/Weiwei's comments --- physics/docs/pdftxt/CU_GF_deep.txt | 8 ++++---- physics/docs/pdftxt/RRFS_v1beta_suite.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index 1a02516f7..3b01a05a4 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -6,17 +6,17 @@ The Grell-Freitas (GF) scheme, as described in Grell and Freitas (2014) \cite gr Freitas et al. (2018) \cite freitas_et_al_2018, Freitas et al. (2021) \cite freitas_et_al_2021, and Lin et al. (2022) \cite Lin_2022 follows the mass flux approach published by Grell (1993) \cite grell_1993. Further developments by Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 included implementing -stochastics through allowing parameter perturbations. In GF scale awareness, and the aerosol dependence through rain generation (following +stochastics through allowing parameter perturbations. The GF scheme takes into account aerosol dependence through rain generation (following Berry (1968) \cite berry_1968 and evaporation formulations (following Jiang et al. (2010) \cite Jiang_2010 ), depending on the cloud concentration nuclei at cloud base were added. The GF scheme includes mixed phase physics impact, momentum transport, a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction and transition from shallow, congestus and deep convection regimes. The vertical mass flux distribution of shallow, congestus and -deep convection regimes is characterized by Probability Density Functions (PDFs). The three PDF's are meant to represent the average +deep convection regimes is characterized by Probability Density Functions (PDFs). The three PDFs are meant to represent the average statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived -from the PDF's. The deep and congestus convection considers scale awareness (Arakawa et al. (2011) \cite Arakawa_2011 ). However, the shallow convection is not scale-aware. Aerosol dependence is implemented through dependence of rain generation and +from the PDFs. Aerosol dependence (considered experimental and not supported in this release) is implemented through dependence of rain generation and evaporation formulations depending on the cloud concentration nuclei at cloud base (Berry 1968 \cite berry_1968, -Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. Aerosol dependence is considered experimental and is turned off at this point. GF is able to transport tracers. +Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. GF is able to transport tracers. Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added,and they are used only for the RAP suite. The impacts of GF scheme in operational RAP/HRRR include:(a)uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes; diff --git a/physics/docs/pdftxt/RRFS_v1beta_suite.txt b/physics/docs/pdftxt/RRFS_v1beta_suite.txt index ae400b982..b2e4ba676 100644 --- a/physics/docs/pdftxt/RRFS_v1beta_suite.txt +++ b/physics/docs/pdftxt/RRFS_v1beta_suite.txt @@ -3,7 +3,7 @@ \section RRFS_v1beta_suite_overview Overview -The RRFS_v1beta suite is one of candicates for the future operational implementation of +The RRFS_v1beta suite is one of the candidates for the future operational implementation of the Rapid Refresh Forecast System (RRFS), which can be configured using the UFS SRW App. This suite is most applicable for runs at 3-km resolution since it does not parameterize deep convection. From dbcd50fee66582d9b58fb03872b4ce34ab23531d Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 15:08:15 -0600 Subject: [PATCH 27/81] Remove hard-coded path in doxyfile --- physics/docs/ccppsrw_doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/docs/ccppsrw_doxyfile b/physics/docs/ccppsrw_doxyfile index 5c9c797b5..a45fad88f 100644 --- a/physics/docs/ccppsrw_doxyfile +++ b/physics/docs/ccppsrw_doxyfile @@ -542,7 +542,7 @@ DIRECTORY_GRAPH = YES DIR_GRAPH_MAX_DEPTH = 1 DOT_IMAGE_FORMAT = SVG INTERACTIVE_SVG = NO -DOT_PATH = /Users/man.zhang/homebrew/bin/dot +DOT_PATH = DOTFILE_DIRS = MSCFILE_DIRS = DIAFILE_DIRS = From 8188e26897b91083b315a0c8f83e32f54209c96d Mon Sep 17 00:00:00 2001 From: dustinswales Date: Tue, 1 Aug 2023 16:01:38 -0600 Subject: [PATCH 28/81] Split ozone physics into time_vary and run components --- physics/GFS_rrtmg_setup.meta | 12 +- physics/GFS_rrtmgp_setup.meta | 12 +- physics/ozphys_2015.F90 | 181 ++--------------------------- physics/ozphys_2015.meta | 205 +-------------------------------- physics/ozphys_time_vary.F90 | 177 +++++++++++++++++++++++++++++ physics/ozphys_time_vary.meta | 207 ++++++++++++++++++++++++++++++++++ 6 files changed, 406 insertions(+), 388 deletions(-) create mode 100644 physics/ozphys_time_vary.F90 create mode 100644 physics/ozphys_time_vary.meta diff --git a/physics/GFS_rrtmg_setup.meta b/physics/GFS_rrtmg_setup.meta index 42b999c82..f92d6f8db 100644 --- a/physics/GFS_rrtmg_setup.meta +++ b/physics/GFS_rrtmg_setup.meta @@ -174,22 +174,22 @@ type = integer intent = in [levozp] - standard_name = number_of_levels_in_ozone_data - long_name = number of levels in ozone data + standard_name = number_of_levels_in_ozone_climotology_data + long_name = number of levels in ozone climotology data units = count dimensions = () type = integer intent = in [timeozp] - standard_name = number_of_times_in_ozone_data - long_name = number of times in ozone data + standard_name = number_of_times_in_ozone_climotology_data + long_name = number of times in ozone climotology data units = count dimensions = () type = integer intent = in [latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data + standard_name = number_of_latitudes_in_ozone_climotology_data + long_name = number of latitude in ozone climotology data units = count dimensions = () type = integer diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/GFS_rrtmgp_setup.meta index 567294d4a..c8ed60650 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/GFS_rrtmgp_setup.meta @@ -267,22 +267,22 @@ type = integer intent = inout [levozp] - standard_name = number_of_levels_in_ozone_data - long_name = number of levels in ozone data + standard_name = number_of_levels_in_ozone_climotology_data + long_name = number of levels in ozone climotology data units = count dimensions = () type = integer intent = in [timeozp] - standard_name = number_of_times_in_ozone_data - long_name = number of times in ozone data + standard_name = number_of_times_in_ozone_climotology_data + long_name = number of times in ozone climotology data units = count dimensions = () type = integer intent = in [latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data + standard_name = number_of_latitudes_in_ozone_climotology_data + long_name = number of latitude in ozone climotology data units = count dimensions = () type = integer diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index fda87611c..82ade0cbd 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -5,176 +5,13 @@ module ozphys_2015 use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec implicit none - public ozphys_2015_init, ozphys_2015_timestep_init, ozphys_2015_run + public ozphys_2015_run contains ! ########################################################################################### !>\defgroup GFS_ozphys_2015 GFS Ozone Photochemistry (2015) Module !! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. !> @{ -!> \section arg_table_ozphys_2015_init Argument Table -!! \htmlinclude ozphys_2015_init.html -!! -! ########################################################################################### - subroutine ozphys_2015_init(oz_phys_2015, nPts, latsozp, oz_lat, dlat, jindx1, jindx2, & - ddy, errmsg, errflg) - ! Inputs - logical, intent(in) :: & - oz_phys_2015 ! Control flag for NRL 2015 ozone physics scheme - integer, intent(in) :: & - nPts, & ! Horizontal dimension - latsozp ! Number of latitudes in ozone data - real(kind_phys), intent(in), dimension(:) :: & - oz_lat, & ! Latitudes of ozone data - dlat ! Latitudes of grid - ! Outputs - integer, intent(out), dimension(:) :: & - jindx1, & ! Interpolation index (low) for ozone data - jindx2 ! Interpolation index (high) for ozone data - real(kind_phys), intent(out), dimension(:) :: & - ddy ! Interpolation high index for ozone data - character(len=*), intent(out) :: & - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag - - ! Local - integer i,j - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Sanity check - if (.not.oz_phys_2015) then - write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' - errflg = 1 - return - endif - - ! Set indices - do j=1,nPts - jindx2(j) = latsozp + 1 - do i=1,latsozp - if (dlat(j) < oz_lat(i)) then - jindx2(j) = i - exit - endif - enddo - jindx1(j) = max(jindx2(j)-1,1) - jindx2(j) = min(jindx2(j),latsozp) - if (jindx2(j) .ne. jindx1(j)) then - ddy(j) = (dlat(j) - oz_lat(jindx1(j))) / (oz_lat(jindx2(j)) - oz_lat(jindx1(j))) - else - ddy(j) = 1.0 - endif - enddo - - end subroutine ozphys_2015_init - -! ########################################################################################### -!> \section arg_table_ozphys_2015_timestep_init Argument Table -!! \htmlinclude ozphys_2015_timestep_init.html -!! -! ########################################################################################### - subroutine ozphys_2015_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp, levozp, & - oz_coeff, timeoz, ozplin, oz_time, oz_lat, ddy, ozplout, errmsg, errflg) - ! Inputs - integer, intent(in) :: & - nPts, & ! Horizontal dimension - latsozp, & ! Number of latitudes in ozone data - levozp, & ! Number of vertical layers in ozone data - oz_coeff, & ! Number of coefficients in ozone data - timeoz ! Number of times in ozone data - integer, intent(in),dimension(:) :: & - idate, & ! Initial date with different size and ordering - jindx1, & ! Interpolation index (low) for ozone - jindx2 ! Interpolation index (high) for ozone - real(kind_phys), intent(in) :: & - fhour ! Forecast hour - real(kind_phys), intent(in), dimension(:) :: & - ddy, & ! Interpolation high index for ozone data - oz_lat, & ! Latitudes for ozone data - oz_time ! Time for ozone data - real(kind_phys), intent(in), dimension(:,:,:,:) :: & - ozplin ! Ozone data - - ! Outputs - real(kind_phys), intent(out), dimension(:,:,:) :: & - ozplout ! Ozone forcing data - character(len=*), intent(out) :: & - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag - - ! Local - integer :: idat(8),jdat(8),iday,j,j1,j2,l,nc,n1,n2,jdow,jdoy,& - jday,w3kindreal,w3kindint - real(kind_phys) :: tem, tx1, tx2, rjday - real(8) :: rinc(5) - real(4) :: rinc4(5) - !real(kind_dbl_prec) :: rinc(5) - !real(kind_sngl_prec) :: rinc4(5) - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! - idat=0 - idat(1)=idate(4) - idat(2)=idate(2) - idat(3)=idate(3) - idat(5)=idate(1) - rinc=0. - rinc(2)=fhour - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL w3movdat(rinc4,idat,jdat) - else - CALL w3movdat(rinc,idat,jdat) - endif - ! - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jdat,jdow,jdoy,jday) - rjday = jdoy + jdat(5) / 24. - IF (RJDAY < oz_time(1)) RJDAY = RJDAY + 365. - ! - n2 = timeoz + 1 - do j=2,timeoz - if (rjday < oz_time(j)) then - n2 = j - exit - endif - enddo - n1 = n2 - 1 - - tx1 = (oz_time(n2) - rjday) / (oz_time(n2) - oz_time(n1)) - tx2 = 1.0 - tx1 - - if (n2 > timeoz) n2 = n2 - timeoz - ! - do nc=1,oz_coeff - do L=1,levozp - do J=1,npts - J1 = jindx1(J) - J2 = jindx2(J) - TEM = 1.0 - ddy(J) - ozplout(j,L,nc) = tx1*(TEM*ozplin(J1,L,nc,n1)+ddy(J)*ozplin(J2,L,nc,n1)) & - + tx2*(TEM*ozplin(J1,L,nc,n2)+ddy(J)*ozplin(J2,L,nc,n2)) - enddo - enddo - enddo - - ! - return - - end subroutine ozphys_2015_timestep_init - -! ########################################################################################### !> The operational GFS currently parameterizes ozone production and !! destruction based on monthly mean coefficients ( !! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval @@ -187,11 +24,11 @@ end subroutine ozphys_2015_timestep_init !> - This code assumes that both prsl and po3 are from bottom to top !! as are all other variables. !> - This code is specifically for NRL parameterization and -!! climatological T and O3 are in location 5 and 6 of prdout array -!!\author June 2015 - Shrinivas Moorthi -!!\author May 2023 - Dustin Swales +!! climatological T and O3 are in location 5 and 6 of oz_data array +!!\author June 2015 - Shrinivas Moorthi +!!\modified May 2023 - Dustin Swales ! ########################################################################################### - subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_coeff, & + subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, oz_data, pl_coeff, & delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss, & index_of_process_ozmix, index_of_process_temp, index_of_process_overhead_ozone, & con_g, errmsg, errflg) @@ -222,7 +59,7 @@ subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_c tin, & ! Temperature of new-state (K) delp ! Difference between mid-layer pressures (Pa) real(kind_phys), intent(in), dimension(:,:,:) :: & - prdout ! Ozone forcing data + oz_data ! Ozone forcing data ! In/Outs real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & @@ -298,7 +135,7 @@ subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_c do j=1,pl_coeff do i=1,im if (flg(i)) then - prod(i,j) = wk2(i) * prdout(i,k,j) + wk3(i) * prdout(i,k+1,j) + prod(i,j) = wk2(i) * oz_data(i,k,j) + wk3(i) * oz_data(i,k+1,j) endif enddo enddo @@ -307,10 +144,10 @@ subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, prdout, pl_c do j=1,pl_coeff do i=1,im if (wk1(i) < po3(ko3)) then - prod(i,j) = prdout(i,ko3,j) + prod(i,j) = oz_data(i,ko3,j) endif if (wk1(i) >= po3(1)) then - prod(i,j) = prdout(i,1,j) + prod(i,j) = oz_data(i,1,j) endif enddo enddo diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index eab24baf1..ea82defaa 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -3,209 +3,6 @@ type = scheme dependencies = machine.F -######################################################################## -[ccpp-arg-table] - name = ozphys_2015_init - type = scheme -[nPts] - standard_name = horizontal_dimension - long_name = horizontal dimension - units = count - dimensions = () - type = integer - intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data - units = count - dimensions = () - type = integer - intent = in -[oz_phys_2015] - standard_name = flag_for_nrl_2015_ozone_scheme - long_name = flag for new (2015) ozone physics - units = flag - dimensions = () - type = logical - intent = in -[oz_lat] - standard_name = ozone_data_latitude - long_name = ozone data latitude - units = deg - dimensions = (number_of_latitudes_in_ozone_data) - type = real - kind = kind_phys - intent = in -[dlat] - standard_name = latitude_in_degree - long_name = latitude in degree north - units = degree_north - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in -[jindx1] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = out -[jindx2] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = out -[ddy] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = out -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - -######################################################################## -[ccpp-arg-table] - name = ozphys_2015_timestep_init - type = scheme -[nPts] - standard_name = horizontal_dimension - long_name = horizontal dimension - units = count - dimensions = () - type = integer - intent = in -[idate] - standard_name = date_and_time_at_model_initialization_in_united_states_order - long_name = initial date with different size and ordering - units = none - dimensions = (4) - type = integer - intent = in -[fhour] - standard_name = forecast_time - long_name = current forecast time - units = h - dimensions = () - type = real - kind = kind_phys - intent = in -[jindx1] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[jindx2] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data - units = count - dimensions = () - type = integer - intent = in -[levozp] - standard_name = number_of_levels_in_ozone_data - long_name = number of levels in ozone data - units = count - dimensions = () - type = integer - intent = in -[oz_coeff] - standard_name = number_of_coefficients_in_ozone_data - long_name = number of coefficients in ozone data - units = count - dimensions = () - type = integer - intent = in -[timeoz] - standard_name = number_of_times_in_ozone_data - long_name = number of times in ozone data - units = count - dimensions = () - type = integer - intent = in -[ozplin] - standard_name = ozone_data - long_name = ozone data - units = 1 - dimensions = (number_of_latitudes_in_ozone_data,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data,number_of_times_in_ozone_data) - type = real - kind = kind_phys - intent = in -[oz_time] - standard_name = ozone_data_time - long_name = ozone data time - units = none - dimensions = (13) - type = real - kind = kind_phys - intent = in -[oz_lat] - standard_name = ozone_data_latitude - long_name = ozone data latitude - units = deg - dimensions = (number_of_latitudes_in_ozone_data) - type = real - kind = kind_phys - intent = in -[ddy] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in -[ozplout] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) - type = real - kind = kind_phys - intent = out -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - ######################################################################## [ccpp-arg-table] name = ozphys_2015_run @@ -271,7 +68,7 @@ type = real kind = kind_phys intent = in -[prdout] +[oz_data] standard_name = ozone_forcing long_name = ozone forcing data units = mixed diff --git a/physics/ozphys_time_vary.F90 b/physics/ozphys_time_vary.F90 new file mode 100644 index 000000000..5b36f88b9 --- /dev/null +++ b/physics/ozphys_time_vary.F90 @@ -0,0 +1,177 @@ +! ########################################################################################### +!> \file ozphys_time_vary.F90 +!! +! ########################################################################################### +module ozphys_time_vary + use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec + implicit none + public ozphys_time_vary_init, ozphys_time_vary_timestep_init +contains + +! ########################################################################################### +!>\defgroup GFS Ozone Photochemistry (2015) Module +!! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. +!> @{ +!> \section arg_table_ozphys_time_vary_init Argument Table +!! \htmlinclude ozphys_time_vary_init.html +!! +! ########################################################################################### + subroutine ozphys_time_vary_init(oz_phys, nPts, latsozp, oz_lat, dlat, jindx1, jindx2, & + ddy, errmsg, errflg) + ! Inputs + logical, intent(in) :: & + oz_phys ! Control flag for NRL ozone scheme + integer, intent(in) :: & + nPts, & ! Horizontal dimension + latsozp ! Number of latitudes in ozone data + real(kind_phys), intent(in), dimension(:) :: & + oz_lat, & ! Latitudes of ozone data + dlat ! Latitudes of grid + ! Outputs + integer, intent(inout), dimension(:) :: & + jindx1, & ! Interpolation index (low) for ozone data + jindx2 ! Interpolation index (high) for ozone data + real(kind_phys), intent(inout), dimension(:) :: & + ddy ! Interpolation high index for ozone data + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + ! Local + integer i,j + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Sanity check + if (.not.oz_phys) then + write (errmsg,'(*(a))') 'Logic error: oz_phys == .false.' + errflg = 1 + return + endif + + ! Set indices + do j=1,nPts + jindx2(j) = latsozp + 1 + do i=1,latsozp + if (dlat(j) < oz_lat(i)) then + jindx2(j) = i + exit + endif + enddo + jindx1(j) = max(jindx2(j)-1,1) + jindx2(j) = min(jindx2(j),latsozp) + if (jindx2(j) .ne. jindx1(j)) then + ddy(j) = (dlat(j) - oz_lat(jindx1(j))) / (oz_lat(jindx2(j)) - oz_lat(jindx1(j))) + else + ddy(j) = 1.0 + endif + enddo + + end subroutine ozphys_time_vary_init + +! ########################################################################################### +!> \section arg_table_ozphys_time_vary_timestep_init Argument Table +!! \htmlinclude ozphys_time_vary_timestep_init.html +!! +! ########################################################################################### + subroutine ozphys_time_vary_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp, & + levozp, oz_coeff, timeoz, ozplin, oz_time, oz_lat, ddy, oz_data, errmsg, errflg) + ! Inputs + integer, intent(in) :: & + nPts, & ! Horizontal dimension + latsozp, & ! Number of latitudes in ozone data + levozp, & ! Number of vertical layers in ozone data + oz_coeff, & ! Number of coefficients in ozone data + timeoz ! Number of times in ozone data + integer, intent(in),dimension(:) :: & + idate, & ! Initial date with different size and ordering + jindx1, & ! Interpolation index (low) for ozone + jindx2 ! Interpolation index (high) for ozone + real(kind_phys), intent(in) :: & + fhour ! Forecast hour + real(kind_phys), intent(in), dimension(:) :: & + ddy, & ! Interpolation high index for ozone data + oz_lat, & ! Latitudes for ozone data + oz_time ! Time for ozone data + real(kind_phys), intent(in), dimension(:,:,:,:) :: & + ozplin ! Ozone data + + ! Outputs + real(kind_phys), intent(inout), dimension(:,:,:) :: & + oz_data ! Ozone forcing data + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + ! Local + integer :: idat(8),jdat(8),iday,j,j1,j2,l,nc,n1,n2,jdow,jdoy,& + jday,w3kindreal,w3kindint + real(kind_phys) :: tem, tx1, tx2, rjday + real(8) :: rinc(5) + real(4) :: rinc4(5) + !real(kind_dbl_prec) :: rinc(5) + !real(kind_sngl_prec) :: rinc4(5) + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! + idat=0 + idat(1)=idate(4) + idat(2)=idate(2) + idat(3)=idate(3) + idat(5)=idate(1) + rinc=0. + rinc(2)=fhour + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + rinc4=rinc + CALL w3movdat(rinc4,idat,jdat) + else + CALL w3movdat(rinc,idat,jdat) + endif + ! + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jdat,jdow,jdoy,jday) + rjday = jdoy + jdat(5) / 24. + IF (RJDAY < oz_time(1)) RJDAY = RJDAY + 365. + ! + n2 = timeoz + 1 + do j=2,timeoz + if (rjday < oz_time(j)) then + n2 = j + exit + endif + enddo + n1 = n2 - 1 + + tx1 = (oz_time(n2) - rjday) / (oz_time(n2) - oz_time(n1)) + tx2 = 1.0 - tx1 + + if (n2 > timeoz) n2 = n2 - timeoz + ! + do nc=1,oz_coeff + do L=1,levozp + do J=1,npts + J1 = jindx1(J) + J2 = jindx2(J) + TEM = 1.0 - ddy(J) + oz_data(j,L,nc) = tx1*(TEM*ozplin(J1,L,nc,n1)+ddy(J)*ozplin(J2,L,nc,n1)) & + + tx2*(TEM*ozplin(J1,L,nc,n2)+ddy(J)*ozplin(J2,L,nc,n2)) + enddo + enddo + enddo + + ! + return + + end subroutine ozphys_time_vary_timestep_init +!> @} +end module ozphys_time_vary diff --git a/physics/ozphys_time_vary.meta b/physics/ozphys_time_vary.meta new file mode 100644 index 000000000..93aa4a3b0 --- /dev/null +++ b/physics/ozphys_time_vary.meta @@ -0,0 +1,207 @@ +[ccpp-table-properties] + name = ozphys_time_vary + type = scheme + dependencies = machine.F + +######################################################################## +[ccpp-arg-table] + name = ozphys_time_vary_init + type = scheme +[nPts] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in +[oz_phys] + standard_name = flag_for_nrl_2015_ozone_scheme + long_name = flag for new (2015) ozone physics + units = flag + dimensions = () + type = logical + intent = in +[oz_lat] + standard_name = ozone_data_latitude + long_name = ozone data latitude + units = deg + dimensions = (number_of_latitudes_in_ozone_data) + type = real + kind = kind_phys + intent = in +[dlat] + standard_name = latitude_in_degree + long_name = latitude in degree north + units = degree_north + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in +[jindx1] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout +[jindx2] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout +[ddy] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + +######################################################################## +[ccpp-arg-table] + name = ozphys_time_vary_timestep_init + type = scheme +[nPts] + standard_name = horizontal_dimension + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in +[idate] + standard_name = date_and_time_at_model_initialization_in_united_states_order + long_name = initial date with different size and ordering + units = none + dimensions = (4) + type = integer + intent = in +[fhour] + standard_name = forecast_time + long_name = current forecast time + units = h + dimensions = () + type = real + kind = kind_phys + intent = in +[jindx1] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[jindx2] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[latsozp] + standard_name = number_of_latitudes_in_ozone_data + long_name = number of latitude in ozone data + units = count + dimensions = () + type = integer + intent = in +[levozp] + standard_name = number_of_levels_in_ozone_data + long_name = number of levels in ozone data + units = count + dimensions = () + type = integer + intent = in +[oz_coeff] + standard_name = number_of_coefficients_in_ozone_data + long_name = number of coefficients in ozone data + units = count + dimensions = () + type = integer + intent = in +[timeoz] + standard_name = number_of_times_in_ozone_data + long_name = number of times in ozone data + units = count + dimensions = () + type = integer + intent = in +[ozplin] + standard_name = ozone_data + long_name = ozone data + units = 1 + dimensions = (number_of_latitudes_in_ozone_data,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data,number_of_times_in_ozone_data) + type = real + kind = kind_phys + intent = in +[oz_time] + standard_name = ozone_data_time + long_name = ozone data time + units = none + dimensions = (13) + type = real + kind = kind_phys + intent = in +[oz_lat] + standard_name = ozone_data_latitude + long_name = ozone data latitude + units = deg + dimensions = (number_of_latitudes_in_ozone_data) + type = real + kind = kind_phys + intent = in +[ddy] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in +[oz_data] + standard_name = ozone_forcing + long_name = ozone forcing data + units = mixed + dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + type = real + kind = kind_phys + intent = inout +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out From 39dccc8e2ade0918f1823b6d7bdb5abb0d101898 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 16:06:29 -0600 Subject: [PATCH 29/81] Various formatting fixes, grammar and wording changes --- physics/clm_lake.f90 | 2 +- physics/docs/pdftxt/CLM_LAKE.txt | 16 ++++++++-------- physics/docs/pdftxt/CU_GF_deep.txt | 12 ++++++------ physics/docs/pdftxt/GFS_NOAHMP.txt | 2 +- physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt | 4 ++-- physics/docs/pdftxt/RUCLSM.txt | 6 +++--- physics/docs/pdftxt/WoFS_v0_suite.txt | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 1728d28b5..093fb407c 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -2746,7 +2746,7 @@ end subroutine SoilThermProp_Lake ! DESCRIPTION: !> Calculation of the phase change within snow, soil, & lake layers: !!\n (1) Check the conditions for which the phase change may take place, - !! i.e., the layer temperature is great than the freezing point + !! i.e., the layer temperature is greater than the freezing point !! and the ice mass is not equal to zero (i.e. melting), !! or the layer temperature is less than the freezing point !! and the liquid water mass is greater than the allowable supercooled diff --git a/physics/docs/pdftxt/CLM_LAKE.txt b/physics/docs/pdftxt/CLM_LAKE.txt index d78244cb2..e22b096ec 100644 --- a/physics/docs/pdftxt/CLM_LAKE.txt +++ b/physics/docs/pdftxt/CLM_LAKE.txt @@ -3,14 +3,14 @@ \section des_clmlake Description The Community Land Model (CLM) lake model is a multi-level one-dimensional lake model that has been implemented within the operational 3-km HRRR and -13-km RAP for small lakes (Benjamin et al. (2022) \cite gmd-15-6659-2022). It is the Community Land Model, version 4.5. +13-km RAP for small lakes (Benjamin et al. (2022) \cite gmd-15-6659-2022). This implementation is from the Community Land Model version 4.5 (Oleson et al. (2013) \cite Oleson2013). Subin et al. (2012) \cite Subin_2012 describe the 1-d CLM lake model as applied within the Community Earth System Model (CESM) as a component of the overall CESM CLM (Lawrence et al. (2019) \cite Lawrence_2019). Gu et al. (2015) \cite Gu2015 describe the introduction of the CLM lake model into the WRF model and inital experiments using its 1-d solution for both lakes Superior (average depth of 147 m) and Erie (average depth of 19 m). The atmospheric inputs into the model are temperature, water vapor, horizontal wind components from the lowest atmospheric level -and short-wave and longwave radiative fluxes. The CLM lake model then provides latent heat and sensible heat fluxes back to the +and shortwave and longwave radiative fluxes. The CLM lake model then provides latent heat and sensible heat fluxes back to the atmosphere. It also computes 2-m temperature/moisture, skin temperature, lake temperature, ice fraction, ice thickness, snow water equivalent and snow depth. The CLM lake model divides the vertical lake profile into 10 layers driven by wind-driven eddies. The thickness of the top layer is fixed to 10-cm and the rest of the lake depth is divided evenly into the other 9 layers. Energy @@ -23,22 +23,22 @@ Testing of the CLM lake model within RAP/HRRR applications showed computational 0.1% in run time. The lake/snow variables have to be continuously transfered within the CLM lake model from one forecast to another, constrained by the atmospheric data assimilation. The lake-cycling initialization in RAP/HRRR has been effective overall, owing to accurate houly estimates of near-surface temperature, moisture and winds, and shortwave and longwave estimates provided to the 1-d CLM -lake model every time step (Benjamin et al. (2022) \cite gmd-15-6659-2022). Cycling technique showed improvements over initializing -lake temperatures from the SST analysis, problematic for small water bodies. The improvements are particularly eminent during transition -periods between cold and warm seasons, and in the regions with anomalies in weather conditions. The CLM lake model has the potential +lake model every time step (Benjamin et al. (2022) \cite gmd-15-6659-2022). Cycling techniques showed improvements over initializing +lake temperatures from the SST analysis, which is problematic for small water bodies. The improvements are particularly eminent during transition +periods between cold and warm seasons, and in the regions with anomalous weather conditions. The CLM lake model has the potential to improve surface prediction in the vicinity of small lakes. The CLM lake model requires bathymetry for the lake points in the model domain. Grid points are assigned as lake points when the fraction of lake coverage in the grid cell exceeds 50% and when this point is disconnected from oceans. The lake water mask is -therefore binary, set to either 1 or 0. This binary approach for models with higher horizontal resolution, for example, 3-km resolution in -in the UFS SRW App, is capable of capturing the effect of lakes on regional heat and moisture fluxes. +therefore binary, set to either 1 or 0. This binary approach for models with higher horizontal resolution --- for example, 3-km resolution in +in the UFS SRW App --- is capable of capturing the effect of lakes on regional heat and moisture fluxes. Lake depths for the RRFS lake configuration (Fig.1) are assigned from a global dataset provided by Kourzeneva et al.(2012) \cite Kourzeneva_2012, this dataset is referred to as GLOBv3 bathymetry in the UFS_UTL. @image html https://user-images.githubusercontent.com/12705538/250180794-76af93a2-a7ba-4e9a-9478-5657198862b8.png "Figure 1: Lake depths for lakes in the 3-km RRFS domain." width=600 -To cold-start the CLM lake model in the UFS SRW App: +To cold-start the CLM lake model in the UFS weather model: - Use the CLM option in the input.nml \n - lkm = 1 \n - iopt_lake = 2 diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index 3b01a05a4..4b504863d 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -17,23 +17,23 @@ a spectrum of plumes within the grid box. Forcing is different for each characte from the PDFs. Aerosol dependence (considered experimental and not supported in this release) is implemented through dependence of rain generation and evaporation formulations depending on the cloud concentration nuclei at cloud base (Berry 1968 \cite berry_1968, Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. GF is able to transport tracers. -Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added,and they are used only for the RAP suite. +Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added, and they are used only for the RAP suite. -The impacts of GF scheme in operational RAP/HRRR include:(a)uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes; +The impacts of GF scheme in operational RAP/HRRR include: (a)uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes; (b)takes parameterization uncertainty into account by allowing parameters from multiple convective schemes which can be perturbed -internally or with temporal and spatial correlation patterns; (c)for higher resolutions (less than 10 km), in addition to scale awareness as in Arakawa et al. (2011) \cite Arakawa_2011 GF can transition as grid spacing decreases into a shallow convection scheme; (d)Coupled to the grid scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated precipitating convective cloud and shallow convective clouds. +internally or with temporal and spatial correlation patterns; (c)for higher resolutions (less than 10 km), in addition to scale awareness as in Arakawa et al. (2011) \cite Arakawa_2011 GF can transition as grid spacing decreases into a shallow convection scheme; (d)Coupled to the grid-scale precipitation and radiation schemes through passing of diagnosed cloud liquid and ice from simulated precipitating convective cloud and shallow convective clouds. \section version_cugf_enh CCPP Physics Updates \version UFS-SRW v3.0.0 -\b The \b Implementation \b of \b GF \b in \b RRFS +The Implementation of GF in RRFS prototypes - Updates for aerosol-awareness (experimental) - Scale-awareness is turned off when explicit microphysics is not active anywhere in the column -- GF completely is turned off at grid points when MYNN produces shallow convection at that point +- GF is completely turned off at grid points when MYNN produces shallow convection at that point - Radar reflectivity considers mass flux PDF as well as whether scale-awareness is turned on at the grid point in equation. -\b The \b implementation \b of \b GF \b in \b HAFS \b is \b undergoing. +The implementation of GF in HAFS is ongoing. \section intra_rough_gf Intraphysics Communication The GF scheme passes cloud hydrometeors to the grid-scale microphysics scheme (\ref THOMPSON ) through detrainment from each diff --git a/physics/docs/pdftxt/GFS_NOAHMP.txt b/physics/docs/pdftxt/GFS_NOAHMP.txt index 386ae816c..e48b7cafc 100644 --- a/physics/docs/pdftxt/GFS_NOAHMP.txt +++ b/physics/docs/pdftxt/GFS_NOAHMP.txt @@ -10,7 +10,7 @@ This implementation of the NoahMP Land Surface Model (LSM) is adapted from the v \section noahmp_update CCPP Physics Updates \version UFS-SRW v3.0.0 -- As part of a larger-scale effort to unify how microphysics outputs (in particular snow) are used in the land models and outputs, an addition option for using the unified frozen precipitation fraction in NoahMP was added +- As part of a larger-scale effort to unify how microphysics outputs (in particular snow) are used in the land models and outputs, an additional option for using the unified frozen precipitation fraction in NoahMP was added - Diagnostic 2-meter temperature and humidity are based on vegetation and bare-ground tiles - Bug fixes for GFS-based thermal roughness length scheme diff --git a/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt b/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt index 3ae1a0234..d5bc9489c 100644 --- a/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt +++ b/physics/docs/pdftxt/GFS_SATMEDMFVDIFQ.txt @@ -31,8 +31,8 @@ reduces the mixing length in a strong shear environment such as a hurricane. background diffusivity in the inversion layers is reduced as a function of surface roughness and green vegetation fraction. - To reduce the PBL overgrowth, the PBL updraft overshoot is not only limited by -bulk Richardson number-based-PBL depth, but the virtual potential temperature at -top of the surface layer rather than that at the model first layer is also used as +bulk Richardson number-based PBL depth, but the virtual potential temperature at +the top of the surface layer rather than that at the model first layer is also used as the near-surface virtual potential temperature in the bulk-Richardson number computation. This helps to largely suppress the unrealistic widespread popcorn-like precipitation. - Updraft entrainment rates for moisture, hydrometeors, and tracers are increased by about 30%. diff --git a/physics/docs/pdftxt/RUCLSM.txt b/physics/docs/pdftxt/RUCLSM.txt index a836e7b93..e8212df21 100644 --- a/physics/docs/pdftxt/RUCLSM.txt +++ b/physics/docs/pdftxt/RUCLSM.txt @@ -17,7 +17,7 @@ The parameterizations in the RUC LSM describe complicated atmosphere–land surf excessive sensitivity to multiple uncertain surface parameters. Nevertheless, the RUC LSM, when coupled with the hourly-assimilating atmospheric model, demonstrated over years of ongoing cycling (Benjamin et al. 2004a,b \cite Benjamin_2004a \cite Benjamin_2004b ; Berbery et al. 1999 \cite Berbery_1999) that it can produce a realistic evolution of hydrologic and time-varying soil fields (i.e., soil moisture and temperature) that cannot be directly -observed over large areas, as well as the evolution of snow cover on the ground surface. This result is possible only if the soil–vegetation–snow +observed over large areas, as well as the evolution of snow cover on the ground surface. This result is possible only if the soil–vegetation–snow component of the coupled model, constrained only by atmospheric boundary conditions and the specification of surface characteristics, has sufficient skill to avoid long-term drift. @@ -28,7 +28,7 @@ included in phase 2(d) of the Project for the Intercomparison of Land Surface Pr Luo et al. 2003 \cite Luo_2003 ). The RUC LSM was also tested during the Snow Models Intercomparison Project (SnowMIP, SnowMIP2, ESM-SnowMIP), with emphasis on snow parameterizations for both grassland and forest locations in different parts of the world (Etchevers et al. 2002, 2004 \cite Etchevers_2002 \cite Etchevers_2004; Essery et al. 2009 \cite Essery_2009 ; Rutter et al. 2009 \cite Rutter_2009 , -Krinner et al. 2018 \cite Krinner_2018 ). The analysis of RUC LSM performance over 10 reference sites in ESM-SnowMIP rated it on the 4th place +Krinner et al. 2018 \cite Krinner_2018 ). The analysis of RUC LSM performance over 10 reference sites in ESM-SnowMIP rated it 4th place among the 26 participating models. The results were published in Menard et al.(2021) \cite Menard_2021 and Essery et al. (2020) \cite essery_et_al_2020. RUC LSM received high rankings in ESM-SnowMIP experiement in terms of multi-year snow cover and surface temperature simulations for several sites located in different parts of the world (Fig.2, Menard et al.2021 \cite Menard_2021). @@ -61,7 +61,7 @@ specifying surface parameters for the dominant soil and land-use category in the grid box, RUC LSM has an option to take into account the sub-grid scale heterogeneity in the computation of such parameters as roughness length, emissivity, soil porosity, soil heat capacity and others. The difference in roughness between the mosaic and dominant category presented on Figure 3, is positive from contribution of the forests, which helped to -reduce high biases of surface wind speeds in these regions. In the cropland regions, roughness lenghth has also a seasonal variability depending on the growing phase of the plants. This again helped to improve the wind forecasts during the warm season. +reduce high biases of surface wind speeds in these regions. In cropland regions, roughness length also has a seasonal variability depending on the growing phase of the plants. This again helped to improve the wind forecasts during the warm season. Turning on sub-grid-scale heterogeneity option requries: \p mosaic_lu = 1 and \p mosaic_soil = 1 in the namelist, and fractions of soil and vegetation types in a grid cell. \image html ruc_lsm_heterogeneity.png "Figure 3: sub-grid scale heterogeneity of surface parameters in RUC LSM (Courtesy of T.G. Smirnova)" width=900 diff --git a/physics/docs/pdftxt/WoFS_v0_suite.txt b/physics/docs/pdftxt/WoFS_v0_suite.txt index 4561109fa..385ad7b7d 100644 --- a/physics/docs/pdftxt/WoFS_v0_suite.txt +++ b/physics/docs/pdftxt/WoFS_v0_suite.txt @@ -5,7 +5,7 @@ The WoFS_v0 suite is targeted for use in the upcoming operational implementation of the NOAA's Warn-on-Forecast System (WoFS) and for the RRFS ensemble. -This suite is most applicable for runs at 3-km resolution since it does +This suite is most applicable for runs at 3-km resolution and higher since it does not parameterize deep convection. The WoFS suite uses the parameterizations in the following order: From 6b12f193deb43fc42915b85a731564f716fcf03b Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 16:16:15 -0600 Subject: [PATCH 30/81] Less ambiguous wording regarding resolution --- physics/docs/pdftxt/WoFS_v0_suite.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/docs/pdftxt/WoFS_v0_suite.txt b/physics/docs/pdftxt/WoFS_v0_suite.txt index 385ad7b7d..788c98323 100644 --- a/physics/docs/pdftxt/WoFS_v0_suite.txt +++ b/physics/docs/pdftxt/WoFS_v0_suite.txt @@ -5,7 +5,7 @@ The WoFS_v0 suite is targeted for use in the upcoming operational implementation of the NOAA's Warn-on-Forecast System (WoFS) and for the RRFS ensemble. -This suite is most applicable for runs at 3-km resolution and higher since it does +This suite is most applicable for runs at <=3-km resolution and higher since it does not parameterize deep convection. The WoFS suite uses the parameterizations in the following order: From 6884732dc149a496e53354079f2d931fb7b265f1 Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Tue, 1 Aug 2023 16:18:41 -0600 Subject: [PATCH 31/81] *actually* fix ambiguous wording --- physics/docs/pdftxt/WoFS_v0_suite.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/docs/pdftxt/WoFS_v0_suite.txt b/physics/docs/pdftxt/WoFS_v0_suite.txt index 788c98323..bf868a461 100644 --- a/physics/docs/pdftxt/WoFS_v0_suite.txt +++ b/physics/docs/pdftxt/WoFS_v0_suite.txt @@ -4,8 +4,8 @@ \section wofs_v0_suite_overview Overview The WoFS_v0 suite is targeted for use in the upcoming operational implementation -of the NOAA's Warn-on-Forecast System (WoFS) and for the RRFS ensemble. -This suite is most applicable for runs at <=3-km resolution and higher since it does +of the NOAA's Warn-on-Forecast System (WoFS) and for the RRFS ensemble. +This suite is most applicable for runs at <= 3-km resolution since it does not parameterize deep convection. The WoFS suite uses the parameterizations in the following order: From 0bfac2ac51d8c460b84cc49fd5240407bcaea6ba Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 2 Aug 2023 17:03:36 +0000 Subject: [PATCH 32/81] Some cleanup. Now working --- physics/GFS_rrtmg_pre.F90 | 2 +- physics/ozphys_2015.F90 | 52 +++++++++++++++++++++++++++++++---- physics/ozphys_2015.meta | 34 +++++++++++++++++++++++ physics/ozphys_time_vary.F90 | 22 ++++----------- physics/ozphys_time_vary.meta | 7 ----- 5 files changed, 87 insertions(+), 30 deletions(-) diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 4a2c3b290..f2183919f 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -44,7 +44,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& gasvmr_o2, gasvmr_co, gasvmr_cfc11, gasvmr_cfc12, gasvmr_cfc22, & gasvmr_ccl4, gasvmr_cfc113, aerodp,ext550, clouds6, clouds7, clouds8, & clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, & - faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, rrfs_sd & + faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, rrfs_sd, & aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, latsozc, levozc, & blatc, dphiozc, errmsg, errflg) diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index 82ade0cbd..110ba02e2 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -5,7 +5,7 @@ module ozphys_2015 use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec implicit none - public ozphys_2015_run + public ozphys_2015_init, ozphys_2015_run contains ! ########################################################################################### @@ -17,8 +17,6 @@ module ozphys_2015 !! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval !! Research Laboratory through CHEM2D chemistry model !! (McCormack et al. (2006) \cite mccormack_et_al_2006). -!! \section arg_table_ozphys_2015_run Argument Table -!! \htmlinclude ozphys_2015_run.html !! !> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm !> - This code assumes that both prsl and po3 are from bottom to top @@ -28,13 +26,50 @@ module ozphys_2015 !!\author June 2015 - Shrinivas Moorthi !!\modified May 2023 - Dustin Swales ! ########################################################################################### - subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, oz_data, pl_coeff, & - delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss, & + +! ########################################################################################### +! SUBROUTINE ozphys_2015_init +! ########################################################################################### +!! \section arg_table_ozphys_2015_init Argument Table +!! \htmlinclude ozphys_2015_init.html +!! + subroutine ozphys_2015_init(oz_phys, errmsg, errflg) + ! Inputs + logical, intent(in) :: & + oz_phys + ! Outputs + character(len=*), intent(out) :: & + errmsg + integer, intent(out) :: & + errflg + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Sanity check + if (.not.oz_phys) then + write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' + errflg = 1 + return + endif + + end subroutine ozphys_2015_init + +! ########################################################################################### +! SUBROUTINE ozphys_2015_run +! ########################################################################################### +!! \section arg_table_ozphys_2015_run Argument Table +!! \htmlinclude ozphys_2015_run.html +!! + subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_data, & + pl_coeff, delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss, & index_of_process_ozmix, index_of_process_temp, index_of_process_overhead_ozone, & con_g, errmsg, errflg) ! Inputs logical, intent(in) :: & + oz_phys, & ! ldiag3d ! Flag to output GFS diagnostic tendencies real(kind_phys),intent(in) :: & con_g ! Physical constant: Gravitational acceleration (ms-2) @@ -88,6 +123,13 @@ subroutine ozphys_2015_run ( im, levs, ko3, dt, oz, tin, po3, prsl, oz_data, pl_ errmsg = '' errflg = 0 + ! Sanity checkt + if (.not.oz_phys) then + write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' + errflg = 1 + return + endif + ! Are UFS diagnostic tendencies requested? If so, set up bookeeping indices... if(ldiag3d) then idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index ea82defaa..4b19f2c04 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -3,10 +3,44 @@ type = scheme dependencies = machine.F +######################################################################## +[ccpp-arg-table] + name = ozphys_2015_init + type = scheme +[oz_phys] + standard_name = flag_for_nrl_2015_ozone_scheme + long_name = flag for new (2015) ozone physics + units = flag + dimensions = () + type = logical + intent = in +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + ######################################################################## [ccpp-arg-table] name = ozphys_2015_run type = scheme +[oz_phys] + standard_name = flag_for_nrl_2015_ozone_scheme + long_name = flag for new (2015) ozone physics + units = flag + dimensions = () + type = logical + intent = in [im] standard_name = horizontal_loop_extent long_name = horizontal loop extent diff --git a/physics/ozphys_time_vary.F90 b/physics/ozphys_time_vary.F90 index 5b36f88b9..a0a778c36 100644 --- a/physics/ozphys_time_vary.F90 +++ b/physics/ozphys_time_vary.F90 @@ -9,18 +9,16 @@ module ozphys_time_vary contains ! ########################################################################################### -!>\defgroup GFS Ozone Photochemistry (2015) Module -!! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. +!>\defgroup GFS Ozone Data Module +!! This module updates the ozone data used by physics. !> @{ !> \section arg_table_ozphys_time_vary_init Argument Table !! \htmlinclude ozphys_time_vary_init.html !! ! ########################################################################################### - subroutine ozphys_time_vary_init(oz_phys, nPts, latsozp, oz_lat, dlat, jindx1, jindx2, & + subroutine ozphys_time_vary_init(nPts, latsozp, oz_lat, dlat, jindx1, jindx2, & ddy, errmsg, errflg) ! Inputs - logical, intent(in) :: & - oz_phys ! Control flag for NRL ozone scheme integer, intent(in) :: & nPts, & ! Horizontal dimension latsozp ! Number of latitudes in ozone data @@ -44,13 +42,6 @@ subroutine ozphys_time_vary_init(oz_phys, nPts, latsozp, oz_lat, dlat, jindx1, j ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - - ! Sanity check - if (.not.oz_phys) then - write (errmsg,'(*(a))') 'Logic error: oz_phys == .false.' - errflg = 1 - return - endif ! Set indices do j=1,nPts @@ -111,10 +102,8 @@ subroutine ozphys_time_vary_timestep_init(nPts, idate, fhour, jindx1, jindx2, la integer :: idat(8),jdat(8),iday,j,j1,j2,l,nc,n1,n2,jdow,jdoy,& jday,w3kindreal,w3kindint real(kind_phys) :: tem, tx1, tx2, rjday - real(8) :: rinc(5) - real(4) :: rinc4(5) - !real(kind_dbl_prec) :: rinc(5) - !real(kind_sngl_prec) :: rinc4(5) + real(kind_dbl_prec) :: rinc(5) + real(kind_sngl_prec) :: rinc4(5) ! Initialize CCPP error handling variables errmsg = '' @@ -169,7 +158,6 @@ subroutine ozphys_time_vary_timestep_init(nPts, idate, fhour, jindx1, jindx2, la enddo enddo - ! return end subroutine ozphys_time_vary_timestep_init diff --git a/physics/ozphys_time_vary.meta b/physics/ozphys_time_vary.meta index 93aa4a3b0..75b8b8e4f 100644 --- a/physics/ozphys_time_vary.meta +++ b/physics/ozphys_time_vary.meta @@ -21,13 +21,6 @@ dimensions = () type = integer intent = in -[oz_phys] - standard_name = flag_for_nrl_2015_ozone_scheme - long_name = flag for new (2015) ozone physics - units = flag - dimensions = () - type = logical - intent = in [oz_lat] standard_name = ozone_data_latitude long_name = ozone data latitude From 724c20ff7d71ed26899642a810e84b294482cc7f Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Thu, 3 Aug 2023 16:39:29 -0600 Subject: [PATCH 33/81] Weiwei's suggested changes --- physics/docs/pdftxt/CLM_LAKE.txt | 3 ++- physics/docs/pdftxt/CU_GF_deep.txt | 16 ++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/physics/docs/pdftxt/CLM_LAKE.txt b/physics/docs/pdftxt/CLM_LAKE.txt index e22b096ec..f80e55b25 100644 --- a/physics/docs/pdftxt/CLM_LAKE.txt +++ b/physics/docs/pdftxt/CLM_LAKE.txt @@ -38,7 +38,8 @@ this dataset is referred to as GLOBv3 bathymetry in the UFS_UTL. @image html https://user-images.githubusercontent.com/12705538/250180794-76af93a2-a7ba-4e9a-9478-5657198862b8.png "Figure 1: Lake depths for lakes in the 3-km RRFS domain." width=600 -To cold-start the CLM lake model in the UFS weather model: +To cold-start the CLM lake model in regional configurations of the UFS: + - Use the CLM option in the input.nml \n - lkm = 1 \n - iopt_lake = 2 diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index 4b504863d..412dab5f0 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -6,18 +6,10 @@ The Grell-Freitas (GF) scheme, as described in Grell and Freitas (2014) \cite gr Freitas et al. (2018) \cite freitas_et_al_2018, Freitas et al. (2021) \cite freitas_et_al_2021, and Lin et al. (2022) \cite Lin_2022 follows the mass flux approach published by Grell (1993) \cite grell_1993. Further developments by Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Grell_2002 included implementing -stochastics through allowing parameter perturbations. The GF scheme takes into account aerosol dependence through rain generation (following -Berry (1968) \cite berry_1968 and evaporation formulations (following Jiang et al. (2010) \cite Jiang_2010 ), depending on the -cloud concentration nuclei at cloud base were added. The GF scheme includes mixed phase physics impact, momentum transport, - a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction -and transition from shallow, congestus and deep convection regimes. The vertical mass flux distribution of shallow, congestus and -deep convection regimes is characterized by Probability Density Functions (PDFs). The three PDFs are meant to represent the average -statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents -a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived -from the PDFs. Aerosol dependence (considered experimental and not supported in this release) is implemented through dependence of rain generation and -evaporation formulations depending on the cloud concentration nuclei at cloud base (Berry 1968 \cite berry_1968, -Jiang et al.(2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010 ). Wet scavenging is considered to add a memory impact. GF is able to transport tracers. -Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added, and they are used only for the RAP suite. +stochastics through allowing parameter perturbations. +The GF scheme includes mixed phase physics impact, momentum transport, a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction and transition from shallow, congestus and deep convection regimes. +The vertical mass flux distribution of shallow, congestus and deep convection regimes is characterized by Probability Density Functions (PDFs). The three PDFs are meant to represent the average statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived from the PDFs. +The GF scheme takes into account aerosol dependence (considered experimental and not supported in this release), which is implemented through rain generation (following Berry (1968) \cite berry_1968 and evaporation formulations depending on the cloud concentration nuclei at cloud base (Jiang et al. (2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010). Wet scavenging is considered to add a memory impact. GF is able to transport tracers. Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added, and they are used only for the RAP suite. The impacts of GF scheme in operational RAP/HRRR include: (a)uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes; (b)takes parameterization uncertainty into account by allowing parameters from multiple convective schemes which can be perturbed From bea77c8dd21b60b8af7603e494aed45abcccec40 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 10 Aug 2023 17:32:59 +0000 Subject: [PATCH 34/81] More reorganization. --- physics/GFS_physics_diagnostics.F90 | 97 +++++++++++++++++++ physics/GFS_physics_diagnostics.meta | 140 +++++++++++++++++++++++++++ physics/ozphys_2015.F90 | 80 ++++++--------- physics/ozphys_2015.meta | 91 +++++++---------- physics/ozphys_time_vary.F90 | 4 +- physics/physcons.F90 | 1 + 6 files changed, 300 insertions(+), 113 deletions(-) create mode 100644 physics/GFS_physics_diagnostics.F90 create mode 100644 physics/GFS_physics_diagnostics.meta diff --git a/physics/GFS_physics_diagnostics.F90 b/physics/GFS_physics_diagnostics.F90 new file mode 100644 index 000000000..0c6197bc2 --- /dev/null +++ b/physics/GFS_physics_diagnostics.F90 @@ -0,0 +1,97 @@ +! ########################################################################################### +!> \file GFS_physics_diagnostics.F90 +!! +! ########################################################################################### +module GFS_physics_diagnostics + use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec + implicit none + public GFS_physics_diagnostics_init, GFS_physics_diagnostics_run +contains + +! ########################################################################################### +! SUBROUTINE GFS_physics_diagnostics_init +! ########################################################################################### +!! \section arg_table_GFS_physics_diagnostics_init Argument Table +!! \htmlinclude GFS_physics_diagnostics_init.html +!! + subroutine GFS_physics_diagnostics_init(errmsg, errflg) + + ! Outputs + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + end subroutine GFS_physics_diagnostics_init + +! ########################################################################################### +! SUBROUTINE GFS_physics_diagnostics_run +! ########################################################################################### +!! \section arg_table_GFS_physics_diagnostics_run Argument Table +!! \htmlinclude GFS_physics_diagnostics_run.html +!! + subroutine GFS_physics_diagnostics_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, & + ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, dtend,& + errmsg, errflg) + ! Inputs + integer, intent(in) :: & + nCol, & ! Horizontal dimension + nLev, & ! Number of vertical layers + ntoz, & ! Index for ozone mixing ratio + ip_prod_loss, & ! Index for process in diagnostic tendency output + ip_ozmix, & ! Index for process in diagnostic tendency output + ip_temp, & ! Index for process in diagnostic tendency output + ip_overhead_ozone ! Index for process in diagnostic tendency output + integer, intent(in), dimension(:,:) :: & + dtidx ! Bookkeeping indices for GFS diagnostic tendencies + + ! Inputs (optional) + real(kind=kind_phys), intent(in), dimension(:,:), pointer, optional :: & + do3_dt_prd, & ! Physics tendency: production and loss effect + do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect + do3_dt_temp, & ! Physics tendency: temperature effect + do3_dt_ohoz ! Physics tendency: overhead ozone effect + + ! Outputs + real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & + dtend ! Diagnostic tendencies for state variables + character(len=*), intent(out) :: & + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag + + ! Locals + integer :: idtend + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! ####################################################################################### + ! + ! Ozone physics diagnostics + ! + ! ####################################################################################### + idtend = dtidx(100+ntoz,ip_prod_loss) + if (idtend >= 1 .and. associated(do3_dt_prd)) then + dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_prd + endif + ! + idtend = dtidx(100+ntoz,ip_ozmix) + if (idtend >= 1 .and. associated(do3_dt_ozmx)) then + dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_ozmx + endif + ! + idtend = dtidx(100+ntoz,ip_temp) + if (idtend >= 1 .and. associated(do3_dt_temp)) then + dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_temp + endif + ! + idtend = dtidx(100+ntoz,ip_overhead_ozone) + if (idtend >= 1 .and. associated(do3_dt_ohoz)) then + dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_ohoz + endif + + end subroutine GFS_physics_diagnostics_run + +end module GFS_physics_diagnostics diff --git a/physics/GFS_physics_diagnostics.meta b/physics/GFS_physics_diagnostics.meta new file mode 100644 index 000000000..b6036b0c9 --- /dev/null +++ b/physics/GFS_physics_diagnostics.meta @@ -0,0 +1,140 @@ +[ccpp-table-properties] + name = GFS_physics_diagnostics + type = scheme + dependencies = machine.F + +######################################################################## +[ccpp-arg-table] + name = GFS_physics_diagnostics_init + type = scheme +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + +######################################################################## +[ccpp-arg-table] + name = GFS_physics_diagnostics_run + type = scheme +[nCol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in +[nLev] + standard_name = vertical_layer_dimension + long_name = number of vertical layers + units = count + dimensions = () + type = integer + intent = in +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = mixed + dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) + type = real + kind = kind_phys + intent = inout +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in +[ntoz] + standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in +[ip_prod_loss] + standard_name = index_of_production_and_loss_process_in_cumulative_change_index + long_name = index of production and loss effect in photochemistry process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[ip_ozmix] + standard_name = index_of_ozone_mixing_ratio_process_in_cumulative_change_index + long_name = index of ozone mixing ratio effect in photochemistry process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[ip_temp] + standard_name = index_of_temperature_process_in_cumulative_change_index + long_name = index of temperature effect in photochemistry process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[ip_overhead_ozone] + standard_name = index_of_overhead_process_in_cumulative_change_index + long_name = index of overhead ozone effect in photochemistry process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[do3_dt_prd] + standard_name = ozone_tendency_due_to_production_and_loss_rate + long_name = ozone tendency due to production and loss rate + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[do3_dt_ozmx] + standard_name = ozone_tendency_due_to_ozone_mixing_ratio + long_name = ozone tendency due to ozone mixing ratio + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[do3_dt_temp] + standard_name = ozone_tendency_due_to_temperature + long_name = ozone tendency due to temperature + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[do3_dt_ohoz] + standard_name = ozone_tendency_due_to_overhead_ozone_column + long_name = ozone tendency due to overhead ozone column + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out \ No newline at end of file diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index 110ba02e2..9898c71e4 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -63,42 +63,35 @@ end subroutine ozphys_2015_init !! \htmlinclude ozphys_2015_run.html !! subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_data, & - pl_coeff, delp, ldiag3d, dtend, dtidx, ntoz, index_of_process_prod_loss, & - index_of_process_ozmix, index_of_process_temp, index_of_process_overhead_ozone, & - con_g, errmsg, errflg) + pl_coeff, delp, con_1ovg, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) ! Inputs logical, intent(in) :: & - oz_phys, & ! - ldiag3d ! Flag to output GFS diagnostic tendencies + oz_phys ! Flag for ozone_physics_2015 scheme. real(kind_phys),intent(in) :: & - con_g ! Physical constant: Gravitational acceleration (ms-2) + con_1ovg ! Physical constant: One divided by gravitational acceleration (m-1 s2) integer, intent(in) :: & - im, & ! Horizontal dimension - levs, & ! Number of vertical layers - ko3, & ! Number of vertical layers in ozone forcing data - pl_coeff, & ! Number of coefficients in ozone forcing data - ntoz, & ! Index for ozone mixing ratio - index_of_process_prod_loss, & ! Index for process in diagnostic tendency output - index_of_process_ozmix, & ! Index for process in diagnostic tendency output - index_of_process_temp, & ! Index for process in diagnostic tendency output - index_of_process_overhead_ozone ! Index for process in diagnostic tendency output - integer, intent(in), dimension(:,:) :: & - dtidx ! Bookkeeping indices for GFS diagnostic tendencies + im, & ! Horizontal dimension + levs, & ! Number of vertical layers + ko3, & ! Number of vertical layers in ozone forcing data + pl_coeff ! Number of coefficients in ozone forcing data real(kind_phys), intent(in) :: & - dt ! Physics timestep (seconds) + dt ! Physics timestep (seconds) real(kind_phys), intent(in), dimension(:) :: & - po3 ! Natural log of ozone forcing data pressure levels + po3 ! Natural log of ozone forcing data pressure levels real(kind_phys), intent(in), dimension(:,:) :: & - prsl, & ! Air-pressure (Pa) - tin, & ! Temperature of new-state (K) - delp ! Difference between mid-layer pressures (Pa) + prsl, & ! Air-pressure (Pa) + tin, & ! Temperature of new-state (K) + delp ! Difference between mid-layer pressures (Pa) real(kind_phys), intent(in), dimension(:,:,:) :: & - oz_data ! Ozone forcing data + oz_data ! Ozone forcing data - ! In/Outs - real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & - dtend ! Diagnostic tendencies for state variables + ! Outputs (optional) + real(kind=kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + do3_dt_prd, & ! Physics tendency: production and loss effect + do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect + do3_dt_temp, & ! Physics tendency: temperature effect + do3_dt_ohoz ! Physics tendency: overhead ozone effect ! Outputs real(kind=kind_phys), intent(inout), dimension(:,:) :: & @@ -110,9 +103,7 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d ! Locals integer :: k, kmax, kmin, l, i, j - integer, dimension(4) :: idtend logical, dimension(im) :: flg - real :: gravi real(kind_phys) :: pmax, pmin, tem, temp real(kind_phys), dimension(im) :: wk1, wk2, wk3, ozib real(kind_phys), dimension(im,pl_coeff) :: prod @@ -130,19 +121,8 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d return endif - ! Are UFS diagnostic tendencies requested? If so, set up bookeeping indices... - if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 - idtend(2) = dtidx(100+ntoz,index_of_process_ozmix) ! was ozp2 - idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 - idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 - else - idtend=0 - endif - ! Temporaries ozi = oz - gravi=1.0/con_g colo3(:,levs+1) = 0.0 coloz(:,levs+1) = 0.0 @@ -194,8 +174,8 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d enddo enddo do i=1,im - colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l)*gravi - coloz(i,l) = coloz(i,l+1) + prod(i,6) * delp(i,l)*gravi + colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l)*con_1ovg + coloz(i,l) = coloz(i,l+1) + prod(i,6) * delp(i,l)*con_1ovg prod(i,2) = min(prod(i,2), 0.0) enddo do i=1,im @@ -204,18 +184,12 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d + prod(i,4) * (colo3(i,l)-coloz(i,l)) oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) enddo - if(idtend(1)>=1) then - dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + (prod(:,1)-prod(:,2)*prod(:,6))*dt - endif - if(idtend(2)>=1) then - dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + (oz(:,l) - ozib(:)) - endif - if(idtend(3)>=1) then - dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + prod(:,3)*(tin(:,l)-prod(:,5))*dt - endif - if(idtend(4)>=1) then - dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + prod(:,4) * (colo3(:,l)-coloz(:,l))*dt - endif + + ! Diagnostics (optional) + if (associated(do3_dt_prd)) do3_dt_prd(:,l) = (prod(:,1)-prod(:,2)*prod(:,6))*dt + if (associated(do3_dt_ozmx)) do3_dt_ozmx(:,l) = (oz(:,l) - ozib(:)) + if (associated(do3_dt_temp)) do3_dt_temp(:,l) = prod(:,3)*(tin(:,l)-prod(:,5))*dt + if (associated(do3_dt_ohoz)) do3_dt_ohoz(:,l) = prod(:,4) * (colo3(:,l)-coloz(:,l))*dt enddo return diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 4b19f2c04..1d8fba74e 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -125,71 +125,46 @@ type = real kind = kind_phys intent = in -[ldiag3d] - standard_name = flag_for_diagnostics_3D - long_name = flag for calculating 3-D diagnostic fields - units = flag +[con_1ovg] + standard_name = one_divided_by_the_gravitational_acceleration + long_name = inverse of gravitational acceleration + units = s2 m-1 dimensions = () - type = logical + type = real + kind = kind_phys intent = in -[dtend] - standard_name = cumulative_change_of_state_variables - long_name = diagnostic tendencies for state variables - units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) +[do3_dt_prd] + standard_name = ozone_tendency_due_to_production_and_loss_rate + long_name = ozone tendency due to production and loss rate + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys intent = inout -[dtidx] - standard_name = cumulative_change_of_state_variables_outer_index - long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index - units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) - type = integer - intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in -[index_of_process_prod_loss] - standard_name = index_of_production_and_loss_process_in_cumulative_change_index - long_name = index of production and loss effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_ozmix] - standard_name = index_of_ozone_mixing_ratio_process_in_cumulative_change_index - long_name = index of ozone mixing ratio effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_temp] - standard_name = index_of_temperature_process_in_cumulative_change_index - long_name = index of temperature effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_overhead_ozone] - standard_name = index_of_overhead_process_in_cumulative_change_index - long_name = index of overhead ozone effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[con_g] - standard_name = gravitational_acceleration - long_name = gravitational acceleration - units = m s-2 - dimensions = () +[do3_dt_ozmx] + standard_name = ozone_tendency_due_to_ozone_mixing_ratio + long_name = ozone tendency due to ozone mixing ratio + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = in + intent = inout +[do3_dt_temp] + standard_name = ozone_tendency_due_to_temperature + long_name = ozone tendency due to temperature + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[do3_dt_ohoz] + standard_name = ozone_tendency_due_to_overhead_ozone_column + long_name = ozone tendency due to overhead ozone column + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/ozphys_time_vary.F90 b/physics/ozphys_time_vary.F90 index a0a778c36..ddac1dcd4 100644 --- a/physics/ozphys_time_vary.F90 +++ b/physics/ozphys_time_vary.F90 @@ -16,8 +16,8 @@ module ozphys_time_vary !! \htmlinclude ozphys_time_vary_init.html !! ! ########################################################################################### - subroutine ozphys_time_vary_init(nPts, latsozp, oz_lat, dlat, jindx1, jindx2, & - ddy, errmsg, errflg) + subroutine ozphys_time_vary_init(nPts, latsozp, oz_lat, dlat, jindx1, jindx2, ddy, & + errmsg, errflg) ! Inputs integer, intent(in) :: & nPts, & ! Horizontal dimension diff --git a/physics/physcons.F90 b/physics/physcons.F90 index e7ec8fb77..19a03ef20 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -97,6 +97,7 @@ module physcons real(kind=kind_phys),parameter:: con_dldt =con_cvap-con_cliq real(kind=kind_phys),parameter:: con_xpona =-con_dldt/con_rv real(kind=kind_phys),parameter:: con_xponb =-con_dldt/con_rv+con_hvap/(con_rv*con_ttp) + real(kind=kind_phys),parameter:: con_1ovg = 1._kind_phys/con_g !> \name Other Physics/Chemistry constants (source: 2002 CODATA) real(kind=kind_phys),parameter:: con_c =2.99792458e+8_kind_phys !< speed of light (\f$m/s\f$) From 816f607d78a4e89e79f405865f7dfceee3b225fd Mon Sep 17 00:00:00 2001 From: "Michael Kavulich, Jr" Date: Mon, 14 Aug 2023 11:01:43 -0600 Subject: [PATCH 35/81] More fixes from Weiwei --- physics/docs/pdftxt/CLM_LAKE.txt | 2 +- physics/docs/pdftxt/CU_GF_deep.txt | 2 +- physics/docs/pdftxt/SRW_all_schemes_list.txt | 2 +- physics/docs/pdftxt/SRW_mainpage.txt | 13 ++++++------- physics/docs/pdftxt/THOMPSON.txt | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/physics/docs/pdftxt/CLM_LAKE.txt b/physics/docs/pdftxt/CLM_LAKE.txt index f80e55b25..498797511 100644 --- a/physics/docs/pdftxt/CLM_LAKE.txt +++ b/physics/docs/pdftxt/CLM_LAKE.txt @@ -22,7 +22,7 @@ in the lake. Testing of the CLM lake model within RAP/HRRR applications showed computational efficiency of the model with no change of even 0.1% in run time. The lake/snow variables have to be continuously transfered within the CLM lake model from one forecast to another, constrained by the atmospheric data assimilation. The lake-cycling initialization in RAP/HRRR has been effective overall, owing to -accurate houly estimates of near-surface temperature, moisture and winds, and shortwave and longwave estimates provided to the 1-d CLM +accurate hourly estimates of near-surface temperature, moisture and winds, and shortwave and longwave estimates provided to the 1-d CLM lake model every time step (Benjamin et al. (2022) \cite gmd-15-6659-2022). Cycling techniques showed improvements over initializing lake temperatures from the SST analysis, which is problematic for small water bodies. The improvements are particularly eminent during transition periods between cold and warm seasons, and in the regions with anomalous weather conditions. The CLM lake model has the potential diff --git a/physics/docs/pdftxt/CU_GF_deep.txt b/physics/docs/pdftxt/CU_GF_deep.txt index 412dab5f0..ca06666e5 100644 --- a/physics/docs/pdftxt/CU_GF_deep.txt +++ b/physics/docs/pdftxt/CU_GF_deep.txt @@ -9,7 +9,7 @@ Further developments by Grell and \f$D\acute{e}v\acute{e}nyi\f$ (2002) \cite Gre stochastics through allowing parameter perturbations. The GF scheme includes mixed phase physics impact, momentum transport, a diurnal cycle closure (Bechtold et al. (2014) \cite bechtold_et_al_2014 ), and a trimodal spectral size to simulate the interaction and transition from shallow, congestus and deep convection regimes. The vertical mass flux distribution of shallow, congestus and deep convection regimes is characterized by Probability Density Functions (PDFs). The three PDFs are meant to represent the average statistical mass flux characteristic of deep, congestus, and shallow (respectively) plumes in the grid area. Each PDF therefore represents a spectrum of plumes within the grid box. Forcing is different for each characteristic type. Entrainment and detrainment are derived from the PDFs. -The GF scheme takes into account aerosol dependence (considered experimental and not supported in this release), which is implemented through rain generation (following Berry (1968) \cite berry_1968 and evaporation formulations depending on the cloud concentration nuclei at cloud base (Jiang et al. (2010) \cite Jiang_2010, and Lee and Feingold (2010) \cite lee_and_feingold_2010). Wet scavenging is considered to add a memory impact. GF is able to transport tracers. Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added, and they are used only for the RAP suite. +The GF scheme takes into account aerosol dependence (considered experimental and not supported in this release), which is implemented through rain generation (following Berry (1968) \cite berry_1968 and evaporation formulations depending on the cloud concentration nuclei at cloud base (Jiang et al. (2010) \cite Jiang_2010), and Lee and Feingold (2010) \cite lee_and_feingold_2010). Wet scavenging is considered to add a memory impact. GF is able to transport tracers. Recently, GPU capabilities and cap suppressing (\p do_cap_suppress) based on radar data assimilation have been added, and they are used only for the RAP suite. The impacts of GF scheme in operational RAP/HRRR include: (a)uses mass-flux schemes, which are more physically realistic than (sounding) adjustment schemes; (b)takes parameterization uncertainty into account by allowing parameters from multiple convective schemes which can be perturbed diff --git a/physics/docs/pdftxt/SRW_all_schemes_list.txt b/physics/docs/pdftxt/SRW_all_schemes_list.txt index 16a1727e6..d9ef65315 100644 --- a/physics/docs/pdftxt/SRW_all_schemes_list.txt +++ b/physics/docs/pdftxt/SRW_all_schemes_list.txt @@ -68,7 +68,7 @@ to the parameterization. - If the in-core saturation adjustment is used (\p do_sat_adj=.true.), it is invoked at shorter timesteps along with the dynamical solver. -The UFS Short Range Weather Application (SRW App) v3.0.0 supports four physicsphysics suites. +The UFS Short Range Weather Application (SRW App) v3.0.0 supports four physics suites. Table 1. Physics suites and primary schemes supported in SRW v3.0.0 \tableofcontents diff --git a/physics/docs/pdftxt/SRW_mainpage.txt b/physics/docs/pdftxt/SRW_mainpage.txt index 5e854034c..1f756c3ff 100644 --- a/physics/docs/pdftxt/SRW_mainpage.txt +++ b/physics/docs/pdftxt/SRW_mainpage.txt @@ -12,13 +12,12 @@ supports suites: - \ref WoFS_v0_page - \ref rap_suite_page -\attention Here all supported suites are a recent snapshot of - -the UFS fork for CCPP . In this regard, GFS_v16 Suite is -not the same code as in the operational GFS v16. First of all, the operational GFS_v16 does not use CCPP at all. -Secondly, most of physics schemes hosted in CCPP repository have marched ahead since GFS was updated to version 16.0 on 22 March 2021. -This implication should be also applied to all other suites: as such, RAP/HRRR suites in this release are +\attention Important note:
        All supported suites are a recent snapshot of +the UFS fork for CCPP . In this regard, they may differ substantially from the suites used in operational models. For example, the GFS_v16 Suite is +not the same code as in the operational GFS v16. While the suite is nominally the same, using the same schemes as the operational version, most +of the individual physics schemes hosted in the CCPP repository have changed, including new development and bug fixes compared to the versions included +in GFS version 16.0, which was released on 22 March 2021. +This implication should be also applied to all other suites: RAP/HRRR suites in this release do not correspond directly to the the evolving version of the RAP/HRRR physics in operations. - */ diff --git a/physics/docs/pdftxt/THOMPSON.txt b/physics/docs/pdftxt/THOMPSON.txt index 4ad481887..914a95922 100644 --- a/physics/docs/pdftxt/THOMPSON.txt +++ b/physics/docs/pdftxt/THOMPSON.txt @@ -89,8 +89,8 @@ Two namelist variables control the usage of the semi-Lagrangian sedimentation, \ the upper level and reduce the OLR bias. - For the non-aerosol option of the scheme, the cloud number concentration is divided into two parts (over land and others). The number -concentration over the ocean is reduced to a smaller numer (50/L) from its default (100/L). The purpose is to reduce the bias in surface -downward shortwave radiative flux off the coastal regional including the Southeast Pacific. +concentration over the ocean is reduced to a smaller number (50/L) from its default (100/L). The purpose is to reduce the bias in surface +downward shortwave radiative flux off the coastal region including the Southeast Pacific. \section intra_thompson Intraphysics Communication - \ref arg_table_mp_thompson_run From 9c342a5f5841656629d85589fec5507657a561f7 Mon Sep 17 00:00:00 2001 From: "Timothy S. Sliwinski" Date: Tue, 15 Aug 2023 00:23:30 +0000 Subject: [PATCH 36/81] Adding OpenACC statements to accelerate MYNN surface scheme performance through GPU offloading Overview: --------- With very minimal changes to the original code of the scheme, the MYNN surface scheme has been enhanced with OpenACC statements which introduce the capability for offloading computational execution to OpenACC-supported accelerator devices (e.g. Nvidia GPUs). Since the scheme operates by looping multiple times over independent vertical columns, the overall computational strategy maps well to GPU hardware where multiple iterations of each loop can be run in parallel with SIMD methods. Data movement has been optimized to ensure data transfers from host memory to device memory are limited as data movement is a significant source of latency when performing offloading to accelerator devices. Performance increases on a GPU ranged from a 3.3x slowdown to a 41.9x speedup versus CPU execution (See the Performance section for more information). MYNN Scheme Code Changes: ------------------------- A few minor code changes were unavoidable due to certain limitations on what OpenACC is able to execute on the accelerator within kernel and parallel blocks. A complete list of these changes is below: 1. Adding preprocessor directives to disable multiple standard output statements, including those used for debug output. The challenges of these are different depending on the view from the host or accelerator. When run in parallel on the accelerator, these statements are not guaranteed to be presented to the user in-order. Also, in limited cases, these statements would have to output variables that were not transferred to the GPU because they were not necessary for computation, introducing additional transfer overhead to ensure they were present only for these output statements. Further, with hundreds of threads executing at once, the output could be quite large and unwieldy. That said, some of these statements could have been run on the host to alleviate the problems introduced by parallelization on the device. However, this would have necessitated device-to-host transfers of variables to ensure values being output were correct while introducing additional transfer overhead costs to performance. Disabling these for accelerators only seemed the best course of action. These are disabled based on the presence of the __OPENACC compile time variable to ensure these are only disabled when the code is compiled for accelerator usage and does not affect CPU execution. 2. Changing the CCPP errmsg variable declaration on line 349 of module_sf_mynn.F90 to be a fixed 200 length character array. Since this variable is set at times in the middle of accelerator kernel regions, it must be present on the accelerator. However, when defined with "len=*", it is an assumed-size array, which OpenACC does not support on the accelerator. Rather than disable this variable completely, changing it to a fixed length allows it to be transferred to/from the accelerator and used. This change is enforced by preprocessor directives based on the presence of the __OPENACC compile time variable and ensures this change only occurs when the code is compiled for accelerator usage, therefore it does not affect CPU execution. 3. Adding preprocessor directives to "move" return statement on line 1399 of module_sf_mynn.F90 out of the main i-loop and instead execute it at line 2006 if errflg is set to 1. This change is necessary as OpenACC accelerator code cannot execute branching such as this, so this conditional return statement can only be executed by the host. This change is enforced by preprocessor directives based on the presence of the __OPENACC compile time variable and ensures this change only occurs when the code is compiled for accelerator usage, therefore it does not affect CPU execution. 4. Commenting out the zLhux local variable in the zolri function over lines 3671 to 3724. The zLhux variable appears to have been used only to capture values of zolri over multiple iterations, but is never used or passed along after this collection is completed. Since this array would be an assumed-size array based on the value of nmax at runtime, it would have been unsupported by OpenACC. But, since it is unused, the choice was made to simply comment out the variable and all lines related to it, allow the remaining code of the function to executed on the accelerator. Performance: ------------ Performance testing was performed on a single Nvidia P100 GPU versus a single 10-core Haswell CPU on Hera. Since the MYNN Surface scheme is a serial code, parallelization on the 10-core Haswell was performed using simple data partitioning across the 10 cores using OpenMP threads such that each thread received a near equal amount of data. When data movement was fully optimized for the accelerator -- meaning all CCPP Physics input variables were pre-loaded on the GPU as they would be when the CCPP infrastructure fully supports accelerator offloading -- GPU performance speedups range between 11.8X and 41.8X over the 10-core Haswell when the number of vertical columns (i) was varied between 150k and 750k, respectively. Performance Timings (optimized data movement) Columns (i) \ Compute | CPU | GPU | GPU Speedup | --------------------------------------------------------------------------- 150,000 | 263 ms | 22 ms | 11.9x | --------------------------------------------------------------------------- 450,000 | 766 ms | 28 ms | 27.0x | --------------------------------------------------------------------------- 750,000 | 1314 ms | 31 ms | 41.9x | --------------------------------------------------------------------------- However, standalone performance -- meaning all CCPP Physics input variables were initially loaded onto the GPU only after being declared in the MYNN subroutine calls -- was slightly less performant than the 10-core Haswell due to the additional overhead incurred by the data transfers. In this case, the decreasing performance lag for the GPU behind the CPU as the number of columns increases is due to the GPU performing better with more data (i.e. higher computational throughput) than the CPU despite more data needing to be transferred to the device. Performance Timings (standalone) Columns (i) \ Compute | CPU | GPU | GPU Speedup | ------------------------------------------------------------------------------- 150,000 | 263 ms | 862 ms | -3.3x | ------------------------------------------------------------------------------- 450,000 | 766 ms | 1767 ms | -2.3x | ------------------------------------------------------------------------------- 750,000 | 1314 ms | 2776 ms | -2.1x | ------------------------------------------------------------------------------- With these results, it is clear that this scheme will perform at its best on accelerators once the CCPP infrastructure also supports OpenACC. Contact Information: -------------------- This enhancement was performed by Timothy Sliwinski at NOAA GSL. Questions regarding these changes should be directed to timothy.s.sliwinski@noaa.gov --- physics/module_sf_mynn.F90 | 331 ++++++++++++++++++++++++++++++++++-- physics/mynnsfc_wrapper.F90 | 31 ++++ 2 files changed, 351 insertions(+), 11 deletions(-) diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index c60247cf6..399b1ee83 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -106,6 +106,7 @@ MODULE module_sf_mynn REAL(kind_phys), DIMENSION(0:1000 ),SAVE :: psim_stab,psim_unstab, & psih_stab,psih_unstab +!$acc declare create(psim_stab, psim_unstab, psih_stab, psih_unstab) CONTAINS @@ -344,7 +345,12 @@ SUBROUTINE SFCLAY_mynn( & & qsfc_wat, qsfc_lnd, qsfc_ice ! CCPP error handling +#ifndef _OPENACC character(len=*), intent(inout) :: errmsg +#else +!Necessary since OpenACC does not support assumed-size arrays + character(len=200), intent(inout) :: errmsg +#endif integer, intent(inout) :: errflg !ADDITIONAL OUTPUT @@ -371,6 +377,20 @@ SUBROUTINE SFCLAY_mynn( & errflg = 0 errmsg = '' +!$acc enter data copyin( dz8w,U3D,V3D,QV3D,QC3D,P3D,T3D, & +!$acc pattern_spp_sfc, errmsg) + +!$acc enter data copyin( UST_WAT(:), UST_LND(:), UST_ICE(:), & +!$acc MOL(:), QFLX(:), HFLX(:), & +!$acc QSFC(:), QSFC_WAT(:), QSFC_LND(:), & +!$acc QSFC_ICE(:)) + +!$acc enter data create( dz8w1d(:), dz2w1d(:), U1D(:), & +!$acc V1D(:), U1D2(:), V1D2(:), & +!$acc QV1D(:), QC1D(:), P1D(:), & +!$acc T1D(:), rstoch1D(:), qstar(:)) + + IF (debug_code >= 1) THEN write(*,*)"======= printing of constants:" write(*,*)"cp=", cp," g=", grav @@ -382,6 +402,10 @@ SUBROUTINE SFCLAY_mynn( & itf=ite !MIN0(ite,ide-1) ktf=kte !MIN0(kte,kde-1) +!$acc parallel loop present(dz8w,U3D,V3D,QV3D,QC3D,P3D,T3D, & +!$acc pattern_spp_sfc,dz8w1d,dz2w1d,U1D, & +!$acc V1D,U1D2,V1D2,QV1D,QC1D,P1D,T1D, & +!$acc rstoch1D,qstar) DO i=its,ite dz8w1d(I) = dz8w(i,kts) dz2w1d(I) = dz8w(i,kts+1) @@ -403,6 +427,9 @@ SUBROUTINE SFCLAY_mynn( & ENDDO IF (itimestep==1 .AND. iter==1) THEN +!$acc parallel loop present(U1D,V1D,UST_WAT,UST_LND,UST_ICE,MOL, & +!$acc QFLX,HFLX,QV3D,QSFC,QSFC_WAT, & +!$acc QSFC_LND,QSFC_ICE) DO i=its,ite IF (.not. flag_restart) THEN !Everything here is used before calculated @@ -432,6 +459,9 @@ SUBROUTINE SFCLAY_mynn( & ENDDO ENDIF +!$acc exit data delete( dz8w,U3D,V3D,QV3D,QC3D,P3D,T3D, & +!$acc pattern_spp_sfc, QC1D) + CALL SFCLAY1D_mynn(flag_iter, & J,U1D,V1D,T1D,QV1D,P1D,dz8w1d, & U1D2,V1D2,dz2w1d, & @@ -471,6 +501,16 @@ SUBROUTINE SFCLAY_mynn( & its,ite, jts,jte, kts,kte, & errmsg, errflg ) +!$acc exit data copyout( UST_WAT(:), UST_LND(:), UST_ICE(:), & +!$acc MOL(:), QFLX(:), HFLX(:), & +!$acc QSFC(:), QSFC_WAT(:), QSFC_LND(:), & +!$acc QSFC_ICE(:), errmsg) + +!$acc exit data delete( dz8w1d(:), dz2w1d(:), U1D(:), & +!$acc V1D(:), U1D2(:), V1D2(:), & +!$acc QV1D(:), T1D(:), P1D(:), & +!$acc rstoch1D(:), qstar(:)) + END SUBROUTINE SFCLAY_MYNN !------------------------------------------------------------------- @@ -626,7 +666,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !JOE-end ! CCPP error handling +#ifndef _OPENACC character(len=*), intent(inout) :: errmsg +#else +! Necessary since OpenACC does not support assumed-size arrays + character(len=200), intent(inout) :: errmsg +#endif integer, intent(inout) :: errflg !---------------------------------------------------------------- @@ -679,6 +724,58 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & errflg = 0 errmsg = '' !------------------------------------------------------------------- +!$acc update device(psim_stab, psim_unstab, psih_stab, psih_unstab) + +!$acc enter data create( ZA, ZA2, THV1D, TH1D, TC1D, TV1D, & +!$acc RHO1D, QVSH, PSIH2, PSIM10, PSIH10, WSPDI, & +!$acc GOVRTH, PSFC, THCON, & +!$acc zratio_lnd, zratio_ice, zratio_wat, & +!$acc TSK_lnd, TSK_ice, TSK_wat, & +!$acc THSK_lnd, THSK_ice, THSK_wat, & +!$acc THVSK_lnd, THVSK_ice, THVSK_wat, & +!$acc GZ1OZ0_lnd, GZ1OZ0_ice, GZ1OZ0_wat, & +!$acc GZ1OZt_lnd, GZ1OZt_ice, GZ1OZt_wat, & +!$acc GZ2OZ0_lnd, GZ2OZ0_ice, GZ2OZ0_wat, & +!$acc GZ2OZt_lnd, GZ2OZt_ice, GZ2OZt_wat, & +!$acc GZ10OZ0_lnd, GZ10OZ0_ice, GZ10OZ0_wat, & +!$acc GZ10OZt_lnd, GZ10OZt_ice, GZ10OZt_wat, & +!$acc ZNTstoch_lnd, ZNTstoch_ice, ZNTstoch_wat, & +!$acc ZT_lnd, ZT_ice, ZT_wat, & +!$acc ZQ_lnd, ZQ_ice, ZQ_wat, & +!$acc PSIQ_lnd, PSIQ_ice, PSIQ_wat, & +!$acc PSIQ2_lnd, PSIQ2_ice, PSIQ2_wat, & +!$acc QSFCMR_lnd, QSFCMR_ice, QSFCMR_wat ) + +!$acc enter data copyin(flag_iter, dry, wet, icy, CPM, MAVAIL, & +!$acc QFX, FLHC, FLQC, CHS, CH, CHS2, CQS2, USTM, & +!$acc HFX, LH, wstar, qstar, PBLH, ZOL, MOL, RMOL, & +!$acc T2, TH2, Q2, QV1D, PSFCPA, & +!$acc WSPD, U10, V10, U1D, V1D, U1D2, V1D2, & +!$acc T1D, P1D, rstoch1D, sigmaf, & +!$acc shdmax, vegtype, z0pert, ztpert, dx, QGH, & +!$acc dz2w1d, dz8w1d, & +!$acc stress_wat, stress_lnd, stress_ice, & +!$acc rb_wat, rb_lnd, rb_ice, & +!$acc tskin_wat, tskin_lnd, tskin_ice, & +!$acc tsurf_wat, tsurf_lnd, tsurf_ice, & +!$acc psim, psih, & +!$acc UST_wat, UST_lnd, UST_ice, & +!$acc ZNT_wat, ZNT_lnd, ZNT_ice, & +!$acc QSFC, QSFC_lnd, QSFC_wat, QSFC_ice, & +!$acc QFLX, QFLX_lnd, QFLX_wat, QFLX_ice, & +!$acc HFLX, HFLX_lnd, HFLX_wat, HFLX_ice, & +!$acc PSIX_wat, PSIX_lnd, PSIX_ice, & +!$acc PSIX10_wat, PSIX10_lnd, PSIX10_ice, & +!$acc PSIT2_lnd, PSIT2_wat, PSIT2_ice, & +!$acc PSIT_lnd, PSIT_wat, PSIT_ice, & +!$acc ch_lnd, ch_wat, ch_ice, & +!$acc cm_lnd, cm_wat, cm_ice, & +!$acc snowh_lnd, errmsg) + +!$acc parallel loop present(PSFCPA, PSFC, QSFC, T1D, flag_iter, & +!$acc QSFC_wat, QSFCMR_wat, wet, TSK_wat, tskin_wat, & +!$acc QSFC_lnd, QSFCMR_lnd, dry, TSK_lnd, tskin_lnd, & +!$acc QSFC_ice, QSFCMR_ice, icy, TSK_ice, tskin_ice) DO I=its,ite ! PSFC ( in cmb) is used later in saturation checks @@ -700,7 +797,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF QSFC_wat(I)=EP2*E1/(PSFC(I)-ep3*E1) !specific humidity QSFCMR_wat(I)=EP2*E1/(PSFC(I)-E1) !mixing ratio +#ifndef _OPENACC IF(QSFC_wat(I)>1..or.QSFC_wat(I)<0.) print *,' QSFC_wat(I)',itimestep,i,QSFC_wat(I),TSK_wat(i) +#endif ENDIF IF (dry(i)) THEN TSK_lnd(I) = tskin_lnd(i) @@ -720,7 +819,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & QSFC_lnd(I)=0.5*(QSFC_lnd(I) + QSFC(I)) QSFCMR_lnd(I)=QSFC_lnd(I)/(1.-QSFC_lnd(I)) !mixing ratio endif ! lsm +#ifndef _OPENACC IF(QSFC_lnd(I)>1..or.QSFC_lnd(I)<0.) print *,' QSFC_lnd(I)',itimestep,i,QSFC_lnd(I),Tskin_lnd(i),tsurf_lnd(i),qsfc(i) +#endif ENDIF IF (icy(i)) THEN TSK_ice(I) = tskin_ice(i) @@ -738,7 +839,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & QSFC_ice(I)=EP2*E1/(PSFC(I)-ep3*E1) !specific humidity QSFCMR_ice(I)=EP2*E1/(PSFC(I)-E1) !mixing ratio endif ! lsm +#ifndef _OPENACC IF(QSFC_ice(I)>1..or.QSFC_ice(I)<0.) print *,' QSFC_ice(I)',itimestep,i,QSFC_ice(I),TSK_ice(i) +#endif ENDIF ELSE @@ -791,6 +894,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & endif ! flag_iter ENDDO +#ifndef _OPENACC IF (debug_code >= 1) THEN write(0,*)"ITIMESTEP=",ITIMESTEP," iter=",iter DO I=its,ite @@ -815,7 +919,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF ENDDO ENDIF +#endif +!$acc parallel loop present(PSFC, PSFCPA, QVSH, QV1D, THCON, flag_iter, & +!$acc dry, tskin_lnd, TSK_lnd, tsurf_lnd, THSK_lnd, THVSK_lnd, qsfc_lnd, & +!$acc icy, tskin_ice, TSK_ice, tsurf_ice, THSK_ice, THVSK_ice, qsfc_ice, & +!$acc wet, tskin_wat, TSK_wat, tsurf_wat, THSK_wat, THVSK_wat) DO I=its,ite ! PSFC ( in cmb) is used later in saturation checks PSFC(I)=PSFCPA(I)/1000. @@ -829,8 +938,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_lnd(I) = TSK_lnd(I)*THCON(I) !(K) THVSK_lnd(I) = THSK_lnd(I)*(1.+EP1*qsfc_lnd(I)) +#ifndef _OPENACC if(THVSK_lnd(I) < 170. .or. THVSK_lnd(I) > 360.) & print *,'THVSK_lnd(I)',itimestep,i,THVSK_lnd(I),THSK_lnd(i),tsurf_lnd(i),tskin_lnd(i),qsfc_lnd(i) +#endif endif if(icy(i)) then TSK_ice(I) = tskin_ice(i) @@ -838,8 +949,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_ice(I) = TSK_ice(I)*THCON(I) !(K) THVSK_ice(I) = THSK_ice(I)*(1.+EP1*qsfc_ice(I)) !(K) +#ifndef _OPENACC if(THVSK_ice(I) < 170. .or. THVSK_ice(I) > 360.) & print *,'THVSK_ice(I)',itimestep,i,THVSK_ice(I),THSK_ice(i),tsurf_ice(i),tskin_ice(i),qsfc_ice(i) +#endif endif if(wet(i)) then TSK_wat(I) = tskin_wat(i) @@ -847,24 +960,29 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_wat(I) = TSK_wat(I)*THCON(I) !(K) THVSK_wat(I) = THSK_wat(I)*(1.+EP1*QVSH(I)) !(K) +#ifndef _OPENACC if(THVSK_wat(I) < 170. .or. THVSK_wat(I) > 360.) & print *,'THVSK_wat(I)',i,THVSK_wat(I),THSK_wat(i),tsurf_wat(i),tskin_wat(i),qsfc_wat(i) +#endif endif endif ! flag_iter ENDDO +!$acc parallel loop present(TH1D, T1D, P1D, TC1D) DO I=its,ite ! CONVERT LOWEST LAYER TEMPERATURE TO POTENTIAL TEMPERATURE: TH1D(I)=T1D(I)*(100000./P1D(I))**ROVCP !(Theta, K) TC1D(I)=T1D(I)-273.15 !(T, Celsius) ENDDO +!$acc parallel loop present(THV1D, TH1D, QVSH, TV1D, T1D) DO I=its,ite ! CONVERT TO VIRTUAL TEMPERATURE THV1D(I)=TH1D(I)*(1.+EP1*QVSH(I)) !(K) TV1D(I)=T1D(I)*(1.+EP1*QVSH(I)) !(K) ENDDO +!$acc parallel loop present(RHO1D, P1D, TV1D, TH1D, ZA, ZA2, dz2w1d, dz8w1d, GOVRTH) DO I=its,ite RHO1D(I)=P1D(I)/(Rd*TV1D(I)) !now using value calculated in sfc driver ZA(I)=0.5*dz8w1d(I) !height of first half-sigma level @@ -873,11 +991,13 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDDO !tgs - should QFX and HFX be separate for land, ice and water? +!$acc parallel loop present(QFX, QFLX, RHO1D, HFX, HFLX) DO I=its,ite QFX(i)=QFLX(i)*RHO1D(I) HFX(i)=HFLX(i)*RHO1D(I)*cp ENDDO +#ifndef _OPENACC IF (debug_code ==2) THEN !write(*,*)"ITIMESTEP=",ITIMESTEP DO I=its,ite @@ -890,7 +1010,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & write(*,*)"RHO1D=", RHO1D(i)," GOVRTH=",GOVRTH(i) ENDDO ENDIF +#endif +!$acc parallel loop present(T1D,P1D,QGH,QV1D,CPM) DO I=its,ite ! QGH CHANGED TO USE LOWEST-LEVEL AIR TEMP ! Q2SAT = QGH IN LSM @@ -908,6 +1030,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & CPM(I)=CP*(1.+0.84*QV1D(I)) ENDDO +#ifndef _OPENACC IF (debug_code == 2) THEN write(*,*)"ITIMESTEP=",ITIMESTEP DO I=its,ite @@ -925,7 +1048,13 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & endif ENDDO ENDIF +#endif +!$acc parallel loop present(flag_iter,U1D,V1D,WSPD,wet,dry,icy, & +!$acc THV1D,THVSK_wat,THVSK_lnd,THVSK_ice, & +!$acc hfx,RHO1D,qfx,WSTAR,pblh,dx,GOVRTH,ZA, & +!$acc TSK_wat,TSK_lnd,TSK_ice, & +!$acc rb_wat,rb_lnd,rb_ice) DO I=its,ite if( flag_iter(i) ) then ! DH* 20200401 - note. A weird bug in Intel 18 on hera prevents using the @@ -1041,6 +1170,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & WSPD(I) = MAX(WSPD_ice,WSPD_wat) WSPD(I) = MAX(WSPD_lnd,WSPD(I)) +#ifndef _OPENACC IF (debug_code == 2) THEN write(*,*)"===== After rb calc in mynn sfc layer:" write(*,*)"ITIMESTEP=",ITIMESTEP @@ -1049,6 +1179,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & IF (wet(i))write(*,*)"rb_wat=", rb_wat(I)," DTHVDZ=",DTHVDZ IF (dry(i))write(*,*)"rb_lnd=", rb_lnd(I)," DTHVDZ=",DTHVDZ ENDIF +#endif ! IF PREVIOUSLY UNSTABLE, DO NOT LET INTO REGIMES 1 AND 2 (STABLE) !if (itimestep .GT. 1) THEN @@ -1067,6 +1198,29 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !-------------------------------------------------------------------- !-------------------------------------------------------------------- +!$acc parallel loop present(flag_iter, errmsg, & +!$acc wet, dry, icy, & +!$acc ZT_wat, ZT_lnd, ZT_ice, & +!$acc ZNT_wat, ZNT_lnd, ZNT_ice, & +!$acc ZNTstoch_wat, ZNTstoch_lnd, ZNTstoch_ice, & +!$acc UST_wat, UST_lnd, UST_ice, & +!$acc ZQ_wat, ZQ_lnd, ZQ_ice, & +!$acc snowh_lnd, & +!$acc THVSK_wat, THVSK_lnd, THVSK_ice, & +!$acc qsfc_wat, qsfc_lnd, qsfc_ice, & +!$acc GZ1OZ0_wat, GZ1OZt_wat, GZ2OZ0_wat, GZ2OZt_wat, GZ10OZ0_wat, GZ10OZt_wat, & +!$acc GZ1OZ0_lnd, GZ1OZt_lnd, GZ2OZ0_lnd, GZ2OZt_lnd, GZ10OZ0_lnd, GZ10OZt_lnd, & +!$acc GZ1OZ0_ice, GZ1OZt_ice, GZ2OZ0_ice, GZ2OZt_ice, GZ10OZ0_ice, GZ10OZt_ice, & +!$acc zratio_wat, zratio_lnd, zratio_ice, & +!$acc stress_wat, stress_lnd, stress_ice, & +!$acc rb_wat, rb_lnd, rb_ice, & +!$acc psim, psih, psim10, psih10, psih2, & +!$acc psix_wat, psix10_wat, psit_wat, psit2_wat, psiq_wat, psiq2_wat, & +!$acc psix_lnd, psix10_lnd, psit_lnd, psit2_lnd, psiq_lnd, psiq2_lnd, & +!$acc psix_ice, psix10_ice, psit_ice, psit2_ice, psiq_ice, psiq2_ice, & +!$acc WSPD, WSPDI, U1D, V1D, TC1D, THV1D, rstoch1D, USTM, ZA, ZOL, QVSH, & +!$acc shdmax, vegtype, z0pert, ztpert, mol, rmol, qstar, sigmaf) + DO I=its,ite if( flag_iter(i) ) then @@ -1082,10 +1236,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & if (sfc_z0_type >= 0) then ! Avoid calculation is using wave model ! CALCULATE z0 (znt) !-------------------------------------- +#ifndef _OPENACC IF (debug_code == 2) THEN write(*,*)"=============Input to ZNT over water:" write(*,*)"u*:",UST_wat(i)," wspd=",WSPD(i)," visc=",visc," za=",ZA(I) ENDIF +#endif IF ( PRESENT(ISFTCFLX) ) THEN IF ( ISFTCFLX .EQ. 0 ) THEN IF (COARE_OPT .EQ. 3.0) THEN @@ -1122,10 +1278,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZNTstoch_wat(I) = ZNT_wat(I) endif +#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"==========Output ZNT over water:" write(*,*)"ZNT:",ZNTstoch_wat(i) ENDIF +#endif !COMPUTE ROUGHNESS REYNOLDS NUMBER (restar) USING NEW ZNT ! AHW: Garrattt formula: Calculate roughness Reynolds number @@ -1136,10 +1294,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !-------------------------------------- !CALCULATE z_t and z_q !-------------------------------------- +#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"=============Input to ZT over water:" write(*,*)"u*:",UST_wat(i)," restar=",restar," visc=",visc ENDIF +#endif IF ( PRESENT(ISFTCFLX) ) THEN IF ( ISFTCFLX .EQ. 0 ) THEN @@ -1183,10 +1343,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & rstoch1D(i),spp_sfc) ENDIF ENDIF +#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"=============Output ZT & ZQ over water:" write(*,*)"ZT:",ZT_wat(i)," ZQ:",ZQ_wat(i) ENDIF +#endif GZ1OZ0_wat(I)= LOG((ZA(I)+ZNTstoch_wat(I))/ZNTstoch_wat(I)) GZ1OZt_wat(I)= LOG((ZA(I)+ZNTstoch_wat(i))/ZT_wat(i)) @@ -1232,7 +1394,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! or initialized to zero, but certainly not set correctly errmsg = 'Logic error: qstar is not set correctly when calling Yang_2008' errflg = 1 +#ifndef _OPENACC +! Necessary since OpenACC does not support branching in parallel code return +#endif CALL Yang_2008(ZNTSTOCH_lnd(i),ZT_lnd(i),ZQ_lnd(i),UST_lnd(i),MOL(I),& qstar(I),restar,visc) ELSEIF ( IZ0TLND .EQ. 3 ) THEN @@ -1249,6 +1414,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & UST_lnd(I),KARMAN,1.0_kind_phys,0,spp_sfc,rstoch1D(i)) ENDIF ENDIF + +#ifndef _OPENACC IF (ZNTstoch_lnd(i) < 1E-8 .OR. Zt_lnd(i) < 1E-10) THEN write(0,*)"===(land) capture bad input in mynn sfc layer, i=:",i write(0,*)" ZNT=", ZNTstoch_lnd(i)," ZT=",Zt_lnd(i) @@ -1257,7 +1424,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " ust=", ust_lnd(i)," snowh=", snowh_lnd(i),"psfcpa=",PSFCPA(i), & " dz=",dz8w1d(i)," qflx=",qflx_lnd(i)," hflx=",hflx_lnd(i)," hpbl=",pblh(i) ENDIF - +#endif GZ1OZ0_lnd(I)= LOG((ZA(I)+ZNTstoch_lnd(I))/ZNTstoch_lnd(I)) GZ1OZt_lnd(I)= LOG((ZA(I)+ZNTstoch_lnd(i))/ZT_lnd(i)) @@ -1323,6 +1490,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),0.0_kind_phys) ZOL(I)=MIN(ZOL(I),20._kind_phys) +#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_wat(i) < 1E-8 .OR. Zt_wat(i) < 1E-10) THEN write(0,*)"===(wet) capture bad input in mynn sfc layer, i=:",i @@ -1333,6 +1501,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF +#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_wat(I),ZA(I),ZNTstoch_wat(I),ZT_wat(I),ZOL(I),psi_opt) @@ -1390,6 +1559,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),-20.0_kind_phys) ZOL(I)=MIN(ZOL(I),0.0_kind_phys) +#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_wat(i) < 1E-8 .OR. Zt_wat(i) < 1E-10) THEN write(0,*)"===(wet) capture bad input in mynn sfc layer, i=:",i @@ -1400,6 +1570,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF +#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_wat(I),ZA(I),ZNTstoch_wat(I),ZT_wat(I),ZOL(I),psi_opt) @@ -1460,6 +1631,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),0.0_kind_phys) ZOL(I)=MIN(ZOL(I),20._kind_phys) +#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_lnd(i) < 1E-8 .OR. Zt_lnd(i) < 1E-10) THEN write(0,*)"===(land) capture bad input in mynn sfc layer, i=:",i @@ -1470,6 +1642,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF +#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_lnd(I),ZA(I),ZNTstoch_lnd(I),ZT_lnd(I),ZOL(I),psi_opt) @@ -1526,6 +1699,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),-20.0_kind_phys) ZOL(I)=MIN(ZOL(I),0.0_kind_phys) +#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_lnd(i) < 1E-8 .OR. Zt_lnd(i) < 1E-10) THEN write(0,*)"===(land) capture bad input in mynn sfc layer, i=:",i @@ -1536,6 +1710,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF +#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_lnd(I),ZA(I),ZNTstoch_lnd(I),ZT_lnd(I),ZOL(I),psi_opt) @@ -1595,6 +1770,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),0.0_kind_phys) ZOL(I)=MIN(ZOL(I),20._kind_phys) +#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_ice(i) < 1E-8 .OR. Zt_ice(i) < 1E-10) THEN write(0,*)"===(ice) capture bad input in mynn sfc layer, i=:",i @@ -1605,6 +1781,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF +#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_ice(I),ZA(I),ZNTstoch_ice(I),ZT_ice(I),ZOL(I),psi_opt) @@ -1661,6 +1838,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),-20.0_kind_phys) ZOL(I)=MIN(ZOL(I),0.0_kind_phys) +#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_ice(i) < 1E-8 .OR. Zt_ice(i) < 1E-10) THEN write(0,*)"===(ice) capture bad input in mynn sfc layer, i=:",i @@ -1671,6 +1849,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF +#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_ice(I),ZA(I),ZNTstoch_ice(I),ZT_ice(I),ZOL(I),psi_opt) @@ -1821,6 +2000,14 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & endif ! flag_iter ENDDO ! end i-loop +#ifdef _OPENACC + ! Necessary since OpenACC does not support branching in parallel code + IF (errflg == 1) THEN + return + ENDIF +#endif + +#ifndef _OPENACC IF (debug_code == 2) THEN DO I=its,ite IF(wet(i))write(*,*)"==== AT END OF MAIN LOOP, i=",i, "(wet)" @@ -1841,10 +2028,29 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & write(*,*)"=============================================" ENDDO ! end i-loop ENDIF +#endif !---------------------------------------------------------- ! COMPUTE SURFACE HEAT AND MOISTURE FLUXES !---------------------------------------------------------- +!$acc parallel loop present(flag_iter, dry, wet, icy, & +!$acc QFX, HFX, FLHC, FLQC, LH, CHS, CH, CHS2, CQS2, & +!$acc RHO1D, MAVAIL, USTM, & +!$acc UST_lnd, UST_wat, UST_ice, & +!$acc PSIQ_lnd, PSIT_lnd, PSIX_lnd, & +!$acc PSIQ_wat, PSIT_wat, PSIX_wat, & +!$acc PSIQ_ice, PSIT_ice, PSIX_ice, & +!$acc PSIQ2_lnd, PSIT2_lnd, & +!$acc PSIQ2_wat, PSIT2_wat, & +!$acc PSIQ2_ice, PSIT2_ice, & +!$acc QSFC, QSFC_lnd, QSFC_wat, QSFC_ice, & +!$acc QFLX, QFLX_lnd, QFLX_wat, QFLX_ice, & +!$acc HFLX, HFLX_lnd, HFLX_wat, HFLX_ice, & +!$acc QSFCMR_lnd, QSFCMR_wat, QSFCMR_ice, & +!$acc QV1D, WSPD, WSPDI, CPM, TH1D, & +!$acc THSK_lnd, THSK_wat, THSK_ice, & +!$acc ch_lnd, ch_wat, ch_ice, & +!$acc cm_lnd, cm_wat, cm_ice) DO I=its,ite if( flag_iter(i) ) then @@ -2008,12 +2214,14 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF +#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"QFX=",QFX(I),"FLQC=",FLQC(I) if(icy(i))write(*,*)"ice, MAVAIL:",MAVAIL(I)," u*=",UST_ice(I)," psiq=",PSIQ_ice(i) if(dry(i))write(*,*)"lnd, MAVAIL:",MAVAIL(I)," u*=",UST_lnd(I)," psiq=",PSIQ_lnd(i) if(wet(i))write(*,*)"ocn, MAVAIL:",MAVAIL(I)," u*=",UST_wat(I)," psiq=",PSIQ_wat(i) ENDIF +#endif ! The exchange coefficient for cloud water is assumed to be the ! same as that for heat. CH is multiplied by WSPD. @@ -2040,6 +2248,18 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDDO ! end i-loop IF (compute_diag) then + !$acc parallel loop present(flag_iter, dry, wet, icy, & + !$acc ZA, ZA2, T2, TH2, TH1D, Q2, QV1D, PSFCPA, & + !$acc THSK_lnd, THSK_wat, THSK_ice, & + !$acc QSFC_lnd, QSFC_wat, QSFC_ice, & + !$acc U10, V10, U1D, V1D, U1D2, V1D2, & + !$acc ZNTstoch_lnd, ZNTstoch_lnd, ZNTstoch_ice, & + !$acc PSIX_lnd, PSIX_wat, PSIX_ice, & + !$acc PSIX10_lnd, PSIX10_wat, PSIX10_ice, & + !$acc PSIT2_lnd, PSIT2_wat, PSIT2_ice, & + !$acc PSIT_lnd, PSIT_wat, PSIT_ice, & + !$acc PSIQ2_lnd, PSIQ2_wat, PSIQ2_ice, & + !$acc PSIQ_lnd, PSIQ_wat, PSIQ_ice) DO I=its,ite if( flag_iter(i) ) then !----------------------------------------------------- @@ -2154,6 +2374,16 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! DEBUG - SUSPICIOUS VALUES !----------------------------------------------------- IF ( debug_code == 2) THEN + !$acc parallel loop present(dry, wet, icy, CPM, MAVAIL, & + !$acc HFX, LH, wstar, RHO1D, PBLH, ZOL, ZA, MOL, & + !$acc PSIM, PSIH, WSTAR, T1D, TH1D, THV1D, QVSH, & + !$acc UST_wat, UST_lnd, UST_ice, & + !$acc THSK_wat, THSK_lnd, THSK_ice, & + !$acc THVSK_wat, THVSK_lnd, THVSK_ice, & + !$acc ZNTstoch_wat, ZNTstoch_lnd, ZNTstoch_ice, & + !$acc ZT_wat, ZT_lnd, ZT_ice, & + !$acc QSFC_wat, QSFC_lnd, QSFC_ice, & + !$acc PSIX_wat, PSIX_lnd, PSIX_ice) DO I=its,ite yesno = 0 IF (compute_flux) THEN @@ -2258,6 +2488,54 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDDO ! end i-loop ENDIF ! end debug option +!$acc exit data copyout(CPM, FLHC, FLQC, CHS, CH, CHS2, CQS2,& +!$acc USTM, wstar, qstar, ZOL, MOL, RMOL, & +!$acc HFX, QFX, LH, QSFC, QFLX, HFLX, & +!$acc T2, TH2, Q2, WSPD, U10, V10, & +!$acc QGH, psim, psih, & +!$acc stress_wat, stress_lnd, stress_ice, & +!$acc rb_wat, rb_lnd, rb_ice, & +!$acc UST_wat, UST_lnd, UST_ice, & +!$acc ZNT_wat, ZNT_lnd, ZNT_ice, & +!$acc QSFC_lnd, QSFC_wat, QSFC_ice, & +!$acc QFLX_lnd, QFLX_wat, QFLX_ice, & +!$acc HFLX_lnd, HFLX_wat, HFLX_ice, & +!$acc PSIX_wat, PSIX_lnd, PSIX_ice, & +!$acc PSIX10_wat, PSIX10_lnd, PSIX10_ice, & +!$acc PSIT2_lnd, PSIT2_wat, PSIT2_ice, & +!$acc PSIT_lnd, PSIT_wat, PSIT_ice, & +!$acc ch_lnd, ch_wat, ch_ice, & +!$acc cm_lnd, cm_wat, cm_ice, & +!$acc errmsg) + +!$acc exit data delete( flag_iter, dry, wet, icy, dx, & +!$acc MAVAIL, PBLH, PSFCPA, z0pert, ztpert, & +!$acc QV1D, U1D, V1D, U1D2, V1D2, T1D, P1D, & +!$acc rstoch1D, sigmaf, shdmax, vegtype, & +!$acc dz2w1d, dz8w1d, snowh_lnd, & +!$acc tskin_wat, tskin_lnd, tskin_ice, & +!$acc tsurf_wat, tsurf_lnd, tsurf_ice) + +!$acc exit data delete( ZA, ZA2, THV1D, TH1D, TC1D, TV1D, & +!$acc RHO1D, QVSH, PSIH2, PSIM10, PSIH10, WSPDI, & +!$acc GOVRTH, PSFC, THCON, & +!$acc zratio_lnd, zratio_ice, zratio_wat, & +!$acc TSK_lnd, TSK_ice, TSK_wat, & +!$acc THSK_lnd, THSK_ice, THSK_wat, & +!$acc THVSK_lnd, THVSK_ice, THVSK_wat, & +!$acc GZ1OZ0_lnd, GZ1OZ0_ice, GZ1OZ0_wat, & +!$acc GZ1OZt_lnd, GZ1OZt_ice, GZ1OZt_wat, & +!$acc GZ2OZ0_lnd, GZ2OZ0_ice, GZ2OZ0_wat, & +!$acc GZ2OZt_lnd, GZ2OZt_ice, GZ2OZt_wat, & +!$acc GZ10OZ0_lnd, GZ10OZ0_ice, GZ10OZ0_wat, & +!$acc GZ10OZt_lnd, GZ10OZt_ice, GZ10OZt_wat, & +!$acc ZNTstoch_lnd, ZNTstoch_ice, ZNTstoch_wat, & +!$acc ZT_lnd, ZT_ice, ZT_wat, & +!$acc ZQ_lnd, ZQ_ice, ZQ_wat, & +!$acc PSIQ_lnd, PSIQ_ice, PSIQ_wat, & +!$acc PSIQ2_lnd, PSIQ2_ice, PSIQ2_wat, & +!$acc QSFCMR_lnd, QSFCMR_ice, QSFCMR_wat ) + END SUBROUTINE SFCLAY1D_mynn !------------------------------------------------------------------- !>\ingroup mynn_sfc @@ -2272,6 +2550,7 @@ END SUBROUTINE SFCLAY1D_mynn SUBROUTINE zilitinkevich_1995(Z_0,Zt,Zq,restar,ustar,KARMAN,& & landsea,IZ0TLND2,spp_sfc,rstoch) + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: Z_0,restar,ustar,KARMAN,landsea INTEGER, OPTIONAL, INTENT(IN) :: IZ0TLND2 @@ -2341,6 +2620,7 @@ SUBROUTINE davis_etal_2008(Z_0,ustar) !This is an update version from Davis et al. 2008, which !corrects a small-bias in Z_0 (AHW real-time 2012). + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: ustar REAL(kind_phys), INTENT(OUT) :: Z_0 @@ -2368,7 +2648,7 @@ END SUBROUTINE davis_etal_2008 !>This formulation for roughness length was designed account for. !!wave steepness. SUBROUTINE Taylor_Yelland_2001(Z_0,ustar,wsp10) - + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: ustar,wsp10 REAL(kind_phys), INTENT(OUT) :: Z_0 @@ -2396,7 +2676,7 @@ END SUBROUTINE Taylor_Yelland_2001 !! The Charnock parameter CZC is varied from .011 to .018. !! between 10-m wsp = 10 and 18.. SUBROUTINE charnock_1955(Z_0,ustar,wsp10,visc,zu) - + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: ustar, visc, wsp10, zu REAL(kind_phys), INTENT(OUT) :: Z_0 @@ -2421,7 +2701,7 @@ END SUBROUTINE charnock_1955 !!The Charnock parameter CZC is varied from about .005 to .028 !!between 10-m wind speeds of 6 and 19 m/s. SUBROUTINE edson_etal_2013(Z_0,ustar,wsp10,visc,zu) - + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: ustar, visc, wsp10, zu REAL(kind_phys), INTENT(OUT) :: Z_0 @@ -2450,7 +2730,7 @@ END SUBROUTINE edson_etal_2013 !!data. The formula for land uses a constant ratio (Z_0/7.4) taken !!from Garratt (1992). SUBROUTINE garratt_1992(Zt,Zq,Z_0,Ren,landsea) - + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: Ren, Z_0,landsea REAL(kind_phys), INTENT(OUT) :: Zt,Zq @@ -2486,7 +2766,7 @@ END SUBROUTINE garratt_1992 !! !!This is for use over water only. SUBROUTINE fairall_etal_2003(Zt,Zq,Ren,ustar,visc,rstoch,spp_sfc) - + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: Ren,ustar,visc,rstoch INTEGER, INTENT(IN) :: spp_sfc @@ -2530,7 +2810,7 @@ END SUBROUTINE fairall_etal_2003 !! The actual reference is unknown. This was passed along by Jim Edson (personal communication). !! This is for use over water only, preferably open ocean. SUBROUTINE fairall_etal_2014(Zt,Zq,Ren,ustar,visc,rstoch,spp_sfc) - + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: Ren,ustar,visc,rstoch INTEGER, INTENT(IN) :: spp_sfc @@ -2578,6 +2858,7 @@ END SUBROUTINE fairall_etal_2014 !!This should only be used over land! SUBROUTINE Yang_2008(Z_0,Zt,Zq,ustar,tstar,qst,Ren,visc) + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: Z_0, Ren, ustar, tstar, qst, visc REAL(kind_phys) :: ht, &! roughness height at critical Reynolds number @@ -2613,6 +2894,7 @@ END SUBROUTINE Yang_2008 !>\ingroup mynn_sfc SUBROUTINE GFS_z0_lnd(z0max,shdmax,z1,vegtype,ivegsrc,z0pert) + !$acc routine seq REAL(kind_phys), INTENT(OUT) :: z0max REAL(kind_phys), INTENT(IN) :: shdmax,z1,z0pert INTEGER, INTENT(IN) :: vegtype,ivegsrc @@ -2673,6 +2955,7 @@ END SUBROUTINE GFS_z0_lnd !>\ingroup mynn_sfc SUBROUTINE GFS_zt_lnd(ztmax,z0max,sigmaf,ztpert,ustar_lnd) + !$acc routine seq REAL(kind_phys), INTENT(OUT) :: ztmax REAL(kind_phys), INTENT(IN) :: z0max,sigmaf,ztpert,ustar_lnd REAL(kind_phys) :: czilc, tem1, tem2 @@ -2701,6 +2984,7 @@ END SUBROUTINE GFS_zt_lnd !>\ingroup mynn_sfc SUBROUTINE GFS_z0_wat(z0rl_wat,ustar_wat,WSPD,z1,sfc_z0_type,redrag) + !$acc routine seq REAL(kind_phys), INTENT(OUT) :: z0rl_wat REAL(kind_phys), INTENT(INOUT):: ustar_wat REAL(kind_phys), INTENT(IN) :: wspd,z1 @@ -2753,11 +3037,16 @@ END SUBROUTINE GFS_z0_wat !-------------------------------------------------------------------- !>\ingroup mynn_sfc SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type,errmsg,errflg) - + !$acc routine seq real(kind_phys), INTENT(OUT) :: ztmax real(kind_phys), INTENT(IN) :: wspd,z1,z0rl_wat,restar INTEGER, INTENT(IN) :: sfc_z0_type +#ifndef _OPENACC character(len=*), intent(out) :: errmsg +#else +! Necessary since OpenACC does not support assumed-size arrays + character(len=200), intent(out) :: errmsg +#endif integer, intent(out) :: errflg real(kind_phys) :: z0,z0max,wind10m,rat,ustar_wat real(kind_phys), PARAMETER :: charnock = 0.014, z0s_max=.317e-2 @@ -2798,6 +3087,7 @@ SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type,errmsg,errflg) errflg = 1 errmsg = 'ERROR(GFS_zt_wat): sfc_z0_type not valid.' return + endif END SUBROUTINE GFS_zt_wat @@ -2807,6 +3097,7 @@ END SUBROUTINE GFS_zt_wat !! Weiguo Wang, 2019-0425 SUBROUTINE znot_m_v6(uref, znotm) + !$acc routine seq use machine , only : kind_phys IMPLICIT NONE ! Calculate areodynamical roughness over water with input 10-m wind @@ -2856,6 +3147,7 @@ END SUBROUTINE znot_m_v6 !! SUBROUTINE znot_t_v6(uref, znott) + !$acc routine seq IMPLICIT NONE !> Calculate scalar roughness over water with input 10-m wind !! For low-to-moderate winds, try to match the Ck-U10 relationship from COARE algorithm @@ -2922,6 +3214,7 @@ END SUBROUTINE znot_t_v6 !! SUBROUTINE znot_m_v7(uref, znotm) + !$acc routine seq IMPLICIT NONE !> Calculate areodynamical roughness over water with input 10-m wind !! For low-to-moderate winds, try to match the Cd-U10 relationship from COARE V3.5 (Edson et al. 2013) @@ -2971,6 +3264,7 @@ END SUBROUTINE znot_m_v7 !! SUBROUTINE znot_t_v7(uref, znott) + !$acc routine seq IMPLICIT NONE !> Calculate scalar roughness over water with input 10-m wind !! For low-to-moderate winds, try to match the Ck-U10 relationship from COARE algorithm @@ -3040,6 +3334,7 @@ END SUBROUTINE znot_t_v7 !! This should only be used over snow/ice! SUBROUTINE Andreas_2002(Z_0,bvisc,ustar,Zt,Zq) + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(IN) :: Z_0, bvisc, ustar REAL(kind_phys), INTENT(OUT) :: Zt, Zq @@ -3313,6 +3608,7 @@ END SUBROUTINE PSI_CB2005 !! and Holtslag (1991) for stable conditions. SUBROUTINE Li_etal_2010(zL, Rib, zaz0, z0zt) + !$acc routine seq IMPLICIT NONE REAL(kind_phys), INTENT(OUT) :: zL REAL(kind_phys), INTENT(IN) :: Rib, zaz0, z0zt @@ -3471,6 +3767,7 @@ REAL(kind_phys) function zolri2(zol2,ri2,za,z0,zt,psi_opt) REAL(kind_phys) function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt) + !$acc routine seq ! This iterative algorithm to compute z/L from bulk-Ri IMPLICIT NONE @@ -3480,7 +3777,7 @@ REAL(kind_phys) function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt) REAL(kind_phys) :: zol20,zol3,zolt,zolold INTEGER :: n INTEGER, PARAMETER :: nmax = 20 - REAL(kind_phys), DIMENSION(nmax):: zLhux + !REAL(kind_phys), DIMENSION(nmax):: zLhux REAL(kind_phys) :: psit2,psix2 !print*,"+++++++INCOMING: z/L=",zol1," ri=",ri @@ -3522,7 +3819,7 @@ REAL(kind_phys) function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt) endif !print*,"n=",n," psit2=",psit2," psix2=",psix2 zolrib=ri*psix2**2/psit2 - zLhux(n)=zolrib + !zLhux(n)=zolrib n=n+1 enddo @@ -3530,7 +3827,7 @@ REAL(kind_phys) function zolrib(ri,za,z0,zt,logz0,logzt,zol1,psi_opt) !print*,"iter FAIL, n=",n," Ri=",ri," z/L=",zolri !if convergence fails, use approximate values: CALL Li_etal_2010(zolrib, ri, za/z0, z0/zt) - zLhux(n)=zolrib + !zLhux(n)=zolrib !print*,"FAILED, n=",n," Ri=",ri," z0=",z0 !print*,"z/L=",zLhux(1:nmax) else @@ -3595,6 +3892,7 @@ END SUBROUTINE psi_init ! !>\ingroup mynn_sfc real(kind_phys) function psim_stable_full(zolf) + !$acc routine seq real(kind_phys) :: zolf !psim_stable_full=-6.1*log(zolf+(1+zolf**2.5)**(1./2.5)) @@ -3605,6 +3903,7 @@ real(kind_phys) function psim_stable_full(zolf) !>\ingroup mynn_sfc real(kind_phys) function psih_stable_full(zolf) + !$acc routine seq real(kind_phys) :: zolf !psih_stable_full=-5.3*log(zolf+(1+zolf**1.1)**(1./1.1)) @@ -3615,6 +3914,7 @@ real(kind_phys) function psih_stable_full(zolf) !>\ingroup mynn_sfc real(kind_phys) function psim_unstable_full(zolf) + !$acc routine seq real(kind_phys) :: zolf,x,ym,psimc,psimk x=(1.-16.*zolf)**.25 @@ -3633,6 +3933,7 @@ real(kind_phys) function psim_unstable_full(zolf) !>\ingroup mynn_sfc real(kind_phys) function psih_unstable_full(zolf) + !$acc routine seq real(kind_phys) :: zolf,y,yh,psihc,psihk y=(1.-16.*zolf)**.5 @@ -3654,6 +3955,7 @@ real(kind_phys) function psih_unstable_full(zolf) !>\ingroup mynn_sfc !! REAL(kind_phys) function psim_stable_full_gfs(zolf) + !$acc routine seq REAL(kind_phys) :: zolf REAL(kind_phys), PARAMETER :: alpha4 = 20. REAL(kind_phys) :: aa @@ -3667,6 +3969,7 @@ REAL(kind_phys) function psim_stable_full_gfs(zolf) !>\ingroup mynn_sfc !! real(kind_phys) function psih_stable_full_gfs(zolf) + !$acc routine seq real(kind_phys) :: zolf real(kind_phys), PARAMETER :: alpha4 = 20. real(kind_phys) :: bb @@ -3680,6 +3983,7 @@ real(kind_phys) function psih_stable_full_gfs(zolf) !>\ingroup mynn_sfc !! real(kind_phys) function psim_unstable_full_gfs(zolf) + !$acc routine seq real(kind_phys) :: zolf real(kind_phys) :: hl1,tem1 real(kind_phys), PARAMETER :: a0=-3.975, a1=12.32, & @@ -3700,6 +4004,7 @@ real(kind_phys) function psim_unstable_full_gfs(zolf) !>\ingroup mynn_sfc !! real(kind_phys) function psih_unstable_full_gfs(zolf) + !$acc routine seq real(kind_phys) :: zolf real(kind_phys) :: hl1,tem1 real(kind_phys), PARAMETER :: a0p=-7.941, a1p=24.75, & @@ -3720,6 +4025,7 @@ real(kind_phys) function psih_unstable_full_gfs(zolf) !>\ingroup mynn_sfc !! look-up table functions - or, if beyond -10 < z/L < 10, recalculate real(kind_phys) function psim_stable(zolf,psi_opt) + !$acc routine seq integer :: nzol,psi_opt real(kind_phys) :: rzol,zolf @@ -3740,6 +4046,7 @@ real(kind_phys) function psim_stable(zolf,psi_opt) !>\ingroup mynn_sfc real(kind_phys) function psih_stable(zolf,psi_opt) + !$acc routine seq integer :: nzol,psi_opt real(kind_phys) :: rzol,zolf @@ -3760,6 +4067,7 @@ real(kind_phys) function psih_stable(zolf,psi_opt) !>\ingroup mynn_sfc real(kind_phys) function psim_unstable(zolf,psi_opt) + !$acc routine seq integer :: nzol,psi_opt real(kind_phys) :: rzol,zolf @@ -3780,6 +4088,7 @@ real(kind_phys) function psim_unstable(zolf,psi_opt) !>\ingroup mynn_sfc real(kind_phys) function psih_unstable(zolf,psi_opt) + !$acc routine seq integer :: nzol,psi_opt real(kind_phys) :: rzol,zolf diff --git a/physics/mynnsfc_wrapper.F90 b/physics/mynnsfc_wrapper.F90 index 1a970c9f4..3c033e65e 100644 --- a/physics/mynnsfc_wrapper.F90 +++ b/physics/mynnsfc_wrapper.F90 @@ -191,6 +191,16 @@ SUBROUTINE mynnsfc_wrapper_run( & & IMS,IME,JMS,JME,KMS,KME, & & ITS,ITE,JTS,JTE,KTS,KTE +!$acc enter data create(hfx, znt, psim, psih, chs, & +!$acc mavail, xland, GZ1OZ0, cpm, qgh, & +!$acc qfx, snowh_wat) + +!$acc enter data create(dz, th, qv) + +!$acc enter data copyin(rmol, phii, t3d, exner, qvsh, slmsk, xland) + +!$acc enter data copyin(dry, wet, icy, znt_lnd, znt_wat, znt_ice, qsfc_lnd, qsfc_ice, qsfc_lnd_ruc, qsfc_ice_ruc) + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -203,6 +213,7 @@ SUBROUTINE mynnsfc_wrapper_run( & ! write(0,*)"iter=",iter ! endif +!$acc kernels ! prep MYNN-only variables dz(:,:) = 0 th(:,:) = 0 @@ -210,6 +221,9 @@ SUBROUTINE mynnsfc_wrapper_run( & hfx(:) = 0 qfx(:) = 0 rmol(:) = 0 +!$acc end kernels + +!$acc parallel loop collapse(2) present(dz, phii, th, t3d, exner, qv, qvsh) do k=1,2 !levs do i=1,im dz(i,k)=(phii(i,k+1) - phii(i,k))*g_inv @@ -219,6 +233,7 @@ SUBROUTINE mynnsfc_wrapper_run( & enddo enddo +!$acc parallel loop present(slmsk, xland, qgh, mavail, cpm, snowh_wat) 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 @@ -235,6 +250,7 @@ SUBROUTINE mynnsfc_wrapper_run( & snowh_wat(i) = 0.0 enddo +!$acc kernels ! cm -> m where (dry) znt_lnd=znt_lnd*0.01 where (wet) znt_wat=znt_wat*0.01 @@ -245,6 +261,7 @@ SUBROUTINE mynnsfc_wrapper_run( & where (dry) qsfc_lnd = qsfc_lnd_ruc/(1.+qsfc_lnd_ruc) ! spec. hum where (icy) qsfc_ice = qsfc_ice_ruc/(1.+qsfc_ice_ruc) ! spec. hum. end if +!$acc end kernels ! if (lprnt) then ! write(0,*)"CALLING SFCLAY_mynn; input:" @@ -274,6 +291,8 @@ SUBROUTINE mynnsfc_wrapper_run( & ! write(0,*)"PBLH=",pblh(1)," xland=",xland(1) ! endif +!$acc exit data delete(qsfc_lnd_ruc, qsfc_ice_ruc) +!$acc exit data delete(phii, qvsh, slmsk) CALL SFCLAY_mynn( & u3d=u,v3d=v,t3d=t3d,qv3d=qv,p3d=prsl,dz8w=dz, & @@ -318,6 +337,13 @@ SUBROUTINE mynnsfc_wrapper_run( & errmsg=errmsg, errflg=errflg ) if (errflg/=0) return +!$acc exit data delete(hfx, znt, psim, psih, chs, & +!$acc mavail, xland, GZ1OZ0, cpm, qgh, & +!$acc qfx, snowh_wat, t3d, exner) +!$acc exit data delete(dz, th, qv) +!$acc exit data copyout(rmol) +!$acc exit data copyout(qsfc_lnd, qsfc_ice) + !! POST MYNN SURFACE LAYER (INTERSTITIAL) WORK: !do i = 1, im ! !* Taken from sfc_nst.f @@ -336,10 +362,15 @@ SUBROUTINE mynnsfc_wrapper_run( & ! znt_ice(i)=znt_ice(i)*100. !enddo +!$acc kernels ! m -> cm where (dry) znt_lnd=znt_lnd*100. where (wet) znt_wat=znt_wat*100. where (icy) znt_ice=znt_ice*100. +!$acc end kernels + +!$acc exit data delete(dry, wet, icy) +!$acc exit data copyout(znt_lnd, znt_wat, znt_ice) ! if (lprnt) then ! write(0,*) From 62298180c7269038931db60549b4ed1a4e6a2b9e Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Mon, 21 Aug 2023 19:19:51 +0000 Subject: [PATCH 37/81] add SPP support for G-F deep convection --- physics/cu_gf_deep.F90 | 7 +++---- physics/cu_gf_driver.F90 | 26 ++++++++++++++++++++------ physics/cu_gf_driver.meta | 15 +++++++++++++++ physics/module_mp_thompson.F90 | 2 +- physics/mp_thompson.F90 | 2 +- physics/mp_thompson.meta | 2 +- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 67dd9bd3f..a4253906c 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -4707,11 +4707,10 @@ subroutine get_zu_zd_pdf_fim(kklev,p,rand_vmas,zubeg,ipr,xland,zuh2,draft,ierr,k if(draft == 1) then lev_start=min(.9,.1+csum*.013) kb_adj=max(kb,2) - tunning=max(p(kklev+1),.5*(p(kpbli)+p(kt))) - tunning=p(kklev) -! tunning=p(kklev+1) !p(kpbli+1) !p(kklev) !p(kt)+(p(kpbli)-p(kt))*lev_start -! tunning=.5*(p(kb_adj)+p(kt)) !p(kpbli+1) !p(kklev) !p(kt)+(p(kpbli)-p(kt))*lev_start +! trash is the depth of the cloud trash=-p(kt)+p(kb_adj) + tunning=p(kklev) + if(rand_vmas.ne.0.) tunning=p(kklev-1)+.1*rand_vmas*trash beta_deep=1.3 +(1.-trash/1200.) tunning =min(0.95, (tunning-p(kb_adj))/(p(kt)-p(kb_adj))) !=.6 tunning =max(0.02, tunning) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index f82569b99..5e42fb777 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -67,6 +67,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& fhour,fh_dfi_radar,ix_dfi_radar,num_dfi_radar,cap_suppress, & dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, & maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in,ichoice_s_in, & + spp_cu_deep,spp_wts_cu_deep, & errmsg,errflg) !------------------------------------------------------------- implicit none @@ -80,6 +81,10 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer :: ichoice=0 ! 0 2 5 13 8 integer :: ichoicem=13 ! 0 2 5 13 integer :: ichoice_s=3 ! 0 1 2 3 + integer, intent(in) :: spp_cu_deep ! flag for using SPP perturbations + real(kind_phys), dimension(:,:), intent(in) :: & + & spp_wts_cu_deep + real(kind=kind_phys) :: spp_wts_cu_deep_tmp logical, intent(in) :: do_cap_suppress real(kind=kind_phys), parameter :: aodc0=0.14 @@ -313,9 +318,18 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ! these should be coming in from outside ! ! cactiv(:) = 0 - rand_mom(:) = 0. - rand_vmas(:) = 0. - rand_clos(:,:) = 0. + if (spp_cu_deep == 0) then + rand_mom(:) = 0. + rand_vmas(:) = 0. + rand_clos(:,:) = 0. + else + do i=1,im + spp_wts_cu_deep_tmp=min(max(-1.0, spp_wts_cu_deep(i,1)),1.0) + rand_mom(i) = spp_wts_cu_deep_tmp + rand_vmas(i) = spp_wts_cu_deep_tmp + rand_clos(i,:) = spp_wts_cu_deep_tmp + end do + end if !$acc end kernels ! its=1 @@ -630,7 +644,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& enddo !$acc end kernels if (dx(its)<6500.) then - ichoice=10 +! ichoice=10 imid_gf=0 endif ! @@ -734,7 +748,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist ,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist ,rand_clos & ! for stochastics closures, if temporal and spatial patterns exist - ,0 & ! flag to what you want perturbed + ,spp_cu_deep & ! flag to what you want perturbed ! 1 = momentum transport ! 2 = normalized vertical mass flux profile ! 3 = closures @@ -816,7 +830,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist ,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist ,rand_clos & ! for stochastics closures, if temporal and spatial patterns exist - ,0 & ! flag to what you want perturbed + ,spp_cu_deep & ! flag to what you want perturbed ! 1 = momentum transport ! 2 = normalized vertical mass flux profile ! 3 = closures diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index 8b1a46e2d..08e9de201 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -597,6 +597,21 @@ dimensions = () type = integer intent = in +[spp_wts_cu_deep] + standard_name = spp_weights_for_cu_deep_scheme + long_name = spp weights for cu deep scheme + units = 1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[spp_cu_deep] + standard_name = control_for_deep_convection_spp_perturbations + long_name = control for deep convection spp perturbations + units = count + dimensions = () + type = integer + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 4d823d2f4..ca913c6e3 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1046,7 +1046,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & INTEGER, INTENT(IN) :: rand_perturb_on, kme_stoch, n_var_spp REAL, DIMENSION(:,:), INTENT(IN) :: rand_pert REAL, DIMENSION(:), INTENT(IN) :: spp_prt_list, spp_stddev_cutoff - CHARACTER(len=3), DIMENSION(:), INTENT(IN) :: spp_var_list + CHARACTER(len=10), DIMENSION(:), INTENT(IN) :: spp_var_list INTEGER, INTENT(IN):: has_reqc, has_reqi, has_reqs #if ( WRF_CHEM == 1 ) REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: & diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 6a95a706c..c456e87cd 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -409,7 +409,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & integer, intent(in) :: n_var_spp real(kind_phys), intent(in) :: spp_wts_mp(:,:) real(kind_phys), intent(in) :: spp_prt_list(:) - character(len=3), intent(in) :: spp_var_list(:) + character(len=10), intent(in) :: spp_var_list(:) real(kind_phys), intent(in) :: spp_stddev_cutoff(:) logical, intent (in) :: cplchm diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index 691698281..5918e4dd9 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -725,7 +725,7 @@ units = none dimensions = (number_of_perturbed_spp_schemes) type = character - kind = len=3 + kind = len=10 intent = in [cplchm] standard_name = flag_for_chemistry_coupling From 96f60024a50b5c9b1701b83cd0fa3ece5c94ba21 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Wed, 23 Aug 2023 15:36:30 +0000 Subject: [PATCH 38/81] minor change on explicitly delcaring data type --- physics/cu_gf_driver.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 5e42fb777..3b700cc5a 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -324,7 +324,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& rand_clos(:,:) = 0. else do i=1,im - spp_wts_cu_deep_tmp=min(max(-1.0, spp_wts_cu_deep(i,1)),1.0) + spp_wts_cu_deep_tmp=min(max(-1.0_kind_phys, spp_wts_cu_deep(i,1)),1.0_kind_phys) rand_mom(i) = spp_wts_cu_deep_tmp rand_vmas(i) = spp_wts_cu_deep_tmp rand_clos(i,:) = spp_wts_cu_deep_tmp From a03c68443ccc2d3debc0b23b23843dfd027d6d7b Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Thu, 24 Aug 2023 14:46:44 +0000 Subject: [PATCH 39/81] Change 1D GS arrays from fixed size to allocated --- physics/module_mp_nssl_2mom.F90 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index cac1218a9..20239833a 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -2326,7 +2326,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw real, dimension(its:ite, 1, na) :: xfall real, dimension(kts:kte, nproc) :: thproclocal integer, parameter :: nor = 0, ng = 0 - integer :: nx,ny,nz + integer :: nx,ny,nz,ngs integer ix,jy,kz,i,j,k,il,n integer :: infdo real :: ssival, ssifac, t8s, t9s, qvapor @@ -2915,6 +2915,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! ENDIF ! .false. + + ngs = 128 + IF ( isedonly /= 1 ) THEN ! call nssl_2mom_gs: main gather-scatter routine to calculate microphysics @@ -2939,7 +2942,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw & timevtcalc,axtra2d, makediag & & ,has_wetscav, rainprod2d, evapprod2d & & ,errmsg,errflg & - & ,elec2,its,ids,ide,jds,jde & + & ,elec2,its,ids,ide,jds,jde,ngs & & ) @@ -2964,7 +2967,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw & ,an,dn1,t77 & & ,pn,wn & & ,axtra2d, makediag & - & ,ssat,t00,t77,flag_qndrop) + & ,ssat,t00,t77,flag_qndrop,ngs) ! recalculate dn1 after temperature changes DO kz = kts,kte @@ -8999,7 +9002,7 @@ SUBROUTINE NUCOND & & ,an,dn,p2 & & ,pn,w & & ,axtra,io_flag & - & ,ssfilt,t00,t77,flag_qndrop & + & ,ssfilt,t00,t77,flag_qndrop,ngs & & ) @@ -9064,7 +9067,7 @@ SUBROUTINE NUCOND & real, parameter :: cwmas20 = 1000.*0.523599*(2.*20.e-6)**3 ! mass of 20-micron radius droplet, for sat. adj. integer nxmpb,nzmpb,nxz integer mgs,ngs,numgs,inumgs - parameter (ngs=500) +! parameter (ngs=1 ) integer ngscnt,igs(ngs),kgs(ngs) integer kgsp(ngs),kgsm(ngs) integer nsvcnt @@ -9095,7 +9098,7 @@ SUBROUTINE NUCOND & integer ifilt ! =1 to filter ssat, =0 to set ssfilt=ssat parameter ( ifilt = 0 ) real temp1,temp2 ! ,ssold - real :: ssmax(ngs) = 0.0 ! maximum SS experienced by a parcel + real :: ssmax(ngs) ! maximum SS experienced by a parcel real ssmx real dnnet,dqnet ! real cnu,rnu,snu,cinu @@ -11598,7 +11601,7 @@ subroutine nssl_2mom_gs & & ,timevtcalc,axtra,io_flag & & , has_wetscav,rainprod2d, evapprod2d & & ,errmsg,errflg & - & ,elec,its,ids,ide,jds,jde & + & ,elec,its,ids,ide,jds,jde,ngs & & ) @@ -11830,7 +11833,7 @@ subroutine nssl_2mom_gs & ! integer nxmpb,nzmpb,nxz integer jgs,mgs,ngs,numgs - parameter (ngs=500) !500) +! parameter (ngs=1 ) !500) integer, parameter :: ngsz = 500 integer ntt parameter (ntt=300) From 95e9ff2268ad03f3004da886634812c5f7bdf32c Mon Sep 17 00:00:00 2001 From: "Timothy S. Sliwinski" Date: Thu, 24 Aug 2023 16:10:55 +0000 Subject: [PATCH 40/81] Reworking how errmsg is treated in device code to remove some preprocessor variable substitutions through the use of new local variables. The changes in this commit affect 3 main areas of module_sf_mynn.F90: 1.) Subroutine SFCLAY_mynn 2.) Subroutine SFCLAY1D_mynn 3.) Subroutine GFS_zt_wat Each of these areas are described in more detail below. 1.) SFCLAY_mynn In the SFCLAY_mynn subroutine, it was possible to remove all #ifdef substitutions of errmsg(len=*) for errmsg(len=200) because errmsg is not used in any code regions of this subroutine that may be run on an accelerator device. Since this is the case, errmsg(len=*) is perfectly acceptable, and can be left alone. The OpenACC data statements within the subroutine were also updated to remove references to errmsg as well since, again, it was not necessary to have errmsg on the device for this subroutine. 2.) SFCLAY1D_mynn - Creation of device_errmsg and device_errflg and proper syncing with errmsg and errflg In the SFCLAY1D_mynn subroutine, it was also possible to remove all #ifdef substitutions by instead creating a new local variable called device_errmsg that is a copy of errmsg but with a fixed size of 512 such that it is acceptable for use on the device. This is necessary because at certain points in the subroutine, loops that are good to be offloaded to the device set errmsg under certain conditions. Since these areas cannot be isolated from the parent loop without a major rework of the loop, we must preserve a way for errmsg to be set on the device. Since device_errmsg is a fixed size, we can do that. However, this complicates the code a bit for error handling purposes as we now have errmsg and device_errmsg which must be synced properly to ensure error messages are returned to CCPP as expected. Therefore, we must keep track of when device_errmsg is set so we can know to sync device_errmsg with errmsg. This is done by making a new local variable called device_errflg to be device_errmsg's complement on the device as errflg is errmsg's complement on the host. When device_errflg is set to a nonzero integer, we then know that device_errmsg must be synced with errmsg. This is simple to do at the end of the subroutine after the device_errmsg on the device is copyout-ed by OpenACC, and a new IF-block has been added for this general case. - Special case of mid-loop return (line 1417), and the creation of device_special_errflg and device_special_errmsg However, there is a special case we must handle a bit differently. In the mid-loop return statement near line 1417, we also must perform this sync to ensure the proper errmsg is returned in the event this return is needed. Therefore, a similar IF-block has been created within the corresponding #ifdef near line 2027 to ensure errmsg has the proper value before the subroutine returns. However, since this block is in the middle of the entire code and only executed on the host, we must first perform an OpenACC sync operation to make sure the device_errmsg and the device_errflg on the host matches the device_errmsg and device_errflg on the host, otherwise the incorrect values could lead to the return statement not executing as expected. This special case seems simple, but an extra trap lay exposed. If device_errmsg and device_errflg is set on the device at any point now before this IF-block, then the return statement we moved out of the loop will now be executed for *ANY* error message, whether that was the intended course or not. Therefore, we need to ensure this special case is only triggered for this specific case. Unfortunately, there appears no other way than to create two additional variables (device_special_errmsg and device_special_errflg) to isolate this case from all other error cases. With these installed in place of just device_errmsg and device_errflg, this special return case is now properly handled. - Complete Ifdef/Ifndef removal not possible Overall, due to the nature of this special case, we have no choice but to leave the #ifdef and #ifndef preprocessor statements in place as they are the only things capable of moving this return statement out of the loop without additional invasive changes to how the code operates. 3.) GFS_zt_wat In the GFS_zt_wat subroutine, since this subroutine is called on the device from within the main I-loop of SFCLAY1D_mynn, we have no choice but to change all errmsg and errflg usage to device_errmsg or device_errflg, otherwise this subroutine and the entire parent loop could not be run on the device. Therefore, all errmsg and errflg lines have been commented out and new, comparable lines using device_errmsg and device_errflg added in their place. Additionally, the subroutine call variable list was updated. --- physics/module_sf_mynn.F90 | 99 ++++++++++++++++++++++++++------------ 1 file changed, 67 insertions(+), 32 deletions(-) diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index 399b1ee83..dd181c99c 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -345,12 +345,7 @@ SUBROUTINE SFCLAY_mynn( & & qsfc_wat, qsfc_lnd, qsfc_ice ! CCPP error handling -#ifndef _OPENACC character(len=*), intent(inout) :: errmsg -#else -!Necessary since OpenACC does not support assumed-size arrays - character(len=200), intent(inout) :: errmsg -#endif integer, intent(inout) :: errflg !ADDITIONAL OUTPUT @@ -378,7 +373,7 @@ SUBROUTINE SFCLAY_mynn( & errmsg = '' !$acc enter data copyin( dz8w,U3D,V3D,QV3D,QC3D,P3D,T3D, & -!$acc pattern_spp_sfc, errmsg) +!$acc pattern_spp_sfc) !$acc enter data copyin( UST_WAT(:), UST_LND(:), UST_ICE(:), & !$acc MOL(:), QFLX(:), HFLX(:), & @@ -504,7 +499,7 @@ SUBROUTINE SFCLAY_mynn( & !$acc exit data copyout( UST_WAT(:), UST_LND(:), UST_ICE(:), & !$acc MOL(:), QFLX(:), HFLX(:), & !$acc QSFC(:), QSFC_WAT(:), QSFC_LND(:), & -!$acc QSFC_ICE(:), errmsg) +!$acc QSFC_ICE(:)) !$acc exit data delete( dz8w1d(:), dz2w1d(:), U1D(:), & !$acc V1D(:), U1D2(:), V1D2(:), & @@ -666,14 +661,25 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !JOE-end ! CCPP error handling -#ifndef _OPENACC character(len=*), intent(inout) :: errmsg -#else -! Necessary since OpenACC does not support assumed-size arrays - character(len=200), intent(inout) :: errmsg -#endif integer, intent(inout) :: errflg +! Local fixed-size errmsg character array for error messages on accelerator +! devices distinct from the host (e.g. GPUs). Necessary since OpenACC does +! not support assumed-size (len=*) arrays like errmsg. Additional +! device_errflg integer to denote when device_errmsg needs to be synced +! with errmsg. + character(len=512) :: device_errmsg + integer :: device_errflg + +! Special versions of the fixed-size errmsg character array for error messages +! on the device and it's errflag counterpart. These are necessary to ensure +! the return statements at lines 1417 and 2030 are executed only for this +! special case, and not any and all error messages set on the device. + character(len=512) :: device_special_errmsg + integer :: device_special_errflg + + !---------------------------------------------------------------- ! LOCAL VARS !---------------------------------------------------------------- @@ -723,6 +729,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! Initialize error-handling errflg = 0 errmsg = '' + device_errflg = errflg + device_errmsg = errmsg + device_special_errflg = errflg + device_special_errmsg = errmsg !------------------------------------------------------------------- !$acc update device(psim_stab, psim_unstab, psih_stab, psih_unstab) @@ -770,7 +780,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !$acc PSIT_lnd, PSIT_wat, PSIT_ice, & !$acc ch_lnd, ch_wat, ch_ice, & !$acc cm_lnd, cm_wat, cm_ice, & -!$acc snowh_lnd, errmsg) +!$acc snowh_lnd, & +!$acc device_errmsg, device_errflg, & +!$acc device_special_errmsg, device_special_errflg) !$acc parallel loop present(PSFCPA, PSFC, QSFC, T1D, flag_iter, & !$acc QSFC_wat, QSFCMR_wat, wet, TSK_wat, tskin_wat, & @@ -1198,7 +1210,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !-------------------------------------------------------------------- !-------------------------------------------------------------------- -!$acc parallel loop present(flag_iter, errmsg, & +!$acc parallel loop present(flag_iter, & +!$acc device_errmsg, device_errflg, & +!$acc device_special_errmsg, device_special_errflg, & !$acc wet, dry, icy, & !$acc ZT_wat, ZT_lnd, ZT_ice, & !$acc ZNT_wat, ZNT_lnd, ZNT_ice, & @@ -1330,7 +1344,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF ELSEIF ( ISFTCFLX .EQ. 4 ) THEN !GFS zt formulation - CALL GFS_zt_wat(ZT_wat(i),ZNTstoch_wat(i),restar,WSPD(i),ZA(i),sfc_z0_type,errmsg,errflg) + CALL GFS_zt_wat(ZT_wat(i),ZNTstoch_wat(i),restar,WSPD(i),ZA(i),sfc_z0_type,device_errmsg,device_errflg) ZQ_wat(i)=ZT_wat(i) ENDIF ELSE @@ -1392,10 +1406,14 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ELSEIF ( IZ0TLND .EQ. 2 ) THEN ! DH note - at this point, qstar is either not initialized ! or initialized to zero, but certainly not set correctly - errmsg = 'Logic error: qstar is not set correctly when calling Yang_2008' - errflg = 1 + device_special_errmsg = 'Logic error: qstar is not set correctly when calling Yang_2008' + device_special_errflg = 1 #ifndef _OPENACC ! Necessary since OpenACC does not support branching in parallel code +! Must sync errmsg and errflg with device_errmsg and device_errflg, respectively +! so that proper error message and error flag codes are returned. + errmsg = device_special_errmsg + errflg = device_special_errflg return #endif CALL Yang_2008(ZNTSTOCH_lnd(i),ZT_lnd(i),ZQ_lnd(i),UST_lnd(i),MOL(I),& @@ -2001,8 +2019,14 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDDO ! end i-loop #ifdef _OPENACC - ! Necessary since OpenACC does not support branching in parallel code - IF (errflg == 1) THEN +! Necessary since OpenACC does not support branching in parallel code. +! Must sync host errflg, errmsg to determine if return must be triggered +! and correct error message and error flag code returned. +! This code is being executed on the HOST side only, pulling data from DEVICE. +!$acc exit data copyout(device_special_errflg, device_special_errmsg) + IF (device_special_errflg /= 0) THEN + errflg = device_special_errflg + errmsg = device_special_errmsg return ENDIF #endif @@ -2506,7 +2530,13 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !$acc PSIT_lnd, PSIT_wat, PSIT_ice, & !$acc ch_lnd, ch_wat, ch_ice, & !$acc cm_lnd, cm_wat, cm_ice, & -!$acc errmsg) +!$acc device_errmsg, device_errflg) + +! Final sync of device and host error flags and messages +IF (device_errflg /= 0) THEN + errflg = device_errflg + errmsg = device_errmsg +ENDIF !$acc exit data delete( flag_iter, dry, wet, icy, dx, & !$acc MAVAIL, PBLH, PSFCPA, z0pert, ztpert, & @@ -3036,24 +3066,27 @@ SUBROUTINE GFS_z0_wat(z0rl_wat,ustar_wat,WSPD,z1,sfc_z0_type,redrag) END SUBROUTINE GFS_z0_wat !-------------------------------------------------------------------- !>\ingroup mynn_sfc - SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type,errmsg,errflg) + SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type,device_errmsg,device_errflg) !$acc routine seq real(kind_phys), INTENT(OUT) :: ztmax real(kind_phys), INTENT(IN) :: wspd,z1,z0rl_wat,restar INTEGER, INTENT(IN) :: sfc_z0_type -#ifndef _OPENACC - character(len=*), intent(out) :: errmsg -#else -! Necessary since OpenACC does not support assumed-size arrays - character(len=200), intent(out) :: errmsg -#endif - integer, intent(out) :: errflg + +! Using device_errmsg and device_errflg rather than the CCPP errmsg and errflg +! so that this subroutine can be run on an accelerator device with OpenACC. +! character(len=*), intent(out) :: errmsg +! integer, intent(out) :: errflg + character(len=512), intent(out) :: device_errmsg + integer, intent(out) :: device_errflg + real(kind_phys) :: z0,z0max,wind10m,rat,ustar_wat real(kind_phys), PARAMETER :: charnock = 0.014, z0s_max=.317e-2 ! Initialize error-handling - errflg = 0 - errmsg = '' +! errflg = 0 +! errmsg = '' + device_errflg = 0 + device_errmsg = '' ! z0 = 0.01 * z0rl_wat !Already converted to meters in the wrapper @@ -3084,8 +3117,10 @@ SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type,errmsg,errflg) call znot_t_v7(wind10m, ztmax) ! 10-m wind,m/s, ztmax(m) else if (sfc_z0_type > 0) then write(0,*)'no option for sfc_z0_type=',sfc_z0_type - errflg = 1 - errmsg = 'ERROR(GFS_zt_wat): sfc_z0_type not valid.' +! errflg = 1 +! errmsg = 'ERROR(GFS_zt_wat): sfc_z0_type not valid.' + device_errflg = 1 + device_errmsg = 'ERROR(GFS_zt_wat): sfc_z0_type not valid.' return endif From 36a313e91bd7089a3069a72d1326d200e4bbcde0 Mon Sep 17 00:00:00 2001 From: "Timothy S. Sliwinski" Date: Mon, 28 Aug 2023 21:11:38 +0000 Subject: [PATCH 41/81] Removing preprocessor directives to re-enable print statements on GPU for debug and other conditions. Original problem: ----------------- Following feedback that debug information was still desirable for OpenACC device- executed code where possible, this change removes all preprocessor directives which were guarding against the compilation of statements which wrote to standard output. These directives were originally used because debug statements and other standard output had the potential to greatly reduce performance because of the need to copy over certain variables from the host to the device just for debug output purposes. Additionally, when statements were located within parallel-execution regions, the output was not guaranteed to be presented in any specific order and the additional IF-branches in the code also would have reduced performance as branching is not efficient when on SIMD architectures. Resolutions: ------------ However, with a bit of extra work, a few of these issues are alleviated to allow output to work again as requested. First, on the data optimization side of the problem, the impact of pulling in variables just for debugging was minimized by ensuring the data was pulled in and resident on the GPU for the entire subroutine execution. While this increases the memory footprint on the device which may have very limited memory, it reduces the data transfer related performance hit. Next, in the cases where debug output was not within parallel regions but still needing to be executed on the GPU to show the proper values at that state of the overall program execution, OpenACC serial regions were used. These allow the data to not have to be transferred off the GPU mid-execution of the program just to be shown as debug output and also partially solve the problem of out-of-order output. Since debug regions are guarded by IF blocks, these serial regions do not significantly impact performance when debug output is turned off (debug_code=0). However, slowdown is significant for any other debug-levels which should be acceptable for debugging situations. Performance Changes: -------------------- Overall, these changes accomplish the goal of re-enabling debugging output, but not completely without a cost. Overall runtime was slightly impacted on the GPU when tested with 150k and 750k vertical columns (the value of ite used in the i-loops) and debugging turned off (debug_code=0). For 150k columns, the GPU decreased in speed from the original baseline of 22ms to 30ms. For 750k columns, the GPU decreased in speed from the original baseline of 31ms to 70ms. The impact is greater for the larger number of columns due to the impact of the number of times the mid-loop IF branches are evaluated on the GPU. While these are slight declines in performance, these are still significant speedups over the CPU-only tests (8.7x and 18.7x speedups for 150k and 750k, respectively). Compilation Time Changes: ------------------------- One additional noted observation regarding performance is compilation time. When all debug output is disabled (debug_code=0), compilation time is approximately 90 seconds with the additional serial blocks, IF-branches, and so forth as each of these require more work from the OpenACC compiler to generate code for the GPU. This problem is compounded when the debug_code option is increase to either 1 (some debug output) or 2 (full debug output). At a value of 1, compilation time jumps up to approximately 12.5 minutes on the Hera GPU nodes. At a value of 2, compilation time increases further to approximately 18.5 minutes on the same GPU nodes. The explanation for this is the need for the OpenACC compiler to enable greater amounts of serial and branching code that (again) are less optimal on the GPU and so the compiler must do more work to try to optimize them as best it can. --- physics/module_sf_mynn.F90 | 112 ++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 63 deletions(-) diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index dd181c99c..eecc5493c 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -780,11 +780,11 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !$acc PSIT_lnd, PSIT_wat, PSIT_ice, & !$acc ch_lnd, ch_wat, ch_ice, & !$acc cm_lnd, cm_wat, cm_ice, & -!$acc snowh_lnd, & +!$acc snowh_lnd, snowh_wat, snowh_ice, & !$acc device_errmsg, device_errflg, & !$acc device_special_errmsg, device_special_errflg) -!$acc parallel loop present(PSFCPA, PSFC, QSFC, T1D, flag_iter, & +!$acc parallel loop present(PSFCPA, PSFC, QSFC, T1D, flag_iter, tsurf_lnd, & !$acc QSFC_wat, QSFCMR_wat, wet, TSK_wat, tskin_wat, & !$acc QSFC_lnd, QSFCMR_lnd, dry, TSK_lnd, tskin_lnd, & !$acc QSFC_ice, QSFCMR_ice, icy, TSK_ice, tskin_ice) @@ -809,9 +809,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF QSFC_wat(I)=EP2*E1/(PSFC(I)-ep3*E1) !specific humidity QSFCMR_wat(I)=EP2*E1/(PSFC(I)-E1) !mixing ratio -#ifndef _OPENACC IF(QSFC_wat(I)>1..or.QSFC_wat(I)<0.) print *,' QSFC_wat(I)',itimestep,i,QSFC_wat(I),TSK_wat(i) -#endif ENDIF IF (dry(i)) THEN TSK_lnd(I) = tskin_lnd(i) @@ -831,9 +829,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & QSFC_lnd(I)=0.5*(QSFC_lnd(I) + QSFC(I)) QSFCMR_lnd(I)=QSFC_lnd(I)/(1.-QSFC_lnd(I)) !mixing ratio endif ! lsm -#ifndef _OPENACC IF(QSFC_lnd(I)>1..or.QSFC_lnd(I)<0.) print *,' QSFC_lnd(I)',itimestep,i,QSFC_lnd(I),Tskin_lnd(i),tsurf_lnd(i),qsfc(i) -#endif ENDIF IF (icy(i)) THEN TSK_ice(I) = tskin_ice(i) @@ -851,9 +847,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & QSFC_ice(I)=EP2*E1/(PSFC(I)-ep3*E1) !specific humidity QSFCMR_ice(I)=EP2*E1/(PSFC(I)-E1) !mixing ratio endif ! lsm -#ifndef _OPENACC IF(QSFC_ice(I)>1..or.QSFC_ice(I)<0.) print *,' QSFC_ice(I)',itimestep,i,QSFC_ice(I),TSK_ice(i) -#endif ENDIF ELSE @@ -906,7 +900,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & endif ! flag_iter ENDDO -#ifndef _OPENACC +!$acc serial present(pblh, PSFCPA, dz8w1d, qflx, hflx, & +!$acc dry, tskin_lnd, tsurf_lnd, qsfc_lnd, znt_lnd, ust_lnd, snowh_lnd, & +!$acc icy, tskin_ice, tsurf_ice, qsfc_ice, znt_ice, ust_ice, snowh_ice, & +!$acc wet, tskin_wat, tsurf_wat, qsfc_wat, znt_wat, ust_wat, snowh_wat) IF (debug_code >= 1) THEN write(0,*)"ITIMESTEP=",ITIMESTEP," iter=",iter DO I=its,ite @@ -931,12 +928,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF ENDDO ENDIF -#endif +!$acc end serial !$acc parallel loop present(PSFC, PSFCPA, QVSH, QV1D, THCON, flag_iter, & !$acc dry, tskin_lnd, TSK_lnd, tsurf_lnd, THSK_lnd, THVSK_lnd, qsfc_lnd, & !$acc icy, tskin_ice, TSK_ice, tsurf_ice, THSK_ice, THVSK_ice, qsfc_ice, & -!$acc wet, tskin_wat, TSK_wat, tsurf_wat, THSK_wat, THVSK_wat) +!$acc wet, tskin_wat, TSK_wat, tsurf_wat, THSK_wat, THVSK_wat, qsfc_wat) DO I=its,ite ! PSFC ( in cmb) is used later in saturation checks PSFC(I)=PSFCPA(I)/1000. @@ -950,10 +947,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_lnd(I) = TSK_lnd(I)*THCON(I) !(K) THVSK_lnd(I) = THSK_lnd(I)*(1.+EP1*qsfc_lnd(I)) -#ifndef _OPENACC if(THVSK_lnd(I) < 170. .or. THVSK_lnd(I) > 360.) & print *,'THVSK_lnd(I)',itimestep,i,THVSK_lnd(I),THSK_lnd(i),tsurf_lnd(i),tskin_lnd(i),qsfc_lnd(i) -#endif endif if(icy(i)) then TSK_ice(I) = tskin_ice(i) @@ -961,10 +956,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_ice(I) = TSK_ice(I)*THCON(I) !(K) THVSK_ice(I) = THSK_ice(I)*(1.+EP1*qsfc_ice(I)) !(K) -#ifndef _OPENACC if(THVSK_ice(I) < 170. .or. THVSK_ice(I) > 360.) & print *,'THVSK_ice(I)',itimestep,i,THVSK_ice(I),THSK_ice(i),tsurf_ice(i),tskin_ice(i),qsfc_ice(i) -#endif endif if(wet(i)) then TSK_wat(I) = tskin_wat(i) @@ -972,10 +965,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_wat(I) = TSK_wat(I)*THCON(I) !(K) THVSK_wat(I) = THSK_wat(I)*(1.+EP1*QVSH(I)) !(K) -#ifndef _OPENACC if(THVSK_wat(I) < 170. .or. THVSK_wat(I) > 360.) & print *,'THVSK_wat(I)',i,THVSK_wat(I),THSK_wat(i),tsurf_wat(i),tskin_wat(i),qsfc_wat(i) -#endif endif endif ! flag_iter ENDDO @@ -1009,7 +1000,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & HFX(i)=HFLX(i)*RHO1D(I)*cp ENDDO -#ifndef _OPENACC +!$acc serial present(THV1D, TV1D, RHO1D, GOVRTH, & +!$acc dry, tsk_lnd, thvsk_lnd, & +!$acc icy, tsk_ice, thvsk_ice, & +!$acc wet, tsk_wat, thvsk_wat) IF (debug_code ==2) THEN !write(*,*)"ITIMESTEP=",ITIMESTEP DO I=its,ite @@ -1022,7 +1016,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & write(*,*)"RHO1D=", RHO1D(i)," GOVRTH=",GOVRTH(i) ENDDO ENDIF -#endif +!$acc end serial !$acc parallel loop present(T1D,P1D,QGH,QV1D,CPM) DO I=its,ite @@ -1042,7 +1036,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & CPM(I)=CP*(1.+0.84*QV1D(I)) ENDDO -#ifndef _OPENACC +!$acc serial present(QGH, & +!$acc wet, QSFC_wat, QSFCMR_wat, & +!$acc dry, QSFC_lnd, QSFCMR_lnd, & +!$acc icy, QSFC_ice, QSFCMR_ice) IF (debug_code == 2) THEN write(*,*)"ITIMESTEP=",ITIMESTEP DO I=its,ite @@ -1060,7 +1057,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & endif ENDDO ENDIF -#endif +!$acc end serial !$acc parallel loop present(flag_iter,U1D,V1D,WSPD,wet,dry,icy, & !$acc THV1D,THVSK_wat,THVSK_lnd,THVSK_ice, & @@ -1182,7 +1179,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & WSPD(I) = MAX(WSPD_ice,WSPD_wat) WSPD(I) = MAX(WSPD_lnd,WSPD(I)) -#ifndef _OPENACC IF (debug_code == 2) THEN write(*,*)"===== After rb calc in mynn sfc layer:" write(*,*)"ITIMESTEP=",ITIMESTEP @@ -1191,7 +1187,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & IF (wet(i))write(*,*)"rb_wat=", rb_wat(I)," DTHVDZ=",DTHVDZ IF (dry(i))write(*,*)"rb_lnd=", rb_lnd(I)," DTHVDZ=",DTHVDZ ENDIF -#endif ! IF PREVIOUSLY UNSTABLE, DO NOT LET INTO REGIMES 1 AND 2 (STABLE) !if (itimestep .GT. 1) THEN @@ -1210,7 +1205,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !-------------------------------------------------------------------- !-------------------------------------------------------------------- -!$acc parallel loop present(flag_iter, & +!$acc parallel loop present(flag_iter, PSFCPA, dz8w1d, pblh, & !$acc device_errmsg, device_errflg, & !$acc device_special_errmsg, device_special_errflg, & !$acc wet, dry, icy, & @@ -1219,8 +1214,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !$acc ZNTstoch_wat, ZNTstoch_lnd, ZNTstoch_ice, & !$acc UST_wat, UST_lnd, UST_ice, & !$acc ZQ_wat, ZQ_lnd, ZQ_ice, & -!$acc snowh_lnd, & +!$acc snowh_wat, snowh_lnd, snowh_ice, & !$acc THVSK_wat, THVSK_lnd, THVSK_ice, & +!$acc tskin_wat, tskin_lnd, tskin_ice, & +!$acc tsurf_wat, tsurf_lnd, tsurf_ice, & !$acc qsfc_wat, qsfc_lnd, qsfc_ice, & !$acc GZ1OZ0_wat, GZ1OZt_wat, GZ2OZ0_wat, GZ2OZt_wat, GZ10OZ0_wat, GZ10OZt_wat, & !$acc GZ1OZ0_lnd, GZ1OZt_lnd, GZ2OZ0_lnd, GZ2OZt_lnd, GZ10OZ0_lnd, GZ10OZt_lnd, & @@ -1228,12 +1225,14 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !$acc zratio_wat, zratio_lnd, zratio_ice, & !$acc stress_wat, stress_lnd, stress_ice, & !$acc rb_wat, rb_lnd, rb_ice, & +!$acc qflx, qflx_lnd, & +!$acc hflx, hflx_lnd, & !$acc psim, psih, psim10, psih10, psih2, & !$acc psix_wat, psix10_wat, psit_wat, psit2_wat, psiq_wat, psiq2_wat, & !$acc psix_lnd, psix10_lnd, psit_lnd, psit2_lnd, psiq_lnd, psiq2_lnd, & !$acc psix_ice, psix10_ice, psit_ice, psit2_ice, psiq_ice, psiq2_ice, & !$acc WSPD, WSPDI, U1D, V1D, TC1D, THV1D, rstoch1D, USTM, ZA, ZOL, QVSH, & -!$acc shdmax, vegtype, z0pert, ztpert, mol, rmol, qstar, sigmaf) +!$acc shdmax, vegtype, z0pert, ztpert, mol, rmol, wstar, qstar, sigmaf) DO I=its,ite if( flag_iter(i) ) then @@ -1250,12 +1249,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & if (sfc_z0_type >= 0) then ! Avoid calculation is using wave model ! CALCULATE z0 (znt) !-------------------------------------- -#ifndef _OPENACC + IF (debug_code == 2) THEN write(*,*)"=============Input to ZNT over water:" write(*,*)"u*:",UST_wat(i)," wspd=",WSPD(i)," visc=",visc," za=",ZA(I) ENDIF -#endif + IF ( PRESENT(ISFTCFLX) ) THEN IF ( ISFTCFLX .EQ. 0 ) THEN IF (COARE_OPT .EQ. 3.0) THEN @@ -1292,12 +1291,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZNTstoch_wat(I) = ZNT_wat(I) endif -#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"==========Output ZNT over water:" write(*,*)"ZNT:",ZNTstoch_wat(i) ENDIF -#endif !COMPUTE ROUGHNESS REYNOLDS NUMBER (restar) USING NEW ZNT ! AHW: Garrattt formula: Calculate roughness Reynolds number @@ -1308,12 +1305,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !-------------------------------------- !CALCULATE z_t and z_q !-------------------------------------- -#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"=============Input to ZT over water:" write(*,*)"u*:",UST_wat(i)," restar=",restar," visc=",visc ENDIF -#endif IF ( PRESENT(ISFTCFLX) ) THEN IF ( ISFTCFLX .EQ. 0 ) THEN @@ -1357,12 +1352,11 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & rstoch1D(i),spp_sfc) ENDIF ENDIF -#ifndef _OPENACC + IF (debug_code > 1) THEN write(*,*)"=============Output ZT & ZQ over water:" write(*,*)"ZT:",ZT_wat(i)," ZQ:",ZQ_wat(i) ENDIF -#endif GZ1OZ0_wat(I)= LOG((ZA(I)+ZNTstoch_wat(I))/ZNTstoch_wat(I)) GZ1OZt_wat(I)= LOG((ZA(I)+ZNTstoch_wat(i))/ZT_wat(i)) @@ -1433,7 +1427,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF ENDIF -#ifndef _OPENACC IF (ZNTstoch_lnd(i) < 1E-8 .OR. Zt_lnd(i) < 1E-10) THEN write(0,*)"===(land) capture bad input in mynn sfc layer, i=:",i write(0,*)" ZNT=", ZNTstoch_lnd(i)," ZT=",Zt_lnd(i) @@ -1442,7 +1435,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " ust=", ust_lnd(i)," snowh=", snowh_lnd(i),"psfcpa=",PSFCPA(i), & " dz=",dz8w1d(i)," qflx=",qflx_lnd(i)," hflx=",hflx_lnd(i)," hpbl=",pblh(i) ENDIF -#endif GZ1OZ0_lnd(I)= LOG((ZA(I)+ZNTstoch_lnd(I))/ZNTstoch_lnd(I)) GZ1OZt_lnd(I)= LOG((ZA(I)+ZNTstoch_lnd(i))/ZT_lnd(i)) @@ -1508,7 +1500,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),0.0_kind_phys) ZOL(I)=MIN(ZOL(I),20._kind_phys) -#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_wat(i) < 1E-8 .OR. Zt_wat(i) < 1E-10) THEN write(0,*)"===(wet) capture bad input in mynn sfc layer, i=:",i @@ -1519,7 +1510,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF -#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_wat(I),ZA(I),ZNTstoch_wat(I),ZT_wat(I),ZOL(I),psi_opt) @@ -1577,7 +1567,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),-20.0_kind_phys) ZOL(I)=MIN(ZOL(I),0.0_kind_phys) -#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_wat(i) < 1E-8 .OR. Zt_wat(i) < 1E-10) THEN write(0,*)"===(wet) capture bad input in mynn sfc layer, i=:",i @@ -1588,7 +1577,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF -#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_wat(I),ZA(I),ZNTstoch_wat(I),ZT_wat(I),ZOL(I),psi_opt) @@ -1649,7 +1637,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),0.0_kind_phys) ZOL(I)=MIN(ZOL(I),20._kind_phys) -#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_lnd(i) < 1E-8 .OR. Zt_lnd(i) < 1E-10) THEN write(0,*)"===(land) capture bad input in mynn sfc layer, i=:",i @@ -1660,7 +1647,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF -#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_lnd(I),ZA(I),ZNTstoch_lnd(I),ZT_lnd(I),ZOL(I),psi_opt) @@ -1717,7 +1703,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),-20.0_kind_phys) ZOL(I)=MIN(ZOL(I),0.0_kind_phys) -#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_lnd(i) < 1E-8 .OR. Zt_lnd(i) < 1E-10) THEN write(0,*)"===(land) capture bad input in mynn sfc layer, i=:",i @@ -1728,7 +1713,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF -#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_lnd(I),ZA(I),ZNTstoch_lnd(I),ZT_lnd(I),ZOL(I),psi_opt) @@ -1788,7 +1772,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),0.0_kind_phys) ZOL(I)=MIN(ZOL(I),20._kind_phys) -#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_ice(i) < 1E-8 .OR. Zt_ice(i) < 1E-10) THEN write(0,*)"===(ice) capture bad input in mynn sfc layer, i=:",i @@ -1799,7 +1782,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF -#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_ice(I),ZA(I),ZNTstoch_ice(I),ZT_ice(I),ZOL(I),psi_opt) @@ -1856,7 +1838,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZOL(I)=MAX(ZOL(I),-20.0_kind_phys) ZOL(I)=MIN(ZOL(I),0.0_kind_phys) -#ifndef _OPENACC IF (debug_code >= 1) THEN IF (ZNTstoch_ice(i) < 1E-8 .OR. Zt_ice(i) < 1E-10) THEN write(0,*)"===(ice) capture bad input in mynn sfc layer, i=:",i @@ -1867,7 +1848,6 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & " dz=",dz8w1d(i)," qflx=",qflx(i)," hflx=",hflx(i)," hpbl=",pblh(i) ENDIF ENDIF -#endif !Use Pedros iterative function to find z/L !zol(I)=zolri(rb_ice(I),ZA(I),ZNTstoch_ice(I),ZT_ice(I),ZOL(I),psi_opt) @@ -2031,7 +2011,13 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF #endif -#ifndef _OPENACC +!$acc serial present(wet, dry, icy, & +!$acc PSIM, PSIH, CPM, RHO1D, ZOL, wspd, MOL, & +!$acc wstar, qstar, THV1D, HFX, MAVAIL, QVSH, & +!$acc THVSK_wat, THVSK_lnd, THVSK_ice, & +!$acc UST_wat, UST_lnd, UST_ice, & +!$acc ZNTstoch_wat, ZNTstoch_lnd, ZNTstoch_ice, & +!$acc zt_wat, zt_lnd, zt_ice) IF (debug_code == 2) THEN DO I=its,ite IF(wet(i))write(*,*)"==== AT END OF MAIN LOOP, i=",i, "(wet)" @@ -2052,7 +2038,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & write(*,*)"=============================================" ENDDO ! end i-loop ENDIF -#endif +!$acc end serial !---------------------------------------------------------- ! COMPUTE SURFACE HEAT AND MOISTURE FLUXES @@ -2238,14 +2224,12 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF -#ifndef _OPENACC IF (debug_code > 1) THEN write(*,*)"QFX=",QFX(I),"FLQC=",FLQC(I) if(icy(i))write(*,*)"ice, MAVAIL:",MAVAIL(I)," u*=",UST_ice(I)," psiq=",PSIQ_ice(i) if(dry(i))write(*,*)"lnd, MAVAIL:",MAVAIL(I)," u*=",UST_lnd(I)," psiq=",PSIQ_lnd(i) if(wet(i))write(*,*)"ocn, MAVAIL:",MAVAIL(I)," u*=",UST_wat(I)," psiq=",PSIQ_wat(i) ENDIF -#endif ! The exchange coefficient for cloud water is assumed to be the ! same as that for heat. CH is multiplied by WSPD. @@ -2397,17 +2381,17 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !----------------------------------------------------- ! DEBUG - SUSPICIOUS VALUES !----------------------------------------------------- +!$acc serial present(dry, wet, icy, CPM, MAVAIL, & +!$acc HFX, LH, wstar, RHO1D, PBLH, ZOL, ZA, MOL, & +!$acc PSIM, PSIH, WSTAR, T1D, TH1D, THV1D, QVSH, & +!$acc UST_wat, UST_lnd, UST_ice, & +!$acc THSK_wat, THSK_lnd, THSK_ice, & +!$acc THVSK_wat, THVSK_lnd, THVSK_ice, & +!$acc ZNTstoch_wat, ZNTstoch_lnd, ZNTstoch_ice, & +!$acc ZT_wat, ZT_lnd, ZT_ice, & +!$acc QSFC_wat, QSFC_lnd, QSFC_ice, & +!$acc PSIX_wat, PSIX_lnd, PSIX_ice) IF ( debug_code == 2) THEN - !$acc parallel loop present(dry, wet, icy, CPM, MAVAIL, & - !$acc HFX, LH, wstar, RHO1D, PBLH, ZOL, ZA, MOL, & - !$acc PSIM, PSIH, WSTAR, T1D, TH1D, THV1D, QVSH, & - !$acc UST_wat, UST_lnd, UST_ice, & - !$acc THSK_wat, THSK_lnd, THSK_ice, & - !$acc THVSK_wat, THVSK_lnd, THVSK_ice, & - !$acc ZNTstoch_wat, ZNTstoch_lnd, ZNTstoch_ice, & - !$acc ZT_wat, ZT_lnd, ZT_ice, & - !$acc QSFC_wat, QSFC_lnd, QSFC_ice, & - !$acc PSIX_wat, PSIX_lnd, PSIX_ice) DO I=its,ite yesno = 0 IF (compute_flux) THEN @@ -2511,6 +2495,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ENDIF ENDDO ! end i-loop ENDIF ! end debug option +!$acc end serial !$acc exit data copyout(CPM, FLHC, FLQC, CHS, CH, CHS2, CQS2,& !$acc USTM, wstar, qstar, ZOL, MOL, RMOL, & @@ -2542,7 +2527,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !$acc MAVAIL, PBLH, PSFCPA, z0pert, ztpert, & !$acc QV1D, U1D, V1D, U1D2, V1D2, T1D, P1D, & !$acc rstoch1D, sigmaf, shdmax, vegtype, & -!$acc dz2w1d, dz8w1d, snowh_lnd, & +!$acc dz2w1d, dz8w1d, & +!$acc snowh_wat, snowh_lnd, snowh_ice, & !$acc tskin_wat, tskin_lnd, tskin_ice, & !$acc tsurf_wat, tsurf_lnd, tsurf_ice) From 315d3cc74f5d5edad379f9968c361f5f3c513725 Mon Sep 17 00:00:00 2001 From: Samuel Trahan Date: Wed, 6 Sep 2023 00:17:12 -0600 Subject: [PATCH 42/81] stop FV3_HRRR_c3 from crashing with gnu debug --- physics/cu_c3_deep.F90 | 298 ++++++++++++++++++++--------------------- physics/cu_c3_sh.F90 | 22 +-- 2 files changed, 160 insertions(+), 160 deletions(-) diff --git a/physics/cu_c3_deep.F90 b/physics/cu_c3_deep.F90 index c3a4b2c4e..7927f1cfb 100644 --- a/physics/cu_c3_deep.F90 +++ b/physics/cu_c3_deep.F90 @@ -159,12 +159,12 @@ subroutine cu_c3_deep_run( & nranflag,itf,ktf,its,ite, kts,kte,ipr,imid integer, intent (in ) :: & ichoice - real(kind=kind_phys), dimension (its:ite,4) & + real(kind=kind_phys), dimension (its:,:) & ,intent (in ) :: rand_clos - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: rand_mom,rand_vmas !$acc declare copyin(rand_clos,rand_mom,rand_vmas) - real(kind=kind_phys), intent(in), dimension (its:ite) :: ca_deep(:) + real(kind=kind_phys), intent(in), dimension (its:) :: ca_deep(:) integer, intent(in) :: do_capsuppress real(kind=kind_phys), intent(in), dimension(:) :: cap_suppress_j !$acc declare create(cap_suppress_j) @@ -177,28 +177,28 @@ subroutine cu_c3_deep_run( & ! outq = output q tendency (per s) ! outqc = output qc tendency (per s) ! pre = output precip - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout ) :: & cnvwt,outu,outv,outt,outq,outqc,cupclw - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & frh_out,rainevap - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & tmf, qmicro, sigmain, forceqv_spechum - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & pre,xmb_out !$acc declare copy(cnvwt,outu,outv,outt,outq,outqc,cupclw,frh_out,pre,xmb_out) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & hfx,qfx,xmbm_in,xmbs_in !$acc declare copyin(hfx,qfx,xmbm_in,xmbs_in) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout ) :: & kbcon,ktop !$acc declare copy(kbcon,ktop) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & kpbl,tropics !$acc declare copyin(kpbl,tropics) @@ -207,26 +207,26 @@ subroutine cu_c3_deep_run( & ! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off ! convection for this call only and at that particular gridpoint ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & dhdt,rho,t,po,us,vs,tn,delp !$acc declare copyin(dhdt,rho,t,po,us,vs,tn) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout ) :: & omeg !$acc declare copy(omeg) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout) :: & q,qo,zuo,zdo,zdm !$acc declare sigmaout - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (out) :: & sigmaout - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & dx,z1,psur,xland !$acc declare copyin(dx,z1,psur,xland) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & mconv,ccn !$acc declare copy(mconv,ccn) @@ -372,8 +372,8 @@ subroutine cu_c3_deep_run( & !$acc kzdown,kdet,k22,jmin,kstabi,kstabm,k22x,xland1, & !$acc ktopdby,kbconx,ierr2,ierr3,kbmax) - integer, dimension (its:ite), intent(inout) :: ierr - integer, dimension (its:ite), intent(in) :: csum + integer, dimension (its:), intent(inout) :: ierr + integer, dimension (its:), intent(in) :: csum logical, intent(in) :: do_ca, progsigma logical, intent(in) :: flag_init, flag_restart !$acc declare copy(ierr) copyin(csum) @@ -421,7 +421,7 @@ subroutine cu_c3_deep_run( & !$acc tn_bl, qo_bl, qeso_bl, heo_bl, heso_bl, & !$acc qeso_cup_bl,qo_cup_bl, heo_cup_bl,heso_cup_bl, & !$acc gammao_cup_bl,tn_cup_bl,hco_bl,dbyo_bl,xf_dicycle) - real(kind=kind_phys), intent(inout), dimension(its:ite,10) :: forcing + real(kind=kind_phys), intent(inout), dimension(its:,:) :: forcing !$acc declare copy(forcing) integer :: turn,pmin_lev(its:ite),start_level(its:ite),ktopkeep(its:ite) real(kind=kind_phys), dimension (its:ite,kts:kte) :: dtempdz @@ -2418,16 +2418,16 @@ subroutine rain_evap_below_cloudbase(itf,ktf, its,ite, kts,kte,ierr, & integer ,intent(in) :: itf,ktf, its,ite, kts,kte - integer, dimension(its:ite) ,intent(in) :: ierr,kbcon - real(kind=kind_phys), dimension(its:ite) ,intent(in) ::psur,xland,pwavo,edto,pwevo,xmb - real(kind=kind_phys), dimension(its:ite,kts:kte),intent(in) :: po_cup,qo_cup,qes_cup - real(kind=kind_phys), dimension(its:ite) ,intent(inout) :: pre - real(kind=kind_phys), dimension(its:ite,kts:kte),intent(inout) :: outt,outq !,outbuoy + integer, dimension(its:) ,intent(in) :: ierr,kbcon + real(kind=kind_phys), dimension(its:) ,intent(in) ::psur,xland,pwavo,edto,pwevo,xmb + real(kind=kind_phys), dimension(its:,kts:),intent(in) :: po_cup,qo_cup,qes_cup + real(kind=kind_phys), dimension(its:) ,intent(inout) :: pre + real(kind=kind_phys), dimension(its:,kts:),intent(inout) :: outt,outq !,outbuoy !$acc declare copyin(ierr,kbcon,psur,xland,pwavo,edto,pwevo,xmb,po_cup,qo_cup,qes_cup) !$acc declare copy(pre,outt,outq) - !real, dimension(its:ite) ,intent(out) :: tot_evap_bcb - !real, dimension(its:ite,kts:kte),intent(out) :: evap_bcb,net_prec_bcb + !real, dimension(its:) ,intent(out) :: tot_evap_bcb + !real, dimension(its:,kts:),intent(out) :: evap_bcb,net_prec_bcb !-- locals integer :: i,k @@ -2511,30 +2511,30 @@ subroutine cup_dd_edt(ierr,us,vs,z,ktop,kbcon,edt,p,pwav, & ! ! ierr error value, maybe modified in this routine ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & rho,us,vs,z,p,pw - real(kind=kind_phys), dimension (its:ite,1) & + real(kind=kind_phys), dimension (its:,: ) & ,intent (out ) :: & edtc - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & pefc - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & edt - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & pwav,pwev,psum2,psumh,edtmax,edtmin - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & ktop,kbcon,xland1 real(kind=kind_phys), intent (in ) :: & !HCB ccnclean - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & ccn - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr !$acc declare copyin(rho,us,vs,z,p,pw,pwav,pwev,psum2,psumh,edtmax,edtmin,ktop,kbcon) @@ -2671,7 +2671,7 @@ subroutine cup_dd_moisture(ierrc,zd,hcd,hes_cup,qcd,qes_cup, & ! pwev = total normalized integrated evaoprate (i2) ! entr= entrainment rate ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & zd,hes_cup,hcd,qes_cup,q_cup,z_cup, & dd_massentr,dd_massdetr,gamma_cup,q,he,p_cup @@ -2679,18 +2679,18 @@ subroutine cup_dd_moisture(ierrc,zd,hcd,hes_cup,qcd,qes_cup, & integer & ,intent (in ) :: & iloop - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & jmin !$acc declare copyin(jmin) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr !$acc declare copy(ierr) - real(kind=kind_phys), dimension (its:ite,kts:kte)& + real(kind=kind_phys), dimension (its:,kts:)& ,intent (out ) :: & qcd,qrcd,pwd - real(kind=kind_phys), dimension (its:ite)& + real(kind=kind_phys), dimension (its:)& ,intent (out ) :: & pwev,bu !$acc declare copyout(qcd,qrcd,pwd,pwev,bu) @@ -2812,23 +2812,23 @@ subroutine cup_env(z,qes,he,hes,t,q,p,z1, & its,ite, kts,kte ! ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & p,t,q !$acc declare copyin(p,t,q) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (out ) :: & hes,qes !$acc declare copyout(hes,qes) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout) :: & he,z !$acc declare copy(he,z) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & psur,z1 !$acc declare copyin(psur,z1) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr !$acc declare copy(ierr) @@ -2966,19 +2966,19 @@ subroutine cup_env_clev(t,qes,q,he,hes,z,p,qes_cup,q_cup, & itf,ktf, & its,ite, kts,kte ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & qes,q,he,hes,z,p,t !$acc declare copyin(qes,q,he,hes,z,p,t) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (out ) :: & qes_cup,q_cup,he_cup,hes_cup,z_cup,p_cup,gamma_cup,t_cup !$acc declare copyout(qes_cup,q_cup,he_cup,hes_cup,z_cup,p_cup,gamma_cup,t_cup) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & psur,z1 !$acc declare copyin(psur,z1) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr !$acc declare copy(ierr) @@ -3077,33 +3077,33 @@ subroutine cup_forcing_ens_3d(closure_n,xland,aa0,aa1,xaa0,mbdt,dtime,ierr,ierr2 ! k22 = updraft originating level ! ichoice = flag if only want one closure (usually set to zero!) ! - real(kind=kind_phys), dimension (its:ite,1:maxens3) & + real(kind=kind_phys), dimension (its:,1:) & ,intent (inout) :: & pr_ens - real(kind=kind_phys), dimension (its:ite,1:maxens3) & + real(kind=kind_phys), dimension (its:,1:) & ,intent (inout ) :: & xf_ens !$acc declare copy(pr_ens,xf_ens) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & zd,zu,p_cup,zdm - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & omeg - real(kind=kind_phys), dimension (its:ite,1) & + real(kind=kind_phys), dimension (its:,:) & ,intent (in ) :: & xaa0 - real(kind=kind_phys), dimension (its:ite,4) & + real(kind=kind_phys), dimension (its:,:) & ,intent (in ) :: & rand_clos - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & aa1,edt,edtm,omegac,sigmab - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & mconv,axx !$acc declare copyin(zd,zu,p_cup,zdm,omeg,xaa0,rand_clos,aa1,edt,edtm,mconv,axx) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout) :: & aa0,closure_n !$acc declare copy(aa0,closure_n) @@ -3113,13 +3113,13 @@ subroutine cup_forcing_ens_3d(closure_n,xland,aa0,aa1,xaa0,mbdt,dtime,ierr,ierr2 real(kind=kind_phys) & ,intent (in ) :: & dtime - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout ) :: & k22,kbcon,ktop - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & xland - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr,ierr2,ierr3 !$acc declare copy(k22,kbcon,ktop,ierr,ierr2,ierr3) copyin(xland) @@ -3129,10 +3129,10 @@ subroutine cup_forcing_ens_3d(closure_n,xland,aa0,aa1,xaa0,mbdt,dtime,ierr,ierr2 integer, intent(in) :: dicycle logical, intent (in) :: progsigma - real(kind=kind_phys), intent(in) , dimension (its:ite) :: aa1_bl,tau_ecmwf - real(kind=kind_phys), intent(inout), dimension (its:ite) :: xf_dicycle - real(kind=kind_phys), intent(out), dimension (its:ite) :: xf_progsigma - real(kind=kind_phys), intent(inout), dimension (its:ite,10) :: forcing + real(kind=kind_phys), intent(in) , dimension (its:) :: aa1_bl,tau_ecmwf + real(kind=kind_phys), intent(inout), dimension (its:) :: xf_dicycle + real(kind=kind_phys), intent(out), dimension (its:) :: xf_progsigma + real(kind=kind_phys), intent(inout), dimension (its:,:) :: forcing !$acc declare copyin(aa1_bl,tau_ecmwf) copy(xf_dicycle,forcing) !- local var real(kind=kind_phys) :: xff_dicycle @@ -3487,31 +3487,31 @@ subroutine cup_kbcon(ierrc,cap_inc,iloop_in,k22,kbcon,he_cup,hes_cup, & ! ! ierr error value, maybe modified in this routine ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & he_cup,hes_cup,p_cup !$acc declare copyin(he_cup,hes_cup,p_cup) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & entr_rate,ztexec,zqexec,cap_inc,cap_max !$acc declare copyin(entr_rate,ztexec,zqexec,cap_inc,cap_max) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & hkb !,cap_max !$acc declare copy(hkb) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & kbmax !$acc declare copyin(kbmax) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & kbcon,k22,ierr !$acc declare copy(kbcon,k22,ierr) integer & ,intent (in ) :: & iloop_in - character*50 :: ierrc(its:ite) - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (in) :: z_cup,heo + character*50 :: ierrc(its:) + real(kind=kind_phys), dimension (its:,kts:),intent (in) :: z_cup,heo !$acc declare copyin(z_cup,heo) integer, dimension (its:ite) :: iloop,start_level !$acc declare create(iloop,start_level) @@ -3645,18 +3645,18 @@ subroutine cup_maximi(array,ks,ke,maxx,ierr, & ! x output array with return values ! kt output array of levels ! ks,kend check-range - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & array !$acc declare copyin(array) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & ierr,ke !$acc declare copyin(ierr,ke) integer & ,intent (in ) :: & ks - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (out ) :: & maxx !$acc declare copyout(maxx) @@ -3708,15 +3708,15 @@ subroutine cup_minimi(array,ks,kend,kt,ierr, & ! x output array with return values ! kt output array of levels ! ks,kend check-range - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & array !$acc declare copyin(array) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & ierr,ks,kend !$acc declare copyin(ierr,ks,kend) - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (out ) :: & kt !$acc declare copyout(kt) @@ -3771,10 +3771,10 @@ subroutine cup_up_aa0(aa0,z,zu,dby,gamma_cup,t_cup, & ! z = heights of model levels ! ierr error value, maybe modified in this routine ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & z,zu,gamma_cup,t_cup,dby - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & kbcon,ktop !$acc declare copyin(z,zu,gamma_cup,t_cup,dby,kbcon,ktop) @@ -3783,11 +3783,11 @@ subroutine cup_up_aa0(aa0,z,zu,dby,gamma_cup,t_cup, & ! - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr !$acc declare copy(ierr) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & aa0 !$acc declare copyout(aa0) @@ -3830,15 +3830,15 @@ subroutine neg_check(name,j,dt,q,outq,outt,outu,outv, & outqc,pret,its,ite,kts,kte,itf,ktf,ktop) integer, intent(in ) :: j,its,ite,kts,kte,itf,ktf - integer, dimension (its:ite ), intent(in ) :: ktop + integer, dimension (its: ), intent(in ) :: ktop - real(kind=kind_phys), dimension (its:ite,kts:kte ) , & + real(kind=kind_phys), dimension (its:,kts: ) , & intent(inout ) :: & outq,outt,outqc,outu,outv - real(kind=kind_phys), dimension (its:ite,kts:kte ) , & + real(kind=kind_phys), dimension (its:,kts: ) , & intent(inout ) :: & q - real(kind=kind_phys), dimension (its:ite ) , & + real(kind=kind_phys), dimension (its: ) , & intent(inout ) :: & pret !$acc declare copy(outq,outt,outqc,outu,outv,q,pret) @@ -3979,38 +3979,38 @@ subroutine cup_output_ens_3d(xff_mid,xf_ens,ierr,dellat,dellaq,dellaqc, & ! pw = pw -epsilon*pd (ensemble dependent) ! ierr error value, maybe modified in this routine ! - real(kind=kind_phys), dimension (its:ite,1:maxens3) & + real(kind=kind_phys), dimension (its:,:) & ,intent (inout) :: & xf_ens,pr_ens - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout ) :: & outtem,outq,outqc - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & zu,pwd,p_cup - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & sig,xmbm_in,xmbs_in,edt,sigmab,dx - real(kind=kind_phys), dimension (its:ite,2) & + real(kind=kind_phys), dimension (its:,:) & ,intent (in ) :: & xff_mid - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & pre,xmb - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & closure_n - real(kind=kind_phys), dimension (its:ite,kts:kte,1) & + real(kind=kind_phys), dimension (its:,kts:,:) & ,intent (in ) :: & dellat,dellaqc,dellaq,pw - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & ktop,xland1 - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr,ierr2,ierr3 integer, intent(in) :: dicycle - real(kind=kind_phys), intent(in), dimension (its:ite) :: xf_dicycle, xf_progsigma + real(kind=kind_phys), intent(in), dimension (its:) :: xf_dicycle, xf_progsigma !$acc declare copyin(zu,pwd,p_cup,sig,xmbm_in,xmbs_in,edt,xff_mid,dellat,dellaqc,dellaq,pw,ktop,xland1,xf_dicycle) !$acc declare copy(xf_ens,pr_ens,outtem,outq,outqc,pre,xmb,closure_n,ierr,ierr2,ierr3) ! @@ -4248,15 +4248,15 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & ! zu = normalized updraft mass flux ! gamma_cup = gamma on model cloud levels ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & p_cup,rho,q,zu,gamma_cup,qe_cup, & up_massentr,up_massdetr,dby,qes_cup,z_cup - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & zqexec,c0 ! entr= entrainment rate - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & kbcon,ktop,k22,xland1 !$acc declare copyin(p_cup,rho,q,zu,gamma_cup,qe_cup,up_massentr,up_massdetr,dby,qes_cup,z_cup,zqexec,c0,kbcon,ktop,k22,xland1) @@ -4268,7 +4268,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & ! ierr error value, maybe modified in this routine - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr !$acc declare copy(ierr) @@ -4281,11 +4281,11 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & ! pwav = totan normalized integrated condensate (i1) ! c0 = conversion rate (cloud to rain) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (out ) :: & qc,qrc,pw,clw_all !$acc declare copy(qc,qrc,pw,clw_all) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout) :: & c1d !$acc declare copy(c1d) @@ -4295,11 +4295,11 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & real(kind=kind_phys), dimension (its:ite) :: & pwavh !$acc declare create(pwavh) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & pwav,psum,psumh !$acc declare copyout(pwav,psum,psumh) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & ccn !$acc declare copyin(ccn) @@ -4329,7 +4329,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & is_deep = (name == 'deep') !$acc kernels - prop_b(kts:kte)=0 + prop_b(kts:)=0 !$acc end kernels iall=0 clwdet=0.1 !0.02 @@ -4646,11 +4646,11 @@ subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo implicit none character *(*), intent (in) :: name integer, intent(in) :: ipr,its,ite,itf,kts,kte,ktf - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (inout) :: entr_rate_2d,zuo - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (in) ::p_cup, heo,heso_cup,z_cup - real(kind=kind_phys), dimension (its:ite),intent (in) :: hkbo,rand_vmas - integer, dimension (its:ite),intent (in) :: kstabi,k22,kpbl,csum,xland,pmin_lev - integer, dimension (its:ite),intent (inout) :: kbcon,ierr,ktop,ktopdby + real(kind=kind_phys), dimension (its:,kts:),intent (inout) :: entr_rate_2d,zuo + real(kind=kind_phys), dimension (its:,kts:),intent (in) ::p_cup, heo,heso_cup,z_cup + real(kind=kind_phys), dimension (its:),intent (in) :: hkbo,rand_vmas + integer, dimension (its:),intent (in) :: kstabi,k22,kpbl,csum,xland,pmin_lev + integer, dimension (its:),intent (inout) :: kbcon,ierr,ktop,ktopdby !$acc declare copy(entr_rate_2d,zuo,kbcon,ierr,ktop,ktopdby) & !$acc copyin(p_cup, heo,heso_cup,z_cup,hkbo,rand_vmas,kstabi,k22,kpbl,csum,xland,pmin_lev) @@ -4737,7 +4737,7 @@ subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo ktop(i)= 0 else call get_zu_zd_pdf_fim(kklev,p_cup(i,:),rand_vmas(i),zubeg,ipr,xland(i),zuh2,1,ierr(i),k22(i), & - kfinalzu+1,zuo(i,kts:kte),kts,kte,ktf,beta_u,kbcon(i),csum(i),pmin_lev(i)) + kfinalzu+1,zuo(i,kts:),kts,kte,ktf,beta_u,kbcon(i),csum(i),pmin_lev(i)) endif endif ! end deep if ( is_mid ) then @@ -4748,7 +4748,7 @@ subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo kfinalzu=ktop(i) ktopdby(i)=ktop(i)+1 call get_zu_zd_pdf_fim(kklev,p_cup(i,:),rand_vmas(i),zubeg,ipr,xland(i),zuh2,3, & - ierr(i),k22(i),ktopdby(i)+1,zuo(i,kts:kte),kts,kte,ktf,beta_u,kbcon(i),csum(i),pmin_lev(i)) + ierr(i),k22(i),ktopdby(i)+1,zuo(i,kts:),kts,kte,ktf,beta_u,kbcon(i),csum(i),pmin_lev(i)) endif endif ! mid if ( is_shallow ) then @@ -4759,7 +4759,7 @@ subroutine rates_up_pdf(rand_vmas,ipr,name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo kfinalzu=ktop(i) ktopdby(i)=ktop(i)+1 call get_zu_zd_pdf_fim(kbcon(i),p_cup(i,:),rand_vmas(i),zubeg,ipr,xland(i),zuh2,2,ierr(i),k22(i), & - ktopdby(i)+1,zuo(i,kts:kte),kts,kte,ktf,beta_u,kbcon(i),csum(i),pmin_lev(i)) + ktopdby(i)+1,zuo(i,kts:),kts,kte,ktf,beta_u,kbcon(i),csum(i),pmin_lev(i)) endif endif ! shal @@ -4782,8 +4782,8 @@ subroutine get_zu_zd_pdf_fim(kklev,p,rand_vmas,zubeg,ipr,xland,zuh2,draft,ierr,k real(kind=kind_phys), parameter :: beta_dd=4.0,g_beta_dd=6. integer, intent(in) ::ipr,xland,kb,kklev,kt,kts,kte,ktf,kpbli,csum,pmin_lev real(kind=kind_phys), intent(in) ::max_mass,zubeg - real(kind=kind_phys), intent(inout) :: zu(kts:kte) - real(kind=kind_phys), intent(in) :: p(kts:kte) + real(kind=kind_phys), intent(inout) :: zu(kts:) + real(kind=kind_phys), intent(in) :: p(kts:) real(kind=kind_phys) :: trash,beta_deep,zuh(kts:kte),zuh2(1:40) integer, intent(inout) :: ierr integer, intent(in) ::draft @@ -5057,20 +5057,20 @@ subroutine cup_up_aa1bl(aa0,t,tn,q,qo,dtime, & ! z = heights of model levels ! ierr error value, maybe modified in this routine ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & z_cup,zu,gamma_cup,t_cup,dby,t,tn,q,qo - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & kbcon,ktop real(kind=kind_phys), intent(in) :: dtime ! ! input and output ! - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout) :: & ierr - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & aa0 ! @@ -5107,14 +5107,14 @@ subroutine get_inversion_layers(ierr,p_cup,t_cup,z_cup,qo_cup,qeso_cup,k_inv_lay implicit none integer ,intent (in ) :: itf,ktf,its,ite,kts,kte - integer, dimension (its:ite) ,intent (in ) :: ierr,kstart,kend + integer, dimension (its:) ,intent (in ) :: ierr,kstart,kend !$acc declare copyin(ierr,kstart,kend) integer, dimension (its:ite) :: kend_p3 !$acc declare create(kend_p3) - real(kind=kind_phys), dimension (its:ite,kts:kte), intent (in ) :: p_cup,t_cup,z_cup,qo_cup,qeso_cup - real(kind=kind_phys), dimension (its:ite,kts:kte), intent (out) :: dtempdz - integer, dimension (its:ite,kts:kte), intent (out) :: k_inv_layers + real(kind=kind_phys), dimension (its:,kts:), intent (in ) :: p_cup,t_cup,z_cup,qo_cup,qeso_cup + real(kind=kind_phys), dimension (its:,kts:), intent (out) :: dtempdz + integer, dimension (its:,kts:), intent (out) :: k_inv_layers !$acc declare copyin(p_cup,t_cup,z_cup,qo_cup,qeso_cup) !$acc declare copyout(dtempdz,k_inv_layers) !-local vars @@ -5308,15 +5308,15 @@ subroutine get_lateral_massflux(itf,ktf, its,ite, kts,kte implicit none integer, intent (in) :: draft integer, intent(in):: itf,ktf, its,ite, kts,kte - integer, intent(in) , dimension(its:ite) :: ierr,ktop,kbcon,k22 + integer, intent(in) , dimension(its:) :: ierr,ktop,kbcon,k22 !$acc declare copyin(ierr,ktop,kbcon,k22) - !real(kind=kind_phys), intent(in), optional , dimension(its:ite):: lambau - real(kind=kind_phys), intent(inout), optional , dimension(its:ite):: lambau - real(kind=kind_phys), intent(in) , dimension(its:ite,kts:kte) :: zo_cup,zuo - real(kind=kind_phys), intent(inout), dimension(its:ite,kts:kte) :: cd,entr_rate_2d - real(kind=kind_phys), intent( out), dimension(its:ite,kts:kte) :: up_massentro, up_massdetro & + !real(kind=kind_phys), intent(in), optional , dimension(its:):: lambau + real(kind=kind_phys), intent(inout), optional , dimension(its:):: lambau + real(kind=kind_phys), intent(in) , dimension(its:,kts:) :: zo_cup,zuo + real(kind=kind_phys), intent(inout), dimension(its:,kts:) :: cd,entr_rate_2d + real(kind=kind_phys), intent( out), dimension(its:,kts:) :: up_massentro, up_massdetro & ,up_massentr, up_massdetr - real(kind=kind_phys), intent( out), dimension(its:ite,kts:kte), optional :: & + real(kind=kind_phys), intent( out), dimension(its:,kts:), optional :: & up_massentru,up_massdetru !$acc declare copy(lambau,cd,entr_rate_2d) copyin(zo_cup,zuo) copyout(up_massentro, up_massdetro,up_massentr, up_massdetr) !$acc declare copyout(up_massentro, up_massdetro,up_massentr, up_massdetr, up_massentru,up_massdetru) @@ -5437,10 +5437,10 @@ subroutine get_partition_liq_ice(ierr,tn,po_cup, p_liq_ice,melting_layer implicit none character *(*), intent (in) :: cumulus integer ,intent (in ) :: itf,ktf, its,ite, kts,kte - real(kind=kind_phys), intent (in ), dimension(its:ite,kts:kte) :: tn,po_cup - real(kind=kind_phys), intent (inout), dimension(its:ite,kts:kte) :: p_liq_ice,melting_layer + real(kind=kind_phys), intent (in ), dimension(its:,kts:) :: tn,po_cup + real(kind=kind_phys), intent (inout), dimension(its:,kts:) :: p_liq_ice,melting_layer !$acc declare copyin(tn,po_cup) copy(p_liq_ice,melting_layer) - integer , intent (in ), dimension(its:ite) :: ierr + integer , intent (in ), dimension(its:) :: ierr !$acc declare copyin(ierr) integer :: i,k real(kind=kind_phys) :: dp @@ -5539,11 +5539,11 @@ subroutine get_melting_profile(ierr,tn_cup,po_cup, p_liq_ice,melting_layer,qrco implicit none character *(*), intent (in) :: cumulus integer ,intent (in ) :: itf,ktf, its,ite, kts,kte - integer ,intent (in ), dimension(its:ite) :: ierr - real(kind=kind_phys) ,intent (in ), dimension(its:ite) :: edto - real(kind=kind_phys) ,intent (in ), dimension(its:ite,kts:kte) :: tn_cup,po_cup,qrco,pwo & + integer ,intent (in ), dimension(its:) :: ierr + real(kind=kind_phys) ,intent (in ), dimension(its:) :: edto + real(kind=kind_phys) ,intent (in ), dimension(its:,kts:) :: tn_cup,po_cup,qrco,pwo & ,pwdo,p_liq_ice,melting_layer - real(kind=kind_phys) ,intent (inout), dimension(its:ite,kts:kte) :: melting + real(kind=kind_phys) ,intent (inout), dimension(its:,kts:) :: melting !$acc declare copyin(ierr,edto,tn_cup,po_cup,qrco,pwo,pwdo,p_liq_ice,melting_layer,melting) integer :: i,k real(kind=kind_phys) :: dp @@ -5615,13 +5615,13 @@ subroutine get_cloud_top(name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo,heso_cup,z_c kstabi,k22,kbcon,its,ite,itf,kts,kte,ktf,zuo,kpbl,klcl,hcot) implicit none integer, intent(in) :: its,ite,itf,kts,kte,ktf - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (inout) :: entr_rate_2d,zuo - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (in) ::p_cup, heo,heso_cup,z_cup - real(kind=kind_phys), dimension (its:ite),intent (in) :: hkbo - integer, dimension (its:ite),intent (in) :: kstabi,k22,kbcon,kpbl,klcl - integer, dimension (its:ite),intent (inout) :: ierr,ktop + real(kind=kind_phys), dimension (its:,kts:),intent (inout) :: entr_rate_2d,zuo + real(kind=kind_phys), dimension (its:,kts:),intent (in) ::p_cup, heo,heso_cup,z_cup + real(kind=kind_phys), dimension (its:),intent (in) :: hkbo + integer, dimension (its:),intent (in) :: kstabi,k22,kbcon,kpbl,klcl + integer, dimension (its:),intent (inout) :: ierr,ktop !$acc declare copy(entr_rate_2d,zuo,ierr,ktop) copyin(p_cup, heo,heso_cup,z_cup,hkbo,kstabi,k22,kbcon,kpbl,klcl) - real(kind=kind_phys), dimension (its:ite,kts:kte) :: hcot + real(kind=kind_phys), dimension (its:,kts:) :: hcot !$acc declare create(hcot) character *(*), intent (in) :: name real(kind=kind_phys) :: dz,dh, dbythresh @@ -5644,7 +5644,7 @@ subroutine get_cloud_top(name,ktop,ierr,p_cup,entr_rate_2d,hkbo,heo,heso_cup,z_c kfinalzu=ktf-2 ktop(i)=kfinalzu if(ierr(i).eq.0)then - dby (kts:kte)=0.0 + dby (kts:)=0.0 start_level(i)=kbcon(i) !-- hcot below kbcon @@ -5704,16 +5704,16 @@ subroutine calculate_updraft_velocity(its,itf,ktf,ite,kts,kte,ierr,progsigma, implicit none logical, intent(in) :: progsigma integer, intent(in) :: itf,its,ktf,ite,kts,kte - integer, dimension (its:ite), intent(inout) :: ierr - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (in) :: zo,entr_rate_2d, & + integer, dimension (its:), intent(inout) :: ierr + real(kind=kind_phys), dimension (its:,kts:),intent (in) :: zo,entr_rate_2d, & cd,po,qeso,to,qo,dbyo,clw_all,qlk,delp,zu - integer, dimension (its:ite),intent(in) :: k22,kbcon,ktcon + integer, dimension (its:),intent(in) :: k22,kbcon,ktcon real(kind=kind_phys), dimension (its:ite) :: sumx real(kind=kind_phys) ,intent (in) :: fv,rd,el2orc real(kind=kind_phys), dimension (its:ite,kts:kte) :: drag, buo, zi, del - real(kind=kind_phys), dimension (its:ite,kts:kte),intent (out) :: wu2,omega_u, & + real(kind=kind_phys), dimension (its:,kts:),intent (out) :: wu2,omega_u, & zeta,zdqca - real(kind=kind_phys), dimension (its:ite),intent(out) :: wc,omegac + real(kind=kind_phys), dimension (its:),intent(out) :: wc,omegac real(kind=kind_phys) :: rho,bb1,bb2,dz,dp,ptem,tem1,ptem1,tem,rfact,gamma,val integer :: i,k diff --git a/physics/cu_c3_sh.F90 b/physics/cu_c3_sh.F90 index 0ea0f28ae..2568a26e6 100644 --- a/physics/cu_c3_sh.F90 +++ b/physics/cu_c3_sh.F90 @@ -95,23 +95,23 @@ subroutine cu_c3_sh_run ( & ! outq = output q tendency (per s) ! outqc = output qc tendency (per s) ! pre = output precip - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout ) :: & cnvwt,outt,outq,outqc,cupclw,zuo,outu,outv !$acc declare copy(cnvwt,outt,outq,outqc,cupclw,zuo,outu,outv) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & tmf, qmicro, sigmain, forceqv_spechum - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & xmb_out - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (inout ) :: & ierr - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (out ) :: & kbcon,ktop,k22 - integer, dimension (its:ite) & + integer, dimension (its:) & ,intent (in ) :: & kpbl,tropics !$acc declare copyout(xmb_out,kbcon,ktop,k22) copyin(kpbl,tropics) copy(ierr) @@ -119,13 +119,13 @@ subroutine cu_c3_sh_run ( & ! basic environmental input includes a flag (ierr) to turn off ! convection for this call only and at that particular gridpoint ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & t,po,tn,dhdt,rho,us,vs,delp - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (inout) :: & q,qo - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & xland,z1,psur,hfx,qfx,dx @@ -133,7 +133,7 @@ subroutine cu_c3_sh_run ( & ,intent (in ) :: & dtime,tcrit,fv,r_d !$acc declare sigmaout - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:,kts:) & ,intent (out) :: & sigmaout @@ -245,7 +245,7 @@ subroutine cu_c3_sh_run ( & real(kind=kind_phys) buo_flux,pgeoh,dp,entup,detup,totmas real(kind=kind_phys) xff_shal(3),blqe,xkshal - character*50 :: ierrc(its:ite) + character*50 :: ierrc(its:) real(kind=kind_phys), dimension (its:ite,kts:kte) :: & up_massentr,up_massdetr,up_massentro,up_massdetro,up_massentru,up_massdetru !$acc declare create(up_massentr,up_massdetr,up_massentro,up_massdetro,up_massentru,up_massdetru) From 26ca9f9c3d08aa5ddc5cb414c1a0377d1fb5fae2 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 6 Sep 2023 10:57:28 -0600 Subject: [PATCH 43/81] Renamed file --- ...s_diagnostics.F90 => GFS_physics_post.F90} | 30 +++++++++---------- ...diagnostics.meta => GFS_physics_post.meta} | 6 ++-- physics/ozphys_2015.F90 | 1 + 3 files changed, 19 insertions(+), 18 deletions(-) rename physics/{GFS_physics_diagnostics.F90 => GFS_physics_post.F90} (81%) rename physics/{GFS_physics_diagnostics.meta => GFS_physics_post.meta} (97%) diff --git a/physics/GFS_physics_diagnostics.F90 b/physics/GFS_physics_post.F90 similarity index 81% rename from physics/GFS_physics_diagnostics.F90 rename to physics/GFS_physics_post.F90 index 0c6197bc2..d034c1999 100644 --- a/physics/GFS_physics_diagnostics.F90 +++ b/physics/GFS_physics_post.F90 @@ -1,20 +1,20 @@ ! ########################################################################################### -!> \file GFS_physics_diagnostics.F90 +!> \file GFS_physics_post.F90 !! ! ########################################################################################### -module GFS_physics_diagnostics +module GFS_physics_post use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec implicit none - public GFS_physics_diagnostics_init, GFS_physics_diagnostics_run + public GFS_physics_post_init, GFS_physics_post_run contains ! ########################################################################################### -! SUBROUTINE GFS_physics_diagnostics_init +! SUBROUTINE GFS_physics_post_init ! ########################################################################################### -!! \section arg_table_GFS_physics_diagnostics_init Argument Table -!! \htmlinclude GFS_physics_diagnostics_init.html +!! \section arg_table_GFS_physics_post_init Argument Table +!! \htmlinclude GFS_physics_post_init.html !! - subroutine GFS_physics_diagnostics_init(errmsg, errflg) + subroutine GFS_physics_post_init(errmsg, errflg) ! Outputs character(len=*), intent(out) :: & @@ -22,15 +22,15 @@ subroutine GFS_physics_diagnostics_init(errmsg, errflg) integer, intent(out) :: & errflg ! CCPP error flag - end subroutine GFS_physics_diagnostics_init + end subroutine GFS_physics_post_init ! ########################################################################################### -! SUBROUTINE GFS_physics_diagnostics_run +! SUBROUTINE GFS_physics_post_run ! ########################################################################################### -!! \section arg_table_GFS_physics_diagnostics_run Argument Table -!! \htmlinclude GFS_physics_diagnostics_run.html +!! \section arg_table_GFS_physics_post_run Argument Table +!! \htmlinclude GFS_physics_post_run.html !! - subroutine GFS_physics_diagnostics_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, & + subroutine GFS_physics_post_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, & ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, dtend,& errmsg, errflg) ! Inputs @@ -69,7 +69,7 @@ subroutine GFS_physics_diagnostics_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip ! ####################################################################################### ! - ! Ozone physics diagnostics + ! Ozone physics diagnostic ! ! ####################################################################################### idtend = dtidx(100+ntoz,ip_prod_loss) @@ -92,6 +92,6 @@ subroutine GFS_physics_diagnostics_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_ohoz endif - end subroutine GFS_physics_diagnostics_run + end subroutine GFS_physics_post_run -end module GFS_physics_diagnostics +end module GFS_physics_post diff --git a/physics/GFS_physics_diagnostics.meta b/physics/GFS_physics_post.meta similarity index 97% rename from physics/GFS_physics_diagnostics.meta rename to physics/GFS_physics_post.meta index b6036b0c9..8b5120b9e 100644 --- a/physics/GFS_physics_diagnostics.meta +++ b/physics/GFS_physics_post.meta @@ -1,11 +1,11 @@ [ccpp-table-properties] - name = GFS_physics_diagnostics + name = GFS_physics_post type = scheme dependencies = machine.F ######################################################################## [ccpp-arg-table] - name = GFS_physics_diagnostics_init + name = GFS_physics_post_init type = scheme [errmsg] standard_name = ccpp_error_message @@ -25,7 +25,7 @@ ######################################################################## [ccpp-arg-table] - name = GFS_physics_diagnostics_run + name = GFS_physics_post_run type = scheme [nCol] standard_name = horizontal_loop_extent diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index 9898c71e4..47386bd6e 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -17,6 +17,7 @@ module ozphys_2015 !! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval !! Research Laboratory through CHEM2D chemistry model !! (McCormack et al. (2006) \cite mccormack_et_al_2006). +!! (https://doi.org/10.5194/acp-6-4943-2006) !! !> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm !> - This code assumes that both prsl and po3 are from bottom to top From c0ec619536bd29740627cb2dc1da106b61dd435c Mon Sep 17 00:00:00 2001 From: Michael Toy Date: Tue, 19 Sep 2023 02:36:14 +0000 Subject: [PATCH 44/81] Added tendency limiter for mesosphere and horizontal wave number filter for orographic gravity wave drag in UGWP -- Issue #95 --- physics/drag_suite.F90 | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 22f122e71..ff68f4216 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -460,6 +460,8 @@ subroutine drag_suite_run( & real(kind=kind_phys), parameter :: ce = 0.8 real(kind=kind_phys), parameter :: cg = 0.5 real(kind=kind_phys), parameter :: sgmalolev = 0.5 ! max sigma lvl for dtfac + real(kind=kind_phys), parameter :: plolevmeso = 70.0 ! pres lvl for mesosphere OGWD reduction (Pa) + real(kind=kind_phys), parameter :: facmeso = 0.5 ! fractional velocity reduction for OGWD integer,parameter :: kpblmin = 2 ! @@ -472,7 +474,7 @@ subroutine drag_suite_run( & rcsks,wdir,ti,rdz,tem2,dw2,shr2, & bvf2,rdelks,wtkbj,tem,gfobnv,hd,fro, & rim,temc,tem1,efact,temv,dtaux,dtauy, & - dtauxb,dtauyb,eng0,eng1 + dtauxb,dtauyb,eng0,eng1,ksmax,dtfac_meso ! logical :: ldrag(im),icrilv(im), & flag(im),kloop1(im) @@ -887,6 +889,14 @@ 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_stoch(i) .le. 0.0 +! Check if mesoscale gravity waves will propagate vertically or be evanescent +! and not impart a drag force -- consider the maximum sub-grid horizontal +! topographic wavelength to be one-half the horizontal grid spacing -- calculate +! ksmax accordingly + ksmax = 4.0*pi/dx(i) ! based on wavelength = 0.5*dx(i) + if ( bnv2(i,1).gt.0.0 ) then + ldrag(i) = ldrag(i) .or. sqrt(bnv2(i,1))*rulow(i).lt.ksmax + endif ! ! set all ri low level values to the low level value ! @@ -1106,7 +1116,19 @@ subroutine drag_suite_run( & enddo ! do k = kts,km - taud_ms(i,k) = taud_ms(i,k)*dtfac(i)* ls_taper(i) *(1.-rstoch(i)) + + ! Check if well into mesosphere -- if so, perform similar reduction of + ! velocity tendency due to mesoscale GWD to prevent sudden reversal of + ! wind direction (similar to above) + dtfac_meso = 1.0 + if (prsl(i,k).le.plolevmeso) then + if (taud_ms(i,k).ne.0.) & + dtfac_meso = min(dtfac_meso,facmeso*abs(velco(i,k) & + /(deltim*rcs*taud_ms(i,k)))) + end if + + taud_ms(i,k) = taud_ms(i,k)*dtfac(i)*dtfac_meso* & + ls_taper(i) *(1.-rstoch(i)) taud_bl(i,k) = taud_bl(i,k)*dtfac(i)* ls_taper(i) *(1.-rstoch(i)) dtaux = taud_ms(i,k) * xn(i) From ab84c01a110bbf13490fcf3243effe06cb26608d Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Wed, 20 Sep 2023 01:29:56 +0000 Subject: [PATCH 45/81] "GF radar reflectivity, dust bug fix, and C3 updates" --- physics/GFS_rrtmg_pre.F90 | 2 +- physics/cu_c3_deep.F90 | 16 +++-- physics/cu_c3_driver.F90 | 4 +- physics/cu_c3_sh.F90 | 10 ++-- physics/cu_gf_driver_post.F90 | 11 ++-- physics/smoke_dust/dust_data_mod.F90 | 32 ++++------ physics/smoke_dust/dust_fengsha_mod.F90 | 70 +++++++++++++++++----- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 22 ++++--- physics/smoke_dust/rrfs_smoke_wrapper.meta | 36 +++++++++-- 9 files changed, 138 insertions(+), 65 deletions(-) diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 4f4de181a..fff4ae0b9 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -976,7 +976,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& & imp_physics_mg, iovr, iovr_rand, iovr_maxrand, iovr_max, & & iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, & & idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, & - & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_gf, do_mynnedmf, & + & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, & & lgfdlmprad, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & diff --git a/physics/cu_c3_deep.F90 b/physics/cu_c3_deep.F90 index c3a4b2c4e..d1b490c77 100644 --- a/physics/cu_c3_deep.F90 +++ b/physics/cu_c3_deep.F90 @@ -2078,9 +2078,9 @@ subroutine cu_c3_deep_run( & !> - Call rain_evap_below_cloudbase() to calculate evaporation below cloud base - call rain_evap_below_cloudbase(itf,ktf,its,ite, & - kts,kte,ierr,kbcon,xmb,psur,xland,qo_cup, & - po_cup,qes_cup,pwavo,edto,pwevo,pre,outt,outq) !,outbuoy) +! call rain_evap_below_cloudbase(itf,ktf,its,ite, & +! kts,kte,ierr,kbcon,xmb,psur,xland,qo_cup, & +! po_cup,qes_cup,pwavo,edto,pwevo,pre,outt,outq) !,outbuoy) k=1 !$acc kernels @@ -2137,7 +2137,7 @@ subroutine cu_c3_deep_run( & do k = ktop(i), 1, -1 rain = pwo(i,k) + edto(i) * pwdo(i,k) rn(i) = rn(i) + rain * xmb(i) * .001 * dtime - !if(po(i,k).gt.400.)then + if(k.gt.jmin(i))then if(flg(i))then q1=qo(i,k)+(outq(i,k))*dtime t1=tn(i,k)+(outt(i,k))*dtime @@ -2162,7 +2162,7 @@ subroutine cu_c3_deep_run( & pre(i)=max(pre(i),0.) delqev(i) = delqev(i) + .001*dp*qevap(i)/g endif - !endif ! 400mb + endif endif enddo ! pre(i)=1000.*rn(i)/dtime @@ -4429,7 +4429,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & ! !now do the rest ! - kklev(i)=maxloc(zu(i,:),1) + kklev(i)=maxloc(zu(i,2:ktop(i)),1) !$acc loop seq do k=kbcon(i)+1,ktop(i) if(t(i,k) > 273.16) then @@ -4489,6 +4489,10 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & endif if(k.gt.kbcon(i)+1)c1d(i,k)=clwdet*up_massdetr(i,k-1) if(k.gt.kbcon(i)+1)c1d_b(i,k)=clwdet*up_massdetr(i,k-1) + !if(is_deep.and.k.gt.kklev(i))then + c1d(i,k)=0.005 + c1d_b(i,k)=0.005 + !endif if(autoconv.eq.2) then ! diff --git a/physics/cu_c3_driver.F90 b/physics/cu_c3_driver.F90 index fd4d37b0b..270e01989 100644 --- a/physics/cu_c3_driver.F90 +++ b/physics/cu_c3_driver.F90 @@ -340,8 +340,8 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ! !> - Set tuning constants for radiation coupling ! - tun_rad_shall(:)=.01 - tun_rad_mid(:)=.3 !.02 + tun_rad_shall(:)=.012 + tun_rad_mid(:)=.15 !.02 tun_rad_deep(:)=.3 !.065 edt(:)=0. edtm(:)=0. diff --git a/physics/cu_c3_sh.F90 b/physics/cu_c3_sh.F90 index 0ea0f28ae..d2b9a71b2 100644 --- a/physics/cu_c3_sh.F90 +++ b/physics/cu_c3_sh.F90 @@ -6,12 +6,12 @@ module cu_c3_sh use progsigma, only : progsigma_calc !real(kind=kind_phys), parameter:: c1_shal=0.0015! .0005 - real(kind=kind_phys), parameter:: c1_shal=0. !0.005! .0005 real(kind=kind_phys), parameter:: g =9.81 real(kind=kind_phys), parameter:: cp =1004. real(kind=kind_phys), parameter:: xlv=2.5e6 real(kind=kind_phys), parameter:: r_v=461. - real(kind=kind_phys), parameter:: c0_shal=.001 + real(kind=kind_phys) :: c0_shal=.004 + real(kind=kind_phys) :: c1_shal=0. !0.005! .0005 real(kind=kind_phys), parameter:: fluxtune=1.5 contains @@ -274,6 +274,8 @@ subroutine cu_c3_sh_run ( & ktopx(i)=0 if(xland(i).gt.1.5 .or. xland(i).lt.0.5)then xland1(i)=0 + c0_shal=.001 + c1_shal=.001 ! ierr(i)=100 endif pre(i)=0. @@ -669,11 +671,11 @@ subroutine cu_c3_sh_run ( & if(qco(i,k)>=trash ) then dz=z_cup(i,k)-z_cup(i,k-1) ! cloud liquid water - c1d(i,k)=.02*up_massdetr(i,k-1) + c1d(i,k)=c1_shal! 0. !.02*up_massdetr(i,k-1) qrco(i,k)= (qco(i,k)-trash)/(1.+(c0_shal+c1d(i,k))*dz) if(qrco(i,k).lt.0.)then ! hli new test 02/12/19 qrco(i,k)=0. - c1d(i,k)=0. + !c1d(i,k)=0. endif pwo(i,k)=c0_shal*dz*qrco(i,k)*zuo(i,k) clw_all(i,k)=qco(i,k)-trash !LB total cloud before rain and detrain diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index 56da0feba..8c5896164 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -66,20 +66,21 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m conv_act_m(i)=0.0 endif ! reflectivity parameterization for parameterized convection (reference:Unipost MDLFLD.f) - if(sqrt(garea(i)).lt.6500.)then + !if(sqrt(garea(i)).lt.6500.)then ze = 0.0 ze_conv = 0.0 dbz_sum = 0.0 - cuprate = raincv(i) * 3600.0 / dt ! cu precip rate (mm/h) - ze_conv = 300.0 * cuprate**1.4 - if (maxupmf(i).gt.0.05) then + cuprate = max(0.1,1.e3*raincv(i) * 3600.0 / dt) ! cu precip rate (mm/h) + if(cuprate .lt. 0.05) cuprate=0. + ze_conv = 300.0 * cuprate**1.5 + if (maxupmf(i).gt.0.1 .and. cuprate.gt.0.) then do k = 1, km ze = 10._kind_phys ** (0.1 * refl_10cm(i,k)) dbz_sum = max(dbzmin, 10.0 * log10(ze + ze_conv)) refl_10cm(i,k) = dbz_sum enddo endif - endif + !endif enddo !$acc end kernels diff --git a/physics/smoke_dust/dust_data_mod.F90 b/physics/smoke_dust/dust_data_mod.F90 index a710701f1..eb809378d 100755 --- a/physics/smoke_dust/dust_data_mod.F90 +++ b/physics/smoke_dust/dust_data_mod.F90 @@ -44,24 +44,10 @@ module dust_data_mod ! Never used: ! real(kind_phys), parameter :: fengsha_alpha = 0.3 ! real(kind_phys), parameter :: fengsha_gamma = 1.3 + ! -- FENGSHA threshold velocities based on Dale A. Gillette's data integer, parameter :: fengsha_maxstypes = 13 -! real(kind_phys), dimension(fengsha_maxstypes) :: dust_uthres = & -! (/ 0.065, & ! Sand - 1 -! 0.20, & ! Loamy Sand - 2 -! 0.52, & ! Sandy Loam - 3 -! 0.50, & ! Silt Loam - 4 -! 0.50, & ! Silt - 5 -! 0.60, & ! Loam - 6 -! 0.73, & ! Sandy Clay Loam - 7 -! 0.73, & ! Silty Clay Loam - 8 -! 0.80, & ! Clay Loam - 9 -! 0.95, & ! Sandy Clay - 10 -! 0.95, & ! Silty Clay - 11 -! 1.00, & ! Clay - 12 -! 9.999 /) ! Other - 13 -! dust_uthres = 0.065, 0.18, 0.27, 0.30, 0.35, 0.38, 0.35, 0.41, 0.41, -! 0.45,0.50,0.45,9999.0 + real(kind_phys), dimension(fengsha_maxstypes), parameter :: dust_uthres = & (/ 0.065, & ! Sand - 1 0.18, & ! Loamy Sand - 2 @@ -76,12 +62,16 @@ module dust_data_mod 0.50, & ! Silty Clay - 11 0.45, & ! Clay - 12 9999.0 /) ! Other - 13 - ! -- FENGSHA uses precalculated drag partition from ASCAT. See: Prigent et al. (2012,2015) - integer, parameter :: dust_calcdrag = 1 - real(kind_phys) :: dust_alpha = 2.2 + ! -- FENGSHA uses precalculated drag partition + integer, parameter :: dust_calcdrag = 1 + ! -- FENGSHA dust moisture parameterization 1:fecan - 2:shao + integer :: dust_moist_opt = 1 + + real(kind_phys) :: dust_alpha = 1.0 real(kind_phys) :: dust_gamma = 1.0 - + real(kind_phys) :: dust_moist_correction = 1.0 + real(kind_phys) :: dust_drylimit_factor = 1.0 ! -- sea salt parameters integer, dimension(nsalt), parameter :: spoint = (/ 1, 2, 2, 2, 2, 2, 3, 3, 3 /) ! 1 Clay, 2 Silt, 3 Sand @@ -93,7 +83,7 @@ module dust_data_mod (/ 1., 0.2, 0.2, 0.2, 0.2, 0.2, 0.333, 0.333, 0.333 /) - ! -- soil vagatation parameters + ! -- soil vegatation parameters integer, parameter :: max_soiltyp = 30 real(kind_phys), dimension(max_soiltyp), parameter :: & maxsmc = (/ 0.421, 0.464, 0.468, 0.434, 0.406, 0.465, & diff --git a/physics/smoke_dust/dust_fengsha_mod.F90 b/physics/smoke_dust/dust_fengsha_mod.F90 index 54a64239d..1e24c8947 100755 --- a/physics/smoke_dust/dust_fengsha_mod.F90 +++ b/physics/smoke_dust/dust_fengsha_mod.F90 @@ -61,6 +61,8 @@ subroutine gocart_dust_fengsha_driver(dt, & REAL(kind_phys), INTENT(IN) :: dt ! time step REAL(kind_phys), INTENT(IN) :: g ! gravity (m/s**2) + + ! Local variables integer :: nmx,i,j,k,imx,jmx,lmx integer :: ilwi @@ -75,6 +77,7 @@ subroutine gocart_dust_fengsha_driver(dt, & real(kind_phys), DIMENSION (num_emis_dust) :: distribution real(kind_phys), dimension (3) :: massfrac real(kind_phys) :: erodtot + real(kind_phys) :: moist_volumetric ! conversion values conver=1.e-9 @@ -174,10 +177,13 @@ subroutine gocart_dust_fengsha_driver(dt, & endif endif + ! soil moisture correction factor + moist_volumetric = dust_moist_correction * smois(i,2,j) + ! Call dust emission routine. call source_dust(imx,jmx, lmx, nmx, dt, tc, ustar, massfrac, & - erodtot, dxy, smois(i,1,j), airden, airmas, bems, g, dust_alpha, dust_gamma, & + erodtot, dxy, moist_volumetric, airden, airmas, bems, g, dust_alpha, dust_gamma, & R, uthr(i,j)) ! convert back to concentration @@ -457,10 +463,16 @@ subroutine DustEmissionFENGSHA(slc, clay, sand, silt, & ! Now compute size-dependent total emission flux ! ---------------------------------------------- - ! Fecan moisture correction - ! ------------------------- - h = moistureCorrectionFecan(slc, sand, clay, rhop) - + + if (dust_moist_opt .eq. 1) then + + ! Fecan moisture correction + ! ------------------------- + h = moistureCorrectionFecan(slc, sand, clay) + else + ! shao soil moisture correction + h = moistureCorrectionShao(slc) + end if ! Adjust threshold ! ---------------- u_thresh = uthrs * h @@ -478,7 +490,7 @@ subroutine DustEmissionFENGSHA(slc, clay, sand, silt, & end subroutine DustEmissionFENGSHA !----------------------------------------------------------------- - real function soilMoistureConvertVol2Grav(vsoil, sandfrac, rhop) + real function soilMoistureConvertVol2Grav(vsoil, sandfrac) ! !USES: implicit NONE @@ -486,7 +498,6 @@ real function soilMoistureConvertVol2Grav(vsoil, sandfrac, rhop) ! !INPUT PARAMETERS: REAL(kind_phys), intent(in) :: vsoil ! volumetric soil moisture fraction [1] REAL(kind_phys), intent(in) :: sandfrac ! fractional sand content [1] - REAL(kind_phys), intent(in) :: rhop ! dry dust density [kg m-3] ! !DESCRIPTION: Convert soil moisture fraction from volumetric to gravimetric. ! @@ -500,20 +511,21 @@ real function soilMoistureConvertVol2Grav(vsoil, sandfrac, rhop) ! !CONSTANTS: REAL(kind_phys), parameter :: rhow = 1000. ! density of water [kg m-3] - + REAL(kind_phys), parameter :: rhop = 1700. ! density of dry soil !EOP !------------------------------------------------------------------------- ! Begin... ! Saturated volumetric water content (sand-dependent) ! [m3 m-3] - vsat = 0.489 - 0.00126 * ( 100. * sandfrac ) + vsat = 0.489 - 0.126 * sandfrac + ! Gravimetric soil content - soilMoistureConvertVol2Grav = vsoil * rhow / (rhop * (1. - vsat)) + soilMoistureConvertVol2Grav = 100.0 * (vsoil * rhow / rhop / ( 1. - vsat)) end function soilMoistureConvertVol2Grav !---------------------------------------------------------------- - real function moistureCorrectionFecan(slc, sand, clay, rhop) + real function moistureCorrectionFecan(slc, sand, clay) ! !USES: implicit NONE @@ -522,7 +534,6 @@ real function moistureCorrectionFecan(slc, sand, clay, rhop) REAL(kind_phys), intent(in) :: slc ! liquid water content of top soil layer, volumetric fraction [1] REAL(kind_phys), intent(in) :: sand ! fractional sand content [1] REAL(kind_phys), intent(in) :: clay ! fractional clay content [1] - REAL(kind_phys), intent(in) :: rhop ! dry dust density [kg m-3] ! !DESCRIPTION: Compute correction factor to account for Fecal soil moisture ! @@ -540,15 +551,46 @@ real function moistureCorrectionFecan(slc, sand, clay, rhop) ! Begin... ! Convert soil moisture from volumetric to gravimetric - grvsoilm = soilMoistureConvertVol2Grav(slc, sand, 2650.) + grvsoilm = soilMoistureConvertVol2Grav(slc, sand) ! Compute fecan dry limit - drylimit = clay * (14.0 * clay + 17.0) + drylimit = dust_drylimit_factor * clay * (14.0 * clay + 17.0) ! Compute soil moisture correction moistureCorrectionFecan = sqrt(1.0 + 1.21 * max(0., grvsoilm - drylimit)**0.68) end function moistureCorrectionFecan +!---------------------------------------------------------------- + real function moistureCorrectionShao(slc) + +! !USES: + implicit NONE + +! !INPUT PARAMETERS: + REAL(kind_phys), intent(in) :: slc ! liquid water content of top soil layer, volumetric fraction [1] + +! !DESCRIPTION: Compute correction factor to account for Fecal soil moisture +! +! !REVISION HISTORY: +! +! 02Apr2020, B.Baker/NOAA - Original implementation +! 01Apr2020, R.Montuoro/NOAA - Adapted for GOCART process library + +! !Local Variables + real :: grvsoilm + real :: drylimit + +!EOP +!--------------------------------------------------------------- +! Begin... + + if (slc < 0.03) then + moistureCorrectionShao = exp(22.7 * slc) + else + moistureCorrectionShao = exp(95.3 * slc - 2.029) + end if + + end function moistureCorrectionShao !--------------------------------------------------------------- real function DustFluxV2HRatioMB95(clay, kvhmax) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index 1f9ef6340..7b69fc9e3 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -12,7 +12,8 @@ module rrfs_smoke_wrapper num_moist, num_chem, num_emis_seas, num_emis_dust, & DUST_OPT_FENGSHA, p_qv, p_atm_shum, p_atm_cldq, & p_smoke, p_dust_1, p_coarse_pm, epsilc - use dust_data_mod, only : dust_alpha, dust_gamma + use dust_data_mod, only : dust_alpha, dust_gamma, dust_moist_opt, & + dust_moist_correction, dust_drylimit_factor use plume_data_mod, only : p_frp_std, p_frp_hr, num_frp_plume use seas_mod, only : gocart_seasalt_driver use dust_fengsha_mod, only : gocart_dust_fengsha_driver @@ -49,6 +50,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ebb_smoke_hr, frp_hr, frp_std_hr, & coef_bb, ebu_smoke,fhist, min_fplume, max_fplume, hwp, wetness, & smoke_ext, dust_ext, ndvel, ddvel_inout,rrfs_sd, & + dust_moist_opt_in, dust_moist_correction_in, dust_drylimit_factor_in, & dust_alpha_in, dust_gamma_in, fire_in, & seas_opt_in, dust_opt_in, drydep_opt_in, coarsepm_settling_in, & do_plumerise_in, plumerisefire_frq_in, addsmoke_flag_in, & @@ -91,12 +93,15 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, real(kind_phys), dimension(:,:), intent(out) :: smoke_ext, dust_ext real(kind_phys), dimension(:,:), intent(inout) :: nwfa, nifa real(kind_phys), dimension(:,:), intent(inout) :: ddvel_inout - real (kind=kind_phys), dimension(:), intent(in) :: wetness - integer, intent(in ) :: imp_physics, imp_physics_thompson - real (kind=kind_phys), intent(in) :: dust_alpha_in, dust_gamma_in, wetdep_ls_alpha_in - integer, intent(in) :: seas_opt_in, dust_opt_in, drydep_opt_in, & - coarsepm_settling_in, plumerisefire_frq_in, & - addsmoke_flag_in, wetdep_ls_opt_in + real(kind_phys), dimension(:), intent(in) :: wetness + real(kind_phys), intent(in) :: dust_alpha_in, dust_gamma_in, wetdep_ls_alpha_in + real(kind_phys), intent(in) :: dust_moist_correction_in + real(kind_phys), intent(in) :: dust_drylimit_factor_in + integer, intent(in) :: dust_moist_opt_in + integer, intent(in) :: imp_physics, imp_physics_thompson + integer, intent(in) :: seas_opt_in, dust_opt_in, drydep_opt_in, & + coarsepm_settling_in, plumerisefire_frq_in, & + addsmoke_flag_in, wetdep_ls_opt_in logical, intent(in ) :: do_plumerise_in, rrfs_sd character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -314,6 +319,9 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ! Set at compile time in dust_data_mod: dust_alpha = dust_alpha_in dust_gamma = dust_gamma_in + dust_moist_opt = dust_moist_opt_in + dust_moist_correction = dust_moist_correction_in + dust_drylimit_factor = dust_drylimit_factor_in call gocart_dust_fengsha_driver(dt,chem,rho_phy,smois,p8w,ssm, & isltyp,vegfrac,snowh,xland,dxy,g,emis_dust,ust,znt, & clayf,sandf,rdrag,uthr, & diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index bf2fddd60..a0a641246 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -210,17 +210,17 @@ kind = kind_phys intent = in [nsoil] - standard_name = vertical_dimension_of_soil - long_name = soil vertical layer dimension + standard_name = vertical_dimension_of_soil_internal_to_land_surface_scheme + long_name = number of soil layers internal to land surface model units = count dimensions = () type = integer intent = in [smc] - standard_name = volume_fraction_of_condensed_water_in_soil - long_name = volumetric fraction of soil moisture + standard_name = volume_fraction_of_soil_moisture_for_land_surface_model + long_name = volumetric fraction of soil moisture for lsm units = frac - dimensions = (horizontal_loop_extent,vertical_dimension_of_soil) + dimensions = (horizontal_dimension,vertical_dimension_of_soil_internal_to_land_surface_scheme) type = real kind = kind_phys intent = inout @@ -612,6 +612,32 @@ dimensions = () type = logical intent = in +[dust_moist_opt_in] + standard_name = control_for_dust_soil_moisture_option + long_name = smoke dust moisture parameterization 1 - fecan 2 - shao + units = index + dimensions = () + type = integer + active = (do_smoke_coupling) + intent = in +[dust_moist_correction_in] + standard_name = dust_moist_correction_fengsha_dust_scheme + long_name = moisture correction term for fengsha dust emission + units = none + dimensions = () + type = real + kind = kind_phys + active = (do_smoke_coupling) + intent = in +[dust_drylimit_factor_in] + standard_name = dust_drylimit_factor_fengsha_dust_scheme + long_name = moisture correction term for drylimit in fengsha dust emission + units = none + dimensions = () + type = real + kind = kind_phys + active = (do_smoke_coupling) + intent = in [dust_alpha_in] standard_name = alpha_fengsha_dust_scheme long_name = alpha paramter for fengsha dust scheme From 5612a96edecac3fe931cdc3a8754dfd6e1532df0 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 21 Sep 2023 20:53:34 +0000 Subject: [PATCH 46/81] Fix race condition in GFS_phys_time_vary.fv3.F90 error detection --- physics/GFS_phys_time_vary.fv3.F90 | 67 +++++++++++++++++++++++------- physics/noahmp_tables.f90 | 18 ++++---- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index a10c10d1b..04348f6dc 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -61,6 +61,22 @@ module GFS_phys_time_vary contains + subroutine copy_error(myerrmsg, myerrflg, errmsg, errflg) + implicit none + character(*), intent(in) :: myerrmsg + integer, intent(in) :: myerrflg + character(*), intent(out) :: errmsg + integer, intent(inout) :: errflg + if(myerrflg == 0) return + if(errflg /= 0) return + !$OMP CRITICAL + if(errflg == 0) then + errmsg = myerrmsg + errflg = myerrflg + endif + !$OMP END CRITICAL + end subroutine copy_error + !> \section arg_table_GFS_phys_time_vary_init Argument Table !! \htmlinclude GFS_phys_time_vary_init.html !! @@ -192,6 +208,9 @@ subroutine GFS_phys_time_vary_init ( real(kind=kind_phys), dimension(:), allocatable :: dzsno real(kind=kind_phys), dimension(:), allocatable :: dzsnso + integer :: myerrflg + character(255) :: myerrmsg + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -215,7 +234,7 @@ subroutine GFS_phys_time_vary_init ( !$OMP shared (do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau,ddy_j2tau) & !$OMP shared (isot,ivegsrc,nlunit,sncovr,sncovr_ice,lsm,lsm_ruc) & !$OMP shared (min_seaice,fice,landfrac,vtype,weasd,snupx,salp_data) & -!$OMP private (ix,i,j,rsnow,vegtyp) +!$OMP private (ix,i,j,rsnow,vegtyp,myerrmsg,myerrflg) !$OMP sections @@ -227,16 +246,18 @@ subroutine GFS_phys_time_vary_init ( ! oz_coeff in GFS_typedefs.F90 match what is set by read_o3data ! in GFS_typedefs.F90: allocate (Tbd%ozpl (IM,levozp,oz_coeff)) if (size(ozpl, dim=2).ne.levozp) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + myerrflg = 1 + write(myerrmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & "levozp from read_o3data does not match value in GFS_typedefs.F90: ", & levozp, " /= ", size(ozpl, dim=2) - errflg = 1 + call copy_error(myerrmsg, myerrflg, errmsg, errflg) end if if (size(ozpl, dim=3).ne.oz_coeff) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + myerrflg = 1 + write(myerrmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & "oz_coeff from read_o3data does not match value in GFS_typedefs.F90: ", & oz_coeff, " /= ", size(ozpl, dim=3) - errflg = 1 + call copy_error(myerrmsg, myerrflg, errmsg, errflg) end if !$OMP section @@ -247,16 +268,18 @@ subroutine GFS_phys_time_vary_init ( ! h2o_coeff in GFS_typedefs.F90 match what is set by read_o3data ! in GFS_typedefs.F90: allocate (Tbd%h2opl (IM,levh2o,h2o_coeff)) if (size(h2opl, dim=2).ne.levh2o) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + write(myerrmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & "levh2o from read_h2odata does not match value in GFS_typedefs.F90: ", & levh2o, " /= ", size(h2opl, dim=2) - errflg = 1 + myerrflg = 1 + call copy_error(myerrmsg, myerrflg, errmsg, errflg) end if if (size(h2opl, dim=3).ne.h2o_coeff) then - write(errmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & + write(myerrmsg,'(2a,i0,a,i0)') "Value error in GFS_phys_time_vary_init: ", & "h2o_coeff from read_h2odata does not match value in GFS_typedefs.F90: ", & h2o_coeff, " /= ", size(h2opl, dim=3) - errflg = 1 + myerrflg = 1 + call copy_error(myerrmsg, myerrflg, errmsg, errflg) end if !$OMP section @@ -264,7 +287,9 @@ subroutine GFS_phys_time_vary_init ( !> added coupled gocart and radiation option to initializing aer_nm if (iaerclm) then ntrcaer = ntrcaerm - call read_aerdata (me,master,iflip,idate,errmsg,errflg) + myerrflg = 0 + call read_aerdata (me,master,iflip,idate,myerrmsg,myerrflg) + call copy_error(myerrmsg, myerrflg, errmsg, errflg) else if(iaermdl ==2 ) then do ix=1,ntrcaerm do j=1,levs @@ -289,16 +314,22 @@ subroutine GFS_phys_time_vary_init ( !$OMP section !> - Call tau_amf dats for ugwp_v1 if (do_ugwp_v1) then - call read_tau_amf(me, master, errmsg, errflg) + myerrflg = 0 + call read_tau_amf(me, master, myerrmsg, myerrflg) + call copy_error(myerrmsg, myerrflg, errmsg, errflg) endif !$OMP section !> - Initialize soil vegetation (needed for sncovr calculation further down) - call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) + myerrflg = 0 + call set_soilveg(me, isot, ivegsrc, nlunit, myerrmsg, myerrflg) + call copy_error(myerrmsg, myerrflg, errmsg, errflg) !$OMP section !> - read in NoahMP table (needed for NoahMP init) - call read_mp_table_parameters(errmsg, errflg) + myerrflg = 0 + call read_mp_table_parameters(myerrmsg, myerrflg) + call copy_error(myerrmsg, myerrflg, errmsg, errflg) !$OMP end sections @@ -393,7 +424,9 @@ subroutine GFS_phys_time_vary_init ( if (errflg/=0) return if (iaerclm) then + ! This call is outside the OpenMP section, so it should access errmsg & errflg directly. call read_aerdataf (me, master, iflip, idate, fhour, errmsg, errflg) + ! If it is moved to an OpenMP section, it must use myerrmsg, myerrflg, and copy_error. if (errflg/=0) return end if @@ -479,7 +512,8 @@ subroutine GFS_phys_time_vary_init ( !$omp shared(dwsat_table,dksat_table,psisat_table,smoiseq) & !$OMP shared(smcwtdxy,deeprechxy,rechxy,errmsg,errflg) & !$OMP private(vegtyp,masslai,masssai,snd,dzsno,dzsnso,isnow) & -!$OMP private(soiltyp,bexp,smcmax,smcwlt,dwsat,dksat,psisat,ddz) +!$OMP private(soiltyp,bexp,smcmax,smcwlt,dwsat,dksat,psisat) & +!$OMP private(myerrmsg,myerrflg,ddz) do ix=1,im if (landfrac(ix) >= drythresh) then tvxy(ix) = tsfcl(ix) @@ -594,8 +628,9 @@ subroutine GFS_phys_time_vary_init ( dzsno(-1) = 0.20_kind_phys dzsno(0) = snd - 0.05_kind_phys - 0.20_kind_phys else - errmsg = 'Error in GFS_phys_time_vary.fv3.F90: Problem with the logic assigning snow layers in Noah MP initialization' - errflg = 1 + myerrmsg = 'Error in GFS_phys_time_vary.fv3.F90: Problem with the logic assigning snow layers in Noah MP initialization' + myerrflg = 1 + call copy_error(myerrmsg, myerrflg, errmsg, errflg) endif ! Now we have the snowxy field diff --git a/physics/noahmp_tables.f90 b/physics/noahmp_tables.f90 index 3b06d7f53..7b536a1d7 100644 --- a/physics/noahmp_tables.f90 +++ b/physics/noahmp_tables.f90 @@ -783,7 +783,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if ( ierr /= 0 ) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -914,7 +914,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if ( ierr /= 0 ) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -957,7 +957,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if ( ierr /= 0 ) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -982,7 +982,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if (ierr /= 0) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -1011,7 +1011,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if (ierr /= 0) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -1069,7 +1069,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if (ierr /= 0) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -1096,7 +1096,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if (ierr /= 0) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -1249,7 +1249,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if (ierr /= 0) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') @@ -1278,7 +1278,7 @@ subroutine read_mp_table_parameters(errmsg, errflg) open(15, status='old', form='formatted', action='read', iostat=ierr) end if if (ierr /= 0) then - errmsg = 'warning: cannot find file noahmptable.tb' + errmsg = 'warning: cannot find file noahmptable.tbl' errflg = 1 return ! write(*,'("warning: cannot find file noahmptable.tbl")') From 3ec61d39e75bf9f83a1e232e762909964a687767 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 21 Sep 2023 22:23:47 +0000 Subject: [PATCH 47/81] detect empty errmsg in GFS_phys_time_vary.fv3.F90 --- physics/GFS_phys_time_vary.fv3.F90 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 04348f6dc..e6bf24186 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -67,14 +67,14 @@ subroutine copy_error(myerrmsg, myerrflg, errmsg, errflg) integer, intent(in) :: myerrflg character(*), intent(out) :: errmsg integer, intent(inout) :: errflg - if(myerrflg == 0) return - if(errflg /= 0) return - !$OMP CRITICAL - if(errflg == 0) then - errmsg = myerrmsg - errflg = myerrflg + if(myerrflg /= 0 .and. errflg == 0) then + !$OMP CRITICAL + if(errflg == 0) then + errmsg = myerrmsg + errflg = myerrflg + endif + !$OMP END CRITICAL endif - !$OMP END CRITICAL end subroutine copy_error !> \section arg_table_GFS_phys_time_vary_init Argument Table @@ -209,7 +209,7 @@ subroutine GFS_phys_time_vary_init ( real(kind=kind_phys), dimension(:), allocatable :: dzsnso integer :: myerrflg - character(255) :: myerrmsg + character(len=255) :: myerrmsg ! Initialize CCPP error handling variables errmsg = '' @@ -288,6 +288,7 @@ subroutine GFS_phys_time_vary_init ( if (iaerclm) then ntrcaer = ntrcaerm myerrflg = 0 + myerrmsg = 'read_aerdata failed without a message' call read_aerdata (me,master,iflip,idate,myerrmsg,myerrflg) call copy_error(myerrmsg, myerrflg, errmsg, errflg) else if(iaermdl ==2 ) then @@ -315,6 +316,7 @@ subroutine GFS_phys_time_vary_init ( !> - Call tau_amf dats for ugwp_v1 if (do_ugwp_v1) then myerrflg = 0 + myerrmsg = 'read_tau_amf failed without a message' call read_tau_amf(me, master, myerrmsg, myerrflg) call copy_error(myerrmsg, myerrflg, errmsg, errflg) endif @@ -322,12 +324,14 @@ subroutine GFS_phys_time_vary_init ( !$OMP section !> - Initialize soil vegetation (needed for sncovr calculation further down) myerrflg = 0 + myerrmsg = 'set_soilveg failed without a message' call set_soilveg(me, isot, ivegsrc, nlunit, myerrmsg, myerrflg) call copy_error(myerrmsg, myerrflg, errmsg, errflg) !$OMP section !> - read in NoahMP table (needed for NoahMP init) myerrflg = 0 + myerrmsg = 'read_mp_table_parameters failed without a message' call read_mp_table_parameters(myerrmsg, myerrflg) call copy_error(myerrmsg, myerrflg, errmsg, errflg) From 7912a1954983010f1f2ee5ce552139b8dda0b669 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 21 Sep 2023 22:24:02 +0000 Subject: [PATCH 48/81] Initialize err variables in set_soilveg.f --- physics/set_soilveg.f | 3 +++ 1 file changed, 3 insertions(+) diff --git a/physics/set_soilveg.f b/physics/set_soilveg.f index 37f2c2a73..35f4ace37 100644 --- a/physics/set_soilveg.f +++ b/physics/set_soilveg.f @@ -44,6 +44,9 @@ subroutine set_soilveg(me,isot,ivet,nlunit,errmsg,errflg) & DEFINED_SLOPE, FXEXP_DATA, NROOT_DATA, REFKDT_DATA, Z0_DATA, & CZIL_DATA, LAI_DATA, CSOIL_DATA + errmsg = '' + errflg = 0 + cmy end locals if(ivet.eq.2) then From 7332c8e7ac3d5eec9d48947ec9c1bbd035d9dfeb Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 21 Sep 2023 23:32:27 +0000 Subject: [PATCH 49/81] initialize errmsg & errflg in noahmp_tables.f90 --- physics/noahmp_tables.f90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/physics/noahmp_tables.f90 b/physics/noahmp_tables.f90 index 7b536a1d7..753c8ff24 100644 --- a/physics/noahmp_tables.f90 +++ b/physics/noahmp_tables.f90 @@ -484,6 +484,9 @@ subroutine read_mp_table_parameters(errmsg, errflg) sr2006_psi_e_a, sr2006_psi_e_b, sr2006_psi_e_c, sr2006_smcmax_a, & sr2006_smcmax_b + errmsg = '' + errflg = 0 + ! initialize our variables to bad values, so that if the namelist read fails, we come to a screeching halt as soon as we try to use anything. ! vegetation parameters isurban_table = -99999 From 374996ecc45f138ff48ed1812fee3dc59837c556 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 22 Sep 2023 13:42:46 +0000 Subject: [PATCH 50/81] only read h2odata, ozdata and noahmp table when they are needed --- physics/GFS_phys_time_vary.fv3.F90 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index e6bf24186..4100bdf6e 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -226,7 +226,7 @@ subroutine GFS_phys_time_vary_init ( !$OMP shared (xlat_d,xlon_d,imap,jmap,errmsg,errflg) & !$OMP shared (levozp,oz_coeff,oz_pres,ozpl) & !$OMP shared (levh2o,h2o_coeff,h2o_pres,h2opl) & -!$OMP shared (iamin, iamax, jamin, jamax) & +!$OMP shared (iamin, iamax, jamin, jamax, lsm_noahmp) & !$OMP shared (iaerclm,iaermdl,ntrcaer,aer_nm,iflip,iccn) & !$OMP shared (jindx1_o3,jindx2_o3,ddy_o3,jindx1_h,jindx2_h,ddy_h) & !$OMP shared (jindx1_aer,jindx2_aer,ddy_aer,iindx1_aer,iindx2_aer,ddx_aer) & @@ -240,6 +240,7 @@ subroutine GFS_phys_time_vary_init ( !$OMP section !> - Call read_o3data() to read ozone data + need_o3data: if(ntoz > 0) then call read_o3data (ntoz, me, master) ! Consistency check that the hardcoded values for levozp and @@ -259,9 +260,11 @@ subroutine GFS_phys_time_vary_init ( oz_coeff, " /= ", size(ozpl, dim=3) call copy_error(myerrmsg, myerrflg, errmsg, errflg) end if + endif need_o3data !$OMP section !> - Call read_h2odata() to read stratospheric water vapor data + need_h2odata: if(h2o_phys) then call read_h2odata (h2o_phys, me, master) ! Consistency check that the hardcoded values for levh2o and @@ -281,6 +284,7 @@ subroutine GFS_phys_time_vary_init ( myerrflg = 1 call copy_error(myerrmsg, myerrflg, errmsg, errflg) end if + endif need_h2odata !$OMP section !> - Call read_aerdata() to read aerosol climatology, Anning added coupled @@ -330,10 +334,12 @@ subroutine GFS_phys_time_vary_init ( !$OMP section !> - read in NoahMP table (needed for NoahMP init) - myerrflg = 0 - myerrmsg = 'read_mp_table_parameters failed without a message' - call read_mp_table_parameters(myerrmsg, myerrflg) - call copy_error(myerrmsg, myerrflg, errmsg, errflg) + if(lsm == lsm_noahmp) then + myerrflg = 0 + myerrmsg = 'read_mp_table_parameters failed without a message' + call read_mp_table_parameters(myerrmsg, myerrflg) + call copy_error(myerrmsg, myerrflg, errmsg, errflg) + endif !$OMP end sections From 5377c7c0ab39f275804749a50f31f0e03f7abab4 Mon Sep 17 00:00:00 2001 From: "anning.cheng" Date: Fri, 22 Sep 2023 10:08:02 -0400 Subject: [PATCH 51/81] passing nc back from microphysics --- physics/module_mp_thompson.F90 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index ca913c6e3..271db11d0 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1509,6 +1509,14 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & enddo endif + if (merra2_aerosol_aware) then + do k = kts, kte + nc(i,k,j) = nc1d(k) + nwfa(i,k,j) = nwfa1d(k) + nifa(i,k,j) = nifa1d(k) + enddo + endif + do k = kts, kte qv(i,k,j) = qv1d(k) qc(i,k,j) = qc1d(k) From f324aa52e64b325965b1552916c733946610ddd2 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Fri, 22 Sep 2023 20:21:45 -0500 Subject: [PATCH 52/81] Update variable name in mp_nssl.F90 --- physics/mp_nssl.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index b81afaafb..aacf4c3dd 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -134,7 +134,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & ! write(0,*) 'call nssl_2mom_init' CALL nssl_2mom_init(ims,ime, jms,jme, kms,kme,nssl_params,ipctmp=ipc,mixphase=0, & - ihvol=ihailv,nssl_ehw0=nssl_ehw0_in,nssl_ehlw0=nssl_ehlw0_in,errmsg=errmsg, & + ihvol=ihailv,nssl_ehw0=nssl_ehw0,nssl_ehlw0=nssl_ehlw0,errmsg=errmsg, & nssl_alphar=nssl_alphar, & nssl_alphah=nssl_alphah, & nssl_alphahl=nssl_alphahl, & From cfd848540b64a55d5b2cc625683ca511889cfd6e Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Sat, 23 Sep 2023 02:49:23 +0000 Subject: [PATCH 53/81] "to address the reviewer's comments" --- physics/cu_c3_deep.F90 | 2 -- physics/cu_c3_driver.F90 | 9 ++------- physics/cu_c3_driver_post.F90 | 9 ++++----- physics/cu_gf_driver.F90 | 5 ++--- physics/cu_gf_driver_post.F90 | 2 -- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/physics/cu_c3_deep.F90 b/physics/cu_c3_deep.F90 index d1b490c77..b8a1dd838 100644 --- a/physics/cu_c3_deep.F90 +++ b/physics/cu_c3_deep.F90 @@ -4489,10 +4489,8 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & endif if(k.gt.kbcon(i)+1)c1d(i,k)=clwdet*up_massdetr(i,k-1) if(k.gt.kbcon(i)+1)c1d_b(i,k)=clwdet*up_massdetr(i,k-1) - !if(is_deep.and.k.gt.kklev(i))then c1d(i,k)=0.005 c1d_b(i,k)=0.005 - !endif if(autoconv.eq.2) then ! diff --git a/physics/cu_c3_driver.F90 b/physics/cu_c3_driver.F90 index 270e01989..cc2906ad5 100644 --- a/physics/cu_c3_driver.F90 +++ b/physics/cu_c3_driver.F90 @@ -644,7 +644,6 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& enddo !$acc end kernels if (dx(its)<6500.) then - ichoice=10 imid_gf=0 endif ! @@ -680,10 +679,6 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& do i=its,itf if(xmbs(i).gt.0.)then cutens(i)=1. - if (dx(i)<6500.) then - ierrm(i)=555 - ierr (i)=555 - endif endif enddo !$acc end kernels @@ -1041,8 +1036,8 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& gdc(i,16,10)=pret(i)*3600. maxupmf(i)=0. - if(forcing(i,6).gt.0.)then - maxupmf(i)=maxval(xmb(i)*zu(i,kts:ktf)/forcing(i,6)) + if(forcing2(i,6).gt.0.)then + maxupmf(i)=maxval(xmb(i)*zu(i,kts:ktf)/forcing2(i,6)) endif if(ktop(i).gt.2 .and.pret(i).gt.0.)dt_mf(i,ktop(i)-1)=ud_mf(i,ktop(i)) diff --git a/physics/cu_c3_driver_post.F90 b/physics/cu_c3_driver_post.F90 index 74957a6b2..528f3d466 100644 --- a/physics/cu_c3_driver_post.F90 +++ b/physics/cu_c3_driver_post.F90 @@ -66,20 +66,19 @@ subroutine cu_c3_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m conv_act_m(i)=0.0 endif ! reflectivity parameterization for parameterized convection (reference:Unipost MDLFLD.f) - if(sqrt(garea(i)).lt.6500.)then ze = 0.0 ze_conv = 0.0 dbz_sum = 0.0 - cuprate = raincv(i) * 3600.0 / dt ! cu precip rate (mm/h) - ze_conv = 300.0 * cuprate**1.4 - if (maxupmf(i).gt.0.05) then + cuprate = max(0.1,1.e3*raincv(i) * 3600.0 / dt) ! cu precip rate (mm/h) + if(cuprate .lt. 0.05) cuprate=0. + ze_conv = 300.0 * cuprate**1.5 + if (maxupmf(i).gt.0.1 .and. cuprate.gt.0.) then do k = 1, km ze = 10._kind_phys ** (0.1 * refl_10cm(i,k)) dbz_sum = max(dbzmin, 10.0 * log10(ze + ze_conv)) refl_10cm(i,k) = dbz_sum enddo endif - endif enddo !$acc end kernels diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 3b700cc5a..f3f5042fc 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -644,7 +644,6 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& enddo !$acc end kernels if (dx(its)<6500.) then -! ichoice=10 imid_gf=0 endif ! @@ -1015,8 +1014,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& gdc(i,16,10)=pret(i)*3600. maxupmf(i)=0. - if(forcing(i,6).gt.0.)then - maxupmf(i)=maxval(xmb(i)*zu(i,kts:ktf)/forcing(i,6)) + if(forcing2(i,6).gt.0.)then + maxupmf(i)=maxval(xmb(i)*zu(i,kts:ktf)/forcing2(i,6)) endif if(ktop(i).gt.2 .and.pret(i).gt.0.)dt_mf(i,ktop(i)-1)=ud_mf(i,ktop(i)) diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index 8c5896164..59f43618c 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -66,7 +66,6 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m conv_act_m(i)=0.0 endif ! reflectivity parameterization for parameterized convection (reference:Unipost MDLFLD.f) - !if(sqrt(garea(i)).lt.6500.)then ze = 0.0 ze_conv = 0.0 dbz_sum = 0.0 @@ -80,7 +79,6 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m refl_10cm(i,k) = dbz_sum enddo endif - !endif enddo !$acc end kernels From fda90e0d45e13458d89425ec9bb4d1ef454e1fa8 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Sat, 23 Sep 2023 16:19:01 -0500 Subject: [PATCH 54/81] Update for NSSL 2/3-moment cloud physics --- physics/module_mp_nssl_2mom.F90 | 1157 +++++++++++++++++++++---------- 1 file changed, 795 insertions(+), 362 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index 6439d81d3..72ff9b1b1 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -8,7 +8,7 @@ !--------------------------------------------------------------------- -! code snapshot: "Apr 10 2023" at "13:17:29" +! code snapshot: "Sep 22 2023" at "22:01:53" !--------------------------------------------------------------------- !--------------------------------------------------------------------- ! IMPORTANT: Best results are attained using the 5th-order WENO (Weighted Essentially Non-Oscillatory) advection option (4) for scalars: @@ -33,9 +33,7 @@ !! !! Added info on graupel density and soaking is in Mansell and Ziegler (2013, JAS) !! -!! Average graupel particle density is predicted, which affects fall speed as well. -!! Hail density prediction is by default disabled in this version, but may be enabled -!! at some point if there is interest. +!! Average graupel and hail particle densities are predicted, which affects fall speed as well. !! !! Maintainer: Ted Mansell, National Severe Storms Laboratory !! @@ -76,6 +74,13 @@ ! ! !--------------------------------------------------------------------- +! Apr. 2023 +! - Update to 3-moment for rain, graupel, and hail +! - Change default graupel/hail fall speeds to icdx/icdxhl=6 (Milbrandt & Morrison 2013) +! and also set default ehw0=0.9 and ehlw0=0.9 to compensate for lower fall speeds. +! - Change default hail conversion to ihlcnh=-1, and then =1 for 2-mom or =3 for 3-mom, +! using wet growth diameter to convert large graupel +!--------------------------------------------------------------------- ! Sept. 2021: ! Fixes: ! Restored previous formulation of snow reflectivity, as it was realized that the last change incorrectly assumed a fixed @@ -225,7 +230,7 @@ MODULE module_mp_nssl_2mom real, private :: rho_qr = 1000., cnor = 8.0e5 ! cnor is set in namelist!! rain params real, private :: rho_qs = 100., cnos = 3.0e6 ! set in namelist!! snow params real, private :: rho_qh = 500., cnoh = 4.0e5 ! set in namelist!! graupel params - real, private :: rho_qhl= 900., cnohl = 4.0e4 ! set in namelist!! hail params + real, private :: rho_qhl= 800., cnohl = 4.0e4 ! set in namelist!! hail params real, private :: hdnmn = 170.0 ! minimum graupel density (for variable density graupel) real, private :: hldnmn = 500.0 ! minimum hail density (for variable density hail) @@ -287,8 +292,10 @@ MODULE module_mp_nssl_2mom real, private :: graupelfallfac = 1.0 ! factor to adjust graupel fall speed real, private :: hailfallfac = 1.0 ! factor to adjust hail fall speed integer, private :: icefallopt = 3 ! 1= default, 2 = Ferrier ice fall speed; 3 = adjusted Ferrier (slightly high Vt) - integer, private :: icdx = 3 ! (graupel) 0=Ferrier; 1=leave drag coef. cd fixed; 2=vary by density, 4=set by user with cdxmin,cdxmax,etc. - integer, private :: icdxhl = 3 ! (hail) 0=Ferrier; 1=leave drag coef. cd fixed; 2=vary by density, 4=set by user with cdxmin,cdxmax,etc. + integer, private :: icdx = 6 ! (graupel) 0=Ferrier; 1=leave drag coef. cd fixed; 2=vary by density, 4=set by user with cdxmin,cdxmax,etc. + ! 6= Milbrandt and Morrison (2013) density-based fall speed + integer, private :: icdxhl = 6 ! (hail) 0=Ferrier; 1=leave drag coef. cd fixed; 2=vary by density, 4=set by user with cdxmin,cdxmax,etc. + ! 6= Milbrandt and Morrison (2013) density-based fall speed real :: axh = 75.7149, bxh = 0.5 real :: axf = 75.7149, bxf = 0.5 real :: axhl = 206.984, bxhl = 0.6384 @@ -340,7 +347,7 @@ MODULE module_mp_nssl_2mom ! (first nucleation is done with a KW sat. adj. step) integer, private :: issfilt = 0 ! flag to turn on filtering of supersaturation field integer, private :: icnuclimit = 0 ! limit droplet nucleation based on Konwar et al. (2012) and Chandrakar et al. (2016) - integer, private :: irenuc = 2 ! =1 to always allow renucleation of droplets within the cloud + integer, private :: irenuc = 2 ! =1 to always allow renucleation of droplets within the cloud (do no use, obsolete) ! =2 renucleation following Twomey/Cohard&Pinty ! =7 New renucleation that requires prediction of the number of activated nuclei ! i.e., not only at cloud base @@ -439,6 +446,7 @@ MODULE module_mp_nssl_2mom real , private :: ehs0 = 0.1, ehs1 = 0.1 ! graupel-snow coll. eff. parameters: ehs0*exp(ehs1*min(temcg(mgs),0.0)) ! set ehs1 = 0 to get a constant value of ehs0 integer :: iessopt = 1 ! 1 = Original (no factor); 2 = factor based on wvel; 3 = factor based on SSI + ! 4 = as 3 but sets min factor of 0.1 and goes to full value at 0.5% SSI real , private :: ess0 = 0.5, ess1 = 0.05 ! snow aggregation coefficients: ess0*exp(ess1*min(temcg(mgs),0.0)) ! set ess1 = 0 to get a constant value of ess0 real , private :: esstem1 = -15. ! lower temperature where snow aggregation turns on @@ -535,17 +543,18 @@ MODULE module_mp_nssl_2mom real, parameter :: alpharmax = 8. ! limited for rwvent calculation - integer, private :: ihlcnh = 1 ! which graupel -> hail conversion to use + integer, private :: ihlcnh = -1 ! which graupel -> hail conversion to use ! 1 = Milbrandt and Yau (2005) using Ziegler 1985 wet growth diameter ! 2 = Straka and Mansell (2005) conversion using size threshold ! 3 = Conversion using wet growth diameter real, private :: hlcnhdia = 1.e-3 ! threshold diameter for graupel -> hail conversion for ihlcnh = 1 option. real, private :: hlcnhqmin = 0.1e-3 ! minimum graupel mass content for graupel -> hail conversion (ihlcnh = 1) - real , private :: hldia1 = 20.0e-3 ! threshold diameter for graupel -> hail conversion for ihlcnh = 2 option. - integer :: incwet = 0 ! flag to do wet growth only on D > D_wet + real , private :: hldia1 = 10.0e-3 ! threshold diameter for graupel -> hail conversion for ihlcnh = 2 option. + integer, private :: incwet = 0 ! flag to do wet growth only on D > D_wet integer, private :: iusedw = 0 ! flag to use experimental wet growth ice diameter for gr -> hl conversion (=1 turns on) real , private :: dwmin = 5.0e-3 ! Minimum diameter with iusedw (can stay at 0 or be set to something larger) real , private :: dwetmin = 5.0e-3 ! Minimum diameter with iusedw (can stay at 0 or be set to something larger) + real , private :: dwmax = 15.e-3 ! for ihlcnh, always convert this size and larger whether or not there is wet growth real , private :: dwtempmin = 242. ! lowest temperature to allow wet growth conversion to hail real , private :: dwehwmin = 0. ! Minimum ehw to use to find wet growth diameter (if > ehw0, then wet growth diam becomes smaller) real , private :: dg0thresh = 0.15 ! graupel wet growth diameter above which we say do not bother @@ -576,7 +585,7 @@ MODULE module_mp_nssl_2mom ! = 2 DTD mass-weighted version based on MY code ! = 3 Milbrandt version (from Cohard and Pinty code integer :: dmropt = 0 ! extra option for crcnw - integer :: dmhlopt = 1 ! options for graupel -> conversion + integer :: dmhlopt = 0 ! options for graupel -> hail conversion integer :: irescalerainopt = 3 ! 0 = default option ! 1 = qx(mgs,lc) > qxmin(lc) ! 2 = qx(mgs,lc) > qxmin(lc) .and. wvel(mgs) < 3.0 @@ -593,7 +602,7 @@ MODULE module_mp_nssl_2mom integer :: ivhmltsoak = 1 ! 0=off, 1=on : flag to simulate soaking (graupel/hail) during melting ! when liquid fraction is not predicted - logical :: iwetsoak = .true. ! soak and freeze during wet growth or not + logical, private :: iwetsoak = .true. ! soak and freeze during wet growth or not integer, private :: ioldlimiter = 0 ! test switch for new(=0) or old(=1) size limiter at the end of GS for 3-moment categories integer, private :: isnowfall = 2 ! Option for choosing between snow fall speed parameters ! 1 = original Zrnic et al. (Mansell et al. 2010) @@ -800,7 +809,7 @@ MODULE module_mp_nssl_2mom double precision gmoi(0:ngm0) ! ,gmod(0:ngm1,0:ngm2),gmdi(0:ngm1,0:ngm2) integer, parameter :: nqiacralpha = 300 !480 ! 240 ! 120 ! 15 - integer, parameter :: nqiacrratio = 100 ! 500 !50 ! 25 + integer, parameter :: nqiacrratio = 400 ! 500 !50 ! 25 ! real, parameter :: maxratiolu = 25. real, parameter :: maxratiolu = 100. ! 25. real, parameter :: maxalphalu = 15. @@ -899,7 +908,7 @@ MODULE module_mp_nssl_2mom ! parameter( xvcmn=4.188e-18 ) ! mks min volume = 3 micron radius real, parameter :: xvcmn=0.523599*(2.*cwradn)**3 ! mks min volume = 2.5 micron radius - real, parameter :: xvcmx=0.523599*(2.*xcradmx)**3 ! mks min volume = 2.5 micron radius + real, parameter :: xvcmx=0.523599*(2.*xcradmx)**3 ! mks max volume = 60 micron radius real, parameter :: cwmasn = 1000.*xvcmn ! minimum mass, defined by radius of 5.0e-6 real, parameter :: cwmasx = 1000.*xvcmx ! maximum mass, defined by radius of 50.0e-6 real, parameter :: cwmasn5 = 1000.*0.523599*(2.*5.0e-6)**3 ! 5.23e-13 @@ -947,7 +956,7 @@ MODULE module_mp_nssl_2mom real :: cp = 1004.0, rd = 287.04 real :: rw = 461.5 ! gas const. for water vapor REAL, PRIVATE :: cpl = 4190.0 - REAL, PRIVATE :: cpigb = 2106.0 + REAL, PRIVATE :: cpigb = 2106.0 real :: cpi real :: cap real :: tfrcbw @@ -962,8 +971,8 @@ MODULE module_mp_nssl_2mom ! GHB: Needed for eqtset=2 in cm1 ! REAL, PRIVATE :: cv = cp - rd - real, private, parameter :: cv = 717.0 ! specific heat at constant volume - air - REAL, PRIVATE, parameter :: cvv = 1408.5 + real, private, parameter :: cv = 717.0 ! specific heat at constant volume - air + REAL, PRIVATE, parameter :: cvv = 1408.5 ! GHB real, parameter :: bfnu0 = (rnu + 2.0)/(rnu + 1.0) @@ -992,6 +1001,8 @@ MODULE module_mp_nssl_2mom logical, parameter :: do_satadj_for_wrfchem = .true. + integer, parameter :: ac_opt = 0 ! option flag for alternate aerosol (for NUWRF only) + logical, private :: nuaccoinp = .false. ! Note to users: Many of these options are for development and not guaranteed to perform well. ! Some may not be functional depending on the version of the code. @@ -1101,7 +1112,7 @@ MODULE module_mp_nssl_2mom rescale_low_alphah, & rescale_low_alphahl, & rescale_high_alpha, & - ihlcnh, hldia1,iusedw, dwehwmin, dwmin, dwtempmin, & + ihlcnh, hldia1,iusedw, dwehwmin, dwmin, dwmax, dwtempmin, dg0thresh, & icvhl2h, hldnmn,hdnmn, & hlcnhdia, hlcnhqmin, & isedonly, & @@ -1194,13 +1205,14 @@ SUBROUTINE nssl_2mom_init_const( & RETURN END SUBROUTINE nssl_2mom_init_const + + ! ##################################################################### ! ##################################################################### !>\ingroup mod_nsslmp !! NSSL MP setup routine (sets local options and array indices) SUBROUTINE nssl_2mom_init( & & ims,ime, jms,jme, kms,kme, nssl_params, ipctmp, mixphase,ihvol,idoniconlytmp, & - & igvol, & & nssl_graupelfallfac, & & nssl_hailfallfac, & & nssl_ehw0, & @@ -1214,6 +1226,7 @@ SUBROUTINE nssl_2mom_init( & & nssl_alphah, & & nssl_alphahl, & & nssl_alphar, & + & nssl_density_on, nssl_hail_on, nssl_ccn_on, nssl_icecrystals_on, ccn_is_ccna, & & errmsg, errflg, & & infileunit, & & myrank, mpiroot & @@ -1233,9 +1246,11 @@ SUBROUTINE nssl_2mom_init( & & nssl_alphahl, & & nssl_alphar integer, intent(in), optional :: & - & nssl_icdx, igvol, & + & nssl_icdx, & & nssl_icdxhl, myrank, mpiroot, & & nssl_ufccn + logical, intent(in), optional :: nssl_density_on, nssl_hail_on, nssl_ccn_on, nssl_icecrystals_on + integer, intent(inout), optional :: ccn_is_ccna integer, intent(in),optional :: infileunit @@ -1243,16 +1258,20 @@ SUBROUTINE nssl_2mom_init( & character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg integer, intent(in), optional :: ims,ime, jms,jme, kms,kme + real, intent(in), dimension(20), optional :: nssl_params - integer, intent(in) :: ipctmp,mixphase,ihvol + integer, intent(in) :: ipctmp,mixphase + integer, optional, intent(in) :: ihvol logical, optional, intent(in) :: idoniconlytmp integer :: igvol_local = 1 logical :: wrote_namelist = .false. logical :: wrf_dm_on_monitor + integer :: hail_on = -1, density_on = -1, icecrystals_on = 1 + integer :: ccn_on = -1 double precision :: arg real :: temq @@ -1277,9 +1296,37 @@ SUBROUTINE nssl_2mom_init( & turn_on_ccna = .false. turn_on_cina = .false. - IF ( present( igvol ) ) THEN - igvol_local = igvol +! IF ( present( igvol ) ) THEN +! igvol_local = igvol +! ENDIF + + IF ( present( nssl_hail_on ) ) THEN + IF ( nssl_hail_on ) THEN + hail_on = 1 + ELSE + hail_on = 0 + ENDIF + ENDIF + + IF ( present( nssl_density_on ) ) THEN + IF ( nssl_density_on ) THEN + density_on = 1 + ELSE + density_on = 0 + ENDIF ENDIF + + IF ( present( nssl_icecrystals_on ) ) THEN + IF ( nssl_icecrystals_on ) THEN + icecrystals_on = 1 + ELSE + icecrystals_on = 0 + ! renucfrac = 1.0 ! why was this set to 1? + ffrzs = 1.0 + ENDIF + ENDIF + + ! ! set some global values from namelist input ! @@ -1295,7 +1342,6 @@ SUBROUTINE nssl_2mom_init( & rho_qh = nssl_params(8) rho_qhl = nssl_params(9) rho_qs = nssl_params(10) - IF ( Nint(nssl_params(13)) == 1 ) THEN ! hack to switch CCN field to CCNA (activated ccn) ! invertccn = .true. @@ -1306,29 +1352,56 @@ SUBROUTINE nssl_2mom_init( & IF ( present(nssl_ufccn) ) iufccn = nssl_ufccn ENDIF - + alphar = nssl_params(15) ! ipelec = Nint(nssl_params(11)) ! isaund = Nint(nssl_params(12)) + + IF ( present(nssl_graupelfallfac) ) graupelfallfac = nssl_graupelfallfac IF ( present(nssl_hailfallfac) ) hailfallfac = nssl_hailfallfac - IF ( present(nssl_ehw0) ) ehw0 = nssl_ehw0 - IF ( present(nssl_ehlw0) ) ehlw0 = nssl_ehlw0 + IF ( present(nssl_ehw0) ) THEN + IF ( nssl_ehw0 > 0.0 ) ehw0 = nssl_ehw0 + ENDIF + IF ( present(nssl_ehlw0) ) THEN + IF ( nssl_ehlw0 > 0.0 ) ehlw0 = nssl_ehlw0 + ENDIF IF ( present(nssl_icdx) ) icdx = nssl_icdx IF ( present(nssl_icdxhl) ) icdxhl = nssl_icdxhl IF ( present(nssl_icefallfac) ) icefallfac = nssl_icefallfac IF ( present(nssl_snowfallfac) ) snowfallfac = nssl_snowfallfac - IF ( present(nssl_cccn) ) ccn = nssl_cccn - IF ( present(nssl_alphah) ) alphah = nssl_alphah - IF ( present(nssl_alphahl) ) alphahl = nssl_alphahl - IF ( present(nssl_alphar) ) alphar = nssl_alphar + IF ( present(nssl_cccn) ) THEN + IF (nssl_cccn > 1 ) ccn = nssl_cccn + ENDIF + IF ( present(nssl_alphah) ) THEN + IF ( nssl_alphah > -1. ) alphah = nssl_alphah + ENDIF + IF ( present(nssl_alphahl) ) THEN + IF ( nssl_alphahl > -1. ) alphahl = nssl_alphahl + ENDIF + IF ( present(nssl_alphar) ) THEN + IF ( nssl_alphar > -1.0 ) alphar = nssl_alphar + ENDIF + + ipconc = ipctmp + + IF ( ipconc < 5 ) THEN + ihlcnh = 0 + ENDIF + IF ( ihlcnh <= 0 ) THEN + IF ( ipconc == 5 ) THEN + ihlcnh = 3 + ELSEIF ( ipconc >= 6 ) THEN + ihlcnh = 3 + ENDIF + ENDIF - IF ( .true. ) THEN ! set to true to enable internal namelist read + IF ( .false. ) THEN ! set to true to enable internal namelist read open(15,file='input.nml',status='old',form='formatted',action='read') rewind(15) read(15,NML=nssl_mp_params,iostat=istat) @@ -1359,8 +1432,34 @@ SUBROUTINE nssl_2mom_init( & ENDIF ENDIF + IF ( present( nssl_ccn_on ) ) THEN + IF ( nssl_ccn_on ) THEN + ccn_on = 1 + ELSE + ccn_on = 0 + irenuc = 2 + ENDIF + ENDIF + IF ( irenuc >= 5 ) THEN turn_on_ccna = .true. + IF ( present( nssl_ccn_on ) ) THEN + IF ( .not. nssl_ccn_on ) THEN + errmsg = 'NSSL_MP Error: Must have nssl_ccn_on=1 for irenuc >= 5!' + errflg = 1 + return + ENDIF + ENDIF + ENDIF + + IF ( present( ccn_is_ccna ) .and. ccn_on == 1 ) THEN + IF ( ccn_is_ccna > 0 ) THEN + turn_on_ccna = .true. + ELSE + IF ( irenuc >= 5 ) THEN + ccn_is_ccna = 1 + ENDIF + ENDIF ENDIF cwccn = ccn @@ -1374,25 +1473,42 @@ SUBROUTINE nssl_2mom_init( & lh = lh + 1 lhl = lhl + 1 ENDIF - IF ( ihvol <= -1 .or. ihvol == 2 ) THEN - IF ( ihvol == -1 .or. ihvol == -2 ) THEN - lhab = lhab - 1 ! turns off hail - lhl = 0 - ! past me thought it would be a good idea to change graupel factors when hail is off.... - ! ehw0 = 0.75 - ! iehw = 2 - ! dfrz = Max( dfrz, 0.5e-3 ) - ENDIF - IF ( ihvol == -2 .or. ihvol == 2 ) THEN ! ice crystals are turned off - ! a value of 2? means to turn off ice crystals but turn on hail - renucfrac = 1.0 - ffrzs = 1.0 - ! idoci = 0 ! try this later + IF ( hail_on == -1 ) THEN ! hail_on is not set + hail_on = 1 + IF ( ihvol <= -1 .or. ihvol == 2 ) THEN + IF ( ihvol == -1 .or. ihvol == -2 ) THEN + lhab = lhab - 1 ! turns off hail + lhl = 0 + hail_on = 0 + ! past me thought it would be a good idea to change graupel factors when hail is off.... + ! ehw0 = 0.75 + ! iehw = 2 + ! dfrz = Max( dfrz, 0.5e-3 ) + ENDIF + IF ( ihvol == -2 .or. ihvol == 2 .or. icecrystals_on == 0 ) THEN ! ice crystals are turned off + ! a value of 2? means to turn off ice crystals but turn on hail + ! renucfrac = 1.0 ! why? + ffrzs = 1.0 + ! idoci = 0 ! try this later + ENDIF + ENDIF + + ELSE ! hail_on is set + IF ( hail_on == 0 ) THEN + lhab = lhab - 1 ! turns off hail + lhl = 0 + ELSE + ! assume default that hail is on ENDIF ENDIF + + IF ( density_on == -1 ) THEN ! density flag not set, so default is to predict it + density_on = 1 + ENDIF + IF ( iresetmoments == 0 ) iresetmoments = 1 ! lhl -! write(0,*) 'wrf_init: lhab,lhl = ',lhab,lhl +! write(0,*) 'wrf_init: lhab,lhl,hail_on,density_on = ',lhab,lhl,hail_on,density_on ! IF ( ipelec > 0 ) idonic = .true. @@ -1551,8 +1667,6 @@ SUBROUTINE nssl_2mom_init( & qiacrratio(0,:) = 1.0 - isub = Min( 0, Max(-1,ihvol) ) ! is -1 or 0 - lccn = 0 lccnuf = 0 lccna = 0 @@ -1576,14 +1690,13 @@ SUBROUTINE nssl_2mom_init( & ! lccn = 9 - ipconc = ipctmp IF ( ipconc == 0 ) THEN - IF ( ihvol >= 0 ) THEN + IF ( hail_on == 1 ) THEN ! turn on graupel density for 1-moment scheme lvh = 9 ltmp = 9 denscale(lvh) = 1 - ELSE ! no hail + ELSE ! no hail, 'LFO' scheme ltmp = lhab lhl = 0 ENDIF @@ -1601,17 +1714,17 @@ SUBROUTINE nssl_2mom_init( & lns = ltmp+5 !13 lnh = ltmp+6 !14 ltmp = lnh - IF ( ihvol >= 0 ) THEN + IF ( hail_on == 1 ) THEN ltmp = ltmp + 1 lnhl = ltmp ! lhab+7 ! 15 ENDIF - IF ( igvol_local >= 1 ) THEN + IF ( density_on >= 1 ) THEN ltmp = ltmp + 1 lvh = ltmp ! lhab+8 + isub ! 16 + isub ! isub adjusts to 15 if hail is off ! ltmp = lvh ENDIF denscale(lccn:ltmp) = 1 - IF ( ihvol >= 1 ) THEN + IF ( density_on == 1 .and. hail_on == 1 ) THEN ltmp = ltmp + 1 lvhl = ltmp ! ltmp = lvhl @@ -1647,13 +1760,13 @@ SUBROUTINE nssl_2mom_init( & ltmp = ltmp + 1 lnhl = ltmp ! lhab+7 ! 15 ENDIF - IF ( igvol_local >= 1 ) THEN + IF ( density_on == 1 ) THEN ltmp = ltmp + 1 lvh = ltmp ! lhab+8 + isub ! 16 + isub ! isub adjusts to 15 if hail is off ENDIF ! ltmp = lvh denscale(lccn:ltmp) = 1 - IF ( ihvol >= 1 ) THEN + IF ( density_on == 1 .and. hail_on == 1 ) THEN ltmp = ltmp + 1 lvhl = ltmp ! ltmp = lvhl @@ -1673,19 +1786,14 @@ SUBROUTINE nssl_2mom_init( & lzh = ltmp ltmp = ltmp + 1 lzr = ltmp - ltmp = ltmp + 1 IF ( lhl > 1 ) THEN ltmp = ltmp + 1 lzhl = ltmp ENDIF + ! write(0,*) 'ipcon,lzr = ',ipconc,lzr,lzh,lzhl ENDIF ! ltmp = lvh ! denscale(lccn:lvh) = 1 - IF ( ihvol >= 1 ) THEN - lvhl = ltmp+1 - ltmp = lvhl - denscale(lvhl) = 1 - ENDIF IF ( mixedphase ) THEN ltmp = ltmp + 1 lsw = ltmp @@ -1705,7 +1813,8 @@ SUBROUTINE nssl_2mom_init( & - + ! write(0,*) 'wrf_init: lh,lhl,lzh,lzhl = ',lh,lhl,lzh,lzhl + ! write(0,*) 'wrf_init: ipconc = ',ipconc ! write(0,*) 'wrf_init: irenuc, turn_on_ccna = ',irenuc, turn_on_ccna IF ( turn_on_ccna ) THEN ltmp = ltmp + 1 @@ -2171,19 +2280,24 @@ END SUBROUTINE nssl_2mom_init !! Driver subroutine that copies state data to local 2D arrays for microphysics calls SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw, chl, & cn, vhw, vhl, cna, cni, f_cn, f_cna, f_cina, & + f_qc, f_qr, f_qi, f_qs, f_qh, f_qhl, & cnuf, f_cnuf, & zrw, zhw, zhl, f_zrw, f_zhw, f_zhl, f_vhw, f_vhl, & qsw, qhw, qhlw, & tt, th, pii, p, w, dn, dz, dtp, itimestep, & + is_theta_or_temp, & ntmul, ntcnt, lastloop, & RAINNC,RAINNCV, & dx, dy, & axtra, & SNOWNC, SNOWNCV, GRPLNC, GRPLNCV, & SR,HAILNC, HAILNCV, & + hail_maxk1, hail_max2d, nwp_diagnostics, & tkediss, & re_cloud, re_ice, re_snow, re_rain, & + re_graup, re_hail, & has_reqc, has_reqi, has_reqs, has_reqr, & + has_reqg, has_reqh, & rainncw2, rainnci2, & dbz, vzf,compdbz, & rscghis_2d,rscghis_2dp,rscghis_2dn, & @@ -2217,6 +2331,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw + + implicit none @@ -2234,6 +2350,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw zrw, zhw, zhl, & qsw, qhw, qhlw, & qi,qhl,ccw,crw,cci,csw,chw,chl,vhw,vhl + integer, optional, intent(in) :: is_theta_or_temp logical, optional, intent(in) :: f_zrw, f_zhw, f_zhl, f_vhw, f_vhl ! not used yet real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(inout):: dbz, vzf, cn, cna, cni, cnuf real, dimension(ims:ime, jms:jme), optional, intent(inout):: compdbz @@ -2268,16 +2385,21 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw real, dimension(ims:ime, kms:kme, jms:jme), optional, intent(inout) :: axtra ! WRF variables - real, dimension(ims:ime, jms:jme), intent(inout):: & + real, dimension(ims:ime, jms:jme) :: & RAINNC,RAINNCV ! accumulated precip (NC) and rate (NCV) real, dimension(ims:ime, jms:jme), optional, intent(inout):: & SNOWNC,SNOWNCV,GRPLNC,GRPLNCV,SR ! accumulated precip (NC) and rate (NCV) real, dimension(ims:ime, jms:jme), optional, intent(inout):: & HAILNC,HAILNCV ! accumulated precip (NC) and rate (NCV) + real, dimension(ims:ime, jms:jme), optional, intent(inout) :: hail_maxk1, hail_max2d + integer, optional, intent(in) :: nwp_diagnostics +! for cm1, set nproctot=44 (or as needed) to get domain total rates integer, parameter :: nproc = 1 - REAL, DIMENSION(ims:ime, kms:kme, jms:jme), optional, INTENT(INOUT):: re_cloud, re_ice, re_snow, re_rain + double precision :: proctot(nproc),proctotmpi(nproc) + REAL, DIMENSION(ims:ime, kms:kme, jms:jme), optional, INTENT(INOUT):: re_cloud, re_ice, re_snow, & + re_rain, re_graup, re_hail REAL, DIMENSION(ims:ime, kms:kme, jms:jme), optional, INTENT(IN):: tkediss - INTEGER, INTENT(IN), optional :: has_reqc, has_reqi, has_reqs, has_reqr + INTEGER, INTENT(IN), optional :: has_reqc, has_reqi, has_reqs, has_reqr, has_reqg, has_reqh real, dimension(ims:ime, jms:jme), intent(out), optional :: & rainncw2, rainnci2 ! liquid rain, ice, accumulation rates real, optional, intent(in) :: dx,dy @@ -2286,6 +2408,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw integer, intent(in), optional :: ntmul, ntcnt logical, optional, intent(in) :: lastloop logical, optional, intent(in) :: diagflag, f_cna, f_cn, f_cina, f_cnuf + logical, optional, intent(in) :: f_qc, f_qr, f_qi, f_qs, f_qh, f_qhl integer, optional, intent(in) :: ipelectmp, ke_diag ! CCPP error handling @@ -2298,7 +2421,11 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw LOGICAL :: flag_qndrop ! wrf-chem LOGICAL :: flag_qnifa , flag_qnwfa logical :: flag_cnuf = .false. + logical :: flag_ccn = .false. + logical :: flag_qi = .true. + logical :: has_reqg_local = .false., has_reqh_local = .false. logical :: flag + logical :: nwp_diagflag = .false. real :: cinchange, t7max,testmax,wmax ! 20130903 acd_ck_washout start @@ -2323,9 +2450,11 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw real, dimension(its:ite, kts:kte) :: rainprod2d, evapprod2d,tke2d real, dimension(its:ite, 1, kts:kte, na) :: an, ancuten real, dimension(its:ite, 1, kts:kte, nxtra) :: axtra2d + real, dimension(its:ite, 1, kts:kte, 3) :: alpha2d real, dimension(its:ite, 1, kts:kte) :: t0,t1,t2,t3,t4,t5,t6,t7,t8,t9 real, dimension(its:ite, 1, kts:kte) :: dn1,t00,t77,ssat,pn,wn,dz2d,dz2dinv,dbz2d,vzf2d real, dimension(its:ite, 1, na) :: xfall + real, dimension(its:ite, 1) :: hailmax1d,hailmaxk1 real, dimension(kts:kte, nproc) :: thproclocal integer, parameter :: nor = 0, ng = 0 integer :: nx,ny,nz,ngs @@ -2374,15 +2503,6 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw integer :: loopcnt, loopmax, outerloopcnt logical :: lastlooptmp -#ifdef MPI - -#if defined(MPI) - integer, parameter :: ntot = 50 - double precision mpitotindp(ntot), mpitotoutdp(ntot) - INTEGER :: mpi_error_code = 1 -#endif -#endif - ! ------------------------------------------------------------------- @@ -2397,11 +2517,35 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw flag_qnifa = .false. flag_qnwfa = .false. flag_cnuf = .false. + flag_ccn = .false. + nwp_diagflag = .false. IF ( PRESENT ( nssl_progn ) ) flag_qndrop = nssl_progn IF ( present ( f_cnuf ) ) flag_cnuf = f_cnuf + IF ( present ( nwp_diagnostics ) ) nwp_diagflag = ( nwp_diagnostics > 0 ) + + IF ( present ( f_cn ) .and. present( cn ) ) THEN + flag_ccn = f_cn + ELSEIF ( present( cn ) ) THEN + flag_ccn = .true. + ENDIF + + IF ( present( f_qi ) ) THEN + flag_qi = f_qi + ELSE + IF ( ffrzs < 1.0 ) THEN + flag_qi = .true. + ELSE + flag_qi = .false. + ENDIF + ENDIF + + IF ( .not. flag_qi .and. ffrzs < 1.0 ) ffrzs = 1.0 + IF ( PRESENT ( has_reqg ) ) has_reqg_local = has_reqg > 0 + IF ( PRESENT ( has_reqh ) ) has_reqh_local = has_reqh > 0 + loopmax = 1 outerloopcnt = 1 lastlooptmp = .true. @@ -2411,7 +2555,13 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw lastlooptmp = lastloop ENDIF - ! --- + + has_wetscav = .false. + IF ( wrfchem_flag > 0 ) THEN + IF ( PRESENT( wetscav_on ) ) THEN + has_wetscav = wetscav_on + ENDIF + ENDIF IF ( present( f_cna ) ) THEN f_cnatmp = f_cna @@ -2462,8 +2612,9 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw nx = ite-its+1 ny = 1 ! set up as 2D slabs nz = kte-kts+1 + ngs = Max(nz,64) - IF ( .not. present( cn ) ) THEN + IF ( .not. flag_ccn ) THEN renucfrac = 1.0 ENDIF @@ -2527,30 +2678,32 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw DO jy = jts,jye - xfall(:,:,:) = 0.0 - ! write(0,*) 'N2M: load an, jy,lccn = ',jy,lccn,qccn IF ( present( pcc2 ) .and. makediag ) THEN axtra2d(its:ite,1,kts:kte,:) = 0.0 ENDIF + IF ( nwp_diagflag ) THEN + alpha2d(its:ite,1,kts:kte,1) = alphar + alpha2d(its:ite,1,kts:kte,2) = alphah + alpha2d(its:ite,1,kts:kte,3) = alphahl + ENDIF + + ! copy from 3D array to 2D slab DO kz = kts,kte DO ix = its,ite - IF ( present( tt ) ) THEN an(ix,1,kz,lt) = tt(ix,kz,jy)/pii(ix,kz,jy) ELSE an(ix,1,kz,lt) = th(ix,kz,jy) ENDIF - - an(ix,1,kz,lv) = qv(ix,kz,jy) an(ix,1,kz,lc) = qc(ix,kz,jy) an(ix,1,kz,lr) = qr(ix,kz,jy) - IF ( present( qi ) ) THEN + IF ( flag_qi ) THEN an(ix,1,kz,li) = qi(ix,kz,jy) ELSE an(ix,1,kz,li) = 0.0 @@ -2561,7 +2714,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw IF ( lccn > 1 ) THEN IF ( is_aerosol_aware .and. flag_qnwfa ) THEN ! - ELSEIF ( present( cn ) ) THEN + ELSEIF ( flag_ccn ) THEN IF ( lccna > 1 .and. .not. ( present( cna ) .and. f_cnatmp ) ) THEN an(ix,1,kz,lccna) = cn(ix,kz,jy) an(ix,1,kz,lccn) = qccn ! cn(ix,kz,jy) @@ -2690,6 +2843,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! ssival = Min(t8s,max(an(ix,1,kz,lv),0.0))/t9s ! qv/qvi + if ( ssival .gt. 1.0 ) then ! IF ( icenucopt == 1 ) THEN @@ -2750,7 +2904,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! naer needs units of cm**-3, so mult by 1.e-6 ! dp1 = 1.e3*0.0000594*(273.16 - t0(ix,1,kz))**3.33 * (1.e-6*cin*dn(ix,1,kz))**(0.0264*(273.16 - t0(ix,1,kz)) + 0.0033) - dp1 = 1.e3*dn1(ix,1,kz)/rho00*0.0000594*(273.16 - t0(ix,1,kz))**3.33 * (1.e-6*naer)**(0.0264*(273.16 - t0(ix,1,kz)) + 0.0033) + tmp = 1.e-6*naer + dp1 = 1.e3*dn1(ix,1,kz)/rho00*0.0000594*(273.16 - t0(ix,1,kz))**3.33 * tmp**(0.0264*(273.16 - t0(ix,1,kz)) + 0.0033) t7(ix,1,kz) = Min(dp1, 1.0d30) ELSE @@ -2767,16 +2922,12 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDDO ! ix ENDDO ! kz - has_wetscav = .false. - IF ( wrfchem_flag > 0 ) THEN - IF ( PRESENT( wetscav_on ) ) THEN - has_wetscav = wetscav_on - IF ( has_wetscav ) THEN - IF ( PRESENT( rainprod ) ) rainprod2d(its:ite,kts:kte) = 0 - IF ( PRESENT( evapprod ) ) evapprod2d(its:ite,kts:kte) = 0 - ENDIF - ENDIF - ENDIF + IF ( wrfchem_flag > 0 ) THEN + IF ( has_wetscav ) THEN + IF ( PRESENT( rainprod ) ) rainprod2d(its:ite,kts:kte) = 0 + IF ( PRESENT( evapprod ) ) evapprod2d(its:ite,kts:kte) = 0 + ENDIF + ENDIF ! transform from number mixing ratios to number conc. @@ -2917,9 +3068,6 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! ENDIF ! .false. - - ngs = 128 - IF ( isedonly /= 1 ) THEN ! call nssl_2mom_gs: main gather-scatter routine to calculate microphysics @@ -2940,11 +3088,11 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ! & ln,ipc,lvol,lz,lliq, & & cdx, & & xdn0,dbz2d,tke2d, & - & thproclocal,nproc,dx1,dy1, & + & thproclocal,nproc,dx1,dy1,ngs, & & timevtcalc,axtra2d, makediag & - & ,has_wetscav, rainprod2d, evapprod2d & + & ,has_wetscav, rainprod2d, evapprod2d, alpha2d & & ,errmsg,errflg & - & ,elec2,its,ids,ide,jds,jde,ngs & + & ,elec2,its,ids,ide,jds,jde & & ) @@ -2967,9 +3115,10 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw & ,dz2d & & ,t0,t9 & & ,an,dn1,t77 & - & ,pn,wn & + & ,pn,wn & + & ,ngs & & ,axtra2d, makediag & - & ,ssat,t00,t77,flag_qndrop,ngs) + & ,ssat,t00,t77,flag_qndrop) ! recalculate dn1 after temperature changes DO kz = kts,kte @@ -2985,14 +3134,12 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDDO ! loopcnt=1,loopmax - IF ( present( pcc2 ) .and. makediag ) THEN DO kz = kts,kte DO ix = its,ite ! example of using the 'axtra2d' array to get rates out of the microphysics routine for output. ! Search for 'axtra' to find example code below ! pcc2(ix,kz,jy) = axtra2d(ix,1,kz,1) - ENDDO ENDDO ENDIF @@ -3056,7 +3203,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw call calc_eff_radius & & (nx,ny,nz,na,jy & & ,nor,nor & - & ,t1=t1,t2=t2,t3=t3,t4=t4 & + & ,t1=t1,t2=t2,t3=t3,t4=t4,t5=t5,t6=t6,f_t5=has_reqg_local, f_t6=has_reqh_local & & ,an=an,dn=dn1 ) DO kz = kts,kte @@ -3078,12 +3225,46 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDDO ENDIF ENDIF + + IF ( present(has_reqg) .and. present( re_graup ) ) THEN + IF ( has_reqg /= 0 ) THEN + DO kz = kts,kte + DO ix = its,ite + re_graup(ix,kz,jy) = MAX(50.E-6, MIN(t5(ix,1,kz), 10.E-3)) + ENDDO + ENDDO + ENDIF + ENDIF + + IF ( present(has_reqh) .and. present( re_hail ) ) THEN + IF ( has_reqh /= 0 ) THEN + DO kz = kts,kte + DO ix = its,ite + re_hail(ix,kz,jy) = MAX(50.E-6, MIN(t5(ix,1,kz), 40.E-3)) + ENDDO + ENDDO + ENDIF + ENDIF ENDIF ENDIF + IF ( present( hail_maxk1 ) .and. present( hail_max2d ) .and. nwp_diagflag ) THEN + DO ix = its,ite + hailmax1d(ix,1) = hail_max2d(ix,jy) + hailmaxk1(ix,1) = hail_maxk1(ix,jy) + ENDDO + call hailmaxd(dtp,nx,ny,nz,an,na,nor,nor,alpha2d,dn1, & + hailmax1d,hailmaxk1,1 ) + + DO ix = its,ite + hail_max2d(ix,jy) = hailmax1d(ix,1) + hail_maxk1(ix,jy) = hailmaxk1(ix,1) + ENDDO +! ENDIF + ENDIF ! transform concentrations back to mixing ratios DO il = lnb,na @@ -3111,14 +3292,14 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw qv(ix,kz,jy) = an(ix,1,kz,lv) qc(ix,kz,jy) = an(ix,1,kz,lc) qr(ix,kz,jy) = an(ix,1,kz,lr) - IF ( present(qi) ) qi(ix,kz,jy) = an(ix,1,kz,li) + IF ( flag_qi ) qi(ix,kz,jy) = an(ix,1,kz,li) qs(ix,kz,jy) = an(ix,1,kz,ls) qh(ix,kz,jy) = an(ix,1,kz,lh) IF ( lhl > 1 ) qhl(ix,kz,jy) = an(ix,1,kz,lhl) IF ( lccn > 1 .and. is_aerosol_aware .and. flag_qnwfa ) THEN ! not used here - ELSEIF ( present( cn ) .and. lccn > 1 .and. .not. flag_qndrop) THEN + ELSEIF ( flag_ccn .and. lccn > 1 .and. .not. flag_qndrop) THEN IF ( lccna > 1 .and. .not. ( present( cna ) .and. f_cnatmp ) ) THEN cn(ix,kz,jy) = Max(0.0, an(ix,1,kz,lccna) ) ELSE @@ -3185,7 +3366,8 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw ENDDO ENDDO - + + ENDDO ! jy @@ -3824,8 +4006,242 @@ Function delabk(ba,bb,nua,nub,mua,mub,k) RETURN END Function delabk + + + +! ####################################################################### +! HAILMAXD - calculated maximum expected hail size +! ####################################################################### +!>\ingroup mod_nsslmp +!! Hail max size subroutine. + subroutine hailmaxd(dtp,nx,ny,nz,an,na,nor,norz,alpha2d,dn, & + & hailmax1d,hailmaxk1,jslab ) +! +! Calculate maximum hail size from the tail of of the distribution. The value +! of thresh_conc sets the minimum concentration in the integral over (Dmax, Inf). +! This uses the lookup tables for incomplete gamma functions and simply search for +! the expected value (and linearly interpolate) on D. +! +! Written by ERM 7/2023 +! +! +! + implicit none + + integer nx,ny,nz,nor,norz,ngt,jgs,na,ia + integer id ! =1 use density, =0 no density +! integer :: its,ite ! x-range to calculate + integer ng1 + parameter(ng1 = 1) + + real an(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz,na) + real dn(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) + +! real gz(-nor+ng1:nz+nor),z1d(-nor+ng1:nz+nor,4) + real dtp + real alpha2d(-nor+1:nx+nor,1,-norz+1:nz+norz,3) ! array for PSD shape parameters + real :: hailmax1d(nx,ny),hailmaxk1(nx,ny) + integer infdo + integer jslab ! which line of xfall to use + + integer ix,jy,kz,ndfall,n,k,il,in + double precision :: tmp, ratio, del, g1palp + real, parameter :: dz = 200. + + real :: db1(nx,nz+1),dtz1(nz+1,nx,0:1),dz2dinv(nz+1,nx),db1inv(nx,nz+1) + + real :: rhovtzx(nz,nx) + + real :: alp, diam, diam1, hwdn + +! real, parameter :: cmin = 0.001 ! threshold number per m^3 for maximum diamter (threshold from diag_nwp) + DOUBLE PRECISION, PARAMETER:: thresh_conc = 0.0005d0 ! number conc. of graupel/hail per cubic meter + real :: cwchtmp,cwchltmp, maxdia + +!----------------------------------------------------------------------------- + + integer :: ixb, jyb, kzb + integer :: ixe, jye, kze + integer :: plo, phi + integer :: ialp, i, j + + logical :: debug_mpi = .TRUE. + +! ################################################################### + + + IF ( lh > 1 ) THEN + cwchtmp = ((3. + dnu(lh))*(2. + dnu(lh))*(1.0 + dnu(lh)))**(-1./3.) + ENDIF + IF ( lhl > 1 ) THEN + cwchltmp = ((3. + dnu(lhl))*(2. + dnu(lhl))*(1.0 + dnu(lhl)))**(-1./3.) + ENDIF + + + kzb = 1 + kze = nz + + ixb = 1 ! aliased its + ixe = nx ! aliased ite + + + jy = jslab + jgs = jy + + +! hailmax1d(:,jy) = 0.0 +! hailmaxk1(:,jy) = 0.0 + + if ( ndebug .gt. 0 ) write(0,*) 'dbg = 3a' + + +! first graupel, even if hail is also predicted, since graupel can sometime be large on its own + IF ( lh > 1 .and. lnh > 1 ) THEN + DO kz = kzb,kze + DO ix = ixb,ixe + IF ( an(ix,jy,kz,lh) .gt. qxmin(lh) .and. an(ix,jy,kz,lnh) .gt. thresh_conc ) THEN + IF ( lvh .gt. 1 ) THEN + hwdn = dn(ix,jy,kz)*an(ix,jy,kz,lh)/an(ix,jy,kz,lvh) + ELSE + hwdn = rho_qh + ENDIF + tmp = 1. + alpha2d(ix,1,kz,2) + i = Int(dgami*(tmp)) + del = tmp - dgam*i + g1palp = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = dn(ix,jy,kz)*an(ix,jy,kz,lh)/(hwdn*an(ix,jy,kz,lnh)) + diam = (6.0*tmp/(3.14159))**(1./3.) + IF ( lzh > 1 ) THEN ! 3moment + cwchtmp = ((3. + alpha2d(ix,1,kz,2))*(2. + alpha2d(ix,1,kz,2))*(1.0 + alpha2d(ix,1,kz,2)))**(-1./3.) + ENDIF + diam1 = diam*cwchtmp ! characteristic diameter, i.e., 1/lambda + ! want cxd1 = thresh_conc + ! tmp = gaminterp(ratio,alpha(mgs,lh),1,1) + ! cxd1 = cx(mgs,lh)*(tmp)/g1palp + ! tmp = thresh_conc*g1palp/cx + ! + tmp = thresh_conc*g1palp/an(ix,jy,kz,lnh) + alp = alpha2d(ix,1,kz,2) + ! gamxinflu(i,j,luindex,ilh) + j = Int(Max(0.0,Min(maxalphalu,alp))*dqiacralphainv) + ratio = 0.0 + maxdia = 0.0 + ! eventually could replace with bisection search, but final value of i is usually small + ! compared to nqiacrratio + DO i = 0,nqiacrratio-1 + IF ( gamxinflu(i,j,1,1) >= tmp .and. tmp >= gamxinflu(i+1,j,1,1) ) THEN + ! interpolate here for FWIW + ratio = i*dqiacrratio + del = tmp - gamxinflu(i,j,1,1) + ratio = (float(i) + del/(gamxinflu(i+1,j,1,1) - gamxinflu(i,j,1,1)))*dqiacrratio + exit + ENDIF + ENDDO + + IF ( ratio > 0.0 ) THEN + maxdia = ratio*diam1 ! units of m + ENDIF + + IF ( kz == kzb ) THEN + hailmaxk1(ix,jy) = Max( maxdia, hailmaxk1(ix,jy) ) +! IF ( maxdia > 0.1 ) THEN +! IF ( an(ix,jy,kz,lh) > 1.e-4 ) THEN +! write(0,*) 'maxdia,tmp,alp,ratio,diam,diam1= ',maxdia,tmp,alp,ratio,diam*100.,diam1*100. +! write(0,*) 'hwdn, cxhl, qx, g1palp = ',hwdn, an(ix,jy,kz,lnhl), an(ix,jy,kz,lhl), g1palp +! write(0,*) 'j,gamxinflu(0,2,4) = ',j,gamxinflu(0,j,1,1),gamxinflu(2,j,1,1), & +! gamxinflu(4,j,1,1) +! ENDIF + ENDIF + + hailmax1d(ix,jy) = Max(maxdia, hailmax1d(ix,jy) ) + + ! + + ENDIF + + ENDDO + ENDDO + + ENDIF ! lh + +! And diam for hail if present + IF ( lhl > 1 .and. lnhl > 1 ) THEN + DO kz = kzb,kze + DO ix = ixb,ixe + IF ( an(ix,jy,kz,lhl) .gt. qxmin(lhl) .and. an(ix,jy,kz,lnhl) .gt. thresh_conc ) THEN + IF ( lvhl .gt. 1 ) THEN + hwdn = dn(ix,jy,kz)*an(ix,jy,kz,lhl)/an(ix,jy,kz,lvhl) + ELSE + hwdn = rho_qhl + ENDIF + + tmp = 1. + alpha2d(ix,1,kz,3) + i = Int(dgami*(tmp)) + del = tmp - dgam*i + g1palp = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = dn(ix,jy,kz)*an(ix,jy,kz,lhl)/(hwdn*an(ix,jy,kz,lnhl)) + diam = (6.0*tmp/(3.14159))**(1./3.) + IF ( lzhl > 1 ) THEN ! 3moment + cwchltmp = ((3. + alpha2d(ix,1,kz,3))*(2. + alpha2d(ix,1,kz,3))*(1.0 + alpha2d(ix,1,kz,3)))**(-1./3.) + ENDIF + diam1 = diam*cwchltmp ! characteristic diameter, i.e., 1/lambda + ! want cxd1 = thresh_conc + ! tmp = gaminterp(ratio,alpha(mgs,lh),1,1) + ! cxd1 = cx(mgs,lh)*(tmp)/g1palp + ! tmp = thresh_conc*g1palp/cx + ! + tmp = thresh_conc*g1palp/an(ix,jy,kz,lnhl) + alp = alpha2d(ix,1,kz,3) + ! gamxinflu(i,j,luindex,ilh) + j = Int(Max(0.0,Min(maxalphalu,alp))*dqiacralphainv) + ratio = 0.0 + maxdia = 0.0 + ! eventually could replace with bisection search, but final value of i is usually small + ! compared to nqiacrratio + DO i = 0,nqiacrratio-1 + IF ( gamxinflu(i,j,1,1) >= tmp .and. tmp >= gamxinflu(i+1,j,1,1) ) THEN + ! interpolate here for FWIW + ratio = i*dqiacrratio + del = tmp - gamxinflu(i,j,1,1) + ratio = (float(i) + del/(gamxinflu(i+1,j,1,1) - gamxinflu(i,j,1,1)))*dqiacrratio + exit + ENDIF + ENDDO + + IF ( ratio > 0.0 ) THEN + maxdia = ratio*diam1 ! units of m + ENDIF + + IF ( kz == kzb ) THEN + hailmaxk1(ix,jy) = Max( maxdia, hailmaxk1(ix,jy) ) +! IF ( maxdia > 0.1 ) THEN +! IF ( an(ix,jy,kz,lhl) > 1.e-4 ) THEN +! write(0,*) 'maxdia,tmp,alp,ratio,diam,diam1= ',maxdia,tmp,alp,ratio,diam*100.,diam1*100. +! write(0,*) 'hwdn, cxhl, qx, g1palp = ',hwdn, an(ix,jy,kz,lnhl), an(ix,jy,kz,lhl), g1palp +! write(0,*) 'j,gamxinflu(0,2,4) = ',j,gamxinflu(0,j,1,1),gamxinflu(2,j,1,1), & +! gamxinflu(4,j,1,1) +! ENDIF + ENDIF + + hailmax1d(ix,jy) = Max(maxdia, hailmax1d(ix,jy) ) + + ! + + ENDIF + + ENDDO + ENDDO + + ENDIF + + + END SUBROUTINE HAILMAXD +! ####################################################################### +! ####################################################################### !>\ingroup mod_nsslmp !! Sedimentation driver subroutine. Calls fallout column by column subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & @@ -4872,9 +5288,6 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & an(ix,jy,kz,lnr) = nrx ! *dninv ! convert to number mixing ratio - IF ( lzr > 1 ) THEN ! set reflectivity moment - an(ix,jy,kz,lzr) = 36.*g1r*dn(ix,kz)**2*q**2/(pi**2*xdnr**2*nrx) ! *dninv - ENDIF ELSEIF ( an(ix,jy,kz,lr) <= qxmin(lr) .or. & ( an(ix,jy,kz,lnr) <= cxmin .and. an(ix,jy,kz,lr) <= qxmin_init(lr)) ) THEN an(ix,jy,kz,lv) = an(ix,jy,kz,lv) + an(ix,jy,kz,lr) @@ -4883,6 +5296,15 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & ENDIF ENDIF + IF ( lzr > 1 ) THEN ! set reflectivity moment + IF ( an(ix,jy,kz,lr) > qxmin_init(lr) .and. an(ix,jy,kz,lzr) < zxmin .and. & + an(ix,jy,kz,lnr) > cxmin ) THEN + q = an(ix,jy,kz,lr) + nrx = an(ix,jy,kz,lnr) + an(ix,jy,kz,lzr) = 36.*g1r*dn(ix,kz)**2*q**2/(pi**2*xdnr**2*nrx) ! *dninv + ENDIF + ENDIF + ! snow IF ( lns > 1 ) THEN IF ( an(ix,jy,kz,lns) <= 0.1*cxmin .and. an(ix,jy,kz,ls) > qxmin_init(ls) ) THEN @@ -4936,9 +5358,6 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & an(ix,jy,kz,lvh) = 0.0 ENDIF - IF ( lzh > 1 ) THEN ! set reflectivity moment - an(ix,jy,kz,lzh) = 36.*g1h*dn(ix,kz)**2*q**2/(pi**2*xdnh**2*nrx) ! *dninv - ENDIF ELSEIF ( an(ix,jy,kz,lh) <= qxmin(lh) .or. & ( an(ix,jy,kz,lnh) <= cxmin .and. an(ix,jy,kz,lh) <= qxmin_init(lh)) ) THEN @@ -4948,6 +5367,15 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & ENDIF ENDIF + IF ( lzh > 1 ) THEN ! set reflectivity moment + IF ( an(ix,jy,kz,lh) > qxmin_init(lh) .and. an(ix,jy,kz,lzh) < zxmin .and. & + an(ix,jy,kz,lnh) > cxmin ) THEN + q = an(ix,jy,kz,lh) + nrx = an(ix,jy,kz,lnh) + an(ix,jy,kz,lzh) = 36.*g1h*dn(ix,kz)**2*q**2/(pi**2*xdnh**2*nrx) ! *dninv + ENDIF + ENDIF + ! hail IF ( lnhl > 1 .and. lhl > 1 ) THEN @@ -4968,10 +5396,6 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & an(ix,jy,kz,lnhl) = nrx ! *dninv ! convert to number mixing ratio - IF ( lzhl > 1 ) THEN ! set reflectivity moment - an(ix,jy,kz,lzhl) = 36.*g1hl*dn(ix,kz)**2*q**2/(pi**2*xdnhl**2*nrx) ! *dninv - ENDIF - ELSEIF ( an(ix,jy,kz,lhl) <= qxmin(lhl) .or. & ( an(ix,jy,kz,lnhl) <= cxmin .and. an(ix,jy,kz,lhl) <= qxmin_init(lhl)) ) THEN @@ -4980,6 +5404,15 @@ subroutine calcnfromq(nx,ny,nz,an,na,nor,norz,dn, & ENDIF ENDIF + + IF ( lzhl > 1 ) THEN ! set reflectivity moment + IF ( an(ix,jy,kz,lhl) > qxmin_init(lhl) .and. an(ix,jy,kz,lzhl) < zxmin .and. & + an(ix,jy,kz,lnhl) > cxmin ) THEN + q = an(ix,jy,kz,lhl) + nrx = an(ix,jy,kz,lnhl) + an(ix,jy,kz,lzhl) = 36.*g1hl*dn(ix,kz)**2*q**2/(pi**2*xdnhl**2*nrx) ! *dninv + ENDIF + ENDIF ! ENDIF @@ -5250,7 +5683,7 @@ END subroutine calcnfromcuten SUBROUTINE calc_eff_radius & & (nx,ny,nz,na,jyslab & & ,nor,norz & - & ,t1,t2,t3,t4 & + & ,t1,t2,t3,t4,t5,t6, f_t5,f_t6 & & ,qcw,qci,qsw,qrw & & ,ccw,cci,csw,crw & & ,an,dn ) @@ -5272,6 +5705,9 @@ SUBROUTINE calc_eff_radius & real,optional :: t2(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) real,optional :: t3(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) real,optional :: t4(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) + real,optional :: t5(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) + real,optional :: t6(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) + logical, optional :: f_t5, f_t6 ! flags to fill t5/t6 for graupel/hail real, optional :: an(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz,na) real dn(-nor+1:nx+nor,-nor+1:ny+nor,-norz+1:nz+norz) @@ -7495,7 +7931,7 @@ subroutine ziegfall1d(nx,ny,nz,nor,norz,na,dtp,jgs,ixcol, & cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*1000.*1000) an(igs(mgs),jgs,kgs(mgs),ln(il)) = cx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > cxmin ) THEN ! have mass and concentration but no reflectivity, so set reflectivity, using default alpha g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) chw = cx(mgs,il) @@ -7511,7 +7947,7 @@ subroutine ziegfall1d(nx,ny,nz,nor,norz,na,dtp,jgs,ixcol, & zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(xdn(mgs,lr)**2*chw) an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! set values according to dBZ of -10, or Z = 0.1 ! write(91,*) 'alpha = ',alpha(mgs,il) @@ -7710,7 +8146,7 @@ subroutine ziegfall1d(nx,ny,nz,nor,norz,na,dtp,jgs,ixcol, & ! zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/chw zx(mgs,il) = Min(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! write(91,*) 'ziegfall: something screwy with moments: il = ',il ! write(91,*) 'q,n,z = ', 1.e3*qx(mgs,il),cx(mgs,il),zx(mgs,il) @@ -7737,7 +8173,7 @@ subroutine ziegfall1d(nx,ny,nz,nor,norz,na,dtp,jgs,ixcol, & ENDIF ENDIF - IF ( qx(mgs,il) .gt. qxmin(il) .and. cx(mgs,il) .gt. 0.0 ) THEN + IF ( qx(mgs,il) .gt. qxmin(il) .and. cx(mgs,il) .gt. cxmin ) THEN chw = cx(mgs,il) qr = qx(mgs,il) z = zx(mgs,il) @@ -9003,8 +9439,9 @@ SUBROUTINE NUCOND & & ,t0,t9 & & ,an,dn,p2 & & ,pn,w & + & ,ngs & & ,axtra,io_flag & - & ,ssfilt,t00,t77,flag_qndrop,ngs & + & ,ssfilt,t00,t77,flag_qndrop & & ) @@ -9061,6 +9498,7 @@ SUBROUTINE NUCOND & logical :: io_flag real :: dv + real :: ccnefactwo, sstmp, cn1, cnuctmp ! ! declarations microphysics and for gather/scatter @@ -9069,7 +9507,6 @@ SUBROUTINE NUCOND & real, parameter :: cwmas20 = 1000.*0.523599*(2.*20.e-6)**3 ! mass of 20-micron radius droplet, for sat. adj. integer nxmpb,nzmpb,nxz integer mgs,ngs,numgs,inumgs -! parameter (ngs=1 ) integer ngscnt,igs(ngs),kgs(ngs) integer kgsp(ngs),kgsm(ngs) integer nsvcnt @@ -9088,6 +9525,7 @@ SUBROUTINE NUCOND & real ccnc(ngs), ccna(ngs), cnuc(ngs), cwnccn(ngs) + real :: ccnc_nu(ngs), ccnc_ac(ngs), ccnc_co(ngs) real ccncuf(ngs) real sscb ! 'cloud base' SS threshold parameter ( sscb = 2.0 ) @@ -9100,7 +9538,7 @@ SUBROUTINE NUCOND & integer ifilt ! =1 to filter ssat, =0 to set ssfilt=ssat parameter ( ifilt = 0 ) real temp1,temp2 ! ,ssold - real :: ssmax(ngs) ! maximum SS experienced by a parcel + real :: ssmax(ngs) ! maximum SS experienced by a parcel real ssmx real dnnet,dqnet ! real cnu,rnu,snu,cinu @@ -9224,7 +9662,6 @@ SUBROUTINE NUCOND & integer :: count - ! ------------------------------------------------------------------------------- itile = nxi jtile = ny @@ -9238,6 +9675,7 @@ SUBROUTINE NUCOND & kzbeg = 1 nzbeg = 1 + IF ( ac_opt > 0 ) ccnefactwo = (1.63e-3/(cck * beta(3./2., cck/2.)))**(1.0/(cck + 2.0)) f5 = 237.3 * 17.27 * 2.5e6 / cp ! combined constants for rain condensation (Soong and Ogura 73) jy = 1 @@ -9463,12 +9901,16 @@ SUBROUTINE NUCOND & ELSE ssmax(mgs) = 0.0 ENDIF - IF ( lccn .gt. 1 ) THEN - ccnc(mgs) = an(igs(mgs),jy,kgs(mgs),lccn) + IF ( lccn .gt. 1 .and. ac_opt == 0 ) THEN + IF ( lccnuf .gt. 1 .and. i_uf_or_ccn > 0 ) THEN + ccnc(mgs) = an(igs(mgs),jy,kgs(mgs),lccn) + an(igs(mgs),jy,kgs(mgs),lccnuf) + ELSE + ccnc(mgs) = an(igs(mgs),jy,kgs(mgs),lccn) + ENDIF ELSE ccnc(mgs) = cwnccn(mgs) ENDIF - IF ( lccnuf .gt. 1 ) THEN + IF ( lccnuf .gt. 1 .and. i_uf_or_ccn == 0 ) THEN ccncuf(mgs) = an(igs(mgs),jy,kgs(mgs),lccnuf) ELSE ccncuf(mgs) = 0.0 @@ -9534,7 +9976,7 @@ SUBROUTINE NUCOND & il = lr DO mgs = 1,ngscnt - IF ( zx(mgs,il) <= 0.0 ) THEN + IF ( zx(mgs,il) <= zxmin ) THEN qx(mgs,lv) = qx(mgs,lv) + qx(mgs,il) qx(mgs,il) = 0.0 cx(mgs,il) = 0.0 @@ -9577,7 +10019,7 @@ SUBROUTINE NUCOND & ENDIF ! an(igs(mgs),jgs,kgs(mgs),ln(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > 0.0 ) THEN ! have mass and concentration but no reflectivity, so set reflectivity, using default alpha IF ( imurain == 3 ) THEN g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) @@ -9593,7 +10035,7 @@ SUBROUTINE NUCOND & ENDIF - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! set values according to dBZ of -10, or Z = 0.1 ! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 @@ -9773,6 +10215,8 @@ SUBROUTINE NUCOND & ssfkp1(mgs) = ssfilt(igs(mgs),jgs,Min(nz-1,kgs(mgs)+1)) ssfkm1(mgs) = ssfilt(igs(mgs),jgs,Max(1,kgs(mgs)-1)) +! IF ( wvel(mgs) /= 0.0 ) write(0,*) 'mgs,wvel1,ssf = ',mgs,wvel(mgs),ssf(mgs) + ENDDO @@ -9782,7 +10226,7 @@ SUBROUTINE NUCOND & ! cloud water variables ! - if ( ndebug .gt. 0 )write(0,*) 'ICEZVD_DR: Set cloud water variables' + if ( ndebug .gt. 0 ) write(0,*) 'ICEZVD_DR: Set cloud water variables' do mgs = 1,ngscnt xv(mgs,lc) = 0.0 @@ -9914,15 +10358,14 @@ SUBROUTINE NUCOND & ENDIF qx(mgs,lc) = 0. IF ( restoreccn ) THEN - IF ( irenuc <= 2 ) THEN - IF ( .not. invertccn ) THEN - ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ) ) - ELSE - ccnc(mgs) = ccnc(mgs) + restoreccnfrac*cx(mgs,lc) - ENDIF - ENDIF - IF ( lccna > 1 ) THEN - ccna(mgs) = ccna(mgs) - restoreccnfrac*cx(mgs,lc) + IF ( lccna > 1 ) THEN + ccna(mgs) = ccna(mgs) - restoreccnfrac*cx(mgs,lc) + ELSEIF ( irenuc <= 2 ) THEN + IF ( .not. invertccn ) THEN + ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ) ) + ELSE + ccnc(mgs) = ccnc(mgs) + restoreccnfrac*cx(mgs,lc) + ENDIF ENDIF ENDIF cx(mgs,lc) = 0. @@ -9932,7 +10375,9 @@ SUBROUTINE NUCOND & qx(mgs,lc) = qx(mgs,lc) - QEVAP IF ( qx(mgs,lc) .le. 0. ) THEN IF ( restoreccn ) THEN - IF ( irenuc <= 2 ) THEN + IF ( lccna > 1 ) THEN + ccna(mgs) = ccna(mgs) - restoreccnfrac*cx(mgs,lc) + ELSEIF ( irenuc <= 2 ) THEN ! ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + cx(mgs,lc) ) ) ! ccnc(mgs) = ccnc(mgs) + cx(mgs,lc) IF ( .not. invertccn ) THEN @@ -9941,15 +10386,14 @@ SUBROUTINE NUCOND & ccnc(mgs) = ccnc(mgs) + restoreccnfrac*cx(mgs,lc) ENDIF ENDIF - IF ( lccna > 1 ) THEN - ccna(mgs) = ccna(mgs) - restoreccnfrac*cx(mgs,lc) - ENDIF ENDIF cx(mgs,lc) = 0. ELSE tmp = 0.9*QEVAP*cx(mgs,lc)/qctmp ! let droplets get smaller but also remove some. A factor of 1.0 would maintain same size IF ( restoreccn ) THEN - IF ( irenuc <= 2 ) THEN + IF ( lccna > 1 ) THEN + ccna(mgs) = ccna(mgs) - restoreccnfrac*tmp + ELSEIF ( irenuc <= 2 ) THEN ! ccnc(mgs) = Max( ccnc(mgs), Min( qccn*rho0(mgs), ccnc(mgs) + tmp ) ) ! ccnc(mgs) = ccnc(mgs) + tmp IF ( .not. invertccn ) THEN @@ -9958,9 +10402,6 @@ SUBROUTINE NUCOND & ccnc(mgs) = ccnc(mgs) + restoreccnfrac*tmp ENDIF ENDIF - IF ( lccna > 1 ) THEN - ccna(mgs) = ccna(mgs) - restoreccnfrac*tmp - ENDIF ENDIF cx(mgs,lc) = cx(mgs,lc) - tmp ENDIF @@ -10300,7 +10741,8 @@ SUBROUTINE NUCOND & ! IF ( ssf(mgs) > ssmx .and. ssf(mgs) < 5.0 .and. ccnc(mgs) > 0.1*cwnccn(mgs) ) THEN ! this one works ! IF ( ssf(mgs) > ssmx .and. ssf(mgs) < 20.0 ) THEN ! test -- fails ! IF ( ssf(mgs) > ssmx .and. ssf(mgs) < 20.0 .and. ccnc(mgs) > 0.1*cwnccn(mgs)) THEN ! test -- is OK - IF ( ssf(mgs) > ssmx .and. ssf(mgs) < 20.0 .and. ccnc(mgs) > 0.05*cwnccn(mgs)) THEN ! test + IF ( ssf(mgs) > ssmx .and. ssf(mgs) < 20.0 .and. & + ( ccnc(mgs) > 0.05*cwnccn(mgs) .or. ( ac_opt > 0 .and. ccnc_ac(mgs) - cx(mgs,lc) > 0.0 ) ) ) THEN ! test ! IF ( ssf(mgs) > ssmx ) THEN ! original condition CALL QVEXCESS(ngs,mgs,qwvp,qv0,qx(1,lc),pres,thetap,theta0,dcloud, & & pi0,tabqvs,nqsat,fqsat,cbw,fcqv1,felvcp,ssmx,pk,ngscnt) @@ -10311,7 +10753,7 @@ SUBROUTINE NUCOND & ELSE dcloud = 0.0 ENDIF - + thetap(mgs) = thetap(mgs) + felvcp(mgs)*DCLOUD/(pi0(mgs)) qwvp(mgs) = qwvp(mgs) - DCLOUD qx(mgs,lc) = qx(mgs,lc) + DCLOUD @@ -10336,11 +10778,16 @@ SUBROUTINE NUCOND & IF ( .not. flag_qndrop ) THEN ! { do not calculate number of droplets if using wrf-chem + IF ( ac_opt == 0 ) THEN + cnuctmp = cnuc(mgs) + ELSE + cnuctmp = ccnc_ac(mgs) + ENDIF ! IF ( ssmax(mgs) .lt. sscb .and. qx(mgs,lc) .gt. qxmin(lc)) THEN IF ( dcloud .gt. qxmin(lc) .and. wvel(mgs) > 0.0) THEN ! CN(mgs) = CCNE*wvel(mgs)**cnexp ! *Min(1.0,1./dtp) ! 0.3465 - CN(mgs) = CCNE0*cnuc(mgs)**(2./(2.+cck))*wvel(mgs)**cnexp ! *Min(1.0,1./dtp) ! 0.3465 + CN(mgs) = CCNE0*cnuctmp**(2./(2.+cck))*wvel(mgs)**cnexp ! *Min(1.0,1./dtp) ! 0.3465 IF ( ny .le. 2 .and. cn(mgs) .gt. 0.0 & & .and. ncdebug .ge. 1 ) THEN write(iunit,*) 'CN: ',cn(mgs)*1.e-6, cx(mgs,lc)*1.e-6, qx(mgs,lc)*1.e3, & @@ -10362,12 +10809,16 @@ SUBROUTINE NUCOND & ENDIF IF ( cn(mgs) .gt. 0.0 ) THEN - IF ( cn(mgs) .gt. ccnc(mgs) ) THEN - cn(mgs) = ccnc(mgs) -! ccnc(mgs) = 0.0 + IF ( ac_opt == 0 ) THEN + IF ( cn(mgs) .gt. ccnc(mgs) ) THEN + cn(mgs) = ccnc(mgs) +! ccnc(mgs) = 0.0 + ENDIF + ELSE + cn(mgs) = Min( cn(mgs), ccnc_ac(mgs) ) ENDIF ! cx(mgs,lc) = cx(mgs,lc) + cn(mgs) - IF ( irenuc <= 2 ) ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + IF ( irenuc <= 2 .and. lccna < 1 ) ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) ccna(mgs) = ccna(mgs) + cn(mgs) ENDIF @@ -10413,7 +10864,8 @@ SUBROUTINE NUCOND & DSSDZ=0. r2dzm=0.50/dz3d(igs(mgs),jy,kgs(mgs)) - IF ( irenuc >= 0 .and. .not. flag_qndrop) THEN ! turn off nucleation when flag_qndrop (using WRF-CHEM for activation) + + IF ( irenuc >= 0 .and. ac_opt == 0 .and. .not. flag_qndrop ) THEN ! turn off nucleation when flag_qndrop (using WRF-CHEM for activation) IF ( irenuc < 2 ) THEN !{ @@ -10490,6 +10942,7 @@ SUBROUTINE NUCOND & ! nucleation CN(mgs) = Min(cn(mgs), ccnc(mgs)) cn(mgs) = Min(cn(mgs), 0.5*dqc/cwmasn) ! limit the nucleation mass to half of the condensation mass + CN(mgs) = Min( CN(mgs), Max(0.0, (cnuc(mgs) - ccna(mgs) )) ) IF ( .false. .and. ny <= 2 ) THEN write(0,*) 'i,k, cwmasn = ',igs(mgs),kgs(mgs),cwmasn @@ -10517,7 +10970,7 @@ SUBROUTINE NUCOND & cx(mgs,lc) = cx(mgs,lc) + cn(mgs) - ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + IF ( lccna < 1 ) ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) ELSEIF ( irenuc == 3 ) THEN !} { ! Phillips Donner Garner 2007 @@ -10704,17 +11157,22 @@ SUBROUTINE NUCOND & ! 6/13/2016: Phillips et al. appears not to decrement CCN, but only increments CCNa. ! This would allow an initially non-homogeneous (vertically, e.g.) initial value of CCN/rho_air ! ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) - ELSEIF ( irenuc == 7 ) THEN !} { + ELSEIF ( irenuc == 7 .or. irenuc == 17 ) THEN !} { ! simple Twomey scheme but limit activation to try to do most activation near cloud base, but keep some CCN available for renuclation ! if (ndebug .gt. 0) write(0,*) 'ICEZVD_DR: Cloud reNucleation, wvel = ',wvel(mgs) cn(mgs) = 0.0 + IF ( irenuc == 7 ) THEN + frac = 0.9 + ELSE + frac = 0.98 + ENDIF ! IF ( ccna(mgs) < 0.7*cnuc(mgs) .and. ccnc(mgs) > 0.69*cnuc(mgs) - ccna(mgs)) THEN ! here, assume we are near cloud base and use Twomey formulation - IF ( ccna(mgs) < 0.9*cnuc(mgs) ) THEN ! { here, assume we are near cloud base and use Twomey formulation - CN(mgs) = Min( 0.91*cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp )! *Min(1.0,1./dtp) ! 0.3465 + IF ( ccna(mgs) < frac*cnuc(mgs) ) THEN ! { here, assume we are near cloud base and use Twomey formulation + CN(mgs) = Min( (frac+0.01)*cnuc(mgs), CCNE0*cnuc(mgs)**(2./(2.+cck))*Max(0.0,wvel(mgs))**cnexp )! *Min(1.0,1./dtp) ! 0.3465 ! IF ( cn(mgs) + ccna(mgs) > 0.71*cnuc ) THEN ! prevent this branch from activating more than 70% of CCN - CN(mgs) = Min( CN(mgs), Max(0.0, (0.9*cnuc(mgs) - ccna(mgs) )) ) + CN(mgs) = Min( CN(mgs), Max(0.0, (frac*cnuc(mgs) - ccna(mgs) )) ) ! CN(mgs) = Min( CN(mgs), Max(0.0, 0.71*ccnc(mgs) - ccna(mgs) ) ) ! write(0,*) '1: k,cn = ',kgs(mgs),cn(mgs),ssf(mgs) !! IF ( ccncuf(mgs) > 0.0 .and. cn(mgs) < 1.e-3 .and. ssmax(mgs) > 1.0 ) THEN @@ -10854,7 +11312,7 @@ SUBROUTINE NUCOND & IF ( cn(mgs) > 0.0 ) THEN cx(mgs,lc) = cx(mgs,lc) + cn(mgs) - ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) + ! ccnc(mgs) = Max(0.0, ccnc(mgs) - cn(mgs)) ! create some small droplets at minimum size (CP 2000), although it adds very little liquid @@ -10873,8 +11331,6 @@ SUBROUTINE NUCOND & ccna(mgs) = ccna(mgs) + cn(mgs) - - ENDIF ! irenuc >= 0 .and. .not. flag_qndrop IF( cx(mgs,lc) .GT. 0. .AND. qx(mgs,lc) .LE. qxmin(lc)) cx(mgs,lc)=0. @@ -10927,7 +11383,11 @@ SUBROUTINE NUCOND & ELSEIF ( imaxsupopt == 4 ) THEN cn(mgs) = Min( Max(ccnc(mgs),cwnccn(mgs)), rho0(mgs)*qvex/Max( cwmasn5, Max(cwmas20,xmas(mgs,lc)) ) ) ENDIF - ccnc(mgs) = Max( 0.0, ccnc(mgs) - cn(mgs) ) + IF ( lccna > 1 ) THEN + ccna(mgs) = ccna(mgs) + cn(mgs) + ELSE + ccnc(mgs) = Max( 0.0, ccnc(mgs) - cn(mgs) ) + ENDIF cx(mgs,lc) = cx(mgs,lc) + cn(mgs) ENDIF @@ -11041,10 +11501,12 @@ SUBROUTINE NUCOND & IF ( ipconc .ge. 2 ) THEN an(igs(mgs),jy,kgs(mgs),lnc) = Max(cx(mgs,lc) , 0.0) IF ( lss > 1 ) an(igs(mgs),jy,kgs(mgs),lss) = Max( 0.0, ssmax(mgs) ) - IF ( lccn .gt. 1 ) THEN - an(igs(mgs),jy,kgs(mgs),lccn) = Max(0.0, ccnc(mgs) ) + IF ( ac_opt == 0 ) THEN + IF ( lccn .gt. 1 .and. lccna .lt. 1 ) THEN + an(igs(mgs),jy,kgs(mgs),lccn) = Max(0.0, ccnc(mgs) ) + ENDIF ENDIF - IF ( lccnuf .gt. 1 ) THEN + IF ( lccnuf .gt. 1 .and. .not. ( lccna .gt. 1 .and. i_uf_or_ccn > 0 ) ) THEN an(igs(mgs),jy,kgs(mgs),lccnuf) = Max(0.0, ccncuf(mgs) ) ENDIF IF ( lccna .gt. 1 ) THEN @@ -11522,20 +11984,25 @@ SUBROUTINE NUCOND & an(ix,jy,kz,lv) = an(ix,jy,kz,lv) + an(ix,jy,kz,lc) an(ix,jy,kz,lc)= 0.0 IF ( ipconc .ge. 2 ) THEN - IF ( lccn .gt. 1 ) THEN - an(ix,jy,kz,lccn) = & - & an(ix,jy,kz,lccn) + Max(0.0,an(ix,jy,kz,lnc)) + IF ( lccn .gt. 1 .or. ac_opt == 1 ) THEN + IF ( irenuc < 5 .and. lccna <= 1 ) THEN + IF ( ac_opt == 0 ) THEN + an(ix,jy,kz,lccn) = an(ix,jy,kz,lccn) + Max(0.0,an(ix,jy,kz,lnc)) + ENDIF + ELSEIF ( lccna > 1 ) THEN + an(ix,jy,kz,lccna) = Max( 0.0, an(ix,jy,kz,lccna) - Max(0.0,an(ix,jy,kz,lnc)) ) + ENDIF ENDIF an(ix,jy,kz,lnc) = 0.0 IF ( lccn > 1 ) an(ix,jy,kz,lccn) = Max( 0.0, an(ix,jy,kz,lccn) ) - IF ( lccna > 0 ) THEN ! apply exponential decay to activated CCN to restore to environmental value + IF ( lccna > 0 .and. ac_opt == 0 ) THEN ! apply exponential decay to activated CCN to restore to environmental value IF ( restoreccn ) THEN tmp = an(ix,jy,kz,li) + an(ix,jy,kz,ls) IF ( an(ix,jy,kz,lccna) > 1. .and. tmp < qxmin(li) ) an(ix,jy,kz,lccna) = an(ix,jy,kz,lccna)*Exp(-dtp/ccntimeconst) ENDIF - ELSEIF ( lccn > 1 .and. restoreccn ) THEN + ELSEIF ( lccn > 1 .and. restoreccn .and. ac_opt == 0 ) THEN ! in this case, we are treating the ccn field as ccna tmp = an(ix,jy,kz,li) + an(ix,jy,kz,ls) ! IF ( ny == 2 .and. ix == nx/2 ) THEN @@ -11599,11 +12066,11 @@ subroutine nssl_2mom_gs & ! & ln,ipc,lvol,lz,lliq, & & cdx, & & xdn0,tmp3d,tkediss & - & ,thproc,numproc,dx1,dy1 & + & ,thproc,numproc,dx1,dy1,ngs & & ,timevtcalc,axtra,io_flag & - & , has_wetscav,rainprod2d, evapprod2d & + & , has_wetscav,rainprod2d, evapprod2d, alpha2d & & ,errmsg,errflg & - & ,elec,its,ids,ide,jds,jde,ngs & + & ,elec,its,ids,ide,jds,jde & & ) @@ -11689,6 +12156,11 @@ subroutine nssl_2mom_gs & real rainprod2d(-nor+1:nx+nor,-norz+ng1:nz+norz) real evapprod2d(-nor+1:nx+nor,-norz+ng1:nz+norz) + + real :: alpha2d(-nor+1:nx+nor,-norz+ng1:nz+norz,3) + + real, parameter :: tfrdry = 243.15 + logical lrescalelow(lc:lhab) real tkediss(-nor+1:nx+nor,-norz+ng1:nz+norz) real axtra(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz,nxtra) @@ -11835,7 +12307,6 @@ subroutine nssl_2mom_gs & ! integer nxmpb,nzmpb,nxz integer jgs,mgs,ngs,numgs -! parameter (ngs=1 ) !500) integer, parameter :: ngsz = 500 integer ntt parameter (ntt=300) @@ -12215,13 +12686,12 @@ subroutine nssl_2mom_gs & real qrcnw(ngs), qwcnr(ngs) real zrcnw(ngs),zracr(ngs),zracw(ngs),zrcev(ngs) - real qracw(ngs) ! qwacr(ngs), real qiacw(ngs) !, qwaci(ngs) real qsacw(ngs) ! ,qwacs(ngs), real qhacw(ngs) ! qwach(ngs), - real :: qhlacw(ngs), qxacwtmp, qxacrtmp ! + real :: qhlacw(ngs), qxacwtmp, qxacrtmp, qxacitmp, qxacstmp ! real vhacw(ngs), vsacw(ngs), vhlacw(ngs), vhlacr(ngs) real qfcev(ngs) @@ -12287,7 +12757,8 @@ subroutine nssl_2mom_gs & real zfmlr(ngs), zfdsv(ngs), zfsbv(ngs), zhlcnf(ngs), zfshr(ngs), zfshrr(ngs) real zhmlrtmp,zhmlr0inf,zhlmlr0inf real zhmlrr(ngs),zhlmlrr(ngs),zhshrr(ngs),zhlshrr(ngs),zfmlrr(ngs) - real zsmlr(ngs), zsmlrr(ngs), zsshr(ngs), zsshrr(ngs) +! real zsmlr(ngs) + real zsmlrr(ngs), zsshr(ngs), zsshrr(ngs) real zhcns(ngs), zhcni(ngs) real zhwdn(ngs), zfwdn(ngs) ! change in Z due to density changes real zhldn(ngs) ! change in Z due to density changes @@ -12664,6 +13135,7 @@ subroutine nssl_2mom_gs & real :: term1,term2,term3,term4 real :: qaacw ! combined qsacw-qhacw for WSM6 variation + real :: cwchtmp real, parameter :: c1r=19.0, c2r=0.6, c3r=1.8, c4r=17.0 ! rain real, parameter :: c1h=5.5, c2h=0.7, c3h=4.5, c4h=8.5 ! Graupel @@ -12993,7 +13465,6 @@ subroutine nssl_2mom_gs & do ix = nxmpb,itile pqs(1) = t00(ix,jy,kz) -! pqs(kz) = t00(ix,jy,kz) theta(1) = an(ix,jy,kz,lt) temg(1) = t0(ix,jy,kz) @@ -13011,22 +13482,8 @@ subroutine nssl_2mom_gs & qss(1) = qvs(1) -! IF ( jy .eq. 1 .and. ix .eq. 24 ) THEN -! write(91,*) 'kz,qv,th: ',kz,an(ix,jy,kz,lv),an(ix,jy,kz,lt),pqs(kz),tabqvs(ltemq),qvs(kz) -! ENDIF - if ( temg(1) .lt. tfr ) then -! if( qcw(kz) .le. qxmin(lc) .and. qci(kz) .gt. qxmin(li)) -! > qss(kz) = qis(kz) -! if( qcw(kz) .gt. qxmin(lc) .and. qci(kz) .gt. qxmin(li)) -! > qss(kz) = (qcw(kz)*qvs(kz) + qci(kz)*qis(kz)) / -! > (qcw(kz) + qci(kz)) - qss(1) = qis(1) - else -! IF ( an(ix,jy,kz,lv) .gt. qss(kz) ) THEN -! write(iunit,*) 'qss exceeded at ',ix,jy,kz,qss(kz),an(ix,jy,kz,lv),temg(kz) -! write(iunit,*) 'other temg = ',theta(kz)*(pinit(kz)+p2(ix,jy,kz)) -! ENDIF + qss(1) = qis(1) end if ! ishail = .false. @@ -13316,7 +13773,6 @@ subroutine nssl_2mom_gs & - ! ! 6th moments ! @@ -13622,20 +14078,54 @@ subroutine nssl_2mom_gs & end do - IF ( ipconc == 5 .and. imydiagalpha > 1 ) THEN + IF ( ipconc == 5 .and. imydiagalpha == 2 ) THEN + cwchtmp = ((3. + dnu(lh))*(2. + dnu(lh))*(1.0 + dnu(lh)))**(-1./3.) + DO mgs = 1,ngscnt !IF ( igs(mgs) == 19 ) write(0,*) 'k,qr,qh,cr,ch = ',kgs(mgs),qx(mgs,lr),cx(mgs,lr),qx(mgs,lh),cx(mgs,lh) IF ( qx(mgs,lr) .gt. qxmin(lr) .and. cx(mgs,lr) > cxmin ) THEN xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(xdn(mgs,lr)*cx(mgs,lr)) ! xdia(mgs,lr,3) = (xv(mgs,lr)*6.0*cwc1)**(1./3.) - alpha(mgs,lr) = Min(alphamax, c1r*tanh(c2r*(xdia(mgs,lr,3)*1000. - c3r)) + c4r) + ! alpha(mgs,lr) = Min(alphamax, c1r*tanh(c2r*(xdia(mgs,lr,3)*1000. - c3r)) + c4r) ! IF ( igs(mgs) == 19 ) write(0,*) 'imy: i,k,alpr,xdia = ',igs(mgs),kgs(mgs),alpha(mgs,lr),xdia(mgs,lr,3)*1000. + + ! M&M-C 2010: + tmp = 4. + alphar + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = 1. + alphar + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = (x/y)**(1./3.)*xdia(mgs,lr,3)*cwchtmp + + alpha(mgs,lr) = Min(15., 11.8*(1000.*tmp - 0.7)**2 + 2.) ENDIF IF ( qx(mgs,lh) .gt. qxmin(lh) .and. cx(mgs,lh) > cxmin ) THEN +! MY 2005: xv(mgs,lh) = rho0(mgs)*qx(mgs,lh)/(xdn(mgs,lh)*cx(mgs,lh)) ! xdia(mgs,lh,3) = (xv(mgs,lh)*6.*piinv)**(1./3.) ! mwfac*xdia(mgs,lh,1) ! (xv(mgs,lh)*cwc0*6.0)**(1./3.) - alpha(mgs,lh) = Min(alphamax, c1h*tanh(c2h*(xdia(mgs,lh,3)*1000. - c3h)) + c4h) +! alpha(mgs,lh) = Min(alphamax, c1h*tanh(c2h*(xdia(mgs,lh,3)*1000. - c3h)) + c4h) + + ! M&M-C 2010: + tmp = 4. + dnu(lh) + i = Int(dgami*(tmp)) + del = tmp - dgam*i + x = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = 1. + dnu(lh) + i = Int(dgami*(tmp)) + del = tmp - dgam*i + y = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami + + tmp = (x/y)**(1./3.)*xdia(mgs,lh,3)*cwchtmp + + alpha(mgs,lh) = Min(15., 11.8*(1000.*tmp - 0.7)**2 + 2.) + ! alphan(mgs,lh) = alpha(mgs,lh) ! IF ( igs(mgs) == 19 ) write(0,*) 'imy: i,k,alph,xdia = ',igs(mgs),kgs(mgs),alpha(mgs,lh),xdia(mgs,lh,3)*1000. il = lh @@ -13731,6 +14221,8 @@ subroutine nssl_2mom_gs & ! CALL cld_cpu('Z-MOMENT-1') + IF ( ipconc >= 6 ) THEN + ! set base g1x in case rain is not 3-moment IF ( ipconc >= 6 .and. imurain == 3 ) THEN il = lr @@ -13825,7 +14317,7 @@ subroutine nssl_2mom_gs & qr = qx(mgs,il) cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*xdn(mgs,lr)**2) ! an(igs(mgs),jgs,kgs(mgs),ln(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > 0.0 ) THEN ! have mass and concentration but no reflectivity, so set reflectivity, using default alpha g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) chw = cx(mgs,il) @@ -13833,7 +14325,7 @@ subroutine nssl_2mom_gs & zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(xdn(mgs,lr)**2*chw) an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! set values according to dBZ of -10, or Z = 0.1 ! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 @@ -13850,7 +14342,6 @@ subroutine nssl_2mom_gs & IF ( zx(mgs,lr) > 0.0 ) THEN xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(1000.*cx(mgs,lr)) vr = xv(mgs,lr) -! z = 36.*(alpha(kz)+2.0)*a(ix,jy,kz,lnr)*vr**2/((alpha(kz)+1.0)*pi**2) qr = qx(mgs,lr) nrx = cx(mgs,lr) z = zx(mgs,lr) @@ -13862,7 +14353,6 @@ subroutine nssl_2mom_gs & IF ( z .gt. 0.0 ) THEN ! alpha(mgs,lr) = 3. alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. -! print*,'kz, alp, alpha(kz) = ',kz,alp,alpha(kz),rd,z,xv DO i = 1,20 IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) @@ -13991,6 +14481,7 @@ subroutine nssl_2mom_gs & ! CALL cld_cpu('Z-MOMENT-1r') ENDIF ! } + ENDIF ! ipconc >= 6 ! Find shape parameters for graupel and hail IF ( ipconc .ge. 6 ) THEN @@ -14073,7 +14564,7 @@ subroutine nssl_2mom_gs & ! cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/z cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(z*(pi*xdn(mgs,il))**2) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > cxmin ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > cxmin ) THEN ! have mass and concentration but no reflectivity, so set reflectivity, using default alpha ! g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & ! & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) @@ -14086,7 +14577,7 @@ subroutine nssl_2mom_gs & zx(mgs,il) = Max(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! set values according to dBZ of -10, or Z = 0.1 ! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 @@ -14740,7 +15231,6 @@ subroutine nssl_2mom_gs & ! eiw(mgs) = 0.0 eii(mgs) = 0.0 - ehsclsn(mgs) = 0.0 ehiclsn(mgs) = 0.0 ehlsclsn(mgs) = 0.0 @@ -14975,7 +15465,7 @@ subroutine nssl_2mom_gs & fac = fac*(ssi(mgs) - 1.0)/0.02 ehsfac(mgs) = (ssi(mgs) - 1.0)/0.02 ENDIF - ELSEIF ( iessopt == 4 ) THEN ! factor based on ice supersat + ELSEIF ( iessopt == 4 ) THEN ! factor based on ice supersat; very roughly based on Hosler et al. 1957 (J. Met.) IF ( ssi(mgs) <= 1.0 ) THEN fac = 0.1 ehsfac(mgs) = 0.1 @@ -15339,6 +15829,7 @@ subroutine nssl_2mom_gs & do mgs = 1,ngscnt qraci(mgs) = 0.0 craci(mgs) = 0.0 + qracs(mgs) = 0.0 IF ( eri(mgs) .gt. 0.0 .and. iacr .ge. 1 .and. xdia(mgs,lr,3) .gt. 2.*rwradmn ) THEN IF ( ipconc .ge. 3 ) THEN @@ -15386,7 +15877,7 @@ subroutine nssl_2mom_gs & ! IF ( ipconc < 3 ) THEN do mgs = 1,ngscnt - qracs(mgs) = 0.0 + qracs(mgs) = 0.0 IF ( ers(mgs) .gt. 0.0 .and. ipconc < 3 ) THEN IF ( lwsm6 .and. ipconc == 0 ) THEN vt = vt2ave(mgs) @@ -16666,7 +17157,7 @@ subroutine nssl_2mom_gs & ! Ziegler (1985) autoconversion ! ! - IF ( ipconc .ge. 2 .and. ircnw /= -1) THEN ! DTD: added flag for autoconversion. If -1, turns off autoconversion + IF ( ipconc .ge. 2 ) THEN if (ndebug .gt. 0 ) write(0,*) 'conc 26a' DO mgs = 1,ngscnt @@ -16749,6 +17240,7 @@ subroutine nssl_2mom_gs & IF ( crcnw(mgs) < 1.e-30 ) qrcnw(mgs) = 0.0 + IF ( ipconc >= 6 ) THEN IF ( lzr > 1 .and. qrcnw(mgs) > 0.0 ) THEN ! vr = rho0(mgs)*qrcnw(mgs)/(1000.*crcnw(mgs)) ! zrcnw(mgs) = 36.*(xnu(lr)+2.0)*crcnw(mgs)*vr**2/((xnu(lr)+1.0)*pi**2) @@ -16788,6 +17280,7 @@ subroutine nssl_2mom_gs & endif ! z = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/((alpha(mgs,lr)+1.0)*pi**2) ENDIF + ENDIF ! ipconc >= 6 ! IF ( crcnw(mgs) .gt. cautn(mgs) .and. crcnw(mgs) .gt. 1.0 ) ! : THEN ! write(0,*) 'crcnw,cautn ',crcnw(mgs)/cautn(mgs), @@ -16998,7 +17491,7 @@ subroutine nssl_2mom_gs & ELSE !{ - IF ( lzr > 1 ) THEN + IF ( ipconc >= 6 .and. lzr > 1 ) THEN ! interpolate along x, i.e., ratio; tmp1 = ziacrratio(i,j) + delx*dqiacrratioinv*(ziacrratio(ip1,j) - ziacrratio(i,j)) tmp2 = ziacrratio(i,jp1) + delx*dqiacrratioinv*(ziacrratio(ip1,jp1) - ziacrratio(i,jp1)) @@ -17016,7 +17509,7 @@ subroutine nssl_2mom_gs & crfrzs(mgs) = crfrz(mgs) qrfrzs(mgs) = qrfrz(mgs) - IF ( lzr > 1 ) THEN + IF ( ipconc >= 6 .and. lzr > 1 ) THEN zrfrzs(mgs) = zrfrz(mgs) zrfrzf(mgs) = 0. ENDIF @@ -17031,7 +17524,7 @@ subroutine nssl_2mom_gs & crfrzf(mgs) = 0.0 qrfrzf(mgs) = 0.0 - IF ( lzr > 1 ) THEN + IF (ipconc >= 6 .and. lzr > 1 ) THEN zrfrzs(mgs) = zrfrz(mgs) zrfrzf(mgs) = 0. ENDIF @@ -17074,7 +17567,7 @@ subroutine nssl_2mom_gs & crfrzs(mgs) = crfrzs(mgs) - crfrzf(mgs) qrfrzs(mgs) = qrfrzs(mgs) - qrfrzf(mgs) - IF ( lzr > 1 ) THEN + IF ( ipconc >= 6 .and. lzr > 1 ) THEN zrfrzs(mgs) = zrfrz(mgs) ! interpolate along x, i.e., ratio; tmp1 = ziacrratio(i,j) + delx*dqiacrratioinv*(ziacrratio(ip1,j) - ziacrratio(i,j)) @@ -17103,7 +17596,7 @@ subroutine nssl_2mom_gs & crfrz(mgs) = fac*crfrz(mgs) crfrzs(mgs) = fac*crfrzs(mgs) crfrzf(mgs) = fac*crfrzf(mgs) - IF ( lzr > 1 ) THEN + IF ( ipconc >= 6 .and. lzr > 1 ) THEN zrfrz(mgs) = fac*zrfrz(mgs) zrfrzf(mgs) = fac*zrfrzf(mgs) ENDIF @@ -17651,7 +18144,7 @@ subroutine nssl_2mom_gs & x = 1. + alpha(mgs,lr) - IF ( lzr > 1 ) THEN ! 3 moment + IF ( ipconc >= 6 .and. lzr > 1 ) THEN ! 3 moment tmp = 1. + alpr ! alpha(mgs,lr) i = Int(dgami*(tmp)) del = tmp - dgam*i @@ -17676,6 +18169,7 @@ subroutine nssl_2mom_gs & & 0.308*fvent(mgs)*y* & & Sqrt(ax(lr)*rhovt(mgs))*(vent1/vent2) + rwventz(mgs) = 0.0 ! rwventz(mgs) = & ! & 0.78*x + & @@ -17694,6 +18188,7 @@ subroutine nssl_2mom_gs & & *(xdia(mgs,lr,1)**((1.0+br)/2.0)) ) + IF ( ipconc >= 7 ) THEN alpr = Min(alpharmax,alpha(mgs,lr) ) tmp = alpr + 5.5 + br/2. @@ -17708,7 +18203,7 @@ subroutine nssl_2mom_gs & & 0.308*fvent(mgs)* & & Sqrt(ax(lr)*rhovt(mgs))*(y/gf1palp(mgs))*(xdia(mgs,lr,1)**((1.0+br)/2.0)) - + ENDIF ENDIF ! iferwisventr @@ -17752,6 +18247,9 @@ subroutine nssl_2mom_gs & hwventa = (0.78)*gmoi(igmhwa) hwventb = (0.308)*gmoi(igmhwb) ! hwventc = (4.0*gr/(3.0*cdx(lh)))**(0.25) + hwvent(:) = 0.0 + hwventy(:) = 0.0 + do mgs = 1,ngscnt IF ( qx(mgs,lh) .gt. qxmin(lh) ) THEN hwventc = (4.0*gr/(3.0*cdxgs(mgs,lh)))**(0.25) @@ -17909,7 +18407,7 @@ subroutine nssl_2mom_gs & vffzf(:) = 0.0 vhlfzhl(:) = 0.0 qsfzs(:) = 0.0 - zsmlr(:) = 0.0 +! zsmlr(:) = 0.0 zhmlr(:) = 0.0 zhmlrr(:) = 0.0 zsmlrr(:) = 0.0 @@ -18110,20 +18608,8 @@ subroutine nssl_2mom_gs & ! ENDIF - - IF ( lzr .gt. 1 .and. qx(mgs,ls) > qxmin(ls) ) THEN - tmp = qx(mgs,ls)/cx(mgs,ls) -! alp = Max( -0.8, alpha(mgs,lh) ) - alp = xnu(ls) - g1 = 36.*(alp+2.0)/((alp+1.0)*pi**2) - - zsmlr(mgs) = g1*(rho0(mgs)/(xdn(mgs,ls)))**2*( tmp * qsmlr(mgs) ) -! zhmlr(mgs) = (xdn0(lr)/(xdn(mgs,lh)))**2*( zx(mgs,lh) * qhmlr(mgs) ) - - ENDIF - IF ( chmlr(mgs) < 0.0 .and. (ibinhmlr < 1 .or. lzh < 1) ) THEN ! { already done if ibinhmlr > 0 - IF ( lzr .gt. 1 .and. lzh < 1 .and. qx(mgs,lh) > qxmin(lh) ) THEN ! Only compute if rain is 3-moment but graupel is not, otherwise is computed later + IF ( ipconc >= 6 .and. lzr .gt. 1 .and. lzh < 1 .and. qx(mgs,lh) > qxmin(lh) ) THEN ! Only compute if rain is 3-moment but graupel is not, otherwise is computed later tmp = qx(mgs,lh)/cx(mgs,lh) alp = alpha(mgs,lh) g1 = g1x(mgs,lh) ! (6.0 + alp)*(5.0 + alp)*(4.0 + alp)/((3.0 + alp)*(2.0 + alp)*(1.0 + alp)) @@ -18236,7 +18722,7 @@ subroutine nssl_2mom_gs & ENDIF !} - IF ( lzhl .gt. 1 .and. ibinhlmlr <= 0 ) THEN + IF ( ipconc >= 8 .and. lzhl .gt. 1 .and. ibinhlmlr <= 0 ) THEN IF ( cx(mgs,lhl) > 0.0 ) THEN tmp = qx(mgs,lhl)/cx(mgs,lhl) @@ -18575,6 +19061,9 @@ subroutine nssl_2mom_gs & qsdpv(mgs) = 0.0 ENDIF + qhsbv(mgs) = 0.0 + qhdpv(mgs) = 0.0 + IF ( qx(mgs,lh) > qxmin(lh) ) THEN IF ( temg(mgs) < tfr .or. .not. qhmlr(mgs) < 0.0 ) THEN ! no liquid from melting, so evaporation is greater. Thus can calculate sublimation rate qhsbv(mgs) = max( min(qhdsv(mgs), 0.0), -qhmxd(mgs) ) @@ -18587,12 +19076,14 @@ subroutine nssl_2mom_gs & ! & evapfac*min( & ! & fmlt1e(mgs)*cx(mgs,lh)*hwvent(mgs)*xdia(mgs,lh,1), 0.0 ) - qhcev(mgs) = evapfac* & - & 2.0*pi*(qx(mgs,lv)-qss0(mgs))*cx(mgs,lh)*xdia(mgs,lh,1)*hwvent(mgs)/(qss0(mgs)*(fav(mgs)+fbv(mgs))) + qhcev(mgs) = evapfac*2.0*pi*(qx(mgs,lv)-qss0(mgs))* & + & cx(mgs,lh)*xdia(mgs,lh,1)*hwvent(mgs)/(qss0(mgs)*(fav(mgs)+fbv(mgs))) - qhcev(mgs) = max(qhcev(mgs), -qhmxd(mgs)) + qhcev(mgs) = max(qhcev(mgs), -qhmxd(mgs)) + IF ( temg(mgs) > tfr ) qhcev(mgs) = Min(0.0, qhcev(mgs) ) ENDIF + ENDIF qhlsbv(mgs) = 0.0 @@ -18605,10 +19096,11 @@ subroutine nssl_2mom_gs & ENDIF IF ( qhlmlr(mgs) < 0.0 .and. .not. mixedphase ) THEN ! Liquid is forming, so find the evaporation that was subtracted from melting (if it is not condensing) - qhlcev(mgs) = evapfac* & - & 2.0*pi*(qx(mgs,lv)-qss0(mgs))*cx(mgs,lhl)*xdia(mgs,lhl,1)*hlvent(mgs)/(qss0(mgs)*(fav(mgs)+fbv(mgs))) + qhlcev(mgs) = evapfac*2.0*pi*(qx(mgs,lv)-qss0(mgs))* & + & cx(mgs,lhl)*xdia(mgs,lhl,1)*hlvent(mgs)/(qss0(mgs)*(fav(mgs)+fbv(mgs))) qhlcev(mgs) = max(qhlcev(mgs), -qhlmxd(mgs)) + IF ( temg(mgs) > tfr ) qhlcev(mgs) = Min(0.0, qhlcev(mgs) ) ENDIF ENDIF @@ -18777,7 +19269,7 @@ subroutine nssl_2mom_gs & ! do mgs = 1,ngscnt - IF ( temg(mgs) < tfr ) THEN + IF ( tfrdry < temg(mgs) .and. temg(mgs) < tfr ) THEN ! ! qswet(mgs) = ! > ( xdia(mgs,ls,1)*swvent(mgs)*cx(mgs,ls)*fwet1(mgs) @@ -18815,7 +19307,6 @@ subroutine nssl_2mom_gs & qhwet(mgs) = qhdry(mgs) qhlwet(mgs) = qhldry(mgs) - ENDIF ! ! qhlwet(mgs) = qhldry(mgs) @@ -19222,14 +19713,22 @@ subroutine nssl_2mom_gs & ELSE IF (((qhacw(mgs) + qhacr(mgs))*dtp > qxmin(lh) .and. qx(mgs,lh) > hlcnhqmin .and. temg(mgs) .le. tfr-2.0 & .and. temg(mgs) .gt. dwtempmin ) .or. ( wetgrowth(mgs) .and. qx(mgs,lh) > hlcnhqmin ) ) THEN - dw = 0.01*( Exp( -temcg(mgs)/( 1.1e4 * rho0(mgs)*ehw(mgs)*qx(mgs,lc) - 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 ) ) - 1.0 ) - dwr = 0.01*( Exp( -temcg(mgs)/( 1.1e4 * rho0(mgs)*(ehw(mgs)*qx(mgs,lc)+ehr(mgs)*qx(mgs,lr)) - & - 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 ) ) - 1.0 ) +! dw = 0.01*( Exp( -temcg(mgs)/( 1.1e4 * rho0(mgs)*ehw(mgs)*qx(mgs,lc) - 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 ) ) - 1.0 ) +! dwr = 0.01*( Exp( -temcg(mgs)/( 1.1e4 * rho0(mgs)*(ehw(mgs)*qx(mgs,lc)+ehr(mgs)*qx(mgs,lr)) - & +! 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 ) ) - 1.0 ) + x = 1.1e4 * rho0(mgs)*(ehw(mgs)*qx(mgs,lc)+ehr(mgs)*qx(mgs,lr)) - & + 1.3e3*rho0(mgs)*qx(mgs,li) + 1.0 + IF ( x > 1.e-20 ) THEN + arg = Min(70.0, (-temcg(mgs)/x )) ! prevent overflow of the exp function in 32 bit + dwr = 0.01*(exp(arg) - 1.0) + ELSE + dwr = 1.e30 + ENDIF d = dwr - IF ( dwr < 0.2 .and. dwr > 0.0 ) THEN + IF ( dwr < 0.2 .and. dwr > 0.0 .and. rho0(mgs)*(qx(mgs,lc)+qx(mgs,lr)) > 1.e-4 ) THEN + sqrtrhovt = Sqrt( rhovt(mgs) ) fventh = sqrtrhovt*(fpndl(mgs)**(1./3.)) * (fakvisc(mgs))**(-0.5) fventm = sqrtrhovt*(fschm(mgs)**(1./3.)) * (fakvisc(mgs))**(-0.5) - sqrtrhovt = Sqrt( rhovt(mgs) ) ltemq = (tfr-163.15)/fqsat+1.5 qvs0 = pqs(mgs)*tabqvs(ltemq) denomdp = felf(mgs) + fcw(mgs)*temcg(mgs) @@ -19242,6 +19741,7 @@ subroutine nssl_2mom_gs & h4 = ehr(mgs)* qx(mgs,lr) ! iterate to find minimum diameter for wet growth. Start with value of dwr DO n = 1,10 + d = Max(d, 1.e-4) dold = d vth = axx(mgs,lh)*d**bxx(mgs,lh) x2 = fventh*sqrtrhovt*Sqrt(d*vth) @@ -19266,32 +19766,26 @@ subroutine nssl_2mom_gs & ELSE - d = 8.*ah*h1*dtpinv/ & + ! Based on Farley and Orville (1986), eq. 5-9 but neglecting the Ci*(T0-Ts) term in (8) since we want Ts=T0 + ! Simplified mass rates as dm_w/dt = pi/4*d**2*(Vh - Vc)*rhoair*qc*ehw, etc. + d = 8.*ah*h1/ & ( ( Max(0.001,vth - vtxbar(mgs,lc,1))*h3 + & Max(0.001,vth - vtxbar(mgs,lr,1))*h4) *rho0(mgs)*denomdp + & Max(0.001,vth - vtxbar(mgs,li,1))*h2) + ENDIF -! write(0,*) 'iter,d,dwr = ',n,d,dwr -! write(91,*) 'parts = ',( -ah*ftka*temcg - ah*felv*fwvdf*dn(i,j,k)*(qvamb - qvs0) ),( Max(0.001,vth - 0.01*vwmw)*ehw* qcmks*dn(i,j,k)/denominv + Max(0.001,vth - 0.01*vimw)*ehi*qimks*dn(i,j,k)*fci*temcg) -!! write(91,*) 'partsr = ',( -ah*ftka*temcg - ah*felv*fwvdf*dn(i,j,k)*(qvamb - qvs0) ),( ( Max(0.001,vth - 0.01*vwmw)*ehw* qcmks + Max(0.001,vth - 0.01*vrmw)*ehr* qrmks) *dn(i,j,k)/denominv + & -!! Max(0.001,vth - 0.01*vimw)*ehi*qimks*dn(i,j,k)*fci*temcg) -! write(91,*) 'parts2 = ',vth - IF ( Abs(dold - d)/dold < 0.05 .or. ( n > 3 .and. d > dg0thresh ) ) EXIT ENDDO ENDIF - dg0(mgs) = Max( d, dwmin ) -! IF ( .false. .and. ny == 2 .and. dwr < 0.5 .and. dwr > 0. ) THEN -! write(0,*) 'i,k,dg0 = ',igs(mgs), kgs(mgs), dg0(mgs) -! write(0,*) 'h1,h2,h3,h4 = ',h1,h2,h3,h4 -! write(0,*) 'dw,dwr = ',dw,dwr -! write(0,*) 'wetgrowth = ',wetgrowth(mgs) -! write(0,*) 'temc,Dh, Dhl = ',temcg(mgs),xdia(mgs,lh,3),xdia(mgs,lhl,3) -! ENDIF + dg0(mgs) = Min( dwmax, Max( d, dwmin ) ) ELSE - dg0(mgs) = dg0thresh + 0.0001 + IF ( qx(mgs,lh) > qxmin(lh) .and. qx(mgs,lh) > hlcnhqmin .and. temg(mgs) .le. tfr-2.0 ) THEN + dg0(mgs) = dwmax + ELSE + dg0(mgs) = dg0thresh + 0.0001 + ENDIF ENDIF IF ( ihlcnh == 3 .and. (qhacw(mgs) + qhacr(mgs))*dtp > qxmin(lh) .and. qx(mgs,lh) > hlcnhqmin & @@ -19301,10 +19795,6 @@ subroutine nssl_2mom_gs & ENDIF ENDIF -! write(0,*) 'notwet growth graupel,hail,Dw,Dwr = ',wetgrowth(mgs) , wetgrowthhl(mgs), dh0 ,tmp,tmp1 -! write(0,*) 'temc,Dh, Dhl = ',temcg(mgs),xdia(mgs,lh,3),xdia(mgs,lhl,3) -! write(0,*) 'qc,qi = ', qx(mgs,lc) , qx(mgs,li) - wtest = (dg0(mgs) > 0.0 .and. dg0(mgs) < dg0thresh ) @@ -19339,18 +19829,6 @@ subroutine nssl_2mom_gs & tmp = qhacw(mgs) + qhacr(mgs) + qhaci(mgs) + qhacs(mgs) ! qtmp = Min( 1.0, xdia(mgs,lh,3)/(2.0*dh0) )*(tmp) qtmp = Min( 100.0, xdia(mgs,lh,3)/(2.0*dh0) )*(tmp) -! IF ( .false. .and. qx(mgs,lhl) + qtmp*dtp .lt. 0.5e-3 ) THEN -! hdia1 = Max(dh0, xdia(mgs,lh,3) ) -! qtmp = qtmp + Min(qxmxd(mgs,lh), Max( 0.0, & -! & ((pi*xdn(mgs,lh)*cx(mgs,lh)) / (6.0*rho0(mgs)*dtp)) & -! & *exp(-hdia1/xdia(mgs,lh,1)) & -! & *( (hdia1**3) + 3.0*(hdia1**2)*xdia(mgs,lh,1) & -! & + 6.0*(hdia1)*(xdia(mgs,lh,1)**2) + 6.0*(xdia(mgs,lh,1)**3) ) ) ) - -! ENDIF - -! qhlcnh(mgs) = Min( 0.5*(qx(mgs,lh))+tmp, xdia(mgs,lh,3)/(2.0*dh0)*(tmp) ) -! qhlcnh(mgs) = Min( qxmxd(mgs,lh), xdia(mgs,lh,3)/(2.0*dh0)*(tmp) ) qhlcnh(mgs) = Min( qxmxd(mgs,lh), qtmp ) IF ( ipconc .ge. 5 ) THEN !{ @@ -19360,8 +19838,6 @@ subroutine nssl_2mom_gs & chlcnhhl(mgs) = Min( cxmxd(mgs,lh), rho0(mgs)*qhlcnh(mgs)/(pi*xdn(mgs,lh)*dh0**3/6.0) ) r = rho0(mgs)*qhlcnh(mgs)/(xdn(mgs,lh)*xv(mgs,lh)) ! number of graupel particles at mean volume diameter -! chlcnh(mgs) = Min( Max( 1./8.*r , chlcnh(mgs)), r ) -! chlcnh(mgs) = Min( chlcnh(mgs), r ) chlcnh(mgs) = Max( chlcnhhl(mgs), r ) ENDIF !} @@ -19395,11 +19871,10 @@ subroutine nssl_2mom_gs & qxd1 = qx(mgs,lh)*(tmp2) qhlcnh(mgs) = dtpinv*qxd1 flim = 1.0 -! tmp3 = Min( dtp*(qfacw(mgs) + qfacr(mgs) ), qxmxd(mgs,lf) ) tmp3 = qxmxd(mgs,lh) IF (qxd1 > tmp3 ) THEN - flim = tmp3/(qxd1) - qhlcnh(mgs) = flim*qhlcnh(mgs) +! flim = tmp3/(qxd1) +! qhlcnh(mgs) = flim*qhlcnh(mgs) ENDIF @@ -19416,10 +19891,10 @@ subroutine nssl_2mom_gs & chlcnhhl(mgs) = chlcnh(mgs) IF ( qx(mgs,lhl) > qxmin(lhl) .and. dmhlopt > 0 ) THEN - dh0 = rho0(mgs)*qhlcnh(mgs)/chlcnhhl(mgs) - IF ( dh0 < xmas(mgs,lhl) ) THEN + tmp = rho0(mgs)*qhlcnh(mgs)/chlcnhhl(mgs) + IF ( tmp < xmas(mgs,lhl) ) THEN ! dh0 = ( qxd1*dh0 + qx(mgs,lhl)*xmas(mgs,lhl))/( qxd1 + qx(mgs,lhl)) ! weighted average - dh0 = (( qxd1*dh0**(1./3.) + qx(mgs,lhl)*xmas(mgs,lhl)**(1./3.))/( qxd1 + qx(mgs,lhl)))**3 ! weighted average + dh0 = (( qxd1*tmp**(1./3.) + qx(mgs,lhl)*xmas(mgs,lhl)**(1./3.))/( qxd1 + qx(mgs,lhl)))**3 ! weighted average chlcnhhl(mgs) = Min( chlcnhhl(mgs), rho0(mgs)*qhlcnh(mgs)/dh0 ) ELSE ! dh0 = Max( dh0, xmas(mgs,lhl) ) ! when enough hail is established, do not dilute the size @@ -19428,7 +19903,7 @@ subroutine nssl_2mom_gs & ! reflectivity - IF ( lzh > 1 .and. lzhl > 1 ) THEN + IF ( ipconc >= 6 .and. lzh > 1 .and. lzhl > 1 ) THEN tmp3 = gaminterp(ratio,alpha(mgs,lh),11,1) zxd1 = flim*zx(mgs,lh)*(tmp3) zhlcnh(mgs) = dtpinv*zxd1 @@ -19440,17 +19915,6 @@ subroutine nssl_2mom_gs & qhlcnh(mgs) = 0.0 ENDIF -! IF ( cxd1 < 0.0 .or. qxd1 < 0.0 ) THEN -! write(0,*) 'cxd1,qxd1 = ',cxd1,qxd1 -! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio -! ENDIF - -! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio -! write(0,*) 'qhlcnh,qh = ',qhlcnh(mgs),qx(mgs,lh),qxd1 -! write(0,*) 'chlcnh,ch = ',chlcnh(mgs),cx(mgs,lh),cxd1 -! write(0,*) 'zhlcnh,zh = ',zhlcnh(mgs),zx(mgs,lh),zxd1 -! write(0,*) 'tmp1,2,3 = ',tmp,tmp2,tmp3 - vhlcnh(mgs) = rho0(mgs)*qhlcnh(mgs)/xdn(mgs,lh) vhlcnhl(mgs) = rho0(mgs)*qhlcnh(mgs)/Max(xdnmn(lhl), xdn(mgs,lh)) @@ -19494,17 +19958,6 @@ subroutine nssl_2mom_gs & ELSE zxd1 = 0 ENDIF -! IF ( cxd1 < 0.0 .or. qxd1 < 0.0 ) THEN -! write(0,*) 'cxd1,qxd1 = ',cxd1,qxd1 -! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio -! ENDIF - -! write(0,*) 'dw,temcg = ',dw,temcg(mgs),ratio -! write(0,*) 'qhlcnh,qh = ',qhlcnh(mgs),qx(mgs,lh),qxd1 -! write(0,*) 'chlcnh,ch = ',chlcnh(mgs),cx(mgs,lh),cxd1 -! write(0,*) 'zhlcnh,zh = ',zhlcnh(mgs),zx(mgs,lh),zxd1 -! write(0,*) 'tmp1,2,3 = ',tmp,tmp2,tmp3 - vhlcnh(mgs) = rho0(mgs)*qhlcnh(mgs)/xdn(mgs,lh) vhlcnhl(mgs) = rho0(mgs)*qhlcnh(mgs)/Max(xdnmn(lhl), xdn(mgs,lh)) @@ -20765,6 +21218,14 @@ subroutine nssl_2mom_gs & pqlwlghld(:) = 0.0 pqlwhli(:) = 0.0 pqlwhld(:) = 0.0 + IF ( ipconc > 5 ) THEN + pzhwi(:) = 0.0 + pzhwd(:) = 0.0 + pzrwi(:) = 0.0 + pzrwd(:) = 0.0 + pzhli(:) = 0.0 + pzhld(:) = 0.0 + ENDIF ! @@ -21337,8 +21798,8 @@ subroutine nssl_2mom_gs & ! zhshr(mgs) = (xdn0(lr)/(xdn(mgs,lh)))**2*( zx(mgs,lh) * qhshr(mgs) ) - qtmp = qhdpv(mgs) + qhcev(mgs) - ctmp = chdpv(mgs) + chcev(mgs) + qtmp = qhdpv(mgs) + qhcev(mgs) + qhsbv(mgs) + ctmp = chdpv(mgs) + chcev(mgs) + chsbv(mgs) zhdsv(mgs) = g1*(6.*rho0(mgs)/(pi*xdn(mgs,lh)))**2*( 2.*( tmp ) * qtmp - tmp**2 * ctmp ) @@ -21484,7 +21945,6 @@ subroutine nssl_2mom_gs & pzhwd(mgs) = 0.0 & & + (1-il5(mgs))*zhmlr(mgs) & & + zhshr(mgs) & -! > + il5(mgs)*chsbv(mgs) & & + Min( 0.0, zhdsv(mgs) ) & & - il5(mgs)*zhlcnh(mgs) @@ -21674,7 +22134,7 @@ subroutine nssl_2mom_gs & zrachl(mgs) = 0.0 zsshr(mgs) = 0.0 zsshrr(mgs) = 0.0 - zsmlr(mgs) = 0.0 +! zsmlr(mgs) = 0.0 zsmlrr(mgs) = 0.0 IF ( qx(mgs,ls) .gt. qxmin(ls) .and. ( csmlr(mgs) /= 0.0 .or. csshr(mgs) /= 0.0 .or. & @@ -21682,8 +22142,8 @@ subroutine nssl_2mom_gs & tmp = qx(mgs,ls)/cx(mgs,ls) g1 = 36.*(xnu(ls)+2.0)/((xnu(ls)+1.0)*pi**2) IF ( .not. mixedphase ) THEN - zsmlr(mgs) = (xdn(mgs,ls)/xdn(mgs,lr))**2*g1*(rho0(mgs)/(xdn(mgs,ls)))**2* & - & ( 2.*tmp * qsmlr(mgs) - tmp**2 * csmlr(mgs) ) +! zsmlr(mgs) = (xdn(mgs,ls)/xdn(mgs,lr))**2*g1*(rho0(mgs)/(xdn(mgs,ls)))**2* & +! & ( 2.*tmp * qsmlr(mgs) - tmp**2 * csmlr(mgs) ) IF ( csmlrr(mgs) /= 0.0 ) THEN z1 = g1smlr*(6.*rho0(mgs)/(pi*xdn(mgs,lr)))**2*( qsmlr(mgs)**2/ csmlrr(mgs) ) @@ -22534,7 +22994,6 @@ subroutine nssl_2mom_gs & end do end if - IF ( has_wetscav ) THEN DO mgs = 1,ngscnt evapprod2d(igs(mgs),kgs(mgs)) = -(qrcev(mgs) + qssbv(mgs) + qhsbv(mgs) + qhlsbv(mgs)) @@ -22776,41 +23235,9 @@ subroutine nssl_2mom_gs & tqvcon = temg(mgs)-cbw ltemq = (temg(mgs)-163.15)/fqsat+1.5 ltemq = Min( nqsat, Max(1,ltemq) ) -! IF ( ltemq .lt. 1 .or. ltemq .gt. nqsat ) THEN -! C$PAR CRITICAL SECTION -! write(iunit,*) 'out of range ltemq!',temgtmp,temg(mgs), -! : thetap(mgs),theta0(mgs),pres(mgs),theta(mgs), -! : ltemq,igs(mgs),jy,kgs(mgs) -! write(iunit,*) an(igs(mgs),jy,kgs(mgs),lt), -! : ab(igs(mgs),jy,kgs(mgs),lt), -! : t0(igs(mgs),jy,kgs(mgs)) -! write(iunit,*) fcc3(mgs),qx(mgs,lc),qitmp(mgs),dtp,ptem(mgs) -! STOP -! C$PAR END CRITICAL SECTION -! END IF + qvs(mgs) = pqs(mgs)*tabqvs(ltemq) qis(mgs) = pqs(mgs)*tabqis(ltemq) -! qss(kz) = qvs(kz) -! if ( temg(kz) .lt. tfr ) then -! if( qcw(kz) .le. qxmin(lc) .and. qci(kz) .gt. qxmin(li)) -! > qss(kz) = qis(kz) -! if( qcw(kz) .gt. qxmin(lc) .and. qci(kz) .gt. qxmin(li)) -! > qss(kz) = (qcw(kz)*qvs(kz) + qci(kz)*qis(kz)) / -! > (qcw(kz) + qci(kz)) -! qss(kz) = qis(kz) -! end if -! dont get enough condensation with qcw .le./.gt. qxmin(lc) -! if ( temg(mgs) .lt. tfr ) then -! if( qx(mgs,lc) .ge. 0.0 .and. qitmp(mgs) .le. qxmin(li) ) -! > qss(mgs) = qvs(mgs) -! if( qx(mgs,lc) .eq. 0.0 .and. qitmp(mgs) .gt. qxmin(li)) -! > qss(mgs) = qis(mgs) -! if( qx(mgs,lc) .gt. 0.0 .and. qitmp(mgs) .gt. qxmin(li)) -! > qss(mgs) = (qx(mgs,lc)*qvs(mgs) + qitmp(mgs)*qis(mgs)) / -! > (qx(mgs,lc) + qitmp(mgs)) -! else -! qss(mgs) = qvs(mgs) -! end if qss(mgs) = qvs(mgs) if ( temg(mgs) .lt. tfr ) then if( qx(mgs,lc) .ge. 0.0 .and. qitmp(mgs) .le. qxmin(li) ) & @@ -23049,7 +23476,6 @@ subroutine nssl_2mom_gs & - if (ndebug .gt. 0 ) write(0,*) 'gs 11' do mgs = 1,ngscnt @@ -23212,7 +23638,7 @@ subroutine nssl_2mom_gs & qr = qx(mgs,il) cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(z*xdn(mgs,lr)**2) ! an(igs(mgs),jgs,kgs(mgs),ln(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > 0.0 ) THEN ! have mass and concentration but no reflectivity, so set reflectivity, using default alpha g1 = 36.*(alpha(mgs,lr)+2.0)/((alpha(mgs,lr)+1.0)*pi**2) chw = cx(mgs,il) @@ -23220,7 +23646,7 @@ subroutine nssl_2mom_gs & zx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(qr)*qr/(xdn(mgs,lr)**2*chw) an(igs(mgs),jgs,kgs(mgs),lz(lr)) = zx(mgs,lr) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! set values according to dBZ of -10, or Z = 0.1 ! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 @@ -23237,7 +23663,6 @@ subroutine nssl_2mom_gs & IF ( zx(mgs,lr) > 0.0 ) THEN xv(mgs,lr) = rho0(mgs)*qx(mgs,lr)/(1000.*cx(mgs,lr)) vr = xv(mgs,lr) -! z = 36.*(alpha(kz)+2.0)*a(ix,jy,kz,lnr)*vr**2/((alpha(kz)+1.0)*pi**2) qr = qx(mgs,lr) nrx = cx(mgs,lr) z = zx(mgs,lr) @@ -23247,9 +23672,7 @@ subroutine nssl_2mom_gs & ! determine shape parameter alpha by iteration IF ( z .gt. 0.0 ) THEN -! alpha(mgs,lr) = 3. alp = 36.*(alpha(mgs,lr)+2.0)*nrx*vr**2/(z*pi**2) - 1. -! write(0,*) 'kz, alp, alpha(kz) = ',kz,alp,alpha(kz),rd,z,xv DO i = 1,20 IF ( Abs(alp - alpha(mgs,lr)) .lt. 0.01 ) EXIT alpha(mgs,lr) = Max( rnumin, Min( rnumax, alp ) ) @@ -23425,7 +23848,7 @@ subroutine nssl_2mom_gs & cx(mgs,il) = g1*dn(igs(mgs),jy,kgs(mgs))**2*(6.*qr)**2/(z*(pi*xdn(mgs,il))**2) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) > 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) > 0.0 ) THEN ! have mass and concentration but no reflectivity, so set reflectivity, using default alpha ! g1 = (6.0 + alpha(mgs,il))*(5.0 + alpha(mgs,il))*(4.0 + alpha(mgs,il))/ & ! & ((3.0 + alpha(mgs,il))*(2.0 + alpha(mgs,il))*(1.0 + alpha(mgs,il))) @@ -23438,7 +23861,7 @@ subroutine nssl_2mom_gs & zx(mgs,il) = Max(zxmin*1.1, g1*dn(igs(mgs),jy,kgs(mgs))**2*(6*qr)**2/(chw*(pi*xdn(mgs,il))**2) ) an(igs(mgs),jgs,kgs(mgs),lz(il)) = zx(mgs,il) - ELSEIF ( zx(mgs,il) <= 0.0 .and. cx(mgs,il) <= 0.0 ) THEN + ELSEIF ( zx(mgs,il) <= zxmin .and. cx(mgs,il) <= 0.0 ) THEN ! How did this happen? ! set values according to dBZ of -10, or Z = 0.1 ! 0.1 = 1.e18*0.224*an(ix,jy,kz,lzh)*(hwdn/rwdn)**2 @@ -23580,6 +24003,16 @@ subroutine nssl_2mom_gs & ENDIF !} + IF ( lzr > 1 ) THEN + alpha2d(igs(mgs),kgs(mgs),1) = Max(alphamin, Min(alphamax, alpha(mgs,lr) )) + ENDIF + IF ( lzh > 1 ) THEN + alpha2d(igs(mgs),kgs(mgs),2) = Max(alphamin, Min(alphamax, alpha(mgs,lh) )) + ENDIF + IF ( lzhl > 1 ) THEN + alpha2d(igs(mgs),kgs(mgs),3) = Max(alphamin, Min(alphamax, alpha(mgs,lhl) )) + ENDIF + IF ( il == lhl .and. lnhlf > 1 ) THEN ! update chxf in case cx has changed chxf(mgs,lhl) = frac*cx(mgs,lhl) @@ -23608,7 +24041,7 @@ subroutine nssl_2mom_gs & ENDIF ! } } - + ENDIF ! }} ENDIF ! } From 0cb137e1822f076e98a468edc8a386fc280c225a Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Sun, 24 Sep 2023 15:49:28 -0500 Subject: [PATCH 55/81] Update NSSL documentation and references for 3-moment option --- physics/docs/library.bib | 17 +++++++++++------ physics/docs/pdftxt/NSSLMICRO.txt | 4 ++-- physics/docs/pdftxt/suite_input.nml.txt | 3 ++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/physics/docs/library.bib b/physics/docs/library.bib index 34bb54e8f..4260fc3c2 100644 --- a/physics/docs/library.bib +++ b/physics/docs/library.bib @@ -3760,8 +3760,6 @@ @inproceedings{yudin_et_al_2019 @article{mansell_2013, author = {Edward R. Mansell and Conrad L. Ziegler}, - date-added = {2015-02-26 22:32:59 +0000}, - date-modified = {2020-02-10 23:06:41 +0000}, doi = {10.1175/JAS-D-12-0264.1}, journal = {Journal of the Atmospheric Sciences}, keywords = {storm electrification, microphysics 2-moment}, @@ -3774,8 +3772,6 @@ @article{mansell_2013 @article{mansell_2010, author = {Edward R. Mansell}, - date-added = {2011-02-22 10:34:11 -0600}, - date-modified = {2011-02-22 10:35:34 -0600}, doi = {10.1175/2010JAS3341.1}, journal = {Journal of the Atmospheric Sciences}, keywords = {advection, microphysics 2-moment}, @@ -3787,8 +3783,6 @@ @article{mansell_2010 @article{mansell_etal_2010, author = {E. R. Mansell and C. L. Ziegler and E. C. Bruning}, - date-added = {2007-08-20 15:44:13 -0500}, - date-modified = {2010-04-13 16:55:16 -0500}, doi = {10.1175/2009JAS2965.1}, journal = {Journal of the Atmospheric Sciences}, keywords = {storm electrification, microphysics 2-moment}, @@ -3798,6 +3792,17 @@ @article{mansell_etal_2010 year = {2010}, bdsk-url-1 = {https://doi.org/10.1175/2009JAS2965.1}} +@article{mansell:2020, + Author = {Edward R. Mansell and Dawson, II, Daniel T. and Jerry M. Straka}, + Doi = {10.1175/JAS-D-19-0268.1}, + Journal = jas, + Keywords = {microphysics 3-moment}, + Pages = {3361-3385}, + Title = {Bin-emulating Hail Melting in 3-moment bulk microphysics}, + Volume = {77}, + Year = {2020}, + Bdsk-Url-1 = {https://dx.doi.org/10.1175/JAS-D-12-0264.1}, + @inproceedings{yudin_et_al_2020, author = {Yudin, V. A. and Yang, F. and Karol, S. I. and Fuller-Rowell T. J. and Kubaryk, A. and Juang, H. and Kar, S. and Alpert, J. C. and Li, Z.}, booktitle = {1st UFS Users' Workshop}, diff --git a/physics/docs/pdftxt/NSSLMICRO.txt b/physics/docs/pdftxt/NSSLMICRO.txt index 3d35c9fd2..44d1f069b 100644 --- a/physics/docs/pdftxt/NSSLMICRO.txt +++ b/physics/docs/pdftxt/NSSLMICRO.txt @@ -2,7 +2,7 @@ \page NSSLMICRO_page NSSL 2-moment Cloud Microphysics Scheme \section nssl2m_descrp Description -The NSSL two-moment bulk microphysical parameterization scheme that describes form and phase changes among a range of liquid and ice hydrometeors, as described in Mansell et al. (2010) \cite Mansell_etal_2010 and Mansell and Ziegler (2013) \cite Mansell_2013. The microphysical parameterization predicts the mass mixing ratio and number concentration of cloud droplets, raindrops, cloud ice crystals (columns), snow particles (including large crystals and aggregates), graupel, and (optionally) hail. +The NSSL 2/3-moment bulk microphysical parameterization scheme that describes form and phase changes among a range of liquid and ice hydrometeors, as described in Mansell et al. (2010) \cite Mansell_etal_2010, Mansell and Ziegler (2013) \cite Mansell_2013, and Mansell et al. (2020) \cite Mansell_etal_2020. The microphysical parameterization predicts the mass mixing ratio and number concentration of cloud droplets, raindrops, cloud ice crystals (columns), snow particles (including large crystals and aggregates), graupel, and (optionally) hail. Optionally, a third moment (reflectivity or 6th moment) of rain, graupel, and hail can be activated. The graupel and hail particle densities are also calculated by predicting the total particle volume. The graupel category therefore emulates a range of characteristics from high-density frozen drops (includes small hail) to low-density graupel (from rimed ice crystals/snow) in its size and density spectrum. The hail category is designed to simulate larger hail sizes. Hail is only produced from higher-density large graupel. @@ -10,7 +10,7 @@ Hydrometeor size distributions are assumed to follow a gamma functional form. Mi Cloud concentration nuclei (CCN) concentration is predicted as in Mansell et al. (2010) \cite Mansell_etal_2010 with a bulk activation spectrum approximating small aerosols. The model tracks the number of unactivated CCN, and the local CCN concentration is depleted as droplets are activated, either at cloud base or in cloud. The CCN are subjected to advection and subgrid turbulent mixing but have no other interactions with hydrometeors; for example, scavenging by raindrops is omitted. CCN are restored by droplet evaporation and by a gradual regeneration when no hydrometeors are present. Aerosol sensitivity is enhanced by explicitly treating droplet condensation instead of using a saturation adjustment. Supersaturation (within reason) is allowed to persist in updraft with low droplet concentration. -Excessive size sorting (common in 2-moment schemes) is effectively controlled by an adaptive breakup method that prevents reflectivity growth by sedimentation (Mansell 2010 \cite Mansell_2010). +Excessive size sorting (common in 2-moment schemes) is effectively controlled by an adaptive breakup method that prevents reflectivity growth by sedimentation (Mansell 2010 \cite Mansell_2010). Activating the 3-moment scheme provides a natural sedimentation feedback that narrows the size spectrum as size-sorting procedes without the the artificial breakup induced by the 2-moment scheme. The NSSL scheme is designed with deep (severe) convection in mind at grid spacings of up to 4 km, but can also be run at larger grid spacing as needed for nesting etc. It is also able to capture non-severe and winter weather. diff --git a/physics/docs/pdftxt/suite_input.nml.txt b/physics/docs/pdftxt/suite_input.nml.txt index e986fc322..c4bb5003b 100644 --- a/physics/docs/pdftxt/suite_input.nml.txt +++ b/physics/docs/pdftxt/suite_input.nml.txt @@ -54,7 +54,7 @@ show some variables in the namelist that must match the SDF.
      • 10: Morrison-Gettelman microphysics scheme
      • 11: GFDL microphysics scheme
      • 17: NSSL microphysics scheme with background CCN -
      • 18: NSSL microphysics scheme with predicted CCN (compatibility) +
      • 18: NSSL microphysics scheme with predicted CCN (compatibility: 18 = 17 + nssl_ccn_on=.true.)
      99 \b Parameters \b related \b to \b radiation \b scheme \b options @@ -406,6 +406,7 @@ show some variables in the namelist that must match the SDF. nssl_ehw0_in mp_nssl constant or max assumed graupel-droplet collection efficiency 0.9 nssl_ehlw0_in mp_nssl constant or max assumed hail-droplet collection efficiency 0.9 nssl_hail_on mp_nssl NSSL flag to activate the hail category .false. +nssl_3moment mp_nssl NSSL flag to activate 3-moment for rain/graupel (and hail if activated).false. nssl_ccn_on mp_nssl NSSL flag to activate the CCN category .true. nssl_invertccn mp_nssl NSSL flag to treat CCN as activated or unactivated .true. nssl_ehw0 mp_nssl NSSL graupel-droplet collection efficiency 0.9 From 9b9f55320455a3bca522f1c059b2919922bee2c4 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Sun, 24 Sep 2023 16:33:05 -0500 Subject: [PATCH 56/81] module_mp_nssl_2mom.F90 : set ngs with constant --- physics/module_mp_nssl_2mom.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index 72ff9b1b1..a373ddaf9 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -2612,7 +2612,7 @@ SUBROUTINE nssl_2mom_driver(qv, qc, qr, qi, qs, qh, qhl, ccw, crw, cci, csw, chw nx = ite-its+1 ny = 1 ! set up as 2D slabs nz = kte-kts+1 - ngs = Max(nz,64) + ngs = 64 IF ( .not. flag_ccn ) THEN renucfrac = 1.0 From 6ee6df60ca69743bab195fc4b04a891e91bdaeaf Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Mon, 25 Sep 2023 12:33:46 -0500 Subject: [PATCH 57/81] module_mp_nssl_2mom.F90: removed unneeded lines --- physics/module_mp_nssl_2mom.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index a373ddaf9..a40a62f02 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -21238,7 +21238,6 @@ subroutine nssl_2mom_gs & pqwvi(mgs) = & & -Min(0.0, qrcev(mgs)) & & -Min(0.0, qhcev(mgs)) & - & -Min(0.0, qfcev(mgs)) & & -Min(0.0, qhlcev(mgs)) & & -Min(0.0, qscev(mgs)) & ! > +il5(mgs)*(-qhsbv(mgs) - qhlsbv(mgs) ) & @@ -21249,7 +21248,6 @@ subroutine nssl_2mom_gs & pqwvd(mgs) = & & -Max(0.0, qrcev(mgs)) & & -Max(0.0, qhcev(mgs)) & - & -Max(0.0, qfcev(mgs)) & & -Max(0.0, qhlcev(mgs)) & & -Max(0.0, qscev(mgs)) & & +il5(mgs)*(-qiint(mgs) & From dbd5f58b1f04f8d31a445ca477a1cc1169707303 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 27 Sep 2023 01:19:48 +0000 Subject: [PATCH 58/81] remove all constant 3D variables from clm lake --- physics/clm_lake.f90 | 202 ++++++++++++++++-------------------------- physics/clm_lake.meta | 78 ++-------------- 2 files changed, 86 insertions(+), 194 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 4fa6dacb6..c6fa56320 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -229,6 +229,31 @@ end subroutine is_salty !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + subroutine calculate_z_dz_lake(i,input_lakedepth,clm_lakedepth,z_lake,dz_lake) + implicit none + integer, intent(in) :: i + real(kind_phys), intent(inout) :: clm_lakedepth(:) ! lake depth used by clm + real(kind_phys), intent(in) :: input_lakedepth(:) ! lake depth before correction (m) + real(kind_lake) :: z_lake(nlevlake) ! layer depth for lake (m) + real(kind_lake) :: dz_lake(nlevlake) ! layer thickness for lake (m) + real(kind_lake) :: depthratio + + if (input_lakedepth(i) == spval) then + clm_lakedepth(i) = zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake) + z_lake(1:nlevlake) = zlak(1:nlevlake) + dz_lake(1:nlevlake) = dzlak(1:nlevlake) + else + depthratio = input_lakedepth(i) / (zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake)) + z_lake(1) = zlak(1) + dz_lake(1) = dzlak(1) + dz_lake(2:nlevlake) = dzlak(2:nlevlake)*depthratio + z_lake(2:nlevlake) = zlak(2:nlevlake)*depthratio + dz_lake(1)*(1._kind_lake - depthratio) + end if + + end subroutine calculate_z_dz_lake + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !> \section arg_table_clm_lake_run Argument Table !! \htmlinclude clm_lake_run.html !! @@ -258,8 +283,8 @@ SUBROUTINE clm_lake_run( & salty, savedtke12d, snowdp2d, h2osno2d, snl2d, t_grnd2d, t_lake3d, & lake_icefrac3d, t_soisno3d, h2osoi_ice3d, h2osoi_liq3d, h2osoi_vol3d, & - z3d, dz3d, zi3d, z_lake3d, dz_lake3d, watsat3d, csol3d, sand3d, clay3d, & - tkmg3d, tkdry3d, tksatu3d, clm_lakedepth, cannot_freeze, & + z3d, dz3d, zi3d, & + input_lakedepth, clm_lakedepth, cannot_freeze, & ! Error reporting: errflg, errmsg) @@ -336,14 +361,8 @@ SUBROUTINE clm_lake_run( & dz3d real(kind_phys), dimension( :,-nlevsnow+0: ) ,INTENT(inout) :: zi3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: z_lake3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: dz_lake3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: watsat3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: csol3d, sand3d, clay3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: tkmg3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: tkdry3d - REAL(KIND_PHYS), DIMENSION( :,: ),INTENT(INOUT) :: tksatu3d REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT) :: clm_lakedepth + REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT) :: input_lakedepth ! ! Error reporting: @@ -430,10 +449,10 @@ SUBROUTINE clm_lake_run( & character*255 :: message logical, parameter :: feedback_to_atmosphere = .true. ! FIXME: REMOVE - real(kind_lake) :: to_radians, lat_d, lon_d, qss + real(kind_lake) :: to_radians, lat_d, lon_d, qss, tkm, bd - integer :: month,num1,num2,day_of_month - real(kind_lake) :: wght1,wght2,Tclim + integer :: month,num1,num2,day_of_month,isl + real(kind_lake) :: wght1,wght2,Tclim,depthratio logical salty_flag, cannot_freeze_flag @@ -451,31 +470,19 @@ SUBROUTINE clm_lake_run( & lakedepth_default=lakedepth_default, fhour=fhour, & oro_lakedepth=oro_lakedepth, savedtke12d=savedtke12d, snowdp2d=snowdp2d, & h2osno2d=h2osno2d, snl2d=snl2d, t_grnd2d=t_grnd2d, t_lake3d=t_lake3d, & - lake_icefrac3d=lake_icefrac3d, z_lake3d=z_lake3d, dz_lake3d=dz_lake3d, & + lake_icefrac3d=lake_icefrac3d, & t_soisno3d=t_soisno3d, h2osoi_ice3d=h2osoi_ice3d, h2osoi_liq3d=h2osoi_liq3d, & - h2osoi_vol3d=h2osoi_vol3d, z3d=z3d, dz3d=dz3d, zi3d=zi3d, watsat3d=watsat3d, & - csol3d=csol3d, tkmg3d=tkmg3d, fice=fice, hice=hice, min_lakeice=min_lakeice, & + h2osoi_vol3d=h2osoi_vol3d, z3d=z3d, dz3d=dz3d, zi3d=zi3d, & + fice=fice, hice=hice, min_lakeice=min_lakeice, & tsfc=tsfc, & - use_lake_model=use_lake_model, use_lakedepth=use_lakedepth, tkdry3d=tkdry3d, & - tksatu3d=tksatu3d, im=im, prsi=prsi, xlat_d=xlat_d, xlon_d=xlon_d, & - clm_lake_initialized=clm_lake_initialized, sand3d=sand3d, clay3d=clay3d, & + use_lake_model=use_lake_model, use_lakedepth=use_lakedepth, & + im=im, prsi=prsi, xlat_d=xlat_d, xlon_d=xlon_d, & + clm_lake_initialized=clm_lake_initialized, input_lakedepth=input_lakedepth, & tg3=tg3, clm_lakedepth=clm_lakedepth, km=km, me=me, master=master, & errmsg=errmsg, errflg=errflg) if(errflg/=0) then return endif - if(any(clay3d>0 .and. clay3d<1)) then - write(message,*) 'Invalid clay3d. Abort.' - errmsg=trim(message) - errflg=1 - return - endif - if(any(dz_lake3d>0 .and. dz_lake3d<.1)) then - write(message,*) 'Invalid dz_lake3d. Abort.' - errmsg=trim(message) - errflg=1 - return - endif lake_points=0 snow_points=0 @@ -540,6 +547,13 @@ SUBROUTINE clm_lake_run( & lake_points = lake_points+1 + call calculate_z_dz_lake(i,input_lakedepth,clm_lakedepth,z_lake(1,:),dz_lake(1,:)) + + do c = 2,column + z_lake(c,:) = z_lake(1,:) + dz_lake(c,:) = z_lake(1,:) + enddo + do c = 1,column forc_t(c) = SFCTMP ! [K] @@ -567,8 +581,6 @@ SUBROUTINE clm_lake_run( & do k = 1,nlevlake t_lake(c,k) = t_lake3d(i,k) lake_icefrac(c,k) = lake_icefrac3d(i,k) - z_lake(c,k) = z_lake3d(i,k) - dz_lake(c,k) = dz_lake3d(i,k) enddo do k = -nlevsnow+1,nlevsoil t_soisno(c,k) = t_soisno3d(i,k) @@ -582,11 +594,18 @@ SUBROUTINE clm_lake_run( & zi(c,k) = zi3d(i,k) enddo do k = 1,nlevsoil - watsat(c,k) = watsat3d(i,k) - csol(c,k) = csol3d(i,k) - tkmg(c,k) = tkmg3d(i,k) - tkdry(c,k) = tkdry3d(i,k) - tksatu(c,k) = tksatu3d(i,k) + ! Soil hydraulic and thermal properties + isl = ISLTYP(i) + if (isl == 0 ) isl = 14 + if (isl == 14 ) isl = isl + 1 + + watsat(c,k) = 0.489_kind_lake - 0.00126_kind_lake*sand(isl) + csol(c,k) = (2.128_kind_lake*sand(isl)+2.385_kind_lake*clay(isl)) / (sand(isl)+clay(isl))*1.e6_kind_lake ! J/(m3 K) + tkm = (8.80_kind_lake*sand(isl)+2.92_kind_lake*clay(isl))/(sand(isl)+clay(isl)) ! W/(m K) + bd = (1._kind_lake-watsat(c,k))*2.7e3_kind_lake + tkmg(c,k) = tkm ** (1._kind_lake- watsat(c,k)) + tkdry(c,k) = (0.135_kind_lake*bd + 64.7_kind_lake) / (2.7e3_kind_lake - 0.947_kind_lake*bd) + tksatu(c,k) = tkmg(c,k)*0.57_kind_lake**watsat(c,k) enddo enddo @@ -747,7 +766,7 @@ SUBROUTINE clm_lake_run( & hice(I) = 0 ! sea_ice_thickness do k=1,nlevlake if(lake_icefrac3d(i,k)>0) then - hice(i) = hice(i) + dz_lake3d(i,k) + hice(i) = hice(i) + dz_lake(c,k) endif end do else ! Not an ice point @@ -5315,14 +5334,14 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, weasd, lakedepth_default, fhour, & oro_lakedepth, savedtke12d, snowdp2d, h2osno2d, & !o snl2d, t_grnd2d, t_lake3d, lake_icefrac3d, & - z_lake3d, dz_lake3d, t_soisno3d, h2osoi_ice3d, & + t_soisno3d, h2osoi_ice3d, & h2osoi_liq3d, h2osoi_vol3d, z3d, dz3d, & - zi3d, watsat3d, csol3d, tkmg3d, & + zi3d, & fice, hice, min_lakeice, tsfc, & use_lake_model, use_lakedepth, & - tkdry3d, tksatu3d, im, prsi, & + im, prsi, & xlat_d, xlon_d, clm_lake_initialized, & - sand3d, clay3d, tg3, clm_lakedepth, & + input_lakedepth, tg3, clm_lakedepth, & km, me, master, errmsg, errflg) !> Some fields in lakeini are not available during initialization, @@ -5360,6 +5379,7 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, real(kind_phys), intent(in) :: lakedepth_default real(kind_phys), dimension(IM),intent(inout) :: clm_lakedepth + real(kind_phys), dimension(IM),intent(inout) :: input_lakedepth real(kind_phys), dimension(IM),intent(in) :: oro_lakedepth real(kind_phys), dimension(IM),intent(out) :: savedtke12d real(kind_phys), dimension(IM),intent(out) :: snowdp2d, & @@ -5368,43 +5388,24 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, t_grnd2d real(kind_phys), dimension(IM,nlevlake),INTENT(out) :: t_lake3d, & - lake_icefrac3d, & - z_lake3d, & - dz_lake3d + lake_icefrac3d real(kind_phys), dimension(IM,-nlevsnow+1:nlevsoil ),INTENT(out) :: t_soisno3d, & h2osoi_ice3d, & h2osoi_liq3d, & h2osoi_vol3d, & z3d, & dz3d - real(kind_phys), dimension(IM,nlevsoil),INTENT(out) :: watsat3d, & - csol3d, & - tkmg3d, & - tkdry3d, & - tksatu3d - real(kind_phys), dimension(IM,nlevsoil),INTENT(inout) :: clay3d, & - sand3d real(kind_phys), dimension( IM,-nlevsnow+0:nlevsoil ),INTENT(out) :: zi3d !LOGICAL, DIMENSION( : ),intent(out) :: lake !REAL(KIND_PHYS), OPTIONAL, DIMENSION( : ), INTENT(IN) :: lake_depth ! no separate variable for this in CCPP - real(kind_lake), dimension( 1:im,1:nlevsoil ) :: bsw3d, & - bsw23d, & - psisat3d, & - vwcsat3d, & - watdry3d, & - watopt3d, & - hksat3d, & - sucsat3d integer :: n,i,j,k,ib,lev,bottom ! indices real(kind_lake),dimension(1:im ) :: bd2d ! bulk density of dry soil material [kg/m^3] real(kind_lake),dimension(1:im ) :: tkm2d ! mineral conductivity real(kind_lake),dimension(1:im ) :: xksat2d ! maximum hydraulic conductivity of soil [mm/s] real(kind_lake),dimension(1:im ) :: depthratio2d ! ratio of lake depth to standard deep lake depth - real(kind_lake),dimension(1:im ) :: clay2d ! temporary - real(kind_lake),dimension(1:im ) :: sand2d ! temporary logical,parameter :: arbinit = .false. real(kind_lake),parameter :: defval = -999.0 @@ -5413,16 +5414,19 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, character*256 :: message real(kind_lake) :: ht real(kind_lake) :: rhosn - real(kind_lake) :: depth + real(kind_lake) :: depth, lakedepth logical :: climatology_limits + real(kind_lake) :: z_lake(nlevlake) ! layer depth for lake (m) + real(kind_lake) :: dz_lake(nlevlake) ! layer thickness for lake (m) + integer, parameter :: xcheck=38 integer, parameter :: ycheck=92 integer :: used_lakedepth_default, init_points, month, julday integer :: mon, iday, num2, num1, juld, day2, day1, wght1, wght2 - real(kind_lake) :: Tclim + real(kind_lake) :: Tclim, watsat used_lakedepth_default=0 @@ -5456,6 +5460,8 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, cycle endif + input_lakedepth=clm_lakedepth + snl2d(i) = defval do k = -nlevsnow+1,nlevsoil h2osoi_liq3d(i,k) = defval @@ -5468,8 +5474,6 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, do k = 1,nlevlake t_lake3d(i,k) = defval lake_icefrac3d(i,k) = defval - z_lake3d(i,k) = defval - dz_lake3d(i,k) = defval enddo if (use_lake_model(i) == 1) then @@ -5499,60 +5503,9 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, isl = ISLTYP(i) if (isl == 0 ) isl = 14 if (isl == 14 ) isl = isl + 1 - do k = 1,nlevsoil - sand3d(i,k) = sand(isl) - clay3d(i,k) = clay(isl) - - ! Cannot continue if either of these checks fail. - if(clay3d(i,k)>0 .and. clay3d(i,k)<1) then - write(message,*) 'bad clay3d ',clay3d(i,k) - write(0,'(A)') trim(message) - errmsg = trim(message) - errflg = 1 - return - endif - if(sand3d(i,k)>0 .and. sand3d(i,k)<1) then - write(message,*) 'bad sand3d ',sand3d(i,k) - write(0,'(A)') trim(message) - errmsg = trim(message) - errflg = 1 - return - endif - enddo - do k = 1,nlevsoil - clay2d(i) = clay3d(i,k) - sand2d(i) = sand3d(i,k) - watsat3d(i,k) = 0.489_kind_lake - 0.00126_kind_lake*sand2d(i) - bd2d(i) = (1._kind_lake-watsat3d(i,k))*2.7e3_kind_lake - xksat2d(i) = 0.0070556_kind_lake *( 10._kind_lake**(-0.884_kind_lake+0.0153_kind_lake*sand2d(i)) ) ! mm/s - tkm2d(i) = (8.80_kind_lake*sand2d(i)+2.92_kind_lake*clay2d(i))/(sand2d(i)+clay2d(i)) ! W/(m K) - - bsw3d(i,k) = 2.91_kind_lake + 0.159_kind_lake*clay2d(i) - bsw23d(i,k) = -(3.10_kind_lake + 0.157_kind_lake*clay2d(i) - 0.003_kind_lake*sand2d(i)) - psisat3d(i,k) = -(exp((1.54_kind_lake - 0.0095_kind_lake*sand2d(i) + 0.0063_kind_lake*(100.0_kind_lake-sand2d(i) & - -clay2d(i)))*log(10.0_kind_lake))*9.8e-5_kind_lake) - vwcsat3d(i,k) = (50.5_kind_lake - 0.142_kind_lake*sand2d(i) - 0.037_kind_lake*clay2d(i))/100.0_kind_lake - hksat3d(i,k) = xksat2d(i) - sucsat3d(i,k) = 10._kind_lake * ( 10._kind_lake**(1.88_kind_lake-0.0131_kind_lake*sand2d(i)) ) - tkmg3d(i,k) = tkm2d(i) ** (1._kind_lake- watsat3d(i,k)) - tksatu3d(i,k) = tkmg3d(i,k)*0.57_kind_lake**watsat3d(i,k) - tkdry3d(i,k) = (0.135_kind_lake*bd2d(i) + 64.7_kind_lake) / (2.7e3_kind_lake - 0.947_kind_lake*bd2d(i)) - csol3d(i,k) = (2.128_kind_lake*sand2d(i)+2.385_kind_lake*clay2d(i)) / (sand2d(i)+clay2d(i))*1.e6_kind_lake ! J/(m3 K) - watdry3d(i,k) = watsat3d(i,k) * (316230._kind_lake/sucsat3d(i,k)) ** (-1._kind_lake/bsw3d(i,k)) - watopt3d(i,k) = watsat3d(i,k) * (158490._kind_lake/sucsat3d(i,k)) ** (-1._kind_lake/bsw3d(i,k)) - end do - if (clm_lakedepth(i) == spval) then - clm_lakedepth(i) = zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake) - z_lake3d(i,1:nlevlake) = zlak(1:nlevlake) - dz_lake3d(i,1:nlevlake) = dzlak(1:nlevlake) - else - depthratio2d(i) = clm_lakedepth(i) / (zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake)) - z_lake3d(i,1) = zlak(1) - dz_lake3d(i,1) = dzlak(1) - dz_lake3d(i,2:nlevlake) = dzlak(2:nlevlake)*depthratio2d(i) - z_lake3d(i,2:nlevlake) = zlak(2:nlevlake)*depthratio2d(i) + dz_lake3d(i,1)*(1._kind_lake - depthratio2d(i)) - end if + call calculate_z_dz_lake(i,input_lakedepth,clm_lakedepth,z_lake,dz_lake) + z3d(i,1:nlevsoil) = zsoi(1:nlevsoil) zi3d(i,0:nlevsoil) = zisoi(0:nlevsoil) dz3d(i,1:nlevsoil) = dzsoi(1:nlevsoil) @@ -5633,9 +5586,9 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, if(lake_icefrac3d(i,1) > 0.) then depth = 0. do k=2,nlevlake - depth = depth + dz_lake3d(i,k) + depth = depth + dz_lake(k) if(hice(i) >= depth) then - lake_icefrac3d(i,k) = max(0.,lake_icefrac3d(i,1)+(0.-lake_icefrac3d(i,1))/z_lake3d(i,nlevlake)*depth) + lake_icefrac3d(i,k) = max(0.,lake_icefrac3d(i,1)+(0.-lake_icefrac3d(i,1))/z_lake(nlevlake)*depth) else lake_icefrac3d(i,k) = 0. endif @@ -5649,8 +5602,8 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, t_grnd2d(i) = max(tfrz,tsfc(i)) endif do k = 2, nlevlake - if(z_lake3d(i,k).le.depth_c) then - t_lake3d(i,k) = tsfc(i)+(277.2_kind_lake-tsfc(i))/depth_c*z_lake3d(i,k) + if(z_lake(k).le.depth_c) then + t_lake3d(i,k) = tsfc(i)+(277.2_kind_lake-tsfc(i))/depth_c*z_lake(k) else t_lake3d(i,k) = 277.2_kind_lake end if @@ -5684,7 +5637,8 @@ SUBROUTINE lakeini(kdt, ISLTYP, gt0, snowd, do k = 1,nlevsoil h2osoi_vol3d(i,k) = 1.0_kind_lake - h2osoi_vol3d(i,k) = min(h2osoi_vol3d(i,k),watsat3d(i,k)) + watsat = 0.489_kind_lake - 0.00126_kind_lake*sand(isl) + h2osoi_vol3d(i,k) = min(h2osoi_vol3d(i,k),watsat) ! soil layers if (t_soisno3d(i,k) <= tfrz) then diff --git a/physics/clm_lake.meta b/physics/clm_lake.meta index 3de543078..11a44286a 100644 --- a/physics/clm_lake.meta +++ b/physics/clm_lake.meta @@ -289,6 +289,14 @@ type = real kind = kind_phys intent = in +[input_lakedepth] + standard_name = lake_depth_before_correction + long_name = lake depth_before_correction + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout [wind] standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level @@ -716,76 +724,6 @@ type = real kind = kind_phys intent = inout -[z_lake3d] - standard_name = depth_of_lake_interface_layers - long_name = depth of lake interface layers - units = fraction - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout -[dz_lake3d] - standard_name = thickness_of_lake_layers - long_name = thickness of lake layers - units = fraction - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout -[watsat3d] - standard_name = saturated_volumetric_soil_water_in_lake_model - long_name = saturated volumetric soil water in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout -[csol3d] - standard_name = soil_heat_capacity_in_lake_model - long_name = soil heat capacity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout -[sand3d] - standard_name = clm_lake_percent_sand - long_name = percent sand in clm lake model - units = percent - dimensions = (horizontal_loop_extent,soil_vertical_dimension_for_clm_lake_model) - type = integer - intent = inout -[clay3d] - standard_name = clm_lake_percent_clay - long_name = percent clay in clm lake model - units = percent - dimensions = (horizontal_loop_extent,soil_vertical_dimension_for_clm_lake_model) - type = integer - intent = inout -[tkmg3d] - standard_name = soil_mineral_thermal_conductivity_in_lake_model - long_name = soil mineral thermal conductivity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout -[tkdry3d] - standard_name = dry_soil_thermal_conductivity_in_lake_model - long_name = dry soil thermal conductivity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout -[tksatu3d] - standard_name = saturated_soil_thermal_conductivity_in_lake_model - long_name = saturated soil thermal conductivity in lake model - units = m - dimensions = (horizontal_loop_extent, lake_vertical_dimension_for_clm_lake_model) - type = real - kind = kind_phys - intent = inout [clm_lakedepth] standard_name = clm_lake_depth long_name = clm internal copy of lake depth with 10.0 replaced by default lake depth From 75ec62308ae51ea48b03ecd438b8a1eb71c8b929 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 27 Sep 2023 14:40:02 +0000 Subject: [PATCH 59/81] calculate constants only once per i --- physics/clm_lake.f90 | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index c6fa56320..da4712810 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -554,6 +554,19 @@ SUBROUTINE clm_lake_run( & dz_lake(c,:) = z_lake(1,:) enddo + ! Soil hydraulic and thermal properties + isl = ISLTYP(i) + if (isl == 0 ) isl = 14 + if (isl == 14 ) isl = isl + 1 + + watsat = 0.489_kind_lake - 0.00126_kind_lake*sand(isl) + csol = (2.128_kind_lake*sand(isl)+2.385_kind_lake*clay(isl)) / (sand(isl)+clay(isl))*1.e6_kind_lake ! J/(m3 K) + tkm = (8.80_kind_lake*sand(isl)+2.92_kind_lake*clay(isl))/(sand(isl)+clay(isl)) ! W/(m K) + bd = (1._kind_lake-watsat(1,1))*2.7e3_kind_lake + tkmg = tkm ** (1._kind_lake- watsat(1,1)) + tkdry = (0.135_kind_lake*bd + 64.7_kind_lake) / (2.7e3_kind_lake - 0.947_kind_lake*bd) + tksatu = tkmg(1,1)*0.57_kind_lake**watsat(1,1) + do c = 1,column forc_t(c) = SFCTMP ! [K] @@ -593,21 +606,6 @@ SUBROUTINE clm_lake_run( & do k = -nlevsnow+0,nlevsoil zi(c,k) = zi3d(i,k) enddo - do k = 1,nlevsoil - ! Soil hydraulic and thermal properties - isl = ISLTYP(i) - if (isl == 0 ) isl = 14 - if (isl == 14 ) isl = isl + 1 - - watsat(c,k) = 0.489_kind_lake - 0.00126_kind_lake*sand(isl) - csol(c,k) = (2.128_kind_lake*sand(isl)+2.385_kind_lake*clay(isl)) / (sand(isl)+clay(isl))*1.e6_kind_lake ! J/(m3 K) - tkm = (8.80_kind_lake*sand(isl)+2.92_kind_lake*clay(isl))/(sand(isl)+clay(isl)) ! W/(m K) - bd = (1._kind_lake-watsat(c,k))*2.7e3_kind_lake - tkmg(c,k) = tkm ** (1._kind_lake- watsat(c,k)) - tkdry(c,k) = (0.135_kind_lake*bd + 64.7_kind_lake) / (2.7e3_kind_lake - 0.947_kind_lake*bd) - tksatu(c,k) = tkmg(c,k)*0.57_kind_lake**watsat(c,k) - enddo - enddo eflx_lwrad_net = -9999 From 7a8f6934f40390de915f4d8828d2119da9f99956 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Wed, 27 Sep 2023 18:56:22 +0000 Subject: [PATCH 60/81] "to address the reviewers' comments" --- physics/cu_c3_deep.F90 | 4 ---- physics/cu_c3_driver.F90 | 32 -------------------------------- physics/cu_c3_driver_post.F90 | 2 +- physics/cu_gf_driver.F90 | 32 -------------------------------- physics/cu_gf_driver_post.F90 | 2 +- 5 files changed, 2 insertions(+), 70 deletions(-) diff --git a/physics/cu_c3_deep.F90 b/physics/cu_c3_deep.F90 index b8a1dd838..e6d238b69 100644 --- a/physics/cu_c3_deep.F90 +++ b/physics/cu_c3_deep.F90 @@ -2078,10 +2078,6 @@ subroutine cu_c3_deep_run( & !> - Call rain_evap_below_cloudbase() to calculate evaporation below cloud base -! call rain_evap_below_cloudbase(itf,ktf,its,ite, & -! kts,kte,ierr,kbcon,xmb,psur,xland,qo_cup, & -! po_cup,qes_cup,pwavo,edto,pwevo,pre,outt,outq) !,outbuoy) - k=1 !$acc kernels do i=its,itf diff --git a/physics/cu_c3_driver.F90 b/physics/cu_c3_driver.F90 index cc2906ad5..8592e08f9 100644 --- a/physics/cu_c3_driver.F90 +++ b/physics/cu_c3_driver.F90 @@ -949,38 +949,6 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& !gdc(i,k,8)=(outq(i,k))*86400.*xlv/cp gdc(i,k,8)=(outqm(i,k)+outqs(i,k)+outq(i,k))*86400.*xlv/cp gdc(i,k,9)=gdc(i,k,2)+gdc(i,k,3)+gdc(i,k,4) -! -!> - Calculate subsidence effect on clw -! -! dsubclw=0. -! dsubclwm=0. -! dsubclws=0. -! dp=100.*(p2d(i,k)-p2d(i,k+1)) -! if (clcw(i,k) .gt. -999.0 .and. clcw(i,k+1) .gt. -999.0 )then -! clwtot = cliw(i,k) + clcw(i,k) -! clwtot1= cliw(i,k+1) + clcw(i,k+1) -! dsubclw=((-edt(i)*zd(i,k+1)+zu(i,k+1))*clwtot1 & -! -(-edt(i)*zd(i,k) +zu(i,k)) *clwtot )*g/dp -! dsubclwm=((-edtm(i)*zdm(i,k+1)+zum(i,k+1))*clwtot1 & -! -(-edtm(i)*zdm(i,k) +zum(i,k)) *clwtot )*g/dp -! dsubclws=(zus(i,k+1)*clwtot1-zus(i,k)*clwtot)*g/dp -! dsubclw=dsubclw+(zu(i,k+1)*clwtot1-zu(i,k)*clwtot)*g/dp -! dsubclwm=dsubclwm+(zum(i,k+1)*clwtot1-zum(i,k)*clwtot)*g/dp -! dsubclws=dsubclws+(zus(i,k+1)*clwtot1-zus(i,k)*clwtot)*g/dp -! endif -! tem = dt*(outqcs(i,k)*cutens(i)+outqc(i,k)*cuten(i) & -! +outqcm(i,k)*cutenm(i) & -! +dsubclw*xmb(i)+dsubclws*xmbs(i)+dsubclwm*xmbm(i) & -! ) -! tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf)) -! if (clcw(i,k) .gt. -999.0) then -! cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice -! clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water -! else -! cliw(i,k) = max(0.,cliw(i,k) + tem) -! endif -! -! enddo !> - FCT treats subsidence effect to cloud ice/water (begin) dp=100.*(p2d(i,k)-p2d(i,k+1)) diff --git a/physics/cu_c3_driver_post.F90 b/physics/cu_c3_driver_post.F90 index 528f3d466..d5d2dee3b 100644 --- a/physics/cu_c3_driver_post.F90 +++ b/physics/cu_c3_driver_post.F90 @@ -69,7 +69,7 @@ subroutine cu_c3_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m ze = 0.0 ze_conv = 0.0 dbz_sum = 0.0 - cuprate = max(0.1,1.e3*raincv(i) * 3600.0 / dt) ! cu precip rate (mm/h) + cuprate = 1.e3*raincv(i) * 3600.0 / dt ! cu precip rate (mm/h) if(cuprate .lt. 0.05) cuprate=0. ze_conv = 300.0 * cuprate**1.5 if (maxupmf(i).gt.0.1 .and. cuprate.gt.0.) then diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index f3f5042fc..d85b7ac52 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -927,38 +927,6 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& !gdc(i,k,8)=(outq(i,k))*86400.*xlv/cp gdc(i,k,8)=(outqm(i,k)+outqs(i,k)+outq(i,k))*86400.*xlv/cp gdc(i,k,9)=gdc(i,k,2)+gdc(i,k,3)+gdc(i,k,4) -! -!> - Calculate subsidence effect on clw -! -! dsubclw=0. -! dsubclwm=0. -! dsubclws=0. -! dp=100.*(p2d(i,k)-p2d(i,k+1)) -! if (clcw(i,k) .gt. -999.0 .and. clcw(i,k+1) .gt. -999.0 )then -! clwtot = cliw(i,k) + clcw(i,k) -! clwtot1= cliw(i,k+1) + clcw(i,k+1) -! dsubclw=((-edt(i)*zd(i,k+1)+zu(i,k+1))*clwtot1 & -! -(-edt(i)*zd(i,k) +zu(i,k)) *clwtot )*g/dp -! dsubclwm=((-edtm(i)*zdm(i,k+1)+zum(i,k+1))*clwtot1 & -! -(-edtm(i)*zdm(i,k) +zum(i,k)) *clwtot )*g/dp -! dsubclws=(zus(i,k+1)*clwtot1-zus(i,k)*clwtot)*g/dp -! dsubclw=dsubclw+(zu(i,k+1)*clwtot1-zu(i,k)*clwtot)*g/dp -! dsubclwm=dsubclwm+(zum(i,k+1)*clwtot1-zum(i,k)*clwtot)*g/dp -! dsubclws=dsubclws+(zus(i,k+1)*clwtot1-zus(i,k)*clwtot)*g/dp -! endif -! tem = dt*(outqcs(i,k)*cutens(i)+outqc(i,k)*cuten(i) & -! +outqcm(i,k)*cutenm(i) & -! +dsubclw*xmb(i)+dsubclws*xmbs(i)+dsubclwm*xmbm(i) & -! ) -! tem1 = max(0.0, min(1.0, (tcr-t(i,k))*tcrf)) -! if (clcw(i,k) .gt. -999.0) then -! cliw(i,k) = max(0.,cliw(i,k) + tem * tem1) ! ice -! clcw(i,k) = max(0.,clcw(i,k) + tem *(1.0-tem1)) ! water -! else -! cliw(i,k) = max(0.,cliw(i,k) + tem) -! endif -! -! enddo !> - FCT treats subsidence effect to cloud ice/water (begin) dp=100.*(p2d(i,k)-p2d(i,k+1)) diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index 59f43618c..5adf3ac42 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -69,7 +69,7 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m ze = 0.0 ze_conv = 0.0 dbz_sum = 0.0 - cuprate = max(0.1,1.e3*raincv(i) * 3600.0 / dt) ! cu precip rate (mm/h) + cuprate = 1.e3*raincv(i) * 3600.0 / dt ! cu precip rate (mm/h) if(cuprate .lt. 0.05) cuprate=0. ze_conv = 300.0 * cuprate**1.5 if (maxupmf(i).gt.0.1 .and. cuprate.gt.0.) then From a110a5b93bce92bab083fdaa07bd21ba5cae8720 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 14:04:50 -0600 Subject: [PATCH 61/81] Getting real close... --- physics/GFS_phys_time_vary.fv3.F90 | 105 ++++-- physics/GFS_phys_time_vary.fv3.meta | 83 ++++- physics/GFS_rrtmg_pre.F90 | 19 +- physics/GFS_rrtmg_pre.meta | 39 +-- physics/GFS_rrtmg_setup.F90 | 26 +- physics/GFS_rrtmg_setup.meta | 30 +- physics/GFS_rrtmgp_pre.F90 | 22 +- physics/GFS_rrtmgp_pre.meta | 35 +- physics/GFS_rrtmgp_setup.F90 | 20 +- physics/GFS_rrtmgp_setup.meta | 30 +- physics/module_ozphys.F90 | 476 ++++++++++++++++++++++++++++ physics/module_ozphys.meta | 24 ++ physics/ozphys_2015.F90 | 126 +++----- physics/ozphys_2015.meta | 62 +--- physics/ozphys_time_vary.F90 | 165 ---------- physics/ozphys_time_vary.meta | 200 ------------ physics/radiation_gases.f | 313 ++---------------- physics/rrtmgp_lw_main.F90 | 1 - 18 files changed, 815 insertions(+), 961 deletions(-) create mode 100644 physics/module_ozphys.F90 create mode 100644 physics/module_ozphys.meta delete mode 100644 physics/ozphys_time_vary.F90 delete mode 100644 physics/ozphys_time_vary.meta diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index d82f22399..af2dd9b00 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -10,10 +10,12 @@ module GFS_phys_time_vary use omp_lib #endif - use machine, only : kind_phys + use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec use mersenne_twister, only: random_setseed, random_number + use module_ozphys, only: ty_ozphys + use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol @@ -64,9 +66,9 @@ module GFS_phys_time_vary !>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm !> @{ subroutine GFS_phys_time_vary_init ( & - me, master, h2o_phys, iaerclm, iccn, iaermdl, iflip, im, levs, & + me, master, ntoz, h2o_phys, iaerclm, iccn, iaermdl, iflip, im, levs, & nx, ny, idate, xlat_d, xlon_d, & - jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & + jindx1_o3, jindx2_o3, ddy_o3, jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, imap, jmap, & do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, & @@ -79,12 +81,12 @@ subroutine GFS_phys_time_vary_init ( smcwtdxy, deeprechxy, rechxy, snowxy, snicexy, snliqxy, tsnoxy , smoiseq, zsnsoxy, & slc, smc, stc, tsfcl, snowd, canopy, tg3, stype, con_t0c, lsm_cold_start, nthrds, & lkm, use_lake_model, lakefrac, lakedepth, iopt_lake, iopt_lake_clm, iopt_lake_flake, & - lakefrac_threshold, lakedepth_threshold, errmsg, errflg) + lakefrac_threshold, lakedepth_threshold, ozphys, errmsg, errflg) implicit none ! Interface variables - integer, intent(in) :: me, master, iccn, iflip, im, nx, ny, levs, iaermdl + integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs, iaermdl logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start integer, intent(in) :: idate(:), iopt_lake, iopt_lake_clm, iopt_lake_flake real(kind_phys), intent(in) :: fhour, lakefrac_threshold, lakedepth_threshold @@ -93,8 +95,8 @@ subroutine GFS_phys_time_vary_init ( integer, intent(in) :: lkm integer, intent(inout) :: use_lake_model(:) real(kind=kind_phys), intent(in ) :: lakefrac(:), lakedepth(:) - integer, intent(inout) :: jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(inout) :: ddy_h(:) + integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:) real(kind_phys), intent(in) :: h2opl(:,:,:) integer, intent(inout) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) @@ -113,6 +115,7 @@ subroutine GFS_phys_time_vary_init ( real(kind_phys), intent(in) :: min_seaice, fice(:) real(kind_phys), intent(in) :: landfrac(:) real(kind_phys), intent(inout) :: weasd(:) + type(ty_ozphys), intent(in) :: ozphys ! NoahMP - only allocated when NoahMP is used integer, intent(in) :: lsoil, lsnow_lsm_lbound, lsnow_lsm_ubound @@ -200,21 +203,30 @@ subroutine GFS_phys_time_vary_init ( jamax=-999 !$OMP parallel num_threads(nthrds) default(none) & -!$OMP shared (me,master,h2o_phys,im,nx,ny,levs,idate) & +!$OMP shared (me,master,ntoz,h2o_phys,im,nx,ny,levs,idate) & !$OMP shared (xlat_d,xlon_d,imap,jmap,errmsg,errflg) & !$OMP shared (levh2o,h2o_coeff,h2o_pres,h2opl) & !$OMP shared (iamin, iamax, jamin, jamax) & !$OMP shared (iaerclm,iaermdl,ntrcaer,aer_nm,iflip,iccn) & -!$OMP shared (jindx1_h,jindx2_h,ddy_h) & +!$OMP shared (jindx1_o3,jindx2_o3,ddy_o3,jindx1_h,jindx2_h,ddy_h) & !$OMP shared (jindx1_aer,jindx2_aer,ddy_aer,iindx1_aer,iindx2_aer,ddx_aer) & !$OMP shared (jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci,ddx_ci) & !$OMP shared (do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau,ddy_j2tau) & !$OMP shared (isot,ivegsrc,nlunit,sncovr,sncovr_ice,lsm,lsm_ruc) & !$OMP shared (min_seaice,fice,landfrac,vtype,weasd,snupx,salp_data) & +!$OMP shared (ozphys) & !$OMP private (ix,i,j,rsnow,vegtyp) !$OMP sections +!$OMP section +!> - Setup spatial interpolation indices for ozone physics. + if (ntoz > 0) then + !$OMP CRITICAL + call ozphys%setup_forcing(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) + !$OMP END CRITICAL + endif + !$OMP section !> - Call read_h2odata() to read stratospheric water vapor data call read_h2odata (h2o_phys, me, master) @@ -710,8 +722,8 @@ end subroutine GFS_phys_time_vary_init !> @{ subroutine GFS_phys_time_vary_timestep_init ( & me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, & - imfdeepcnv, cal_pre, random_clds, nscyc, h2o_phys, iaerclm, iccn, clstp, & - jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & + imfdeepcnv, cal_pre, random_clds, nscyc, ntoz, h2o_phys, iaerclm, iccn, clstp, & + jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, fn_nml, & imap, jmap, prsl, seed0, rann, nthrds, nx, ny, nsst, tile_num, nlunit, lsoil, lsoil_lsm,& @@ -719,21 +731,21 @@ subroutine GFS_phys_time_vary_timestep_init ( lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, & tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, & zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, & - cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, & + cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, ozphys, & do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, errmsg, errflg) implicit none ! Interface variables integer, intent(in) :: me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, & - nsswr, imfdeepcnv, iccn, nscyc, iflip + nsswr, imfdeepcnv, iccn, nscyc, ntoz, iflip integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhswr, fhour logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm real(kind_phys), intent(out) :: clstp - integer, intent(in) :: jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(in) :: ddy_h(:) - real(kind_phys), intent(inout) :: h2opl(:,:,:) + integer, intent(in) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(in) :: ddy_o3(:), ddy_h(:) + real(kind_phys), intent(inout) :: ozpl(:,:,:), h2opl(:,:,:) integer, intent(in) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(in) :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(inout) :: aer_nm(:,:,:) @@ -749,6 +761,7 @@ subroutine GFS_phys_time_vary_timestep_init ( integer, intent(in) :: jindx1_tau(:), jindx2_tau(:) real(kind_phys), intent(in) :: ddy_j1tau(:), ddy_j2tau(:) real(kind_phys), intent(inout) :: tau_amf(:) + type(ty_ozphys), intent(in) :: ozphys ! For gcycle only integer, intent(in) :: nthrds, nx, ny, nsst, tile_num, nlunit, lsoil @@ -771,10 +784,13 @@ subroutine GFS_phys_time_vary_timestep_init ( integer, intent(out) :: errflg ! Local variables - integer :: i, j, k, iseed, iskip, ix - real(kind=kind_phys) :: wrk(1) - real(kind=kind_phys) :: rannie(cny) - real(kind=kind_phys) :: rndval(cnx*cny*nrcm) + integer :: i, j, k, iseed, iskip, ix, idat(8), jdat(8), iday, j1, j2, nc, n1, n2, jdow, & + jdoy, jday, w3kindreal, w3kindint + real(kind_phys) :: wrk(1), tem, tx1, tx2, rjday + real(kind_phys) :: rannie(cny) + real(kind_phys) :: rndval(cnx*cny*nrcm) + real(kind_dbl_prec) :: rinc(5) + real(kind_sngl_prec) :: rinc4(5) ! Initialize CCPP error handling variables errmsg = '' @@ -790,15 +806,56 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP parallel num_threads(nthrds) default(none) & !$OMP shared(kdt,nsswr,lsswr,clstp,imfdeepcnv,cal_pre,random_clds) & !$OMP shared(fhswr,fhour,seed0,cnx,cny,nrcm,wrk,rannie,rndval) & -!$OMP shared(rann,im,isc,jsc,imap,jmap,me,idate) & -!$OMP shared(h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & +!$OMP shared(rann,im,isc,jsc,imap,jmap,ntoz,me,idate,jindx1_o3,jindx2_o3) & +!$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & !$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & !$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & -!$OMP shared(ddy_j2tau,tau_amf,iflip) & -!$OMP private(iseed,iskip,i,j,k) +!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys) & +!$OMP private(iseed,iskip,i,j,rjday,idat,rinc,w3kindreal,w3kindint,jdat)& +!$OMP private(jdow,jdoy,jday,rinc4,n1,n2) !$OMP sections +!$OMP section +!> - Compute temporal interpolation indices for updating gas concentrations. + idat=0 + idat(1)=idate(4) + idat(2)=idate(2) + idat(3)=idate(3) + idat(5)=idate(1) + rinc=0. + rinc(2)=fhour + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + rinc4=rinc + CALL w3movdat(rinc4,idat,jdat) + else + CALL w3movdat(rinc,idat,jdat) + endif + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jdat,jdow,jdoy,jday) + rjday = jdoy + jdat(5) / 24. + if (rjday < ozphys%time(1)) rjday = rjday + 365. + + n2 = ozphys%ntime + 1 + do j=2,ozphys%ntime + if (rjday < ozphys%time(j)) then + n2 = j + exit + endif + enddo + n1 = n2 - 1 + if (n2 > ozphys%ntime) n2 = n2 - ozphys%ntime + + !> - Update ozone concentration. + if (ntoz > 0) then + !$OMP CRITICAL + call ozphys%update_forcing(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) + !$OMP END CRITICAL + endif + !$OMP section !--- switch for saving convective clouds - cnvc90.f diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index 6ef6e226c..bf5a3fa04 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -2,7 +2,7 @@ name = GFS_phys_time_vary type = scheme dependencies = aerclm_def.F,aerinterp.F90,gcycle.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f - dependencies = namelist_soilveg.f,set_soilveg.f,sfcsub.F,cires_tauamf_data.F90,noahmp_tables.f90 + dependencies = namelist_soilveg.f,set_soilveg.f,sfcsub.F,cires_tauamf_data.F90,noahmp_tables.f90,module_ozphys.F90 ######################################################################## [ccpp-arg-table] @@ -72,6 +72,36 @@ dimensions = () type = integer intent = in + intent = in +[ntoz] + standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in +[jindx1_o3] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[jindx2_o3] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[ddy_o3] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in [nx] standard_name = number_of_points_in_x_direction_for_this_MPI_rank long_name = number of points in x direction for this MPI rank @@ -932,6 +962,13 @@ type = real kind = kind_phys intent = in +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -1107,6 +1144,13 @@ dimensions = () type = integer intent = in +[ntoz] + standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -1136,6 +1180,36 @@ type = real kind = kind_phys intent = out +[jindx1_o3] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[jindx2_o3] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[ddy_o3] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in +[ozpl] + standard_name = ozone_forcing + long_name = ozone forcing data + units = mixed + dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + type = real + kind = kind_phys + intent = inout [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -1868,6 +1942,13 @@ type = real kind = kind_phys intent = inout +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index f2183919f..69be4f8d0 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -45,8 +45,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& gasvmr_ccl4, gasvmr_cfc113, aerodp,ext550, clouds6, clouds7, clouds8, & clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, & faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, rrfs_sd, & - aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, latsozc, levozc, & - blatc, dphiozc, errmsg, errflg) + aero_dir_fdb, fdb_coef, spp_wts_rad, spp_rad, ico2, ozphys, & + errmsg, errflg) use machine, only: kind_phys @@ -54,7 +54,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& use funcphys, only: fpvs use module_radiation_astronomy,only: coszmn ! sol_init, sol_update - use module_radiation_gases, only: NF_VGAS, getgases, getozn ! gas_init, gas_update, + use module_radiation_gases, only: NF_VGAS, getgases ! gas_init, gas_update, use module_radiation_aerosols, only: NF_AESW, NF_AELW, setaer, & ! aer_init, aer_update, & NSPC1 use module_radiation_clouds, only: NF_CLDS, & ! cld_init @@ -81,6 +81,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& make_IceNumber, & make_DropletNumber, & make_RainNumber + ! For NRL Ozone + use module_ozphys, only: ty_ozphys implicit none integer, intent(in) :: im, levs, lm, lmk, lmp, ltp, & @@ -102,8 +104,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& imp_physics_mg, imp_physics_wsm6, & imp_physics_nssl, & imp_physics_fer_hires, & - yearlen, icloud, iaermdl, iaerflg, & - latsozc, levozc + yearlen, icloud, iaermdl, iaerflg integer, intent(in) :: & iovr, & ! choice of cloud-overlap method @@ -134,7 +135,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& integer, intent(in) :: spp_rad real(kind_phys), intent(in) :: spp_wts_rad(:,:) - real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp, dcorr_con, blatc, dphiozc + real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp, dcorr_con real(kind=kind_phys), intent(in) :: con_eps, epsm1, fvirt, rog, rocp, con_rd, con_pi, con_g, con_ttp, con_thgni real(kind=kind_phys), dimension(:), intent(in) :: xlat_d, xlat, xlon, & @@ -252,6 +253,9 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& integer :: iflag integer :: islmsk + ! For NRL Ozone + type(ty_ozphys),intent(in) :: ozphys + integer :: ids, ide, jds, jde, kds, kde, & ims, ime, jms, jme, kms, kme, & its, ite, jts, jte, kts, kte @@ -422,7 +426,6 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& !> - Get layer ozone mass mixing ratio (if use ozone climatology data, -!! call getozn()). if (ntoz > 0) then ! interactive ozone generation do k=1,lmk @@ -431,7 +434,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& enddo enddo else ! climatological ozone - call getozn (prslk1, xlat, im, lmk, top_at_1, latsozc, levozc, blatc, dphiozc, olyr) + call ozphys%oz_clim(xlat, prslk1, con_pi, olyr) endif ! end_if_ntoz !> - Call coszmn(), to compute cosine of zenith angle (only when SW is called) diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta index 038f59c27..a29b0ac3c 100644 --- a/physics/GFS_rrtmg_pre.meta +++ b/physics/GFS_rrtmg_pre.meta @@ -2,7 +2,7 @@ name = GFS_rrtmg_pre type = scheme dependencies = funcphys.f90,iounitdef.f,machine.F,module_bfmicrophysics.f,module_mp_radar.F90,module_mp_thompson.F90 - dependencies = module_mp_thompson_make_number_concentrations.F90,radcons.f90,radiation_aerosols.f + dependencies = module_mp_thompson_make_number_concentrations.F90,radcons.f90,radiation_aerosols.f,module_ozphys.F90 dependencies = radiation_astronomy.f,radiation_clouds.f,radiation_gases.f,radlw_param.f,radsw_param.f,surface_perturbation.F90,radiation_cloud_overlap.F90 ######################################################################## @@ -247,6 +247,13 @@ dimensions = () type = integer intent = in +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = in [iaermdl] standard_name = control_for_aerosol_radiation_scheme long_name = control of aerosol scheme in radiation @@ -1503,36 +1510,6 @@ dimensions = () type = integer intent = in -[latsozc] - standard_name = number_of_latitudes_in_ozone_climotology_data - long_name = number of latitude in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[levozc] - standard_name = number_of_levels_in_ozone_climotology_data - long_name = number of levels in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[dphiozc] - standard_name = ozone_data_parameter_1 - long_name = ozone data parameter 1 - units = none - dimensions = () - type = real - kind = kind_phys - intent = in -[blatc] - standard_name = ozone_data_parameter_2 - long_name = ozone data parameter 2 - units = none - dimensions = () - type = real - kind = kind_phys - intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 30917b961..908a364dc 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -7,7 +7,7 @@ module GFS_rrtmg_setup use machine, only: kind_phys - + use module_ozphys, only: ty_ozphys implicit none public GFS_rrtmg_setup_init, GFS_rrtmg_setup_timestep_init, GFS_rrtmg_setup_finalize @@ -44,7 +44,7 @@ subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & iaermdl, iaerflg, aeros_file, con_pi, con_t0c, con_c, con_boltz, & con_plnk, con_solr_2008, con_solr_2002, con_g, con_rd, co2usr_file, & co2cyc_file, rad_hr_units, inc_minor_gas, icliq_lw, isubcsw, isubclw,& - iswmode, latsozp, levozp, timeozp, ipsd0, ltp, lextop, errmsg, errflg) + iswmode, ipsd0, ltp, lextop, errmsg, errflg) ! ================= subprogram documentation block ================ ! ! ! ! subprogram: GFS_rrtmg_setup_init - a subprogram to initialize radiation ! @@ -155,8 +155,7 @@ subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & integer, intent(in) :: levr, ictm, isol, ico2, iaer, ntcw, num_p3d, & ltp, npdf3d, ntoz, iovr, iovr_rand, iovr_maxrand, iovr_max, & iovr_dcorr, iovr_exp, iovr_exprand, icliq_sw, imp_physics, & - iflip, me, rad_hr_units, icliq_lw, isubcsw, isubclw, iswmode, & - latsozp, levozp, timeozp + iflip, me, rad_hr_units, icliq_lw, isubcsw, isubclw, iswmode integer, intent(in) :: idate(:) logical, intent(in) :: lcrick, lcnorm, lnoprec, do_RRTMGP, lalw1bd, & inc_minor_gas, lextop @@ -219,8 +218,7 @@ subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & con_pi ) call aer_init ( levr, me, iaermdl, iaerflg, lalw1bd, aeros_file, & con_pi, con_t0c, con_c, con_boltz, con_plnk, errflg, errmsg) - call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, ntoz, & - con_pi, latsozp, levozp, timeozp, errflg, errmsg) + call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, con_pi, errflg, errmsg ) call cld_init ( si, levr, imp_physics, me, con_g, con_rd, errflg, errmsg) call rlwinit ( me, rad_hr_units, inc_minor_gas, icliq_lw, isubcsw, & iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, & @@ -246,7 +244,8 @@ end subroutine GFS_rrtmg_setup_init !! subroutine GFS_rrtmg_setup_timestep_init (idate, jdate, deltsw, deltim, & lsswr, me, iaermdl, iaerflg, isol, aeros_file, slag, sdec, cdec, & - solcon, con_pi, co2dat_file, co2gbl_file, ictm, ico2, ntoz, errmsg, errflg) + solcon, con_pi, co2dat_file, co2gbl_file, ictm, ico2, ntoz, ozphys,& + errmsg, errflg) implicit none @@ -259,6 +258,7 @@ subroutine GFS_rrtmg_setup_timestep_init (idate, jdate, deltsw, deltim, & logical, intent(in) :: lsswr integer, intent(in) :: me integer, intent(in) :: iaermdl, iaerflg, isol, ictm, ico2, ntoz + type(ty_ozphys), intent(inout) :: ozphys character(len=26), intent(in) :: aeros_file, co2dat_file, co2gbl_file real(kind=kind_phys), intent(out) :: slag real(kind=kind_phys), intent(out) :: sdec @@ -279,7 +279,7 @@ subroutine GFS_rrtmg_setup_timestep_init (idate, jdate, deltsw, deltim, & errflg = 0 call radupdate(idate,jdate,deltsw,deltim,lsswr,me,iaermdl, iaerflg,isol,aeros_file,& - slag,sdec,cdec,solcon,con_pi,co2dat_file,co2gbl_file,ictm,ico2,ntoz,errflg,errmsg) + slag,sdec,cdec,solcon,con_pi,co2dat_file,co2gbl_file,ictm,ico2,ntoz,ozphys,errflg,errmsg) end subroutine GFS_rrtmg_setup_timestep_init @@ -327,7 +327,7 @@ end subroutine GFS_rrtmg_setup_finalize !----------------------------------- subroutine radupdate( idate,jdate,deltsw,deltim,lsswr,me, iaermdl,& iaerflg, isol, aeros_file, slag,sdec,cdec,solcon, con_pi, & - co2dat_file,co2gbl_file, ictm, ico2, ntoz, errflg, errmsg) + co2dat_file,co2gbl_file, ictm, ico2, ntoz, ozphys, errflg, errmsg) !................................... ! ================= subprogram documentation block ================ ! @@ -371,6 +371,7 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr,me, iaermdl,& ! --- inputs: integer, intent(in) :: idate(:), jdate(:), me, iaermdl, iaerflg, isol, ictm, ntoz, ico2 + type(ty_ozphys),intent(inout) :: ozphys logical, intent(in) :: lsswr character(len=26),intent(in) :: aeros_file,co2dat_file,co2gbl_file @@ -463,8 +464,11 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr,me, iaermdl,& lco2_chg = .false. endif - call gas_update ( kyear,kmon,kday,khour,loz1st,lco2_chg, me, co2dat_file, & - co2gbl_file, ictm, ico2, ntoz, errflg, errmsg ) + call gas_update ( kyear,kmon,kday,khour,lco2_chg, me, co2dat_file, & + co2gbl_file, ictm, ico2, errflg, errmsg ) + if (ntoz == 0) then + call ozphys%update_clim(kmon, kday, khour, loz1st) + endif if ( loz1st ) loz1st = .false. diff --git a/physics/GFS_rrtmg_setup.meta b/physics/GFS_rrtmg_setup.meta index f92d6f8db..35713757b 100644 --- a/physics/GFS_rrtmg_setup.meta +++ b/physics/GFS_rrtmg_setup.meta @@ -2,7 +2,7 @@ name = GFS_rrtmg_setup type = scheme dependencies = iounitdef.f,module_bfmicrophysics.f,radcons.f90,radiation_aerosols.f,radiation_astronomy.f,radiation_clouds.f - dependencies = module_mp_thompson.F90,radiation_gases.f,radlw_main.F90,radlw_param.f,radsw_main.F90,radsw_param.f,machine.F + dependencies = module_mp_thompson.F90,radiation_gases.f,radlw_main.F90,radlw_param.f,radsw_main.F90,radsw_param.f,machine.F,module_ozphys.F90 ######################################################################## [ccpp-arg-table] @@ -173,27 +173,6 @@ dimensions = () type = integer intent = in -[levozp] - standard_name = number_of_levels_in_ozone_climotology_data - long_name = number of levels in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[timeozp] - standard_name = number_of_times_in_ozone_climotology_data - long_name = number of times in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_climotology_data - long_name = number of latitude in ozone climotology data - units = count - dimensions = () - type = integer - intent = in [icliq_sw] standard_name = control_for_shortwave_radiation_liquid_clouds long_name = sw optical property for liquid clouds @@ -530,6 +509,13 @@ dimensions = () type = integer intent = in +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = inout [con_pi] standard_name = pi long_name = ratio of a circle's circumference to its diameter diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index dd72a6a1c..9dcc002a0 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -8,7 +8,8 @@ module GFS_rrtmgp_pre use machine, only: kind_phys use funcphys, only: fpvs use module_radiation_astronomy, only: coszmn - use module_radiation_gases, only: NF_VGAS, getgases, getozn + use module_radiation_gases, only: NF_VGAS, getgases + use module_ozphys, only: ty_ozphys use mo_gas_concentrations, only: ty_gas_concs use radiation_tools, only: check_error_msg,cmp_tlev use rrtmgp_lw_gas_optics, only: lw_gas_props @@ -117,25 +118,23 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl vmr_n2o, vmr_co2, tsfg, tsfa, qs_lay, q_lay, tv_lay, & relhum, deltaZ, deltaZc, deltaP, active_gases_array, & tsfc_radtime, coszen, coszdg, top_at_1, iSFC, iTOA, nDay, idxday, semis, & - sfc_emiss_byband, ico2, latsozc, levozc, blatc, dphiozc, con_pi, errmsg, errflg) + sfc_emiss_byband, ico2, ozphys, con_pi, errmsg, errflg) - ! Inputs + ! Inputs integer, intent(in) :: & me, & ! MPI rank nCol, & ! Number of horizontal grid points nLev, & ! Number of vertical layers ico2, & ! Flag for co2 radiation scheme - i_o3, & ! Index into tracer array for ozone - latsozc, & ! - levozc + i_o3 ! Index into tracer array for ozone + type(ty_ozphys),intent(in) :: & + ozphys logical, intent(in) :: & doSWrad, & ! Call SW radiation? doLWrad ! Call LW radiation real(kind_phys), intent(in) :: & fhswr, & ! Frequency of SW radiation call. - fhlwr, & ! Frequency of LW radiation call. - blatc, & ! - dphiozc + fhlwr ! Frequency of LW radiation call. real(kind_phys), intent(in) :: & con_g, & ! Physical constant: gravitational constant con_rd, & ! Physical constant: gas-constant for dry air @@ -353,9 +352,8 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl enddo enddo ! OR Use climatological ozone data - else - call getozn (prslk(1:NCOL,:), xlat, nCol, nLev, top_at_1, latsozc, levozc, blatc, & - dphiozc, o3_lay) + else + call ozphys%oz_clim(xlat, prslk, con_pi, o3_lay) endif ! ####################################################################################### diff --git a/physics/GFS_rrtmgp_pre.meta b/physics/GFS_rrtmgp_pre.meta index 1a96eee1b..4e2aa3a56 100644 --- a/physics/GFS_rrtmgp_pre.meta +++ b/physics/GFS_rrtmgp_pre.meta @@ -2,7 +2,7 @@ name = GFS_rrtmgp_pre type = scheme dependencies = funcphys.f90,iounitdef.f,machine.F,module_bfmicrophysics.f,physcons.F90,radcons.f90,radiation_aerosols.f - dependencies = radiation_astronomy.f,radiation_gases.f,radiation_tools.F90,rrtmg_lw_cloud_optics.F90 + dependencies = radiation_astronomy.f,radiation_gases.f,radiation_tools.F90,rrtmg_lw_cloud_optics.F90,module_ozphys.F90 ######################################################################## [ccpp-arg-table] @@ -503,35 +503,12 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout -[latsozc] - standard_name = number_of_latitudes_in_ozone_climotology_data - long_name = number of latitude in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[levozc] - standard_name = number_of_levels_in_ozone_climotology_data - long_name = number of levels in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[dphiozc] - standard_name = ozone_data_parameter_1 - long_name = ozone data parameter 1 - units = none - dimensions = () - type = real - kind = kind_phys - intent = in -[blatc] - standard_name = ozone_data_parameter_2 - long_name = ozone data parameter 2 - units = none +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed dimensions = () - type = real - kind = kind_phys + type = ty_ozphys intent = in [errmsg] standard_name = ccpp_error_message diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index 7b5479e60..3e4f57d13 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -6,6 +6,7 @@ module GFS_rrtmgp_setup use module_radiation_astronomy, only : sol_init, sol_update use module_radiation_aerosols, only : aer_init, aer_update use module_radiation_gases, only : gas_init, gas_update + use module_ozphys, only : ty_ozphys implicit none public GFS_rrtmgp_setup_init, GFS_rrtmgp_setup_timestep_init, GFS_rrtmgp_setup_finalize @@ -37,7 +38,7 @@ module GFS_rrtmgp_setup subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, & imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, & imp_physics_zhao_carr_pdf, imp_physics_mg, si, levr, ictm, isol, ico2, iaer, & - ntcw, ntoz, iovr, latsozp, levozp, timeozp, isubc_sw, isubc_lw, lalw1bd, idate, & + ntcw, ntoz, iovr, isubc_sw, isubc_lw, lalw1bd, idate, & me, aeros_file, iaermdl, iaerflg, con_pi, con_t0c, con_c, con_boltz, con_plnk, & solar_file, con_solr_2008, con_solr_2002, co2usr_file, co2cyc_file, ipsd0, & errmsg, errflg) @@ -57,8 +58,7 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, con_pi, con_t0c, con_c, con_boltz, con_plnk, con_solr_2008, con_solr_2002 real(kind_phys), dimension(:), intent(in) :: & si - integer, intent(in) :: levr, ictm, isol, ico2, iaer, & - ntcw, ntoz, iovr, isubc_sw, isubc_lw, latsozp, levozp, timeozp, me + integer, intent(in) :: levr, ictm, isol, ico2, iaer, ntcw, ntoz, iovr, isubc_sw, isubc_lw, me logical, intent(in) :: & lalw1bd integer, intent(in), dimension(:) :: & @@ -129,8 +129,7 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, call sol_init ( me, isol, solar_file, con_solr_2008, con_solr_2002, con_pi ) call aer_init ( levr, me, iaermdl, iaerflg, lalw1bd, aeros_file, con_pi, con_t0c, & con_c, con_boltz, con_plnk, errflg, errmsg) - call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, ntoz, con_pi, latsozp, & - levozp, timeozp, errflg, errmsg ) + call gas_init ( me, co2usr_file, co2cyc_file, ico2, ictm, con_pi, errflg, errmsg ) if ( me == 0 ) then print *,' return from rad_initialize (GFS_rrtmgp_setup_init) - after calling radinit' @@ -149,7 +148,7 @@ end subroutine GFS_rrtmgp_setup_init !! subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad, me, & iaermdl, aeros_file, isol, slag, sdec, cdec, solcon, con_pi, co2dat_file, & - co2gbl_file, ictm, ico2, ntoz, errmsg, errflg) + co2gbl_file, ictm, ico2, ntoz, ozphys, errmsg, errflg) ! Inputs integer, intent(in) :: idate(:) @@ -161,7 +160,7 @@ subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad integer, intent(in) :: me integer, intent(in) :: iaermdl,isol,ictm,ico2,ntoz character(len=26), intent(in) :: aeros_file,co2dat_file,co2gbl_file - + type(ty_ozphys),intent(inout) :: ozphys ! Outputs real(kind_phys), intent(out) :: slag real(kind_phys), intent(out) :: sdec @@ -241,8 +240,11 @@ subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad else lco2_chg = .false. endif - call gas_update (kyear, kmon, kday, khour, loz1st, lco2_chg, me, co2dat_file, & - co2gbl_file, ictm, ico2, ntoz, errflg, errmsg ) + call gas_update (kyear, kmon, kday, khour, lco2_chg, me, co2dat_file, co2gbl_file, ictm,& + ico2, errflg, errmsg ) + if (ntoz == 0) then + call ozphys%update_clim(kmon, kday, khour, loz1st) + endif if ( loz1st ) loz1st = .false. diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/GFS_rrtmgp_setup.meta index c8ed60650..96f7e24e7 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/GFS_rrtmgp_setup.meta @@ -2,7 +2,7 @@ name = GFS_rrtmgp_setup type = scheme dependencies = iounitdef.f,machine.F,module_bfmicrophysics.f,radiation_aerosols.f,radiation_astronomy.f - dependencies = module_mp_thompson.F90,radiation_gases.f + dependencies = module_mp_thompson.F90,radiation_gases.f,module_ozphys.F90 ######################################################################## [ccpp-arg-table] @@ -266,27 +266,6 @@ dimensions = () type = integer intent = inout -[levozp] - standard_name = number_of_levels_in_ozone_climotology_data - long_name = number of levels in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[timeozp] - standard_name = number_of_times_in_ozone_climotology_data - long_name = number of times in ozone climotology data - units = count - dimensions = () - type = integer - intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_climotology_data - long_name = number of latitude in ozone climotology data - units = count - dimensions = () - type = integer - intent = in [iaermdl] standard_name = control_for_aerosol_radiation_scheme long_name = control of aerosol scheme in radiation @@ -410,6 +389,13 @@ dimensions = () type = integer intent = in +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = inout [iaermdl] standard_name = control_for_aerosol_radiation_scheme long_name = control of aerosol scheme in radiation diff --git a/physics/module_ozphys.F90 b/physics/module_ozphys.F90 new file mode 100644 index 000000000..966d27113 --- /dev/null +++ b/physics/module_ozphys.F90 @@ -0,0 +1,476 @@ +! ######################################################################################### +!> \section arg_table_module_ozphys Argument table +!! \htmlinclude module_ozphys.html +!! +! ######################################################################################### +module module_ozphys + use machine, only : kind_phys + use funcphys, only : fpkapx + implicit none + + public ty_ozphys + +! ######################################################################################### +!> \section arg_table_ty_ozphys Argument Table +!! \htmlinclude ty_ozphys.html +!! +!! All data field are ordered from surface-to-toa (j=1=isfc) +!! +! ######################################################################################### + type ty_ozphys + ! Prognostic ozone. + integer :: nlat !< Number of latitudes. + integer :: nlev !< Number of vertical layers. + integer :: ntime !< Number of times. + integer :: ncf !< Number of coefficients. + real(kind_phys), allocatable :: lat(:) !< Latitude. + real(kind_phys), allocatable :: pres(:) !< Pressure levels. + real(kind_phys), allocatable :: po3(:) !< Natural log pressure of levels. + real(kind_phys), allocatable :: time(:) !< Time. + real(kind_phys), allocatable :: data(:,:,:,:) !< Ozone forcing data (raw) + ! Climotological ozone. + integer :: nlatc !< Number of latitudes. + integer :: nlevc !< Number of vertical layers. + integer :: ntimec !< Number of times. + real(kind_phys) :: blatc !< Parameter for ozone climotology + real(kind_phys) :: dphiozc !< Parameter for ozone climotology + real(kind_phys), allocatable :: pkstr(:) !< + real(kind_phys), allocatable :: pstr(:) !< + real(kind_phys), allocatable :: datac(:,:,:) !< Ozone climotological data + integer :: k1oz !< Lower interpolation index in datac(dim=3), time dim + integer :: k2oz !< Upper interpolation index in datac(dim=3), time dim + real(kind_phys) :: facoz !< Parameter for ozone climotology + contains + procedure, public :: load_forcing + procedure, public :: load_clim + procedure, public :: setup_forcing + procedure, public :: update_forcing + procedure, public :: update_clim + procedure, public :: oz_prog_2015 + procedure, public :: oz_prog_2006 + procedure, public :: oz_clim + end type ty_ozphys + +contains + ! ######################################################################################### + ! Procedure (type-bound) for loading ozone forcing data. + ! ######################################################################################### + function load_forcing(this, file, fileID) result (err_message) + class(ty_ozphys), intent(inout) :: this + integer, intent(in) :: fileID + character(len=*), intent(in) :: file + character(len=128) :: err_message + integer :: i1, i2, i3 + real(kind=4), dimension(:), allocatable :: lat4, pres4, time4, tempin + real(kind=4) :: blatc4 + + ! Get dimensions from data file + open(unit=fileID,file=trim(file), form='unformatted', convert='big_endian') + read (fileID) this%ncf, this%nlat, this%nlev, this%ntime + rewind(fileID) + + allocate (this%lat(this%nlat)) + allocate (this%pres(this%nlev)) + allocate (this%po3(this%nlev)) + allocate (this%time(this%ntime+1)) + allocate (this%data(this%nlat,this%nlev,this%ncf,this%ntime)) + + allocate(lat4(this%nlat), pres4(this%nlev), time4(this%ntime+1)) + read (fileID) this%ncf, this%nlat, this%nlev, this%ntime, lat4, pres4, time4 + + ! Store + this%pres(:) = pres4(:) + this%po3(:) = log(100.0*this%pres(:)) ! from mb to ln(Pa) + this%lat(:) = lat4(:) + this%time(:) = time4(:) + deallocate(lat4, pres4, time4) + + allocate(tempin(this%nlat)) + do i1=1,this%ntime + do i2=1,this%ncf + do i3=1,this%nlev + read(fileID) tempin + this%data(:,i3,i2,i1) = tempin(:) + enddo + enddo + enddo + deallocate(tempin) + close(fileID) + + end function load_forcing + + ! ######################################################################################### + ! Procedure for setting up interpolation indices between data and model grid. + ! ######################################################################################### + subroutine setup_forcing(this, lat, idx1, idx2, idxh) + class(ty_ozphys), intent(in) :: this + real(kind_phys), intent(in) :: lat(:) + integer, intent(out) :: idx1(:), idx2(:) + real(kind_phys), intent(out) :: idxh(:) + integer :: i,j + + do j=1,size(lat) + idx2(j) = this%nlat + 1 + do i=1,this%nlat + if (lat(j) < this%lat(i)) then + idx2(j) = i + exit + endif + enddo + idx1(j) = max(idx2(j)-1,1) + idx2(j) = min(idx2(j),this%nlat) + if (idx2(j) .ne. idx1(j)) then + idxh(j) = (lat(j) - this%lat(idx1(j))) / (this%lat(idx2(j)) - this%lat(idx1(j))) + else + idxh(j) = 1.0 + endif + enddo + + end subroutine setup_forcing + + ! ######################################################################################### + ! Procedure (type-bound) for updating ozone data. + ! ######################################################################################### + subroutine update_forcing(this, idx1, idx2, idxh, rjday, idxt1, idxt2, ozpl) + class(ty_ozphys), intent(in) :: this + integer, intent(in) :: idx1(:), idx2(:) + real(kind_phys), intent(in) :: idxh(:) + real(kind_phys), intent(in) :: rjday + integer, intent(in) :: idxt1, idxt2 + real(kind_phys), intent(out) :: ozpl(:,:,:) + integer :: nc, l, j, j1, j2 + real(kind_phys) :: tem, tx1, tx2 + + tx1 = (this%time(idxt2) - rjday) / (this%time(idxt2) - this%time(idxt1)) + tx2 = 1.0 - tx1 + + do nc=1,this%ncf + do l=1,this%nlev + do j=1,size(ozpl(:,1,1)) + j1 = idx1(j) + j2 = idx2(j) + tem = 1.0 - idxh(j) + ozpl(j,l,nc) = tx1*(tem*this%data(j1,l,nc,idxt1)+idxh(j)*this%data(j2,l,nc,idxt1)) & + + tx2*(tem*this%data(j1,l,nc,idxt2)+idxh(j)*this%data(j2,l,nc,idxt2)) + enddo + enddo + enddo + + end subroutine update_forcing + + ! ######################################################################################### + ! Procedure (type-bound) for NRL prognostic ozone (2015). + ! ######################################################################################### + subroutine oz_prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, do3_dt_ozmx, & + do3_dt_temp, do3_dt_ohoz) + class(ty_ozphys), intent(in) :: this + real(kind_phys),intent(in) :: & + con_1ovg ! Physical constant: One divided by gravitational acceleration (m-1 s2) + real(kind_phys), intent(in) :: & + dt ! Model timestep (sec) + real(kind_phys), intent(in), dimension(:,:) :: & + p, & ! Model Pressure (Pa) + t, & ! Model temperature (K) + dp ! Model layer thickness (Pa) + real(kind_phys), intent(in), dimension(:,:,:) :: & + ozpl ! Ozone forcing data + real(kind_phys), intent(inout), dimension(:,:) :: & + oz ! Ozone concentration updated by physics + real(kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + do3_dt_prd, & ! Physics tendency: production and loss effect + do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect + do3_dt_temp, & ! Physics tendency: temperature effect + do3_dt_ohoz ! Physics tendency: overhead ozone effect + + integer :: k, kmax, kmin, iLev, iCol, nCol, nLev, iCf + logical, dimension(size(p,1)) :: flg + real(kind_phys) :: pmax, pmin, tem, temp + real(kind_phys), dimension(size(p,1)) :: wk1, wk2, wk3, ozib + real(kind_phys), dimension(size(p,1),this%ncf) :: prod + real(kind_phys), dimension(size(p,1),size(p,2)) :: ozi + real(kind_phys), dimension(size(p,1),size(p,2)+1) :: colo3, coloz + + ! Dimensions + nCol = size(p,1) + nLev = size(p,2) + + ! Temporaries + ozi = oz + + colo3(:,nLev+1) = 0.0 + coloz(:,nLev+1) = 0.0 + + do iLev=nLev,1,-1 + pmin = 1.0e10 + pmax = -1.0e10 + + do iCol=1,nCol + wk1(iCol) = log(p(iCol,iLev)) + pmin = min(wk1(iCol), pmin) + pmax = max(wk1(iCol), pmax) + prod(iCol,:) = 0._kind_phys + enddo + kmax = 1 + kmin = 1 + do k=1,this%nlev-1 + if (pmin < this%po3(k)) kmax = k + if (pmax < this%po3(k)) kmin = k + enddo + ! + do k=kmin,kmax + temp = 1.0 / (this%po3(k) - this%po3(k+1)) + do iCol=1,nCol + flg(iCol) = .false. + if (wk1(iCol) < this%po3(k) .and. wk1(iCol) >= this%po3(k+1)) then + flg(iCol) = .true. + wk2(iCol) = (wk1(iCol) - this%po3(k+1)) * temp + wk3(iCol) = 1.0 - wk2(iCol) + endif + enddo + do iCf=1,this%ncf + do iCol=1,nCol + if (flg(iCol)) then + prod(iCol,iCf) = wk2(iCol) * ozpl(iCol,k,iCf) + wk3(iCol) * ozpl(iCol,k+1,iCf) + endif + enddo + enddo + enddo + + do iCf=1,this%ncf + do iCol=1,nCol + if (wk1(iCol) < this%po3(this%nlev)) then + prod(iCol,iCf) = ozpl(iCol,this%nlev,iCf) + endif + if (wk1(iCol) >= this%po3(1)) then + prod(iCol,iCf) = ozpl(iCol,1,iCf) + endif + enddo + enddo + do iCol=1,nCol + colo3(iCol,iLev) = colo3(iCol,iLev+1) + ozi(iCol,iLev) * dp(iCol,iLev)*con_1ovg + coloz(iCol,iLev) = coloz(iCol,iLev+1) + prod(iCol,6) * dp(iCol,iLev)*con_1ovg + prod(iCol,2) = min(prod(iCol,2), 0.0) + enddo + do iCol=1,nCol + ozib(iCol) = ozi(iCol,iLev) ! no filling + tem = prod(iCol,1) - prod(iCol,2) * prod(iCol,6) & + + prod(iCol,3) * (t(iCol,iLev) - prod(iCol,5)) & + + prod(iCol,4) * (colo3(iCol,iLev)-coloz(iCol,iLev)) + oz(iCol,iLev) = (ozib(iCol) + tem*dt) / (1.0 - prod(iCol,2)*dt) + enddo + + ! Diagnostics (optional) + if (associated(do3_dt_prd)) do3_dt_prd(:,iLev) = (prod(:,1)-prod(:,2)*prod(:,6))*dt + if (associated(do3_dt_ozmx)) do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) + if (associated(do3_dt_temp)) do3_dt_temp(:,iLev) = prod(:,3)*(t(:,iLev)-prod(:,5))*dt + if (associated(do3_dt_ohoz)) do3_dt_ohoz(:,iLev) = prod(:,4) * (colo3(:,iLev)-coloz(:,iLev))*dt + enddo + + return + end subroutine oz_prog_2015 + + ! ######################################################################################### + ! Procedure (type-bound) for NRL prognostic ozone (2006). + ! ######################################################################################### + subroutine oz_prog_2006(this) + class(ty_ozphys), intent(in) :: this + return + end subroutine oz_prog_2006 + + ! ######################################################################################### + ! Procedure (type-bound) for NRL updating climotological ozone. + ! Build this up from getozn. + ! ######################################################################################### + subroutine oz_clim(this, lat, prslk, con_pi, oz) + class(ty_ozphys), intent(in) :: this + real(kind_phys), intent(in) :: & + con_pi ! Physics constant: Pi + real(kind_phys), intent(in), dimension(:) :: & + lat ! Grid latitude + real(kind_phys), intent(in), dimension(:,:) :: & + prslk ! Exner function + real(kind_phys), intent(out), dimension(:,:) :: & + oz ! Ozone concentration updated by climotology + + integer :: nCol, iCol, nLev, iLev, j, j1, j2, l, ll + real(kind_phys) :: elte, deglat, tem, tem1, tem2, tem3, tem4, temp + real(kind_phys), allocatable :: o3i(:,:),wk1(:) + logical :: top_at_1 + + nCol = size(prslk(:,1)) + nLev = size(prslk(1,:)) + allocate(o3i(nCol, this%nlevc),wk1(nCol)) + + ! What is vertical ordering? + top_at_1 = (prslk(1,1) .lt. prslk(1, nLev)) + + elte = this%blatc + (this%nlatc-1)*this%dphiozc + + do iCol = 1, nCol + deglat = lat(iCol) * 180.0 / con_pi + if (deglat > this%blatc .and. deglat < elte) then + tem1 = (deglat - this%blatc) / this%dphiozc + 1 + j1 = tem1 + j2 = j1 + 1 + tem1 = tem1 - j1 + elseif (deglat <= this%blatc) then + j1 = 1 + j2 = 1 + tem1 = 1.0 + elseif (deglat >= elte) then + j1 = this%nlatc + j2 = this%nlatc + tem1 = 1.0 + endif + + tem2 = 1.0 - tem1 + do j = 1, this%nlevc + tem3 = tem2*this%datac(j1,j,this%k1oz) + tem1*this%datac(j2,j,this%k1oz) + tem4 = tem2*this%datac(j1,j,this%k2oz) + tem1*this%datac(j2,j,this%k2oz) + o3i(iCol,j) = tem4*this%facoz + tem3*(1.0 - this%facoz) + enddo + enddo + + do iLev = 1, nLev + ll = iLev + if (.not. top_at_1) ll = nLev - iLev + 1 + + do iCol = 1, nCol + wk1(iCol) = prslk(iCol,ll) + enddo + + do j = 1, this%nlevc-1 + temp = 1.0 / (this%pkstr(j+1) - this%pkstr(j)) + do iCol = 1, nCol + if (wk1(iCol) > this%pkstr(j) .and. wk1(iCol) <= this%pkstr(j+1)) then + tem = (this%pkstr(j+1) - wk1(iCol)) * temp + oz(iCol,ll) = tem * o3i(iCol,j) + (1.0 - tem) * o3i(iCol,j+1) + endif + enddo + enddo + + do iCol = 1, nCol + if (wk1(iCol) > this%pkstr(this%nlevc)) oz(iCol,ll) = o3i(iCol,this%nlevc) + if (wk1(iCol) < this%pkstr(1)) oz(iCol,ll) = o3i(iCol,1) + enddo + enddo + + return + end subroutine oz_clim + + ! ######################################################################################### + ! Procedure (type-bound) for loading ozone climo data. + ! ######################################################################################### + function load_clim(this, file, fileID) result (err_message) + class(ty_ozphys), intent(inout) :: this + integer, intent(in) :: fileID + character(len=*), intent(in) :: file + character(len=128) :: err_message + + ! Locals + real(kind=4) :: blatc4 + integer :: iLev, iLat, imo + real(kind=4), allocatable :: o3clim4(:,:,:), pstr4(:) + integer, allocatable :: imond(:), ilatt(:,:) + + open(unit=fileID,file=trim(file), form='unformatted', convert='big_endian') + read (fileID,end=101) this%nlatc, this%nlevc, this%ntimec, blatc4 +101 if (this%nlevc < 10 .or. this%nlevc > 100) then + rewind (fileID) + this%nlevc = 17 + this%nlatc = 18 + this%blatc = -85.0 + else + this%blatc = blatc4 + endif + this%nlat = 2 + this%nlev = 1 + this%ntimec = 1 + this%ncf = 0 + this%dphiozc = -(this%blatc+this%blatc)/(this%nlatc-1) + + allocate (o3clim4(this%nlatc,this%nlevc,12), pstr4(this%nlevc), imond(12), ilatt(this%nlatc,12) ) + + allocate (this%pkstr(this%nlevc), this%pstr(this%nlevc), this%datac(this%nlatc,this%nlevc,12)) + if ( this%nlevc == 17 ) then ! For the operational ozone climatology + do iLev = 1, this%nlevc + read (fileID,15) pstr4(iLev) +15 format(f10.3) + enddo + + do imo = 1, 12 + do iLat = 1, this%nlatc + read (fileID,16) imond(imo), ilatt(iLat,imo), (o3clim4(iLat,iLev,imo),iLev=1,10) +16 format(i2,i4,10f6.2) + read (fileID,20) (o3clim4(iLat,iLev,imo),iLev=11,this%nlevc) +20 format(6x,10f6.2) + enddo + enddo + else ! For newer ozone climatology + read (fileID) + do iLev = 1, this%nlevc + read (fileID) pstr4(iLev) + enddo + + do imo = 1, 12 + do iLev = 1, this%nlevc + read (fileID) (o3clim4(iLat,iLev,imo),iLat=1,this%nlatc) + enddo + enddo + endif ! end if_this%nlevc_block + + do imo = 1, 12 + do iLev = 1, this%nlevc + do iLat = 1, this%nlatc + this%datac(iLat,iLev,imo) = o3clim4(iLat,iLev,imo) * 1.655e-6 + enddo + enddo + enddo + + do iLev = 1, this%nlevc + this%pstr(iLev) = pstr4(iLev) + this%pkstr(iLev) = fpkapx(this%pstr(iLev)*100.0) + enddo + + end function load_clim + + ! ######################################################################################### + ! Procedure (type-bound) for updating ozone climotological data. + ! ######################################################################################### + subroutine update_clim(this, imon, iday, ihour, loz1st) + class(ty_ozphys), intent(inout) :: this + integer, intent(in) :: imon, iday, ihour + logical, intent(in) :: loz1st + + integer :: midmon=15, midm=15, midp=45, id + integer, parameter, dimension(13) :: mdays = (/31,28,31,30,31,30,31,31,30,31,30,31,30/) + logical :: change + + midmon = mdays(imon)/2 + 1 + change = loz1st .or. ( (iday==midmon) .and. (ihour==0) ) + + if ( change ) then + if ( iday < midmon ) then + this%k1oz = mod(imon+10, 12) + 1 + midm = mdays(this%k1oz)/2 + 1 + this%k2oz = imon + midp = mdays(this%k1oz) + midmon + else + this%k1oz = imon + midm = midmon + this%k2oz = mod(imon, 12) + 1 + midp = mdays(this%k2oz)/2 + 1 + mdays(this%k1oz) + endif + endif + + if (iday < midmon) then + id = iday + mdays(this%k1oz) + else + id = iday + endif + + this%facoz = float(id - midm) / float(midp - midm) + + end subroutine update_clim + +end module module_ozphys diff --git a/physics/module_ozphys.meta b/physics/module_ozphys.meta new file mode 100644 index 000000000..2922d16d7 --- /dev/null +++ b/physics/module_ozphys.meta @@ -0,0 +1,24 @@ +[ccpp-table-properties] + name = ty_ozphys + type = ddt + dependencies = + +[ccpp-arg-table] + name = ty_ozphys + type = ddt + +######################################################################## +[ccpp-table-properties] + name = module_ozphys + type = module + dependencies = machine.F,funcphys.f90 + +[ccpp-arg-table] + name = module_ozphys + type = module +[ty_ozphys] + standard_name = ty_ozphys + long_name = definition of type ty_ozphys + units = DDT + dimensions = () + type = ty_ozphys \ No newline at end of file diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 index 47386bd6e..1478d0d6e 100644 --- a/physics/ozphys_2015.F90 +++ b/physics/ozphys_2015.F90 @@ -3,89 +3,57 @@ !! ! ########################################################################################### module ozphys_2015 - use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec + use machine, only: kind_phys, kind_dbl_prec, kind_sngl_prec + use module_ozphys, only: ty_ozphys implicit none - public ozphys_2015_init, ozphys_2015_run + public ozphys_2015_run contains ! ########################################################################################### !>\defgroup GFS_ozphys_2015 GFS Ozone Photochemistry (2015) Module !! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. !> @{ -!> The operational GFS currently parameterizes ozone production and -!! destruction based on monthly mean coefficients ( -!! \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by Naval -!! Research Laboratory through CHEM2D chemistry model +!> The operational GFS currently parameterizes ozone production and destruction based on +!! monthly mean coefficients ( \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by +!! Naval Research Laboratory through CHEM2D chemistry model !! (McCormack et al. (2006) \cite mccormack_et_al_2006). !! (https://doi.org/10.5194/acp-6-4943-2006) !! !> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm -!> - This code assumes that both prsl and po3 are from bottom to top -!! as are all other variables. -!> - This code is specifically for NRL parameterization and -!! climatological T and O3 are in location 5 and 6 of oz_data array +!> - This code assumes that both 2D fields are ordered from bottom to top. +!> - This code is specifically for NRL parameterization and climatological T and O3 are in +! location 5 and 6 of ozpl array !!\author June 2015 - Shrinivas Moorthi !!\modified May 2023 - Dustin Swales ! ########################################################################################### -! ########################################################################################### -! SUBROUTINE ozphys_2015_init -! ########################################################################################### -!! \section arg_table_ozphys_2015_init Argument Table -!! \htmlinclude ozphys_2015_init.html -!! - subroutine ozphys_2015_init(oz_phys, errmsg, errflg) - ! Inputs - logical, intent(in) :: & - oz_phys - ! Outputs - character(len=*), intent(out) :: & - errmsg - integer, intent(out) :: & - errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Sanity check - if (.not.oz_phys) then - write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' - errflg = 1 - return - endif - - end subroutine ozphys_2015_init - ! ########################################################################################### ! SUBROUTINE ozphys_2015_run ! ########################################################################################### !! \section arg_table_ozphys_2015_run Argument Table !! \htmlinclude ozphys_2015_run.html !! - subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_data, & - pl_coeff, delp, con_1ovg, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) + subroutine ozphys_2015_run (oz_phys, ozphys, nCol, nLev, dt, oz, tin, prsl, ozpl, & + delp, con_1ovg, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) ! Inputs logical, intent(in) :: & oz_phys ! Flag for ozone_physics_2015 scheme. + type(ty_ozphys),intent(in) :: & + ozphys real(kind_phys),intent(in) :: & con_1ovg ! Physical constant: One divided by gravitational acceleration (m-1 s2) integer, intent(in) :: & - im, & ! Horizontal dimension - levs, & ! Number of vertical layers - ko3, & ! Number of vertical layers in ozone forcing data - pl_coeff ! Number of coefficients in ozone forcing data + nCol, & ! Horizontal dimension + nLev ! Number of vertical layers real(kind_phys), intent(in) :: & dt ! Physics timestep (seconds) - real(kind_phys), intent(in), dimension(:) :: & - po3 ! Natural log of ozone forcing data pressure levels real(kind_phys), intent(in), dimension(:,:) :: & prsl, & ! Air-pressure (Pa) tin, & ! Temperature of new-state (K) delp ! Difference between mid-layer pressures (Pa) real(kind_phys), intent(in), dimension(:,:,:) :: & - oz_data ! Ozone forcing data + ozpl ! Ozone forcing data ! Outputs (optional) real(kind=kind_phys), intent(inout), dimension(:,:), pointer, optional :: & @@ -96,26 +64,26 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d ! Outputs real(kind=kind_phys), intent(inout), dimension(:,:) :: & - oz ! Ozone concentration updated by physics + oz ! Ozone concentration updated by physics character(len=*), intent(out) :: & - errmsg ! CCPP error message + errmsg ! CCPP error message integer, intent(out) :: & - errflg ! CCPP error flag + errflg ! CCPP error flag ! Locals integer :: k, kmax, kmin, l, i, j - logical, dimension(im) :: flg + logical, dimension(nCol) :: flg real(kind_phys) :: pmax, pmin, tem, temp - real(kind_phys), dimension(im) :: wk1, wk2, wk3, ozib - real(kind_phys), dimension(im,pl_coeff) :: prod - real(kind_phys), dimension(im,levs) :: ozi - real(kind_phys), dimension(im,levs+1) :: colo3, coloz + real(kind_phys), dimension(nCol) :: wk1, wk2, wk3, ozib + real(kind_phys), dimension(nCol,ozphys%ncf) :: prod + real(kind_phys), dimension(nCol,nLev) :: ozi + real(kind_phys), dimension(nCol,nLev+1) :: colo3, coloz ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - ! Sanity checkt + ! Sanity checks if (.not.oz_phys) then write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' errflg = 1 @@ -125,14 +93,14 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d ! Temporaries ozi = oz - colo3(:,levs+1) = 0.0 - coloz(:,levs+1) = 0.0 + colo3(:,nLev+1) = 0.0 + coloz(:,nLev+1) = 0.0 - do l=levs,1,-1 + do l=nLev,1,-1 pmin = 1.0e10 pmax = -1.0e10 - do i=1,im + do i=1,nCol wk1(i) = log(prsl(i,l)) pmin = min(wk1(i), pmin) pmax = max(wk1(i), pmax) @@ -140,46 +108,46 @@ subroutine ozphys_2015_run (oz_phys, im, levs, ko3, dt, oz, tin, po3, prsl, oz_d enddo kmax = 1 kmin = 1 - do k=1,ko3-1 - if (pmin < po3(k)) kmax = k - if (pmax < po3(k)) kmin = k + do k=1,ozphys%nlev-1 + if (pmin < ozphys%po3(k)) kmax = k + if (pmax < ozphys%po3(k)) kmin = k enddo ! do k=kmin,kmax - temp = 1.0 / (po3(k) - po3(k+1)) - do i=1,im + temp = 1.0 / (ozphys%po3(k) - ozphys%po3(k+1)) + do i=1,nCol flg(i) = .false. - if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1)) then + if (wk1(i) < ozphys%po3(k) .and. wk1(i) >= ozphys%po3(k+1)) then flg(i) = .true. - wk2(i) = (wk1(i) - po3(k+1)) * temp + wk2(i) = (wk1(i) - ozphys%po3(k+1)) * temp wk3(i) = 1.0 - wk2(i) endif enddo - do j=1,pl_coeff - do i=1,im + do j=1,ozphys%ncf + do i=1,nCol if (flg(i)) then - prod(i,j) = wk2(i) * oz_data(i,k,j) + wk3(i) * oz_data(i,k+1,j) + prod(i,j) = wk2(i) * ozpl(i,k,j) + wk3(i) * ozpl(i,k+1,j) endif enddo enddo enddo - do j=1,pl_coeff - do i=1,im - if (wk1(i) < po3(ko3)) then - prod(i,j) = oz_data(i,ko3,j) + do j=1,ozphys%ncf + do i=1,nCol + if (wk1(i) < ozphys%po3(ozphys%nlev)) then + prod(i,j) = ozpl(i,ozphys%nlev,j) endif - if (wk1(i) >= po3(1)) then - prod(i,j) = oz_data(i,1,j) + if (wk1(i) >= ozphys%po3(1)) then + prod(i,j) = ozpl(i,1,j) endif enddo enddo - do i=1,im + do i=1,nCol colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l)*con_1ovg coloz(i,l) = coloz(i,l+1) + prod(i,6) * delp(i,l)*con_1ovg prod(i,2) = min(prod(i,2), 0.0) enddo - do i=1,im + do i=1,nCol ozib(i) = ozi(i,l) ! no filling tem = prod(i,1) - prod(i,2) * prod(i,6) + prod(i,3) * (tin(i,l) - prod(i,5)) & + prod(i,4) * (colo3(i,l)-coloz(i,l)) diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta index 1d8fba74e..ca2d56e4e 100644 --- a/physics/ozphys_2015.meta +++ b/physics/ozphys_2015.meta @@ -1,11 +1,11 @@ [ccpp-table-properties] name = ozphys_2015 type = scheme - dependencies = machine.F + dependencies = machine.F,module_ozphys.F90 ######################################################################## [ccpp-arg-table] - name = ozphys_2015_init + name = ozphys_2015_run type = scheme [oz_phys] standard_name = flag_for_nrl_2015_ozone_scheme @@ -14,54 +14,27 @@ dimensions = () type = logical intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - -######################################################################## -[ccpp-arg-table] - name = ozphys_2015_run - type = scheme -[oz_phys] - standard_name = flag_for_nrl_2015_ozone_scheme - long_name = flag for new (2015) ozone physics - units = flag +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed dimensions = () - type = logical + type = ty_ozphys intent = in -[im] +[nCol] standard_name = horizontal_loop_extent long_name = horizontal loop extent units = count dimensions = () type = integer intent = in -[levs] +[nLev] standard_name = vertical_layer_dimension long_name = number of vertical layers units = count dimensions = () type = integer intent = in -[ko3] - standard_name = number_of_levels_in_ozone_data - long_name = number of vertical layers in ozone forcing data - units = count - dimensions = () - type = integer - intent = in [dt] standard_name = timestep_for_physics long_name = physics time step @@ -86,14 +59,6 @@ type = real kind = kind_phys intent = in -[po3] - standard_name = natural_log_of_ozone_data_pressure_levels - long_name = natural log of ozone forcing data pressure levels - units = 1 - dimensions = (number_of_levels_in_ozone_data) - type = real - kind = kind_phys - intent = in [prsl] standard_name = air_pressure long_name = mid-layer pressure @@ -102,7 +67,7 @@ type = real kind = kind_phys intent = in -[oz_data] +[ozpl] standard_name = ozone_forcing long_name = ozone forcing data units = mixed @@ -110,13 +75,6 @@ type = real kind = kind_phys intent = in -[pl_coeff] - standard_name = number_of_coefficients_in_ozone_data - long_name = number of coefficients in ozone forcing data - units = count - dimensions = () - type = integer - intent = in [delp] standard_name = air_pressure_difference_between_midlayers long_name = difference between mid-layer pressures diff --git a/physics/ozphys_time_vary.F90 b/physics/ozphys_time_vary.F90 deleted file mode 100644 index ddac1dcd4..000000000 --- a/physics/ozphys_time_vary.F90 +++ /dev/null @@ -1,165 +0,0 @@ -! ########################################################################################### -!> \file ozphys_time_vary.F90 -!! -! ########################################################################################### -module ozphys_time_vary - use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec - implicit none - public ozphys_time_vary_init, ozphys_time_vary_timestep_init -contains - -! ########################################################################################### -!>\defgroup GFS Ozone Data Module -!! This module updates the ozone data used by physics. -!> @{ -!> \section arg_table_ozphys_time_vary_init Argument Table -!! \htmlinclude ozphys_time_vary_init.html -!! -! ########################################################################################### - subroutine ozphys_time_vary_init(nPts, latsozp, oz_lat, dlat, jindx1, jindx2, ddy, & - errmsg, errflg) - ! Inputs - integer, intent(in) :: & - nPts, & ! Horizontal dimension - latsozp ! Number of latitudes in ozone data - real(kind_phys), intent(in), dimension(:) :: & - oz_lat, & ! Latitudes of ozone data - dlat ! Latitudes of grid - ! Outputs - integer, intent(inout), dimension(:) :: & - jindx1, & ! Interpolation index (low) for ozone data - jindx2 ! Interpolation index (high) for ozone data - real(kind_phys), intent(inout), dimension(:) :: & - ddy ! Interpolation high index for ozone data - character(len=*), intent(out) :: & - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag - - ! Local - integer i,j - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Set indices - do j=1,nPts - jindx2(j) = latsozp + 1 - do i=1,latsozp - if (dlat(j) < oz_lat(i)) then - jindx2(j) = i - exit - endif - enddo - jindx1(j) = max(jindx2(j)-1,1) - jindx2(j) = min(jindx2(j),latsozp) - if (jindx2(j) .ne. jindx1(j)) then - ddy(j) = (dlat(j) - oz_lat(jindx1(j))) / (oz_lat(jindx2(j)) - oz_lat(jindx1(j))) - else - ddy(j) = 1.0 - endif - enddo - - end subroutine ozphys_time_vary_init - -! ########################################################################################### -!> \section arg_table_ozphys_time_vary_timestep_init Argument Table -!! \htmlinclude ozphys_time_vary_timestep_init.html -!! -! ########################################################################################### - subroutine ozphys_time_vary_timestep_init(nPts, idate, fhour, jindx1, jindx2, latsozp, & - levozp, oz_coeff, timeoz, ozplin, oz_time, oz_lat, ddy, oz_data, errmsg, errflg) - ! Inputs - integer, intent(in) :: & - nPts, & ! Horizontal dimension - latsozp, & ! Number of latitudes in ozone data - levozp, & ! Number of vertical layers in ozone data - oz_coeff, & ! Number of coefficients in ozone data - timeoz ! Number of times in ozone data - integer, intent(in),dimension(:) :: & - idate, & ! Initial date with different size and ordering - jindx1, & ! Interpolation index (low) for ozone - jindx2 ! Interpolation index (high) for ozone - real(kind_phys), intent(in) :: & - fhour ! Forecast hour - real(kind_phys), intent(in), dimension(:) :: & - ddy, & ! Interpolation high index for ozone data - oz_lat, & ! Latitudes for ozone data - oz_time ! Time for ozone data - real(kind_phys), intent(in), dimension(:,:,:,:) :: & - ozplin ! Ozone data - - ! Outputs - real(kind_phys), intent(inout), dimension(:,:,:) :: & - oz_data ! Ozone forcing data - character(len=*), intent(out) :: & - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag - - ! Local - integer :: idat(8),jdat(8),iday,j,j1,j2,l,nc,n1,n2,jdow,jdoy,& - jday,w3kindreal,w3kindint - real(kind_phys) :: tem, tx1, tx2, rjday - real(kind_dbl_prec) :: rinc(5) - real(kind_sngl_prec) :: rinc4(5) - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! - idat=0 - idat(1)=idate(4) - idat(2)=idate(2) - idat(3)=idate(3) - idat(5)=idate(1) - rinc=0. - rinc(2)=fhour - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL w3movdat(rinc4,idat,jdat) - else - CALL w3movdat(rinc,idat,jdat) - endif - ! - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jdat,jdow,jdoy,jday) - rjday = jdoy + jdat(5) / 24. - IF (RJDAY < oz_time(1)) RJDAY = RJDAY + 365. - ! - n2 = timeoz + 1 - do j=2,timeoz - if (rjday < oz_time(j)) then - n2 = j - exit - endif - enddo - n1 = n2 - 1 - - tx1 = (oz_time(n2) - rjday) / (oz_time(n2) - oz_time(n1)) - tx2 = 1.0 - tx1 - - if (n2 > timeoz) n2 = n2 - timeoz - ! - do nc=1,oz_coeff - do L=1,levozp - do J=1,npts - J1 = jindx1(J) - J2 = jindx2(J) - TEM = 1.0 - ddy(J) - oz_data(j,L,nc) = tx1*(TEM*ozplin(J1,L,nc,n1)+ddy(J)*ozplin(J2,L,nc,n1)) & - + tx2*(TEM*ozplin(J1,L,nc,n2)+ddy(J)*ozplin(J2,L,nc,n2)) - enddo - enddo - enddo - - return - - end subroutine ozphys_time_vary_timestep_init -!> @} -end module ozphys_time_vary diff --git a/physics/ozphys_time_vary.meta b/physics/ozphys_time_vary.meta deleted file mode 100644 index 75b8b8e4f..000000000 --- a/physics/ozphys_time_vary.meta +++ /dev/null @@ -1,200 +0,0 @@ -[ccpp-table-properties] - name = ozphys_time_vary - type = scheme - dependencies = machine.F - -######################################################################## -[ccpp-arg-table] - name = ozphys_time_vary_init - type = scheme -[nPts] - standard_name = horizontal_dimension - long_name = horizontal dimension - units = count - dimensions = () - type = integer - intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data - units = count - dimensions = () - type = integer - intent = in -[oz_lat] - standard_name = ozone_data_latitude - long_name = ozone data latitude - units = deg - dimensions = (number_of_latitudes_in_ozone_data) - type = real - kind = kind_phys - intent = in -[dlat] - standard_name = latitude_in_degree - long_name = latitude in degree north - units = degree_north - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in -[jindx1] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = inout -[jindx2] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = inout -[ddy] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = inout -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - -######################################################################## -[ccpp-arg-table] - name = ozphys_time_vary_timestep_init - type = scheme -[nPts] - standard_name = horizontal_dimension - long_name = horizontal dimension - units = count - dimensions = () - type = integer - intent = in -[idate] - standard_name = date_and_time_at_model_initialization_in_united_states_order - long_name = initial date with different size and ordering - units = none - dimensions = (4) - type = integer - intent = in -[fhour] - standard_name = forecast_time - long_name = current forecast time - units = h - dimensions = () - type = real - kind = kind_phys - intent = in -[jindx1] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[jindx2] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[latsozp] - standard_name = number_of_latitudes_in_ozone_data - long_name = number of latitude in ozone data - units = count - dimensions = () - type = integer - intent = in -[levozp] - standard_name = number_of_levels_in_ozone_data - long_name = number of levels in ozone data - units = count - dimensions = () - type = integer - intent = in -[oz_coeff] - standard_name = number_of_coefficients_in_ozone_data - long_name = number of coefficients in ozone data - units = count - dimensions = () - type = integer - intent = in -[timeoz] - standard_name = number_of_times_in_ozone_data - long_name = number of times in ozone data - units = count - dimensions = () - type = integer - intent = in -[ozplin] - standard_name = ozone_data - long_name = ozone data - units = 1 - dimensions = (number_of_latitudes_in_ozone_data,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data,number_of_times_in_ozone_data) - type = real - kind = kind_phys - intent = in -[oz_time] - standard_name = ozone_data_time - long_name = ozone data time - units = none - dimensions = (13) - type = real - kind = kind_phys - intent = in -[oz_lat] - standard_name = ozone_data_latitude - long_name = ozone data latitude - units = deg - dimensions = (number_of_latitudes_in_ozone_data) - type = real - kind = kind_phys - intent = in -[ddy] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in -[oz_data] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) - type = real - kind = kind_phys - intent = inout -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out diff --git a/physics/radiation_gases.f b/physics/radiation_gases.f index 5f017598f..4c626b348 100644 --- a/physics/radiation_gases.f +++ b/physics/radiation_gases.f @@ -1,17 +1,14 @@ !> \file radiation_gases.f -!! This file contains routines that set up ozone climatological -!! profiles and other constant gas profiles, such as co2, ch4, n2o, -!! o2, and those of cfc gases. All data are entered as mixing ratio -!! by volume, except ozone which is mass mixing ratio (g/g). +!! This file contains routines that set up gas profiles, such as co2, +!! ch4, n2o, o2, and those of cfc gases. All data are entered as mixing +!! ratio by volume ! ========================================================== !!!!! ! 'module_radiation_gases' description !!!!! ! ========================================================== !!!!! ! ! -! set up ozone climatological profiles and other constant gas ! -! profiles, such as co2, ch4, n2o, o2, and those of cfc gases. All ! -! data are entered as mixing ratio by volume, except ozone which is ! -! mass mixing ratio (g/g). ! +! set up constant gas profiles, such as co2, ch4, n2o, o2, and those ! +! of cfc gases. All data are entered as mixing ratio by volume ! ! ! ! in the module, the externally callabe subroutines are : ! ! ! @@ -23,16 +20,10 @@ ! ! ! 'gas_update' -- read in data and update with time ! ! input: ! -! ( iyear, imon, iday, ihour, loz1st, ldoco2, me ) ! +! ( iyear, imon, iday, ihour, ldoco2, me ) ! ! output: ! ! ( errflg, errmsg ) ! ! ! -! 'getozn' -- setup climatological ozone profile ! -! input: ! -! ( prslk,xlat, ! -! IMAX, LM ) ! -! output: ! -! ( o3mmr ) ! ! ! ! 'getgases' -- setup constant gas profiles for LW and SW ! ! input: ! @@ -47,7 +38,6 @@ ! 'module module_iounitdef' in 'iounitdef.f' ! ! ! ! unit used for radiative active gases: ! -! ozone : mass mixing ratio (g/g) ! ! co2 : volume mixing ratio (p/p) ! ! n2o : volume mixing ratio (p/p) ! ! ch4 : volume mixing ratio (p/p) ! @@ -81,15 +71,6 @@ ! seasonal cycle calculations ! ! aug 2011 - y-t hou fix a bug in subr getgases doing vertical ! ! co2 mapping. (for top_at_1 case, not affact opr). ! -! aug 2012 - y-t hou modified subr getozn. moved the if-first ! -! block to subr gas_init to ensure threading safe in ! -! climatology ozone applications. (not affect gfs) ! -! also changed the initialization subr into two parts:! -! 'gas_init' is called at the start of run to set up ! -! module parameters; and 'gas_update' is called within! -! the time loop to check and update data sets. defined! -! the climatology ozone parameters k1oz,k2oz,facoz as ! -! module variables and are set in subr 'gas_update' ! ! nov 2012 - y-t hou modified control parameters thru module ! ! 'physparam'. ! ! jan 2013 - z. janjic/y. hou modified ilon (longitude index) ! @@ -105,10 +86,8 @@ !> \defgroup module_radiation_gases_mod Radiation Gases Module !> @{ -!> This module sets up ozone climatological profiles and other constant -!! gas profiles, such as co2, ch4, n2o, o2, and those of cfc gases. All -!! data are entered as mixing ratio by volume, except ozone which is -!! mass mixing ratio (g/g). +!> This module sets up constant gas profiles, such as co2, ch4, n2o, o2, +!! and those of cfc gases. All data are entered as mixing ratio by volume. !!\image html rad_gas_AGGI.png "Figure 1: Atmospheric radiative forcing, relative to 1750, by long-lived greenhouse gases and the 2016 update of the NOAA Annual Greenhouse Gas Index (AGGI)" !! NOAA Annual Greenhouse Gas Index (AGGI) shows that from 1990 to 2016, !! radiative forcing by long-lived greenhouse gases (LLGHGs) increased by @@ -121,10 +100,6 @@ !!\n ICO2=1: use observed global annual mean value !!\n ICO2=2: use observed monthly 2-d data table in \f$15^o\f$ horizontal resolution !! -!! O3 Distribution (namelist control parameter -\b NTOZ): -!!\n NTOZ=0: use seasonal and zonal averaged climatological ozone -!!\n NTOZ>0: use 3-D prognostic ozone -!! !! Trace Gases (currently using the global mean climatology in unit of ppmv): !! \f$CH_4-1.50\times10^{-6}\f$; !! \f$N_2O-0.31\times10^{-6}\f$; @@ -137,8 +112,8 @@ !! !!\version NCEP-Radiation_gases v5.1 Nov 2012 -!> This module sets up ozone climatological profiles and other constant gas -!! profiles, such as co2, ch4, n2o, o2, and those of cfc gases. +!> This module sets up constant gas rofiles, such as co2, ch4, n2o, o2, and those +!! of cfc gases. module module_radiation_gases use machine, only : kind_phys, kind_io4 use funcphys, only : fpkapx @@ -179,22 +154,8 @@ module module_radiation_gases ! gfdl 1999 value real (kind=kind_phys), parameter :: f113vmr_def= 8.2000e-11 -! --- ozone seasonal climatology parameters defined in module ozne_def -! - 4x5 ozone data parameter -! integer, parameter :: JMR=45, LOZ=17 -! real (kind=kind_phys), parameter :: blte=-86.0, dlte=4.0 -! - geos ozone data -! integer, parameter :: JMR=18, LOZ=17 -! real (kind=kind_phys), parameter :: blte=-85.0, dlte=10.0 - ! --- module variables to be set in subroutin gas_init and/or gas_update -! variables for climatology ozone (ioznflg = 0) - - real (kind=kind_phys), allocatable :: pkstr(:), o3r(:,:,:) - integer :: k1oz = 0, k2oz = 0 - real (kind=kind_phys) :: facoz = 0.0 - ! arrays for co2 2-d monthly data and global mean values from observed data real (kind=kind_phys), allocatable :: co2vmr_sav(:,:,:) @@ -209,33 +170,30 @@ module module_radiation_gases ! --- public interfaces - public gas_init, gas_update, getgases, getozn + public gas_init, gas_update, getgases ! ================= contains ! ================= -!> This subroutine sets up ozone, co2, etc. parameters. If climatology -!! ozone then read in monthly ozone data. +!> This subroutine sets up co2, etc. parameters. !!\param me print message control flag !!\param co2usr_file co2 user defined data table !!\param co2cyc_file co2 climotology monthly cycle data table !!\param ictmflg data ic time/date control flag !!\param ico2flg co2 data source control flag -!!\param ioznflg ozone data control flag !!\param con_pi physical constant Pi !!\param errflg error flag !!\param errmsg error message !>\section gas_init_gen gas_init General Algorithm !----------------------------------- subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & - & ictmflg, ioznflg, con_pi, JMR, LOZ, timeozc, errflg, errmsg) + & ictmflg, con_pi, errflg, errmsg) ! =================================================================== ! ! ! -! gas_init sets up ozone, co2, etc. parameters. if climatology ozone ! -! then read in monthly ozone data. ! +! gas_init sets up co2, etc. parameters. ! ! ! ! inputs: ! ! me - print message control flag ! @@ -256,9 +214,6 @@ subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & ! further data extrapolation. ! ! =yyyy1: use yyyy data for the fcst. if needed, do ! ! extrapolation to match the fcst time. ! -! ioznflg - ozone data control flag ! -! =0: use climatological ozone profile ! -! >0: use interactive ozone profile ! ! co2usr_file - external co2 user defined data table ! ! co2cyc_file - external co2 climotology monthly cycle data table ! ! con_pi - physical constant Pi ! @@ -267,9 +222,6 @@ subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & ! errflg - error flag ! ! errmsg - error message ! ! ! -! internal module variables: ! -! pkstr, o3r - arrays for climatology ozone data ! -! ! ! usage: call gas_init ! ! ! ! subprograms called: none ! @@ -279,8 +231,7 @@ subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & implicit none ! --- inputs: - integer, intent(in) :: me, ictmflg, ioznflg, ico2flg - integer, intent(in) :: JMR, LOZ, timeozc + integer, intent(in) :: me, ictmflg, ico2flg character(len=26),intent(in) :: co2usr_file,co2cyc_file real(kind=kind_phys), intent(in) :: con_pi @@ -291,10 +242,7 @@ subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & ! --- locals: real (kind=kind_phys), dimension(IMXCO2,JMXCO2) :: co2dat real (kind=kind_phys) :: co2g1, co2g2 - real (kind=kind_phys) :: pstr(LOZ) - real (kind=kind_io4) :: o3clim4(JMR,LOZ,12), pstr4(LOZ) - integer :: imond(12), ilat(JMR,12) integer :: i, j, k, iyr, imo logical :: file_exist, lextpl character :: cline*100, cform*8 @@ -316,78 +264,6 @@ subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & kyrsav = 0 kmonsav = 1 -! --- ... climatology ozone data section - - if ( ioznflg > 0 ) then - if ( me == 0 ) then - print *,' - Using interactive ozone distribution' - endif - else - if ( timeozc /= 12 ) then - print *,' - Using climatology ozone distribution' - print *,' timeozc=',timeozc, ' is not monthly mean', & - & ' - job aborting in subroutin gas_init!!!' - errflg = 1 - errmsg = 'ERROR(gas_init): Climatological o3 distribution '// & - & 'is not monthly mean' - return - endif - - allocate (pkstr(LOZ), o3r(JMR,LOZ,12)) - rewind NIO3CLM - - if ( LOZ == 17 ) then ! For the operational ozone climatology - do k = 1, LOZ - read (NIO3CLM,15) pstr4(k) - 15 format(f10.3) - enddo - - do imo = 1, 12 - do j = 1, JMR - read (NIO3CLM,16) imond(imo), ilat(j,imo), & - & (o3clim4(j,k,imo),k=1,10) - 16 format(i2,i4,10f6.2) - read (NIO3CLM,20) (o3clim4(j,k,imo),k=11,LOZ) - 20 format(6x,10f6.2) - enddo - enddo - else ! For newer ozone climatology - read (NIO3CLM) - do k = 1, LOZ - read (NIO3CLM) pstr4(k) - enddo - - do imo = 1, 12 - do k = 1, LOZ - read (NIO3CLM) (o3clim4(j,k,imo),j=1,JMR) - enddo - enddo - endif ! end if_LOZ_block -! - do imo = 1, 12 - do k = 1, LOZ - do j = 1, JMR - o3r(j,k,imo) = o3clim4(j,k,imo) * 1.655e-6 - enddo - enddo - enddo - - do k = 1, LOZ - pstr(k) = pstr4(k) - enddo - - if ( me == 0 ) then - print *,' - Using climatology ozone distribution' - print *,' Found ozone data for levels pstr=', & - & (pstr(k),k=1,LOZ) -! print *,' O3=',(o3r(15,k,1),k=1,LOZ) - endif - - do k = 1, LOZ - pkstr(k) = fpkapx(pstr(k)*100.0) - enddo - endif ! end if_ioznflg_block - ! --- ... co2 data section co2_glb = co2vmr_def @@ -541,20 +417,18 @@ end subroutine gas_init !!\param imon month of the year !!\param iday day of the month !!\param ihour hour of the day -!!\param loz1st clim ozone 1st time update control flag !!\param ldoco2 co2 update control flag !!\param me print message control flag !!\param co2dat_file co2 2d monthly obsv data table !!\param co2gbl_file co2 global annual mean data table !!\param ictmflg data ic time/date control flag !!\param ico2flg co2 data source control flag -!!\param ioznflg ozone data control flag !!\param errflg error flag !!\param errmsg error message !>\section gen_gas_update gas_update General Algorithm !----------------------------------- - subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & - & me, co2dat_file, co2gbl_file, ictmflg, ico2flg, ioznflg, & + subroutine gas_update(iyear, imon, iday, ihour, ldoco2, & + & me, co2dat_file, co2gbl_file, ictmflg, ico2flg, & & errflg, errmsg ) ! =================================================================== ! @@ -567,7 +441,6 @@ subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & ! imon - month of the year 1 ! ! iday - day of the month 1 ! ! ihour - hour of the day 1 ! -! loz1st - clim ozone 1st time update control flag 1 ! ! ldoco2 - co2 update control flag 1 ! ! me - print message control flag 1 ! ! ico2flg - co2 data source control flag ! @@ -587,9 +460,6 @@ subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & ! further data extrapolation. ! ! =yyyy1: use yyyy data for the fcst. if needed, do ! ! extrapolation to match the fcst time. ! -! ioznflg - ozone data control flag ! -! =0: use climatological ozone profile ! -! >0: use interactive ozone profile ! ! ivflip - vertical profile indexing flag ! ! co2dat_file - external co2 2d monthly obsv data table ! ! co2gbl_file - external co2 global annual mean data table ! @@ -603,8 +473,6 @@ subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & ! co2cyc_sav - monthly cycle co2 vol mixing ratio IMXCO2*JMXCO2*12 ! ! co2_glb - global annual mean co2 mixing ratio ! ! gco2cyc - global monthly mean co2 variation 12 ! -! k1oz,k2oz,facoz ! -! - climatology ozone parameters 1 ! ! ! ! usage: call gas_update ! ! ! @@ -616,9 +484,8 @@ subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & ! --- inputs: integer, intent(in) :: iyear,imon,iday,ihour,me,ictmflg,ico2flg - integer, intent(in) :: ioznflg character(len=26),intent(in) :: co2dat_file, co2gbl_file - logical, intent(in) :: loz1st, ldoco2 + logical, intent(in) :: ldoco2 ! --- output: character(len=*), intent(out) :: errmsg @@ -643,35 +510,6 @@ subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & errmsg = '' errflg = 0 -!> - Ozone data section - - if ( ioznflg == 0 ) then - midmon = mdays(imon)/2 + 1 - change = loz1st .or. ( (iday==midmon) .and. (ihour==0) ) -! - if ( change ) then - if ( iday < midmon ) then - k1oz = mod(imon+10, 12) + 1 - midm = mdays(k1oz)/2 + 1 - k2oz = imon - midp = mdays(k1oz) + midmon - else - k1oz = imon - midm = midmon - k2oz = mod(imon, 12) + 1 - midp = mdays(k2oz)/2 + 1 + mdays(k1oz) - endif - endif -! - if (iday < midmon) then - id = iday + mdays(k1oz) - else - id = iday - endif - - facoz = float(id - midm) / float(midp - midm) - endif - !> - co2 data section if ( ico2flg == 0 ) return ! use prescribed global mean co2 data @@ -1103,121 +941,6 @@ subroutine getgases( plvl, xlon, xlat, IMAX, LMAX, ico2flg, & end subroutine getgases !----------------------------------- -!> This subroutine sets up climatological ozone profile for radiation -!! calculation. This code is originally written by Shrinivas Moorthi. -!!\param prslk (IMAX,LM), exner function = \f$(p/p0)^{rocp}\f$ -!!\param xlat (IMAX), latitude in radians, default to pi/2 -> -!! -pi/2 range, otherwise see in-line comment -!!\param IMAX, LM (1), horizontal and vertical dimensions -!!\param top_at_1 (1), vertical profile indexing flag -!!\param o3mmr (IMAX,LM), output ozone profile in mass mixing -!! ratio (g/g) -!>\section getozn_gen getozn General Algorithm -!----------------------------------- - subroutine getozn( prslk,xlat, IMAX, LM, top_at_1, JMR, LOZ, blte,& - & dlte, o3mmr) - -! =================================================================== ! -! ! -! getozn sets up climatological ozone profile for radiation calculation! -! ! -! this code is originally written By Shrinivas Moorthi ! -! ! -! inputs: ! -! prslk (IMAX,LM) - exner function = (p/p0)**rocp ! -! xlat (IMAX) - latitude in radians, default to pi/2 -> -pi/2 ! -! range, otherwise see in-line comment ! -! IMAX, LM - horizontal and vertical dimensions ! -! top_at_1 - vertical profile indexing flag ! -! ! -! outputs: ! -! o3mmr (IMAX,LM) - output ozone profile in mass mixing ratio (g/g)! -! ! -! module variables: ! -! k1oz, k2oz - ozone data interpolation indices ! -! facoz - ozone data interpolation factor ! -! ! -! usage: call getozn ! -! ! -! =================================================================== ! -! - implicit none - -! --- inputs: - integer, intent(in) :: IMAX, LM, JMR, LOZ - real(kind=kind_phys), intent(in) :: blte, dlte - logical, intent(in) :: top_at_1 - real (kind=kind_phys), intent(in) :: prslk(:,:), xlat(:) - -! --- outputs: - real (kind=kind_phys), intent(out) :: o3mmr(:,:) - -! --- locals: - real (kind=kind_phys) :: o3i(IMAX,LOZ), wk1(IMAX), deglat, elte, & - & tem, tem1, tem2, tem3, tem4, temp - integer :: i, j, k, l, j1, j2, ll -! -!===> ... begin here -! - elte = blte + (JMR-1)*dlte - - do i = 1, IMAX - deglat = xlat(i) * raddeg ! if xlat in pi/2 -> -pi/2 range -! deglat = 90.0 - xlat(i)*raddeg ! if xlat in 0 -> pi range - - if (deglat > blte .and. deglat < elte) then - tem1 = (deglat - blte) / dlte + 1 - j1 = tem1 - j2 = j1 + 1 - tem1 = tem1 - j1 - elseif (deglat <= blte) then - j1 = 1 - j2 = 1 - tem1 = 1.0 - elseif (deglat >= elte) then - j1 = JMR - j2 = JMR - tem1 = 1.0 - endif - - tem2 = 1.0 - tem1 - do j = 1, LOZ - tem3 = tem2*o3r(j1,j,k1oz) + tem1*o3r(j2,j,k1oz) - tem4 = tem2*o3r(j1,j,k2oz) + tem1*o3r(j2,j,k2oz) - o3i(i,j) = tem4*facoz + tem3*(1.0 - facoz) - enddo - enddo - - do l = 1, LM - ll = l - if (.not. top_at_1) ll = LM -l + 1 - - do i = 1, IMAX - wk1(i) = prslk(i,ll) - enddo - - do k = 1, LOZ-1 - temp = 1.0 / (pkstr(k+1) - pkstr(k)) - - do i = 1, IMAX - if (wk1(i) > pkstr(k) .and. wk1(i) <= pkstr(k+1)) then - tem = (pkstr(k+1) - wk1(i)) * temp - o3mmr(I,ll) = tem * o3i(i,k) + (1.0 - tem) * o3i(i,k+1) - endif - enddo - enddo - - do i = 1, IMAX - if (wk1(i) > pkstr(LOZ)) o3mmr(i,ll) = o3i(i,LOZ) - if (wk1(i) < pkstr(1)) o3mmr(i,ll) = o3i(i,1) - enddo - enddo -! - return -!................................... - end subroutine getozn -!----------------------------------- - ! !........................................! end module module_radiation_gases ! diff --git a/physics/rrtmgp_lw_main.F90 b/physics/rrtmgp_lw_main.F90 index 67f7f749a..01b25c925 100644 --- a/physics/rrtmgp_lw_main.F90 +++ b/physics/rrtmgp_lw_main.F90 @@ -19,7 +19,6 @@ module rrtmgp_lw_main use rrtmgp_lw_gas_optics, only: lw_gas_props,rrtmgp_lw_gas_optics_init use rrtmgp_lw_cloud_optics, only: lw_cloud_props, rrtmgp_lw_cloud_optics_init, abssnow0, & abssnow1, absrain - use module_radiation_gases, only: NF_VGAS, getgases, getozn use GFS_rrtmgp_pre, only: iStr_h2o, iStr_co2, iStr_o3, iStr_n2o, iStr_ch4, & iStr_o2, iStr_ccl4, iStr_cfc11, iStr_cfc12, iStr_cfc22, & eps, oneminus, ftiny From 2886df96f645f9366d7d0496ac654fc178264e7d Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 14:23:36 -0600 Subject: [PATCH 62/81] Small cosmetic changes --- physics/GFS_phys_time_vary.fv3.F90 | 53 ++++++++++++++---------------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index af2dd9b00..f72763c3a 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -219,14 +219,6 @@ subroutine GFS_phys_time_vary_init ( !$OMP sections -!$OMP section -!> - Setup spatial interpolation indices for ozone physics. - if (ntoz > 0) then - !$OMP CRITICAL - call ozphys%setup_forcing(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) - !$OMP END CRITICAL - endif - !$OMP section !> - Call read_h2odata() to read stratospheric water vapor data call read_h2odata (h2o_phys, me, master) @@ -294,6 +286,12 @@ subroutine GFS_phys_time_vary_init ( !$OMP sections +!$OMP section +!> - Setup spatial interpolation indices for ozone physics. + if (ntoz > 0) then + call ozphys%setup_forcing(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) + endif + !$OMP section !> - Call setindxh2o() to initialize stratospheric water vapor data if (h2o_phys) then @@ -803,21 +801,7 @@ subroutine GFS_phys_time_vary_timestep_init ( return end if -!$OMP parallel num_threads(nthrds) default(none) & -!$OMP shared(kdt,nsswr,lsswr,clstp,imfdeepcnv,cal_pre,random_clds) & -!$OMP shared(fhswr,fhour,seed0,cnx,cny,nrcm,wrk,rannie,rndval) & -!$OMP shared(rann,im,isc,jsc,imap,jmap,ntoz,me,idate,jindx1_o3,jindx2_o3) & -!$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & -!$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & -!$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & -!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys) & -!$OMP private(iseed,iskip,i,j,rjday,idat,rinc,w3kindreal,w3kindint,jdat)& -!$OMP private(jdow,jdoy,jday,rinc4,n1,n2) - -!$OMP sections - -!$OMP section -!> - Compute temporal interpolation indices for updating gas concentrations. + !> - Compute temporal interpolation indices for updating gas concentrations. idat=0 idat(1)=idate(4) idat(2)=idate(2) @@ -849,12 +833,17 @@ subroutine GFS_phys_time_vary_timestep_init ( n1 = n2 - 1 if (n2 > ozphys%ntime) n2 = n2 - ozphys%ntime - !> - Update ozone concentration. - if (ntoz > 0) then - !$OMP CRITICAL - call ozphys%update_forcing(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) - !$OMP END CRITICAL - endif +!$OMP parallel num_threads(nthrds) default(none) & +!$OMP shared(kdt,nsswr,lsswr,clstp,imfdeepcnv,cal_pre,random_clds) & +!$OMP shared(fhswr,fhour,seed0,cnx,cny,nrcm,wrk,rannie,rndval) & +!$OMP shared(rann,im,isc,jsc,imap,jmap,ntoz,me,idate,jindx1_o3,jindx2_o3) & +!$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & +!$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & +!$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & +!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys) & +!$OMP private(iseed,iskip,i,j) + +!$OMP sections !$OMP section @@ -901,6 +890,12 @@ subroutine GFS_phys_time_vary_timestep_init ( endif ! imfdeepcnv, cal_re, random_clds +!$OMP section +!> - Update ozone concentration. + if (ntoz > 0) then + call ozphys%update_forcing(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) + endif + !$OMP section !> - Call h2ointerpol() to make stratospheric water vapor data interpolation if (h2o_phys) then From 17b057ce219479a3e46e9c8d7825736a0935083c Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 14:28:52 -0600 Subject: [PATCH 63/81] Housekeeping --- physics/GFS_phys_time_vary.fv3.F90 | 2 +- physics/GFS_phys_time_vary.fv3.meta | 59 ++++++++++++++--------------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index f72763c3a..6fa188471 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -841,7 +841,7 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & !$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & !$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys) & -!$OMP private(iseed,iskip,i,j) +!$OMP private(iseed,iskip,i,j,k) !$OMP sections diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index bf5a3fa04..639e2db6a 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -30,6 +30,13 @@ dimensions = () type = logical intent = in +[ntoz] + standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in [iaerclm] standard_name = flag_for_aerosol_input_MG_radiation long_name = flag for using aerosols in Morrison-Gettelman MP_radiation @@ -72,36 +79,6 @@ dimensions = () type = integer intent = in - intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in -[jindx1_o3] - standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation low index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[jindx2_o3] - standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation - long_name = interpolation high index for ozone - units = index - dimensions = (horizontal_dimension) - type = integer - intent = in -[ddy_o3] - standard_name = latitude_interpolation_weight_for_ozone_forcing - long_name = interpolation high index for ozone - units = none - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in [nx] standard_name = number_of_points_in_x_direction_for_this_MPI_rank long_name = number of points in x direction for this MPI rank @@ -139,6 +116,28 @@ type = real kind = kind_phys intent = in +[jindx1_o3] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout +[jindx2_o3] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout +[ddy_o3] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor From 17203fe06a90612ad09a357e8084510c4a277d58 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 14:32:20 -0600 Subject: [PATCH 64/81] Housekeeping --- physics/GFS_phys_time_vary.fv3.meta | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index 639e2db6a..ad543e146 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -23,13 +23,6 @@ dimensions = () type = integer intent = in -[h2o_phys] - standard_name = flag_for_stratospheric_water_vapor_physics - long_name = flag for stratospheric water vapor physics - units = flag - dimensions = () - type = logical - intent = in [ntoz] standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array long_name = tracer index for ozone mixing ratio @@ -37,6 +30,13 @@ dimensions = () type = integer intent = in +[h2o_phys] + standard_name = flag_for_stratospheric_water_vapor_physics + long_name = flag for stratospheric water vapor physics + units = flag + dimensions = () + type = logical + intent = in [iaerclm] standard_name = flag_for_aerosol_input_MG_radiation long_name = flag for using aerosols in Morrison-Gettelman MP_radiation From 3f6168b12443a79adf7abcdf326bcfa6813c8d84 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 15:49:35 -0600 Subject: [PATCH 65/81] More reorg. --- physics/GFS_phys_time_vary.fv3.F90 | 9 +- physics/GFS_rrtmg_pre.F90 | 2 +- physics/GFS_rrtmg_setup.F90 | 2 +- physics/GFS_rrtmgp_pre.F90 | 2 +- physics/GFS_rrtmgp_setup.F90 | 2 +- physics/GFS_suite_stateout_update.F90 | 135 +++++++++++++++---------- physics/GFS_suite_stateout_update.meta | 95 ++++++++++++++++- physics/module_ozphys.F90 | 50 ++++----- 8 files changed, 209 insertions(+), 88 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 6fa188471..70eeb81e1 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -95,6 +95,7 @@ subroutine GFS_phys_time_vary_init ( integer, intent(in) :: lkm integer, intent(inout) :: use_lake_model(:) real(kind=kind_phys), intent(in ) :: lakefrac(:), lakedepth(:) + integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:) real(kind_phys), intent(in) :: h2opl(:,:,:) @@ -289,7 +290,7 @@ subroutine GFS_phys_time_vary_init ( !$OMP section !> - Setup spatial interpolation indices for ozone physics. if (ntoz > 0) then - call ozphys%setup_forcing(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) + call ozphys%setup_o3prog(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) endif !$OMP section @@ -729,7 +730,7 @@ subroutine GFS_phys_time_vary_timestep_init ( lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, & tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, & zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, & - cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, ozphys, & + cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, ozphys, & do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, errmsg, errflg) implicit none @@ -841,7 +842,7 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & !$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & !$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys) & -!$OMP private(iseed,iskip,i,j,k) +!$OMP private(iseed,iskip,i,j,k,rjday,n1,n2) !$OMP sections @@ -893,7 +894,7 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP section !> - Update ozone concentration. if (ntoz > 0) then - call ozphys%update_forcing(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) + call ozphys%update_o3prog(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) endif !$OMP section diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 69be4f8d0..108d6f407 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -434,7 +434,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& enddo enddo else ! climatological ozone - call ozphys%oz_clim(xlat, prslk1, con_pi, olyr) + call ozphys%run_o3clim(xlat, prslk1, con_pi, olyr) endif ! end_if_ntoz !> - Call coszmn(), to compute cosine of zenith angle (only when SW is called) diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 908a364dc..e48a60ac8 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -467,7 +467,7 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr,me, iaermdl,& call gas_update ( kyear,kmon,kday,khour,lco2_chg, me, co2dat_file, & co2gbl_file, ictm, ico2, errflg, errmsg ) if (ntoz == 0) then - call ozphys%update_clim(kmon, kday, khour, loz1st) + call ozphys%update_o3clim(kmon, kday, khour, loz1st) endif if ( loz1st ) loz1st = .false. diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index 9dcc002a0..cbf8d161b 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -353,7 +353,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl enddo ! OR Use climatological ozone data else - call ozphys%oz_clim(xlat, prslk, con_pi, o3_lay) + call ozphys%run_o3clim(xlat, prslk, con_pi, o3_lay) endif ! ####################################################################################### diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index 3e4f57d13..9f2b2a9f9 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -243,7 +243,7 @@ subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad call gas_update (kyear, kmon, kday, khour, lco2_chg, me, co2dat_file, co2gbl_file, ictm,& ico2, errflg, errmsg ) if (ntoz == 0) then - call ozphys%update_clim(kmon, kday, khour, loz1st) + call ozphys%update_o3clim(kmon, kday, khour, loz1st) endif if ( loz1st ) loz1st = .false. diff --git a/physics/GFS_suite_stateout_update.F90 b/physics/GFS_suite_stateout_update.F90 index 2771c3e82..41f44e0de 100644 --- a/physics/GFS_suite_stateout_update.F90 +++ b/physics/GFS_suite_stateout_update.F90 @@ -1,63 +1,90 @@ +! ######################################################################################### !> \file GFS_suite_stateout_update.f90 -!! Contains code to update the state variables due to process-split physics from accumulated tendencies during that phase. +!! Update the state variables due to process-split physics from accumulated tendencies +!! during that phase. +!! Update gas concentrations, if using prognostic photolysis schemes. !! Also, set bounds on the mass-weighted rime factor when using Ferrier-Aligo microphysics. - - module GFS_suite_stateout_update - - contains - +! ######################################################################################### +module GFS_suite_stateout_update + use machine, only: kind_phys + use module_ozphys, only: ty_ozphys + implicit none +contains +! ######################################################################################### !> \section arg_table_GFS_suite_stateout_update_run Argument Table !! \htmlinclude GFS_suite_stateout_update_run.html !! - subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, & - tgrs, ugrs, vgrs, qgrs, dudt, dvdt, dtdt, dqdt, & - gt0, gu0, gv0, gq0, ntiw, nqrimef, imp_physics, & - imp_physics_fer_hires, epsq, errmsg, errflg) - - use machine, only: kind_phys - - implicit none - - ! Interface variables - integer, intent(in ) :: im - integer, intent(in ) :: levs - integer, intent(in ) :: ntrac - integer, intent(in ) :: imp_physics,imp_physics_fer_hires - integer, intent(in ) :: ntiw, nqrimef - real(kind=kind_phys), intent(in ) :: dtp, epsq - - real(kind=kind_phys), intent(in ), dimension(:,:) :: tgrs, ugrs, vgrs - real(kind=kind_phys), intent(in ), dimension(:,:,:) :: qgrs - real(kind=kind_phys), intent(in ), dimension(:,:) :: dudt, dvdt, dtdt - real(kind=kind_phys), intent(in ), dimension(:,:,:) :: dqdt - real(kind=kind_phys), intent(out), dimension(:,:) :: gt0, gu0, gv0 - real(kind=kind_phys), intent(out), dimension(:,:,:) :: gq0 - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - integer :: i, k - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - gt0(:,:) = tgrs(:,:) + dtdt(:,:) * dtp - gu0(:,:) = ugrs(:,:) + dudt(:,:) * dtp - gv0(:,:) = vgrs(:,:) + dvdt(:,:) * dtp - gq0(:,:,:) = qgrs(:,:,:) + dqdt(:,:,:) * dtp - - if (imp_physics == imp_physics_fer_hires) then +! ######################################################################################### + subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs, qgrs, & + dudt, dvdt, dtdt, dqdt, gt0, gu0, gv0, gq0, oz0, ntiw, nqrimef, imp_physics, & + imp_physics_fer_hires, epsq, ozphys, oz_phys_2015, oz_phys_2006, con_1ovg, prsl, & + dp, ozpl, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) + + ! Inputs + integer, intent(in ) :: im + integer, intent(in ) :: levs + integer, intent(in ) :: ntrac + integer, intent(in ) :: imp_physics,imp_physics_fer_hires + integer, intent(in ) :: ntiw, nqrimef + real(kind=kind_phys), intent(in ) :: dtp, epsq, con_1ovg + real(kind=kind_phys), intent(in ), dimension(:,:) :: tgrs, ugrs, vgrs, prsl, dp + real(kind=kind_phys), intent(in ), dimension(:,:,:) :: qgrs, ozpl + real(kind=kind_phys), intent(in ), dimension(:,:) :: dudt, dvdt, dtdt + real(kind=kind_phys), intent(in ), dimension(:,:,:) :: dqdt + logical, intent(in) :: oz_phys_2015 + logical, intent(in) :: oz_phys_2006 + type(ty_ozphys), intent(in) :: ozphys + + ! Outputs (optional) + real(kind=kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + do3_dt_prd, & ! Physics tendency: production and loss effect + do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect + do3_dt_temp, & ! Physics tendency: temperature effect + do3_dt_ohoz ! Physics tendency: overhead ozone effect + + ! Outputs + real(kind=kind_phys), intent(out), dimension(:,:) :: gt0, gu0, gv0, oz0 + real(kind=kind_phys), intent(out), dimension(:,:,:) :: gq0 + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Locals + integer :: i, k + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Update prognostic state varaibles using accumulated tendencies from "process-split" + ! section of GFS suite. + gt0(:,:) = tgrs(:,:) + dtdt(:,:) * dtp + gu0(:,:) = ugrs(:,:) + dudt(:,:) * dtp + gv0(:,:) = vgrs(:,:) + dvdt(:,:) * dtp + gq0(:,:,:) = qgrs(:,:,:) + dqdt(:,:,:) * dtp + + ! If using photolysis physics schemes, update (prognostic) gas concentrations using + ! updated state. + if (oz_phys_2015) then + call ozphys%run_o3prog_2015(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, do3_dt_prd, & + do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) + endif + if (oz_phys_2006) then + call ozphys%run_o3prog_2006() + endif + + ! If using Ferrier-Aligo microphysics, set bounds on the mass-weighted rime factor. + if (imp_physics == imp_physics_fer_hires) then do k=1,levs - do i=1,im - if(gq0(i,k,ntiw) > epsq) then - gq0(i,k,nqrimef) = max(1., gq0(i,k,nqrimef)/gq0(i,k,ntiw)) - else - gq0(i,k,nqrimef) = 1. - end if - end do + do i=1,im + if(gq0(i,k,ntiw) > epsq) then + gq0(i,k,nqrimef) = max(1., gq0(i,k,nqrimef)/gq0(i,k,ntiw)) + else + gq0(i,k,nqrimef) = 1. + end if + end do end do - end if + end if - end subroutine GFS_suite_stateout_update_run + end subroutine GFS_suite_stateout_update_run - end module GFS_suite_stateout_update \ No newline at end of file +end module GFS_suite_stateout_update diff --git a/physics/GFS_suite_stateout_update.meta b/physics/GFS_suite_stateout_update.meta index 580482b71..8cbab9139 100644 --- a/physics/GFS_suite_stateout_update.meta +++ b/physics/GFS_suite_stateout_update.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_stateout_update type = scheme - dependencies = machine.F + dependencies = machine.F,module_ozphys.F90 ######################################################################## [ccpp-arg-table] @@ -37,6 +37,27 @@ type = real kind = kind_phys intent = in +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = in +[oz_phys_2015] + standard_name = flag_for_nrl_2015_ozone_scheme + long_name = flag for new (2015) ozone physics + units = flag + dimensions = () + type = logical + intent = in +[oz_phys_2006] + standard_name = flag_for_nrl_2006_ozone_scheme + long_name = flag for new (2006) ozone physics + units = flag + dimensions = () + type = logical + intent = in [tgrs] standard_name = air_temperature long_name = model layer mean temperature @@ -133,6 +154,14 @@ type = real kind = kind_phys intent = out +[oz0] + standard_name = ozone_concentration_of_new_state + long_name = ozone concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout [ntiw] standard_name = index_of_cloud_ice_mixing_ratio_in_tracer_concentration_array long_name = tracer index for ice water @@ -169,6 +198,70 @@ type = real kind = kind_phys intent = in +[con_1ovg] + standard_name = one_divided_by_the_gravitational_acceleration + long_name = inverse of gravitational acceleration + units = s2 m-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[prsl] + standard_name = air_pressure + long_name = mid-layer pressure + units = Pa + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[ozpl] + standard_name = ozone_forcing + long_name = ozone forcing data + units = mixed + dimensions = (horizontal_loop_extent,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + type = real + kind = kind_phys + intent = in +[dp] + standard_name = air_pressure_difference_between_midlayers + long_name = difference between mid-layer pressures + units = Pa + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[do3_dt_prd] + standard_name = ozone_tendency_due_to_production_and_loss_rate + long_name = ozone tendency due to production and loss rate + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[do3_dt_ozmx] + standard_name = ozone_tendency_due_to_ozone_mixing_ratio + long_name = ozone tendency due to ozone mixing ratio + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[do3_dt_temp] + standard_name = ozone_tendency_due_to_temperature + long_name = ozone tendency due to temperature + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[do3_dt_ohoz] + standard_name = ozone_tendency_due_to_overhead_ozone_column + long_name = ozone tendency due to overhead ozone column + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_ozphys.F90 b/physics/module_ozphys.F90 index 966d27113..205a02b46 100644 --- a/physics/module_ozphys.F90 +++ b/physics/module_ozphys.F90 @@ -41,21 +41,22 @@ module module_ozphys integer :: k2oz !< Upper interpolation index in datac(dim=3), time dim real(kind_phys) :: facoz !< Parameter for ozone climotology contains - procedure, public :: load_forcing - procedure, public :: load_clim - procedure, public :: setup_forcing - procedure, public :: update_forcing - procedure, public :: update_clim - procedure, public :: oz_prog_2015 - procedure, public :: oz_prog_2006 - procedure, public :: oz_clim + procedure, public :: load_o3prog + procedure, public :: setup_o3prog + procedure, public :: update_o3prog + procedure, public :: run_o3prog_2015 + procedure, public :: run_o3prog_2006 + ! + procedure, public :: load_o3clim + procedure, public :: update_o3clim + procedure, public :: run_o3clim end type ty_ozphys contains ! ######################################################################################### ! Procedure (type-bound) for loading ozone forcing data. ! ######################################################################################### - function load_forcing(this, file, fileID) result (err_message) + function load_o3prog(this, file, fileID) result (err_message) class(ty_ozphys), intent(inout) :: this integer, intent(in) :: fileID character(len=*), intent(in) :: file @@ -97,12 +98,12 @@ function load_forcing(this, file, fileID) result (err_message) deallocate(tempin) close(fileID) - end function load_forcing + end function load_o3prog ! ######################################################################################### ! Procedure for setting up interpolation indices between data and model grid. ! ######################################################################################### - subroutine setup_forcing(this, lat, idx1, idx2, idxh) + subroutine setup_o3prog(this, lat, idx1, idx2, idxh) class(ty_ozphys), intent(in) :: this real(kind_phys), intent(in) :: lat(:) integer, intent(out) :: idx1(:), idx2(:) @@ -126,12 +127,12 @@ subroutine setup_forcing(this, lat, idx1, idx2, idxh) endif enddo - end subroutine setup_forcing + end subroutine setup_o3prog ! ######################################################################################### ! Procedure (type-bound) for updating ozone data. ! ######################################################################################### - subroutine update_forcing(this, idx1, idx2, idxh, rjday, idxt1, idxt2, ozpl) + subroutine update_o3prog(this, idx1, idx2, idxh, rjday, idxt1, idxt2, ozpl) class(ty_ozphys), intent(in) :: this integer, intent(in) :: idx1(:), idx2(:) real(kind_phys), intent(in) :: idxh(:) @@ -156,12 +157,12 @@ subroutine update_forcing(this, idx1, idx2, idxh, rjday, idxt1, idxt2, ozpl) enddo enddo - end subroutine update_forcing + end subroutine update_o3prog ! ######################################################################################### ! Procedure (type-bound) for NRL prognostic ozone (2015). ! ######################################################################################### - subroutine oz_prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, do3_dt_ozmx, & + subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, do3_dt_ozmx, & do3_dt_temp, do3_dt_ohoz) class(ty_ozphys), intent(in) :: this real(kind_phys),intent(in) :: & @@ -267,21 +268,20 @@ subroutine oz_prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, do3_ enddo return - end subroutine oz_prog_2015 + end subroutine run_o3prog_2015 ! ######################################################################################### ! Procedure (type-bound) for NRL prognostic ozone (2006). ! ######################################################################################### - subroutine oz_prog_2006(this) + subroutine run_o3prog_2006(this) class(ty_ozphys), intent(in) :: this return - end subroutine oz_prog_2006 + end subroutine run_o3prog_2006 ! ######################################################################################### ! Procedure (type-bound) for NRL updating climotological ozone. - ! Build this up from getozn. ! ######################################################################################### - subroutine oz_clim(this, lat, prslk, con_pi, oz) + subroutine run_o3clim(this, lat, prslk, con_pi, oz) class(ty_ozphys), intent(in) :: this real(kind_phys), intent(in) :: & con_pi ! Physics constant: Pi @@ -356,12 +356,12 @@ subroutine oz_clim(this, lat, prslk, con_pi, oz) enddo return - end subroutine oz_clim + end subroutine run_o3clim ! ######################################################################################### ! Procedure (type-bound) for loading ozone climo data. ! ######################################################################################### - function load_clim(this, file, fileID) result (err_message) + function load_o3clim(this, file, fileID) result (err_message) class(ty_ozphys), intent(inout) :: this integer, intent(in) :: fileID character(len=*), intent(in) :: file @@ -432,12 +432,12 @@ function load_clim(this, file, fileID) result (err_message) this%pkstr(iLev) = fpkapx(this%pstr(iLev)*100.0) enddo - end function load_clim + end function load_o3clim ! ######################################################################################### ! Procedure (type-bound) for updating ozone climotological data. ! ######################################################################################### - subroutine update_clim(this, imon, iday, ihour, loz1st) + subroutine update_o3clim(this, imon, iday, ihour, loz1st) class(ty_ozphys), intent(inout) :: this integer, intent(in) :: imon, iday, ihour logical, intent(in) :: loz1st @@ -471,6 +471,6 @@ subroutine update_clim(this, imon, iday, ihour, loz1st) this%facoz = float(id - midm) / float(midp - midm) - end subroutine update_clim + end subroutine update_o3clim end module module_ozphys From d0a4bfd63fae9f4e4a06cb5598049f1019aed945 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 15:50:51 -0600 Subject: [PATCH 66/81] Remove ozphysics modules. Now part of ty_ozphys --- physics/ozphys_2015.F90 | 167 --------------------------------------- physics/ozphys_2015.meta | 140 -------------------------------- 2 files changed, 307 deletions(-) delete mode 100644 physics/ozphys_2015.F90 delete mode 100644 physics/ozphys_2015.meta diff --git a/physics/ozphys_2015.F90 b/physics/ozphys_2015.F90 deleted file mode 100644 index 1478d0d6e..000000000 --- a/physics/ozphys_2015.F90 +++ /dev/null @@ -1,167 +0,0 @@ -! ########################################################################################### -!> \file ozphys_2015.F90 -!! -! ########################################################################################### -module ozphys_2015 - use machine, only: kind_phys, kind_dbl_prec, kind_sngl_prec - use module_ozphys, only: ty_ozphys - implicit none - public ozphys_2015_run -contains - -! ########################################################################################### -!>\defgroup GFS_ozphys_2015 GFS Ozone Photochemistry (2015) Module -!! This module contains the CCPP-compliant Ozone 2015 photochemistry scheme. -!> @{ -!> The operational GFS currently parameterizes ozone production and destruction based on -!! monthly mean coefficients ( \c ozprdlos_2015_new_sbuvO3_tclm15_nuchem.f77) provided by -!! Naval Research Laboratory through CHEM2D chemistry model -!! (McCormack et al. (2006) \cite mccormack_et_al_2006). -!! (https://doi.org/10.5194/acp-6-4943-2006) -!! -!> \section genal_ozphys_2015 GFS ozphys_2015_run General Algorithm -!> - This code assumes that both 2D fields are ordered from bottom to top. -!> - This code is specifically for NRL parameterization and climatological T and O3 are in -! location 5 and 6 of ozpl array -!!\author June 2015 - Shrinivas Moorthi -!!\modified May 2023 - Dustin Swales -! ########################################################################################### - -! ########################################################################################### -! SUBROUTINE ozphys_2015_run -! ########################################################################################### -!! \section arg_table_ozphys_2015_run Argument Table -!! \htmlinclude ozphys_2015_run.html -!! - subroutine ozphys_2015_run (oz_phys, ozphys, nCol, nLev, dt, oz, tin, prsl, ozpl, & - delp, con_1ovg, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) - - ! Inputs - logical, intent(in) :: & - oz_phys ! Flag for ozone_physics_2015 scheme. - type(ty_ozphys),intent(in) :: & - ozphys - real(kind_phys),intent(in) :: & - con_1ovg ! Physical constant: One divided by gravitational acceleration (m-1 s2) - integer, intent(in) :: & - nCol, & ! Horizontal dimension - nLev ! Number of vertical layers - real(kind_phys), intent(in) :: & - dt ! Physics timestep (seconds) - real(kind_phys), intent(in), dimension(:,:) :: & - prsl, & ! Air-pressure (Pa) - tin, & ! Temperature of new-state (K) - delp ! Difference between mid-layer pressures (Pa) - real(kind_phys), intent(in), dimension(:,:,:) :: & - ozpl ! Ozone forcing data - - ! Outputs (optional) - real(kind=kind_phys), intent(inout), dimension(:,:), pointer, optional :: & - do3_dt_prd, & ! Physics tendency: production and loss effect - do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect - do3_dt_temp, & ! Physics tendency: temperature effect - do3_dt_ohoz ! Physics tendency: overhead ozone effect - - ! Outputs - real(kind=kind_phys), intent(inout), dimension(:,:) :: & - oz ! Ozone concentration updated by physics - character(len=*), intent(out) :: & - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag - - ! Locals - integer :: k, kmax, kmin, l, i, j - logical, dimension(nCol) :: flg - real(kind_phys) :: pmax, pmin, tem, temp - real(kind_phys), dimension(nCol) :: wk1, wk2, wk3, ozib - real(kind_phys), dimension(nCol,ozphys%ncf) :: prod - real(kind_phys), dimension(nCol,nLev) :: ozi - real(kind_phys), dimension(nCol,nLev+1) :: colo3, coloz - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Sanity checks - if (.not.oz_phys) then - write (errmsg,'(*(a))') 'Logic error: oz_phys_2015 == .false.' - errflg = 1 - return - endif - - ! Temporaries - ozi = oz - - colo3(:,nLev+1) = 0.0 - coloz(:,nLev+1) = 0.0 - - do l=nLev,1,-1 - pmin = 1.0e10 - pmax = -1.0e10 - - do i=1,nCol - wk1(i) = log(prsl(i,l)) - pmin = min(wk1(i), pmin) - pmax = max(wk1(i), pmax) - prod(i,:) = 0.0 - enddo - kmax = 1 - kmin = 1 - do k=1,ozphys%nlev-1 - if (pmin < ozphys%po3(k)) kmax = k - if (pmax < ozphys%po3(k)) kmin = k - enddo - ! - do k=kmin,kmax - temp = 1.0 / (ozphys%po3(k) - ozphys%po3(k+1)) - do i=1,nCol - flg(i) = .false. - if (wk1(i) < ozphys%po3(k) .and. wk1(i) >= ozphys%po3(k+1)) then - flg(i) = .true. - wk2(i) = (wk1(i) - ozphys%po3(k+1)) * temp - wk3(i) = 1.0 - wk2(i) - endif - enddo - do j=1,ozphys%ncf - do i=1,nCol - if (flg(i)) then - prod(i,j) = wk2(i) * ozpl(i,k,j) + wk3(i) * ozpl(i,k+1,j) - endif - enddo - enddo - enddo - - do j=1,ozphys%ncf - do i=1,nCol - if (wk1(i) < ozphys%po3(ozphys%nlev)) then - prod(i,j) = ozpl(i,ozphys%nlev,j) - endif - if (wk1(i) >= ozphys%po3(1)) then - prod(i,j) = ozpl(i,1,j) - endif - enddo - enddo - do i=1,nCol - colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l)*con_1ovg - coloz(i,l) = coloz(i,l+1) + prod(i,6) * delp(i,l)*con_1ovg - prod(i,2) = min(prod(i,2), 0.0) - enddo - do i=1,nCol - ozib(i) = ozi(i,l) ! no filling - tem = prod(i,1) - prod(i,2) * prod(i,6) + prod(i,3) * (tin(i,l) - prod(i,5)) & - + prod(i,4) * (colo3(i,l)-coloz(i,l)) - oz(i,l) = (ozib(i) + tem*dt) / (1.0 - prod(i,2)*dt) - enddo - - ! Diagnostics (optional) - if (associated(do3_dt_prd)) do3_dt_prd(:,l) = (prod(:,1)-prod(:,2)*prod(:,6))*dt - if (associated(do3_dt_ozmx)) do3_dt_ozmx(:,l) = (oz(:,l) - ozib(:)) - if (associated(do3_dt_temp)) do3_dt_temp(:,l) = prod(:,3)*(tin(:,l)-prod(:,5))*dt - if (associated(do3_dt_ohoz)) do3_dt_ohoz(:,l) = prod(:,4) * (colo3(:,l)-coloz(:,l))*dt - enddo - - return - end subroutine ozphys_2015_run -!> @} -end module ozphys_2015 diff --git a/physics/ozphys_2015.meta b/physics/ozphys_2015.meta deleted file mode 100644 index ca2d56e4e..000000000 --- a/physics/ozphys_2015.meta +++ /dev/null @@ -1,140 +0,0 @@ -[ccpp-table-properties] - name = ozphys_2015 - type = scheme - dependencies = machine.F,module_ozphys.F90 - -######################################################################## -[ccpp-arg-table] - name = ozphys_2015_run - type = scheme -[oz_phys] - standard_name = flag_for_nrl_2015_ozone_scheme - long_name = flag for new (2015) ozone physics - units = flag - dimensions = () - type = logical - intent = in -[ozphys] - standard_name = dataset_for_ozone_physics - long_name = dataset for NRL ozone physics - units = mixed - dimensions = () - type = ty_ozphys - intent = in -[nCol] - standard_name = horizontal_loop_extent - long_name = horizontal loop extent - units = count - dimensions = () - type = integer - intent = in -[nLev] - standard_name = vertical_layer_dimension - long_name = number of vertical layers - units = count - dimensions = () - type = integer - intent = in -[dt] - standard_name = timestep_for_physics - long_name = physics time step - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[oz] - standard_name = ozone_concentration_of_new_state - long_name = ozone concentration updated by physics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[tin] - standard_name = air_temperature_of_new_state - long_name = updated air temperature - units = K - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[prsl] - standard_name = air_pressure - long_name = mid-layer pressure - units = Pa - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[ozpl] - standard_name = ozone_forcing - long_name = ozone forcing data - units = mixed - dimensions = (horizontal_loop_extent,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) - type = real - kind = kind_phys - intent = in -[delp] - standard_name = air_pressure_difference_between_midlayers - long_name = difference between mid-layer pressures - units = Pa - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[con_1ovg] - standard_name = one_divided_by_the_gravitational_acceleration - long_name = inverse of gravitational acceleration - units = s2 m-1 - dimensions = () - type = real - kind = kind_phys - intent = in -[do3_dt_prd] - standard_name = ozone_tendency_due_to_production_and_loss_rate - long_name = ozone tendency due to production and loss rate - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[do3_dt_ozmx] - standard_name = ozone_tendency_due_to_ozone_mixing_ratio - long_name = ozone tendency due to ozone mixing ratio - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[do3_dt_temp] - standard_name = ozone_tendency_due_to_temperature - long_name = ozone tendency due to temperature - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[do3_dt_ohoz] - standard_name = ozone_tendency_due_to_overhead_ozone_column - long_name = ozone tendency due to overhead ozone column - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out From 385ef4e2802a838fd3099b17ee479ebaae1a6402 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 27 Sep 2023 22:19:36 -0600 Subject: [PATCH 67/81] Some polishing. Merge 2006 ozone into module_ozphys --- physics/GFS_phys_time_vary.fv3.F90 | 69 ++++----- physics/GFS_suite_stateout_update.F90 | 3 +- physics/module_ozphys.F90 | 127 +++++++++++++++- physics/ozphys.f | 211 -------------------------- physics/ozphys.meta | 208 ------------------------- 5 files changed, 158 insertions(+), 460 deletions(-) delete mode 100644 physics/ozphys.f delete mode 100644 physics/ozphys.meta diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 70eeb81e1..cd1f8287a 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -802,38 +802,6 @@ subroutine GFS_phys_time_vary_timestep_init ( return end if - !> - Compute temporal interpolation indices for updating gas concentrations. - idat=0 - idat(1)=idate(4) - idat(2)=idate(2) - idat(3)=idate(3) - idat(5)=idate(1) - rinc=0. - rinc(2)=fhour - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL w3movdat(rinc4,idat,jdat) - else - CALL w3movdat(rinc,idat,jdat) - endif - jdow = 0 - jdoy = 0 - jday = 0 - call w3doxdat(jdat,jdow,jdoy,jday) - rjday = jdoy + jdat(5) / 24. - if (rjday < ozphys%time(1)) rjday = rjday + 365. - - n2 = ozphys%ntime + 1 - do j=2,ozphys%ntime - if (rjday < ozphys%time(j)) then - n2 = j - exit - endif - enddo - n1 = n2 - 1 - if (n2 > ozphys%ntime) n2 = n2 - ozphys%ntime - !$OMP parallel num_threads(nthrds) default(none) & !$OMP shared(kdt,nsswr,lsswr,clstp,imfdeepcnv,cal_pre,random_clds) & !$OMP shared(fhswr,fhour,seed0,cnx,cny,nrcm,wrk,rannie,rndval) & @@ -841,8 +809,9 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & !$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & !$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & -!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys) & -!$OMP private(iseed,iskip,i,j,k,rjday,n1,n2) +!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc,rinc4) & +!$OMP shared(w3kindreal,w3kindint,jdow,jdoy,jday) & +!$OMP private(iseed,iskip,i,j,k) !$OMP sections @@ -892,6 +861,38 @@ subroutine GFS_phys_time_vary_timestep_init ( endif ! imfdeepcnv, cal_re, random_clds !$OMP section + !> - Compute temporal interpolation indices for updating gas concentrations. + idat=0 + idat(1)=idate(4) + idat(2)=idate(2) + idat(3)=idate(3) + idat(5)=idate(1) + rinc=0. + rinc(2)=fhour + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + rinc4=rinc + CALL w3movdat(rinc4,idat,jdat) + else + CALL w3movdat(rinc,idat,jdat) + endif + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jdat,jdow,jdoy,jday) + rjday = jdoy + jdat(5) / 24. + if (rjday < ozphys%time(1)) rjday = rjday + 365. + + n2 = ozphys%ntime + 1 + do j=2,ozphys%ntime + if (rjday < ozphys%time(j)) then + n2 = j + exit + endif + enddo + n1 = n2 - 1 + if (n2 > ozphys%ntime) n2 = n2 - ozphys%ntime + !> - Update ozone concentration. if (ntoz > 0) then call ozphys%update_o3prog(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) diff --git a/physics/GFS_suite_stateout_update.F90 b/physics/GFS_suite_stateout_update.F90 index 41f44e0de..e9e477fce 100644 --- a/physics/GFS_suite_stateout_update.F90 +++ b/physics/GFS_suite_stateout_update.F90 @@ -69,7 +69,8 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) endif if (oz_phys_2006) then - call ozphys%run_o3prog_2006() + call ozphys%run_o3prog_2006(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, do3_dt_prd, & + do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) endif ! If using Ferrier-Aligo microphysics, set bounds on the mass-weighted rime factor. diff --git a/physics/module_ozphys.F90 b/physics/module_ozphys.F90 index 205a02b46..d24585d4d 100644 --- a/physics/module_ozphys.F90 +++ b/physics/module_ozphys.F90 @@ -162,12 +162,12 @@ end subroutine update_o3prog ! ######################################################################################### ! Procedure (type-bound) for NRL prognostic ozone (2015). ! ######################################################################################### - subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, do3_dt_ozmx, & - do3_dt_temp, do3_dt_ohoz) + subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, & + do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) class(ty_ozphys), intent(in) :: this - real(kind_phys),intent(in) :: & + real(kind_phys), intent(in) :: & con_1ovg ! Physical constant: One divided by gravitational acceleration (m-1 s2) - real(kind_phys), intent(in) :: & + real(kind_phys), intent(in) :: & dt ! Model timestep (sec) real(kind_phys), intent(in), dimension(:,:) :: & p, & ! Model Pressure (Pa) @@ -253,7 +253,7 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, d prod(iCol,2) = min(prod(iCol,2), 0.0) enddo do iCol=1,nCol - ozib(iCol) = ozi(iCol,iLev) ! no filling + ozib(iCol) = ozi(iCol,iLev) tem = prod(iCol,1) - prod(iCol,2) * prod(iCol,6) & + prod(iCol,3) * (t(iCol,iLev) - prod(iCol,5)) & + prod(iCol,4) * (colo3(iCol,iLev)-coloz(iCol,iLev)) @@ -273,8 +273,123 @@ end subroutine run_o3prog_2015 ! ######################################################################################### ! Procedure (type-bound) for NRL prognostic ozone (2006). ! ######################################################################################### - subroutine run_o3prog_2006(this) + subroutine run_o3prog_2006(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, & + do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) class(ty_ozphys), intent(in) :: this + real(kind_phys), intent(in) :: & + con_1ovg ! Physical constant: One divided by gravitational acceleration (m-1 s2) + real(kind_phys), intent(in) :: & + dt ! Model timestep (sec) + real(kind_phys), intent(in), dimension(:,:) :: & + p, & ! Model Pressure (Pa) + t, & ! Model temperature (K) + dp ! Model layer thickness (Pa) + real(kind_phys), intent(in), dimension(:,:,:) :: & + ozpl ! Ozone forcing data + real(kind_phys), intent(inout), dimension(:,:) :: & + oz ! Ozone concentration updated by physics + real(kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + do3_dt_prd, & ! Physics tendency: production and loss effect + do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect + do3_dt_temp, & ! Physics tendency: temperature effect + do3_dt_ohoz ! Physics tendency: overhead ozone effect + + ! Locals + integer :: k, kmax, kmin, iLev, iCol, nCol, nLev, iCf + logical, dimension(size(p,1)) :: flg + real(kind_phys) :: pmax, pmin, tem, temp + real(kind_phys), dimension(size(p,1)) :: wk1, wk2, wk3, ozib + real(kind_phys), dimension(size(p,1),this%ncf) :: prod + real(kind_phys), dimension(size(p,1),size(p,2)) :: ozi + real(kind_phys), dimension(size(p,1),size(p,2)+1) :: colo3, coloz + + ! Dimensions + nCol = size(p,1) + nLev = size(p,2) + + ! Temporaries + ozi = oz + + !> - Calculate vertical integrated column ozone values. + if (this%ncf > 2) then + colo3(:,nLev+1) = 0.0 + do iLev=nLev,1,-1 + do iCol=1,nCol + colo3(iCol,iLev) = colo3(iCol,iLev+1) + ozi(iCol,iLev) * dp(iCol,iLev) * con_1ovg + enddo + enddo + endif + + !> - Apply vertically linear interpolation to the ozone coefficients. + do iLev=1,nLev + pmin = 1.0e10 + pmax = -1.0e10 + + do iCol=1,nCol + wk1(iCol) = log(p(iCol,iLev)) + pmin = min(wk1(iCol), pmin) + pmax = max(wk1(iCol), pmax) + prod(iCol,:) = 0._kind_phys + enddo + kmax = 1 + kmin = 1 + do k=1,this%nlev-1 + if (pmin < this%po3(k)) kmax = k + if (pmax < this%po3(k)) kmin = k + enddo + + do k=kmin,kmax + temp = 1.0 / (this%po3(k) - this%po3(k+1)) + do iCol=1,nCol + flg(iCol) = .false. + if (wk1(iCol) < this%po3(k) .and. wk1(iCol) >= this%po3(k+1)) then + flg(iCol) = .true. + wk2(iCol) = (wk1(iCol) - this%po3(k+1)) * temp + wk3(iCol) = 1.0 - wk2(iCol) + endif + enddo + do iCf=1,this%ncf + do iCol=1,nCol + if (flg(iCol)) then + prod(iCol,iCf) = wk2(iCol) * ozpl(iCol,k,iCf) + wk3(iCol) * ozpl(iCol,k+1,iCf) + endif + enddo + enddo + enddo + + do iCf=1,this%ncf + do iCol=1,nCol + if (wk1(iCol) < this%po3(this%nlev)) then + prod(iCol,iCf) = ozpl(iCol,this%nlev,iCf) + endif + if (wk1(iCol) >= this%po3(1)) then + prod(iCol,iCf) = ozpl(iCol,1,iCf) + endif + enddo + enddo + + if (this%ncf == 2) then + do iCol=1,nCol + ozib(iCol) = ozi(iCol,iLev) + oz(iCol,iLev) = (ozib(iCol) + prod(iCol,1)*dt) / (1.0 + prod(iCol,2)*dt) + enddo + endif + + if (this%ncf == 4) then + do iCol=1,nCol + ozib(iCol) = ozi(iCol,iLev) + tem = prod(iCol,1) + prod(iCol,3)*t(iCol,iLev) + prod(iCol,4)*colo3(iCol,iLev+1) + oz(iCol,iLev) = (ozib(iCol) + tem*dt) / (1.0 + prod(iCol,2)*dt) + enddo + endif + ! Diagnostics (optional) + if (associated(do3_dt_prd)) do3_dt_prd(:,iLev) = prod(:,1)*dt + if (associated(do3_dt_ozmx)) do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) + if (associated(do3_dt_temp)) do3_dt_temp(:,iLev) = prod(:,3) * t(:,iLev) * dt + if (associated(do3_dt_ohoz)) do3_dt_ohoz(:,iLev) = prod(:,4) * colo3(:,iLev) * dt + + enddo + return end subroutine run_o3prog_2006 diff --git a/physics/ozphys.f b/physics/ozphys.f deleted file mode 100644 index 18a9ae46f..000000000 --- a/physics/ozphys.f +++ /dev/null @@ -1,211 +0,0 @@ -!> \file ozphys.f -!! This file is ozone sources and sinks (previous version). - - -!> This module contains the CCPP-compliant Ozone photochemistry scheme. - module ozphys - - contains - -! \brief Brief description of the subroutine -! -!> \section arg_table_ozphys_init Argument Table -!! \htmlinclude ozphys_init.html -!! - subroutine ozphys_init(oz_phys, errmsg, errflg) - - implicit none - logical, intent(in) :: oz_phys - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not.oz_phys) then - write (errmsg,'(*(a))') 'Logic error: oz_phys == .false.' - errflg = 1 - return - endif - - end subroutine ozphys_init - -!>\defgroup GFS_ozphys GFS ozphys Main -!! \brief The operational GFS currently parameterizes ozone production and -!! destruction based on monthly mean coefficients (\c global_o3prdlos.f77) provided by Naval -!! Research Laboratory through CHEM2D chemistry model -!! (McCormack et al. (2006) \cite mccormack_et_al_2006). -!! \section arg_table_ozphys_run Argument Table -!! \htmlinclude ozphys_run.html -!! -!> \section genal_ozphys GFS ozphys_run General Algorithm -!> @{ - subroutine ozphys_run ( & - & im, levs, ko3, dt, oz, tin, po3, & - & prsl, prdout, oz_coeff, delp, ldiag3d, & - & ntoz, dtend, dtidx, index_of_process_prod_loss, & - & index_of_process_ozmix, index_of_process_temp, & - & index_of_process_overhead_ozone, con_g, me, errmsg, errflg) -! -! this code assumes that both prsl and po3 are from bottom to top -! as are all other variables -! - use machine , only : kind_phys - implicit none -! - ! Interface variables - integer, intent(in) :: im, levs, ko3, oz_coeff, me - real(kind=kind_phys), intent(inout) :: oz(:,:) - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), ntoz, & - & index_of_process_prod_loss, index_of_process_ozmix, & - & index_of_process_temp, index_of_process_overhead_ozone - real(kind=kind_phys), intent(in) :: & - & dt, po3(:), prdout(:,:,:), & - & prsl(:,:), tin(:,:), delp(:,:), & - & con_g - real :: gravi - logical, intent(in) :: ldiag3d - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -! - ! Local variables - integer k,kmax,kmin,l,i,j, idtend(4) - logical flg(im) - real(kind=kind_phys) pmax, pmin, tem, temp - real(kind=kind_phys) wk1(im), wk2(im), wk3(im), prod(im,oz_coeff), - & ozib(im), colo3(im,levs+1), ozi(im,levs) -! - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -! -! save input oz in ozi - ozi = oz - gravi=1.0/con_g - - - if(ldiag3d) then - idtend(1) = dtidx(100+ntoz,index_of_process_prod_loss) ! was ozp1 - idtend(2) = dtidx(100+ntoz,index_of_process_ozmix) ! was ozp2 - idtend(3) = dtidx(100+ntoz,index_of_process_temp) ! was ozp3 - idtend(4) = dtidx(100+ntoz,index_of_process_overhead_ozone) ! was ozp4 - else - idtend=0 - endif - -! -!> - Calculate vertical integrated column ozone values. - if (oz_coeff > 2) then - colo3(:,levs+1) = 0.0 - do l=levs,1,-1 - do i=1,im - colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l) * gravi - enddo - enddo - endif -! -!> - Apply vertically linear interpolation to the ozone coefficients. - do l=1,levs - pmin = 1.0e10 - pmax = -1.0e10 -! - do i=1,im - wk1(i) = log(prsl(i,l)) - pmin = min(wk1(i), pmin) - pmax = max(wk1(i), pmax) - prod(i,:) = 0.0 - enddo - kmax = 1 - kmin = 1 - do k=1,ko3-1 - if (pmin < po3(k)) kmax = k - if (pmax < po3(k)) kmin = k - enddo -! - do k=kmin,kmax - temp = 1.0 / (po3(k) - po3(k+1)) - do i=1,im - flg(i) = .false. - if (wk1(i) < po3(k) .and. wk1(i) >= po3(k+1)) then - flg(i) = .true. - wk2(i) = (wk1(i) - po3(k+1)) * temp - wk3(i) = 1.0 - wk2(i) - endif - enddo - do j=1,oz_coeff - do i=1,im - if (flg(i)) then - prod(i,j) = wk2(i) * prdout(i,k,j) - & + wk3(i) * prdout(i,k+1,j) - endif - enddo - enddo - enddo -! - do j=1,oz_coeff - do i=1,im - if (wk1(i) < po3(ko3)) then - prod(i,j) = prdout(i,ko3,j) - endif - if (wk1(i) >= po3(1)) then - prod(i,j) = prdout(i,1,j) - endif - enddo - enddo - - if (oz_coeff == 2) then - do i=1,im - ozib(i) = ozi(i,l) ! no filling - oz(i,l) = (ozib(i) + prod(i,1)*dt) / (1.0 + prod(i,2)*dt) - enddo -! - if(idtend(1)>=1) then - dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 - & prod(:,1)*dt - endif - if(idtend(2)>=1) then - dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 - & (oz(:,l) - ozib(:)) - endif - endif -!> - Calculate the 4 terms of prognostic ozone change during time \a dt: -!! - ozp1(:,:) - Ozone production from production/loss ratio -!! - ozp2(:,:) - Ozone production from ozone mixing ratio -!! - ozp3(:,:) - Ozone production from temperature term at model layers -!! - ozp4(:,:) - Ozone production from column ozone term at model layers - if (oz_coeff == 4) then - do i=1,im - ozib(i) = ozi(i,l) ! no filling - tem = prod(i,1) + prod(i,3)*tin(i,l) - & + prod(i,4)*colo3(i,l+1) -! if (me .eq. 0) print *,'ozphys tem=',tem,' prod=',prod(i,:) -! &,' ozib=',ozib(i),' l=',l,' tin=',tin(i,l),'colo3=',colo3(i,l+1) - oz(i,l) = (ozib(i) + tem*dt) / (1.0 + prod(i,2)*dt) - enddo - if(idtend(1)>=1) then - dtend(:,l,idtend(1)) = dtend(:,l,idtend(1)) + ! was ozp1 - & prod(:,1)*dt - endif - if(idtend(2)>=1) then - dtend(:,l,idtend(2)) = dtend(:,l,idtend(2)) + ! was ozp2 - & (oz(:,l)-ozib(:)) - endif - if(idtend(3)>=1) then - dtend(:,l,idtend(3)) = dtend(:,l,idtend(3)) + ! was ozp3 - & prod(:,3)*tin(:,l)*dt - endif - if(idtend(4)>=1) then - dtend(:,l,idtend(4)) = dtend(:,l,idtend(4)) + ! was ozp4 - & prod(:,4)*colo3(:,l+1)*dt - endif - endif - enddo ! vertical loop -! - return - end subroutine ozphys_run -!> @} - - end module ozphys diff --git a/physics/ozphys.meta b/physics/ozphys.meta deleted file mode 100644 index 485e2a491..000000000 --- a/physics/ozphys.meta +++ /dev/null @@ -1,208 +0,0 @@ -[ccpp-table-properties] - name = ozphys - type = scheme - dependencies = machine.F - -######################################################################## -[ccpp-arg-table] - name = ozphys_init - type = scheme -[oz_phys] - standard_name = flag_for_nrl_2006_ozone_scheme - long_name = flag for old (2006) ozone physics - units = flag - dimensions = () - type = logical - intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - -######################################################################## -[ccpp-arg-table] - name = ozphys_run - type = scheme -[im] - standard_name = horizontal_loop_extent - long_name = horizontal loop extent - units = count - dimensions = () - type = integer - intent = in -[levs] - standard_name = vertical_layer_dimension - long_name = number of vertical layers - units = count - dimensions = () - type = integer - intent = in -[ko3] - standard_name = vertical_dimension_of_ozone_forcing_data - long_name = number of vertical layers in ozone forcing data - units = count - dimensions = () - type = integer - intent = in -[dt] - standard_name = timestep_for_physics - long_name = physics time step - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[oz] - standard_name = ozone_concentration_of_new_state - long_name = ozone concentration updated by physics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[tin] - standard_name = air_temperature_of_new_state - long_name = updated air temperature - units = K - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[po3] - standard_name = natural_log_of_ozone_forcing_data_pressure_levels - long_name = natural log of ozone forcing data pressure levels - units = 1 - dimensions = (vertical_dimension_of_ozone_forcing_data) - type = real - kind = kind_phys - intent = in -[prsl] - standard_name = air_pressure - long_name = mid-layer pressure - units = Pa - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[prdout] - standard_name = ozone_forcing - long_name = ozone forcing coefficients - units = mixed - dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data) - type = real - kind = kind_phys - intent = in -[oz_coeff] - standard_name = number_of_coefficients_in_ozone_forcing_data - long_name = number of coefficients in ozone forcing data - units = index - dimensions = () - type = integer - intent = in -[delp] - standard_name = air_pressure_difference_between_midlayers - long_name = difference between mid-layer pressures - units = Pa - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[ldiag3d] - standard_name = flag_for_diagnostics_3D - long_name = flag for calculating 3-D diagnostic fields - units = flag - dimensions = () - type = logical - intent = in -[dtend] - standard_name = cumulative_change_of_state_variables - long_name = diagnostic tendencies for state variables - units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) - type = real - kind = kind_phys - active = (flag_for_diagnostics_3D) - intent = inout -[dtidx] - standard_name = cumulative_change_of_state_variables_outer_index - long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index - units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) - type = integer - intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in -[index_of_process_prod_loss] - standard_name = index_of_production_and_loss_process_in_cumulative_change_index - long_name = index of production and loss effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_ozmix] - standard_name = index_of_ozone_mixing_ratio_process_in_cumulative_change_index - long_name = index of ozone mixing ratio effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_temp] - standard_name = index_of_temperature_process_in_cumulative_change_index - long_name = index of temperature effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_overhead_ozone] - standard_name = index_of_overhead_process_in_cumulative_change_index - long_name = index of overhead ozone effect in photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[con_g] - standard_name = gravitational_acceleration - long_name = gravitational acceleration - units = m s-2 - dimensions = () - type = real - kind = kind_phys - intent = in -[me] - standard_name = mpi_rank - long_name = rank of the current MPI task - units = index - dimensions = () - type = integer - intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out From a55ce5e69e85d93e6b28b303a92c9ad7087aad08 Mon Sep 17 00:00:00 2001 From: "Samuel Trahan (NOAA contractor)" <39415369+SamuelTrahanNOAA@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:09:44 -0400 Subject: [PATCH 68/81] z => dz --- physics/clm_lake.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index da4712810..620f79a96 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -551,7 +551,7 @@ SUBROUTINE clm_lake_run( & do c = 2,column z_lake(c,:) = z_lake(1,:) - dz_lake(c,:) = z_lake(1,:) + dz_lake(c,:) = dz_lake(1,:) enddo ! Soil hydraulic and thermal properties From 00d90608a08f13ac367f2c002b8ae18eea4e8f6b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 28 Sep 2023 17:19:33 +0000 Subject: [PATCH 69/81] Added documentation --- physics/GFS_physics_post.F90 | 12 +++- physics/module_ozphys.F90 | 119 +++++++++++++++++++++++------------ 2 files changed, 87 insertions(+), 44 deletions(-) diff --git a/physics/GFS_physics_post.F90 b/physics/GFS_physics_post.F90 index d034c1999..e6a50cc3a 100644 --- a/physics/GFS_physics_post.F90 +++ b/physics/GFS_physics_post.F90 @@ -1,6 +1,11 @@ ! ########################################################################################### !> \file GFS_physics_post.F90 !! +!! This module contains GFS specific calculations (e.g. diagnostics) and suite specific +!! code (e.g Saving fields for subsequent physics timesteps). For interoperability across a +!! wide range of hosts, CCPP compliant schemes should avoid including such calculations. This +!! module/scheme is intended for such "host-specific" computations. +!! ! ########################################################################################### module GFS_physics_post use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec @@ -30,9 +35,10 @@ end subroutine GFS_physics_post_init !! \section arg_table_GFS_physics_post_run Argument Table !! \htmlinclude GFS_physics_post_run.html !! - subroutine GFS_physics_post_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, & - ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, dtend,& - errmsg, errflg) + subroutine GFS_physics_post_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, ip_temp, & + ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, dtend, errmsg, & + errflg) + ! Inputs integer, intent(in) :: & nCol, & ! Horizontal dimension diff --git a/physics/module_ozphys.F90 b/physics/module_ozphys.F90 index d24585d4d..f824736b1 100644 --- a/physics/module_ozphys.F90 +++ b/physics/module_ozphys.F90 @@ -2,6 +2,39 @@ !> \section arg_table_module_ozphys Argument table !! \htmlinclude module_ozphys.html !! +! +!> The operational GFS currently parameterizes ozone production and destruction based on +!! monthly mean coefficients (\c global_o3prdlos.f77) provided by Naval Research Laboratory +!! through CHEM2D chemistry model (McCormack et al. (2006) \cite mccormack_et_al_2006). +!! +!! There are two implementations of this parameterization within this module. +!! run_o3prog_2006 - Relies on either two/four mean monthly coefficients. This is explained +!! in (https://doi.org/10.5194/acp-6-4943-2006. See Eq.(4)). +!! run_o3prog_2015 - Relies on six mean monthly coefficients, specifically for NRL +!! parameterization and climatological T and O3 are in location 5 and 6 of +!! the coefficient array. +!! +!! Both of these rely on the scheme being setup correctly by invoking the load(), setup(), +!! and update() procedures prior to calling the run() procedure. +!! +!! load_o3prog() - Read in data and load into type ty_ozphys (called once from host) +!! setup_o3prog() - Create spatial interpolation indices (called once, after model grid is known) +!! update_o3prog() - Update ozone concentration in time (call in physics loop, before run()) +!! *CAVEAT* Since the radiation is often run at a lower temporal resolution +!! than the rest of the physics, update_o3prog() needs to be +!! called before the radiation, which is called before the physics. +!! For example, within the physics loop: +!! update_o3prog() -> radiation() -> run_o3prog() -> physics.... +!! +!! Additionally, there is the functionality to not use interactive ozone, instead reverting +!! to ozone climatology. In this case, analagous to when using prognostic ozone, there are +!! update() and run() procedures that need to be called before the radiation. +!! For example, within the physics loop: +!! update_o3clim() -> run_o3clim() -> radiation() -> physics... +!! +!!\author June 2015 - Shrinivas Moorthi +!!\modified Sep 2023 - Dustin Swales +!! ! ######################################################################################### module module_ozphys use machine, only : kind_phys @@ -14,7 +47,8 @@ module module_ozphys !> \section arg_table_ty_ozphys Argument Table !! \htmlinclude ty_ozphys.html !! -!! All data field are ordered from surface-to-toa (j=1=isfc) +!> Derived type containing data and procedures needed by ozone photochemistry parameterization +!! *Note* All data field are ordered from surface-to-toa. !! ! ######################################################################################### type ty_ozphys @@ -54,7 +88,7 @@ module module_ozphys contains ! ######################################################################################### - ! Procedure (type-bound) for loading ozone forcing data. + ! Procedure (type-bound) for loading data for prognostic ozone. ! ######################################################################################### function load_o3prog(this, file, fileID) result (err_message) class(ty_ozphys), intent(inout) :: this @@ -101,7 +135,9 @@ function load_o3prog(this, file, fileID) result (err_message) end function load_o3prog ! ######################################################################################### - ! Procedure for setting up interpolation indices between data and model grid. + ! Procedure (type-bound) for setting up interpolation indices between data-grid and + ! model-grid. + ! Called once during initialization ! ######################################################################################### subroutine setup_o3prog(this, lat, idx1, idx2, idxh) class(ty_ozphys), intent(in) :: this @@ -130,7 +166,7 @@ subroutine setup_o3prog(this, lat, idx1, idx2, idxh) end subroutine setup_o3prog ! ######################################################################################### - ! Procedure (type-bound) for updating ozone data. + ! Procedure (type-bound) for updating data used in prognostic ozone scheme. ! ######################################################################################### subroutine update_o3prog(this, idx1, idx2, idxh, rjday, idxt1, idxt2, ozpl) class(ty_ozphys), intent(in) :: this @@ -474,7 +510,7 @@ subroutine run_o3clim(this, lat, prslk, con_pi, oz) end subroutine run_o3clim ! ######################################################################################### - ! Procedure (type-bound) for loading ozone climo data. + ! Procedure (type-bound) for loading data for climotological ozone. ! ######################################################################################### function load_o3clim(this, file, fileID) result (err_message) class(ty_ozphys), intent(inout) :: this @@ -546,46 +582,47 @@ function load_o3clim(this, file, fileID) result (err_message) this%pstr(iLev) = pstr4(iLev) this%pkstr(iLev) = fpkapx(this%pstr(iLev)*100.0) enddo - + end function load_o3clim - ! ######################################################################################### - ! Procedure (type-bound) for updating ozone climotological data. - ! ######################################################################################### - subroutine update_o3clim(this, imon, iday, ihour, loz1st) - class(ty_ozphys), intent(inout) :: this - integer, intent(in) :: imon, iday, ihour - logical, intent(in) :: loz1st - - integer :: midmon=15, midm=15, midp=45, id - integer, parameter, dimension(13) :: mdays = (/31,28,31,30,31,30,31,31,30,31,30,31,30/) - logical :: change - - midmon = mdays(imon)/2 + 1 - change = loz1st .or. ( (iday==midmon) .and. (ihour==0) ) + ! ######################################################################################### + ! Procedure (type-bound) for updating temporal interpolation index when using climotological + ! ozone + ! ######################################################################################### + subroutine update_o3clim(this, imon, iday, ihour, loz1st) + class(ty_ozphys), intent(inout) :: this + integer, intent(in) :: imon, iday, ihour + logical, intent(in) :: loz1st + + integer :: midmon=15, midm=15, midp=45, id + integer, parameter, dimension(13) :: mdays = (/31,28,31,30,31,30,31,31,30,31,30,31,30/) + logical :: change + + midmon = mdays(imon)/2 + 1 + change = loz1st .or. ( (iday==midmon) .and. (ihour==0) ) - if ( change ) then - if ( iday < midmon ) then - this%k1oz = mod(imon+10, 12) + 1 - midm = mdays(this%k1oz)/2 + 1 - this%k2oz = imon - midp = mdays(this%k1oz) + midmon - else - this%k1oz = imon - midm = midmon - this%k2oz = mod(imon, 12) + 1 - midp = mdays(this%k2oz)/2 + 1 + mdays(this%k1oz) - endif - endif + if ( change ) then + if ( iday < midmon ) then + this%k1oz = mod(imon+10, 12) + 1 + midm = mdays(this%k1oz)/2 + 1 + this%k2oz = imon + midp = mdays(this%k1oz) + midmon + else + this%k1oz = imon + midm = midmon + this%k2oz = mod(imon, 12) + 1 + midp = mdays(this%k2oz)/2 + 1 + mdays(this%k1oz) + endif + endif - if (iday < midmon) then - id = iday + mdays(this%k1oz) - else - id = iday - endif + if (iday < midmon) then + id = iday + mdays(this%k1oz) + else + id = iday + endif - this%facoz = float(id - midm) / float(midp - midm) + this%facoz = float(id - midm) / float(midp - midm) - end subroutine update_o3clim + end subroutine update_o3clim -end module module_ozphys + end module module_ozphys From ab4d5f1206d5bb8a7550682612a84bf77e0bdbdc Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Fri, 29 Sep 2023 02:49:39 +0000 Subject: [PATCH 70/81] "correct the dimension of soil moisture for dust emission" --- physics/smoke_dust/rrfs_smoke_wrapper.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index a0a641246..cddc20fbc 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -220,7 +220,7 @@ standard_name = volume_fraction_of_soil_moisture_for_land_surface_model long_name = volumetric fraction of soil moisture for lsm units = frac - dimensions = (horizontal_dimension,vertical_dimension_of_soil_internal_to_land_surface_scheme) + dimensions = (horizontal_loop_extent,vertical_dimension_of_soil_internal_to_land_surface_scheme) type = real kind = kind_phys intent = inout From e08ecd648a3f984a79e1dfd042f66edfbfb54d62 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Fri, 6 Oct 2023 15:07:48 -0400 Subject: [PATCH 71/81] land surface updates for hr3 --- physics/module_sf_noahmplsm.F90 | 15 +++++++++------ physics/noahmpdrv.F90 | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/physics/module_sf_noahmplsm.F90 b/physics/module_sf_noahmplsm.F90 index 86853dabe..8ced8930f 100644 --- a/physics/module_sf_noahmplsm.F90 +++ b/physics/module_sf_noahmplsm.F90 @@ -2116,7 +2116,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in ! thermal properties of soil, snow, lake, and frozen soil call thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , & !in - dt ,snowh ,snice ,snliq , & !in + dt ,snowh ,snice ,snliq , shdfac, & !in smc ,sh2o ,tg ,stc ,ur , & !in lat ,z0m ,zlvl ,vegtyp , & !in df ,hcpct ,snicev ,snliqv ,epore , & !out @@ -2463,7 +2463,7 @@ end subroutine energy !>\ingroup NoahMP_LSM subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , & !in - dt ,snowh ,snice ,snliq , & !in + dt ,snowh ,snice ,snliq , shdfac, & !in smc ,sh2o ,tg ,stc ,ur , & !in lat ,z0m ,zlvl ,vegtyp , & !in df ,hcpct ,snicev ,snliqv ,epore , & !out @@ -2480,6 +2480,7 @@ subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , real (kind=kind_phys) , intent(in) :: dt !< time step [s] real (kind=kind_phys), dimension(-nsnow+1: 0), intent(in) :: snice !< snow ice mass (kg/m2) real (kind=kind_phys), dimension(-nsnow+1: 0), intent(in) :: snliq !< snow liq mass (kg/m2) + real (kind=kind_phys) , intent(in) :: shdfac !< green vegetation fraction [0.0-1.0] real (kind=kind_phys), dimension(-nsnow+1:nsoil), intent(in) :: dzsnso !< thickness of snow/soil layers [m] real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: smc !< soil moisture (ice + liq.) [m3/m3] real (kind=kind_phys), dimension( 1:nsoil), intent(in) :: sh2o !< liquid soil moisture [m3/m3] @@ -2539,6 +2540,7 @@ subroutine thermoprop (parameters,nsoil ,nsnow ,isnow ,ist ,dzsnso , ! not in use because of the separation of the canopy layer from the ground. ! but this may represent the effects of leaf litter (niu comments) ! df1 = df1 * exp (sbeta * shdfac) + df(1) = df(1) * exp (sbeta * shdfac) ! compute lake thermal properties ! (no consideration of turbulent mixing for this version) @@ -4888,7 +4890,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & end if endif ! 4 -! use sfc_diag to calculate t2mv and q2v for opt_sfc=1&3 +! use sfc_diag to calculate t2mb and q2b for opt_sfc=1&3 if(opt_diag ==3) then if(opt_sfc == 1 .or. opt_sfc == 3) then @@ -5823,7 +5825,8 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, elseif (opt_trs == chen09) then - z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) +! z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) +! z0m_out = fveg * z0m + (1.0 - fveg) * z0mg czil = 10.0 ** (- 0.4 * parameters%hvt) reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c @@ -5873,7 +5876,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, z0h_out = z0m_out - elseif (opt_trs == tessel) then + elseif (opt_trs == chen09 .or. opt_trs == tessel) then if (vegtyp <= 5) then z0h_out = z0m_out @@ -5881,7 +5884,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, z0h_out = z0m_out * 0.01 endif - elseif (opt_trs == blumel99 .or. opt_trs == chen09) then + elseif (opt_trs == blumel99) then reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c if (reyn > 2.0) then diff --git a/physics/noahmpdrv.F90 b/physics/noahmpdrv.F90 index 4500d51a8..c2c03d0de 100644 --- a/physics/noahmpdrv.F90 +++ b/physics/noahmpdrv.F90 @@ -450,7 +450,7 @@ subroutine noahmpdrv_run & integer :: iopt_pedo = 1 ! option for pedotransfer function integer :: iopt_crop = 0 ! option for crop model integer :: iopt_gla = 2 ! option for glacier treatment - integer :: iopt_z0m = 2 ! option for z0m treatment + integer :: iopt_z0m = 1 ! option for z0m treatment ! ! --- local inputs to noah-mp and glacier subroutines; listed in order in noah-mp call From 4f8004ab57b85d76884858849a5f4211f28d3084 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Fri, 6 Oct 2023 18:05:17 -0400 Subject: [PATCH 72/81] remove one printout from sfcsub.f and uncomment z0m composition in module_sf_noahmplsm.F90 --- physics/module_sf_noahmplsm.F90 | 2 +- physics/sfcsub.F | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/physics/module_sf_noahmplsm.F90 b/physics/module_sf_noahmplsm.F90 index 8ced8930f..6abd59f69 100644 --- a/physics/module_sf_noahmplsm.F90 +++ b/physics/module_sf_noahmplsm.F90 @@ -5826,7 +5826,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, elseif (opt_trs == chen09) then ! z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) -! z0m_out = fveg * z0m + (1.0 - fveg) * z0mg + z0m_out = fveg * z0m + (1.0 - fveg) * z0mg czil = 10.0 ** (- 0.4 * parameters%hvt) reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c diff --git a/physics/sfcsub.F b/physics/sfcsub.F index 7be07b39c..494b8f7dc 100644 --- a/physics/sfcsub.F +++ b/physics/sfcsub.F @@ -7491,9 +7491,6 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & endif call abort endif -! -! soil type - print *,'in FIXREAD fnsotc =',fnsotc ! if(fnsotc(1:8).ne.' ') then if ( index(fnsotc, "tileX.nc") == 0) then ! grib file From 5bd6da748d22564212a448ba0e143fb8ada23722 Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Wed, 11 Oct 2023 14:21:32 -0500 Subject: [PATCH 73/81] Set initial values for some constants (just in case) --- physics/module_mp_nssl_2mom.F90 | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index a40a62f02..a88ffe053 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -951,19 +951,20 @@ MODULE module_mp_nssl_2mom real, parameter :: cawbolton = 17.67 real, parameter :: tfrh = 233.15 +! -------------------------- + ! For CCPP, the following variables should be set by the host model, but initial values are set just in case real :: tfr = 273.15 - real :: cp = 1004.0, rd = 287.04 real :: rw = 461.5 ! gas const. for water vapor - REAL, PRIVATE :: cpl = 4190.0 - REAL, PRIVATE :: cpigb = 2106.0 - real :: cpi - real :: cap - real :: tfrcbw - real :: tfrcbi - real :: rovcp - real, public :: rdorv = 0.622 - + real :: cpl = 4190.0 + real :: cpigb = 2106.0 + real :: cpi = 1.0/1004.0 + real :: cap = 287.04/1004.0 + real :: tfrcbw = 273.15 - cbw + real :: tfrcbi = 273.15 - cbi + real :: rovcp = 287.04/1004.0 + real :: rdorv = 0.622 +! -------------------------- real, parameter :: poo = 1.0e+05 real, parameter :: advisc0 = 1.832e-05 ! reference dynamic viscosity (SMT; see Beard & Pruppacher 71) real, parameter :: advisc1 = 1.718e-05 ! dynamic viscosity constant used in thermal conductivity calc @@ -4113,7 +4114,7 @@ subroutine hailmaxd(dtp,nx,ny,nz,an,na,nor,norz,alpha2d,dn, & g1palp = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami tmp = dn(ix,jy,kz)*an(ix,jy,kz,lh)/(hwdn*an(ix,jy,kz,lnh)) - diam = (6.0*tmp/(3.14159))**(1./3.) + diam = (6.0*tmp/pi)**(1./3.) IF ( lzh > 1 ) THEN ! 3moment cwchtmp = ((3. + alpha2d(ix,1,kz,2))*(2. + alpha2d(ix,1,kz,2))*(1.0 + alpha2d(ix,1,kz,2)))**(-1./3.) ENDIF @@ -4184,7 +4185,7 @@ subroutine hailmaxd(dtp,nx,ny,nz,an,na,nor,norz,alpha2d,dn, & g1palp = gmoi(i) + (gmoi(i+1) - gmoi(i))*del*dgami tmp = dn(ix,jy,kz)*an(ix,jy,kz,lhl)/(hwdn*an(ix,jy,kz,lnhl)) - diam = (6.0*tmp/(3.14159))**(1./3.) + diam = (6.0*tmp/pi)**(1./3.) IF ( lzhl > 1 ) THEN ! 3moment cwchltmp = ((3. + alpha2d(ix,1,kz,3))*(2. + alpha2d(ix,1,kz,3))*(1.0 + alpha2d(ix,1,kz,3)))**(-1./3.) ENDIF From 1b2239714a949341409261ebbfb8a0bdf6a4f5da Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 12 Oct 2023 03:40:06 +0000 Subject: [PATCH 74/81] Some more cleanup --- physics/GFS_physics_post.F90 | 99 ++++++++++++++++++++++++++++++----- physics/GFS_physics_post.meta | 49 +++++++++++++++++ physics/phys_tend.F90 | 96 --------------------------------- physics/phys_tend.meta | 95 --------------------------------- 4 files changed, 134 insertions(+), 205 deletions(-) delete mode 100644 physics/phys_tend.F90 delete mode 100644 physics/phys_tend.meta diff --git a/physics/GFS_physics_post.F90 b/physics/GFS_physics_post.F90 index e6a50cc3a..def38cd1a 100644 --- a/physics/GFS_physics_post.F90 +++ b/physics/GFS_physics_post.F90 @@ -35,47 +35,62 @@ end subroutine GFS_physics_post_init !! \section arg_table_GFS_physics_post_run Argument Table !! \htmlinclude GFS_physics_post_run.html !! - subroutine GFS_physics_post_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, ip_temp, & - ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, dtend, errmsg, & - errflg) + subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_summed, & + dtidx, is_photochem, ldiag3d, ip_physics, ip_photochem, & + ip_prod_loss, ip_ozmix, ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, & + do3_dt_temp, do3_dt_ohoz, dtend, errmsg, errflg) ! Inputs integer, intent(in) :: & nCol, & ! Horizontal dimension nLev, & ! Number of vertical layers ntoz, & ! Index for ozone mixing ratio + ntracp100, & ! Number of tracers plus 100 + nprocess, & ! Number of processes that cause changes in state variables + nprocess_summed,& ! Number of causes in dtidx per tracer summed for total physics tendency + ip_physics, & ! Index for process in diagnostic tendency output + ip_photochem, & ! ip_prod_loss, & ! Index for process in diagnostic tendency output ip_ozmix, & ! Index for process in diagnostic tendency output ip_temp, & ! Index for process in diagnostic tendency output ip_overhead_ozone ! Index for process in diagnostic tendency output integer, intent(in), dimension(:,:) :: & dtidx ! Bookkeeping indices for GFS diagnostic tendencies + logical, intent(in) :: & + ldiag3d ! Flag for 3d diagnostic fields + logical, intent(in), dimension(:) :: & + is_photochem ! Flags for photochemistry processes to sum ! Inputs (optional) real(kind=kind_phys), intent(in), dimension(:,:), pointer, optional :: & - do3_dt_prd, & ! Physics tendency: production and loss effect - do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect - do3_dt_temp, & ! Physics tendency: temperature effect - do3_dt_ohoz ! Physics tendency: overhead ozone effect + do3_dt_prd, & ! Physics tendency: production and loss effect + do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect + do3_dt_temp, & ! Physics tendency: temperature effect + do3_dt_ohoz ! Physics tendency: overhead ozone effect ! Outputs real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & - dtend ! Diagnostic tendencies for state variables + dtend ! Diagnostic tendencies for state variables character(len=*), intent(out) :: & - errmsg ! CCPP error message + errmsg ! CCPP error message integer, intent(out) :: & - errflg ! CCPP error flag + errflg ! CCPP error flag ! Locals - integer :: idtend - + integer :: idtend, ichem, iphys, itrac + logical :: all_true(nprocess) + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + if(.not.ldiag3d) then + return + endif + ! ####################################################################################### ! - ! Ozone physics diagnostic + ! Ozone physics diagnostics ! ! ####################################################################################### idtend = dtidx(100+ntoz,ip_prod_loss) @@ -98,6 +113,62 @@ subroutine GFS_physics_post_run(nCol, nLev, ntoz, dtidx, ip_prod_loss, ip_ozmix, dtend(:,:,idtend) = dtend(:,:,idtend) + do3_dt_ohoz endif - end subroutine GFS_physics_post_run + ! ####################################################################################### + ! + ! Total (photochemical) tendencies. + ! + ! ####################################################################################### + itrac = ntoz+100 + ichem = dtidx(itrac, ip_photochem) + if(ichem >= 1) then + call sum_it(ichem, itrac, is_photochem) + endif + ! ####################################################################################### + ! + ! Total (physics) tendencies + ! + ! ####################################################################################### + all_true = .true. + do itrac = 2,ntracp100 + iphys = dtidx(itrac,ip_physics) + if(iphys >= 1) then + call sum_it(iphys, itrac, all_true) + endif + enddo + + contains + + subroutine sum_it(isum,itrac,sum_me) + integer, intent(in) :: isum ! third index of dtend of summary process + integer, intent(in) :: itrac ! tracer or state variable being summed + logical, intent(in) :: sum_me(nprocess) ! false = skip this process + logical :: first + integer :: idtend, iprocess + + first=.true. + do iprocess=1,nprocess + if(iprocess>nprocess_summed) then + exit ! Don't sum up the sums. + else if(.not.sum_me(iprocess)) then + cycle ! We were asked to skip this one. + endif + idtend = dtidx(itrac,iprocess) + if(idtend>=1) then + ! This tendency was calculated for this tracer, so + ! accumulate it into the total tendency. + if(first) then + dtend(:,:,isum) = dtend(:,:,idtend) + first=.false. + else + dtend(:,:,isum) = dtend(:,:,isum) + dtend(:,:,idtend) + endif + endif + enddo + if(first) then + ! No tendencies were calculated, so sum is 0: + dtend(:,:,isum) = 0 + endif + end subroutine sum_it + end subroutine GFS_physics_post_run end module GFS_physics_post diff --git a/physics/GFS_physics_post.meta b/physics/GFS_physics_post.meta index 8b5120b9e..649ef6491 100644 --- a/physics/GFS_physics_post.meta +++ b/physics/GFS_physics_post.meta @@ -63,6 +63,55 @@ dimensions = () type = integer intent = in +[ntracp100] + standard_name = number_of_tracers_plus_one_hundred + long_name = number of tracers plus one hundred + units = count + dimensions = () + type = integer + intent = in +[nprocess] + standard_name = number_of_cumulative_change_processes + long_name = number of processes that cause changes in state variables + units = count + dimensions = () + type = integer + intent = in +[nprocess_summed] + standard_name = number_of_physics_causes_of_tracer_changes + long_name = number of causes in dtidx per tracer summed for total physics tendency + units = count + dimensions = () + type = integer + intent = in +[ip_physics] + standard_name = index_of_all_physics_process_in_cumulative_change_index + long_name = index of all physics transport process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[ip_photochem] + standard_name = index_of_photochemistry_process_in_cumulative_change_index + long_name = index of photochemistry process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[is_photochem] + standard_name = flags_for_photochemistry_processes_to_sum + long_name = flags for photochemistry processes to sum as the total photochemistry process cumulative change + units = flag + dimensions = (number_of_cumulative_change_processes) + type = logical + intent = in +[ldiag3d] + standard_name = flag_for_diagnostics_3D + long_name = flag for 3d diagnostic fields + units = flag + dimensions = () + type = logical + intent = in [ip_prod_loss] standard_name = index_of_production_and_loss_process_in_cumulative_change_index long_name = index of production and loss effect in photochemistry process in second dimension of array cumulative change index diff --git a/physics/phys_tend.F90 b/physics/phys_tend.F90 deleted file mode 100644 index e63f44be5..000000000 --- a/physics/phys_tend.F90 +++ /dev/null @@ -1,96 +0,0 @@ -!>\file phys_tend.F90 -!! -module phys_tend - - use machine, only: kind_phys - - implicit none - - private - - public phys_tend_run - -contains - -!> \section arg_table_phys_tend_run Argument Table -!! \htmlinclude phys_tend_run.html -!! - subroutine phys_tend_run(ldiag3d, dtend, dtidx, ntracp100, & - index_of_process_physics, index_of_process_photochem, & - nprocess, nprocess_summed, is_photochem, ntoz, errmsg, errflg) - - ! Interface variables - logical, intent(in) :: ldiag3d, is_photochem(:) - real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_process_physics, ntoz, & - ntracp100, nprocess, nprocess_summed, index_of_process_photochem - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - integer :: ichem, iphys, itrac - logical :: all_true(nprocess) - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if(.not.ldiag3d) then - return - endif - - all_true = .true. - - ! Total photochemical tendencies - itrac=ntoz+100 - ichem = dtidx(itrac,index_of_process_photochem) - if(ichem>=1) then - call sum_it(ichem,itrac,is_photochem) - endif - - - do itrac=2,ntracp100 - ! Total physics tendencies - iphys = dtidx(itrac,index_of_process_physics) - if(iphys>=1) then - call sum_it(iphys,itrac,all_true) - endif - enddo - - contains - - subroutine sum_it(isum,itrac,sum_me) - implicit none - integer, intent(in) :: isum ! third index of dtend of summary process - integer, intent(in) :: itrac ! tracer or state variable being summed - logical, intent(in) :: sum_me(nprocess) ! false = skip this process - logical :: first - integer :: idtend, iprocess - - first=.true. - do iprocess=1,nprocess - if(iprocess>nprocess_summed) then - exit ! Don't sum up the sums. - else if(.not.sum_me(iprocess)) then - cycle ! We were asked to skip this one. - endif - idtend = dtidx(itrac,iprocess) - if(idtend>=1) then - ! This tendency was calculated for this tracer, so - ! accumulate it into the total tendency. - if(first) then - dtend(:,:,isum) = dtend(:,:,idtend) - first=.false. - else - dtend(:,:,isum) = dtend(:,:,isum) + dtend(:,:,idtend) - endif - endif - enddo - if(first) then - ! No tendencies were calculated, so sum is 0: - dtend(:,:,isum) = 0 - endif - end subroutine sum_it - - end subroutine phys_tend_run - -end module phys_tend diff --git a/physics/phys_tend.meta b/physics/phys_tend.meta deleted file mode 100644 index 0f78af20b..000000000 --- a/physics/phys_tend.meta +++ /dev/null @@ -1,95 +0,0 @@ -[ccpp-table-properties] - name = phys_tend - type = scheme - dependencies = machine.F - -######################################################################## -[ccpp-arg-table] - name = phys_tend_run - type = scheme -[ldiag3d] - standard_name = flag_for_diagnostics_3D - long_name = flag for 3d diagnostic fields - units = flag - dimensions = () - type = logical - intent = in -[dtend] - standard_name = cumulative_change_of_state_variables - long_name = diagnostic tendencies for state variables - units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) - type = real - kind = kind_phys - intent = inout -[dtidx] - standard_name = cumulative_change_of_state_variables_outer_index - long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index - units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) - type = integer - intent = in -[ntracp100] - standard_name = number_of_tracers_plus_one_hundred - long_name = number of tracers plus one hundred - units = count - dimensions = () - type = integer - intent = in -[index_of_process_physics] - standard_name = index_of_all_physics_process_in_cumulative_change_index - long_name = index of all physics transport process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_photochem] - standard_name = index_of_photochemistry_process_in_cumulative_change_index - long_name = index of photochemistry process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[nprocess] - standard_name = number_of_cumulative_change_processes - long_name = number of processes that cause changes in state variables - units = count - dimensions = () - type = integer - intent = in -[nprocess_summed] - standard_name = number_of_physics_causes_of_tracer_changes - long_name = number of causes in dtidx per tracer summed for total physics tendency - units = count - dimensions = () - type = integer - intent = in -[is_photochem] - standard_name = flags_for_photochemistry_processes_to_sum - long_name = flags for photochemistry processes to sum as the total photochemistry process cumulative change - units = flag - dimensions = (number_of_cumulative_change_processes) - type = logical - intent = in -[ntoz] - standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array - long_name = tracer index for ozone mixing ratio - units = index - dimensions = () - type = integer - intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out From 06bb2bcc9ea2fa5dd52d8f0aa8be2f41b65ab8c0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 12 Oct 2023 15:17:00 +0000 Subject: [PATCH 75/81] Final cleanup --- physics/GFS_phys_time_vary.scm.F90 | 83 +++++++++++++++++++++++------ physics/GFS_phys_time_vary.scm.meta | 75 +++++++++++++++++++++++++- physics/GFS_physics_post.F90 | 24 ++------- physics/GFS_physics_post.meta | 20 ------- 4 files changed, 144 insertions(+), 58 deletions(-) diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index 97460ac98..075bfc039 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -2,15 +2,17 @@ !! Contains code related to GFS physics suite setup (physics part of time_vary_step) !>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update -!! This module contains GFS physics time vary subroutines including, stratospheric water vapor, +!! This module contains GFS physics time vary subroutines including stratospheric water vapor, !! aerosol, IN&CCN and surface properties updates. !> @{ module GFS_phys_time_vary - use machine, only : kind_phys + use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec use mersenne_twister, only: random_setseed, random_number + use module_ozphys, only: ty_ozphys + use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol @@ -58,8 +60,8 @@ module GFS_phys_time_vary !>\section gen_GFS_phys_time_vary_init GFS_phys_time_vary_init General Algorithm !! @{ subroutine GFS_phys_time_vary_init ( & - me, master, h2o_phys, iaerclm, iccn, iflip, im, nx, ny, idate, xlat_d, xlon_d, & - jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & + me, master, ntoz, h2o_phys, iaerclm, iccn, iflip, im, nx, ny, idate, xlat_d, xlon_d, & + jindx1_o3, jindx2_o3, ddy_o3, ozphys, jindx1_h, jindx2_h, ddy_h, h2opl,fhour, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, imap, jmap, & do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, & @@ -76,14 +78,14 @@ subroutine GFS_phys_time_vary_init ( implicit none ! Interface variables - integer, intent(in) :: me, master, iccn, iflip, im, nx, ny + integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhour real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:) - integer, intent(inout) :: jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(inout) :: ddy_h(:) + integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:) real(kind_phys), intent(in) :: h2opl(:,:,:) integer, intent(inout) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(inout) :: ddy_aer(:), ddx_aer(:) @@ -101,6 +103,7 @@ subroutine GFS_phys_time_vary_init ( real(kind_phys), intent(in) :: min_seaice, fice(:) real(kind_phys), intent(in) :: landfrac(:) real(kind_phys), intent(inout) :: weasd(:) + type(ty_ozphys), intent(in) :: ozphys ! NoahMP - only allocated when NoahMP is used integer, intent(in) :: lsoil, lsnow_lsm_lbound, lsnow_lsm_ubound @@ -244,6 +247,11 @@ subroutine GFS_phys_time_vary_init ( !> - Initialize soil vegetation (needed for sncovr calculation further down) call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) +!> - Setup spatial interpolation indices for ozone physics. + if (ntoz > 0) then + call ozphys%setup_o3prog(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) + endif + !> - Call setindxh2o() to initialize stratospheric water vapor data if (h2o_phys) then call setindxh2o (im, xlat_d, jindx1_h, jindx2_h, ddy_h) @@ -625,8 +633,8 @@ end subroutine GFS_phys_time_vary_init !! @{ subroutine GFS_phys_time_vary_timestep_init ( & me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, & - imfdeepcnv, cal_pre, random_clds, h2o_phys, iaerclm, iccn, clstp, & - jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & + imfdeepcnv, cal_pre, random_clds, ozphys, ntoz, h2o_phys, iaerclm, iccn, clstp, & + jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, & jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, & imap, jmap, prsl, seed0, rann, do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau,& @@ -636,14 +644,14 @@ subroutine GFS_phys_time_vary_timestep_init ( ! Interface variables integer, intent(in) :: me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, & - nsswr, imfdeepcnv, iccn, iflip + nsswr, imfdeepcnv, iccn, ntoz, iflip integer, intent(in) :: idate(:) real(kind_phys), intent(in) :: fhswr, fhour logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm real(kind_phys), intent(out) :: clstp - integer, intent(in) :: jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(in) :: ddy_h(:) - real(kind_phys), intent(inout) :: h2opl(:,:,:) + integer, intent(in) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(in) :: ddy_o3(:), ddy_h(:) + real(kind_phys), intent(inout) :: ozpl(:,:,:), h2opl(:,:,:) integer, intent(in) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) real(kind_phys), intent(in) :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(inout) :: aer_nm(:,:,:) @@ -659,15 +667,19 @@ subroutine GFS_phys_time_vary_timestep_init ( integer, intent(in) :: jindx1_tau(:), jindx2_tau(:) real(kind_phys), intent(in) :: ddy_j1tau(:), ddy_j2tau(:) real(kind_phys), intent(inout) :: tau_amf(:) + type(ty_ozphys), intent(in) :: ozphys integer, intent(in) :: nthrds character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables - integer :: i, j, k, iseed, iskip, ix - real(kind=kind_phys) :: wrk(1) - real(kind=kind_phys) :: rannie(cny) - real(kind=kind_phys) :: rndval(cnx*cny*nrcm) + integer :: i, j, k, iseed, iskip, ix, idat(8), jdat(8), iday, j1, j2, nc, n1, n2, jdow, & + jdoy, jday, w3kindreal, w3kindint + real(kind_phys) :: wrk(1), tem, tx1, tx2, rjday + real(kind_phys) :: rannie(cny) + real(kind_phys) :: rndval(cnx*cny*nrcm) + real(kind_dbl_prec) :: rinc(5) + real(kind_sngl_prec) :: rinc4(5) ! Initialize CCPP error handling variables errmsg = '' @@ -721,6 +733,43 @@ subroutine GFS_phys_time_vary_timestep_init ( endif ! imfdeepcnv, cal_re, random_clds + !> - Compute temporal interpolation indices for updating gas concentrations. + idat=0 + idat(1)=idate(4) + idat(2)=idate(2) + idat(3)=idate(3) + idat(5)=idate(1) + rinc=0. + rinc(2)=fhour + call w3kind(w3kindreal,w3kindint) + if(w3kindreal==4) then + rinc4=rinc + CALL w3movdat(rinc4,idat,jdat) + else + CALL w3movdat(rinc,idat,jdat) + endif + jdow = 0 + jdoy = 0 + jday = 0 + call w3doxdat(jdat,jdow,jdoy,jday) + rjday = jdoy + jdat(5) / 24. + if (rjday < ozphys%time(1)) rjday = rjday + 365. + + n2 = ozphys%ntime + 1 + do j=2,ozphys%ntime + if (rjday < ozphys%time(j)) then + n2 = j + exit + endif + enddo + n1 = n2 - 1 + if (n2 > ozphys%ntime) n2 = n2 - ozphys%ntime + +!> - Update ozone concentration. + if (ntoz > 0) then + call ozphys%update_o3prog(jindx1_o3, jindx2_o3, ddy_o3, rjday, n1, n2, ozpl) + endif + !> - Call h2ointerpol() to make stratospheric water vapor data interpolation if (h2o_phys) then call h2ointerpol (me, im, idate, fhour, & diff --git a/physics/GFS_phys_time_vary.scm.meta b/physics/GFS_phys_time_vary.scm.meta index 21d1f2736..cf5ad15ca 100644 --- a/physics/GFS_phys_time_vary.scm.meta +++ b/physics/GFS_phys_time_vary.scm.meta @@ -2,7 +2,7 @@ name = GFS_phys_time_vary type = scheme dependencies = aerclm_def.F,aerinterp.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f - dependencies = namelist_soilveg.f,set_soilveg.f,cires_tauamf_data.F90,noahmp_tables.f90 + dependencies = namelist_soilveg.f,set_soilveg.f,module_ozphys.F90,cires_tauamf_data.F90,noahmp_tables.f90 ######################################################################## [ccpp-arg-table] @@ -23,6 +23,13 @@ dimensions = () type = integer intent = in +[ntoz] + standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -95,6 +102,28 @@ type = real kind = kind_phys intent = in +[jindx1_o3] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout +[jindx2_o3] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = inout +[ddy_o3] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = inout [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -1019,6 +1048,13 @@ dimensions = () type = logical intent = in +[ntoz] + standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array + long_name = tracer index for ozone mixing ratio + units = index + dimensions = () + type = integer + intent = in [h2o_phys] standard_name = flag_for_stratospheric_water_vapor_physics long_name = flag for stratospheric water vapor physics @@ -1048,6 +1084,36 @@ type = real kind = kind_phys intent = out +[jindx1_o3] + standard_name = lower_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation low index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[jindx2_o3] + standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation + long_name = interpolation high index for ozone + units = index + dimensions = (horizontal_dimension) + type = integer + intent = in +[ddy_o3] + standard_name = latitude_interpolation_weight_for_ozone_forcing + long_name = interpolation high index for ozone + units = none + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in +[ozpl] + standard_name = ozone_forcing + long_name = ozone forcing data + units = mixed + dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + type = real + kind = kind_phys + intent = inout [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -1279,6 +1345,13 @@ type = real kind = kind_phys intent = inout +[ozphys] + standard_name = dataset_for_ozone_physics + long_name = dataset for NRL ozone physics + units = mixed + dimensions = () + type = ty_ozphys + intent = in [nthrds] standard_name = number_of_openmp_threads long_name = number of OpenMP threads available for physics schemes diff --git a/physics/GFS_physics_post.F90 b/physics/GFS_physics_post.F90 index def38cd1a..f89b257a8 100644 --- a/physics/GFS_physics_post.F90 +++ b/physics/GFS_physics_post.F90 @@ -13,22 +13,6 @@ module GFS_physics_post public GFS_physics_post_init, GFS_physics_post_run contains -! ########################################################################################### -! SUBROUTINE GFS_physics_post_init -! ########################################################################################### -!! \section arg_table_GFS_physics_post_init Argument Table -!! \htmlinclude GFS_physics_post_init.html -!! - subroutine GFS_physics_post_init(errmsg, errflg) - - ! Outputs - character(len=*), intent(out) :: & - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag - - end subroutine GFS_physics_post_init - ! ########################################################################################### ! SUBROUTINE GFS_physics_post_run ! ########################################################################################### @@ -36,9 +20,9 @@ end subroutine GFS_physics_post_init !! \htmlinclude GFS_physics_post_run.html !! subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_summed, & - dtidx, is_photochem, ldiag3d, ip_physics, ip_photochem, & - ip_prod_loss, ip_ozmix, ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, & - do3_dt_temp, do3_dt_ohoz, dtend, errmsg, errflg) + dtidx, is_photochem, ldiag3d, ip_physics, ip_photochem, ip_prod_loss, ip_ozmix, & + ip_temp, ip_overhead_ozone, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, & + dtend, errmsg, errflg) ! Inputs integer, intent(in) :: & @@ -49,7 +33,7 @@ subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_ nprocess, & ! Number of processes that cause changes in state variables nprocess_summed,& ! Number of causes in dtidx per tracer summed for total physics tendency ip_physics, & ! Index for process in diagnostic tendency output - ip_photochem, & ! + ip_photochem, & ! Index for process in diagnostic tendency output ip_prod_loss, & ! Index for process in diagnostic tendency output ip_ozmix, & ! Index for process in diagnostic tendency output ip_temp, & ! Index for process in diagnostic tendency output diff --git a/physics/GFS_physics_post.meta b/physics/GFS_physics_post.meta index 649ef6491..5701909fd 100644 --- a/physics/GFS_physics_post.meta +++ b/physics/GFS_physics_post.meta @@ -3,26 +3,6 @@ type = scheme dependencies = machine.F -######################################################################## -[ccpp-arg-table] - name = GFS_physics_post_init - type = scheme -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - ######################################################################## [ccpp-arg-table] name = GFS_physics_post_run From 89af3d8946ab25737628a016fe89356a261155ac Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 12 Oct 2023 15:45:58 +0000 Subject: [PATCH 76/81] Omission from previous commit --- physics/GFS_physics_post.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_physics_post.F90 b/physics/GFS_physics_post.F90 index f89b257a8..fe5409353 100644 --- a/physics/GFS_physics_post.F90 +++ b/physics/GFS_physics_post.F90 @@ -10,7 +10,7 @@ module GFS_physics_post use machine, only : kind_phys, kind_dbl_prec, kind_sngl_prec implicit none - public GFS_physics_post_init, GFS_physics_post_run + public GFS_physics_post_run contains ! ########################################################################################### From c6204e149fdbff013532cf991e9ad00b107d111b Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Sun, 15 Oct 2023 08:15:23 -0400 Subject: [PATCH 77/81] add dlw,dsw inst to cpllnd block --- physics/GFS_surface_generic_post.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/GFS_surface_generic_post.F90 b/physics/GFS_surface_generic_post.F90 index 9faebc8cf..7e8cfa753 100644 --- a/physics/GFS_surface_generic_post.F90 +++ b/physics/GFS_surface_generic_post.F90 @@ -130,6 +130,8 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl if (cplflx .or. cpllnd) then do i=1,im + dlwsfci_cpl (i) = adjsfcdlw(i) + dswsfci_cpl (i) = adjsfcdsw(i) dlwsfc_cpl (i) = dlwsfc_cpl(i) + adjsfcdlw(i)*dtf dswsfc_cpl (i) = dswsfc_cpl(i) + adjsfcdsw(i)*dtf psurfi_cpl (i) = pgr(i) @@ -138,8 +140,6 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl if (cplflx) then do i=1,im - dlwsfci_cpl (i) = adjsfcdlw(i) - dswsfci_cpl (i) = adjsfcdsw(i) dnirbmi_cpl (i) = adjnirbmd(i) dnirdfi_cpl (i) = adjnirdfd(i) dvisbmi_cpl (i) = adjvisbmd(i) @@ -242,7 +242,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl tedir(i) = tedir(i) + edir(i) * dtf if (lsm == lsm_noahmp) then paha(i) = paha(i) + pah(i) * dtf - twa(i) = waxy(i) + twa(i) = waxy(i) endif enddo endif @@ -252,7 +252,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl ! heat torage parameterization the kinematic sensible heat flux ! (hflx) as surface boundary forcing to the pbl scheme is ! reduced in a factor of hffac given as a function of surface roughness & -! green vegetation fraction (zvfun) +! green vegetation fraction (zvfun) ! do i=1,im hflxq(i) = hflx(i) From 2f417bb5f8c1e814ea5f3539615395d9ed096eca Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Tue, 17 Oct 2023 12:32:30 -0400 Subject: [PATCH 78/81] refine surface 2m t/q diagnostic method --- physics/sfc_diag_post.F90 | 24 ++++++++++++++++++------ physics/sfc_diag_post.meta | 7 +++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 index c1a43f170..6945e48e9 100644 --- a/physics/sfc_diag_post.F90 +++ b/physics/sfc_diag_post.F90 @@ -14,16 +14,17 @@ module sfc_diag_post !! #endif subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, con_eps, con_epsm1, pgr,& - t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & + vegtype,t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & wind10mmax, u10mmax, v10mmax, dpt2m, errmsg, errflg) use machine, only: kind_phys, kind_dbl_prec implicit none - integer, intent(in) :: im, lsm, lsm_noahmp,opt_diag - logical, intent(in) :: lssav - real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 + integer, intent(in) :: im, lsm, lsm_noahmp,opt_diag + integer, dimension(:), intent(in) :: vegtype ! vegetation type (integer index) + logical, intent(in) :: lssav + real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 logical , dimension(:), intent(in) :: dry real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax @@ -41,12 +42,23 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co errflg = 0 if (lsm == lsm_noahmp) then - if (opt_diag == 2 .or. opt_diag == 3)then +! over shrublands use opt_diag=2 + do i=1, im + if(dry(i)) then + if (vegtype(i) == 6 .or. vegtype(i) == 7 & + .or. vegtype(i) == 16) then + t2m(i) = t2mmp(i) + q2m(i) = q2mp(i) + endif + endif + enddo + + if (opt_diag == 2 .or. opt_diag == 3) then do i=1,im if(dry(i)) then t2m(i) = t2mmp(i) q2m(i) = q2mp(i) - endif + endif enddo endif endif diff --git a/physics/sfc_diag_post.meta b/physics/sfc_diag_post.meta index c50d3c4dc..17648753a 100644 --- a/physics/sfc_diag_post.meta +++ b/physics/sfc_diag_post.meta @@ -81,6 +81,13 @@ type = real kind = kind_phys intent = in +[vegtype] + standard_name = vegetation_type_classification + long_name = vegetation type at each grid cell + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent= in [t2mmp] standard_name = temperature_at_2m_from_noahmp long_name = 2 meter temperature from noahmp From 32cf7ba5484db1387e33c7f9d25de87079e9014c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 27 Oct 2023 17:01:01 +0000 Subject: [PATCH 79/81] Reverted standard_name change --- physics/GFS_phys_time_vary.fv3.meta | 2 +- physics/GFS_phys_time_vary.scm.meta | 2 +- physics/GFS_suite_stateout_update.meta | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index ad543e146..968f33027 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -1205,7 +1205,7 @@ standard_name = ozone_forcing long_name = ozone forcing data units = mixed - dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_data) type = real kind = kind_phys intent = inout diff --git a/physics/GFS_phys_time_vary.scm.meta b/physics/GFS_phys_time_vary.scm.meta index cf5ad15ca..d72e27fd5 100644 --- a/physics/GFS_phys_time_vary.scm.meta +++ b/physics/GFS_phys_time_vary.scm.meta @@ -1110,7 +1110,7 @@ standard_name = ozone_forcing long_name = ozone forcing data units = mixed - dimensions = (horizontal_dimension,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_data) type = real kind = kind_phys intent = inout diff --git a/physics/GFS_suite_stateout_update.meta b/physics/GFS_suite_stateout_update.meta index 8cbab9139..fae276d2f 100644 --- a/physics/GFS_suite_stateout_update.meta +++ b/physics/GFS_suite_stateout_update.meta @@ -218,7 +218,7 @@ standard_name = ozone_forcing long_name = ozone forcing data units = mixed - dimensions = (horizontal_loop_extent,number_of_levels_in_ozone_data,number_of_coefficients_in_ozone_data) + dimensions = (horizontal_loop_extent,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_data) type = real kind = kind_phys intent = in From 1abaff07fabc582e2ddaaf4977e337c85e5e9dfa Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Sun, 29 Oct 2023 15:42:36 -0500 Subject: [PATCH 80/81] module_mp_nssl_2mom.F90: fix bug when nz > 128 where sedimentation did not work for k > 128 --- physics/module_mp_nssl_2mom.F90 | 152 ++++++++++++++++++++++++-------- 1 file changed, 115 insertions(+), 37 deletions(-) diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/module_mp_nssl_2mom.F90 index a88ffe053..ad90ec81f 100644 --- a/physics/module_mp_nssl_2mom.F90 +++ b/physics/module_mp_nssl_2mom.F90 @@ -4274,7 +4274,7 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ! real gz(-nor+ng1:nz+nor),z1d(-nor+ng1:nz+nor,4) real dtp real xfall(nx,ny,na) ! array for stuff landing on the ground - real xfall0(nx,ny) ! dummy array +! real xfall0(nx,ny) ! dummy array integer infdo integer jslab ! which line of xfall to use @@ -4282,47 +4282,81 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & real tmp, vtmax, dtptmp, dtfrac real, parameter :: dz = 200. - real :: xvt(nz+1,nx,3,lc:lhab) ! (nx,nz,2,lc:lhab) ! 1=mass-weighted, 2=number-weighted - real :: tmpn(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz) - real :: tmpn2(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz) - real :: z(-nor+ng1:nx+nor,-norz+ng1:nz+norz,lr:lhab) - real :: db1(nx,nz+1),dtz1(nz+1,nx,0:1),dz2dinv(nz+1,nx),db1inv(nx,nz+1) +! real :: xvt(nz+1,nx,3,lc:lhab) ! (nx,nz,2,lc:lhab) ! 1=mass-weighted, 2=number-weighted +! real :: tmpn(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz) +! real :: tmpn2(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz) +! real :: z(-nor+ng1:nx+nor,-norz+ng1:nz+norz,lr:lhab) +! real :: db1(nx,nz+1),dtz1(nz+1,nx,0:1),dz2dinv(nz+1,nx),db1inv(nx,nz+1) - real :: rhovtzx(nz,nx) +! real :: rhovtzx(nz,nx) + + real, allocatable :: db1(:,:), dtz1(:,:,:),dz2dinv(:,:),db1inv(:,:) ! db1(nx,nz+1),dtz1(nz+1,nx,0:1),dz2dinv(nz+1,nx),db1inv(nx,nz+1) + real, allocatable :: rhovtzx(:,:) + real, allocatable :: xfall0(:,:), xvt(:,:,:,:),tmpn(:,:,:),tmpn2(:,:,:),z(:,:,:) double precision :: timesed1,timesed2,timesed3, zmaxsed,timesetvt,dummy double precision :: dt1,dt2,dt3,dt4 - integer,parameter :: ngs = 128 + integer :: ngs ! = 512 integer :: ngscnt,mgs,ipconc0 - real :: qx(ngs,lv:lhab) - real :: qxw(ngs,ls:lhab) - real :: cx(ngs,lc:lhab) - real :: xv(ngs,lc:lhab) - real :: vtxbar(ngs,lc:lhab,3) - real :: xmas(ngs,lc:lhab) - real :: xdn(ngs,lc:lhab) - real :: xdia(ngs,lc:lhab,3) - real :: vx(ngs,li:lhab) - real :: alpha(ngs,lc:lhab) - real :: zx(ngs,lr:lhab) - logical :: hasmass(nx,lc+1:lhab) - - integer igs(ngs),kgs(ngs) - - real rho0(ngs),temcg(ngs) - - real temg(ngs) - - real rhovt(ngs) - - real cwnc(ngs),cinc(ngs) - real fadvisc(ngs),cwdia(ngs),cipmas(ngs) - - real cimasn,cimasx,cnina(ngs),cimas(ngs) - - real cnostmp(ngs) +! real :: qx(ngs,lv:lhab) +! real :: qxw(ngs,ls:lhab) +! real :: cx(ngs,lc:lhab) +! real :: xv(ngs,lc:lhab) +! real :: vtxbar(ngs,lc:lhab,3) +! real :: xmas(ngs,lc:lhab) +! real :: xdn(ngs,lc:lhab) +! real :: xdia(ngs,lc:lhab,3) +! real :: vx(ngs,li:lhab) +! real :: alpha(ngs,lc:lhab) +! real :: zx(ngs,lr:lhab) +! logical :: hasmass(nx,lc+1:lhab) +! +! integer igs(ngs),kgs(ngs) +! +! real rho0(ngs),temcg(ngs) +! +! real temg(ngs) +! +! real rhovt(ngs) +! +! real cwnc(ngs),cinc(ngs) +! real fadvisc(ngs),cwdia(ngs),cipmas(ngs) +! +! real cimasn,cimasx,cnina(ngs),cimas(ngs) +! +! real cnostmp(ngs) + + real, allocatable :: qx(:,:) + real, allocatable :: qxw(:,:) + real, allocatable :: cx(:,:) + real, allocatable :: xv(:,:) + real, allocatable :: vtxbar(:,:,:) + real, allocatable :: xmas(:,:) + real, allocatable :: xdn(:,:) + real, allocatable :: xdia(:,:,:) + real, allocatable :: vx(:,:) + real, allocatable :: alpha(:,:) + real, allocatable :: zx(:,:) + logical, allocatable :: hasmass(:,:) + + integer, allocatable :: igs(:),kgs(:) + + real, allocatable :: rho0(:),temcg(:) + + real, allocatable :: temg(:) + + real, allocatable :: rhovt(:) + + real, allocatable :: cwnc(:),cinc(:) + real, allocatable :: fadvisc(:),cwdia(:),cipmas(:) + + real, allocatable :: cnina(:),cimas(:) + + real, allocatable :: cnostmp(:) + + real :: cimasn,cimasx !----------------------------------------------------------------------------- @@ -4336,7 +4370,30 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ! ################################################################### - + allocate( db1(nx,nz+1),dtz1(nz+1,nx,0:1),dz2dinv(nz+1,nx),db1inv(nx,nz+1),rhovtzx(nz,nx) ) + allocate( xfall0(nx,ny), xvt(nz+1,nx,3,lc:lhab), tmpn(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz) ) + allocate( tmpn2(-nor+ng1:nx+nor,-nor+ng1:ny+nor,-norz+ng1:nz+norz), z(-nor+ng1:nx+nor,-norz+ng1:nz+norz,lr:lhab)) + + ngs = nz+3 + + allocate( qx(ngs,lv:lhab), & + qxw(ngs,ls:lhab), & + cx(ngs,lc:lhab), & + xv(ngs,lc:lhab), & + vtxbar(ngs,lc:lhab,3), & + xmas(ngs,lc:lhab), & + xdn(ngs,lc:lhab), & + xdia(ngs,lc:lhab,3), & + vx(ngs,li:lhab), & + alpha(ngs,lc:lhab), & + zx(ngs,lr:lhab), & + hasmass(nx,lc+1:lhab), & + igs(ngs),kgs(ngs), & + rho0(ngs),temcg(ngs),temg(ngs), rhovt(ngs), & + cwnc(ngs),cinc(ngs), & + fadvisc(ngs),cwdia(ngs),cipmas(ngs), & + cnina(ngs),cimas(ngs), & + cnostmp(ngs) ) kzb = 1 kze = nz @@ -4656,8 +4713,29 @@ subroutine sediment1d(dtp,nx,ny,nz,an,na,nor,norz,xfall,dn,dz3d,dz3dinv, & ENDDO ! ix + deallocate( db1,dtz1,dz2dinv,db1inv,rhovtzx ) + deallocate( xfall0, xvt, tmpn ) + deallocate( tmpn2, z) + + deallocate( qx, & + qxw, & + cx, & + xv, & + vtxbar, & + xmas, & + xdn, & + xdia, & + vx, & + alpha, & + zx, & + hasmass, & + igs,kgs, & + rho0,temcg,temg, rhovt, & + cwnc,cinc, & + fadvisc,cwdia,cipmas, & + cnina,cimas, & + cnostmp ) - RETURN END SUBROUTINE SEDIMENT1D From e10030bf5a9578046d04adef261440bf9173013f Mon Sep 17 00:00:00 2001 From: Ted Mansell Date: Thu, 2 Nov 2023 13:28:39 -0500 Subject: [PATCH 81/81] mp_nssl.F90: space formatting --- physics/mp_nssl.F90 | 233 ++++++++++++++++++++++---------------------- 1 file changed, 115 insertions(+), 118 deletions(-) diff --git a/physics/mp_nssl.F90 b/physics/mp_nssl.F90 index aacf4c3dd..e79376709 100644 --- a/physics/mp_nssl.F90 +++ b/physics/mp_nssl.F90 @@ -26,12 +26,12 @@ module mp_nssl !! \htmlinclude mp_nssl_init.html !! subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & - mpirank, mpiroot, & - con_g, con_rd, con_cp, con_rv, & - con_t0c, con_cliq, con_csol, con_eps, & - imp_physics, imp_physics_nssl, & - nssl_cccn, nssl_alphah, nssl_alphahl, & - nssl_alphar, nssl_ehw0, nssl_ehlw0, & + mpirank, mpiroot, & + con_g, con_rd, con_cp, con_rv, & + con_t0c, con_cliq, con_csol, con_eps, & + imp_physics, imp_physics_nssl, & + nssl_cccn, nssl_alphah, nssl_alphahl, & + nssl_alphar, nssl_ehw0, nssl_ehlw0, & nssl_ccn_on, nssl_hail_on, nssl_invertccn, nssl_3moment ) @@ -134,7 +134,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & ! write(0,*) 'call nssl_2mom_init' CALL nssl_2mom_init(ims,ime, jms,jme, kms,kme,nssl_params,ipctmp=ipc,mixphase=0, & - ihvol=ihailv,nssl_ehw0=nssl_ehw0,nssl_ehlw0=nssl_ehlw0,errmsg=errmsg, & + ihvol=ihailv,nssl_ehw0=nssl_ehw0,nssl_ehlw0=nssl_ehlw0,errmsg=errmsg, & nssl_alphar=nssl_alphar, & nssl_alphah=nssl_alphah, & nssl_alphahl=nssl_alphahl, & @@ -165,19 +165,18 @@ end subroutine mp_nssl_init !! \htmlinclude mp_nssl_run.html !! subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & -! spechum, cccn, qc, qr, qi, qs, qh, qhl, & - spechum, cccn, cccna, qc, qr, qi, qs, qh, qhl, & - ccw, crw, cci, csw, chw, chl, vh, vhl, & - zrw, zhw, zhl, & - tgrs, prslk, prsl, phii, omega, dtp, & - prcp, rain, graupel, ice, snow, sr, & + spechum, cccn, cccna, qc, qr, qi, qs, qh, qhl, & + ccw, crw, cci, csw, chw, chl, vh, vhl, & + zrw, zhw, zhl, & + tgrs, prslk, prsl, phii, omega, dtp, & + prcp, rain, graupel, ice, snow, sr, & refl_10cm, do_radar_ref, first_time_step, restart, & - re_cloud, re_ice, re_snow, re_rain, & - nleffr, nieffr, nseffr, nreffr, & - imp_physics, convert_dry_rho, & - imp_physics_nssl, nssl_ccn_on, & - nssl_hail_on, nssl_invertccn, nssl_3moment, & - ntccn, ntccna, & + re_cloud, re_ice, re_snow, re_rain, & + nleffr, nieffr, nseffr, nreffr, & + imp_physics, convert_dry_rho, & + imp_physics_nssl, nssl_ccn_on, & + nssl_hail_on, nssl_invertccn, nssl_3moment, & + ntccn, ntccna, & errflg, errmsg) use module_mp_nssl_2mom, only: calcnfromq, na @@ -602,116 +601,114 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & IF ( nssl_ccn_on ) THEN - - CALL nssl_2mom_driver( & - ITIMESTEP=itimestep, & - ! TH=th, & - tt=tgrs, & - QV=qv_mp, & - QC=qc_mp, & - QR=qr_mp, & - QI=qi_mp, & - QS=qs_mp, & - QH=qh_mp, & - QHL=qhl_mp, & - CCW=nc_mp, & - CRW=nr_mp, & - CCI=ni_mp, & - CSW=ns_mp, & - CHW=nh_mp, & - CHL=nhl_mp, & - VHW=vh_mp, & - VHL=vhl_mp, & - cn=cn_mp, & - ZRW=zrw_mp, & - ZHW=zhw_mp, & - ZHL=zhl_mp, & -! cna=cna_mp, f_cna=( ntccna > 0 ), & ! for future use - cna=cna_mp, f_cna=.false. , & - PII=prslk, & - P=prsl, & - W=w, & - DZ=dz, & - DTP=dtptmp, & - DN=rho, & - rainnc=xrain_mp, rainncv=xdelta_rain_mp, & - snownc=xsnow_mp, snowncv=xdelta_snow_mp, & -! icenc=ice_mp, icencv=delta_ice_mp, & - GRPLNC=xgraupel_mp, GRPLNCV=xdelta_graupel_mp, sr=sr, & - dbz = refl_10cm, & -! nssl_progn=.false., & - diagflag = diagflag, & - errmsg=errmsg,errflg=errflg, & - re_cloud=re_cloud_mp, & - re_ice=re_ice_mp, & - re_snow=re_snow_mp, & - re_rain=re_rain_mp, & - has_reqc=has_reqc, & ! ala G. Thompson - has_reqi=has_reqi, & ! ala G. Thompson - has_reqs=has_reqs, & ! ala G. Thompson - has_reqr=has_reqr, & + CALL nssl_2mom_driver( & + ITIMESTEP=itimestep, & + ! TH=th, & + tt=tgrs, & + QV=qv_mp, & + QC=qc_mp, & + QR=qr_mp, & + QI=qi_mp, & + QS=qs_mp, & + QH=qh_mp, & + QHL=qhl_mp, & + CCW=nc_mp, & + CRW=nr_mp, & + CCI=ni_mp, & + CSW=ns_mp, & + CHW=nh_mp, & + CHL=nhl_mp, & + VHW=vh_mp, & + VHL=vhl_mp, & + cn=cn_mp, & + ZRW=zrw_mp, & + ZHW=zhw_mp, & + ZHL=zhl_mp, & +! cna=cna_mp, f_cna=( ntccna > 0 ), & ! for future use + cna=cna_mp, f_cna=.false. , & + PII=prslk, & + P=prsl, & + W=w, & + DZ=dz, & + DTP=dtptmp, & + DN=rho, & + rainnc=xrain_mp, rainncv=xdelta_rain_mp, & + snownc=xsnow_mp, snowncv=xdelta_snow_mp, & + GRPLNC=xgraupel_mp, & + GRPLNCV=xdelta_graupel_mp, & + sr=sr, & + dbz = refl_10cm, & + diagflag = diagflag, & + errmsg=errmsg,errflg=errflg, & + re_cloud=re_cloud_mp, & + re_ice=re_ice_mp, & + re_snow=re_snow_mp, & + re_rain=re_rain_mp, & + has_reqc=has_reqc, & + has_reqi=has_reqi, & + has_reqs=has_reqs, & + has_reqr=has_reqr, & IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde, & IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme, & ITS=its,ITE=ite, JTS=jts,JTE=jte, KTS=kts,KTE=kte & ) - ELSE - CALL nssl_2mom_driver( & - ITIMESTEP=itimestep, & - ! TH=th, & - tt=tgrs, & - QV=qv_mp, & - QC=qc_mp, & - QR=qr_mp, & - QI=qi_mp, & - QS=qs_mp, & - QH=qh_mp, & - QHL=qhl_mp, & -! CCW=qnc_mp, & - CCW=nc_mp, & - CRW=nr_mp, & - CCI=ni_mp, & - CSW=ns_mp, & - CHW=nh_mp, & - CHL=nhl_mp, & - VHW=vh_mp, & - VHL=vhl_mp, & - ZRW=zrw_mp, & - ZHW=zhw_mp, & - ZHL=zhl_mp, & - ! cn=cccn, & - PII=prslk, & - P=prsl, & - W=w, & - DZ=dz, & - DTP=dtptmp, & - DN=rho, & - rainnc=xrain_mp, rainncv=xdelta_rain_mp, & - snownc=xsnow_mp, snowncv=xdelta_snow_mp, & -! icenc=ice_mp, icencv=delta_ice_mp, & - GRPLNC=xgraupel_mp, GRPLNCV=xdelta_graupel_mp, sr=sr, & - dbz = refl_10cm, & -! nssl_progn=.false., & - diagflag = diagflag, & - errmsg=errmsg,errflg=errflg, & - re_cloud=re_cloud_mp, & - re_ice=re_ice_mp, & - re_snow=re_snow_mp, & - re_rain=re_rain_mp, & - has_reqc=has_reqc, & ! ala G. Thompson - has_reqi=has_reqi, & ! ala G. Thompson - has_reqs=has_reqs, & ! ala G. Thompson - has_reqr=has_reqr, & + CALL nssl_2mom_driver( & + ITIMESTEP=itimestep, & + ! TH=th, & + tt=tgrs, & + QV=qv_mp, & + QC=qc_mp, & + QR=qr_mp, & + QI=qi_mp, & + QS=qs_mp, & + QH=qh_mp, & + QHL=qhl_mp, & + CCW=nc_mp, & + CRW=nr_mp, & + CCI=ni_mp, & + CSW=ns_mp, & + CHW=nh_mp, & + CHL=nhl_mp, & + VHW=vh_mp, & + VHL=vhl_mp, & +! cn=cn_mp, & + ZRW=zrw_mp, & + ZHW=zhw_mp, & + ZHL=zhl_mp, & +! cna=cna_mp, f_cna=( ntccna > 0 ), & ! for future use +! cna=cna_mp, f_cna=.false. , & + PII=prslk, & + P=prsl, & + W=w, & + DZ=dz, & + DTP=dtptmp, & + DN=rho, & + rainnc=xrain_mp, rainncv=xdelta_rain_mp, & + snownc=xsnow_mp, snowncv=xdelta_snow_mp, & + GRPLNC=xgraupel_mp, & + GRPLNCV=xdelta_graupel_mp, & + sr=sr, & + dbz = refl_10cm, & + diagflag = diagflag, & + errmsg=errmsg,errflg=errflg, & + re_cloud=re_cloud_mp, & + re_ice=re_ice_mp, & + re_snow=re_snow_mp, & + re_rain=re_rain_mp, & + has_reqc=has_reqc, & + has_reqi=has_reqi, & + has_reqs=has_reqs, & + has_reqr=has_reqr, & IDS=ids,IDE=ide, JDS=jds,JDE=jde, KDS=kds,KDE=kde, & IMS=ims,IME=ime, JMS=jms,JME=jme, KMS=kms,KME=kme, & ITS=its,ITE=ite, JTS=jts,JTE=jte, KTS=kts,KTE=kte & ) - + ENDIF - - + DO i = 1,ncol delta_rain_mp(i) = delta_rain_mp(i) + xdelta_rain_mp(i) ! this is liquid equivalent of all precip delta_graupel_mp(i) = delta_graupel_mp(i) + xdelta_graupel_mp(i) ! this is liquid equivalent of graupel @@ -720,7 +717,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & ENDDO ENDDO - + ENDIF