Skip to content
Merged
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
50 changes: 44 additions & 6 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ module GFS_phys_time_vary
use iccninterp, only : read_cidata, setindxci, ciinterpol

use gcycle_mod, only : gcycle

use cires_tauamf_data, only: cires_indx_ugwp, read_tau_amf, tau_amf_interp
use cires_tauamf_data, only: tau_limb, days_limb, ugwp_taulat

#if 0
!--- variables needed for calculating 'sncovr'
Expand Down Expand Up @@ -58,6 +61,7 @@ subroutine GFS_phys_time_vary_init (
jindx1_o3, jindx2_o3, ddy_o3, ozpl, jindx1_h, jindx2_h, ddy_h, h2opl, &
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, &
nthrds, errmsg, errflg)

implicit none
Expand All @@ -77,6 +81,10 @@ subroutine GFS_phys_time_vary_init (
integer, intent(inout) :: jindx1_ci(:), jindx2_ci(:), iindx1_ci(:), iindx2_ci(:)
real(kind_phys), intent(inout) :: ddy_ci(:), ddx_ci(:)
integer, intent(inout) :: imap(:), jmap(:)

logical, intent(in) :: do_ugwp_v1
real(kind_phys), intent(inout) :: ddy_j1tau(:), ddy_j2tau(:)
integer, intent(inout) :: jindx1_tau(:), jindx2_tau(:)

integer, intent(in) :: nthrds
character(len=*), intent(out) :: errmsg
Expand All @@ -100,6 +108,7 @@ subroutine GFS_phys_time_vary_init (
!$OMP shared (jindx1_o3,jindx2_o3,ddy_o3,jindx1_h,jindx2_h,ddy_h) &
!$OMP shared (jindx1_aer,jindx2_aer,ddy_aer,iindx1_aer,iindx2_aer,ddx_aer) &
!$OMP shared (jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci,ddx_ci) &
!$OMP shared (do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau) &
!$OMP private (ix,i,j)

!$OMP sections
Expand Down Expand Up @@ -176,7 +185,11 @@ subroutine GFS_phys_time_vary_init (
! No consistency check needed for in/ccn data, all values are
! hardcoded in module iccn_def.F and GFS_typedefs.F90
endif

!$OMP section
!> - Call tau_amf dats for ugwp_v1
if (do_ugwp_v1) then
call read_tau_amf(me, master, errmsg, errflg)
endif
!$OMP end sections

! Need an OpenMP barrier here (implicit in "end sections")
Expand Down Expand Up @@ -211,7 +224,12 @@ subroutine GFS_phys_time_vary_init (
jindx2_ci, ddy_ci, xlon_d, &
iindx1_ci, iindx2_ci, ddx_ci)
endif

!$OMP section
!> - Call cires_indx_ugwp to read monthly-mean GW-tau diagnosed from FV3GFS-runs that can resolve GWs
if (do_ugwp_v1) then
call cires_indx_ugwp (im, me, master, xlat_d, jindx1_tau, jindx2_tau, &
ddy_j1tau, ddy_j2tau)
endif
!$OMP section
!--- initial calculation of maps local ix -> global i and j
ix = 0
Expand Down Expand Up @@ -273,7 +291,8 @@ subroutine GFS_phys_time_vary_timestep_init (
lakefrac, min_seaice, min_lakeice, smc, slc, stc, smois, sh2o, tslb, tiice, tg3, tref, &
tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, &
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype, shdmin, shdmax, snowd, &
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, errmsg, errflg)
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, &
do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, errmsg, errflg)

implicit none

Expand All @@ -297,11 +316,19 @@ subroutine GFS_phys_time_vary_timestep_init (
real(kind_phys), intent(in) :: prsl(:,:)
integer, intent(in) :: seed0
real(kind_phys), intent(inout) :: rann(:,:)

logical, intent(in) :: do_ugwp_v1
integer, intent(in) :: jindx1_tau(:), jindx2_tau(:)
real(kind_phys), intent(in) :: ddy_j1tau(:), ddy_j2tau(:)
real(kind_phys), intent(inout) :: tau_amf(:)

! For gcycle only
integer, intent(in) :: nthrds, nx, ny, nsst, tile_num, nlunit, lsoil
integer, intent(in) :: lsoil_lsm, kice, ialb, isot, ivegsrc
character(len=*), intent(in) :: input_nml_file(:)

logical, intent(in) :: use_ufo, nst_anl, frac_grid

real(kind_phys), intent(in) :: fhcyc, phour, lakefrac(:), min_seaice, min_lakeice, &
xlat_d(:), xlon_d(:)
real(kind_phys), intent(inout) :: smc(:,:), slc(:,:), stc(:,:), smois(:,:), sh2o(:,:), &
Expand All @@ -310,7 +337,7 @@ subroutine GFS_phys_time_vary_timestep_init (
facsf(:), facwf(:), alvsf(:), alvwf(:), alnsf(:), alnwf(:), &
zorli(:), zorll(:), zorlo(:), weasd(:), slope(:), snoalb(:), &
canopy(:), vfrac(:), vtype(:), stype(:), shdmin(:), shdmax(:), &
snowd(:), cv(:), cvb(:), cvt(:), oro(:), oro_uf(:), slmsk(:)
snowd(:), cv(:), cvb(:), cvt(:), oro(:), oro_uf(:), slmsk(:)
!
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down Expand Up @@ -404,7 +431,13 @@ subroutine GFS_phys_time_vary_timestep_init (
iindx2_ci, ddx_ci, &
levs, prsl, in_nm, ccn_nm)
endif


!> - Call cires_indx_ugwp to read monthly-mean GW-tau diagnosed from FV3GFS-runs that resolve GW-activ
if (do_ugwp_v1) then
call tau_amf_interp(me, master, im, idate,fhour, &
jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf)
endif

!> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs
if (nscyc > 0) then
if (mod(kdt,nscyc) == 1) THEN
Expand Down Expand Up @@ -479,7 +512,12 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg)
if (allocated(ciplin) ) deallocate(ciplin)
if (allocated(ccnin) ) deallocate(ccnin)
if (allocated(ci_pres) ) deallocate(ci_pres)


! Deallocate UGWP-input arrays
if (allocated (ugwp_taulat)) deallocate(ugwp_taulat)
if (allocated (tau_limb)) deallocate (tau_limb)
if (allocated (days_limb)) deallocate(days_limb)

is_initialized = .false.

end subroutine GFS_phys_time_vary_finalize
Expand Down
95 changes: 94 additions & 1 deletion physics/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[ccpp-table-properties]
name = GFS_phys_time_vary
type = scheme
dependencies = aerclm_def.F,aerinterp.F90,gcycle.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f,namelist_soilveg.f,ozinterp.f90,ozne_def.f,sfcsub.F
dependencies = aerclm_def.F,aerinterp.F90,gcycle.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f,namelist_soilveg.f,ozinterp.f90,ozne_def.f,sfcsub.F,cires_tauamf_data.F90

########################################################################
[ccpp-arg-table]
Expand Down Expand Up @@ -315,6 +315,48 @@
type = integer
intent = in
optional = F
[do_ugwp_v1]
standard_name = do_ugwp_v1
long_name = flag to activate ver 1 CIRES UGWP
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[jindx1_tau]
standard_name = index_interp_weight1_taungw
long_name = index1 for weight1 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = inout
optional = F
[jindx2_tau]
standard_name = index_interp_weight2_taungw
long_name = index2 for weight2 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = inout
optional = F
[ddy_j1tau]
standard_name = interp_weight1_taungw
long_name = interpolation weight1 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = real
intent = inout
kind = kind_phys
optional = F
[ddy_j2tau]
standard_name = interp_weight2_taungw
long_name = interpolation weight2 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = real
intent = inout
kind = kind_phys
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down Expand Up @@ -1335,6 +1377,57 @@
kind = kind_phys
intent = inout
optional = F
[do_ugwp_v1]
standard_name = do_ugwp_v1
long_name = flag to activate ver 1 CIRES UGWP
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[jindx1_tau]
standard_name = index_interp_weight1_taungw
long_name = index1 for weight1 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = in
optional = F
[jindx2_tau]
standard_name = index_interp_weight2_taungw
long_name = index2 for weight2 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = integer
intent = in
optional = F
[ddy_j1tau]
standard_name = interp_weight1_taungw
long_name = interpolation weight1 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = real
intent = in
kind = kind_phys
optional = F
[ddy_j2tau]
standard_name = interp_weight2_taungw
long_name = interpolation weight2 for tau NGWs
units = none
dimensions = (horizontal_loop_extent)
type = real
intent = in
kind = kind_phys
optional = F
[tau_amf]
standard_name = ngw_abs_momentum_flux
long_name = ngw_absolute_momentum_flux
units = various
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
Loading