Skip to content

Commit

Permalink
Add rte-rrtmgp DDTs to CCPP
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed May 8, 2019
1 parent 0a40aaa commit 81f256d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
31 changes: 19 additions & 12 deletions physics/GFS_rrtmgp_lw.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ module GFS_rrtmgp_lw
ngb_LW ! Band index for each g-points

! Classes used by rte+rrtmgp
type(ty_gas_optics_rrtmgp) :: &
kdist_lw
!type(ty_gas_optics_rrtmgp) :: &
! kdist_lw
type(ty_cloud_optics) :: &
kdist_lw_cldy
type(ty_gas_concs) :: &
Expand All @@ -67,17 +67,18 @@ module GFS_rrtmgp_lw
! GFS_rrtmgp_lw_init
! #########################################################################################
!! \section arg_table_GFS_rrtmgp_lw_init Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |-----------------|---------------------------|---------------------------------------------------------|-------|------|------------------|-----------|--------|----------|
!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
!! | mpirank | mpi_rank | current MPI rank | index | 0 | integer | | in | F |
!! | mpiroot | mpi_root | master MPI rank | index | 0 | integer | | in | F |
!! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |-----------------|------------------------------------------|--------------------------------------------------------------------|-------|------|----------------------|-----------|--------|----------|
!! | Model | GFS_control_type_instance | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F |
!! | mpirank | mpi_rank | current MPI rank | index | 0 | integer | | in | F |
!! | mpiroot | mpi_root | master MPI rank | index | 0 | integer | | in | F |
!! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!! | kdist_lw | K_distribution_file_for_RRTMGP_LW_scheme | DDT containing spectral information for RRTMGP LW radiation scheme | DDT | 0 | ty_gas_optics_rrtmgp | | inout | F |
!!
! #########################################################################################
subroutine GFS_rrtmgp_lw_init(Model,mpicomm, mpirank, mpiroot, errmsg, errflg)
subroutine GFS_rrtmgp_lw_init(Model,mpicomm, mpirank, mpiroot, kdist_lw, errmsg, errflg)
use netcdf

#ifdef MPI
Expand All @@ -91,6 +92,8 @@ subroutine GFS_rrtmgp_lw_init(Model,mpicomm, mpirank, mpiroot, errmsg, errflg)
mpicomm, & ! MPI communicator
mpirank, & ! Current MPI rank
mpiroot ! Master MPI rank
type(ty_gas_optics_rrtmgp),intent(inout) :: &
kdist_lw
! Outputs
character(len=*), intent(out) :: &
errmsg ! Error message
Expand Down Expand Up @@ -770,11 +773,13 @@ end subroutine GFS_rrtmgp_lw_init
!! | cld_od | cloud_optical_depth | cloud optical depth | none | 2 | real | kind_phys | in | T |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!! | kdist_lw | K_distribution_file_for_RRTMGP_LW_scheme | DDT containing spectral information for RRTMGP LW radiation scheme | DDT | 0 | ty_gas_optics_rrtmgp | | in | F |
!!
! #########################################################################################
subroutine GFS_rrtmgp_lw_run(p_lay, p_lev, t_lay, t_lev, q_lay, o3_lay, vmr_co2, vmr_n2o, & ! IN
vmr_ch4, vmr_o2, vmr_co, vmr_cfc11, vmr_cfc12, vmr_cfc22, vmr_ccl4, icseed, tau_aer, & ! IN
ssa_aer, sfc_emiss, skt, dzlyr, delpin, de_lgth, ncol, nlay, lprint, cldfrac, lslwr, & ! IN
kdist_lw, &
hlwc, topflx, sfcflx, cldtau, & ! OUT
hlw0, hlwb, flxprf, & ! OPT(out)
cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, cld_rwp, cld_ref_rain, cld_swp, & ! OPT(in)
Expand All @@ -791,7 +796,9 @@ subroutine GFS_rrtmgp_lw_run(p_lay, p_lev, t_lay, t_lev, q_lay, o3_lay, vmr_co2,
! random numbers. when isubclw /=2, it will not be used.
logical,intent(in) :: &
lprint, & ! Control flag for diagnostics
lslwr ! Flag to calculate RRTMGP LW? (1)
lslwr ! Flag to calculate RRTMGP LW? (1)
type(ty_gas_optics_rrtmgp),intent(in) :: &
kdist_lw ! DDT containing LW spectral information
real(kind_phys), dimension(ncol), intent(in) :: &
sfc_emiss, & ! Surface emissivity (1)
skt, & ! Surface(skin) temperature (K)
Expand Down
11 changes: 7 additions & 4 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ end subroutine GFS_rrtmgp_pre_init
!! | alb1d | surface_albedo_perturbation | surface albedo perturbation | frac | 1 | real | kind_phys | out | F |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!! | kdist_lw | K_distribution_file_for_RRTMGP_LW_scheme | DDT containing spectral information for RRTMGP LW radiation scheme | DDT | 0 | ty_gas_optics_rrtmgp | | in | F |
!!
! Attention - the output arguments lm, im, lmk, lmp must not be set
! in the CCPP version - they are defined in the interstitial_create routine
! #########################################################################################
subroutine GFS_rrtmgp_pre_run (Model, Grid, Sfcprop, Statein, Tbd, Cldprop, Coupling, & ! IN
Radtend, & ! INOUT
lm, im, lmk, lmp, & ! IN
lm, im, lmk, lmp, kdist_lw, & ! IN
kd, kt, kb, raddt, delp, dz, plvl, plyr, tlvl, tlyr, tsfg, tsfa, qlyr, olyr, & ! OUT
gasvmr_co2, gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & ! OUT
gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, gasvmr_cfc113, faersw1, faersw2, faersw3, & ! OUT
Expand Down Expand Up @@ -138,9 +139,10 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Sfcprop, Statein, Tbd, Cldprop, Coup
use surface_perturbation, only: &
cdfnor ! Routine to compute CDF (used to compute percentiles)
! RRTMGP stuff
use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp
use GFS_rrtmgp_lw, only: &
nBandsLW, & ! Number of LW bands in RRTMGP
kdist_lw ! DDT contining LW spectral information
nBandsLW!, & ! Number of LW bands in RRTMGP
!kdist_lw ! DDT contining LW spectral information
use GFS_rrtmgp_sw, only: &
nBandsSW, & ! Number of SW bands in RRTMGP
kdist_sw ! DDT contining SW spectral information
Expand All @@ -156,7 +158,8 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Sfcprop, Statein, Tbd, Cldprop, Coup
type(GFS_cldprop_type), intent(in) :: Cldprop
type(GFS_coupling_type), intent(in) :: Coupling
integer, intent(in) :: im, lm, lmk, lmp

type(ty_gas_optics_rrtmgp),intent(in) :: kdist_lw

! Outputs
integer, intent(out) :: kd, kt, kb
real(kind_phys), intent(out) :: raddt
Expand Down
2 changes: 1 addition & 1 deletion physics/rte-rrtmgp
Submodule rte-rrtmgp updated from fa305d to f0748a

0 comments on commit 81f256d

Please sign in to comment.