Skip to content

Commit

Permalink
Added Songyou's merged code
Browse files Browse the repository at this point in the history
  • Loading branch information
mdtoyNOAA committed Mar 29, 2024
1 parent 53062d6 commit eff7680
Show file tree
Hide file tree
Showing 9 changed files with 431 additions and 35 deletions.
237 changes: 228 additions & 9 deletions physics/GWD/drag_suite.F90

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions physics/GWD/drag_suite.meta
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,13 @@
type = real
kind = kind_phys
intent = in
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = in
[g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down Expand Up @@ -573,6 +580,21 @@
dimensions = ()
type = logical
intent = in
[do_gwd_opt_psl]
standard_name = do_gsl_drag_suite_with_psl_gwd_option
long_name = flag to activate PSL drag suite - mesoscale GWD and blocking
units = flag
dimensions = ()
type = logical
intent = in
[psl_gwd_dx_factor]
standard_name = effective_grid_spacing_of_psl_gwd_suite
long_name = multiplication of grid spacing
units = count
dimensions = ()
type = real
kind = kind_phys
intent = in
[dtend]
standard_name = cumulative_change_of_state_variables
long_name = diagnostic tendencies for state variables
Expand Down
14 changes: 10 additions & 4 deletions physics/GWD/ugwpv1_gsldrag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,13 @@ end subroutine ugwpv1_gsldrag_finalize
!! @{
subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, &
fhzero, kdt, ldiag3d, lssav, flag_for_gwd_generic_tend, do_gsl_drag_ls_bl, &
do_gsl_drag_ss, do_gsl_drag_tofd, do_ugwp_v1, do_ugwp_v1_orog_only, &
do_gsl_drag_ss, do_gsl_drag_tofd, &
do_gwd_opt_psl, psl_gwd_dx_factor, &
do_ugwp_v1, do_ugwp_v1_orog_only, &
do_ugwp_v1_w_gsldrag, gwd_opt, do_tofd, ldiag_ugwp, ugwp_seq_update, &
cdmbgwd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, &
elvmax, clx, oa4, varss,oc1ss,oa4ss,ol4ss, dx, xlat, xlat_d, sinlat, coslat, &
area, rain, br1, hpbl, kpbl, slmsk, &
area, rain, br1, hpbl,vtype, kpbl, slmsk, &
ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, del, tau_amf, &
dudt_ogw, dvdt_ogw, du_ogwcol, dv_ogwcol, &
dudt_obl, dvdt_obl, du_oblcol, dv_oblcol, &
Expand Down Expand Up @@ -367,7 +369,9 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
real(kind=kind_phys), intent(in) :: dtp, fhzero
real(kind=kind_phys), intent(in) :: ak(:), bk(:)
integer, intent(in) :: kdt, jdat(:)

! option for psl gwd
logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag
real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor !
! SSO parameters and variables
integer, intent(in) :: gwd_opt !gwd_opt and nmtvr are "redundant" controls
integer, intent(in) :: nmtvr
Expand Down Expand Up @@ -396,6 +400,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii
real(kind=kind_phys), intent(in), dimension(:,:) :: q1
integer, intent(in), dimension(:) :: kpbl
integer, intent(in), dimension(:) :: vtype

real(kind=kind_phys), intent(in), dimension(:) :: rain
real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk
Expand Down Expand Up @@ -554,10 +559,11 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
dusfcg, dvsfcg, &
du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, &
slmsk,br1,hpbl, con_g,con_cp,con_rd,con_rv, &
slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, &
con_fv, con_pi, lonr, &
cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, &
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
do_gwd_opt_psl, psl_gwd_dx_factor, &
dtend, dtidx, index_of_process_orographic_gwd, &
index_of_temperature, index_of_x_wind, &
index_of_y_wind, ldiag3d, ldiag_ugwp, &
Expand Down
22 changes: 22 additions & 0 deletions physics/GWD/ugwpv1_gsldrag.meta
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,21 @@
dimensions = ()
type = logical
intent = in
[do_gwd_opt_psl]
standard_name = do_gsl_drag_suite_with_psl_gwd_option
long_name = flag to activate PSL drag suite - mesoscale GWD and blocking
units = flag
dimensions = ()
type = logical
intent = in
[psl_gwd_dx_factor]
standard_name = effective_grid_spacing_of_psl_gwd_suite
long_name = multiplication of grid spacing
units = count
dimensions = ()
type = real
kind = kind_phys
intent = in
[do_ugwp_v1]
standard_name = flag_for_ugwp_version_1
long_name = flag to activate ver 1 CIRES UGWP
Expand Down Expand Up @@ -641,6 +656,13 @@
type = real
kind = kind_phys
intent = in
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = in
[kpbl]
standard_name = vertical_index_at_top_of_atmosphere_boundary_layer
long_name = vertical index at top atmospheric boundary layer
Expand Down
11 changes: 9 additions & 2 deletions physics/GWD/unified_ugwp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
varss,oc1ss,oa4ss,ol4ss,dx,dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl,dusfc_ss, &
dvsfc_ss,dusfc_fd,dvsfc_fd,dtaux2d_ms,dtauy2d_ms,dtaux2d_bl,dtauy2d_bl, &
dtaux2d_ss,dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dudt_ngw,dvdt_ngw,dtdt_ngw, &
br1,hpbl,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, &
br1,hpbl,vtype,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, &
cdmbgwd, jdat, xlat, xlat_d, sinlat, coslat, area, &
ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, &
del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, &
Expand All @@ -262,6 +262,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
index_of_process_nonorographic_gwd, &
lssav, flag_for_gwd_generic_tend, do_ugwp_v0, do_ugwp_v0_orog_only, &
do_ugwp_v0_nst_only, do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, &
do_gwd_opt_psl, psl_gwd_dx_factor, &
gwd_opt, spp_wts_gwd, spp_gwd, errmsg, errflg)

implicit none
Expand All @@ -270,6 +271,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr
integer, intent(in) :: gwd_opt
integer, intent(in), dimension(:) :: kpbl
integer, intent(in), dimension(:) :: vtype
real(kind=kind_phys), intent(in), dimension(:) :: ak, bk
real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma
real(kind=kind_phys), intent(in), dimension(:) :: varss,oc1ss, dx
Expand Down Expand Up @@ -345,6 +347,10 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:)
integer, intent(in) :: spp_gwd

! option for psl gwd
logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag
real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor !

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

Expand Down Expand Up @@ -496,10 +502,11 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dusfcg, &
dvsfcg,dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl, &
dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, &
slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, &
slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, &
con_fvirt,con_pi,lonr, &
cdmbgwd,me,master,lprnt,ipr,rdxzb,dx,gwd_opt, &
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
do_gwd_opt_psl, psl_gwd_dx_factor, &
dtend, dtidx, index_of_process_orographic_gwd, &
index_of_temperature, index_of_x_wind, &
index_of_y_wind, ldiag3d, ldiag_ugwp, &
Expand Down
22 changes: 22 additions & 0 deletions physics/GWD/unified_ugwp.meta
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,13 @@
type = real
kind = kind_phys
intent = in
[vtype]
standard_name = vegetation_type_classification
long_name = vegetation type for lsm
units = index
dimensions = (horizontal_dimension)
type = integer
intent = in
[slmsk]
standard_name = area_type
long_name = landmask: sea/land/ice=0/1/2
Expand Down Expand Up @@ -1218,6 +1225,21 @@
dimensions = ()
type = logical
intent = in
[do_gwd_opt_psl]
standard_name = do_gsl_drag_suite_with_psl_gwd_option
long_name = flag to activate PSL drag suite - mesoscale GWD and blocking
units = flag
dimensions = ()
type = logical
intent = in
[psl_gwd_dx_factor]
standard_name = effective_grid_spacing_of_psl_gwd_suite
long_name = multiplication of grid spacing
units = count
dimensions = ()
type = real
kind = kind_phys
intent = in
[gwd_opt]
standard_name = control_for_drag_suite_gravity_wave_drag
long_name = flag to choose gwd scheme
Expand Down
Loading

0 comments on commit eff7680

Please sign in to comment.