CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
cires_ugwp_initialize.F90
1
3! initialization of ugwp_common_v0
4! init gw-solvers (1,2) .. no UFS-funds for (3,4) tests
5! init gw-source specifications
6! init gw-background dissipation
7!===============================
8
11!
12 use machine, only: kind_phys
13 use physcons, only : pi => con_pi, grav => con_g, rd => con_rd, &
14 rv => con_rv, cpd => con_cp, fv => con_fvirt,&
15 arad => con_rerth
16 implicit none
17
18 real(kind=kind_phys), parameter :: grcp = grav/cpd, rgrav = 1.0d0/grav, &
19 rdi = 1.0d0/rd, &
20 gor = grav/rd, gr2 = grav*gor, gocp = grav/cpd, &
21 rcpd = 1./cpd, rcpd2 = 0.5*rcpd, &
22 pi2 = pi + pi, omega1 = pi2/86400.0, &
23 omega2 = omega1+omega1, &
24 rad_to_deg=180.0/pi, deg_to_rad=pi/180.0, &
25 dw2min=1.0, bnv2min=1.e-6, velmin=sqrt(dw2min)
26
27
28 end module ugwp_common_v0
29!
30!
31!===================================================
32!
33!Part-1 init => wave dissipation + RFriction
34!
35!===================================================
37 subroutine init_global_gwdis_v0(levs, zkm, pmb, kvg, ktg, krad, kion)
38 implicit none
39
40 integer :: levs
41 real, intent(in) :: zkm(levs), pmb(levs)
42 real, intent(out), dimension(levs+1) :: kvg, ktg, krad, kion
43!
44!locals + data
45!
46 integer :: k
47 real, parameter :: vusurf = 2.e-5
48 real, parameter :: musurf = vusurf/1.95
49 real, parameter :: hpmol = 8.5
50!
51 real, parameter :: kzmin = 0.1
52 real, parameter :: kturbo = 100.
53 real, parameter :: zturbo = 130.
54 real, parameter :: zturw = 30.
55 real, parameter :: inv_pra = 3. !kt/kv =inv_pr
56!
57 real, parameter :: alpha = 1./86400./15.
58!
59 real, parameter :: kdrag = 1./86400./10.
60 real, parameter :: zdrag = 100.
61 real, parameter :: zgrow = 50.
62!
63 real :: vumol, mumol, keddy, ion_drag
64!
65 do k=1, levs
66 vumol = vusurf*exp(-zkm(k)/hpmol)
67 mumol = musurf*exp(-zkm(k)/hpmol)
68
69 keddy = kturbo*exp(-((zkm(k)-zturbo) /zturw)**2)
70
71 kvg(k) = vumol + keddy
72 ktg(k) = mumol + keddy*inv_pra
73
74 krad(k) = alpha
75!
76 ion_drag = kdrag
77!
78 kion(k) = ion_drag
79 enddo
80
81 k= levs+1
82 kion(k) = kion(k-1)
83 krad(k) = krad(k-1)
84 kvg(k) = kvg(k-1)
85 ktg(k) = ktg(k-1)
86!
87 end subroutine init_global_gwdis_v0
88
89
90! ========================================================================
91! Part 2 - sources
92! wave sources
93! ========================================================================
94!
95! ugwpv0_oro_init
96!
97!=========================================================================
100
101 use ugwp_common_v0, only : bnv2min, grav, grcp, fv, grav, cpd, grcp, pi
102
103 implicit none
104!
105! constants and "crirtical" values to run oro-mtb_gw physics
106!
107! choice of oro-scheme: strver = 'vay_2018' , 'gfs_2018', 'kdn_2005', 'smc_2000'
108!
109 character(len=8) :: strver = 'gfs_2018'
110 character(len=8) :: strbase = 'gfs_2018'
111 real, parameter :: rimin=-10., ric=0.25
112
113!
114 real, parameter :: efmin=0.5, efmax=10.0
115 real, parameter :: hpmax=2400.0, hpmin=25.0
116 real, parameter :: sigma_std=1./100., gamm_std=1.0
117
118 real, parameter :: frmax=10., frc =1.0, frmin =0.01
119!
120
121 real, parameter :: ce=0.8, ceofrc=ce/frc, cg=0.5
122 real, parameter :: gmax=1.0, veleps=1.0, factop=0.5
123!
124 real, parameter :: rlolev=50000.0
125!
126 real, parameter :: hncrit=9000. ! max value in meters for elvmax
127
128! hncrit set to 8000m and sigfac added to enhance elvmax mtn hgt
129
130 real, parameter :: sigfac=4.0 ! mb3a expt test for elvmax factor
131 real, parameter :: hminmt=50. ! min mtn height (*j*)
132 real, parameter :: minwnd=1.0 ! min wind component (*j*)
133 real, parameter :: dpmin=5000.0 ! minimum thickness of the reference layer in pa
134
135 real, parameter :: kxoro=6.28e-3/200. !
136 real, parameter :: coro = 0.0
137 integer, parameter :: nridge=2
138
139 real :: cdmb ! scale factors for mtb
140 real :: cleff ! scale factors for orogw
141 integer :: nworo ! number of waves
142 integer :: nazoro ! number of azimuths
143 integer :: nstoro ! flag for stochastic launch above SG-peak
144
145 integer, parameter :: mdir = 8
146 real, parameter :: fdir=.5*mdir/pi
147
148 integer nwdir(mdir)
149 data nwdir/6,7,5,8,2,3,1,4/
150 save nwdir
151
152 real, parameter :: odmin = 0.1, odmax = 10.0
153!------------------------------------------------------------------------------
154! small-scale orography parameters for TOFD of Beljaars et al., 2004, QJRMS
155!------------------------------------------------------------------------------
156
157 integer, parameter :: n_tofd = 2 ! depth of SSO for TOFD compared with Zpbl
158 real, parameter :: const_tofd = 0.0759 ! alpha*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759
159 real, parameter :: ze_tofd = 1500.0 ! BJ's z-decay in meters
160 real, parameter :: a12_tofd = 0.0002662*0.005363 ! BJ's k-spect const for sigf2 * a1*a2*exp(-[z/zdec]**1.5]
161 real, parameter :: ztop_tofd = 10.*ze_tofd ! no TOFD > this height too higher 15 km
162!------------------------------------------------------------------------------
163!
164 real, parameter :: fcrit_sm = 0.7, fcrit_sm2 = fcrit_sm * fcrit_sm
165 real, parameter :: fcrit_gfs = 0.7
166 real, parameter :: fcrit_mtb = 0.7
167
168 real, parameter :: lzmax = 18.e3 ! 18 km
169 real, parameter :: mkzmin = 6.28/lzmax
170 real, parameter :: mkz2min = mkzmin*mkzmin
171 real, parameter :: zbr_pi = (3.0/2.0)*pi
172 real, parameter :: zbr_ifs = 0.5*pi
173
174 contains
175!
176 subroutine init_oro_gws_v0(nwaves, nazdir, nstoch, effac, &
177 lonr, kxw, cdmbgwd )
178!
179!
180 integer :: nwaves, nazdir, nstoch
181 integer :: lonr
182 real :: cdmbgwd(2) ! scaling factors for MTb (1) & (2) for cleff = cleff * cdmbgwd(2)
183 ! high res-n "larger" MTB and "less-active" cleff in GFS-2018
184 real :: cdmbX
185 real :: kxw
186 real :: effac ! it is analog of cdmbgwd(2) for GWs, off for now
187!-----------------------------! GFS-setup for cdmb & cleff
188! cdmb = 4.0 * (192.0/IMX)
189! cleff = 0.5E-5 / SQRT(IMX/192.0) = 0.5E-5*SQRT(192./IMX)
190!
191 real, parameter :: lonr_refmb = 4.0 * 192.0
192 real, parameter :: lonr_refgw = 192.0
193
194! copy to "ugwp_oro_init" => nwaves, nazdir, nstoch
195
196 nworo = nwaves
197 nazoro = nazdir
198 nstoro = nstoch
199
200 cdmbx = lonr_refmb/float(lonr)
201 cdmb = cdmbx
202 if (cdmbgwd(1) >= 0.0) cdmb = cdmb * cdmbgwd(1)
203
204 cleff = 0.5e-5 * sqrt(lonr_refgw/float(lonr)) !* effac
205
206!!! cleff = kxw * sqrt(lonr_refgw/float(lonr)) !* effac
207
208 if (cdmbgwd(2) >= 0.0) cleff = cleff * cdmbgwd(2)
209!
210!....................................................................
211! higher res => smaller h' ..&.. higher kx
212! flux_gwd ~ 'u'^2*kx/kz ~kxu/n ~1/dx *u/n tau ~ h'*h'*kx*kx = const (h'-less kx-grow)
213!....................................................................
214!
215! print *, ' init_oro_gws 2-1cdmb', cdmbgwd(2), cdmbgwd(1)
216 end subroutine init_oro_gws_v0
217!
218
219 end module ugwpv0_oro_init
220!=============================== end of GW sources
221!
222! init specific gw-solvers (1,2,3,4)
223!
224
225!===============================
226! Part -3 init wave solvers
227!===============================
228
231 implicit none
232
233 integer :: nwav, nazd
234 integer :: nst
235 real :: eff
236 integer, parameter :: incdim = 4, iazdim = 4
237!
238 contains
239
240 subroutine initsolv_lsatdis_v0(me, master, nwaves, nazdir, nstoch, effac, do_physb, kxw)
241
242 implicit none
243!
244 integer :: me, master
245 integer :: nwaves, nazdir
246 integer :: nstoch
247 real :: effac
248 logical :: do_physb
249 real :: kxw
250!
251!locals: define azimuths and Ch(nwaves) - domain when physics-based soureces
252! are not actibve
253!
254 integer :: inc, jk, jl, iazi, i, j, k
255
256 if( nwaves == 0 .or. nstoch == 1 ) then
257! redefine from the default
258 nwav = incdim
259 nazd = iazdim
260 nst = 0
261 eff = 1.0
262 else
263! from input_nml multi-wave spectra
264 nwav = nwaves
265 nazd = nazdir
266 nst = nstoch
267 eff = effac
268 endif
269!
270 end subroutine initsolv_lsatdis_v0
271!
272 end module ugwpv0_lsatdis_init
273!
274!
277
278 use ugwp_common_v0, only : pi, pi2
279 implicit none
280
281 real, parameter :: maxdudt = 250.e-5
282
283 real, parameter :: hpscale= 7000., rhp2 = 0.5/hpscale
284 real, parameter :: omega2 = 2.*6.28/86400
285 real, parameter :: gptwo=2.0
286
287 real, parameter :: dked_min =0.01
288 real, parameter :: gssec = (6.28/30.)**2 ! max-value for bn2
289 real, parameter :: bv2min = (6.28/60./120.)**2 ! min-value for bn2 7.6(-7) 2 hrs
290 real, parameter :: minvel = 0.5
291
292!
293! make parameter list that will be passed to SOLVER
294!
295
296 real, parameter :: v_kxw = 6.28e-3/200.
297 real, parameter :: v_kxw2 = v_kxw*v_kxw
298 real, parameter :: tamp_mpa = 30.e-3
299 real, parameter :: zfluxglob= 3.75e-3
300
301 real , parameter :: nslope=1 ! the GW sprctral slope at small-m
302
303 integer , parameter :: iazidim=4 ! number of azimuths
304 integer , parameter :: incdim=25 ! number of discrete cx - spectral elements in launch spectrum
305 real , parameter :: ucrit2=0.5
306
307 real , parameter :: zcimin = ucrit2
308 real , parameter :: zcimax = 125.0
309 real , parameter :: zgam = 0.25
310 real , parameter :: zms_l = 2000.0, zms = pi2 / zms_l, zmsi = 1.0 / zms
311
312 integer :: ilaunch
313 real :: gw_eff
314
315!===========================================================================
316 integer :: nwav, nazd, nst
317 real :: eff
318
319 real :: zaz_fct
320 real, allocatable :: zci(:), zci4(:), zci3(:),zci2(:), zdci(:)
321 real, allocatable :: zcosang(:), zsinang(:)
322 contains
323!============================================================================
324 subroutine initsolv_wmsdis_v0(me, master, nwaves, nazdir, nstoch, effac, do_physb, kxw)
325
326 implicit none
327!
328!input -control for solvers:
329! nwaves, nazdir, nstoch, effac, do_physb, kxw
330!
331!
332 integer :: me, master, nwaves, nazdir, nstoch
333 real :: effac, kxw
334 logical :: do_physb
335!
336!locals
337!
338 integer :: inc, jk, jl, iazi
339!
340 real :: zang, zang1, znorm
341 real :: zx1, zx2, ztx, zdx, zxran, zxmin, zxmax, zx, zpexp
342
343 if( nwaves == 0) then
344!
345! redefine from the deafault
346!
347 nwav = incdim
348 nazd = iazidim
349 nst = 0
350 eff = 1.0
351 gw_eff = eff
352 else
353!
354! from input.nml
355!
356 nwav = nwaves
357 nazd = nazdir
358 nst = nstoch
359 gw_eff = effac
360 endif
361
362 allocate ( zci(nwav), zci4(nwav), zci3(nwav),zci2(nwav), zdci(nwav) )
363 allocate ( zcosang(nazd), zsinang(nazd) )
364
365 if (me == master) then
366 print *, 'ugwp_v0: init_gw_wmsdis_control '
367! print *, 'ugwp_v0: WMSDIS launch layer ', klaunch
368 print *, 'ugwp_v0: WMSDIS launch layer ', ilaunch
369 print *, 'ugwp_v0: WMSDID tot_mflux in mpa', tamp_mpa*1000.
370 endif
371
372 zpexp = gptwo * 0.5 ! gptwo=2 , zpexp = 1.
373
374!
375! set up azimuth directions and some trig factors
376!
377!
378 zang = pi2 / float(nazd)
379
380! get normalization factor to ensure that the same amount of momentum
381! flux is directed (n,s,e,w) no mater how many azimuths are selected.
382!
383 znorm = 0.0
384 do iazi=1, nazd
385 zang1 = (iazi-1)*zang
386 zcosang(iazi) = cos(zang1)
387 zsinang(iazi) = sin(zang1)
388 znorm = znorm + abs(zcosang(iazi))
389 enddo
390! zaz_fct = 1.0
391 zaz_fct = 2.0 / znorm ! correction factor for azimuthal sums
392
393! define coordinate transform for "Ch" ....x = 1/c stretching transform
394! -----------------------------------------------
395! note that this is expresed in terms of the intrinsic phase speed
396! at launch ci=c-u_o so that the transformation is identical
397! see eq. 28-30 of scinocca 2003. x = 1/c stretching transform
398!
399 zxmax = 1.0 / zcimin
400 zxmin = 1.0 / zcimax
401 zxran = zxmax - zxmin
402 zdx = zxran / real(nwav-1) ! dkz
403!
404 zx1 = zxran/(exp(zxran/zgam)-1.0 ) ! zgam =1./4.
405 zx2 = zxmin - zx1
406
407!
408! computations for zci =1/zx
409! if(lgacalc) zgam=(zxmax-zxmin)/log(zxmax/zxmin)
410! zx1=zxran/(exp(zxran/zgam)-1.0_jprb)
411! zx2=zxmin-zx1
412! zms = pi2 / zms_l
413 do inc=1, nwav
414 ztx = real(inc-1)*zdx+zxmin
415 zx = zx1*exp((ztx-zxmin)/zgam)+zx2 !eq. 29 of scinocca 2003
416 zci(inc) = 1.0 /zx !eq. 28 of scinocca 2003
417 zdci(inc) = zci(inc)**2*(zx1/zgam)*exp((ztx-zxmin)/zgam)*zdx !eq. 30 of scinocca 2003
418 zci4(inc) = (zms*zci(inc))**4
419 zci2(inc) = (zms*zci(inc))**2
420 zci3(inc) = (zms*zci(inc))**3
421 enddo
422!
423!
424! all done and print-out
425!
426!
427 if (me == master) then
428 print *
429 print *, 'ugwp_v0: zcimin=' , zcimin
430 print *, 'ugwp_v0: zcimax=' , zcimax
431 print *, 'ugwp_v0: cd_crit=', zgam ! m/s precision for crit-level
432 print *, 'ugwp_v0: launch_level', ilaunch
433 print *, ' ugwp_v0 zms_l=', zms_l
434 print *, ' ugwp_vgw nslope=', nslope
435
436 print *
437 endif
438
439 end subroutine initsolv_wmsdis_v0
440!
441 end module ugwpv0_wmsdis_init
This module contains UGWP v0 initialization schemes.
This module contains initialization of wave solvers for UGWP v0.
This module contains orographic wave source schemes for UGWP v0.
This module contains init-solvers for "broad" non-stationary multi-wave spectra.