Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions schemes/rrtmgp/rrtmgp_lw_calculate_fluxes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module rrtmgp_lw_calculate_fluxes
!> \section arg_table_rrtmgp_lw_calculate_fluxes_run Argument Table
!! \htmlinclude rrtmgp_lw_calculate_fluxes_run.html
subroutine rrtmgp_lw_calculate_fluxes_run(num_diag_subcycles, icall, ncol, pverp, nlay, ktopcam, ktoprad, &
active_calls, flw, flwc, flns, flnt, flwds, fnl, fcnl, errmsg, errflg)
active_calls, dolw, flw, flwc, flns, flnt, flwds, fnl, fcnl, errmsg, errflg)

use ccpp_fluxes, only: ty_fluxes_broadband_ccpp
use ccpp_fluxes_byband, only: ty_fluxes_byband_ccpp
Expand All @@ -27,14 +27,15 @@ subroutine rrtmgp_lw_calculate_fluxes_run(num_diag_subcycles, icall, ncol, pverp
integer, intent(in) :: ktopcam ! Index in host model arrays of top level (layer or interface) at which RRTMGP is active
integer, intent(in) :: ktoprad ! Index in RRTMGP array corresponding to top layer or interface of host model arrays
logical, intent(in) :: active_calls(:) ! Logical array of flags for whether a specified subcycle is active
logical, intent(in) :: dolw ! Flag for whether to perform longwave calculation
type(ty_fluxes_byband_ccpp), intent(in) :: flw ! Longwave all-sky flux object
type(ty_fluxes_broadband_ccpp), intent(in) :: flwc ! Longwave clear-sky flux object
! Output variables
real(kind_phys), intent(out) :: fnl(:,:) ! Longwave net radiative flux [W m-2]
real(kind_phys), intent(out) :: fcnl(:,:) ! Longwave net radiative clear-sky flux [W m-2]
real(kind_phys), intent(out) :: flns(:) ! Longwave net upward flux at surface [W m-2]
real(kind_phys), intent(out) :: flnt(:) ! Longwave net outgoing flux at model top [W m-2]
real(kind_phys), intent(out) :: flwds(:) ! Longwave downward radiative flux at surface [W m-2]
real(kind_phys), intent(inout) :: fnl(:,:) ! Longwave net radiative flux [W m-2]
real(kind_phys), intent(inout) :: fcnl(:,:) ! Longwave net radiative clear-sky flux [W m-2]
real(kind_phys), intent(inout) :: flns(:) ! Longwave net upward flux at surface [W m-2]
real(kind_phys), intent(inout) :: flnt(:) ! Longwave net outgoing flux at model top [W m-2]
real(kind_phys), intent(inout) :: flwds(:) ! Longwave downward radiative flux at surface [W m-2]


! CCPP error handling variables
Expand All @@ -47,6 +48,11 @@ subroutine rrtmgp_lw_calculate_fluxes_run(num_diag_subcycles, icall, ncol, pverp
errmsg = ''
errflg = 0

! Persist fluxes from the last radiation timestep in non-radiation timesteps:
if (.not. dolw) then
return
end if

diag_index = num_diag_subcycles - icall + 1

! Don't do anything if this subcycle is inactive
Expand Down
18 changes: 12 additions & 6 deletions schemes/rrtmgp/rrtmgp_lw_calculate_fluxes.meta
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
type = logical
dimensions = (number_of_diagnostic_subcycles)
intent = in
[ dolw ]
standard_name = do_longwave_radiation
units = flag
type = logical
dimensions = ()
intent = in
[ flw ]
standard_name = longwave_all_sky_flux_object_for_RRTMGP
units = none
Expand All @@ -70,31 +76,31 @@
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ flnt ]
standard_name = longwave_net_outgoing_flux_at_model_top
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ flwds ]
standard_name = longwave_downward_radiative_flux_at_surface
standard_name = longwave_downward_radiative_flux_at_surface_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ fnl ]
standard_name = longwave_net_radiative_flux
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = out
intent = inout
[ fcnl ]
standard_name = longwave_net_radiative_clear_sky_flux
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = out
intent = inout
[ errmsg ]
standard_name = ccpp_error_message
units = none
Expand Down
4 changes: 2 additions & 2 deletions schemes/rrtmgp/rrtmgp_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
dimensions = ()
intent = inout
[ flwds ]
standard_name = longwave_downward_radiative_flux_at_surface
standard_name = longwave_downward_radiative_flux_at_surface_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
Expand All @@ -126,7 +126,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
intent = out
[ netsw ]
standard_name = net_shortwave_flux_at_surface
standard_name = net_shortwave_flux_at_surface_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
Expand Down
24 changes: 15 additions & 9 deletions schemes/rrtmgp/rrtmgp_sw_calculate_fluxes.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module rrtmgp_sw_calculate_fluxes
!> \section arg_table_rrtmgp_sw_calculate_fluxes_run Argument Table
!! \htmlinclude rrtmgp_sw_calculate_fluxes_run.html
subroutine rrtmgp_sw_calculate_fluxes_run(num_diag_subcycles, icall, ncol, pverp, nlay, nday, idxday, ktopcam, ktoprad, &
active_calls, fsw, fswc, fns, fcns, fsns, fsnt, soll, sols, solld, solsd, errmsg, errflg)
active_calls, dosw, fsw, fswc, fns, fcns, fsns, fsnt, soll, sols, solld, solsd, errmsg, errflg)

use ccpp_fluxes, only: ty_fluxes_broadband_ccpp
use ccpp_fluxes_byband, only: ty_fluxes_byband_ccpp
Expand All @@ -29,17 +29,18 @@ subroutine rrtmgp_sw_calculate_fluxes_run(num_diag_subcycles, icall, ncol, pverp
integer, intent(in) :: ktoprad ! Index in RRTMGP array corresponding to top layer or interface of host model arrays
integer, intent(in) :: idxday(:) ! Daytime points indices
logical, intent(in) :: active_calls(:) ! Logical array of flags for whether a specified subcycle is active
logical, intent(in) :: dosw ! Flag for whether to perform shortwave calculation
type(ty_fluxes_byband_ccpp), intent(in) :: fsw ! Shortwave all-sky flux object
type(ty_fluxes_broadband_ccpp), intent(in) :: fswc ! Shortwave clear-sky flux object
! Output variables
real(kind_phys), intent(out) :: fns(:,:) ! Shortwave net radiative flux [W m-2]
real(kind_phys), intent(out) :: fcns(:,:) ! Shortwave net radiative clear-sky flux [W m-2]
real(kind_phys), intent(out) :: fsns(:) ! Shortwave net upward flux at surface [W m-2]
real(kind_phys), intent(out) :: fsnt(:) ! Shortwave net outgoing flux at model top [W m-2]
real(kind_phys), intent(out) :: soll(:) ! Direct solar radiative flux at surface >= 700nm [W m-2]
real(kind_phys), intent(out) :: sols(:) ! Direct solar radiative flux at surface < 700nm [W m-2]
real(kind_phys), intent(out) :: solld(:) ! Diffuse solar radiative flux at surface >= 700nm [W m-2]
real(kind_phys), intent(out) :: solsd(:) ! Diffuse solar radiative flux at surface < 700nm [W m-2]
real(kind_phys), intent(inout) :: fns(:,:) ! Shortwave net radiative flux [W m-2]
real(kind_phys), intent(inout) :: fcns(:,:) ! Shortwave net radiative clear-sky flux [W m-2]
real(kind_phys), intent(inout) :: fsns(:) ! Shortwave net upward flux at surface [W m-2]
real(kind_phys), intent(inout) :: fsnt(:) ! Shortwave net outgoing flux at model top [W m-2]
real(kind_phys), intent(inout) :: soll(:) ! Direct solar radiative flux at surface >= 700nm [W m-2]
real(kind_phys), intent(inout) :: sols(:) ! Direct solar radiative flux at surface < 700nm [W m-2]
real(kind_phys), intent(inout) :: solld(:) ! Diffuse solar radiative flux at surface >= 700nm [W m-2]
real(kind_phys), intent(inout) :: solsd(:) ! Diffuse solar radiative flux at surface < 700nm [W m-2]


! CCPP error handling variables
Expand All @@ -55,6 +56,11 @@ subroutine rrtmgp_sw_calculate_fluxes_run(num_diag_subcycles, icall, ncol, pverp
errmsg = ''
errflg = 0

! Persist fluxes from the last radiation timestep in non-radiation timesteps:
if (.not. dosw) then
return
end if

diag_index = num_diag_subcycles - icall + 1

! Don't do anything if this subcycle is inactive
Expand Down
22 changes: 14 additions & 8 deletions schemes/rrtmgp/rrtmgp_sw_calculate_fluxes.meta
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
type = logical
dimensions = (number_of_diagnostic_subcycles)
intent = in
[ dosw ]
standard_name = do_shortwave_radiation
units = flag
type = logical
dimensions = ()
intent = in
[ fsw ]
standard_name = shortwave_all_sky_flux_object_for_RRTMGP
units = none
Expand All @@ -82,49 +88,49 @@
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = out
intent = inout
[ fcns ]
standard_name = shortwave_net_radiative_clear_sky_flux
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent, vertical_interface_dimension)
intent = out
intent = inout
[ fsns ]
standard_name = shortwave_net_upward_flux_at_surface
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ fsnt ]
standard_name = shortwave_net_outgoing_flux_at_model_top
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ soll ]
standard_name = direct_solar_radiative_flux_at_surface_ge_700nm_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ sols ]
standard_name = direct_solar_radiative_flux_at_surface_lt_700nm_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ solld ]
standard_name = diffuse_solar_radiative_flux_at_surface_ge_700nm_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ solsd ]
standard_name = diffuse_solar_radiative_flux_at_surface_lt_700nm_to_coupler
units = W m-2
type = real | kind = kind_phys
dimensions = (horizontal_loop_extent)
intent = out
intent = inout
[ errmsg ]
standard_name = ccpp_error_message
units = none
Expand Down
Loading