From def30ce6634e68ccfc8e6e188f11b748e7fb6fb1 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 12 Dec 2019 17:09:10 -0700 Subject: [PATCH] Started removing GFS DDTs from RRTMGP scheme. --- physics/GFS_rrtmgp_pre.F90 | 9 +- physics/GFS_rrtmgp_pre.meta | 9 ++ physics/rrtmgp_lw_cloud_optics.F90 | 124 ++++++++++++++-------------- physics/rrtmgp_lw_cloud_optics.meta | 72 +++++++++++++--- physics/rrtmgp_lw_gas_optics.F90 | 77 ++++++++--------- physics/rrtmgp_lw_gas_optics.meta | 109 +++++++++++++++--------- physics/rrtmgp_sw_gas_optics.F90 | 81 ++++++++++-------- physics/rrtmgp_sw_gas_optics.meta | 114 +++++++++++++++++-------- physics/rrtmgp_sw_rte.F90 | 14 +++- physics/rrtmgp_sw_rte.meta | 17 ++++ 10 files changed, 396 insertions(+), 230 deletions(-) diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index 05c853fd3..efc4312ae 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -67,13 +67,16 @@ module GFS_rrtmgp_pre !! \section arg_table_GFS_rrtmgp_pre_init !! \htmlinclude GFS_rrtmgp_pre_init.html !! - subroutine GFS_rrtmgp_pre_init(Model, Radtend, errmsg, errflg) + subroutine GFS_rrtmgp_pre_init(Model, Radtend, active_gases_array, errmsg, errflg) ! Inputs type(GFS_control_type), intent(inout) :: & Model ! DDT: FV3-GFS model control parameters type(GFS_radtend_type), intent(inout) :: & - Radtend ! DDT: FV3-GFS radiation tendencies + Radtend ! DDT: FV3-GFS radiation tendencies + ! Outputs + character(len=128),dimension(Model%ngases), intent(out) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP character(len=*), intent(out) :: & errmsg ! Error message integer, intent(out) :: & @@ -106,7 +109,7 @@ subroutine GFS_rrtmgp_pre_init(Model, Radtend, errmsg, errflg) gasIndices(Model%ngases,2)=len(trim(Model%active_gases)) ! Now extract the gas names do ij=1,Model%ngases - Model%active_gases_array(ij) = Model%active_gases(gasIndices(ij,1):gasIndices(ij,2)) + active_gases_array(ij) = Model%active_gases(gasIndices(ij,1):gasIndices(ij,2)) enddo endif end subroutine GFS_rrtmgp_pre_init diff --git a/physics/GFS_rrtmgp_pre.meta b/physics/GFS_rrtmgp_pre.meta index 84fe20907..87934aa24 100644 --- a/physics/GFS_rrtmgp_pre.meta +++ b/physics/GFS_rrtmgp_pre.meta @@ -17,6 +17,15 @@ type = GFS_radtend_type intent = inout optional = F +[active_gases_array] + standard_name = list_of_active_gases_used_by_RRTMGP + long_name = list of active gases used by RRTMGP + units = none + dimensions = (number_of_active_gases_used_by_RRTMGP) + type = character + kind = len=128 + intent = out + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/rrtmgp_lw_cloud_optics.F90 index 794b679ef..418fe8cbf 100644 --- a/physics/rrtmgp_lw_cloud_optics.F90 +++ b/physics/rrtmgp_lw_cloud_optics.F90 @@ -1,15 +1,9 @@ -!>\file rrtmgp_lw_cloud_optics.F90 -!! This file contains module rrtmgp_lw_cloud_optics use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type use mo_rte_kind, only: wl use mo_cloud_optics, only: ty_cloud_optics use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp - use physparam, only: isubclw, iovrlw use mo_optical_props, only: ty_optical_props_1scl - use mo_cloud_sampling, only: sampled_mask_max_ran, sampled_mask_exp_ran, draw_samples - use mersenne_twister, only: random_setseed, random_number, random_stat use mo_rrtmg_lw_cloud_optics, only: rrtmg_lw_cloud_optics use rrtmgp_aux, only: check_error_msg use netcdf @@ -17,33 +11,36 @@ module rrtmgp_lw_cloud_optics public rrtmgp_lw_cloud_optics_init, rrtmgp_lw_cloud_optics_run, rrtmgp_lw_cloud_optics_finalize contains -!! \section arg_table_rrtmgp_lw_cloud_optics_init -!! \htmlinclude rrtmgp_lw_cloud_optics.html -!! ! ######################################################################################### ! SUBROUTINE rrtmgp_lw_cloud_optics_init() ! ######################################################################################### - subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_cloud_props, & - errmsg, errflg) +!! \section arg_table_rrtmgp_lw_cloud_optics_init +!! \htmlinclude rrtmgp_lw_cloud_optics.html +!! + subroutine rrtmgp_lw_cloud_optics_init(cld_optics_scheme, nrghice, rrtmgp_root_dir, & + rrtmgp_lw_file_clouds, mpicomm, mpirank, mpiroot, lw_cloud_props, errmsg, errflg) !#ifdef MPI ! use mpi !#endif ! Inputs - type(GFS_control_type), intent(in) :: & - Model ! DDT containing model control parameters - integer,intent(in) :: & - mpicomm, & ! MPI communicator - mpirank, & ! Current MPI rank - mpiroot ! Master MPI rank + integer, intent(in) :: & + nrghice, & ! Number of ice-roughness categories + cld_optics_scheme, & ! Cloud-optics scheme + mpicomm, & ! MPI communicator + mpirank, & ! Current MPI rank + mpiroot ! Master MPI rank + character(len=128),intent(in) :: & + rrtmgp_root_dir, & ! RTE-RRTMGP root directory + rrtmgp_lw_file_clouds ! RRTMGP file containing coefficients used to compute clouds optical properties ! Outputs type(ty_cloud_optics),intent(out) :: & - lw_cloud_props ! DDT containing spectral information for RRTMGP LW radiation scheme + lw_cloud_props ! RRTMGP DDT: spectral information for RRTMGP LW radiation scheme character(len=*), intent(out) :: & - errmsg ! Error message + errmsg ! Error message integer, intent(out) :: & - errflg ! Error code + errflg ! Error code ! Variables that will be passed to cloud_optics%load() real(kind_phys) :: & @@ -101,10 +98,10 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou errmsg = '' errflg = 0 - if (Model%rrtmgp_cld_optics .eq. 0) return + if (cld_optics_scheme .eq. 0) return ! Filenames are set in the gfs_physics_nml (scm/src/GFS_typedefs.F90) - lw_cloud_props_file = trim(Model%rrtmgp_root)//trim(Model%lw_file_clouds) + lw_cloud_props_file = trim(rrtmgp_root_dir)//trim(rrtmgp_lw_file_clouds) ! Read dimensions for k-distribution fields (only on master processor(0)) ! if (mpirank .eq. mpiroot) then @@ -131,14 +128,14 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou endif ! Check to ensure that number of ice-roughness categories is feasible. - if (Model%rrtmgp_nrghice .gt. nrghice_lw) then + if (nrghice .gt. nrghice_lw) then errmsg = 'Number of RRTMGP ice-roughness categories requested in namelist file is not allowed' endif ! endif ! ! Broadcast dimensions to all processors !#ifdef MPI -! if (Model%rrtmgp_cld_optics .eq. 1 .or. Model%rrtmgp_cld_optics .eq. 2) then +! if (Cld_optics_scheme .eq. 1 .or. Cld_optics_scheme .eq. 2) then ! call MPI_BCAST(nbandLWcldy, 1, MPI_INTEGER, mpiroot, mpicomm, ierr) ! call MPI_BCAST(nrghice_lw, 1, MPI_INTEGER, mpiroot, mpicomm, ierr) ! call MPI_BCAST(nsize_liq, 1, MPI_INTEGER, mpiroot, mpicomm, ierr) @@ -151,7 +148,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou ! endif !#endif - if (Model%rrtmgp_cld_optics .eq. 1) then + if (Cld_optics_scheme .eq. 1) then allocate(lut_extliq(nsize_liq, nBandLWcldy)) allocate(lut_ssaliq(nsize_liq, nBandLWcldy)) allocate(lut_asyliq(nsize_liq, nBandLWcldy)) @@ -160,7 +157,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou allocate(lut_asyice(nsize_ice, nBandLWcldy, nrghice_lw)) allocate(band_lims_cldy(2, nBandLWcldy)) endif - if (Model%rrtmgp_cld_optics .eq. 2) then + if (Cld_optics_scheme .eq. 2) then allocate(pade_extliq(nbandLWcldy, nsizereg, ncoeff_ext )) allocate(pade_ssaliq(nbandLWcldy, nsizereg, ncoeff_ssa_g)) allocate(pade_asyliq(nbandLWcldy, nsizereg, ncoeff_ssa_g)) @@ -179,7 +176,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou ! On master processor, allocate space, read in fields, broadcast to all processors ! if (mpirank .eq. mpiroot) then ! - if (Model%rrtmgp_cld_optics .eq. 1) then + if (Cld_optics_scheme .eq. 1) then write (*,*) 'Reading RRTMGP longwave cloud data (LUT) ... ' ! if(nf90_open(trim(lw_cloud_props_file), NF90_WRITE, ncid_lw_clds) == NF90_NOERR) then @@ -213,7 +210,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou endif endif ! - if (Model%rrtmgp_cld_optics .eq. 2) then + if (Cld_optics_scheme .eq. 2) then write (*,*) 'Reading RRTMGP longwave cloud data (PADE) ... ' ! if(nf90_open(trim(lw_cloud_props_file), NF90_WRITE, ncid_lw_clds) == NF90_NOERR) then @@ -262,7 +259,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou ! ! Broadcast arrays to all processors !#ifdef MPI -! if (Model%rrtmgp_cld_optics .eq. 1) then +! if (Cld_optics_scheme .eq. 1) then ! write (*,*) 'Broadcasting RRTMGP longwave cloud data (LUT) ... ' !#ifndef SINGLE_PREC ! call MPI_BCAST(radliq_lwr, 1, MPI_DOUBLE_PRECISION, mpiroot, mpicomm, ierr) @@ -294,7 +291,7 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou ! call MPI_BCAST(band_lims_cldy , size(band_lims_cldy), MPI_REAL, mpiroot, mpicomm, ierr) !#endif ! endif -! if (Model%rrtmgp_cld_optics .eq. 2) then +! if (Cld_optics_scheme .eq. 2) then ! write (*,*) 'Broadcasting RRTMGP longwave cloud data (PADE) ... ' !#ifndef SINGLE_PREC ! call MPI_BCAST(pade_extliq, size(pade_extliq), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, ierr) @@ -329,14 +326,14 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou !#endif ! Load tables data for RRTMGP cloud-optics - if (Model%rrtmgp_cld_optics .eq. 1) then - call check_error_msg('lw_cloud_optics_init',lw_cloud_props%set_ice_roughness(Model%rrtmgp_nrghice)) + if (cld_optics_scheme .eq. 1) then + call check_error_msg('lw_cloud_optics_init',lw_cloud_props%set_ice_roughness(nrghice)) call check_error_msg('lw_cloud_optics_init',lw_cloud_props%load(band_lims_cldy, & radliq_lwr, radliq_upr, radliq_fac, radice_lwr, radice_upr, radice_fac, & lut_extliq, lut_ssaliq, lut_asyliq, lut_extice, lut_ssaice, lut_asyice)) endif - if (Model%rrtmgp_cld_optics .eq. 2) then - call check_error_msg('lw_cloud_optics_init',lw_cloud_props%set_ice_roughness(Model%rrtmgp_nrghice)) + if (cld_optics_scheme .eq. 2) then + call check_error_msg('lw_cloud_optics_init',lw_cloud_props%set_ice_roughness(nrghice)) call check_error_msg('lw_cloud_optics_init',lw_cloud_props%load(band_lims_cldy, & pade_extliq, pade_ssaliq, pade_asyliq, pade_extice, pade_ssaice, & pade_asyice, pade_sizereg_extliq, pade_sizereg_ssaliq, pade_sizereg_asyliq,& @@ -344,23 +341,26 @@ subroutine rrtmgp_lw_cloud_optics_init(Model, mpicomm, mpirank, mpiroot, lw_clou endif end subroutine rrtmgp_lw_cloud_optics_init - -!! \section arg_table_rrtmgp_lw_cloud_optics_run -!! \htmlinclude rrtmgp_lw_cloud_optics.html -!! ! ######################################################################################### ! SUBROUTINE rrtmgp_lw_cloud_optics_run() ! ######################################################################################### - subroutine rrtmgp_lw_cloud_optics_run(Model, ncol, cld_frac, cld_lwp, cld_reliq, cld_iwp, & - cld_reice, cld_swp, cld_resnow, cld_rwp, cld_rerain, lw_cloud_props, lw_gas_props, & - cldtaulw, lw_optical_props_cloudsByBand, errmsg, errflg) +!! \section arg_table_rrtmgp_lw_cloud_optics_run +!! \htmlinclude rrtmgp_lw_cloud_optics.html +!! + subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nrghice, & + cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, & + cld_rerain, lw_cloud_props, lw_gas_props, cldtaulw, lw_optical_props_cloudsByBand, & + errmsg, errflg) ! Inputs - type(GFS_control_type), intent(in) :: & - Model ! DDT containing FV3-GFS model control parameters + logical, intent(in) :: & + doLWrad ! Logical flag for longwave radiation call integer, intent(in) :: & - ncol ! Number of horizontal gridpoints - real(kind_phys), dimension(ncol,model%levs),intent(in) :: & + nCol, & ! Number of horizontal gridpoints + nLev, & ! Number of vertical levels + nrghice, & ! Number of ice-roughness categories + cld_optics_scheme ! Cloud-optics scheme + real(kind_phys), dimension(ncol,nLev),intent(in) :: & cld_frac, & ! Total cloud fraction by layer cld_lwp, & ! Cloud liquid water path cld_reliq, & ! Cloud liquid effective radius @@ -371,30 +371,30 @@ subroutine rrtmgp_lw_cloud_optics_run(Model, ncol, cld_frac, cld_lwp, cld_reliq, cld_rwp, & ! Cloud rain water path (used only fro RRTMG scheme) cld_rerain ! Cloud rain effective radius (used only fro RRTMG scheme) type(ty_cloud_optics),intent(in) :: & - lw_cloud_props ! + lw_cloud_props ! RRTMGP DDT: spectral information for RRTMGP LW radiation scheme type(ty_gas_optics_rrtmgp),intent(in) :: & - lw_gas_props - + lw_gas_props ! RRTMGP DDT: spectral information for RRTMGP LW radiation scheme + ! Outputs - real(kind_phys), dimension(ncol,Model%levs), intent(out) :: & - cldtaulw ! approx 10.mu band layer cloud optical depth + real(kind_phys), dimension(ncol,nLev), intent(out) :: & + cldtaulw ! Approx. 10.mu band layer cloud optical depth type(ty_optical_props_1scl),intent(out) :: & - lw_optical_props_cloudsByBand ! + lw_optical_props_cloudsByBand ! RRTMGP DDT: longwave cloud optical properties in each band integer, intent(out) :: & - errflg ! + errflg ! Error flag character(len=*), intent(out) :: & - errmsg ! + errmsg ! Error message ! Local variables - logical,dimension(ncol,model%levs) :: liqmask, icemask - real(kind_phys), dimension(ncol,model%levs,lw_gas_props%get_nband()) :: & + logical,dimension(ncol,nLev) :: liqmask, icemask + real(kind_phys), dimension(ncol,nLev,lw_gas_props%get_nband()) :: & tau_cld ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - if (.not. Model%lslwr) return + if (.not. doLWrad) return ! ####################################################################################### ! Compute ice/liquid cloud masks, needed by rrtmgp_cloud_optics @@ -405,20 +405,20 @@ subroutine rrtmgp_lw_cloud_optics_run(Model, ncol, cld_frac, cld_lwp, cld_reliq, ! ####################################################################################### ! Allocate space for RRTMGP DDTs containing cloud radiative properties ! ####################################################################################### - ! Cloud optics [nCol,model%levs,nBands] + ! Cloud optics [nCol,nLev,nBands] call check_error_msg('rrtmgp_lw_cloud_optics_run',lw_optical_props_cloudsByBand%alloc_1scl(& - ncol, model%levs, lw_gas_props%get_band_lims_wavenumber())) + ncol, nLev, lw_gas_props%get_band_lims_wavenumber())) ! ####################################################################################### ! Compute cloud-optics for RTE. ! ####################################################################################### - if (Model%rrtmgp_cld_optics .gt. 0) then + if (rrtmgp_cld_optics .gt. 0) then ! i) RRTMGP cloud-optics. call check_error_msg('rrtmgp_lw_cloud_optics_run',lw_cloud_props%cloud_optics(& ncol, & ! IN - Number of horizontal gridpoints - model%levs, & ! IN - Number of vertical layers + nLev, & ! IN - Number of vertical layers lw_cloud_props%get_nband(), & ! IN - Number of LW bands - Model%rrtmgp_nrghice, & ! IN - Number of ice-roughness categories + nrghice, & ! IN - Number of ice-roughness categories liqmask, & ! IN - Liquid-cloud mask icemask, & ! IN - Ice-cloud mask cld_lwp, & ! IN - Cloud liquid water path @@ -430,7 +430,7 @@ subroutine rrtmgp_lw_cloud_optics_run(Model, ncol, cld_frac, cld_lwp, cld_reliq, else ! ii) RRTMG cloud-optics. if (any(cld_frac .gt. 0)) then - call rrtmg_lw_cloud_optics(ncol, model%levs, lw_gas_props%get_nband(), cld_lwp, & + call rrtmg_lw_cloud_optics(ncol, nLev, lw_gas_props%get_nband(), cld_lwp, & cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow, & cld_frac, tau_cld) lw_optical_props_cloudsByBand%tau = tau_cld diff --git a/physics/rrtmgp_lw_cloud_optics.meta b/physics/rrtmgp_lw_cloud_optics.meta index 60daf2666..81602c552 100644 --- a/physics/rrtmgp_lw_cloud_optics.meta +++ b/physics/rrtmgp_lw_cloud_optics.meta @@ -1,14 +1,40 @@ [ccpp-arg-table] name = rrtmgp_lw_cloud_optics_init type = scheme -[Model] - standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type +[cld_optics_scheme] + standard_name = rrtmgp_cloud_optics_flag + long_name = Flag to control which RRTMGP cloud-optics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[nrghice] + standard_name = number_of_rrtmgp_ice_roughness + long_name = number of ice-roughness categories in RRTMGP calculation + units = count + dimensions = () + type = integer + intent = in + optional = F +[rrtmgp_root_dir] + standard_name = directory_for_rte_rrtmgp_source_code + long_name = directory for rte+rrtmgp source code + units = none + dimensions = () + type = character + intent = in + optional = F + kind = len=128 +[rrtmgp_lw_file_clouds] + standard_name = rrtmgp_coeff_lw_cloud_optics + long_name = file containing coefficients for RRTMGP LW cloud optics + units = none + dimensions = () + type = character intent = in optional = F + kind = len=128 [mpirank] standard_name = mpi_rank long_name = current MPI rank @@ -63,12 +89,12 @@ [ccpp-arg-table] name = rrtmgp_lw_cloud_optics_run type = scheme -[Model] - standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type - units = DDT +[doLWrad] + standard_name = flag_to_calc_lw + long_name = logical flags for lw radiation calls + units = flag dimensions = () - type = GFS_control_type + type = logical intent = in optional = F [ncol] @@ -79,6 +105,30 @@ type = integer intent = in optional = F +[nLev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F +[cld_optics_scheme] + standard_name = rrtmgp_cloud_optics_flag + long_name = Flag to control which RRTMGP cloud-optics scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[nrghice] + standard_name = number_of_rrtmgp_ice_roughness + long_name = number of ice-roughness categories in RRTMGP calculation + units = count + dimensions = () + type = integer + intent = in + optional = F [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction diff --git a/physics/rrtmgp_lw_gas_optics.F90 b/physics/rrtmgp_lw_gas_optics.F90 index a5854fe37..2adcdc8de 100644 --- a/physics/rrtmgp_lw_gas_optics.F90 +++ b/physics/rrtmgp_lw_gas_optics.F90 @@ -1,6 +1,5 @@ module rrtmgp_lw_gas_optics use machine, only: kind_phys - use GFS_typedefs, only: GFS_control_type use mo_rte_kind, only: wl use mo_gas_optics_rrtmgp, only: ty_gas_optics_rrtmgp use mo_gas_concentrations, only: ty_gas_concs @@ -18,8 +17,8 @@ module rrtmgp_lw_gas_optics !! \section arg_table_rrtmgp_lw_gas_optics_init !! \htmlinclude rrtmgp_lw_gas_optics.html !! - subroutine rrtmgp_lw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, lw_gas_props, & - ipsdlw0, errmsg, errflg) + subroutine rrtmgp_lw_gas_optics_init(rrtmgp_root_dir, rrtmgp_lw_file_gas, rrtmgp_nGases, & + active_gases_array, mpicomm, mpirank, mpiroot, lw_gas_props, ipsdlw0, errmsg, errflg) use netcdf !#ifdef MPI @@ -27,25 +26,30 @@ subroutine rrtmgp_lw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, lw_gas_pr !#endif ! Inputs - type(GFS_control_type), intent(in) :: & - Model ! DDT containing model control parameters + character(len=128),intent(in) :: & + rrtmgp_root_dir, & ! RTE-RRTMGP root directory + rrtmgp_lw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP + character(len=128),dimension(rrtmgp_nGases), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP integer,intent(in) :: & - mpicomm, & ! MPI communicator - mpirank, & ! Current MPI rank - mpiroot ! Master MPI rank + mpicomm, & ! MPI communicator + mpirank, & ! Current MPI rank + mpiroot ! Master MPI rank ! Outputs character(len=*), intent(out) :: & - errmsg ! Error message + errmsg ! Error message integer, intent(out) :: & - errflg, & ! Error code - ipsdlw0 + errflg, & ! Error code + ipsdlw0 ! type(ty_gas_optics_rrtmgp),intent(out) :: & - lw_gas_props ! DDT containing spectral information for RRTMGP LW radiation scheme + lw_gas_props ! RRTMGP DDT: ! Variables that will be passed to gas_optics%load() type(ty_gas_concs) :: & - gas_concentrations + gas_concentrations ! RRTMGP DDT: trace gas concentrations (vmr) integer, dimension(:), allocatable :: & kminor_start_lower, & ! kminor_start_upper ! @@ -120,7 +124,7 @@ subroutine rrtmgp_lw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, lw_gas_pr errflg = 0 ! Filenames are set in the gfs_physics_nml (scm/src/GFS_typedefs.F90) - lw_gas_props_file = trim(Model%rrtmgp_root)//trim(Model%lw_file_gas) + lw_gas_props_file = trim(rrtmgp_root_dir)//trim(rrtmgp_lw_file_gas) ! Read dimensions for k-distribution fields (only on master processor(0)) ! if (mpirank .eq. mpiroot) then @@ -382,8 +386,8 @@ subroutine rrtmgp_lw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, lw_gas_pr !#endif ! Initialize gas concentrations and gas optics class with data - do iGas=1,Model%nGases - call check_error_msg('lw_gas_optics_init',gas_concentrations%set_vmr(Model%active_gases_array(iGas), 0._kind_phys)) + do iGas=1,rrtmgp_nGases + call check_error_msg('lw_gas_optics_init',gas_concentrations%set_vmr(active_gases_array(iGas), 0._kind_phys)) enddo call check_error_msg('lw_gas_optics_init',lw_gas_props%load(gas_concentrations, gas_names, & key_species, band2gpt, band_lims, press_ref, press_ref_trop, temp_ref, temp_ref_p, & @@ -404,30 +408,27 @@ end subroutine rrtmgp_lw_gas_optics_init !! \section arg_table_rrtmgp_lw_gas_optics_run !! \htmlinclude rrtmgp_lw_gas_optics.html !! - subroutine rrtmgp_lw_gas_optics_run(Model, lw_gas_props, ncol, p_lay, p_lev, t_lay,& - t_lev, skt, gas_concentrations, lslwr, lw_optical_props_clrsky, sources, & - errmsg, errflg) + subroutine rrtmgp_lw_gas_optics_run(doLWrad, nCol, nLev, lw_gas_props, p_lay, p_lev, t_lay,& + t_lev, skt, gas_concentrations, lw_optical_props_clrsky, sources, errmsg, errflg) ! Inputs - type(GFS_control_type), intent(in) :: & - Model ! DDT containing model control parameters - - type(ty_gas_optics_rrtmgp),intent(in) :: & - lw_gas_props ! DDT containing spectral information for RRTMGP LW radiation scheme + logical, intent(in) :: & + doLWrad ! Flag to calculate LW irradiances integer,intent(in) :: & - ncol ! Number of horizontal points - real(kind_phys), dimension(ncol,model%levs), intent(in) :: & - p_lay, & ! Pressure @ model layer-centers (hPa) - t_lay ! Temperature (K) - real(kind_phys), dimension(ncol,model%levs+1), intent(in) :: & - p_lev, & ! Pressure @ model layer-interfaces (hPa) + ncol, & ! Number of horizontal points + nLev ! Number of vertical levels + type(ty_gas_optics_rrtmgp),intent(in) :: & + lw_gas_props ! RRTMGP DDT: + real(kind_phys), dimension(ncol,nLev), intent(in) :: & + p_lay, & ! Pressure @ model layer-centers (hPa) + t_lay ! Temperature (K) + real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & + p_lev, & ! Pressure @ model layer-interfaces (hPa) t_lev ! Temperature @ model levels real(kind_phys), dimension(ncol), intent(in) :: & - skt ! Surface(skin) temperature (K) + skt ! Surface(skin) temperature (K) type(ty_gas_concs),intent(in) :: & gas_concentrations ! RRTMGP DDT: trace gas concentrations (vmr) - logical, intent(in) :: & - lslwr ! Flag to calculate LW irradiances ! Output character(len=*), intent(out) :: & @@ -435,20 +436,20 @@ subroutine rrtmgp_lw_gas_optics_run(Model, lw_gas_props, ncol, p_lay, p_lev, t_l integer, intent(out) :: & errflg ! Error code type(ty_optical_props_1scl),intent(out) :: & - lw_optical_props_clrsky ! + lw_optical_props_clrsky ! RRTMGP DDT: type(ty_source_func_lw),intent(out) :: & - sources + sources ! RRTMGP DDT: ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - if (.not. Model%lslwr) return + if (.not. doLWrad) return ! Allocate space - call check_error_msg('rrtmgp_lw_gas_optics_run',lw_optical_props_clrsky%alloc_1scl(ncol, model%levs, lw_gas_props)) + call check_error_msg('rrtmgp_lw_gas_optics_run',lw_optical_props_clrsky%alloc_1scl(ncol, nLev, lw_gas_props)) call check_error_msg('rrtmgp_lw_gas_optics_run',sources%init(lw_gas_props)) - call check_error_msg('rrtmgp_lw_gas_optics_run',sources%alloc(ncol, Model%levs)) + call check_error_msg('rrtmgp_lw_gas_optics_run',sources%alloc(ncol, nLev)) ! Gas-optics call check_error_msg('rrtmgp_lw_gas_optics_run',lw_gas_props%gas_optics(& diff --git a/physics/rrtmgp_lw_gas_optics.meta b/physics/rrtmgp_lw_gas_optics.meta index ee15ca3bf..b6d2c3934 100644 --- a/physics/rrtmgp_lw_gas_optics.meta +++ b/physics/rrtmgp_lw_gas_optics.meta @@ -1,12 +1,39 @@ [ccpp-arg-table] name = rrtmgp_lw_gas_optics_init type = scheme -[Model] - standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type +[rrtmgp_root_dir] + standard_name = directory_for_rte_rrtmgp_source_code + long_name = directory for rte+rrtmgp source code + units = none + dimensions = () + type = character + intent = in + optional = F + kind = len=128 +[rrtmgp_lw_file_gas] + standard_name = rrtmgp_kdistribution_lw + long_name = file containing RRTMGP LW k-distribution + units = none + dimensions = () + type = character + intent = in + optional = F + kind = len=128 +[rrtmgp_nGases] + standard_name = number_of_active_gases_used_by_RRTMGP + long_name = number of gases available used by RRTMGP + units = count + dimensions = () + type = integer + intent = in + optional = F +[active_gases_array] + standard_name = list_of_active_gases_used_by_RRTMGP + long_name = list of active gases used by RRTMGP + units = none + dimensions = (number_of_active_gases_used_by_RRTMGP) + type = character + kind = len=128 intent = in optional = F [mpirank] @@ -71,20 +98,12 @@ [ccpp-arg-table] name = rrtmgp_lw_gas_optics_run type = scheme -[Model] - standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type - 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 - units = DDT +[doLWrad] + standard_name = flag_to_calc_lw + long_name = flag to calculate LW irradiances + units = flag dimensions = () - type = ty_gas_optics_rrtmgp + type = logical intent = in optional = F [ncol] @@ -95,6 +114,22 @@ type = integer intent = in optional = F +[nLev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + 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 + units = DDT + dimensions = () + type = ty_gas_optics_rrtmgp + intent = in + optional = F [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa long_name = air pressure layer @@ -148,13 +183,21 @@ type = ty_gas_concs intent = in optional = F -[lslwr] - standard_name = flag_to_calc_lw - long_name = flag to calculate LW irradiances - units = flag +[lw_optical_props_clrsky] + standard_name = longwave_optical_properties_for_clear_sky + long_name = Fortran DDT containing RRTMGP optical properties + units = DDT dimensions = () - type = logical - intent = in + type = ty_optical_props_1scl + intent = out + optional = F +[sources] + standard_name = longwave_source_function + long_name = Fortran DDT containing RRTMGP source functions + units = DDT + dimensions = () + type = ty_source_func_lw + intent = out optional = F [errmsg] standard_name = ccpp_error_message @@ -173,19 +216,3 @@ type = integer intent = out optional = F -[lw_optical_props_clrsky] - standard_name = longwave_optical_properties_for_clear_sky - long_name = Fortran DDT containing RRTMGP optical properties - units = DDT - dimensions = () - type = ty_optical_props_1scl - intent = out - optional = F -[sources] - standard_name = longwave_source_function - long_name = Fortran DDT containing RRTMGP source functions - units = DDT - dimensions = () - type = ty_source_func_lw - intent = out - optional = F diff --git a/physics/rrtmgp_sw_gas_optics.F90 b/physics/rrtmgp_sw_gas_optics.F90 index 506fd47c3..71fefa648 100644 --- a/physics/rrtmgp_sw_gas_optics.F90 +++ b/physics/rrtmgp_sw_gas_optics.F90 @@ -18,29 +18,34 @@ module rrtmgp_sw_gas_optics !! \section arg_table_rrtmgp_sw_gas_optics_init !! \htmlinclude rrtmgp_sw_gas_optics.html !! - subroutine rrtmgp_sw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, sw_gas_props, & - ipsdsw0, errmsg, errflg) + subroutine rrtmgp_sw_gas_optics_init(rrtmgp_root_dir, rrtmgp_sw_file_gas, rrtmgp_nGases, & + active_gases_array, mpicomm, mpirank, mpiroot, sw_gas_props, ipsdsw0, errmsg, errflg) use netcdf !#ifdef MPI ! use mpi !#endif ! Inputs - type(GFS_control_type), intent(in) :: & - Model ! DDT containing model control parameters + character(len=128),intent(in) :: & + rrtmgp_root_dir, & ! RTE-RRTMGP root directory + rrtmgp_sw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP + character(len=128),dimension(rrtmgp_nGases), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP integer,intent(in) :: & - mpicomm, & ! MPI communicator - mpirank, & ! Current MPI rank - mpiroot ! Master MPI rank - + mpicomm, & ! MPI communicator + mpirank, & ! Current MPI rank + mpiroot ! Master MPI rank + ! Outputs character(len=*), intent(out) :: & - errmsg ! Error message + errmsg ! Error message integer, intent(out) :: & - errflg, & ! Error code - ipsdsw0 ! + errflg, & ! Error code + ipsdsw0 ! type(ty_gas_optics_rrtmgp),intent(out) :: & - sw_gas_props + sw_gas_props ! RRTMGP DDT: ! Fields from the K-distribution files ! Variables that will be passed to gas_optics%load() @@ -117,8 +122,10 @@ subroutine rrtmgp_sw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, sw_gas_p errflg = 0 ! Filenames are set in the gfs_physics_nml (GFS_typedefs.F90) - sw_gas_props_file = trim(Model%rrtmgp_root)//trim(Model%sw_file_gas) - + sw_gas_props_file = trim(rrtmgp_root_dir)//trim(rrtmgp_sw_file_gas) + print*,'sw_gas_props_file: ',sw_gas_props_file + print*,'1; ',rrtmgp_root_dir + print*,'2; ',rrtmgp_sw_file_gas ! Read dimensions for k-distribution fields (only on master processor(0)) ! if (mpirank .eq. mpiroot) then if(nf90_open(trim(sw_gas_props_file), NF90_WRITE, ncid_sw) .eq. NF90_NOERR) then @@ -381,8 +388,8 @@ subroutine rrtmgp_sw_gas_optics_init(Model, mpicomm, mpirank, mpiroot, sw_gas_p !#endif ! Initialize gas concentrations and gas optics class with data - do iGas=1,Model%nGases - call check_error_msg('sw_gas_optics_init',gas_concentrations%set_vmr(Model%active_gases_array(iGas), 0._kind_phys)) + do iGas=1,rrtmgp_nGases + call check_error_msg('sw_gas_optics_init',gas_concentrations%set_vmr(active_gases_array(iGas), 0._kind_phys)) enddo call check_error_msg('sw_gas_optics_init',sw_gas_props%load(gas_concentrations, gas_names_sw, & key_species_sw, band2gpt_sw, band_lims_sw, press_ref_sw, press_ref_trop_sw, temp_ref_sw, & @@ -405,32 +412,35 @@ 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, 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) + subroutine rrtmgp_sw_gas_optics_run(doSWrad, nCol, nLev, nday, idxday, sw_gas_props, p_lay,& + p_lev, toa_src_sw, t_lay, t_lev, gas_concentrations, solcon, rrtmgp_nGases, & + active_gases_array, sw_optical_props_clrsky, errmsg, errflg) ! Inputs - type(GFS_control_type), intent(in) :: & - Model ! DDT: FV3-GFS model control parameters - type(ty_gas_optics_rrtmgp),intent(in) :: & - sw_gas_props ! RRTMGP DDT: spectral information for RRTMGP SW radiation scheme + logical, intent(in) :: & + doSWrad ! Flag to calculate SW irradiances integer,intent(in) :: & - nday, & ! Number of daylit points. - ncol ! Number of horizontal points + nDay, & ! Number of daylit points. + nCol, & ! Number of horizontal points + nLev ! Number of vertical levels integer,intent(in),dimension(ncol) :: & idxday ! Indices for daylit points. - real(kind_phys), dimension(ncol,model%levs), intent(in) :: & + type(ty_gas_optics_rrtmgp),intent(in) :: & + sw_gas_props ! RRTMGP DDT: spectral information for RRTMGP SW radiation scheme + real(kind_phys), dimension(ncol,nLev), intent(in) :: & p_lay, & ! Pressure @ model layer-centers (hPa) t_lay ! Temperature (K) - real(kind_phys), dimension(ncol,model%levs+1), intent(in) :: & + real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & p_lev, & ! Pressure @ model layer-interfaces (hPa) t_lev ! Temperature @ model levels type(ty_gas_concs),intent(in) :: & gas_concentrations ! RRTMGP DDT: trace gas concentrations (vmr) - logical, intent(in) :: & - lsswr ! Flag to calculate SW irradiances real(kind_phys), intent(in) :: & solcon ! Solar constant + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP + character(len=128),dimension(rrtmgp_nGases), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP ! Output character(len=*), intent(out) :: & @@ -444,7 +454,7 @@ subroutine rrtmgp_sw_gas_optics_run(Model, sw_gas_props, ncol, nday, idxday, p_l ! Local variables integer :: ij,iGas - real(kind_phys), dimension(ncol,Model%levs) :: vmrTemp + real(kind_phys), dimension(ncol,nLev) :: vmrTemp real(kind_phys), dimension(nday,sw_gas_props%get_ngpt()) :: toa_src_sw_temp type(ty_gas_concs) :: & gas_concentrations_daylit ! RRTMGP DDT: trace gas concentrations (vmr) @@ -453,18 +463,18 @@ subroutine rrtmgp_sw_gas_optics_run(Model, sw_gas_props, ncol, nday, idxday, p_l errmsg = '' errflg = 0 - if (.not. Model%lsswr) return + if (.not. doSWrad) return if (nDay .gt. 0) then ! Allocate space - call check_error_msg('rrtmgp_sw_gas_optics_run',sw_optical_props_clrsky%alloc_2str(nday, model%levs, sw_gas_props)) + call check_error_msg('rrtmgp_sw_gas_optics_run',sw_optical_props_clrsky%alloc_2str(nday, nLev, sw_gas_props)) ! Subset the gas concentrations, only need daylit points. - do iGas=1,Model%nGases + do iGas=1,rrtmgp_nGases call check_error_msg('rrtmgp_sw_rte_run',& - gas_concentrations%get_vmr(trim(Model%active_gases_array(iGas)),vmrTemp)) + gas_concentrations%get_vmr(trim(active_gases_array(iGas)),vmrTemp)) call check_error_msg('rrtmgp_sw_rte_run',& - gas_concentrations_daylit%set_vmr(trim(Model%active_gases_array(iGas)),vmrTemp(idxday(1:nday),:))) + gas_concentrations_daylit%set_vmr(trim(active_gases_array(iGas)),vmrTemp(idxday(1:nday),:))) enddo ! Gas-optics @@ -484,7 +494,6 @@ subroutine rrtmgp_sw_gas_optics_run(Model, sw_gas_props, ncol, nday, idxday, p_l enddo endif - end subroutine rrtmgp_sw_gas_optics_run ! ######################################################################################### diff --git a/physics/rrtmgp_sw_gas_optics.meta b/physics/rrtmgp_sw_gas_optics.meta index 7ee8e9edc..6a2b87a9a 100644 --- a/physics/rrtmgp_sw_gas_optics.meta +++ b/physics/rrtmgp_sw_gas_optics.meta @@ -1,12 +1,39 @@ [ccpp-arg-table] name = rrtmgp_sw_gas_optics_init type = scheme -[Model] - standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type +[rrtmgp_root_dir] + standard_name = directory_for_rte_rrtmgp_source_code + long_name = directory for rte+rrtmgp source code + units = none + dimensions = () + type = character + intent = in + optional = F + kind = len=128 +[rrtmgp_sw_file_gas] + standard_name = rrtmgp_kdistribution_sw + long_name = file containing RRTMGP SW k-distribution + units = none + dimensions = () + type = character + intent = in + optional = F + kind = len=128 +[rrtmgp_nGases] + standard_name = number_of_active_gases_used_by_RRTMGP + long_name = number of gases available used by RRTMGP + units = count + dimensions = () + type = integer + intent = in + optional = F +[active_gases_array] + standard_name = list_of_active_gases_used_by_RRTMGP + long_name = list of active gases used by RRTMGP + units = none + dimensions = (number_of_active_gases_used_by_RRTMGP) + type = character + kind = len=128 intent = in optional = F [mpirank] @@ -71,20 +98,12 @@ [ccpp-arg-table] name = rrtmgp_sw_gas_optics_run type = scheme -[Model] - standard_name = GFS_control_type_instance - long_name = instance of derived type GFS_control_type - units = DDT - dimensions = () - type = GFS_control_type - intent = in - optional = F -[sw_gas_props] - standard_name = coefficients_for_sw_gas_optics - long_name = DDT containing spectral information for RRTMGP SW radiation scheme - units = DDT +[doSWrad] + standard_name = flag_to_calc_sw + long_name = flag to calculate SW irradiances + units = flag dimensions = () - type = ty_gas_optics_rrtmgp + type = logical intent = in optional = F [ncol] @@ -95,6 +114,14 @@ type = integer intent = in optional = F +[nLev] + standard_name = vertical_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in + optional = F [nday] standard_name = daytime_points_dimension long_name = daytime points dimension @@ -111,14 +138,13 @@ 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 +[sw_gas_props] + standard_name = coefficients_for_sw_gas_optics + long_name = DDT containing spectral information for RRTMGP SW radiation scheme + units = DDT + dimensions = () + type = ty_gas_optics_rrtmgp + intent = in optional = F [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa @@ -156,6 +182,15 @@ kind = kind_phys 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 [gas_concentrations] standard_name = Gas_concentrations_for_RRTMGP_suite long_name = DDT containing gas concentrations for RRTMGP radiation scheme @@ -164,14 +199,6 @@ type = ty_gas_concs intent = in optional = F -[lsswr] - standard_name = flag_to_calc_sw - long_name = flag to calculate SW irradiances - units = flag - dimensions = () - type = logical - intent = in - optional = F [solcon] standard_name = solar_constant long_name = solar constant @@ -181,6 +208,23 @@ kind = kind_phys intent = in optional = F +[rrtmgp_nGases] + standard_name = number_of_active_gases_used_by_RRTMGP + long_name = number of gases available used by RRTMGP + units = count + dimensions = () + type = integer + intent = in + optional = F +[active_gases_array] + standard_name = list_of_active_gases_used_by_RRTMGP + long_name = list of active gases used by RRTMGP + units = none + dimensions = (number_of_active_gases_used_by_RRTMGP) + type = character + kind = len=128 + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/rrtmgp_sw_rte.F90 b/physics/rrtmgp_sw_rte.F90 index 4a612ccce..66e73516e 100644 --- a/physics/rrtmgp_sw_rte.F90 +++ b/physics/rrtmgp_sw_rte.F90 @@ -30,10 +30,16 @@ end subroutine rrtmgp_sw_rte_init subroutine rrtmgp_sw_rte_run(Model, Radtend, Statein, ncol, sw_gas_props, p_lay, t_lay, & p_lev, gas_concentrations, sw_optical_props_clrsky, sfc_alb_nir_dir, sfc_alb_nir_dif,& sfc_alb_uvvis_dir, sfc_alb_uvvis_dif, toa_src_sw, sw_optical_props_clouds, & - sw_optical_props_aerosol, lsswr, nday, idxday, hsw0, hswb, scmpsw, fluxswUP_allsky, & + sw_optical_props_aerosol, lsswr, nday, idxday, hsw0, hswb, rrtmgp_nGases, active_gases_array, scmpsw, fluxswUP_allsky, & fluxswDOWN_allsky, fluxswUP_clrsky, fluxswDOWN_clrsky, errmsg, errflg) ! Inputs + + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP + character(len=*),dimension(rrtmgp_nGases), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + type(GFS_control_type), intent(in) :: & Model type(GFS_radtend_type), intent(in) :: & @@ -142,11 +148,11 @@ subroutine rrtmgp_sw_rte_run(Model, Radtend, Statein, ncol, sw_gas_props, p_lay, fluxswDOWN_clrsky(:,:) = 0._kind_phys ! Subset the gas concentrations, only need daylit points. - do iGas=1,Model%nGases + do iGas=1,rrtmgp_nGases call check_error_msg('rrtmgp_sw_rte_run',& - gas_concentrations%get_vmr(trim(Model%active_gases_array(iGas)),vmrTemp)) + gas_concentrations%get_vmr(trim(active_gases_array(iGas)),vmrTemp)) call check_error_msg('rrtmgp_sw_rte_run',& - gas_concentrations_daylit%set_vmr(trim(Model%active_gases_array(iGas)),vmrTemp(idxday(1:nday),:))) + gas_concentrations_daylit%set_vmr(trim(active_gases_array(iGas)),vmrTemp(idxday(1:nday),:))) enddo ! Initialize RRTMGP DDT containing 2D(3D) fluxes diff --git a/physics/rrtmgp_sw_rte.meta b/physics/rrtmgp_sw_rte.meta index 81575e6f4..e9dee8cc4 100644 --- a/physics/rrtmgp_sw_rte.meta +++ b/physics/rrtmgp_sw_rte.meta @@ -1,6 +1,23 @@ [ccpp-arg-table] name = rrtmgp_sw_rte_run type = scheme +[rrtmgp_nGases] + standard_name = number_of_active_gases_used_by_RRTMGP + long_name = number of gases available used by RRTMGP + units = count + dimensions = () + type = integer + intent = in + optional = F +[active_gases_array] + standard_name = list_of_active_gases_used_by_RRTMGP + long_name = list of active gases used by RRTMGP + units = none + dimensions = (number_of_active_gases_used_by_RRTMGP) + type = character + kind = len=128 + intent = in + optional = F [Model] standard_name = GFS_control_type_instance long_name = instance of derived type GFS_control_type