Skip to content

Commit

Permalink
Moved some interstitial firelds out of GFS_interstitial_type into fla…
Browse files Browse the repository at this point in the history
…t fields.
  • Loading branch information
dustinswales committed Dec 11, 2019
1 parent b16c6c7 commit ac6d7a5
Show file tree
Hide file tree
Showing 10 changed files with 210 additions and 103 deletions.
9 changes: 4 additions & 5 deletions physics/GFS_rrtmgp_lw_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module GFS_rrtmgp_lw_pre
GFS_sfcprop_type, & ! Surface fields
GFS_grid_type, & ! Grid and interpolation related data
GFS_statein_type, & !
GFS_Interstitial_type, & !
GFS_radtend_type ! Radiation tendencies needed in physics
use module_radiation_surface, only: &
setemis ! Routine to compute surface-emissivity
Expand Down Expand Up @@ -36,7 +35,7 @@ end subroutine GFS_rrtmgp_lw_pre_init
!! \htmlinclude GFS_rrtmgp_lw_pre.html
!!
subroutine GFS_rrtmgp_lw_pre_run (Model, Grid, Sfcprop, Statein, ncol, p_lay, p_lev, &
tv_lay, relhum, tracer, lw_gas_props, Radtend, Interstitial, aerosolslw, aerodp, &
tv_lay, relhum, tracer, lw_gas_props, Radtend, aerosolslw, aerodp, sfc_emiss_byband, &
errmsg, errflg)

! Inputs
Expand Down Expand Up @@ -64,12 +63,12 @@ subroutine GFS_rrtmgp_lw_pre_run (Model, Grid, Sfcprop, Statein, ncol, p_lay,
! Outputs
type(GFS_radtend_type), intent(inout) :: &
Radtend ! DDT: FV3-GFS radiation tendencies
type(GFS_interstitial_type), intent(inout) :: &
Interstitial ! DDT: FV3-GFS Interstitial arrays
real(kind_phys), dimension(ncol,Model%levs,lw_gas_props%get_nband(),NF_AELW), intent(out) ::&
aerosolslw ! Aerosol radiative properties in each SW band.
real(kind_phys), dimension(ncol,NSPC1), intent(inout) :: &
aerodp ! Vertical integrated optical depth for various aerosol species
real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(out) :: &
sfc_emiss_byband ! Surface emissivity in each band
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
Expand All @@ -93,7 +92,7 @@ subroutine GFS_rrtmgp_lw_pre_run (Model, Grid, Sfcprop, Statein, ncol, p_lay,

! Assign same emissivity to all bands
do iBand=1,lw_gas_props%get_nband()
Interstitial%sfc_emiss_byband(iBand,1:NCOL) = Radtend%semis(1:NCOL)
sfc_emiss_byband(iBand,1:NCOL) = Radtend%semis(1:NCOL)
enddo

! #######################################################################################
Expand Down
17 changes: 9 additions & 8 deletions physics/GFS_rrtmgp_lw_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,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
[Grid]
standard_name = GFS_grid_type_instance
long_name = instance of derived type GFS_grid_type
Expand Down Expand Up @@ -128,6 +120,15 @@
kind = kind_phys
intent = out
optional = F
[sfc_emiss_byband]
standard_name = surface_emissivity_in_each_RRTMGP_LW_band
long_name = surface emissivity in each RRTMGP LW band
units = none
dimensions = (number_of_lw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
27 changes: 15 additions & 12 deletions physics/GFS_rrtmgp_sw_post.F90
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module GFS_rrtmgp_sw_post
use machine, only: kind_phys
use GFS_typedefs, only: GFS_coupling_type, GFS_control_type, GFS_grid_type, &
GFS_radtend_type, GFS_diag_type, GFS_statein_type, &
GFS_interstitial_type
GFS_radtend_type, GFS_diag_type, GFS_statein_type
use module_radiation_aerosols, only: NSPC1
use module_radsw_parameters, only: topfsw_type, sfcfsw_type, profsw_type, cmpfsw_type
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
Expand All @@ -27,16 +26,15 @@ end subroutine GFS_rrtmgp_sw_post_init
!> \section arg_table_GFS_rrtmgp_sw_post_run
!! \htmlinclude GFS_rrtmgp_sw_post.html
!!
subroutine GFS_rrtmgp_sw_post_run (Model, Interstitial, Grid, Diag, Radtend, Coupling, &
Statein, scmpsw, nCol, p_lev, sw_gas_props, nday, idxday, fluxswUP_allsky, &
fluxswDOWN_allsky, fluxswUP_clrsky, fluxswDOWN_clrsky, raddt, aerodp, cldsa, mbota, &
mtopa, cld_frac, cldtausw, flxprf_sw, hsw0, errmsg, errflg)
subroutine GFS_rrtmgp_sw_post_run (Model, Grid, Diag, Radtend, Coupling, Statein, scmpsw, &
nCol, p_lev, sfc_alb_nir_dir, sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, &
sw_gas_props, nday, idxday, fluxswUP_allsky, fluxswDOWN_allsky, fluxswUP_clrsky, &
fluxswDOWN_clrsky, raddt, aerodp, cldsa, mbota, mtopa, cld_frac, cldtausw, flxprf_sw,&
hsw0, errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Model ! Fortran DDT: FV3-GFS model control parameters
type(GFS_Interstitial_type), intent(in) :: &
Interstitial ! Fortran DDT: FV3-GFS interstitial arrays
type(GFS_grid_type), intent(in) :: &
Grid ! Fortran DDT: FV3-GFS grid and interpolation related data
type(GFS_coupling_type), intent(inout) :: &
Expand All @@ -56,6 +54,11 @@ subroutine GFS_rrtmgp_sw_post_run (Model, Interstitial, Grid, Diag, Radtend, Cou
sw_gas_props ! DDT containing SW spectral information
real(kind_phys), dimension(nCol, Model%levs+1), intent(in) :: &
p_lev ! Pressure @ model layer-interfaces (hPa)
real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: &
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(nCol, Model%levs+1), intent(in) :: &
fluxswUP_allsky, & ! SW All-sky flux (W/m2)
fluxswDOWN_allsky, & ! SW All-sky flux (W/m2)
Expand Down Expand Up @@ -190,10 +193,10 @@ subroutine GFS_rrtmgp_sw_post_run (Model, Interstitial, Grid, Diag, Radtend, Cou
Coupling%visbmdi(i) = scmpsw(i)%visbm
Coupling%visdfdi(i) = scmpsw(i)%visdf

Coupling%nirbmui(i) = scmpsw(i)%nirbm * Interstitial%sfc_alb_nir_dir(1,i)
Coupling%nirdfui(i) = scmpsw(i)%nirdf * Interstitial%sfc_alb_nir_dif(1,i)
Coupling%visbmui(i) = scmpsw(i)%visbm * Interstitial%sfc_alb_uvvis_dir(1,i)
Coupling%visdfui(i) = scmpsw(i)%visdf * Interstitial%sfc_alb_uvvis_dif(1,i)
Coupling%nirbmui(i) = scmpsw(i)%nirbm * sfc_alb_nir_dir(1,i)
Coupling%nirdfui(i) = scmpsw(i)%nirdf * sfc_alb_nir_dif(1,i)
Coupling%visbmui(i) = scmpsw(i)%visbm * sfc_alb_uvvis_dir(1,i)
Coupling%visdfui(i) = scmpsw(i)%visdf * sfc_alb_uvvis_dif(1,i)
enddo
else ! if_nday_block
! #######################################################################################
Expand Down
44 changes: 36 additions & 8 deletions physics/GFS_rrtmgp_sw_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,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 = in
optional = F
[Grid]
standard_name = GFS_grid_type_instance
long_name = instance of derived type GFS_grid_type
Expand Down Expand Up @@ -82,6 +74,42 @@
kind = kind_phys
intent = in
optional = F
[sfc_alb_nir_dir]
standard_name = surface_albedo_nearIR_direct
long_name = near-IR (direct) surface albedo (sfc_alb_nir_dir)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[sfc_alb_nir_dif]
standard_name = surface_albedo_nearIR_diffuse
long_name = near-IR (diffuse) surface albedo (sfc_alb_nir_dif)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[sfc_alb_uvvis_dir]
standard_name = surface_albedo_uvvis_dir
long_name = UVVIS (direct) surface albedo (sfc_alb_uvvis_dir)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[sfc_alb_uvvis_dif]
standard_name = surface_albedo_uvvis_dif
long_name = UVVIS (diffuse) surface albedo (sfc_alb_uvvis_dif)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[nday]
standard_name = daytime_points_dimension
long_name = daytime points dimension
Expand Down
22 changes: 13 additions & 9 deletions physics/GFS_rrtmgp_sw_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ end subroutine GFS_rrtmgp_sw_pre_init
!> \section arg_table_GFS_rrtmgp_sw_pre_run
!! \htmlinclude GFS_rrtmgp_sw_pre.html
!!
subroutine GFS_rrtmgp_sw_pre_run(Model, Interstitial, Grid, Sfcprop, Statein, ncol, p_lay,&
p_lev, tv_lay, relhum, tracer, sw_gas_props, nday, idxday, alb1d, RadTend, &
Coupling, aerosolssw, aerodp, errmsg, errflg)
subroutine GFS_rrtmgp_sw_pre_run(Model, Grid, Sfcprop, Statein, ncol, p_lay, p_lev, &
tv_lay, relhum, tracer, sw_gas_props, nday, idxday, alb1d, sfc_alb_nir_dir, &
sfc_alb_nir_dif, sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, RadTend, Coupling, aerosolssw,&
aerodp, errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Model ! DDT: FV3-GFS model control parameters
type(GFS_Interstitial_type),intent(inout) :: &
Interstitial
type(GFS_grid_type), intent(in) :: &
Grid ! DDT: FV3-GFS grid and interpolation related data
type(GFS_sfcprop_type), intent(in) :: &
Expand All @@ -77,6 +76,11 @@ subroutine GFS_rrtmgp_sw_pre_run(Model, Interstitial, Grid, Sfcprop, Statein, nc
idxday ! Indices for daylit points
real(kind_phys), dimension(ncol), intent(out) :: &
alb1d ! Surface albedo pertubation
real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(out) :: &
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)
type(GFS_radtend_type), intent(inout) :: &
Radtend ! DDT: FV3-GFS radiation tendencies
type(GFS_coupling_type), intent(inout) :: &
Expand Down Expand Up @@ -149,10 +153,10 @@ subroutine GFS_rrtmgp_sw_pre_run(Model, Interstitial, Grid, Sfcprop, Statein, nc

! Spread across all SW bands
do iBand=1,sw_gas_props%get_nband()
Interstitial%sfc_alb_nir_dir(iBand,1:NCOL) = sfcalb(1:NCOL,1)
Interstitial%sfc_alb_nir_dif(iBand,1:NCOL) = sfcalb(1:NCOL,2)
Interstitial%sfc_alb_uvvis_dir(iBand,1:NCOL) = sfcalb(1:NCOL,3)
Interstitial%sfc_alb_uvvis_dif(iBand,1:NCOL) = sfcalb(1:NCOL,4)
sfc_alb_nir_dir(iBand,1:NCOL) = sfcalb(1:NCOL,1)
sfc_alb_nir_dif(iBand,1:NCOL) = sfcalb(1:NCOL,2)
sfc_alb_uvvis_dir(iBand,1:NCOL) = sfcalb(1:NCOL,3)
sfc_alb_uvvis_dif(iBand,1:NCOL) = sfcalb(1:NCOL,4)
enddo

! #######################################################################################
Expand Down
44 changes: 36 additions & 8 deletions physics/GFS_rrtmgp_sw_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,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
[Grid]
standard_name = GFS_grid_type_instance
long_name = instance of derived type GFS_grid_type
Expand Down Expand Up @@ -127,6 +119,42 @@
kind = kind_phys
intent = out
optional = F
[sfc_alb_nir_dir]
standard_name = surface_albedo_nearIR_direct
long_name = near-IR (direct) surface albedo (sfc_alb_nir_dir)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[sfc_alb_nir_dif]
standard_name = surface_albedo_nearIR_diffuse
long_name = near-IR (diffuse) surface albedo (sfc_alb_nir_dif)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[sfc_alb_uvvis_dir]
standard_name = surface_albedo_uvvis_dir
long_name = UVVIS (direct) surface albedo (sfc_alb_uvvis_dir)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[sfc_alb_uvvis_dif]
standard_name = surface_albedo_uvvis_dif
long_name = UVVIS (diffuse) surface albedo (sfc_alb_uvvis_dif)
units = none
dimensions = (number_of_sw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = out
optional = F
[nday]
standard_name = daytime_points_dimension
long_name = daytime points dimension
Expand Down
29 changes: 15 additions & 14 deletions physics/rrtmgp_lw_rte.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
! ###########################################################################################
module rrtmgp_lw_rte
use machine, only: kind_phys
use GFS_typedefs, only: GFS_control_type, GFS_interstitial_type, GFS_statein_type
use GFS_typedefs, only: GFS_control_type, GFS_statein_type
use mo_rte_kind, only: wl
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
use mo_cloud_optics, only: ty_cloud_optics
Expand All @@ -27,15 +27,14 @@ end subroutine rrtmgp_lw_rte_init
!! \section arg_table_rrtmgp_lw_rte_run
!! \htmlinclude rrtmgp_lw_rte.html
!!
subroutine rrtmgp_lw_rte_run(Model, Statein, Interstitial, ncol, lw_gas_props, p_lay, t_lay, p_lev, &
skt, sources, lw_optical_props_clrsky, lw_optical_props_clouds, lw_optical_props_aerosol, lslwr,&
fluxlwUP_allsky, fluxlwDOWN_allsky, fluxlwUP_clrsky, fluxlwDOWN_clrsky, hlw0, hlwb, errmsg, errflg)
subroutine rrtmgp_lw_rte_run(Model, Statein, ncol, lw_gas_props, p_lay, t_lay, p_lev, skt,&
sfc_emiss_byband, sources, lw_optical_props_clrsky, lw_optical_props_clouds, &
lw_optical_props_aerosol, lslwr, fluxlwUP_allsky, fluxlwDOWN_allsky, fluxlwUP_clrsky,&
fluxlwDOWN_clrsky, hlw0, hlwb, errmsg, errflg)

! Inputs
type(GFS_control_type), intent(in) :: &
Model ! Fortran DDT containing FV3-GFS model control parameters
type(GFS_Interstitial_type), intent(in) :: &
Interstitial ! Fortran DDT containing FV3-GFS radiation tendencies
type(GFS_statein_type), intent(in) :: &
Statein ! Fortran DDT containing FV3-GFS prognostic state data in from dycore
integer, intent(in) :: &
Expand All @@ -58,6 +57,8 @@ subroutine rrtmgp_lw_rte_run(Model, Statein, Interstitial, ncol, lw_gas_props, p
sources
logical, intent(in) :: &
lslwr ! Flag to calculate LW irradiances
real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(in) :: &
sfc_emiss_byband ! Surface emissivity in each band

! Outputs
character(len=*), intent(out) :: &
Expand Down Expand Up @@ -114,10 +115,10 @@ subroutine rrtmgp_lw_rte_run(Model, Statein, Interstitial, ncol, lw_gas_props, p
call check_error_msg('rrtmgp_lw_rte_run',lw_optical_props_aerosol%increment(lw_optical_props_clrsky))
if (l_ClrSky_HR) then
call check_error_msg('rrtmgp_lw_rte_run',rte_lw( &
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
Interstitial%sfc_emiss_byband, & ! IN - surface emissivity in each LW band
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_clrsky))
! Store fluxes
fluxlwUP_clrsky = sum(flux_clrsky%bnd_flux_up,dim=3)
Expand All @@ -128,10 +129,10 @@ subroutine rrtmgp_lw_rte_run(Model, Statein, Interstitial, ncol, lw_gas_props, p
! Clear-sky fluxes are (gas+aerosol)+clouds
call check_error_msg('rrtmgp_lw_rte_run',lw_optical_props_clouds%increment(lw_optical_props_clrsky))
call check_error_msg('rrtmgp_lw_rte_run',rte_lw( &
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
Interstitial%sfc_emiss_byband, & ! IN - surface emissivity in each LW band
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_allsky))
! Store fluxes
fluxlwUP_allsky = sum(flux_allsky%bnd_flux_up,dim=3)
Expand Down
17 changes: 9 additions & 8 deletions physics/rrtmgp_lw_rte.meta
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,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 = in
optional = F
[Statein]
standard_name = GFS_statein_type_instance
long_name = instance of derived type GFS_statein_type
Expand Down Expand Up @@ -69,6 +61,15 @@
kind = kind_phys
intent = in
optional = F
[sfc_emiss_byband]
standard_name = surface_emissivity_in_each_RRTMGP_LW_band
long_name = surface emissivity in each RRTMGP LW band
units = none
dimensions = (number_of_lw_bands_rrtmgp,horizontal_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[lw_gas_props]
standard_name = coefficients_for_lw_gas_optics
long_name = DDT containing spectral information for RRTMGP LW radiation scheme
Expand Down
Loading

0 comments on commit ac6d7a5

Please sign in to comment.