1 | SUBROUTINE check_parameters |
---|
2 | |
---|
3 | !--------------------------------------------------------------------------------! |
---|
4 | ! This file is part of PALM. |
---|
5 | ! |
---|
6 | ! PALM is free software: you can redistribute it and/or modify it under the terms |
---|
7 | ! of the GNU General Public License as published by the Free Software Foundation, |
---|
8 | ! either version 3 of the License, or (at your option) any later version. |
---|
9 | ! |
---|
10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
13 | ! |
---|
14 | ! You should have received a copy of the GNU General Public License along with |
---|
15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | ! |
---|
17 | ! Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
18 | !--------------------------------------------------------------------------------! |
---|
19 | ! |
---|
20 | ! Current revisions: |
---|
21 | ! ----------------- |
---|
22 | ! |
---|
23 | ! |
---|
24 | ! Former revisions: |
---|
25 | ! ----------------- |
---|
26 | ! $Id: check_parameters.f90 1362 2014-04-16 15:19:12Z hoffmann $ |
---|
27 | ! |
---|
28 | ! 1361 2014-04-16 15:17:48Z hoffmann |
---|
29 | ! PA0363 removed |
---|
30 | ! PA0362 changed |
---|
31 | ! |
---|
32 | ! 1359 2014-04-11 17:15:14Z hoffmann |
---|
33 | ! Do not allow the execution of PALM with use_particle_tails, since particle |
---|
34 | ! tails are currently not supported by our new particle structure. |
---|
35 | ! |
---|
36 | ! PA0084 not necessary for new particle structure |
---|
37 | ! |
---|
38 | ! 1353 2014-04-08 15:21:23Z heinze |
---|
39 | ! REAL constants provided with KIND-attribute |
---|
40 | ! |
---|
41 | ! 1330 2014-03-24 17:29:32Z suehring |
---|
42 | ! In case of SGS-particle velocity advection of TKE is also allowed with |
---|
43 | ! dissipative 5th-order scheme. |
---|
44 | ! |
---|
45 | ! 1327 2014-03-21 11:00:16Z raasch |
---|
46 | ! "baroclinicity" renamed "baroclinity", "ocean version" replaced by "ocean mode" |
---|
47 | ! bugfix: duplicate error message 56 removed, |
---|
48 | ! check of data_output_format and do3d_compress removed |
---|
49 | ! |
---|
50 | ! 1322 2014-03-20 16:38:49Z raasch |
---|
51 | ! some REAL constants defined as wp-kind |
---|
52 | ! |
---|
53 | ! 1320 2014-03-20 08:40:49Z raasch |
---|
54 | ! Kind-parameters added to all INTEGER and REAL declaration statements, |
---|
55 | ! kinds are defined in new module kinds, |
---|
56 | ! revision history before 2012 removed, |
---|
57 | ! comment fields (!:) to be used for variable explanations added to |
---|
58 | ! all variable declaration statements |
---|
59 | ! |
---|
60 | ! 1308 2014-03-13 14:58:42Z fricke |
---|
61 | ! +netcdf_data_format_save |
---|
62 | ! Calculate fixed number of output time levels for parallel netcdf output. |
---|
63 | ! For masked data, parallel netcdf output is not tested so far, hence |
---|
64 | ! netcdf_data_format is switched back to non-paralell output. |
---|
65 | ! |
---|
66 | ! 1299 2014-03-06 13:15:21Z heinze |
---|
67 | ! enable usage of large_scale subsidence in combination with large_scale_forcing |
---|
68 | ! output for profile of large scale vertical velocity w_subs added |
---|
69 | ! |
---|
70 | ! 1276 2014-01-15 13:40:41Z heinze |
---|
71 | ! Use LSF_DATA also in case of Dirichlet bottom boundary condition for scalars |
---|
72 | ! |
---|
73 | ! 1241 2013-10-30 11:36:58Z heinze |
---|
74 | ! output for profiles of ug and vg added |
---|
75 | ! set surface_heatflux and surface_waterflux also in dependence on |
---|
76 | ! large_scale_forcing |
---|
77 | ! checks for nudging and large scale forcing from external file |
---|
78 | ! |
---|
79 | ! 1236 2013-09-27 07:21:13Z raasch |
---|
80 | ! check number of spectra levels |
---|
81 | ! |
---|
82 | ! 1216 2013-08-26 09:31:42Z raasch |
---|
83 | ! check for transpose_compute_overlap (temporary) |
---|
84 | ! |
---|
85 | ! 1214 2013-08-21 12:29:17Z kanani |
---|
86 | ! additional check for simultaneous use of vertical grid stretching |
---|
87 | ! and particle advection |
---|
88 | ! |
---|
89 | ! 1212 2013-08-15 08:46:27Z raasch |
---|
90 | ! checks for poisfft_hybrid removed |
---|
91 | ! |
---|
92 | ! 1210 2013-08-14 10:58:20Z raasch |
---|
93 | ! check for fftw |
---|
94 | ! |
---|
95 | ! 1179 2013-06-14 05:57:58Z raasch |
---|
96 | ! checks and settings of buoyancy parameters and switches revised, |
---|
97 | ! initial profile for rho added to hom (id=77) |
---|
98 | ! |
---|
99 | ! 1174 2013-05-31 10:28:08Z gryschka |
---|
100 | ! Bugfix in computing initial profiles for ug, vg, lad, q in case of Atmosphere |
---|
101 | ! |
---|
102 | ! 1159 2013-05-21 11:58:22Z fricke |
---|
103 | ! bc_lr/ns_dirneu/neudir removed |
---|
104 | ! |
---|
105 | ! 1115 2013-03-26 18:16:16Z hoffmann |
---|
106 | ! unused variables removed |
---|
107 | ! drizzle can be used without precipitation |
---|
108 | ! |
---|
109 | ! 1111 2013-03-08 23:54:10Z raasch |
---|
110 | ! ibc_p_b = 2 removed |
---|
111 | ! |
---|
112 | ! 1103 2013-02-20 02:15:53Z raasch |
---|
113 | ! Bugfix: turbulent inflow must not require cyclic fill in restart runs |
---|
114 | ! |
---|
115 | ! 1092 2013-02-02 11:24:22Z raasch |
---|
116 | ! unused variables removed |
---|
117 | ! |
---|
118 | ! 1069 2012-11-28 16:18:43Z maronga |
---|
119 | ! allow usage of topography in combination with cloud physics |
---|
120 | ! |
---|
121 | ! 1065 2012-11-22 17:42:36Z hoffmann |
---|
122 | ! Bugfix: It is not allowed to use cloud_scheme = seifert_beheng without |
---|
123 | ! precipitation in order to save computational resources. |
---|
124 | ! |
---|
125 | ! 1060 2012-11-21 07:19:51Z raasch |
---|
126 | ! additional check for parameter turbulent_inflow |
---|
127 | ! |
---|
128 | ! 1053 2012-11-13 17:11:03Z hoffmann |
---|
129 | ! necessary changes for the new two-moment cloud physics scheme added: |
---|
130 | ! - check cloud physics scheme (Kessler or Seifert and Beheng) |
---|
131 | ! - plant_canopy is not allowed |
---|
132 | ! - currently, only cache loop_optimization is allowed |
---|
133 | ! - initial profiles of nr, qr |
---|
134 | ! - boundary condition of nr, qr |
---|
135 | ! - check output quantities (qr, nr, prr) |
---|
136 | ! |
---|
137 | ! 1036 2012-10-22 13:43:42Z raasch |
---|
138 | ! code put under GPL (PALM 3.9) |
---|
139 | ! |
---|
140 | ! 1031/1034 2012-10-22 11:32:49Z raasch |
---|
141 | ! check of netcdf4 parallel file support |
---|
142 | ! |
---|
143 | ! 1019 2012-09-28 06:46:45Z raasch |
---|
144 | ! non-optimized version of prognostic_equations not allowed any more |
---|
145 | ! |
---|
146 | ! 1015 2012-09-27 09:23:24Z raasch |
---|
147 | ! acc allowed for loop optimization, |
---|
148 | ! checks for adjustment of mixing length to the Prandtl mixing length removed |
---|
149 | ! |
---|
150 | ! 1003 2012-09-14 14:35:53Z raasch |
---|
151 | ! checks for cases with unequal subdomain sizes removed |
---|
152 | ! |
---|
153 | ! 1001 2012-09-13 14:08:46Z raasch |
---|
154 | ! all actions concerning leapfrog- and upstream-spline-scheme removed |
---|
155 | ! |
---|
156 | ! 996 2012-09-07 10:41:47Z raasch |
---|
157 | ! little reformatting |
---|
158 | |
---|
159 | ! 978 2012-08-09 08:28:32Z fricke |
---|
160 | ! setting of bc_lr/ns_dirneu/neudir |
---|
161 | ! outflow damping layer removed |
---|
162 | ! check for z0h* |
---|
163 | ! check for pt_damping_width |
---|
164 | ! |
---|
165 | ! 964 2012-07-26 09:14:24Z raasch |
---|
166 | ! check of old profil-parameters removed |
---|
167 | ! |
---|
168 | ! 940 2012-07-09 14:31:00Z raasch |
---|
169 | ! checks for parameter neutral |
---|
170 | ! |
---|
171 | ! 924 2012-06-06 07:44:41Z maronga |
---|
172 | ! Bugfix: preprocessor directives caused error during compilation |
---|
173 | ! |
---|
174 | ! 892 2012-05-02 13:51:44Z maronga |
---|
175 | ! Bugfix for parameter file check ( excluding __netcdf4 ) |
---|
176 | ! |
---|
177 | ! 866 2012-03-28 06:44:41Z raasch |
---|
178 | ! use only 60% of the geostrophic wind as translation speed in case of Galilean |
---|
179 | ! transformation and use_ug_for_galilei_tr = .T. in order to mimimize the |
---|
180 | ! timestep |
---|
181 | ! |
---|
182 | ! 861 2012-03-26 14:18:34Z suehring |
---|
183 | ! Check for topography and ws-scheme removed. |
---|
184 | ! Check for loop_optimization = 'vector' and ws-scheme removed. |
---|
185 | ! |
---|
186 | ! 845 2012-03-07 10:23:05Z maronga |
---|
187 | ! Bugfix: exclude __netcdf4 directive part from namelist file check compilation |
---|
188 | ! |
---|
189 | ! 828 2012-02-21 12:00:36Z raasch |
---|
190 | ! check of collision_kernel extended |
---|
191 | ! |
---|
192 | ! 825 2012-02-19 03:03:44Z raasch |
---|
193 | ! check for collision_kernel and curvature_solution_effects |
---|
194 | ! |
---|
195 | ! 809 2012-01-30 13:32:58Z maronga |
---|
196 | ! Bugfix: replaced .AND. and .NOT. with && and ! in the preprocessor directives |
---|
197 | ! |
---|
198 | ! 807 2012-01-25 11:53:51Z maronga |
---|
199 | ! New cpp directive "__check" implemented which is used by check_namelist_files |
---|
200 | ! |
---|
201 | ! Revision 1.1 1997/08/26 06:29:23 raasch |
---|
202 | ! Initial revision |
---|
203 | ! |
---|
204 | ! |
---|
205 | ! Description: |
---|
206 | ! ------------ |
---|
207 | ! Check control parameters and deduce further quantities. |
---|
208 | !------------------------------------------------------------------------------! |
---|
209 | |
---|
210 | USE arrays_3d |
---|
211 | USE cloud_parameters |
---|
212 | USE constants |
---|
213 | USE control_parameters |
---|
214 | USE dvrp_variables |
---|
215 | USE grid_variables |
---|
216 | USE indices |
---|
217 | USE kinds |
---|
218 | USE model_1d |
---|
219 | USE netcdf_control |
---|
220 | USE particle_attributes |
---|
221 | USE pegrid |
---|
222 | USE profil_parameter |
---|
223 | USE spectrum |
---|
224 | USE statistics |
---|
225 | USE subsidence_mod |
---|
226 | USE statistics |
---|
227 | USE transpose_indices |
---|
228 | |
---|
229 | IMPLICIT NONE |
---|
230 | |
---|
231 | CHARACTER (LEN=1) :: sq !: |
---|
232 | CHARACTER (LEN=6) :: var !: |
---|
233 | CHARACTER (LEN=7) :: unit !: |
---|
234 | CHARACTER (LEN=8) :: date !: |
---|
235 | CHARACTER (LEN=10) :: time !: |
---|
236 | CHARACTER (LEN=40) :: coupling_string !: |
---|
237 | CHARACTER (LEN=100) :: action !: |
---|
238 | |
---|
239 | INTEGER(iwp) :: i !: |
---|
240 | INTEGER(iwp) :: ilen !: |
---|
241 | INTEGER(iwp) :: iremote = 0 !: |
---|
242 | INTEGER(iwp) :: j !: |
---|
243 | INTEGER(iwp) :: k !: |
---|
244 | INTEGER(iwp) :: kk !: |
---|
245 | INTEGER(iwp) :: netcdf_data_format_save !: |
---|
246 | INTEGER(iwp) :: position !: |
---|
247 | INTEGER(iwp) :: prec !: |
---|
248 | |
---|
249 | LOGICAL :: found !: |
---|
250 | LOGICAL :: ldum !: |
---|
251 | |
---|
252 | REAL(wp) :: gradient !: |
---|
253 | REAL(wp) :: remote = 0.0_wp !: |
---|
254 | REAL(wp) :: simulation_time_since_reference !: |
---|
255 | |
---|
256 | ! |
---|
257 | !-- Check for overlap combinations, which are not realized yet |
---|
258 | IF ( transpose_compute_overlap ) THEN |
---|
259 | IF ( numprocs == 1 ) STOP '+++ transpose-compute-overlap not implemented for single PE runs' |
---|
260 | #if defined( __openacc ) |
---|
261 | STOP '+++ transpose-compute-overlap not implemented for GPU usage' |
---|
262 | #endif |
---|
263 | ENDIF |
---|
264 | |
---|
265 | ! |
---|
266 | !-- Warning, if host is not set |
---|
267 | IF ( host(1:1) == ' ' ) THEN |
---|
268 | message_string = '"host" is not set. Please check that environment ' // & |
---|
269 | 'variable "localhost" & is set before running PALM' |
---|
270 | CALL message( 'check_parameters', 'PA0001', 0, 0, 0, 6, 0 ) |
---|
271 | ENDIF |
---|
272 | |
---|
273 | ! |
---|
274 | !-- Check the coupling mode |
---|
275 | IF ( coupling_mode /= 'uncoupled' .AND. & |
---|
276 | coupling_mode /= 'atmosphere_to_ocean' .AND. & |
---|
277 | coupling_mode /= 'ocean_to_atmosphere' ) THEN |
---|
278 | message_string = 'illegal coupling mode: ' // TRIM( coupling_mode ) |
---|
279 | CALL message( 'check_parameters', 'PA0002', 1, 2, 0, 6, 0 ) |
---|
280 | ENDIF |
---|
281 | |
---|
282 | ! |
---|
283 | !-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny |
---|
284 | IF ( coupling_mode /= 'uncoupled') THEN |
---|
285 | |
---|
286 | IF ( dt_coupling == 9999999.9_wp ) THEN |
---|
287 | message_string = 'dt_coupling is not set but required for coup' // & |
---|
288 | 'ling mode "' // TRIM( coupling_mode ) // '"' |
---|
289 | CALL message( 'check_parameters', 'PA0003', 1, 2, 0, 6, 0 ) |
---|
290 | ENDIF |
---|
291 | |
---|
292 | #if defined( __parallel ) |
---|
293 | |
---|
294 | ! |
---|
295 | !-- NOTE: coupled runs have not been implemented in the check_namelist_files |
---|
296 | !-- program. |
---|
297 | !-- check_namelist_files will need the following information of the other |
---|
298 | !-- model (atmosphere/ocean). |
---|
299 | ! dt_coupling = remote |
---|
300 | ! dt_max = remote |
---|
301 | ! restart_time = remote |
---|
302 | ! dt_restart= remote |
---|
303 | ! simulation_time_since_reference = remote |
---|
304 | ! dx = remote |
---|
305 | |
---|
306 | |
---|
307 | #if ! defined( __check ) |
---|
308 | IF ( myid == 0 ) THEN |
---|
309 | CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, & |
---|
310 | ierr ) |
---|
311 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, & |
---|
312 | status, ierr ) |
---|
313 | ENDIF |
---|
314 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
315 | #endif |
---|
316 | IF ( dt_coupling /= remote ) THEN |
---|
317 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
318 | '": dt_coupling = ', dt_coupling, '& is not equal to ', & |
---|
319 | 'dt_coupling_remote = ', remote |
---|
320 | CALL message( 'check_parameters', 'PA0004', 1, 2, 0, 6, 0 ) |
---|
321 | ENDIF |
---|
322 | IF ( dt_coupling <= 0.0_wp ) THEN |
---|
323 | #if ! defined( __check ) |
---|
324 | IF ( myid == 0 ) THEN |
---|
325 | CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr ) |
---|
326 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & |
---|
327 | status, ierr ) |
---|
328 | ENDIF |
---|
329 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
330 | #endif |
---|
331 | dt_coupling = MAX( dt_max, remote ) |
---|
332 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
333 | '": dt_coupling <= 0.0 & is not allowed and is reset to ', & |
---|
334 | 'MAX(dt_max(A,O)) = ', dt_coupling |
---|
335 | CALL message( 'check_parameters', 'PA0005', 0, 1, 0, 6, 0 ) |
---|
336 | ENDIF |
---|
337 | #if ! defined( __check ) |
---|
338 | IF ( myid == 0 ) THEN |
---|
339 | CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, & |
---|
340 | ierr ) |
---|
341 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & |
---|
342 | status, ierr ) |
---|
343 | ENDIF |
---|
344 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
345 | #endif |
---|
346 | IF ( restart_time /= remote ) THEN |
---|
347 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
348 | '": restart_time = ', restart_time, '& is not equal to ', & |
---|
349 | 'restart_time_remote = ', remote |
---|
350 | CALL message( 'check_parameters', 'PA0006', 1, 2, 0, 6, 0 ) |
---|
351 | ENDIF |
---|
352 | #if ! defined( __check ) |
---|
353 | IF ( myid == 0 ) THEN |
---|
354 | CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, & |
---|
355 | ierr ) |
---|
356 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & |
---|
357 | status, ierr ) |
---|
358 | ENDIF |
---|
359 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
360 | #endif |
---|
361 | IF ( dt_restart /= remote ) THEN |
---|
362 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
363 | '": dt_restart = ', dt_restart, '& is not equal to ', & |
---|
364 | 'dt_restart_remote = ', remote |
---|
365 | CALL message( 'check_parameters', 'PA0007', 1, 2, 0, 6, 0 ) |
---|
366 | ENDIF |
---|
367 | |
---|
368 | simulation_time_since_reference = end_time - coupling_start_time |
---|
369 | #if ! defined( __check ) |
---|
370 | IF ( myid == 0 ) THEN |
---|
371 | CALL MPI_SEND( simulation_time_since_reference, 1, MPI_REAL, target_id, & |
---|
372 | 14, comm_inter, ierr ) |
---|
373 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & |
---|
374 | status, ierr ) |
---|
375 | ENDIF |
---|
376 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
377 | #endif |
---|
378 | IF ( simulation_time_since_reference /= remote ) THEN |
---|
379 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
380 | '": simulation_time_since_reference = ', & |
---|
381 | simulation_time_since_reference, '& is not equal to ', & |
---|
382 | 'simulation_time_since_reference_remote = ', remote |
---|
383 | CALL message( 'check_parameters', 'PA0008', 1, 2, 0, 6, 0 ) |
---|
384 | ENDIF |
---|
385 | |
---|
386 | #if ! defined( __check ) |
---|
387 | IF ( myid == 0 ) THEN |
---|
388 | CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr ) |
---|
389 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, & |
---|
390 | status, ierr ) |
---|
391 | ENDIF |
---|
392 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
393 | |
---|
394 | #endif |
---|
395 | IF ( coupling_mode == 'atmosphere_to_ocean') THEN |
---|
396 | |
---|
397 | IF ( dx < remote ) THEN |
---|
398 | WRITE( message_string, * ) 'coupling mode "', & |
---|
399 | TRIM( coupling_mode ), & |
---|
400 | '": dx in Atmosphere is not equal to or not larger then dx in ocean' |
---|
401 | CALL message( 'check_parameters', 'PA0009', 1, 2, 0, 6, 0 ) |
---|
402 | ENDIF |
---|
403 | |
---|
404 | IF ( (nx_a+1)*dx /= (nx_o+1)*remote ) THEN |
---|
405 | WRITE( message_string, * ) 'coupling mode "', & |
---|
406 | TRIM( coupling_mode ), & |
---|
407 | '": Domain size in x-direction is not equal in ocean and atmosphere' |
---|
408 | CALL message( 'check_parameters', 'PA0010', 1, 2, 0, 6, 0 ) |
---|
409 | ENDIF |
---|
410 | |
---|
411 | ENDIF |
---|
412 | |
---|
413 | #if ! defined( __check ) |
---|
414 | IF ( myid == 0) THEN |
---|
415 | CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr ) |
---|
416 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, & |
---|
417 | status, ierr ) |
---|
418 | ENDIF |
---|
419 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
420 | #endif |
---|
421 | IF ( coupling_mode == 'atmosphere_to_ocean') THEN |
---|
422 | |
---|
423 | IF ( dy < remote ) THEN |
---|
424 | WRITE( message_string, * ) 'coupling mode "', & |
---|
425 | TRIM( coupling_mode ), & |
---|
426 | '": dy in Atmosphere is not equal to or not larger then dy in ocean' |
---|
427 | CALL message( 'check_parameters', 'PA0011', 1, 2, 0, 6, 0 ) |
---|
428 | ENDIF |
---|
429 | |
---|
430 | IF ( (ny_a+1)*dy /= (ny_o+1)*remote ) THEN |
---|
431 | WRITE( message_string, * ) 'coupling mode "', & |
---|
432 | TRIM( coupling_mode ), & |
---|
433 | '": Domain size in y-direction is not equal in ocean and atmosphere' |
---|
434 | CALL message( 'check_parameters', 'PA0012', 1, 2, 0, 6, 0 ) |
---|
435 | ENDIF |
---|
436 | |
---|
437 | IF ( MOD(nx_o+1,nx_a+1) /= 0 ) THEN |
---|
438 | WRITE( message_string, * ) 'coupling mode "', & |
---|
439 | TRIM( coupling_mode ), & |
---|
440 | '": nx+1 in ocean is not divisible without remainder with nx+1 in', & |
---|
441 | ' atmosphere' |
---|
442 | CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 ) |
---|
443 | ENDIF |
---|
444 | |
---|
445 | IF ( MOD(ny_o+1,ny_a+1) /= 0 ) THEN |
---|
446 | WRITE( message_string, * ) 'coupling mode "', & |
---|
447 | TRIM( coupling_mode ), & |
---|
448 | '": ny+1 in ocean is not divisible without remainder with ny+1 in', & |
---|
449 | ' atmosphere' |
---|
450 | CALL message( 'check_parameters', 'PA0340', 1, 2, 0, 6, 0 ) |
---|
451 | ENDIF |
---|
452 | |
---|
453 | ENDIF |
---|
454 | #else |
---|
455 | WRITE( message_string, * ) 'coupling requires PALM to be called with', & |
---|
456 | ' ''mrun -K parallel''' |
---|
457 | CALL message( 'check_parameters', 'PA0141', 1, 2, 0, 6, 0 ) |
---|
458 | #endif |
---|
459 | ENDIF |
---|
460 | |
---|
461 | #if defined( __parallel ) && ! defined ( __check ) |
---|
462 | ! |
---|
463 | !-- Exchange via intercommunicator |
---|
464 | IF ( coupling_mode == 'atmosphere_to_ocean' .AND. myid == 0 ) THEN |
---|
465 | CALL MPI_SEND( humidity, 1, MPI_LOGICAL, target_id, 19, comm_inter, & |
---|
466 | ierr ) |
---|
467 | ELSEIF ( coupling_mode == 'ocean_to_atmosphere' .AND. myid == 0) THEN |
---|
468 | CALL MPI_RECV( humidity_remote, 1, MPI_LOGICAL, target_id, 19, & |
---|
469 | comm_inter, status, ierr ) |
---|
470 | ENDIF |
---|
471 | CALL MPI_BCAST( humidity_remote, 1, MPI_LOGICAL, 0, comm2d, ierr) |
---|
472 | |
---|
473 | #endif |
---|
474 | |
---|
475 | |
---|
476 | ! |
---|
477 | !-- Generate the file header which is used as a header for most of PALM's |
---|
478 | !-- output files |
---|
479 | CALL DATE_AND_TIME( date, time ) |
---|
480 | run_date = date(7:8)//'-'//date(5:6)//'-'//date(3:4) |
---|
481 | run_time = time(1:2)//':'//time(3:4)//':'//time(5:6) |
---|
482 | IF ( coupling_mode == 'uncoupled' ) THEN |
---|
483 | coupling_string = '' |
---|
484 | ELSEIF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
485 | coupling_string = ' coupled (atmosphere)' |
---|
486 | ELSEIF ( coupling_mode == 'ocean_to_atmosphere' ) THEN |
---|
487 | coupling_string = ' coupled (ocean)' |
---|
488 | ENDIF |
---|
489 | |
---|
490 | WRITE ( run_description_header, & |
---|
491 | '(A,2X,A,2X,A,A,A,I2.2,A,2X,A,A,2X,A,1X,A)' ) & |
---|
492 | TRIM( version ), TRIM( revision ), 'run: ', & |
---|
493 | TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ), & |
---|
494 | 'host: ', TRIM( host ), run_date, run_time |
---|
495 | |
---|
496 | ! |
---|
497 | !-- Check the general loop optimization method |
---|
498 | IF ( loop_optimization == 'default' ) THEN |
---|
499 | IF ( host(1:3) == 'nec' ) THEN |
---|
500 | loop_optimization = 'vector' |
---|
501 | ELSE |
---|
502 | loop_optimization = 'cache' |
---|
503 | ENDIF |
---|
504 | ENDIF |
---|
505 | |
---|
506 | SELECT CASE ( TRIM( loop_optimization ) ) |
---|
507 | |
---|
508 | CASE ( 'acc', 'cache', 'vector' ) |
---|
509 | CONTINUE |
---|
510 | |
---|
511 | CASE DEFAULT |
---|
512 | message_string = 'illegal value given for loop_optimization: "' // & |
---|
513 | TRIM( loop_optimization ) // '"' |
---|
514 | CALL message( 'check_parameters', 'PA0013', 1, 2, 0, 6, 0 ) |
---|
515 | |
---|
516 | END SELECT |
---|
517 | |
---|
518 | ! |
---|
519 | !-- Check if vertical grid stretching is used together with particles |
---|
520 | IF ( dz_stretch_level < 100000.0_wp .AND. particle_advection ) THEN |
---|
521 | message_string = 'Vertical grid stretching is not allowed together ' // & |
---|
522 | 'with particle advection.' |
---|
523 | CALL message( 'check_parameters', 'PA0017', 1, 2, 0, 6, 0 ) |
---|
524 | ENDIF |
---|
525 | |
---|
526 | ! |
---|
527 | !-- |
---|
528 | IF ( use_particle_tails ) THEN |
---|
529 | message_string = 'Particle tails are currently not available due ' // & |
---|
530 | 'to the new particle structure.' |
---|
531 | CALL message( 'check_parameters', 'PA0392', 1, 2, 0, 6, 0 ) |
---|
532 | ENDIF |
---|
533 | |
---|
534 | ! |
---|
535 | !-- Check topography setting (check for illegal parameter combinations) |
---|
536 | IF ( topography /= 'flat' ) THEN |
---|
537 | action = ' ' |
---|
538 | IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme') THEN |
---|
539 | WRITE( action, '(A,A)' ) 'scalar_advec = ', scalar_advec |
---|
540 | ENDIF |
---|
541 | IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) & |
---|
542 | THEN |
---|
543 | WRITE( action, '(A,A)' ) 'momentum_advec = ', momentum_advec |
---|
544 | ENDIF |
---|
545 | IF ( psolver == 'sor' ) THEN |
---|
546 | WRITE( action, '(A,A)' ) 'psolver = ', psolver |
---|
547 | ENDIF |
---|
548 | IF ( sloping_surface ) THEN |
---|
549 | WRITE( action, '(A)' ) 'sloping surface = .TRUE.' |
---|
550 | ENDIF |
---|
551 | IF ( galilei_transformation ) THEN |
---|
552 | WRITE( action, '(A)' ) 'galilei_transformation = .TRUE.' |
---|
553 | ENDIF |
---|
554 | IF ( cloud_physics ) THEN |
---|
555 | WRITE( action, '(A)' ) 'cloud_physics = .TRUE.' |
---|
556 | ENDIF |
---|
557 | IF ( cloud_droplets ) THEN |
---|
558 | WRITE( action, '(A)' ) 'cloud_droplets = .TRUE.' |
---|
559 | ENDIF |
---|
560 | IF ( .NOT. prandtl_layer ) THEN |
---|
561 | WRITE( action, '(A)' ) 'prandtl_layer = .FALSE.' |
---|
562 | ENDIF |
---|
563 | IF ( action /= ' ' ) THEN |
---|
564 | message_string = 'a non-flat topography does not allow ' // & |
---|
565 | TRIM( action ) |
---|
566 | CALL message( 'check_parameters', 'PA0014', 1, 2, 0, 6, 0 ) |
---|
567 | ENDIF |
---|
568 | ! |
---|
569 | !-- In case of non-flat topography, check whether the convention how to |
---|
570 | !-- define the topography grid has been set correctly, or whether the default |
---|
571 | !-- is applicable. If this is not possible, abort. |
---|
572 | IF ( TRIM( topography_grid_convention ) == ' ' ) THEN |
---|
573 | IF ( TRIM( topography ) /= 'single_building' .AND. & |
---|
574 | TRIM( topography ) /= 'single_street_canyon' .AND. & |
---|
575 | TRIM( topography ) /= 'read_from_file' ) THEN |
---|
576 | !-- The default value is not applicable here, because it is only valid |
---|
577 | !-- for the two standard cases 'single_building' and 'read_from_file' |
---|
578 | !-- defined in init_grid. |
---|
579 | WRITE( message_string, * ) & |
---|
580 | 'The value for "topography_grid_convention" ', & |
---|
581 | 'is not set. Its default value is & only valid for ', & |
---|
582 | '"topography" = ''single_building'', ', & |
---|
583 | '''single_street_canyon'' & or ''read_from_file''.', & |
---|
584 | ' & Choose ''cell_edge'' or ''cell_center''.' |
---|
585 | CALL message( 'user_check_parameters', 'PA0239', 1, 2, 0, 6, 0 ) |
---|
586 | ELSE |
---|
587 | !-- The default value is applicable here. |
---|
588 | !-- Set convention according to topography. |
---|
589 | IF ( TRIM( topography ) == 'single_building' .OR. & |
---|
590 | TRIM( topography ) == 'single_street_canyon' ) THEN |
---|
591 | topography_grid_convention = 'cell_edge' |
---|
592 | ELSEIF ( TRIM( topography ) == 'read_from_file' ) THEN |
---|
593 | topography_grid_convention = 'cell_center' |
---|
594 | ENDIF |
---|
595 | ENDIF |
---|
596 | ELSEIF ( TRIM( topography_grid_convention ) /= 'cell_edge' .AND. & |
---|
597 | TRIM( topography_grid_convention ) /= 'cell_center' ) THEN |
---|
598 | WRITE( message_string, * ) & |
---|
599 | 'The value for "topography_grid_convention" is ', & |
---|
600 | 'not recognized. & Choose ''cell_edge'' or ''cell_center''.' |
---|
601 | CALL message( 'user_check_parameters', 'PA0240', 1, 2, 0, 6, 0 ) |
---|
602 | ENDIF |
---|
603 | |
---|
604 | ENDIF |
---|
605 | |
---|
606 | ! |
---|
607 | !-- Check ocean setting |
---|
608 | IF ( ocean ) THEN |
---|
609 | |
---|
610 | action = ' ' |
---|
611 | IF ( action /= ' ' ) THEN |
---|
612 | message_string = 'ocean = .T. does not allow ' // TRIM( action ) |
---|
613 | CALL message( 'check_parameters', 'PA0015', 1, 2, 0, 6, 0 ) |
---|
614 | ENDIF |
---|
615 | |
---|
616 | ELSEIF ( TRIM( coupling_mode ) == 'uncoupled' .AND. & |
---|
617 | TRIM( coupling_char ) == '_O' ) THEN |
---|
618 | |
---|
619 | ! |
---|
620 | !-- Check whether an (uncoupled) atmospheric run has been declared as an |
---|
621 | !-- ocean run (this setting is done via mrun-option -y) |
---|
622 | |
---|
623 | message_string = 'ocean = .F. does not allow coupling_char = "' // & |
---|
624 | TRIM( coupling_char ) // '" set by mrun-option "-y"' |
---|
625 | CALL message( 'check_parameters', 'PA0317', 1, 2, 0, 6, 0 ) |
---|
626 | |
---|
627 | ENDIF |
---|
628 | ! |
---|
629 | !-- Check cloud scheme |
---|
630 | IF ( cloud_scheme == 'seifert_beheng' ) THEN |
---|
631 | icloud_scheme = 0 |
---|
632 | ELSEIF ( cloud_scheme == 'kessler' ) THEN |
---|
633 | icloud_scheme = 1 |
---|
634 | ELSE |
---|
635 | message_string = 'unknown cloud microphysics scheme cloud_scheme ="' // & |
---|
636 | TRIM( cloud_scheme ) // '"' |
---|
637 | CALL message( 'check_parameters', 'PA0357', 1, 2, 0, 6, 0 ) |
---|
638 | ENDIF |
---|
639 | ! |
---|
640 | !-- Check whether there are any illegal values |
---|
641 | !-- Pressure solver: |
---|
642 | IF ( psolver /= 'poisfft' .AND. & |
---|
643 | psolver /= 'sor' .AND. psolver /= 'multigrid' ) THEN |
---|
644 | message_string = 'unknown solver for perturbation pressure: psolver' // & |
---|
645 | ' = "' // TRIM( psolver ) // '"' |
---|
646 | CALL message( 'check_parameters', 'PA0016', 1, 2, 0, 6, 0 ) |
---|
647 | ENDIF |
---|
648 | |
---|
649 | IF ( psolver == 'multigrid' ) THEN |
---|
650 | IF ( cycle_mg == 'w' ) THEN |
---|
651 | gamma_mg = 2 |
---|
652 | ELSEIF ( cycle_mg == 'v' ) THEN |
---|
653 | gamma_mg = 1 |
---|
654 | ELSE |
---|
655 | message_string = 'unknown multigrid cycle: cycle_mg = "' // & |
---|
656 | TRIM( cycle_mg ) // '"' |
---|
657 | CALL message( 'check_parameters', 'PA0020', 1, 2, 0, 6, 0 ) |
---|
658 | ENDIF |
---|
659 | ENDIF |
---|
660 | |
---|
661 | IF ( fft_method /= 'singleton-algorithm' .AND. & |
---|
662 | fft_method /= 'temperton-algorithm' .AND. & |
---|
663 | fft_method /= 'fftw' .AND. & |
---|
664 | fft_method /= 'system-specific' ) THEN |
---|
665 | message_string = 'unknown fft-algorithm: fft_method = "' // & |
---|
666 | TRIM( fft_method ) // '"' |
---|
667 | CALL message( 'check_parameters', 'PA0021', 1, 2, 0, 6, 0 ) |
---|
668 | ENDIF |
---|
669 | |
---|
670 | IF( momentum_advec == 'ws-scheme' .AND. & |
---|
671 | .NOT. call_psolver_at_all_substeps ) THEN |
---|
672 | message_string = 'psolver must be called at each RK3 substep when "'//& |
---|
673 | TRIM(momentum_advec) // ' "is used for momentum_advec' |
---|
674 | CALL message( 'check_parameters', 'PA0344', 1, 2, 0, 6, 0 ) |
---|
675 | END IF |
---|
676 | ! |
---|
677 | !-- Advection schemes: |
---|
678 | IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) & |
---|
679 | THEN |
---|
680 | message_string = 'unknown advection scheme: momentum_advec = "' // & |
---|
681 | TRIM( momentum_advec ) // '"' |
---|
682 | CALL message( 'check_parameters', 'PA0022', 1, 2, 0, 6, 0 ) |
---|
683 | ENDIF |
---|
684 | IF ( ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & |
---|
685 | .AND. ( timestep_scheme == 'euler' .OR. & |
---|
686 | timestep_scheme == 'runge-kutta-2' ) ) & |
---|
687 | THEN |
---|
688 | message_string = 'momentum_advec or scalar_advec = "' & |
---|
689 | // TRIM( momentum_advec ) // '" is not allowed with timestep_scheme = "' // & |
---|
690 | TRIM( timestep_scheme ) // '"' |
---|
691 | CALL message( 'check_parameters', 'PA0023', 1, 2, 0, 6, 0 ) |
---|
692 | ENDIF |
---|
693 | IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' .AND. & |
---|
694 | scalar_advec /= 'bc-scheme' ) & |
---|
695 | THEN |
---|
696 | message_string = 'unknown advection scheme: scalar_advec = "' // & |
---|
697 | TRIM( scalar_advec ) // '"' |
---|
698 | CALL message( 'check_parameters', 'PA0024', 1, 2, 0, 6, 0 ) |
---|
699 | ENDIF |
---|
700 | IF ( scalar_advec == 'bc-scheme' .AND. loop_optimization == 'cache' ) & |
---|
701 | THEN |
---|
702 | message_string = 'advection_scheme scalar_advec = "' & |
---|
703 | // TRIM( scalar_advec ) // '" not implemented for & loop_optimization = "' // & |
---|
704 | TRIM( loop_optimization ) // '"' |
---|
705 | CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 ) |
---|
706 | ENDIF |
---|
707 | |
---|
708 | IF ( use_sgs_for_particles .AND. .NOT. use_upstream_for_tke .AND. & |
---|
709 | scalar_advec /= 'ws-scheme' ) THEN |
---|
710 | use_upstream_for_tke = .TRUE. |
---|
711 | message_string = 'use_upstream_for_tke set .TRUE. because ' // & |
---|
712 | 'use_sgs_for_particles = .TRUE. ' // & |
---|
713 | 'and scalar_advec /= ws-scheme' |
---|
714 | CALL message( 'check_parameters', 'PA0025', 0, 1, 0, 6, 0 ) |
---|
715 | ENDIF |
---|
716 | |
---|
717 | IF ( use_sgs_for_particles .AND. curvature_solution_effects ) THEN |
---|
718 | message_string = 'use_sgs_for_particles = .TRUE. not allowed with ' // & |
---|
719 | 'curvature_solution_effects = .TRUE.' |
---|
720 | CALL message( 'check_parameters', 'PA0349', 1, 2, 0, 6, 0 ) |
---|
721 | ENDIF |
---|
722 | |
---|
723 | ! |
---|
724 | !-- Set LOGICAL switches to enhance performance |
---|
725 | IF ( momentum_advec == 'ws-scheme' ) ws_scheme_mom = .TRUE. |
---|
726 | IF ( scalar_advec == 'ws-scheme' ) ws_scheme_sca = .TRUE. |
---|
727 | |
---|
728 | ! |
---|
729 | !-- Timestep schemes: |
---|
730 | SELECT CASE ( TRIM( timestep_scheme ) ) |
---|
731 | |
---|
732 | CASE ( 'euler' ) |
---|
733 | intermediate_timestep_count_max = 1 |
---|
734 | |
---|
735 | CASE ( 'runge-kutta-2' ) |
---|
736 | intermediate_timestep_count_max = 2 |
---|
737 | |
---|
738 | CASE ( 'runge-kutta-3' ) |
---|
739 | intermediate_timestep_count_max = 3 |
---|
740 | |
---|
741 | CASE DEFAULT |
---|
742 | message_string = 'unknown timestep scheme: timestep_scheme = "' // & |
---|
743 | TRIM( timestep_scheme ) // '"' |
---|
744 | CALL message( 'check_parameters', 'PA0027', 1, 2, 0, 6, 0 ) |
---|
745 | |
---|
746 | END SELECT |
---|
747 | |
---|
748 | IF ( (momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme') & |
---|
749 | .AND. timestep_scheme(1:5) == 'runge' ) THEN |
---|
750 | message_string = 'momentum advection scheme "' // & |
---|
751 | TRIM( momentum_advec ) // '" & does not work with ' // & |
---|
752 | 'timestep_scheme "' // TRIM( timestep_scheme ) // '"' |
---|
753 | CALL message( 'check_parameters', 'PA0029', 1, 2, 0, 6, 0 ) |
---|
754 | ENDIF |
---|
755 | |
---|
756 | ! |
---|
757 | !-- Collision kernels: |
---|
758 | SELECT CASE ( TRIM( collision_kernel ) ) |
---|
759 | |
---|
760 | CASE ( 'hall', 'hall_fast' ) |
---|
761 | hall_kernel = .TRUE. |
---|
762 | |
---|
763 | CASE ( 'palm' ) |
---|
764 | palm_kernel = .TRUE. |
---|
765 | |
---|
766 | CASE ( 'wang', 'wang_fast' ) |
---|
767 | wang_kernel = .TRUE. |
---|
768 | |
---|
769 | CASE ( 'none' ) |
---|
770 | |
---|
771 | |
---|
772 | CASE DEFAULT |
---|
773 | message_string = 'unknown collision kernel: collision_kernel = "' // & |
---|
774 | TRIM( collision_kernel ) // '"' |
---|
775 | CALL message( 'check_parameters', 'PA0350', 1, 2, 0, 6, 0 ) |
---|
776 | |
---|
777 | END SELECT |
---|
778 | IF ( collision_kernel(6:9) == 'fast' ) use_kernel_tables = .TRUE. |
---|
779 | |
---|
780 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & |
---|
781 | TRIM( initializing_actions ) /= 'cyclic_fill' ) THEN |
---|
782 | ! |
---|
783 | !-- No restart run: several initialising actions are possible |
---|
784 | action = initializing_actions |
---|
785 | DO WHILE ( TRIM( action ) /= '' ) |
---|
786 | position = INDEX( action, ' ' ) |
---|
787 | SELECT CASE ( action(1:position-1) ) |
---|
788 | |
---|
789 | CASE ( 'set_constant_profiles', 'set_1d-model_profiles', & |
---|
790 | 'by_user', 'initialize_vortex', 'initialize_ptanom' ) |
---|
791 | action = action(position+1:) |
---|
792 | |
---|
793 | CASE DEFAULT |
---|
794 | message_string = 'initializing_action = "' // & |
---|
795 | TRIM( action ) // '" unkown or not allowed' |
---|
796 | CALL message( 'check_parameters', 'PA0030', 1, 2, 0, 6, 0 ) |
---|
797 | |
---|
798 | END SELECT |
---|
799 | ENDDO |
---|
800 | ENDIF |
---|
801 | |
---|
802 | IF ( TRIM( initializing_actions ) == 'initialize_vortex' .AND. & |
---|
803 | conserve_volume_flow ) THEN |
---|
804 | message_string = 'initializing_actions = "initialize_vortex"' // & |
---|
805 | ' ist not allowed with conserve_volume_flow = .T.' |
---|
806 | CALL message( 'check_parameters', 'PA0343', 1, 2, 0, 6, 0 ) |
---|
807 | ENDIF |
---|
808 | |
---|
809 | |
---|
810 | IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & |
---|
811 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
812 | message_string = 'initializing_actions = "set_constant_profiles"' // & |
---|
813 | ' and "set_1d-model_profiles" are not allowed ' // & |
---|
814 | 'simultaneously' |
---|
815 | CALL message( 'check_parameters', 'PA0031', 1, 2, 0, 6, 0 ) |
---|
816 | ENDIF |
---|
817 | |
---|
818 | IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & |
---|
819 | INDEX( initializing_actions, 'by_user' ) /= 0 ) THEN |
---|
820 | message_string = 'initializing_actions = "set_constant_profiles"' // & |
---|
821 | ' and "by_user" are not allowed simultaneously' |
---|
822 | CALL message( 'check_parameters', 'PA0032', 1, 2, 0, 6, 0 ) |
---|
823 | ENDIF |
---|
824 | |
---|
825 | IF ( INDEX( initializing_actions, 'by_user' ) /= 0 .AND. & |
---|
826 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
827 | message_string = 'initializing_actions = "by_user" and ' // & |
---|
828 | '"set_1d-model_profiles" are not allowed simultaneously' |
---|
829 | CALL message( 'check_parameters', 'PA0033', 1, 2, 0, 6, 0 ) |
---|
830 | ENDIF |
---|
831 | |
---|
832 | IF ( cloud_physics .AND. .NOT. humidity ) THEN |
---|
833 | WRITE( message_string, * ) 'cloud_physics = ', cloud_physics, ' is ', & |
---|
834 | 'not allowed with humidity = ', humidity |
---|
835 | CALL message( 'check_parameters', 'PA0034', 1, 2, 0, 6, 0 ) |
---|
836 | ENDIF |
---|
837 | |
---|
838 | IF ( precipitation .AND. .NOT. cloud_physics ) THEN |
---|
839 | WRITE( message_string, * ) 'precipitation = ', precipitation, ' is ', & |
---|
840 | 'not allowed with cloud_physics = ', cloud_physics |
---|
841 | CALL message( 'check_parameters', 'PA0035', 1, 2, 0, 6, 0 ) |
---|
842 | ENDIF |
---|
843 | |
---|
844 | IF ( humidity .AND. sloping_surface ) THEN |
---|
845 | message_string = 'humidity = .TRUE. and sloping_surface = .TRUE. ' // & |
---|
846 | 'are not allowed simultaneously' |
---|
847 | CALL message( 'check_parameters', 'PA0036', 1, 2, 0, 6, 0 ) |
---|
848 | ENDIF |
---|
849 | |
---|
850 | IF ( passive_scalar .AND. humidity ) THEN |
---|
851 | message_string = 'humidity = .TRUE. and passive_scalar = .TRUE. ' // & |
---|
852 | 'is not allowed simultaneously' |
---|
853 | CALL message( 'check_parameters', 'PA0038', 1, 2, 0, 6, 0 ) |
---|
854 | ENDIF |
---|
855 | |
---|
856 | IF ( plant_canopy .AND. ( drag_coefficient == 0.0_wp ) ) THEN |
---|
857 | message_string = 'plant_canopy = .TRUE. requires a non-zero drag ' // & |
---|
858 | 'coefficient & given value is drag_coefficient = 0.0' |
---|
859 | CALL message( 'check_parameters', 'PA0041', 1, 2, 0, 6, 0 ) |
---|
860 | ENDIF |
---|
861 | |
---|
862 | IF ( plant_canopy .AND. cloud_physics .AND. icloud_scheme == 0 ) THEN |
---|
863 | message_string = 'plant_canopy = .TRUE. requires cloud_scheme /=' // & |
---|
864 | ' seifert_beheng' |
---|
865 | CALL message( 'check_parameters', 'PA0360', 1, 2, 0, 6, 0 ) |
---|
866 | ENDIF |
---|
867 | |
---|
868 | IF ( .NOT. ( loop_optimization == 'cache' .OR. & |
---|
869 | loop_optimization == 'vector' ) & |
---|
870 | .AND. cloud_physics .AND. icloud_scheme == 0 ) THEN |
---|
871 | message_string = 'cloud_scheme = seifert_beheng requires ' // & |
---|
872 | 'loop_optimization = "cache" or "vector"' |
---|
873 | CALL message( 'check_parameters', 'PA0362', 1, 2, 0, 6, 0 ) |
---|
874 | ENDIF |
---|
875 | |
---|
876 | ! |
---|
877 | !-- In case of no model continuation run, check initialising parameters and |
---|
878 | !-- deduce further quantities |
---|
879 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN |
---|
880 | |
---|
881 | ! |
---|
882 | !-- Initial profiles for 1D and 3D model, respectively (u,v further below) |
---|
883 | pt_init = pt_surface |
---|
884 | IF ( humidity ) THEN |
---|
885 | q_init = q_surface |
---|
886 | ENDIF |
---|
887 | IF ( ocean ) sa_init = sa_surface |
---|
888 | IF ( passive_scalar ) q_init = s_surface |
---|
889 | IF ( plant_canopy ) lad = 0.0_wp |
---|
890 | |
---|
891 | ! |
---|
892 | !-- |
---|
893 | !-- If required, compute initial profile of the geostrophic wind |
---|
894 | !-- (component ug) |
---|
895 | i = 1 |
---|
896 | gradient = 0.0_wp |
---|
897 | |
---|
898 | IF ( .NOT. ocean ) THEN |
---|
899 | |
---|
900 | ug_vertical_gradient_level_ind(1) = 0 |
---|
901 | ug(0) = ug_surface |
---|
902 | DO k = 1, nzt+1 |
---|
903 | IF ( i < 11 ) THEN |
---|
904 | IF ( ug_vertical_gradient_level(i) < zu(k) .AND. & |
---|
905 | ug_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
906 | gradient = ug_vertical_gradient(i) / 100.0_wp |
---|
907 | ug_vertical_gradient_level_ind(i) = k - 1 |
---|
908 | i = i + 1 |
---|
909 | ENDIF |
---|
910 | ENDIF |
---|
911 | IF ( gradient /= 0.0_wp ) THEN |
---|
912 | IF ( k /= 1 ) THEN |
---|
913 | ug(k) = ug(k-1) + dzu(k) * gradient |
---|
914 | ELSE |
---|
915 | ug(k) = ug_surface + dzu(k) * gradient |
---|
916 | ENDIF |
---|
917 | ELSE |
---|
918 | ug(k) = ug(k-1) |
---|
919 | ENDIF |
---|
920 | ENDDO |
---|
921 | |
---|
922 | ELSE |
---|
923 | |
---|
924 | ug_vertical_gradient_level_ind(1) = nzt+1 |
---|
925 | ug(nzt+1) = ug_surface |
---|
926 | DO k = nzt, nzb, -1 |
---|
927 | IF ( i < 11 ) THEN |
---|
928 | IF ( ug_vertical_gradient_level(i) > zu(k) .AND. & |
---|
929 | ug_vertical_gradient_level(i) <= 0.0_wp ) THEN |
---|
930 | gradient = ug_vertical_gradient(i) / 100.0_wp |
---|
931 | ug_vertical_gradient_level_ind(i) = k + 1 |
---|
932 | i = i + 1 |
---|
933 | ENDIF |
---|
934 | ENDIF |
---|
935 | IF ( gradient /= 0.0_wp ) THEN |
---|
936 | IF ( k /= nzt ) THEN |
---|
937 | ug(k) = ug(k+1) - dzu(k+1) * gradient |
---|
938 | ELSE |
---|
939 | ug(k) = ug_surface - 0.5_wp * dzu(k+1) * gradient |
---|
940 | ug(k+1) = ug_surface + 0.5_wp * dzu(k+1) * gradient |
---|
941 | ENDIF |
---|
942 | ELSE |
---|
943 | ug(k) = ug(k+1) |
---|
944 | ENDIF |
---|
945 | ENDDO |
---|
946 | |
---|
947 | ENDIF |
---|
948 | |
---|
949 | ! |
---|
950 | !-- In case of no given gradients for ug, choose a zero gradient |
---|
951 | IF ( ug_vertical_gradient_level(1) == -9999999.9_wp ) THEN |
---|
952 | ug_vertical_gradient_level(1) = 0.0_wp |
---|
953 | ENDIF |
---|
954 | |
---|
955 | ! |
---|
956 | !-- |
---|
957 | !-- If required, compute initial profile of the geostrophic wind |
---|
958 | !-- (component vg) |
---|
959 | i = 1 |
---|
960 | gradient = 0.0_wp |
---|
961 | |
---|
962 | IF ( .NOT. ocean ) THEN |
---|
963 | |
---|
964 | vg_vertical_gradient_level_ind(1) = 0 |
---|
965 | vg(0) = vg_surface |
---|
966 | DO k = 1, nzt+1 |
---|
967 | IF ( i < 11 ) THEN |
---|
968 | IF ( vg_vertical_gradient_level(i) < zu(k) .AND. & |
---|
969 | vg_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
970 | gradient = vg_vertical_gradient(i) / 100.0_wp |
---|
971 | vg_vertical_gradient_level_ind(i) = k - 1 |
---|
972 | i = i + 1 |
---|
973 | ENDIF |
---|
974 | ENDIF |
---|
975 | IF ( gradient /= 0.0_wp ) THEN |
---|
976 | IF ( k /= 1 ) THEN |
---|
977 | vg(k) = vg(k-1) + dzu(k) * gradient |
---|
978 | ELSE |
---|
979 | vg(k) = vg_surface + dzu(k) * gradient |
---|
980 | ENDIF |
---|
981 | ELSE |
---|
982 | vg(k) = vg(k-1) |
---|
983 | ENDIF |
---|
984 | ENDDO |
---|
985 | |
---|
986 | ELSE |
---|
987 | |
---|
988 | vg_vertical_gradient_level_ind(1) = nzt+1 |
---|
989 | vg(nzt+1) = vg_surface |
---|
990 | DO k = nzt, nzb, -1 |
---|
991 | IF ( i < 11 ) THEN |
---|
992 | IF ( vg_vertical_gradient_level(i) > zu(k) .AND. & |
---|
993 | vg_vertical_gradient_level(i) <= 0.0_wp ) THEN |
---|
994 | gradient = vg_vertical_gradient(i) / 100.0_wp |
---|
995 | vg_vertical_gradient_level_ind(i) = k + 1 |
---|
996 | i = i + 1 |
---|
997 | ENDIF |
---|
998 | ENDIF |
---|
999 | IF ( gradient /= 0.0_wp ) THEN |
---|
1000 | IF ( k /= nzt ) THEN |
---|
1001 | vg(k) = vg(k+1) - dzu(k+1) * gradient |
---|
1002 | ELSE |
---|
1003 | vg(k) = vg_surface - 0.5_wp * dzu(k+1) * gradient |
---|
1004 | vg(k+1) = vg_surface + 0.5_wp * dzu(k+1) * gradient |
---|
1005 | ENDIF |
---|
1006 | ELSE |
---|
1007 | vg(k) = vg(k+1) |
---|
1008 | ENDIF |
---|
1009 | ENDDO |
---|
1010 | |
---|
1011 | ENDIF |
---|
1012 | |
---|
1013 | ! |
---|
1014 | !-- In case of no given gradients for vg, choose a zero gradient |
---|
1015 | IF ( vg_vertical_gradient_level(1) == -9999999.9_wp ) THEN |
---|
1016 | vg_vertical_gradient_level(1) = 0.0_wp |
---|
1017 | ENDIF |
---|
1018 | |
---|
1019 | ! |
---|
1020 | !-- Let the initial wind profiles be the calculated ug/vg profiles or |
---|
1021 | !-- interpolate them from wind profile data (if given) |
---|
1022 | IF ( u_profile(1) == 9999999.9_wp .AND. v_profile(1) == 9999999.9_wp ) THEN |
---|
1023 | |
---|
1024 | u_init = ug |
---|
1025 | v_init = vg |
---|
1026 | |
---|
1027 | ELSEIF ( u_profile(1) == 0.0_wp .AND. v_profile(1) == 0.0_wp ) THEN |
---|
1028 | |
---|
1029 | IF ( uv_heights(1) /= 0.0_wp ) THEN |
---|
1030 | message_string = 'uv_heights(1) must be 0.0' |
---|
1031 | CALL message( 'check_parameters', 'PA0345', 1, 2, 0, 6, 0 ) |
---|
1032 | ENDIF |
---|
1033 | |
---|
1034 | use_prescribed_profile_data = .TRUE. |
---|
1035 | |
---|
1036 | kk = 1 |
---|
1037 | u_init(0) = 0.0_wp |
---|
1038 | v_init(0) = 0.0_wp |
---|
1039 | |
---|
1040 | DO k = 1, nz+1 |
---|
1041 | |
---|
1042 | IF ( kk < 100 ) THEN |
---|
1043 | DO WHILE ( uv_heights(kk+1) <= zu(k) ) |
---|
1044 | kk = kk + 1 |
---|
1045 | IF ( kk == 100 ) EXIT |
---|
1046 | ENDDO |
---|
1047 | ENDIF |
---|
1048 | |
---|
1049 | IF ( kk < 100 .AND. uv_heights(kk+1) /= 9999999.9_wp ) THEN |
---|
1050 | u_init(k) = u_profile(kk) + ( zu(k) - uv_heights(kk) ) / & |
---|
1051 | ( uv_heights(kk+1) - uv_heights(kk) ) * & |
---|
1052 | ( u_profile(kk+1) - u_profile(kk) ) |
---|
1053 | v_init(k) = v_profile(kk) + ( zu(k) - uv_heights(kk) ) / & |
---|
1054 | ( uv_heights(kk+1) - uv_heights(kk) ) * & |
---|
1055 | ( v_profile(kk+1) - v_profile(kk) ) |
---|
1056 | ELSE |
---|
1057 | u_init(k) = u_profile(kk) |
---|
1058 | v_init(k) = v_profile(kk) |
---|
1059 | ENDIF |
---|
1060 | |
---|
1061 | ENDDO |
---|
1062 | |
---|
1063 | ELSE |
---|
1064 | |
---|
1065 | message_string = 'u_profile(1) and v_profile(1) must be 0.0' |
---|
1066 | CALL message( 'check_parameters', 'PA0346', 1, 2, 0, 6, 0 ) |
---|
1067 | |
---|
1068 | ENDIF |
---|
1069 | |
---|
1070 | ! |
---|
1071 | !-- Compute initial temperature profile using the given temperature gradients |
---|
1072 | IF ( .NOT. neutral ) THEN |
---|
1073 | |
---|
1074 | i = 1 |
---|
1075 | gradient = 0.0_wp |
---|
1076 | |
---|
1077 | IF ( .NOT. ocean ) THEN |
---|
1078 | |
---|
1079 | pt_vertical_gradient_level_ind(1) = 0 |
---|
1080 | DO k = 1, nzt+1 |
---|
1081 | IF ( i < 11 ) THEN |
---|
1082 | IF ( pt_vertical_gradient_level(i) < zu(k) .AND. & |
---|
1083 | pt_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
1084 | gradient = pt_vertical_gradient(i) / 100.0_wp |
---|
1085 | pt_vertical_gradient_level_ind(i) = k - 1 |
---|
1086 | i = i + 1 |
---|
1087 | ENDIF |
---|
1088 | ENDIF |
---|
1089 | IF ( gradient /= 0.0_wp ) THEN |
---|
1090 | IF ( k /= 1 ) THEN |
---|
1091 | pt_init(k) = pt_init(k-1) + dzu(k) * gradient |
---|
1092 | ELSE |
---|
1093 | pt_init(k) = pt_surface + dzu(k) * gradient |
---|
1094 | ENDIF |
---|
1095 | ELSE |
---|
1096 | pt_init(k) = pt_init(k-1) |
---|
1097 | ENDIF |
---|
1098 | ENDDO |
---|
1099 | |
---|
1100 | ELSE |
---|
1101 | |
---|
1102 | pt_vertical_gradient_level_ind(1) = nzt+1 |
---|
1103 | DO k = nzt, 0, -1 |
---|
1104 | IF ( i < 11 ) THEN |
---|
1105 | IF ( pt_vertical_gradient_level(i) > zu(k) .AND. & |
---|
1106 | pt_vertical_gradient_level(i) <= 0.0_wp ) THEN |
---|
1107 | gradient = pt_vertical_gradient(i) / 100.0_wp |
---|
1108 | pt_vertical_gradient_level_ind(i) = k + 1 |
---|
1109 | i = i + 1 |
---|
1110 | ENDIF |
---|
1111 | ENDIF |
---|
1112 | IF ( gradient /= 0.0_wp ) THEN |
---|
1113 | IF ( k /= nzt ) THEN |
---|
1114 | pt_init(k) = pt_init(k+1) - dzu(k+1) * gradient |
---|
1115 | ELSE |
---|
1116 | pt_init(k) = pt_surface - 0.5_wp * dzu(k+1) * gradient |
---|
1117 | pt_init(k+1) = pt_surface + 0.5_wp * dzu(k+1) * gradient |
---|
1118 | ENDIF |
---|
1119 | ELSE |
---|
1120 | pt_init(k) = pt_init(k+1) |
---|
1121 | ENDIF |
---|
1122 | ENDDO |
---|
1123 | |
---|
1124 | ENDIF |
---|
1125 | |
---|
1126 | ENDIF |
---|
1127 | |
---|
1128 | ! |
---|
1129 | !-- In case of no given temperature gradients, choose gradient of neutral |
---|
1130 | !-- stratification |
---|
1131 | IF ( pt_vertical_gradient_level(1) == -9999999.9_wp ) THEN |
---|
1132 | pt_vertical_gradient_level(1) = 0.0_wp |
---|
1133 | ENDIF |
---|
1134 | |
---|
1135 | ! |
---|
1136 | !-- Store temperature gradient at the top boundary for possible Neumann |
---|
1137 | !-- boundary condition |
---|
1138 | bc_pt_t_val = ( pt_init(nzt+1) - pt_init(nzt) ) / dzu(nzt+1) |
---|
1139 | |
---|
1140 | ! |
---|
1141 | !-- If required, compute initial humidity or scalar profile using the given |
---|
1142 | !-- humidity/scalar gradient. In case of scalar transport, initially store |
---|
1143 | !-- values of the scalar parameters on humidity parameters |
---|
1144 | IF ( passive_scalar ) THEN |
---|
1145 | bc_q_b = bc_s_b |
---|
1146 | bc_q_t = bc_s_t |
---|
1147 | q_surface = s_surface |
---|
1148 | q_surface_initial_change = s_surface_initial_change |
---|
1149 | q_vertical_gradient = s_vertical_gradient |
---|
1150 | q_vertical_gradient_level = s_vertical_gradient_level |
---|
1151 | surface_waterflux = surface_scalarflux |
---|
1152 | wall_humidityflux = wall_scalarflux |
---|
1153 | ENDIF |
---|
1154 | |
---|
1155 | IF ( humidity .OR. passive_scalar ) THEN |
---|
1156 | |
---|
1157 | i = 1 |
---|
1158 | gradient = 0.0_wp |
---|
1159 | q_vertical_gradient_level_ind(1) = 0 |
---|
1160 | DO k = 1, nzt+1 |
---|
1161 | IF ( i < 11 ) THEN |
---|
1162 | IF ( q_vertical_gradient_level(i) < zu(k) .AND. & |
---|
1163 | q_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
1164 | gradient = q_vertical_gradient(i) / 100.0_wp |
---|
1165 | q_vertical_gradient_level_ind(i) = k - 1 |
---|
1166 | i = i + 1 |
---|
1167 | ENDIF |
---|
1168 | ENDIF |
---|
1169 | IF ( gradient /= 0.0_wp ) THEN |
---|
1170 | IF ( k /= 1 ) THEN |
---|
1171 | q_init(k) = q_init(k-1) + dzu(k) * gradient |
---|
1172 | ELSE |
---|
1173 | q_init(k) = q_init(k-1) + dzu(k) * gradient |
---|
1174 | ENDIF |
---|
1175 | ELSE |
---|
1176 | q_init(k) = q_init(k-1) |
---|
1177 | ENDIF |
---|
1178 | ! |
---|
1179 | !-- Avoid negative humidities |
---|
1180 | IF ( q_init(k) < 0.0_wp ) THEN |
---|
1181 | q_init(k) = 0.0_wp |
---|
1182 | ENDIF |
---|
1183 | ENDDO |
---|
1184 | |
---|
1185 | ! |
---|
1186 | !-- In case of no given humidity gradients, choose zero gradient |
---|
1187 | !-- conditions |
---|
1188 | IF ( q_vertical_gradient_level(1) == -1.0_wp ) THEN |
---|
1189 | q_vertical_gradient_level(1) = 0.0_wp |
---|
1190 | ENDIF |
---|
1191 | ! |
---|
1192 | !-- Store humidity, rain water content and rain drop concentration |
---|
1193 | !-- gradient at the top boundary for possile Neumann boundary condition |
---|
1194 | bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) |
---|
1195 | ENDIF |
---|
1196 | |
---|
1197 | ! |
---|
1198 | !-- If required, compute initial salinity profile using the given salinity |
---|
1199 | !-- gradients |
---|
1200 | IF ( ocean ) THEN |
---|
1201 | |
---|
1202 | i = 1 |
---|
1203 | gradient = 0.0_wp |
---|
1204 | |
---|
1205 | sa_vertical_gradient_level_ind(1) = nzt+1 |
---|
1206 | DO k = nzt, 0, -1 |
---|
1207 | IF ( i < 11 ) THEN |
---|
1208 | IF ( sa_vertical_gradient_level(i) > zu(k) .AND. & |
---|
1209 | sa_vertical_gradient_level(i) <= 0.0_wp ) THEN |
---|
1210 | gradient = sa_vertical_gradient(i) / 100.0_wp |
---|
1211 | sa_vertical_gradient_level_ind(i) = k + 1 |
---|
1212 | i = i + 1 |
---|
1213 | ENDIF |
---|
1214 | ENDIF |
---|
1215 | IF ( gradient /= 0.0_wp ) THEN |
---|
1216 | IF ( k /= nzt ) THEN |
---|
1217 | sa_init(k) = sa_init(k+1) - dzu(k+1) * gradient |
---|
1218 | ELSE |
---|
1219 | sa_init(k) = sa_surface - 0.5_wp * dzu(k+1) * gradient |
---|
1220 | sa_init(k+1) = sa_surface + 0.5_wp * dzu(k+1) * gradient |
---|
1221 | ENDIF |
---|
1222 | ELSE |
---|
1223 | sa_init(k) = sa_init(k+1) |
---|
1224 | ENDIF |
---|
1225 | ENDDO |
---|
1226 | |
---|
1227 | ENDIF |
---|
1228 | |
---|
1229 | ! |
---|
1230 | !-- If required compute the profile of leaf area density used in the plant |
---|
1231 | !-- canopy model |
---|
1232 | IF ( plant_canopy ) THEN |
---|
1233 | |
---|
1234 | i = 1 |
---|
1235 | gradient = 0.0_wp |
---|
1236 | |
---|
1237 | IF ( .NOT. ocean ) THEN |
---|
1238 | |
---|
1239 | lad(0) = lad_surface |
---|
1240 | |
---|
1241 | lad_vertical_gradient_level_ind(1) = 0 |
---|
1242 | DO k = 1, pch_index |
---|
1243 | IF ( i < 11 ) THEN |
---|
1244 | IF ( lad_vertical_gradient_level(i) < zu(k) .AND. & |
---|
1245 | lad_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
1246 | gradient = lad_vertical_gradient(i) |
---|
1247 | lad_vertical_gradient_level_ind(i) = k - 1 |
---|
1248 | i = i + 1 |
---|
1249 | ENDIF |
---|
1250 | ENDIF |
---|
1251 | IF ( gradient /= 0.0_wp ) THEN |
---|
1252 | IF ( k /= 1 ) THEN |
---|
1253 | lad(k) = lad(k-1) + dzu(k) * gradient |
---|
1254 | ELSE |
---|
1255 | lad(k) = lad_surface + dzu(k) *gradient |
---|
1256 | ENDIF |
---|
1257 | ELSE |
---|
1258 | lad(k) = lad(k-1) |
---|
1259 | ENDIF |
---|
1260 | ENDDO |
---|
1261 | |
---|
1262 | ENDIF |
---|
1263 | |
---|
1264 | ! |
---|
1265 | !-- In case of no given leaf area density gradients, choose a vanishing |
---|
1266 | !-- gradient |
---|
1267 | IF ( lad_vertical_gradient_level(1) == -9999999.9_wp ) THEN |
---|
1268 | lad_vertical_gradient_level(1) = 0.0_wp |
---|
1269 | ENDIF |
---|
1270 | |
---|
1271 | ENDIF |
---|
1272 | |
---|
1273 | ENDIF |
---|
1274 | |
---|
1275 | ! |
---|
1276 | !-- Initialize large scale subsidence if required |
---|
1277 | If ( large_scale_subsidence ) THEN |
---|
1278 | IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp .AND. & |
---|
1279 | .NOT. large_scale_forcing ) THEN |
---|
1280 | CALL init_w_subsidence |
---|
1281 | ENDIF |
---|
1282 | ! |
---|
1283 | !-- In case large_scale_forcing is used, profiles for subsidence velocity |
---|
1284 | !-- are read in from file LSF_DATA |
---|
1285 | |
---|
1286 | IF ( subs_vertical_gradient_level(1) == -9999999.9_wp .AND. & |
---|
1287 | .NOT. large_scale_forcing ) THEN |
---|
1288 | message_string = 'There is no default large scale vertical ' // & |
---|
1289 | 'velocity profile set. Specify the subsidence ' // & |
---|
1290 | 'velocity profile via subs_vertical_gradient and ' // & |
---|
1291 | 'subs_vertical_gradient_level.' |
---|
1292 | CALL message( 'check_parameters', 'PA0380', 1, 2, 0, 6, 0 ) |
---|
1293 | ENDIF |
---|
1294 | ELSE |
---|
1295 | IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp ) THEN |
---|
1296 | message_string = 'Enable usage of large scale subsidence by ' // & |
---|
1297 | 'setting large_scale_subsidence = .T..' |
---|
1298 | CALL message( 'check_parameters', 'PA0381', 1, 2, 0, 6, 0 ) |
---|
1299 | ENDIF |
---|
1300 | ENDIF |
---|
1301 | |
---|
1302 | ! |
---|
1303 | !-- Compute Coriolis parameter |
---|
1304 | f = 2.0_wp * omega * SIN( phi / 180.0_wp * pi ) |
---|
1305 | fs = 2.0_wp * omega * COS( phi / 180.0_wp * pi ) |
---|
1306 | |
---|
1307 | ! |
---|
1308 | !-- Check and set buoyancy related parameters and switches |
---|
1309 | IF ( reference_state == 'horizontal_average' ) THEN |
---|
1310 | CONTINUE |
---|
1311 | ELSEIF ( reference_state == 'initial_profile' ) THEN |
---|
1312 | use_initial_profile_as_reference = .TRUE. |
---|
1313 | ELSEIF ( reference_state == 'single_value' ) THEN |
---|
1314 | use_single_reference_value = .TRUE. |
---|
1315 | IF ( pt_reference == 9999999.9_wp ) pt_reference = pt_surface |
---|
1316 | vpt_reference = pt_reference * ( 1.0_wp + 0.61_wp * q_surface ) |
---|
1317 | ELSE |
---|
1318 | message_string = 'illegal value for reference_state: "' // & |
---|
1319 | TRIM( reference_state ) // '"' |
---|
1320 | CALL message( 'check_parameters', 'PA0056', 1, 2, 0, 6, 0 ) |
---|
1321 | ENDIF |
---|
1322 | |
---|
1323 | ! |
---|
1324 | !-- Ocean runs always use reference values in the buoyancy term |
---|
1325 | IF ( ocean ) THEN |
---|
1326 | reference_state = 'single_value' |
---|
1327 | use_single_reference_value = .TRUE. |
---|
1328 | ENDIF |
---|
1329 | |
---|
1330 | ! |
---|
1331 | !-- Sign of buoyancy/stability terms |
---|
1332 | IF ( ocean ) atmos_ocean_sign = -1.0_wp |
---|
1333 | |
---|
1334 | ! |
---|
1335 | !-- Ocean version must use flux boundary conditions at the top |
---|
1336 | IF ( ocean .AND. .NOT. use_top_fluxes ) THEN |
---|
1337 | message_string = 'use_top_fluxes must be .TRUE. in ocean mode' |
---|
1338 | CALL message( 'check_parameters', 'PA0042', 1, 2, 0, 6, 0 ) |
---|
1339 | ENDIF |
---|
1340 | |
---|
1341 | ! |
---|
1342 | !-- In case of a given slope, compute the relevant quantities |
---|
1343 | IF ( alpha_surface /= 0.0_wp ) THEN |
---|
1344 | IF ( ABS( alpha_surface ) > 90.0_wp ) THEN |
---|
1345 | WRITE( message_string, * ) 'ABS( alpha_surface = ', alpha_surface, & |
---|
1346 | ' ) must be < 90.0' |
---|
1347 | CALL message( 'check_parameters', 'PA0043', 1, 2, 0, 6, 0 ) |
---|
1348 | ENDIF |
---|
1349 | sloping_surface = .TRUE. |
---|
1350 | cos_alpha_surface = COS( alpha_surface / 180.0_wp * pi ) |
---|
1351 | sin_alpha_surface = SIN( alpha_surface / 180.0_wp * pi ) |
---|
1352 | ENDIF |
---|
1353 | |
---|
1354 | ! |
---|
1355 | !-- Check time step and cfl_factor |
---|
1356 | IF ( dt /= -1.0_wp ) THEN |
---|
1357 | IF ( dt <= 0.0_wp .AND. dt /= -1.0_wp ) THEN |
---|
1358 | WRITE( message_string, * ) 'dt = ', dt , ' <= 0.0' |
---|
1359 | CALL message( 'check_parameters', 'PA0044', 1, 2, 0, 6, 0 ) |
---|
1360 | ENDIF |
---|
1361 | dt_3d = dt |
---|
1362 | dt_fixed = .TRUE. |
---|
1363 | ENDIF |
---|
1364 | |
---|
1365 | IF ( cfl_factor <= 0.0_wp .OR. cfl_factor > 1.0_wp ) THEN |
---|
1366 | IF ( cfl_factor == -1.0_wp ) THEN |
---|
1367 | IF ( timestep_scheme == 'runge-kutta-2' ) THEN |
---|
1368 | cfl_factor = 0.8_wp |
---|
1369 | ELSEIF ( timestep_scheme == 'runge-kutta-3' ) THEN |
---|
1370 | cfl_factor = 0.9_wp |
---|
1371 | ELSE |
---|
1372 | cfl_factor = 0.9_wp |
---|
1373 | ENDIF |
---|
1374 | ELSE |
---|
1375 | WRITE( message_string, * ) 'cfl_factor = ', cfl_factor, & |
---|
1376 | ' out of range & 0.0 < cfl_factor <= 1.0 is required' |
---|
1377 | CALL message( 'check_parameters', 'PA0045', 1, 2, 0, 6, 0 ) |
---|
1378 | ENDIF |
---|
1379 | ENDIF |
---|
1380 | |
---|
1381 | ! |
---|
1382 | !-- Store simulated time at begin |
---|
1383 | simulated_time_at_begin = simulated_time |
---|
1384 | |
---|
1385 | ! |
---|
1386 | !-- Store reference time for coupled runs and change the coupling flag, |
---|
1387 | !-- if ... |
---|
1388 | IF ( simulated_time == 0.0_wp ) THEN |
---|
1389 | IF ( coupling_start_time == 0.0_wp ) THEN |
---|
1390 | time_since_reference_point = 0.0_wp |
---|
1391 | ELSEIF ( time_since_reference_point < 0.0_wp ) THEN |
---|
1392 | run_coupled = .FALSE. |
---|
1393 | ENDIF |
---|
1394 | ENDIF |
---|
1395 | |
---|
1396 | ! |
---|
1397 | !-- Set wind speed in the Galilei-transformed system |
---|
1398 | IF ( galilei_transformation ) THEN |
---|
1399 | IF ( use_ug_for_galilei_tr .AND. & |
---|
1400 | ug_vertical_gradient_level(1) == 0.0_wp .AND. & |
---|
1401 | ug_vertical_gradient(1) == 0.0_wp .AND. & |
---|
1402 | vg_vertical_gradient_level(1) == 0.0_wp .AND. & |
---|
1403 | vg_vertical_gradient(1) == 0.0_wp ) THEN |
---|
1404 | u_gtrans = ug_surface * 0.6_wp |
---|
1405 | v_gtrans = vg_surface * 0.6_wp |
---|
1406 | ELSEIF ( use_ug_for_galilei_tr .AND. & |
---|
1407 | ( ug_vertical_gradient_level(1) /= 0.0_wp .OR. & |
---|
1408 | ug_vertical_gradient(1) /= 0.0_wp ) ) THEN |
---|
1409 | message_string = 'baroclinity (ug) not allowed simultaneously' // & |
---|
1410 | ' with galilei transformation' |
---|
1411 | CALL message( 'check_parameters', 'PA0046', 1, 2, 0, 6, 0 ) |
---|
1412 | ELSEIF ( use_ug_for_galilei_tr .AND. & |
---|
1413 | ( vg_vertical_gradient_level(1) /= 0.0_wp .OR. & |
---|
1414 | vg_vertical_gradient(1) /= 0.0_wp ) ) THEN |
---|
1415 | message_string = 'baroclinity (vg) not allowed simultaneously' // & |
---|
1416 | ' with galilei transformation' |
---|
1417 | CALL message( 'check_parameters', 'PA0047', 1, 2, 0, 6, 0 ) |
---|
1418 | ELSE |
---|
1419 | message_string = 'variable translation speed used for galilei-' // & |
---|
1420 | 'transformation, which may cause & instabilities in stably ' // & |
---|
1421 | 'stratified regions' |
---|
1422 | CALL message( 'check_parameters', 'PA0048', 0, 1, 0, 6, 0 ) |
---|
1423 | ENDIF |
---|
1424 | ENDIF |
---|
1425 | |
---|
1426 | ! |
---|
1427 | !-- In case of using a prandtl-layer, calculated (or prescribed) surface |
---|
1428 | !-- fluxes have to be used in the diffusion-terms |
---|
1429 | IF ( prandtl_layer ) use_surface_fluxes = .TRUE. |
---|
1430 | |
---|
1431 | ! |
---|
1432 | !-- Check boundary conditions and set internal variables: |
---|
1433 | !-- Lateral boundary conditions |
---|
1434 | IF ( bc_lr /= 'cyclic' .AND. bc_lr /= 'dirichlet/radiation' .AND. & |
---|
1435 | bc_lr /= 'radiation/dirichlet' ) THEN |
---|
1436 | message_string = 'unknown boundary condition: bc_lr = "' // & |
---|
1437 | TRIM( bc_lr ) // '"' |
---|
1438 | CALL message( 'check_parameters', 'PA0049', 1, 2, 0, 6, 0 ) |
---|
1439 | ENDIF |
---|
1440 | IF ( bc_ns /= 'cyclic' .AND. bc_ns /= 'dirichlet/radiation' .AND. & |
---|
1441 | bc_ns /= 'radiation/dirichlet' ) THEN |
---|
1442 | message_string = 'unknown boundary condition: bc_ns = "' // & |
---|
1443 | TRIM( bc_ns ) // '"' |
---|
1444 | CALL message( 'check_parameters', 'PA0050', 1, 2, 0, 6, 0 ) |
---|
1445 | ENDIF |
---|
1446 | |
---|
1447 | ! |
---|
1448 | !-- Internal variables used for speed optimization in if clauses |
---|
1449 | IF ( bc_lr /= 'cyclic' ) bc_lr_cyc = .FALSE. |
---|
1450 | IF ( bc_lr == 'dirichlet/radiation' ) bc_lr_dirrad = .TRUE. |
---|
1451 | IF ( bc_lr == 'radiation/dirichlet' ) bc_lr_raddir = .TRUE. |
---|
1452 | IF ( bc_ns /= 'cyclic' ) bc_ns_cyc = .FALSE. |
---|
1453 | IF ( bc_ns == 'dirichlet/radiation' ) bc_ns_dirrad = .TRUE. |
---|
1454 | IF ( bc_ns == 'radiation/dirichlet' ) bc_ns_raddir = .TRUE. |
---|
1455 | |
---|
1456 | ! |
---|
1457 | !-- Non-cyclic lateral boundaries require the multigrid method and Piascek- |
---|
1458 | !-- Willimas or Wicker - Skamarock advection scheme. Several schemes |
---|
1459 | !-- and tools do not work with non-cyclic boundary conditions. |
---|
1460 | IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN |
---|
1461 | IF ( psolver /= 'multigrid' ) THEN |
---|
1462 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
1463 | 'psolver = "' // TRIM( psolver ) // '"' |
---|
1464 | CALL message( 'check_parameters', 'PA0051', 1, 2, 0, 6, 0 ) |
---|
1465 | ENDIF |
---|
1466 | IF ( momentum_advec /= 'pw-scheme' .AND. & |
---|
1467 | momentum_advec /= 'ws-scheme') THEN |
---|
1468 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
1469 | 'momentum_advec = "' // TRIM( momentum_advec ) // '"' |
---|
1470 | CALL message( 'check_parameters', 'PA0052', 1, 2, 0, 6, 0 ) |
---|
1471 | ENDIF |
---|
1472 | IF ( scalar_advec /= 'pw-scheme' .AND. & |
---|
1473 | scalar_advec /= 'ws-scheme' ) THEN |
---|
1474 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
1475 | 'scalar_advec = "' // TRIM( scalar_advec ) // '"' |
---|
1476 | CALL message( 'check_parameters', 'PA0053', 1, 2, 0, 6, 0 ) |
---|
1477 | ENDIF |
---|
1478 | IF ( galilei_transformation ) THEN |
---|
1479 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
1480 | 'galilei_transformation = .T.' |
---|
1481 | CALL message( 'check_parameters', 'PA0054', 1, 2, 0, 6, 0 ) |
---|
1482 | ENDIF |
---|
1483 | ENDIF |
---|
1484 | |
---|
1485 | ! |
---|
1486 | !-- Bottom boundary condition for the turbulent Kinetic energy |
---|
1487 | IF ( bc_e_b == 'neumann' ) THEN |
---|
1488 | ibc_e_b = 1 |
---|
1489 | ELSEIF ( bc_e_b == '(u*)**2+neumann' ) THEN |
---|
1490 | ibc_e_b = 2 |
---|
1491 | IF ( .NOT. prandtl_layer ) THEN |
---|
1492 | bc_e_b = 'neumann' |
---|
1493 | ibc_e_b = 1 |
---|
1494 | message_string = 'boundary condition bc_e_b changed to "' // & |
---|
1495 | TRIM( bc_e_b ) // '"' |
---|
1496 | CALL message( 'check_parameters', 'PA0057', 0, 1, 0, 6, 0 ) |
---|
1497 | ENDIF |
---|
1498 | ELSE |
---|
1499 | message_string = 'unknown boundary condition: bc_e_b = "' // & |
---|
1500 | TRIM( bc_e_b ) // '"' |
---|
1501 | CALL message( 'check_parameters', 'PA0058', 1, 2, 0, 6, 0 ) |
---|
1502 | ENDIF |
---|
1503 | |
---|
1504 | ! |
---|
1505 | !-- Boundary conditions for perturbation pressure |
---|
1506 | IF ( bc_p_b == 'dirichlet' ) THEN |
---|
1507 | ibc_p_b = 0 |
---|
1508 | ELSEIF ( bc_p_b == 'neumann' ) THEN |
---|
1509 | ibc_p_b = 1 |
---|
1510 | ELSE |
---|
1511 | message_string = 'unknown boundary condition: bc_p_b = "' // & |
---|
1512 | TRIM( bc_p_b ) // '"' |
---|
1513 | CALL message( 'check_parameters', 'PA0059', 1, 2, 0, 6, 0 ) |
---|
1514 | ENDIF |
---|
1515 | |
---|
1516 | IF ( bc_p_t == 'dirichlet' ) THEN |
---|
1517 | ibc_p_t = 0 |
---|
1518 | ELSEIF ( bc_p_t == 'neumann' ) THEN |
---|
1519 | ibc_p_t = 1 |
---|
1520 | ELSE |
---|
1521 | message_string = 'unknown boundary condition: bc_p_t = "' // & |
---|
1522 | TRIM( bc_p_t ) // '"' |
---|
1523 | CALL message( 'check_parameters', 'PA0061', 1, 2, 0, 6, 0 ) |
---|
1524 | ENDIF |
---|
1525 | |
---|
1526 | ! |
---|
1527 | !-- Boundary conditions for potential temperature |
---|
1528 | IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
1529 | ibc_pt_b = 2 |
---|
1530 | ELSE |
---|
1531 | IF ( bc_pt_b == 'dirichlet' ) THEN |
---|
1532 | ibc_pt_b = 0 |
---|
1533 | ELSEIF ( bc_pt_b == 'neumann' ) THEN |
---|
1534 | ibc_pt_b = 1 |
---|
1535 | ELSE |
---|
1536 | message_string = 'unknown boundary condition: bc_pt_b = "' // & |
---|
1537 | TRIM( bc_pt_b ) // '"' |
---|
1538 | CALL message( 'check_parameters', 'PA0062', 1, 2, 0, 6, 0 ) |
---|
1539 | ENDIF |
---|
1540 | ENDIF |
---|
1541 | |
---|
1542 | IF ( bc_pt_t == 'dirichlet' ) THEN |
---|
1543 | ibc_pt_t = 0 |
---|
1544 | ELSEIF ( bc_pt_t == 'neumann' ) THEN |
---|
1545 | ibc_pt_t = 1 |
---|
1546 | ELSEIF ( bc_pt_t == 'initial_gradient' ) THEN |
---|
1547 | ibc_pt_t = 2 |
---|
1548 | ELSE |
---|
1549 | message_string = 'unknown boundary condition: bc_pt_t = "' // & |
---|
1550 | TRIM( bc_pt_t ) // '"' |
---|
1551 | CALL message( 'check_parameters', 'PA0063', 1, 2, 0, 6, 0 ) |
---|
1552 | ENDIF |
---|
1553 | |
---|
1554 | IF ( surface_heatflux == 9999999.9_wp ) THEN |
---|
1555 | constant_heatflux = .FALSE. |
---|
1556 | IF ( large_scale_forcing ) THEN |
---|
1557 | IF ( ibc_pt_b == 0 ) THEN |
---|
1558 | constant_heatflux = .FALSE. |
---|
1559 | ELSEIF ( ibc_pt_b == 1 ) THEN |
---|
1560 | constant_heatflux = .TRUE. |
---|
1561 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN |
---|
1562 | surface_heatflux = shf_surf(1) |
---|
1563 | ENDIF |
---|
1564 | ENDIF |
---|
1565 | ENDIF |
---|
1566 | ELSE |
---|
1567 | constant_heatflux = .TRUE. |
---|
1568 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & |
---|
1569 | large_scale_forcing ) THEN |
---|
1570 | surface_heatflux = shf_surf(1) |
---|
1571 | ENDIF |
---|
1572 | ENDIF |
---|
1573 | |
---|
1574 | IF ( top_heatflux == 9999999.9_wp ) constant_top_heatflux = .FALSE. |
---|
1575 | |
---|
1576 | IF ( neutral ) THEN |
---|
1577 | |
---|
1578 | IF ( surface_heatflux /= 0.0_wp .AND. surface_heatflux /= 9999999.9_wp ) & |
---|
1579 | THEN |
---|
1580 | message_string = 'heatflux must not be set for pure neutral flow' |
---|
1581 | CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) |
---|
1582 | ENDIF |
---|
1583 | |
---|
1584 | IF ( top_heatflux /= 0.0 .AND. top_heatflux /= 9999999.9_wp ) & |
---|
1585 | THEN |
---|
1586 | message_string = 'heatflux must not be set for pure neutral flow' |
---|
1587 | CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) |
---|
1588 | ENDIF |
---|
1589 | |
---|
1590 | ENDIF |
---|
1591 | |
---|
1592 | IF ( top_momentumflux_u /= 9999999.9_wp .AND. & |
---|
1593 | top_momentumflux_v /= 9999999.9_wp ) THEN |
---|
1594 | constant_top_momentumflux = .TRUE. |
---|
1595 | ELSEIF ( .NOT. ( top_momentumflux_u == 9999999.9_wp .AND. & |
---|
1596 | top_momentumflux_v == 9999999.9_wp ) ) THEN |
---|
1597 | message_string = 'both, top_momentumflux_u AND top_momentumflux_v ' // & |
---|
1598 | 'must be set' |
---|
1599 | CALL message( 'check_parameters', 'PA0064', 1, 2, 0, 6, 0 ) |
---|
1600 | ENDIF |
---|
1601 | |
---|
1602 | ! |
---|
1603 | !-- A given surface temperature implies Dirichlet boundary condition for |
---|
1604 | !-- temperature. In this case specification of a constant heat flux is |
---|
1605 | !-- forbidden. |
---|
1606 | IF ( ibc_pt_b == 0 .AND. constant_heatflux .AND. & |
---|
1607 | surface_heatflux /= 0.0_wp ) THEN |
---|
1608 | message_string = 'boundary_condition: bc_pt_b = "' // TRIM( bc_pt_b ) //& |
---|
1609 | '& is not allowed with constant_heatflux = .TRUE.' |
---|
1610 | CALL message( 'check_parameters', 'PA0065', 1, 2, 0, 6, 0 ) |
---|
1611 | ENDIF |
---|
1612 | IF ( constant_heatflux .AND. pt_surface_initial_change /= 0.0_wp ) THEN |
---|
1613 | WRITE ( message_string, * ) 'constant_heatflux = .TRUE. is not allo', & |
---|
1614 | 'wed with pt_surface_initial_change (/=0) = ', & |
---|
1615 | pt_surface_initial_change |
---|
1616 | CALL message( 'check_parameters', 'PA0066', 1, 2, 0, 6, 0 ) |
---|
1617 | ENDIF |
---|
1618 | |
---|
1619 | ! |
---|
1620 | !-- A given temperature at the top implies Dirichlet boundary condition for |
---|
1621 | !-- temperature. In this case specification of a constant heat flux is |
---|
1622 | !-- forbidden. |
---|
1623 | IF ( ibc_pt_t == 0 .AND. constant_top_heatflux .AND. & |
---|
1624 | top_heatflux /= 0.0_wp ) THEN |
---|
1625 | message_string = 'boundary_condition: bc_pt_t = "' // TRIM( bc_pt_t ) //& |
---|
1626 | '" is not allowed with constant_top_heatflux = .TRUE.' |
---|
1627 | CALL message( 'check_parameters', 'PA0067', 1, 2, 0, 6, 0 ) |
---|
1628 | ENDIF |
---|
1629 | |
---|
1630 | ! |
---|
1631 | !-- Boundary conditions for salinity |
---|
1632 | IF ( ocean ) THEN |
---|
1633 | IF ( bc_sa_t == 'dirichlet' ) THEN |
---|
1634 | ibc_sa_t = 0 |
---|
1635 | ELSEIF ( bc_sa_t == 'neumann' ) THEN |
---|
1636 | ibc_sa_t = 1 |
---|
1637 | ELSE |
---|
1638 | message_string = 'unknown boundary condition: bc_sa_t = "' // & |
---|
1639 | TRIM( bc_sa_t ) // '"' |
---|
1640 | CALL message( 'check_parameters', 'PA0068', 1, 2, 0, 6, 0 ) |
---|
1641 | ENDIF |
---|
1642 | |
---|
1643 | IF ( top_salinityflux == 9999999.9_wp ) constant_top_salinityflux = .FALSE. |
---|
1644 | IF ( ibc_sa_t == 1 .AND. top_salinityflux == 9999999.9_wp ) THEN |
---|
1645 | message_string = 'boundary condition: bc_sa_t = "' // & |
---|
1646 | TRIM( bc_sa_t ) // '" requires to set ' // & |
---|
1647 | 'top_salinityflux' |
---|
1648 | CALL message( 'check_parameters', 'PA0069', 1, 2, 0, 6, 0 ) |
---|
1649 | ENDIF |
---|
1650 | |
---|
1651 | ! |
---|
1652 | !-- A fixed salinity at the top implies Dirichlet boundary condition for |
---|
1653 | !-- salinity. In this case specification of a constant salinity flux is |
---|
1654 | !-- forbidden. |
---|
1655 | IF ( ibc_sa_t == 0 .AND. constant_top_salinityflux .AND. & |
---|
1656 | top_salinityflux /= 0.0_wp ) THEN |
---|
1657 | message_string = 'boundary condition: bc_sa_t = "' // & |
---|
1658 | TRIM( bc_sa_t ) // '" is not allowed with ' // & |
---|
1659 | 'constant_top_salinityflux = .TRUE.' |
---|
1660 | CALL message( 'check_parameters', 'PA0070', 1, 2, 0, 6, 0 ) |
---|
1661 | ENDIF |
---|
1662 | |
---|
1663 | ENDIF |
---|
1664 | |
---|
1665 | ! |
---|
1666 | !-- In case of humidity or passive scalar, set boundary conditions for total |
---|
1667 | !-- water content / scalar |
---|
1668 | IF ( humidity .OR. passive_scalar ) THEN |
---|
1669 | IF ( humidity ) THEN |
---|
1670 | sq = 'q' |
---|
1671 | ELSE |
---|
1672 | sq = 's' |
---|
1673 | ENDIF |
---|
1674 | IF ( bc_q_b == 'dirichlet' ) THEN |
---|
1675 | ibc_q_b = 0 |
---|
1676 | ELSEIF ( bc_q_b == 'neumann' ) THEN |
---|
1677 | ibc_q_b = 1 |
---|
1678 | ELSE |
---|
1679 | message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // & |
---|
1680 | '_b ="' // TRIM( bc_q_b ) // '"' |
---|
1681 | CALL message( 'check_parameters', 'PA0071', 1, 2, 0, 6, 0 ) |
---|
1682 | ENDIF |
---|
1683 | IF ( bc_q_t == 'dirichlet' ) THEN |
---|
1684 | ibc_q_t = 0 |
---|
1685 | ELSEIF ( bc_q_t == 'neumann' ) THEN |
---|
1686 | ibc_q_t = 1 |
---|
1687 | ELSE |
---|
1688 | message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // & |
---|
1689 | '_t ="' // TRIM( bc_q_t ) // '"' |
---|
1690 | CALL message( 'check_parameters', 'PA0072', 1, 2, 0, 6, 0 ) |
---|
1691 | ENDIF |
---|
1692 | |
---|
1693 | IF ( surface_waterflux == 9999999.9_wp ) THEN |
---|
1694 | constant_waterflux = .FALSE. |
---|
1695 | IF ( large_scale_forcing ) THEN |
---|
1696 | IF ( ibc_q_b == 0 ) THEN |
---|
1697 | constant_waterflux = .FALSE. |
---|
1698 | ELSEIF ( ibc_q_b == 1 ) THEN |
---|
1699 | constant_waterflux = .TRUE. |
---|
1700 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN |
---|
1701 | surface_waterflux = qsws_surf(1) |
---|
1702 | ENDIF |
---|
1703 | ENDIF |
---|
1704 | ENDIF |
---|
1705 | ELSE |
---|
1706 | constant_waterflux = .TRUE. |
---|
1707 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & |
---|
1708 | large_scale_forcing ) THEN |
---|
1709 | surface_waterflux = qsws_surf(1) |
---|
1710 | ENDIF |
---|
1711 | ENDIF |
---|
1712 | |
---|
1713 | ! |
---|
1714 | !-- A given surface humidity implies Dirichlet boundary condition for |
---|
1715 | !-- humidity. In this case specification of a constant water flux is |
---|
1716 | !-- forbidden. |
---|
1717 | IF ( ibc_q_b == 0 .AND. constant_waterflux ) THEN |
---|
1718 | message_string = 'boundary condition: bc_' // TRIM( sq ) // '_b ' // & |
---|
1719 | '= "' // TRIM( bc_q_b ) // '" is not allowed wi' // & |
---|
1720 | 'th prescribed surface flux' |
---|
1721 | CALL message( 'check_parameters', 'PA0073', 1, 2, 0, 6, 0 ) |
---|
1722 | ENDIF |
---|
1723 | IF ( constant_waterflux .AND. q_surface_initial_change /= 0.0_wp ) THEN |
---|
1724 | WRITE( message_string, * ) 'a prescribed surface flux is not allo', & |
---|
1725 | 'wed with ', sq, '_surface_initial_change (/=0) = ', & |
---|
1726 | q_surface_initial_change |
---|
1727 | CALL message( 'check_parameters', 'PA0074', 1, 2, 0, 6, 0 ) |
---|
1728 | ENDIF |
---|
1729 | |
---|
1730 | ENDIF |
---|
1731 | ! |
---|
1732 | !-- Boundary conditions for horizontal components of wind speed |
---|
1733 | IF ( bc_uv_b == 'dirichlet' ) THEN |
---|
1734 | ibc_uv_b = 0 |
---|
1735 | ELSEIF ( bc_uv_b == 'neumann' ) THEN |
---|
1736 | ibc_uv_b = 1 |
---|
1737 | IF ( prandtl_layer ) THEN |
---|
1738 | message_string = 'boundary condition: bc_uv_b = "' // & |
---|
1739 | TRIM( bc_uv_b ) // '" is not allowed with prandtl_layer = .TRUE.' |
---|
1740 | CALL message( 'check_parameters', 'PA0075', 1, 2, 0, 6, 0 ) |
---|
1741 | ENDIF |
---|
1742 | ELSE |
---|
1743 | message_string = 'unknown boundary condition: bc_uv_b = "' // & |
---|
1744 | TRIM( bc_uv_b ) // '"' |
---|
1745 | CALL message( 'check_parameters', 'PA0076', 1, 2, 0, 6, 0 ) |
---|
1746 | ENDIF |
---|
1747 | ! |
---|
1748 | !-- In case of coupled simulations u and v at the ground in atmosphere will be |
---|
1749 | !-- assigned with the u and v values of the ocean surface |
---|
1750 | IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
1751 | ibc_uv_b = 2 |
---|
1752 | ENDIF |
---|
1753 | |
---|
1754 | IF ( coupling_mode == 'ocean_to_atmosphere' ) THEN |
---|
1755 | bc_uv_t = 'neumann' |
---|
1756 | ibc_uv_t = 1 |
---|
1757 | ELSE |
---|
1758 | IF ( bc_uv_t == 'dirichlet' .OR. bc_uv_t == 'dirichlet_0' ) THEN |
---|
1759 | ibc_uv_t = 0 |
---|
1760 | IF ( bc_uv_t == 'dirichlet_0' ) THEN |
---|
1761 | ! |
---|
1762 | !-- Velocities for the initial u,v-profiles are set zero at the top |
---|
1763 | !-- in case of dirichlet_0 conditions |
---|
1764 | u_init(nzt+1) = 0.0_wp |
---|
1765 | v_init(nzt+1) = 0.0_wp |
---|
1766 | ENDIF |
---|
1767 | ELSEIF ( bc_uv_t == 'neumann' ) THEN |
---|
1768 | ibc_uv_t = 1 |
---|
1769 | ELSE |
---|
1770 | message_string = 'unknown boundary condition: bc_uv_t = "' // & |
---|
1771 | TRIM( bc_uv_t ) // '"' |
---|
1772 | CALL message( 'check_parameters', 'PA0077', 1, 2, 0, 6, 0 ) |
---|
1773 | ENDIF |
---|
1774 | ENDIF |
---|
1775 | |
---|
1776 | ! |
---|
1777 | !-- Compute and check, respectively, the Rayleigh Damping parameter |
---|
1778 | IF ( rayleigh_damping_factor == -1.0_wp ) THEN |
---|
1779 | rayleigh_damping_factor = 0.0_wp |
---|
1780 | ELSE |
---|
1781 | IF ( rayleigh_damping_factor < 0.0 .OR. rayleigh_damping_factor > 1.0_wp ) & |
---|
1782 | THEN |
---|
1783 | WRITE( message_string, * ) 'rayleigh_damping_factor = ', & |
---|
1784 | rayleigh_damping_factor, ' out of range [0.0,1.0]' |
---|
1785 | CALL message( 'check_parameters', 'PA0078', 1, 2, 0, 6, 0 ) |
---|
1786 | ENDIF |
---|
1787 | ENDIF |
---|
1788 | |
---|
1789 | IF ( rayleigh_damping_height == -1.0_wp ) THEN |
---|
1790 | IF ( .NOT. ocean ) THEN |
---|
1791 | rayleigh_damping_height = 0.66666666666_wp * zu(nzt) |
---|
1792 | ELSE |
---|
1793 | rayleigh_damping_height = 0.66666666666_wp * zu(nzb) |
---|
1794 | ENDIF |
---|
1795 | ELSE |
---|
1796 | IF ( .NOT. ocean ) THEN |
---|
1797 | IF ( rayleigh_damping_height < 0.0_wp .OR. & |
---|
1798 | rayleigh_damping_height > zu(nzt) ) THEN |
---|
1799 | WRITE( message_string, * ) 'rayleigh_damping_height = ', & |
---|
1800 | rayleigh_damping_height, ' out of range [0.0,', zu(nzt), ']' |
---|
1801 | CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) |
---|
1802 | ENDIF |
---|
1803 | ELSE |
---|
1804 | IF ( rayleigh_damping_height > 0.0_wp .OR. & |
---|
1805 | rayleigh_damping_height < zu(nzb) ) THEN |
---|
1806 | WRITE( message_string, * ) 'rayleigh_damping_height = ', & |
---|
1807 | rayleigh_damping_height, ' out of range [0.0,', zu(nzb), ']' |
---|
1808 | CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) |
---|
1809 | ENDIF |
---|
1810 | ENDIF |
---|
1811 | ENDIF |
---|
1812 | |
---|
1813 | ! |
---|
1814 | !-- Check number of chosen statistic regions. More than 10 regions are not |
---|
1815 | !-- allowed, because so far no more than 10 corresponding output files can |
---|
1816 | !-- be opened (cf. check_open) |
---|
1817 | IF ( statistic_regions > 9 .OR. statistic_regions < 0 ) THEN |
---|
1818 | WRITE ( message_string, * ) 'number of statistic_regions = ', & |
---|
1819 | statistic_regions+1, ' but only 10 regions are allowed' |
---|
1820 | CALL message( 'check_parameters', 'PA0082', 1, 2, 0, 6, 0 ) |
---|
1821 | ENDIF |
---|
1822 | IF ( normalizing_region > statistic_regions .OR. & |
---|
1823 | normalizing_region < 0) THEN |
---|
1824 | WRITE ( message_string, * ) 'normalizing_region = ', & |
---|
1825 | normalizing_region, ' must be >= 0 and <= ',statistic_regions, & |
---|
1826 | ' (value of statistic_regions)' |
---|
1827 | CALL message( 'check_parameters', 'PA0083', 1, 2, 0, 6, 0 ) |
---|
1828 | ENDIF |
---|
1829 | |
---|
1830 | ! |
---|
1831 | !-- Set the default intervals for data output, if necessary |
---|
1832 | !-- NOTE: dt_dosp has already been set in package_parin |
---|
1833 | IF ( dt_data_output /= 9999999.9_wp ) THEN |
---|
1834 | IF ( dt_dopr == 9999999.9_wp ) dt_dopr = dt_data_output |
---|
1835 | IF ( dt_dopts == 9999999.9_wp ) dt_dopts = dt_data_output |
---|
1836 | IF ( dt_do2d_xy == 9999999.9_wp ) dt_do2d_xy = dt_data_output |
---|
1837 | IF ( dt_do2d_xz == 9999999.9_wp ) dt_do2d_xz = dt_data_output |
---|
1838 | IF ( dt_do2d_yz == 9999999.9_wp ) dt_do2d_yz = dt_data_output |
---|
1839 | IF ( dt_do3d == 9999999.9_wp ) dt_do3d = dt_data_output |
---|
1840 | IF ( dt_data_output_av == 9999999.9_wp ) dt_data_output_av = dt_data_output |
---|
1841 | DO mid = 1, max_masks |
---|
1842 | IF ( dt_domask(mid) == 9999999.9_wp ) dt_domask(mid) = dt_data_output |
---|
1843 | ENDDO |
---|
1844 | ENDIF |
---|
1845 | |
---|
1846 | ! |
---|
1847 | !-- Set the default skip time intervals for data output, if necessary |
---|
1848 | IF ( skip_time_dopr == 9999999.9_wp ) & |
---|
1849 | skip_time_dopr = skip_time_data_output |
---|
1850 | IF ( skip_time_dosp == 9999999.9_wp ) & |
---|
1851 | skip_time_dosp = skip_time_data_output |
---|
1852 | IF ( skip_time_do2d_xy == 9999999.9_wp ) & |
---|
1853 | skip_time_do2d_xy = skip_time_data_output |
---|
1854 | IF ( skip_time_do2d_xz == 9999999.9_wp ) & |
---|
1855 | skip_time_do2d_xz = skip_time_data_output |
---|
1856 | IF ( skip_time_do2d_yz == 9999999.9_wp ) & |
---|
1857 | skip_time_do2d_yz = skip_time_data_output |
---|
1858 | IF ( skip_time_do3d == 9999999.9_wp ) & |
---|
1859 | skip_time_do3d = skip_time_data_output |
---|
1860 | IF ( skip_time_data_output_av == 9999999.9_wp ) & |
---|
1861 | skip_time_data_output_av = skip_time_data_output |
---|
1862 | DO mid = 1, max_masks |
---|
1863 | IF ( skip_time_domask(mid) == 9999999.9_wp ) & |
---|
1864 | skip_time_domask(mid) = skip_time_data_output |
---|
1865 | ENDDO |
---|
1866 | |
---|
1867 | ! |
---|
1868 | !-- Check the average intervals (first for 3d-data, then for profiles and |
---|
1869 | !-- spectra) |
---|
1870 | IF ( averaging_interval > dt_data_output_av ) THEN |
---|
1871 | WRITE( message_string, * ) 'averaging_interval = ', & |
---|
1872 | averaging_interval, ' must be <= dt_data_output = ', dt_data_output |
---|
1873 | CALL message( 'check_parameters', 'PA0085', 1, 2, 0, 6, 0 ) |
---|
1874 | ENDIF |
---|
1875 | |
---|
1876 | IF ( averaging_interval_pr == 9999999.9_wp ) THEN |
---|
1877 | averaging_interval_pr = averaging_interval |
---|
1878 | ENDIF |
---|
1879 | |
---|
1880 | IF ( averaging_interval_pr > dt_dopr ) THEN |
---|
1881 | WRITE( message_string, * ) 'averaging_interval_pr = ', & |
---|
1882 | averaging_interval_pr, ' must be <= dt_dopr = ', dt_dopr |
---|
1883 | CALL message( 'check_parameters', 'PA0086', 1, 2, 0, 6, 0 ) |
---|
1884 | ENDIF |
---|
1885 | |
---|
1886 | IF ( averaging_interval_sp == 9999999.9_wp ) THEN |
---|
1887 | averaging_interval_sp = averaging_interval |
---|
1888 | ENDIF |
---|
1889 | |
---|
1890 | IF ( averaging_interval_sp > dt_dosp ) THEN |
---|
1891 | WRITE( message_string, * ) 'averaging_interval_sp = ', & |
---|
1892 | averaging_interval_sp, ' must be <= dt_dosp = ', dt_dosp |
---|
1893 | CALL message( 'check_parameters', 'PA0087', 1, 2, 0, 6, 0 ) |
---|
1894 | ENDIF |
---|
1895 | |
---|
1896 | ! |
---|
1897 | !-- Set the default interval for profiles entering the temporal average |
---|
1898 | IF ( dt_averaging_input_pr == 9999999.9_wp ) THEN |
---|
1899 | dt_averaging_input_pr = dt_averaging_input |
---|
1900 | ENDIF |
---|
1901 | |
---|
1902 | ! |
---|
1903 | !-- Set the default interval for the output of timeseries to a reasonable |
---|
1904 | !-- value (tries to minimize the number of calls of flow_statistics) |
---|
1905 | IF ( dt_dots == 9999999.9_wp ) THEN |
---|
1906 | IF ( averaging_interval_pr == 0.0_wp ) THEN |
---|
1907 | dt_dots = MIN( dt_run_control, dt_dopr ) |
---|
1908 | ELSE |
---|
1909 | dt_dots = MIN( dt_run_control, dt_averaging_input_pr ) |
---|
1910 | ENDIF |
---|
1911 | ENDIF |
---|
1912 | |
---|
1913 | ! |
---|
1914 | !-- Check the sample rate for averaging (first for 3d-data, then for profiles) |
---|
1915 | IF ( dt_averaging_input > averaging_interval ) THEN |
---|
1916 | WRITE( message_string, * ) 'dt_averaging_input = ', & |
---|
1917 | dt_averaging_input, ' must be <= averaging_interval = ', & |
---|
1918 | averaging_interval |
---|
1919 | CALL message( 'check_parameters', 'PA0088', 1, 2, 0, 6, 0 ) |
---|
1920 | ENDIF |
---|
1921 | |
---|
1922 | IF ( dt_averaging_input_pr > averaging_interval_pr ) THEN |
---|
1923 | WRITE( message_string, * ) 'dt_averaging_input_pr = ', & |
---|
1924 | dt_averaging_input_pr, ' must be <= averaging_interval_pr = ', & |
---|
1925 | averaging_interval_pr |
---|
1926 | CALL message( 'check_parameters', 'PA0089', 1, 2, 0, 6, 0 ) |
---|
1927 | ENDIF |
---|
1928 | |
---|
1929 | ! |
---|
1930 | !-- Set the default value for the integration interval of precipitation amount |
---|
1931 | IF ( precipitation ) THEN |
---|
1932 | IF ( precipitation_amount_interval == 9999999.9_wp ) THEN |
---|
1933 | precipitation_amount_interval = dt_do2d_xy |
---|
1934 | ELSE |
---|
1935 | IF ( precipitation_amount_interval > dt_do2d_xy ) THEN |
---|
1936 | WRITE( message_string, * ) 'precipitation_amount_interval = ', & |
---|
1937 | precipitation_amount_interval, ' must not be larger than ', & |
---|
1938 | 'dt_do2d_xy = ', dt_do2d_xy |
---|
1939 | CALL message( 'check_parameters', 'PA0090', 1, 2, 0, 6, 0 ) |
---|
1940 | ENDIF |
---|
1941 | ENDIF |
---|
1942 | ENDIF |
---|
1943 | |
---|
1944 | ! |
---|
1945 | !-- Determine the number of output profiles and check whether they are |
---|
1946 | !-- permissible |
---|
1947 | DO WHILE ( data_output_pr(dopr_n+1) /= ' ' ) |
---|
1948 | |
---|
1949 | dopr_n = dopr_n + 1 |
---|
1950 | i = dopr_n |
---|
1951 | |
---|
1952 | ! |
---|
1953 | !-- Determine internal profile number (for hom, homs) |
---|
1954 | !-- and store height levels |
---|
1955 | SELECT CASE ( TRIM( data_output_pr(i) ) ) |
---|
1956 | |
---|
1957 | CASE ( 'u', '#u' ) |
---|
1958 | dopr_index(i) = 1 |
---|
1959 | dopr_unit(i) = 'm/s' |
---|
1960 | hom(:,2,1,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1961 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
1962 | dopr_initial_index(i) = 5 |
---|
1963 | hom(:,2,5,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1964 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
1965 | ENDIF |
---|
1966 | |
---|
1967 | CASE ( 'v', '#v' ) |
---|
1968 | dopr_index(i) = 2 |
---|
1969 | dopr_unit(i) = 'm/s' |
---|
1970 | hom(:,2,2,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1971 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
1972 | dopr_initial_index(i) = 6 |
---|
1973 | hom(:,2,6,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1974 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
1975 | ENDIF |
---|
1976 | |
---|
1977 | CASE ( 'w' ) |
---|
1978 | dopr_index(i) = 3 |
---|
1979 | dopr_unit(i) = 'm/s' |
---|
1980 | hom(:,2,3,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
1981 | |
---|
1982 | CASE ( 'pt', '#pt' ) |
---|
1983 | IF ( .NOT. cloud_physics ) THEN |
---|
1984 | dopr_index(i) = 4 |
---|
1985 | dopr_unit(i) = 'K' |
---|
1986 | hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1987 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
1988 | dopr_initial_index(i) = 7 |
---|
1989 | hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1990 | hom(nzb,2,7,:) = 0.0_wp ! because zu(nzb) is negative |
---|
1991 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
1992 | ENDIF |
---|
1993 | ELSE |
---|
1994 | dopr_index(i) = 43 |
---|
1995 | dopr_unit(i) = 'K' |
---|
1996 | hom(:,2,43,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
1997 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
1998 | dopr_initial_index(i) = 28 |
---|
1999 | hom(:,2,28,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2000 | hom(nzb,2,28,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2001 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2002 | ENDIF |
---|
2003 | ENDIF |
---|
2004 | |
---|
2005 | CASE ( 'e' ) |
---|
2006 | dopr_index(i) = 8 |
---|
2007 | dopr_unit(i) = 'm2/s2' |
---|
2008 | hom(:,2,8,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2009 | hom(nzb,2,8,:) = 0.0_wp |
---|
2010 | |
---|
2011 | CASE ( 'km', '#km' ) |
---|
2012 | dopr_index(i) = 9 |
---|
2013 | dopr_unit(i) = 'm2/s' |
---|
2014 | hom(:,2,9,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2015 | hom(nzb,2,9,:) = 0.0_wp |
---|
2016 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2017 | dopr_initial_index(i) = 23 |
---|
2018 | hom(:,2,23,:) = hom(:,2,9,:) |
---|
2019 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2020 | ENDIF |
---|
2021 | |
---|
2022 | CASE ( 'kh', '#kh' ) |
---|
2023 | dopr_index(i) = 10 |
---|
2024 | dopr_unit(i) = 'm2/s' |
---|
2025 | hom(:,2,10,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2026 | hom(nzb,2,10,:) = 0.0_wp |
---|
2027 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2028 | dopr_initial_index(i) = 24 |
---|
2029 | hom(:,2,24,:) = hom(:,2,10,:) |
---|
2030 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2031 | ENDIF |
---|
2032 | |
---|
2033 | CASE ( 'l', '#l' ) |
---|
2034 | dopr_index(i) = 11 |
---|
2035 | dopr_unit(i) = 'm' |
---|
2036 | hom(:,2,11,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2037 | hom(nzb,2,11,:) = 0.0_wp |
---|
2038 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2039 | dopr_initial_index(i) = 25 |
---|
2040 | hom(:,2,25,:) = hom(:,2,11,:) |
---|
2041 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2042 | ENDIF |
---|
2043 | |
---|
2044 | CASE ( 'w"u"' ) |
---|
2045 | dopr_index(i) = 12 |
---|
2046 | dopr_unit(i) = 'm2/s2' |
---|
2047 | hom(:,2,12,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2048 | IF ( prandtl_layer ) hom(nzb,2,12,:) = zu(1) |
---|
2049 | |
---|
2050 | CASE ( 'w*u*' ) |
---|
2051 | dopr_index(i) = 13 |
---|
2052 | dopr_unit(i) = 'm2/s2' |
---|
2053 | hom(:,2,13,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2054 | |
---|
2055 | CASE ( 'w"v"' ) |
---|
2056 | dopr_index(i) = 14 |
---|
2057 | dopr_unit(i) = 'm2/s2' |
---|
2058 | hom(:,2,14,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2059 | IF ( prandtl_layer ) hom(nzb,2,14,:) = zu(1) |
---|
2060 | |
---|
2061 | CASE ( 'w*v*' ) |
---|
2062 | dopr_index(i) = 15 |
---|
2063 | dopr_unit(i) = 'm2/s2' |
---|
2064 | hom(:,2,15,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2065 | |
---|
2066 | CASE ( 'w"pt"' ) |
---|
2067 | dopr_index(i) = 16 |
---|
2068 | dopr_unit(i) = 'K m/s' |
---|
2069 | hom(:,2,16,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2070 | |
---|
2071 | CASE ( 'w*pt*' ) |
---|
2072 | dopr_index(i) = 17 |
---|
2073 | dopr_unit(i) = 'K m/s' |
---|
2074 | hom(:,2,17,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2075 | |
---|
2076 | CASE ( 'wpt' ) |
---|
2077 | dopr_index(i) = 18 |
---|
2078 | dopr_unit(i) = 'K m/s' |
---|
2079 | hom(:,2,18,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2080 | |
---|
2081 | CASE ( 'wu' ) |
---|
2082 | dopr_index(i) = 19 |
---|
2083 | dopr_unit(i) = 'm2/s2' |
---|
2084 | hom(:,2,19,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2085 | IF ( prandtl_layer ) hom(nzb,2,19,:) = zu(1) |
---|
2086 | |
---|
2087 | CASE ( 'wv' ) |
---|
2088 | dopr_index(i) = 20 |
---|
2089 | dopr_unit(i) = 'm2/s2' |
---|
2090 | hom(:,2,20,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2091 | IF ( prandtl_layer ) hom(nzb,2,20,:) = zu(1) |
---|
2092 | |
---|
2093 | CASE ( 'w*pt*BC' ) |
---|
2094 | dopr_index(i) = 21 |
---|
2095 | dopr_unit(i) = 'K m/s' |
---|
2096 | hom(:,2,21,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2097 | |
---|
2098 | CASE ( 'wptBC' ) |
---|
2099 | dopr_index(i) = 22 |
---|
2100 | dopr_unit(i) = 'K m/s' |
---|
2101 | hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2102 | |
---|
2103 | CASE ( 'sa', '#sa' ) |
---|
2104 | IF ( .NOT. ocean ) THEN |
---|
2105 | message_string = 'data_output_pr = ' // & |
---|
2106 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2107 | 'lemented for ocean = .FALSE.' |
---|
2108 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
2109 | ELSE |
---|
2110 | dopr_index(i) = 23 |
---|
2111 | dopr_unit(i) = 'psu' |
---|
2112 | hom(:,2,23,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2113 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2114 | dopr_initial_index(i) = 26 |
---|
2115 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2116 | hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2117 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2118 | ENDIF |
---|
2119 | ENDIF |
---|
2120 | |
---|
2121 | CASE ( 'u*2' ) |
---|
2122 | dopr_index(i) = 30 |
---|
2123 | dopr_unit(i) = 'm2/s2' |
---|
2124 | hom(:,2,30,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2125 | |
---|
2126 | CASE ( 'v*2' ) |
---|
2127 | dopr_index(i) = 31 |
---|
2128 | dopr_unit(i) = 'm2/s2' |
---|
2129 | hom(:,2,31,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2130 | |
---|
2131 | CASE ( 'w*2' ) |
---|
2132 | dopr_index(i) = 32 |
---|
2133 | dopr_unit(i) = 'm2/s2' |
---|
2134 | hom(:,2,32,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2135 | |
---|
2136 | CASE ( 'pt*2' ) |
---|
2137 | dopr_index(i) = 33 |
---|
2138 | dopr_unit(i) = 'K2' |
---|
2139 | hom(:,2,33,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2140 | |
---|
2141 | CASE ( 'e*' ) |
---|
2142 | dopr_index(i) = 34 |
---|
2143 | dopr_unit(i) = 'm2/s2' |
---|
2144 | hom(:,2,34,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2145 | |
---|
2146 | CASE ( 'w*2pt*' ) |
---|
2147 | dopr_index(i) = 35 |
---|
2148 | dopr_unit(i) = 'K m2/s2' |
---|
2149 | hom(:,2,35,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2150 | |
---|
2151 | CASE ( 'w*pt*2' ) |
---|
2152 | dopr_index(i) = 36 |
---|
2153 | dopr_unit(i) = 'K2 m/s' |
---|
2154 | hom(:,2,36,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2155 | |
---|
2156 | CASE ( 'w*e*' ) |
---|
2157 | dopr_index(i) = 37 |
---|
2158 | dopr_unit(i) = 'm3/s3' |
---|
2159 | hom(:,2,37,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2160 | |
---|
2161 | CASE ( 'w*3' ) |
---|
2162 | dopr_index(i) = 38 |
---|
2163 | dopr_unit(i) = 'm3/s3' |
---|
2164 | hom(:,2,38,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2165 | |
---|
2166 | CASE ( 'Sw' ) |
---|
2167 | dopr_index(i) = 39 |
---|
2168 | dopr_unit(i) = 'none' |
---|
2169 | hom(:,2,39,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2170 | |
---|
2171 | CASE ( 'p' ) |
---|
2172 | dopr_index(i) = 40 |
---|
2173 | dopr_unit(i) = 'Pa' |
---|
2174 | hom(:,2,40,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2175 | |
---|
2176 | CASE ( 'q', '#q' ) |
---|
2177 | IF ( .NOT. humidity ) THEN |
---|
2178 | message_string = 'data_output_pr = ' // & |
---|
2179 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2180 | 'lemented for humidity = .FALSE.' |
---|
2181 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
2182 | ELSE |
---|
2183 | dopr_index(i) = 41 |
---|
2184 | dopr_unit(i) = 'kg/kg' |
---|
2185 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2186 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2187 | dopr_initial_index(i) = 26 |
---|
2188 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2189 | hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2190 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2191 | ENDIF |
---|
2192 | ENDIF |
---|
2193 | |
---|
2194 | CASE ( 's', '#s' ) |
---|
2195 | IF ( .NOT. passive_scalar ) THEN |
---|
2196 | message_string = 'data_output_pr = ' // & |
---|
2197 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2198 | 'lemented for passive_scalar = .FALSE.' |
---|
2199 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
2200 | ELSE |
---|
2201 | dopr_index(i) = 41 |
---|
2202 | dopr_unit(i) = 'kg/m3' |
---|
2203 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2204 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2205 | dopr_initial_index(i) = 26 |
---|
2206 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2207 | hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2208 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2209 | ENDIF |
---|
2210 | ENDIF |
---|
2211 | |
---|
2212 | CASE ( 'qv', '#qv' ) |
---|
2213 | IF ( .NOT. cloud_physics ) THEN |
---|
2214 | dopr_index(i) = 41 |
---|
2215 | dopr_unit(i) = 'kg/kg' |
---|
2216 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2217 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2218 | dopr_initial_index(i) = 26 |
---|
2219 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2220 | hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2221 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2222 | ENDIF |
---|
2223 | ELSE |
---|
2224 | dopr_index(i) = 42 |
---|
2225 | dopr_unit(i) = 'kg/kg' |
---|
2226 | hom(:,2,42,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2227 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2228 | dopr_initial_index(i) = 27 |
---|
2229 | hom(:,2,27,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2230 | hom(nzb,2,27,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2231 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2232 | ENDIF |
---|
2233 | ENDIF |
---|
2234 | |
---|
2235 | CASE ( 'lpt', '#lpt' ) |
---|
2236 | IF ( .NOT. cloud_physics ) THEN |
---|
2237 | message_string = 'data_output_pr = ' // & |
---|
2238 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2239 | 'lemented for cloud_physics = .FALSE.' |
---|
2240 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
2241 | ELSE |
---|
2242 | dopr_index(i) = 4 |
---|
2243 | dopr_unit(i) = 'K' |
---|
2244 | hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2245 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2246 | dopr_initial_index(i) = 7 |
---|
2247 | hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2248 | hom(nzb,2,7,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2249 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2250 | ENDIF |
---|
2251 | ENDIF |
---|
2252 | |
---|
2253 | CASE ( 'vpt', '#vpt' ) |
---|
2254 | dopr_index(i) = 44 |
---|
2255 | dopr_unit(i) = 'K' |
---|
2256 | hom(:,2,44,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2257 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2258 | dopr_initial_index(i) = 29 |
---|
2259 | hom(:,2,29,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2260 | hom(nzb,2,29,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2261 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2262 | ENDIF |
---|
2263 | |
---|
2264 | CASE ( 'w"vpt"' ) |
---|
2265 | dopr_index(i) = 45 |
---|
2266 | dopr_unit(i) = 'K m/s' |
---|
2267 | hom(:,2,45,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2268 | |
---|
2269 | CASE ( 'w*vpt*' ) |
---|
2270 | dopr_index(i) = 46 |
---|
2271 | dopr_unit(i) = 'K m/s' |
---|
2272 | hom(:,2,46,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2273 | |
---|
2274 | CASE ( 'wvpt' ) |
---|
2275 | dopr_index(i) = 47 |
---|
2276 | dopr_unit(i) = 'K m/s' |
---|
2277 | hom(:,2,47,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2278 | |
---|
2279 | CASE ( 'w"q"' ) |
---|
2280 | IF ( .NOT. humidity ) THEN |
---|
2281 | message_string = 'data_output_pr = ' // & |
---|
2282 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2283 | 'lemented for humidity = .FALSE.' |
---|
2284 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
2285 | ELSE |
---|
2286 | dopr_index(i) = 48 |
---|
2287 | dopr_unit(i) = 'kg/kg m/s' |
---|
2288 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2289 | ENDIF |
---|
2290 | |
---|
2291 | CASE ( 'w*q*' ) |
---|
2292 | IF ( .NOT. humidity ) THEN |
---|
2293 | message_string = 'data_output_pr = ' // & |
---|
2294 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2295 | 'lemented for humidity = .FALSE.' |
---|
2296 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
2297 | ELSE |
---|
2298 | dopr_index(i) = 49 |
---|
2299 | dopr_unit(i) = 'kg/kg m/s' |
---|
2300 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2301 | ENDIF |
---|
2302 | |
---|
2303 | CASE ( 'wq' ) |
---|
2304 | IF ( .NOT. humidity ) THEN |
---|
2305 | message_string = 'data_output_pr = ' // & |
---|
2306 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2307 | 'lemented for humidity = .FALSE.' |
---|
2308 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
2309 | ELSE |
---|
2310 | dopr_index(i) = 50 |
---|
2311 | dopr_unit(i) = 'kg/kg m/s' |
---|
2312 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2313 | ENDIF |
---|
2314 | |
---|
2315 | CASE ( 'w"s"' ) |
---|
2316 | IF ( .NOT. passive_scalar ) THEN |
---|
2317 | message_string = 'data_output_pr = ' // & |
---|
2318 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2319 | 'lemented for passive_scalar = .FALSE.' |
---|
2320 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
2321 | ELSE |
---|
2322 | dopr_index(i) = 48 |
---|
2323 | dopr_unit(i) = 'kg/m3 m/s' |
---|
2324 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2325 | ENDIF |
---|
2326 | |
---|
2327 | CASE ( 'w*s*' ) |
---|
2328 | IF ( .NOT. passive_scalar ) THEN |
---|
2329 | message_string = 'data_output_pr = ' // & |
---|
2330 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2331 | 'lemented for passive_scalar = .FALSE.' |
---|
2332 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
2333 | ELSE |
---|
2334 | dopr_index(i) = 49 |
---|
2335 | dopr_unit(i) = 'kg/m3 m/s' |
---|
2336 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2337 | ENDIF |
---|
2338 | |
---|
2339 | CASE ( 'ws' ) |
---|
2340 | IF ( .NOT. passive_scalar ) THEN |
---|
2341 | message_string = 'data_output_pr = ' // & |
---|
2342 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2343 | 'lemented for passive_scalar = .FALSE.' |
---|
2344 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
2345 | ELSE |
---|
2346 | dopr_index(i) = 50 |
---|
2347 | dopr_unit(i) = 'kg/m3 m/s' |
---|
2348 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2349 | ENDIF |
---|
2350 | |
---|
2351 | CASE ( 'w"qv"' ) |
---|
2352 | IF ( humidity .AND. .NOT. cloud_physics ) & |
---|
2353 | THEN |
---|
2354 | dopr_index(i) = 48 |
---|
2355 | dopr_unit(i) = 'kg/kg m/s' |
---|
2356 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2357 | ELSEIF( humidity .AND. cloud_physics ) THEN |
---|
2358 | dopr_index(i) = 51 |
---|
2359 | dopr_unit(i) = 'kg/kg m/s' |
---|
2360 | hom(:,2,51,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2361 | ELSE |
---|
2362 | message_string = 'data_output_pr = ' // & |
---|
2363 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2364 | 'lemented for cloud_physics = .FALSE. an&' // & |
---|
2365 | 'd humidity = .FALSE.' |
---|
2366 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
2367 | ENDIF |
---|
2368 | |
---|
2369 | CASE ( 'w*qv*' ) |
---|
2370 | IF ( humidity .AND. .NOT. cloud_physics ) & |
---|
2371 | THEN |
---|
2372 | dopr_index(i) = 49 |
---|
2373 | dopr_unit(i) = 'kg/kg m/s' |
---|
2374 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2375 | ELSEIF( humidity .AND. cloud_physics ) THEN |
---|
2376 | dopr_index(i) = 52 |
---|
2377 | dopr_unit(i) = 'kg/kg m/s' |
---|
2378 | hom(:,2,52,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2379 | ELSE |
---|
2380 | message_string = 'data_output_pr = ' // & |
---|
2381 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2382 | 'lemented for cloud_physics = .FALSE. an&' // & |
---|
2383 | 'd humidity = .FALSE.' |
---|
2384 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
2385 | ENDIF |
---|
2386 | |
---|
2387 | CASE ( 'wqv' ) |
---|
2388 | IF ( humidity .AND. .NOT. cloud_physics ) & |
---|
2389 | THEN |
---|
2390 | dopr_index(i) = 50 |
---|
2391 | dopr_unit(i) = 'kg/kg m/s' |
---|
2392 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2393 | ELSEIF( humidity .AND. cloud_physics ) THEN |
---|
2394 | dopr_index(i) = 53 |
---|
2395 | dopr_unit(i) = 'kg/kg m/s' |
---|
2396 | hom(:,2,53,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2397 | ELSE |
---|
2398 | message_string = 'data_output_pr = ' // & |
---|
2399 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2400 | 'lemented for cloud_physics = .FALSE. an&' // & |
---|
2401 | 'd humidity = .FALSE.' |
---|
2402 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
2403 | ENDIF |
---|
2404 | |
---|
2405 | CASE ( 'ql' ) |
---|
2406 | IF ( .NOT. cloud_physics .AND. .NOT. cloud_droplets ) THEN |
---|
2407 | message_string = 'data_output_pr = ' // & |
---|
2408 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2409 | 'lemented for cloud_physics = .FALSE. or' // & |
---|
2410 | '&cloud_droplets = .FALSE.' |
---|
2411 | CALL message( 'check_parameters', 'PA0096', 1, 2, 0, 6, 0 ) |
---|
2412 | ELSE |
---|
2413 | dopr_index(i) = 54 |
---|
2414 | dopr_unit(i) = 'kg/kg' |
---|
2415 | hom(:,2,54,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2416 | ENDIF |
---|
2417 | |
---|
2418 | CASE ( 'w*u*u*:dz' ) |
---|
2419 | dopr_index(i) = 55 |
---|
2420 | dopr_unit(i) = 'm2/s3' |
---|
2421 | hom(:,2,55,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2422 | |
---|
2423 | CASE ( 'w*p*:dz' ) |
---|
2424 | dopr_index(i) = 56 |
---|
2425 | dopr_unit(i) = 'm2/s3' |
---|
2426 | hom(:,2,56,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2427 | |
---|
2428 | CASE ( 'w"e:dz' ) |
---|
2429 | dopr_index(i) = 57 |
---|
2430 | dopr_unit(i) = 'm2/s3' |
---|
2431 | hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2432 | |
---|
2433 | |
---|
2434 | CASE ( 'u"pt"' ) |
---|
2435 | dopr_index(i) = 58 |
---|
2436 | dopr_unit(i) = 'K m/s' |
---|
2437 | hom(:,2,58,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2438 | |
---|
2439 | CASE ( 'u*pt*' ) |
---|
2440 | dopr_index(i) = 59 |
---|
2441 | dopr_unit(i) = 'K m/s' |
---|
2442 | hom(:,2,59,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2443 | |
---|
2444 | CASE ( 'upt_t' ) |
---|
2445 | dopr_index(i) = 60 |
---|
2446 | dopr_unit(i) = 'K m/s' |
---|
2447 | hom(:,2,60,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2448 | |
---|
2449 | CASE ( 'v"pt"' ) |
---|
2450 | dopr_index(i) = 61 |
---|
2451 | dopr_unit(i) = 'K m/s' |
---|
2452 | hom(:,2,61,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2453 | |
---|
2454 | CASE ( 'v*pt*' ) |
---|
2455 | dopr_index(i) = 62 |
---|
2456 | dopr_unit(i) = 'K m/s' |
---|
2457 | hom(:,2,62,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2458 | |
---|
2459 | CASE ( 'vpt_t' ) |
---|
2460 | dopr_index(i) = 63 |
---|
2461 | dopr_unit(i) = 'K m/s' |
---|
2462 | hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2463 | |
---|
2464 | CASE ( 'rho' ) |
---|
2465 | IF ( .NOT. ocean ) THEN |
---|
2466 | message_string = 'data_output_pr = ' // & |
---|
2467 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2468 | 'lemented for ocean = .FALSE.' |
---|
2469 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
2470 | ELSE |
---|
2471 | dopr_index(i) = 64 |
---|
2472 | dopr_unit(i) = 'kg/m3' |
---|
2473 | hom(:,2,64,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2474 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
2475 | dopr_initial_index(i) = 77 |
---|
2476 | hom(:,2,77,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2477 | hom(nzb,2,77,:) = 0.0_wp ! because zu(nzb) is negative |
---|
2478 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
2479 | ENDIF |
---|
2480 | ENDIF |
---|
2481 | |
---|
2482 | CASE ( 'w"sa"' ) |
---|
2483 | IF ( .NOT. ocean ) THEN |
---|
2484 | message_string = 'data_output_pr = ' // & |
---|
2485 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2486 | 'lemented for ocean = .FALSE.' |
---|
2487 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
2488 | ELSE |
---|
2489 | dopr_index(i) = 65 |
---|
2490 | dopr_unit(i) = 'psu m/s' |
---|
2491 | hom(:,2,65,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2492 | ENDIF |
---|
2493 | |
---|
2494 | CASE ( 'w*sa*' ) |
---|
2495 | IF ( .NOT. ocean ) THEN |
---|
2496 | message_string = 'data_output_pr = ' // & |
---|
2497 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2498 | 'lemented for ocean = .FALSE.' |
---|
2499 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
2500 | ELSE |
---|
2501 | dopr_index(i) = 66 |
---|
2502 | dopr_unit(i) = 'psu m/s' |
---|
2503 | hom(:,2,66,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2504 | ENDIF |
---|
2505 | |
---|
2506 | CASE ( 'wsa' ) |
---|
2507 | IF ( .NOT. ocean ) THEN |
---|
2508 | message_string = 'data_output_pr = ' // & |
---|
2509 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2510 | 'lemented for ocean = .FALSE.' |
---|
2511 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
2512 | ELSE |
---|
2513 | dopr_index(i) = 67 |
---|
2514 | dopr_unit(i) = 'psu m/s' |
---|
2515 | hom(:,2,67,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
2516 | ENDIF |
---|
2517 | |
---|
2518 | CASE ( 'w*p*' ) |
---|
2519 | dopr_index(i) = 68 |
---|
2520 | dopr_unit(i) = 'm3/s3' |
---|
2521 | hom(:,2,68,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2522 | |
---|
2523 | CASE ( 'w"e' ) |
---|
2524 | dopr_index(i) = 69 |
---|
2525 | dopr_unit(i) = 'm3/s3' |
---|
2526 | hom(:,2,69,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2527 | |
---|
2528 | CASE ( 'q*2' ) |
---|
2529 | IF ( .NOT. humidity ) THEN |
---|
2530 | message_string = 'data_output_pr = ' // & |
---|
2531 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2532 | 'lemented for humidity = .FALSE.' |
---|
2533 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
2534 | ELSE |
---|
2535 | dopr_index(i) = 70 |
---|
2536 | dopr_unit(i) = 'kg2/kg2' |
---|
2537 | hom(:,2,70,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2538 | ENDIF |
---|
2539 | |
---|
2540 | CASE ( 'prho' ) |
---|
2541 | IF ( .NOT. ocean ) THEN |
---|
2542 | message_string = 'data_output_pr = ' // & |
---|
2543 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2544 | 'lemented for ocean = .FALSE.' |
---|
2545 | CALL message( 'check_parameters', 'PA0091', 1, 2, 0, 6, 0 ) |
---|
2546 | ELSE |
---|
2547 | dopr_index(i) = 71 |
---|
2548 | dopr_unit(i) = 'kg/m3' |
---|
2549 | hom(:,2,71,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2550 | ENDIF |
---|
2551 | |
---|
2552 | CASE ( 'hyp' ) |
---|
2553 | dopr_index(i) = 72 |
---|
2554 | dopr_unit(i) = 'dbar' |
---|
2555 | hom(:,2,72,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2556 | |
---|
2557 | CASE ( 'nr' ) |
---|
2558 | IF ( .NOT. cloud_physics ) THEN |
---|
2559 | message_string = 'data_output_pr = ' // & |
---|
2560 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2561 | 'lemented for cloud_physics = .FALSE.' |
---|
2562 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
2563 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2564 | message_string = 'data_output_pr = ' // & |
---|
2565 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2566 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
2567 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
2568 | ELSEIF ( .NOT. precipitation ) THEN |
---|
2569 | message_string = 'data_output_pr = ' // & |
---|
2570 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2571 | 'lemented for precipitation = .FALSE.' |
---|
2572 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
2573 | ELSE |
---|
2574 | dopr_index(i) = 73 |
---|
2575 | dopr_unit(i) = '1/m3' |
---|
2576 | hom(:,2,73,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2577 | ENDIF |
---|
2578 | |
---|
2579 | CASE ( 'qr' ) |
---|
2580 | IF ( .NOT. cloud_physics ) THEN |
---|
2581 | message_string = 'data_output_pr = ' // & |
---|
2582 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2583 | 'lemented for cloud_physics = .FALSE.' |
---|
2584 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
2585 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2586 | message_string = 'data_output_pr = ' // & |
---|
2587 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2588 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
2589 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
2590 | ELSEIF ( .NOT. precipitation ) THEN |
---|
2591 | message_string = 'data_output_pr = ' // & |
---|
2592 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2593 | 'lemented for precipitation = .FALSE.' |
---|
2594 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
2595 | ELSE |
---|
2596 | dopr_index(i) = 74 |
---|
2597 | dopr_unit(i) = 'kg/kg' |
---|
2598 | hom(:,2,74,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2599 | ENDIF |
---|
2600 | |
---|
2601 | CASE ( 'qc' ) |
---|
2602 | IF ( .NOT. cloud_physics ) THEN |
---|
2603 | message_string = 'data_output_pr = ' // & |
---|
2604 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2605 | 'lemented for cloud_physics = .FALSE.' |
---|
2606 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
2607 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2608 | message_string = 'data_output_pr = ' // & |
---|
2609 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2610 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
2611 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
2612 | ELSE |
---|
2613 | dopr_index(i) = 75 |
---|
2614 | dopr_unit(i) = 'kg/kg' |
---|
2615 | hom(:,2,75,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2616 | ENDIF |
---|
2617 | |
---|
2618 | CASE ( 'prr' ) |
---|
2619 | IF ( .NOT. cloud_physics ) THEN |
---|
2620 | message_string = 'data_output_pr = ' // & |
---|
2621 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2622 | 'lemented for cloud_physics = .FALSE.' |
---|
2623 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
2624 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2625 | message_string = 'data_output_pr = ' // & |
---|
2626 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2627 | 'lemented for cloud_scheme /= seifert_beheng' |
---|
2628 | CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) |
---|
2629 | ELSEIF ( .NOT. precipitation ) THEN |
---|
2630 | message_string = 'data_output_pr = ' // & |
---|
2631 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2632 | 'lemented for precipitation = .FALSE.' |
---|
2633 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
2634 | |
---|
2635 | ELSE |
---|
2636 | dopr_index(i) = 76 |
---|
2637 | dopr_unit(i) = 'kg/kg m/s' |
---|
2638 | hom(:,2,76,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2639 | ENDIF |
---|
2640 | |
---|
2641 | CASE ( 'ug' ) |
---|
2642 | dopr_index(i) = 78 |
---|
2643 | dopr_unit(i) = 'm/s' |
---|
2644 | hom(:,2,78,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2645 | |
---|
2646 | CASE ( 'vg' ) |
---|
2647 | dopr_index(i) = 79 |
---|
2648 | dopr_unit(i) = 'm/s' |
---|
2649 | hom(:,2,79,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2650 | |
---|
2651 | CASE ( 'w_subs' ) |
---|
2652 | IF ( .NOT. large_scale_subsidence ) THEN |
---|
2653 | message_string = 'data_output_pr = ' // & |
---|
2654 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
2655 | 'lemented for large_scale_subsidence = .FALSE.' |
---|
2656 | CALL message( 'check_parameters', 'PA0382', 1, 2, 0, 6, 0 ) |
---|
2657 | ELSE |
---|
2658 | dopr_index(i) = 80 |
---|
2659 | dopr_unit(i) = 'm/s' |
---|
2660 | hom(:,2,80,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
2661 | ENDIF |
---|
2662 | |
---|
2663 | CASE DEFAULT |
---|
2664 | |
---|
2665 | CALL user_check_data_output_pr( data_output_pr(i), i, unit ) |
---|
2666 | |
---|
2667 | IF ( unit == 'illegal' ) THEN |
---|
2668 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
2669 | message_string = 'illegal value for data_output_pr or ' // & |
---|
2670 | 'data_output_pr_user = "' // & |
---|
2671 | TRIM( data_output_pr(i) ) // '"' |
---|
2672 | CALL message( 'check_parameters', 'PA0097', 1, 2, 0, 6, 0 ) |
---|
2673 | ELSE |
---|
2674 | message_string = 'illegal value for data_output_pr = "' // & |
---|
2675 | TRIM( data_output_pr(i) ) // '"' |
---|
2676 | CALL message( 'check_parameters', 'PA0098', 1, 2, 0, 6, 0 ) |
---|
2677 | ENDIF |
---|
2678 | ENDIF |
---|
2679 | |
---|
2680 | END SELECT |
---|
2681 | |
---|
2682 | ENDDO |
---|
2683 | |
---|
2684 | |
---|
2685 | ! |
---|
2686 | !-- Append user-defined data output variables to the standard data output |
---|
2687 | IF ( data_output_user(1) /= ' ' ) THEN |
---|
2688 | i = 1 |
---|
2689 | DO WHILE ( data_output(i) /= ' ' .AND. i <= 100 ) |
---|
2690 | i = i + 1 |
---|
2691 | ENDDO |
---|
2692 | j = 1 |
---|
2693 | DO WHILE ( data_output_user(j) /= ' ' .AND. j <= 100 ) |
---|
2694 | IF ( i > 100 ) THEN |
---|
2695 | message_string = 'number of output quantitities given by data' // & |
---|
2696 | '_output and data_output_user exceeds the limit of 100' |
---|
2697 | CALL message( 'check_parameters', 'PA0102', 1, 2, 0, 6, 0 ) |
---|
2698 | ENDIF |
---|
2699 | data_output(i) = data_output_user(j) |
---|
2700 | i = i + 1 |
---|
2701 | j = j + 1 |
---|
2702 | ENDDO |
---|
2703 | ENDIF |
---|
2704 | |
---|
2705 | ! |
---|
2706 | !-- Check and set steering parameters for 2d/3d data output and averaging |
---|
2707 | i = 1 |
---|
2708 | DO WHILE ( data_output(i) /= ' ' .AND. i <= 100 ) |
---|
2709 | ! |
---|
2710 | !-- Check for data averaging |
---|
2711 | ilen = LEN_TRIM( data_output(i) ) |
---|
2712 | j = 0 ! no data averaging |
---|
2713 | IF ( ilen > 3 ) THEN |
---|
2714 | IF ( data_output(i)(ilen-2:ilen) == '_av' ) THEN |
---|
2715 | j = 1 ! data averaging |
---|
2716 | data_output(i) = data_output(i)(1:ilen-3) |
---|
2717 | ENDIF |
---|
2718 | ENDIF |
---|
2719 | ! |
---|
2720 | !-- Check for cross section or volume data |
---|
2721 | ilen = LEN_TRIM( data_output(i) ) |
---|
2722 | k = 0 ! 3d data |
---|
2723 | var = data_output(i)(1:ilen) |
---|
2724 | IF ( ilen > 3 ) THEN |
---|
2725 | IF ( data_output(i)(ilen-2:ilen) == '_xy' .OR. & |
---|
2726 | data_output(i)(ilen-2:ilen) == '_xz' .OR. & |
---|
2727 | data_output(i)(ilen-2:ilen) == '_yz' ) THEN |
---|
2728 | k = 1 ! 2d data |
---|
2729 | var = data_output(i)(1:ilen-3) |
---|
2730 | ENDIF |
---|
2731 | ENDIF |
---|
2732 | ! |
---|
2733 | !-- Check for allowed value and set units |
---|
2734 | SELECT CASE ( TRIM( var ) ) |
---|
2735 | |
---|
2736 | CASE ( 'e' ) |
---|
2737 | IF ( constant_diffusion ) THEN |
---|
2738 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2739 | 'res constant_diffusion = .FALSE.' |
---|
2740 | CALL message( 'check_parameters', 'PA0103', 1, 2, 0, 6, 0 ) |
---|
2741 | ENDIF |
---|
2742 | unit = 'm2/s2' |
---|
2743 | |
---|
2744 | CASE ( 'lpt' ) |
---|
2745 | IF ( .NOT. cloud_physics ) THEN |
---|
2746 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2747 | 'res cloud_physics = .TRUE.' |
---|
2748 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2749 | ENDIF |
---|
2750 | unit = 'K' |
---|
2751 | |
---|
2752 | CASE ( 'nr' ) |
---|
2753 | IF ( .NOT. cloud_physics ) THEN |
---|
2754 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2755 | 'res cloud_physics = .TRUE.' |
---|
2756 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2757 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2758 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2759 | 'res cloud_scheme = seifert_beheng' |
---|
2760 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
2761 | ENDIF |
---|
2762 | unit = '1/m3' |
---|
2763 | |
---|
2764 | CASE ( 'pc', 'pr' ) |
---|
2765 | IF ( .NOT. particle_advection ) THEN |
---|
2766 | message_string = 'output of "' // TRIM( var ) // '" requir' // & |
---|
2767 | 'es a "particles_par"-NAMELIST in the parameter file (PARIN)' |
---|
2768 | CALL message( 'check_parameters', 'PA0104', 1, 2, 0, 6, 0 ) |
---|
2769 | ENDIF |
---|
2770 | IF ( TRIM( var ) == 'pc' ) unit = 'number' |
---|
2771 | IF ( TRIM( var ) == 'pr' ) unit = 'm' |
---|
2772 | |
---|
2773 | CASE ( 'prr' ) |
---|
2774 | IF ( .NOT. cloud_physics ) THEN |
---|
2775 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2776 | 'res cloud_physics = .TRUE.' |
---|
2777 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2778 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2779 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2780 | 'res cloud_scheme = seifert_beheng' |
---|
2781 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
2782 | ELSEIF ( .NOT. precipitation ) THEN |
---|
2783 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2784 | 'res precipitation = .TRUE.' |
---|
2785 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
2786 | ENDIF |
---|
2787 | unit = 'kg/kg m/s' |
---|
2788 | |
---|
2789 | CASE ( 'q', 'vpt' ) |
---|
2790 | IF ( .NOT. humidity ) THEN |
---|
2791 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2792 | 'res humidity = .TRUE.' |
---|
2793 | CALL message( 'check_parameters', 'PA0105', 1, 2, 0, 6, 0 ) |
---|
2794 | ENDIF |
---|
2795 | IF ( TRIM( var ) == 'q' ) unit = 'kg/kg' |
---|
2796 | IF ( TRIM( var ) == 'vpt' ) unit = 'K' |
---|
2797 | |
---|
2798 | CASE ( 'qc' ) |
---|
2799 | IF ( .NOT. cloud_physics ) THEN |
---|
2800 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2801 | 'res cloud_physics = .TRUE.' |
---|
2802 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2803 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2804 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2805 | 'res cloud_scheme = seifert_beheng' |
---|
2806 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
2807 | ENDIF |
---|
2808 | unit = 'kg/kg' |
---|
2809 | |
---|
2810 | CASE ( 'ql' ) |
---|
2811 | IF ( .NOT. ( cloud_physics .OR. cloud_droplets ) ) THEN |
---|
2812 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2813 | 'res cloud_physics = .TRUE. or cloud_droplets = .TRUE.' |
---|
2814 | CALL message( 'check_parameters', 'PA0106', 1, 2, 0, 6, 0 ) |
---|
2815 | ENDIF |
---|
2816 | unit = 'kg/kg' |
---|
2817 | |
---|
2818 | CASE ( 'ql_c', 'ql_v', 'ql_vp' ) |
---|
2819 | IF ( .NOT. cloud_droplets ) THEN |
---|
2820 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2821 | 'res cloud_droplets = .TRUE.' |
---|
2822 | CALL message( 'check_parameters', 'PA0107', 1, 2, 0, 6, 0 ) |
---|
2823 | ENDIF |
---|
2824 | IF ( TRIM( var ) == 'ql_c' ) unit = 'kg/kg' |
---|
2825 | IF ( TRIM( var ) == 'ql_v' ) unit = 'm3' |
---|
2826 | IF ( TRIM( var ) == 'ql_vp' ) unit = 'none' |
---|
2827 | |
---|
2828 | CASE ( 'qr' ) |
---|
2829 | IF ( .NOT. cloud_physics ) THEN |
---|
2830 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2831 | 'res cloud_physics = .TRUE.' |
---|
2832 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2833 | ELSEIF ( icloud_scheme /= 0 ) THEN |
---|
2834 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2835 | 'res cloud_scheme = seifert_beheng' |
---|
2836 | CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) |
---|
2837 | ELSEIF ( .NOT. precipitation ) THEN |
---|
2838 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2839 | 'res precipitation = .TRUE.' |
---|
2840 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
2841 | ENDIF |
---|
2842 | unit = 'kg/kg' |
---|
2843 | |
---|
2844 | CASE ( 'qv' ) |
---|
2845 | IF ( .NOT. cloud_physics ) THEN |
---|
2846 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2847 | 'res cloud_physics = .TRUE.' |
---|
2848 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2849 | ENDIF |
---|
2850 | unit = 'kg/kg' |
---|
2851 | |
---|
2852 | CASE ( 'rho' ) |
---|
2853 | IF ( .NOT. ocean ) THEN |
---|
2854 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2855 | 'res ocean = .TRUE.' |
---|
2856 | CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 ) |
---|
2857 | ENDIF |
---|
2858 | unit = 'kg/m3' |
---|
2859 | |
---|
2860 | CASE ( 's' ) |
---|
2861 | IF ( .NOT. passive_scalar ) THEN |
---|
2862 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2863 | 'res passive_scalar = .TRUE.' |
---|
2864 | CALL message( 'check_parameters', 'PA0110', 1, 2, 0, 6, 0 ) |
---|
2865 | ENDIF |
---|
2866 | unit = 'conc' |
---|
2867 | |
---|
2868 | CASE ( 'sa' ) |
---|
2869 | IF ( .NOT. ocean ) THEN |
---|
2870 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2871 | 'res ocean = .TRUE.' |
---|
2872 | CALL message( 'check_parameters', 'PA0109', 1, 2, 0, 6, 0 ) |
---|
2873 | ENDIF |
---|
2874 | unit = 'psu' |
---|
2875 | |
---|
2876 | CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'qsws*', 'shf*', 'z0*', 'z0h*' ) |
---|
2877 | IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN |
---|
2878 | message_string = 'illegal value for data_output: "' // & |
---|
2879 | TRIM( var ) // '" & only 2d-horizontal ' // & |
---|
2880 | 'cross sections are allowed for this value' |
---|
2881 | CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 ) |
---|
2882 | ENDIF |
---|
2883 | IF ( TRIM( var ) == 'lwp*' .AND. .NOT. cloud_physics ) THEN |
---|
2884 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2885 | 'res cloud_physics = .TRUE.' |
---|
2886 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
2887 | ENDIF |
---|
2888 | IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN |
---|
2889 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2890 | 'res precipitation = .TRUE.' |
---|
2891 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
2892 | ENDIF |
---|
2893 | IF ( TRIM( var ) == 'pra*' .AND. j == 1 ) THEN |
---|
2894 | message_string = 'temporal averaging of precipitation ' // & |
---|
2895 | 'amount "' // TRIM( var ) // '" is not possible' |
---|
2896 | CALL message( 'check_parameters', 'PA0113', 1, 2, 0, 6, 0 ) |
---|
2897 | ENDIF |
---|
2898 | IF ( TRIM( var ) == 'prr*' .AND. .NOT. precipitation ) THEN |
---|
2899 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2900 | 'res precipitation = .TRUE.' |
---|
2901 | CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) |
---|
2902 | ENDIF |
---|
2903 | IF ( TRIM( var ) == 'qsws*' .AND. .NOT. humidity ) THEN |
---|
2904 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
2905 | 'res humidity = .TRUE.' |
---|
2906 | CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 ) |
---|
2907 | ENDIF |
---|
2908 | |
---|
2909 | IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/kg*m' |
---|
2910 | IF ( TRIM( var ) == 'pra*' ) unit = 'mm' |
---|
2911 | IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s' |
---|
2912 | IF ( TRIM( var ) == 'qsws*' ) unit = 'kgm/kgs' |
---|
2913 | IF ( TRIM( var ) == 'shf*' ) unit = 'K*m/s' |
---|
2914 | IF ( TRIM( var ) == 't*' ) unit = 'K' |
---|
2915 | IF ( TRIM( var ) == 'u*' ) unit = 'm/s' |
---|
2916 | IF ( TRIM( var ) == 'z0*' ) unit = 'm' |
---|
2917 | IF ( TRIM( var ) == 'z0h*' ) unit = 'm' |
---|
2918 | |
---|
2919 | |
---|
2920 | CASE ( 'p', 'pt', 'u', 'v', 'w' ) |
---|
2921 | IF ( TRIM( var ) == 'p' ) unit = 'Pa' |
---|
2922 | IF ( TRIM( var ) == 'pt' ) unit = 'K' |
---|
2923 | IF ( TRIM( var ) == 'u' ) unit = 'm/s' |
---|
2924 | IF ( TRIM( var ) == 'v' ) unit = 'm/s' |
---|
2925 | IF ( TRIM( var ) == 'w' ) unit = 'm/s' |
---|
2926 | CONTINUE |
---|
2927 | |
---|
2928 | CASE DEFAULT |
---|
2929 | CALL user_check_data_output( var, unit ) |
---|
2930 | |
---|
2931 | IF ( unit == 'illegal' ) THEN |
---|
2932 | IF ( data_output_user(1) /= ' ' ) THEN |
---|
2933 | message_string = 'illegal value for data_output or ' // & |
---|
2934 | 'data_output_user = "' // TRIM( data_output(i) ) // '"' |
---|
2935 | CALL message( 'check_parameters', 'PA0114', 1, 2, 0, 6, 0 ) |
---|
2936 | ELSE |
---|
2937 | message_string = 'illegal value for data_output =' // & |
---|
2938 | TRIM( data_output(i) ) // '"' |
---|
2939 | CALL message( 'check_parameters', 'PA0115', 1, 2, 0, 6, 0 ) |
---|
2940 | ENDIF |
---|
2941 | ENDIF |
---|
2942 | |
---|
2943 | END SELECT |
---|
2944 | ! |
---|
2945 | !-- Set the internal steering parameters appropriately |
---|
2946 | IF ( k == 0 ) THEN |
---|
2947 | do3d_no(j) = do3d_no(j) + 1 |
---|
2948 | do3d(j,do3d_no(j)) = data_output(i) |
---|
2949 | do3d_unit(j,do3d_no(j)) = unit |
---|
2950 | ELSE |
---|
2951 | do2d_no(j) = do2d_no(j) + 1 |
---|
2952 | do2d(j,do2d_no(j)) = data_output(i) |
---|
2953 | do2d_unit(j,do2d_no(j)) = unit |
---|
2954 | IF ( data_output(i)(ilen-2:ilen) == '_xy' ) THEN |
---|
2955 | data_output_xy(j) = .TRUE. |
---|
2956 | ENDIF |
---|
2957 | IF ( data_output(i)(ilen-2:ilen) == '_xz' ) THEN |
---|
2958 | data_output_xz(j) = .TRUE. |
---|
2959 | ENDIF |
---|
2960 | IF ( data_output(i)(ilen-2:ilen) == '_yz' ) THEN |
---|
2961 | data_output_yz(j) = .TRUE. |
---|
2962 | ENDIF |
---|
2963 | ENDIF |
---|
2964 | |
---|
2965 | IF ( j == 1 ) THEN |
---|
2966 | ! |
---|
2967 | !-- Check, if variable is already subject to averaging |
---|
2968 | found = .FALSE. |
---|
2969 | DO k = 1, doav_n |
---|
2970 | IF ( TRIM( doav(k) ) == TRIM( var ) ) found = .TRUE. |
---|
2971 | ENDDO |
---|
2972 | |
---|
2973 | IF ( .NOT. found ) THEN |
---|
2974 | doav_n = doav_n + 1 |
---|
2975 | doav(doav_n) = var |
---|
2976 | ENDIF |
---|
2977 | ENDIF |
---|
2978 | |
---|
2979 | i = i + 1 |
---|
2980 | ENDDO |
---|
2981 | |
---|
2982 | ! |
---|
2983 | !-- Averaged 2d or 3d output requires that an averaging interval has been set |
---|
2984 | IF ( doav_n > 0 .AND. averaging_interval == 0.0_wp ) THEN |
---|
2985 | WRITE( message_string, * ) 'output of averaged quantity "', & |
---|
2986 | TRIM( doav(1) ), '_av" requires to set a ', & |
---|
2987 | 'non-zero & averaging interval' |
---|
2988 | CALL message( 'check_parameters', 'PA0323', 1, 2, 0, 6, 0 ) |
---|
2989 | ENDIF |
---|
2990 | |
---|
2991 | ! |
---|
2992 | !-- Check sectional planes and store them in one shared array |
---|
2993 | IF ( ANY( section_xy > nz + 1 ) ) THEN |
---|
2994 | WRITE( message_string, * ) 'section_xy must be <= nz + 1 = ', nz + 1 |
---|
2995 | CALL message( 'check_parameters', 'PA0319', 1, 2, 0, 6, 0 ) |
---|
2996 | ENDIF |
---|
2997 | IF ( ANY( section_xz > ny + 1 ) ) THEN |
---|
2998 | WRITE( message_string, * ) 'section_xz must be <= ny + 1 = ', ny + 1 |
---|
2999 | CALL message( 'check_parameters', 'PA0320', 1, 2, 0, 6, 0 ) |
---|
3000 | ENDIF |
---|
3001 | IF ( ANY( section_yz > nx + 1 ) ) THEN |
---|
3002 | WRITE( message_string, * ) 'section_yz must be <= nx + 1 = ', nx + 1 |
---|
3003 | CALL message( 'check_parameters', 'PA0321', 1, 2, 0, 6, 0 ) |
---|
3004 | ENDIF |
---|
3005 | section(:,1) = section_xy |
---|
3006 | section(:,2) = section_xz |
---|
3007 | section(:,3) = section_yz |
---|
3008 | |
---|
3009 | ! |
---|
3010 | !-- Upper plot limit for 2D vertical sections |
---|
3011 | IF ( z_max_do2d == -1.0_wp ) z_max_do2d = zu(nzt) |
---|
3012 | IF ( z_max_do2d < zu(nzb+1) .OR. z_max_do2d > zu(nzt) ) THEN |
---|
3013 | WRITE( message_string, * ) 'z_max_do2d = ', z_max_do2d, & |
---|
3014 | ' must be >= ', zu(nzb+1), '(zu(nzb+1)) and <= ', zu(nzt), & |
---|
3015 | ' (zu(nzt))' |
---|
3016 | CALL message( 'check_parameters', 'PA0116', 1, 2, 0, 6, 0 ) |
---|
3017 | ENDIF |
---|
3018 | |
---|
3019 | ! |
---|
3020 | !-- Upper plot limit for 3D arrays |
---|
3021 | IF ( nz_do3d == -9999 ) nz_do3d = nzt + 1 |
---|
3022 | |
---|
3023 | ! |
---|
3024 | !-- Set output format string (used in header) |
---|
3025 | SELECT CASE ( netcdf_data_format ) |
---|
3026 | CASE ( 1 ) |
---|
3027 | output_format_netcdf = 'netCDF classic' |
---|
3028 | CASE ( 2 ) |
---|
3029 | output_format_netcdf = 'netCDF 64bit offset' |
---|
3030 | CASE ( 3 ) |
---|
3031 | output_format_netcdf = 'netCDF4/HDF5' |
---|
3032 | CASE ( 4 ) |
---|
3033 | output_format_netcdf = 'netCDF4/HDF5 classic' |
---|
3034 | CASE ( 5 ) |
---|
3035 | output_format_netcdf = 'parallel netCDF4/HDF5' |
---|
3036 | CASE ( 6 ) |
---|
3037 | output_format_netcdf = 'parallel netCDF4/HDF5 classic' |
---|
3038 | |
---|
3039 | END SELECT |
---|
3040 | |
---|
3041 | #if defined( __spectra ) |
---|
3042 | ! |
---|
3043 | !-- Check the number of spectra level to be output |
---|
3044 | i = 1 |
---|
3045 | DO WHILE ( comp_spectra_level(i) /= 999999 .AND. i <= 100 ) |
---|
3046 | i = i + 1 |
---|
3047 | ENDDO |
---|
3048 | i = i - 1 |
---|
3049 | IF ( i == 0 ) THEN |
---|
3050 | WRITE( message_string, * ) 'no spectra levels given' |
---|
3051 | CALL message( 'check_parameters', 'PA0019', 1, 2, 0, 6, 0 ) |
---|
3052 | ENDIF |
---|
3053 | #endif |
---|
3054 | |
---|
3055 | ! |
---|
3056 | !-- Check mask conditions |
---|
3057 | DO mid = 1, max_masks |
---|
3058 | IF ( data_output_masks(mid,1) /= ' ' .OR. & |
---|
3059 | data_output_masks_user(mid,1) /= ' ' ) THEN |
---|
3060 | masks = masks + 1 |
---|
3061 | ENDIF |
---|
3062 | ENDDO |
---|
3063 | |
---|
3064 | IF ( masks < 0 .OR. masks > max_masks ) THEN |
---|
3065 | WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', & |
---|
3066 | '<= ', max_masks, ' (=max_masks)' |
---|
3067 | CALL message( 'check_parameters', 'PA0325', 1, 2, 0, 6, 0 ) |
---|
3068 | ENDIF |
---|
3069 | IF ( masks > 0 ) THEN |
---|
3070 | mask_scale(1) = mask_scale_x |
---|
3071 | mask_scale(2) = mask_scale_y |
---|
3072 | mask_scale(3) = mask_scale_z |
---|
3073 | IF ( ANY( mask_scale <= 0.0_wp ) ) THEN |
---|
3074 | WRITE( message_string, * ) & |
---|
3075 | 'illegal value: mask_scale_x, mask_scale_y and mask_scale_z', & |
---|
3076 | 'must be > 0.0' |
---|
3077 | CALL message( 'check_parameters', 'PA0326', 1, 2, 0, 6, 0 ) |
---|
3078 | ENDIF |
---|
3079 | ! |
---|
3080 | !-- Generate masks for masked data output |
---|
3081 | !-- Parallel netcdf output is not tested so far for masked data, hence |
---|
3082 | !-- netcdf_data_format is switched back to non-paralell output. |
---|
3083 | netcdf_data_format_save = netcdf_data_format |
---|
3084 | IF ( netcdf_data_format > 4 ) THEN |
---|
3085 | IF ( netcdf_data_format == 5 ) netcdf_data_format = 3 |
---|
3086 | IF ( netcdf_data_format == 6 ) netcdf_data_format = 4 |
---|
3087 | message_string = 'netCDF file formats '// & |
---|
3088 | '5 (parallel netCDF 4) and ' // & |
---|
3089 | '6 (parallel netCDF 4 Classic model) '// & |
---|
3090 | '&are currently not supported (not yet tested) ' // & |
---|
3091 | 'for masked data.&Using respective non-parallel' // & |
---|
3092 | ' output for masked data.' |
---|
3093 | CALL message( 'check_parameters', 'PA0383', 0, 0, 0, 6, 0 ) |
---|
3094 | ENDIF |
---|
3095 | CALL init_masks |
---|
3096 | netcdf_data_format = netcdf_data_format_save |
---|
3097 | ENDIF |
---|
3098 | |
---|
3099 | ! |
---|
3100 | !-- Check the NetCDF data format |
---|
3101 | #if ! defined ( __check ) |
---|
3102 | IF ( netcdf_data_format > 2 ) THEN |
---|
3103 | #if defined( __netcdf4 ) |
---|
3104 | CONTINUE |
---|
3105 | #else |
---|
3106 | message_string = 'netCDF: netCDF4 format requested but no ' // & |
---|
3107 | 'cpp-directive __netcdf4 given & switch ' // & |
---|
3108 | 'back to 64-bit offset format' |
---|
3109 | CALL message( 'check_parameters', 'PA0171', 0, 1, 0, 6, 0 ) |
---|
3110 | netcdf_data_format = 2 |
---|
3111 | #endif |
---|
3112 | ENDIF |
---|
3113 | IF ( netcdf_data_format > 4 ) THEN |
---|
3114 | #if defined( __netcdf4 ) && defined( __netcdf4_parallel ) |
---|
3115 | CONTINUE |
---|
3116 | #else |
---|
3117 | message_string = 'netCDF: netCDF4 parallel output requested but no ' // & |
---|
3118 | 'cpp-directive __netcdf4_parallel given & switch ' // & |
---|
3119 | 'back to netCDF4 non-parallel output' |
---|
3120 | CALL message( 'check_parameters', 'PA0099', 0, 1, 0, 6, 0 ) |
---|
3121 | netcdf_data_format = netcdf_data_format - 2 |
---|
3122 | #endif |
---|
3123 | ENDIF |
---|
3124 | #endif |
---|
3125 | |
---|
3126 | ! |
---|
3127 | !-- Calculate fixed number of output time levels for parallel netcdf output. |
---|
3128 | !-- The time dimension has to be defined as limited for parallel output, |
---|
3129 | !-- because otherwise the I/O performance drops significantly. |
---|
3130 | IF ( netcdf_data_format > 4 ) THEN |
---|
3131 | |
---|
3132 | ntdim_3d(0) = INT( ( end_time - skip_time_do3d ) / dt_do3d ) |
---|
3133 | IF ( do3d_at_begin ) ntdim_3d(0) = ntdim_3d(0) + 1 |
---|
3134 | ntdim_3d(1) = INT( ( end_time - skip_time_data_output_av ) & |
---|
3135 | / dt_data_output_av ) |
---|
3136 | ntdim_2d_xy(0) = INT( ( end_time - skip_time_do2d_xy ) / dt_do2d_xy ) |
---|
3137 | ntdim_2d_xz(0) = INT( ( end_time - skip_time_do2d_xz ) / dt_do2d_xz ) |
---|
3138 | ntdim_2d_yz(0) = INT( ( end_time - skip_time_do2d_yz ) / dt_do2d_yz ) |
---|
3139 | IF ( do2d_at_begin ) THEN |
---|
3140 | ntdim_2d_xy(0) = ntdim_2d_xy(0) + 1 |
---|
3141 | ntdim_2d_xz(0) = ntdim_2d_xz(0) + 1 |
---|
3142 | ntdim_2d_yz(0) = ntdim_2d_yz(0) + 1 |
---|
3143 | ENDIF |
---|
3144 | ntdim_2d_xy(1) = ntdim_3d(1) |
---|
3145 | ntdim_2d_xz(1) = ntdim_3d(1) |
---|
3146 | ntdim_2d_yz(1) = ntdim_3d(1) |
---|
3147 | |
---|
3148 | ENDIF |
---|
3149 | |
---|
3150 | #if ! defined( __check ) |
---|
3151 | ! |
---|
3152 | !-- Check netcdf precison |
---|
3153 | ldum = .FALSE. |
---|
3154 | CALL define_netcdf_header( 'ch', ldum, 0 ) |
---|
3155 | #endif |
---|
3156 | ! |
---|
3157 | !-- Check, whether a constant diffusion coefficient shall be used |
---|
3158 | IF ( km_constant /= -1.0_wp ) THEN |
---|
3159 | IF ( km_constant < 0.0_wp ) THEN |
---|
3160 | WRITE( message_string, * ) 'km_constant = ', km_constant, ' < 0.0' |
---|
3161 | CALL message( 'check_parameters', 'PA0121', 1, 2, 0, 6, 0 ) |
---|
3162 | ELSE |
---|
3163 | IF ( prandtl_number < 0.0_wp ) THEN |
---|
3164 | WRITE( message_string, * ) 'prandtl_number = ', prandtl_number, & |
---|
3165 | ' < 0.0' |
---|
3166 | CALL message( 'check_parameters', 'PA0122', 1, 2, 0, 6, 0 ) |
---|
3167 | ENDIF |
---|
3168 | constant_diffusion = .TRUE. |
---|
3169 | |
---|
3170 | IF ( prandtl_layer ) THEN |
---|
3171 | message_string = 'prandtl_layer is not allowed with fixed ' // & |
---|
3172 | 'value of km' |
---|
3173 | CALL message( 'check_parameters', 'PA0123', 1, 2, 0, 6, 0 ) |
---|
3174 | ENDIF |
---|
3175 | ENDIF |
---|
3176 | ENDIF |
---|
3177 | |
---|
3178 | ! |
---|
3179 | !-- In case of non-cyclic lateral boundaries and a damping layer for the |
---|
3180 | !-- potential temperature, check the width of the damping layer |
---|
3181 | IF ( bc_lr /= 'cyclic' ) THEN |
---|
3182 | IF ( pt_damping_width < 0.0_wp .OR. pt_damping_width > REAL( nx * dx ) ) THEN |
---|
3183 | message_string = 'pt_damping_width out of range' |
---|
3184 | CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) |
---|
3185 | ENDIF |
---|
3186 | ENDIF |
---|
3187 | |
---|
3188 | IF ( bc_ns /= 'cyclic' ) THEN |
---|
3189 | IF ( pt_damping_width < 0.0_wp .OR. pt_damping_width > REAL( ny * dy ) ) THEN |
---|
3190 | message_string = 'pt_damping_width out of range' |
---|
3191 | CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) |
---|
3192 | ENDIF |
---|
3193 | ENDIF |
---|
3194 | |
---|
3195 | ! |
---|
3196 | !-- Check value range for rif |
---|
3197 | IF ( rif_min >= rif_max ) THEN |
---|
3198 | WRITE( message_string, * ) 'rif_min = ', rif_min, ' must be less ', & |
---|
3199 | 'than rif_max = ', rif_max |
---|
3200 | CALL message( 'check_parameters', 'PA0125', 1, 2, 0, 6, 0 ) |
---|
3201 | ENDIF |
---|
3202 | |
---|
3203 | ! |
---|
3204 | !-- Determine upper and lower hight level indices for random perturbations |
---|
3205 | IF ( disturbance_level_b == -9999999.9_wp ) THEN |
---|
3206 | IF ( ocean ) THEN |
---|
3207 | disturbance_level_b = zu((nzt*2)/3) |
---|
3208 | disturbance_level_ind_b = ( nzt * 2 ) / 3 |
---|
3209 | ELSE |
---|
3210 | disturbance_level_b = zu(nzb+3) |
---|
3211 | disturbance_level_ind_b = nzb + 3 |
---|
3212 | ENDIF |
---|
3213 | ELSEIF ( disturbance_level_b < zu(3) ) THEN |
---|
3214 | WRITE( message_string, * ) 'disturbance_level_b = ', & |
---|
3215 | disturbance_level_b, ' must be >= ', zu(3), '(zu(3))' |
---|
3216 | CALL message( 'check_parameters', 'PA0126', 1, 2, 0, 6, 0 ) |
---|
3217 | ELSEIF ( disturbance_level_b > zu(nzt-2) ) THEN |
---|
3218 | WRITE( message_string, * ) 'disturbance_level_b = ', & |
---|
3219 | disturbance_level_b, ' must be <= ', zu(nzt-2), '(zu(nzt-2))' |
---|
3220 | CALL message( 'check_parameters', 'PA0127', 1, 2, 0, 6, 0 ) |
---|
3221 | ELSE |
---|
3222 | DO k = 3, nzt-2 |
---|
3223 | IF ( disturbance_level_b <= zu(k) ) THEN |
---|
3224 | disturbance_level_ind_b = k |
---|
3225 | EXIT |
---|
3226 | ENDIF |
---|
3227 | ENDDO |
---|
3228 | ENDIF |
---|
3229 | |
---|
3230 | IF ( disturbance_level_t == -9999999.9_wp ) THEN |
---|
3231 | IF ( ocean ) THEN |
---|
3232 | disturbance_level_t = zu(nzt-3) |
---|
3233 | disturbance_level_ind_t = nzt - 3 |
---|
3234 | ELSE |
---|
3235 | disturbance_level_t = zu(nzt/3) |
---|
3236 | disturbance_level_ind_t = nzt / 3 |
---|
3237 | ENDIF |
---|
3238 | ELSEIF ( disturbance_level_t > zu(nzt-2) ) THEN |
---|
3239 | WRITE( message_string, * ) 'disturbance_level_t = ', & |
---|
3240 | disturbance_level_t, ' must be <= ', zu(nzt-2), '(zu(nzt-2))' |
---|
3241 | CALL message( 'check_parameters', 'PA0128', 1, 2, 0, 6, 0 ) |
---|
3242 | ELSEIF ( disturbance_level_t < disturbance_level_b ) THEN |
---|
3243 | WRITE( message_string, * ) 'disturbance_level_t = ', & |
---|
3244 | disturbance_level_t, ' must be >= disturbance_level_b = ', & |
---|
3245 | disturbance_level_b |
---|
3246 | CALL message( 'check_parameters', 'PA0129', 1, 2, 0, 6, 0 ) |
---|
3247 | ELSE |
---|
3248 | DO k = 3, nzt-2 |
---|
3249 | IF ( disturbance_level_t <= zu(k) ) THEN |
---|
3250 | disturbance_level_ind_t = k |
---|
3251 | EXIT |
---|
3252 | ENDIF |
---|
3253 | ENDDO |
---|
3254 | ENDIF |
---|
3255 | |
---|
3256 | ! |
---|
3257 | !-- Check again whether the levels determined this way are ok. |
---|
3258 | !-- Error may occur at automatic determination and too few grid points in |
---|
3259 | !-- z-direction. |
---|
3260 | IF ( disturbance_level_ind_t < disturbance_level_ind_b ) THEN |
---|
3261 | WRITE( message_string, * ) 'disturbance_level_ind_t = ', & |
---|
3262 | disturbance_level_ind_t, ' must be >= disturbance_level_b = ', & |
---|
3263 | disturbance_level_b |
---|
3264 | CALL message( 'check_parameters', 'PA0130', 1, 2, 0, 6, 0 ) |
---|
3265 | ENDIF |
---|
3266 | |
---|
3267 | ! |
---|
3268 | !-- Determine the horizontal index range for random perturbations. |
---|
3269 | !-- In case of non-cyclic horizontal boundaries, no perturbations are imposed |
---|
3270 | !-- near the inflow and the perturbation area is further limited to ...(1) |
---|
3271 | !-- after the initial phase of the flow. |
---|
3272 | dist_nxl = 0; dist_nxr = nx |
---|
3273 | dist_nys = 0; dist_nyn = ny |
---|
3274 | IF ( bc_lr /= 'cyclic' ) THEN |
---|
3275 | IF ( inflow_disturbance_begin == -1 ) THEN |
---|
3276 | inflow_disturbance_begin = MIN( 10, nx/2 ) |
---|
3277 | ENDIF |
---|
3278 | IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > nx )& |
---|
3279 | THEN |
---|
3280 | message_string = 'inflow_disturbance_begin out of range' |
---|
3281 | CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) |
---|
3282 | ENDIF |
---|
3283 | IF ( inflow_disturbance_end == -1 ) THEN |
---|
3284 | inflow_disturbance_end = MIN( 100, 3*nx/4 ) |
---|
3285 | ENDIF |
---|
3286 | IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > nx ) & |
---|
3287 | THEN |
---|
3288 | message_string = 'inflow_disturbance_end out of range' |
---|
3289 | CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) |
---|
3290 | ENDIF |
---|
3291 | ELSEIF ( bc_ns /= 'cyclic' ) THEN |
---|
3292 | IF ( inflow_disturbance_begin == -1 ) THEN |
---|
3293 | inflow_disturbance_begin = MIN( 10, ny/2 ) |
---|
3294 | ENDIF |
---|
3295 | IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > ny )& |
---|
3296 | THEN |
---|
3297 | message_string = 'inflow_disturbance_begin out of range' |
---|
3298 | CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) |
---|
3299 | ENDIF |
---|
3300 | IF ( inflow_disturbance_end == -1 ) THEN |
---|
3301 | inflow_disturbance_end = MIN( 100, 3*ny/4 ) |
---|
3302 | ENDIF |
---|
3303 | IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > ny ) & |
---|
3304 | THEN |
---|
3305 | message_string = 'inflow_disturbance_end out of range' |
---|
3306 | CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) |
---|
3307 | ENDIF |
---|
3308 | ENDIF |
---|
3309 | |
---|
3310 | IF ( bc_lr == 'radiation/dirichlet' ) THEN |
---|
3311 | dist_nxr = nx - inflow_disturbance_begin |
---|
3312 | dist_nxl(1) = nx - inflow_disturbance_end |
---|
3313 | ELSEIF ( bc_lr == 'dirichlet/radiation' ) THEN |
---|
3314 | dist_nxl = inflow_disturbance_begin |
---|
3315 | dist_nxr(1) = inflow_disturbance_end |
---|
3316 | ENDIF |
---|
3317 | IF ( bc_ns == 'dirichlet/radiation' ) THEN |
---|
3318 | dist_nyn = ny - inflow_disturbance_begin |
---|
3319 | dist_nys(1) = ny - inflow_disturbance_end |
---|
3320 | ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN |
---|
3321 | dist_nys = inflow_disturbance_begin |
---|
3322 | dist_nyn(1) = inflow_disturbance_end |
---|
3323 | ENDIF |
---|
3324 | |
---|
3325 | ! |
---|
3326 | !-- A turbulent inflow requires Dirichlet conditions at the respective inflow |
---|
3327 | !-- boundary (so far, a turbulent inflow is realized from the left side only) |
---|
3328 | IF ( turbulent_inflow .AND. bc_lr /= 'dirichlet/radiation' ) THEN |
---|
3329 | message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // & |
---|
3330 | 'condition at the inflow boundary' |
---|
3331 | CALL message( 'check_parameters', 'PA0133', 1, 2, 0, 6, 0 ) |
---|
3332 | ENDIF |
---|
3333 | |
---|
3334 | ! |
---|
3335 | !-- Turbulent inflow requires that 3d arrays have been cyclically filled with |
---|
3336 | !-- data from prerun in the first main run |
---|
3337 | IF ( turbulent_inflow .AND. initializing_actions /= 'cyclic_fill' .AND. & |
---|
3338 | initializing_actions /= 'read_restart_data' ) THEN |
---|
3339 | message_string = 'turbulent_inflow = .T. requires ' // & |
---|
3340 | 'initializing_actions = ''cyclic_fill'' ' |
---|
3341 | CALL message( 'check_parameters', 'PA0055', 1, 2, 0, 6, 0 ) |
---|
3342 | ENDIF |
---|
3343 | |
---|
3344 | ! |
---|
3345 | !-- In case of turbulent inflow calculate the index of the recycling plane |
---|
3346 | IF ( turbulent_inflow ) THEN |
---|
3347 | IF ( recycling_width == 9999999.9_wp ) THEN |
---|
3348 | ! |
---|
3349 | !-- Set the default value for the width of the recycling domain |
---|
3350 | recycling_width = 0.1_wp * nx * dx |
---|
3351 | ELSE |
---|
3352 | IF ( recycling_width < dx .OR. recycling_width > nx * dx ) THEN |
---|
3353 | WRITE( message_string, * ) 'illegal value for recycling_width:', & |
---|
3354 | ' ', recycling_width |
---|
3355 | CALL message( 'check_parameters', 'PA0134', 1, 2, 0, 6, 0 ) |
---|
3356 | ENDIF |
---|
3357 | ENDIF |
---|
3358 | ! |
---|
3359 | !-- Calculate the index |
---|
3360 | recycling_plane = recycling_width / dx |
---|
3361 | ENDIF |
---|
3362 | |
---|
3363 | ! |
---|
3364 | !-- Check random generator |
---|
3365 | IF ( random_generator /= 'system-specific' .AND. & |
---|
3366 | random_generator /= 'numerical-recipes' ) THEN |
---|
3367 | message_string = 'unknown random generator: random_generator = "' // & |
---|
3368 | TRIM( random_generator ) // '"' |
---|
3369 | CALL message( 'check_parameters', 'PA0135', 1, 2, 0, 6, 0 ) |
---|
3370 | ENDIF |
---|
3371 | |
---|
3372 | ! |
---|
3373 | !-- Determine damping level index for 1D model |
---|
3374 | IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
3375 | IF ( damp_level_1d == -1.0_wp ) THEN |
---|
3376 | damp_level_1d = zu(nzt+1) |
---|
3377 | damp_level_ind_1d = nzt + 1 |
---|
3378 | ELSEIF ( damp_level_1d < 0.0_wp .OR. damp_level_1d > zu(nzt+1) ) THEN |
---|
3379 | WRITE( message_string, * ) 'damp_level_1d = ', damp_level_1d, & |
---|
3380 | ' must be > 0.0 and < ', zu(nzt+1), '(zu(nzt+1))' |
---|
3381 | CALL message( 'check_parameters', 'PA0136', 1, 2, 0, 6, 0 ) |
---|
3382 | ELSE |
---|
3383 | DO k = 1, nzt+1 |
---|
3384 | IF ( damp_level_1d <= zu(k) ) THEN |
---|
3385 | damp_level_ind_1d = k |
---|
3386 | EXIT |
---|
3387 | ENDIF |
---|
3388 | ENDDO |
---|
3389 | ENDIF |
---|
3390 | ENDIF |
---|
3391 | |
---|
3392 | ! |
---|
3393 | !-- Check some other 1d-model parameters |
---|
3394 | IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & |
---|
3395 | TRIM( mixing_length_1d ) /= 'blackadar' ) THEN |
---|
3396 | message_string = 'mixing_length_1d = "' // TRIM( mixing_length_1d ) // & |
---|
3397 | '" is unknown' |
---|
3398 | CALL message( 'check_parameters', 'PA0137', 1, 2, 0, 6, 0 ) |
---|
3399 | ENDIF |
---|
3400 | IF ( TRIM( dissipation_1d ) /= 'as_in_3d_model' .AND. & |
---|
3401 | TRIM( dissipation_1d ) /= 'detering' ) THEN |
---|
3402 | message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & |
---|
3403 | '" is unknown' |
---|
3404 | CALL message( 'check_parameters', 'PA0138', 1, 2, 0, 6, 0 ) |
---|
3405 | ENDIF |
---|
3406 | |
---|
3407 | ! |
---|
3408 | !-- Set time for the next user defined restart (time_restart is the |
---|
3409 | !-- internal parameter for steering restart events) |
---|
3410 | IF ( restart_time /= 9999999.9_wp ) THEN |
---|
3411 | IF ( restart_time > time_since_reference_point ) THEN |
---|
3412 | time_restart = restart_time |
---|
3413 | ENDIF |
---|
3414 | ELSE |
---|
3415 | ! |
---|
3416 | !-- In case of a restart run, set internal parameter to default (no restart) |
---|
3417 | !-- if the NAMELIST-parameter restart_time is omitted |
---|
3418 | time_restart = 9999999.9_wp |
---|
3419 | ENDIF |
---|
3420 | |
---|
3421 | ! |
---|
3422 | !-- Set default value of the time needed to terminate a model run |
---|
3423 | IF ( termination_time_needed == -1.0_wp ) THEN |
---|
3424 | IF ( host(1:3) == 'ibm' ) THEN |
---|
3425 | termination_time_needed = 300.0_wp |
---|
3426 | ELSE |
---|
3427 | termination_time_needed = 35.0_wp |
---|
3428 | ENDIF |
---|
3429 | ENDIF |
---|
3430 | |
---|
3431 | ! |
---|
3432 | !-- Check the time needed to terminate a model run |
---|
3433 | IF ( host(1:3) == 't3e' ) THEN |
---|
3434 | ! |
---|
3435 | !-- Time needed must be at least 30 seconds on all CRAY machines, because |
---|
3436 | !-- MPP_TREMAIN gives the remaining CPU time only in steps of 30 seconds |
---|
3437 | IF ( termination_time_needed <= 30.0_wp ) THEN |
---|
3438 | WRITE( message_string, * ) 'termination_time_needed = ', & |
---|
3439 | termination_time_needed, ' must be > 30.0 on host "', & |
---|
3440 | TRIM( host ), '"' |
---|
3441 | CALL message( 'check_parameters', 'PA0139', 1, 2, 0, 6, 0 ) |
---|
3442 | ENDIF |
---|
3443 | ELSEIF ( host(1:3) == 'ibm' ) THEN |
---|
3444 | ! |
---|
3445 | !-- On IBM-regatta machines the time should be at least 300 seconds, |
---|
3446 | !-- because the job time consumed before executing palm (for compiling, |
---|
3447 | !-- copying of files, etc.) has to be regarded |
---|
3448 | IF ( termination_time_needed < 300.0_wp ) THEN |
---|
3449 | WRITE( message_string, * ) 'termination_time_needed = ', & |
---|
3450 | termination_time_needed, ' should be >= 300.0 on host "', & |
---|
3451 | TRIM( host ), '"' |
---|
3452 | CALL message( 'check_parameters', 'PA0140', 1, 2, 0, 6, 0 ) |
---|
3453 | ENDIF |
---|
3454 | ENDIF |
---|
3455 | |
---|
3456 | ! |
---|
3457 | !-- Check pressure gradient conditions |
---|
3458 | IF ( dp_external .AND. conserve_volume_flow ) THEN |
---|
3459 | WRITE( message_string, * ) 'Both dp_external and conserve_volume_flo', & |
---|
3460 | 'w are .TRUE. but one of them must be .FALSE.' |
---|
3461 | CALL message( 'check_parameters', 'PA0150', 1, 2, 0, 6, 0 ) |
---|
3462 | ENDIF |
---|
3463 | IF ( dp_external ) THEN |
---|
3464 | IF ( dp_level_b < zu(nzb) .OR. dp_level_b > zu(nzt) ) THEN |
---|
3465 | WRITE( message_string, * ) 'dp_level_b = ', dp_level_b, ' is out ', & |
---|
3466 | ' of range' |
---|
3467 | CALL message( 'check_parameters', 'PA0151', 1, 2, 0, 6, 0 ) |
---|
3468 | ENDIF |
---|
3469 | IF ( .NOT. ANY( dpdxy /= 0.0_wp ) ) THEN |
---|
3470 | WRITE( message_string, * ) 'dp_external is .TRUE. but dpdxy is ze', & |
---|
3471 | 'ro, i.e. the external pressure gradient & will not be applied' |
---|
3472 | CALL message( 'check_parameters', 'PA0152', 0, 1, 0, 6, 0 ) |
---|
3473 | ENDIF |
---|
3474 | ENDIF |
---|
3475 | IF ( ANY( dpdxy /= 0.0_wp ) .AND. .NOT. dp_external ) THEN |
---|
3476 | WRITE( message_string, * ) 'dpdxy is nonzero but dp_external is ', & |
---|
3477 | '.FALSE., i.e. the external pressure gradient & will not be applied' |
---|
3478 | CALL message( 'check_parameters', 'PA0153', 0, 1, 0, 6, 0 ) |
---|
3479 | ENDIF |
---|
3480 | IF ( conserve_volume_flow ) THEN |
---|
3481 | IF ( TRIM( conserve_volume_flow_mode ) == 'default' ) THEN |
---|
3482 | |
---|
3483 | conserve_volume_flow_mode = 'initial_profiles' |
---|
3484 | |
---|
3485 | ELSEIF ( TRIM( conserve_volume_flow_mode ) /= 'initial_profiles' .AND. & |
---|
3486 | TRIM( conserve_volume_flow_mode ) /= 'inflow_profile' .AND. & |
---|
3487 | TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) THEN |
---|
3488 | WRITE( message_string, * ) 'unknown conserve_volume_flow_mode: ', & |
---|
3489 | conserve_volume_flow_mode |
---|
3490 | CALL message( 'check_parameters', 'PA0154', 1, 2, 0, 6, 0 ) |
---|
3491 | ENDIF |
---|
3492 | IF ( (bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic') .AND. & |
---|
3493 | TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' ) THEN |
---|
3494 | WRITE( message_string, * ) 'non-cyclic boundary conditions ', & |
---|
3495 | 'require conserve_volume_flow_mode = ''initial_profiles''' |
---|
3496 | CALL message( 'check_parameters', 'PA0155', 1, 2, 0, 6, 0 ) |
---|
3497 | ENDIF |
---|
3498 | IF ( bc_lr == 'cyclic' .AND. bc_ns == 'cyclic' .AND. & |
---|
3499 | TRIM( conserve_volume_flow_mode ) == 'inflow_profile' ) THEN |
---|
3500 | WRITE( message_string, * ) 'cyclic boundary conditions ', & |
---|
3501 | 'require conserve_volume_flow_mode = ''initial_profiles''', & |
---|
3502 | ' or ''bulk_velocity''' |
---|
3503 | CALL message( 'check_parameters', 'PA0156', 1, 2, 0, 6, 0 ) |
---|
3504 | ENDIF |
---|
3505 | ENDIF |
---|
3506 | IF ( ( u_bulk /= 0.0_wp .OR. v_bulk /= 0.0_wp ) .AND. & |
---|
3507 | ( .NOT. conserve_volume_flow .OR. & |
---|
3508 | TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) ) THEN |
---|
3509 | WRITE( message_string, * ) 'nonzero bulk velocity requires ', & |
---|
3510 | 'conserve_volume_flow = .T. and ', & |
---|
3511 | 'conserve_volume_flow_mode = ''bulk_velocity''' |
---|
3512 | CALL message( 'check_parameters', 'PA0157', 1, 2, 0, 6, 0 ) |
---|
3513 | ENDIF |
---|
3514 | |
---|
3515 | ! |
---|
3516 | !-- Check particle attributes |
---|
3517 | IF ( particle_color /= 'none' ) THEN |
---|
3518 | IF ( particle_color /= 'absuv' .AND. particle_color /= 'pt*' .AND. & |
---|
3519 | particle_color /= 'z' ) THEN |
---|
3520 | message_string = 'illegal value for parameter particle_color: ' // & |
---|
3521 | TRIM( particle_color) |
---|
3522 | CALL message( 'check_parameters', 'PA0313', 1, 2, 0, 6, 0 ) |
---|
3523 | ELSE |
---|
3524 | IF ( color_interval(2) <= color_interval(1) ) THEN |
---|
3525 | message_string = 'color_interval(2) <= color_interval(1)' |
---|
3526 | CALL message( 'check_parameters', 'PA0315', 1, 2, 0, 6, 0 ) |
---|
3527 | ENDIF |
---|
3528 | ENDIF |
---|
3529 | ENDIF |
---|
3530 | |
---|
3531 | IF ( particle_dvrpsize /= 'none' ) THEN |
---|
3532 | IF ( particle_dvrpsize /= 'absw' ) THEN |
---|
3533 | message_string = 'illegal value for parameter particle_dvrpsize:' // & |
---|
3534 | ' ' // TRIM( particle_color) |
---|
3535 | CALL message( 'check_parameters', 'PA0314', 1, 2, 0, 6, 0 ) |
---|
3536 | ELSE |
---|
3537 | IF ( dvrpsize_interval(2) <= dvrpsize_interval(1) ) THEN |
---|
3538 | message_string = 'dvrpsize_interval(2) <= dvrpsize_interval(1)' |
---|
3539 | CALL message( 'check_parameters', 'PA0316', 1, 2, 0, 6, 0 ) |
---|
3540 | ENDIF |
---|
3541 | ENDIF |
---|
3542 | ENDIF |
---|
3543 | |
---|
3544 | ! |
---|
3545 | !-- Check nudging and large scale forcing from external file |
---|
3546 | IF ( nudging .AND. ( .NOT. large_scale_forcing ) ) THEN |
---|
3547 | message_string = 'Nudging requires large_scale_forcing = .T.. &'// & |
---|
3548 | 'Surface fluxes and geostrophic wind should be &'// & |
---|
3549 | 'prescribed in file LSF_DATA' |
---|
3550 | CALL message( 'check_parameters', 'PA0374', 1, 2, 0, 6, 0 ) |
---|
3551 | ENDIF |
---|
3552 | |
---|
3553 | IF ( large_scale_forcing .AND. ( bc_lr /= 'cyclic' .OR. & |
---|
3554 | bc_ns /= 'cyclic' ) ) THEN |
---|
3555 | message_string = 'Non-cyclic lateral boundaries do not allow for &' // & |
---|
3556 | 'the usage of large scale forcing from external file.' |
---|
3557 | CALL message( 'check_parameters', 'PA0375', 1, 2, 0, 6, 0 ) |
---|
3558 | ENDIF |
---|
3559 | |
---|
3560 | IF ( large_scale_forcing .AND. ( .NOT. humidity ) ) THEN |
---|
3561 | message_string = 'The usage of large scale forcing from external &'//& |
---|
3562 | 'file LSF_DATA requires humidity = .T..' |
---|
3563 | CALL message( 'check_parameters', 'PA0376', 1, 2, 0, 6, 0 ) |
---|
3564 | ENDIF |
---|
3565 | |
---|
3566 | IF ( large_scale_forcing .AND. topography /= 'flat' ) THEN |
---|
3567 | message_string = 'The usage of large scale forcing from external &'//& |
---|
3568 | 'file LSF_DATA is not implemented for non-flat topography' |
---|
3569 | CALL message( 'check_parameters', 'PA0377', 1, 2, 0, 6, 0 ) |
---|
3570 | ENDIF |
---|
3571 | |
---|
3572 | IF ( large_scale_forcing .AND. ocean ) THEN |
---|
3573 | message_string = 'The usage of large scale forcing from external &'//& |
---|
3574 | 'file LSF_DATA is not implemented for ocean runs' |
---|
3575 | CALL message( 'check_parameters', 'PA0378', 1, 2, 0, 6, 0 ) |
---|
3576 | ENDIF |
---|
3577 | ! |
---|
3578 | !-- Check &userpar parameters |
---|
3579 | CALL user_check_parameters |
---|
3580 | |
---|
3581 | |
---|
3582 | |
---|
3583 | END SUBROUTINE check_parameters |
---|