Skip to content

Commit

Permalink
Cleaned up rrtmgp_lw_pre.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Feb 19, 2020
1 parent 1d92cfa commit e201f08
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 38 deletions.
44 changes: 20 additions & 24 deletions physics/rrtmgp_lw_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,35 @@ end subroutine rrtmgp_lw_pre_init
!> \section arg_table_rrtmgp_lw_pre_run
!! \htmlinclude rrtmgp_lw_pre.html
!!
subroutine rrtmgp_lw_pre_run (doLWrad, nCol, lon, lat, slmsk, zorl, snowd, sncovr, tsfc, &
nmtvr, hprime, lw_gas_props, sfc_emiss_byband, errmsg, errflg)
subroutine rrtmgp_lw_pre_run (doLWrad, nCol, xlon, xlat, slmsk, zorl, snowd, sncovr, tsfc, &
hprime, lw_gas_props, sfc_emiss_byband, semis, errmsg, errflg)

! Inputs
logical, intent(in) :: &
doLWrad ! Logical flag for longwave radiation call
doLWrad ! Logical flag for longwave radiation call
integer, intent(in) :: &
nCol, & ! Number of horizontal grid points
nmtvr ! number of topographic variables in GWD
nCol ! Number of horizontal grid points
real(kind_phys), dimension(nCol), intent(in) :: &
lon, & ! Longitude
lat, & ! Latitude
slmsk, & ! Land/sea/sea-ice mask
zorl, & ! Surface roughness length (cm)
snowd, & ! water equivalent snow depth (mm)
sncovr, & ! Surface snow are fraction (1)
tsfc ! Surface skin temperature (K)
real(kind_phys), dimension(nCol,nmtvr), intent(in) :: &
hprime ! Standard deviation of subgrid orography

xlon, & ! Longitude
xlat, & ! Latitude
slmsk, & ! Land/sea/sea-ice mask
zorl, & ! Surface roughness length (cm)
snowd, & ! water equivalent snow depth (mm)
sncovr, & ! Surface snow are fraction (1)
tsfc, & ! Surface skin temperature (K)
hprime ! Standard deviation of subgrid orography
type(ty_gas_optics_rrtmgp),intent(in) :: &
lw_gas_props ! RRTMGP DDT: spectral information for LW calculation
lw_gas_props ! RRTMGP DDT: spectral information for LW calculation

! Outputs
real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(out) :: &
sfc_emiss_byband ! Surface emissivity in each band
sfc_emiss_byband ! Surface emissivity in each band
character(len=*), intent(out) :: &
errmsg ! Error message
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag

! Local fields
real(kind_phys), dimension(nCol) :: sfc_emiss
errflg ! Error flag
real(kind_phys), dimension(nCol), intent(out) :: &
semis

! Initialize CCPP error handling variables
errmsg = ''
Expand All @@ -72,11 +68,11 @@ subroutine rrtmgp_lw_pre_run (doLWrad, nCol, lon, lat, slmsk, zorl, snowd, sncov
! #######################################################################################
! Call module_radiation_surface::setemis(),to setup surface emissivity for LW radiation.
! #######################################################################################
call setemis (lon, lat, slmsk, snowd, sncovr, zorl, tsfc, tsfc, hprime(:,1), nCol, sfc_emiss)
call setemis (xlon, xlat, slmsk, snowd, sncovr, zorl, tsfc, tsfc, hprime, nCol, semis)

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

end subroutine rrtmgp_lw_pre_run
Expand Down
29 changes: 15 additions & 14 deletions physics/rrtmgp_lw_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@
type = integer
intent = in
optional = F
[nmtvr]
standard_name = number_of_statistical_measures_of_subgrid_orography
long_name = number of topographic variables in GWD
units = count
dimensions = ()
type = integer
intent = in
optional = F
[lon]
[xlon]
standard_name = longitude
long_name = longitude
units = radians
Expand All @@ -34,7 +26,7 @@
kind = kind_phys
intent = in
optional = F
[lat]
[xlat]
standard_name = latitude
long_name = latitude
units = radians
Expand Down Expand Up @@ -89,10 +81,10 @@
intent = in
optional = F
[hprime]
standard_name = statistical_measures_of_subgrid_orography
long_name = orographic metrics
units = various
dimensions = (horizontal_dimension,number_of_statistical_measures_of_subgrid_orography)
standard_name = standard_deviation_of_subgrid_orography
long_name = standard deviation of subgrid orography
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
Expand All @@ -105,6 +97,15 @@
type = ty_gas_optics_rrtmgp
intent = in
optional = F
[semis]
standard_name = surface_longwave_emissivity
long_name = surface lw emissivity in fraction
units = frac
dimensions = (horizontal_dimension)
type = real
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
Expand Down

0 comments on commit e201f08

Please sign in to comment.