From 8f7f329f01fcb7a88e7240f77740bfef0e94de57 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Thu, 8 Dec 2022 19:09:10 +0000 Subject: [PATCH 01/14] New winter wx diags, variable precip ice density computed in MP_generic instead of RUC LSM, variable precip ice density optional use for NOAH MP and NOAH LSM, change radar_reset to fullradar_diag since original name did not make sense. --- physics/GFS_MP_generic_post.F90 | 87 ++++++++++++++++++++++++++++++-- physics/GFS_MP_generic_post.meta | 70 +++++++++++++++++++++++++ physics/GFS_debug.F90 | 2 +- physics/lsm_noah.f | 24 ++++----- physics/lsm_noah.meta | 15 ++++++ physics/lsm_ruc.F90 | 12 +++-- physics/lsm_ruc.meta | 8 +++ physics/module_mp_thompson.F90 | 6 +-- physics/module_sf_noahmplsm.f90 | 8 +-- physics/module_sf_ruclsm.F90 | 26 +++++----- physics/mp_thompson.F90 | 10 ++-- physics/mp_thompson.meta | 6 +-- physics/noahmpdrv.F90 | 5 +- physics/noahmpdrv.meta | 8 +++ physics/sflx.f | 25 ++++++--- 15 files changed, 253 insertions(+), 59 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index b7e65bc8b..edfecf927 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -20,10 +20,11 @@ module GFS_MP_generic_post !> @{ subroutine GFS_MP_generic_post_run( & im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, & - imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, & + imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, & rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,& graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, & + acfrzrn, acfrzrnb, acgraup, acgraupb, acsnow, acsnowb, rhonewsn1, vrbliceden_noah, iopt_snf, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, & @@ -37,7 +38,7 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires integer, intent(in) :: imp_physics_nssl - logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma + logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, vrbliceden_noah integer, intent(in) :: index_of_temperature,index_of_process_mp integer :: dfi_radar_max_intervals @@ -70,7 +71,7 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl, dsnow_cpl ! Rainfall variables previous time step - integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp + integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp, iopt_snf real(kind=kind_phys), dimension(:), intent(inout) :: raincprv real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv real(kind=kind_phys), dimension(:), intent(inout) :: iceprv @@ -81,6 +82,13 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), dimension(:), intent(inout) :: diceprv real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv + real(kind=kind_phys), dimension(:), intent(inout) :: acfrzrn + real(kind=kind_phys), dimension(:), intent(inout) :: acfrzrnb + real(kind=kind_phys), dimension(:), intent(inout) :: acgraup + real(kind=kind_phys), dimension(:), intent(inout) :: acgraupb + real(kind=kind_phys), dimension(:), intent(inout) :: acsnow + real(kind=kind_phys), dimension(:), intent(inout) :: acsnowb + real(kind=kind_phys), dimension(:), intent(inout) :: rhonewsn1 real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdt_qmicro real(kind=kind_phys), dimension(:,:), intent(inout) :: prevsq real(kind=kind_phys), intent(in) :: dtp @@ -101,6 +109,10 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2, ttend real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1 + real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr + real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice + real(kind=kind_phys), parameter :: rhowater = 1000.0_kind_phys + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -111,6 +123,75 @@ subroutine GFS_MP_generic_post_run( rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit enddo +!aligo compute surface snowfall, graupel/sleet, freezing rain and precip ice density + if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then + do i = 1, im +! write(0,*)'freezing rain gt0(1),gt0(levs):',gt0(1,1),gt0(1,levs) + if (gt0(i,1) .le. 273) then + acfrzrn(i) = acfrzrn(i) + rain0(i) + acfrzrnb(i) = acfrzrnb(i) + rain0(i) + endif + acsnow(i) = acsnow(i) + snow0(i) + acsnowb(i) = acsnowb(i) + snow0(i) + acgraup(i) = acgraup(i) + graupel0(i) + acgraupb(i) = acgraupb(i) + graupel0(i) + enddo +!Compute the variable precip ice density for specific LSM schemes and options +! if ( lsm .ne. 2 .or. iopt_snf .ne. 5) then +! write(0,*)'aligo,lsm,iopt_snf :',lsm,iopt_snf +! endif + if ( lsm == lsm_ruc .or. lsm == lsm_noahmp .and. iopt_snf == 5 .or. vrbliceden_noah == .true.) then +! write(0,*)'lsm,iopt_snf,vrbliceden_noah: ',lsm,iopt_snf,vrbliceden_noah + snowrat = 0. + grauprat = 0. + icerat = 0. + prcpncfr = 0. + prcpcufr = 0. + curat = 0. + prcpncfr = 0. + prcpcufr = 0. + rhonewsnow = 0. + rhonewgr = 0. + rhonewice = 0. + rhoprcpice = 0. + do i = 1, im + rhonewsn1(i)= 200. + prcpncfr = rain1(i)*sr(i) + if(sr(i) > 0..and. gt0(i,1) < 273.) then + prcpcufr = max(0.,rainc(i)*sr(i)) + else + if(gt0(i,1) < 273.) then + prcpcufr = max(0.,rainc(i)) + else + prcpcufr = 0. + endif ! gt0(i,1) < 273. + endif ! frzfrac > 0. +! + if((prcpncfr + prcpcufr) > 0.) then +! -- calculate snow, graupel and ice fractions in falling frozen precip + snowrat=min(1.,max(0.,snow0(i)/(prcpncfr + prcpcufr))) + grauprat=min(1.,max(0.,graupel0(i)/(prcpncfr + prcpcufr))) + icerat=min(1.,max(0.,(prcpncfr-snow0(i)-graupel0(i)) & + /(prcpncfr + prcpcufr))) + curat=min(1.,max(0.,(prcpcufr/(prcpncfr + prcpcufr)))) + + rhonewsnow=min(125.,1000.0/max(8.,(17.*tanh((276.65-gt0(i,1))*0.15)))) + rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-gt0(i,1))*0.3333)))) + rhonewice=rhonewsnow + +!--- compute density of "precip ice" from weighted contribution +! of snow, graupel and ice fractions + + rhoprcpice = min(500.,max(58.8,(rhonewsnow*snowrat + & + rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) + +! from now on rhonewsn1 is the density of falling frozen precipitation + rhonewsn1(i)=rhoprcpice + endif + enddo + endif + endif + !> - If requested (e.g. Zhao-Carr MP scheme), call calpreciptype() to calculate dominant !! precipitation type. ! DH* TODO - Fix wrong code in non-CCPP build (GFS_physics_driver) diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 5216b7157..46dfe66d6 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -278,6 +278,76 @@ type = real kind = kind_phys intent = inout +[acfrzrn] + standard_name = lwe_thickness_of_sfc_freezing_rain_amount + long_name = accumulated surface freezing rain + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[acfrzrnb] + standard_name = lwe_thickness_of_sfc_freezing_rain_amount_in_bucket + long_name = accumulated surface freezing rain in bucket + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[acgraup] + standard_name = lwe_thickness_of_sfc_graupel_amount + long_name = accumulated surface graupel + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[acgraupb] + standard_name = lwe_thickness_of_sfc_graupel_amount_in_bucket + long_name = accumulated surface graupel in bucket + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[acsnow] + standard_name = lwe_thickness_of_sfc_snow_amount + long_name = accumulated surface snow + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[acsnowb] + standard_name = lwe_thickness_of_sfc_snow_amount_in_bucket + long_name = accumulated surface snow in bucket + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[rhonewsn1] + standard_name = lwe_density_of_precip_ice + long_name = density of precipitation ice + units = kg m-3 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[vrbliceden_noah] + standard_name = flag_for_vrbl_prcp_ice_den + long_name = flag for variable precip ice density + units = flag + dimensions = () + type = logical + intent = in +[iopt_snf] + standard_name = control_for_land_surface_scheme_precipitation_type_partition + long_name = choice for precipitation partition option (see noahmp module for definition) + units = index + dimensions = () + type = integer + intent = in [save_t] standard_name = air_temperature_save long_name = air temperature before entering a physics scheme diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 5e6419256..5387e6300 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -1285,7 +1285,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_ice ', Interstitial%qss_ice ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_land ', Interstitial%qss_land ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_water ', Interstitial%qss_water ) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%radar_reset ', Interstitial%radar_reset ) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%fullradar_diag ', Interstitial%fullradar_diag ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raddt ', Interstitial%raddt ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raincd ', Interstitial%raincd ) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raincs ', Interstitial%raincs ) diff --git a/physics/lsm_noah.f b/physics/lsm_noah.f index 246f81654..bc12aa64e 100644 --- a/physics/lsm_noah.f +++ b/physics/lsm_noah.f @@ -220,7 +220,8 @@ subroutine lsm_noah_run & & lheatstrg, isot, ivegsrc, & & bexppert, xlaipert, vegfpert,pertvegf, & ! sfc perts, mgehne & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & - & adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, & + & adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, rhonewsn1, & + & vrbliceden_noah, & ! --- in/outs: & weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & & canopy, trans, tsurf, zorl, & @@ -252,7 +253,7 @@ subroutine lsm_noah_run & & -1.0_kind_phys, -2.0_kind_phys / ! --- input: - integer, intent(in) :: im, km, isot, ivegsrc + integer, intent(in) :: im, km, isot, ivegsrc real (kind=kind_phys), intent(in) :: grav, cp, hvap, rd, eps, & & epsm1, rvrdm1 real (kind=kind_phys), intent(in) :: pertvegf @@ -265,13 +266,13 @@ subroutine lsm_noah_run & & snoalb, sfalb, zf, & & bexppert, xlaipert, vegfpert, & & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & - & adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd + & adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, rhonewsn1 real (kind=kind_phys), intent(in) :: delt logical, dimension(:), intent(in) :: flag_iter, flag_guess, land - logical, intent(in) :: lheatstrg + logical, intent(in) :: lheatstrg, vrbliceden_noah ! --- in/out: real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & @@ -292,7 +293,7 @@ subroutine lsm_noah_run & ! --- locals: real (kind=kind_phys), dimension(im) :: rch, rho, & & q0, qs1, theta1, weasd_old, snwdph_old, & - & tprcp_old, srflag_old, tskin_old, canopy_old + & tprcp_old, srflag_old, tskin_old, canopy_old real (kind=kind_phys), dimension(km) :: et, sldpth, stsoil, & & smsoil, slsoil @@ -309,8 +310,8 @@ subroutine lsm_noah_run & & smcdry, smcref, smcmax, sneqv, snoalb1d, snowh, & & snomlt, sncovr, soilw, soilm, ssoil, tsea, th2, tbot, & & xlai, zlvl, swdn, tem, z0, bexpp, xlaip, vegfp, & - & mv, sv, alphav, betav, vegftmp, cpinv, hvapi, elocp - + & mv, sv, alphav, betav, vegftmp, cpinv, hvapi, elocp, & + & rhonewsn integer :: couple, ice, nsoil, nroot, slope, stype, vtype integer :: i, k, iflag ! @@ -326,7 +327,7 @@ subroutine lsm_noah_run & errflg = 0 !> - Save land-related prognostic fields for guess run. - +!aligo do i = 1, im if (land(i) .and. flag_guess(i)) then weasd_old(i) = weasd(i) @@ -335,7 +336,6 @@ subroutine lsm_noah_run & canopy_old(i) = canopy(i) tprcp_old(i) = tprcp(i) srflag_old(i) = srflag(i) - do k = 1, km smc_old(i,k) = smc(i,k) stc_old(i,k) = stc(i,k) @@ -361,7 +361,6 @@ subroutine lsm_noah_run & sbsno(i) = zero snowc(i) = zero snohf(i) = zero - !> - Initialize variables wind, q, and rh at level 1. q0(i) = max(q1(i), qmin) !* q1=specific humidity at level 1 (kg/kg) @@ -371,7 +370,6 @@ subroutine lsm_noah_run & qs1(i) = fpvs( t1(i) ) !* qs1=sat. humidity at level 1 (kg/kg) qs1(i) = max(eps*qs1(i) / (prsl1(i)+epsm1*qs1(i)), qmin) q0 (i) = min(qs1(i), q0(i)) - do k = 1, km zsoil(i,k) = zsoil_noah(k) enddo @@ -524,7 +522,8 @@ subroutine lsm_noah_run & !> - Apply perturbation of soil type b parameter and leave area index. bexpp = bexppert(i) ! sfc perts, mgehne xlaip = xlaipert(i) ! sfc perts, mgehne - +!> - New snow depth variables + rhonewsn = rhonewsn1(i) !> - Call Noah LSM gfssflx(). call gfssflx & ! ccppdox: these is sflx in mpbl @@ -533,6 +532,7 @@ subroutine lsm_noah_run & & swdn, solnet, lwdn, sfcems, sfcprs, sfctmp, & & sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, & & vtype, stype, slope, shdmin1d, alb, snoalb1d, & + & rhonewsn, vrbliceden_noah, & & bexpp, xlaip, & ! sfc-perts, mgehne & lheatstrg, & ! --- input/outputs: diff --git a/physics/lsm_noah.meta b/physics/lsm_noah.meta index 2ce7c3e6c..2235dda88 100644 --- a/physics/lsm_noah.meta +++ b/physics/lsm_noah.meta @@ -486,6 +486,21 @@ type = real kind = kind_phys intent = in +[rhonewsn1] + standard_name = lwe_density_of_precip_ice + long_name = density of precipitation ice + units = kg m-3 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[vrbliceden_noah] + standard_name = flag_for_vrbl_prcp_ice_den + long_name = flag for variable precip ice density + units = flag + dimensions = () + type = logical + intent = in [weasd] standard_name = water_equivalent_accumulated_snow_depth_over_land long_name = water equiv of acc snow depth over land diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 99b6c2b41..6aae4feac 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -331,7 +331,7 @@ subroutine lsm_ruc_run & ! inputs & prsl1, zf, wind, shdmin, shdmax, & & srflag, sfalb_lnd_bck, snoalb, & & isot, ivegsrc, fice, smcwlt2, smcref2, & - & min_lakeice, min_seaice, oceanfrac, & + & min_lakeice, min_seaice, oceanfrac, rhonewsn1, & ! --- constants & con_cp, con_rd, con_rv, con_g, con_pi, con_hvap, & & con_fvirt, & @@ -418,7 +418,7 @@ subroutine lsm_ruc_run & ! inputs ! --- in real (kind=kind_phys), dimension(:), intent(in) :: & - & rainnc, rainc, ice, snow, graupel + & rainnc, rainc, ice, snow, graupel, rhonewsn1 ! --- in/out: ! --- on RUC levels real (kind=kind_phys), dimension(:,:), intent(inout) :: & @@ -494,7 +494,8 @@ subroutine lsm_ruc_run & ! inputs & soilt_lnd, tbot, & & xlai, swdn, z0_lnd, znt_lnd, rhosnfr, infiltr, & & precipfr, snfallac_lnd, acsn, & - & qsfc_lnd, qsg_lnd, qvg_lnd, qcg_lnd, soilt1_lnd, chklowq + & qsfc_lnd, qsg_lnd, qvg_lnd, qcg_lnd, soilt1_lnd, chklowq, & + & rhonewsn ! ice real (kind=kind_phys),dimension (im,1) :: & & albbck_ice, alb_ice, chs_ice, flhc_ice, flqc_ice, & @@ -845,6 +846,7 @@ subroutine lsm_ruc_run & ! inputs rainncv(i,j) = rhoh2o * rainnc(i) ! total time-step explicit precip graupelncv(i,j) = rhoh2o * graupel(i) snowncv(i,j) = rhoh2o * snow(i) + rhonewsn(i,j) = rhonewsn1(i) if (debug_print) then !-- diagnostics for a test point with known lat/lon if (abs(xlat_d(i)-testptlat).lt.2.5 .and. & @@ -1125,7 +1127,7 @@ subroutine lsm_ruc_run & ! inputs & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & & swdn(i,j), solnet_lnd(i,j), sfcems_lnd(i,j), chklowq(i,j), & - & chs_lnd(i,j), flqc_lnd(i,j), flhc_lnd(i,j), & + & chs_lnd(i,j), flqc_lnd(i,j), flhc_lnd(i,j), rhonewsn(i,j), & ! --- input/outputs: & wet(i,j), cmc(i,j), shdfac(i,j), alb_lnd(i,j), znt_lnd(i,j), & & z0_lnd(i,j), snoalb1d_lnd(i,j), albbck_lnd(i,j), & @@ -1399,7 +1401,7 @@ subroutine lsm_ruc_run & ! inputs & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & & swdn(i,j), solnet_ice(i,j), sfcems_ice(i,j), chklowq(i,j), & - & chs_ice(i,j), flqc_ice(i,j), flhc_ice(i,j), & + & chs_ice(i,j), flqc_ice(i,j), flhc_ice(i,j), rhonewsn(i,j), & ! --- input/outputs: & wet_ice(i,j), cmc(i,j), shdfac(i,j), alb_ice(i,j), & & znt_ice(i,j), z0_ice(i,j), snoalb1d_ice(i,j), & diff --git a/physics/lsm_ruc.meta b/physics/lsm_ruc.meta index 587fda681..3fe40f419 100644 --- a/physics/lsm_ruc.meta +++ b/physics/lsm_ruc.meta @@ -952,6 +952,14 @@ type = real kind = kind_phys intent = in +[rhonewsn1] + standard_name = lwe_density_of_precip_ice + long_name = density of precipitation ice + units = kg m-3 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [con_cp] standard_name = specific_heat_of_dry_air_at_constant_pressure long_name = specific heat !of dry air at constant pressure diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 70c48feba..b828c9ab0 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1003,7 +1003,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & ids,ide, jds,jde, kds,kde, & ! domain dims ims,ime, jms,jme, kms,kme, & ! memory dims its,ite, jts,jte, kts,kte, & ! tile dims - reset_dBZ, istep, nsteps, & + fullradar_diag, istep, nsteps, & errmsg, errflg, & ! Extended diagnostics, array pointers ! only associated if ext_diag flag is .true. @@ -1070,7 +1070,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & INTEGER, INTENT(IN) :: decfl ! To support subcycling: current step and maximum number of steps INTEGER, INTENT (IN) :: istep, nsteps - LOGICAL, INTENT (IN) :: reset_dBZ + LOGICAL, INTENT (IN) :: fullradar_diag ! Extended diagnostics, array pointers only associated if ext_diag flag is .true. LOGICAL, INTENT (IN) :: ext_diag LOGICAL, OPTIONAL, INTENT(IN):: aero_ind_fdb @@ -1677,7 +1677,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & if (diagflag .and. do_radar_ref == 1) then ! ! Only set melti to true at the output times - if (reset_dBZ) then + if (fullradar_diag) then melti=.true. else melti=.false. diff --git a/physics/module_sf_noahmplsm.f90 b/physics/module_sf_noahmplsm.f90 index 1da30f156..5146c56e6 100644 --- a/physics/module_sf_noahmplsm.f90 +++ b/physics/module_sf_noahmplsm.f90 @@ -218,6 +218,7 @@ module module_sf_noahmplsm real (kind=kind_phys) :: saim(12) !< monthly stem area index, one-sided real (kind=kind_phys) :: laim(12) !< monthly leaf area index, one-sided real (kind=kind_phys) :: sla !< single-side leaf area per kg [m2/kg] + real (kind=kind_phys) :: prcpiceden !< precipitation ice density [kg/m^3] real (kind=kind_phys) :: dilefc !< coeficient for leaf stress death [1/s] real (kind=kind_phys) :: dilefw !< coeficient for leaf stress death [1/s] real (kind=kind_phys) :: fragr !< fraction of growth respiration !original was 0.3 @@ -1068,13 +1069,14 @@ subroutine atm (parameters,sfcprs ,sfctmp ,q2 , ! fresh snow density bdfall = min(120.,67.92+51.25*exp((sfctmp-tfrz)/2.59)) !mb/an: change to min - if(opt_snf == 4) then + if(opt_snf == 4 .or. opt_snf == 5) then prcp_frozen = prcpsnow + prcpgrpl + prcphail if(prcpnonc > 0. .and. prcp_frozen > 0.) then fpice = min(1.0,prcp_frozen/prcpnonc) fpice = max(0.0,fpice) - bdfall = bdfall*(prcpsnow/prcp_frozen) + rho_grpl*(prcpgrpl/prcp_frozen) + & - rho_hail*(prcphail/prcp_frozen) + if(opt_snf==4) bdfall = bdfall*(prcpsnow/prcp_frozen) + rho_grpl*(prcpgrpl/prcp_frozen) + & + rho_hail*(prcphail/prcp_frozen) + if(opt_snf==5) bdfall = parameters%prcpiceden else fpice = 0.0 endif diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 9a6363c08..6c417d6fd 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -57,8 +57,8 @@ SUBROUTINE LSMRUC( & rhosnf,precipfr, & Z3D,P8W,T3D,QV3D,QC3D,RHO3D,EMISBCK, & GLW,GSWdn,GSW,EMISS,CHKLOWQ, CHS, & - FLQC,FLHC,MAVAIL,CANWAT,VEGFRA,ALB,ZNT, & - Z0,SNOALB,ALBBCK,LAI, & + FLQC,FLHC,rhonewsn,MAVAIL,CANWAT,VEGFRA,ALB, & + ZNT,Z0,SNOALB,ALBBCK,LAI, & landusef, nlcat, & ! mosaic_lu, mosaic_soil, & soilctop, nscat, & QSFC,QSG,QVG,QCG,DEW,SOILT1,TSNAV, & @@ -191,7 +191,8 @@ SUBROUTINE LSMRUC( & INTENT(IN ) :: GRAUPELNCV, & SNOWNCV, & RAINCV, & - RAINNCV + RAINNCV, & + RHONEWSN ! REAL, DIMENSION( ims:ime , jms:jme ), & ! INTENT(IN ) :: lakemask ! INTEGER, INTENT(IN ) :: LakeModel @@ -301,7 +302,6 @@ SUBROUTINE LSMRUC( & !--- soil/snow properties REAL & :: RHOCS, & - RHONEWSN, & RHOSN, & RHOSNFALL, & BCLH, & @@ -684,7 +684,6 @@ SUBROUTINE LSMRUC( & NROOT= 4 ! ! rooting depth - RHONEWSN = 200. if(SNOW(i,j).gt.0. .and. SNOWH(i,j).gt.0.) then RHOSN = SNOW(i,j)/SNOWH(i,j) else @@ -895,7 +894,7 @@ SUBROUTINE LSMRUC( & nzs,nddzs,nroot,meltfactor, & !added meltfactor iland,isoil,ivgtyp(i,j),isltyp(i,j), & PRCPMS, NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - RHOSN,RHONEWSN,RHOSNFALL, & + RHOSN,RHONEWSN(I,J),RHOSNFALL, & snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,RHO, & GLW(I,J),GSWdn(i,j),GSW(I,J), & @@ -1190,7 +1189,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia nddzs !nddzs=2*(nzs-2) REAL, INTENT(IN ) :: DELT,CONFLX,meltfactor - REAL, INTENT(IN ) :: C1SN,C2SN + REAL, INTENT(IN ) :: C1SN,C2SN,RHONEWSN LOGICAL, INTENT(IN ) :: myj, debug_print !--- 3-D Atmospheric variables REAL , & @@ -1282,7 +1281,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia EVAPL, & INFILTR, & RHOSN, & - RHONEWSN, & rhosnfall, & snowrat, & grauprat, & @@ -1494,19 +1492,19 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia !--- 27 Feb 2014 - empirical formulations from John M. Brown ! rhonewsn=min(250.,rhowater/max(4.179,(13.*tanh((274.15-Tabs)*0.3333)))) !--- 13 Mar 2018 - formulation from Trevor Elcott - rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) - rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-Tabs)*0.3333)))) - rhonewice=rhonewsn +!aligo rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) +!aligo rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-Tabs)*0.3333)))) +!aligo rhonewice=rhonewsn !--- compute density of "snowfall" from weighted contribution ! of snow, graupel and ice fractions - rhosnfall = min(500.,max(58.8,(rhonewsn*snowrat + & +!aligo rhosnfall = min(500.,max(58.8,(rhonewsn*snowrat + & !13mar18 rhosnfall = min(500.,max(76.9,(rhonewsn*snowrat + & - rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) +!aligo rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) ! from now on rhonewsn is the density of falling frozen precipitation - rhonewsn=rhosnfall +!aligo rhonewsn=rhosnfall !*** Define average snow density of the snow pack considering !*** the amount of fresh snow (eq. 9 in Koren et al.(1999) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 727098a05..aee97ef60 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -326,8 +326,8 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & dt_inner, & first_time_step, istep, nsteps, & prcp, rain, graupel, ice, snow, sr, & - refl_10cm, reset_dBZ, do_radar_ref, & - aerfld, & + refl_10cm, fullradar_diag, & + do_radar_ref, aerfld, & mpicomm, mpirank, mpiroot, blkno, & ext_diag, diag3d, reset_diag3d, & spp_wts_mp, spp_mp, n_var_spp, & @@ -357,7 +357,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), intent(inout) :: ni(:,:) real(kind_phys), intent(inout) :: nr(:,:) ! Aerosols - logical, intent(in) :: is_aerosol_aware, reset_dBZ + logical, intent(in) :: is_aerosol_aware, fullradar_diag logical, intent(in) :: merra2_aerosol_aware real(kind_phys), optional, intent(inout) :: nc(:,:) real(kind_phys), optional, intent(inout) :: nwfa(:,:) @@ -705,7 +705,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & 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, & - reset_dBZ=reset_dBZ, istep=istep, nsteps=nsteps, & + fullradar_diag=fullradar_diag, astep=istep, nsteps=nsteps, & first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, & ! Extended diagnostics ext_diag=ext_diag, & @@ -744,7 +744,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & 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, & - reset_dBZ=reset_dBZ, istep=istep, nsteps=nsteps, & + fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, & first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, & ! Extended diagnostics ext_diag=ext_diag, & diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index 1f459bb88..744405c03 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -610,9 +610,9 @@ type = real kind = kind_phys intent = out -[reset_dBZ] - standard_name = flag_for_resetting_radar_reflectivity_calculation - long_name = flag for resetting radar reflectivity calculation +[fullradar_diag] + standard_name = flag_for_computing_full_radar_reflectivity + long_name = flag for computing full radar reflectivity units = flag dimensions = () type = logical diff --git a/physics/noahmpdrv.F90 b/physics/noahmpdrv.F90 index fed823ead..e223ffbec 100644 --- a/physics/noahmpdrv.F90 +++ b/physics/noahmpdrv.F90 @@ -138,7 +138,7 @@ subroutine noahmpdrv_run & idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, & iopt_inf, iopt_rad, iopt_alb, iopt_snf, iopt_tbot, & iopt_stc, iopt_trs,xlatin, xcoszin, iyrlen, julian, garea, & - rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, & + rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, rhonewsn1,& con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & con_fvirt, con_rd, con_hfus, thsfc_loc, & @@ -262,6 +262,7 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(in) :: snow_mp ! microphysics snow [mm] real(kind=kind_phys), dimension(:) , intent(in) :: graupel_mp ! microphysics graupel [mm] real(kind=kind_phys), dimension(:) , intent(in) :: ice_mp ! microphysics ice/hail [mm] + real(kind=kind_phys), dimension(:) , intent(in) :: rhonewsn1 ! precipitation ice density (kg/m^3) real(kind=kind_phys) , intent(in) :: con_hvap ! latent heat condensation [J/kg] real(kind=kind_phys) , intent(in) :: con_cp ! specific heat air [J/kg/K] real(kind=kind_phys) , intent(in) :: con_jcal ! joules per calorie (not used) @@ -757,7 +758,7 @@ subroutine noahmpdrv_run & call transfer_mp_parameters(vegetation_category, soil_category, & slope_category, soil_color_category, crop_type,parameters) - + parameters%prcpiceden = rhonewsn1(i) call noahmp_options(idveg ,iopt_crs, iopt_btr , iopt_run, iopt_sfc, & iopt_frz, iopt_inf , iopt_rad, iopt_alb, & iopt_snf, iopt_tbot, iopt_stc, iopt_rsf, & diff --git a/physics/noahmpdrv.meta b/physics/noahmpdrv.meta index 3235b7c90..82d72386f 100644 --- a/physics/noahmpdrv.meta +++ b/physics/noahmpdrv.meta @@ -532,6 +532,14 @@ type = real kind = kind_phys intent = in +[rhonewsn1] + standard_name = lwe_density_of_precip_ice + long_name = density of precipitation ice + units = kg m-3 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [con_hvap] standard_name = latent_heat_of_vaporization_of_water_at_0C long_name = latent heat of evaporation/sublimation diff --git a/physics/sflx.f b/physics/sflx.f index a020e217a..56a8cfd70 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -116,6 +116,7 @@ subroutine gfssflx &! --- input & swdn, swnet, lwdn, sfcems, sfcprs, sfctmp, & & sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, & & vegtyp, soiltyp, slopetyp, shdmin, alb, snoalb, & + & rhonewsn, vrbliceden_noah, & & bexpp, xlaip, & ! sfc-perts, mgehne & lheatstrg, &! --- input/outputs: & tbot, cmc, t1, stc, smc, sh2o, sneqv, ch, cm,z0, &! --- outputs: @@ -310,9 +311,9 @@ subroutine gfssflx &! --- input real (kind=kind_phys), intent(in) :: ffrozp, dt, zlvl, lwdn, & & sldpth(nsoil), swdn, swnet, sfcems, sfcprs, sfctmp, & & sfcspd, prcp, q2, q2sat, dqsdt2, th2, shdmin, alb, snoalb, & - & bexpp, xlaip & !sfc-perts, mgehne + & bexpp, xlaip, rhonewsn & !sfc-perts, mgehne - logical, intent(in) :: lheatstrg + logical, intent(in) :: lheatstrg, vrbliceden_noah ! --- input/outputs: real (kind=kind_phys), intent(inout) :: tbot, cmc, t1, sneqv, & @@ -564,7 +565,7 @@ subroutine gfssflx &! --- input !! using old and new snow. call snow_new ! --- inputs: ! -! ( sfctmp, sn_new, ! +! ( sfctmp, sn_new, rhonewsn, vrbliceden_noah, ! ! --- input/outputs: ! ! snowh, sndens ) ! @@ -877,7 +878,11 @@ subroutine gfssflx &! --- input ! smc, ssoil, runoff1, runoff2, runoff3, edir, ec, et, ! ! ett, snomlt, drip, dew, flx1, flx3, esnow ) ! +! run-total accumulated snow based on snowfall and snowmelt in [m] + endif + + !> - Noah LSM post-processing: !> - Calculate sensible heat (h) for return to parent model. @@ -2851,7 +2856,7 @@ end subroutine snopac subroutine snow_new !................................... ! --- inputs: -! & ( sfctmp, sn_new, & +! & ( sfctmp, sn_new, rhonewsn, vrbliceden_noah, & ! --- input/outputs: ! & snowh, sndens & ! & ) @@ -2900,10 +2905,14 @@ subroutine snow_new ! snowcovered and glacierized basin', 6th nordic hydrological ! conference, vemadolen, sweden, 1980, 172-177pp. - if (tempc <= -15.0) then - dsnew = 0.05 - else - dsnew = 0.05 + 0.0017*(tempc + 15.0)**1.5 + if(vrbliceden_noah == .false.) then + if (tempc <= -15.0) then + dsnew = 0.05 + else + dsnew = 0.05 + 0.0017*(tempc + 15.0)**1.5 + endif + elseif(vrbliceden_noah == .true.) then + dsnew = rhonewsn*0.001 endif ! --- ... adjustment of snow density depending on new snowfall From 33f4922398a896c9c69b4b9852a13d6febd86706 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Fri, 9 Dec 2022 15:41:18 +0000 Subject: [PATCH 02/14] Fix typo --- physics/mp_thompson.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index aee97ef60..e62e8a596 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -705,7 +705,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & 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, & - fullradar_diag=fullradar_diag, astep=istep, nsteps=nsteps, & + fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, & first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, & ! Extended diagnostics ext_diag=ext_diag, & From f72f38b13992eb127a32bb5f18ca2a3ea7c5ebfd Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Mon, 12 Dec 2022 14:58:26 +0000 Subject: [PATCH 03/14] Rename winter wx diags --- physics/GFS_MP_generic_post.F90 | 26 +++++++++++++------------- physics/GFS_MP_generic_post.meta | 12 ++++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index edfecf927..fd78a27b8 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -24,7 +24,7 @@ subroutine GFS_MP_generic_post_run( rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,& graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, & - acfrzrn, acfrzrnb, acgraup, acgraupb, acsnow, acsnowb, rhonewsn1, vrbliceden_noah, iopt_snf, & + frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, vrbliceden_noah, iopt_snf, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, & @@ -82,12 +82,12 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), dimension(:), intent(inout) :: diceprv real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv - real(kind=kind_phys), dimension(:), intent(inout) :: acfrzrn - real(kind=kind_phys), dimension(:), intent(inout) :: acfrzrnb - real(kind=kind_phys), dimension(:), intent(inout) :: acgraup - real(kind=kind_phys), dimension(:), intent(inout) :: acgraupb - real(kind=kind_phys), dimension(:), intent(inout) :: acsnow - real(kind=kind_phys), dimension(:), intent(inout) :: acsnowb + real(kind=kind_phys), dimension(:), intent(inout) :: frzr + real(kind=kind_phys), dimension(:), intent(inout) :: frzrb + real(kind=kind_phys), dimension(:), intent(inout) :: frozr + real(kind=kind_phys), dimension(:), intent(inout) :: frozrb + real(kind=kind_phys), dimension(:), intent(inout) :: tsnowp + real(kind=kind_phys), dimension(:), intent(inout) :: tsnowpb real(kind=kind_phys), dimension(:), intent(inout) :: rhonewsn1 real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdt_qmicro real(kind=kind_phys), dimension(:,:), intent(inout) :: prevsq @@ -128,13 +128,13 @@ subroutine GFS_MP_generic_post_run( do i = 1, im ! write(0,*)'freezing rain gt0(1),gt0(levs):',gt0(1,1),gt0(1,levs) if (gt0(i,1) .le. 273) then - acfrzrn(i) = acfrzrn(i) + rain0(i) - acfrzrnb(i) = acfrzrnb(i) + rain0(i) + frzr(i) = frzr(i) + rain0(i) + frzrb(i) = frzrb(i) + rain0(i) endif - acsnow(i) = acsnow(i) + snow0(i) - acsnowb(i) = acsnowb(i) + snow0(i) - acgraup(i) = acgraup(i) + graupel0(i) - acgraupb(i) = acgraupb(i) + graupel0(i) + tsnowp(i) = tsnowp(i) + snow0(i) + tsnowpb(i) = tsnowpb(i) + snow0(i) + frozr(i) = frozr(i) + graupel0(i) + frozrb(i) = frozrb(i) + graupel0(i) enddo !Compute the variable precip ice density for specific LSM schemes and options ! if ( lsm .ne. 2 .or. iopt_snf .ne. 5) then diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 46dfe66d6..6b2fb5392 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -278,7 +278,7 @@ type = real kind = kind_phys intent = inout -[acfrzrn] +[frzr] standard_name = lwe_thickness_of_sfc_freezing_rain_amount long_name = accumulated surface freezing rain units = m @@ -286,7 +286,7 @@ type = real kind = kind_phys intent = inout -[acfrzrnb] +[frzrb] standard_name = lwe_thickness_of_sfc_freezing_rain_amount_in_bucket long_name = accumulated surface freezing rain in bucket units = m @@ -294,7 +294,7 @@ type = real kind = kind_phys intent = inout -[acgraup] +[frozr] standard_name = lwe_thickness_of_sfc_graupel_amount long_name = accumulated surface graupel units = m @@ -302,7 +302,7 @@ type = real kind = kind_phys intent = inout -[acgraupb] +[frozrb] standard_name = lwe_thickness_of_sfc_graupel_amount_in_bucket long_name = accumulated surface graupel in bucket units = m @@ -310,7 +310,7 @@ type = real kind = kind_phys intent = inout -[acsnow] +[tsnowp] standard_name = lwe_thickness_of_sfc_snow_amount long_name = accumulated surface snow units = m @@ -318,7 +318,7 @@ type = real kind = kind_phys intent = inout -[acsnowb] +[tsnowpb] standard_name = lwe_thickness_of_sfc_snow_amount_in_bucket long_name = accumulated surface snow in bucket units = m From 560f998871340120ab302c4be534a9169597e724 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Thu, 5 Jan 2023 20:25:02 +0000 Subject: [PATCH 04/14] minor touchups --- physics/GFS_MP_generic_post.F90 | 15 ++++----------- physics/lsm_noah.f | 1 - physics/module_sf_ruclsm.F90 | 12 ++++++------ physics/sflx.f | 4 ++-- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index fd78a27b8..6ed96e764 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -20,11 +20,11 @@ module GFS_MP_generic_post !> @{ subroutine GFS_MP_generic_post_run( & im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, & - imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, & + imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, & rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,& graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, & - frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, vrbliceden_noah, iopt_snf, & + frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, vrbliceden_noah, iopt_snf, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, & @@ -109,7 +109,7 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2, ttend real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1 - real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr + real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice real(kind=kind_phys), parameter :: rhowater = 1000.0_kind_phys @@ -123,10 +123,9 @@ subroutine GFS_MP_generic_post_run( rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit enddo -!aligo compute surface snowfall, graupel/sleet, freezing rain and precip ice density +! compute surface snowfall, graupel/sleet, freezing rain and precip ice density if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then do i = 1, im -! write(0,*)'freezing rain gt0(1),gt0(levs):',gt0(1,1),gt0(1,levs) if (gt0(i,1) .le. 273) then frzr(i) = frzr(i) + rain0(i) frzrb(i) = frzrb(i) + rain0(i) @@ -137,11 +136,7 @@ subroutine GFS_MP_generic_post_run( frozrb(i) = frozrb(i) + graupel0(i) enddo !Compute the variable precip ice density for specific LSM schemes and options -! if ( lsm .ne. 2 .or. iopt_snf .ne. 5) then -! write(0,*)'aligo,lsm,iopt_snf :',lsm,iopt_snf -! endif if ( lsm == lsm_ruc .or. lsm == lsm_noahmp .and. iopt_snf == 5 .or. vrbliceden_noah == .true.) then -! write(0,*)'lsm,iopt_snf,vrbliceden_noah: ',lsm,iopt_snf,vrbliceden_noah snowrat = 0. grauprat = 0. icerat = 0. @@ -178,13 +173,11 @@ subroutine GFS_MP_generic_post_run( rhonewsnow=min(125.,1000.0/max(8.,(17.*tanh((276.65-gt0(i,1))*0.15)))) rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-gt0(i,1))*0.3333)))) rhonewice=rhonewsnow - !--- compute density of "precip ice" from weighted contribution ! of snow, graupel and ice fractions rhoprcpice = min(500.,max(58.8,(rhonewsnow*snowrat + & rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) - ! from now on rhonewsn1 is the density of falling frozen precipitation rhonewsn1(i)=rhoprcpice endif diff --git a/physics/lsm_noah.f b/physics/lsm_noah.f index bc12aa64e..3e66c86fb 100644 --- a/physics/lsm_noah.f +++ b/physics/lsm_noah.f @@ -327,7 +327,6 @@ subroutine lsm_noah_run & errflg = 0 !> - Save land-related prognostic fields for guess run. -!aligo do i = 1, im if (land(i) .and. flag_guess(i)) then weasd_old(i) = weasd(i) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 6c417d6fd..73fe23c0d 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1492,19 +1492,19 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia !--- 27 Feb 2014 - empirical formulations from John M. Brown ! rhonewsn=min(250.,rhowater/max(4.179,(13.*tanh((274.15-Tabs)*0.3333)))) !--- 13 Mar 2018 - formulation from Trevor Elcott -!aligo rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) -!aligo rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-Tabs)*0.3333)))) -!aligo rhonewice=rhonewsn +! rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) +! rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-Tabs)*0.3333)))) +! rhonewice=rhonewsn !--- compute density of "snowfall" from weighted contribution ! of snow, graupel and ice fractions -!aligo rhosnfall = min(500.,max(58.8,(rhonewsn*snowrat + & +! rhosnfall = min(500.,max(58.8,(rhonewsn*snowrat + & !13mar18 rhosnfall = min(500.,max(76.9,(rhonewsn*snowrat + & -!aligo rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) +! rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) ! from now on rhonewsn is the density of falling frozen precipitation -!aligo rhonewsn=rhosnfall +! rhonewsn=rhosnfall !*** Define average snow density of the snow pack considering !*** the amount of fresh snow (eq. 9 in Koren et al.(1999) diff --git a/physics/sflx.f b/physics/sflx.f index 56a8cfd70..ae302be1c 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -2905,13 +2905,13 @@ subroutine snow_new ! snowcovered and glacierized basin', 6th nordic hydrological ! conference, vemadolen, sweden, 1980, 172-177pp. - if(vrbliceden_noah == .false.) then + if(.not. vrbliceden_noah) then if (tempc <= -15.0) then dsnew = 0.05 else dsnew = 0.05 + 0.0017*(tempc + 15.0)**1.5 endif - elseif(vrbliceden_noah == .true.) then + else dsnew = rhonewsn*0.001 endif From 2f3d69a121aca341aa6e9b8cabac8eb8892c7541 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Thu, 5 Jan 2023 21:18:24 +0000 Subject: [PATCH 05/14] removed commented out lines related to old computation of precip ice density --- physics/module_sf_ruclsm.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 73fe23c0d..a0280e500 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1492,19 +1492,13 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia !--- 27 Feb 2014 - empirical formulations from John M. Brown ! rhonewsn=min(250.,rhowater/max(4.179,(13.*tanh((274.15-Tabs)*0.3333)))) !--- 13 Mar 2018 - formulation from Trevor Elcott -! rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) -! rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-Tabs)*0.3333)))) -! rhonewice=rhonewsn !--- compute density of "snowfall" from weighted contribution ! of snow, graupel and ice fractions -! rhosnfall = min(500.,max(58.8,(rhonewsn*snowrat + & !13mar18 rhosnfall = min(500.,max(76.9,(rhonewsn*snowrat + & -! rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) ! from now on rhonewsn is the density of falling frozen precipitation -! rhonewsn=rhosnfall !*** Define average snow density of the snow pack considering !*** the amount of fresh snow (eq. 9 in Koren et al.(1999) From 5eaa95f9beec430046babcf17f11d6e260315e30 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 11 Jan 2023 12:04:01 -0700 Subject: [PATCH 06/14] remove unused frozen precip density in RUC; update many CCPP standard names --- physics/GFS_MP_generic_post.F90 | 15 +++++++-------- physics/GFS_MP_generic_post.meta | 24 ++++++++++++++++-------- physics/lsm_noah.meta | 4 ++-- physics/lsm_ruc.F90 | 12 +++++------- physics/lsm_ruc.meta | 10 +--------- physics/module_sf_ruclsm.F90 | 14 +++----------- physics/mp_thompson.meta | 2 +- physics/noahmpdrv.meta | 2 +- 8 files changed, 36 insertions(+), 47 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index 6ed96e764..d9d205720 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -20,11 +20,11 @@ module GFS_MP_generic_post !> @{ subroutine GFS_MP_generic_post_run( & im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, & - imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, & - rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,& - graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & - totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, & - frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, vrbliceden_noah, iopt_snf, & + imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rhowater, rainmin, dtf, & + frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, & + rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,& + totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, & + pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, vrbliceden_noah, iopt_snf, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, & @@ -47,7 +47,7 @@ subroutine GFS_MP_generic_post_run( integer :: ix_dfi_radar(:) real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0 - real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin + real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0 @@ -111,7 +111,6 @@ subroutine GFS_MP_generic_post_run( real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice - real(kind=kind_phys), parameter :: rhowater = 1000.0_kind_phys ! Initialize CCPP error handling variables errmsg = '' @@ -136,7 +135,7 @@ subroutine GFS_MP_generic_post_run( frozrb(i) = frozrb(i) + graupel0(i) enddo !Compute the variable precip ice density for specific LSM schemes and options - if ( lsm == lsm_ruc .or. lsm == lsm_noahmp .and. iopt_snf == 5 .or. vrbliceden_noah == .true.) then + if ( lsm == lsm_ruc .or. (lsm == lsm_noahmp .and. iopt_snf == 5) .or. vrbliceden_noah == .true.) then snowrat = 0. grauprat = 0. icerat = 0. diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 6b2fb5392..107b528a2 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -150,6 +150,14 @@ type = real kind = kind_phys intent = in +[rhowater] + standard_name = fresh_liquid_water_density_at_0c + long_name = density of liquid water + units = kg m-3 + dimensions = () + type = real + kind = kind_phys + intent = in [dtf] standard_name = timestep_for_dynamics long_name = dynamics timestep @@ -279,7 +287,7 @@ kind = kind_phys intent = inout [frzr] - standard_name = lwe_thickness_of_sfc_freezing_rain_amount + standard_name = lwe_thickness_of_surface_freezing_rain_amount long_name = accumulated surface freezing rain units = m dimensions = (horizontal_loop_extent) @@ -287,7 +295,7 @@ kind = kind_phys intent = inout [frzrb] - standard_name = lwe_thickness_of_sfc_freezing_rain_amount_in_bucket + standard_name = lwe_thickness_of_surface_freezing_rain_amount_in_bucket long_name = accumulated surface freezing rain in bucket units = m dimensions = (horizontal_loop_extent) @@ -295,7 +303,7 @@ kind = kind_phys intent = inout [frozr] - standard_name = lwe_thickness_of_sfc_graupel_amount + standard_name = lwe_thickness_of_surface_graupel_amount long_name = accumulated surface graupel units = m dimensions = (horizontal_loop_extent) @@ -303,7 +311,7 @@ kind = kind_phys intent = inout [frozrb] - standard_name = lwe_thickness_of_sfc_graupel_amount_in_bucket + standard_name = lwe_thickness_of_surface_graupel_amount_in_bucket long_name = accumulated surface graupel in bucket units = m dimensions = (horizontal_loop_extent) @@ -311,7 +319,7 @@ kind = kind_phys intent = inout [tsnowp] - standard_name = lwe_thickness_of_sfc_snow_amount + standard_name = lwe_thickness_of_surface_snow_amount long_name = accumulated surface snow units = m dimensions = (horizontal_loop_extent) @@ -319,7 +327,7 @@ kind = kind_phys intent = inout [tsnowpb] - standard_name = lwe_thickness_of_sfc_snow_amount_in_bucket + standard_name = lwe_thickness_of_surface_snow_amount_in_bucket long_name = accumulated surface snow in bucket units = m dimensions = (horizontal_loop_extent) @@ -327,7 +335,7 @@ kind = kind_phys intent = inout [rhonewsn1] - standard_name = lwe_density_of_precip_ice + standard_name = surface_frozen_precipitation_density long_name = density of precipitation ice units = kg m-3 dimensions = (horizontal_loop_extent) @@ -335,7 +343,7 @@ kind = kind_phys intent = inout [vrbliceden_noah] - standard_name = flag_for_vrbl_prcp_ice_den + standard_name = do_variable_surface_frozen_precipitation_density long_name = flag for variable precip ice density units = flag dimensions = () diff --git a/physics/lsm_noah.meta b/physics/lsm_noah.meta index 2235dda88..9c93586da 100644 --- a/physics/lsm_noah.meta +++ b/physics/lsm_noah.meta @@ -487,7 +487,7 @@ kind = kind_phys intent = in [rhonewsn1] - standard_name = lwe_density_of_precip_ice + standard_name = surface_frozen_precipitation_density long_name = density of precipitation ice units = kg m-3 dimensions = (horizontal_loop_extent) @@ -495,7 +495,7 @@ kind = kind_phys intent = in [vrbliceden_noah] - standard_name = flag_for_vrbl_prcp_ice_den + standard_name = do_variable_surface_frozen_precipitation_density long_name = flag for variable precip ice density units = flag dimensions = () diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 6aae4feac..3cf12eb29 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -355,7 +355,7 @@ subroutine lsm_ruc_run & ! inputs & cm_ice, ch_ice, snowfallac_ice, & & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & ! --- out - & rhosnf, sbsno, & + & sbsno, & & cmm_lnd, chh_lnd, cmm_ice, chh_ice, & ! & flag_iter, flag_guess, flag_init, lsm_cold_start, & @@ -426,7 +426,7 @@ subroutine lsm_ruc_run & ! inputs ! --- output: real (kind=kind_phys), dimension(:), intent(inout) :: & - & rhosnf, runof, drain, runoff, srunoff, evbs, evcw, & + & runof, drain, runoff, srunoff, evbs, evcw, & & stm, wetness, semisbase, semis_lnd, semis_ice, & & sfalb_lnd, sfalb_ice, & ! for land @@ -492,7 +492,7 @@ subroutine lsm_ruc_run & ! inputs & sneqv_lnd, snoalb1d_lnd, snowh_lnd, snoh_lnd, tsnav_lnd, & & snomlt_lnd, sncovr_lnd, soilw, soilm, ssoil_lnd, & & soilt_lnd, tbot, & - & xlai, swdn, z0_lnd, znt_lnd, rhosnfr, infiltr, & + & xlai, swdn, z0_lnd, znt_lnd, infiltr, & & precipfr, snfallac_lnd, acsn, & & qsfc_lnd, qsg_lnd, qvg_lnd, qcg_lnd, soilt1_lnd, chklowq, & & rhonewsn @@ -747,7 +747,6 @@ subroutine lsm_ruc_run & ! inputs acrunoff(i,j) = 0.0 snfallac_lnd(i,j) = 0.0 snfallac_ice(i,j) = 0.0 - rhosnfr(i,j) = 0.0 precipfr(i,j) = 0.0 endif @@ -1122,7 +1121,7 @@ subroutine lsm_ruc_run & ! inputs & zs, prcp(i,j), sneqv_lnd(i,j), snowh_lnd(i,j), & & sncovr_lnd(i,j), & & ffrozp(i,j), frpcpn, & - & rhosnfr(i,j), precipfr(i,j), & + & precipfr(i,j), & ! --- inputs: & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & @@ -1246,7 +1245,6 @@ subroutine lsm_ruc_run & ! inputs sfcqv_lnd(i) = qvg_lnd(i,j) sfcqc_lnd(i) = qcg_lnd(i,j) ! --- ... units [m/s] = [g m-2 s-1] - rhosnf(i) = rhosnfr(i,j) !acsnow(i) = acsn(i,j) ! kg m-2 ! --- ... accumulated total runoff and surface runoff @@ -1396,7 +1394,7 @@ subroutine lsm_ruc_run & ! inputs & zs, prcp(i,j), sneqv_ice(i,j), snowh_ice(i,j), & & sncovr_ice(i,j), & & ffrozp(i,j), frpcpn, & - & rhosnfr(i,j), precipfr(i,j), & + & precipfr(i,j), & ! --- inputs: & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & diff --git a/physics/lsm_ruc.meta b/physics/lsm_ruc.meta index 3fe40f419..28a3545c9 100644 --- a/physics/lsm_ruc.meta +++ b/physics/lsm_ruc.meta @@ -953,7 +953,7 @@ kind = kind_phys intent = in [rhonewsn1] - standard_name = lwe_density_of_precip_ice + standard_name = surface_frozen_precipitation_density long_name = density of precipitation ice units = kg m-3 dimensions = (horizontal_loop_extent) @@ -1512,14 +1512,6 @@ type = real kind = kind_phys intent = out -[rhosnf] - standard_name = frozen_precipitation_density - long_name = density of frozen precipitation - units = kg m-3 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = inout [sbsno] standard_name = snow_deposition_sublimation_upward_latent_heat_flux long_name = latent heat flux from snow depo/subl diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index a0280e500..857408979 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -54,7 +54,7 @@ SUBROUTINE LSMRUC( & DT,init,lsm_cold_start,KTAU,iter,NSL, & graupelncv,snowncv,rainncv,raincv, & ZS,RAINBL,SNOW,SNOWH,SNOWC,FRZFRAC,frpcpn, & - rhosnf,precipfr, & + precipfr, & Z3D,P8W,T3D,QV3D,QC3D,RHO3D,EMISBCK, & GLW,GSWdn,GSW,EMISS,CHKLOWQ, CHS, & FLQC,FLHC,rhonewsn,MAVAIL,CANWAT,VEGFRA,ALB, & @@ -296,14 +296,12 @@ SUBROUTINE LSMRUC( & SMFR3D REAL, DIMENSION( ims:ime, jms:jme ), INTENT(OUT) :: & - RHOSNF, & !RHO of snowfall PRECIPFR, & ! time-step frozen precip SNOWFALLAC !--- soil/snow properties REAL & :: RHOCS, & RHOSN, & - RHOSNFALL, & BCLH, & DQM, & KSAT, & @@ -457,7 +455,6 @@ SUBROUTINE LSMRUC( & ACSNOW(i,j) = 0. SNOWFALLAC(i,j) = 0. PRECIPFR(i,j) = 0. - RHOSNF(i,j) = -1.e3 ! non-zero flag SNFLX(i,j) = 0. DEW (i,j) = 0. PC (i,j) = 0. @@ -622,7 +619,6 @@ SUBROUTINE LSMRUC( & CANWATR=CANWAT(I,J)*1.E-3 SNOWFRAC=SNOWC(I,J) - RHOSNFALL=RHOSNF(I,J) snowold(i,j)=snwe !----- @@ -894,7 +890,7 @@ SUBROUTINE LSMRUC( & nzs,nddzs,nroot,meltfactor, & !added meltfactor iland,isoil,ivgtyp(i,j),isltyp(i,j), & PRCPMS, NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - RHOSN,RHONEWSN(I,J),RHOSNFALL, & + RHOSN,RHONEWSN(I,J), & snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,RHO, & GLW(I,J),GSWdn(i,j),GSW(I,J), & @@ -1073,9 +1069,6 @@ SUBROUTINE LSMRUC( & SNOWC(I,J)=SNOWFRAC -!--- RHOSNF - density of snowfall - RHOSNF(I,J)=RHOSNFALL - ! Accumulated moisture flux [kg/m^2] SFCEVP (I,J) = SFCEVP (I,J) + QFX (I,J) * DT @@ -1161,7 +1154,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia nzs,nddzs,nroot,meltfactor, & ILAND,ISOIL,IVGTYP,ISLTYP,PRCPMS, & NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - RHOSN,RHONEWSN,RHOSNFALL, & + RHOSN,RHONEWSN, & snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,rho, & GLW,GSWdn,GSW,EMISS,EMISBCK,QKMS,TKMS,PC, & @@ -1281,7 +1274,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia EVAPL, & INFILTR, & RHOSN, & - rhosnfall, & snowrat, & grauprat, & icerat, & diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index 744405c03..691698281 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -611,7 +611,7 @@ kind = kind_phys intent = out [fullradar_diag] - standard_name = flag_for_computing_full_radar_reflectivity + standard_name = do_full_radar_reflectivity long_name = flag for computing full radar reflectivity units = flag dimensions = () diff --git a/physics/noahmpdrv.meta b/physics/noahmpdrv.meta index 82d72386f..b8c4a8307 100644 --- a/physics/noahmpdrv.meta +++ b/physics/noahmpdrv.meta @@ -533,7 +533,7 @@ kind = kind_phys intent = in [rhonewsn1] - standard_name = lwe_density_of_precip_ice + standard_name = surface_frozen_precipitation_density long_name = density of precipitation ice units = kg m-3 dimensions = (horizontal_loop_extent) From 8abbcba7b74856e0adf62650af9a4e5806c709b3 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 11 Jan 2023 17:45:15 -0700 Subject: [PATCH 07/14] address standard name clash for lwe of surface snow --- physics/GFS_MP_generic_post.meta | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 107b528a2..c71b61ed0 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -287,7 +287,7 @@ kind = kind_phys intent = inout [frzr] - standard_name = lwe_thickness_of_surface_freezing_rain_amount + standard_name = cumulative_lwe_thickness_of_surface_freezing_rain_amount long_name = accumulated surface freezing rain units = m dimensions = (horizontal_loop_extent) @@ -295,7 +295,7 @@ kind = kind_phys intent = inout [frzrb] - standard_name = lwe_thickness_of_surface_freezing_rain_amount_in_bucket + standard_name = cumulative_lwe_thickness_of_surface_freezing_rain_amount_in_bucket long_name = accumulated surface freezing rain in bucket units = m dimensions = (horizontal_loop_extent) @@ -303,7 +303,7 @@ kind = kind_phys intent = inout [frozr] - standard_name = lwe_thickness_of_surface_graupel_amount + standard_name = cumulative_lwe_thickness_of_surface_graupel_amount long_name = accumulated surface graupel units = m dimensions = (horizontal_loop_extent) @@ -311,7 +311,7 @@ kind = kind_phys intent = inout [frozrb] - standard_name = lwe_thickness_of_surface_graupel_amount_in_bucket + standard_name = cumulative_lwe_thickness_of_surface_graupel_amount_in_bucket long_name = accumulated surface graupel in bucket units = m dimensions = (horizontal_loop_extent) @@ -319,7 +319,7 @@ kind = kind_phys intent = inout [tsnowp] - standard_name = lwe_thickness_of_surface_snow_amount + standard_name = cumulative_lwe_thickness_of_surface_snow_amount long_name = accumulated surface snow units = m dimensions = (horizontal_loop_extent) @@ -327,7 +327,7 @@ kind = kind_phys intent = inout [tsnowpb] - standard_name = lwe_thickness_of_surface_snow_amount_in_bucket + standard_name = cumulative_lwe_thickness_of_surface_snow_amount_in_bucket long_name = accumulated surface snow in bucket units = m dimensions = (horizontal_loop_extent) From e259523a1cf51c41fed5066ecbc76b52faf93022 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 18 Jan 2023 16:51:09 -0500 Subject: [PATCH 08/14] add back RUC LSM internal surface frozen precip density and option to use externally-calculated value --- physics/lsm_ruc.F90 | 17 ++++++++------ physics/lsm_ruc.meta | 15 ++++++++++++ physics/module_sf_ruclsm.F90 | 44 ++++++++++++++++++++++++++---------- 3 files changed, 57 insertions(+), 19 deletions(-) diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 3cf12eb29..d065c154a 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -323,8 +323,8 @@ end subroutine lsm_ruc_finalize subroutine lsm_ruc_run & ! inputs & ( iter, me, master, delt, kdt, im, nlev, lsm_ruc, lsm, & & imp_physics, imp_physics_gfdl, imp_physics_thompson, & - & imp_physics_nssl, & - & do_mynnsfclay, lsoil_ruc, lsoil, rdlai, xlat_d, xlon_d, zs,& + & imp_physics_nssl, do_mynnsfclay, vrbliceden, & + & lsoil_ruc, lsoil, rdlai, xlat_d, xlon_d, zs, & & t1, q1, qc, stype, vtype, sigmaf, laixy, & & dlwflx, dswsfc, tg3, coszen, land, icy, use_lake, & & rainnc, rainc, ice, snow, graupel, & @@ -355,7 +355,7 @@ subroutine lsm_ruc_run & ! inputs & cm_ice, ch_ice, snowfallac_ice, & & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & ! --- out - & sbsno, & + & rhosnf, sbsno, & & cmm_lnd, chh_lnd, cmm_ice, chh_ice, & ! & flag_iter, flag_guess, flag_init, lsm_cold_start, & @@ -397,6 +397,7 @@ subroutine lsm_ruc_run & ! inputs logical, dimension(:), intent(in) :: flag_cice logical, intent(in) :: frac_grid logical, intent(in) :: do_mynnsfclay + logical, intent(in) :: vrbliceden logical, intent(in) :: rdlai @@ -426,7 +427,7 @@ subroutine lsm_ruc_run & ! inputs ! --- output: real (kind=kind_phys), dimension(:), intent(inout) :: & - & runof, drain, runoff, srunoff, evbs, evcw, & + & rhosnf, runof, drain, runoff, srunoff, evbs, evcw, & & stm, wetness, semisbase, semis_lnd, semis_ice, & & sfalb_lnd, sfalb_ice, & ! for land @@ -492,7 +493,7 @@ subroutine lsm_ruc_run & ! inputs & sneqv_lnd, snoalb1d_lnd, snowh_lnd, snoh_lnd, tsnav_lnd, & & snomlt_lnd, sncovr_lnd, soilw, soilm, ssoil_lnd, & & soilt_lnd, tbot, & - & xlai, swdn, z0_lnd, znt_lnd, infiltr, & + & xlai, swdn, z0_lnd, znt_lnd, rhosnfr, infiltr, & & precipfr, snfallac_lnd, acsn, & & qsfc_lnd, qsg_lnd, qvg_lnd, qcg_lnd, soilt1_lnd, chklowq, & & rhonewsn @@ -747,6 +748,7 @@ subroutine lsm_ruc_run & ! inputs acrunoff(i,j) = 0.0 snfallac_lnd(i,j) = 0.0 snfallac_ice(i,j) = 0.0 + rhosnfr(i,j) = 0.0 precipfr(i,j) = 0.0 endif @@ -1121,7 +1123,7 @@ subroutine lsm_ruc_run & ! inputs & zs, prcp(i,j), sneqv_lnd(i,j), snowh_lnd(i,j), & & sncovr_lnd(i,j), & & ffrozp(i,j), frpcpn, & - & precipfr(i,j), & + & rhosnfr(i,j), precipfr(i,j), vrbliceden, & ! --- inputs: & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & @@ -1245,6 +1247,7 @@ subroutine lsm_ruc_run & ! inputs sfcqv_lnd(i) = qvg_lnd(i,j) sfcqc_lnd(i) = qcg_lnd(i,j) ! --- ... units [m/s] = [g m-2 s-1] + rhosnf(i) = rhosnfr(i,j) !acsnow(i) = acsn(i,j) ! kg m-2 ! --- ... accumulated total runoff and surface runoff @@ -1394,7 +1397,7 @@ subroutine lsm_ruc_run & ! inputs & zs, prcp(i,j), sneqv_ice(i,j), snowh_ice(i,j), & & sncovr_ice(i,j), & & ffrozp(i,j), frpcpn, & - & precipfr(i,j), & + & rhosnfr(i,j), precipfr(i,j), vrbliceden, & ! --- inputs: & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & diff --git a/physics/lsm_ruc.meta b/physics/lsm_ruc.meta index 28a3545c9..2fd4f8f77 100644 --- a/physics/lsm_ruc.meta +++ b/physics/lsm_ruc.meta @@ -634,6 +634,13 @@ dimensions = () type = logical intent = in +[vrbliceden] + standard_name = do_variable_surface_frozen_precipitation_density + long_name = flag for variable precip ice density + units = flag + dimensions = () + type = logical + intent = in [lsoil_ruc] standard_name = vertical_dimension_of_soil_internal_to_land_surface_scheme long_name = number of soil layers internal to land surface model @@ -1512,6 +1519,14 @@ type = real kind = kind_phys intent = out +[rhosnf] + standard_name = lsm_internal_surface_frozen_precipitation_density + long_name = density of frozen precipitation + units = kg m-3 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout [sbsno] standard_name = snow_deposition_sublimation_upward_latent_heat_flux long_name = latent heat flux from snow depo/subl diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 857408979..bf7a0bf8e 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -54,11 +54,11 @@ SUBROUTINE LSMRUC( & DT,init,lsm_cold_start,KTAU,iter,NSL, & graupelncv,snowncv,rainncv,raincv, & ZS,RAINBL,SNOW,SNOWH,SNOWC,FRZFRAC,frpcpn, & - precipfr, & + rhosnf,precipfr,vrbliceden, & Z3D,P8W,T3D,QV3D,QC3D,RHO3D,EMISBCK, & GLW,GSWdn,GSW,EMISS,CHKLOWQ, CHS, & - FLQC,FLHC,rhonewsn,MAVAIL,CANWAT,VEGFRA,ALB, & - ZNT,Z0,SNOALB,ALBBCK,LAI, & + FLQC,FLHC,rhonewsn_ex,MAVAIL,CANWAT,VEGFRA, & + ALB, ZNT,Z0,SNOALB,ALBBCK,LAI, & landusef, nlcat, & ! mosaic_lu, mosaic_soil, & soilctop, nscat, & QSFC,QSG,QVG,QCG,DEW,SOILT1,TSNAV, & @@ -157,7 +157,7 @@ SUBROUTINE LSMRUC( & ! INTEGER, PARAMETER :: nddzs=2*(nzss-2) REAL, INTENT(IN ) :: DT - LOGICAL, INTENT(IN ) :: myj,frpcpn,init,lsm_cold_start + LOGICAL, INTENT(IN ) :: myj,frpcpn,init,lsm_cold_start,vrbliceden INTEGER, INTENT(IN ) :: NLCAT, NSCAT ! , mosaic_lu, mosaic_soil INTEGER, INTENT(IN ) :: ktau, iter, nsl, isice, iswater, & ims,ime, jms,jme, kms,kme, & @@ -192,7 +192,7 @@ SUBROUTINE LSMRUC( & SNOWNCV, & RAINCV, & RAINNCV, & - RHONEWSN + RHONEWSN_ex !externally-calculated srf frz precip density ! REAL, DIMENSION( ims:ime , jms:jme ), & ! INTENT(IN ) :: lakemask ! INTEGER, INTENT(IN ) :: LakeModel @@ -296,12 +296,15 @@ SUBROUTINE LSMRUC( & SMFR3D REAL, DIMENSION( ims:ime, jms:jme ), INTENT(OUT) :: & + RHOSNF, & !RHO of snowfall PRECIPFR, & ! time-step frozen precip SNOWFALLAC !--- soil/snow properties REAL & :: RHOCS, & + RHONEWSN, & RHOSN, & + RHOSNFALL, & BCLH, & DQM, & KSAT, & @@ -455,6 +458,7 @@ SUBROUTINE LSMRUC( & ACSNOW(i,j) = 0. SNOWFALLAC(i,j) = 0. PRECIPFR(i,j) = 0. + RHOSNF(i,j) = -1.e3 ! non-zero flag SNFLX(i,j) = 0. DEW (i,j) = 0. PC (i,j) = 0. @@ -619,6 +623,7 @@ SUBROUTINE LSMRUC( & CANWATR=CANWAT(I,J)*1.E-3 SNOWFRAC=SNOWC(I,J) + RHOSNFALL=RHOSNF(I,J) snowold(i,j)=snwe !----- @@ -680,6 +685,7 @@ SUBROUTINE LSMRUC( & NROOT= 4 ! ! rooting depth + RHONEWSN = 200. if(SNOW(i,j).gt.0. .and. SNOWH(i,j).gt.0.) then RHOSN = SNOW(i,j)/SNOWH(i,j) else @@ -890,8 +896,8 @@ SUBROUTINE LSMRUC( & nzs,nddzs,nroot,meltfactor, & !added meltfactor iland,isoil,ivgtyp(i,j),isltyp(i,j), & PRCPMS, NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - RHOSN,RHONEWSN(I,J), & - snowrat,grauprat,icerat,curat, & + vrbliceden,RHOSN,RHONEWSN_ex(I,J),RHONEWSN, & + RHOSNFALL,snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,RHO, & GLW(I,J),GSWdn(i,j),GSW(I,J), & EMISSL(I,J),EMISBCK(I,J), & @@ -1069,6 +1075,9 @@ SUBROUTINE LSMRUC( & SNOWC(I,J)=SNOWFRAC +!--- RHOSNF - density of snowfall + RHOSNF(I,J)=RHOSNFALL + ! Accumulated moisture flux [kg/m^2] SFCEVP (I,J) = SFCEVP (I,J) + QFX (I,J) * DT @@ -1154,7 +1163,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia nzs,nddzs,nroot,meltfactor, & ILAND,ISOIL,IVGTYP,ISLTYP,PRCPMS, & NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - RHOSN,RHONEWSN, & + vrbliceden,RHOSN,RHONEWSN_ex,RHONEWSN,RHOSNFALL, & snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,rho, & GLW,GSWdn,GSW,EMISS,EMISBCK,QKMS,TKMS,PC, & @@ -1182,8 +1191,8 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia nddzs !nddzs=2*(nzs-2) REAL, INTENT(IN ) :: DELT,CONFLX,meltfactor - REAL, INTENT(IN ) :: C1SN,C2SN,RHONEWSN - LOGICAL, INTENT(IN ) :: myj, debug_print + REAL, INTENT(IN ) :: C1SN,C2SN,RHONEWSN_ex + LOGICAL, INTENT(IN ) :: myj, debug_print, vrbliceden !--- 3-D Atmospheric variables REAL , & INTENT(IN ) :: PATM, & @@ -1273,7 +1282,9 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia EETA, & EVAPL, & INFILTR, & - RHOSN, & + RHOSN, & + RHONEWSN, & + rhosnfall, & snowrat, & grauprat, & icerat, & @@ -1484,13 +1495,22 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia !--- 27 Feb 2014 - empirical formulations from John M. Brown ! rhonewsn=min(250.,rhowater/max(4.179,(13.*tanh((274.15-Tabs)*0.3333)))) !--- 13 Mar 2018 - formulation from Trevor Elcott - + if (vrbliceden) then + rhonewsn = rhonewsn_ex + else + rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) + rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-Tabs)*0.3333)))) + rhonewice=rhonewsn !--- compute density of "snowfall" from weighted contribution ! of snow, graupel and ice fractions + rhosnfall = min(500.,max(58.8,(rhonewsn*snowrat + & !13mar18 rhosnfall = min(500.,max(76.9,(rhonewsn*snowrat + & + rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat))) ! from now on rhonewsn is the density of falling frozen precipitation + rhonewsn=rhosnfall + end if !*** Define average snow density of the snow pack considering !*** the amount of fresh snow (eq. 9 in Koren et al.(1999) From c96fee620e54758250d145fb776b759c2c6c61bc Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 19 Jan 2023 10:28:11 -0500 Subject: [PATCH 09/14] update initialization of rhosnfr in lsm_ruc.F90 --- physics/lsm_ruc.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index d065c154a..21b805d9c 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -748,7 +748,7 @@ subroutine lsm_ruc_run & ! inputs acrunoff(i,j) = 0.0 snfallac_lnd(i,j) = 0.0 snfallac_ice(i,j) = 0.0 - rhosnfr(i,j) = 0.0 + rhosnfr(i,j) = -1.e3 precipfr(i,j) = 0.0 endif From cb0afb8c8b9de7b97e37d593225fe2dc81c9f6d8 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 19 Jan 2023 20:46:52 -0500 Subject: [PATCH 10/14] use updated exticeden flag --- physics/GFS_MP_generic_post.F90 | 8 ++++---- physics/GFS_MP_generic_post.meta | 13 +++---------- physics/lsm_noah.f | 6 +++--- physics/lsm_noah.meta | 6 +++--- physics/lsm_ruc.F90 | 8 ++++---- physics/lsm_ruc.meta | 6 +++--- physics/module_sf_ruclsm.F90 | 12 ++++++------ physics/sflx.f | 10 +++++----- 8 files changed, 31 insertions(+), 38 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index d9d205720..1a04c74ba 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -24,7 +24,7 @@ subroutine GFS_MP_generic_post_run( frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, & rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,& totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, & - pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, vrbliceden_noah, iopt_snf, & + pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, & @@ -38,7 +38,7 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires integer, intent(in) :: imp_physics_nssl - logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, vrbliceden_noah + logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden integer, intent(in) :: index_of_temperature,index_of_process_mp integer :: dfi_radar_max_intervals @@ -71,7 +71,7 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl, dsnow_cpl ! Rainfall variables previous time step - integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp, iopt_snf + integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp real(kind=kind_phys), dimension(:), intent(inout) :: raincprv real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv real(kind=kind_phys), dimension(:), intent(inout) :: iceprv @@ -135,7 +135,7 @@ subroutine GFS_MP_generic_post_run( frozrb(i) = frozrb(i) + graupel0(i) enddo !Compute the variable precip ice density for specific LSM schemes and options - if ( lsm == lsm_ruc .or. (lsm == lsm_noahmp .and. iopt_snf == 5) .or. vrbliceden_noah == .true.) then + if (exticeden) then snowrat = 0. grauprat = 0. icerat = 0. diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index c71b61ed0..fa1cfafe0 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -342,20 +342,13 @@ type = real kind = kind_phys intent = inout -[vrbliceden_noah] - standard_name = do_variable_surface_frozen_precipitation_density - long_name = flag for variable precip ice density +[exticeden] + standard_name = do_external_surface_frozen_precipitation_density + long_name = flag for calculating frozen precip ice density outside of the LSM units = flag dimensions = () type = logical intent = in -[iopt_snf] - standard_name = control_for_land_surface_scheme_precipitation_type_partition - long_name = choice for precipitation partition option (see noahmp module for definition) - units = index - dimensions = () - type = integer - intent = in [save_t] standard_name = air_temperature_save long_name = air temperature before entering a physics scheme diff --git a/physics/lsm_noah.f b/physics/lsm_noah.f index 3e66c86fb..e145fa94b 100644 --- a/physics/lsm_noah.f +++ b/physics/lsm_noah.f @@ -221,7 +221,7 @@ subroutine lsm_noah_run & & bexppert, xlaipert, vegfpert,pertvegf, & ! sfc perts, mgehne & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & & adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, rhonewsn1, & - & vrbliceden_noah, & + & exticeden, & ! --- in/outs: & weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & & canopy, trans, tsurf, zorl, & @@ -272,7 +272,7 @@ subroutine lsm_noah_run & logical, dimension(:), intent(in) :: flag_iter, flag_guess, land - logical, intent(in) :: lheatstrg, vrbliceden_noah + logical, intent(in) :: lheatstrg, exticeden ! --- in/out: real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & @@ -531,7 +531,7 @@ subroutine lsm_noah_run & & swdn, solnet, lwdn, sfcems, sfcprs, sfctmp, & & sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, & & vtype, stype, slope, shdmin1d, alb, snoalb1d, & - & rhonewsn, vrbliceden_noah, & + & rhonewsn, exticeden, & & bexpp, xlaip, & ! sfc-perts, mgehne & lheatstrg, & ! --- input/outputs: diff --git a/physics/lsm_noah.meta b/physics/lsm_noah.meta index 9c93586da..e059a22c6 100644 --- a/physics/lsm_noah.meta +++ b/physics/lsm_noah.meta @@ -494,9 +494,9 @@ type = real kind = kind_phys intent = in -[vrbliceden_noah] - standard_name = do_variable_surface_frozen_precipitation_density - long_name = flag for variable precip ice density +[exticeden] + standard_name = do_external_surface_frozen_precipitation_density + long_name = flag for calculating frozen precip ice density outside of the LSM units = flag dimensions = () type = logical diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 21b805d9c..f4c2a8be6 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -323,7 +323,7 @@ end subroutine lsm_ruc_finalize subroutine lsm_ruc_run & ! inputs & ( iter, me, master, delt, kdt, im, nlev, lsm_ruc, lsm, & & imp_physics, imp_physics_gfdl, imp_physics_thompson, & - & imp_physics_nssl, do_mynnsfclay, vrbliceden, & + & imp_physics_nssl, do_mynnsfclay, exticeden, & & lsoil_ruc, lsoil, rdlai, xlat_d, xlon_d, zs, & & t1, q1, qc, stype, vtype, sigmaf, laixy, & & dlwflx, dswsfc, tg3, coszen, land, icy, use_lake, & @@ -397,7 +397,7 @@ subroutine lsm_ruc_run & ! inputs logical, dimension(:), intent(in) :: flag_cice logical, intent(in) :: frac_grid logical, intent(in) :: do_mynnsfclay - logical, intent(in) :: vrbliceden + logical, intent(in) :: exticeden logical, intent(in) :: rdlai @@ -1123,7 +1123,7 @@ subroutine lsm_ruc_run & ! inputs & zs, prcp(i,j), sneqv_lnd(i,j), snowh_lnd(i,j), & & sncovr_lnd(i,j), & & ffrozp(i,j), frpcpn, & - & rhosnfr(i,j), precipfr(i,j), vrbliceden, & + & rhosnfr(i,j), precipfr(i,j), exticeden, & ! --- inputs: & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & @@ -1397,7 +1397,7 @@ subroutine lsm_ruc_run & ! inputs & zs, prcp(i,j), sneqv_ice(i,j), snowh_ice(i,j), & & sncovr_ice(i,j), & & ffrozp(i,j), frpcpn, & - & rhosnfr(i,j), precipfr(i,j), vrbliceden, & + & rhosnfr(i,j), precipfr(i,j), exticeden, & ! --- inputs: & conflx2(i,1,j), sfcprs(i,1,j), sfctmp(i,1,j), q2(i,1,j), & & qcatm(i,1,j), rho2(i,1,j), semis_bck(i,j), lwdn(i,j), & diff --git a/physics/lsm_ruc.meta b/physics/lsm_ruc.meta index 2fd4f8f77..0d22f8d4a 100644 --- a/physics/lsm_ruc.meta +++ b/physics/lsm_ruc.meta @@ -634,9 +634,9 @@ dimensions = () type = logical intent = in -[vrbliceden] - standard_name = do_variable_surface_frozen_precipitation_density - long_name = flag for variable precip ice density +[exticeden] + standard_name = do_external_surface_frozen_precipitation_density + long_name = flag for calculating frozen precip ice density outside of the LSM units = flag dimensions = () type = logical diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index bf7a0bf8e..cf0d6f015 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -54,7 +54,7 @@ SUBROUTINE LSMRUC( & DT,init,lsm_cold_start,KTAU,iter,NSL, & graupelncv,snowncv,rainncv,raincv, & ZS,RAINBL,SNOW,SNOWH,SNOWC,FRZFRAC,frpcpn, & - rhosnf,precipfr,vrbliceden, & + rhosnf,precipfr,exticeden, & Z3D,P8W,T3D,QV3D,QC3D,RHO3D,EMISBCK, & GLW,GSWdn,GSW,EMISS,CHKLOWQ, CHS, & FLQC,FLHC,rhonewsn_ex,MAVAIL,CANWAT,VEGFRA, & @@ -157,7 +157,7 @@ SUBROUTINE LSMRUC( & ! INTEGER, PARAMETER :: nddzs=2*(nzss-2) REAL, INTENT(IN ) :: DT - LOGICAL, INTENT(IN ) :: myj,frpcpn,init,lsm_cold_start,vrbliceden + LOGICAL, INTENT(IN ) :: myj,frpcpn,init,lsm_cold_start,exticeden INTEGER, INTENT(IN ) :: NLCAT, NSCAT ! , mosaic_lu, mosaic_soil INTEGER, INTENT(IN ) :: ktau, iter, nsl, isice, iswater, & ims,ime, jms,jme, kms,kme, & @@ -896,7 +896,7 @@ SUBROUTINE LSMRUC( & nzs,nddzs,nroot,meltfactor, & !added meltfactor iland,isoil,ivgtyp(i,j),isltyp(i,j), & PRCPMS, NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - vrbliceden,RHOSN,RHONEWSN_ex(I,J),RHONEWSN, & + exticeden,RHOSN,RHONEWSN_ex(I,J),RHONEWSN, & RHOSNFALL,snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,RHO, & GLW(I,J),GSWdn(i,j),GSW(I,J), & @@ -1163,7 +1163,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia nzs,nddzs,nroot,meltfactor, & ILAND,ISOIL,IVGTYP,ISLTYP,PRCPMS, & NEWSNMS,SNWE,SNHEI,SNOWFRAC, & - vrbliceden,RHOSN,RHONEWSN_ex,RHONEWSN,RHOSNFALL, & + exticeden,RHOSN,RHONEWSN_ex,RHONEWSN,RHOSNFALL, & snowrat,grauprat,icerat,curat, & PATM,TABS,QVATM,QCATM,rho, & GLW,GSWdn,GSW,EMISS,EMISBCK,QKMS,TKMS,PC, & @@ -1192,7 +1192,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia REAL, INTENT(IN ) :: DELT,CONFLX,meltfactor REAL, INTENT(IN ) :: C1SN,C2SN,RHONEWSN_ex - LOGICAL, INTENT(IN ) :: myj, debug_print, vrbliceden + LOGICAL, INTENT(IN ) :: myj, debug_print, exticeden !--- 3-D Atmospheric variables REAL , & INTENT(IN ) :: PATM, & @@ -1495,7 +1495,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia !--- 27 Feb 2014 - empirical formulations from John M. Brown ! rhonewsn=min(250.,rhowater/max(4.179,(13.*tanh((274.15-Tabs)*0.3333)))) !--- 13 Mar 2018 - formulation from Trevor Elcott - if (vrbliceden) then + if (exticeden) then rhonewsn = rhonewsn_ex else rhonewsn=min(125.,1000.0/max(8.,(17.*tanh((276.65-Tabs)*0.15)))) diff --git a/physics/sflx.f b/physics/sflx.f index ae302be1c..df22d128f 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -116,7 +116,7 @@ subroutine gfssflx &! --- input & swdn, swnet, lwdn, sfcems, sfcprs, sfctmp, & & sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, & & vegtyp, soiltyp, slopetyp, shdmin, alb, snoalb, & - & rhonewsn, vrbliceden_noah, & + & rhonewsn, exticeden, & & bexpp, xlaip, & ! sfc-perts, mgehne & lheatstrg, &! --- input/outputs: & tbot, cmc, t1, stc, smc, sh2o, sneqv, ch, cm,z0, &! --- outputs: @@ -313,7 +313,7 @@ subroutine gfssflx &! --- input & sfcspd, prcp, q2, q2sat, dqsdt2, th2, shdmin, alb, snoalb, & & bexpp, xlaip, rhonewsn & !sfc-perts, mgehne - logical, intent(in) :: lheatstrg, vrbliceden_noah + logical, intent(in) :: lheatstrg, exticeden ! --- input/outputs: real (kind=kind_phys), intent(inout) :: tbot, cmc, t1, sneqv, & @@ -565,7 +565,7 @@ subroutine gfssflx &! --- input !! using old and new snow. call snow_new ! --- inputs: ! -! ( sfctmp, sn_new, rhonewsn, vrbliceden_noah, ! +! ( sfctmp, sn_new, rhonewsn, exticeden, ! ! --- input/outputs: ! ! snowh, sndens ) ! @@ -2856,7 +2856,7 @@ end subroutine snopac subroutine snow_new !................................... ! --- inputs: -! & ( sfctmp, sn_new, rhonewsn, vrbliceden_noah, & +! & ( sfctmp, sn_new, rhonewsn, exticeden, & ! --- input/outputs: ! & snowh, sndens & ! & ) @@ -2905,7 +2905,7 @@ subroutine snow_new ! snowcovered and glacierized basin', 6th nordic hydrological ! conference, vemadolen, sweden, 1980, 172-177pp. - if(.not. vrbliceden_noah) then + if(.not. exticeden) then if (tempc <= -15.0) then dsnew = 0.05 else From f3499e3c2bba057c36975d4ff5faa8772ab85c16 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 8 Feb 2023 10:45:58 -0700 Subject: [PATCH 11/14] Merge pull request #956 from dustinswales/accumulated_cleanup Accumulated cleanup --- CODEOWNERS | 301 ++++++----- physics/GFS_cloud_diagnostics.F90 | 80 ++- physics/GFS_cloud_diagnostics.meta | 23 + physics/GFS_phys_time_vary.fv3.F90 | 14 +- physics/GFS_phys_time_vary.fv3.meta | 15 + physics/GFS_phys_time_vary.scm.F90 | 2 +- physics/GFS_rad_time_vary.fv3.F90 | 8 +- physics/GFS_rad_time_vary.fv3.meta | 16 +- physics/GFS_rad_time_vary.scm.F90 | 8 +- physics/GFS_rad_time_vary.scm.meta | 16 +- physics/GFS_radiation_surface.F90 | 23 +- physics/GFS_radiation_surface.meta | 33 +- physics/GFS_rrtmg_pre.F90 | 89 ++-- physics/GFS_rrtmg_pre.meta | 121 ++++- physics/GFS_rrtmg_setup.F90 | 442 ++++------------ physics/GFS_rrtmg_setup.meta | 290 ++++++++++- physics/GFS_rrtmgp_cloud_overlap.F90 | 3 +- physics/GFS_rrtmgp_cloud_overlap.meta | 4 +- physics/GFS_rrtmgp_pre.F90 | 34 +- physics/GFS_rrtmgp_pre.meta | 21 +- physics/GFS_rrtmgp_setup.F90 | 95 ++-- physics/GFS_rrtmgp_setup.meta | 223 ++++++-- physics/GFS_surface_composites_pre.F90 | 1 - physics/GFS_surface_composites_pre.meta | 2 +- physics/cires_ugwpv1_oro.F90 | 4 +- physics/drag_suite.F90 | 6 + physics/gcycle.F90 | 27 +- physics/gfdl_cloud_microphys.F90 | 2 +- physics/gfdl_sfc_layer.F90 | 6 +- physics/lsm_noah.f | 5 +- physics/lsm_ruc.F90 | 8 +- physics/m_micro.F90 | 4 +- physics/module_SF_JSFC.F90 | 23 +- physics/module_gfdl_cloud_microphys.F90 | 13 +- physics/module_sf_exchcoef.f90 | 13 +- physics/module_sf_mynn.F90 | 21 +- ...acier.f90 => module_sf_noahmp_glacier.F90} | 2 +- ..._noahmplsm.f90 => module_sf_noahmplsm.F90} | 2 +- physics/module_sf_ruclsm.F90 | 29 +- physics/myjsfc_wrapper.F90 | 2 +- physics/noahmpdrv.F90 | 2 +- physics/noahmpdrv.meta | 2 +- physics/physcons.F90 | 4 +- physics/physparam.f | 300 ----------- physics/radiation_aerosols.f | 477 +++++++++++------ physics/radiation_astronomy.f | 74 +-- physics/radiation_cloud_overlap.F90 | 2 +- physics/radiation_clouds.f | 488 ++++++++---------- physics/radiation_gases.f | 310 ++++++----- physics/radiation_surface.f | 44 +- physics/radlw_datatb.f | 38 +- physics/radlw_main.F90 | 212 ++++---- physics/radlw_main.meta | 86 ++- physics/radlw_param.f | 2 +- physics/radsw_datatb.f | 34 +- physics/radsw_main.F90 | 275 +++++----- physics/radsw_main.meta | 93 +++- physics/radsw_param.f | 2 +- physics/rrtmgp_aerosol_optics.F90 | 25 +- physics/rrtmgp_aerosol_optics.meta | 45 ++ physics/set_soilveg.f | 22 +- physics/set_soilveg_ruc.F90 | 20 +- physics/sfc_diff.f | 4 +- physics/sflx.f | 36 +- 64 files changed, 2605 insertions(+), 2023 deletions(-) rename physics/{module_sf_noahmp_glacier.f90 => module_sf_noahmp_glacier.F90} (99%) rename physics/{module_sf_noahmplsm.f90 => module_sf_noahmplsm.F90} (99%) delete mode 100644 physics/physparam.f diff --git a/CODEOWNERS b/CODEOWNERS index cf7a886aa..15821a791 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -4,127 +4,198 @@ # Default codeowners for files that don't have specific owners: -* @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA +* @grantfirl @ChunxiZhang-NOAA @dustinswales @mzhangw # The following lines are from the CCPP Primary Schemes Points of Contact # https://docs.google.com/spreadsheets/d/14y0Th_sSpCqlssEMNfSZ_Ni9wrpPqfpPY0kRG7jCZB8/edit#gid=0 # (Internal NOAA document.) -smoke/* @haiqinli @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/cs_conv_aw_adj.* @AnningCheng-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/cs_conv.* @AnningCheng-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/cu_gf* @hannahcbarnes @haiqinli @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/sascnvn.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/cu_ntiedtke* @ChunxiZhang-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich -physics/rascnv.* @SMoorthi-emc @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/samfdeepcnv.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/samfshalcnv.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/samfaerosols.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/shalcnv.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/unified_ugwp* @mdtoyNOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/ugwp_driver_v0.F @mdtoyNOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/cires_ugwp* @mdtoyNOAA @ValeryYudin-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/drag_suite.* @mdtoyNOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/gwdc.* @Songyou184 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/gwdps.* @Songyou184 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/gfdl_fv_sat_adj.* @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/gfdl_cloud_microphys.* @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/module_gfdl_cloud_microphys.* @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/multi_gases.F90 @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/mp_fer_hires.* @ericaligo-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/module_MP_FER_HIRES.* @ericaligo-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/module_mp_thompson* @gthompsnWRF @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/module_mp_radar.* @gthompsnWRF @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/mp_thompson* @gthompsnWRF @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/precpd.* @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/gscond.* @RuiyuSun @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/m_micro* @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/aer_cloud.F @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/aerclm_def.F @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/cldmacro.F @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/cldwat2m_micro.F @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/wv_saturation.F @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/micro_mg* @AnningCheng-NOAA @andrewgettelman @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/ozphys* @AlexBelochitski-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/satmedmfvdif.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/satmedmfvdifq.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/mfpbl.f @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/mfscu.f @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/mfpbltq.f @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/mfscuq.f @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/shinhongvdif.* @ChunxiZhang-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich -physics/ysuvdif.* @ChunxiZhang-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich - -physics/tridi.f @JongilHan66 @ChunxiZhang-NOAA @JongilHan66 @WeiguoWang-NOAA @AlexBelochitski-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich - -physics/moninedmf.* @JongilHan66 @WeiguoWang-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/module_BL_MYJPBL.* @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/module_MYJPBL_wrapper.* @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/module_bl_mynn.* @joeolson42 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/module_MYNNPBL_wrapper.* @joeolson42 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/gcm_shoc.* @AlexBelochitski-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/moninshoc.* @AlexBelochitski-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/rte-rrtmgp @dustinswales @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/radiation_tools.* @dustinswales @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/rrtmgp_lw_rte.met* @dustinswales @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/rrtmgp_sw_rte.met* @dustinswales @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/radlw_main.* @mjiacono @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/HWRF_mcica_random_numbers.F90 @mjiacono @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/HWRF_mersenne_twister.F90 @mjiacono @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/radlw_datatb.f @mjiacono @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/radsw_datatb.* @mjiacono @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/radsw_main.* @mjiacono @Qingfu-Liu @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/radsw_param.f @dustinswales @Qingfu-Liu @mjiacono @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/rayleigh_damp.* @yangfanglin @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/GFS_stochastics.* @pjpegion @lisa-bengtsson @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/flake* @YihuaWu-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/sfc_drv.* @HelinWei-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/sflx.f @HelinWei-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/surface_perturbation.* @HelinWei-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/*noahmp* @barlage @cenlinhe @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/set_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/namelist_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/namelist_soilveg_ruc.* @tanyasmirnova @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/set_soilveg_ruc.* @tanyasmirnova @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/module_sf_ruclsm.* @tanyasmirnova @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/module_soil_pre.* @tanyasmirnova @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/sfc_drv_ruc.* @tanyasmirnova @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/date_def.f @XuLi-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/*nst* @XuLi-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/sfc_ocean.* @HelinWei-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/sfc_diff.* @JongilHan66 @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/h2ophys.* @AlexBelochitski-NOAA @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA - -physics/sfc_sice.* @wd20xw @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA -physics/sfc_cice.* @wd20xw @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA +smoke/* @haiqinli @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/aerclm_def.F @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/aer_cloud.F @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/aerinterp.F90 @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/bl_mynn_common.f90 @joeolson42 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/calpreciptype.f90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cires_orowam2017.f @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cires_tauamf_data.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cires_ugwp* @ValeryYudin-NOAA @mdtoyNOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cldmacro.F @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cldwat2m_micro.F @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cnvc90.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cs_conv_aw_adj.* @AnningCheng-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cs_conv.* @AnningCheng-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cu_gf* @hannahcbarnes @haiqinli @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/cu_ntiedtke* @ChunxiZhang-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/date_def.f @XuLi-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/dcyc2t3.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/drag_suite.* @mdtoyNOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/flake* @YihuaWu-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/funcphys.f90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/fv_sat_adj.* @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gcycle.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/get_phi_fv3.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/get_prs_fv3.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gfdl_cloud_microphys.* @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFDL_parse_tracers.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gfdl_sfc_layer.* @ZhanZhang-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_cloud_diagnostics.* @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_DCNV_generic_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_DCNV_generic_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_debug.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_GWD_generic_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_GWD_generic_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_MP_generic_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_MP_generic_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_PBL_generic_common.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_PBL_generic_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_PBL_generic_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_phys_time_vary.fv3.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_phys_time_vary.scm.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gfs_phy_tracer_config.F @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_radiation_surface.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rad_time_vary.fv3.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rad_time_vary.scm.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_cloud_mp.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_cloud_overlap.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_lw_post.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmg_post.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_pre.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmg_pre.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_setup.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_sw_post.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmgp_sw_pre.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_rrtmg_setup.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_SCNV_generic_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_SCNV_generic_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_stochastics.* @pjpegion @lisa-bengtsson @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_1.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_2.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_3.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_4.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_5.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_phys_reset.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_interstitial_rad_reset.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_stateout_reset.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_suite_stateout_update.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_composites_inter.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_composites_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_composites_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_generic_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_generic_pre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_loop_control_part1.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_surface_loop_control_part2.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_time_vary_pre.fv3.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/GFS_time_vary_pre.scm.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gocart_tracer_config_stub.f @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gwdc.* @Songyou184 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/gwdps.* @Songyou184 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/h2o_def.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/h2ointerp.f90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/h2ophys.* @SMoorthi-emc @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/hedmf.* @JongilHan66 @WeiguoWang-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/iccn_def.F @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/iccninterp.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/iounitdef.f @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/lsm_noah.* @HelinWei-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/lsm_ruc.* @tanyasmirnova @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/machine.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/maximum_hourly_diagnostics.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mersenne_twister.f @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mfpbl.f @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mfpblt.f @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mfpbltq.f @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mfscu.f @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mfscuq.f @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/micro_mg* @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/m_micro* @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_bfmicrophysics.f @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_BL_MYJPBL.* @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_bl_mynn.* @joeolson42 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_gfdl_cloud_microphys.* @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_MP_FER_HIRES.* @ericaligo-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_mp_nssl_2mom.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_mp_radar.* @gthompsnWRF @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_mp_thompson* @gthompsnWRF @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_nst* @XuLi-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_sf_exchcoef.f90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_SF_JSFC.F90 @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_sf_mynn.F90 @joeolson42 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_sf_ruclsm.* @tanyasmirnova @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/module_soil_pre.* @tanyasmirnova @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/moninshoc.* @SMoorthi-emc @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mp_fer_hires.* @ericaligo-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mp_nssl.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mp_thompson* @gthompsnWRF @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/multi_gases.F90 @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/myjpbl_wrapper.* @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/myjsfc_wrapper.* @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mynnedmf_wrapper.* @joeolson42 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/mynnsfc_wrapper.* @joeolson42 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/namelist_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/namelist_soilveg_ruc.* @tanyasmirnova @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/*noahmp* @barlage @cenlinhe @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ozinterp.f90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ozne_def.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ozphys* @SMoorthi-emc @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/physcons.F90 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/phys_tend.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/progsigma_calc.f90 @lisa-bengtsson @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radcons.f90 @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_aerosols.f @Qingfu-Liu @dustinswales @AnningCheng-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_astronomy.f @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_cloud_overlap.F90 @dustinswales @mjiacono @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_clouds.f @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_gases.f @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_surface.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radiation_tools.F90 @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radlw_* @mjiacono @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/radsw_* @mjiacono @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rad_sw_pre.* @dustinswales @Qingfu-Liu @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rascnv.* @SMoorthi-emc @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rayleigh_damp.* @yangfanglin @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmg_lw_cloud_optics.F90 @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmg_lw_post.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmg_lw_pre.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmgp_aerosol_optics.* @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmgp_lw_* @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmgp_sw_* @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmg_sw_cloud_optics.F90 @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rrtmg_sw_post.* @Qingfu-Liu @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/rte-rrtmgp @RobertPincus @dustinswales @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/samfdeepcnv.* @JongilHan66 @lisa-bengtsson @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/samfshalcnv.* @JongilHan66 @lisa-bengtsson @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/samfaerosols.* @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sascnvn.* @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/satmedmfvdif.* @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/satmedmfvdifq.* @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/scm_sfc_flux_spec.* @grantfirl @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/set_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/set_soilveg_ruc.* @tanyasmirnova @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_cice.* @wd20xw @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_diag.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_diag_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_diff.* @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_nst* @XuLi-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_ocean.* @HelinWei-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sfc_sice.* @wd20xw @grantfirl @ChunxiZhang-NOAA @dustinswales +#physics/sfcsub.F @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sflx.f @HelinWei-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sgscloud_radpost.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/sgscloud_radpre.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/shalcnv.* @JongilHan66 @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/shinhongvdif.* @ChunxiZhang-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/shoc.* @SMoorthi-emc @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/surface_perturbation.* @HelinWei-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/tridi.f @JongilHan66 @ChunxiZhang-NOAA @WeiguoWang-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ugwp_driver_v0.F @mdtoyNOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ugwpv1_gsldrag.* @mdtoyNOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ugwpv1_gsldrag_post.* @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/unified_ugwp* @mdtoyNOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/wv_saturation.F @AnningCheng-NOAA @andrewgettelman @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/ysuvdif.* @ChunxiZhang-NOAA @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/zhaocarr_gscond.* @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales +physics/zhaocarr_precpd.* @RuiyuSun @grantfirl @ChunxiZhang-NOAA @dustinswales ######################################################################## diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/GFS_cloud_diagnostics.F90 index 0e3f730e5..86dc2b518 100644 --- a/physics/GFS_cloud_diagnostics.F90 +++ b/physics/GFS_cloud_diagnostics.F90 @@ -3,7 +3,6 @@ module GFS_cloud_diagnostics use machine, only: kind_phys - use physparam, only: icldflg use module_radiation_clouds, only: gethml ! Module parameters (imported directly from radiation_cloud.f) @@ -19,10 +18,6 @@ module GFS_cloud_diagnostics ! Version tag and last revision date character(40), parameter :: VTAGCLD='UFS-cloud-diagnostics vX.x May 2020 ' - - ! Module variables - integer :: & - llyr = 2 ! Upper limit of boundary layer clouds public GFS_cloud_diagnostics_run @@ -36,51 +31,54 @@ module GFS_cloud_diagnostics !> \section arg_table_GFS_cloud_diagnostics_run !! \htmlinclude GFS_cloud_diagnostics_run.html !! - subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr_rand, iovr_maxrand, iovr_max, & - iovr_dcorr, iovr_exp, iovr_exprand, lsswr, lslwr, lat, de_lgth, p_lay, & + subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr, iovr_rand, iovr_maxrand, & + iovr_max, iovr_dcorr, iovr_exp, iovr_exprand, lsswr, lslwr, lat, de_lgth, p_lay, & cld_frac, p_lev, deltaZ, cloud_overlap_param, precip_overlap_param, con_pi, & - mtopa, mbota, cldsa, errmsg, errflg) + top_at_1, si, mtopa, mbota, cldsa, errmsg, errflg) implicit none ! Inputs - integer, intent(in) :: & - nCol, & ! Number of horizontal grid-points - nLev ! Number of vertical-layers - integer, intent(in) :: & - iovr_rand, & ! Flag for random cloud overlap method - iovr_maxrand, & ! Flag for maximum-random cloud overlap method - iovr_max, & ! Flag for maximum cloud overlap method - iovr_dcorr, & ! Flag for decorrelation-length cloud overlap method - iovr_exp, & ! Flag for exponential cloud overlap method - iovr_exprand ! Flag for exponential-random cloud overlap method - logical, intent(in) :: & - lsswr, & ! Call SW radiation? - lslwr ! Call LW radiation - real(kind_phys), intent(in) :: & - con_pi ! Physical constant: pi + integer, intent(in) :: & + nCol, & ! Number of horizontal grid-points + nLev ! Number of vertical-layers + integer, intent(in) :: & + iovr, & ! Choice of cloud-overlap method + iovr_rand, & ! Flag for random cloud overlap method + iovr_maxrand, & ! Flag for maximum-random cloud overlap method + iovr_max, & ! Flag for maximum cloud overlap method + iovr_dcorr, & ! Flag for decorrelation-length cloud overlap method + iovr_exp, & ! Flag for exponential cloud overlap method + iovr_exprand ! Flag for exponential-random cloud overlap method + logical, intent(in) :: & + lsswr, & ! Call SW radiation? + lslwr, & ! Call LW radiation? + top_at_1 ! Vertical ordering flag + real(kind_phys), intent(in) :: & + con_pi ! Physical constant: pi real(kind_phys), dimension(:), intent(in) :: & - lat, & ! Latitude - de_lgth ! Decorrelation length + lat, & ! Latitude + de_lgth, & ! Decorrelation length + si ! Vertical sigma coordinate real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure at model-layer - cld_frac ! Total cloud fraction + p_lay, & ! Pressure at model-layer + cld_frac ! Total cloud fraction real(kind_phys), dimension(:,:), intent(in) :: & - p_lev ! Pressure at model interfaces + p_lev ! Pressure at model interfaces real(kind_phys), dimension(:,:), intent(in) :: & - deltaZ, & ! Layer thickness (m) - cloud_overlap_param, & ! Cloud-overlap parameter - precip_overlap_param ! Precipitation overlap parameter + deltaZ, & ! Layer thickness (m) + cloud_overlap_param, & ! Cloud-overlap parameter + precip_overlap_param ! Precipitation overlap parameter ! Outputs - character(len=*), intent(out) :: & - errmsg ! Error message - integer, intent(out) :: & - errflg ! Error flag - integer,dimension(:,:),intent(out) :: & - mbota, & ! Vertical indices for cloud tops - mtopa ! Vertical indices for cloud bases + character(len=*), intent(out) :: & + errmsg ! Error message + integer, intent(out) :: & + errflg ! Error flag + integer,dimension(:,:),intent(out) :: & + mbota, & ! Vertical indices for cloud tops + mtopa ! Vertical indices for cloud bases real(kind_phys),dimension(:,:), intent(out) :: & - cldsa ! Fraction of clouds for low, middle, high, total and BL + cldsa ! Fraction of clouds for low, middle, high, total and BL ! Local variables integer i,id,iCol,iLay,icld @@ -111,8 +109,8 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr_rand, iovr_maxrand, iovr_m ! defined by ptopc. The cloud overlapping method is defined by control flag 'iovr', which may ! be different for lw and sw radiation programs. call gethml(p_lay*0.01, ptop1, cld_frac, cldcnv, deltaZ, de_lgth, cloud_overlap_param,& - nCol, nLev, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, & - iovr_exprand, cldsa, mtopa, mbota) + nCol, nLev, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, & + iovr_exprand, top_at_1, si, cldsa, mtopa, mbota) end subroutine GFS_cloud_diagnostics_run !> @} diff --git a/physics/GFS_cloud_diagnostics.meta b/physics/GFS_cloud_diagnostics.meta index dd88bbc46..53d1552e6 100644 --- a/physics/GFS_cloud_diagnostics.meta +++ b/physics/GFS_cloud_diagnostics.meta @@ -1,6 +1,7 @@ [ccpp-table-properties] name = GFS_cloud_diagnostics type = scheme + dependencies = machine.F,radiation_clouds.f ######################################################################## [ccpp-arg-table] @@ -20,6 +21,13 @@ dimensions = () type = integer intent = in +[iovr] + standard_name = flag_for_cloud_overlap_method_for_radiation + long_name = max-random overlap clouds + units = flag + dimensions = () + type = integer + intent = in [iovr_rand] standard_name = flag_for_random_cloud_overlap_method long_name = choice of random cloud overlap method @@ -148,6 +156,21 @@ type = real kind = kind_phys intent = in +[top_at_1] + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation + units = flag + dimensions = () + type = logical + intent = in +[si] + standard_name = sigma_pressure_hybrid_vertical_coordinate + long_name = vertical sigma coordinate for radiation initialization + units = none + dimensions = (vertical_interface_dimension) + type = real + kind = kind_phys + intent = in [mtopa] standard_name = model_layer_number_at_cloud_top long_name = vertical indices for low, middle and high cloud tops diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 796856ad3..42f2bbc15 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -34,7 +34,6 @@ module GFS_phys_time_vary !--- variables needed for calculating 'sncovr' use namelist_soilveg, only: salp_data, snupx use set_soilveg_mod, only: set_soilveg - use physparam, only : iaermdl ! --- needed for Noah MP init use noahmp_tables, only: laim_table,saim_table,sla_table, & @@ -67,7 +66,7 @@ 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, levs, & + me, master, ntoz, 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_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & @@ -86,7 +85,7 @@ subroutine GFS_phys_time_vary_init ( implicit none ! Interface variables - integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs + 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(:) real(kind_phys), intent(in) :: fhour @@ -288,7 +287,7 @@ subroutine GFS_phys_time_vary_init ( !$OMP section !> - Initialize soil vegetation (needed for sncovr calculation further down) - call set_soilveg(me, isot, ivegsrc, nlunit) + call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) !$OMP end sections @@ -712,7 +711,7 @@ subroutine GFS_phys_time_vary_timestep_init ( 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, & + 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,& kice, ialb, isot, ivegsrc, input_nml_file, use_ufo, nst_anl, frac_grid, fhcyc, phour, & lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, & @@ -753,6 +752,7 @@ subroutine GFS_phys_time_vary_timestep_init ( integer, intent(in) :: nthrds, nx, ny, nsst, tile_num, nlunit, lsoil integer, intent(in) :: lsoil_lsm, kice, ialb, isot, ivegsrc character(len=*), intent(in) :: input_nml_file(:) + character(len=*), intent(in) :: fn_nml logical, intent(in) :: use_ufo, nst_anl, frac_grid real(kind_phys), intent(in) :: fhcyc, phour, lakefrac(:), min_seaice, min_lakeice, & xlat_d(:), xlon_d(:), landfrac(:) @@ -893,14 +893,14 @@ subroutine GFS_phys_time_vary_timestep_init ( !> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs if (nscyc > 0) then if (mod(kdt,nscyc) == 1) THEN - call gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, & + call gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml, & input_nml_file, lsoil, lsoil_lsm, kice, idate, ialb, isot, ivegsrc, & use_ufo, nst_anl, fhcyc, phour, landfrac, lakefrac, min_seaice, min_lakeice,& frac_grid, 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, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, & - xlat_d, xlon_d, slmsk, imap, jmap) + xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg) endif endif diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index f37235975..ce8c6c54b 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -44,6 +44,13 @@ dimensions = () type = logical intent = in +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = in [iccn] standard_name = control_for_ice_cloud_condensation_nuclei_forcing long_name = flag for IN and CCN forcing for morrison gettelman microphysics @@ -1285,6 +1292,14 @@ type = real kind = kind_phys intent = inout +[fn_nml] + standard_name = filename_of_namelist + long_name = namelist filename + units = none + dimensions = () + type = character + kind = len=* + intent = in [imap] standard_name = map_of_block_column_number_to_global_i_index long_name = map of local index ix to global index i for this block diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index c70e3232a..74b34e974 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -264,7 +264,7 @@ subroutine GFS_phys_time_vary_init ( endif !> - Initialize soil vegetation (needed for sncovr calculation further down) - call set_soilveg(me, isot, ivegsrc, nlunit) + call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) !> - Call setindxoz() to initialize ozone data if (ntoz > 0) then diff --git a/physics/GFS_rad_time_vary.fv3.F90 b/physics/GFS_rad_time_vary.fv3.F90 index cef530b55..978dc177f 100644 --- a/physics/GFS_rad_time_vary.fv3.F90 +++ b/physics/GFS_rad_time_vary.fv3.F90 @@ -18,10 +18,10 @@ module GFS_rad_time_vary !! subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, & lslwr, lsswr, isubc_lw, isubc_sw, icsdsw, icsdlw, cnx, cny, isc, jsc, & - imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ps_2delt, & - ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, errmsg, errflg) + imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim,& + ps_2delt, ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, & + errmsg, errflg) - use physparam, only: ipsd0, ipsdlim, iaerflg use mersenne_twister, only: random_setseed, random_index, random_stat use machine, only: kind_phys use radcons, only: qmin, con_100 @@ -32,7 +32,7 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, logical, intent(in) :: lrseeds integer, intent(in) :: rseeds(:,:) integer, intent(in) :: isubc_lw, isubc_sw, cnx, cny, isc, jsc, kdt - integer, intent(in) :: imp_physics, imp_physics_zhao_carr + integer, intent(in) :: imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim logical, intent(in) :: lslwr, lsswr integer, intent(inout) :: icsdsw(:), icsdlw(:) integer, intent(in) :: imap(:), jmap(:) diff --git a/physics/GFS_rad_time_vary.fv3.meta b/physics/GFS_rad_time_vary.fv3.meta index f7a154eea..19eb41dc2 100644 --- a/physics/GFS_rad_time_vary.fv3.meta +++ b/physics/GFS_rad_time_vary.fv3.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_rad_time_vary type = scheme - dependencies = machine.F,mersenne_twister.f,physparam.f,radcons.f90 + dependencies = machine.F,mersenne_twister.f,radcons.f90 ######################################################################## [ccpp-arg-table] @@ -134,6 +134,20 @@ dimensions = () type = integer intent = in +[ipsd0] + standard_name = initial_seed_for_mcica + long_name = initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer + intent = in +[ipsdlim] + standard_name = limit_for_initial_seed_for_mcica + long_name = limit for initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer + intent = in [ps_2delt] standard_name = surface_air_pressure_two_timesteps_back long_name = surface air pressure two timesteps back diff --git a/physics/GFS_rad_time_vary.scm.F90 b/physics/GFS_rad_time_vary.scm.F90 index 924312a2a..3f730eaf5 100644 --- a/physics/GFS_rad_time_vary.scm.F90 +++ b/physics/GFS_rad_time_vary.scm.F90 @@ -18,10 +18,10 @@ module GFS_rad_time_vary !! subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, & lslwr, lsswr, isubc_lw, isubc_sw, icsdsw, icsdlw, cnx, cny, isc, jsc, & - imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ps_2delt, & - ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, errmsg, errflg) + imap, jmap, sec, kdt, imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim,& + ps_2delt, ps_1delt, t_2delt, t_1delt, qv_2delt, qv_1delt, t, qv, ps, & + errmsg, errflg) - use physparam, only: ipsd0, ipsdlim, iaerflg use mersenne_twister, only: random_setseed, random_index, random_stat use machine, only: kind_phys use radcons, only: qmin, con_100 @@ -32,7 +32,7 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, logical, intent(in) :: lrseeds integer, intent(in) :: rseeds(:,:) integer, intent(in) :: isubc_lw, isubc_sw, cnx, cny, isc, jsc, kdt - integer, intent(in) :: imp_physics, imp_physics_zhao_carr + integer, intent(in) :: imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim logical, intent(in) :: lslwr, lsswr integer, intent(inout) :: icsdsw(:), icsdlw(:) integer, intent(in) :: imap(:), jmap(:) diff --git a/physics/GFS_rad_time_vary.scm.meta b/physics/GFS_rad_time_vary.scm.meta index f7a154eea..19eb41dc2 100644 --- a/physics/GFS_rad_time_vary.scm.meta +++ b/physics/GFS_rad_time_vary.scm.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_rad_time_vary type = scheme - dependencies = machine.F,mersenne_twister.f,physparam.f,radcons.f90 + dependencies = machine.F,mersenne_twister.f,radcons.f90 ######################################################################## [ccpp-arg-table] @@ -134,6 +134,20 @@ dimensions = () type = integer intent = in +[ipsd0] + standard_name = initial_seed_for_mcica + long_name = initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer + intent = in +[ipsdlim] + standard_name = limit_for_initial_seed_for_mcica + long_name = limit for initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer + intent = in [ps_2delt] standard_name = surface_air_pressure_two_timesteps_back long_name = surface air pressure two timesteps back diff --git a/physics/GFS_radiation_surface.F90 b/physics/GFS_radiation_surface.F90 index 6a23cb264..feae36fbe 100644 --- a/physics/GFS_radiation_surface.F90 +++ b/physics/GFS_radiation_surface.F90 @@ -17,14 +17,15 @@ module GFS_radiation_surface !> \section arg_table_GFS_radiation_surface_init Argument Table !! \htmlinclude GFS_radiation_surface_init.html !! - subroutine GFS_radiation_surface_init (me, ialb, iems, errmsg, errflg) + subroutine GFS_radiation_surface_init (me, ialb, iems, semis_file, con_pi, errmsg, errflg) - use physparam, only: ialbflg, iemsflg use module_radiation_surface, only: sfc_init implicit none integer, intent(in) :: me, ialb, iems + character(len=26), intent(in) :: semis_file + real(kind_phys), intent(in) :: con_pi character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -32,16 +33,13 @@ subroutine GFS_radiation_surface_init (me, ialb, iems, errmsg, errflg) errmsg = '' errflg = 0 - ialbflg= ialb ! surface albedo control flag - iemsflg= iems ! surface emissivity control flag - if ( me == 0 ) then print *,'In GFS_radiation_surface_init, before calling sfc_init' print *,'ialb=',ialb,' iems=',iems end if ! Call surface initialization routine - call sfc_init ( me, errmsg, errflg ) + call sfc_init ( me, ialb, iems, semis_file, con_pi, errmsg, errflg ) end subroutine GFS_radiation_surface_init @@ -50,13 +48,13 @@ end subroutine GFS_radiation_surface_init !! \htmlinclude GFS_radiation_surface_run.html !! subroutine GFS_radiation_surface_run ( & - im, nf_albd, frac_grid, lslwr, lsswr, lsm, lsm_noahmp, lsm_ruc, & - xlat, xlon, slmsk, lndp_type, n_var_lndp, sfc_alb_pert, & + ialb, im, nf_albd, frac_grid, lslwr, lsswr, lsm, lsm_noahmp, & + lsm_ruc, xlat, xlon, slmsk, lndp_type, n_var_lndp, sfc_alb_pert,& lndp_var_list, lndp_prt_list, landfrac, snodl, snodi, sncovr, & sncovr_ice, fice, zorl, hprime, tsfg, tsfa, tisfc, coszen, & cplice, min_seaice, min_lakeice, lakefrac, use_flake, & alvsf, alnsf, alvwf, alnwf, facsf, facwf, & - semis_lnd, semis_ice, semis_wat, snoalb, use_cice_alb, & + semis_lnd, semis_ice, semis_wat, snoalb, use_cice_alb, con_ttp, & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & semisbase, semis, sfcalb, sfc_alb_dif, errmsg, errflg) @@ -67,10 +65,10 @@ subroutine GFS_radiation_surface_run ( & implicit none - integer, intent(in) :: im, nf_albd + integer, intent(in) :: im, nf_albd, ialb logical, intent(in) :: frac_grid, lslwr, lsswr, use_cice_alb, cplice integer, intent(in) :: lsm, lsm_noahmp, lsm_ruc, lndp_type, n_var_lndp - real(kind=kind_phys), intent(in) :: min_seaice, min_lakeice + real(kind=kind_phys), intent(in) :: min_seaice, min_lakeice, con_ttp logical, dimension(:), intent(in) :: use_flake real(kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, slmsk, & @@ -184,7 +182,8 @@ subroutine GFS_radiation_surface_run ( & alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & - im, nf_albd, sfc_alb_pert, lndp_alb, fracl, fraco, fraci, icy, & ! --- inputs + im, nf_albd, sfc_alb_pert, lndp_alb, fracl, fraco, fraci, icy, ialb, & + con_ttp, & ! --- inputs sfcalb ) ! --- outputs !> -# Approximate mean surface albedo from vis- and nir- diffuse values. diff --git a/physics/GFS_radiation_surface.meta b/physics/GFS_radiation_surface.meta index 771cd5f4d..22f2d4f0b 100644 --- a/physics/GFS_radiation_surface.meta +++ b/physics/GFS_radiation_surface.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_radiation_surface type = scheme - dependencies = iounitdef.f,machine.F,physparam.f,radiation_surface.f,set_soilveg_ruc.F90,namelist_soilveg_ruc.F90 + dependencies = iounitdef.f,machine.F,radiation_surface.f,set_soilveg_ruc.F90,namelist_soilveg_ruc.F90 ######################################################################## [ccpp-arg-table] @@ -28,6 +28,22 @@ dimensions = () type = integer intent = in +[semis_file] + standard_name = surface_emissivity_data_file + long_name = surface emissivity data file for radiation + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + 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 @@ -55,6 +71,13 @@ dimensions = () type = integer intent = in +[ialb] + standard_name = control_for_surface_albedo + long_name = flag for using climatology alb, based on sfc type + units = flag + dimensions = () + type = integer + intent = in [nf_albd] standard_name = number_of_components_for_surface_albedo long_name = number of IR/VIS/UV compinents for surface albedo @@ -387,6 +410,14 @@ dimensions = () type = logical intent = in +[con_ttp] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in [albdvis_lnd] standard_name = surface_albedo_direct_visible_over_land long_name = direct surface albedo visible band over land diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index d05f02dae..c8ed0339e 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -17,9 +17,9 @@ module GFS_rrtmg_pre !! \htmlinclude GFS_rrtmg_pre_run.html !! !>\section rrtmg_pre_gen General Algorithm - subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & - n_var_lndp, imfdeepcnv, imfdeepcnv_gf, me, ncnd, ntrac, num_p3d, & - npdf3d, ncnvcld3d, ntqv, ntcw,ntiw, ntlnc, ntinc, ntrnc, ntsnc, ntccn, & + subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& + ltp, imfdeepcnv, imfdeepcnv_gf, me, ncnd, ntrac, num_p3d, npdf3d, & + ncnvcld3d,ntqv, ntcw,ntiw, ntlnc, ntinc, ntrnc, ntsnc, ntccn, top_at_1,& ntrw, ntsw, ntgl, nthl, ntwa, ntoz, & ntclamt, nleffr, nieffr, nseffr, lndp_type, kdt, & ntdu1, ntdu2, ntdu3, ntdu4, ntdu5, ntss1, ntss2, & @@ -27,14 +27,15 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & imp_physics,imp_physics_nssl, nssl_ccn_on, nssl_invertccn, & imp_physics_thompson, imp_physics_gfdl, imp_physics_zhao_carr, & imp_physics_zhao_carr_pdf, imp_physics_mg, imp_physics_wsm6, & - imp_physics_fer_hires, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, & - iovr_exp, iovr_exprand, idcor_con, idcor_hogan, idcor_oreopoulos, & - julian, yearlen, lndp_var_list, lsswr, lslwr, & - ltaerosol, mraerosol, lgfdlmprad, uni_cld, effr_in, do_mynnedmf, lmfshal, & - lmfdeep2, fhswr, fhlwr, solhr, sup, con_eps, epsm1, fvirt, & - rog, rocp, con_rd, xlat_d, xlat, xlon, coslat, sinlat, tsfc, slmsk, & - prsi, prsl, prslk, tgrs, sfc_wts, mg_cld, effrr_in, pert_clds, & - sppt_wts, sppt_amp, cnvw_in, cnvc_in, qgrs, aer_nm, dx, icloud, & !inputs from here and above + imp_physics_fer_hires, iovr, iovr_rand, iovr_maxrand, iovr_max, & + iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, idcor_hogan, & + idcor_oreopoulos, dcorr_con, julian, yearlen, lndp_var_list, lsswr, & + lslwr, ltaerosol, mraerosol, lgfdlmprad, uni_cld, effr_in, do_mynnedmf,& + lmfshal, lcnorm, lmfdeep2, lcrick, fhswr, fhlwr, solhr, sup, con_eps, & + epsm1, fvirt, rog, rocp, con_rd, xlat_d, xlat, xlon, coslat, sinlat, & + tsfc, slmsk, prsi, prsl, prslk, tgrs, sfc_wts, mg_cld, effrr_in, & + pert_clds, sppt_wts, sppt_amp, cnvw_in, cnvc_in, qgrs, aer_nm, dx, & + icloud, iaermdl, iaerflg, con_pi, con_g, con_ttp, con_thgni, si, & !inputs from here and above coszen, coszdg, effrl_inout, effri_inout, effrs_inout, & clouds1, clouds2, clouds3, clouds4, clouds5, qci_conv, & !in/out from here and above kd, kt, kb, mtopa, mbota, raddt, tsfg, tsfa, de_lgth, alb1d, delp, dz, & !output from here and below @@ -44,14 +45,11 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & clouds9, cldsa, cldfra, cldfra2d, lwp_ex,iwp_ex, lwp_fc,iwp_fc, & faersw1, faersw2, faersw3, faerlw1, faerlw2, faerlw3, alpha, & aero_dir_fdb, smoke_ext, dust_ext, & - spp_wts_rad, spp_rad, rrfs_smoke_band, errmsg, errflg) + spp_wts_rad, spp_rad, rrfs_smoke_band, ico2, errmsg, errflg) use machine, only: kind_phys - use physparam - - use radcons, only: itsfc, qmin, & - qme5, qme6, epsq, prsmin + use radcons, only: itsfc, qmin, qme5, qme6, epsq, prsmin use funcphys, only: fpvs use module_radiation_astronomy,only: coszmn ! sol_init, sol_update @@ -82,7 +80,6 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & make_IceNumber, & make_DropletNumber, & make_RainNumber - use physparam, only : iaermdl implicit none integer, intent(in) :: im, levs, lm, lmk, lmp, ltp, & @@ -102,9 +99,10 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & imp_physics_mg, imp_physics_wsm6, & imp_physics_nssl, & imp_physics_fer_hires, & - yearlen, icloud + yearlen, icloud, iaermdl, iaerflg integer, intent(in) :: & + iovr, & ! choice of cloud-overlap method iovr_rand, & ! Flag for random cloud overlap method iovr_maxrand, & ! Flag for maximum-random cloud overlap method iovr_max, & ! Flag for maximum cloud overlap method @@ -112,18 +110,21 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & iovr_exp, & ! Flag for exponential cloud overlap method iovr_exprand, & ! Flag for exponential-random cloud overlap method idcor_con, & + idcor, & idcor_hogan, & idcor_oreopoulos, & - rrfs_smoke_band ! Band number for rrfs-smoke dust and smoke + rrfs_smoke_band, & ! Band number for rrfs-smoke dust and smoke + ico2 ! Flag for co2 source used in radiation integer, intent(in) :: ntdu1, ntdu2, ntdu3, ntdu4, ntdu5, ntss1, ntss2, ntss3, & ntss4, ntss5, ntsu, ntbcb, ntbcl, ntocb, ntocl, ntchm character(len=3), dimension(:), intent(in) :: lndp_var_list - logical, intent(in) :: lextop, lsswr, lslwr, ltaerosol, lgfdlmprad, & + logical, intent(in) :: lsswr, lslwr, ltaerosol, lgfdlmprad, & uni_cld, effr_in, do_mynnedmf, & - lmfshal, lmfdeep2, pert_clds, mraerosol + lmfshal, lmfdeep2, pert_clds, lcrick,& + lcnorm, top_at_1, lextop, mraerosol logical, intent(in) :: aero_dir_fdb real(kind=kind_phys), dimension(:,:), intent(in) :: smoke_ext, dust_ext @@ -131,12 +132,12 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & 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 - real(kind=kind_phys), intent(in) :: con_eps, epsm1, fvirt, rog, rocp, con_rd + 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, & coslat, sinlat, tsfc, & - slmsk, dx + slmsk, dx, si real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, prslk, & tgrs, sfc_wts, & @@ -202,7 +203,6 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & faerlw2,& faerlw3 real(kind=kind_phys), dimension(:,:), intent(out) :: alpha - character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -285,7 +285,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & ! variables if ( lextop ) then - if ( ivflip == 1 ) then ! vertical from sfc upward + if (.not. top_at_1) then ! vertical from sfc upward kd = 0 ! index diff between in/out and local kt = 1 ! index diff between lyr and upper bound kb = 0 ! index diff between lyr and lower bound @@ -301,16 +301,16 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & llb = 1 ! local index at toa level lya = 2 ! local index for the 2nd layer from top lyb = 1 ! local index for the top layer - endif ! end if_ivflip_block + endif ! end if_top_at_1_block else kd = 0 - if ( ivflip == 1 ) then ! vertical from sfc upward + if (.not. top_at_1) then ! vertical from sfc upward kt = 1 ! index diff between lyr and upper bound kb = 0 ! index diff between lyr and lower bound else ! vertical from toa downward kt = 0 ! index diff between lyr and upper bound kb = 1 ! index diff between lyr and lower bound - endif ! end if_ivflip_block + endif ! end if_top_at_1_block endif ! end if_lextop_block raddt = min(fhswr, fhlwr) @@ -337,7 +337,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & ! lsk = 0 - if (ivflip == 0 .and. lm < levs) lsk = levs - lm + if (top_at_1 .and. lm < levs) lsk = levs - lm ! convert pressure unit from pa to mb do k = 1, LM @@ -368,7 +368,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & enddo enddo ! - if (ivflip == 0) then ! input data from toa to sfc + if (top_at_1) then ! input data from toa to sfc if (lsk > 0) then k1 = 1 + kd k2 = k1 + kb @@ -427,8 +427,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & enddo enddo else ! climatological ozone - call getozn (prslk1, xlat, im, lmk, & ! --- inputs - olyr) ! --- outputs + call getozn (prslk1, xlat, im, lmk, top_at_1, & ! --- inputs + olyr) ! --- outputs endif ! end_if_ntoz !> - Call coszmn(), to compute cosine of zenith angle (only when SW is called) @@ -452,8 +452,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & ! --- ... set up non-prognostic gas volume mixing ratioes - call getgases (plvl, xlon, xlat, IM, LMK, & ! --- inputs - gasvmr) ! --- outputs + call getgases (plvl, xlon, xlat, IM, LMK, ico2, top_at_1,& ! --- inputs + con_pi, gasvmr) ! --- outputs !CCPP: re-assign gasvmr(:,:,NF_VGAS) to gasvmr_X(:,:) do k = 1, LMK @@ -479,7 +479,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & enddo enddo - if (ivflip == 0) then ! input data from toa to sfc + if (top_at_1) then ! input data from toa to sfc do i = 1, IM tem1d (i) = QME6 tem2da(i,1) = log( plyr(i,1) ) @@ -609,7 +609,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & dzb(i,1) = hzb(i,1) - hz(i,1) enddo - endif ! end_if_ivflip + endif ! end_if_top_at_1 !check print *,' in grrad : calling setaer ' @@ -642,8 +642,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & !! property profile for radiation. call setaer (plvl, plyr, prslk1, tvly, rhly, slmsk, & ! --- inputs tracer1, aer_nm, xlon, xlat, IM, LMK, LMP,& - lsswr,lslwr, & - faersw,faerlw,aerodp) ! --- outputs + lsswr, lslwr, iaermdl, iaerflg, top_at_1, con_pi, & + con_rd, con_g, faersw, faerlw, aerodp, errflg, errmsg) ! --- outputs ! CCPP do j = 1,NBDSW @@ -961,20 +961,21 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, lextop, ltp, & & ( plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, & ! --- inputs: & ccnd, ncndl, cnvw, cnvc, tracer1, & & xlat, xlon, slmsk, dz, delp, IM, LM, LMK, LMP, & - & deltaq, sup, me, icloud, kdt, & + & deltaq, sup, dcorr_con, me, icloud, kdt, & & ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, ntclamt, & & imp_physics, imp_physics_nssl, 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, iovr_rand, iovr_maxrand, iovr_max, & - & iovr_dcorr, iovr_exp, iovr_exprand, idcor_con, & - & idcor_hogan, idcor_oreopoulos, & + & 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, do_mynnedmf, lgfdlmprad, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & & effrl_inout, effri_inout, effrs_inout, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & - & dzb, xlat_d, julian, yearlen, gridkm, & + & dzb, xlat_d, julian, yearlen, gridkm, top_at_1, si, & + & con_ttp, con_pi, con_g, con_rd, con_thgni, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, & ! --- outputs: & cld_rwp, cld_rerain, cld_swp, cld_resnow, & ! --- outputs: & cldsa, mtopa, mbota, de_lgth, alpha & ! --- outputs: diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta index 63ab11d3e..53f05225b 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,physcons.F90,physparam.f,radcons.f90,radiation_aerosols.f + dependencies = module_mp_thompson_make_number_concentrations.F90,radcons.f90,radiation_aerosols.f dependencies = radiation_astronomy.f,radiation_clouds.f,radiation_gases.f,radlw_param.f,radsw_param.f,surface_perturbation.F90,radiation_cloud_overlap.F90 ######################################################################## @@ -219,6 +219,20 @@ dimensions = () type = integer intent = in +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = in +[iaerflg] + standard_name = control_for_aerosol_effects_in_radiation + long_name = control of aerosol effects in radiation + units = 1 + dimensions = () + type = integer + intent = in [nssl_ccn_on] standard_name = nssl_ccn_on long_name = CCN activation flag in NSSL micro @@ -450,6 +464,13 @@ dimensions = () type = integer intent = in +[iovr] + standard_name = flag_for_cloud_overlap_method_for_radiation + long_name = max-random overlap clouds + units = flag + dimensions = () + type = integer + intent = in [iovr_rand] standard_name = flag_for_random_cloud_overlap_method long_name = choice of random cloud overlap method @@ -492,6 +513,20 @@ dimensions = () type = integer intent = in +[dcorr_con] + standard_name = decorrelation_length_used_by_overlap_method + long_name = decorrelation length (default) used by cloud overlap method (iovr) + units = km + dimensions = () + type = real + intent = in +[idcor] + standard_name = flag_for_decorrelation_length_method + long_name = flag for decorrelation length method used in cloud overlap method (iovr) + units = flag + dimensions = () + type = integer + intent = in [idcor_con] standard_name = flag_for_constant_decorrelation_length_method long_name = choice of decorrelation length computation (costant) @@ -606,6 +641,20 @@ dimensions = () type = logical intent = in +[lcrick] + standard_name = flag_for_CRICK_proof_cloud_water + long_name = flag for CRICK-Proof cloud water + units = flag + dimensions = () + type = logical + intent = in +[lcnorm] + standard_name = flag_for_in_cloud_condensate + long_name = flag for cloud condensate normalized by cloud cover + units = flag + dimensions = () + type = logical + intent = in [fhswr] standard_name = period_of_shortwave_radiation_calls long_name = frequency for shortwave radiation @@ -646,6 +695,46 @@ type = real kind = kind_phys intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[con_rd] + standard_name = gas_constant_of_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_ttp] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in +[con_thgni] + standard_name = temperature_ice_nucleation_starts + long_name = temperature the H.G.Nuc. ice starts + units = K + dimensions = () + type = real + kind = kind_phys + intent = in [epsm1] standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one long_name = (rd/rv) - 1 @@ -678,14 +767,6 @@ type = real kind = kind_phys intent = in -[con_rd] - standard_name = gas_constant_of_dry_air - long_name = ideal gas constant for dry air - units = J kg-1 K-1 - dimensions = () - type = real - kind = kind_phys - intent = in [xlat_d] standard_name = latitude_in_degree long_name = latitude in degree north @@ -1327,6 +1408,28 @@ type = real kind = kind_phys intent = out +[top_at_1] + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation + units = flag + dimensions = () + type = logical + intent = in +[si] + standard_name = sigma_pressure_hybrid_vertical_coordinate + long_name = vertical sigma coordinate for radiation initialization + units = none + dimensions = (vertical_interface_dimension) + type = real + kind = kind_phys + intent = in +[ico2] + standard_name = control_for_co2 + long_name = prescribed global mean value (old opernl) + units = flag + dimensions = () + type = integer + intent = in [aero_dir_fdb] standard_name = do_smoke_aerosol_direct_feedback long_name = flag for smoke and dust radiation feedback diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 86d8fab7b..384d5252d 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -6,12 +6,7 @@ !> @{ module GFS_rrtmg_setup - use physparam, only : isolar , ictmflg, ico2flg, ioznflg, iaerflg, & - & iaermdl, icldflg, & - & iovrRad=>iovr, lcrick , lcnorm , lnoprec, & - & isubcsw, isubclw, ivflip , ipsd0, & - & iswcliq, & - & kind_phys + use machine, only: kind_phys implicit none @@ -27,14 +22,14 @@ module GFS_rrtmg_setup ! & VTAGRAD='NCEP-Radiation_driver v5.1 Nov 2012 ' ! & VTAGRAD='NCEP-Radiation_driver v5.0 Aug 2012 ' - !> new data input control variables (set/reset in subroutines radinit/radupdate): + !> new data input control variables (set/reset in subroutine radupdate): integer :: month0 = 0 integer :: iyear0 = 0 integer :: monthd = 0 !> control flag for the first time of reading climatological ozone data !! (set/reset in subroutines radinit/radupdate, it is used only if the - !! control parameter ioznflg=0) + !! control parameter ntoz=0) logical :: loz1st = .true. contains @@ -42,13 +37,14 @@ module GFS_rrtmg_setup !> \section arg_table_GFS_rrtmg_setup_init Argument Table !! \htmlinclude GFS_rrtmg_setup_init.html !! - subroutine GFS_rrtmg_setup_init ( & - si, levr, ictm, isol, ico2, iaer, ntcw, & - num_p3d, npdf3d, ntoz, iovr, isubc_sw, isubc_lw, & - icliq_sw, crick_proof, ccnorm, & - imp_physics, & - norad_precip, idate, iflip, & - do_RRTMGP, me, ltp, lextop, errmsg, errflg) + subroutine GFS_rrtmg_setup_init ( si, levr, ictm, isol, solar_file, ico2, & + iaer, ntcw, num_p3d, npdf3d, ntoz, iovr, iovr_rand, iovr_maxrand, & + iovr_max, iovr_dcorr, iovr_exp, iovr_exprand, icliq_sw, lcrick, & + lcnorm, imp_physics, lnoprec, idate, iflip, do_RRTMGP, me, lalw1bd, & + 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) ! ================= subprogram documentation block ================ ! ! ! ! subprogram: GFS_rrtmg_setup_init - a subprogram to initialize radiation ! @@ -125,14 +121,14 @@ subroutine GFS_rrtmg_setup_init ( & ! =1: max/ran overlapping clouds ! ! =2: maximum overlap clouds (mcica only) ! ! =3: decorrelation-length overlap (mcica only) ! -! =4: exponential overlap clouds -! isubc_sw/isubc_lw: sub-column cloud approx control flag (sw/lw rad) ! +! =4: exponential overlap clouds ! +! isubcsw/isubclw: sub-column cloud approx control flag (sw/lw rad) ! ! =0: with out sub-column cloud approximation ! ! =1: mcica sub-col approx. prescribed random seed ! ! =2: mcica sub-col approx. provided random seed ! -! crick_proof : control flag for eliminating CRICK ! -! ccnorm : control flag for in-cloud condensate mixing ratio! -! norad_precip : control flag for not using precip in radiation ! +! lcrick : control flag for eliminating CRICK ! +! lcnorm : control flag for in-cloud condensate mixing ratio! +! lnoprec : control flag for not using precip in radiation ! ! idate(4) : ncep absolute date and time of initial condition ! ! (hour, month, day, year) ! ! iflip : control flag for direction of vertical index ! @@ -146,35 +142,31 @@ subroutine GFS_rrtmg_setup_init ( & ! ! ! =================================================================== ! ! + use module_radiation_astronomy, only : sol_init + use module_radiation_aerosols, only : aer_init + use module_radiation_gases, only : gas_init + use module_radiation_clouds, only : cld_init + use rrtmg_lw, only : rlwinit + use rrtmg_sw, only : rswinit implicit none ! interface variables real (kind=kind_phys), intent(in) :: si(:) - integer, intent(in) :: levr - integer, intent(in) :: ictm - integer, intent(in) :: isol - integer, intent(in) :: ico2 - integer, intent(in) :: iaer - integer, intent(in) :: ntcw - integer, intent(in) :: num_p3d - integer, intent(in) :: npdf3d - integer, intent(in) :: ntoz - integer, intent(in) :: iovr - integer, intent(in) :: isubc_sw - integer, intent(in) :: isubc_lw - integer, intent(in) :: icliq_sw - logical, intent(in) :: crick_proof - logical, intent(in) :: ccnorm - integer, intent(in) :: imp_physics - logical, intent(in) :: norad_precip + 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 integer, intent(in) :: idate(:) - integer, intent(in) :: iflip - logical, intent(in) :: do_RRTMGP - integer, intent(in) :: me - integer, intent(in) :: ltp - logical, intent(in) :: lextop + logical, intent(in) :: lcrick, lcnorm, lnoprec, do_RRTMGP, lalw1bd, & + inc_minor_gas, lextop + character(len=26),intent(in) :: aeros_file, solar_file, co2usr_file,& + co2cyc_file + real(kind_phys), intent(in) :: con_pi, con_t0c, con_c, con_boltz, & + con_plnk, con_solr_2008, con_solr_2002, con_g, con_rd + integer, intent(inout) :: ipsd0 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + integer, intent(out) :: iaermdl, iaerflg ! Initialize the CCPP error handling variables errmsg = '' @@ -188,11 +180,6 @@ subroutine GFS_rrtmg_setup_init ( & return end if - isolar = isol ! solar constant control flag - ictmflg= ictm ! data ic time/date control flag - ico2flg= ico2 ! co2 data source control flag - ioznflg= ntoz ! ozone data source control flag - if ( ictm==0 .or. ictm==-2 ) then iaerflg = mod(iaer, 100) ! no volcanic aerosols for clim hindcast else @@ -201,58 +188,50 @@ subroutine GFS_rrtmg_setup_init ( & iaermdl = iaer/1000 ! control flag for aerosol scheme selection if ( iaermdl < 0 .or. (iaermdl>2 .and. iaermdl/=5) ) then print *, ' Error -- IAER flag is incorrect, Abort' - stop 7777 + errflg = 1 + errmsg = 'ERROR(GFS_rrtmg_setup): IAER flag is incorrect' + return endif -! if ( ntcw > 0 ) then - icldflg = 1 ! prognostic cloud optical prop scheme -! else -! icldflg = 0 ! no support for diag cloud opt prop scheme -! endif - - iswcliq = icliq_sw ! optical property for liquid clouds for sw - - ! iovr comes from the model. In the RRTMG implementation this is stored in phyrparam.f, - ! it comes in from the host-model and is set here. - ! In GP, iovr is passed directly into the routines. - iovrRAD = iovr - lcrick = crick_proof ! control flag for eliminating CRICK - lcnorm = ccnorm ! control flag for in-cld condensate - lnoprec = norad_precip ! precip effect on radiation flag (ferrier microphysics) - isubcsw = isubc_sw ! sub-column cloud approx flag in sw radiation - isubclw = isubc_lw ! sub-column cloud approx flag in lw radiation - - ivflip = iflip ! vertical index direction control flag - ! --- assign initial permutation seed for mcica cloud-radiation - if ( isubc_sw>0 .or. isubc_lw>0 ) then + if ( isubcsw>0 .or. isubclw>0 ) then ! ipsd0 = 17*idate(1)+43*idate(2)+37*idate(3)+23*idate(4) + ipsd0 ipsd0 = 17*idate(1)+43*idate(2)+37*idate(3)+23*idate(4) endif if ( me == 0 ) then - print *,' In rad_initialize (GFS_rrtmg_setup_init), before calling radinit' - print *,' si =',si - print *,' levr=',levr,' ictm=',ictm,' isol=',isol,' ico2=',ico2,& - & ' iaermdl=',iaermdl,' iaerflg=',iaerflg - print *,' np3d=',num_p3d,' ntoz=',ntoz, & - & ' iovr=',iovr,' isubc_sw=',isubc_sw, & - & ' isubc_lw=',isubc_lw,' icliq_sw=',icliq_sw, & - & ' iflip=',iflip,' me=',me - print *,' crick_proof=',crick_proof, & - & ' ccnorm=',ccnorm,' norad_precip=',norad_precip + print *,' In rad_initialize (GFS_rrtmg_setup_init), before calling RRTMG initialization' + print *,' si =',si + print *,' levr=',levr,' ictm=',ictm,' isol=',isol,' ico2=',ico2,& + ' iaermdl=',iaermdl,' iaerflg=',iaerflg + print *,' np3d=',num_p3d,' ntoz=',ntoz, & + ' iovr=',iovr,' isubcsw=',isubcsw, & + ' isubclw=',isubclw,' icliq_sw=',icliq_sw, & + ' iflip=',iflip,' me=',me + print *,' lcrick=',lcrick, & + ' lcnorm=',lcnorm,' lnoprec=',lnoprec + print *, 'lextop=',lextop, ' ltp=',ltp endif - call radinit & -! --- inputs: - & ( si, levr, imp_physics, me, ltp, lextop ) -! --- outputs: -! ( none ) + ! Call initialization routines + 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 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, & + iovr_exp, iovr_exprand, errflg, errmsg ) + call rswinit ( me, rad_hr_units, inc_minor_gas, icliq_sw, isubclw, & + iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, & + iovr_exp, iovr_exprand,iswmode, errflg, errmsg ) if ( me == 0 ) then print *,' Radiation sub-cloud initial seed =',ipsd0, & & ' IC-idate =',idate - print *,' return from rad_initialize (GFS_rrtmg_setup_init) - after calling radinit' + print *,' return from rad_initialize (GFS_rrtmg_setup_init) - after calling RRTMG initialization' endif ! is_initialized = .true. @@ -264,9 +243,9 @@ end subroutine GFS_rrtmg_setup_init !> \section arg_table_GFS_rrtmg_setup_timestep_init Argument Table !! \htmlinclude GFS_rrtmg_setup_timestep_init.html !! - subroutine GFS_rrtmg_setup_timestep_init ( & - idate, jdate, deltsw, deltim, lsswr, me, & - slag, sdec, cdec, solcon, errmsg, errflg) + 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) implicit none @@ -275,8 +254,11 @@ subroutine GFS_rrtmg_setup_timestep_init ( & integer, intent(in) :: jdate(:) real(kind=kind_phys), intent(in) :: deltsw real(kind=kind_phys), intent(in) :: deltim + real(kind=kind_phys), intent(in) :: con_pi logical, intent(in) :: lsswr integer, intent(in) :: me + integer, intent(in) :: iaermdl, iaerflg, isol, ictm, ico2, ntoz + 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 real(kind=kind_phys), intent(out) :: cdec @@ -295,8 +277,8 @@ subroutine GFS_rrtmg_setup_timestep_init ( & errmsg = '' errflg = 0 - call radupdate(idate,jdate,deltsw,deltim,lsswr,me, & - slag,sdec,cdec,solcon) + 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) end subroutine GFS_rrtmg_setup_timestep_init @@ -322,229 +304,6 @@ subroutine GFS_rrtmg_setup_finalize (errmsg, errflg) end subroutine GFS_rrtmg_setup_finalize - -! Private functions - -!>Initialization of radiation calculations. - subroutine radinit( si, NLAY, imp_physics, me, ltp, lextop ) -!................................... - -! --- inputs: -! & ( si, NLAY, imp_physics, me ) -! --- outputs: -! ( none ) - -! ================= subprogram documentation block ================ ! -! ! -! subprogram: radinit initialization of radiation calculations ! -! ! -! usage: call radinit ! -! ! -! attributes: ! -! language: fortran 90 ! -! machine: wcoss ! -! ! -! ==================== definition of variables ==================== ! -! ! -! input parameters: ! -! si : model vertical sigma interface ! -! NLAY : number of model vertical layers ! -! imp_physics : MP identifier ! -! me : print control flag ! -! ! -! outputs: (none) ! -! ! -! external module variables: (in module physparam) ! -! isolar : solar constant cntrol flag ! -! = 0: use the old fixed solar constant in "physcon" ! -! =10: use the new fixed solar constant in "physcon" ! -! = 1: use noaa ann-mean tsi tbl abs-scale with cycle apprx! -! = 2: use noaa ann-mean tsi tbl tim-scale with cycle apprx! -! = 3: use cmip5 ann-mean tsi tbl tim-scale with cycl apprx! -! = 4: use cmip5 mon-mean tsi tbl tim-scale with cycl apprx! -! iaerflg : 3-digit aerosol flag (abc for volc, lw, sw) ! -! a:=0 use background stratospheric aerosol ! -! =1 include stratospheric vocanic aeros ! -! b:=0 no topospheric aerosol in lw radiation ! -! =1 compute tropspheric aero in 1 broad band for lw ! -! =2 compute tropspheric aero in multi bands for lw ! -! c:=0 no topospheric aerosol in sw radiation ! -! =1 include tropspheric aerosols for sw ! -! ico2flg : co2 data source control flag ! -! =0: use prescribed global mean co2 (old oper) ! -! =1: use observed co2 annual mean value only ! -! =2: use obs co2 monthly data with 2-d variation ! -! ictmflg : =yyyy#, external data ic time/date control flag ! -! = -2: same as 0, but superimpose seasonal cycle ! -! from climatology data set. ! -! = -1: use user provided external data for the ! -! forecast time, no extrapolation. ! -! = 0: use data at initial cond time, if not ! -! available, use latest, no extrapolation. ! -! = 1: use data at the forecast time, if not ! -! available, use latest and extrapolation. ! -! =yyyy0: use yyyy data for the forecast time, ! -! no further data extrapolation. ! -! =yyyy1: use yyyy data for the fcst. if needed, do ! -! extrapolation to match the fcst time. ! -! ioznflg : ozone data source control flag ! -! =0: use climatological ozone profile ! -! =1: use interactive ozone profile ! -! icldflg : cloud optical property scheme control flag ! -! =0: use diagnostic cloud scheme ! -! =1: use prognostic cloud scheme (default) ! -! imp_physics : cloud microphysics scheme control flag ! -! =99 zhao/carr/sundqvist microphysics scheme ! -! =98 zhao/carr/sundqvist microphysics+pdf cloud&cnvc,cnvw ! -! =11 GFDL cloud microphysics ! -! =8 Thompson microphysics scheme ! -! =6 WSM6 microphysics scheme ! -! =10 MG microphysics scheme ! -! iovr : control flag for cloud overlap in radiation ! -! =0: random overlapping clouds ! -! =1: max/ran overlapping clouds ! -! isubcsw : sub-column cloud approx control flag in sw radiation ! -! isubclw : sub-column cloud approx control flag in lw radiation ! -! =0: with out sub-column cloud approximation ! -! =1: mcica sub-col approx. prescribed random seed ! -! =2: mcica sub-col approx. provided random seed ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! lnoprec : precip effect in radiation flag (ferrier microphysics) ! -! =t: snow/rain has no impact on radiation ! -! =f: snow/rain has impact on radiation ! -! ivflip : vertical index direction control flag ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! ! -! subroutines called: sol_init, aer_init, gas_init, cld_init, ! -! rlwinit, rswinit ! -! ! -! usage: call radinit ! -! ! -! =================================================================== ! -! - - use module_radiation_astronomy, only : sol_init - use module_radiation_aerosols, only : aer_init - use module_radiation_gases, only : gas_init - use module_radiation_clouds, only : cld_init - use rrtmg_lw, only : rlwinit - use rrtmg_sw, only : rswinit - - implicit none - -! --- inputs: - integer, intent(in) :: NLAY, me, imp_physics, ltp - logical, intent(in) :: lextop - - real (kind=kind_phys), intent(in) :: si(:) - -! --- outputs: (none, to module variables) - -! --- locals: - -! -!===> ... begin here -! -!> -# Set up control variables and external module variables in -!! module physparam - loz1st = (ioznflg == 0) ! first-time clim ozone data read flag - month0 = 0 - iyear0 = 0 - monthd = 0 - - if (me == 0) then -! print *,' NEW RADIATION PROGRAM STRUCTURES -- SEP 01 2004' - print *,' NEW RADIATION PROGRAM STRUCTURES BECAME OPER. ', & - & ' May 01 2007' - print *, VTAGRAD !print out version tag - print *,' - Selected Control Flag settings: ICTMflg=',ictmflg, & - & ' ISOLar =',isolar, ' ICO2flg=',ico2flg,' IAERflg=',iaerflg, & - & ' ICLDflg=',icldflg, & - & ' IMP_PHYSICS=',imp_physics,' IOZNflg=',ioznflg - print *,' IVFLIP=',ivflip,' IOVR=',iovrRad, & - & ' ISUBCSW=',isubcsw,' ISUBCLW=',isubclw - print *,' LCRICK=',lcrick,' LCNORM=',lcnorm,' LNOPREC=',lnoprec - print *,' LTP =',ltp,', add extra top layer =',lextop - - if ( ictmflg==0 .or. ictmflg==-2 ) then - print *,' Data usage is limited by initial condition!' - print *,' No volcanic aerosols' - endif - - if ( isubclw == 0 ) then - print *,' - ISUBCLW=',isubclw,' No McICA, use grid ', & - & 'averaged cloud in LW radiation' - elseif ( isubclw == 1 ) then - print *,' - ISUBCLW=',isubclw,' Use McICA with fixed ', & - & 'permutation seeds for LW random number generator' - elseif ( isubclw == 2 ) then - print *,' - ISUBCLW=',isubclw,' Use McICA with random ', & - & 'permutation seeds for LW random number generator' - else - print *,' - ERROR!!! ISUBCLW=',isubclw,' is not a ', & - & 'valid option ' - stop - endif - - if ( isubcsw == 0 ) then - print *,' - ISUBCSW=',isubcsw,' No McICA, use grid ', & - & 'averaged cloud in SW radiation' - elseif ( isubcsw == 1 ) then - print *,' - ISUBCSW=',isubcsw,' Use McICA with fixed ', & - & 'permutation seeds for SW random number generator' - elseif ( isubcsw == 2 ) then - print *,' - ISUBCSW=',isubcsw,' Use McICA with random ', & - & 'permutation seeds for SW random number generator' - else - print *,' - ERROR!!! ISUBCSW=',isubcsw,' is not a ', & - & 'valid option ' - stop - endif - - if ( isubcsw /= isubclw ) then - print *,' - *** Notice *** ISUBCSW /= ISUBCLW !!!', & - & isubcsw, isubclw - endif - endif - -!> -# Initialization -!! - astronomy initialization routine: -!! call module_radiation_astronomy::sol_init() -!! - aerosols initialization routine: -!! call module_radiation_aerosols::aer_init() -!! - CO2 and other gases intialization routine: -!! call module_radiation_gases::gas_init() -!! - cloud initialization routine: -!! call module_radiation_clouds::cld_init() -!! - LW radiation initialization routine: -!! call module_radlw_main::rlwinit() -!! - SW radiation initialization routine: -!! call module_radsw_main::rswinit() -! Initialization - - call sol_init ( me ) ! --- ... astronomy initialization routine - - call aer_init ( NLAY, me ) ! --- ... aerosols initialization routine - - call gas_init ( me ) ! --- ... co2 and other gases initialization routine - - call cld_init ( si, NLAY, imp_physics, me) ! --- ... cloud initialization routine - - call rlwinit ( me ) ! --- ... lw radiation initialization routine - - call rswinit ( me ) ! --- ... sw radiation initialization routine -! - return -! - end subroutine radinit - !----------------------------------- - !> This subroutine checks and updates time sensitive data used by !! radiation computations. This subroutine needs to be placed inside !! the time advancement loop but outside of the horizontal grid loop. @@ -565,8 +324,9 @@ end subroutine radinit !! \param solcon solar constant adjusted by sun-earth distance \f$(W/m^2)\f$ !> \section gen_radupdate General Algorithm !----------------------------------- - subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & - & slag,sdec,cdec,solcon) + 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) !................................... ! ================= subprogram documentation block ================ ! @@ -598,31 +358,6 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & ! sdec, cdec : sin and cos of the solar declination angle ! ! solcon : sun-earth distance adjusted solar constant (w/m2) ! ! ! -! external module variables: ! -! isolar : solar constant cntrl (in module physparam) ! -! = 0: use the old fixed solar constant in "physcon" ! -! =10: use the new fixed solar constant in "physcon" ! -! = 1: use noaa ann-mean tsi tbl abs-scale with cycle apprx! -! = 2: use noaa ann-mean tsi tbl tim-scale with cycle apprx! -! = 3: use cmip5 ann-mean tsi tbl tim-scale with cycl apprx! -! = 4: use cmip5 mon-mean tsi tbl tim-scale with cycl apprx! -! ictmflg : =yyyy#, external data ic time/date control flag ! -! = -2: same as 0, but superimpose seasonal cycle ! -! from climatology data set. ! -! = -1: use user provided external data for the ! -! forecast time, no extrapolation. ! -! = 0: use data at initial cond time, if not ! -! available, use latest, no extrapolation. ! -! = 1: use data at the forecast time, if not ! -! available, use latest and extrapolation. ! -! =yyyy0: use yyyy data for the forecast time, ! -! no further data extrapolation. ! -! =yyyy1: use yyyy data for the fcst. if needed, do ! -! extrapolation to match the fcst time. ! -! ! -! module variables: ! -! loz1st : first-time clim ozone data read flag ! -! ! ! subroutines called: sol_update, aer_update, gas_update ! ! ! ! =================================================================== ! @@ -634,13 +369,16 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & implicit none ! --- inputs: - integer, intent(in) :: idate(:), jdate(:), me + integer, intent(in) :: idate(:), jdate(:), me, iaermdl, iaerflg, isol, ictm, ntoz, ico2 logical, intent(in) :: lsswr + character(len=26),intent(in) :: aeros_file,co2dat_file,co2gbl_file - real (kind=kind_phys), intent(in) :: deltsw, deltim + real (kind=kind_phys), intent(in) :: deltsw, deltim, con_pi ! --- outputs: real (kind=kind_phys), intent(out) :: slag, sdec, cdec, solcon + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! --- locals: integer :: iyear, imon, iday, ihour @@ -652,6 +390,11 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & ! !===> ... begin here ! + + ! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + !> -# Set up time stamp at fcst time and that for green house gases !! (currently co2 only) ! --- ... time stamp at fcst time @@ -663,7 +406,7 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & ! --- ... set up time stamp used for green house gases (** currently co2 only) - if ( ictmflg==0 .or. ictmflg==-2 ) then ! get external data at initial condition time + if ( ictm==0 .or. ictm==-2 ) then ! get external data at initial condition time kyear = idate(1) kmon = idate(2) kday = idate(3) @@ -673,7 +416,7 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & kmon = imon kday = iday khour = ihour - endif ! end if_ictmflg_block + endif ! end if_ictm_block if ( month0 /= imon ) then lmon_chg = .true. @@ -686,12 +429,12 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & !! time interpolation. if (lsswr) then - if ( isolar == 0 .or. isolar == 10 ) then + if ( isol == 0 .or. isol == 10 ) then lsol_chg = .false. elseif ( iyear0 /= iyear ) then lsol_chg = .true. else - lsol_chg = ( isolar==4 .and. lmon_chg ) + lsol_chg = ( isol==4 .and. lmon_chg ) endif iyear0 = iyear @@ -699,7 +442,7 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & ! --- inputs: & ( jdate,kyear,deltsw,deltim,lsol_chg, me, & ! --- outputs: - & slag,sdec,cdec,solcon & + & slag,sdec,cdec,solcon,con_pi,errmsg,errflg & & ) endif ! end_if_lsswr_block @@ -707,7 +450,7 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & !> -# Call module_radiation_aerosols::aer_update(), monthly update, no !! time interpolation if ( lmon_chg ) then - call aer_update ( iyear, imon, me ) + call aer_update ( iyear, imon, me, iaermdl, aeros_file, errflg, errmsg ) endif !> -# Call co2 and other gases update routine: @@ -719,7 +462,8 @@ subroutine radupdate( idate,jdate,deltsw,deltim,lsswr, me, & lco2_chg = .false. endif - call gas_update ( kyear,kmon,kday,khour,loz1st,lco2_chg, me ) + call gas_update ( kyear,kmon,kday,khour,loz1st,lco2_chg, me, co2dat_file, & + co2gbl_file, ictm, ico2, ntoz, errflg, errmsg ) if ( loz1st ) loz1st = .false. diff --git a/physics/GFS_rrtmg_setup.meta b/physics/GFS_rrtmg_setup.meta index 599f974f4..adf6d8750 100644 --- a/physics/GFS_rrtmg_setup.meta +++ b/physics/GFS_rrtmg_setup.meta @@ -1,8 +1,8 @@ [ccpp-table-properties] name = GFS_rrtmg_setup type = scheme - dependencies = iounitdef.f,module_bfmicrophysics.f,physparam.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 + 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 ######################################################################## [ccpp-arg-table] @@ -37,6 +37,30 @@ dimensions = () type = integer intent = in +[solar_file] + standard_name = solar_constant_file + long_name = external solar constant data table file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[con_solr_2008] + standard_name = solar_constant_2008 + long_name = solar constant Tim 2008 + units = W m-2 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_solr_2002] + standard_name = solar_constant_2002 + long_name= solar constant Liu 2002 + units = W m-2 + dimensions = () + type = real + kind = kind_phys + intent = in [ico2] standard_name = control_for_co2 long_name = prescribed global mean value (old opernl) @@ -86,20 +110,69 @@ dimensions = () type = integer intent = in -[isubc_sw] +[iovr_exp] + standard_name = flag_for_exponential_cloud_overlap_method + long_name = choice of exponential cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_exprand] + standard_name = flag_for_exponential_random_cloud_overlap_method + long_name = choice of exponential-random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_max] + standard_name = flag_for_maximum_cloud_overlap_method + long_name = choice of maximum cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_rand] + standard_name = flag_for_random_cloud_overlap_method + long_name = choice of random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_maxrand] + standard_name = flag_for_maximum_random_cloud_overlap_method + long_name = choice of maximum-random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_dcorr] + standard_name = flag_for_decorrelation_length_cloud_overlap_method + long_name = choice of decorrelation-length cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[isubcsw] standard_name = flag_for_sw_clouds_grid_approximation long_name = flag for sw clouds sub-grid approximation units = flag dimensions = () type = integer intent = in -[isubc_lw] +[isubclw] standard_name = flag_for_lw_clouds_sub_grid_approximation long_name = flag for lw clouds sub-grid approximation units = flag dimensions = () type = integer intent = in +[iswmode] + standard_name = control_for_sw_scattering_choice + long_name = control of rrtmg shortwave scattering choice + units = 1 + dimensions = () + type = integer + intent = in [icliq_sw] standard_name = control_for_shortwave_radiation_liquid_clouds long_name = sw optical property for liquid clouds @@ -107,14 +180,14 @@ dimensions = () type = integer intent = in -[crick_proof] +[lcrick] standard_name = flag_for_CRICK_proof_cloud_water long_name = flag for CRICK-Proof cloud water units = flag dimensions = () type = logical intent = in -[ccnorm] +[lcnorm] standard_name = flag_for_in_cloud_condensate long_name = flag for cloud condensate normalized by cloud cover units = flag @@ -128,7 +201,7 @@ dimensions = () type = integer intent = in -[norad_precip] +[lnoprec] standard_name = flag_for_turning_off_precipitation_radiative_effect long_name = radiation precip flag for Ferrier/Moorthi units = flag @@ -163,6 +236,114 @@ dimensions = () type = integer intent = in +[aeros_file] + standard_name = aerosol_data_file + long_name = aerosol data file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2usr_file] + standard_name = co2_user_data_table_file + long_name = co2 user defined data table file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2cyc_file] + standard_name = co2_clim_monthly_cycle_data_table_file + long_name = co2 climotological monthly cycle data table file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[rad_hr_units] + standard_name = control_for_radiation_heating_rate_units + long_name = control of heating rate units + units = 1 + dimensions = () + type = integer + intent = in +[inc_minor_gas] + standard_name = flag_to_include_minor_gases_in_rrtmg + long_name = flag to include minor trace gases in rrtmg + units = flag + dimensions = () + type = logical + intent = in +[icliq_lw] + standard_name = flag_for_optical_property_for_liquid_clouds_for_longwave_radiation + long_name = lw optical property for liquid clouds + units = flag + dimensions = () + type = integer + intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[con_c] + standard_name = speed_of_light_in_vacuum + long_name = speed of light in vacuum + units = m s-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_plnk] + standard_name = planck_constant + long_name = Planck constant + units = J s-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_boltz] + standard_name = boltzmann_constant + long_name = Boltzmann constant + units = J K-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degree Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in +[con_rd] + standard_name = gas_constant_of_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in +[lalw1bd] + standard_name = do_longwave_aerosol_band_properties + long_name = control of band or multiband longwave aerosol properties + units = 1 + dimensions = () + type = logical + intent = in [ltp] standard_name = extra_top_layer long_name = extra top layer for radiation @@ -177,6 +358,27 @@ dimensions = () type = logical intent = in +[ipsd0] + standard_name = initial_seed_for_mcica + long_name = initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer + intent = inout +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = out +[iaerflg] + standard_name = control_for_aerosol_effects_in_radiation + long_name = control of aerosol effects in radiation + units = 1 + dimensions = () + type = integer + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -241,6 +443,80 @@ dimensions = () type = integer intent = in +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = in +[iaerflg] + standard_name = control_for_aerosol_effects_in_radiation + long_name = control of aerosol effects in radiation + units = 1 + dimensions = () + type = integer + intent = in +[isol] + standard_name = control_for_solar_constant + long_name = use prescribed solar constant + units = flag + dimensions = () + type = integer + intent = in +[aeros_file] + standard_name = aerosol_data_file + long_name = aerosol data file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2dat_file] + standard_name = co2_monthly_obs_data_table_file + long_name = co2 monthly observation data table + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2gbl_file] + standard_name = co2_global_annual_mean_data_table_file + long_name = co2 global annual mean data file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[ictm] + standard_name = flag_for_initial_time_date_control + long_name = flag for initial conditions and forcing + units = flag + dimensions = () + type = integer + intent = in +[ico2] + standard_name = control_for_co2 + long_name = prescribed global mean value (old opernl) + units = flag + 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 +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [slag] standard_name = equation_of_time long_name = equation of time (radian) diff --git a/physics/GFS_rrtmgp_cloud_overlap.F90 b/physics/GFS_rrtmgp_cloud_overlap.F90 index b294b4a99..0094f8165 100644 --- a/physics/GFS_rrtmgp_cloud_overlap.F90 +++ b/physics/GFS_rrtmgp_cloud_overlap.F90 @@ -100,6 +100,7 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, ! ! Cloud decorrelation length ! + de_lgth(:) = 0. if (idcor == idcor_hogan) then call cmp_dcorr_lgth(nCol, lat, con_pi, de_lgth) endif @@ -116,7 +117,6 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, if (iovr == iovr_dcorr .or. iovr == iovr_exp .or. iovr == iovr_exprand) then call get_alpha_exper(nCol, nLev, iovr, iovr_exprand, deltaZc*0.001, de_lgth, cld_frac, cloud_overlap_param) else - de_lgth(:) = 0. cloud_overlap_param(:,:) = 0. endif @@ -127,7 +127,6 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, if (iovr_convcld == iovr_dcorr .or. iovr_convcld == iovr_exp .or. iovr_convcld == iovr_exprand) then call get_alpha_exper(nCol, nLev, iovr_convcld, iovr_exprand, deltaZc*0.001, de_lgth, cld_cnv_frac, cnv_cloud_overlap_param) else - de_lgth(:) = 0. cnv_cloud_overlap_param(:,:) = 0. endif endif diff --git a/physics/GFS_rrtmgp_cloud_overlap.meta b/physics/GFS_rrtmgp_cloud_overlap.meta index f7d12bed5..cf6a05217 100644 --- a/physics/GFS_rrtmgp_cloud_overlap.meta +++ b/physics/GFS_rrtmgp_cloud_overlap.meta @@ -210,8 +210,8 @@ kind = kind_phys intent = in [top_at_1] - standard_name = flag_for_vertical_ordering_in_RRTMGP - long_name = flag for vertical ordering in RRTMGP + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation units = flag dimensions = () type = logical diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index 8e115b774..02cc506fd 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -5,18 +5,14 @@ !! \brief This module contains code to prepare model fields for use by the RRTMGP !! radiation scheme. module GFS_rrtmgp_pre - use machine, only: & - kind_phys !< Working type - use funcphys, only: & - fpvs !< Function ot compute sat. vapor pressure over liq. - use module_radiation_astronomy, only: & - coszmn - use module_radiation_gases, only: & - NF_VGAS, & !< Number of active gas species - getgases, & !< Routine to setup trace gases - getozn !< Routine to setup ozone - use radiation_tools, only: check_error_msg,cmp_tlev - use rrtmgp_lw_gas_optics, only: lw_gas_props + 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 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 + implicit none real(kind_phys), parameter :: & @@ -121,13 +117,15 @@ 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, errmsg, errflg) + sfc_emiss_byband, ico2, con_pi, errmsg, errflg) ! Inputs integer, intent(in) :: & me, & ! MPI rank nCol, & ! Number of horizontal grid points nLev, & ! Number of vertical layers + nTracers, & ! Number of tracers from model. + ico2, & ! Flag for co2 radiation scheme i_o3 ! Index into tracer array for ozone logical, intent(in) :: & doSWrad, & ! Call SW radiation? @@ -142,6 +140,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl con_epsm1, & ! Physical constant: Epsilon (Rd/Rv) minus one con_fvirt, & ! Physical constant: Inverse of epsilon minus one con_epsqs, & ! Physical constant: Minimum saturation mixing-ratio (kg/kg) + con_pi, & ! Physical constant: Pi solhr ! Time in hours after 00z at the current timestep real(kind_phys), dimension(:), intent(in) :: & xlon, & ! Longitude @@ -208,7 +207,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - + nday = 0 idxday = 0 if (.not. (doSWrad .or. doLWrad)) return @@ -352,14 +351,14 @@ 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, o3_lay) + call getozn (prslk(1:NCOL,:), xlat, nCol, nLev, top_at_1, o3_lay) endif ! ####################################################################################### ! Set gas concentrations for RRTMGP ! ####################################################################################### ! Call getgases(), to set up non-prognostic gas volume mixing ratios (gas_vmr). - call getgases (p_lev/100., xlon, xlat, nCol, nLev, gas_vmr) + call getgases (p_lev/100., xlon, xlat, nCol, nLev, ico2, top_at_1, con_pi, gas_vmr) vmr_o2 = gas_vmr(:,:,4) vmr_ch4 = gas_vmr(:,:,3) vmr_n2o = gas_vmr(:,:,2) @@ -377,6 +376,9 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl ! ####################################################################################### ! Setup surface ground temperature and ground/air skin temperature if required. ! ####################################################################################### + iSFC_ilev = 1 + if (top_at_1) iSFC_ilev = iSFC + 1 + tsfg(1:NCOL) = t_lev(1:NCOL,iSFC_ilev) tsfa(1:NCOL) = t_lay(1:NCOL,iSFC) diff --git a/physics/GFS_rrtmgp_pre.meta b/physics/GFS_rrtmgp_pre.meta index 455010e58..abb07b825 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_clouds.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 ######################################################################## [ccpp-arg-table] @@ -245,6 +245,21 @@ type = real kind = kind_phys intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[ico2] + standard_name = control_for_co2 + long_name = prescribed global mean value (old opernl) + units = flag + dimensions = () + type = integer + intent = in [raddt] standard_name = time_step_for_radiation long_name = radiation time step @@ -310,8 +325,8 @@ kind = kind_phys intent = inout [top_at_1] - standard_name = flag_for_vertical_ordering_in_RRTMGP - long_name = flag for vertical ordering in RRTMGP + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation units = flag dimensions = () type = logical diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index f028acca2..76db14279 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -6,15 +6,12 @@ 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 GFS_cloud_diagnostics, only : hml_cloud_diagnostics_initialize - ! *NOTE* These parameters below are required radiation_****** modules. They are not - ! directly used by the RRTMGP routines. - use physparam, only : isolar, ictmflg, ico2flg, ioznflg, iaerflg, & - iaermdl, ivflip implicit none public GFS_rrtmgp_setup_init, GFS_rrtmgp_setup_timestep_init, GFS_rrtmgp_setup_finalize - + + private + ! Version tag and last revision date character(40), parameter :: & VTAGRAD='NCEP-RRTMGP_driver v1.0 Sep 2019 ' @@ -28,7 +25,7 @@ module GFS_rrtmgp_setup is_initialized = .false. ! Control flag for the first time of reading climatological ozone data ! (set/reset in subroutines GFS_rrtmgp_setup_init/GFS_rrtmgp_setup_timestep_init, it is used only if - ! the control parameter ioznflg=0) + ! the control parameter ntoz=0) logical :: loz1st = .true. contains @@ -40,8 +37,9 @@ 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, num_p3d, ntoz, iovr, isubc_sw, isubc_lw, icliq_sw, crick_proof, ccnorm, & - norad_precip, idate, iflip, me, errmsg, errflg) + 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) ! Inputs logical, intent(in) :: do_RRTMGP @@ -54,19 +52,24 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, imp_physics_zhao_carr, & ! Flag for zhao-carr scheme imp_physics_zhao_carr_pdf, & ! Flag for zhao-carr+PDF scheme imp_physics_mg ! Flag for MG scheme + real(kind_phys), intent(in) :: & + 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, num_p3d, ntoz, iovr, isubc_sw, isubc_lw, & - icliq_sw, iflip, me + ntcw, ntoz, iovr, isubc_sw, isubc_lw, & + me logical, intent(in) :: & - crick_proof, ccnorm, norad_precip + lalw1bd integer, intent(in), dimension(:) :: & idate + character(len=26),intent(in) :: aeros_file, solar_file, co2usr_file, co2cyc_file ! Outputs - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + integer, intent(inout) :: ipsd0 + integer, intent(out) :: iaermdl, iaerflg ! Initialize the CCPP error handling variables errmsg = '' @@ -82,12 +85,6 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, end if ! Set radiation parameters - isolar = isol ! solar constant control flag - ictmflg = ictm ! data ic time/date control flag - ico2flg = ico2 ! co2 data source control flag - ioznflg = ntoz ! ozone data source control flag - ivflip = iflip ! vertical index direction control flag - if ( ictm==0 .or. ictm==-2 ) then iaerflg = mod(iaer, 100) ! no volcanic aerosols for clim hindcast else @@ -99,6 +96,11 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, errflg = 1 return endif + + ! Assign initial permutation seed for mcica cloud-radiation + if ( isubc_sw>0 .or. isubc_lw>0 ) then + ipsd0 = 17*idate(1)+43*idate(2)+37*idate(3)+23*idate(4) + endif if ( me == 0 ) then print *,' In rad_initialize (GFS_rrtmgp_setup_init), before calling radinit' @@ -107,39 +109,27 @@ subroutine GFS_rrtmgp_setup_init(do_RRTMGP, imp_physics, imp_physics_fer_hires, ' ictm = ',ictm, & ' isol = ',isol, & ' ico2 = ',ico2, & - ' iaer = ',iaer, & - ' ntcw = ',ntcw - print *,' np3d = ',num_p3d, & + ' iaermdl = ',iaermdl, & + ' iaerflg = ',iaerflg, & + ' ntcw = ',ntcw, & ' ntoz = ',ntoz, & ' iovr = ',iovr, & ' isubc_sw = ',isubc_sw, & ' isubc_lw = ',isubc_lw, & - ' icliq_sw = ',icliq_sw, & - ' iflip = ',iflip, & + ' ipsd0 = ',ipsd0, & ' me = ',me endif - - loz1st = (ioznflg == 0) ! first-time clim ozone data read flag + + loz1st = (ntoz == 0) ! first-time clim ozone data read flag month0 = 0 iyear0 = 0 monthd = 0 -!> -# Initialization -!! - astronomy initialization routine: -!! call module_radiation_astronomy::sol_init() -!! - aerosols initialization routine: -!! call module_radiation_aerosols::aer_init() -!! - CO2 and other gases intialization routine: -!! call module_radiation_gases::gas_init() - ! Call initialization routines.. - call sol_init ( me ) - call aer_init ( levr, me ) - call gas_init ( me ) - !call hml_cloud_diagnostics_initialize(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, levr, me, si,& - ! errflg) + 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 ) if ( me == 0 ) then print *,' return from rad_initialize (GFS_rrtmgp_setup_init) - after calling radinit' @@ -156,8 +146,9 @@ end subroutine GFS_rrtmgp_setup_init !> \section arg_table_GFS_rrtmgp_setup_timestep_init !! \htmlinclude GFS_rrtmgp_setup_timestep_init.html !! - subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad, me, & - slag, sdec, cdec, solcon, errmsg, errflg) + 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) ! Inputs integer, intent(in) :: idate(:) @@ -165,7 +156,10 @@ subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad real(kind_phys), intent(in) :: deltsw real(kind_phys), intent(in) :: deltim logical, intent(in) :: doSWrad + real(kind_phys), intent(in) :: con_pi integer, intent(in) :: me + integer, intent(in) :: iaermdl,isol,ictm,ico2,ntoz + character(len=26), intent(in) :: aeros_file,co2dat_file,co2gbl_file ! Outputs real(kind_phys), intent(out) :: slag @@ -201,7 +195,7 @@ subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad ! Set up time stamp used for green house gases (** currently co2 only) ! get external data at initial condition time - if ( ictmflg==0 .or. ictmflg==-2 ) then + if ( ictm==0 .or. ictm==-2 ) then kyear = idate(1) kmon = idate(2) kday = idate(3) @@ -223,20 +217,20 @@ subroutine GFS_rrtmgp_setup_timestep_init (idate, jdate, deltsw, deltim, doSWrad ! Update solar forcing... if (doSWrad) then - if ( isolar == 0 .or. isolar == 10 ) then + if ( isol == 0 .or. isol == 10 ) then lsol_chg = .false. elseif ( iyear0 /= iyear ) then lsol_chg = .true. else - lsol_chg = ( isolar==4 .and. lmon_chg ) + lsol_chg = ( isol==4 .and. lmon_chg ) endif iyear0 = iyear - call sol_update(jdate, kyear, deltsw, deltim, lsol_chg, me, slag, sdec, cdec, solcon) + call sol_update(jdate, kyear, deltsw, deltim, lsol_chg, me, slag, sdec, cdec, solcon, con_pi, errmsg, errflg) endif ! Update aerosols... if ( lmon_chg ) then - call aer_update ( iyear, imon, me ) + call aer_update ( iyear, imon, me, iaermdl, aeros_file, errflg, errmsg) endif ! Update trace gases (co2 only)... @@ -246,7 +240,8 @@ 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 ) + call gas_update (kyear, kmon, kday, khour, loz1st, lco2_chg, me, co2dat_file, & + co2gbl_file, ictm, ico2, ntoz, errflg, errmsg ) if ( loz1st ) loz1st = .false. diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/GFS_rrtmgp_setup.meta index 160430765..c4f7cfaa5 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/GFS_rrtmgp_setup.meta @@ -1,8 +1,8 @@ [ccpp-table-properties] name = GFS_rrtmgp_setup type = scheme - dependencies = iounitdef.f,machine.F,module_bfmicrophysics.f,physparam.f,radiation_aerosols.f,radiation_astronomy.f - dependencies = module_mp_thompson.F90,radiation_clouds.f,radiation_gases.f + dependencies = iounitdef.f,machine.F,module_bfmicrophysics.f,radiation_aerosols.f,radiation_astronomy.f + dependencies = module_mp_thompson.F90,radiation_gases.f ######################################################################## [ccpp-arg-table] @@ -101,6 +101,30 @@ dimensions = () type = integer intent = in +[solar_file] + standard_name = solar_constant_file + long_name = external solar constant data table file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[con_solr_2008] + standard_name = solar_constant_2008 + long_name = solar constant Tim 2008 + units = W m-2 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_solr_2002] + standard_name = solar_constant_2002 + long_name= solar constant Liu 2002 + units = W m-2 + dimensions = () + type = real + kind = kind_phys + intent = in [ico2] standard_name = control_for_co2 long_name = prescribed global mean value (old opernl) @@ -122,13 +146,6 @@ dimensions = () type = integer intent = in -[num_p3d] - standard_name = number_of_microphysics_variables_in_xyz_dimensioned_restart_array - long_name = number of 3D arrays needed for microphysics - units = count - 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 @@ -157,31 +174,10 @@ dimensions = () type = integer intent = in -[icliq_sw] - standard_name = control_for_shortwave_radiation_liquid_clouds - long_name = sw optical property for liquid clouds - units = flag - dimensions = () - type = integer - intent = in -[crick_proof] - standard_name = flag_for_CRICK_proof_cloud_water - long_name = flag for CRICK-Proof cloud water - units = flag - dimensions = () - type = logical - intent = in -[ccnorm] - standard_name = flag_for_in_cloud_condensate - long_name = flag for cloud condensate normalized by cloud cover - units = flag - dimensions = () - type = logical - intent = in -[norad_precip] - standard_name = flag_for_turning_off_precipitation_radiative_effect - long_name = radiation precip flag for Ferrier/Moorthi - units = flag +[lalw1bd] + standard_name = do_longwave_aerosol_band_properties + long_name = control of band or multiband longwave aerosol properties + units = 1 dimensions = () type = logical intent = in @@ -192,13 +188,6 @@ dimensions = (4) type = integer intent = in -[iflip] - standard_name = control_for_vertical_index_direction - long_name = flag for vertical index direction control - units = flag - dimensions = () - type = integer - intent = in [me] standard_name = mpi_rank long_name = current MPI-rank @@ -206,6 +195,91 @@ dimensions = () type = integer intent = in +[aeros_file] + standard_name = aerosol_data_file + long_name = aerosol data file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[con_c] + standard_name = speed_of_light_in_vacuum + long_name = speed of light in vacuum + units = m s-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_plnk] + standard_name = planck_constant + long_name = Planck constant + units = J s-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_boltz] + standard_name = boltzmann_constant + long_name = Boltzmann constant + units = J K-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degree Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in +[co2usr_file] + standard_name = co2_user_data_table_file + long_name = co2 user defined data table file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2cyc_file] + standard_name = co2_clim_monthly_cycle_data_table_file + long_name = co2 climotological monthly cycle data table file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[ipsd0] + standard_name = initial_seed_for_mcica + long_name = initial permutaion seed for mcica radiation + units = 1 + dimensions = () + type = integer + intent = inout +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = out +[iaerflg] + standard_name = control_for_aerosol_effects_in_radiation + long_name = control of aerosol effects in radiation + units = 1 + dimensions = () + type = integer + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -270,6 +344,73 @@ dimensions = () type = integer intent = in +[aeros_file] + standard_name = aerosol_data_file + long_name = aerosol data file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2dat_file] + standard_name = co2_monthly_obs_data_table_file + long_name = co2 monthly observation data table + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[co2gbl_file] + standard_name = co2_global_annual_mean_data_table_file + long_name = co2 global annual mean data file + units = none + dimensions = () + type = character + kind = len=26 + intent = in +[ictm] + standard_name = flag_for_initial_time_date_control + long_name = flag for initial conditions and forcing + units = flag + dimensions = () + type = integer + intent = in +[ico2] + standard_name = control_for_co2 + long_name = prescribed global mean value (old opernl) + units = flag + 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 +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = in +[isol] + standard_name = control_for_solar_constant + long_name = use prescribed solar constant + units = flag + dimensions = () + type = integer + intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [slag] standard_name = equation_of_time long_name = equation of time (radian) diff --git a/physics/GFS_surface_composites_pre.F90 b/physics/GFS_surface_composites_pre.F90 index 734f1965b..a8b0a3112 100644 --- a/physics/GFS_surface_composites_pre.F90 +++ b/physics/GFS_surface_composites_pre.F90 @@ -4,7 +4,6 @@ module GFS_surface_composites_pre use machine, only: kind_phys - use physparam, only : iemsflg implicit none diff --git a/physics/GFS_surface_composites_pre.meta b/physics/GFS_surface_composites_pre.meta index e87af3e28..a0e30055f 100644 --- a/physics/GFS_surface_composites_pre.meta +++ b/physics/GFS_surface_composites_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_surface_composites_pre type = scheme - dependencies = machine.F,physparam.f + dependencies = machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cires_ugwpv1_oro.F90 b/physics/cires_ugwpv1_oro.F90 index b0af0f2a1..423a21348 100644 --- a/physics/cires_ugwpv1_oro.F90 +++ b/physics/cires_ugwpv1_oro.F90 @@ -1002,7 +1002,9 @@ subroutine orogw_v1 (im, km, imx, me, master, dtp, kdt, do_tofd, & ! enddo print * - stop + errflg = 1 + errmsg = 'ERROR(orogw_v1): ' + return endif endif diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index ed1571622..4c65a91ce 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -9,6 +9,12 @@ module drag_suite !> \defgroup gfs_drag_suite_mod GSL drag_suite Module !> This module contains the CCPP-compliant GSL orographic gravity wave drag scheme. !> @{ +!! +!> \brief This subroutine initializes the orographic gravity wave drag scheme. +!! +!> \section arg_table_drag_suite_init Argument Table +!! \htmlinclude drag_suite_init.html +!! subroutine drag_suite_init(gwd_opt, errmsg, errflg) integer, intent(in) :: gwd_opt diff --git a/physics/gcycle.F90 b/physics/gcycle.F90 index 5f4f959c6..16e446b27 100644 --- a/physics/gcycle.F90 +++ b/physics/gcycle.F90 @@ -15,14 +15,14 @@ module gcycle_mod !>\ingroup mod_GFS_phys_time_vary !! This subroutine repopulates specific time-varying surface properties for !! atmospheric forecast runs. - subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, & + subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml, & input_nml_file, lsoil, lsoil_lsm, kice, idate, ialb, isot, ivegsrc, & use_ufo, nst_anl, fhcyc, phour, landfrac, lakefrac, min_seaice, min_lakeice, & frac_grid, 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, shdmin, shdmax, snowd, cv, cvb, cvt, oro, oro_uf, & - xlat_d, xlon_d, slmsk, imap, jmap) + xlat_d, xlon_d, slmsk, imap, jmap, errmsg, errflg) ! ! use machine, only: kind_phys, kind_io8 @@ -31,6 +31,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, integer, intent(in) :: me, nthrds, nx, ny, isc, jsc, nsst, & tile_num, nlunit, lsoil, lsoil_lsm, kice integer, intent(in) :: idate(:), ialb, isot, ivegsrc + character(len = 64), intent(in) :: fn_nml character(len=*), intent(in) :: input_nml_file(:) logical, intent(in) :: use_ufo, nst_anl, frac_grid real(kind=kind_phys), intent(in) :: fhcyc, phour, landfrac(:), lakefrac(:), & @@ -77,6 +78,9 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, slope(:) integer, intent(in) :: imap(:), jmap(:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! ! Local variables ! --------------- @@ -103,6 +107,11 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, real(kind=kind_phys) :: sig1t integer :: npts, nb, ix, jx, ls, ios, ll logical :: exists + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + ! !@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ! @@ -210,13 +219,15 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, enddo ! #ifndef INTERNAL_FILE_NML - inquire (file=trim(Model%fn_nml),exist=exists) + inquire (file=trim(fn_nml),exist=exists) if (.not. exists) then - write(6,*) 'gcycle:: namelist file: ',trim(Model%fn_nml),' does not exist' - stop + write(6,*) 'gcycle:: namelist file: ',trim(fn_nml),' does not exist' + errflg = 1 + errmsg = 'ERROR(gcycle): namelist file: ',trim(fn_nml),' does not exist.' + return else - open (unit=Model%nlunit, file=trim(Model%fn_nml), action='READ', status='OLD', iostat=ios) - rewind (Model%nlunit) + open (unit=nlunit, file=trim(fn_nml), action='READ', status='OLD', iostat=ios) + rewind (nlunit) endif #endif CALL SFCCYCLE (9998, npts, max(lsoil,lsoil_lsm), sig1t, fhcyc, & @@ -233,7 +244,7 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, min_ice, ialb, isot, ivegsrc, & trim(tile_num_ch), i_indx, j_indx) #ifndef INTERNAL_FILE_NML - close (Model%nlunit) + close (nlunit) #endif ! if ( nsst > 0 ) then diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 4e8b3d586..0fd84c7ea 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -63,7 +63,7 @@ subroutine gfdl_cloud_microphys_init (me, master, nlunit, input_nml_file, loguni return endif - call gfdl_cloud_microphys_mod_init(me, master, nlunit, input_nml_file, logunit, fn_nml) + call gfdl_cloud_microphys_mod_init(me, master, nlunit, input_nml_file, logunit, fn_nml, errmsg, errflg) is_initialized = .true. diff --git a/physics/gfdl_sfc_layer.F90 b/physics/gfdl_sfc_layer.F90 index cf97fc1b6..e235acc52 100644 --- a/physics/gfdl_sfc_layer.F90 +++ b/physics/gfdl_sfc_layer.F90 @@ -1137,7 +1137,7 @@ SUBROUTINE MFLUX2( fxh,fxe,fxmx,fxmy,cdm,rib,xxfh,zoc,mzoc,tstrc, & !m land(i) = 0.0 windmks=wind10p(i)*.01 if ( iwavecpl .eq. 1 ) then - call znot_wind10m(windmks,znott,znotm,icoef_sf) + call znot_wind10m(windmks,znott,znotm,icoef_sf,errmsg,errflg) !Check if Charnock parameter ratio is received in a proper range. if ( alpha(i) .ge. 0.2 .and. alpha(i) .le. 5. ) then znotm = znotm*alpha(i) @@ -1145,7 +1145,7 @@ SUBROUTINE MFLUX2( fxh,fxe,fxmx,fxmy,cdm,rib,xxfh,zoc,mzoc,tstrc, & !m zoc(i) = -100.*znotm zot(i) = -100* znott else - call znot_wind10m(windmks,znott,znotm,icoef_sf) + call znot_wind10m(windmks,znott,znotm,icoef_sf,errmsg,errflg) zoc(i) = -100.*znotm zot(i) = -100* znott endif @@ -1782,7 +1782,7 @@ SUBROUTINE MFLUX2( fxh,fxe,fxmx,fxmy,cdm,rib,xxfh,zoc,mzoc,tstrc, & !m !!! if ( iwavecpl .eq. 1 .and. zoc(i) .le. 0.0 ) then windmks = wind10(i) * 0.01 - call znot_wind10m(windmks,znott,znotm,icoef_sf) + call znot_wind10m(windmks,znott,znotm,icoef_sf,errmsg,errflg) !Check if Charnock parameter ratio is received in a proper range. if ( alpha(i) .ge. 0.2 .and. alpha(i) .le. 5. ) then znotm = znotm*alpha(i) diff --git a/physics/lsm_noah.f b/physics/lsm_noah.f index 246f81654..e13f7facc 100644 --- a/physics/lsm_noah.f +++ b/physics/lsm_noah.f @@ -61,7 +61,7 @@ subroutine lsm_noah_init(lsm, lsm_noah, me, isot, ivegsrc, nlunit, end if !--- initialize soil vegetation - call set_soilveg(me, isot, ivegsrc, nlunit) + call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) pores (:) = maxsmc (:) resid (:) = drysmc (:) @@ -543,7 +543,8 @@ subroutine lsm_noah_run & & edir, et, ett, esnow, drip, dew, beta, etp, ssoil, & & flx1, flx2, flx3, runoff1, runoff2, runoff3, & & snomlt, sncovr, rc, pc, rsmin, xlai, rcs, rct, rcq, & - & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax) + & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax, & + & errmsg, errflg ) !> - Noah LSM: prepare variables for return to parent model and unit conversion. ! - 6. output (o): diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 99b6c2b41..e6dc66579 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -159,7 +159,7 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & endif !--- initialize soil vegetation - call set_soilveg_ruc(me, isot, ivegsrc, nlunit) + call set_soilveg_ruc(me, isot, ivegsrc, nlunit, errmsg, errflg) pores (:) = maxsmc (:) resid (:) = drysmc (:) @@ -1149,7 +1149,8 @@ subroutine lsm_ruc_run & ! inputs & smfrsoil(i,:,j),keepfrsoil(i,:,j), .false., & & shdmin1d(i,j), shdmax1d(i,j), rdlai2d, & & ims,ime, jms,jme, kms,kme, & - & its,ite, jts,jte, kts,kte ) + & its,ite, jts,jte, kts,kte, & + & errmsg, errflg) if(debug_print) then write (0,*)'after LSMRUC for land' write (0,*)'after sneqv(i,j) =',i,j,sneqv_lnd(i,j) @@ -1423,7 +1424,8 @@ subroutine lsm_ruc_run & ! inputs & smfrice(i,:,j),keepfrice(i,:,j), .false., & & shdmin1d(i,j), shdmax1d(i,j), rdlai2d, & & ims,ime, jms,jme, kms,kme, & - & its,ite, jts,jte, kts,kte ) + & its,ite, jts,jte, kts,kte, & + & errmsg, errflg) ! Interstitial evap_ice(i) = qfx_ice(i,j) / rho(i) ! kinematic diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 091ed2020..714372d53 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -123,7 +123,9 @@ subroutine m_micro_init(imp_physics, imp_physics_mg, fprcp, gravit, rair, rh2o, mg_ngcons, mg_ngnst) else write(0,*)' fprcp = ',fprcp,' is not a valid option - aborting' - stop + errflg = 1 + errmsg = 'ERROR(m_micro_init): fprcp is not a valid option' + return endif call aer_cloud_init () diff --git a/physics/module_SF_JSFC.F90 b/physics/module_SF_JSFC.F90 index 8d67a81cd..fdf188b96 100644 --- a/physics/module_SF_JSFC.F90 +++ b/physics/module_SF_JSFC.F90 @@ -122,7 +122,7 @@ SUBROUTINE JSFC(FLAG_ITER,ITER,ME & & ,A1U,A1T,A1Q & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & - & ,ITS,ITE,JTS,JTE,KTS,LM) + & ,ITS,ITE,JTS,JTE,KTS,LM,errmsg,errflg) ! !----------------------------------------------------------------------- ! SUBROUTINE JSFC(NTSD,EPSQ2,HT,DZ & @@ -182,6 +182,8 @@ SUBROUTINE JSFC(FLAG_ITER,ITER,ME & REAL(kind=kfpt),DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: CM,CH,STRESS,FFM & & ,FFH,WIND,FM10,FH2 & & ,A1U,A1T,A1Q + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg ! ! REAL(kind=kfpt),DIMENSION(IMS:IME,JMS:JME),INTENT(OUT) :: CHS,CHS2,CQS2 & ! & ,CPM,CT,FLHC,FLQC & @@ -215,6 +217,9 @@ SUBROUTINE JSFC(FLAG_ITER,ITER,ME & ! !---------------------------------------------------------------------- !********************************************************************** + ! Initialize error-handling + errflg = 0 + errmsg = '' !---------------------------------------------------------------------- ! !*** MAKE PREPARATIONS @@ -390,7 +395,8 @@ SUBROUTINE JSFC(FLAG_ITER,ITER,ME & & ,A1U(I,J),A1T(I,J),A1Q(I,J) & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & - & ,ITS,ITE,JTS,JTE,KTS,LM,I,J,ZHK(LMH+1),RIB(I,J)) ! Added Bulk Richardson No. + & ,ITS,ITE,JTS,JTE,KTS,LM,I,J,ZHK(LMH+1),RIB(I,J) & ! Added Bulk Richardson No. + & ,errmsg, errflg) ! !*** REMOVE SUPERATURATION AT 2M AND 10M ! @@ -454,7 +460,8 @@ SUBROUTINE SFCDIF(NTSD,SEAMASK,THS,QS,PSFC & & ,FFM,FFH,FM10,FH2,A1U,A1T,A1Q & & ,IDS,IDE,JDS,JDE,KDS,KDE & & ,IMS,IME,JMS,JME,KMS,KME & - & ,ITS,ITE,JTS,JTE,KTS,LM,I,J,ZSFC,RIB) ! Added Bulk Richardson No. + & ,ITS,ITE,JTS,JTE,KTS,LM,I,J,ZSFC,RIB & ! Added Bulk Richardson No. + & ,errmsg, errflg) ! **************************************************************** ! * * ! * SURFACE LAYER * @@ -481,6 +488,8 @@ SUBROUTINE SFCDIF(NTSD,SEAMASK,THS,QS,PSFC & REAL(kind=kfpt),INTENT(OUT) :: FFM,FFH,FM10,FH2,A1U,A1T,A1Q ! REAL(kind=kfpt),INTENT(INOUT) :: AKHS,AKMS,QZ0,THZ0,USTAR,UZ0,VZ0,Z0,QS + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg !---------------------------------------------------------------------- !*** !*** LOCAL VARIABLES @@ -507,6 +516,10 @@ SUBROUTINE SFCDIF(NTSD,SEAMASK,THS,QS,PSFC & !---------------------------------------------------------------------- !********************************************************************** !---------------------------------------------------------------------- + ! Initialize error-handling + errflg = 0 + errmsg = '' + RDZ=1./ZSL CXCHL=EXCML*RDZ CXCHS=EXCMS*RDZ @@ -701,7 +714,9 @@ SUBROUTINE SFCDIF(NTSD,SEAMASK,THS,QS,PSFC & print*,'PSIH1(1,2),RDZT=',PSIH1(K+1),PSIH1(K+2),RDZT print*,'ZSLU,ZSLT,RLMO,ZU,ZT=',ZSLU,ZSLT,RLMO,ZU,ZT print*,'A,B,DTHV,DU2,RIB=',A,B,DTHV,DU2,RIB - stop + errflg = 1 + errmsg = 'ERROR(SFCDIF): ' + return end if diff --git a/physics/module_gfdl_cloud_microphys.F90 b/physics/module_gfdl_cloud_microphys.F90 index 3ebcfc587..5cab1abbc 100644 --- a/physics/module_gfdl_cloud_microphys.F90 +++ b/physics/module_gfdl_cloud_microphys.F90 @@ -3563,7 +3563,8 @@ end subroutine setupm !>\ingroup mod_gfdl_cloud_mp !! The subroutine 'gfdl_cloud_microphys_init' initializes the GFDL !! cloud microphysics. -subroutine gfdl_cloud_microphys_mod_init (me, master, nlunit, input_nml_file, logunit, fn_nml) +subroutine gfdl_cloud_microphys_mod_init (me, master, nlunit, input_nml_file, logunit, & + fn_nml, errmsg, errflg) implicit none @@ -3574,6 +3575,8 @@ subroutine gfdl_cloud_microphys_mod_init (me, master, nlunit, input_nml_file, lo character (len = 64), intent (in) :: fn_nml character (len = *), intent (in) :: input_nml_file(:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg integer :: ios logical :: exists @@ -3588,13 +3591,19 @@ subroutine gfdl_cloud_microphys_mod_init (me, master, nlunit, input_nml_file, lo ! master = (mpp_pe () .eq.mpp_root_pe ()) + ! Initialize CCPP error-handling + errflg = 0 + errmsg = '' + #ifdef INTERNAL_FILE_NML read (input_nml_file, nml = gfdl_cloud_microphysics_nml) #else inquire (file = trim (fn_nml), exist = exists) if (.not. exists) then write (6, *) 'gfdl - mp :: namelist file: ', trim (fn_nml), ' does not exist' - stop + errflg = 1 + errmsg = 'ERROR(gfdl_cloud_microphys_mod_init): namelist file '//trim (fn_nml)//' does not exist' + return else open (unit = nlunit, file = fn_nml, action = 'read' , status = 'old', iostat = ios) endif diff --git a/physics/module_sf_exchcoef.f90 b/physics/module_sf_exchcoef.f90 index 0e3dae80c..6ec9ed835 100644 --- a/physics/module_sf_exchcoef.f90 +++ b/physics/module_sf_exchcoef.f90 @@ -636,7 +636,7 @@ SUBROUTINE znot_t_v8(uref,znott) END SUBROUTINE znot_t_v8 - SUBROUTINE znot_wind10m(w10m,znott,znotm,icoef_sf) + SUBROUTINE znot_wind10m(w10m,znott,znotm,icoef_sf,errmsg,errflg) IMPLICIT NONE ! w10m(m/s) : 10-m wind speed @@ -647,8 +647,15 @@ SUBROUTINE znot_wind10m(w10m,znott,znotm,icoef_sf) REAL, INTENT(IN) :: w10m INTEGER, INTENT(IN) :: icoef_sf REAL, INTENT(OUT):: znott, znotm + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg real :: zm,zt,windmks, zlev,z10, tmp, zlevt, aaa, zm1,zt1 + + ! Initialize error-handling + errflg = 0 + errmsg = '' + zlev=20.0 zlevt=10.0 z10=10.0 @@ -722,7 +729,9 @@ SUBROUTINE znot_wind10m(w10m,znott,znotm,icoef_sf) call znot_t_v8(windmks,zt1) else write(0,*)'stop, icoef_sf must be one of 0,1,2,3,4,5,6,7,8' - stop + errflg = 1 + errmsg = 'ERROR(znot_wind10m): icoef_sf must be one of 0,1,2,3,4,5,6,7,8' + return endif znott=zt1 znotm=zm1 diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index c0457c20a..33678fa3a 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -382,6 +382,10 @@ SUBROUTINE SFCLAY_mynn( & INTEGER :: I,J,K,itf,ktf !----------------------------------------------------------- + ! Initialize error-handling + errflg = 0 + errmsg = '' + IF (debug_code >= 1) THEN write(*,*)"======= printing of constants:" write(*,*)"cp=", cp," g=", g @@ -684,6 +688,9 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & REAL(kind=kind_phys) :: FLUXC,VSGD REAL(kind=kind_phys) :: restar,VISC,DQG,OLDUST,OLDTST + ! Initialize error-handling + errflg = 0 + errmsg = '' !------------------------------------------------------------------- DO I=its,ite @@ -1192,7 +1199,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) + CALL GFS_zt_wat(ZT_wat(i),ZNTstoch_wat(i),restar,WSPD(i),ZA(i),sfc_z0_type,errmsg,errflg) ZQ_wat(i)=ZT_wat(i) ENDIF ELSE @@ -2763,14 +2770,20 @@ 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) + SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type,errmsg,errflg) REAL(kind=kind_phys), INTENT(OUT) :: ztmax REAL(kind=kind_phys), INTENT(IN) :: wspd,z1,z0rl_wat,restar INTEGER, INTENT(IN):: sfc_z0_type + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg REAL(kind=kind_phys) :: z0,z0max,wind10m,rat,ustar_wat REAL(kind=kind_phys), PARAMETER :: charnock = 0.014, z0s_max=.317e-2 + ! Initialize error-handling + errflg = 0 + errmsg = '' + ! z0 = 0.01 * z0rl_wat !Already converted to meters in the wrapper z0 = z0rl_wat @@ -2800,7 +2813,9 @@ SUBROUTINE GFS_zt_wat(ztmax,z0rl_wat,restar,WSPD,z1,sfc_z0_type) 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 - stop + errflg = 1 + errmsg = 'ERROR(GFS_zt_wat): sfc_z0_type not valid.' + return endif END SUBROUTINE GFS_zt_wat diff --git a/physics/module_sf_noahmp_glacier.f90 b/physics/module_sf_noahmp_glacier.F90 similarity index 99% rename from physics/module_sf_noahmp_glacier.f90 rename to physics/module_sf_noahmp_glacier.F90 index 738a40b5c..bd6b016f1 100644 --- a/physics/module_sf_noahmp_glacier.f90 +++ b/physics/module_sf_noahmp_glacier.F90 @@ -1,5 +1,5 @@ #define CCPP -!> \file module_sf_noahmp_glacier.f90 +!> \file module_sf_noahmp_glacier.F90 !! This file contains the NoahMP Glacier scheme. !>\ingroup NoahMP_LSM diff --git a/physics/module_sf_noahmplsm.f90 b/physics/module_sf_noahmplsm.F90 similarity index 99% rename from physics/module_sf_noahmplsm.f90 rename to physics/module_sf_noahmplsm.F90 index 1da30f156..53373073f 100644 --- a/physics/module_sf_noahmplsm.f90 +++ b/physics/module_sf_noahmplsm.F90 @@ -1,5 +1,5 @@ #define CCPP -!> \file module_sf_noahmplsm.f90 +!> \file module_sf_noahmplsm.F90 !! This file contains the NoahMP land surface model. !>\ingroup NoahMP_LSM diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 9a6363c08..5cf04d297 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -72,7 +72,8 @@ SUBROUTINE LSMRUC( & SMFR3D,KEEPFR3DFLAG, & myj,shdmin,shdmax,rdlai2d, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) + its,ite, jts,jte, kts,kte, & + errmsg, errflg) !----------------------------------------------------------------- IMPLICIT NONE !----------------------------------------------------------------- @@ -325,7 +326,6 @@ SUBROUTINE LSMRUC( & KICE, & KWT - REAL, DIMENSION(1:NSL) :: ZSMAIN, & ZSHALF, & DTDZS2 @@ -381,9 +381,14 @@ SUBROUTINE LSMRUC( & INTEGER :: I,J,K,NZS,NZS1,NDDZS INTEGER :: k1,k2 logical :: debug_print - + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg !----------------------------------------------------------------- ! + ! Initialize error-handling + errflg = 0 + errmsg = '' + debug_print = .false. ! rovcp = rd/cp @@ -704,7 +709,7 @@ SUBROUTINE LSMRUC( & soilfrac,nscat,shdmin(i,j),shdmax(i,j),mosaic_lu, mosaic_soil,& NLCAT,ILAND,ISOIL,iswater,MYJ,IFOREST,lufrac,VEGFRA(I,J), & EMISSL(I,J),PC(I,J),ZNT(I,J),LAI(I,J),RDLAI2D, & - QWRTZ,RHOCS,BCLH,DQM,KSAT,PSIS,QMIN,REF,WILT,i,j ) + QWRTZ,RHOCS,BCLH,DQM,KSAT,PSIS,QMIN,REF,WILT,i,j,errmsg, errflg) !-- update background emissivity for land points, can have vegetation mosaic effect EMISBCK(I,J) = EMISSL(I,J) @@ -6547,7 +6552,8 @@ SUBROUTINE SOILVEGIN ( debug_print, & mosaic_lu, mosaic_soil, & NLCAT,IVGTYP,ISLTYP,iswater,MYJ, & IFOREST,lufrac,vegfrac,EMISS,PC,ZNT,LAI,RDLAI2D,& - QWRTZ,RHOCS,BCLH,DQM,KSAT,PSIS,QMIN,REF,WILT,I,J) + QWRTZ,RHOCS,BCLH,DQM,KSAT,PSIS,QMIN,REF,WILT,I,J,& + errmsg, errflg) !************************************************************************ ! Set-up soil and vegetation Parameters in the case when @@ -6809,7 +6815,8 @@ SUBROUTINE SOILVEGIN ( debug_print, & REF, & WILT INTEGER, INTENT ( OUT) :: iforest - + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg ! INTEGER, DIMENSION( 1:(lucats) ) , & ! INTENT ( OUT) :: iforest @@ -6830,7 +6837,11 @@ SUBROUTINE SOILVEGIN ( debug_print, & ! iforest(k)=if1(k) ! enddo - iforest = IFORTBL(IVGTYP) + ! Initialize error-handling + errflg = 0 + errmsg = '' + + iforest = IFORTBL(IVGTYP) IF (debug_print ) THEN print *,'ifortbl(ivgtyp),ivgtyp,laitbl(ivgtyp),z0tbl(ivgtyp)', & @@ -6904,7 +6915,9 @@ SUBROUTINE SOILVEGIN ( debug_print, & if (area.gt.1.) area=1. if (area <= 0.) then print *,'Bad area of grid box', area - stop + errflg = 1 + errmsg = 'ERROR(SOILVEGIN): Bad area of grid box' + return endif IF (debug_print ) THEN diff --git a/physics/myjsfc_wrapper.F90 b/physics/myjsfc_wrapper.F90 index 81cb36765..cebd2a9f1 100644 --- a/physics/myjsfc_wrapper.F90 +++ b/physics/myjsfc_wrapper.F90 @@ -334,7 +334,7 @@ SUBROUTINE myjsfc_wrapper_run( & & ,phy_f2d_myj(1:im,13) & & ,1,im,1,1,1,levs & & ,1,im,1,1,1,levs & - & ,1,im,1,1,1,levs) + & ,1,im,1,1,1,levs, errmsg, errflg) do i = 1, im if(flag_iter(i))then diff --git a/physics/noahmpdrv.F90 b/physics/noahmpdrv.F90 index fed823ead..615b7cbc7 100644 --- a/physics/noahmpdrv.F90 +++ b/physics/noahmpdrv.F90 @@ -93,7 +93,7 @@ subroutine noahmpdrv_init(lsm, lsm_noahmp, me, isot, ivegsrc, & !--- initialize soil vegetation - call set_soilveg(me, isot, ivegsrc, nlunit) + call set_soilveg(me, isot, ivegsrc, nlunit, errmsg, errflg) ! initialize psih and psim diff --git a/physics/noahmpdrv.meta b/physics/noahmpdrv.meta index 3235b7c90..29ce6f2f7 100644 --- a/physics/noahmpdrv.meta +++ b/physics/noahmpdrv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = noahmpdrv type = scheme - dependencies = funcphys.f90,machine.F,sfc_diff.f,module_sf_noahmp_glacier.f90,module_sf_noahmplsm.f90,noahmp_tables.f90,set_soilveg.f + dependencies = funcphys.f90,machine.F,sfc_diff.f,module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90,set_soilveg.f ######################################################################## [ccpp-arg-table] diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 41d37491a..7b7a71c98 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -53,8 +53,8 @@ module physcons real(kind=kind_phys),parameter:: con_omega =7.2921e-5_kind_phys !< ang vel of earth (\f$s^{-1}\f$) real(kind=kind_phys),parameter:: con_p0 =1.01325e5_kind_phys !< standard atmospheric pressure (\f$Pa\f$) ! real(kind=kind_phys),parameter:: con_solr =1.36822e+3_kind_phys ! solar constant (W/m2)-aer(2001) - real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002) - real(kind=kind_phys),parameter:: con_solr =1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) + real(kind=kind_phys),parameter:: con_solr_2002 =1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002) + real(kind=kind_phys),parameter:: con_solr_2008 =1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) ! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3_kind_phys ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 ! Selected geophysics/astronomy constants with kind=kind_dyn real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0_kind_dyn !< gravity (\f$m/s^{2}\f$) diff --git a/physics/physparam.f b/physics/physparam.f deleted file mode 100644 index 5518c6163..000000000 --- a/physics/physparam.f +++ /dev/null @@ -1,300 +0,0 @@ -!> \file physparam.f -!! This file contains module physparam. - -! ========================================================== !!!!! -! module physparam description !!!!! -! ========================================================== !!!!! -! ! -! This module defines commonly used control variables/parameters ! -! in physics related programs. ! -! ! -! Section 1 contains control variables defined in the form of ! -! parameter. They are pre-determined choices and not adjustable ! -! during model's run-time. ! -! ! -! Section 2 contains control variables defined as module variables.! -! They are more flexible to be changed during run-time by either ! -! through input namelist, or through model environment condition. ! -! They are preassigned here as the default values. ! -! ! -!!!!! ========================================================== !!!!! - -!> \defgroup phy_sparam GFS Physics Parameter Module -!! Those variables are grouped together in accordance with functionaity -!! and are given brief descriptions and value specifications. There are -!! two types of attributes (parameters vs. save) designated for the -!! control variables. Those with a "parameter" attribute are prescribed -!! with a preferred option value, while the ones with a "save" attribute -!! are given a default value but could be changed at the model's -!! execution-time (usually through an input of name-list file or through -!! run scripts). - -!> This module defines commonly used control variables and parameters -!! in physics related programs. - module physparam -! -! implicit none - -! --- ... define kind parameters here - -! ** if already exist, use the module containing kind definitions - use machine - -! ** otherwise, define kind parameter here -! implicit none -! integer, public, parameter :: kind_io4 = 4 -! integer, public, parameter :: kind_io8 = 8 -! integer, public, parameter :: kind_phys= selected_real_kind(13,60) ! the '60' maps to 64-bit real -! ..... - -! implicit none -! - public - -!================================================================================== -! Section - 1 - -! control flags are pre-set as run-time non-adjuztable parameters. -!================================================================================== - -! ............................................. ! -!> \name 1.1 Control flags for SW radiation -! ............................................. ! - -!> SW heating rate unit control flag: =1:k/day; =2:k/second. - integer,parameter :: iswrate = 2 - -!> SW minor gases effect control flag (CH4 and O2): =0:no; =1:yes. -!!\n =0: minor gases' effects are not included in calculations -!!\n =1: minor gases' effects are included in calculations - integer,parameter :: iswrgas = 1 - -!> SW optical property for liquid clouds -!!\n =0:input cld opt depth, ignoring iswcice setting -!!\n =1:cloud optical property scheme based on Hu and Stamnes(1993) \cite hu_and_stamnes_1993 method -!!\n =2:cloud optical property scheme based on Hu and Stamnes(1993) -updated - integer,save :: iswcliq = 1 - -!> SW optical property for ice clouds (only iswcliq>0) -!!\n =1:optical property scheme based on Ebert and Curry (1992) -!! \cite ebert_and_curry_1992 method -!!\n =2:optical property scheme based on Streamer v3.0 -!! \cite key_2002 method -!!\n =3:optical property scheme based on Fu's method (1996) -!! \cite fu_1996 method - integer,save :: iswcice = 3 - -!> SW control flag for scattering process approximation -!!\n =1:two-stream delta-eddington (Joseph et al. 1976 -!! \cite joseph_et_al_1976) -!!\n =2:two-stream PIFM (Zdunkowski et al. 1980 -!! \cite zdunkowski_et_al_1980) -!!\n =3:discrete ordinates (Liou, 1973 -!! \cite liou_1973) - integer,parameter :: iswmode = 2 - -! ............................................. ! -!> \name 1.2 Control flags for LW radiation -! ............................................. ! - -!> LW heating rate unit: =1:k/day; =2:k/second. - integer,parameter :: ilwrate = 2 - -!> LW minor gases effect control flag (CH4,N2O,O2,and some CFCs): -!!\n =0: minor gases' effects are not included in calculations -!!\n =1: minor gases' effects are included in calculations - integer,parameter :: ilwrgas = 1 - -!> LW optical property scheme for liquid clouds -!!\n =0:input cloud optical properties directly, not computed within -!!\n =1:input cwp,rew, use Hu and Stamnes(1993) -!! \cite hu_and_stamnes_1993 method - integer,save :: ilwcliq = 1 - -!> LW optical property scheme for ice clouds (only ilwcliq>0) -!!\n =1:optical property scheme based on Ebert and Curry (1992) -!! \cite ebert_and_curry_1992 method -!!\n =2:optical property scheme based on Streamer v3 -!! \cite key_2002 method -!!\n =3:optical property scheme use Fu's method (1998) -!! \cite fu_et_al_1998 method - integer,save :: ilwcice = 3 - -! ............................................. ! -!>\name 1.3 Control flag for LW aerosol property - -!> selects 1 band or multi bands for LW aerosol properties -!!\n =.true.:aerosol properties calculated in 1 broad LW band -!!\n =.false.:aerosol properties calculated in all LW bands -!!\n variable names diff in Opr CFS - logical,parameter :: lalw1bd =.false. - -!================================================================================== -! Section - 2 - -! values of control flags might be re-set in initialization subroutines -! (may be adjusted at run time based on namelist input or run condition) -!================================================================================== - -! ............................................. ! -!>\name 2.1 For module radiation_astronomy -! ............................................. ! - -!> solar constant scheme control flag -!!\n =0:fixed value=1366.0\f$W/m^2\f$(old standard) -!!\n =10:fixed value=1360.8\f$W/m^2\f$(new standard) -!!\n =1:NOAA ABS-scale TSI table (yearly) w 11-yr cycle approx -!!\n =2:NOAA TIM-scale TSI table (yearly) w 11-yr cycle approx -!!\n =3:CMIP5 TIM-scale TSI table (yearly) w 11-yr cycle approx -!!\n =4:CMIP5 TIM-scale TSI table (monthly) w 11-yr cycle approx -!!\n see ISOL in run scripts: Opr GFS=2; Opr CFS=1 - integer, save :: isolar = 0 - -!> external solar constant data table,solarconstant_noaa_a0.txt - character, save :: solar_file*26 -! data solar_file / 'solarconstantdata.txt ' / - data solar_file / 'solarconstant_noaa_a0.txt ' / - -! ............................................. ! -!> \name 2.2 For module radiation_aerosols -! ............................................. ! - -!> aerosol model scheme control flag -!!\n =0:seasonal global distributed OPAC aerosol climatology -!!\n =1:monthly global distributed GOCART aerosol climatology -!!\n =2: GOCART prognostic aerosol model -!!\n =5: OPAC climatoloy with new band mapping -!!\n Opr GFS=0; Opr CFS=n/a - integer, save :: iaermdl = 0 - -!> aerosol effect control flag -!!\n 3-digit flag 'abc': -!!\n a-stratospheric volcanic aerols -!!\n b-tropospheric aerosols for LW -!!\n c-tropospheric aerosols for SW -!!\n =0:aerosol effect is not included; =1:aerosol effect is included -!!\n Opr GFS/CFS =111; see IAER in run scripts - integer, save :: iaerflg = 0 - -!> external aerosols data file: aerosol.dat - character, save :: aeros_file*26 -! data aeros_file / 'climaeropac_global.txt ' / - data aeros_file / 'aerosol.dat ' / - -! ............................................. ! -!> \name 2.3 For module radiation_gases -! ............................................. ! - -!> co2 data source control flag -!!\n =0:prescribed value(380 ppmv) -!!\n =1:yearly global averaged annual mean from observations -!!\n =2:monthly 15 degree horizontal resolution from observations -!!\n Opr GFS/CFS=2; see ICO2 in run scripts - integer, save :: ico2flg = 0 - -!> controls external data at initial time and data usage during -!! forecast time -!!\n =-2:as in 0,but superimpose with seasonal climatology cycle -!!\n =-1:use user data,no extrapolation in overtime -!!\n =0:use IC time to select data,no extrapolation in overtime -!!\n =1:use forecast time to select data,extrapolate when necessary -!!\n =yyyy0:use yyyy year of data, no extrapolation -!!\n =yyyy1:use yyyy year of data, extrapolate when necessary -!!\n Opr GFS/CFS=1; see ICTM in run scripts - integer, save :: ictmflg = 0 - -!> ozone data source control flag -!!\n =0:use seasonal climatology ozone data -!!\n >0:use prognostic ozone scheme (also depend on other model control -!! variable at initial time) - integer, save :: ioznflg = 1 - -!> external co2 2d monthly obsv data table: co2historicaldata_2004.txt - character, save :: co2dat_file*26 -!> external co2 global annual mean data tb: co2historicaldata_glob.txt - character, save :: co2gbl_file*26 -!> external co2 user defined data table: co2userdata.txt - character, save :: co2usr_file*26 -!> external co2 clim monthly cycle data tb: co2monthlycyc.txt - character, save :: co2cyc_file*26 - data co2dat_file / 'co2historicaldata_2004.txt' / !year is run-time selected - data co2gbl_file / 'co2historicaldata_glob.txt' / - data co2usr_file / 'co2userdata.txt ' / - data co2cyc_file / 'co2monthlycyc.txt ' / - -! ............................................. ! -!>\name 2.4 For module radiation_clouds -! ............................................. ! - -!> cloud optical property scheme control flag -!!\n =0:use diagnostic cloud scheme for cloud cover and mean optical properties -!!\n =1:use prognostic cloud scheme for cloud cover and cloud properties - integer, save :: icldflg = 1 - -!> cloud overlapping control flag for Radiation -!!\n =0:use random cloud overlapping method -!!\n =1:use maximum-random cloud overlapping method -!!\n =2:use maximum cloud overlapping method -!!\n =3:use decorrelation length overlapping method -!!\n =4:use exponential overlapping method -!!\n =5:use exponential-random overlapping method -!!\n Opr GFS/CFS=1; see IOVR in run scripts - integer, save :: iovr = 1 -!!\n Decorrelation length type for iovr = 4 or 5 -!!\n =0:use constant decorrelation length defined by decorr_con (in module physcons) -!!\n =1:use day-of-year and latitude-varying decorrelation length - integer, save :: idcor = 1 - -!> sub-column cloud approx flag in SW radiation -!!\n =0:no McICA approximation in SW radiation -!!\n =1:use McICA with precribed permutation seeds (test mode) -!!\n =2:use McICA with randomly generated permutation seeds -!!\n Opr GFS/CFS=2; see ISUBC_SW in run scripts - integer, save :: isubcsw = 0 -!> sub-column cloud approx flag in LW radiation -!!\n =0:no McICA approximation in LW radiation -!!\n =1:use McICA with prescribed permutation seeds (test mode) -!!\n =2:use McICA with randomly generatedo -!!\n Opr GFS/CFS=2; see ISUBC_LW in run scripts - integer, save :: isubclw = 0 - -!> eliminating CRICK control flag - logical, save :: lcrick =.false. -!> in-cld condensate control flag - logical, save :: lcnorm =.false. -!> precip effect on radiation flag (Ferrier microphysics) - logical, save :: lnoprec =.false. -!> shallow convetion flag - logical, save :: lsashal =.false. - -! ............................................. ! -!>\name 2.5 For module radiation_surface -! ............................................. ! - -!> surface albedo scheme control flag -!!\n =0:vegetation type based climatological albedo scheme -!!\n =1:seasonal albedo derived from MODIS measurements - integer, save :: ialbflg = 0 - -!> surface emissivity scheme control flag -!!\n =0:black-body surface emissivity(=1.0) -!!\n =1:vegetation type based climatology emissivity(<1.0) -!!\n Opr GFS/CFS=1; see IEMS in run scripts - integer, save :: iemsflg = 0 - -!> external sfc emissivity data table: sfc_emissivity_idx.txt - character, save :: semis_file*26 - data semis_file / 'sfc_emissivity_idx.txt ' / - -! ............................................. ! -!> \name 2.6 general purpose -! ............................................. ! - -!> vertical profile indexing flag - integer, save :: ivflip = 1 - -!> initial permutaion seed for mcica radiation - integer, save :: ipsd0 = 0 - integer, save :: ipsdlim = 1e8 -! -!...................................! - end module physparam ! -!===================================! diff --git a/physics/radiation_aerosols.f b/physics/radiation_aerosols.f index 8f4562847..3cd5c64e1 100644 --- a/physics/radiation_aerosols.f +++ b/physics/radiation_aerosols.f @@ -15,25 +15,23 @@ ! inputs: ! ! ( NLAY, me ) ! ! outputs: ! -! ( none ) ! +! ( errflg, errmsg ) ! ! ! ! 'aer_update' -- updating aerosol data ! ! inputs: ! ! ( iyear, imon, me ) ! ! outputs: ! -! ( none ) ! +! ( errflg, errmsg ) ! ! ! ! 'setaer' -- mapping aeros profile, compute aeros opticals ! ! inputs: ! ! (prsi,prsl,prslk,tvly,rhlay,slmsk,tracer,aerfld,xlon,xlat, ! ! IMAX,NLAY,NLP1, lsswr,lslwr, ! ! outputs: ! -! (aerosw,aerolw,aerodp) ! +! (aerosw,aerolw,aerodp,errmsg,errflg) ! ! ! ! ! ! external modules referenced: ! -! 'module physparam' in 'physparam.f' ! -! 'module physcons' in 'physcons.f' ! ! 'module module_radsw_parameters' in 'radsw_xxxx#_param.f' ! ! 'module module_radlw_parameters' in 'radlw_xxxx#_param.f' ! ! 'module module_radlw_cntr_para' in 'radsw_xxxx#_param.f' ! @@ -128,11 +126,7 @@ module module_radiation_aerosols ! !........................................! ! - use physparam,only : iaermdl, iaerflg, lalw1bd, aeros_file, & - & ivflip, kind_phys, kind_io4, kind_io8 - use physcons, only : con_pi, con_rd, con_g, con_t0c, con_c, & - & con_boltz, con_plnk, con_amd - + use machine, only : kind_phys, kind_io4, kind_io8 use module_iounitdef, only : NIAERCM use module_radsw_parameters, only : NBDSW, wvnsw1=>wvnum1, & & NSWSTR, wvnsw2=>wvnum2 @@ -499,8 +493,8 @@ module module_radiation_aerosols ! !>\section gen_al General Algorithm !----------------------------------- subroutine aer_init & - & ( NLAY, me ) ! --- inputs -! --- outputs: ( to module variables ) + & ( NLAY, me, iaermdl, iaerflg, lalw1bd, aeros_file, con_pi, & + & con_t0c, con_c, con_boltz, con_plnk, errflg, errmsg) ! ================================================================== ! ! ! @@ -510,24 +504,26 @@ subroutine aer_init & ! inputs: ! ! NLAY - number of model vertical layers (not used) ! ! me - print message control flag ! -! ! -! outputs: (to module variables) ! -! ! -! external module variables: (in physparam) ! ! iaermdl - tropospheric aerosol model scheme flag ! ! =0 opac-clim; =1 gocart-clim, =2 gocart-prognostic ! ! =5 opac-clim new spectral mapping ! +! lalw1bd = logical lw aeros propty 1 band vs multi-band cntl flag ! +! =t use 1 broad band optical property ! +! =f use multi bands optical property ! +! ! +! outputs: (CCPP error handling) ! +! errmsg - CCPP error message ! +! errflg - CCPP error flag ! +! ! +! internal module variables: ! ! lalwflg - logical lw aerosols effect control flag ! ! =t compute lw aerosol optical prop ! ! laswflg - logical sw aerosols effect control flag ! ! =t compute sw aerosol optical prop ! ! lavoflg - logical stratosphere volcanic aerosol control flag ! ! =t include volcanic aerosol effect ! -! lalw1bd = logical lw aeros propty 1 band vs multi-band cntl flag ! -! =t use 1 broad band optical property ! -! =f use multi bands optical property ! ! ! -! module constants: ! +! internal module constants: ! ! NWVSOL - num of wvnum regions where solar flux is constant ! ! NWVTOT - total num of wave numbers used in sw spectrum ! ! NWVTIR - total num of wave numbers used in the ir region ! @@ -542,9 +538,14 @@ subroutine aer_init & ! ================================================================== ! ! --- inputs: - integer, intent(in) :: NLAY, me - -! --- output: ( none ) + integer, intent(in) :: NLAY, me, iaermdl, iaerflg + logical, intent(in) :: lalw1bd + character(len=26),intent(in) :: aeros_file + real(kind_phys), intent(in) :: con_pi,con_t0c, con_c, con_boltz, & + & con_plnk +! --- output: + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys), dimension(NWVTOT) :: solfwv ! one wvn sol flux @@ -552,6 +553,11 @@ subroutine aer_init & ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + kyrstr = 1 kyrend = 1 kyrsav = 1 @@ -565,9 +571,9 @@ subroutine aer_init & if ( me == 0 ) then - call wrt_aerlog ! write aerosol param info to log file + call wrt_aerlog(iaermdl, iaerflg, lalw1bd, errflg, errmsg) ! write aerosol param info to log file ! --- inputs: (in scope variables) -! --- outputs: ( none ) +! --- outputs: (CCPP error handling) endif @@ -617,33 +623,36 @@ subroutine aer_init & !> -# Call set_spectrum to set up spectral one wavenumber solar/IR !! fluxes. - call set_spectrum + call set_spectrum(con_pi, con_t0c, con_c, con_boltz, con_plnk, & + & errflg, errmsg) ! --- inputs: (module constants) -! --- outputs: (in-scope variables) +! --- outputs: (ccpp error handling) !> -# Call clim_aerinit() to invoke tropospheric aerosol initialization. if ( iaermdl==0 .or. iaermdl==5 ) then ! opac-climatology scheme - call clim_aerinit & ! --- inputs: - & ( solfwv, eirfwv, me & + & ( solfwv, eirfwv, me, aeros_file, & ! --- outputs: - & ) + & errflg, errmsg) elseif ( iaermdl==1 .or. iaermdl==2 ) then ! gocart clim/prog scheme call gocart_aerinit & ! --- inputs: - & ( solfwv, eirfwv, me & + & ( solfwv, eirfwv, me, & ! --- outputs: - & ) + & errflg, errmsg) else if ( me == 0 ) then print *,' !!! ERROR in aerosol model scheme selection', & & ' iaermdl =',iaermdl - stop + errflg = 1 + errmsg = 'ERROR(aer_init): aerosol model scheme selected'// & + & 'is invalid' + return endif endif @@ -654,9 +663,9 @@ subroutine aer_init & if ( lavoflg ) then - call set_volcaer + call set_volcaer(errflg, errmsg) ! --- inputs: (module variables) -! --- outputs: (module variables) +! --- outputs: (module variables: ccpp error handling) endif ! end if_lavoflg_block @@ -667,11 +676,7 @@ subroutine aer_init & !> This subroutine writes aerosol parameter configuration to run log file. !-------------------------------- - subroutine wrt_aerlog -!................................ -! --- inputs: (in scope variables) -! --- outputs: ( none ) - + subroutine wrt_aerlog(iaermdl, iaerflg, lalw1bd, errflg, errmsg) ! ================================================================== ! ! ! ! subprogram : wrt_aerlog ! @@ -680,15 +685,18 @@ subroutine wrt_aerlog ! ! ! ==================== defination of variables =================== ! ! ! -! external module variables: (in physparam) ! -! iaermdl - aerosol scheme flag: 0:opac-clm; 1:gocart-clim; ! -! 2:gocart-prog; 5:opac-clim+new mapping ! -! iaerflg - aerosol effect control flag: 3-digits (volc,lw,sw) ! +! internal module variables: ! ! lalwflg - toposphere lw aerosol effect: =f:no; =t:yes ! ! laswflg - toposphere sw aerosol effect: =f:no; =t:yes ! -! lavoflg - stratospherer volcanic aeros effect: =f:no; =t:yes ! +! lavoflg - stratosphere volcanic aeros effect: =f:no; =t:yes ! +! ! +! inputs: ! +! iaerflg - aerosol effect control flag: 3-digits (volc,lw,sw) ! +! iaermdl - tropospheric aerosol model scheme flag ! ! ! -! outputs: ( none ) ! +! outputs: ! +! errmsg - CCPP error message ! +! errflg - CCPP error flag ! ! ! ! subroutines called: none ! ! ! @@ -696,13 +704,22 @@ subroutine wrt_aerlog ! ! ! ================================================================== ! -! --- inputs: ( none ) -! --- output: ( none ) +! --- inputs: () + integer, intent(in) :: iaermdl, iaerflg + logical, intent(in) :: lalw1bd +! --- output: (CCPP error handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + print *, VTAGAER ! print out version tag if ( iaermdl==0 .or. iaermdl==5 ) then @@ -717,7 +734,10 @@ subroutine wrt_aerlog else print *,' !!! ERROR in selection of aerosol model scheme', & & ' IAER_MDL =',iaermdl - stop + errflg = 1 + errmsg = 'ERROR(wrt_aerlog): Selected aerosol model scheme is'//& + & 'is invalid' + return endif ! end_if_iaermdl_block print *,' IAER=',iaerflg,' LW-trop-aer=',lalwflg, & @@ -764,10 +784,8 @@ end subroutine wrt_aerlog !> This subroutine defines the one wavenumber solar fluxes based on toa !! solar spectral distribution, and define the one wavenumber IR fluxes !! based on black-body emission distribution at a predefined temperature. - subroutine set_spectrum -!................................ -! --- inputs: (module constants) -! --- outputs: (in-scope variables) + subroutine set_spectrum(con_pi, con_t0c, con_c, con_boltz, & + & con_plnk, errflg, errmsg) ! ================================================================== ! ! ! @@ -779,7 +797,14 @@ subroutine set_spectrum ! ! ! ==================== defination of variables =================== ! ! ! -!> - inputs: (module constants) +!> - inputs: (CCPP Interstitials) +!! - con_pi: Physical constant (pi) +!! - con_t0c: Physical constant (temperature kelvin at zero celcius) +!! - con_c: Physical constant (speed of light) +!! - con_boltz: Physical constant (Boltzmann constant) +!! - con_plnk: Physical constant (Planck constant) +!! +!> - inputs: (in-scope variables) !! - NWVTOT: total num of wave numbers used in sw spectrum !! - NWVTIR: total num of wave numbers used in the ir region !! @@ -788,6 +813,10 @@ subroutine set_spectrum !! (\f$W/m^2\f$) !! - eirfwv(NWVTIR): ir flux(273k) for each individual wavenumber !! (\f$W/m^2\f$) +!! +!> - outputs: (CCPP error-handling) +!! - errflg: CCPP error flag +!! - errmsg: CCPP error message ! ! ! subroutines called: none ! ! ! @@ -797,15 +826,24 @@ subroutine set_spectrum ! --- inputs: (module constants) ! integer :: NWVTOT, NWVTIR +! --- inputs: (CCPP Interstitials) + real(kind_phys),intent(in) :: con_pi, con_t0c, con_c, con_boltz, & + & con_plnk ! --- output: (in-scope variables) ! real (kind=kind_phys), dimension(NWVTOT) :: solfwv ! one wvn sol flux ! real (kind=kind_phys), dimension(NWVTIR) :: eirfwv ! one wvn ir flux - +! --- output: (CCPP error-handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys) :: soltot, tmp1, tmp2, tmp3 integer :: nb, nw, nw1, nw2, nmax, nmin + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 ! !===> ... begin here ! @@ -857,11 +895,12 @@ end subroutine set_spectrum !> The initialization program for stratospheric volcanic aerosols. !----------------------------- - subroutine set_volcaer + subroutine set_volcaer(errflg, errmsg) !............................. -! --- inputs: ( none ) -! --- outputs: (module variables) - +! --- inputs: ( none ) ! +! outputs: (CCPP error handling) ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! ! ================================================================== ! ! ! ! subprogram : set_volcaer ! @@ -877,13 +916,19 @@ subroutine set_volcaer ! --- inputs: (none) -! --- output: (module variables) +! --- output: (CCPP error handling) ! integer :: ivolae(:,:,:) - + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + ! --- allocate data space if ( .not. allocated(ivolae) ) then @@ -910,8 +955,8 @@ end subroutine aer_init !! !!\section gen_clim_aerinit General Algorithm subroutine clim_aerinit & - & ( solfwv, eirfwv, me & ! --- inputs - & ) ! --- outputs + & ( solfwv, eirfwv, me, aeros_file, & ! --- inputs + & errflg, errmsg) ! --- outputs ! ================================================================== ! ! ! @@ -922,24 +967,17 @@ subroutine clim_aerinit & ! solfwv(NWVTOT) - solar flux for each individual wavenumber (w/m2)! ! eirfwv(NWVTIR) - ir flux(273k) for each individual wavenum (w/m2)! ! me - print message control flag ! +! aeros_file - external aerosol data file name ! ! ! -! outputs: (to module variables) ! +! outputs: (CCPP error handling) ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! ! ! -! external module variables: (in physparam) ! -! iaerflg - abc 3-digit integer aerosol flag (abc:volc,lw,sw) ! -! a: =0 use background stratospheric aerosol ! -! =1 incl stratospheric vocanic aeros (MINVYR-MAXVYR) ! -! b: =0 no topospheric aerosol in lw radiation ! -! =1 include tropspheric aerosols for lw radiation ! -! c: =0 no topospheric aerosol in sw radiation ! -! =1 include tropspheric aerosols for sw radiation ! +! internal module variables: ! ! lalwflg - logical lw aerosols effect control flag ! ! =t compute lw aerosol optical prop ! ! laswflg - logical sw aerosols effect control flag ! ! =t compute sw aerosol optical prop ! -! lalw1bd = logical lw aeros propty 1 band vs multi-band cntl flag ! -! =t use 1 broad band optical property ! -! =f use multi bands optical property ! ! ! ! module constants: ! ! NWVSOL - num of wvnum regions where solar flux is constant ! @@ -960,10 +998,11 @@ subroutine clim_aerinit & ! --- inputs: real (kind=kind_phys), dimension(:) :: solfwv ! one wvn sol flux real (kind=kind_phys), dimension(:) :: eirfwv ! one wvn ir flux - integer, intent(in) :: me - -! --- output: ( none ) + character(len=26), intent(in) :: aeros_file +! --- output: (CCPP error handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys), dimension(NAERBND,NCM1) :: & @@ -982,10 +1021,14 @@ subroutine clim_aerinit & ! !===> ... begin here ! +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + ! --- ... invoke tropospheric aerosol initialization !> - call set_aercoef() to invoke tropospheric aerosol initialization. - call set_aercoef + call set_aercoef(aeros_file, errflg, errmsg) ! --- inputs: (in-scope variables, module constants) ! --- outputs: (module variables) @@ -999,10 +1042,10 @@ subroutine clim_aerinit & !! corresponding SW radiation spectral bands. !!\section det_set_aercoef General Algorithm !-------------------------------- - subroutine set_aercoef + subroutine set_aercoef(aeros_file,errflg, errmsg) !................................ ! --- inputs: (in-scope variables, module constants) -! --- outputs: (module variables) +! --- outputs: (CCPP error handling) ! ================================================================== ! ! ! @@ -1021,8 +1064,11 @@ subroutine set_aercoef ! me - integer, select cpu number as print control flag ! ! ! ! outputs: (to the module variables) ! +! outputs: (CCPP error handling) ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! ! ! -! external module variables: (in physparam) ! +! external module variables: ! ! lalwflg - module control flag for lw trop-aer: =f:no; =t:yes ! ! laswflg - module control flag for sw trop-aer: =f:no; =t:yes ! ! aeros_file- external aerosol data file name ! @@ -1076,7 +1122,10 @@ subroutine set_aercoef ! ================================================================== ! ! ! --- inputs: ( none ) -! --- output: ( none ) + character(len=26),intent(in) :: aeros_file +! --- output: (CCPP error handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: integer, dimension(NAERBND) :: iendwv @@ -1090,6 +1139,11 @@ subroutine set_aercoef ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + !> -# Reading climatological aerosols optical data from aeros_file, !! including: @@ -1104,7 +1158,10 @@ subroutine set_aercoef print *,' Requested aerosol data file "',aeros_file, & & '" not found!' print *,' *** Stopped in subroutine aero_init !!' - stop + errflg = 1 + errmsg = 'ERROR(set_aercoef): Requested aerosol data file '// & + & aeros_file//' not found' + return endif ! end if_file_exist_block ! --- ... skip monthly global distribution @@ -1470,7 +1527,7 @@ subroutine optavg ! NSWBND - total number of sw spectral bands ! ! NLWBND - total number of lw spectral bands ! ! ! -! external module variables: (in physparam) ! +! external module variables: ! ! laswflg - control flag for sw spectral region ! ! lalwflg - control flag for lw spectral region ! ! ! @@ -1705,22 +1762,25 @@ end subroutine clim_aerinit !>\section gen_aer_upd General Algorithm !----------------------------------- subroutine aer_update & - & ( iyear, imon, me ) ! --- inputs: -! --- outputs: ( to module variables ) + & ( iyear, imon, me, iaermdl, aeros_file, errflg, errmsg ) ! ================================================================== ! ! ! ! aer_update checks and update time varying climatology aerosol ! ! data sets. ! ! ! -! inputs: size ! -! iyear - 4-digit calender year 1 ! -! imon - month of the year 1 ! -! me - print message control flag 1 ! +! inputs: size ! +! iyear - 4-digit calender year 1 ! +! imon - month of the year 1 ! +! me - print message control flag 1 ! +! iaermdl - tropospheric aerosol model scheme flag 1 ! +! aeros_file - external aerosol data file name len=26 ! ! ! -! outputs: ( none ) ! +! outputs: (CCPP error handling) len=* ! +! errmsg - CCPP error message 1 ! +! errflg - CCPP error flag ! ! ! -! external module variables: (in physparam) ! +! internal module variables: ! ! lalwflg - control flag for tropospheric lw aerosol ! ! laswflg - control flag for tropospheric sw aerosol ! ! lavoflg - control flag for stratospheric volcanic aerosol ! @@ -1732,33 +1792,41 @@ subroutine aer_update & ! ================================================================== ! ! --- inputs: - integer, intent(in) :: iyear, imon, me - -! --- output: ( none ) - + integer, intent(in) :: iyear, imon, me, iaermdl + character(len=26),intent(in) :: aeros_file +! --- output: (CCPP error-handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: ( none ) ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + if ( imon < 1 .or. imon > 12 ) then print *,' ***** ERROR in specifying requested month !!! ', & & 'imon=', imon print *,' ***** STOPPED in subroutinte aer_update !!!' - stop + errflg = 1 + errmsg = 'ERROR(aer_update): Requested month not valid' + return endif !> -# Call trop_update() to update monthly tropospheric aerosol data. if ( lalwflg .or. laswflg ) then if ( iaermdl == 0 .or. iaermdl==5 ) then ! opac-climatology scheme - call trop_update + call trop_update(aeros_file, errflg, errmsg) endif endif !> -# Call volc_update() to update yearly stratospheric volcanic aerosol data. if ( lavoflg ) then - call volc_update + call volc_update(errflg, errmsg) endif @@ -1769,10 +1837,7 @@ subroutine aer_update & !> This subroutine updates the monthly global distribution of aerosol !! profiles in five degree horizontal resolution. !-------------------------------- - subroutine trop_update -!................................ -! --- inputs: (in scope variables, module variables) -! --- outputs: (module variables) + subroutine trop_update(aeros_file, errflg, errmsg) ! ================================================================== ! ! ! @@ -1786,11 +1851,14 @@ subroutine trop_update ! inputs: (in-scope variables, module constants) ! ! imon - integer, month of the year ! ! me - integer, print message control flag ! +! inputs: (CCPP Interstitials) ! +! aeros_file - external aerosol data file name ! ! ! ! outputs: (module variables) ! -! ! -! external module variables: (in physparam) ! -! aeros_file - external aerosol data file name ! +! +! outputs: (CCPP error-handling) ! +! errmsg - Error message ! +! errflg - Error flag ! ! ! ! internal module variables: ! ! kprfg ( IMXAE*JMXAE) - aeros profile index ! @@ -1806,8 +1874,11 @@ subroutine trop_update ! ! ! ================================================================== ! -! --- inputs: ( none ) -! --- output: ( none ) +! --- inputs: (CCPP Interstitials) + character(len=26),intent(in) :: aeros_file +! --- output: (CCPP error handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: ! real (kind=kind_io8) :: cmix(NXC), denn, tem @@ -1821,6 +1892,11 @@ subroutine trop_update ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + ! --- ... reading climatological aerosols data inquire (file=aeros_file, exist=file_exist) @@ -1838,7 +1914,10 @@ subroutine trop_update print *,' Requested aerosol data file "',aeros_file, & & '" not found!' print *,' *** Stopped in subroutine trop_update !!' - stop + errflg = 1 + errmsg = 'ERROR(trop_update):Requested aerosol data file '// & + & aeros_file // ' not found.' + return endif ! end if_file_exist_block !$omp parallel do private(i,j,m) @@ -1930,10 +2009,10 @@ end subroutine trop_update !> This subroutine searches historical volcanic data sets to find and !! read in monthly 45-degree lat-zone band of optical depth. !-------------------------------- - subroutine volc_update + subroutine volc_update(errflg, errmsg) !................................ ! --- inputs: (in scope variables, module variables) -! --- outputs: (module variables) +! --- outputs: (CCPP error handling) ! ================================================================== ! ! ! @@ -1957,6 +2036,10 @@ subroutine volc_update ! kyrsav - integer, the year of data in use in the input file ! ! kmonsav - integer, the month of data in use in the input file ! ! ! +! outputs: (CCPP error-handling) ! +! errmsg - Error message ! +! errflg - Error flag ! +! ! ! subroutines called: none ! ! ! ! usage: call volc_aerinit ! @@ -1968,6 +2051,9 @@ subroutine volc_update ! --- output: (module variables) ! integer :: ivolae(:,:,:), kyrstr, kyrend, kyrsav, kmonsav +! --- output: (CCPP error-handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: integer :: i, j, k @@ -1978,6 +2064,11 @@ subroutine volc_update ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + kmonsav = imon if ( kyrstr<=iyear .and. iyear<=kyrend ) then ! use previously input data @@ -2032,7 +2123,10 @@ subroutine volc_update print *,' Requested volcanic data file "', & & volcano_file,'" not found!' print *,' *** Stopped in subroutine VOLC_AERINIT !!' - stop + errflg = 1 + errmsg = 'ERROR(volc_update): Requested volcanic data '// & + & 'file '//volcano_file//' not found!' + return endif ! end if_file_exist_block endif ! end if_iyear_block @@ -2083,9 +2177,9 @@ end subroutine aer_update !----------------------------------- subroutine setaer & & ( prsi,prsl,prslk,tvly,rhlay,slmsk,tracer,aerfld,xlon,xlat, & ! --- inputs - & IMAX,NLAY,NLP1, lsswr,lslwr, & - & aerosw,aerolw & ! --- outputs - &, aerodp & + & IMAX,NLAY,NLP1, lsswr,lslwr,iaermdl,iaerflg,top_at_1, & + & con_pi,con_rd,con_g,aerosw,aerolw, & ! --- outputs + & aerodp, errflg, errmsg & & ) ! ================================================================== ! @@ -2109,6 +2203,12 @@ subroutine setaer & ! NLAY,NLP1-vertical dimensions of arrays 1 ! ! lsswr,lslwr ! ! - logical flags for sw/lw radiation calls 1 ! +! con_pi - Physical constant (pi) ! +! con_t0c - Physical constant (temperature kelvin at zero celcius) ! +! con_c - Physical constant (speed of light) ! +! iaermdl - tropospheric aerosol model scheme flag ! +! iaerflg - aerosol effect control flag ! +! top_at_1 - Vertical ordering convection flag ! ! ! ! outputs: ! ! aerosw - aeros opt properties for sw IMAX*NLAY*NBDSW*NF_AESW! @@ -2122,18 +2222,16 @@ subroutine setaer & ! tau_gocart - 550nm aeros opt depth IMAX*NLAY*MAX_NUM_GRIDCOMP! !! aerodp - vertically integrated optical depth IMAX*NSPC1 ! ! ! -! external module variable: (in physparam) ! -! iaerflg - aerosol effect control flag (volc,lw,sw, 3-dig) ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! +! ! +! internal module variable: ! ! laswflg - tropospheric aerosol control flag for sw radiation ! ! =f: no sw aeros calc. =t: do sw aeros calc. ! ! lalwflg - tropospheric aerosol control flag for lw radiation ! ! =f: no lw aeros calc. =t: do lw aeros calc. ! ! lavoflg - control flag for stratospheric vocanic aerosols ! ! =t: add volcanic aerosols to the background aerosols ! -! ivflip - control flag for direction of vertical index ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! ! ! internal module variable: (set by subroutine aer_init) ! ! ivolae - stratosphere volcanic aerosol optical depth (fac 1.e4) ! ! 12*4*10 ! @@ -2144,8 +2242,8 @@ subroutine setaer & ! ================================================================== ! ! --- inputs: - integer, intent(in) :: IMAX, NLAY, NLP1 - + integer, intent(in) :: IMAX, NLAY, NLP1, iaermdl, iaerflg + real (kind=kind_phys), intent(in) :: con_pi, con_rd, con_g real (kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, & & prslk, tvly, rhlay real (kind=kind_phys), dimension(:), intent(in) :: xlon, xlat, & @@ -2153,7 +2251,7 @@ subroutine setaer & real (kind=kind_phys), dimension(:,:,:),intent(in):: tracer real (kind=kind_phys), dimension(:,:,:),intent(in):: aerfld - logical, intent(in) :: lsswr, lslwr + logical, intent(in) :: lsswr, lslwr, top_at_1 ! --- outputs: @@ -2161,6 +2259,8 @@ subroutine setaer & & aerosw, aerolw real (kind=kind_phys), dimension(:,:) , intent(out) :: aerodp + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys), parameter :: psrfh = 5.0 ! ref press (mb) for upper bound @@ -2177,10 +2277,16 @@ subroutine setaer & logical :: laddlw=.false., laerlw=.false. ! --- conversion constants - real (kind=kind_phys), parameter :: rdg = 180.0 / con_pi - real (kind=kind_phys), parameter :: rovg = 0.001 * con_rd / con_g + real (kind=kind_phys) :: rdg + real (kind=kind_phys) :: rovg !===> ... begin here + rdg = 180._kind_phys / con_pi + rovg = 0.001_kind_phys * con_rd / con_g + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 do m = 1, NF_AESW do j = 1, NBDSW @@ -2235,7 +2341,7 @@ subroutine setaer & lab_do_IMAX : do i = 1, IMAX - lab_if_flip : if (ivflip == 1) then ! input from sfc to toa + lab_if_flip : if (.not. top_at_1) then ! input from sfc to toa do k = 1, NLAY prsln(k) = log(prsi(i,k)) @@ -2290,10 +2396,10 @@ subroutine setaer & ! --- inputs: & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer, & & alon,alat,slmsk, laersw,laerlw, & - & IMAX,NLAY,NLP1, & + & IMAX,NLAY,NLP1,top_at_1, & ! & IMAX,NLAY,NLP1,NSPC1, & ! --- outputs: - & aerosw,aerolw,aerodp & + & aerosw,aerolw,aerodp,errflg,errmsg & & ) ! @@ -2302,10 +2408,10 @@ subroutine setaer & call aer_property_gocart & ! --- inputs: & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer,aerfld, & - & alon,alat,slmsk,laersw,laerlw, & + & alon,alat,slmsk,laersw,laerlw,con_rd, & & IMAX,NLAY,NLP1, & ! --- outputs: - & aerosw,aerolw,aerodp & + & aerosw,aerolw,aerodp,errflg,errmsg & & ) endif ! end if_iaerflg_block @@ -2392,7 +2498,7 @@ subroutine setaer & endif enddo - if ( ivflip == 0 ) then ! input data from toa to sfc + if (top_at_1) then ! input data from toa to sfc ! --- find lower boundary of stratosphere @@ -2627,7 +2733,7 @@ subroutine setaer & endif ! end if_NLWBND_block endif ! end if_laddlw_block - endif ! end if_ivflip_block + endif ! end if_top_at_1_block endif ! end if_lavoflg_block ! @@ -2667,8 +2773,8 @@ end subroutine setaer subroutine aer_property & & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer, & ! --- inputs: & alon,alat,slmsk, laersw,laerlw, & - & IMAX,NLAY,NLP1, & - & aerosw,aerolw,aerodp & ! --- outputs: + & IMAX,NLAY,NLP1,top_at_1, & + & aerosw,aerolw,aerodp,errflg,errmsg & ! --- outputs: & ) ! ================================================================== ! @@ -2694,6 +2800,7 @@ subroutine aer_property & ! IMAX - horizontal dimension of arrays 1 ! ! NLAY,NLP1-vertical dimensions of arrays 1 ! !! NSPC - num of species for optional aod output fields 1 ! +! top_at_1 - vertical ordering flag ! ! ! ! outputs: ! ! aerosw - aeros opt properties for sw IMAX*NLAY*NBDSW*NF_AESW! @@ -2706,16 +2813,14 @@ subroutine aer_property & ! (:,:,:,3): asymmetry parameter ! !! aerodp - vertically integrated aer-opt-depth IMAX*NSPC+1 ! ! ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! +! ! ! module parameters and constants: ! ! NSWBND - total number of actual sw spectral bands computed ! ! NLWBND - total number of actual lw spectral bands computed ! ! NSWLWBD - total number of sw+lw bands computed ! ! ! -! external module variables: (in physparam) ! -! ivflip - control flag for direction of vertical index ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! ! ! module variable: (set by subroutine aer_init) ! ! kprfg - aerosols profile index IMXAE*JMXAE ! ! 1:ant 2:arc 3:cnt 4:mar 5:des 6:marme 7:cntme ! @@ -2735,7 +2840,7 @@ subroutine aer_property & ! --- inputs: integer, intent(in) :: IMAX, NLAY, NLP1 ! integer, intent(in) :: IMAX, NLAY, NLP1, NSPC - logical, intent(in) :: laersw, laerlw + logical, intent(in) :: laersw, laerlw, top_at_1 real (kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, & & prslk, tvly, rhlay, dz, hz @@ -2747,6 +2852,8 @@ subroutine aer_property & real (kind=kind_phys), dimension(:,:,:,:), intent(out) :: & & aerosw, aerolw real (kind=kind_phys), dimension(:,:) , intent(out) :: aerodp + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys), dimension(NCM) :: cmix @@ -2773,6 +2880,11 @@ subroutine aer_property & ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + !> -# Map aerosol data to model grids !! - Map grid in longitude direction, lon from 0 to 355 deg resolution !! - Map grid in latitude direction, lat from 90n to 90s in 5 deg resolution @@ -2798,7 +2910,9 @@ subroutine aer_property & if ( i3 > IMXAE ) then print *,' ERROR! In setclimaer alon>360. ipt =',i, & & ', dltg,alon,tlon,dlon =',dltg,alon(i),tmp1,dtmp - stop + errflg = 1 + errmsg = 'ERROR(aer_property)' + return endif elseif ( dtmp >= f_zero ) then i1 = i3 @@ -2816,7 +2930,9 @@ subroutine aer_property & if ( i3 < 1 ) then print *,' ERROR! In setclimaer alon< 0. ipt =',i, & & ', dltg,alon,tlon,dlon =',dltg,alon(i),tmp1,dtmp - stop + errflg = 1 + errmsg = 'ERROR(aer_property)' + return endif endif enddo lab_do_IMXAE @@ -2835,7 +2951,9 @@ subroutine aer_property & if ( j3 >= JMXAE ) then print *,' ERROR! In setclimaer alat<-90. ipt =',i, & & ', dltg,alat,tlat,dlat =',dltg,alat(i),tmp2,dtmp - stop + errflg = 1 + errmsg = 'ERROR(aer_property)' + return endif elseif ( dtmp >= f_zero ) then j1 = j3 @@ -2853,7 +2971,9 @@ subroutine aer_property & if ( j3 < 1 ) then print *,' ERROR! In setclimaer alat>90. ipt =',i, & & ', dltg,alat,tlat,dlat =',dltg,alat(i),tmp2,dtmp - stop + errflg = 1 + errmsg = 'ERROR(aer_property)' + return endif endif enddo lab_do_JMXAE @@ -2950,14 +3070,16 @@ subroutine aer_property & dz1(k) = dz (i,k) enddo - lab_if_flip : if (ivflip == 1) then ! input from sfc to toa + lab_if_flip : if (.not. top_at_1) then ! input from sfc to toa if ( prsi(i,1) > 100.0 ) then rps = f_one / prsi(i,1) else print *,' !!! (1) Error in subr radiation_aerosols:', & & ' unrealistic surface pressure =', i,prsi(i,1) - stop + errflg = 1 + errmsg = 'ERROR(aer_property): Unrealistic surface pressure' + return endif ii = 1 @@ -3030,7 +3152,7 @@ subroutine aer_property & !> -# Call radclimaer() to calculate SW/LW aerosol optical properties !! for the corresponding frequency bands. - call radclimaer + call radclimaer(top_at_1) ! --- inputs: (in-scope variables) ! --- outputs: (in-scope variables) @@ -3091,7 +3213,7 @@ subroutine aer_property & !! troposphere, aerosol distribution at each grid point is composed !! from up to six components out of ten different substances. !-------------------------------- - subroutine radclimaer + subroutine radclimaer(top_at_1) !................................ ! --- inputs: (in scope variables) @@ -3127,6 +3249,7 @@ subroutine radclimaer parameter (crt1=30.0, crt2=0.03333) ! --- inputs: + logical, intent(in) :: top_at_1 ! --- outputs: ! --- locals: @@ -3329,7 +3452,7 @@ subroutine radclimaer ! !===> ... smooth profile at domain boundaries ! - if ( ivflip == 0 ) then ! input from toa to sfc + if (top_at_1) then ! input from toa to sfc do ib = 1, NSWLWBD do kk = 2, NLAY @@ -3404,8 +3527,8 @@ end subroutine aer_property !>\section gel_go_ini General Algorithm !----------------------------------- subroutine gocart_aerinit & - & ( solfwv, eirfwv, me & - & ) + & ( solfwv, eirfwv, me, & + & errflg, errmsg) ! ================================================================== ! ! ! @@ -3419,7 +3542,9 @@ subroutine gocart_aerinit & ! eirfwv(NWVTIR) - ir flux(273k) for each individual wavenum (w/m2)! ! me - print message control flag ! ! ! -! outputs: (to module variables) ! +! outputs: (CCPP error handling) ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! ! ! ! module variables: ! ! NWVSOL - num of wvnum regions where solar flux is constant ! @@ -3445,7 +3570,9 @@ subroutine gocart_aerinit & integer, intent(in) :: me -! --- output: ( none ) +! --- output: (CCPP error handling) + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys), dimension(kaerbndi,kcm1) :: & @@ -3476,13 +3603,20 @@ subroutine gocart_aerinit & ! !===> ... begin here + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + ! ! --- ... invoke gocart aerosol initialization if (KCM /= ntrcaerm ) then print *, 'ERROR in # of gocart aer species',KCM - stop 3000 + errflg = 1 + errmsg = 'ERROR(gocart_init): Incorrect # of species' + return endif ! --- ... aloocate and input aerosol optical data @@ -3801,7 +3935,9 @@ subroutine rd_gocart_luts else print *,' Requested luts file ',trim(fin),' not found' print *,' ** Stopped in rd_gocart_luts ** ' - stop 1220 + errflg = 1 + errmsg = 'Requested luts file '//trim(fin)//' not found' + return endif ! end if_file_exist_block iradius = 5 @@ -3866,7 +4002,9 @@ subroutine rd_gocart_luts else print *,' Requested luts file ',trim(fin),' not found' print *,' ** Stopped in rd_gocart_luts ** ' - stop 1222 + errflg = 1 + errmsg = 'Requested luts file '//trim(fin)//' not found' + return endif ! end if_file_exist_block ibeg = radius_lower(ib) - kcm1 @@ -3977,7 +4115,7 @@ subroutine optavg_gocart ! nswbnd - total number of sw spectral bands ! ! nlwbnd - total number of lw spectral bands ! ! ! -! external module variables: (in physparam) ! +! external module variables: ! ! laswflg - control flag for sw spectral region ! ! lalwflg - control flag for lw spectral region ! ! ! @@ -4193,10 +4331,10 @@ subroutine aer_property_gocart & ! --- inputs: & ( prsi,prsl,prslk,tvly,rhlay,dz,hz,tracer,aerfld, & - & alon,alat,slmsk, laersw,laerlw, & + & alon,alat,slmsk, laersw,laerlw,con_rd, & & imax,nlay,nlp1, & ! --- outputs: - & aerosw,aerolw,aerodp & + & aerosw,aerolw,aerodp,errflg,errmsg & & ) ! ================================================================== ! @@ -4222,6 +4360,7 @@ subroutine aer_property_gocart & ! - logical flag for sw/lw aerosol calculations ! ! IMAX - horizontal dimension of arrays 1 ! ! NLAY,NLP1-vertical dimensions of arrays 1 ! +! con_rd - Physical constant (gas constant for dry air) ! ! ! ! outputs: ! ! aerosw - aeros opt properties for sw IMAX*NLAY*NBDSW*NF_AESW! @@ -4233,17 +4372,14 @@ subroutine aer_property_gocart & ! (:,:,:,2): single scattering albedo ! ! (:,:,:,3): asymmetry parameter ! ! aerodp - vertically integrated aer-opt-depth IMAX*NSPC+1 ! +! errflg - CCPP error flag ! +! errmsg - CCPP error message ! ! ! ! module parameters and constants: ! ! NSWBND - total number of actual sw spectral bands computed ! ! NLWBND - total number of actual lw spectral bands computed ! ! NSWLWBD - total number of sw+lw bands computed ! ! ! -! external module variables: (in physparam) ! -! ivflip - control flag for direction of vertical index ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! ! ! module variable: (set by subroutine aer_init) ! ! ! ! usage: call aer_property_gocart ! @@ -4253,7 +4389,7 @@ subroutine aer_property_gocart & ! --- inputs: integer, intent(in) :: IMAX, NLAY, NLP1 logical, intent(in) :: laersw, laerlw - + real (kind=kind_phys), intent(in) :: con_rd real (kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, & & prslk, tvly, rhlay, dz, hz real (kind=kind_phys), dimension(:), intent(in) :: alon, alat, & @@ -4265,6 +4401,8 @@ subroutine aer_property_gocart & real (kind=kind_phys), dimension(:,:,:,:), intent(out) :: & & aerosw, aerolw real (kind=kind_phys), dimension(:,:) , intent(out) :: aerodp + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! --- locals: real (kind=kind_phys), dimension(nlay,nswlwbd):: tauae,ssaae,asyae @@ -4279,6 +4417,11 @@ subroutine aer_property_gocart & ! !===> ... begin here ! + +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + lab_do_IMAXg : do i = 1, IMAX ! --- initialize tauae, ssaae, asyae diff --git a/physics/radiation_astronomy.f b/physics/radiation_astronomy.f index 1d60c74ef..b25c89a8c 100644 --- a/physics/radiation_astronomy.f +++ b/physics/radiation_astronomy.f @@ -21,7 +21,7 @@ ! input: ! ! ( jdate,kyear,deltsw,deltim,lsol_chg, me ) ! ! output: ! -! ( slag,sdec,cdec,solcon ) ! +! ( slag,sdec,cdec,solcon,errmsg,errflg) ! ! ! ! 'coszmn' -- compute cosin of zenith angles ! ! input: ! @@ -29,11 +29,6 @@ ! output: ! ! ( coszen,coszdg ) ! ! ! -! ! -! external modules referenced: ! -! 'module physparam' in 'physparam.f' ! -! 'module physcons' in 'physcons.f' ! -! ! ! program history log: ! ! - a collection of programs to track solar-earth position ! ! may 1977 --- ray orzol (gfdl) created program compjd to ! @@ -93,8 +88,7 @@ !> This module sets up astronomy quantities for solar radiation calculations. module module_radiation_astronomy ! - use physparam, only : isolar, solar_file, kind_phys - use physcons, only : con_solr, con_solr_old, con_pi + use machine, only : kind_phys use module_iounitdef, only : NIRADSF ! implicit none @@ -107,17 +101,17 @@ module module_radiation_astronomy ! & VTAGAST='NCEP-Radiation_astronomy v5.1 Nov 2012 ' ! Parameter constants - real (kind=kind_phys), parameter :: degrad = 180.0/con_pi - real (kind=kind_phys), parameter :: tpi = 2.0 * con_pi - real (kind=kind_phys), parameter :: hpi = 0.5 * con_pi + real (kind=kind_phys) :: degrad + real (kind=kind_phys) :: tpi + real (kind=kind_phys) :: hpi + real (kind=kind_phys) :: pid12 real (kind=kind_phys), parameter :: f12 = 12.0 real (kind=kind_phys), parameter :: f3600 = 3600.0 real (kind=kind_phys), parameter :: czlimt = 0.0001 ! ~ cos(89.99427) - real (kind=kind_phys), parameter :: pid12 = con_pi/f12 ! angle per hour ! real (kind=kind_phys), parameter :: pid12 = (2.0*asin(1.0))/f12 ! Module variable (to be set in module_radiation_astronomy::sol_init): - real (kind=kind_phys), public :: solc0 = con_solr + real (kind=kind_phys), public :: solc0 integer :: isolflg = 10 character(26) :: solar_fname = ' ' @@ -133,7 +127,6 @@ module module_radiation_astronomy real (kind=kind_phys) :: anginc=0.0 ! saved monthly solar constants (isolflg=4 only) real (kind=kind_phys) :: smon_sav(12) - data smon_sav(1:12) / 12*con_solr / ! saved year of data used integer :: iyr_sav =0 @@ -152,7 +145,7 @@ module module_radiation_astronomy !!\param me print message control flag !>\section sol_init_gen sol_init General Algorithm subroutine sol_init & - & ( me ) ! --- inputs + & ( me, isolar, solar_file, con_solr, con_solr_old, con_pi ) ! --- inputs ! --- outputs: ( none ) ! =================================================================== ! @@ -161,18 +154,16 @@ subroutine sol_init & ! ! ! inputs: ! ! me - print message control flag ! -! ! -! outputs: (to module variable) ! -! ( none ) ! -! ! -! external module variable: (in physparam) ! -! isolar - = 0: use the old fixed solar constant in "physcon" ! -! =10: use the new fixed solar constant in "physcon" ! +! isolar - = 0: use the old fixed solar constant in "GFS_typedefs" ! +! =10: use the new fixed solar constant in "GFS_typedefs" ! ! = 1: use noaa ann-mean tsi tbl abs-scale with cyc apprx ! ! = 2: use noaa ann-mean tsi tbl tim-scale with cyc apprx ! ! = 3: use cmip5 ann-mean tsi tbl tim-scale with cyc apprx! ! = 4: use cmip5 mon-mean tsi tbl tim-scale with cyc apprx! -! solar_file- external solar constant data table ! +! solar_file - external solar constant data table ! +! ! +! outputs: (to module variable) ! +! ( none ) ! ! ! ! internal module variable: ! ! isolflg - internal solar constant scheme control flag ! @@ -189,23 +180,33 @@ subroutine sol_init & implicit none ! --- input: - integer, intent(in) :: me - + integer, intent(in) :: me, isolar + character(len=26), intent(in) :: solar_file + real(kind=kind_phys), intent(in) :: con_solr, con_solr_old, con_pi ! --- output: ( none ) ! --- local: logical :: file_exist + integer :: imonth ! !===> ... begin here ! if ( me == 0 ) print *, VTAGAST !print out version tag + degrad = 180.0/con_pi + tpi = 2.0 * con_pi + hpi = 0.5 * con_pi + pid12 = con_pi/f12 + ! --- initialization isolflg = isolar solc0 = con_solr solar_fname = solar_file iyr_sav = 0 nstp = 6 + do imonth = 1,12 + smon_sav(imonth) = con_solr + enddo if ( isolar == 0 ) then solc0 = con_solr_old @@ -326,7 +327,7 @@ end subroutine sol_init !----------------------------------- subroutine sol_update & & ( jdate,kyear,deltsw,deltim,lsol_chg, me, & ! --- inputs - & slag, sdec, cdec, solcon & ! --- outputs + & slag, sdec, cdec, solcon, con_pi, errmsg, errflg & ! --- outputs & ) ! =================================================================== ! @@ -348,6 +349,8 @@ subroutine sol_update & ! slag - equation of time in radians ! ! sdec, cdec - sin and cos of the solar declination angle ! ! solcon - sun-earth distance adjusted solar constant (w/m2) ! +! errmsg - CCPP error message ! +! errflg - CCPP error flag ! ! ! ! ! ! module variable: ! @@ -381,10 +384,12 @@ subroutine sol_update & integer, intent(in) :: jdate(:), kyear, me logical, intent(in) :: lsol_chg - real (kind=kind_phys), intent(in) :: deltsw, deltim + real (kind=kind_phys), intent(in) :: deltsw, deltim, con_pi ! --- output: real (kind=kind_phys), intent(out) :: slag, sdec, cdec, solcon + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! --- locals: real (kind=kind_phys), parameter :: hrday = 1.0/24.0 ! frc day/hour @@ -403,6 +408,10 @@ subroutine sol_update & ! !===> ... begin here ! +! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + ! --- ... forecast time iyear = jdate(1) imon = jdate(2) @@ -425,7 +434,10 @@ subroutine sol_update & inquire (file=solar_fname, exist=file_exist) if ( .not. file_exist ) then print *,' !!! ERROR! Can not find solar constant file!!!' - stop + errflg = 1 + errmsg = "ERROR(radiation_astronomy): solar constant file"//& + & " not found" + return else iyr = iyear @@ -580,7 +592,7 @@ subroutine sol_update & !> -# Call solar() call solar & ! --- inputs: - & ( jd, fjd, & + & ( jd, fjd, con_pi, & ! --- outputs: & r1, dlt, alp & & ) @@ -644,7 +656,7 @@ end subroutine sol_update !>\section solar_gen solar General Algorithm !----------------------------------- subroutine solar & - & ( jd, fjd, & ! --- inputs + & ( jd, fjd, con_pi, & ! --- inputs & r1, dlt, alp & ! --- outputs & ) @@ -676,7 +688,7 @@ subroutine solar & implicit none ! --- inputs: - real (kind=kind_phys), intent(in) :: fjd + real (kind=kind_phys), intent(in) :: fjd, con_pi integer, intent(in) :: jd ! --- outputs: diff --git a/physics/radiation_cloud_overlap.F90 b/physics/radiation_cloud_overlap.F90 index d6169b3e5..737b9be61 100644 --- a/physics/radiation_cloud_overlap.F90 +++ b/physics/radiation_cloud_overlap.F90 @@ -4,7 +4,7 @@ !>\defgroup rad_cld_ovr_mod Radiation Cloud Overlap Module !! This module contains the calculation of cloud overlap parameters for both RRTMG and RRTMGP. module module_radiation_cloud_overlap - use physparam, only : kind_phys + use machine, only : kind_phys implicit none public :: cmp_dcorr_lgth diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index 7255f1578..ca9ea6e81 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -16,7 +16,7 @@ ! inputs: ! ! ( si, NLAY, imp_physics, me ) ! ! outputs: ! -! ( none ) ! +! ( errflg, errmsg ) ! ! ! ! 'radiation_clouds_prop' --- radiation cloud properties ! ! obtained from various cloud schemes ! @@ -29,8 +29,8 @@ ! imp_physics, imp_physics_nssl, 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, iovr_rand, iovr_maxrand, iovr_max, ! -! iovr_dcorr, iovr_exp, iovr_exprand, idcor_con, ! +! imp_physics_mg, iovr, iovr_rand, iovr_maxrand, iovr_max, ! +! iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, ! ! idcor_hogan, idcor_oreopoulos, ! ! imfdeepcnv, imfdeepcnv_gf, do_mynnedmf, lgfdlmprad, ! ! uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, ! @@ -68,12 +68,8 @@ ! ** fu's scheme need to be normalized by snow density (g/m**3/1.0e6)! ! ! ! external modules referenced: ! -! ! -! 'module physparam' in 'physparam.f' ! -! 'module physcons' in 'physcons.f' ! ! 'module module_microphysics' in 'module_bfmicrophysics.f' ! ! ! -! ! ! program history log: ! ! nov 1992, y.h., k.a.c, a.k. - cloud parameterization ! ! 'cldjms' patterned after slingo and slingo's work (jgr, ! @@ -169,13 +165,6 @@ !> This module computes cloud related quantities for radiation computations. module module_radiation_clouds ! - use physparam, only : icldflg, iovr, idcor, & - & lcrick, lcnorm, lnoprec, & - & ivflip - use physcons, only : con_fvirt, con_ttp, con_rocp, & - & con_t0c, con_pi, con_g, con_rd, & - & con_thgni, decorr_con - use module_microphysics, only : rsipath2 use module_iounitdef, only : NICLTUN use module_radiation_cloud_overlap, only: cmp_dcorr_lgth, & & get_alpha_exper @@ -191,9 +180,7 @@ module module_radiation_clouds ! & VTAGCLD='NCEP-Radiation_clouds v5.0 Aug 2012 ' ! --- set constant parameters - real (kind=kind_phys), parameter :: gfac=1.0e5/con_g & - &, gord=con_g/con_rd - + real (kind=kind_phys) :: gfac,gord integer, parameter, public :: NF_CLDS = 9 !< number of fields in cloud array integer, parameter, public :: NK_CLDS = 3 !< number of cloud vertical domains @@ -265,10 +252,7 @@ module module_radiation_clouds !!\param me print control flag !>\section cld_init General Algorithm subroutine cld_init & - & ( si, NLAY, imp_physics, me ) ! --- inputs -! --- outputs: -! ( none ) - + & ( si, NLAY, imp_physics, me, con_g, con_rd, errflg, errmsg ) ! =================================================================== ! ! ! ! abstract: cld_init is an initialization program for cloud-radiation ! @@ -280,31 +264,12 @@ subroutine cld_init & ! NLAY : vertical layer number ! ! imp_physics : MP identifier ! ! me : print control flag ! +! imp_physics : cloud microphysics scheme control flag ! ! ! -! outputs: (none) ! -! to module variables ! +! outputs: ! +! errflg : CCPP error flag ! +! errmsg : CCPP error message ! ! ! -! external module variables: (in physparam) ! -! icldflg : cloud optical property scheme control flag ! -! =0: abort! diagnostic cloud method discontinued ! -! =1: model use prognostic cloud method ! -! imp_physics : cloud microphysics scheme control flag ! -! =99: zhao/carr/sundqvist microphysics cloud ! -! =98: zhao/carr/sundqvist microphysics cloud+pdfcld! -! =11: GFDL microphysics cloud ! -! =8: Thompson microphysics ! -! =6: WSM6 microphysics ! -! =10: MG microphysics ! -! iovr : control flag for cloud overlapping scheme ! -! =0: random overlapping clouds ! -! =1: max/ran overlapping clouds ! -! =2: maximum overlap clouds (mcica only) ! -! =3: decorrelation-length overlap (mcica only) ! -! =4: exponential cloud overlap (AER; mcica only) ! -! =5: exponential-random overlap (AER; mcica only) ! -! ivflip : control flag for direction of vertical index ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! ! usage: call cld_init ! ! ! ! subroutines called: rhtable ! @@ -316,71 +281,51 @@ subroutine cld_init & ! --- inputs: integer, intent(in) :: NLAY, me, imp_physics - real (kind=kind_phys), intent(in) :: si(:) + real (kind=kind_phys), intent(in) :: si(:), con_g, con_rd -! --- outputs: (none) - -! --- locals: - integer :: k, kl, ier +! --- outputs: + integer, intent(out) :: errflg + character(len=*), intent(out) :: errmsg ! !===> ... begin here ! -! --- set up module variables - - if (me == 0) print *, VTAGCLD !print out version tag - - if ( icldflg == 0 ) then - print *,' - Diagnostic Cloud Method has been discontinued' - stop - - else - if (me == 0) then - print *,' - Using Prognostic Cloud Method' - if (imp_physics == 99) then +! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Initialze module parameters + gfac = 1.0e5/con_g + gord = con_g/con_rd + + if (me == 0) then + print *, VTAGCLD !print out version tag + print *,' - Using Prognostic Cloud Method' + if (imp_physics == 99) then print *,' --- Zhao/Carr/Sundqvist microphysics' - elseif (imp_physics == 98) then + elseif (imp_physics == 98) then print *,' --- zhao/carr/sundqvist + pdf cloud' - elseif (imp_physics == 11) then + elseif (imp_physics == 11) then print *,' --- GFDL Lin cloud microphysics' - elseif (imp_physics == 8) then + elseif (imp_physics == 8) then print *,' --- Thompson cloud microphysics' - elseif (imp_physics == 6) then + elseif (imp_physics == 6) then print *,' --- WSM6 cloud microphysics' - elseif (imp_physics == 10) then + elseif (imp_physics == 10) then print *,' --- MG cloud microphysics' - elseif (imp_physics == 15) then + elseif (imp_physics == 15) then print *,' --- Ferrier-Aligo cloud microphysics' - elseif (imp_physics == 17) then + elseif (imp_physics == 17) then print *,' --- NSSL cloud microphysics' - else + else print *,' !!! ERROR in cloud microphysc specification!!!', & & ' imp_physics (NP3D) =',imp_physics - stop - endif - endif + errflg = 1 + errmsg = 'ERROR(cld_init): cloud mp specification is not'// & + & ' valid' + return + endif endif - -!> - Compute the top of BL cld (llyr), which is the topmost non -!! cld(low) layer for stratiform (at or above lowest 0.1 of the -!! atmosphere). - - if ( ivflip == 0 ) then ! data from toa to sfc - lab_do_k0 : do k = NLAY, 2, -1 - kl = k - if (si(k) < 0.9e0) exit lab_do_k0 - enddo lab_do_k0 - - llyr = kl - else ! data from sfc to top - lab_do_k1 : do k = 2, NLAY - kl = k - if (si(k) < 0.9e0) exit lab_do_k1 - enddo lab_do_k1 - - llyr = kl - 1 - endif ! end_if_ivflip - ! return !................................... @@ -394,20 +339,21 @@ subroutine radiation_clouds_prop & & ( plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, & ! --- inputs: & ccnd, ncndl, cnvw, cnvc, tracer1, & & xlat, xlon, slmsk, dz, delp, IX, LM, NLAY, NLP1, & - & deltaq, sup, me, icloud, kdt, & + & deltaq, sup, dcorr_con, me, icloud, kdt, & & ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, ntclamt, & & imp_physics, imp_physics_nssl, 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, iovr_rand, iovr_maxrand, iovr_max, & - & iovr_dcorr, iovr_exp, iovr_exprand, idcor_con, & - & idcor_hogan, idcor_oreopoulos, & + & 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, do_mynnedmf, lgfdlmprad, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & & effrl_inout, effri_inout, effrs_inout, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & - & dzlay, latdeg, julian, yearlen, gridkm, & + & dzlay, latdeg, julian, yearlen, gridkm, top_at_1, si, & + & con_ttp, con_pi, con_g, con_rd, con_thgni, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, & ! --- outputs: & cld_rwp, cld_rerain, cld_swp, cld_resnow, & & clds, mtop, mbot, de_lgth, alpha & @@ -490,15 +436,17 @@ subroutine radiation_clouds_prop & ! imp_physics_zhao_carr : Zhao-Carr microphysics scheme ! ! imp_physics_zhao_carr_pdf : Zhao-Carr microphysics scheme with PDF clouds ! imp_physics_mg : Morrison-Gettelman microphysics scheme ! -! iovr_rand : choice of cloud-overlap: random (=0) -! iovr_maxrand : choice of cloud-overlap: maximum random (=1) -! iovr_max : choice of cloud-overlap: maximum (=2) -! iovr_dcorr : choice of cloud-overlap: decorrelation length (=3) -! iovr_exp : choice of cloud-overlap: exponential (=4) -! iovr_exprand : choice of cloud-overlap: exponential random (=5) -! idcor_con : choice for decorrelation-length: Use constant value (=0) -! idcor_hogan : choice for decorrelation-length: (=1) -! idcor_oreopoulos: choice for decorrelation-length: (=2) +! iovr : choice of cloud-overlap ! +! iovr_rand : flag of cloud-overlap: random (=0) ! +! iovr_maxrand : flag of cloud-overlap: maximum random (=1) ! +! iovr_max : flag of cloud-overlap: maximum (=2) ! +! iovr_dcorr : flag of cloud-overlap: decorrelation length(=3) ! +! iovr_exp : flag of cloud-overlap: exponential (=4) ! +! iovr_exprand : flag of cloud-overlap: exponential random (=5) ! +! idcor : choice for decorrelation-length ! +! idcor_con : flag for decorrelation-length: Use constant value (=0) +! idcor_hogan : flag for decorrelation-length: (=1) ! +! idcor_oreopoulos: flag for decorrelation-length: (=2) ! ! imfdeepcnv : flag for mass-flux deep convection scheme ! ! imfdeepcnv_gf : flag for scale- & aerosol-aware Grell-Freitas scheme (GSD) ! do_mynnedmf : flag for MYNN-EDMF ! @@ -506,6 +454,7 @@ subroutine radiation_clouds_prop & ! uni_cld : logical - true for cloud fraction from shoc ! ! lmfshal : logical - true for mass flux shallow convection ! ! lmfdeep2 : logical - true for mass flux deep convection ! +! top_at_1 : logical - true if ordered from toa-2-sfc ! ! cldcov : layer cloud fraction (used when uni_cld=.true. ! ! clouds1 : layer total cloud fraction ! effrl, : effective radius for liquid water @@ -524,7 +473,15 @@ subroutine radiation_clouds_prop & ! latdeg(ix) : latitude (in degrees 90 -> -90) ! ! julian : day of the year (fractional julian day) ! ! yearlen : current length of the year (365/366 days) ! -! gridkm : grid length in km +! gridkm : grid length in km ! +! lmfshal : mass-flux shallow conv scheme flag ! +! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -542,20 +499,7 @@ subroutine radiation_clouds_prop & ! mtop (IX,3) : vertical indices for low, mid, hi cloud tops ! ! mbot (IX,3) : vertical indices for low, mid, hi cloud bases ! ! de_lgth(ix) : clouds decorrelation length (km) ! -! alpha(ix,nlay) : alpha decorrelation parameter -! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lmfshal : mass-flux shallow conv scheme flag ! -! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! +! alpha(ix,nlay) : alpha decorrelation parameter ! ! ! ! ==================== end of description ===================== ! implicit none @@ -577,19 +521,21 @@ subroutine radiation_clouds_prop & & imp_physics_mg ! Flag for MG scheme integer, intent(in) :: & + & iovr, ! & iovr_rand, ! Flag for random cloud overlap method & iovr_maxrand, ! Flag for maximum-random cloud overlap method & iovr_max, ! Flag for maximum cloud overlap method & iovr_dcorr, ! Flag for decorrelation-length cloud overlap method & iovr_exp, ! Flag for exponential cloud overlap method & iovr_exprand, ! Flag for exponential-random cloud overlap method + & idcor, & idcor_con, & idcor_hogan, & idcor_oreopoulos - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in - logical, intent(in) :: do_mynnedmf, lgfdlmprad + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in, & + & do_mynnedmf, lgfdlmprad, top_at_1, lcrick, lcnorm real (kind=kind_phys), dimension(:,:,:), intent(in) :: ccnd, & & tracer1 @@ -597,9 +543,10 @@ subroutine radiation_clouds_prop & & tlyr, tvly, qlyr, qstl, rhly, cnvw, cnvc, cldcov, & & delp, dz, effrl, effri, effrr, effrs, dzlay, clouds1 - real (kind=kind_phys), intent(in) :: sup + real (kind=kind_phys), intent(in) :: sup, dcorr_con, con_ttp, & + & con_pi, con_g, con_rd, con_thgni real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, & - & slmsk + & slmsk, si real(kind=kind_phys), dimension(:), intent(in) :: latdeg, gridkm real(kind=kind_phys), intent(in) :: julian @@ -677,7 +624,7 @@ subroutine radiation_clouds_prop & & IX, NLAY, NLP1, cldcov, & & effrl, effri, effrr, effrs, effr_in, & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -688,7 +635,7 @@ subroutine radiation_clouds_prop & & lmfshal, lmfdeep2, & & cldcov, effrl, effri, effrr, effrs, effr_in, & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -700,8 +647,8 @@ subroutine radiation_clouds_prop & & qstl, rhly, ccnd(1:IX,1:NLAY,1), cnvw, cnvc, & & xlat, xlon, slmsk, dz, delp, IX, NLAY, NLP1, & & deltaq, sup, kdt, me, dzlay, & - & cldtot, cldcnv, & ! inout - & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs + & cldtot, cldcnv, lcrick, lcnorm, con_thgni, & ! inout + & con_ttp, cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -712,7 +659,7 @@ subroutine radiation_clouds_prop & & qstl, rhly, ccnd(1:IX,1:NLAY,1), cnvw, cnvc, & & xlat, xlon, slmsk, cldcov, dz, delp, & & IX, NLAY, NLP1, dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -722,7 +669,7 @@ subroutine radiation_clouds_prop & & xlon, slmsk, dz,delp, IX, NLAY, NLP1, cldcov, & & effrl, effri, effrr, effrs, effr_in, & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -744,7 +691,7 @@ subroutine radiation_clouds_prop & & cldcov(:,1:NLAY),effrl_inout(:,:), & & effri_inout(:,:), effrs_inout(:,:), & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcnorm, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -767,7 +714,7 @@ subroutine radiation_clouds_prop & & cld_frac, & & effrl, effri, effrr, effrs, effr_in , & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -776,13 +723,13 @@ subroutine radiation_clouds_prop & call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs & rhly,tracer1,xlat,xlon,slmsk,dz,delp, & & ntrac-1, ntcw-1,ntiw-1,ntrw-1, & - & ntsw-1,ntgl-1, & + & ntsw-1,ntgl-1,con_ttp, & & IX, NLAY, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:NLAY), cnvw, effrl_inout, & & effri_inout, effrs_inout, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcnorm, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -800,7 +747,7 @@ subroutine radiation_clouds_prop & & IX, LM, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:LM), effrl, effri, effrs, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & - & dzlay, gridkm, & + & dzlay, gridkm, top_at_1, & & cldtot, cldcnv, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & @@ -822,7 +769,7 @@ subroutine radiation_clouds_prop & & cld_frac, & & effrl, effri, effrr, effrs, effr_in , & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -839,7 +786,7 @@ subroutine radiation_clouds_prop & & IX, LM, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:LM), effrl, effri, effrs, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & - & dzlay, gridkm, & + & dzlay, gridkm, top_at_1, & & cldtot, cldcnv, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & @@ -849,12 +796,12 @@ subroutine radiation_clouds_prop & call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs & rhly,tracer1,xlat,xlon,slmsk,dz,delp, & & ntrac-1, ntcw-1,ntiw-1,ntrw-1, & - & ntsw-1,ntgl-1, & + & ntsw-1,ntgl-1,con_ttp, & & IX, NLAY, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:NLAY), cnvw, effrl, effri, effrs, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & & dzlay, & - & cldtot, cldcnv, & ! inout + & cldtot, cldcnv, lcnorm, & ! inout & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, & & cld_resnow) @@ -889,7 +836,7 @@ subroutine radiation_clouds_prop & call cmp_dcorr_lgth(ix, latdeg, julian, yearlen, de_lgth) endif if (idcor == idcor_con) then - de_lgth(:) = decorr_con + de_lgth(:) = dcorr_con endif ! Call subroutine get_alpha_exper to define alpha parameter for exponential cloud overlap options @@ -914,8 +861,8 @@ subroutine radiation_clouds_prop & call gethml & ! --- inputs: & ( plyr, ptop1, cldtot, cldcnv, dz, de_lgth, alpha, & - & IX, NLAY, iovr_rand, iovr_maxrand, iovr_max, & - & iovr_dcorr, iovr_exp, iovr_exprand, & + & IX, NLAY, iovr, iovr_rand, iovr_maxrand, iovr_max, & + & iovr_dcorr, iovr_exp, iovr_exprand, top_at_1, si, & ! --- outputs: & clds, mtop, mbot & & ) @@ -932,7 +879,7 @@ subroutine progcld_zhao_carr & & xlat,xlon,slmsk,dz,delp, IX, NLAY, NLP1, & & uni_cld, lmfshal, lmfdeep2, cldcov, & & effrl,effri,effrr,effrs,effr_in, & - & dzlay, cldtot, cldcnv, & + & dzlay, cldtot, cldcnv, lcrick, lcnorm, con_ttp, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -949,9 +896,7 @@ subroutine progcld_zhao_carr & ! top and base. the three vertical cloud domains are set up in the ! ! initial subroutine "cld_init". ! ! ! -! usage: call progcld_zhao_carr ! -! ! -! subprograms called: gethml ! +! usage: call progcld_zhao_carr ! ! ! ! attributes: ! ! language: fortran 90 ! @@ -987,6 +932,14 @@ subroutine progcld_zhao_carr & ! effrs : effective radius for snow water ! effr_in : logical, if .true. use input effective radii ! dzlay(ix,nlay) : thickness between model layer centers (km) ! +! lmfshal : mass-flux shallow conv scheme flag ! +! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -1000,19 +953,6 @@ subroutine progcld_zhao_carr & ! *** cld_swp (:,:) - layer snow flake water path not assigned ! ! cld_resnow(:,:) - mean eff radius for snow flake (micron) ! ! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lmfshal : mass-flux shallow conv scheme flag ! -! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! ! ! ==================== end of description ===================== ! ! implicit none @@ -1020,7 +960,8 @@ subroutine progcld_zhao_carr & ! --- inputs integer, intent(in) :: IX, NLAY, NLP1 - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in, & + & lcrick, lcnorm real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, tvly, qlyr, qstl, rhly, clw, cldcov, delp, dz, & @@ -1028,6 +969,7 @@ subroutine progcld_zhao_carr & real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, & & slmsk + real (kind=kind_phys), intent(in) :: con_ttp ! --- inputs/outputs @@ -1236,7 +1178,7 @@ subroutine progcld_zhao_carr_pdf & & xlat,xlon,slmsk, dz, delp, & & ix, nlay, nlp1, & & deltaq,sup,kdt,me, & - & dzlay, cldtot, cldcnv, & + & dzlay, cldtot, cldcnv, lcrick, lcnorm, con_thgni, con_ttp, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -1253,9 +1195,7 @@ subroutine progcld_zhao_carr_pdf & ! top and base. the three vertical cloud domains are set up in the ! ! initial subroutine "cld_init". ! ! ! -! usage: call progcld_zhao_carr_pdf ! -! ! -! subprograms called: gethml ! +! usage: call progcld_zhao_carr_pdf ! ! ! ! attributes: ! ! language: fortran 90 ! @@ -1286,6 +1226,12 @@ subroutine progcld_zhao_carr_pdf & ! deltaq(ix,nlay) : half total water distribution width ! ! sup : supersaturation ! ! dzlay(ix,nlay) : thickness between model layer centers (km) ! +! lcrick : control flag for eliminating crick ! +! =t: apply layer smoothing to eliminate crick ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -1299,28 +1245,18 @@ subroutine progcld_zhao_carr_pdf & ! *** cld_swp (:,:) - layer snow flake water path not assigned ! ! cld_resnow(:,:) - mean eff radius for snow flake (micron) ! ! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lcrick : control flag for eliminating crick ! -! =t: apply layer smoothing to eliminate crick ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! ! ! ==================== end of description ===================== ! ! implicit none ! --- inputs integer, intent(in) :: ix, nlay, nlp1,kdt - + logical, intent(in) :: lcrick, lcnorm real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, tvly, qlyr, qstl, rhly, clw, dz, delp, dzlay ! & tlyr, tvly, qlyr, qstl, rhly, clw, cnvw, cnvc ! real (kind=kind_phys), dimension(:,:), intent(in) :: deltaq + real (kind=kind_phys), intent(in) :: con_thgni, con_ttp real (kind=kind_phys), dimension(:,:) :: deltaq, cnvw, cnvc real (kind=kind_phys) qtmp,qsc,rhs real (kind=kind_phys), intent(in) :: sup @@ -1416,7 +1352,7 @@ subroutine progcld_zhao_carr_pdf & do k = 1, nlay do i = 1, ix tem1 = tlyr(i,k) - 273.16 - if(tem1 < con_thgni) then ! for pure ice, has to be consistent with gscond + if(tem1 < (con_thgni - 273.16)) then ! for pure ice, has to be consistent with gscond qsc = sup * qstl(i,k) rhs = sup else @@ -1536,7 +1472,7 @@ subroutine progcld_gfdl_lin & & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw,cnvw,cnvc, & ! --- inputs: & xlat,xlon,slmsk,cldtot, dz, delp, & & IX, NLAY, NLP1, & - & dzlay, cldtot1, cldcnv, & + & dzlay, cldtot1, cldcnv, lcrick, lcnorm, con_ttp, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -1553,9 +1489,7 @@ subroutine progcld_gfdl_lin & ! top and base. the three vertical cloud domains are set up in the ! ! initial subroutine "cld_init". ! ! ! -! usage: call progcld_gfdl_lin ! -! ! -! subprograms called: gethml ! +! usage: call progcld_gfdl_lin ! ! ! ! attributes: ! ! language: fortran 90 ! @@ -1584,6 +1518,12 @@ subroutine progcld_gfdl_lin & ! IX : horizontal dimention ! ! NLAY,NLP1 : vertical layer/level dimensions ! ! dzlay(ix,nlay) : thickness between model layer centers (km) ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -1597,28 +1537,17 @@ subroutine progcld_gfdl_lin & ! *** cld_swp (:,:) - layer snow flake water path not assigned ! ! cld_resnow(:,:) - mean eff radius for snow flake (micron) ! ! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lsashal : control flag for shallow convection ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! ! ! ==================== end of description ===================== ! ! implicit none ! --- inputs integer, intent(in) :: IX, NLAY, NLP1 - + logical, intent(in) :: lcrick, lcnorm real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, tvly, qlyr, qstl, rhly, clw, cldtot, cnvw, cnvc, & & delp, dz, dzlay + real (kind=kind_phys) :: con_ttp real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, & & slmsk @@ -1786,7 +1715,7 @@ subroutine progcld_fer_hires & & IX, NLAY, NLP1, icloud, & & uni_cld, lmfshal, lmfdeep2, cldcov, & & re_cloud,re_ice,re_snow, & - & dzlay, cldtot, cldcnv, & + & dzlay, cldtot, cldcnv, lcnorm, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -1803,9 +1732,7 @@ subroutine progcld_fer_hires & ! top and base. the three vertical cloud domains are set up in the ! ! initial subroutine "cld_init". ! ! ! -! usage: call progcld_fer_hires ! -! ! -! subprograms called: gethml ! +! usage: call progcld_fer_hires ! ! ! ! attributes: ! ! language: fortran 90 ! @@ -1837,6 +1764,14 @@ subroutine progcld_fer_hires & ! lmfdeep2 : logical - true for mass flux deep convection ! ! cldcov : layer cloud fraction (used when uni_cld=.true. ! ! dzlay(ix,nlay) : thickness between model layer centers (km) ! +! lmfshal : mass-flux shallow conv scheme flag ! +! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -1850,19 +1785,6 @@ subroutine progcld_fer_hires & ! *** cld_swp (:,:) - layer snow flake water path not assigned ! ! cld_resnow(:,:) - mean eff radius for snow flake (micron) ! ! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lmfshal : mass-flux shallow conv scheme flag ! -! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! ! ! ==================== end of description ===================== ! ! implicit none @@ -1871,7 +1793,7 @@ subroutine progcld_fer_hires & integer, intent(in) :: IX, NLAY, NLP1, ICLOUD integer, intent(in) :: ntrac, ntcw, ntiw, ntrw - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2 + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, tvly, qlyr, qstl, rhly, cldcov, delp, dz, dzlay @@ -2036,12 +1958,12 @@ end subroutine progcld_fer_hires subroutine progcld_thompson_wsm6 & & ( plyr,plvl,tlyr,qlyr,qstl,rhly,clw, & ! --- inputs: & xlat,xlon,slmsk,dz,delp, & - & ntrac,ntcw,ntiw,ntrw,ntsw,ntgl, & + & ntrac,ntcw,ntiw,ntrw,ntsw,ntgl,con_ttp, & & IX, NLAY, NLP1, & & uni_cld, lmfshal, lmfdeep2, cldcov, cnvw, & & re_cloud,re_ice,re_snow, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & - & dzlay, cldtot, cldcnv, & + & dzlay, cldtot, cldcnv, lcnorm, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -2059,9 +1981,7 @@ subroutine progcld_thompson_wsm6 & ! top and base. the three vertical cloud domains are set up in the ! ! initial subroutine "cld_init". ! ! ! -! usage: call progcld_thompson_wsm6 ! -! ! -! subprograms called: gethml ! +! usage: call progcld_thompson_wsm6 ! ! ! ! attributes: ! ! language: fortran 90 ! @@ -2092,6 +2012,14 @@ subroutine progcld_thompson_wsm6 & ! lmfshal : logical - true for mass flux shallow convection ! ! lmfdeep2 : logical - true for mass flux deep convection ! ! cldcov : layer cloud fraction (used when uni_cld=.true. ! +! lmfshal : mass-flux shallow conv scheme flag ! +! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -2110,19 +2038,6 @@ subroutine progcld_thompson_wsm6 & ! mbot (IX,3) : vertical indices for low, mid, hi cloud bases ! ! de_lgth(ix) : clouds decorrelation length (km) ! ! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lmfshal : mass-flux shallow conv scheme flag ! -! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! ! ! ==================== end of description ===================== ! ! implicit none @@ -2131,7 +2046,7 @@ subroutine progcld_thompson_wsm6 & integer, intent(in) :: IX, NLAY, NLP1 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2 + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, & @@ -2143,7 +2058,7 @@ subroutine progcld_thompson_wsm6 & real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, & & slmsk - + real (kind=kind_phys), intent(in) :: con_ttp ! --- inputs/outputs real (kind=kind_phys), dimension(:,:), intent(inout) :: & @@ -2342,7 +2257,7 @@ subroutine progcld_thompson & & uni_cld, lmfshal, lmfdeep2, cldcov, & & re_cloud,re_ice,re_snow, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & - & dzlay, gridkm, cldtot, cldcnv, & + & dzlay, gridkm, top_at_1, cldtot, cldcnv, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -2361,8 +2276,6 @@ subroutine progcld_thompson & ! ! ! usage: call progcld_thompson ! ! ! -! subprograms called: gethml ! -! ! ! attributes: ! ! language: fortran 90 ! ! machine: ibm-sp, sgi ! @@ -2392,7 +2305,16 @@ subroutine progcld_thompson & ! uni_cld : logical - true for cloud fraction from shoc ! ! lmfshal : logical - true for mass flux shallow convection ! ! lmfdeep2 : logical - true for mass flux deep convection ! +! top_at_1 : logical - true if vertical ordereing is toa-2-sfc ! ! cldcov : layer cloud fraction (used when uni_cld=.true. ! +! lmfshal : mass-flux shallow conv scheme flag ! +! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -2406,19 +2328,6 @@ subroutine progcld_thompson & ! *** cld_swp (:,:) - layer snow flake water path not assigned ! ! cld_resnow(:,:) - mean eff radius for snow flake (micron) ! ! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lmfshal : mass-flux shallow conv scheme flag ! -! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! -! ! ! ==================== end of description ===================== ! ! implicit none @@ -2427,7 +2336,7 @@ subroutine progcld_thompson & integer, intent(in) :: IX, NLAY, NLP1 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2 + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, top_at_1 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, & @@ -2531,7 +2440,7 @@ subroutine progcld_thompson & cldfra1d(:) = 0.0 - if (ivflip .eq. 1) then + if (.not. top_at_1) then do k = 1, NLAY qv1d(k) = qlyr(i,k) qc1d(k) = max(0.0, clw(i,k,ntcw)) @@ -2625,7 +2534,7 @@ subroutine progclduni & & ( plyr,plvl,tlyr,tvly,ccnd,ncnd, & ! --- inputs: & xlat,xlon,slmsk,dz,delp, IX, NLAY, NLP1, cldtot, & & effrl,effri,effrr,effrs,effr_in, & - & dzlay, cldtot1, cldcnv, & + & dzlay, cldtot1, cldcnv, lcrick, lcnorm, con_ttp, & & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow & & ) @@ -2647,8 +2556,6 @@ subroutine progclduni & ! ! ! usage: call progclduni ! ! ! -! subprograms called: gethml ! -! ! ! attributes: ! ! language: fortran 90 ! ! machine: ibm-sp, sgi ! @@ -2679,6 +2586,14 @@ subroutine progclduni & ! dz (ix,nlay) : layer thickness (km) ! ! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) ! ! dzlay(ix,nlay) : thickness between model layer centers (km) ! +! lmfshal : mass-flux shallow conv scheme flag ! +! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! +! lcrick : control flag for eliminating CRICK ! +! =t: apply layer smoothing to eliminate CRICK ! +! =f: do not apply layer smoothing ! +! lcnorm : control flag for in-cld condensate ! +! =t: normalize cloud condensate ! +! =f: not normalize cloud condensate ! ! ! ! output variables: ! ! cloud profiles: ! @@ -2696,20 +2611,7 @@ subroutine progclduni & ! mtop (IX,3) : vertical indices for low, mid, hi cloud tops ! ! mbot (IX,3) : vertical indices for low, mid, hi cloud bases ! ! de_lgth(ix) : clouds decorrelation length (km) ! -! alpha(ix,nlay) : alpha decorrelation parameter -! ! -! module variables: ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! lmfshal : mass-flux shallow conv scheme flag ! -! lmfdeep2 : scale-aware mass-flux deep conv scheme flag ! -! lcrick : control flag for eliminating CRICK ! -! =t: apply layer smoothing to eliminate CRICK ! -! =f: do not apply layer smoothing ! -! lcnorm : control flag for in-cld condensate ! -! =t: normalize cloud condensate ! -! =f: not normalize cloud condensate ! +! alpha(ix,nlay) : alpha decorrelation parameter ! ! ! ! ==================== end of description ===================== ! ! @@ -2717,8 +2619,9 @@ subroutine progclduni & ! --- inputs integer, intent(in) :: IX, NLAY, NLP1, ncnd - logical, intent(in) :: effr_in + logical, intent(in) :: effr_in, lcrick, lcnorm + real (kind=kind_phys), intent(in) :: con_ttp real (kind=kind_phys), dimension(:,:,:), intent(in) :: ccnd real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr,& & tlyr, tvly, cldtot, effrl, effri, effrr, effrs, dz, delp, & @@ -2936,8 +2839,8 @@ end subroutine progclduni !>\section detail Detailed Algorithm subroutine gethml & & ( plyr, ptop1, cldtot, cldcnv, dz, de_lgth, alpha, & ! --- inputs: - & IX, NLAY, iovr_rand, iovr_maxrand, iovr_max, & - & iovr_dcorr, iovr_exp, iovr_exprand, & + & IX, NLAY, iovr, iovr_rand, iovr_maxrand, iovr_max, & + & iovr_dcorr, iovr_exp, iovr_exprand, top_at_1, si, & & clds, mtop, mbot & ! --- outputs: & ) @@ -2975,13 +2878,7 @@ subroutine gethml & ! output variables: ! ! clds (IX,5) : fraction of clouds for low, mid, hi, tot, bl ! ! mtop (IX,3) : vertical indices for low, mid, hi cloud tops ! -! mbot (IX,3) : vertical indices for low, mid, hi cloud bases ! -! ! -! external module variables: (in physparam) ! -! ivflip : control flag of vertical index direction ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! ! +! mbot (IX,3) : vertical indices for low, mid, hi cloud bases ! ! ! internal module variables: ! ! iovr : control flag for cloud overlap ! ! =0 random overlapping clouds ! @@ -2996,8 +2893,10 @@ subroutine gethml & implicit none! ! --- inputs: + logical, intent(in) :: top_at_1 integer, intent(in) :: IX, NLAY integer, intent(in) :: & + & iovr, ! & iovr_rand, ! Flag for random cloud overlap method & iovr_maxrand, ! Flag for maximum-random cloud overlap method & iovr_max, ! Flag for maximum cloud overlap method @@ -3007,7 +2906,7 @@ subroutine gethml & real (kind=kind_phys), dimension(:,:), intent(in) :: plyr, ptop1, & & cldtot, cldcnv, dz - real (kind=kind_phys), dimension(:), intent(in) :: de_lgth + real (kind=kind_phys), dimension(:), intent(in) :: de_lgth, si real (kind=kind_phys), dimension(:,:), intent(in) :: alpha ! --- outputs @@ -3020,11 +2919,30 @@ subroutine gethml & real (kind=kind_phys) :: pcur, pnxt, ccur, cnxt, alfa integer, dimension(IX):: idom, kbt1, kth1, kbt2, kth2 - integer :: i, k, id, id1, kstr, kend, kinc + integer :: i, k, id, id1, kstr, kend, kinc,kl ! !===> ... begin here ! +!> - Compute the top of BL cld (llyr), which is the topmost non +!! cld(low) layer for stratiform (at or above lowest 0.1 of the +!! atmosphere). + + if (top_at_1) then ! data from toa to sfc + lab_do_k0 : do k = NLAY, 2, -1 + kl = k + if (si(k) < 0.9e0) exit lab_do_k0 + enddo lab_do_k0 + llyr = kl + else ! data from sfc to top + lab_do_k1 : do k = 2, NLAY + kl = k + if (si(k) < 0.9e0) exit lab_do_k1 + enddo lab_do_k1 + + llyr = kl - 1 + endif ! end_if_top_at_1 + clds(:,:) = 0.0 do i = 1, IX @@ -3038,7 +2956,7 @@ subroutine gethml & !> - Calculate total and BL cloud fractions (maximum-random cloud !! overlapping is operational). - if ( ivflip == 0 ) then ! input data from toa to sfc + if (top_at_1) then ! input data from toa to sfc kstr = NLAY kend = 1 kinc = -1 @@ -3046,7 +2964,7 @@ subroutine gethml & kstr = 1 kend = NLAY kinc = 1 - endif ! end_if_ivflip + endif ! end_if_top_at_1 if ( iovr == iovr_rand ) then ! random overlap @@ -3180,7 +3098,7 @@ subroutine gethml & !> - Calculte high, mid, low cloud fractions and vertical indices of !! cloud tops/bases. - if ( ivflip == 0 ) then ! input data from toa to sfc + if (top_at_1) then ! input data from toa to sfc do i = 1, IX cl1 (i) = 0.0 @@ -3344,7 +3262,7 @@ subroutine gethml & enddo ! end_do_i_loop enddo ! end_do_k_loop - endif ! end_if_ivflip + endif ! end_if_top_at_1 ! return diff --git a/physics/radiation_gases.f b/physics/radiation_gases.f index c958fc243..ccc3b598a 100644 --- a/physics/radiation_gases.f +++ b/physics/radiation_gases.f @@ -19,13 +19,13 @@ ! input: ! ! ( me ) ! ! output: ! -! ( none ) ! +! ( errflg, errmsg ) ! ! ! ! 'gas_update' -- read in data and update with time ! ! input: ! ! ( iyear, imon, iday, ihour, loz1st, ldoco2, me ) ! ! output: ! -! ( none ) ! +! ( errflg, errmsg ) ! ! ! ! 'getozn' -- setup climatological ozone profile ! ! input: ! @@ -44,7 +44,6 @@ ! external modules referenced: ! ! 'module machine' in 'machine.f' ! ! 'module funcphys' in 'funcphys.f' ! -! 'module physcons' in 'physcons.f ! ! 'module module_iounitdef' in 'iounitdef.f' ! ! ! ! unit used for radiative active gases: ! @@ -81,7 +80,7 @@ ! nov 2008 - y-t hou fix bugs in superimposing climatology ! ! seasonal cycle calculations ! ! aug 2011 - y-t hou fix a bug in subr getgases doing vertical ! -! co2 mapping. (for iflip=0 case, not affact opr). ! +! 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) ! @@ -141,13 +140,8 @@ !> This module sets up ozone climatological profiles and other constant gas !! profiles, such as co2, ch4, n2o, o2, and those of cfc gases. module module_radiation_gases -! - use physparam, only : ico2flg, ictmflg, ioznflg, ivflip, & - & co2dat_file, co2gbl_file, & - & co2usr_file, co2cyc_file, & - & kind_phys, kind_io4 + use machine, only : kind_phys, kind_io4 use funcphys, only : fpkapx - use physcons, only : con_pi use ozne_def, only : JMR => latsozc, LOZ => levozc, & & blte => blatc, dlte=> dphiozc, & & timeozc => timeozc @@ -168,9 +162,9 @@ module module_radiation_gases integer, parameter :: MINYEAR = 1957 ! earlist year 2D CO2 data available real (kind=kind_phys), parameter :: resco2=15.0 ! horizontal resolution in degree - real (kind=kind_phys), parameter :: raddeg=180.0/con_pi ! rad->deg conversion real (kind=kind_phys), parameter :: prsco2=788.0 ! pressure limitation for 2D CO2 (mb) - real (kind=kind_phys), parameter :: hfpi =0.5*con_pi ! half of pi + real (kind=kind_phys) :: raddeg ! rad->deg conversion + real (kind=kind_phys) :: hfpi ! half of pi real (kind=kind_phys), parameter :: co2vmr_def = 350.0e-6 ! parameter constant for CO2 volume mixing ratio real (kind=kind_phys), parameter :: n2ovmr_def = 0.31e-6 ! parameter constant for N2O volume mixing ratio @@ -227,48 +221,54 @@ module module_radiation_gases !> This subroutine sets up ozone, co2, etc. parameters. If climatology !! ozone then read in monthly ozone data. -!!\param me print message control flag +!!\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 )! --- inputs: -! --- outputs: ( none ) + subroutine gas_init( me, co2usr_file, co2cyc_file, ico2flg, & + & ictmflg, ioznflg, con_pi, errflg, errmsg) ! =================================================================== ! ! ! ! gas_init sets up ozone, co2, etc. parameters. if climatology ozone ! ! then read in monthly ozone data. ! ! ! -! inputs: dimemsion ! -! me - print message control flag 1 ! -! ! -! outputs: (to the module variables) ! -! ( none ) ! -! ! -! external module variables: (in physparam) ! -! ico2flg - co2 data source control flag ! +! inputs: ! +! me - print message control flag ! +! ico2flg - co2 data source control flag ! ! =0: use prescribed co2 global mean value ! ! =1: use input global mean co2 value (co2_glb) ! ! =2: use input 2-d monthly co2 value (co2vmr_sav) ! -! ictmflg - =yyyy#, data ic time/date control flag ! -! = -2: same as 0, but superimpose seasonal cycle ! -! from climatology data set. ! -! = -1: use user provided external data for the fcst ! -! time, no extrapolation. ! -! = 0: use data at initial cond time, if not existed! -! then use latest, without extrapolation. ! -! = 1: use data at the forecast time, if not existed! -! then use latest and extrapolate to fcst time.! -! =yyyy0: use yyyy data for the forecast time, no ! -! further data extrapolation. ! -! =yyyy1: use yyyy data for the fcst. if needed, do ! -! extrapolation to match the fcst time. ! -! ioznflg - ozone data control flag ! +! ictmflg - =yyyy#, data ic time/date control flag ! +! =-2: same as 0, but superimpose seasonal cycle ! +! from climatology data set. ! +! =-1: use user provided external data for the fcst ! +! time, no extrapolation. ! +! =0: use data at initial cond time, if not existed ! +! then use latest, without extrapolation. ! +! =1: use data at the forecast time, if not existed ! +! then use latest and extrapolate to fcst time. ! +! =yyyy0: use yyyy data for the forecast time, no ! +! 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 ! -! co2usr_file- external co2 user defined data table ! -! co2cyc_file- external co2 climotology monthly cycle data table ! +! >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 ! +! ! +! outputs: (CCPP error handling) ! +! errflg - error flag ! +! errmsg - error message ! ! ! ! internal module variables: ! ! pkstr, o3r - arrays for climatology ozone data ! @@ -282,9 +282,12 @@ subroutine gas_init & implicit none ! --- inputs: - integer, intent(in) :: me - -! --- output: ( none ) + integer, intent(in) :: me, ictmflg, ioznflg, ico2flg + 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 ! --- locals: real (kind=kind_phys), dimension(IMXCO2,JMXCO2) :: co2dat @@ -300,6 +303,15 @@ subroutine gas_init & ! !===> ... begin here ! + +! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + +! Initiailize module parameters + raddeg = 180.0/con_pi + hfpi = 0.5*con_pi + if ( me == 0 ) print *, VTAGGAS ! print out version tag kyrsav = 0 @@ -316,7 +328,10 @@ subroutine gas_init & print *,' - Using climatology ozone distribution' print *,' timeozc=',timeozc, ' is not monthly mean', & & ' - job aborting in subroutin gas_init!!!' - stop + errflg = 1 + errmsg = 'ERROR(gas_init): Climatological o3 distribution '// & + & 'is not monthly mean' + return endif allocate (pkstr(LOZ), o3r(JMR,LOZ,12)) @@ -391,9 +406,10 @@ subroutine gas_init & inquire (file=co2usr_file, exist=file_exist) if ( .not. file_exist ) then - print *,' Can not find user CO2 data file: ',co2usr_file, & - & ' - Stopped in subroutine gas_init !!' - stop + print *,' Can not find user CO2 data file: ',co2usr_file + errflg = 1 + errmsg = 'ERROR(gas_init): Can not find user CO2 data file' + return else close (NICO2CN) open(NICO2CN,file=co2usr_file,form='formatted',status='old') @@ -434,9 +450,10 @@ subroutine gas_init & enddo endif else - print *,' ICO2=',ico2flg,' is not a valid selection', & - & ' - Stoped in subroutine gas_init!!!' - stop + print *,' ICO2=',ico2flg,' is not a valid selection' + errflg = 1 + errmsg = 'ERROR(gas_init): ICO2 is not valid' + return endif ! endif_ico2flg_block close (NICO2CN) @@ -455,9 +472,10 @@ subroutine gas_init & print *,' - Using observed co2 monthly 2-d data' endif else - print *,' ICO2=',ico2flg,' is not a valid selection', & - & ' - Stoped in subroutine gas_init!!!' - stop + print *,' ICO2=',ico2flg,' is not a valid selection' + errflg = 1 + errmsg = 'ERROR(gas_init): ICO2 is not valid' + return endif if ( ictmflg == -2 ) then @@ -465,9 +483,12 @@ subroutine gas_init & if ( .not. file_exist ) then if ( me == 0 ) then print *,' Can not find seasonal cycle CO2 data: ', & - & co2cyc_file,' - Stopped in subroutine gas_init !!' + & co2cyc_file endif - stop + errflg = 1 + errmsg = 'ERROR(gas_init): Can not find seasonal cycle '//& + & 'CO2 data' + return else allocate( co2cyc_sav(IMXCO2,JMXCO2,12) ) @@ -517,18 +538,25 @@ end subroutine gas_init !> This subroutine reads in 2-d monthly co2 data set for a specified !! year. Data are in a 15 degree lat/lon horizontal resolution. -!!\param iyear year of the requested data for fcst -!!\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 iyear year of the requested data for fcst +!!\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 )! --- inputs -! --- outputs: ( none ) + subroutine gas_update(iyear, imon, iday, ihour, loz1st, ldoco2, & + & me, co2dat_file, co2gbl_file, ictmflg, ico2flg, ioznflg, & + & errflg, errmsg ) ! =================================================================== ! ! ! @@ -536,41 +564,40 @@ subroutine gas_update & ! data are in a 15 degree lat/lon horizontal resolution. ! ! ! ! inputs: dimemsion ! -! iyear - year of the requested data for fcst 1 ! -! 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 ! -! ! -! outputs: (to the module variables) ! -! ( none ) ! -! ! -! external module variables: (in physparam) ! -! ico2flg - co2 data source control flag ! +! iyear - year of the requested data for fcst 1 ! +! 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 ! ! =0: use prescribed co2 global mean value ! ! =1: use input global mean co2 value (co2_glb) ! ! =2: use input 2-d monthly co2 value (co2vmr_sav) ! -! ictmflg - =yyyy#, data ic time/date control flag ! -! = -2: same as 0, but superimpose seasonal cycle ! -! from climatology data set. ! -! = -1: use user provided external data for the fcst ! -! time, no extrapolation. ! -! = 0: use data at initial cond time, if not existed! -! then use latest, without extrapolation. ! -! = 1: use data at the forecast time, if not existed! -! then use latest and extrapolate to fcst time.! -! =yyyy0: use yyyy data for the forecast time, no ! -! further data extrapolation. ! -! =yyyy1: use yyyy data for the fcst. if needed, do ! -! extrapolation to match the fcst time. ! -! ioznflg - ozone data control flag ! +! ictmflg - =yyyy#, data ic time/date control flag ! +! =-2: same as 0, but superimpose seasonal cycle ! +! from climatology data set. ! +! =-1: use user provided external data for the fcst ! +! time, no extrapolation. ! +! =0: use data at initial cond time, if not existed ! +! then use latest, without extrapolation. ! +! =1: use data at the forecast time, if not existed ! +! then use latest and extrapolate to fcst time. ! +! =yyyy0: use yyyy data for the forecast time, no ! +! 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 ! +! ivflip - vertical profile indexing flag ! +! co2dat_file - external co2 2d monthly obsv data table ! +! co2gbl_file - external co2 global annual mean data table ! +! ! +! outputs: (CCPP error handling) ! +! errflg - error flag ! +! errmsg - error message ! ! ! ! internal module variables: ! ! co2vmr_sav - monthly co2 volume mixing ratio IMXCO2*JMXCO2*12 ! @@ -589,11 +616,14 @@ subroutine gas_update & implicit none ! --- inputs: - integer, intent(in) :: iyear, imon, iday, ihour, me - + 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 -! --- output: ( none ) +! --- output: + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! --- locals: real (kind=kind_phys), dimension(IMXCO2,JMXCO2) :: co2dat, co2ann @@ -610,6 +640,10 @@ subroutine gas_update & ! !===> ... begin here ! +! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + !> - Ozone data section if ( ioznflg == 0 ) then @@ -680,8 +714,11 @@ subroutine gas_update & inquire (file=co2gbl_file, exist=file_exist) if ( .not. file_exist ) then print *,' Requested co2 data file "',co2gbl_file, & - & '" not found - Stopped in subroutine gas_update!!' - stop + & '" not found' + errflg = 1 + errmsg = 'ERROR(gas_update): Requested co2 data file not '// & + & 'found' + return else close(NICO2CN) open (NICO2CN,file=co2gbl_file,form='formatted',status='old') @@ -748,9 +785,11 @@ subroutine gas_update & if ( me == 0 ) then print *,' Specified co2 data for year',idyr, & & ' not found !! Need to change namelist ICTM !!' - print *,' *** Stopped in subroutine gas_update !!' endif - stop + errflg = 1 + errmsg = 'ERROR(gas_update): Specified co2 data for year '//& + & 'not found' + return else Lab_if_ictm ! looking for latest available data if ( me == 0 ) then print *,' Requested co2 data for year',idyr, & @@ -774,9 +813,11 @@ subroutine gas_update & if ( .not. file_exist ) then if ( me == 0 ) then print *,' Can not find co2 data source file' - print *,' *** Stopped in subroutine gas_update !!' endif - stop + errflg = 1 + errmsg = 'ERROR(gas_update): Can not find co2 data '// & + & 'source file' + return endif endif Lab_if_ictm endif ! end if_file_exist_block @@ -907,6 +948,9 @@ end subroutine gas_update !! pi/2 -> -pi/2, otherwise see in-line comment !!\param IMAX horizontal dimension for output data !!\param LMAX vertical dimension for output data +!!\param ico2flg (1), co2 data source control flag +!!\param top_at_1 (1), vertical ordering flag +!!\param con_pi (1), physical constant Pi !!\param gasdat (IMAX,LMAX,NF_VGAS) - gases volume mixing ratioes !!\n (:,:,1) - co2 !!\n (:,:,2) - n2o @@ -918,13 +962,16 @@ end subroutine gas_update !!\n (:,:,8) - cfc22 !!\n (:,:,9) - ccl4 !!\n (:,:,10) - cfc113 +!!\n +!> - Internal module variables : +!!\n co2vmr_sav - saved monthly co2 concentration from sub gas_update +!!\n co2_glb - saved global annual mean co2 value from gas_update +!!\n gco2cyc - saved global seasonal variation of co2 climatology +!! in 12-month form !>\section gen_getgases getgases General Algorithm !----------------------------------- - subroutine getgases & - & ( plvl, xlon, xlat, & ! --- inputs - & IMAX, LMAX, & - & gasdat & ! --- outputs - & ) + subroutine getgases( plvl, xlon, xlat, IMAX, LMAX, ico2flg, & + & top_at_1, con_pi, gasdat) ! =================================================================== ! ! ! ! getgases set up global distribution of radiation absorbing gases ! @@ -939,6 +986,12 @@ subroutine getgases & ! xlat(IMAX) - grid latitude in radians, default range to ! ! pi/2 -> -pi/2, otherwise see in-line comment ! ! IMAX, LMAX - horiz, vert dimensions for output data ! +! ico2flg - co2 data source control flag ! +! =0: use prescribed co2 global mean value ! +! =1: use input global mean co2 value (co2_glb) ! +! =2: use input 2-d monthly co2 value (co2vmr_sav)! +! top_at_1 - vertical profile indexing flag ! +! con_pi - physical constant Pi ! ! ! ! outputs: ! ! gasdat(IMAX,LMAX,NF_VGAS) - gases volume mixing ratioes ! @@ -953,19 +1006,7 @@ subroutine getgases & ! (:,:,9) - ccl4 ! ! (:,:,10) - cfc113 ! ! ! -!> - External module variables: (in physparam) -!!\n ico2flg - co2 data source control flag -!!\n =0: use prescribed co2 global mean value -!!\n =1: use input global mean co2 value (co2_glb) -!!\n =2: use input 2-d monthly co2 value (co2vmr_sav) -!!\n ivflip - vertical profile indexing flag -!! -!> - Internal module variables : -!!\n co2vmr_sav - saved monthly co2 concentration from sub gas_update -!!\n co2_glb - saved global annual mean co2 value from gas_update -!!\n gco2cyc - saved global seasonal variation of co2 climatology -!! in 12-month form -!note: for lower atmos co2vmr_sav may have clim monthly deviations ! +! note: for lower atmos co2vmr_sav may have clim monthly deviations ! ! superimposed on init-cond co2 value, while co2_glb only ! ! contains the global mean value, thus needs to add the ! ! monthly dglobal mean deviation gco2cyc at upper atmos. for ! @@ -980,8 +1021,10 @@ subroutine getgases & implicit none ! --- input: - integer, intent(in) :: IMAX, LMAX + integer, intent(in) :: IMAX, LMAX, ico2flg real (kind=kind_phys), intent(in) :: plvl(:,:), xlon(:), xlat(:) + logical, intent(in) :: top_at_1 + real(kind=kind_phys), intent(in) :: con_pi ! --- output: real (kind=kind_phys), intent(out) :: gasdat(:,:,:) @@ -1035,7 +1078,7 @@ subroutine getgases & ilon = min( IMXCO2, int( xlon1*tmp + 1 )) ilat = min( JMXCO2, int( xlat1*tmp + 1 )) - if ( ivflip == 0 ) then ! index from toa to sfc + if (top_at_1) then ! index from toa to sfc do k = 1, LMAX if ( plvl(i,k) >= prsco2 ) then gasdat(i,k,1) = co2vmr_sav(ilon,ilat,kmonsav) @@ -1066,16 +1109,13 @@ end subroutine getgases !!\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 horizontal and vertical dimensions +!!\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, & ! --- inputs - & IMAX, LM, & - & o3mmr & ! --- outputs - & ) + subroutine getozn( prslk,xlat, IMAX, LM, top_at_1, o3mmr) ! =================================================================== ! ! ! @@ -1088,6 +1128,7 @@ subroutine getozn & ! 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)! @@ -1095,7 +1136,6 @@ subroutine getozn & ! module variables: ! ! k1oz, k2oz - ozone data interpolation indices ! ! facoz - ozone data interpolation factor ! -! ivflip - control flag for direction of vertical index ! ! ! ! usage: call getozn ! ! ! @@ -1105,7 +1145,7 @@ subroutine getozn & ! --- inputs: integer, intent(in) :: IMAX, LM - + logical, intent(in) :: top_at_1 real (kind=kind_phys), intent(in) :: prslk(:,:), xlat(:) ! --- outputs: @@ -1149,7 +1189,7 @@ subroutine getozn & do l = 1, LM ll = l - if (ivflip == 1) ll = LM -l + 1 + if (.not. top_at_1) ll = LM -l + 1 do i = 1, IMAX wk1(i) = prslk(i,ll) diff --git a/physics/radiation_surface.f b/physics/radiation_surface.f index 2fea84b5f..299f2e92c 100644 --- a/physics/radiation_surface.f +++ b/physics/radiation_surface.f @@ -104,9 +104,7 @@ !! emissivity for LW radiation. module module_radiation_surface ! - use physparam, only : ialbflg, iemsflg, semis_file, & - & kind_phys - use physcons, only : con_t0c, con_ttp, con_pi, con_tice + use machine, only : kind_phys use module_iounitdef, only : NIRADSF use surface_perturbation, only : ppfbet ! @@ -125,7 +123,7 @@ module module_radiation_surface real (kind=kind_phys), parameter :: f_zero = 0.0 real (kind=kind_phys), parameter :: f_one = 1.0 real (kind=kind_phys), parameter :: epsln = 1.0e-6 - real (kind=kind_phys), parameter :: rad2dg = 180.0 / con_pi + real (kind=kind_phys) :: rad2dg integer, allocatable :: idxems(:,:) ! global surface emissivity index array integer :: iemslw = 1 ! global surface emissivity control flag set up in 'sfc_init' ! @@ -141,7 +139,7 @@ module module_radiation_surface !>\section gen_sfc_init sfc_init General Algorithm !----------------------------------- subroutine sfc_init & - & ( me, errmsg, errflg )! --- inputs/outputs: + & ( me, ialbflg, iemsflg, semis_file, con_pi, errmsg, errflg )! --- inputs/outputs: ! ! =================================================================== ! ! ! @@ -155,11 +153,7 @@ subroutine sfc_init & ! ==================== defination of variables ==================== ! ! ! ! inputs: ! -! me - print control flag ! -! ! -! outputs: (none) to module variables only ! -! ! -! external module variables: ! +! me - print control flag ! ! ialbflg - control flag for surface albedo schemes ! ! =1: use modis based surface albedo ! ! =2: use surface albedo from land model ! @@ -169,13 +163,18 @@ subroutine sfc_init & ! b:=1 use varying climtology sfc emiss (veg based) ! ! =2 use surface emissivity from land model ! ! ! +! outputs: (CCPP error handling) ! +! errmsg - CCPP error message ! +! errflg - CCPP error flag ! +! ! ! ==================== end of description ===================== ! ! implicit none ! --- inputs: - integer, intent(in) :: me - + integer, intent(in) :: me, ialbflg, iemsflg + real(kind=kind_phys), intent(in) :: con_pi + character(len=26), intent(in) :: semis_file ! --- outputs: ( none ) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -191,10 +190,13 @@ subroutine sfc_init & errmsg = '' errflg = 0 ! + ! Module + rad2dg = 180.0 / con_pi + if ( me == 0 ) print *, VTAGSFC ! print out version tag !> - Initialization of surface albedo section -!! \n physparam::ialbflg +!! \n GFS_typedefs::ialbflg !! - = 1: using MODIS based land surface albedo for SW !! - = 2: using albedo from land model @@ -219,6 +221,9 @@ subroutine sfc_init & endif ! end if_ialbflg_block !> - Initialization of surface emissivity section +!! \n GFS_typedefs::iemsflg +!! - = 1: input SFC emissivity type map from "semis_file" +!! - = 2: input SFC emissivity from land model iemslw = mod(iemsflg, 10) ! emissivity control @@ -344,6 +349,7 @@ subroutine setalb & & lsmalbdvis, lsmalbdnir, lsmalbivis, lsmalbinir, & & icealbdvis, icealbdnir, icealbivis, icealbinir, & & IMAX, NF_ALBD, albPpert, pertalb, fracl, fraco, fraci, icy,& + & ialbflg, con_ttp, & & sfcalb & ! --- outputs: & ) @@ -391,6 +397,9 @@ subroutine setalb & ! fice (IMAX) - sea-ice fraction ! ! tisfc (IMAX) - sea-ice surface temperature ! ! IMAX - array horizontal dimension ! +! ialbflg - control flag for surface albedo schemes ! +! =1: use modis based surface albedo ! +! =2: use surface albedo from land model ! ! ! ! outputs: ! ! sfcalb(IMAX,NF_ALBD) ! @@ -399,17 +408,12 @@ subroutine setalb & ! ( :, 3) - uv+vis direct beam albedo ! ! ( :, 4) - uv+vis diffused albedo ! ! ! -! module internal control variables: ! -! ialbflg - =0 use the default climatology surface albedo ! -! =1 use modis retrieved albedo and input snow cover! -! for land areas ! -! ! ! ==================== end of description ===================== ! ! implicit none ! --- inputs - integer, intent(in) :: IMAX, NF_ALBD + integer, intent(in) :: IMAX, NF_ALBD, ialbflg integer, intent(in) :: lsm, lsm_noahmp, lsm_ruc logical, intent(in) :: use_cice_alb, frac_grid @@ -419,7 +423,7 @@ subroutine setalb & & alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, & & icealbdvis, icealbdnir, icealbivis, icealbinir, & & sncovr, sncovr_ice, snoalb, albPpert ! sfc-perts, mgehne - real (kind=kind_phys), intent(in) :: pertalb ! sfc-perts, mgehne + real (kind=kind_phys), intent(in) :: pertalb, con_ttp! sfc-perts, mgehne real (kind=kind_phys), dimension(:), intent(in) :: & & fracl, fraco, fraci real (kind=kind_phys), dimension(:),intent(inout) :: & diff --git a/physics/radlw_datatb.f b/physics/radlw_datatb.f index f297c8e4c..da0f5eaa3 100644 --- a/physics/radlw_datatb.f +++ b/physics/radlw_datatb.f @@ -66,7 +66,7 @@ module module_radlw_avplank ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NPLNK, NBANDS ! implicit none @@ -747,7 +747,7 @@ end module module_radlw_avplank ! module module_radlw_ref ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys ! implicit none ! @@ -924,7 +924,7 @@ end module module_radlw_ref ! module module_radlw_cldprlw ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NBANDS ! implicit none @@ -1607,7 +1607,7 @@ end module module_radlw_cldprlw ! module module_radlw_kgb01 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG01 ! implicit none @@ -2421,7 +2421,7 @@ end module module_radlw_kgb01 ! module module_radlw_kgb02 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG02 ! implicit none @@ -3278,7 +3278,7 @@ end module module_radlw_kgb02 ! module module_radlw_kgb03 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG03 ! implicit none @@ -10152,7 +10152,7 @@ end module module_radlw_kgb03 ! module module_radlw_kgb04 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG04 ! implicit none @@ -15352,7 +15352,7 @@ end module module_radlw_kgb04 ! module module_radlw_kgb05 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG05 ! implicit none @@ -21849,7 +21849,7 @@ end module module_radlw_kgb05 ! module module_radlw_kgb06 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG06 ! implicit none @@ -22109,7 +22109,7 @@ end module module_radlw_kgb06 ! module module_radlw_kgb07 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG07 ! implicit none @@ -24756,7 +24756,7 @@ end module module_radlw_kgb07 ! module module_radlw_kgb08 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG08 ! implicit none @@ -25553,7 +25553,7 @@ end module module_radlw_kgb08 ! module module_radlw_kgb09 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG09 ! implicit none @@ -28231,7 +28231,7 @@ end module module_radlw_kgb09 ! module module_radlw_kgb10 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG10 ! implicit none @@ -28705,7 +28705,7 @@ end module module_radlw_kgb10 ! module module_radlw_kgb11 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG11 ! implicit none @@ -29404,7 +29404,7 @@ end module module_radlw_kgb11 ! module module_radlw_kgb12 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG12 ! implicit none @@ -30475,7 +30475,7 @@ end module module_radlw_kgb12 ! module module_radlw_kgb13 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG13 ! implicit none @@ -31381,7 +31381,7 @@ end module module_radlw_kgb13 ! module module_radlw_kgb14 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG14 ! implicit none @@ -31605,7 +31605,7 @@ end module module_radlw_kgb14 ! module module_radlw_kgb15 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG15 ! implicit none @@ -32010,7 +32010,7 @@ end module module_radlw_kgb15 ! module module_radlw_kgb16 ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radlw_parameters, only : NG16 ! implicit none diff --git a/physics/radlw_main.F90 b/physics/radlw_main.F90 index 04609382d..7bc1ea80c 100644 --- a/physics/radlw_main.F90 +++ b/physics/radlw_main.F90 @@ -79,7 +79,6 @@ ! ! ! external modules referenced: ! ! ! -! 'module physparam' ! ! 'module physcons' ! ! 'mersenne_twister' ! ! ! @@ -278,8 +277,6 @@ !! rrtmg-lw radiation code from aer inc. module rrtmg_lw ! - use physparam, only : ilwrate, ilwrgas, ilwcliq, ilwcice, & - & isubclw, icldflg, iovr, ivflip use physcons, only : con_g, con_cp, con_avgd, con_amd, & & con_amw, con_amo3 use mersenne_twister, only : random_setseed, random_number, & @@ -425,7 +422,10 @@ subroutine rrtmg_lw_run & & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, & & icseed,aeraod,aerssa,sfemis,sfgtmp, & & dzlyr,delpin,de_lgth,alpha, & - & npts, nlay, nlp1, lprnt, cld_cf, lslwr, & + & npts, nlay, nlp1, lprnt, cld_cf, lslwr, top_at_1, iovr, & + & iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, & + & iovr_exprand, & + & inc_minor_gas, ilwcliq, ilwcice, isubclw, & & hlwc,topflx,sfcflx,cldtau, & ! --- outputs & HLW0,HLWB,FLXPRF, & ! --- optional & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & @@ -483,6 +483,33 @@ subroutine rrtmg_lw_run & ! npts : total number of horizontal points ! ! nlay, nlp1 : total number of vertical layers, levels ! ! lprnt : cntl flag for diagnostic print out ! +! inc_minor_gas - control flag for rare gases (ch4,n2o,o2,cfcs, etc.) ! +! =0: do not include rare gases ! +! >0: include all rare gases ! +! ilwcliq - control flag for liq-cloud optical properties ! +! =1: input cld liqp & reliq, hu & stamnes (1993) ! +! =2: not used ! +! ilwcice - control flag for ice-cloud optical properties ! +! =1: input cld icep & reice, ebert & curry (1997) ! +! =2: input cld icep & reice, streamer (1996) ! +! =3: input cld icep & reice, fu (1998) ! +! isubclw - sub-column cloud approximation control flag ! +! =0: no sub-col cld treatment, use grid-mean cld quantities ! +! =1: mcica sub-col, prescribed seeds to get random numbers ! +! =2: mcica sub-col, providing array icseed for random numbers! +! iovr - clouds vertical overlapping control flag ! +! =iovr_rand ! +! =iovr_maxrand ! +! =iovr_max ! +! =iovr_dcorr ! +! =iovr_exp ! +! =iovr_exprand ! +! iovr_rand - choice of cloud-overlap: random ! +! iovr_maxrand - choice of cloud-overlap: maximum random ! +! iovr_max - choice of cloud-overlap: maximum ! +! iovr_dcorr - choice of cloud-overlap: decorrelation length ! +! iovr_exp - choice of cloud-overlap: exponential ! +! iovr_exprand - choice of cloud-overlap: exponential random ! ! ! ! output variables: ! ! hlwc (npts,nlay): total sky heating rate (k/day or k/sec) ! @@ -508,32 +535,6 @@ subroutine rrtmg_lw_run & ! upfx0 - clear sky upward flux ! ! dnfx0 - clear sky dnward flux ! ! ! -! external module variables: (in physparam) ! -! ilwrgas - control flag for rare gases (ch4,n2o,o2,cfcs, etc.) ! -! =0: do not include rare gases ! -! >0: include all rare gases ! -! ilwcliq - control flag for liq-cloud optical properties ! -! =1: input cld liqp & reliq, hu & stamnes (1993) ! -! =2: not used ! -! ilwcice - control flag for ice-cloud optical properties ! -! =1: input cld icep & reice, ebert & curry (1997) ! -! =2: input cld icep & reice, streamer (1996) ! -! =3: input cld icep & reice, fu (1998) ! -! isubclw - sub-column cloud approximation control flag ! -! =0: no sub-col cld treatment, use grid-mean cld quantities ! -! =1: mcica sub-col, prescribed seeds to get random numbers ! -! =2: mcica sub-col, providing array icseed for random numbers! -! iovr - cloud overlapping control flag ! -! =0: random overlapping clouds ! -! =1: maximum/random overlapping clouds ! -! =2: maximum overlap cloud (used for isubclw>0 only) ! -! =3: decorrelation-length overlap (for isubclw>0 only) ! -! =4: exponential cloud overlap (AER) ! -! =5: exponential-random cloud overlap (AER) ! -! ivflip - control flag for vertical index direction ! -! =0: vertical index from toa to surface ! -! =1: vertical index from surface to toa ! -! ! ! module parameters, control variables: ! ! nbands - number of longwave spectral bands ! ! maxgas - maximum number of absorbing gaseous ! @@ -605,10 +606,12 @@ subroutine rrtmg_lw_run & ! ====================== end of definitions =================== ! ! --- inputs: - integer, intent(in) :: npts, nlay, nlp1 + integer, intent(in) :: npts, nlay, nlp1, ilwcliq, ilwcice, & + isubclw, iovr, iovr_dcorr, iovr_exp, iovr_exprand, iovr_rand,& + iovr_maxrand, iovr_max integer, intent(in) :: icseed(npts) - logical, intent(in) :: lprnt + logical, intent(in) :: lprnt, inc_minor_gas real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, & & tlvl @@ -631,6 +634,7 @@ subroutine rrtmg_lw_run & real (kind=kind_phys), dimension(:,:,:),intent(in):: & & aeraod, aerssa + logical, intent(in) :: lslwr, top_at_1 ! --- outputs: real (kind=kind_phys), dimension(:,:), intent(inout) :: hlwc @@ -650,7 +654,6 @@ subroutine rrtmg_lw_run & & intent(inout) :: hlw0 type (proflw_type), dimension(:,:), optional, & & intent(inout) :: flxprf - logical, intent(in) :: lslwr ! --- locals: real (kind=kind_phys), dimension(0:nlp1) :: cldfrc @@ -790,7 +793,7 @@ subroutine rrtmg_lw_run & endif stemp = sfgtmp(iplon) ! surface ground temp - if (iovr == 3) delgth= de_lgth(iplon) ! clouds decorr-length + if (iovr == iovr_dcorr) delgth= de_lgth(iplon) ! clouds decorr-length !> -# Prepare atmospheric profile for use in rrtm. ! the vertical index of internal array is from surface to top @@ -801,7 +804,7 @@ subroutine rrtmg_lw_run & ! layer pressure thickness (in mb), based on the hydrostatic equation ! --- ... and includes a correction to account for h2o in the layer. - if (ivflip == 0) then ! input from toa to sfc + if (top_at_1) then ! input from toa to sfc tem1 = 100.0 * con_g tem2 = 1.0e-20 * 1.0e3 * con_avgd @@ -814,7 +817,7 @@ subroutine rrtmg_lw_run & tavel(k)= tlyr(iplon,k1) tz(k) = tlvl(iplon,k1) dz(k) = dzlyr(iplon,k1) - if (iovr == 4 .or. iovr == 5) alph(k) = alpha(iplon,k) ! alpha decorrelation + if (iovr == iovr_exp .or. iovr == iovr_exprand) alph(k) = alpha(iplon,k) ! alpha decorrelation !> -# Set absorber amount for h2o, co2, and o3. @@ -841,7 +844,7 @@ subroutine rrtmg_lw_run & !! cf22, convert from volume mixing ratio to molec/cm2 based on !! coldry (scaled to 1.0e-20). - if (ilwrgas > 0) then + if (inc_minor_gas) then do k = 1, nlay k1 = nlp1 - k colamt(k,4)=max(temcol(k), coldry(k)*gasvmr_n2o(iplon,k1)) ! n2o @@ -927,7 +930,7 @@ subroutine rrtmg_lw_run & tavel(k)= tlyr(iplon,k) tz(k) = tlvl(iplon,k+1) dz(k) = dzlyr(iplon,k) - if (iovr == 4 .or. iovr == 5) alph(k) = alpha(iplon,k) ! alpha decorrelation + if (iovr == iovr_exp .or. iovr == iovr_exprand) alph(k) = alpha(iplon,k) ! alpha decorrelation ! --- ... set absorber amount !test use @@ -952,7 +955,7 @@ subroutine rrtmg_lw_run & ! --- ... set up col amount for rare gases, convert from volume mixing ratio ! to molec/cm2 based on coldry (scaled to 1.0e-20) - if (ilwrgas > 0) then + if (inc_minor_gas) then do k = 1, nlay colamt(k,4)=max(temcol(k), coldry(k)*gasvmr_n2o(iplon,k)) ! n2o colamt(k,5)=max(temcol(k), coldry(k)*gasvmr_ch4(iplon,k)) ! ch4 @@ -1021,7 +1024,7 @@ subroutine rrtmg_lw_run & tem0 = 10.0 * tem2 / (amdw * tem1 * con_g) pwvcm = tem0 * plvl(iplon,1) - endif ! if_ivflip + endif ! top_at_1 !> -# Compute column amount for broadening gases. @@ -1078,6 +1081,7 @@ subroutine rrtmg_lw_run & ! --- inputs: & ( cldfrc,clwp,relw,ciwp,reiw,cda1,cda2,cda3,cda4, & & nlay, nlp1, ipseed(iplon), dz, delgth, iovr, alph, & + & ilwcliq, ilwcice, isubclw, & ! --- outputs: & cldfmc, taucld & & ) @@ -1085,7 +1089,7 @@ subroutine rrtmg_lw_run & ! --- ... save computed layer cloud optical depth for output ! rrtm band-7 is apprx 10mu channel (or use spectral mean of bands 6-8) - if (ivflip == 0) then ! input from toa to sfc + if (top_at_1) then ! input from toa to sfc do k = 1, nlay k1 = nlp1 - k cldtau(iplon,k1) = taucld( 7,k) @@ -1094,7 +1098,7 @@ subroutine rrtmg_lw_run & do k = 1, nlay cldtau(iplon,k) = taucld( 7,k) enddo - endif ! end if_ivflip_block + endif ! end if_top_at_1_block else cldfmc = f_zero @@ -1229,7 +1233,7 @@ subroutine rrtmg_lw_run & sfcflx(iplon)%dnfxc = totdflux(0) sfcflx(iplon)%dnfx0 = totdclfl(0) - if (ivflip == 0) then ! output from toa to sfc + if (top_at_1) then ! output from toa to sfc !! --- ... optional fluxes if ( lflxprf ) then @@ -1297,7 +1301,7 @@ subroutine rrtmg_lw_run & enddo endif - endif ! if_ivflip + endif ! if_top_at_1 enddo lab_do_iplon @@ -1315,9 +1319,9 @@ end subroutine rrtmg_lw_run !! spectral band are reduced from 256 g-point intervals to 140. !!\param me print control for parallel process !!\section rlwinit_gen rlwinit General Algorithm - subroutine rlwinit & - & ( me ) ! --- inputs -! --- outputs: (none) + subroutine rlwinit( me, rad_hr_units, inc_minor_gas, ilwcliq, & + isubclw, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr,& + iovr_exp, iovr_exprand, errflg, errmsg ) ! =================== program usage description =================== ! ! ! @@ -1329,17 +1333,9 @@ subroutine rlwinit & ! ==================== defination of variables ==================== ! ! ! ! inputs: ! -! me - print control for parallel process ! -! ! -! outputs: (none) ! -! ! -! external module variables: (in physparam) ! -! ilwrate - heating rate unit selections ! -! =1: output in k/day ! -! =2: output in k/second ! -! ilwrgas - control flag for rare gases (ch4,n2o,o2,cfcs, etc.) ! -! =0: do not include rare gases ! -! >0: include all rare gases ! +! me - print control for parallel process ! +! rad_hr_units - 1 for heating rates in units K/day. 2 for K/s ! +! inc_minor_gas - flag to turn on/off minor gases in rrtmg ! ! ilwcliq - liquid cloud optical properties contrl flag ! ! =0: input cloud opt depth from diagnostic scheme ! ! >0: input cwp,rew, and other cloud content parameters ! @@ -1347,16 +1343,23 @@ subroutine rlwinit & ! =0: no sub-col cld treatment, use grid-mean cld quantities ! ! =1: mcica sub-col, prescribed seeds to get random numbers ! ! =2: mcica sub-col, providing array icseed for random numbers! -! icldflg - cloud scheme control flag ! -! =0: diagnostic scheme gives cloud tau, omiga, and g. ! -! =1: prognostic scheme gives cloud liq/ice path, etc. ! ! iovr - clouds vertical overlapping control flag ! -! =0: random overlapping clouds ! -! =1: maximum/random overlapping clouds ! -! =2: maximum overlap cloud (isubcol>0 only) ! -! =3: decorrelation-length overlap (for isubclw>0 only) ! -! =4: exponential cloud overlap (AER) ! -! =5: exponential-random cloud overlap (AER) ! +! =iovr_rand ! +! =iovr_maxrand ! +! =iovr_max ! +! =iovr_dcorr ! +! =iovr_exp ! +! =iovr_exprand ! +! iovr_rand - choice of cloud-overlap: random ! +! iovr_maxrand - choice of cloud-overlap: maximum random ! +! iovr_max - choice of cloud-overlap: maximum ! +! iovr_dcorr - choice of cloud-overlap: decorrelation length ! +! iovr_exp - choice of cloud-overlap: exponential ! +! iovr_exprand - choice of cloud-overlap: exponential random ! +! ! +! outputs: ! +! errflg - error flag ! +! errmsg - error message ! ! ! ! ******************************************************************* ! ! original code description ! @@ -1386,9 +1389,14 @@ subroutine rlwinit & ! ====================== end of description block ================= ! ! --- inputs: - integer, intent(in) :: me + integer, intent(in) :: me, rad_hr_units, ilwcliq, isubclw, iovr, & + iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, & + iovr_exprand + logical, intent(in) :: inc_minor_gas -! --- outputs: none +! --- outputs: + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! --- locals: real (kind=kind_phys), parameter :: expeps = 1.e-20 @@ -1400,25 +1408,21 @@ subroutine rlwinit & ! !===> ... begin here ! - if ( iovr<0 .or. iovr>5 ) then - print *,' *** Error in specification of cloud overlap flag', & - & ' IOVR=',iovr,' in RLWINIT !!' - stop - elseif ( (iovr==2 .or. iovr==3) .and. isubclw==0 ) then - if (me == 0) then - print *,' *** IOVR=',iovr,' is not available for', & - & ' ISUBCLW=0 setting!!' - print *,' The program uses maximum/random overlap', & - & ' instead.' - endif + ! Initialize error-handling + errflg = 0 + errmsg = '' - iovr = 1 + if ((iovr .ne. iovr_rand) .and. (iovr .ne. iovr_maxrand) .and. & + (iovr .ne. iovr_max) .and. (iovr .ne. iovr_dcorr) .and. & + (iovr .ne. iovr_exp) .and. (iovr .ne. iovr_exprand)) then + errflg = 1 + errmsg = 'ERROR(rlwinit): Error in specification of cloud overlap flag' endif if (me == 0) then print *,' - Using AER Longwave Radiation, Version: ', VTAGLW - if (ilwrgas > 0) then + if (inc_minor_gas) then print *,' --- Include rare gases N2O, CH4, O2, CFCs ', & & 'absorptions in LW' else @@ -1434,22 +1438,9 @@ subroutine rlwinit & elseif ( isubclw == 2 ) then print *,' --- Using MCICA sub-colum clouds approximation ', & & 'with provided input array of permutation seeds' - else - print *,' *** Error in specification of sub-column cloud ', & - & ' control flag isubclw =',isubclw,' !!' - stop endif endif -!> -# Check cloud flags for consistency. - - if ((icldflg == 0 .and. ilwcliq /= 0) .or. & - & (icldflg == 1 .and. ilwcliq == 0)) then - print *,' *** Model cloud scheme inconsistent with LW', & - & ' radiation cloud radiative property setup !!' - stop - endif - !> -# Setup default surface emissivity for each band. semiss0(:) = f_one @@ -1461,7 +1452,7 @@ subroutine rlwinit & fluxfac = pival * 2.0d4 ! fluxfac = 62831.85307179586 ! = 2 * pi * 1.0e4 - if (ilwrate == 1) then + if (rad_hr_units == 1) then ! heatfac = 8.4391 ! heatfac = con_g * 86400. * 1.0e-2 / con_cp ! (in k/day) heatfac = con_g * 864.0 / con_cp ! (in k/day) @@ -1538,8 +1529,8 @@ end subroutine rlwinit !!\section gen_cldprop cldprop General Algorithm subroutine cldprop & & ( cfrac,cliqp,reliq,cicep,reice,cdat1,cdat2,cdat3,cdat4, & ! --- inputs - & nlay, nlp1, ipseed, dz, de_lgth, iovr, alpha, & - & cldfmc, taucld & ! --- outputs + & nlay, nlp1, ipseed, dz, de_lgth, iovr, alpha, ilwcliq, & + & ilwcice, isubclw, cldfmc, taucld & ! --- outputs & ) ! =================== program usage description =================== ! @@ -1639,7 +1630,8 @@ subroutine cldprop & use module_radlw_cldprlw ! --- inputs: - integer, intent(in) :: nlay, nlp1, ipseed, iovr + integer, intent(in) :: nlay, nlp1, ipseed, iovr, ilwcliq, ilwcice,& + isubclw real (kind=kind_phys), dimension(0:nlp1), intent(in) :: cfrac real (kind=kind_phys), dimension(nlay), intent(in) :: cliqp, & @@ -1804,7 +1796,7 @@ subroutine cldprop & endif lab_if_ilwcliq -!> -# if physparam::isubclw > 0, call mcica_subcol() to distribute +!> -# if GFS_typedefs::isubclw > 0, call mcica_subcol() to distribute !! cloud properties to each g-point. if ( isubclw > 0 ) then ! mcica sub-col clouds approx @@ -1820,7 +1812,7 @@ subroutine cldprop & call mcica_subcol & ! --- inputs: - & ( cldf, nlay, ipseed, dz, de_lgth, alpha, & + & ( cldf, nlay, ipseed, dz, de_lgth, alpha, iovr, & ! --- output: & lcloudy & & ) @@ -1853,7 +1845,7 @@ end subroutine cldprop !!\param lcloudy sub-colum cloud profile flag array !!\section mcica_subcol_gen mcica_subcol General Algorithm subroutine mcica_subcol & - & ( cldf, nlay, ipseed, dz, de_lgth, alpha, & ! --- inputs + & ( cldf, nlay, ipseed, dz, de_lgth, alpha, iovr, & ! --- inputs & lcloudy & ! --- outputs & ) @@ -1868,22 +1860,20 @@ subroutine mcica_subcol & ! for lw and sw, use values differ by the number of g-pts. ! ! dz - real, layer thickness (km) nlay ! ! de_lgth - real, layer cloud decorrelation length (km) 1 ! -! alpha - real, EXP/ER decorrelation parameter nlay ! +! alpha - real, EXP/ER decorrelation parameter nlay ! +! iovr - control flag for cloud overlapping method 1 ! +! =0:random; =1:maximum/random: =2:maximum; =3:decorr ! +! =4:exponential; =5:exponential-random ! ! ! ! output variables: ! ! lcloudy - logical, sub-colum cloud profile flag array ngptlw*nlay! ! ! -! other control flags from module variables: ! -! iovr : control flag for cloud overlapping method ! -! =0:random; =1:maximum/random: =2:maximum; =3:decorr ! -! =4:exponential; =5:exponential-random ! -! ! ! ===================== end of definitions ==================== ! implicit none ! --- inputs: - integer, intent(in) :: nlay, ipseed + integer, intent(in) :: nlay, ipseed, iovr real (kind=kind_phys), dimension(nlay), intent(in) :: cldf, dz real (kind=kind_phys), intent(in) :: de_lgth @@ -7635,7 +7625,9 @@ subroutine cldprmc(nlayers, inflag, iceflag, liqflag, cldfmc, & return elseif(inflag .eq. 1) then - stop 'INFLAG = 1 OPTION NOT AVAILABLE WITH MCICA' + errflg = 1 + errmsg = 'ERROR(rlwinit): INFLAG = 1 OPTION NOT AVAILABLE WITH MCICA' + return ! cwp = ciwpmc(ig,lay) + clwpmc(ig,lay) ! taucmc(ig,lay) = abscld1 * cwp diff --git a/physics/radlw_main.meta b/physics/radlw_main.meta index 9286c45cb..3dccc97b3 100644 --- a/physics/radlw_main.meta +++ b/physics/radlw_main.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmg_lw type = scheme - dependencies = machine.F,mersenne_twister.f,physcons.F90,physparam.f,radlw_datatb.f,radlw_param.f + dependencies = machine.F,mersenne_twister.f,physcons.F90,radlw_datatb.f,radlw_param.f ######################################################################## [ccpp-arg-table] @@ -241,6 +241,90 @@ dimensions = () type = logical intent = in +[top_at_1] + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation + units = flag + dimensions = () + type = logical + intent = in +[iovr] + standard_name = flag_for_cloud_overlap_method_for_radiation + long_name = flag for cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_exp] + standard_name = flag_for_exponential_cloud_overlap_method + long_name = choice of exponential cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_exprand] + standard_name = flag_for_exponential_random_cloud_overlap_method + long_name = choice of exponential-random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_max] + standard_name = flag_for_maximum_cloud_overlap_method + long_name = choice of maximum cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_rand] + standard_name = flag_for_random_cloud_overlap_method + long_name = choice of random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_maxrand] + standard_name = flag_for_maximum_random_cloud_overlap_method + long_name = choice of maximum-random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_dcorr] + standard_name = flag_for_decorrelation_length_cloud_overlap_method + long_name = choice of decorrelation-length cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[inc_minor_gas] + standard_name = flag_to_include_minor_gases_in_rrtmg + long_name = flag to include minor trace gases in rrtmg + units = flag + dimensions = () + type = logical + intent = in +[ilwcliq] + standard_name = flag_for_optical_property_for_liquid_clouds_for_longwave_radiation + long_name = lw optical property for liquid clouds + units = flag + dimensions = () + type = integer + intent = in +[ilwcice] + standard_name = flag_for_optical_property_for_ice_clouds_for_longwave_radiation + long_name = lw optical property for ice clouds + units = flag + dimensions = () + type = integer + intent = in +[isubclw] + standard_name = flag_for_lw_clouds_sub_grid_approximation + long_name = flag for lw clouds sub-grid approximation + units = flag + dimensions = () + type = integer + intent = in [hlwc] standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_time_step_and_radiation_levels long_name = longwave total sky heating rate diff --git a/physics/radlw_param.f b/physics/radlw_param.f index fa7ceecb0..bc2aae224 100644 --- a/physics/radlw_param.f +++ b/physics/radlw_param.f @@ -65,7 +65,7 @@ module module_radlw_parameters ! !! \htmlinclude module_radlw_parameters.html !! - use physparam, only : kind_phys + use machine, only : kind_phys implicit none ! diff --git a/physics/radsw_datatb.f b/physics/radsw_datatb.f index 6d88f1989..e0bb651e9 100644 --- a/physics/radsw_datatb.f +++ b/physics/radsw_datatb.f @@ -73,7 +73,7 @@ module module_radsw_ref ! !........................................! ! - use physparam, only : kind_phys + use machine, only : kind_phys ! implicit none ! @@ -217,7 +217,7 @@ module module_radsw_cldprtb ! ! ! ! ************************* end description ************************ ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : nblow, nbhgh ! implicit none @@ -2503,7 +2503,7 @@ module module_radsw_sflux ! ! ! ! ************************* end description ************************ ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NGMAX, NG16, NG17, NG18, NG19,& & NG20, NG21, NG22, NG23, NG24, & & NG25, NG26, NG27, NG28, NG29, & @@ -2838,7 +2838,7 @@ module module_radsw_kgb16 ! ! ! ! ************************ end description ************************ ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG16 ! @@ -4031,7 +4031,7 @@ module module_radsw_kgb17 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG17 ! @@ -8640,7 +8640,7 @@ module module_radsw_kgb18 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG18 ! @@ -10158,7 +10158,7 @@ module module_radsw_kgb19 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG19 ! @@ -11677,7 +11677,7 @@ module module_radsw_kgb20 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG20 ! @@ -12461,7 +12461,7 @@ module module_radsw_kgb21 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG21 ! @@ -16319,7 +16319,7 @@ module module_radsw_kgb22 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG22 ! @@ -16766,7 +16766,7 @@ module module_radsw_kgb23 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG23 ! @@ -17023,7 +17023,7 @@ module module_radsw_kgb24 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG24 ! @@ -18588,7 +18588,7 @@ module module_radsw_kgb25 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG25 ! @@ -18748,7 +18748,7 @@ module module_radsw_kgb26 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG26 ! @@ -18784,7 +18784,7 @@ module module_radsw_kgb27 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG27 ! @@ -19387,7 +19387,7 @@ module module_radsw_kgb28 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG28 ! @@ -21701,7 +21701,7 @@ module module_radsw_kgb29 ! ! ! ! ********* ********* end description ********* ********* ! ! - use physparam, only : kind_phys + use machine, only : kind_phys use module_radsw_parameters, only : NG29 ! diff --git a/physics/radsw_main.F90 b/physics/radsw_main.F90 index ae2f21e18..fe63963f5 100644 --- a/physics/radsw_main.F90 +++ b/physics/radsw_main.F90 @@ -90,7 +90,6 @@ ! ! ! external modules referenced: ! ! ! -! 'module physparam' ! ! 'module physcons' ! ! 'mersenne_twister' ! ! ! @@ -304,9 +303,6 @@ !! rrtmg-sw radiation code from aer inc. module rrtmg_sw ! - use physparam, only : iswrate, iswrgas, iswcliq, iswcice, & - & isubcsw, icldflg, iovr, ivflip, & - & iswmode use physcons, only : con_g, con_cp, con_avgd, con_amd, & & con_amw, con_amo3 use machine, only : rb => kind_phys, im => kind_io4, & @@ -503,8 +499,9 @@ subroutine rrtmg_sw_run & & sfcalb_uvis_dir, sfcalb_uvis_dif, & & dzlyr,delpin,de_lgth,alpha, & & cosz,solcon,NDAY,idxday, & - & npts, nlay, nlp1, lprnt, & - & cld_cf, lsswr, & + & npts, nlay, nlp1, lprnt, inc_minor_gas, iswcliq, iswcice, & + & isubcsw, iovr, top_at_1, iswmode, cld_cf, lsswr, iovr_rand,& + & iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, iovr_exprand,& & hswc,topflx,sfcflx,cldtau, & ! --- outputs & HSW0,HSWB,FLXPRF,FDNCMP, & ! --- optional & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & @@ -570,6 +567,36 @@ subroutine rrtmg_sw_run & ! npts : number of horizontal points ! ! nlay,nlp1 : vertical layer/lavel numbers ! ! lprnt : logical check print flag ! +! iswcliq - control flag for liq-cloud optical properties ! +! =0: input cloud optical depth, fixed ssa, asy ! +! =1: use hu and stamnes(1993) method for liq cld ! +! =2: use updated coeffs for hu and stamnes scheme ! +! iswcice - control flag for ice-cloud optical properties ! +! *** if iswcliq==0, iswcice is ignored ! +! =1: use ebert and curry (1992) scheme for ice clouds ! +! =2: use streamer v3.0 (2001) method for ice clouds ! +! =3: use fu's method (1996) for ice clouds ! +! iswmode - control flag for 2-stream transfer scheme ! +! =1; delta-eddington (joseph et al., 1976) ! +! =2: pifm (zdunkowski et al., 1980) ! +! =3: discrete ordinates (liou, 1973) ! +! isubcsw - sub-column cloud approximation control flag ! +! =0: no sub-col cld treatment, use grid-mean cld quantities ! +! =1: mcica sub-col, prescribed seeds to get random numbers ! +! =2: mcica sub-col, providing array icseed for random numbers! +! iovr - clouds vertical overlapping control flag ! +! =iovr_rand ! +! =iovr_maxrand ! +! =iovr_max ! +! =iovr_dcorr ! +! =iovr_exp ! +! =iovr_exprand ! +! iovr_rand - choice of cloud-overlap: random ! +! iovr_maxrand - choice of cloud-overlap: maximum random ! +! iovr_max - choice of cloud-overlap: maximum ! +! iovr_dcorr - choice of cloud-overlap: decorrelation length ! +! iovr_exp - choice of cloud-overlap: exponential ! +! iovr_exprand - choice of cloud-overlap: exponential random ! ! ! ! output variables: ! ! hswc (npts,nlay): total sky heating rates (k/sec or k/day) ! @@ -604,38 +631,6 @@ subroutine rrtmg_sw_run & ! visbm - downward surface uv+vis direct beam flux ! ! visdf - downward surface uv+vis diffused flux ! ! ! -! external module variables: (in physparam) ! -! iswrgas - control flag for rare gases (ch4,n2o,o2, etc.) ! -! =0: do not include rare gases ! -! >0: include all rare gases ! -! iswcliq - control flag for liq-cloud optical properties ! -! =0: input cloud optical depth, fixed ssa, asy ! -! =1: use hu and stamnes(1993) method for liq cld ! -! =2: use updated coeffs for hu and stamnes scheme ! -! iswcice - control flag for ice-cloud optical properties ! -! *** if iswcliq==0, iswcice is ignored ! -! =1: use ebert and curry (1992) scheme for ice clouds ! -! =2: use streamer v3.0 (2001) method for ice clouds ! -! =3: use fu's method (1996) for ice clouds ! -! iswmode - control flag for 2-stream transfer scheme ! -! =1; delta-eddington (joseph et al., 1976) ! -! =2: pifm (zdunkowski et al., 1980) ! -! =3: discrete ordinates (liou, 1973) ! -! isubcsw - sub-column cloud approximation control flag ! -! =0: no sub-col cld treatment, use grid-mean cld quantities ! -! =1: mcica sub-col, prescribed seeds to get random numbers ! -! =2: mcica sub-col, providing array icseed for random numbers! -! iovr - cloud overlapping control flag ! -! =0: random overlapping clouds ! -! =1: maximum/random overlapping clouds ! -! =2: maximum overlap cloud ! -! =3: decorrelation-length overlap clouds ! -! =4: exponential cloud overlap (AER) ! -! =5: exponential-random cloud overlap (AER) ! -! ivflip - control flg for direction of vertical index ! -! =0: index from toa to surface ! -! =1: index from surface to toa ! -! ! ! module parameters, control variables: ! ! nblow,nbhgh - lower and upper limits of spectral bands ! ! maxgas - maximum number of absorbing gaseous ! @@ -690,11 +685,13 @@ subroutine rrtmg_sw_run & ! ===================== end of definitions ==================== ! ! --- inputs: - integer, intent(in) :: npts, nlay, nlp1, NDAY + integer, intent(in) :: npts, nlay, nlp1, NDAY, iswcliq, iswcice, & + isubcsw, iovr, iswmode, iovr_dcorr, iovr_exp, iovr_exprand, & + iovr_rand, iovr_maxrand, iovr_max integer, dimension(:), intent(in) :: idxday, icseed - logical, intent(in) :: lprnt, lsswr + logical, intent(in) :: lprnt, lsswr, inc_minor_gas, top_at_1 real (kind=kind_phys), dimension(:,:), intent(in) :: & & plvl, tlvl @@ -899,7 +896,7 @@ subroutine rrtmg_sw_run & cosz1 = cosz(j1) sntz1 = f_one / cosz(j1) ssolar = s0fac * cosz(j1) - if (iovr == 3) delgth = de_lgth(j1) ! clouds decorr-length + if (iovr == iovr_dcorr) delgth = de_lgth(j1) ! clouds decorr-length !> - Prepare surface albedo: bm,df - dir,dif; 1,2 - nir,uvv. albbm(1) = sfcalb_nir_dir(j1) @@ -910,7 +907,7 @@ subroutine rrtmg_sw_run & !> - Prepare atmospheric profile for use in rrtm. ! the vertical index of internal array is from surface to top - if (ivflip == 0) then ! input from toa to sfc + if (top_at_1) then ! input from toa to sfc tem1 = 100.0 * con_g tem2 = 1.0e-20 * 1.0e3 * con_avgd @@ -921,7 +918,7 @@ subroutine rrtmg_sw_run & tavel(k) = tlyr(j1,kk) delp (k) = delpin(j1,kk) dz (k) = dzlyr (j1,kk) - if (iovr == 4 .or. iovr == 5) alph(k) = alpha(j1,k) ! alpha decorrelation + if (iovr == iovr_exp .or. iovr == iovr_exprand) alph(k) = alpha(j1,k) ! alpha decorrelation !> - Set absorber and gas column amount, convert from volume mixing !! ratio to molec/cm2 based on coldry (scaled to 1.0e-20) @@ -950,7 +947,7 @@ subroutine rrtmg_sw_run & ! --- ... set up gas column amount, convert from volume mixing ratio ! to molec/cm2 based on coldry (scaled to 1.0e-20) - if (iswrgas > 0) then + if (inc_minor_gas) then do k = 1, nlay kk = nlp1 - k colamt(k,4) = max(temcol(k), coldry(k)*gasvmr_n2o(j1,kk)) ! n2o @@ -1012,7 +1009,7 @@ subroutine rrtmg_sw_run & tavel(k) = tlyr(j1,k) delp (k) = delpin(j1,k) dz (k) = dzlyr (j1,k) - if (iovr == 4 .or. iovr == 5) alph(k) = alpha(j1,k) ! alpha decorrelation + if (iovr == iovr_exp .or. iovr == iovr_exprand) alph(k) = alpha(j1,k) ! alpha decorrelation ! --- ... set absorber amount !test use @@ -1047,7 +1044,7 @@ subroutine rrtmg_sw_run & ! --- ... set up gas column amount, convert from volume mixing ratio ! to molec/cm2 based on coldry (scaled to 1.0e-20) - if (iswrgas > 0) then + if (inc_minor_gas) then do k = 1, nlay colamt(k,4) = max(temcol(k), coldry(k)*gasvmr_n2o(j1,k)) ! n2o colamt(k,5) = max(temcol(k), coldry(k)*gasvmr_ch4(j1,k)) ! ch4 @@ -1094,7 +1091,7 @@ subroutine rrtmg_sw_run & enddo endif ! end if_iswcliq - endif ! if_ivflip + endif ! if_top_at_1 !> - Compute fractions of clear sky view: !! - random overlapping @@ -1103,11 +1100,11 @@ subroutine rrtmg_sw_run & zcf0 = f_one zcf1 = f_one - if (iovr == 0) then ! random overlapping + if (iovr == iovr_rand) then ! random overlapping do k = 1, nlay zcf0 = zcf0 * (f_one - cfrac(k)) enddo - else if (iovr == 1) then ! max/ran/exp overlapping + else if (iovr == iovr_maxrand) then ! max/ran/exp overlapping do k = 1, nlay if (cfrac(k) > ftiny) then ! cloudy layer zcf1 = min ( zcf1, f_one-cfrac(k) ) @@ -1135,7 +1132,8 @@ subroutine rrtmg_sw_run & call cldprop & ! --- inputs: & ( cfrac,cliqp,reliq,cicep,reice,cdat1,cdat2,cdat3,cdat4, & - & zcf1, nlay, ipseed(j1), dz, delgth, alph, & + & zcf1, nlay, ipseed(j1), dz, delgth, alph, iswcliq, iswcice,& + & isubcsw, iovr, & ! --- outputs: & taucw, ssacw, asycw, cldfrc, cldfmc & & ) @@ -1143,7 +1141,7 @@ subroutine rrtmg_sw_run & ! --- ... save computed layer cloud optical depth for output ! rrtm band 10 is approx to the 0.55 mu spectrum - if (ivflip == 0) then ! input from toa to sfc + if (top_at_1) then ! input from toa to sfc do k = 1, nlay kk = nlp1 - k cldtau(j1,kk) = taucw(k,10) @@ -1152,7 +1150,7 @@ subroutine rrtmg_sw_run & do k = 1, nlay cldtau(j1,k) = taucw(k,10) enddo - endif ! end if_ivflip_block + endif ! end if_top_at_1_block else ! clear sky column cldfrc(:) = f_zero @@ -1187,9 +1185,9 @@ subroutine rrtmg_sw_run & & ) !> - Call the 2-stream radiation transfer model: -!! - if physparam::isubcsw .le.0, using standard cloud scheme, +!! - if GFS_typedefs::isubcsw .le.0, using standard cloud scheme, !! call spcvrtc(). -!! - if physparam::isubcsw .gt.0, using mcica cloud scheme, +!! - if GFS_typedefs::isubcsw .gt.0, using mcica cloud scheme, !! call spcvrtm(). if ( isubcsw <= 0 ) then ! use standard cloud scheme @@ -1198,7 +1196,7 @@ subroutine rrtmg_sw_run & ! --- inputs: & ( ssolar,cosz1,sntz1,albbm,albdf,sfluxzen,cldfrc, & & zcf1,zcf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, & - & nlay, nlp1, & + & nlay, nlp1, iswmode, & ! --- outputs: & fxupc,fxdnc,fxup0,fxdn0, & & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, & @@ -1211,7 +1209,7 @@ subroutine rrtmg_sw_run & ! --- inputs: & ( ssolar,cosz1,sntz1,albbm,albdf,sfluxzen,cldfmc, & & zcf1,zcf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, & - & nlay, nlp1, & + & nlay, nlp1, iswmode, & ! --- outputs: & fxupc,fxdnc,fxup0,fxdn0, & & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, & @@ -1276,7 +1274,7 @@ subroutine rrtmg_sw_run & sfcflx(j1)%upfx0 = fsfcu0 sfcflx(j1)%dnfx0 = fsfcd0 - if (ivflip == 0) then ! output from toa to sfc + if (top_at_1) then ! output from toa to sfc ! --- ... compute heating rates @@ -1372,7 +1370,7 @@ subroutine rrtmg_sw_run & enddo endif - endif ! if_ivflip + endif ! if_top_at_1 enddo lab_do_ipt @@ -1387,9 +1385,9 @@ end subroutine rrtmg_sw_run !!\param me print control for parallel process !>\section rswinit_gen rswinit General Algorithm !----------------------------------- - subroutine rswinit & - & ( me ) ! --- inputs: -! --- outputs: (none) + subroutine rswinit( me, rad_hr_units, inc_minor_gas, iswcliq, & + isubcsw, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr,& + iovr_exp, iovr_exprand, iswmode, errflg, errmsg ) ! =================== program usage description =================== ! ! ! @@ -1401,17 +1399,8 @@ subroutine rswinit & ! ==================== defination of variables ==================== ! ! ! ! inputs: ! -! me - print control for parallel process ! -! ! -! outputs: (none) ! -! ! -! external module variables: (in physparam) ! -! iswrate - heating rate unit selections ! -! =1: output in k/day ! -! =2: output in k/second ! -! iswrgas - control flag for rare gases (ch4,n2o,o2, etc.) ! -! =0: do not include rare gases ! -! >0: include all rare gases ! +! me - print control for parallel process ! +! rad_hr_units - ! ! iswcliq - liquid cloud optical properties contrl flag ! ! =0: input cloud opt depth from diagnostic scheme ! ! >0: input cwp,rew, and other cloud content parameters ! @@ -1419,21 +1408,27 @@ subroutine rswinit & ! =0: no sub-col cld treatment, use grid-mean cld quantities ! ! =1: mcica sub-col, prescribed seeds to get random numbers ! ! =2: mcica sub-col, providing array icseed for random numbers! -! icldflg - cloud scheme control flag ! -! =0: diagnostic scheme gives cloud tau, omiga, and g. ! -! =1: prognostic scheme gives cloud liq/ice path, etc. ! -! iovr - clouds vertical overlapping control flag ! -! =0: random overlapping clouds ! -! =1: maximum/random overlapping clouds ! -! =2: maximum overlap cloud ! -! =3: decorrelation-length overlap clouds ! -! =4: exponential cloud overlap (AER) ! -! =5: exponential-random cloud overlap (AER) ! +! iovr - clouds vertical overlapping control flag ! +! =iovr_rand ! +! =iovr_maxrand ! +! =iovr_max ! +! =iovr_dcorr ! +! =iovr_exp ! +! =iovr_exprand ! +! iovr_rand - choice of cloud-overlap: random ! +! iovr_maxrand - choice of cloud-overlap: maximum random ! +! iovr_max - choice of cloud-overlap: maximum ! +! iovr_dcorr - choice of cloud-overlap: decorrelation length ! +! iovr_exp - choice of cloud-overlap: exponential ! +! iovr_exprand - choice of cloud-overlap: exponential random ! ! iswmode - control flag for 2-stream transfer scheme ! ! =1; delta-eddington (joseph et al., 1976) ! ! =2: pifm (zdunkowski et al., 1980) ! ! =3: discrete ordinates (liou, 1973) ! ! ! +! outputs: ! +! errflg - error flag ! +! errmsg - error message ! ! ******************************************************************* ! ! ! ! definitions: ! @@ -1446,9 +1441,13 @@ subroutine rswinit & ! ====================== end of description block ================= ! ! --- inputs: - integer, intent(in) :: me - -! --- outputs: none + integer, intent(in) :: me, rad_hr_units, iswcliq, isubcsw, iovr, & + iswmode, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, & + iovr_exp, iovr_exprand + logical, intent(in) :: inc_minor_gas +! --- outputs: + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! --- locals: real (kind=kind_phys), parameter :: expeps = 1.e-20 @@ -1460,10 +1459,15 @@ subroutine rswinit & ! !===> ... begin here ! - if ( iovr<0 .or. iovr>5 ) then - print *,' *** Error in specification of cloud overlap flag', & - & ' IOVR=',iovr,' in RSWINIT !!' - stop + ! Initialize error-handling + errflg = 0 + errmsg = '' + + if ((iovr .ne. iovr_rand) .and. (iovr .ne. iovr_maxrand) .and. & + (iovr .ne. iovr_max) .and. (iovr .ne. iovr_dcorr) .and. & + (iovr .ne. iovr_exp) .and. (iovr .ne. iovr_exprand)) then + errflg = 1 + errmsg = 'ERROR(rswinit): Error in specification of cloud overlap flag' endif if (me == 0) then @@ -1477,7 +1481,7 @@ subroutine rswinit & print *,' --- Discrete ordinates 2-stream transfer scheme' endif - if (iswrgas <= 0) then + if (.not. inc_minor_gas) then print *,' --- Rare gases absorption is NOT included in SW' else print *,' --- Include rare gases N2O, CH4, O2, absorptions',& @@ -1493,37 +1497,13 @@ subroutine rswinit & elseif ( isubcsw == 2 ) then print *,' --- Using MCICA sub-colum clouds approximation ', & & 'with provided input array of permutation seeds' - else - print *,' *** Error in specification of sub-column cloud ', & - & ' control flag isubcsw =',isubcsw,' !!' - stop endif endif -!> - Check cloud flags for consistency. - - if ((icldflg == 0 .and. iswcliq /= 0) .or. & - & (icldflg == 1 .and. iswcliq == 0)) then - print *,' *** Model cloud scheme inconsistent with SW', & - & ' radiation cloud radiative property setup !!' - stop - endif - - if ( isubcsw==0 .and. iovr>2 ) then - if (me == 0) then - print *,' *** IOVR=',iovr,' is not available for', & - & ' ISUBCSW=0 setting!!' - print *,' The program will use maximum/random overlap', & - & ' instead.' - endif - - iovr = 1 - endif - !> - Setup constant factors for heating rate !! the 1.0e-2 is to convert pressure from mb to \f$N/m^2\f$ . - if (iswrate == 1) then + if (rad_hr_units == 1) then ! heatfac = 8.4391 ! heatfac = con_g * 86400. * 1.0e-2 / con_cp ! (in k/day) heatfac = con_g * 864.0 / con_cp ! (in k/day) @@ -1585,8 +1565,8 @@ end subroutine rswinit !!\section General_cldprop cldprop General Algorithm subroutine cldprop & & ( cfrac,cliqp,reliq,cicep,reice,cdat1,cdat2,cdat3,cdat4, & ! --- inputs - & cf1, nlay, ipseed, dz, delgth, alpha, & - & taucw, ssacw, asycw, cldfrc, cldfmc & ! --- output + & cf1, nlay, ipseed, dz, delgth, alpha, iswcliq, iswcice, & + & isubcsw, iovr, taucw, ssacw, asycw, cldfrc, cldfmc & ! --- output & ) ! =================== program usage description =================== ! @@ -1637,7 +1617,7 @@ subroutine cldprop & ! ! ! ! ! explanation of the method for each value of iswcliq, and iswcice. ! -! set up in module "physparam" ! +! provided by host-model ! ! ! ! iswcliq=0 : input cloud optical property (tau, ssa, asy). ! ! (used for diagnostic cloud method) ! @@ -1672,7 +1652,8 @@ subroutine cldprop & use module_radsw_cldprtb ! --- inputs: - integer, intent(in) :: nlay, ipseed + integer, intent(in) :: nlay, ipseed, iswcliq, iswcice, isubcsw, & + iovr real (kind=kind_phys), intent(in) :: cf1, delgth real (kind=kind_phys), dimension(nlay), intent(in) :: cliqp, & @@ -1930,7 +1911,7 @@ subroutine cldprop & call mcica_subcol & ! --- inputs: - & ( cldf, nlay, ipseed, dz, delgth, alpha, & + & ( cldf, nlay, ipseed, dz, delgth, alpha, iovr, & ! --- outputs: & lcloudy & & ) @@ -1969,7 +1950,7 @@ end subroutine cldprop !!\section mcica_sw_gen mcica_subcol General Algorithm ! ---------------------------------- subroutine mcica_subcol & - & ( cldf, nlay, ipseed, dz, de_lgth, alpha, & ! --- inputs + & ( cldf, nlay, ipseed, dz, de_lgth, alpha, iovr, & ! --- inputs & lcloudy & ! --- outputs & ) @@ -1982,15 +1963,10 @@ subroutine mcica_subcol & ! ** note : if the cloud generator is called multiple times, need ! ! to permute the seed between each call; if between calls ! ! for lw and sw, use values differ by the number of g-pts. ! -! dz - real, layer thickness (km) nlay ! -! de_lgth-real, layer cloud decorrelation length (km) 1 ! -! alpha - real, EXP/ER decorrelation parameter nlay ! -! ! -! output variables: ! -! lcloudy - logical, sub-colum cloud profile flag array nlay*ngptsw! -! ! -! other control flags from module variables: ! -! iovr : control flag for cloud overlapping method ! +! dz - real, layer thickness (km) nlay ! +! de_lgth - real, layer cloud decorrelation length (km) 1 ! +! alpha - real, EXP/ER decorrelation parameter nlay ! +! iovr - control flag for cloud overlapping method 1 ! ! =0: random ! ! =1: maximum/random overlapping clouds ! ! =2: maximum overlap cloud ! @@ -1998,12 +1974,15 @@ subroutine mcica_subcol & ! =4: exponential cloud overlap method (AER) ! ! =5: exponential-random cloud overlap method (AER) ! ! ! +! output variables: ! +! lcloudy - logical, sub-colum cloud profile flag array nlay*ngptsw! +! ! ! ===================== end of definitions ==================== ! implicit none ! --- inputs: - integer, intent(in) :: nlay, ipseed + integer, intent(in) :: nlay, ipseed, iovr real (kind=kind_phys), dimension(nlay), intent(in) :: cldf, dz real (kind=kind_phys), intent(in) :: de_lgth @@ -2453,7 +2432,7 @@ end subroutine setcoef subroutine spcvrtc & & ( ssolar,cosz,sntz,albbm,albdf,sfluxzen,cldfrc, & ! --- inputs & cf1,cf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, & - & nlay, nlp1, & + & nlay, nlp1, iswmode, & & fxupc,fxdnc,fxup0,fxdn0, & ! --- outputs & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, & & sfbmc,sfdfc,sfbm0,sfdf0,suvbfc,suvbf0 & @@ -2515,7 +2494,7 @@ subroutine spcvrtc & ! zldbt - real, layer beam transmittance for clear/cloudy nlp1 ! ! ztdbt - real, lev total beam transmittance for clr/cld nlp1 ! ! ! -! control parameters in module "physparam" ! +! control parameters in module "GFS_typedefs" ! ! iswmode - control flag for 2-stream transfer schemes ! ! = 1 delta-eddington (joseph et al., 1976) ! ! = 2 pifm (zdunkowski et al., 1980) ! @@ -2556,7 +2535,7 @@ subroutine spcvrtc & real (kind=kind_phys), parameter :: eps1 = 1.0e-8 ! --- inputs: - integer, intent(in) :: nlay, nlp1 + integer, intent(in) :: nlay, nlp1, iswmode real (kind=kind_phys), dimension(nlay,ngptsw), intent(in) :: & & taug, taur @@ -2661,7 +2640,7 @@ subroutine spcvrtc & !! transmittance. ! - Set up toa direct beam and surface values (beam and diff). ! - Delta scaling for clear-sky condition. -! - General two-stream expressions for physparam::iswmode . +! - General two-stream expressions. ! - Compute homogeneous reflectance and transmittance for both ! conservative and non-conservative scattering. ! - Pre-delta-scaling clear and cloudy direct beam transmittance. @@ -2693,7 +2672,7 @@ subroutine spcvrtc & zasy3 = 0.75 * zasy1 !> - Perform general two-stream expressions: -!!\n control parameters in module "physparam" +!!\n control parameters provided by host-model !!\n iswmode - control flag for 2-stream transfer schemes !!\n = 1 delta-eddington (joseph et al., 1976) !!\n = 2 pifm (zdunkowski et al., 1980) @@ -2887,7 +2866,7 @@ subroutine spcvrtc & !! transmittance. ! - Set up toa direct beam and surface values (beam and diff) ! - Delta scaling for total-sky condition -! - General two-stream expressions for physparam::iswmode +! - General two-stream expressions ! - Compute homogeneous reflectance and transmittance for ! conservative scattering and non-conservative scattering ! - Pre-delta-scaling clear and cloudy direct beam transmittance @@ -2922,7 +2901,7 @@ subroutine spcvrtc & zasy3 = 0.75 * zasy1 !> - Perform general two-stream expressions: -!!\n control parameters in module "physparam" +!!\n control parameters provided by host-model !!\n iswmode - control flag for 2-stream transfer schemes !!\n = 1 delta-eddington (joseph et al., 1976) !!\n = 2 pifm (zdunkowski et al., 1980) @@ -3249,7 +3228,7 @@ end subroutine spcvrtc subroutine spcvrtm & & ( ssolar,cosz,sntz,albbm,albdf,sfluxzen,cldfmc, & ! --- inputs & cf1,cf0,taug,taur,tauae,ssaae,asyae,taucw,ssacw,asycw, & - & nlay, nlp1, & + & nlay, nlp1, iswmode, & & fxupc,fxdnc,fxup0,fxdn0, & ! --- outputs & ftoauc,ftoau0,ftoadc,fsfcuc,fsfcu0,fsfcdc,fsfcd0, & & sfbmc,sfdfc,sfbm0,sfdf0,suvbfc,suvbf0 & @@ -3285,6 +3264,10 @@ subroutine spcvrtm & ! ssacw - real, weighted cloud single scat albedo nlay*nbdsw ! ! asycw - real, weighted cloud asymmetry factor nlay*nbdsw ! ! nlay,nlp1 - integer, number of layers/levels 1 ! +! iswmode - control flag for 2-stream transfer schemes ! +! = 1 delta-eddington (joseph et al., 1976) ! +! = 2 pifm (zdunkowski et al., 1980) ! +! = 3 discrete ordinates (liou, 1973) ! ! ! ! output variables: ! ! fxupc - real, tot sky upward flux nlp1*nbdsw ! @@ -3313,12 +3296,6 @@ subroutine spcvrtm & ! zldbt - real, layer beam transmittance for clear/cloudy nlp1 ! ! ztdbt - real, lev total beam transmittance for clr/cld nlp1 ! ! ! -! control parameters in module "physparam" ! -! iswmode - control flag for 2-stream transfer schemes ! -! = 1 delta-eddington (joseph et al., 1976) ! -! = 2 pifm (zdunkowski et al., 1980) ! -! = 3 discrete ordinates (liou, 1973) ! -! ! ! ******************************************************************* ! ! original code description ! ! ! @@ -3354,7 +3331,7 @@ subroutine spcvrtm & real (kind=kind_phys), parameter :: eps1 = 1.0e-8 ! --- inputs: - integer, intent(in) :: nlay, nlp1 + integer, intent(in) :: nlay, nlp1, iswmode real (kind=kind_phys), dimension(nlay,ngptsw), intent(in) :: & & taug, taur, cldfmc @@ -3458,7 +3435,7 @@ subroutine spcvrtm & !! transmittance. ! - Set up toa direct beam and surface values (beam and diff) ! - Delta scaling for clear-sky condition -! - General two-stream expressions for physparam::iswmode +! - General two-stream expressions ! - Compute homogeneous reflectance and transmittance for both ! conservative and non-conservative scattering ! - Pre-delta-scaling clear and cloudy direct beam transmittance @@ -3489,7 +3466,7 @@ subroutine spcvrtm & zasy3 = 0.75 * zasy1 !> - Perform general two-stream expressions: -!!\n control parameters in module "physparam" +!!\n control parameters provided by host-model !!\n iswmode - control flag for 2-stream transfer schemes !!\n = 1 delta-eddington (joseph et al., 1976) !!\n = 2 pifm (zdunkowski et al., 1980) @@ -3682,7 +3659,7 @@ subroutine spcvrtm & !! transmittance. ! - Set up toa direct beam and surface values (beam and diff) ! - Delta scaling for total-sky condition -! - General two-stream expressions for physparam::iswmode +! - General two-stream expressions ! - Compute homogeneous reflectance and transmittance for ! conservative scattering and non-conservative scattering ! - Pre-delta-scaling clear and cloudy direct beam transmittance diff --git a/physics/radsw_main.meta b/physics/radsw_main.meta index 506e2edf0..1edb6fcac 100644 --- a/physics/radsw_main.meta +++ b/physics/radsw_main.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmg_sw type = scheme - dependencies = machine.F,mersenne_twister.f,physcons.F90,physparam.f,radsw_datatb.f,radsw_param.f + dependencies = machine.F,mersenne_twister.f,physcons.F90,radsw_datatb.f,radsw_param.f ######################################################################## [ccpp-arg-table] @@ -280,6 +280,97 @@ dimensions = () type = logical intent = in +[inc_minor_gas] + standard_name = flag_to_include_minor_gases_in_rrtmg + long_name = flag to include minor trace gases in rrtmg + units = flag + dimensions = () + type = logical + intent = in +[top_at_1] + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation + units = flag + dimensions = () + type = logical + intent = in +[iswcice] + standard_name = flag_for_optical_property_for_ice_clouds_for_shortwave_radiation + long_name = sw optical property for ice clouds + units = flag + dimensions = () + type = integer + intent = in +[iswcliq] + standard_name = control_for_shortwave_radiation_liquid_clouds + long_name = sw optical property for liquid clouds + units = flag + dimensions = () + type = integer + intent = in +[isubcsw] + standard_name = flag_for_sw_clouds_grid_approximation + long_name = flag for sw clouds sub-grid approximation + units = flag + dimensions = () + type = integer + intent = in +[iovr] + standard_name = flag_for_cloud_overlap_method_for_radiation + long_name = max-random overlap clouds + units = flag + dimensions = () + type = integer + intent = in +[iovr_exp] + standard_name = flag_for_exponential_cloud_overlap_method + long_name = choice of exponential cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_exprand] + standard_name = flag_for_exponential_random_cloud_overlap_method + long_name = choice of exponential-random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_max] + standard_name = flag_for_maximum_cloud_overlap_method + long_name = choice of maximum cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_rand] + standard_name = flag_for_random_cloud_overlap_method + long_name = choice of random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_maxrand] + standard_name = flag_for_maximum_random_cloud_overlap_method + long_name = choice of maximum-random cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iovr_dcorr] + standard_name = flag_for_decorrelation_length_cloud_overlap_method + long_name = choice of decorrelation-length cloud overlap method + units = flag + dimensions = () + type = integer + intent = in +[iswmode] + standard_name = control_for_sw_scattering_choice + long_name = control of rrtmg shortwave scattering choice + units = 1 + dimensions = () + type = integer + intent = in [cld_cf] standard_name = total_cloud_fraction long_name = total cloud fraction diff --git a/physics/radsw_param.f b/physics/radsw_param.f index 69c8c2446..2086f5df8 100644 --- a/physics/radsw_param.f +++ b/physics/radsw_param.f @@ -66,7 +66,7 @@ module module_radsw_parameters ! !! \htmlinclude module_radsw_parameters.html !! - use physparam, only : kind_phys + use machine, only : kind_phys implicit none ! diff --git a/physics/rrtmgp_aerosol_optics.F90 b/physics/rrtmgp_aerosol_optics.F90 index cf3f7deea..e23a19a15 100644 --- a/physics/rrtmgp_aerosol_optics.F90 +++ b/physics/rrtmgp_aerosol_optics.F90 @@ -24,20 +24,29 @@ module rrtmgp_aerosol_optics !! \section arg_table_rrtmgp_aerosol_optics_run !! \htmlinclude rrtmgp_aerosol_optics_run.html !! - subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nDay, idxday, p_lev, & - p_lay, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, & - aerodp, aerlw_tau, aerlw_ssa, aerlw_g, aersw_tau, aersw_ssa, aersw_g, errmsg, errflg ) + subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nTracer, nTracerAer, & + nDay, idxday, p_lev, p_lay, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, & + iaermdl, iaerflg, top_at_1, con_pi, con_rd, con_g, aerodp, errmsg, errflg ) ! Inputs logical, intent(in) :: & doSWrad, & ! Logical flag for shortwave radiation call - doLWrad ! Logical flag for longwave radiation call + doLWrad, & ! Logical flag for longwave radiation call + top_at_1 ! Logical flag for vertical grid direcetion integer, intent(in) :: & nCol, & ! Number of horizontal grid points nDay, & ! Number of daylit points - nLev ! Number of vertical layers - integer,dimension(:), intent(in) :: & - idxday ! Indices for daylit points. + nLev, & ! Number of vertical layers + nTracer, & ! Number of tracers + nTracerAer, & ! Number of aerosol tracers + iaermdl, & ! Aerosol model scheme flag + iaerflg ! Aerosol effects to include + integer,intent(in),dimension(:) :: & + idxday ! Indices for daylit points. + real(kind_phys),intent(in) :: & + con_pi, & ! Physical constant (pi) + con_rd, & ! Physical constant (gas constant for dry-air) + con_g ! Physical constant (gravitational constant) real(kind_phys), dimension(:), intent(in) :: & lon, & ! Longitude lat, & ! Latitude @@ -84,7 +93,7 @@ subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nDay, idxday, ! Call module_radiation_aerosols::setaer(),to setup aerosols property profile call setaer(p_lev*0.01, p_lay*0.01, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, nCol, nLev, & - nLev+1, .true., .true., aerosolssw2, aerosolslw, aerodp) + nLev+1, .true., .true., iaermdl, iaerflg, top_at_1, con_pi, con_rd, con_g, aerosolssw2, aerosolslw, aerodp, errflg, errmsg) ! Shortwave if (doSWrad .and. (nDay .gt. 0)) then diff --git a/physics/rrtmgp_aerosol_optics.meta b/physics/rrtmgp_aerosol_optics.meta index 6dbf9c73c..e2b81b192 100644 --- a/physics/rrtmgp_aerosol_optics.meta +++ b/physics/rrtmgp_aerosol_optics.meta @@ -21,6 +21,37 @@ dimensions = () type = logical intent = in +[top_at_1] + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation + units = flag + dimensions = () + type = logical + intent = in +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[con_rd] + standard_name = gas_constant_of_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in [ncol] standard_name = horizontal_loop_extent long_name = horizontal dimension @@ -129,6 +160,20 @@ type = real kind = kind_phys intent = in +[iaermdl] + standard_name = control_for_aerosol_radiation_scheme + long_name = control of aerosol scheme in radiation + units = 1 + dimensions = () + type = integer + intent = in +[iaerflg] + standard_name = control_for_aerosol_effects_in_radiation + long_name = control of aerosol effects in radiation + units = 1 + dimensions = () + type = integer + intent = in [aerodp] standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles long_name = vertical integrated optical depth for various aerosol species diff --git a/physics/set_soilveg.f b/physics/set_soilveg.f index efef0f24b..37f2c2a73 100644 --- a/physics/set_soilveg.f +++ b/physics/set_soilveg.f @@ -13,11 +13,13 @@ module set_soilveg_mod !> \ingroup Noah_LSM !! This subroutine initializes soil and vegetation. - subroutine set_soilveg(me,isot,ivet,nlunit) + subroutine set_soilveg(me,isot,ivet,nlunit,errmsg,errflg) use namelist_soilveg implicit none integer, intent(in) :: me,isot,ivet,nlunit + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg !my begin locals !for 20 igbp veg type and 19 stasgo soil type integer i @@ -385,16 +387,22 @@ subroutine set_soilveg(me,isot,ivet,nlunit) ! CLOSE(59) IF (DEFINED_SOIL .GT. MAX_SOILTYP) THEN - WRITE(0,*) 'Warning: DEFINED_SOIL too large in namelist' - STOP 222 + errflg = 222 + errmsg = 'ERROR(set_soilveg): DEFINED_SOIL too large in '// & + & 'namelist' + return ENDIF IF (DEFINED_VEG .GT. MAX_VEGTYP) THEN - WRITE(0,*) 'Warning: DEFINED_VEG too large in namelist' - STOP 222 + errflg = 222 + errmsg = 'ERROR(set_soilveg): DEFINED_VEG too large in '// & + & 'namelist' + return ENDIF IF (DEFINED_SLOPE .GT. MAX_SLOPETYP) THEN - WRITE(0,*) 'Warning: DEFINED_SLOPE too large in namelist' - STOP 222 + errflg = 222 + errmsg = 'ERROR(set_soilveg): DEFINED_SLOPE too large in '//& + & 'namelist' + return ENDIF SMLOW = SMLOW_DATA diff --git a/physics/set_soilveg_ruc.F90 b/physics/set_soilveg_ruc.F90 index cac4fd1e7..c03e6fc5f 100644 --- a/physics/set_soilveg_ruc.F90 +++ b/physics/set_soilveg_ruc.F90 @@ -17,9 +17,11 @@ module set_soilveg_ruc_mod !>\ingroup lsm_ruc_group !! This subroutine specifies vegetation and soil parameters for a given !! soil and land-use classification. - subroutine set_soilveg_ruc(me,isot,ivet,nlunit) + subroutine set_soilveg_ruc(me,isot,ivet,nlunit,errmsg,errflg) integer, intent(in) :: isot,ivet,nlunit + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg integer me integer i @@ -35,6 +37,10 @@ subroutine set_soilveg_ruc(me,isot,ivet,nlunit) & WLTSMC, QTZ, mosaic_soil, mosaic_lu, & & REFSMCnoah, WLTSMCnoah, MAXSMCnoah + ! Initialize error-handling + errflg = 0 + errmsg = '' + if(ivet.eq.2) then ! Using umd veg classification slope_data =(/0.1, 0.6, 1.0, 0.35, 0.55, 0.8, & @@ -415,15 +421,21 @@ subroutine set_soilveg_ruc(me,isot,ivet,nlunit) IF (DEFINED_SOIL .GT. MAX_SOILTYP) THEN WRITE(0,*) 'Warning: DEFINED_SOIL too large in namelist' - STOP 222 + errflg = 1 + errmsg = 'ERROR(set_soilveg_ruc): DEFINED_SOIL too large in namelist' + return ENDIF IF (DEFINED_VEG .GT. MAX_VEGTYP) THEN WRITE(0,*) 'Warning: DEFINED_VEG too large in namelist' - STOP 222 + errflg = 1 + errmsg = 'ERROR(set_soilveg_ruc): DEFINED_VEG too large in namelist' + return ENDIF IF (DEFINED_SLOPE .GT. MAX_SLOPETYP) THEN WRITE(0,*) 'Warning: DEFINED_SLOPE too large in namelist' - STOP 222 + errflg = 1 + errmsg = 'ERROR(set_soilveg_ruc): DEFINED_SLOPE too large in namelist' + return ENDIF ! if (me == 0) write(6,soil_veg_ruc) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 9bc7e6d0a..01294bb31 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -376,7 +376,9 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) call znot_t_v7(wind10m, ztmax_wat(i)) ! 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 - stop + errflg = 1 + errmsg = 'ERROR(sfc_diff_run): no option for sfc_z0_type' + return endif ! call stability diff --git a/physics/sflx.f b/physics/sflx.f index a020e217a..92205dd61 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -123,7 +123,8 @@ subroutine gfssflx &! --- input & edir, et, ett, esnow, drip, dew, beta, etp, ssoil, & & flx1, flx2, flx3, runoff1, runoff2, runoff3, & & snomlt, sncovr, rc, pc, rsmin, xlai, rcs, rct, rcq, & - & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax) + & rcsoil, soilw, soilm, smcwlt, smcdry, smcref, smcmax, & + & errmsg, errflg ) ! ===================================================================== ! ! description: ! @@ -327,6 +328,8 @@ subroutine gfssflx &! --- input & runoff1, runoff2, runoff3, rc, pc, rsmin, xlai, rcs, & & rct, rcq, rcsoil, soilw, soilm, smcwlt, smcdry, smcref, & & smcmax + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! --- locals: ! real (kind=kind_phys) :: df1h, @@ -346,6 +349,10 @@ subroutine gfssflx &! --- input ! !===> ... begin here ! +! Initialize CCPP error-handling + errflg = 0 + errmsg = '' + ! --- ... initialization runoff1 = 0.0 @@ -411,7 +418,7 @@ subroutine gfssflx &! --- input !> - Call redprm() to set the land-surface paramters, !! including soil-type and veg-type dependent parameters. - call redprm + call redprm(errmsg, errflg) if(ivegsrc == 1) then !only igbp type has urban !urban @@ -1668,7 +1675,7 @@ end subroutine penman !> This subroutine internally sets default values or optionally read-in !! via namelist i/o, all soil and vegetation parateters requied for the execusion !! of the Noah LSM. - subroutine redprm + subroutine redprm(errmsg, errflg) !................................... ! --- inputs: ! & ( nsoil, vegtyp, soiltyp, slopetyp, sldpth, zsoil, & @@ -1855,7 +1862,8 @@ subroutine redprm ! & frzx, psisat, slope, snup, salp, bexp, dksat, dwsat, & ! & smcmax, smcwlt, smcref, smcdry, f1, quartz, fxexp, z0, & ! & czil, xlai, csoil, rtdis(nsoil) - + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg ! integer, intent(out) :: nroot ! --- locals: @@ -1866,20 +1874,30 @@ subroutine redprm ! !===> ... begin here ! +! Initialize CCPP error-handling + errflg = 0 + errmsg = '' + if (soiltyp > defined_soil) then write(*,*) 'warning: too many soil types,soiltyp=',soiltyp, & & 'defined_soil=',defined_soil - stop 333 + errflg = 1 + errmsg = 'ERROR(sflx.f): too many soil types' + return endif if (vegtyp > defined_veg) then write(*,*) 'warning: too many veg types' - stop 333 + errflg = 1 + errmsg = 'ERROR(sflx.f): too many veg types' + return endif if (slopetyp > defined_slope) then write(*,*) 'warning: too many slope types' - stop 333 + errflg = 1 + errmsg = 'ERROR(sflx.f): too many slope types' + return endif ! --- ... set-up universal parameters (not dependent on soiltyp, vegtyp @@ -1936,7 +1954,9 @@ subroutine redprm if (nroot > nsoil) then write(*,*) 'warning: too many root layers' - stop 333 + errflg = 1 + errmsg = 'ERROR(sflx.f): too many root layers' + return endif ! --- ... calculate root distribution. present version assumes uniform From 944aae4476ead37d12fb5ab8e2dd488572a803b4 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 8 Feb 2023 14:33:20 -0700 Subject: [PATCH 12/14] Cleanup from previous merge. --- physics/GFS_rrtmgp_pre.F90 | 1 - physics/rrtmgp_aerosol_optics.F90 | 9 ++++----- physics/rrtmgp_lw_main.meta | 4 ++-- physics/rrtmgp_sw_main.meta | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index 02cc506fd..009eb8c38 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -124,7 +124,6 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl me, & ! MPI rank nCol, & ! Number of horizontal grid points nLev, & ! Number of vertical layers - nTracers, & ! Number of tracers from model. ico2, & ! Flag for co2 radiation scheme i_o3 ! Index into tracer array for ozone logical, intent(in) :: & diff --git a/physics/rrtmgp_aerosol_optics.F90 b/physics/rrtmgp_aerosol_optics.F90 index e23a19a15..ce0fa8ea9 100644 --- a/physics/rrtmgp_aerosol_optics.F90 +++ b/physics/rrtmgp_aerosol_optics.F90 @@ -24,9 +24,10 @@ module rrtmgp_aerosol_optics !! \section arg_table_rrtmgp_aerosol_optics_run !! \htmlinclude rrtmgp_aerosol_optics_run.html !! - subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nTracer, nTracerAer, & - nDay, idxday, p_lev, p_lay, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, & - iaermdl, iaerflg, top_at_1, con_pi, con_rd, con_g, aerodp, errmsg, errflg ) + subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nDay, idxday, p_lev, & + p_lay, p_lk, tv_lay, relhum, lsmask, tracer, aerfld, lon, lat, iaermdl, iaerflg, & + top_at_1, con_pi, con_rd, con_g, aerodp, aerlw_tau, aerlw_ssa, aerlw_g, aersw_tau, & + aersw_ssa, aersw_g, errmsg, errflg ) ! Inputs logical, intent(in) :: & @@ -37,8 +38,6 @@ subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nTracer, nTra nCol, & ! Number of horizontal grid points nDay, & ! Number of daylit points nLev, & ! Number of vertical layers - nTracer, & ! Number of tracers - nTracerAer, & ! Number of aerosol tracers iaermdl, & ! Aerosol model scheme flag iaerflg ! Aerosol effects to include integer,intent(in),dimension(:) :: & diff --git a/physics/rrtmgp_lw_main.meta b/physics/rrtmgp_lw_main.meta index a1a384b25..fd96eb14b 100644 --- a/physics/rrtmgp_lw_main.meta +++ b/physics/rrtmgp_lw_main.meta @@ -149,8 +149,8 @@ type = logical intent = in [top_at_1] - standard_name = flag_for_vertical_ordering_in_RRTMGP - long_name = flag for vertical ordering in RRTMGP + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiaiton units = flag dimensions = () type = logical diff --git a/physics/rrtmgp_sw_main.meta b/physics/rrtmgp_sw_main.meta index 4ca6cc716..dbb93a5df 100644 --- a/physics/rrtmgp_sw_main.meta +++ b/physics/rrtmgp_sw_main.meta @@ -149,8 +149,8 @@ type = logical intent = in [top_at_1] - standard_name = flag_for_vertical_ordering_in_RRTMGP - long_name = flag for vertical ordering in RRTMGP + standard_name = flag_for_vertical_ordering_in_radiation + long_name = flag for vertical ordering in radiation units = flag dimensions = () type = logical From bc083e716c2b00d894bc197dfb0cb4b85262de31 Mon Sep 17 00:00:00 2001 From: Michael Toy Date: Mon, 13 Feb 2023 18:43:22 +0000 Subject: [PATCH 13/14] Changed UGWP diagnostic variable declaration intents from 'out' to 'inout' --- physics/drag_suite.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index ed1571622..e082379e0 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -377,12 +377,12 @@ subroutine drag_suite_run( & real(kind=kind_phys), intent(inout) :: & & dusfc(:), dvsfc(:) !Output (optional): - real(kind=kind_phys), intent(out) :: & + real(kind=kind_phys), intent(inout) :: & & dusfc_ms(:),dvsfc_ms(:), & & dusfc_bl(:),dvsfc_bl(:), & & dusfc_ss(:),dvsfc_ss(:), & & dusfc_fd(:),dvsfc_fd(:) - real(kind=kind_phys), intent(out) :: & + real(kind=kind_phys), intent(inout) :: & & dtaux2d_ms(:,:),dtauy2d_ms(:,:), & & dtaux2d_bl(:,:),dtauy2d_bl(:,:), & & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & From 3a386379e6ea99426f30203098dafa4bcbe5a5ae Mon Sep 17 00:00:00 2001 From: Michael Toy Date: Tue, 14 Feb 2023 15:42:24 +0000 Subject: [PATCH 14/14] Updated UGWP diagnostic variable declaration intents in drag_suite.meta --- physics/drag_suite.meta | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/physics/drag_suite.meta b/physics/drag_suite.meta index 8f33fcc60..ff60290ae 100644 --- a/physics/drag_suite.meta +++ b/physics/drag_suite.meta @@ -277,7 +277,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtauy2d_ms] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = y wind tendency from mesoscale gwd @@ -285,7 +285,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtaux2d_bl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -293,7 +293,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtauy2d_bl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -301,7 +301,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtaux2d_ss] standard_name = tendency_of_x_wind_due_to_small_scale_gravity_wave_drag long_name = x wind tendency from small scale gwd @@ -309,7 +309,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtauy2d_ss] standard_name = tendency_of_y_wind_due_to_small_scale_gravity_wave_drag long_name = y wind tendency from small scale gwd @@ -317,7 +317,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtaux2d_fd] standard_name = tendency_of_x_wind_due_to_form_drag long_name = x wind tendency from form drag @@ -325,7 +325,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dtauy2d_fd] standard_name = tendency_of_y_wind_due_to_form_drag long_name = y wind tendency from form drag @@ -333,7 +333,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = out + intent = inout [dusfc] standard_name = instantaneous_x_stress_due_to_gravity_wave_drag long_name = zonal surface stress due to orographic gravity wave drag @@ -357,7 +357,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dvsfc_ms] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from mesoscale gwd @@ -365,7 +365,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dusfc_bl] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -373,7 +373,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dvsfc_bl] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -381,7 +381,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dusfc_ss] standard_name = vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated x momentum flux from small scale gwd @@ -389,7 +389,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dvsfc_ss] standard_name = vertically_integrated_y_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated y momentum flux from small scale gwd @@ -397,7 +397,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dusfc_fd] standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag long_name = integrated x momentum flux from form drag @@ -405,7 +405,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [dvsfc_fd] standard_name = vertically_integrated_y_momentum_flux_due_to_form_drag long_name = integrated y momentum flux from form drag @@ -413,7 +413,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2