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