diff --git a/CODEOWNERS b/CODEOWNERS index 5908f30ae9..2e6e555ef7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -154,11 +154,10 @@ physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.* physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.* @dustinswales @Qingfu-Liu @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.* @dustinswales @Qingfu-Liu @grantfirl @rhaesung @Qingfu-Liu @dustinswales -physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.* @Qingfu-Liu @dustinswales @grantfirl @rhaesung @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.* @Qingfu-Liu @dustinswales @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.* @dustinswales @Qingfu-Liu @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.* @Qingfu-Liu @dustinswales @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.* @dustinswales @Qingfu-Liu @grantfirl @rhaesung @Qingfu-Liu @dustinswales -physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.* @dustinswales @Qingfu-Liu @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.* @Qingfu-Liu @dustinswales @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.* @grantfirl @rhaesung @Qingfu-Liu @dustinswales diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 index ca11daffe9..d66c1f19f4 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 @@ -212,7 +212,7 @@ subroutine GFS_phys_time_vary_init ( if(iaermdl==1) then call read_aerdata (me,master,iflip,idate,errmsg,errflg) elseif(iaermdl==6) then - call read_aerdata_dl (me,master,iflip,idate,errmsg,errflg) + call read_aerdata_dl (me,master,iflip,idate,fhour,errmsg,errflg) end if endif if (errflg /= 0) return @@ -816,13 +816,13 @@ subroutine GFS_phys_time_vary_timestep_init ( fhour, iflip, jindx1_aer, jindx2_aer, & ddy_aer, iindx1_aer, & iindx2_aer, ddx_aer, & - levs, prsl, aer_nm) + levs, prsl, aer_nm, errmsg, errflg) elseif (iaermdl==6) then call aerinterpol_dl (me, master, nthrds, im, idate, & fhour, iflip, jindx1_aer, jindx2_aer, & ddy_aer, iindx1_aer, & iindx2_aer, ddx_aer, & - levs, prsl, aer_nm) + levs, prsl, aer_nm, errmsg, errflg) endif endif diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.F90 new file mode 100644 index 0000000000..a0a7f12db1 --- /dev/null +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.F90 @@ -0,0 +1,474 @@ +! ############################################################################################# +!> \file GFS_radiation_post.F90 +!! +!! Radiation post-processing routine. +!! +!! This module has two purposes: +!! 1*) Perform coupling from the radiation scheme(s) to other physical parameterizations. +!! 2) Compute diagnostics +!! +!! *For RRTMG, this coupling is handled in the SCHEME. +!! *For RRTMGP, this coupling is handled HERE (more on this below). +!! +! ############################################################################################# +module GFS_radiation_post + use machine, only: kind_phys + use module_radlw_parameters, only: topflw_type, sfcflw_type + use module_radsw_parameters, only: topfsw_type, sfcfsw_type, cmpfsw_type + use mo_heating_rates, only: compute_heating_rate + use radiation_tools, only: check_error_msg + implicit none + + public GFS_radiation_post_run + +contains +! ############################################################################################# +!> \section arg_table_GFS_radiation_post_run Argument Table +!! \htmlinclude GFS_radiation_post_run.html +!! +!! This routine needs to be called AFTER the RRTMG (radlw_main.F90 and radsw_main.F90) +!! or the RRTMGP (rrtmgp_lw_main.F90 and rrtmgp_sw_main.F90) radiaiton schemes in the +!! CCPP enabled UFS. +!! +!! For RRTMG, not much is done here, since the scheme outputs the fields needed by the +!! UFS. For example, RRTMG provides the heating-rate profiles and has been modified to use +!! UFS native DDTs for storing the fluxes. +!! fluxes. +!! +!! For RRTMGP*: +!! - The all-sky radiation tendency is computed. The clear-sky tendency is computed, if +!! requested. +!! - Surface and TOA fluxes are copied to UFS native DDTs that persist between radiation/physics +!! calls. +!! +!! *Note on RTE-RRTMGP implementation in CCPP +!! This is done in an attempt to make the CCPP enabled RRTMGP LW/SW drivers more host agnostic. +!! The drivers are outputting the same fields as RTE, flux profiles, maintaining the same scheme +!! interface at the lowest CCPP entrypoint, the "Scheme-level" interstitial. Any host specific +!! coupling to the scheme happens here, a layer above, within the "Suite-level" interstitial. +!! +!! For ALL Radiaiton Schemes: +!! - Compute SW total cloud albedo +!! - Compute diagnostics +!! +! ############################################################################################# + + ! ########################################################################################### + ! GFS_radiation_post_run + ! ########################################################################################### + subroutine GFS_radiation_post_run(doLWrad, doSWrad, lssav, total_albedo, topfsw, fhlwr, fhswr,& + coszen, coszdg, raddt, aerodp, cldsa, mtopa, mbota, cldtausw, cldtaulw, p_lev, tgrs, kb, & + kd, kt, sfcflw, sfcfsw, topflw, scmpsw, nCol, nLev, lmk, nDay, nfxr, nspc1, fluxr, & + do_RRTMGP, do_lw_clrsky_hr, fluxlwUP_clrsky, fluxlwDOWN_clrsky, htrlwc, fluxlwUP_allsky, & + fluxlwDOWN_allsky, htrlw, do_sw_clrsky_hr, htrswc, fluxswUP_clrsky, idxday, & + fluxswDOWN_clrsky, htrsw, fluxswUP_allsky, fluxswDOWN_allsky, iSFC, iTOA, tsflw, tsfa, & + sfcdlw, sfculw, htrlwu, nirbmdi, nirdfdi, visbmdi, visdfdi, nirbmui, nirdfui, visbmui, & + visdfui, sfc_alb_nir_dir, sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, sfcnsw, & + sfcdsw, errmsg, errflg) + + ! Inputs + integer, intent(in) :: & + nCol, & !< Horizontal loop extent + nLev, & !< Number of vertical layers + lmk, & !< Number of vertical layers for radiation (adjusted) + nDay, & !< Number of daylit columns + nfxr, & !< Number of variables stored in the fluxr array + nspc1, & !< Number of species for output aerosol optical depth + kb, & !< Vertical index difference between layer and lower bound (H/M/L diag) + kd, & !< Vertical index difference between in/out and local (H/M/L diag) + kt, & !< Vertical index difference between layer and upper bound (H/M/L diag) + iSFC, & !< Vertical index for surface level + iTOA !< Vertical index for TOA level + integer, intent(in), dimension(:) :: & + idxday !< Index array for daytime points + logical, intent(in) :: & + doLWrad, & !< Logical flags for lw radiation calls + doSWrad, & !< Logical flags for sw radiation calls + lssav, & !< Flag for radiation diagnostics + do_RRTMGP, & !< Flag for using RRTMGP scheme + do_lw_clrsky_hr, & !< Output clear-sky LW heating-rate? + do_sw_clrsky_hr !< Output clear-sky SW heating-rate? + real(kind_phys), intent(in) :: & + fhlwr, & !< Frequency for longwave radiation (sec) + fhswr, & !< Frequency for shortwave radiation (sec) + raddt !< Radiation time step (sec) + real(kind_phys), dimension(:), intent(in) :: & + coszen, & !< Mean cos of zenith angle over rad call period + coszdg !< Daytime mean cosz over rad call period + real(kind_phys), dimension(:), intent(in) :: & + tsfa, & !< Lowest model layer air temperature for radiation (K) + sfc_alb_nir_dir, & !< Surface albedo (direct) + sfc_alb_nir_dif, & !< Surface albedo (diffuse) + sfc_alb_uvvis_dir, & !< Surface albedo (direct) + sfc_alb_uvvis_dif !< Surface albedo (diffuse) + real(kind_phys), dimension(:,:), intent(in) :: & + p_lev !< Pressure @ model layer-interfaces (Pa) + real(kind_phys), dimension(:,:), intent(in) :: & + tgrs !< Temperature @ model layer-centers (K) + real(kind_phys), dimension(:,:), intent(in), optional :: & + fluxlwUP_clrsky, & !< RRTMGP longwave clear-sky flux (W/m2) + fluxlwDOWN_clrsky, & !< RRTMGP longwave clear-sky flux (W/m2) + fluxlwUP_allsky, & !< RRTMGP longwave all-sky flux (W/m2) + fluxlwDOWN_allsky, & !< RRTMGP longwave all-sky flux (W/m2) + fluxswUP_clrsky, & !< RRTMGP shortwave clear-sky flux (W/m2) + fluxswDOWN_clrsky, & !< RRTMGP shortwave clear-sky flux (W/m2) + fluxswUP_allsky, & !< RRTMGP shortwave all-sky flux (W/m2) + fluxswDOWN_allsky !< RRTMGP shortwave all-sky flux (W/m2) + real(kind_phys), dimension(:,:), intent(in) :: & + aerodp !< Vertical integrated optical depth for aerosol species + real(kind_phys), dimension(:,:), intent(in) :: & + cldtausw, & !< .55mu band layer cloud optical depth (SW) + cldtaulw !< 10mu band layer cloud optical depth (LW) + real(kind_phys), dimension(:,:), intent(in) :: & + cldsa !< Fraction of clouds for High/Mid/Low diagnostics: + !< low(1), middle(2), high(3), total(4) and BL(5) + integer, intent(in), dimension(:,:) :: & + mtopa, & !< Vertical indices for low, middle and high cloud tops (H/M/L diag) + mbota !< Vertical indices for low, middle and high cloud bases (H/M/L diag) + type(cmpfsw_type), dimension(:), intent(in) :: & + scmpsw !< 2D surface fluxes, components: + !!\n uvbfc - total sky downward uv-b flux at (W/m2) + !!\n uvbf0 - clear sky downward uv-b flux at (W/m2) + !!\n nirbm - downward nir direct beam flux (W/m2) + !!\n nirdf - downward nir diffused flux (W/m2) + !!\n visbm - downward uv+vis direct beam flux (W/m2) + !!\n visdf - downward uv+vis diffused flux (W/m2) + ! Outputs (mandatory) + real(kind_phys), dimension(:), intent(inout) :: & + tsflw, & !< LW sfc air temp during calculation (K) + sfcdlw, & !< LW sfc all-sky downward flux (W/m2) + sfculw, & !< LW sfc all-sky upward flux (W/m2) + nirbmdi, & !< SW sfc nir beam downward flux (W/m2) + nirdfdi, & !< SW sfc nir diff downward flux (W/m2) + visbmdi, & !< SW sfc uv+vis beam downward flux (W/m2) + visdfdi, & !< SW sfc uv+vis diff downward flux (W/m2) + nirbmui, & !< SW sfc nir beam upward flux (W/m2) + nirdfui, & !< SW sfc nir diff upward flux (W/m2) + visbmui, & !< SW sfc uv+vis beam upward flux (W/m2) + visdfui, & !< SW sfc uv+vis diff upward flux (W/m2) + sfcnsw, & !< SW sfc all-sky net flux (W/m2) flux into ground + sfcdsw !< SW sfc all-sky downward flux (W/m2) + real(kind_phys), dimension(:,:), intent(inout) :: & + htrlw, & !< LW all-sky heating rate (K/s) + htrsw !< SW all-sky heating rate (K/s) + real(kind_phys), dimension(:), intent(inout) :: & + total_albedo !< Total sky albedo at TOA (W/m2) + real(kind_phys), dimension(:,:), intent(inout), optional :: & + htrlwu !< LW all-sky heating-rate updated in-between radiation calls. + type(sfcflw_type), dimension(:), intent(inout) :: & + sfcflw !< LW radiation fluxes at sfc + type(sfcfsw_type), dimension(:), intent(inout) :: & + sfcfsw !< SW radiation fluxes at sfc + type(topfsw_type), dimension(:), intent(inout) :: & + topfsw !< SW fluxes at top atmosphere + type(topflw_type), dimension(:), intent(inout) :: & + topflw !< LW fluxes at top atmosphere + real(kind_phys), dimension(:,:), intent(inout) :: & + fluxr !< LW/SW diagnostics + character(len=*), intent(out) :: & + errmsg !< CCPP error message + integer, intent(out) :: & + errflg !< CCPP error code + ! Outputs (optional) + real(kind_phys),dimension(:,:),intent(inout),optional :: & + htrlwc, & !< LW clear-sky heating-rate (K/s) + htrswc !< SW clear-sky heating rate (K/s) + + ! Local variables + integer :: i + real(kind_phys), dimension(nDay, nLev) :: thetaTendClrSky, thetaTendAllSky + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Only proceed if radiation is being called. + if (.not. (doLWrad .or. doSWrad)) return + + ! ####################################################################################### + ! Longwave Radiation + ! ####################################################################################### + if (doLWRad) then + if (do_RRTMGP) then + ! Clear-sky heating-rate (optional) + if (do_lw_clrsky_hr) then + call check_error_msg('GFS_radiation_post',compute_heating_rate( & + fluxlwUP_clrsky, & ! IN - RRTMGP upward longwave clear-sky flux profiles (W/m2) + fluxlwDOWN_clrsky, & ! IN - RRTMGP downward longwave clear-sky flux profiles (W/m2) + p_lev, & ! IN - Pressure @ layer-interfaces (Pa) + htrlwc)) ! OUT - Longwave clear-sky heating rate (K/sec) + endif + + ! All-sky heating-rate (mandatory) + call check_error_msg('GFS_radiation_post',compute_heating_rate( & + fluxlwUP_allsky, & ! IN - RRTMGP upward longwave all-sky flux profiles (W/m2) + fluxlwDOWN_allsky, & ! IN - RRTMGP downward longwave all-sky flux profiles (W/m2) + p_lev, & ! IN - Pressure @ layer-interfaces (Pa) + htrlw)) ! OUT - Longwave all-sky heating rate (K/sec) + + ! (Copy fluxes from RRTMGP types into model radiation types.) + ! TOA fluxes + topflw(:)%upfxc = fluxlwUP_allsky(:,iTOA) + topflw(:)%upfx0 = fluxlwUP_clrsky(:,iTOA) + + ! Surface fluxes + sfcflw(:)%upfxc = fluxlwUP_allsky(:,iSFC) + sfcflw(:)%upfx0 = fluxlwUP_clrsky(:,iSFC) + sfcflw(:)%dnfxc = fluxlwDOWN_allsky(:,iSFC) + sfcflw(:)%dnfx0 = fluxlwDOWN_clrsky(:,iSFC) + + ! Save surface air temp for diurnal adjustment at model t-steps + tsflw(:) = tsfa(:) + + ! Radiation fluxes for other physics processes + sfcdlw(:) = sfcflw(:)%dnfxc + sfculw(:) = sfcflw(:)%upfxc + + ! Heating-rate at radiation timestep, used for adjustment between radiation calls. + htrlwu = htrlw + endif ! RRTMGP Longwave Radiaiton + endif ! ALL Longwave Radiation + + ! ####################################################################################### + ! Shortwave Radiation + ! ####################################################################################### + if (doSWRad) then + if (do_RRTMGP) then + if (nDay .gt. 0) then + ! Clear-sky heating-rate (optional) + if (do_sw_clrsky_hr) then + htrswc(:,:) = 0._kind_phys + call check_error_msg('GFS_radiation_post',compute_heating_rate( & + fluxswUP_clrsky(idxday(1:nDay),:), & ! IN - Shortwave upward clear-sky flux profiles (W/m2) + fluxswDOWN_clrsky(idxday(1:nDay),:), & ! IN - Shortwave downward clear-sky flux profiles (W/m2) + p_lev(idxday(1:nDay),:), & ! IN - Pressure at model-interface (Pa) + thetaTendClrSky)) ! OUT - Clear-sky heating-rate (K/sec) + htrswc(idxday(1:nDay),:)=thetaTendClrSky !**NOTE** GP doesn't use radiation levels, it uses the model fields. Not sure if this is necessary + endif + + ! All-sky heating-rate (mandatory) + htrsw(:,:) = 0._kind_phys + call check_error_msg('GFS_radiation_post',compute_heating_rate( & + fluxswUP_allsky(idxday(1:nDay),:), & ! IN - Shortwave upward all-sky flux profiles (W/m2) + fluxswDOWN_allsky(idxday(1:nDay),:), & ! IN - Shortwave downward all-sky flux profiles (W/m2) + p_lev(idxday(1:nDay),:), & ! IN - Pressure at model-interface (Pa) + thetaTendAllSky)) ! OUT - All-sky heating-rate (K/sec) + htrsw(idxday(1:nDay),:) = thetaTendAllSky + + ! (Copy fluxes from RRTMGP types into model radiation types.) + + ! TOA fluxes + topfsw(:)%upfxc = fluxswUP_allsky(:,iTOA) + topfsw(:)%upfx0 = fluxswUP_clrsky(:,iTOA) + topfsw(:)%dnfxc = fluxswDOWN_allsky(:,iTOA) + + ! Surface fluxes + sfcfsw(:)%upfxc = fluxswUP_allsky(:,iSFC) + sfcfsw(:)%upfx0 = fluxswUP_clrsky(:,iSFC) + sfcfsw(:)%dnfxc = fluxswDOWN_allsky(:,iSFC) + sfcfsw(:)%dnfx0 = fluxswDOWN_clrsky(:,iSFC) + + ! Surface down and up spectral component fluxes + ! - Save two spectral bands' surface downward and upward fluxes for output. + do i=1,nCol + nirbmdi(i) = scmpsw(i)%nirbm + nirdfdi(i) = scmpsw(i)%nirdf + visbmdi(i) = scmpsw(i)%visbm + visdfdi(i) = scmpsw(i)%visdf + nirbmui(i) = scmpsw(i)%nirbm * sfc_alb_nir_dir(i) + nirdfui(i) = scmpsw(i)%nirdf * sfc_alb_nir_dif(i) + visbmui(i) = scmpsw(i)%visbm * sfc_alb_uvvis_dir(i) + visdfui(i) = scmpsw(i)%visdf * sfc_alb_uvvis_dif(i) + enddo + else ! if_nday_block + ! Dark everywhere + htrsw(:,:) = 0.0 + sfcfsw = sfcfsw_type( 0.0, 0.0, 0.0, 0.0 ) + topfsw = topfsw_type( 0.0, 0.0, 0.0 ) + do i=1,nCol + nirbmdi(i) = 0.0 + nirdfdi(i) = 0.0 + visbmdi(i) = 0.0 + visdfdi(i) = 0.0 + nirbmui(i) = 0.0 + nirdfui(i) = 0.0 + visbmui(i) = 0.0 + visdfui(i) = 0.0 + enddo + + if (do_sw_clrsky_hr) then + htrswc(:,:) = 0 + endif + endif ! end_if_nday + + ! Radiation fluxes for other physics processes + ! *NOTE* For RRTMG, sfcnsw and sfcdsw are provided. + ! For RRTMGP, we compute them here. + do i=1,nCol + sfcnsw(i) = sfcfsw(i)%dnfxc - sfcfsw(i)%upfxc + sfcdsw(i) = sfcfsw(i)%dnfxc + enddo + endif ! RRTMGP Shortwave Radiaiton + endif ! ALL Shortwave Radiation + + ! The total sky (with clouds) shortwave albedo + total_albedo = 0.0 + where(topfsw(:)%dnfxc>0) total_albedo(:) = topfsw(:)%upfxc/topfsw(:)%dnfxc + + ! ######################################################################################### + ! Compute radiation diagnostics + ! ######################################################################################### + if (lssav) then + call GFS_radiation_diagnostics(doLWrad, doSWrad, fhlwr, fhswr, coszen, coszdg, raddt, & + aerodp, cldsa, mtopa, mbota, cldtausw, cldtaulw, p_lev, tgrs, kb, kd, kt, sfcflw, & + sfcfsw, topfsw, topflw, scmpsw, nCol, nDay, nLev, lmk, nfxr, nspc1, fluxr) + endif + + end subroutine GFS_radiation_post_run + + ! ########################################################################################### + ! GFS_radiation_diagnostics + ! + ! For time averaged output quantities (including total-sky and clear-sky SW and LW fluxes at + ! TOA and surface; conventional 3-domain cloud amount, cloud top and base pressure, and cloud + ! top temperature; aerosols AOD, etc.), store computed results in corresponding slots of + ! array with appropriate time weights. + ! + ! ########################################################################################### + subroutine GFS_radiation_diagnostics(doLWrad, doSWrad, fhlwr, fhswr, coszen, coszdg, raddt, & + aerodp, cldsa, mtopa, mbota, cldtausw, cldtaulw, p_lev, tgrs, kb, kd, kt, sfcflw, & + sfcfsw, topfsw, topflw, scmpsw, nCol, nDay, nLev, lmk, nfxr, nspc1, fluxr) + ! Inputs + logical, intent(in) :: doLWrad, doSWrad + integer, intent(in) :: nCol, nLev, lmk, nfxr, nspc1, nDay + real(kind_phys), intent(in) :: fhlwr, fhswr, coszen(nCol), coszdg(nCol), raddt + real(kind_phys), intent(in) :: aerodp(nCol,nspc1) + real(kind_phys), intent(in) :: cldtausw(nCol,lmk), cldtaulw(nCol,lmk) + real(kind_phys), intent(in) :: p_lev(nCol,nLev+1), tgrs(nCol,nLev) + type(cmpfsw_type), intent(in) :: scmpsw(nCol) + type(sfcflw_type), intent(in) :: sfcflw(nCol) + type(sfcfsw_type), intent(in) :: sfcfsw(nCol) + type(topfsw_type), intent(in) :: topfsw(nCol) + type(topflw_type), intent(in) :: topflw(nCol) + ! For High/Mid/Low cloud flux diagnsotics + integer, intent(in) :: kb, kd, kt + integer, intent(in) :: mtopa(nCol,3), mbota(nCol,3) + real(kind_phys), intent(in) :: cldsa(nCol,5) + + ! Outputs + real(kind_phys), intent(inout) :: fluxr(nCol,nfxr) + ! Locals + integer :: i, j, k, itop, ibtc + real(kind_phys) :: tem0d, tem1, tem2 + + ! Save LW toa and sfc fluxes + if (doLWrad) then + do i=1,nCol + ! LW total-sky fluxes + fluxr(i,1 ) = fluxr(i,1 ) + fhlwr * topflw(i)%upfxc ! total sky TOA LW up + fluxr(i,19) = fluxr(i,19) + fhlwr * sfcflw(i)%dnfxc ! total sky SFC LW down + fluxr(i,20) = fluxr(i,20) + fhlwr * sfcflw(i)%upfxc ! total sky SFC LW up + ! LW clear-sky fluxes + fluxr(i,28) = fluxr(i,28) + fhlwr * topflw(i)%upfx0 ! clear sky TOA LW up + fluxr(i,30) = fluxr(i,30) + fhlwr * sfcflw(i)%dnfx0 ! clear sky SFC LW down + fluxr(i,33) = fluxr(i,33) + fhlwr * sfcflw(i)%upfx0 ! clear sky SFC LW up + enddo + endif ! END DOLWRAD + + ! Save SW toa and sfc fluxes with proper diurnal sw wgt. coszen=mean cosz over daylight + ! part of sw calling interval, while coszdg= mean cosz over entire interval + if (doSWrad) then + do i=1,nCol + ! Aerosol optical-depths + fluxr(i,34) = aerodp(i,1) ! Total aod at 550nm + fluxr(i,35) = aerodp(i,2) ! Dust aod at 550nm + fluxr(i,36) = aerodp(i,3) ! Soot aod at 550nm + fluxr(i,37) = aerodp(i,4) ! Waso aod at 550nm + fluxr(i,38) = aerodp(i,5) ! Suso aod at 550nm + fluxr(i,39) = aerodp(i,6) ! Salt aod at 550nm + + if (coszen(i) > 0.) then + ! SW total-sky fluxes + tem0d = fhswr * coszdg(i) / coszen(i) + fluxr(i,2 ) = fluxr(i,2) + topfsw(i)%upfxc * tem0d ! total sky TOA SW up + fluxr(i,3 ) = fluxr(i,3) + sfcfsw(i)%upfxc * tem0d ! total sky SFC SW up + fluxr(i,4 ) = fluxr(i,4) + sfcfsw(i)%dnfxc * tem0d ! total sky SFC SW down + ! SW uv-b fluxes + fluxr(i,21) = fluxr(i,21) + scmpsw(i)%uvbfc * tem0d ! total sky uv-b SW down + fluxr(i,22) = fluxr(i,22) + scmpsw(i)%uvbf0 * tem0d ! clear sky uv-b SW down + ! SW toa incoming fluxes + fluxr(i,23) = fluxr(i,23) + topfsw(i)%dnfxc * tem0d ! TOA SW down + ! SW sfc flux components + fluxr(i,24) = fluxr(i,24) + scmpsw(i)%visbm * tem0d ! uv/vis beam SW down + fluxr(i,25) = fluxr(i,25) + scmpsw(i)%visdf * tem0d ! uv/vis diff SW down + fluxr(i,26) = fluxr(i,26) + scmpsw(i)%nirbm * tem0d ! nir beam SW down + fluxr(i,27) = fluxr(i,27) + scmpsw(i)%nirdf * tem0d ! nir diff SW down + ! SW clear-sky fluxes + fluxr(i,29) = fluxr(i,29) + topfsw(i)%upfx0 * tem0d ! clear sky TOA SW up + fluxr(i,31) = fluxr(i,31) + sfcfsw(i)%upfx0 * tem0d ! clear sky SFC SW up + fluxr(i,32) = fluxr(i,32) + sfcfsw(i)%dnfx0 * tem0d ! clear sky SFC SW down + endif + enddo + endif ! END DOSWRAD + + ! + ! High/Mid/Low diagnostics + ! + if (doLWrad .or. doSWrad) then + ! Save total and boundary layer clouds + do i=1,nCol + fluxr(i,17) = fluxr(i,17) + raddt * cldsa(i,4) + fluxr(i,18) = fluxr(i,18) + raddt * cldsa(i,5) + enddo + + ! Save cld frac,toplyr,botlyr and top temp, note that the order + ! of h,m,l cloud is reversed for the fluxr output. + ! save interface pressure (pa) of top/bot + do j = 1, 3 + do i = 1, nCol + tem0d = raddt * cldsa(i,j) + itop = mtopa(i,j) - kd + ibtc = mbota(i,j) - kd + fluxr(i, 8-j) = fluxr(i, 8-j) + tem0d + fluxr(i,11-j) = fluxr(i,11-j) + tem0d * p_lev(i,itop+kt) + fluxr(i,14-j) = fluxr(i,14-j) + tem0d * p_lev(i,ibtc+kb) + fluxr(i,17-j) = fluxr(i,17-j) + tem0d * tgrs(i,itop) + enddo + enddo + + ! In-cloud (shortwave) optical depth at approx .55 um channel + if (doSWrad .and. (nDay > 0)) then + do j = 1, 3 + do i = 1, nCol + tem0d = raddt * cldsa(i,j) + itop = mtopa(i,j) - kd + ibtc = mbota(i,j) - kd + tem1 = 0. + do k=ibtc,itop + tem1 = tem1 + cldtausw(i,k) + enddo + fluxr(i,43-j) = fluxr(i,43-j) + tem0d * tem1 + enddo + enddo + endif ! END DOSWRAD + + ! In-cloud (longwave) optical depth at approx 10. um channel + if (doLWrad) then + do j = 1, 3 + do i = 1, nCol + tem0d = raddt * cldsa(i,j) + itop = mtopa(i,j) - kd + ibtc = mbota(i,j) - kd + tem2 = 0. + do k=ibtc,itop + tem2 = tem2 + cldtaulw(i,k) + enddo + fluxr(i,46-j) = fluxr(i,46-j) + tem0d * (1.0-exp(-tem2)) + enddo + enddo + endif ! END DOLWRAD + endif ! END DOSWRAD OR DOLWRAD + + end subroutine GFS_radiation_diagnostics + +end module GFS_radiation_post diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.meta similarity index 87% rename from physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.meta index 5d67afcd8e..bc371e1025 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_post.meta @@ -1,5 +1,5 @@ [ccpp-table-properties] - name = GFS_rrtmgp_post + name = GFS_radiation_post type = scheme relative_path = ../../ dependencies = hooks/machine.F,Radiation/radiation_aerosols.f @@ -7,64 +7,8 @@ ######################################################################## [ccpp-arg-table] - name = GFS_rrtmgp_post_run + name = GFS_radiation_post_run type = scheme -[nCol] - standard_name = horizontal_loop_extent - long_name = horizontal loop extent - units = count - dimensions = () - type = integer - intent = in -[nLev] - standard_name = vertical_layer_dimension - long_name = number of vertical levels - units = count - dimensions = () - type = integer - intent = in -[iSFC] - standard_name = vertical_index_for_surface_in_RRTMGP - long_name = index for surface layer in RRTMGP - units = flag - dimensions = () - type = integer - intent = in -[iTOA] - standard_name = vertical_index_for_TOA_in_RRTMGP - long_name = index for TOA layer in RRTMGP - units = flag - dimensions = () - type = integer - intent = in -[nday] - standard_name = daytime_points_dimension - long_name = daytime points dimension - units = count - dimensions = () - type = integer - intent = in -[idxday] - standard_name = daytime_points - long_name = daytime points - units = index - dimensions = (horizontal_loop_extent) - type = integer - intent = in -[doSWrad] - standard_name = flag_for_calling_shortwave_radiation - long_name = logical flags for sw radiation calls - units = flag - dimensions = () - type = logical - intent = in -[do_sw_clrsky_hr] - standard_name = flag_for_output_of_tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep_assuming_clear_sky - long_name = flag to output sw heating rate - units = flag - dimensions = () - type = logical - intent = in [doLWrad] standard_name = flag_for_calling_longwave_radiation long_name = logical flags for lw radiation calls @@ -72,20 +16,35 @@ dimensions = () type = logical intent = in -[do_lw_clrsky_hr] - standard_name = flag_for_output_of_tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep_assuming_clear_sky - long_name = flag to output lw heating rate +[doSWrad] + standard_name = flag_for_calling_shortwave_radiation + long_name = logical flags for sw radiation calls units = flag dimensions = () type = logical intent = in -[save_diag] +[lssav] standard_name = flag_for_diagnostics long_name = logical flag for storing diagnostics units = flag dimensions = () type = logical intent = in +[total_albedo] + standard_name = total_sky_albedo + long_name = total sky albedo at toa + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[topfsw] + standard_name = sw_fluxes_top_atmosphere + long_name = sw radiation fluxes at toa + units = W m-2 + dimensions = (horizontal_loop_extent) + type = topfsw_type + intent = inout [fhlwr] standard_name = period_of_longwave_radiation_calls long_name = frequency for longwave radiation @@ -118,73 +77,189 @@ type = real kind = kind_phys intent = in -[sfc_alb_nir_dir] - standard_name = surface_albedo_due_to_near_IR_direct - long_name = surface albedo due to near IR direct beam - units = frac - dimensions = (horizontal_loop_extent) +[raddt] + standard_name = time_step_for_radiation + long_name = radiation time step + units = s + dimensions = () type = real kind = kind_phys intent = in -[sfc_alb_nir_dif] - standard_name = surface_albedo_due_to_near_IR_diffused - long_name = surface albedo due to near IR diffused beam - units = frac - dimensions = (horizontal_loop_extent) +[aerodp] + standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles + long_name = vertical integrated optical depth for various aerosol species + units = none + dimensions = (horizontal_loop_extent,number_of_species_for_aerosol_optical_depth) type = real kind = kind_phys intent = in -[sfc_alb_uvvis_dir] - standard_name = surface_albedo_due_to_UV_and_VIS_direct - long_name = surface albedo due to UV+VIS direct beam +[cldsa] + standard_name = cloud_area_fraction_for_radiation + long_name = fraction of clouds for low, middle, high, total and BL units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_loop_extent,5) type = real kind = kind_phys intent = in -[sfc_alb_uvvis_dif] - standard_name = surface_albedo_due_to_UV_and_VIS_diffused - long_name = surface albedo due to UV+VIS diffused beam - units = frac - dimensions = (horizontal_loop_extent) +[mtopa] + standard_name = model_layer_number_at_cloud_top + long_name = vertical indices for low, middle and high cloud tops + units = index + dimensions = (horizontal_loop_extent,3) + type = integer + intent = in +[mbota] + standard_name = model_layer_number_at_cloud_base + long_name = vertical indices for low, middle and high cloud bases + units = index + dimensions = (horizontal_loop_extent,3) + type = integer + intent = in +[cldtausw] + standard_name = cloud_optical_depth_layers_at_0p55mu_band + long_name = approx .55mu band layer cloud optical depth + units = none + dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys intent = in -[tsfa] - standard_name = surface_air_temperature_for_radiation - long_name = lowest model layer air temperature for radiation - units = K - dimensions = (horizontal_loop_extent) +[cldtaulw] + standard_name = cloud_optical_depth_layers_at_10mu_band + long_name = approx 10mu band layer cloud optical depth + units = none + dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) type = real kind = kind_phys intent = in [p_lev] - standard_name = air_pressure_at_interface_for_RRTMGP + standard_name = air_pressure_at_interface long_name = air pressure level units = Pa dimensions = (horizontal_loop_extent,vertical_interface_dimension) type = real kind = kind_phys intent = in - optional = True -[fluxlwUP_allsky] - standard_name = RRTMGP_lw_flux_profile_upward_allsky - long_name = RRTMGP upward longwave all-sky flux profile - units = W m-2 - dimensions = (horizontal_loop_extent,vertical_interface_dimension) +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys intent = in - optional = True -[fluxlwDOWN_allsky] - standard_name = RRTMGP_lw_flux_profile_downward_allsky - long_name = RRTMGP downward longwave all-sky flux profile +[kb] + standard_name = vertical_index_difference_between_layer_and_lower_bound + long_name = vertical index difference between layer and lower bound + units = index + dimensions = () + type = integer + intent = in +[kd] + standard_name = vertical_index_difference_between_inout_and_local + long_name = vertical index difference between in/out and local + units = index + dimensions = () + type = integer + intent = in +[kt] + standard_name = vertical_index_difference_between_layer_and_upper_bound + long_name = vertical index difference between layer and upper bound + units = index + dimensions = () + type = integer + intent = in +[sfcflw] + standard_name = surface_lw_fluxes_assuming_total_and_clear_sky_on_radiation_timestep + long_name = lw radiation fluxes at sfc units = W m-2 - dimensions = (horizontal_loop_extent,vertical_interface_dimension) + dimensions = (horizontal_loop_extent) + type = sfcflw_type + intent = inout +[sfcfsw] + standard_name = surface_sw_fluxes_assuming_total_and_clear_sky_on_radiation_timestep + long_name = sw radiation fluxes at sfc + units = W m-2 + dimensions = (horizontal_loop_extent) + type = sfcfsw_type + intent = inout +[topflw] + standard_name = lw_fluxes_top_atmosphere + long_name = lw radiation fluxes at top + units = W m-2 + dimensions = (horizontal_loop_extent) + type = topflw_type + intent = inout +[scmpsw] + standard_name = components_of_surface_downward_shortwave_fluxes + long_name = derived type for special components of surface downward shortwave fluxes + units = W m-2 + dimensions = (horizontal_loop_extent) + type = cmpfsw_type + intent = in +[nCol] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in +[nLev] + standard_name = vertical_layer_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in +[lmk] + standard_name = adjusted_vertical_layer_dimension_for_radiation + long_name = adjusted number of vertical layers for radiation + units = count + dimensions = () + type = integer + intent = in +[nday] + standard_name = daytime_points_dimension + long_name = daytime points dimension + units = count + dimensions = () + type = integer + intent = in +[nfxr] + standard_name = number_of_diagnostics_variables_for_radiation + long_name = number of variables stored in the fluxr array + units = count + dimensions = () + type = integer + intent = in +[nspc1] + standard_name = number_of_species_for_aerosol_optical_depth + long_name = number of species for output aerosol optical depth plus total + units = count + dimensions = () + type = integer + intent = in +[fluxr] + standard_name = cumulative_radiation_diagnostic + long_name = time-accumulated 2D radiation-related diagnostic fields + units = mixed + dimensions = (horizontal_loop_extent,number_of_diagnostics_variables_for_radiation) type = real kind = kind_phys + intent = inout +[do_RRTMGP] + standard_name = flag_for_rrtmgp_radiation_scheme + long_name = flag for RRTMGP scheme + units = flag + dimensions = () + type = logical + intent = in +[do_lw_clrsky_hr] + standard_name = flag_for_output_of_tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep_assuming_clear_sky + long_name = flag to output lw heating rate + units = flag + dimensions = () + type = logical intent = in - optional = True [fluxlwUP_clrsky] standard_name = RRTMGP_lw_flux_profile_upward_clrsky long_name = RRTMGP upward longwave clr-sky flux profile @@ -203,24 +278,57 @@ kind = kind_phys intent = in optional = True -[fluxswUP_allsky] - standard_name = RRTMGP_sw_flux_profile_upward_allsky - long_name = RRTMGP upward shortwave all-sky flux profile +[htrlwc] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_timestep + long_name = longwave clear sky heating rate + units = K s-1 + dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) + type = real + kind = kind_phys + intent = inout + optional = True +[fluxlwUP_allsky] + standard_name = RRTMGP_lw_flux_profile_upward_allsky + long_name = RRTMGP upward longwave all-sky flux profile units = W m-2 dimensions = (horizontal_loop_extent,vertical_interface_dimension) type = real kind = kind_phys intent = in optional = True -[fluxswDOWN_allsky] - standard_name = RRTMGP_sw_flux_profile_downward_allsky - long_name = RRTMGP downward shortwave all-sky flux profile +[fluxlwDOWN_allsky] + standard_name = RRTMGP_lw_flux_profile_downward_allsky + long_name = RRTMGP downward longwave all-sky flux profile units = W m-2 dimensions = (horizontal_loop_extent,vertical_interface_dimension) type = real kind = kind_phys intent = in optional = True +[htrlw] + standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep + long_name = total sky lw heating rate + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[do_sw_clrsky_hr] + standard_name = flag_for_output_of_tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep_assuming_clear_sky + long_name = flag to output sw heating rate + units = flag + dimensions = () + type = logical + intent = in +[htrswc] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_timestep + long_name = clear sky sw heating rates + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout + optional = True [fluxswUP_clrsky] standard_name = RRTMGP_sw_flux_profile_upward_clrsky long_name = RRTMGP upward shortwave clr-sky flux profile @@ -230,6 +338,13 @@ kind = kind_phys intent = in optional = True +[idxday] + standard_name = daytime_points + long_name = daytime points + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = in [fluxswDOWN_clrsky] standard_name = RRTMGP_sw_flux_profile_downward_clrsky long_name = RRTMGP downward shortwave clr-sky flux profile @@ -239,83 +354,62 @@ kind = kind_phys intent = in optional = True -[raddt] - standard_name = time_step_for_radiation - long_name = radiation time step - units = s - dimensions = () +[htrsw] + standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep + long_name = total sky sw heating rate + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys - intent = in -[aerodp] - standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles - long_name = vertical integrated optical depth for various aerosol species - units = none - dimensions = (horizontal_loop_extent,number_of_species_for_aerosol_optical_depth) + intent = inout +[fluxswUP_allsky] + standard_name = RRTMGP_sw_flux_profile_upward_allsky + long_name = RRTMGP upward shortwave all-sky flux profile + units = W m-2 + dimensions = (horizontal_loop_extent,vertical_interface_dimension) type = real kind = kind_phys intent = in -[cldsa] - standard_name = cloud_area_fraction_for_radiation - long_name = fraction of clouds for low, middle, high, total and BL - units = frac - dimensions = (horizontal_loop_extent,5) + optional = True +[fluxswDOWN_allsky] + standard_name = RRTMGP_sw_flux_profile_downward_allsky + long_name = RRTMGP downward shortwave all-sky flux profile + units = W m-2 + dimensions = (horizontal_loop_extent,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 - units = index - dimensions = (horizontal_loop_extent,3) + optional = True +[iSFC] + standard_name = vertical_index_for_surface_in_RRTMGP + long_name = index for surface layer in RRTMGP + units = flag + dimensions = () type = integer intent = in -[mbota] - standard_name = model_layer_number_at_cloud_base - long_name = vertical indices for low, middle and high cloud bases - units = index - dimensions = (horizontal_loop_extent,3) +[iTOA] + standard_name = vertical_index_for_TOA_in_RRTMGP + long_name = index for TOA layer in RRTMGP + units = flag + dimensions = () type = integer intent = in -[cld_frac] - standard_name = total_cloud_fraction - long_name = layer total cloud fraction - units = frac - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[cldtaulw] - standard_name = cloud_optical_depth_layers_at_10mu_band - long_name = approx 10mu band layer cloud optical depth - units = none - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[cldtausw] - standard_name = cloud_optical_depth_layers_at_0p55mu_band - long_name = approx .55mu band layer cloud optical depth - units = none - dimensions = (horizontal_loop_extent,vertical_layer_dimension) +[tsflw] + standard_name = air_temperature_at_surface_adjacent_layer_on_radiation_timestep + long_name = surface air temp during lw calculation + units = K + dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in -[scmpsw] - standard_name = components_of_surface_downward_shortwave_fluxes - long_name = derived type for special components of surface downward shortwave fluxes - units = W m-2 + intent = inout +[tsfa] + standard_name = surface_air_temperature_for_radiation + long_name = lowest model layer air temperature for radiation + units = K dimensions = (horizontal_loop_extent) - type = cmpfsw_type - intent = in -[fluxr] - standard_name = cumulative_radiation_diagnostic - long_name = time-accumulated 2D radiation-related diagnostic fields - units = mixed - dimensions = (horizontal_loop_extent,number_of_diagnostics_variables_for_radiation) type = real kind = kind_phys - intent = inout + intent = in [sfcdlw] standard_name = surface_downwelling_longwave_flux_on_radiation_timestep long_name = total sky sfc downward lw flux @@ -323,7 +417,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = inout [sfculw] standard_name = surface_upwelling_longwave_flux_on_radiation_timestep long_name = total sky sfc upward lw flux @@ -332,29 +426,6 @@ type = real kind = kind_phys intent = inout -[sfcflw] - standard_name = surface_lw_fluxes_assuming_total_and_clear_sky_on_radiation_timestep - long_name = lw radiation fluxes at sfc - units = W m-2 - dimensions = (horizontal_loop_extent) - type = sfcflw_type - intent = inout -[tsflw] - standard_name = air_temperature_at_surface_adjacent_layer_on_radiation_timestep - long_name = surface air temp during lw calculation - units = K - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = inout -[htrlw] - standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep - long_name = total sky lw heating rate - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout [htrlwu] standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_timestep long_name = total sky longwave heating rate on physics time step @@ -364,13 +435,6 @@ kind = kind_phys intent = inout optional = True -[topflw] - standard_name = lw_fluxes_top_atmosphere - long_name = lw radiation fluxes at top - units = W m-2 - dimensions = (horizontal_loop_extent) - type = topflw_type - intent = inout [nirbmdi] standard_name = surface_downwelling_direct_nir_shortwave_flux_on_radiation_timestep long_name = sfc nir beam sw downward flux @@ -435,57 +499,51 @@ type = real kind = kind_phys intent = inout -[sfcnsw] - standard_name = surface_net_downwelling_shortwave_flux_on_radiation_timestep - long_name = total sky sfc netsw flx into ground - units = W m-2 +[sfc_alb_nir_dir] + standard_name = surface_albedo_due_to_near_IR_direct + long_name = surface albedo due to near IR direct beam + units = frac dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout -[sfcdsw] - standard_name = surface_downwelling_shortwave_flux_on_radiation_timestep - long_name = total sky sfc downward sw flux - units = W m-2 + intent = in +[sfc_alb_nir_dif] + standard_name = surface_albedo_due_to_near_IR_diffused + long_name = surface albedo due to near IR diffused beam + units = frac dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout -[htrsw] - standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep - long_name = total sky sw heating rate - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[sfc_alb_uvvis_dir] + standard_name = surface_albedo_due_to_UV_and_VIS_direct + long_name = surface albedo due to UV+VIS direct beam + units = frac + dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout -[sfcfsw] - standard_name = surface_sw_fluxes_assuming_total_and_clear_sky_on_radiation_timestep - long_name = sw radiation fluxes at sfc - units = W m-2 + intent = in +[sfc_alb_uvvis_dif] + standard_name = surface_albedo_due_to_UV_and_VIS_diffused + long_name = surface albedo due to UV+VIS diffused beam + units = frac dimensions = (horizontal_loop_extent) - type = sfcfsw_type - intent = inout -[topfsw] - standard_name = sw_fluxes_top_atmosphere - long_name = sw radiation fluxes at toa + type = real + kind = kind_phys + intent = in +[sfcnsw] + standard_name = surface_net_downwelling_shortwave_flux_on_radiation_timestep + long_name = total sky sfc netsw flx into ground units = W m-2 dimensions = (horizontal_loop_extent) - type = topfsw_type - intent = inout -[htrswc] - standard_name = tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_timestep - long_name = clear sky sw heating rates - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys intent = inout -[htrlwc] - standard_name = tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_timestep - long_name = longwave clear sky heating rate - units = K s-1 - dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) +[sfcdsw] + standard_name = surface_downwelling_shortwave_flux_on_radiation_timestep + long_name = total sky sfc downward sw flux + units = W m-2 + dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = inout @@ -503,4 +561,4 @@ units = 1 dimensions = () type = integer - intent = out + intent = out \ No newline at end of file diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90 deleted file mode 100644 index 76ee18ec22..0000000000 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90 +++ /dev/null @@ -1,214 +0,0 @@ -!>\file GFS_rrtmg_post.F90 -!! This file contains the calculation of time averaged output quantities (including total-sky and -!! clear-sky SW and LW fluxes at TOA and surface; conventional -!! 3-domain cloud amount, cloud top and base pressure, and cloud top -!! temperature; aerosols AOD, etc.), store computed results in -!! corresponding slots of array fluxr with appropriate time weights. - - module GFS_rrtmg_post - contains - -!>\defgroup GFS_rrtmg_post_mod GFS RRTMG Scheme Post -!! This module calculate time averaged output quantities (including total-sky and -!! clear-sky SW and LW fluxes at TOA and surface; conventional -!! 3-domain cloud amount, cloud top and base pressure, and cloud top -!! temperature; aerosols AOD, etc.), store computed results in -!! corresponding slots of array fluxr with appropriate time weights. -!> @{ -!> \section arg_table_GFS_rrtmg_post_run Argument Table -!! \htmlinclude GFS_rrtmg_post_run.html -!! - subroutine GFS_rrtmg_post_run (im, km, kmp1, lm, ltp, kt, kb, kd, nspc1, & - nfxr, nday, lsswr, lslwr, lssav, fhlwr, fhswr, raddt, coszen, & - coszdg, prsi, tgrs, aerodp, cldsa, mtopa, mbota, clouds1, & - cldtaulw, cldtausw, sfcflw, sfcfsw, topflw, topfsw, scmpsw, & - fluxr, total_albedo, errmsg, errflg) - - use machine, only: kind_phys - use module_radsw_parameters, only: topfsw_type, sfcfsw_type, & - cmpfsw_type - use module_radlw_parameters, only: topflw_type, sfcflw_type - - implicit none - - ! Interface variables - integer, intent(in) :: im, km, kmp1, lm, ltp, kt, kb, kd, & - nspc1, nfxr, nday - logical, intent(in) :: lsswr, lslwr, lssav - real(kind=kind_phys), intent(in) :: raddt, fhlwr, fhswr - - real(kind=kind_phys), dimension(im), intent(in) :: coszen, coszdg - - real(kind=kind_phys), dimension(im,kmp1), intent(in) :: prsi - real(kind=kind_phys), dimension(im,km), intent(in) :: tgrs - - real(kind=kind_phys), dimension(im,NSPC1), intent(in) :: aerodp - real(kind=kind_phys), dimension(im,5), intent(in) :: cldsa - integer, dimension(im,3), intent(in) :: mbota, mtopa - real(kind=kind_phys), dimension(im,lm+LTP), intent(in) :: clouds1 - real(kind=kind_phys), dimension(im,lm+LTP), intent(in) :: cldtausw - real(kind=kind_phys), dimension(im,lm+LTP), intent(in) :: cldtaulw - real(kind=kind_phys), dimension(im), intent(inout) :: total_albedo - - type(sfcflw_type), dimension(im), intent(in) :: sfcflw - type(sfcfsw_type), dimension(im), intent(in) :: sfcfsw - type(cmpfsw_type), dimension(im), intent(in) :: scmpsw - type(topflw_type), dimension(im), intent(in) :: topflw - type(topfsw_type), dimension(im), intent(in) :: topfsw - - real(kind=kind_phys), dimension(im,nfxr), intent(inout) :: fluxr - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Local variables - integer :: i, j, k, k1, itop, ibtc - real(kind=kind_phys) :: tem0d, tem1, tem2 - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not. (lsswr .or. lslwr)) return - -! - For time averaged output quantities (including total-sky and -! clear-sky SW and LW fluxes at TOA and surface; conventional -! 3-domain cloud amount, cloud top and base pressure, and cloud top -! temperature; aerosols AOD, etc.), store computed results in -! corresponding slots of array fluxr with appropriate time weights. - -! --- ... collect the fluxr data for wrtsfc - - if (lssav) then - if (lsswr) then - do i=1,im -! fluxr(i,34) = fluxr(i,34) + fhswr*aerodp(i,1) ! total aod at 550nm -! fluxr(i,35) = fluxr(i,35) + fhswr*aerodp(i,2) ! DU aod at 550nm -! fluxr(i,36) = fluxr(i,36) + fhswr*aerodp(i,3) ! BC aod at 550nm -! fluxr(i,37) = fluxr(i,37) + fhswr*aerodp(i,4) ! OC aod at 550nm -! fluxr(i,38) = fluxr(i,38) + fhswr*aerodp(i,5) ! SU aod at 550nm -! fluxr(i,39) = fluxr(i,39) + fhswr*aerodp(i,6) ! SS aod at 550nm - fluxr(i,34) = aerodp(i,1) ! total aod at 550nm - fluxr(i,35) = aerodp(i,2) ! DU aod at 550nm - fluxr(i,36) = aerodp(i,3) ! BC aod at 550nm - fluxr(i,37) = aerodp(i,4) ! OC aod at 550nm - fluxr(i,38) = aerodp(i,5) ! SU aod at 550nm - fluxr(i,39) = aerodp(i,6) ! SS aod at 550nm - enddo - endif - -! --- save lw toa and sfc fluxes - if (lslwr) then - do i=1,im -! --- lw total-sky fluxes - fluxr(i,1 ) = fluxr(i,1 ) + fhlwr * topflw(i)%upfxc ! total sky top lw up - fluxr(i,19) = fluxr(i,19) + fhlwr * sfcflw(i)%dnfxc ! total sky sfc lw dn - fluxr(i,20) = fluxr(i,20) + fhlwr * sfcflw(i)%upfxc ! total sky sfc lw up -! --- lw clear-sky fluxes - fluxr(i,28) = fluxr(i,28) + fhlwr * topflw(i)%upfx0 ! clear sky top lw up - fluxr(i,30) = fluxr(i,30) + fhlwr * sfcflw(i)%dnfx0 ! clear sky sfc lw dn - fluxr(i,33) = fluxr(i,33) + fhlwr * sfcflw(i)%upfx0 ! clear sky sfc lw up - enddo - endif - -! --- save sw toa and sfc fluxes with proper diurnal sw wgt. coszen=mean cosz over daylight -! part of sw calling interval, while coszdg= mean cosz over entire interval - if (lsswr) then - do i = 1, IM - if (coszen(i) > 0.) then -! --- sw total-sky fluxes -! ------------------- - tem0d = fhswr * coszdg(i) / coszen(i) - fluxr(i,2 ) = fluxr(i,2) + topfsw(i)%upfxc * tem0d ! total sky top sw up - fluxr(i,3 ) = fluxr(i,3) + sfcfsw(i)%upfxc * tem0d ! total sky sfc sw up - fluxr(i,4 ) = fluxr(i,4) + sfcfsw(i)%dnfxc * tem0d ! total sky sfc sw dn -! --- sw uv-b fluxes -! -------------- - fluxr(i,21) = fluxr(i,21) + scmpsw(i)%uvbfc * tem0d ! total sky uv-b sw dn - fluxr(i,22) = fluxr(i,22) + scmpsw(i)%uvbf0 * tem0d ! clear sky uv-b sw dn -! --- sw toa incoming fluxes -! ---------------------- - fluxr(i,23) = fluxr(i,23) + topfsw(i)%dnfxc * tem0d ! top sw dn -! --- sw sfc flux components -! ---------------------- - fluxr(i,24) = fluxr(i,24) + scmpsw(i)%visbm * tem0d ! uv/vis beam sw dn - fluxr(i,25) = fluxr(i,25) + scmpsw(i)%visdf * tem0d ! uv/vis diff sw dn - fluxr(i,26) = fluxr(i,26) + scmpsw(i)%nirbm * tem0d ! nir beam sw dn - fluxr(i,27) = fluxr(i,27) + scmpsw(i)%nirdf * tem0d ! nir diff sw dn -! --- sw clear-sky fluxes -! ------------------- - fluxr(i,29) = fluxr(i,29) + topfsw(i)%upfx0 * tem0d ! clear sky top sw up - fluxr(i,31) = fluxr(i,31) + sfcfsw(i)%upfx0 * tem0d ! clear sky sfc sw up - fluxr(i,32) = fluxr(i,32) + sfcfsw(i)%dnfx0 * tem0d ! clear sky sfc sw dn - endif - enddo - endif - -! --- save total and boundary layer clouds - - if (lsswr .or. lslwr) then - do i=1,im - fluxr(i,17) = fluxr(i,17) + raddt * cldsa(i,4) - fluxr(i,18) = fluxr(i,18) + raddt * cldsa(i,5) - enddo - -! --- save cld frac,toplyr,botlyr and top temp, note that the order -! of h,m,l cloud is reversed for the fluxr output. -! --- save interface pressure (pa) of top/bot - - do j = 1, 3 - do i = 1, IM - tem0d = raddt * cldsa(i,j) - itop = mtopa(i,j) - kd - ibtc = mbota(i,j) - kd - fluxr(i, 8-j) = fluxr(i, 8-j) + tem0d - fluxr(i,11-j) = fluxr(i,11-j) + tem0d * prsi(i,itop+kt) - fluxr(i,14-j) = fluxr(i,14-j) + tem0d * prsi(i,ibtc+kb) - fluxr(i,17-j) = fluxr(i,17-j) + tem0d * tgrs(i,itop) - enddo - enddo - -! Anning adds optical depth and emissivity output - if (lsswr .and. (nday > 0)) then - do j = 1, 3 - do i = 1, IM - tem0d = raddt * cldsa(i,j) - itop = mtopa(i,j) - kd - ibtc = mbota(i,j) - kd - tem1 = 0. - do k=ibtc,itop - tem1 = tem1 + cldtausw(i,k) ! approx .55 um channel - enddo - fluxr(i,43-j) = fluxr(i,43-j) + tem0d * tem1 - enddo - enddo - endif - - if (lslwr) then - do j = 1, 3 - do i = 1, IM - tem0d = raddt * cldsa(i,j) - itop = mtopa(i,j) - kd - ibtc = mbota(i,j) - kd - tem2 = 0. - do k=ibtc,itop - tem2 = tem2 + cldtaulw(i,k) ! approx 10. um channel - enddo - fluxr(i,46-j) = fluxr(i,46-j) + tem0d * (1.0-exp(-tem2)) - enddo - enddo - endif - - endif - - endif ! end_if_lssav - -! --- The total sky (with clouds) shortwave albedo - total_albedo = 0.0 - if (lsswr) then - where(topfsw(:)%dnfxc>0) total_albedo(:) = topfsw(:)%upfxc/topfsw(:)%dnfxc - endif -! - end subroutine GFS_rrtmg_post_run -!> @} - end module GFS_rrtmg_post diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta deleted file mode 100644 index b387c3e336..0000000000 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta +++ /dev/null @@ -1,285 +0,0 @@ -[ccpp-table-properties] - name = GFS_rrtmg_post - type = scheme - relative_path = ../../ - dependencies = hooks/machine.F - dependencies = Radiation/radiation_aerosols.f,Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f - -######################################################################## -[ccpp-arg-table] - name = GFS_rrtmg_post_run - type = scheme -[im] - standard_name = horizontal_loop_extent - long_name = horizontal loop extent - units = count - dimensions = () - type = integer - intent = in -[km] - standard_name = vertical_layer_dimension - long_name = number of vertical levels - units = count - dimensions = () - type = integer - intent = in -[kmp1] - standard_name = vertical_interface_dimension - long_name = number of vertical levels plus one - units = count - dimensions = () - type = integer - intent = in -[lm] - standard_name = vertical_dimension_for_radiation - long_name = number of vertical layers for radiation calculation - units = count - dimensions = () - type = integer - intent = in -[ltp] - standard_name = extra_top_layer - long_name = extra top layers - units = count - dimensions = () - type = integer - intent = in -[kt] - standard_name = vertical_index_difference_between_layer_and_upper_bound - long_name = vertical index difference between layer and upper bound - units = index - dimensions = () - type = integer - intent = in -[kb] - standard_name = vertical_index_difference_between_layer_and_lower_bound - long_name = vertical index difference between layer and lower bound - units = index - dimensions = () - type = integer - intent = in -[kd] - standard_name = vertical_index_difference_between_inout_and_local - long_name = vertical index difference between in/out and local - units = index - dimensions = () - type = integer - intent = in -[nspc1] - standard_name = number_of_species_for_aerosol_optical_depth - long_name = number of species for output aerosol optical depth plus total - units = count - dimensions = () - type = integer - intent = in -[nfxr] - standard_name = number_of_diagnostics_variables_for_radiation - long_name = number of variables stored in the fluxr array - units = count - dimensions = () - type = integer - intent = in -[nday] - standard_name = daytime_points_dimension - long_name = daytime points dimension - units = count - dimensions = () - type = integer - intent = in -[lsswr] - standard_name = flag_for_calling_shortwave_radiation - long_name = logical flags for sw radiation calls - units = flag - dimensions = () - type = logical - intent = in -[lslwr] - standard_name = flag_for_calling_longwave_radiation - long_name = logical flags for lw radiation calls - units = flag - dimensions = () - type = logical - intent = in -[lssav] - standard_name = flag_for_diagnostics - long_name = logical flag for storing diagnostics - units = flag - dimensions = () - type = logical - intent = in -[fhlwr] - standard_name = period_of_longwave_radiation_calls - long_name = frequency for longwave radiation - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[fhswr] - standard_name = period_of_shortwave_radiation_calls - long_name = frequency for shortwave radiation - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[raddt] - standard_name = time_step_for_radiation - long_name = radiation time step - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[coszen] - standard_name = cosine_of_solar_zenith_angle_for_daytime_points_on_radiation_timestep - long_name = mean cos of zenith angle over rad call period - units = none - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[coszdg] - standard_name = cosine_of_solar_zenith_angle_on_radiation_timestep - long_name = daytime mean cosz over rad call period - units = none - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[prsi] - standard_name = air_pressure_at_interface - long_name = air pressure at model layer interfaces - units = Pa - dimensions = (horizontal_loop_extent,vertical_interface_dimension) - type = real - kind = kind_phys - intent = in -[tgrs] - standard_name = air_temperature - long_name = model layer mean temperature - units = K - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[aerodp] - standard_name = atmosphere_optical_thickness_due_to_ambient_aerosol_particles - long_name = vertical integrated optical depth for various aerosol species - units = none - dimensions = (horizontal_loop_extent,number_of_species_for_aerosol_optical_depth) - type = real - kind = kind_phys - intent = in -[cldsa] - standard_name = cloud_area_fraction_for_radiation - long_name = fraction of clouds for low, middle, high, total and BL - units = frac - dimensions = (horizontal_loop_extent,5) - 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 - units = index - dimensions = (horizontal_loop_extent,3) - type = integer - intent = in -[mbota] - standard_name = model_layer_number_at_cloud_base - long_name = vertical indices for low, middle and high cloud bases - units = index - dimensions = (horizontal_loop_extent,3) - type = integer - intent = in -[clouds1] - standard_name = total_cloud_fraction - long_name = layer total cloud fraction - units = frac - dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) - type = real - kind = kind_phys - intent = in -[cldtaulw] - standard_name = cloud_optical_depth_layers_at_10mu_band - long_name = approx 10mu band layer cloud optical depth - units = none - dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) - type = real - kind = kind_phys - intent = in -[cldtausw] - standard_name = cloud_optical_depth_layers_at_0p55mu_band - long_name = approx .55mu band layer cloud optical depth - units = none - dimensions = (horizontal_loop_extent,adjusted_vertical_layer_dimension_for_radiation) - type = real - kind = kind_phys - intent = in -[sfcflw] - standard_name = surface_lw_fluxes_assuming_total_and_clear_sky_on_radiation_timestep - long_name = lw radiation fluxes at sfc - units = W m-2 - dimensions = (horizontal_loop_extent) - type = sfcflw_type - intent = in -[sfcfsw] - standard_name = surface_sw_fluxes_assuming_total_and_clear_sky_on_radiation_timestep - long_name = sw radiation fluxes at sfc - units = W m-2 - dimensions = (horizontal_loop_extent) - type = sfcfsw_type - intent = in -[topflw] - standard_name = lw_fluxes_top_atmosphere - long_name = lw radiation fluxes at top - units = W m-2 - dimensions = (horizontal_loop_extent) - type = topflw_type - intent = in -[topfsw] - standard_name = sw_fluxes_top_atmosphere - long_name = sw radiation fluxes at toa - units = W m-2 - dimensions = (horizontal_loop_extent) - type = topfsw_type - intent = in -[scmpsw] - standard_name = components_of_surface_downward_shortwave_fluxes - long_name = derived type for special components of surface downward shortwave fluxes - units = W m-2 - dimensions = (horizontal_loop_extent) - type = cmpfsw_type - intent = in -[fluxr] - standard_name = cumulative_radiation_diagnostic - long_name = time-accumulated 2D radiation-related diagnostic fields - units = mixed - dimensions = (horizontal_loop_extent,number_of_diagnostics_variables_for_radiation) - type = real - kind = kind_phys - intent = inout -[total_albedo] - standard_name = total_sky_albedo - long_name = total sky albedo at toa - units = frac - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = inout -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 deleted file mode 100644 index ec22f24d3d..0000000000 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 +++ /dev/null @@ -1,386 +0,0 @@ -!> \file GFS_rrtmgp_post.F90 -!! RRTMGP post-processing routine. -!! -module GFS_rrtmgp_post - use machine, only: kind_phys - use module_radlw_parameters, only: topflw_type, sfcflw_type - use module_radsw_parameters, only: topfsw_type, sfcfsw_type, cmpfsw_type - use mo_heating_rates, only: compute_heating_rate - use radiation_tools, only: check_error_msg - implicit none - - public GFS_rrtmgp_post_run - -contains - -!> \section arg_table_GFS_rrtmgp_post_run Argument Table -!! \htmlinclude GFS_rrtmgp_post_run.html -!! -!!The all-sky radiation tendency is computed, the clear-sky tendency is computed -!! if requested. -!! -!! RRTMGP surface and TOA fluxes are copied to fields that persist between radiation/physics -!! calls. -!! -!! (optional) Save additional diagnostics. - subroutine GFS_rrtmgp_post_run (nCol, nLev, nDay, iSFC, iTOA, idxday, doLWrad, doSWrad, & - do_lw_clrsky_hr, do_sw_clrsky_hr, save_diag, fhlwr, fhswr, sfc_alb_nir_dir, & - sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, p_lev, tsfa, coszen, coszdg, & - fluxlwDOWN_clrsky, fluxlwUP_allsky, fluxlwDOWN_allsky, fluxlwUP_clrsky, & - fluxswDOWN_clrsky, fluxswUP_allsky, fluxswDOWN_allsky, fluxswUP_clrsky, & - raddt, aerodp, cldsa, mtopa, mbota, cld_frac, cldtaulw, cldtausw, scmpsw, fluxr, & - sfcdlw, sfculw, sfcflw, tsflw, htrlw, htrlwu, topflw, nirbmdi, nirdfdi, visbmdi, & - visdfdi, nirbmui, nirdfui, visbmui, visdfui, sfcnsw, sfcdsw, htrsw, sfcfsw, topfsw, & - htrswc, htrlwc, errmsg, errflg) - - ! Inputs - integer, intent(in) :: & - nCol, & !< Horizontal loop extent - nLev, & !< Number of vertical layers - nDay, & !< Number of daylit columns - iSFC, & !< Vertical index for surface level - iTOA !< Vertical index for TOA level - integer, intent(in), dimension(:) :: & - idxday !< Index array for daytime points - integer, intent(in), dimension(:,:) :: & - mbota, & !< Vertical indices for low, middle and high cloud tops - mtopa !< ertical indices for low, middle and high cloud bases - logical, intent(in) :: & - doLWrad, & !< Logical flags for lw radiation calls - doSWrad, & !< Logical flags for sw radiation calls - do_lw_clrsky_hr, & !< Output clear-sky LW heating-rate? - do_sw_clrsky_hr, & !< Output clear-sky SW heating-rate? - save_diag !< Output radiation diagnostics? - real(kind_phys), intent(in) :: & - fhlwr, & !< Frequency for LW radiation calls - fhswr !< Frequency for SW radiation calls - real(kind_phys), dimension(:), intent(in) :: & - tsfa, & !< Lowest model layer air temperature for radiation (K) - coszen, & !< Cosine(SZA) - coszdg, & !< Cosine(SZA), daytime - sfc_alb_nir_dir, & !< Surface albedo (direct) - sfc_alb_nir_dif, & !< Surface albedo (diffuse) - sfc_alb_uvvis_dir, & !< Surface albedo (direct) - sfc_alb_uvvis_dif !< Surface albedo (diffuse) - real(kind_phys), dimension(:,:), intent(in), optional :: & - p_lev, & !< Pressure @ model layer-interfaces (Pa) - fluxlwUP_allsky, & !< RRTMGP longwave all-sky flux (W/m2) - fluxlwDOWN_allsky, & !< RRTMGP longwave all-sky flux (W/m2) - fluxlwUP_clrsky, & !< RRTMGP longwave clear-sky flux (W/m2) - fluxlwDOWN_clrsky, & !< RRTMGP longwave clear-sky flux (W/m2) - fluxswUP_allsky, & !< RRTMGP shortwave all-sky flux (W/m2) - fluxswDOWN_allsky, & !< RRTMGP shortwave all-sky flux (W/m2) - fluxswUP_clrsky, & !< RRTMGP shortwave clear-sky flux (W/m2) - fluxswDOWN_clrsky !< RRTMGP shortwave clear-sky flux (W/m2) - real(kind_phys), intent(in) :: & - raddt !< Radiation time step - real(kind_phys), dimension(:,:), intent(in) :: & - aerodp, & !< Vertical integrated optical depth for various aerosol species - cldsa, & !< Fraction of clouds for low, middle, high, total and BL - cld_frac, & !< Total cloud fraction in each layer - cldtaulw, & !< approx 10.mu band layer cloud optical depth - cldtausw !< approx .55mu band layer cloud optical depth - type(cmpfsw_type), dimension(:), intent(in) :: & - scmpsw !< 2D surface fluxes, components: - !!\n uvbfc - total sky downward uv-b flux at (W/m2) - !!\n uvbf0 - clear sky downward uv-b flux at (W/m2) - !!\n nirbm - downward nir direct beam flux (W/m2) - !!\n nirdf - downward nir diffused flux (W/m2) - !!\n visbm - downward uv+vis direct beam flux (W/m2) - !!\n visdf - downward uv+vis diffused flux (W/m2) - - - real(kind=kind_phys), dimension(:,:), intent(inout) :: fluxr - - ! Outputs (mandatory) - real(kind_phys), dimension(:), intent(inout) :: & - tsflw, & !< LW sfc air temp during calculation (K) - sfcdlw, & !< LW sfc all-sky downward flux (W/m2) - sfculw, & !< LW sfc all-sky upward flux (W/m2) - nirbmdi, & !< SW sfc nir beam downward flux (W/m2) - nirdfdi, & !< SW sfc nir diff downward flux (W/m2) - visbmdi, & !< SW sfc uv+vis beam downward flux (W/m2) - visdfdi, & !< SW sfc uv+vis diff downward flux (W/m2) - nirbmui, & !< SW sfc nir beam upward flux (W/m2) - nirdfui, & !< SW sfc nir diff upward flux (W/m2) - visbmui, & !< SW sfc uv+vis beam upward flux (W/m2) - visdfui, & !< SW sfc uv+vis diff upward flux (W/m2) - sfcnsw, & !< SW sfc all-sky net flux (W/m2) flux into ground - sfcdsw !< SW sfc all-sky downward flux (W/m2) - real(kind_phys), dimension(:,:), intent(inout) :: & - htrlw, & !< LW all-sky heating rate (K/s) - htrsw !< SW all-sky heating rate (K/s) - real(kind_phys), dimension(:,:), intent(inout), optional :: & - htrlwu !< LW all-sky heating-rate updated in-between radiation calls. - type(sfcflw_type), dimension(:), intent(inout) :: & - sfcflw !< LW radiation fluxes at sfc - type(sfcfsw_type), dimension(:), intent(inout) :: & - sfcfsw !< SW radiation fluxes at sfc - type(topfsw_type), dimension(:), intent(inout) :: & - topfsw !< SW fluxes at top atmosphere - type(topflw_type), dimension(:), intent(inout) :: & - topflw !< LW fluxes at top atmosphere - character(len=*), intent(out) :: & - errmsg !< CCPP error message - integer, intent(out) :: & - errflg !< CCPP error code - - ! Outputs (optional) - real(kind_phys),dimension(:,:),intent(inout),optional :: & - htrlwc, & !< LW clear-sky heating-rate (K/s) - htrswc !< SW clear-sky heating rate (K/s) - - ! Local variables - integer :: i, j, k, itop, ibtc - real(kind_phys) :: tem0d, tem1, tem2 - real(kind_phys), dimension(nDay, nLev) :: thetaTendClrSky, thetaTendAllSky - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not. (doLWrad .or. doSWrad)) return - - if (doLWRad) then - ! ####################################################################################### - ! Compute LW heating-rates. - ! ####################################################################################### - - ! Clear-sky heating-rate (optional) - if (do_lw_clrsky_hr) then - call check_error_msg('GFS_rrtmgp_post',compute_heating_rate( & - fluxlwUP_clrsky, & ! IN - RRTMGP upward longwave clear-sky flux profiles (W/m2) - fluxlwDOWN_clrsky, & ! IN - RRTMGP downward longwave clear-sky flux profiles (W/m2) - p_lev, & ! IN - Pressure @ layer-interfaces (Pa) - htrlwc)) ! OUT - Longwave clear-sky heating rate (K/sec) - endif - - ! All-sky heating-rate (mandatory) - call check_error_msg('GFS_rrtmgp_post',compute_heating_rate( & - fluxlwUP_allsky, & ! IN - RRTMGP upward longwave all-sky flux profiles (W/m2) - fluxlwDOWN_allsky, & ! IN - RRTMGP downward longwave all-sky flux profiles (W/m2) - p_lev, & ! IN - Pressure @ layer-interfaces (Pa) - htrlw)) ! OUT - Longwave all-sky heating rate (K/sec) - - ! ####################################################################################### - ! Save LW outputs. - ! (Copy fluxes from RRTMGP types into model radiation types.) - ! ####################################################################################### - ! TOA fluxes - - topflw(:)%upfxc = fluxlwUP_allsky(:,iTOA) - topflw(:)%upfx0 = fluxlwUP_clrsky(:,iTOA) - - ! Surface fluxes - sfcflw(:)%upfxc = fluxlwUP_allsky(:,iSFC) - sfcflw(:)%upfx0 = fluxlwUP_clrsky(:,iSFC) - sfcflw(:)%dnfxc = fluxlwDOWN_allsky(:,iSFC) - sfcflw(:)%dnfx0 = fluxlwDOWN_clrsky(:,iSFC) - - ! Save surface air temp for diurnal adjustment at model t-steps - tsflw (:) = tsfa(:) - - ! Radiation fluxes for other physics processes - sfcdlw(:) = sfcflw(:)%dnfxc - sfculw(:) = sfcflw(:)%upfxc - - ! Heating-rate at radiation timestep, used for adjustment between radiation calls. - htrlwu = htrlw - - ! ####################################################################################### - ! Save LW diagnostics - ! - For time averaged output quantities (including total-sky and clear-sky SW and LW - ! fluxes at TOA and surface; conventional 3-domain cloud amount, cloud top and base - ! pressure, and cloud top temperature; aerosols AOD, etc.), store computed results in - ! corresponding slots of array fluxr with appropriate time weights. - ! - Collect the fluxr data for wrtsfc - ! ####################################################################################### - if (save_diag) then - do i=1,nCol - ! LW all-sky fluxes - fluxr(i,1 ) = fluxr(i,1 ) + fhlwr * fluxlwUP_allsky( i,iTOA) ! total sky top lw up - fluxr(i,19) = fluxr(i,19) + fhlwr * fluxlwDOWN_allsky(i,iSFC) ! total sky sfc lw dn - fluxr(i,20) = fluxr(i,20) + fhlwr * fluxlwUP_allsky( i,iSFC) ! total sky sfc lw up - ! LW clear-sky fluxes - fluxr(i,28) = fluxr(i,28) + fhlwr * fluxlwUP_clrsky( i,iTOA) ! clear sky top lw up - fluxr(i,30) = fluxr(i,30) + fhlwr * fluxlwDOWN_clrsky(i,iSFC) ! clear sky sfc lw dn - fluxr(i,33) = fluxr(i,33) + fhlwr * fluxlwUP_clrsky( i,iSFC) ! clear sky sfc lw up - enddo - - ! Save cld frac,toplyr,botlyr and top temp, note that the order of h,m,l cloud is reversed for - ! the fluxr output. save interface pressure (pa) of top/bot - do j = 1, 3 - do i = 1, nCol - tem0d = raddt * cldsa(i,j) - itop = mtopa(i,j) - ibtc = mbota(i,j) - - ! Add optical depth and emissivity output - tem2 = 0. - do k=ibtc,itop - tem2 = tem2 + cldtaulw(i,k) ! approx 10. mu channel - enddo - fluxr(i,46-j) = fluxr(i,46-j) + tem0d * (1.0-exp(-tem2)) - enddo - enddo - endif - endif - ! ####################################################################################### - ! ####################################################################################### - ! ####################################################################################### - ! ####################################################################################### - ! ####################################################################################### - ! ####################################################################################### - if (doSWRad) then - if (nDay .gt. 0) then - ! ################################################################################# - ! Compute SW heating-rates - ! ################################################################################# - - ! Clear-sky heating-rate (optional) - if (do_sw_clrsky_hr) then - htrswc(:,:) = 0._kind_phys - call check_error_msg('GFS_rrtmgp_post',compute_heating_rate( & - fluxswUP_clrsky(idxday(1:nDay),:), & ! IN - Shortwave upward clear-sky flux profiles (W/m2) - fluxswDOWN_clrsky(idxday(1:nDay),:), & ! IN - Shortwave downward clear-sky flux profiles (W/m2) - p_lev(idxday(1:nDay),:), & ! IN - Pressure at model-interface (Pa) - thetaTendClrSky)) ! OUT - Clear-sky heating-rate (K/sec) - htrswc(idxday(1:nDay),:)=thetaTendClrSky !**NOTE** GP doesn't use radiation levels, it uses the model fields. Not sure if this is necessary - endif - - ! All-sky heating-rate (mandatory) - htrsw(:,:) = 0._kind_phys - call check_error_msg('GFS_rrtmgp_post',compute_heating_rate( & - fluxswUP_allsky(idxday(1:nDay),:), & ! IN - Shortwave upward all-sky flux profiles (W/m2) - fluxswDOWN_allsky(idxday(1:nDay),:), & ! IN - Shortwave downward all-sky flux profiles (W/m2) - p_lev(idxday(1:nDay),:), & ! IN - Pressure at model-interface (Pa) - thetaTendAllSky)) ! OUT - All-sky heating-rate (K/sec) - htrsw(idxday(1:nDay),:) = thetaTendAllSky - - ! ################################################################################# - ! Save SW outputs - ! (Copy fluxes from RRTMGP types into model radiation types.) - ! ################################################################################# - - ! TOA fluxes - topfsw(:)%upfxc = fluxswUP_allsky(:,iTOA) - topfsw(:)%upfx0 = fluxswUP_clrsky(:,iTOA) - topfsw(:)%dnfxc = fluxswDOWN_allsky(:,iTOA) - - ! Surface fluxes - sfcfsw(:)%upfxc = fluxswUP_allsky(:,iSFC) - sfcfsw(:)%upfx0 = fluxswUP_clrsky(:,iSFC) - sfcfsw(:)%dnfxc = fluxswDOWN_allsky(:,iSFC) - sfcfsw(:)%dnfx0 = fluxswDOWN_clrsky(:,iSFC) - - ! Surface down and up spectral component fluxes - ! - Save two spectral bands' surface downward and upward fluxes for output. - do i=1,nCol - nirbmdi(i) = scmpsw(i)%nirbm - nirdfdi(i) = scmpsw(i)%nirdf - visbmdi(i) = scmpsw(i)%visbm - visdfdi(i) = scmpsw(i)%visdf - nirbmui(i) = scmpsw(i)%nirbm * sfc_alb_nir_dir(i) - nirdfui(i) = scmpsw(i)%nirdf * sfc_alb_nir_dif(i) - visbmui(i) = scmpsw(i)%visbm * sfc_alb_uvvis_dir(i) - visdfui(i) = scmpsw(i)%visdf * sfc_alb_uvvis_dif(i) - enddo - else ! if_nday_block - ! ################################################################################# - ! Dark everywhere - ! ################################################################################# - htrsw(:,:) = 0.0 - sfcfsw = sfcfsw_type( 0.0, 0.0, 0.0, 0.0 ) - topfsw = topfsw_type( 0.0, 0.0, 0.0 ) - do i=1,nCol - nirbmdi(i) = 0.0 - nirdfdi(i) = 0.0 - visbmdi(i) = 0.0 - visdfdi(i) = 0.0 - nirbmui(i) = 0.0 - nirdfui(i) = 0.0 - visbmui(i) = 0.0 - visdfui(i) = 0.0 - enddo - - if (do_sw_clrsky_hr) then - htrswc(:,:) = 0 - endif - endif ! end_if_nday - - ! Radiation fluxes for other physics processes - do i=1,nCol - sfcnsw(i) = sfcfsw(i)%dnfxc - sfcfsw(i)%upfxc - sfcdsw(i) = sfcfsw(i)%dnfxc - enddo - - ! ################################################################################# - ! Save SW diagnostics - ! - For time averaged output quantities (including total-sky and clear-sky SW and LW - ! fluxes at TOA and surface; conventional 3-domain cloud amount, cloud top and base - ! pressure, and cloud top temperature; aerosols AOD, etc.), store computed results in - ! corresponding slots of array fluxr with appropriate time weights. - ! - Collect the fluxr data for wrtsfc - ! ################################################################################# - if (save_diag) then - do i=1,nCol - fluxr(i,34) = aerodp(i,1) ! total aod at 550nm - fluxr(i,35) = aerodp(i,2) ! DU aod at 550nm - fluxr(i,36) = aerodp(i,3) ! BC aod at 550nm - fluxr(i,37) = aerodp(i,4) ! OC aod at 550nm - fluxr(i,38) = aerodp(i,5) ! SU aod at 550nm - fluxr(i,39) = aerodp(i,6) ! SS aod at 550nm - if (coszen(i) > 0.) then - ! SW all-sky fluxes - tem0d = fhswr * coszdg(i) / coszen(i) - fluxr(i,2 ) = fluxr(i,2) + topfsw(i)%upfxc * tem0d ! total sky top sw up - fluxr(i,3 ) = fluxr(i,3) + sfcfsw(i)%upfxc * tem0d - fluxr(i,4 ) = fluxr(i,4) + sfcfsw(i)%dnfxc * tem0d ! total sky sfc sw dn - ! SW uv-b fluxes - fluxr(i,21) = fluxr(i,21) + scmpsw(i)%uvbfc * tem0d ! total sky uv-b sw dn - fluxr(i,22) = fluxr(i,22) + scmpsw(i)%uvbf0 * tem0d ! clear sky uv-b sw dn - ! SW TOA incoming fluxes - fluxr(i,23) = fluxr(i,23) + topfsw(i)%dnfxc * tem0d ! top sw dn - ! SW SFC flux components - fluxr(i,24) = fluxr(i,24) + visbmdi(i) * tem0d ! uv/vis beam sw dn - fluxr(i,25) = fluxr(i,25) + visdfdi(i) * tem0d ! uv/vis diff sw dn - fluxr(i,26) = fluxr(i,26) + nirbmdi(i) * tem0d ! nir beam sw dn - fluxr(i,27) = fluxr(i,27) + nirdfdi(i) * tem0d ! nir diff sw dn - ! SW clear-sky fluxes - fluxr(i,29) = fluxr(i,29) + topfsw(i)%upfx0 * tem0d - fluxr(i,31) = fluxr(i,31) + sfcfsw(i)%upfx0 * tem0d - fluxr(i,32) = fluxr(i,32) + sfcfsw(i)%dnfx0 * tem0d - endif - enddo - - ! Save total and boundary-layer clouds - do i=1,nCol - fluxr(i,17) = fluxr(i,17) + raddt * cldsa(i,4) - fluxr(i,18) = fluxr(i,18) + raddt * cldsa(i,5) - enddo - - ! Save cld frac,toplyr,botlyr and top temp, note that the order of h,m,l cloud - ! is reversed for the fluxr output. save interface pressure (pa) of top/bot - do j = 1, 3 - do i = 1, nCol - tem0d = raddt * cldsa(i,j) - itop = mtopa(i,j) - ibtc = mbota(i,j) - fluxr(i, 8-j) = fluxr(i, 8-j) + tem0d - fluxr(i,11-j) = fluxr(i,11-j) + tem0d * p_lev(i,itop) - fluxr(i,14-j) = fluxr(i,14-j) + tem0d * p_lev(i,ibtc) - fluxr(i,17-j) = fluxr(i,17-j) + tem0d * p_lev(i,itop) - - ! Add optical depth and emissivity output - tem1 = 0. - do k=ibtc,itop - tem1 = tem1 + cldtausw(i,k) ! approx .55 mu channel - enddo - fluxr(i,43-j) = fluxr(i,43-j) + tem0d * tem1 - enddo - enddo - endif - endif - - end subroutine GFS_rrtmgp_post_run -end module GFS_rrtmgp_post diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta index 7af8e04d56..1e329c4c65 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta @@ -3,7 +3,7 @@ type = scheme relative_path = ../../ dependencies = tools/funcphys.f90,hooks/machine.F,Radiation/radiation_aerosols.f,photochem/module_ozphys.F90 - dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_gases.f,Radiation/radiation_tools.F90 + dependencies = Radiation/RRTMG/iounitdef.f,Radiation/radiation_astronomy.f,Radiation/radiation_gases.f,Radiation/radiation_tools.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta index bbd698d66e..df41686570 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta @@ -4,7 +4,7 @@ relative_path = ../../ dependencies = hooks/machine.F,MP/module_mp_radar.F90,MP/Thompson/module_mp_thompson.F90 dependencies = Radiation/radiation_aerosols.f,photochem/module_ozphys.F90 - dependencies = Radiation/radiation_gases.f,Radiation/radiation_astronomy.f + dependencies = Radiation/radiation_gases.f,Radiation/RRTMG/iounitdef.f,Radiation/radiation_astronomy.f ######################################################################## [ccpp-arg-table] diff --git a/physics/docs/pdftxt/GFS_RRTMG.txt b/physics/docs/pdftxt/GFS_RRTMG.txt index 13625d223c..cf206d9308 100644 --- a/physics/docs/pdftxt/GFS_RRTMG.txt +++ b/physics/docs/pdftxt/GFS_RRTMG.txt @@ -110,7 +110,7 @@ Summary of the major changes: + \b rrtmg_lw_pre: \ref arg_table_rrtmg_lw_pre_run + \b rrtmg_lw: \ref arg_table_rrtmg_lw_run + \b rrtmg_lw_post: \ref arg_table_rrtmg_lw_post_run -+ \b GFS_rrtmg_post: \ref arg_table_GFS_rrtmg_post_run ++ \b GFS_radiation_post: \ref arg_table_GFS_radiation_post_run \section gen_al_rrtmg General Algorithm + \ref gen_lwrad diff --git a/physics/docs/pdftxt/GFS_RRTMGP.txt b/physics/docs/pdftxt/GFS_RRTMGP.txt index 44e8b1bb27..b42a832573 100644 --- a/physics/docs/pdftxt/GFS_RRTMGP.txt +++ b/physics/docs/pdftxt/GFS_RRTMGP.txt @@ -80,7 +80,7 @@ + \b GFS RRTMGP aerosol interface: \ref arg_table_rrtmgp_aerosol_optics_run + \b GFS RRTMGP-Longwave radiation driver: \ref arg_table_rrtmgp_lw_main_run + \b GFS RRTMGP-Shortwave radiation driver: \ref arg_table_rrtmgp_sw_main_run - + \b GFS RRTMGP post-processing, for both Longwave and Shortwave: \ref arg_table_GFS_rrtmgp_post_run + + \b GFS RRTMGP post-processing, for both Longwave and Shortwave: \ref arg_table_GFS_radiation_post_run */