Skip to content

Commit 8103e21

Browse files
authored
Merge pull request ufs-community#207 from Qingfu-Liu/HR4-GWD-update
HR4 Gravity Wave Drag Update
2 parents 16a1d88 + c6dec90 commit 8103e21

6 files changed

+1387
-26
lines changed

physics/GWD/drag_suite.F90

+1,235-10
Large diffs are not rendered by default.

physics/GWD/drag_suite.meta

+8
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,14 @@
521521
type = real
522522
kind = kind_phys
523523
intent = in
524+
[alpha_fd]
525+
standard_name = alpha_coefficient_for_turbulent_orographic_form_drag
526+
long_name = alpha coefficient for Beljaars et al turbulent orographic form drag
527+
units = 1
528+
dimensions = ()
529+
type = real
530+
kind = kind_phys
531+
intent = in
524532
[me]
525533
standard_name = mpi_rank
526534
long_name = rank of the current MPI task

physics/GWD/ugwpv1_gsldrag.F90

+38-10
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module ugwpv1_gsldrag
4444
use cires_ugwpv1_solv2, only: cires_ugwpv1_ngw_solv2
4545
use cires_ugwpv1_oro, only: orogw_v1
4646

47-
use drag_suite, only: drag_suite_run
47+
use drag_suite, only: drag_suite_run, drag_suite_psl
4848

4949
implicit none
5050

@@ -305,11 +305,13 @@ end subroutine ugwpv1_gsldrag_finalize
305305
!! @{
306306
subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, &
307307
fhzero, kdt, ldiag3d, lssav, flag_for_gwd_generic_tend, do_gsl_drag_ls_bl, &
308-
do_gsl_drag_ss, do_gsl_drag_tofd, do_ugwp_v1, do_ugwp_v1_orog_only, &
308+
do_gsl_drag_ss, do_gsl_drag_tofd, &
309+
do_gwd_opt_psl, psl_gwd_dx_factor, &
310+
do_ugwp_v1, do_ugwp_v1_orog_only, &
309311
do_ugwp_v1_w_gsldrag, gwd_opt, do_tofd, ldiag_ugwp, ugwp_seq_update, &
310-
cdmbgwd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, &
312+
cdmbgwd, alpha_fd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, &
311313
elvmax, clx, oa4, varss,oc1ss,oa4ss,ol4ss, dx, xlat, xlat_d, sinlat, coslat, &
312-
area, rain, br1, hpbl, kpbl, slmsk, &
314+
area, rain, br1, hpbl,vtype, kpbl, slmsk, &
313315
ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, del, tau_amf, &
314316
dudt_ogw, dvdt_ogw, du_ogwcol, dv_ogwcol, &
315317
dudt_obl, dvdt_obl, du_oblcol, dv_oblcol, &
@@ -367,11 +369,13 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
367369
real(kind=kind_phys), intent(in) :: dtp, fhzero
368370
real(kind=kind_phys), intent(in) :: ak(:), bk(:)
369371
integer, intent(in) :: kdt, jdat(:)
370-
372+
! option for psl gwd
373+
logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag
374+
real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor !
371375
! SSO parameters and variables
372376
integer, intent(in) :: gwd_opt !gwd_opt and nmtvr are "redundant" controls
373377
integer, intent(in) :: nmtvr
374-
real(kind=kind_phys), intent(in) :: cdmbgwd(:) ! for gsl_drag
378+
real(kind=kind_phys), intent(in) :: cdmbgwd(:), alpha_fd ! for gsl_drag
375379

376380
real(kind=kind_phys), intent(in), dimension(:) :: hprime, oc, theta, sigma, gamma
377381

@@ -397,10 +401,10 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
397401
real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii
398402
real(kind=kind_phys), intent(in), dimension(:,:) :: q1
399403
integer, intent(in), dimension(:) :: kpbl
404+
integer, intent(in), dimension(:) :: vtype
400405

401406
real(kind=kind_phys), intent(in), dimension(:) :: rain
402-
real(kind=kind_phys), intent(in), dimension(:) :: br1, slmsk
403-
real(kind=kind_phys), intent(in), dimension(:) :: hpbl
407+
real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk
404408
!
405409
! moved to GFS_phys_time_vary
406410
! real(kind=kind_phys), intent(in), dimension(:) :: ddy_j1tau, ddy_j2tau
@@ -545,6 +549,28 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
545549
! dusfcg, dvsfcg
546550
!
547551
!
552+
if (do_gwd_opt_psl) then
553+
call drag_suite_psl(im, levs, Pdvdt, Pdudt, Pdtdt, &
554+
ugrs,vgrs,tgrs,q1, &
555+
kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
556+
kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, &
557+
ol4ss,theta,sigma,gamma,elvmax, &
558+
dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, &
559+
dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, &
560+
dusfcg, dvsfcg, &
561+
du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
562+
du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, &
563+
slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, &
564+
con_fv, con_pi, lonr, &
565+
cdmbgwd(1:2),alpha_fd,me,master, &
566+
lprnt,ipr,rdxzb,dx,gwd_opt, &
567+
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
568+
psl_gwd_dx_factor, &
569+
dtend, dtidx, index_of_process_orographic_gwd, &
570+
index_of_temperature, index_of_x_wind, &
571+
index_of_y_wind, ldiag3d, ldiag_ugwp, &
572+
ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
573+
else
548574
call drag_suite_run(im, levs, Pdvdt, Pdudt, Pdtdt, &
549575
ugrs,vgrs,tgrs,q1, &
550576
kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
@@ -555,14 +581,16 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp,
555581
dusfcg, dvsfcg, &
556582
du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
557583
du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, &
558-
slmsk,br1,hpbl, con_g,con_cp,con_rd,con_rv, &
584+
slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, &
559585
con_fv, con_pi, lonr, &
560-
cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, &
586+
cdmbgwd(1:2),alpha_fd,me,master, &
587+
lprnt,ipr,rdxzb,dx,gwd_opt, &
561588
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
562589
dtend, dtidx, index_of_process_orographic_gwd, &
563590
index_of_temperature, index_of_x_wind, &
564591
index_of_y_wind, ldiag3d, ldiag_ugwp, &
565592
ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
593+
endif
566594
!
567595
! dusfcg = du_ogwcol + du_oblcol + du_osscol + du_ofdcol
568596
!

physics/GWD/ugwpv1_gsldrag.meta

+30
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,21 @@
402402
dimensions = ()
403403
type = logical
404404
intent = in
405+
[do_gwd_opt_psl]
406+
standard_name = do_gsl_drag_suite_with_psl_gwd_option
407+
long_name = flag to activate PSL drag suite - mesoscale GWD and blocking
408+
units = flag
409+
dimensions = ()
410+
type = logical
411+
intent = in
412+
[psl_gwd_dx_factor]
413+
standard_name = effective_grid_spacing_of_psl_gwd_suite
414+
long_name = multiplication of grid spacing
415+
units = 1
416+
dimensions = ()
417+
type = real
418+
kind = kind_phys
419+
intent = in
405420
[do_ugwp_v1]
406421
standard_name = flag_for_ugwp_version_1
407422
long_name = flag to activate ver 1 CIRES UGWP
@@ -459,6 +474,14 @@
459474
type = real
460475
kind = kind_phys
461476
intent = in
477+
[alpha_fd]
478+
standard_name = alpha_coefficient_for_turbulent_orographic_form_drag
479+
long_name = alpha coefficient for Beljaars et al turbulent orographic form drag
480+
units = 1
481+
dimensions = ()
482+
type = real
483+
kind = kind_phys
484+
intent = in
462485
[jdat]
463486
standard_name = date_and_time_of_forecast_in_united_states_order
464487
long_name = current forecast date and time
@@ -645,6 +668,13 @@
645668
type = real
646669
kind = kind_phys
647670
intent = in
671+
[vtype]
672+
standard_name = vegetation_type_classification
673+
long_name = vegetation type for lsm
674+
units = index
675+
dimensions = (horizontal_loop_extent)
676+
type = integer
677+
intent = in
648678
[kpbl]
649679
standard_name = vertical_index_at_top_of_atmosphere_boundary_layer
650680
long_name = vertical index at top atmospheric boundary layer

physics/GWD/unified_ugwp.F90

+46-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module unified_ugwp
4040
use gwdps, only: gwdps_run
4141
use cires_ugwp_triggers
4242
use ugwp_driver_v0
43-
use drag_suite, only: drag_suite_run
43+
use drag_suite, only: drag_suite_run, drag_suite_psl
4444

4545
implicit none
4646

@@ -249,8 +249,8 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
249249
varss,oc1ss,oa4ss,ol4ss,dx,dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl,dusfc_ss, &
250250
dvsfc_ss,dusfc_fd,dvsfc_fd,dtaux2d_ms,dtauy2d_ms,dtaux2d_bl,dtauy2d_bl, &
251251
dtaux2d_ss,dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dudt_ngw,dvdt_ngw,dtdt_ngw, &
252-
br1,hpbl,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, &
253-
cdmbgwd, jdat, xlat, xlat_d, sinlat, coslat, area, &
252+
br1,hpbl,vtype,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, &
253+
cdmbgwd, alpha_fd, jdat, xlat, xlat_d, sinlat, coslat, area, &
254254
ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, &
255255
del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, &
256256
tau_tofd, tau_mtb, tau_ogw, tau_ngw, &
@@ -262,6 +262,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
262262
index_of_process_nonorographic_gwd, &
263263
lssav, flag_for_gwd_generic_tend, do_ugwp_v0, do_ugwp_v0_orog_only, &
264264
do_ugwp_v0_nst_only, do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, &
265+
do_gwd_opt_psl, psl_gwd_dx_factor, &
265266
gwd_opt, spp_wts_gwd, spp_gwd, errmsg, errflg)
266267

267268
implicit none
@@ -270,6 +271,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
270271
integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr
271272
integer, intent(in) :: gwd_opt
272273
integer, intent(in), dimension(:) :: kpbl
274+
integer, intent(in), dimension(:) :: vtype
273275
real(kind=kind_phys), intent(in), dimension(:) :: ak, bk
274276
real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma
275277
real(kind=kind_phys), intent(in), dimension(:), optional :: varss,oc1ss
@@ -288,7 +290,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
288290
real(kind=kind_phys), intent(in), dimension(:,:) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil
289291
real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii
290292
real(kind=kind_phys), intent(in), dimension(:,:) :: q1
291-
real(kind=kind_phys), intent(in) :: dtp, fhzero, cdmbgwd(:)
293+
real(kind=kind_phys), intent(in) :: dtp, fhzero, cdmbgwd(:), alpha_fd
292294
integer, intent(in) :: jdat(:)
293295
logical, intent(in) :: do_tofd, ldiag_ugwp, ugwp_seq_update
294296

@@ -346,6 +348,10 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
346348
real(kind=kind_phys), intent(in), optional :: spp_wts_gwd(:,:)
347349
integer, intent(in) :: spp_gwd
348350

351+
! option for psl gwd
352+
logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag
353+
real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor !
354+
349355
character(len=*), intent(out) :: errmsg
350356
integer, intent(out) :: errflg
351357

@@ -379,6 +385,18 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
379385
errflg = 0
380386

381387

388+
! Initialize intent(out) variables in case they are not set below
389+
dusfcg(:) = 0.0
390+
dvsfcg(:) = 0.0
391+
rdxzb(:) = 0.0
392+
tau_ngw(:) = 0.0
393+
gw_dudt(:,:) = 0.0
394+
gw_dvdt(:,:) = 0.0
395+
gw_dtdt(:,:) = 0.0
396+
gw_kdis(:,:) = 0.0
397+
dudt_mtb(:,:) = 0.0
398+
dudt_tms(:,:) = 0.0
399+
382400
! 1) ORO stationary GWs
383401
! ------------------
384402

@@ -488,7 +506,27 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
488506
! Note: In case of GSL drag_suite, this includes ss and tofd
489507

490508
if ( do_gsl_drag_ls_bl.or.do_gsl_drag_ss.or.do_gsl_drag_tofd ) then
491-
509+
!
510+
if (do_gwd_opt_psl) then
511+
call drag_suite_psl(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, &
512+
tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
513+
kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, &
514+
ol4ss,theta,sigma,gamma,elvmax,dtaux2d_ms, &
515+
dtauy2d_ms,dtaux2d_bl,dtauy2d_bl,dtaux2d_ss, &
516+
dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dusfcg, &
517+
dvsfcg,dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl, &
518+
dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, &
519+
slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, &
520+
con_fvirt,con_pi,lonr, &
521+
cdmbgwd,alpha_fd,me,master, &
522+
lprnt,ipr,rdxzb,dx,gwd_opt, &
523+
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
524+
psl_gwd_dx_factor, &
525+
dtend, dtidx, index_of_process_orographic_gwd, &
526+
index_of_temperature, index_of_x_wind, &
527+
index_of_y_wind, ldiag3d, ldiag_ugwp, &
528+
ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
529+
else
492530
call drag_suite_run(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, &
493531
tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
494532
kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, &
@@ -499,12 +537,14 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
499537
dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, &
500538
slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, &
501539
con_fvirt,con_pi,lonr, &
502-
cdmbgwd,me,master,lprnt,ipr,rdxzb,dx,gwd_opt, &
540+
cdmbgwd,alpha_fd,me,master, &
541+
lprnt,ipr,rdxzb,dx,gwd_opt, &
503542
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
504543
dtend, dtidx, index_of_process_orographic_gwd, &
505544
index_of_temperature, index_of_x_wind, &
506545
index_of_y_wind, ldiag3d, ldiag_ugwp, &
507546
ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
547+
endif
508548
!
509549
! put zeros due to xy GSL-drag style: dtaux2d_bl,dtauy2d_bl,dtaux2d_ss.......dusfc_ms,dvsfc_ms
510550
!

physics/GWD/unified_ugwp.meta

+30
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,13 @@
671671
type = real
672672
kind = kind_phys
673673
intent = in
674+
[vtype]
675+
standard_name = vegetation_type_classification
676+
long_name = vegetation type for lsm
677+
units = index
678+
dimensions = (horizontal_loop_extent)
679+
type = integer
680+
intent = in
674681
[slmsk]
675682
standard_name = area_type
676683
long_name = landmask: sea/land/ice=0/1/2
@@ -708,6 +715,14 @@
708715
type = real
709716
kind = kind_phys
710717
intent = in
718+
[alpha_fd]
719+
standard_name = alpha_coefficient_for_turbulent_orographic_form_drag
720+
long_name = alpha coefficient for Beljaars et al turbulent orographic form drag
721+
units = 1
722+
dimensions = ()
723+
type = real
724+
kind = kind_phys
725+
intent = in
711726
[jdat]
712727
standard_name = date_and_time_of_forecast_in_united_states_order
713728
long_name = current forecast date and time
@@ -1221,6 +1236,21 @@
12211236
dimensions = ()
12221237
type = logical
12231238
intent = in
1239+
[do_gwd_opt_psl]
1240+
standard_name = do_gsl_drag_suite_with_psl_gwd_option
1241+
long_name = flag to activate PSL drag suite - mesoscale GWD and blocking
1242+
units = flag
1243+
dimensions = ()
1244+
type = logical
1245+
intent = in
1246+
[psl_gwd_dx_factor]
1247+
standard_name = effective_grid_spacing_of_psl_gwd_suite
1248+
long_name = multiplication of grid spacing
1249+
units = 1
1250+
dimensions = ()
1251+
type = real
1252+
kind = kind_phys
1253+
intent = in
12241254
[gwd_opt]
12251255
standard_name = control_for_drag_suite_gravity_wave_drag
12261256
long_name = flag to choose gwd scheme

0 commit comments

Comments
 (0)