Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UGWP v0 v1 combined #561

Merged
merged 23 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2fd0bb3
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into gs…
ValeryYudin-NOAA Jan 10, 2021
6d1994c
update Jan 9 2021 from NCAR/ccpp-physics
ValeryYudin-NOAA Jan 10, 2021
7ddfb71
cires_ugwpv1*90 new ; ugwpv1_gsldrag* new unified_ugwp.* modified
ValeryYudin-NOAA Jan 10, 2021
9ebf28b
physics/cires_tauamf_data.F90 ugwp-data
ValeryYudin-NOAA Jan 11, 2021
e7cd306
Added new logical flag do_ugwp_v0_nst_only which allows non-stationar…
mdtoyNOAA Jan 17, 2021
8463f3a
new GFS_phys_time_vary.fv3.F90; and new ugwp_common instead physcons
ValeryYudin-NOAA Jan 20, 2021
21ace2c
git update with cccp/master 2021-01-20
ValeryYudin-NOAA Jan 20, 2021
ec3384a
Merge branch 'unified_ugwp_jan_2021_update' of https://github.com/mdt…
climbfuji Jan 21, 2021
c07f9df
Merge branch 'master' of https://github.com/valeryyudin-noaa/ccpp-phy…
climbfuji Jan 21, 2021
79dd17e
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into ug…
climbfuji Jan 22, 2021
a5547cb
Fix formatting in physics/GFS_phys_time_vary.fv3.F90
climbfuji Jan 26, 2021
2b4489a
compiling all 3 GW suites
ValeryYudin-NOAA Jan 28, 2021
4f3fa2a
Merge pull request #6 from ValeryYudin-NOAA/ugwp_v0_v1_combined_vay
climbfuji Jan 28, 2021
a0efcb4
Update GFS_debug.F90 with new variables
climbfuji Feb 1, 2021
f4c0b0b
Replace tabs with whitespaces in physics/cires_ugwpv1_solv2.F90, trim…
climbfuji Feb 1, 2021
28a7793
Fix uninitialized variables in physics/cires_ugwpv1_solv2.F90
climbfuji Feb 3, 2021
7d45f10
Update and cleanup of UGWPv0, UGWpv1 and drag suite standard names
climbfuji Feb 9, 2021
8be0803
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into ug…
climbfuji Feb 9, 2021
e354d11
Update physics/GFS_debug.F90 with additional UGWP changes
climbfuji Feb 10, 2021
828759a
Update physics/GFS_debug.F90, and fix formatting in physics/ugwpv1_gs…
climbfuji Feb 11, 2021
ea77544
physics/ugwpv1_gsldrag.F90: adjust formatting
climbfuji Feb 11, 2021
04ecde3
Bugfix in physics/ugwpv1_gsldrag.F90, 3d diagnostic arrays may not be…
climbfuji Feb 12, 2021
8e4caf1
Bugfix in physics/GFS_debug.F90
climbfuji Feb 16, 2021
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
56 changes: 45 additions & 11 deletions physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,31 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%exch_h ', Diag%exch_h)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%exch_m ', Diag%exch_m)
end if
! UGWP - incomplete list
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dudt_gw ', Diag%dudt_gw)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dvdt_gw ', Diag%dvdt_gw)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dtdt_gw ', Diag%dtdt_gw)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%kdis_gw ', Diag%kdis_gw)
if (Model%do_ugwp_v1 .or. Model%gwd_opt==33 .or. Model%gwd_opt==22) then
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dudt_ogw ', Diag%dudt_ogw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dvdt_ogw ', Diag%dvdt_ogw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dudt_obl ', Diag%dudt_obl )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dvdt_obl ', Diag%dvdt_obl )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dudt_oss ', Diag%dudt_oss )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dvdt_oss ', Diag%dvdt_oss )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dudt_ofd ', Diag%dudt_ofd )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dvdt_ofd ', Diag%dvdt_ofd )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%du_ogwcol ', Diag%du_ogwcol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dv_ogwcol ', Diag%dv_ogwcol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%du_oblcol ', Diag%du_oblcol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dv_oblcol ', Diag%dv_oblcol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%du_osscol ', Diag%du_osscol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dv_osscol ', Diag%dv_osscol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%du_ofdcol ', Diag%du_ofdcol)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dv_ofdcol ', Diag%dv_ofdcol)
else
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%dudt_ogw ', Diag%dudt_ogw)
end if
! Statein
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Statein%phii' , Statein%phii)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Statein%prsi' , Statein%prsi)
Expand Down Expand Up @@ -824,8 +849,12 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling,
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Grid%jindx1_h', Grid%jindx1_h)
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Grid%jindx2_h', Grid%jindx2_h)
endif
! Model/Control
! not yet
if (Model%do_ugwp_v1) then
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Grid%ddy_j1tau ', Grid%ddy_j1tau )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Grid%ddy_j2tau ', Grid%ddy_j2tau )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Grid%jindx1_tau', Grid%jindx1_tau )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Grid%jindx2_tau', Grid%jindx2_tau )
endif
end if
#ifdef OPENMP
!$OMP BARRIER
Expand Down Expand Up @@ -1229,23 +1258,28 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zorl_land ', Interstitial%zorl_land )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zorl_ocean ', Interstitial%zorl_ocean )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zt1d ', Interstitial%zt1d )
! CIRES UGWP v0
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%gw_dudt ', Interstitial%gw_dudt )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%gw_dvdt ', Interstitial%gw_dvdt )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%gw_dtdt ', Interstitial%gw_dtdt )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%gw_kdis ', Interstitial%gw_kdis )
! UGWP
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%tau_mtb ', Interstitial%tau_mtb )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%tau_ogw ', Interstitial%tau_ogw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%tau_tofd ', Interstitial%tau_tofd )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%tau_ngw ', Interstitial%tau_ngw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%tau_oss ', Interstitial%tau_oss )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dudt_mtb ', Interstitial%dudt_mtb )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dudt_tms ', Interstitial%dudt_tms )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zmtb ', Interstitial%zmtb )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zlwb ', Interstitial%zlwb )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zogw ', Interstitial%zogw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dudt_mtb ', Interstitial%dudt_mtb )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dudt_ogw ', Interstitial%dudt_ogw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dudt_tms ', Interstitial%dudt_tms )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%zngw ', Interstitial%zngw )
! UGWP v1
if (Model%do_ugwp_v1) then
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dudt_ngw ', Interstitial%dudt_ngw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dvdt_ngw ', Interstitial%dvdt_ngw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%dtdt_ngw ', Interstitial%dtdt_ngw )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%kdis_ngw ', Interstitial%kdis_ngw )
end if
!-- GSD drag suite
if (Model%gwd_opt==3 .or. Model%gwd_opt==33) then
if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. &
Model%gwd_opt==2 .or. Model%gwd_opt==22) then
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%varss ', Interstitial%varss )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%ocss ', Interstitial%ocss )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%oa4ss ', Interstitial%oa4ss )
Expand Down
50 changes: 45 additions & 5 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
!! Contains code related to GFS physics suite setup (physics part of time_vary_step)

!>\defgroup mod_GFS_phys_time_vary GFS Physics Time Update
!! This module contains GFS physics time vary subroutines including ozone, stratospheric water vapor,
!! aerosol, IN&CCN and surface properties updates.
!! This module contains GFS physics time vary subroutines including ozone, stratospheric water vapor,
!! aerosol, IN&CCN and surface properties updates.
!> @{
module GFS_phys_time_vary

Expand All @@ -29,6 +29,9 @@ module GFS_phys_time_vary

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

!--- variables needed for calculating 'sncovr'
use namelist_soilveg, only: salp_data, snupx
use set_soilveg_mod, only: set_soilveg
Expand Down Expand Up @@ -60,6 +63,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, &
isot, ivegsrc, nlunit, sncovr, sncovr_ice, lsm, lsm_ruc, min_seaice, fice, landfrac, &
vtype, weasd, nthrds, errmsg, errflg)

Expand All @@ -80,6 +84,9 @@ 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) :: isot, ivegsrc, nlunit
real(kind_phys), intent(inout) :: sncovr(:), sncovr_ice(:)
Expand Down Expand Up @@ -110,14 +117,15 @@ 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 shared (isot,ivegsrc,nlunit,sncovr,sncovr_ice,lsm,lsm_ruc) &
!$OMP shared (min_seaice,fice,landfrac,vtype,weasd,snupx,salp_data) &
!$OMP private (ix,i,j,rsnow,vegtyp)

!$OMP sections

!$OMP section
!> - Call read_o3data() to read ozone data
!> - Call read_o3data() to read ozone data
call read_o3data (ntoz, me, master)

! Consistency check that the hardcoded values for levozp and
Expand Down Expand Up @@ -189,6 +197,12 @@ subroutine GFS_phys_time_vary_init (
! 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 section
!> - Initialize soil vegetation (needed for sncovr calculation further down)
call set_soilveg(me, isot, ivegsrc, nlunit)
Expand Down Expand Up @@ -228,6 +242,13 @@ subroutine GFS_phys_time_vary_init (
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 @@ -293,7 +314,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 @@ -317,6 +339,12 @@ 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
Expand All @@ -331,7 +359,7 @@ subroutine GFS_phys_time_vary_timestep_init (
zorli(:), zorll(:), zorlo(:), weasd(:), slope(:), snoalb(:), &
canopy(:), vfrac(:), vtype(:), stype(:), shdmin(:), shdmax(:), &
snowd(:), cv(:), cvb(:), cvt(:), oro(:), oro_uf(:), slmsk(:)
!

character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -425,6 +453,13 @@ subroutine GFS_phys_time_vary_timestep_init (
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 @@ -500,6 +535,11 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg)
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
Loading