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