CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
ugwpv1_gsldrag.F90
1
2
39
40 use machine, only: kind_phys
41
42 use cires_ugwpv1_triggers, only: slat_geos5_2020, slat_geos5_tamp_v1
43 use cires_ugwpv1_module, only: cires_ugwpv1_init, ngwflux_update, calendar_ugwp
44 use cires_ugwpv1_module, only: knob_ugwp_version, cires_ugwp_dealloc, tamp_mpa
45 use cires_ugwpv1_solv2, only: cires_ugwpv1_ngw_solv2
46 use cires_ugwpv1_oro, only: orogw_v1
47
48 use drag_suite, only: drag_suite_run, drag_suite_psl
49
50 implicit none
51
52 private
53
54 public ugwpv1_gsldrag_init, ugwpv1_gsldrag_run, ugwpv1_gsldrag_finalize
55
56 logical :: is_initialized = .false.
57
58contains
59
60! ------------------------------------------------------------------------
61! CCPP entry points for CIRES Unified Gravity Wave Physics (UGWP) scheme v0
62! ------------------------------------------------------------------------
67 subroutine ugwpv1_gsldrag_init ( &
68 me, master, nlunit, input_nml_file, logunit, &
69 fn_nml2, jdat, lonr, latr, levs, ak, bk, dtp, &
70 con_pi, con_rerth, con_p0, &
71 con_g, con_omega, con_cp, con_rd, con_rv,con_fvirt, &
72 do_ugwp,do_ugwp_v0, do_ugwp_v0_orog_only, do_gsl_drag_ls_bl, &
73 do_gsl_drag_ss, do_gsl_drag_tofd, do_ugwp_v1, &
74 do_ugwp_v1_orog_only, do_ugwp_v1_w_gsldrag, errmsg, errflg)
75
76 use ugwp_common
77
78!---- initialization of unified_ugwp
79 implicit none
80
81 integer, intent (in) :: me
82 integer, intent (in) :: master
83 integer, intent (in) :: nlunit
84 character(len=*), intent (in) :: input_nml_file(:)
85 integer, intent (in) :: logunit
86 integer, intent (in) :: jdat(:)
87 integer, intent (in) :: lonr
88 integer, intent (in) :: levs
89 integer, intent (in) :: latr
90 real(kind=kind_phys), intent (in) :: ak(:), bk(:)
91 real(kind=kind_phys), intent (in) :: dtp
92
93 real(kind=kind_phys), intent (in) :: con_p0, con_pi, con_rerth
94 real(kind=kind_phys), intent (in) :: con_g, con_cp, con_rd, con_rv, con_omega, con_fvirt
95 logical, intent (in) :: do_ugwp
96
97 logical, intent (in) :: do_ugwp_v0, do_ugwp_v0_orog_only, &
98 do_gsl_drag_ls_bl, do_gsl_drag_ss, &
99 do_gsl_drag_tofd, do_ugwp_v1, &
100 do_ugwp_v1_orog_only,do_ugwp_v1_w_gsldrag
101
102 character(len=*), intent (in) :: fn_nml2
103 !character(len=*), parameter :: fn_nml='input.nml'
104
105 integer :: ios
106 logical :: exists
107 real :: dxsg
108 integer :: k
109
110 character(len=*), intent(out) :: errmsg
111 integer, intent(out) :: errflg
112
113 ! Initialize CCPP error handling variables
114 errmsg = ''
115 errflg = 0
116!============================================================================
117!
118! gwd_opt => "1 and 2, 3, 22, 33' see previous GSL-commits
119! related to GSL-oro drag suite
120! for use of the new-GSL/old-GFS/EMC inputs for sub-grid orography
121! see details inside /ufs-weather-model/FV3/io/FV3GFS_io.F90
122! FV3GFS_io.F90: if (Model%gwd_opt==3 .or. Model%gwd_opt==33 .or. &
123! FV3GFS_io.F90: Model%gwd_opt==2 .or. Model%gwd_opt==22 ) then
124! FV3GFS_io.F90: if ( (Model%gwd_opt==3 .or. Model%gwd_opt==33) .or. &
125! FV3GFS_io.F90: ( (Model%gwd_opt==2 .or. Model%gwd_opt==22) .and. &
126!
127! gwd_opt=1 -current 14-element GFS-EMC subgrid-oro input
128! gwd_opt=2 and 3 24-element -current 14-element GFS-EMC subgrid-oro input
129! GSL uses the gwd_opt flag to control "extra" diagnostics (22 and 33)
130! CCPP may use gwd_opt to determine 14 or 24 variables for the input
131! but at present you work with "nmtvr"
132! GFS_GWD_generic.F90: integer, intent(in) :: im, levs, nmtvr
133!GFS_GWD_generic.F90: real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr)
134!GFS_GWD_generic.F90: if (nmtvr == 14) then ! gwd_opt=1 current operational - as of 2014
135!GFS_GWD_generic.F90: elseif (nmtvr == 10) then ????
136!GFS_GWD_generic.F90: elseif (nmtvr == 6) then ????
137!GFS_GWD_generic.F90: elseif (nmtvr == 24) then ! GSD_drag_suite and unified_ugwp gwd_opt=2,3
138!
139! 1) gsldrag: do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, do_ugwp_v1
140! 2) CIRES-v1: do_ugwp_v1, do_ugwp_v1_orog_only, do_tofd, ldiag_ugwp
141!==============================================================================
142 ! Test to make sure that at most only one large-scale/blocking
143 ! orographic drag scheme is chosen
144 if ( (do_ugwp_v0.and.(do_ugwp_v0_orog_only.or.do_gsl_drag_ls_bl.or. &
145 do_ugwp_v1.or.do_ugwp_v1_orog_only)) .or. &
146 (do_ugwp_v0_orog_only.and.(do_gsl_drag_ls_bl.or.do_ugwp_v1.or. &
147 do_ugwp_v1_orog_only)) .or. &
148 (do_gsl_drag_ls_bl.and.do_ugwp_v1_orog_only) ) then
149
150 write(errmsg,'(*(a))') "Logic error: Only one large-scale&
151 &/blocking scheme (do_ugwp_v0,do_ugwp_v0_orog_only,&
152 &do_gsl_drag_ls_bl,do_ugwp_v1 or &
153 &do_ugwp_v1_orog_only) can be chosen"
154 errflg = 1
155 return
156
157 end if
158!
159 if ( do_ugwp_v0_orog_only .or. do_ugwp_v0) then
160 print *, ' ccpp do_ugwp_v0 active ', do_ugwp_v0
161 print *, ' ccpp do_ugwp_v1_orog_only active ', do_ugwp_v0_orog_only
162 write(errmsg,'(*(a))') " the CIRES <ugwpv1_gsldrag> CCPP-suite does not &
163 support <ugwp_v0> schemes "
164 errflg = 1
165 return
166 endif
167!
168 if (do_ugwp_v1_w_gsldrag .and. do_ugwp_v1_orog_only ) then
169
170 print *, ' do_ugwp_v1_w_gsldrag ', do_ugwp_v1_w_gsldrag
171 print *, ' do_ugwp_v1_orog_only ', do_ugwp_v1_orog_only
172 print *, ' do_gsl_drag_ls_bl ',do_gsl_drag_ls_bl
173 write(errmsg,'(*(a))') " the CIRES <ugwpv1_gsldrag> CCPP-suite intend to &
174 support <ugwp_v1> with <gsldrag> but has Logic error"
175 errflg = 1
176 return
177 endif
178!==========================
179!
180! initialize ugwp_common
181! con_pi, con_rerth, con_p0, con_g, con_omega, con_cp, con_rd, con_rv,con_fvirt
182!
183!==========================
184
185 pi = con_pi
186 arad = con_rerth
187 p0s = con_p0
188 grav = con_g
189 omega1= con_omega
190 cpd = con_cp
191 rd = con_rd
192 rv = con_rv
193 fv = con_fvirt
194
195 grav2 = grav + grav; rgrav = 1.0/grav ; rgrav2 = rgrav*rgrav
196 rdi = 1.0 / rd ; rcpd = 1./cpd; rcpd2 = 0.5/cpd
197 gor = grav/rd
198 gr2 = grav*gor
199 grcp = grav*rcpd
200 gocp = grcp
201 rcpdl = cpd*rgrav
202 grav2cpd = grav*grcp
203
204 pi2 = 2.*pi ; pih = .5*pi
205 rad_to_deg=180.0/pi
206 deg_to_rad=pi/180.0
207
208 bnv2min = (pi2/1800.)*(pi2/1800.)
209 bnv2max = (pi2/30.)*(pi2/30.)
210 dw2min = 1.0
211 velmin = sqrt(dw2min)
212 minvel = 0.5
213
214 omega2 = 2.*omega1
215 omega3 = 3.*omega1
216
217 hpscale = 7000. ; hpskm = hpscale*1.e-3
218 rhp = 1./hpscale
219 rhp2 = 0.5*rhp; rh4 = 0.25*rhp
220 rhp4 = rhp2 * rhp2
221 khp = rhp* rd/cpd
222 mkzmin = pi2/80.0e3
223 mkz2min = mkzmin*mkzmin
224 mkzmax = pi2/500.
225 mkz2max = mkzmax*mkzmax
226 cdmin = 2.e-2/mkzmax
227
228 rcpdt = rcpd/dtp
229
230 if ( do_ugwp_v1 ) then
231 call cires_ugwpv1_init (me, master, nlunit, logunit, jdat, con_pi, &
232 con_rerth, fn_nml2, input_nml_file, lonr, latr, &
233 levs, ak, bk, con_p0, dtp, errmsg, errflg)
234 if (errflg/=0) return
235 end if
236
237 if (me == master) then
238 print *, ' ccpp: ugwpv1_gsldrag_init '
239
240 print *, ' ccpp do_ugwp_v1 flag ', do_ugwp_v1
241 print *, ' ccpp do_gsl_drag_ls_bl flag ', do_gsl_drag_ls_bl
242 print *, ' ccpp do_gsl_drag_ss flag ' , do_gsl_drag_ss
243 print *, ' ccpp do_gsl_drag_tofd flag ', do_gsl_drag_tofd
244
245 print *, ' ccpp: ugwpv1_gsldrag_init '
246 endif
247
248
249
250 is_initialized = .true.
251
252
253 end subroutine ugwpv1_gsldrag_init
254
255
256! -----------------------------------------------------------------------
257! finalize of ugwpv1_gsldrag (_finalize)
258! -----------------------------------------------------------------------
259
261
265 subroutine ugwpv1_gsldrag_finalize(errmsg, errflg)
266
267 implicit none
268!
269 character(len=*), intent(out) :: errmsg
270 integer, intent(out) :: errflg
271
272! Initialize CCPP error handling variables
273 errmsg = ''
274 errflg = 0
275
276 if (.not.is_initialized) return
277
278 call cires_ugwp_dealloc
279
280 is_initialized = .false.
281
282 end subroutine ugwpv1_gsldrag_finalize
283
284
285! -----------------------------------------------------------------------
286! originally from ugwp_driver_v0.f
287! driver of cires_ugwp (_driver)
288! -----------------------------------------------------------------------
289! driver is called after pbl & before chem-parameterizations
290! -----------------------------------------------------------------------
291! order = dry-adj=>conv=mp-aero=>radiation -sfc/land- chem -> vertdiff-> [rf-gws]=> ion-re
292! -----------------------------------------------------------------------
301 subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, &
302 fhzero, kdt, ldiag3d, lssav, flag_for_gwd_generic_tend, do_gsl_drag_ls_bl, &
303 do_gsl_drag_ss, do_gsl_drag_tofd, &
304 do_gwd_opt_psl, psl_gwd_dx_factor, &
305 do_ugwp_v1, do_ugwp_v1_orog_only, &
306 do_ugwp_v1_w_gsldrag, gwd_opt, do_tofd, ldiag_ugwp, ugwp_seq_update, &
307 cdmbgwd, alpha_fd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, &
308 elvmax, clx, oa4, varss,oc1ss,oa4ss,ol4ss, dx, xlat, xlat_d, sinlat, coslat, &
309 area, rain, br1, hpbl,vtype, kpbl, slmsk, &
310 ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, del, tau_amf, &
311 dudt_ogw, dvdt_ogw, du_ogwcol, dv_ogwcol, &
312 dudt_obl, dvdt_obl, du_oblcol, dv_oblcol, &
313 dudt_oss, dvdt_oss, du_osscol, dv_osscol, &
314 dudt_ofd, dvdt_ofd, du_ofdcol, dv_ofdcol, &
315 dudt_ngw, dvdt_ngw, dtdt_ngw, kdis_ngw, dudt_gw, dvdt_gw, dtdt_gw, kdis_gw, &
316 tau_ogw, tau_ngw, tau_oss, &
317 zogw, zlwb, zobl, zngw, dusfcg, dvsfcg, dudt, dvdt, dtdt, rdxzb, &
318 dtend, dtidx, index_of_x_wind, index_of_y_wind, index_of_temperature, &
319 index_of_process_orographic_gwd, index_of_process_nonorographic_gwd, &
320 lprnt, ipr, spp_wts_gwd, spp_gwd, errmsg, errflg)
321
322!
323!########################################################################
324! Attention New Arrays and Names must be ADDED inside
325!
326! a) /FV3/gfsphysics/GFS_layer/GFS_typedefs.meta
327! b) /FV3/gfsphysics/GFS_layer/GFS_typedefs.F90
328! c) /FV3/gfsphysics/GFS_layer/GFS_diagnostics.F90 "diag-cs is not tested"
329!########################################################################
330
331!
332
333 use ugwp_common, only : con_pi => pi, con_g => grav, con_rd => rd, &
334 con_rv => rv, con_cp => cpd, con_fv => fv, &
335 con_rerth => arad, con_omega => omega1, rgrav
336
337 implicit none
338
339! Preference use (im,levs) rather than (:,:) to avoid memory-leaks
340! that found in Nov-Dec 2020
341! order array-description control-logical
342! other in-variables
343! out-variables
344! local-variables
345!
346! unified GSL and CIRES diagnostics inside CCPP and GFS_typedefs.F90/GFS_diagnostics.F90
347!
348!
349! interface variables
350 logical, intent(in) :: ldiag3d, lssav
351 logical, intent(in) :: flag_for_gwd_generic_tend
352 logical, intent(in) :: lprnt
353
354 integer, intent(in) :: ipr
355
356! flags for choosing combination of GW drag schemes to run
357
358 logical, intent (in) :: do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd
359 logical, intent (in) :: do_ugwp_v1, do_ugwp_v1_orog_only, do_tofd
360 logical, intent (in) :: ldiag_ugwp, ugwp_seq_update
361 logical, intent (in) :: do_ugwp_v1_w_gsldrag ! combination of ORO and NGW schemes
362
363 integer, intent(in) :: me, master, im, levs, ntrac,lonr
364 real(kind=kind_phys), intent(in) :: dtp, fhzero
365 real(kind=kind_phys), intent(in) :: ak(:), bk(:)
366 integer, intent(in) :: kdt, jdat(:)
367! option for psl gwd
368 logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag
369 real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor !
370! SSO parameters and variables
371 integer, intent(in) :: gwd_opt !gwd_opt and nmtvr are "redundant" controls
372 integer, intent(in) :: nmtvr
373 real(kind=kind_phys), intent(in) :: cdmbgwd(:), alpha_fd ! for gsl_drag
374
375 real(kind=kind_phys), intent(in), dimension(:) :: hprime, oc, theta, sigma, gamma
376
377 real(kind=kind_phys), intent(in), dimension(:) :: elvmax
378 real(kind=kind_phys), intent(in), dimension(:,:) :: clx, oa4
379
380 real(kind=kind_phys), intent(in), dimension(:) :: dx
381 real(kind=kind_phys), intent(in), dimension(:), optional :: varss,oc1ss
382 real(kind=kind_phys), intent(in), dimension(:,:), optional :: oa4ss,ol4ss
383
384!=====
385!ccpp-style passing constants, I prefer to take them out from the "call-subr" list
386!=====
387! real(kind=kind_phys), intent(in) :: con_g, con_omega, con_pi, con_cp, con_rd, &
388! con_rv, con_rerth, con_fvirt
389! grids
390
391 real(kind=kind_phys), intent(in), dimension(:) :: xlat, xlat_d, sinlat, coslat, area
392
393! State vars + PBL/slmsk +rain
394
395 real(kind=kind_phys), intent(in), dimension(:,:) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil
396 real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii
397 real(kind=kind_phys), intent(in), dimension(:,:) :: q1
398 integer, intent(in), dimension(:) :: kpbl
399 integer, intent(in), dimension(:) :: vtype
400
401 real(kind=kind_phys), intent(in), dimension(:) :: rain
402 real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk
403!
404! moved to GFS_phys_time_vary
405! real(kind=kind_phys), intent(in), dimension(:) :: ddy_j1tau, ddy_j2tau
406! integer, intent(in), dimension(:) :: jindx1_tau, jindx2_tau
407 real(kind=kind_phys), intent(in), dimension(:) :: tau_amf
408
409!Output (optional):
410
411 real(kind=kind_phys), intent(out), dimension(:), optional :: &
412 du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
413 du_osscol, dv_osscol, du_ofdcol, dv_ofdcol
414!
415! we may add later but due to launch in the upper layes ~ mPa comparing to ORO Pa*(0.1)
416! du_ngwcol, dv_ngwcol
417
418 real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg
419 real(kind=kind_phys), intent(out), dimension(:) :: tau_ogw, tau_ngw, tau_oss
420
421 real(kind=kind_phys), intent(out) , dimension(:,:), optional :: &
422 dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, &
423 dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd
424
425 real(kind=kind_phys), intent(out) , dimension(:,:), optional :: dudt_ngw, dvdt_ngw, kdis_ngw, dtdt_ngw
426 real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_gw, dvdt_gw, dtdt_gw, kdis_gw
427
428 real(kind=kind_phys), intent(out) , dimension(:) :: zogw, zlwb, zobl, zngw
429!
430!
431 real(kind=kind_phys), intent(inout), dimension(:,:) :: dudt, dvdt, dtdt
432
433 real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:)
434 integer, intent(in) :: dtidx(:,:)
435 integer, intent(in) :: &
436 index_of_x_wind, index_of_y_wind, index_of_temperature, &
437 index_of_process_orographic_gwd, index_of_process_nonorographic_gwd
438
439 real(kind=kind_phys), intent(out), dimension(:) :: rdxzb ! for stoch phys. mtb-level
440
441 real(kind=kind_phys), intent(in), optional :: spp_wts_gwd(:,:)
442 integer, intent(in) :: spp_gwd
443
444 character(len=*), intent(out) :: errmsg
445 integer, intent(out) :: errflg
446
447! local variables
448 integer :: i, k
449 real(kind=kind_phys), dimension(im) :: sgh30
450 real(kind=kind_phys), dimension(im, levs) :: pdvdt, pdudt
451 real(kind=kind_phys), dimension(im, levs) :: pdtdt, pkdis
452!------------
453!
454! from ugwp_driver_v0.f -> cires_ugwp_initialize.F90 -> module ugwp_wmsdis_init
455! now in the namelist of cires_ugwp "knob_ugwp_tauamp" controls tamp_mpa
456!
457! tamp_mpa =knob_ugwp_tauamp !amplitude for GEOS-5/MERRA-2
458!------------
459! real(kind=kind_phys), parameter :: tamp_mpa_v0=30.e-3 ! large flux to help "GFS-ensembles" in July 2019
460
461! switches that activate impact of OGWs and NGWs
462
463! integer :: nmtvr_temp
464
465 real(kind=kind_phys), dimension(im, levs) :: zmet ! geopotential height at model Layer centers
466 real(kind=kind_phys), dimension(im, levs+1) :: zmeti ! geopotential height at model layer interfaces
467
468
469! ugwp_v1 local variables
470
471 integer :: y4, month, day, ddd_ugwp, curdate, curday, idtend
472
473! ugwp_v1 temporary (local) diagnostic variables from cires_ugwp_solv2_v1
474! diagnostics for wind and temp rms to compare with space-borne data and metrics
475! in the Middle atmosphere: 20-110 km ( not active in CCPP-style, oct 2020)
476! real(kind=kind_phys) :: tauabs(im,levs), wrms(im,levs), trms(im,levs)
477
478
479 ! Initialize CCPP error handling variables
480
481 errmsg = ''
482 errflg = 0
483
484! 1) ORO stationary GWs
485! ------------------
486!
487! for all oro-suites can uze geo-meters having "hpbl"
488!
489!
490! All GW-schemes operate with Zmet =phil*inv_g, passing Zmet/Zmeti can be more robust
491! + rho*dz = =delp * inv_g can be also pre-comp for all "GW-schemes"
492!
493 zmeti = phii* rgrav
494 zmet = phil* rgrav
495
496!===============================================================
497! ORO-diag
498
499 if (do_ugwp_v1 .or. ldiag_ugwp) then
500 dudt_ogw(:,:)= 0.; dvdt_ogw(:,:)=0.; dudt_obl(:,:)=0.; dvdt_obl(:,:)=0.
501 dudt_oss(:,:)= 0.; dvdt_oss(:,:)=0.; dudt_ofd(:,:)=0.; dvdt_ofd(:,:)=0.
502 du_ogwcol(:)=0. ; dv_ogwcol(:)=0. ; du_oblcol(:)=0. ; dv_oblcol(:)=0.
503 du_osscol(:)=0. ; dv_osscol(:)=0. ;du_ofdcol(:)=0. ; dv_ofdcol(:)=0.
504 dudt_ngw(:,:)=0.; dvdt_ngw(:,:)=0.; dtdt_ngw(:,:)=0.; kdis_ngw(:,:)=0.
505 else
506 dudt_ogw(:,:) = 0.
507 end if
508
509 dusfcg(:) = 0. ; dvsfcg(:) =0.
510
511
512! ngw+ogw - diag
513
514 dudt_gw(:,:)=0. ; dvdt_gw(:,:)=0. ; dtdt_gw(:,:)=0. ; kdis_gw(:,:)=0.
515! source fluxes
516
517 tau_ogw(:)=0. ; tau_ngw(:)=0. ; tau_oss(:)=0.
518
519! launch layers
520
521 zlwb(:)= 0. ; zogw(:)=0. ; zobl(:)=0. ; zngw(:)=0.
522!===============================================================
523! diag tendencies due to all-SSO schemes (ORO-physics)
524! ogw + obl + oss + ofd ..... no explicit "lee wave trapping"
525!===============================================================
526 do k=1,levs
527 do i=1,im
528 pdvdt(i,k) = 0.0
529 pdudt(i,k) = 0.0
530 pdtdt(i,k) = 0.0
531 pkdis(i,k) = 0.0
532 enddo
533 enddo
534!
535 ! Run the appropriate large-scale (large-scale GWD + blocking) scheme
536 ! Note: In case of GSL drag_suite, this includes ss and tofd
537
538 if ( do_gsl_drag_ls_bl.or.do_gsl_drag_ss.or.do_gsl_drag_tofd) then
539!
540! to do: the zero diag and tendency values assigned inside "drag_suite_run" can be skipped :
541!
542! dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl,dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd
543! du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, du_osscol, dv_osscol, du_ofdcol dv_ofdcol
544! dusfcg, dvsfcg
545!
546!
547 if (do_gwd_opt_psl) then
548 call drag_suite_psl(im, levs, pdvdt, pdudt, pdtdt, &
549 ugrs,vgrs,tgrs,q1, &
550 kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
551 kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, &
552 ol4ss,theta,sigma,gamma,elvmax, &
553 dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, &
554 dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, &
555 dusfcg, dvsfcg, &
556 du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
557 du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, &
558 slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, &
559 con_fv, con_pi, lonr, &
560 cdmbgwd(1:2),alpha_fd,me,master, &
561 lprnt,ipr,rdxzb,dx,gwd_opt, &
562 do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
563 psl_gwd_dx_factor, &
564 dtend, dtidx, index_of_process_orographic_gwd, &
565 index_of_temperature, index_of_x_wind, &
566 index_of_y_wind, ldiag3d, ldiag_ugwp, &
567 ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
568 else
569 call drag_suite_run(im, levs, pdvdt, pdudt, pdtdt, &
570 ugrs,vgrs,tgrs,q1, &
571 kpbl,prsi,del,prsl,prslk,phii,phil,dtp, &
572 kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, &
573 ol4ss,theta,sigma,gamma,elvmax, &
574 dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, &
575 dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, &
576 dusfcg, dvsfcg, &
577 du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
578 du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, &
579 slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, &
580 con_fv, con_pi, lonr, &
581 cdmbgwd(1:2),alpha_fd,me,master, &
582 lprnt,ipr,rdxzb,dx,gwd_opt, &
583 do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, &
584 dtend, dtidx, index_of_process_orographic_gwd, &
585 index_of_temperature, index_of_x_wind, &
586 index_of_y_wind, ldiag3d, ldiag_ugwp, &
587 ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg)
588 endif
589!
590! dusfcg = du_ogwcol + du_oblcol + du_osscol + du_ofdcol
591!
592! if (kdt <= 2 .and. me == master) then
593! print *, ' unified drag_suite_run ', kdt
594! print *, ' GSL drag du/dt ', maxval(Pdudt)*86400, minval(Pdudt)*86400
595! print *, ' GSL drag dv/dt ', maxval(Pdvdt)*86400, minval(Pdvdt)*86400
596!
597! zero print *, ' unified drag_GSL dT/dt ', maxval(Pdtdt)*86400, minval(Pdtdt)*86400
598!
599! if (gwd_opt == 22 .or. gwd_opt == 33) then
600! print *, ' unified drag_GSL dUBL/dt ', maxval(dudt_obl)*86400, minval(dudt_obl)*86400
601! print *, ' unified drag_GSL dVBL/dt ', maxval(dvdt_obl)*86400, minval(dvdt_obl)*86400
602! print *, ' unified drag_GSL dUOGW/dt ', maxval(dudt_ogw)*86400, minval(dudt_ogw)*86400
603! print *, ' unified drag_GSL dVOGW/dt ', maxval(dvdt_ogw)*86400, minval(dvdt_ogw)*86400
604! print *, ' unified drag_GSL dUOss/dt ', maxval(dudt_oss)*86400, minval(dudt_oss)*86400
605! print *, ' unified drag_GSL dVOSS/dt ', maxval(dvdt_oss)*86400, minval(dvdt_oss)*86400
606! print *, ' unified drag_GSL dUOfd/dt ', maxval(dudt_ofd)*86400, minval(dudt_ofd)*86400
607! print *, ' unified drag_GSL dVOfd/dt ', maxval(dvdt_ofd)*86400, minval(dvdt_ofd)*86400
608! endif
609! endif
610
611 endif
612!
613! not gsldrag large-scale oro-scheme for example "do_ugwp_v1_orog_only"
614!
615
616 if ( do_ugwp_v1_orog_only ) then
617!
618! for TOFD we use now "varss" of GSL-drag /not sgh30=abs(oro-oro_f)/
619! only sum of integrated ORO+GW effects (dusfcg and dvsfcg) = sum(ogw + obl + oss*0 + ofd + ngw)
620!
621! OROGW_V1 introduce "orchestration" between OGW-effects and Mountain Blocking
622! it starts to examines options for the Scale-Aware (SA)formulation of SSO-effects
623! if ( me == master .and. kdt == 1) print *, ' bf orogw_v1 nmtvr=', nmtvr, ' do_tofd=', do_tofd
624
625 if (gwd_opt ==1 )sgh30 = 0.15*hprime ! portion of the mesoscale SSO (~[oro_unfilt -oro_filt)
626 if (gwd_opt >1 ) sgh30 = varss ! as in gsldrag: see drag_suite_run
627
628 call orogw_v1 (im, levs, lonr, me, master,dtp, kdt, do_tofd, &
629 xlat_d, sinlat, coslat, area, &
630 cdmbgwd(1:2), hprime, oc, oa4, clx, theta, &
631 sigma, gamma, elvmax, sgh30, kpbl, ugrs, &
632 vgrs, tgrs, q1, prsi,del,prsl,prslk, zmeti, zmet, &
633 pdvdt, pdudt, pdtdt, pkdis, dusfcg, dvsfcg,rdxzb, &
634 zobl, zlwb, zogw, tau_ogw, dudt_ogw, dvdt_ogw, &
635 dudt_obl, dvdt_obl,dudt_ofd, dvdt_ofd, &
636 du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, &
637 du_ofdcol, dv_ofdcol, errmsg,errflg )
638!
639! orogw_v1: dusfcg = du_ogwcol + du_oblcol + du_ofdcol only 3 terms
640!
641!
642! if (kdt <= 2 .and. me == master) then
643!
644! print *, ' unified_ugwp orogw_v1 ', kdt, me, nmtvr
645! print *, ' unified_ugwp orogw_v1 du/dt ', maxval(Pdudt)*86400, minval(Pdudt)*86400
646! print *, ' unified_ugwp orogw_v1 dv/dt ', maxval(Pdvdt)*86400, minval(Pdvdt)*86400
647! print *, ' unified_ugwp orogw_v1 dT/dt ', maxval(Pdtdt)*86400, minval(Pdtdt)*86400
648! print *, ' unified_ugwp orogw_v1 dUBL/dt ', maxval(dudt_obl)*86400, minval(dudt_obl)*86400
649! print *, ' unified_ugwp orogw_v1 dVBL/dt ', maxval(dvdt_obl)*86400, minval(dvdt_obl)*86400
650! endif
651
652
653 end if
654!
655! for old-fashioned GFS-style diag-cs like dt3dt(:.:, 1:14) collections
656!
657 if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then
658 idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd)
659 if(idtend>=1) then
660 dtend(:,:,idtend) = dtend(:,:,idtend) + pdudt*dtp
661 endif
662 idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd)
663 if(idtend>=1) then
664 dtend(:,:,idtend) = dtend(:,:,idtend) + pdvdt*dtp
665 endif
666 idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd)
667 if(idtend>=1) then
668 dtend(:,:,idtend) = dtend(:,:,idtend) + pdtdt*dtp
669 endif
670 endif
671!
672!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
673! Begin non-stationary GW schemes
674! ugwp_v1
675!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
676
677 if (do_ugwp_v1) then
678
679!==================================================================
680! call slat_geos5_tamp_v1(im, tamp_mpa, xlat_d, tau_ngw)
681!
682! 2020 updates of MERRA/GEOS tau_ngw for the C96-QBO FV3GFS-127L runs
683!==================================================================
684
685 call slat_geos5_2020(im, tamp_mpa, xlat_d, tau_ngw)
686
687 y4 = jdat(1); month = jdat(2); day = jdat(3)
688!
689! hour = jdat(5)
690! fhour = float(hour)+float(jdat(6))/60. + float(jdat(7))/3600.
691! fhour = (kdt-1)*dtp/3600.
692! fhrday = fhour/24. - nint(fhour/24.)
693
694
695 call calendar_ugwp(y4, month, day, ddd_ugwp)
696 curdate = y4*1000 + ddd_ugwp
697!
698 call ngwflux_update(me, master, im, levs, kdt, ddd_ugwp,curdate, &
699 tau_amf, xlat_d, sinlat,coslat, rain, tau_ngw)
700
701 call cires_ugwpv1_ngw_solv2(me, master, im, levs, kdt, dtp, &
702 tau_ngw, tgrs, ugrs, vgrs, q1, prsl, prsi, &
703 zmet, zmeti,prslk, xlat_d, sinlat, coslat, &
704 dudt_ngw, dvdt_ngw, dtdt_ngw, kdis_ngw, zngw)
705!
706! => con_g, con_cp, con_rd, con_rv, con_omega, con_pi, con_fvirt
707!
708! if (me == master .and. kdt <= 2) then
709! print *
710! write(6,*)'FV3GFS finished fv3_ugwp_solv2_v1 '
711! write(6,*) ' non-stationary GWs with GMAO/MERRA GW-forcing '
712! print *
713!
714! print *, ' ugwp_v1 ', kdt
715! print *, ' ugwp_v1 du/dt ', maxval(dudt_ngw)*86400, minval(dudt_ngw)*86400
716! print *, ' ugwp_v1 dv/dt ', maxval(dvdt_ngw)*86400, minval(dvdt_ngw)*86400
717! print *, ' ugwp_v1 dT/dt ', maxval(dtdt_ngw)*86400, minval(dtdt_ngw)*86400
718! endif
719
720
721 end if ! do_ugwp_v1
722
723 if(ldiag3d .and. lssav .and. .not. flag_for_gwd_generic_tend) then
724 idtend = dtidx(index_of_x_wind,index_of_process_nonorographic_gwd)
725 if(idtend>=1) then
726 dtend(:,:,idtend) = dtend(:,:,idtend) + dudt_ngw(i,k)*dtp
727 endif
728 idtend = dtidx(index_of_y_wind,index_of_process_nonorographic_gwd)
729 if(idtend>=1) then
730 dtend(:,:,idtend) = dtend(:,:,idtend) + dvdt_ngw(i,k)*dtp
731 endif
732 idtend = dtidx(index_of_temperature,index_of_process_nonorographic_gwd)
733 if(idtend>=1) then
734 dtend(:,:,idtend) = dtend(:,:,idtend) + dtdt_ngw(i,k)*dtp
735 endif
736 endif
737
738!
739! get total sso-OGW + NGW
740!
741 if (do_ugwp_v1) then
742 dudt_gw = pdudt + dudt_ngw
743 dvdt_gw = pdvdt + dvdt_ngw
744 dtdt_gw = pdtdt + dtdt_ngw
745 kdis_gw = pkdis + kdis_ngw
746 else
747 dudt_gw = pdudt
748 dvdt_gw = pdvdt
749 dtdt_gw = pdtdt
750 kdis_gw = pkdis
751 end if
752!
753! accumulate "tendencies" as in the GFS-ipd (pbl + ugwp + zero-RF)
754!
755 dudt = dudt + dudt_gw
756 dvdt = dvdt + dvdt_gw
757 dtdt = dtdt + dtdt_gw
758
759 end subroutine ugwpv1_gsldrag_run
760end module ugwpv1_gsldrag
This module contains the orographic drag scheme.
Definition drag_suite.F90:6
This module introduces two gravity wave drag schemes: UGWPv1 and orographic drag scheme.