Skip to content

Commit

Permalink
Alebdos (nIR and uvvis) are being averaged in rrtmg, did same in rrtm…
Browse files Browse the repository at this point in the history
…gp. Sneaky
  • Loading branch information
dustinswales committed Dec 11, 2019
1 parent ac6d7a5 commit ddebe45
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
18 changes: 9 additions & 9 deletions physics/rrtmgp_sw_gas_optics.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module rrtmgp_sw_gas_optics
use machine, only: kind_phys
use GFS_typedefs, only: GFS_control_type, GFS_interstitial_type
use GFS_typedefs, only: GFS_control_type
use module_radiation_gases, only: NF_VGAS
use mo_rte_kind, only: wl
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
Expand Down Expand Up @@ -405,15 +405,13 @@ end subroutine rrtmgp_sw_gas_optics_init
!! \section arg_table_rrtmgp_sw_gas_optics_run
!! \htmlinclude rrtmgp_sw_gas_optics.html
!!
subroutine rrtmgp_sw_gas_optics_run(Model, Interstitial, sw_gas_props, ncol, nday, idxday,&
p_lay, p_lev, t_lay, t_lev, gas_concentrations, lsswr, solcon, &
sw_optical_props_clrsky, errmsg, errflg)
subroutine rrtmgp_sw_gas_optics_run(Model, sw_gas_props, ncol, nday, idxday, p_lay, p_lev,&
toa_src_sw, t_lay, t_lev, gas_concentrations, lsswr, solcon, sw_optical_props_clrsky,&
errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Model ! DDT: FV3-GFS model control parameters
type(GFS_Interstitial_type),intent(inout) :: &
Interstitial ! DDT: FV3-GFS Interstitial arrays
type(ty_gas_optics_rrtmgp),intent(in) :: &
sw_gas_props ! RRTMGP DDT: spectral information for RRTMGP SW radiation scheme
integer,intent(in) :: &
Expand Down Expand Up @@ -441,6 +439,8 @@ subroutine rrtmgp_sw_gas_optics_run(Model, Interstitial, sw_gas_props, ncol, nda
errflg ! Error code
type(ty_optical_props_2str),intent(out) :: &
sw_optical_props_clrsky ! RRTMGP DDT: clear-sky shortwave optical properties, spectral (tau,ssa,g)
real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(out) :: &
toa_src_sw ! TOA incident spectral flux (W/m2)

! Local variables
integer :: ij,iGas
Expand Down Expand Up @@ -476,11 +476,11 @@ subroutine rrtmgp_sw_gas_optics_run(Model, Interstitial, sw_gas_props, ncol, nda
sw_optical_props_clrsky, & ! OUT - RRTMGP DDT: Shortwave optical properties, by
! spectral point (tau,ssa,g)
toa_src_sw_temp)) ! OUT - TOA incident shortwave radiation (spectral)
Interstitial%toa_src_sw(idxday(1:nday),:) = toa_src_sw_temp
toa_src_sw(idxday(1:nday),:) = toa_src_sw_temp
! Scale incident flux
do ij=1,nday
Interstitial%toa_src_sw(idxday(ij),:) = Interstitial%toa_src_sw(idxday(ij),:)*solcon/ &
sum(Interstitial%toa_src_sw(idxday(ij),:))
toa_src_sw(idxday(ij),:) = toa_src_sw(idxday(ij),:)*solcon/ &
sum(toa_src_sw(idxday(ij),:))
enddo
endif

Expand Down
17 changes: 9 additions & 8 deletions physics/rrtmgp_sw_gas_optics.meta
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@
type = GFS_control_type
intent = in
optional = F
[Interstitial]
standard_name = GFS_interstitial_type_instance
long_name = derived type GFS_interstitial_type in FV3
units = DDT
dimensions = ()
type = GFS_interstitial_type
intent = inout
optional = F
[sw_gas_props]
standard_name = coefficients_for_sw_gas_optics
long_name = DDT containing spectral information for RRTMGP SW radiation scheme
Expand Down Expand Up @@ -119,6 +111,15 @@
type = integer
intent = in
optional = F
[toa_src_sw]
standard_name = toa_incident_sw_flux_by_spectral_point
long_name = TOA shortwave incident flux at each spectral points
units = W m-2
dimensions = (horizontal_dimension,number_of_sw_spectral_points_rrtmgp)
type = real
kind = kind_phys
intent = out
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
long_name = air pressure layer
Expand Down
14 changes: 10 additions & 4 deletions physics/rrtmgp_sw_rte.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ subroutine rrtmgp_sw_rte_run(Model, Radtend, Statein, ncol, sw_gas_props, p_lay,
! visdf - downward uv+vis diffused flux (W/m2)

! Local variables
real(kind_phys), dimension(sw_gas_props%get_nband(),nday) :: &
sfc_alb_dir,sfc_alb_dif
type(ty_fluxes_byband) :: &
flux_allsky, & ! All-sky flux (W/m2)
flux_clrsky ! Clear-sky flux (W/m2)
Expand Down Expand Up @@ -154,6 +156,10 @@ subroutine rrtmgp_sw_rte_run(Model, Radtend, Statein, ncol, sw_gas_props, p_lay,
flux_clrsky%bnd_flux_up => fluxSW_up_clrsky
flux_clrsky%bnd_flux_dn => fluxSW_dn_clrsky

! In RRTMG, the near-IR and uv-visible surface albedos are averaged.
sfc_alb_dir = 0.5_kind_phys*(sfc_alb_nir_dir(:,idxday(1:nday)) + sfc_alb_uvvis_dir(:,idxday(1:nday)))
sfc_alb_dif = 0.5_kind_phys*(sfc_alb_nir_dif(:,idxday(1:nday)) + sfc_alb_uvvis_dif(:,idxday(1:nday)))

! Compute clear-sky fluxes (if requested)
! Clear-sky fluxes (gas+aerosol)
call check_error_msg('rrtmgp_sw_rte_run',sw_optical_props_aerosol%increment(sw_optical_props_clrsky))
Expand All @@ -165,8 +171,8 @@ subroutine rrtmgp_sw_rte_run(Model, Radtend, Statein, ncol, sw_gas_props, p_lay,
top_at_1, & ! IN - veritcal ordering flag
Radtend%coszen(idxday(1:nday)), & ! IN - Cosine of solar zenith angle
toa_src_sw(idxday(1:nday),:), & ! IN - incident solar flux at TOA
sfc_alb_nir_dir(:,idxday(1:nday)), & ! IN - Shortwave surface albedo (direct)
sfc_alb_nir_dif(:,idxday(1:nday)), & ! IN - Shortwave surface albedo (diffuse)
sfc_alb_dir, & ! IN - Shortwave surface albedo (direct)
sfc_alb_dif, & ! IN - Shortwave surface albedo (diffuse)
flux_clrsky)) ! OUT - Fluxes, clear-sky, 3D (nCol,Model%levs,nBand)
! Store fluxes
fluxswUP_clrsky(idxday(1:nday),:) = sum(flux_clrsky%bnd_flux_up,dim=3)
Expand All @@ -183,8 +189,8 @@ subroutine rrtmgp_sw_rte_run(Model, Radtend, Statein, ncol, sw_gas_props, p_lay,
top_at_1, & ! IN - veritcal ordering flag
Radtend%coszen(idxday(1:nday)), & ! IN - Cosine of solar zenith angle
toa_src_sw(idxday(1:nday),:), & ! IN - incident solar flux at TOA
sfc_alb_nir_dir(:,idxday(1:nday)), & ! IN - Shortwave surface albedo (direct)
sfc_alb_nir_dif(:,idxday(1:nday)), & ! IN - Shortwave surface albedo (diffuse)
sfc_alb_dir, & ! IN - Shortwave surface albedo (direct)
sfc_alb_dif, & ! IN - Shortwave surface albedo (diffuse)
flux_allsky)) ! OUT - Fluxes, clear-sky, 3D (nCol,Model%levs,nBand)
! Store fluxes
fluxswUP_allsky(idxday(1:nday),:) = sum(flux_allsky%bnd_flux_up,dim=3)
Expand Down
2 changes: 1 addition & 1 deletion physics/rrtmgp_sw_rte.meta
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
optional = F
[toa_src_sw]
standard_name = toa_incident_sw_flux_by_spectral_point
long_name = TOA shortwave incident flux at each spectral points (Radtend%toa_src_sw)
long_name = TOA shortwave incident flux at each spectral points
units = W m-2
dimensions = (horizontal_dimension,number_of_sw_spectral_points_rrtmgp)
type = real
Expand Down

0 comments on commit ddebe45

Please sign in to comment.