PLUME-MoM-TSM  1.0
VolcanicPlumeModel
meteo.f90
Go to the documentation of this file.
1 !********************************************************************
3 !
9 !********************************************************************
10 
12 
13  USE variables, ONLY: gi ! Grav acceleration
14  USE variables, ONLY : wp
15 
16  IMPLICIT NONE
17 
18  REAL(wp) :: h0
19  REAL(wp) :: h1
20  REAL(wp) :: h2
21  REAL(wp) :: h3
22  REAL(wp) :: h4
23  REAL(wp) :: h5
24  REAL(wp) :: h6
25 
26  REAL(wp) :: u0
27  REAL(wp) :: u1
28  REAL(wp) :: u2
29  REAL(wp) :: u3
30  REAL(wp) :: u4
31  REAL(wp) :: u5
32  REAL(wp) :: u6
33 
35 
36  REAL(wp) :: rel_hu
37 
38  REAL(wp) :: gamma_m
39 
40  REAL(wp) :: gamma_d
41 
42  REAL(wp) :: rho_dry
43 
45  REAL(wp) :: rh
46 
48  REAL(wp) :: cos_theta , sin_theta
49 
51  REAL(wp) :: rho_atm0
52 
54  REAL(wp) :: u_atm
55 
56  REAL(wp) :: u_wind
57  REAL(wp) :: v_wind
58 
60  REAL(wp) :: rho_atm
61 
63  REAL(wp) :: sphu_atm
64 
66  REAL(wp) :: sphu_atm0
67 
68 
70  REAL(wp) :: visc_atm
71 
73  REAL(wp) :: visc_atm0
74 
76  REAL(wp) :: ta
77 
79  REAL(wp) :: pa
80 
82  REAL(wp) :: dpdz
83 
85  REAL(wp) :: dtdz
86 
88  REAL(wp) :: rair
89 
91  REAL(wp) :: cpair
92 
94  REAL(wp), PARAMETER :: t_ref = 273.15_wp
95 
97  REAL(wp), PARAMETER :: h_wv0 = 2.501d6
98 
100  REAL(wp), PARAMETER :: c_wv = 1996.0_wp
101 
103  REAL(wp), PARAMETER :: h_lw0 = 3.337d5
104 
106  REAL(wp), PARAMETER :: c_lw = 4187.0_wp
107 
109  REAL(wp), PARAMETER :: c_ice = 2108.0_wp
110 
112  REAL(wp), PARAMETER :: da_mol_wt = 0.029_wp
113 
115  REAL(wp), PARAMETER :: wv_mol_wt = 0.018_wp
116 
118  REAL(wp), PARAMETER :: rwv = 462
119 
120  INTEGER :: n_atm_profile
121 
132  REAL(wp), ALLOCATABLE :: atm_profile(:,:)
133 
134  CHARACTER*10 :: read_atm_profile
135 
136  REAL(wp) :: u_max , z_r , exp_wind
137 
138  REAL(wp), ALLOCATABLE :: rho_atm_month_lat(:) , pres_atm_month_lat(:) , &
140 
141  REAL(wp), ALLOCATABLE :: h_levels(:)
142 
143  REAL(wp) :: wind_mult_coeff
144 
145  SAVE
146 
147 CONTAINS
148 
149  !******************************************************************************
151  !
157  !******************************************************************************
158 
159  SUBROUTINE initialize_meteo
161  IMPLICIT NONE
162 
163 
164  IF ( read_atm_profile .EQ. 'standard' ) THEN
165 
166  ! tropospere base altitude (m)
167  h0 = 0.0_wp
168  u0 = 0.0_wp
169  sp_hu0 = sphu_atm0
170 
171  ! ------------------------ atmosphere layer 1 ----------------------------
172 
173  ! tropopause base altitude
174  h1 = 11000.0_wp
175  ! specific humidity (kg/kg) at top of layer 1
176  sp_hu1 = 2.0e-6_wp
177  u1 = u_max
178 
179  ! ------------------------ atmosphere layer 2 ----------------------------
180  h2 = 20000.0_wp
181  ! specific humidity (kg/kg) at top of layer 2
182  sp_hu2 = 2.6e-6_wp
183  u2 = 10.0_wp
184 
185  ! ------------------------ atmosphere layer 3 ----------------------------
186  h3 = 32000.0_wp
187  ! specific humidity (kg/kg) at top of layer 3
188  sp_hu3 = 3.2e-6_wp
189 
190  ! ------------------------ atmosphere layer 4 ----------------------------
191  h4 = 47000.0_wp
192  ! specific humidity (kg/kg) at top of layer 4
193  sp_hu4 = 3.2e-6_wp
194 
195  ! ------------------------ atmosphere layer 5 ----------------------------
196  h5 = 51000.0_wp
197  ! specific humidity (kg/kg) at top of layer 5
198  sp_hu5 = 3.2e-6_wp
199 
200  ! ------------------------ atmosphere layer 6 ----------------------------
201  h6 = 71000.0_wp
202  ! specific humidity (kg/kg) at top of layer 6
203  sp_hu6 = 2.4e-6_wp
204  ! Ref: WINDS AT ALTITUDES UP TO 80 KILOMETERS (Fig. 2)
205  u6 = 65.0_wp
206 
207  END IF
208 
209  CALL zmet
210 
211  rho_atm0 = rho_atm
212 
213 
214  RETURN
215 
216  END SUBROUTINE initialize_meteo
217 
218  !******************************************************************************
220  !
226  !******************************************************************************
227 
228  SUBROUTINE zmet
230  USE plume_module, ONLY: z , vent_height
231 
232  USE variables, ONLY : verbose_level
233 
234  IMPLICIT NONE
235 
236  REAL(wp) :: const, const1, t1, p1, p2
237  REAL(wp) :: const2
238 
240  REAL(wp) :: WE_wind , NS_wind
241 
243  REAL(wp) :: Cs
244 
245  ! Density correction factor
246  REAL(wp) :: K
247 
248  REAL(wp) :: sp_hu_avg
249 
250  REAL(wp) :: hu_ratio
251 
252  REAL(wp) :: h_bot , h_top
253  REAL(wp) :: sphu_bot , sphu_top
254 
255  REAL(wp) :: T_ref , t0
256  REAL(wp) :: el , es , e_sl
257 
258  REAL(wp) :: p_wv , p_da
259  REAL(wp) :: n_wv , n_da
260  REAL(wp) :: x_wv , x_da
261 
262 
263  IF ( read_atm_profile .EQ. 'card' ) THEN
264 
265  ! interp density profile
267 
268  ! interp pressure profile
269  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(3,:), z, pa)
270 
271  ! interp temperature profile
272  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(4,:), z, ta)
273 
274  ! interp specific humifity profile
276 
277  ! interp pressure profile
278  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(6,:), z, we_wind)
279 
280  ! interp pressure profile
281  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(7,:), z, ns_wind)
282 
283  u_wind = we_wind
284  v_wind = -ns_wind
285 
286  IF ( ( we_wind .EQ. 0.0_wp ) .AND. ( ns_wind .EQ. 0.0_wp ) ) THEN
287 
288  we_wind = 1.e-15_wp
289  ns_wind = 1.e-15_wp
290 
291  END IF
292 
293  u_atm = sqrt( we_wind**2 + ns_wind**2 )
294 
295  cos_theta = we_wind / u_atm
296  sin_theta = ns_wind / u_atm
297 
298  ELSEIF ( read_atm_profile .EQ. 'table' ) THEN
299 
300  ! interp density profile
302 
303  ! interp pressure profile
305 
306  ! interp temperature profile
308 
309  IF ( ( z - vent_height ) .LE. z_r ) THEN
310 
311  u_atm = u_max * ( ( z - vent_height ) / z_r )**exp_wind
312 
313  ELSE
314 
315  u_atm = u_max
316 
317  END IF
318 
319  cos_theta = 1.0_wp
320  sin_theta = 0.0_wp
321 
322  ELSEIF ( read_atm_profile .EQ. 'standard' ) THEN
323 
324  IF ( z <= h1 ) THEN
325 
326  ! ... Troposphere
327  u_atm = u0 + (u1-u0) * (z-h0) / (h1-h0)
328 
329  h_bot = h0
330  h_top = h1
331  sphu_bot = sp_hu0
332  sphu_top = sp_hu1
333 
334  gamma_d = 6.5e-3_wp
335 
336  ELSE IF (z > h1 .AND. z <= h2) THEN
337 
338  ! ... Tropopause
339  u_atm = u1 + (u2-u1) * (z-h1) / (h2-h1)
340 
341  h_bot = h1
342  h_top = h2
343  sphu_bot = sp_hu1
344  sphu_top = sp_hu2
345 
346  gamma_d = 0.0_wp
347 
348  ELSE IF (z > h2 .AND. z <= h3) THEN
349 
350  ! ... Stratosphere
351  u_atm = u2 + (u6-u2) * (z-h2) / (h6-h2)
352 
353  h_bot = h2
354  h_top = h3
355  sphu_bot = sp_hu2
356  sphu_top = sp_hu3
357 
358  gamma_d = -1.0e-3_wp
359 
360  ELSE IF (z > h3 .AND. z <= h4) THEN
361 
362  u_atm = u2 + (u6-u2) * (z-h2) / (h6-h2);
363 
364  h_bot = h3
365  h_top = h4
366  sphu_bot = sp_hu3
367  sphu_top = sp_hu4
368 
369  gamma_d = -2.8e-3_wp
370 
371  ELSE IF (z > h4 .AND. z <= h5) THEN
372 
373  u_atm = u2 + (u6-u2) * (z-h2) / (h6-h2)
374 
375  h_bot = h4
376  h_top = h5
377  sphu_bot = sp_hu4
378  sphu_top = sp_hu5
379 
380  gamma_d = 0.0_wp
381 
382  ELSE IF (z > h5 .AND. z <= h6) THEN
383 
384  u_atm = u2 + (u6-u2) * (z-h2) / (h6-h2);
385 
386  h_bot = h5
387  h_top = h6
388  sphu_bot = sp_hu5
389  sphu_top = sp_hu6
390 
391  gamma_d = +2.8e-3_wp
392 
393  ENDIF
394 
395  IF ( sphu_atm0 .GT. 0.0_wp ) THEN
396 
397  ! log of specific humidity is assumed to vary linearly
398  sphu_atm = exp( log(sphu_bot) + ( log(sphu_top) - log(sphu_bot) ) * &
399  (z-h_bot) / (h_top-h_bot) )
400 
401  ELSE
402 
403  t_ref = 273.16_wp
404  t0 = t_ref - 40.0_wp
405 
406  ! saturation pressure of vapor over liquid Pa
407  el = 611.2_wp * exp( 17.67_wp * ( ta-273.16_wp ) / ( ta - 29.65_wp ) )
408 
409  ! saturation pressure of vapor over ice Pa
410  es = -9.097_wp * ( (273.16_wp / ta ) - 1.0_wp ) - 3.566_wp * &
411  log10(273.16_wp / ta) + 0.876_wp * ( 1.0_wp - (ta / 273.16_wp) )
412 
413  es = 611.22_wp * ( 10.0_wp**es )
414 
415  ! saturation pressure of vapor
416  IF ( ta .GE. t_ref ) THEN
417 
418  e_sl = el
419 
420  ELSEIF ( ta .LE. t0 ) THEN
421 
422  e_sl = es
423 
424  ELSE
425 
426  e_sl = es + ( ta - t0 ) / ( t_ref - t0 ) * ( el - es )
427 
428  END IF
429 
430  p_wv = min(pa, rel_hu*e_sl)
431  ! dry air partial pressure
432  p_da = pa - p_wv
433  !molar fraction of water vapor
434  n_wv = p_wv / pa
435  !molar fraction dry air
436  n_da = p_da / pa
437  !mass fraction of da
438  x_da = (n_da * da_mol_wt) / (n_da * da_mol_wt + n_wv * wv_mol_wt )
439  !mass fraction of wv
440  x_wv = (n_wv * wv_mol_wt) / (n_da * da_mol_wt + n_wv * wv_mol_wt )
441  !specific humidity
442  sphu_atm = x_wv / (x_da+x_wv)
443 
444  END IF
445 
446  ! WRITE(*,*) sphu_atm
447 
448  ! Density of dry air
449  rho_dry = pa / ( rair*ta )
450 
451  ! Density correction factor
452  k = 1.0_wp / ( 1.0_wp + ( rwv/rair - 1.0_wp ) * sphu_atm )
453 
454  ! Density of mixure (dry air and water vapor)
455  rho_atm = k * rho_dry
456 
457  ! Lapse rate corrected for specific humidity
458  gamma_m = gamma_d * (1.0_wp - 0.856_wp * sphu_atm )
459 
460  u_wind = u_atm
461  v_wind = 0.0_wp
462 
463  IF ( u_max .GT. 0.0_wp ) THEN
464 
467 
468  ELSE
469 
470  cos_theta = 1.0_wp
471  sin_theta = 0.0_wp
472 
473  END IF
474 
475  END IF
476 
477  ! ... Air viscosity ( Armienti et al. 1988)
478  cs = 120.0_wp
479  visc_atm = visc_atm0 * ( 288.15_wp + cs ) / ( ta + cs ) * ( ta / 288.15_wp )**1.5_wp
480 
481  IF ( verbose_level .GE. 1 ) THEN
482 
483  WRITE(*,*) 'Height (asl) = ',z
484  WRITE(*,*) 'Ambient temperature (K) = ',ta
485  WRITE(*,*) 'Ambient pressure (Pa) = ', pa
486  WRITE(*,*) 'Dry atmosphere density (kg m-3) = ',rho_dry
487  WRITE(*,*) 'Moist atmosphere density (kg m-3) = ',rho_atm
488  WRITE(*,*) 'Atmosphere viscosity = ',visc_atm
489  WRITE(*,*) 'Wind speed (m s-1) = ',u_atm
490  READ(*,*)
491 
492  END IF
493 
494  RETURN
495 
496  END SUBROUTINE zmet
497 
498 !---------------------------------------------------------------------------
500 !
508 !---------------------------------------------------------------------------
509 
510  SUBROUTINE interp_1d_scalar(x1, f1, x2, f2)
511  IMPLICIT NONE
512 
513  REAL(wp), INTENT(IN), DIMENSION(:) :: x1, f1
514  REAL(wp), INTENT(IN) :: x2
515  REAL(wp), INTENT(OUT) :: f2
516  INTEGER :: n, n1x, t
517  REAL(wp) :: grad
518 
519  n1x = SIZE(x1)
520 
521  !
522  ! ... locate the grid points near the topographic points
523  ! ... and interpolate linearly the profile
524  !
525  t = 0
526 
527  DO n = 1, n1x
528 
529  IF (x1(n) <= x2) t = n
530 
531  END DO
532 
533  IF ( t.EQ.0 ) THEN
534 
535  f2 = f1(1)
536 
537  ELSEIF ( t.EQ.n1x ) THEN
538 
539  f2 = f1(n1x)
540 
541  ELSE
542 
543  grad = (f1(t+1)-f1(t))/(x1(t+1)-x1(t))
544  f2 = f1(t) + (x2-x1(t)) * grad
545 
546  END IF
547 
548  RETURN
549 
550  END SUBROUTINE interp_1d_scalar
551 
552  !------------------------------------------------------------------
553 
554 END MODULE meteo_module
555 !----------------------------------------------------------------------
real(wp) v_wind
Definition: meteo.f90:57
real(wp) visc_atm
Atmospheric kinematic viscosity.
Definition: meteo.f90:70
real(wp) h2
Definition: meteo.f90:20
real(wp) pa
Atmospheric pressure.
Definition: meteo.f90:79
real(wp) u0
Definition: meteo.f90:26
real(wp) rho_atm
Atmospheric density.
Definition: meteo.f90:60
real(wp) cpair
specific heat capacity for dry air
Definition: meteo.f90:91
real(wp) rh
Relative humidity for standard atmosphere.
Definition: meteo.f90:45
real(wp), parameter h_lw0
enthalpy of liquid water at reference temperature (J kg-1)
Definition: meteo.f90:103
real(wp) sp_hu1
Definition: meteo.f90:34
real(wp) u_max
Definition: meteo.f90:136
real(wp) z_r
Definition: meteo.f90:136
real(wp) sp_hu5
Definition: meteo.f90:34
real(wp) h0
Definition: meteo.f90:18
real(wp) ta
Atmospheric temperature.
Definition: meteo.f90:76
real(wp) rho_dry
Definition: meteo.f90:42
real(wp), parameter wv_mol_wt
molecular weight of water vapor
Definition: meteo.f90:115
real(wp) sp_hu4
Definition: meteo.f90:34
real(wp) u_atm
Horizonal wind speed.
Definition: meteo.f90:54
real(wp) wind_mult_coeff
Definition: meteo.f90:143
real(wp) sp_hu2
Definition: meteo.f90:34
real(wp) exp_wind
Definition: meteo.f90:136
real(wp) h4
Definition: meteo.f90:22
real(wp) sp_hu0
Definition: meteo.f90:34
real(wp) sp_hu3
Definition: meteo.f90:34
real(wp) sphu_atm0
Atmospheric specific humidity at sea level (kg/kg)
Definition: meteo.f90:66
real(wp) h3
Definition: meteo.f90:21
real(wp) u1
Definition: meteo.f90:27
Meteo module.
Definition: meteo.f90:11
real(wp) gamma_d
Definition: meteo.f90:40
real(wp) visc_atm0
Atmospheric kinematic viscosity at sea level.
Definition: meteo.f90:73
real(wp) u5
Definition: meteo.f90:31
subroutine interp_1d_scalar(x1, f1, x2, f2)
Scalar interpolation.
Definition: meteo.f90:511
real(wp) rho_atm0
Atmospheric density at sea level.
Definition: meteo.f90:51
real(wp), dimension(:), allocatable pres_atm_month_lat
Definition: meteo.f90:138
real(wp) gamma_m
Definition: meteo.f90:38
Plume module.
Definition: plume.f90:11
real(wp), parameter h_wv0
enthalpy of water vapor at reference temperature (J kg-1)
Definition: meteo.f90:97
real(wp) u4
Definition: meteo.f90:30
real(wp) cos_theta
Wind angle.
Definition: meteo.f90:48
real(wp) u2
Definition: meteo.f90:28
real(wp) h6
Definition: meteo.f90:24
real(wp), dimension(:), allocatable h_levels
Definition: meteo.f90:141
subroutine zmet
Meteo parameters.
Definition: meteo.f90:229
real(wp) dpdz
Vertical gradient of the pressure.
Definition: meteo.f90:82
real(wp), parameter c_ice
specific heat of ice (J K-1 kg-1)
Definition: meteo.f90:109
real(wp) rair
perfect gas constant for dry air ( J/(kg K) )
Definition: meteo.f90:88
real(wp), parameter t_ref
reference temperature (K)
Definition: meteo.f90:94
real(wp), parameter da_mol_wt
molecular weight of dry air
Definition: meteo.f90:112
real(wp), dimension(:,:), allocatable temp_atm_month
Definition: meteo.f90:138
real(wp) dtdz
Vertical gradient of the temperature.
Definition: meteo.f90:85
real(wp), dimension(:,:), allocatable atm_profile
atmospheric profile above the vent. It is an array with n_atm_profile rows and 7 columns: ...
Definition: meteo.f90:132
real(wp), dimension(:), allocatable rho_atm_month_lat
Definition: meteo.f90:138
real(wp) u_wind
Definition: meteo.f90:56
real(wp) vent_height
height of the base of the plume
Definition: plume.f90:35
real(wp) u3
Definition: meteo.f90:29
real(wp) z
plume vertical coordinate
Definition: plume.f90:21
integer, parameter wp
working precision
Definition: variables.f90:21
real(wp), parameter c_lw
specific heat of liquid water (J K-1 kg-1)
Definition: meteo.f90:106
real(wp), parameter c_wv
specifc heat of water vapor (J K-1 kg-1)
Definition: meteo.f90:100
real(wp), dimension(:), allocatable temp_atm_month_lat
Definition: meteo.f90:138
subroutine initialize_meteo
Meteo parameters initialization.
Definition: meteo.f90:160
real *8 gi
Gravity acceleration.
Definition: variables.f90:24
real(wp), parameter rwv
gas constant for water vapor ( J/(kg K) )
Definition: meteo.f90:118
real(wp) rel_hu
Definition: meteo.f90:36
integer n_atm_profile
Definition: meteo.f90:120
Global variables.
Definition: variables.f90:10
real(wp) h5
Definition: meteo.f90:23
character *10 read_atm_profile
Definition: meteo.f90:134
real(wp) h1
Definition: meteo.f90:19
real(wp) sin_theta
Definition: meteo.f90:48
real(wp) u6
Definition: meteo.f90:32
integer verbose_level
Level of verbose output (0 = minimal output on screen)
Definition: variables.f90:33
real(wp) sp_hu6
Definition: meteo.f90:34
real(wp) sphu_atm
Atmospheric specific humidity (kg/kg)
Definition: meteo.f90:63