PLUME-MoM  1.0
Integralvolcanicplumemodel
 All Classes Files Functions Variables Pages
meteo.f90
Go to the documentation of this file.
1 !********************************************************************
3 !
9 !********************************************************************
10 
12 
13  USE variables, ONLY: gi ! Grav acceleration
14 
15  IMPLICIT NONE
16 
18  REAL*8 :: gt
19 
21  REAL*8 :: gs
22 
24  REAL*8 :: p0
25 
27  REAL*8 :: t0
28 
30  REAL*8 :: h1
31 
33  REAL*8 :: h2
34 
36  REAL*8 :: u_atm0
37 
39  REAL*8 :: duatm_dz0
40 
42  REAL*8 :: cos_theta , sin_theta
43 
45  REAL*8 :: rho_atm0
46 
48  REAL*8 :: u_atm
49 
51  REAL*8 :: rho_atm
52 
54  REAL*8 :: visc_atm
55 
57  REAL*8 :: visc_atm0
58 
60  REAL*8 :: ta
61 
63  REAL*8 :: pa
64 
66  REAL*8 :: dpdz
67 
69  REAL*8 :: dtdz
70 
72  REAL*8 :: duatm_dz
73 
75  REAL :: rair
76 
78  REAL :: cpair
79 
80  INTEGER :: n_atm_profile
81 
82  REAL*8, ALLOCATABLE :: atm_profile(:,:)
83 
84  CHARACTER*10 :: read_atm_profile
85 
86  REAL*8 :: u_r , z_r , exp_wind
87 
88  REAL*8, ALLOCATABLE :: rho_atm_month_lat(:) , pres_atm_month_lat(:) , &
89  temp_atm_month_lat(:) , temp_atm_month(:,:)
90 
91  REAL*8, ALLOCATABLE :: h_levels(:)
92 
93  REAL*8 :: wind_mult_coeff
94 
95  SAVE
96 
97 CONTAINS
98 
99  !******************************************************************************
101  !
107  !******************************************************************************
108 
109  SUBROUTINE initialize_meteo
110 
111  IMPLICIT NONE
112 
113  CALL zmet
114 
115  rho_atm0 = rho_atm
116 
117  RETURN
118 
119  END SUBROUTINE initialize_meteo
120 
121  !******************************************************************************
123  !
129  !******************************************************************************
130 
131  SUBROUTINE zmet
132 
133  USE plume_module, ONLY: z , vent_height
134 
135  USE variables, ONLY : verbose_level
136 
137  IMPLICIT NONE
138 
139  REAL*8 :: const, const1, t1, p1, p2
140  REAL*8 :: const2
141 
143  REAL*8 :: we_wind , ns_wind
144 
146  REAL*8 :: cs
147 
148  IF ( read_atm_profile .EQ. 'card' ) THEN
149 
150  ! interp density profile
151  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(2,:), z, rho_atm)
152 
153  ! interp pressure profile
154  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(3,:), z, pa)
155 
156  ! interp temperature profile
157  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(4,:), z, ta)
158 
159  ! interp pressure profile
160  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(6,:), z, we_wind)
161 
162  ! interp pressure profile
163  CALL interp_1d_scalar(atm_profile(1,:), atm_profile(7,:), z, ns_wind)
164 
165  u_atm = dsqrt( we_wind**2 + ns_wind**2 )
166 
167  cos_theta = we_wind / u_atm
168  sin_theta = ns_wind / u_atm
169 
170  ELSEIF ( read_atm_profile .EQ. 'table' ) THEN
171 
172  ! interp density profile
173  CALL interp_1d_scalar(h_levels(:), rho_atm_month_lat(:), z, rho_atm)
174 
175  ! interp pressure profile
176  CALL interp_1d_scalar(h_levels(:), pres_atm_month_lat(:), z, pa)
177 
178  ! interp temperature profile
179  CALL interp_1d_scalar(h_levels(:), temp_atm_month_lat(:), z, ta)
180 
181  IF ( z .LE. z_r ) THEN
182 
183  u_atm = u_r * ( ( z - vent_height ) / z_r )**exp_wind
184 
185  ELSE
186 
187  u_atm = u_r
188 
189  END IF
190 
191  cos_theta = 1.d0
192  sin_theta = 0.d0
193 
194 
195  ELSEIF ( read_atm_profile .EQ. 'standard' ) THEN
196 
197 
198  ! u_atm = u_atm0 + duatm_dz * z
199  ! duatm_dz = duatm_dz0
200 
201  IF ( z .LE. z_r ) THEN
202 
203  u_atm = u_r * ( z / z_r )**exp_wind
204 
205  ELSE
206 
207  u_atm = u_r
208 
209  END IF
210 
211  cos_theta = 1.d0
212  sin_theta = 0.d0
213 
214 
215  !
216  ! ... Temperature and pressure at the tropopause bottom
217  !
218  const = - gi / ( rair * gt )
219  t1 = t0 + gt * h1
220  p1 = p0 * (t1/t0)**const
221  const1 = gi / ( rair * t1 )
222  p2 = p1 * dexp( -const1 * ( h2-h1 ) )
223  const2 = - gi / ( rair * gs )
224 
225  IF ( z <= h1 ) THEN
226 
227  ! ... Troposphere
228 
229  ta = t0 + gt * z
230  pa = p0 * ( ta / t0 )**const
231  rho_atm = pa / ( rair*ta )
232 
233  ELSE IF (z > h1 .AND. z <= h2) THEN
234 
235  ! ... Tropopause
236 
237  ta = t1
238  pa = p1 * dexp( -const1 * ( z - h1 ) )
239  rho_atm = pa / ( rair * ta )
240 
241  ELSE
242 
243  ! ... Stratosphere
244 
245  ta = t0 + gt*h1 + gs*(z-h2)
246  pa = p2 * (ta/t1)**const2
247  rho_atm = pa / (rair*ta)
248 
249  ENDIF
250 
251  END IF
252 
253  ! ... Air viscosity ( Armienti et al. 1988)
254  cs = 120.d0
255  visc_atm = visc_atm0 * ( 288.15d0 + cs ) / ( ta + cs ) * ( ta / 288.15d0 )**1.5d0
256 
257  IF ( verbose_level .GE. 1 ) THEN
258 
259  WRITE(*,*) z,rho_atm,pa,ta,u_atm,cos_theta,sin_theta
260  WRITE(*,*) 'visc_atm',visc_atm
261  READ(*,*)
262 
263  END IF
264 
265  RETURN
266 
267  END SUBROUTINE zmet
268 
269 !---------------------------------------------------------------------------
271 !
279 !---------------------------------------------------------------------------
280 
281  SUBROUTINE interp_1d_scalar(x1, f1, x2, f2)
282  IMPLICIT NONE
283 
284  REAL*8, INTENT(IN), DIMENSION(:) :: x1, f1
285  REAL*8, INTENT(IN) :: x2
286  REAL*8, INTENT(OUT) :: f2
287  INTEGER :: n, n1x, t
288  REAL*8 :: grad
289 
290  n1x = SIZE(x1)
291 
292  !
293  ! ... locate the grid points near the topographic points
294  ! ... and interpolate linearly the profile
295  !
296  t = 1
297 
298  DO n = 1, n1x
299 
300  IF (x1(n) <= x2) t = n
301 
302  END DO
303 
304  IF (t==1 .OR. t==n1x) THEN
305 
306  f2 = f1(t)
307 
308  ELSE
309 
310  grad = (f1(t+1)-f1(t))/(x1(t+1)-x1(t))
311  f2 = f1(t) + (x2-x1(t)) * grad
312 
313  END IF
314 
315  RETURN
316 
317  END SUBROUTINE interp_1d_scalar
318 
319  !------------------------------------------------------------------
320 
321 END MODULE meteo_module
322 !----------------------------------------------------------------------
Meteo module.
Definition: meteo.f90:11
subroutine zmet
Meteo parameters.
Definition: meteo.f90:131
Global variables.
Definition: variables.f90:10
Plume module.
Definition: plume.f90:11
subroutine initialize_meteo
Meteo parameters initialization.
Definition: meteo.f90:109
subroutine interp_1d_scalar(x1, f1, x2, f2)
Scalar interpolation.
Definition: meteo.f90:281