Skip to content

Commit

Permalink
Merge pull request #817 from grantfirl/wrapper_806_807_813
Browse files Browse the repository at this point in the history
Wrapper for #806, #807, and #813
  • Loading branch information
climbfuji committed Dec 21, 2021
2 parents 84654b7 + b0de7da commit b6d6e4a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
19 changes: 9 additions & 10 deletions physics/GFS_phys_time_vary.scm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module GFS_phys_time_vary
use h2o_def, only : levh2o, h2o_coeff, h2o_lat, h2o_pres, h2o_time, h2oplin
use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol

use aerclm_def, only : aerin, aer_pres, ntrcaer, ntrcaerm
use aerclm_def, only : aerin, aer_pres, ntrcaer, ntrcaerm, iamin, iamax, jamin, jamax
use aerinterp, only : read_aerdata, setindxaer, aerinterpol, read_aerdataf

use iccn_def, only : ciplin, ccnin, ci_pres
Expand Down Expand Up @@ -62,7 +62,7 @@ module GFS_phys_time_vary
!! @{
subroutine GFS_phys_time_vary_init ( &
me, master, ntoz, h2o_phys, iaerclm, iccn, iflip, im, nx, ny, idate, xlat_d, xlon_d, &
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, &
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl,fhour, &
jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, &
jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, imap, jmap, &
do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, &
Expand All @@ -82,6 +82,7 @@ subroutine GFS_phys_time_vary_init (
integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny
logical, intent(in) :: h2o_phys, iaerclm, flag_restart
integer, intent(in) :: idate(:)
real(kind_phys), intent(in) :: fhour
real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:)

integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:)
Expand All @@ -99,10 +100,9 @@ subroutine GFS_phys_time_vary_init (

integer, intent(in) :: isot, ivegsrc, nlunit
real(kind_phys), intent(inout) :: sncovr(:), sncovr_ice(:)
integer, intent(in) :: lsm, lsm_noahmp, lsm_ruc
integer, intent(in) :: lsm, lsm_noahmp, lsm_ruc, vtype(:)
real(kind_phys), intent(in) :: min_seaice, fice(:)
real(kind_phys), intent(in) :: landfrac(:)
integer, intent(in) :: vtype(:)
real(kind_phys), intent(inout) :: weasd(:)

! NoahMP - only allocated when NoahMP is used
Expand Down Expand Up @@ -168,7 +168,7 @@ subroutine GFS_phys_time_vary_init (
integer, intent(out) :: errflg

! Local variables
integer :: i, j, ix, vegtyp, iamin, iamax, jamin, jamax
integer :: i, j, ix, vegtyp
real(kind_phys) :: rsnow

!--- Noah MP
Expand Down Expand Up @@ -342,8 +342,7 @@ subroutine GFS_phys_time_vary_init (
if (errflg/=0) return

if (iaerclm) then
call read_aerdataf (iamin, iamax, jamin, jamax, me, master, iflip, &
idate, errmsg, errflg)
call read_aerdataf (me, master, iflip, idate, fhour, errmsg, errflg)
if (errflg/=0) return
end if

Expand Down Expand Up @@ -654,7 +653,7 @@ end subroutine GFS_phys_time_vary_init
subroutine GFS_phys_time_vary_timestep_init ( &
me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, idate, nsswr, fhswr, lsswr, fhour, &
imfdeepcnv, cal_pre, random_clds, ntoz, h2o_phys, iaerclm, iccn, clstp, &
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, &
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, iflip, &
jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, &
jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, &
imap, jmap, prsl, seed0, rann, do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau,&
Expand All @@ -664,7 +663,7 @@ subroutine GFS_phys_time_vary_timestep_init (

! Interface variables
integer, intent(in) :: me, master, cnx, cny, isc, jsc, nrcm, im, levs, kdt, &
nsswr, imfdeepcnv, iccn, ntoz
nsswr, imfdeepcnv, iccn, ntoz, iflip
integer, intent(in) :: idate(:)
real(kind_phys), intent(in) :: fhswr, fhour
logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm
Expand Down Expand Up @@ -784,7 +783,7 @@ subroutine GFS_phys_time_vary_timestep_init (
! aerinterpol is using threading inside, don't
! move into OpenMP parallel section above
call aerinterpol (me, master, nthrds, im, idate, &
fhour, jindx1_aer, jindx2_aer,&
fhour, iflip, jindx1_aer, jindx2_aer, &
ddy_aer, iindx1_aer, &
iindx2_aer, ddx_aer, &
levs, prsl, aer_nm)
Expand Down
15 changes: 15 additions & 0 deletions physics/GFS_phys_time_vary.scm.meta
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@
type = real
kind = kind_phys
intent = in
[fhour]
standard_name = forecast_time
long_name = current forecast time
units = h
dimensions = ()
type = real
kind = kind_phys
intent = in
[jindx1_aer]
standard_name = lower_latitude_index_of_aerosol_forcing_for_interpolation
long_name = interpolation low index for prescribed aerosols in the y direction
Expand Down Expand Up @@ -1144,6 +1152,13 @@
type = real
kind = kind_phys
intent = inout
[iflip]
standard_name = control_for_vertical_index_direction
long_name = iflip - is not the same as flipv
units = flag
dimensions = ()
type = integer
intent = in
[jindx1_aer]
standard_name = lower_latitude_index_of_aerosol_forcing_for_interpolation
long_name = interpolation low index for prescribed aerosols in the y direction
Expand Down
9 changes: 0 additions & 9 deletions physics/GFS_rrtmgp_lw_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag
fluxr(i,30) = fluxr(i,30) + fhlwr * fluxlwDOWN_clrsky(i,iSFC) ! clear sky sfc lw dn
fluxr(i,33) = fluxr(i,33) + fhlwr * fluxlwUP_clrsky( i,iSFC) ! clear sky sfc lw up
enddo

do i=1,nCol
fluxr(i,17) = fluxr(i,17) + raddt * cldsa(i,4)
fluxr(i,18) = fluxr(i,18) + raddt * cldsa(i,5)
enddo

! Save cld frac,toplyr,botlyr and top temp, note that the order of h,m,l cloud is reversed for
! the fluxr output. save interface pressure (pa) of top/bot
Expand All @@ -166,10 +161,6 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag
tem0d = raddt * cldsa(i,j)
itop = mtopa(i,j)
ibtc = mbota(i,j)
fluxr(i, 8-j) = fluxr(i, 8-j) + tem0d
fluxr(i,11-j) = fluxr(i,11-j) + tem0d * p_lev(i,itop)
fluxr(i,14-j) = fluxr(i,14-j) + tem0d * p_lev(i,ibtc)
fluxr(i,17-j) = fluxr(i,17-j) + tem0d * t_lay(i,itop)

! Add optical depth and emissivity output
tem2 = 0.
Expand Down
6 changes: 4 additions & 2 deletions physics/radiation_surface.f
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,12 @@ subroutine sfc_init &
if ( me == 0 ) then
print *,' - Using Varying Surface Emissivity for lw'
print *,' Requested data file "',semis_file,'" not found!'
print *,' Change to fixed surface emissivity = 1.0 !'
endif
errmsg = 'module_radiation_surface: surface emissivity
& file not provided'
errflg = 1
return

iemslw = 0
else
close(NIRADSF)
open (NIRADSF,file=semis_file,form='formatted',status='old')
Expand Down

0 comments on commit b6d6e4a

Please sign in to comment.