@@ -40,7 +40,7 @@ module unified_ugwp
40
40
use gwdps, only: gwdps_run
41
41
use cires_ugwp_triggers
42
42
use ugwp_driver_v0
43
- use drag_suite, only: drag_suite_run
43
+ use drag_suite, only: drag_suite_run, drag_suite_psl
44
44
45
45
implicit none
46
46
@@ -249,8 +249,8 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
249
249
varss ,oc1ss ,oa4ss ,ol4ss ,dx ,dusfc_ms ,dvsfc_ms ,dusfc_bl ,dvsfc_bl ,dusfc_ss , &
250
250
dvsfc_ss ,dusfc_fd ,dvsfc_fd ,dtaux2d_ms ,dtauy2d_ms ,dtaux2d_bl ,dtauy2d_bl , &
251
251
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 , &
254
254
ugrs , vgrs , tgrs , q1 , prsi , prsl , prslk , phii , phil , &
255
255
del , kpbl , dusfcg , dvsfcg , gw_dudt , gw_dvdt , gw_dtdt , gw_kdis , &
256
256
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
262
262
index_of_process_nonorographic_gwd , &
263
263
lssav , flag_for_gwd_generic_tend , do_ugwp_v0 , do_ugwp_v0_orog_only , &
264
264
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 , &
265
266
gwd_opt , spp_wts_gwd , spp_gwd , errmsg , errflg )
266
267
267
268
implicit none
@@ -270,6 +271,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
270
271
integer , intent (in ) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr
271
272
integer , intent (in ) :: gwd_opt
272
273
integer , intent (in ), dimension (:) :: kpbl
274
+ integer , intent (in ), dimension (:) :: vtype
273
275
real (kind= kind_phys), intent (in ), dimension (:) :: ak, bk
274
276
real (kind= kind_phys), intent (in ), dimension (:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma
275
277
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
288
290
real (kind= kind_phys), intent (in ), dimension (:,:) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil
289
291
real (kind= kind_phys), intent (in ), dimension (:,:) :: prsi, phii
290
292
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
292
294
integer , intent (in ) :: jdat(:)
293
295
logical , intent (in ) :: do_tofd, ldiag_ugwp, ugwp_seq_update
294
296
@@ -346,6 +348,10 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
346
348
real (kind= kind_phys), intent (in ), optional :: spp_wts_gwd(:,:)
347
349
integer , intent (in ) :: spp_gwd
348
350
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
+
349
355
character (len=* ), intent (out ) :: errmsg
350
356
integer , intent (out ) :: errflg
351
357
@@ -379,6 +385,18 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
379
385
errflg = 0
380
386
381
387
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
+
382
400
! 1) ORO stationary GWs
383
401
! ------------------
384
402
@@ -488,7 +506,27 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt
488
506
! Note: In case of GSL drag_suite, this includes ss and tofd
489
507
490
508
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
492
530
call drag_suite_run(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, &
493
531
tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
494
532
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
499
537
dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, &
500
538
slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, &
501
539
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, &
503
542
do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
504
543
dtend, dtidx, index_of_process_orographic_gwd, &
505
544
index_of_temperature, index_of_x_wind, &
506
545
index_of_y_wind, ldiag3d, ldiag_ugwp, &
507
546
ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
547
+ endif
508
548
!
509
549
! put zeros due to xy GSL-drag style: dtaux2d_bl,dtauy2d_bl,dtaux2d_ss.......dusfc_ms,dvsfc_ms
510
550
!
0 commit comments