1 | !> @file module_interface.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of PALM. |
---|
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 | ! $Id: module_interface.f90 3837 2019-03-28 16:55:58Z knoop $ |
---|
27 | ! bugfix: intent of dummy arguments changed to inout |
---|
28 | ! |
---|
29 | ! 3770 2019-02-28 11:22:32Z moh.hefny |
---|
30 | ! removed unused variables in module_interface_check_data_output_ts |
---|
31 | ! |
---|
32 | ! 3767 08:18:02Z raasch |
---|
33 | ! unused variable file_index removed from subroutine parameter list |
---|
34 | ! |
---|
35 | ! 3766 2019-02-26 16:23:41Z raasch |
---|
36 | ! first argument removed from module_interface_rrd_*, statement added to avoid |
---|
37 | ! compiler warning about unused variable, file reformatted with respect to coding |
---|
38 | ! standards |
---|
39 | ! |
---|
40 | ! 3762 2019-02-25 16:54:16Z suehring |
---|
41 | ! only pass required arguments to surface_data_output_rrd_local |
---|
42 | ! |
---|
43 | ! 3747 2019-02-16 15:15:23Z gronemeier |
---|
44 | ! Call user_init_arrays |
---|
45 | ! |
---|
46 | ! 3745 2019-02-15 18:57:56Z suehring |
---|
47 | ! Add indoor model |
---|
48 | ! |
---|
49 | ! 3744 2019-02-15 18:38:58Z suehring |
---|
50 | ! Removed bio_check_parameters as the method is empty. |
---|
51 | ! |
---|
52 | ! 3735 2019-02-12 09:52:40Z dom_dwd_user |
---|
53 | ! Accepting variable j from check_parameters and passing it to |
---|
54 | ! bio_check_data_output |
---|
55 | ! Add required restart data for surface output module |
---|
56 | ! |
---|
57 | ! 3731 2019-02-11 13:06:27Z suehring |
---|
58 | ! Add check_parameters routine for virtual measurements |
---|
59 | ! |
---|
60 | ! 3711 2019-01-31 13:44:26Z knoop |
---|
61 | ! Introduced module_interface_init_checks for post-init checks |
---|
62 | ! |
---|
63 | ! 3705 2019-01-29 19:56:39Z suehring |
---|
64 | ! Add last_actions for virtual measurements |
---|
65 | ! |
---|
66 | ! 3704 2019-01-29 19:51:41Z suehring |
---|
67 | ! Some interface calls moved to module_interface + cleanup |
---|
68 | ! |
---|
69 | ! 3684 2019-01-20 20:20:58Z knoop |
---|
70 | ! Bugfix: made unit intend INOUT |
---|
71 | ! |
---|
72 | ! 3650 2019-01-04 13:01:33Z kanani |
---|
73 | ! Add restart routines for biometeorology |
---|
74 | ! |
---|
75 | ! 3649 2019-01-02 16:52:21Z suehring |
---|
76 | ! Initialize strings, in order to avoid compiler warnings for non-initialized |
---|
77 | ! characters with intent(out) attribute |
---|
78 | ! |
---|
79 | ! 3648 2019-01-02 16:35:46Z suehring |
---|
80 | ! Rename subroutines for surface-data output |
---|
81 | ! |
---|
82 | ! 3641 2018-12-23 22:10:01Z knoop |
---|
83 | ! Initial implementation of the PALM module interface |
---|
84 | ! |
---|
85 | ! |
---|
86 | ! Description: |
---|
87 | ! ------------ |
---|
88 | !> This is the interface between the PALM model core and all its modules. |
---|
89 | !> |
---|
90 | !> @todo Re-format module to be consistent with coding standard |
---|
91 | !------------------------------------------------------------------------------! |
---|
92 | MODULE module_interface |
---|
93 | |
---|
94 | USE indices, & |
---|
95 | ONLY: nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt |
---|
96 | |
---|
97 | USE kinds |
---|
98 | |
---|
99 | ! |
---|
100 | !-- load module-specific control parameters. |
---|
101 | !-- ToDo: move all of them to respective module or a dedicated central module |
---|
102 | USE control_parameters, & |
---|
103 | ONLY: biometeorology, & |
---|
104 | air_chemistry, & |
---|
105 | indoor_model, & |
---|
106 | land_surface, & |
---|
107 | large_scale_forcing, & |
---|
108 | nesting_offline, & |
---|
109 | nudging, & |
---|
110 | ocean_mode, & |
---|
111 | plant_canopy, & |
---|
112 | salsa, & |
---|
113 | surface_output, & |
---|
114 | syn_turb_gen, & |
---|
115 | urban_surface, & |
---|
116 | virtual_flight, & |
---|
117 | virtual_measurement, & |
---|
118 | wind_turbine |
---|
119 | |
---|
120 | ! |
---|
121 | !-- load interface routines of all PALM modules |
---|
122 | USE biometeorology_mod, & |
---|
123 | ONLY: bio_parin, & |
---|
124 | bio_check_data_output, & |
---|
125 | bio_init, & |
---|
126 | bio_init_checks, & |
---|
127 | bio_header, & |
---|
128 | bio_3d_data_averaging, & |
---|
129 | bio_data_output_2d, & |
---|
130 | bio_data_output_3d, & |
---|
131 | bio_rrd_global, & |
---|
132 | bio_rrd_local, & |
---|
133 | bio_wrd_global, & |
---|
134 | bio_wrd_local |
---|
135 | |
---|
136 | USE bulk_cloud_model_mod, & |
---|
137 | ONLY: bulk_cloud_model, & |
---|
138 | bcm_parin, & |
---|
139 | bcm_check_parameters, & |
---|
140 | bcm_check_data_output_pr, & |
---|
141 | bcm_check_data_output, & |
---|
142 | bcm_init_arrays, & |
---|
143 | bcm_init, & |
---|
144 | bcm_header, & |
---|
145 | bcm_swap_timelevel, & |
---|
146 | bcm_3d_data_averaging, & |
---|
147 | bcm_data_output_2d, & |
---|
148 | bcm_data_output_3d, & |
---|
149 | bcm_rrd_global, & |
---|
150 | bcm_wrd_global, & |
---|
151 | bcm_rrd_local, & |
---|
152 | bcm_wrd_local |
---|
153 | |
---|
154 | USE chemistry_model_mod, & |
---|
155 | ONLY: chem_parin, & |
---|
156 | chem_check_parameters, & |
---|
157 | chem_check_data_output_pr, & |
---|
158 | chem_check_data_output, & |
---|
159 | chem_init_arrays, & |
---|
160 | chem_init, & |
---|
161 | chem_header, & |
---|
162 | chem_swap_timelevel, & |
---|
163 | chem_3d_data_averaging, & |
---|
164 | chem_data_output_2d, & |
---|
165 | chem_data_output_3d, & |
---|
166 | chem_statistics, & |
---|
167 | chem_rrd_local, & |
---|
168 | chem_wrd_local |
---|
169 | |
---|
170 | USE flight_mod, & |
---|
171 | ONLY: flight_parin, & |
---|
172 | flight_header, & |
---|
173 | flight_init, & |
---|
174 | flight_rrd_global, & |
---|
175 | flight_wrd_global |
---|
176 | |
---|
177 | USE gust_mod, & |
---|
178 | ONLY: gust_module_enabled, & |
---|
179 | gust_parin, & |
---|
180 | gust_check_parameters, & |
---|
181 | gust_check_data_output_pr, & |
---|
182 | gust_check_data_output, & |
---|
183 | gust_init_arrays, & |
---|
184 | gust_init, & |
---|
185 | gust_header, & |
---|
186 | gust_actions, & |
---|
187 | gust_prognostic_equations, & |
---|
188 | gust_swap_timelevel, & |
---|
189 | gust_3d_data_averaging, & |
---|
190 | gust_data_output_2d, & |
---|
191 | gust_data_output_3d, & |
---|
192 | gust_statistics, & |
---|
193 | gust_rrd_global, & |
---|
194 | gust_wrd_global, & |
---|
195 | gust_rrd_local, & |
---|
196 | gust_wrd_local |
---|
197 | |
---|
198 | USE indoor_model_mod, & |
---|
199 | ONLY: im_parin, & |
---|
200 | im_check_data_output, & |
---|
201 | im_check_parameters, & |
---|
202 | im_data_output_3d, & |
---|
203 | im_init |
---|
204 | |
---|
205 | USE land_surface_model_mod, & |
---|
206 | ONLY: lsm_parin, & |
---|
207 | lsm_check_parameters, & |
---|
208 | lsm_check_data_output_pr, & |
---|
209 | lsm_check_data_output, & |
---|
210 | lsm_init_arrays, & |
---|
211 | lsm_init, & |
---|
212 | lsm_header, & |
---|
213 | lsm_swap_timelevel, & |
---|
214 | lsm_3d_data_averaging, & |
---|
215 | lsm_data_output_2d, & |
---|
216 | lsm_rrd_local, & |
---|
217 | lsm_wrd_local |
---|
218 | |
---|
219 | USE lsf_nudging_mod, & |
---|
220 | ONLY: lsf_nudging_check_parameters, & |
---|
221 | lsf_nudging_check_data_output_pr, & |
---|
222 | lsf_init, & |
---|
223 | nudge_init, & |
---|
224 | lsf_nudging_header |
---|
225 | |
---|
226 | USE multi_agent_system_mod, & |
---|
227 | ONLY: mas_parin |
---|
228 | |
---|
229 | USE nesting_offl_mod, & |
---|
230 | ONLY: nesting_offl_parin, & |
---|
231 | nesting_offl_check_parameters, & |
---|
232 | nesting_offl_header |
---|
233 | |
---|
234 | USE ocean_mod, & |
---|
235 | ONLY: ocean_parin, & |
---|
236 | ocean_check_parameters, & |
---|
237 | ocean_check_data_output_pr, & |
---|
238 | ocean_check_data_output, & |
---|
239 | ocean_init_arrays, & |
---|
240 | ocean_init, & |
---|
241 | ocean_header, & |
---|
242 | ocean_swap_timelevel, & |
---|
243 | ocean_3d_data_averaging, & |
---|
244 | ocean_data_output_2d, & |
---|
245 | ocean_data_output_3d, & |
---|
246 | ocean_rrd_global, & |
---|
247 | ocean_wrd_global, & |
---|
248 | ocean_rrd_local, & |
---|
249 | ocean_wrd_local |
---|
250 | |
---|
251 | USE plant_canopy_model_mod, & |
---|
252 | ONLY: pcm_parin, & |
---|
253 | pcm_check_parameters, & |
---|
254 | pcm_check_data_output, & |
---|
255 | pcm_init, & |
---|
256 | pcm_header, & |
---|
257 | pcm_data_output_3d |
---|
258 | |
---|
259 | USE radiation_model_mod, & |
---|
260 | ONLY: radiation, & |
---|
261 | radiation_parin, & |
---|
262 | radiation_check_parameters, & |
---|
263 | radiation_check_data_output_ts, & |
---|
264 | radiation_check_data_output_pr, & |
---|
265 | radiation_check_data_output, & |
---|
266 | radiation_init, & |
---|
267 | radiation_header, & |
---|
268 | radiation_3d_data_averaging, & |
---|
269 | radiation_data_output_2d, & |
---|
270 | radiation_data_output_3d, & |
---|
271 | radiation_rrd_local, & |
---|
272 | radiation_wrd_local |
---|
273 | |
---|
274 | USE salsa_mod, & |
---|
275 | ONLY: salsa_parin, & |
---|
276 | salsa_check_parameters, & |
---|
277 | salsa_check_data_output, & |
---|
278 | salsa_init_arrays, & |
---|
279 | salsa_init, & |
---|
280 | salsa_header, & |
---|
281 | salsa_swap_timelevel, & |
---|
282 | salsa_3d_data_averaging, & |
---|
283 | salsa_data_output_2d, & |
---|
284 | salsa_data_output_3d, & |
---|
285 | salsa_rrd_local, & |
---|
286 | salsa_wrd_local |
---|
287 | |
---|
288 | USE spectra_mod, & |
---|
289 | ONLY: calculate_spectra, & |
---|
290 | spectra_parin, & |
---|
291 | spectra_check_parameters, & |
---|
292 | spectra_header |
---|
293 | |
---|
294 | USE surface_data_output_mod, & |
---|
295 | ONLY: surface_data_output_parin, & |
---|
296 | surface_data_output_check_parameters, & |
---|
297 | surface_data_output_init_arrays, & |
---|
298 | surface_data_output_rrd_local, & |
---|
299 | surface_data_output_rrd_global, & |
---|
300 | surface_data_output_wrd_local, & |
---|
301 | surface_data_output_wrd_global |
---|
302 | |
---|
303 | USE synthetic_turbulence_generator_mod, & |
---|
304 | ONLY: stg_parin, & |
---|
305 | stg_check_parameters, & |
---|
306 | stg_header, & |
---|
307 | stg_rrd_global, & |
---|
308 | stg_wrd_global |
---|
309 | |
---|
310 | USE urban_surface_mod, & |
---|
311 | ONLY: usm_parin, & |
---|
312 | usm_check_parameters, & |
---|
313 | usm_check_data_output, & |
---|
314 | usm_init_arrays, & |
---|
315 | usm_init, & |
---|
316 | usm_swap_timelevel, & |
---|
317 | usm_3d_data_averaging, & |
---|
318 | usm_rrd_local, & |
---|
319 | usm_wrd_local |
---|
320 | |
---|
321 | USE user, & |
---|
322 | ONLY: user_module_enabled, & |
---|
323 | user_parin, & |
---|
324 | user_check_parameters, & |
---|
325 | user_check_data_output_ts, & |
---|
326 | user_check_data_output_pr, & |
---|
327 | user_check_data_output, & |
---|
328 | user_init, & |
---|
329 | user_init_arrays, & |
---|
330 | user_header, & |
---|
331 | user_actions, & |
---|
332 | user_3d_data_averaging, & |
---|
333 | user_data_output_2d, & |
---|
334 | user_data_output_3d, & |
---|
335 | user_statistics, & |
---|
336 | user_rrd_global, & |
---|
337 | user_rrd_local, & |
---|
338 | user_wrd_global, & |
---|
339 | user_wrd_local, & |
---|
340 | user_last_actions |
---|
341 | |
---|
342 | USE virtual_measurement_mod, & |
---|
343 | ONLY: vm_check_parameters, & |
---|
344 | vm_init, & |
---|
345 | vm_last_actions, & |
---|
346 | vm_parin |
---|
347 | |
---|
348 | USE wind_turbine_model_mod, & |
---|
349 | ONLY: wtm_parin, & |
---|
350 | wtm_check_parameters, & |
---|
351 | wtm_init_arrays, & |
---|
352 | wtm_init, & |
---|
353 | wtm_rrd_global, & |
---|
354 | wtm_wrd_global |
---|
355 | |
---|
356 | IMPLICIT NONE |
---|
357 | |
---|
358 | PRIVATE |
---|
359 | |
---|
360 | ! |
---|
361 | !-- Public functions |
---|
362 | PUBLIC & |
---|
363 | module_interface_parin, & |
---|
364 | module_interface_check_parameters, & |
---|
365 | module_interface_check_data_output_ts, & |
---|
366 | module_interface_check_data_output_pr, & |
---|
367 | module_interface_check_data_output, & |
---|
368 | module_interface_init_masks, & |
---|
369 | module_interface_define_netcdf_grid, & |
---|
370 | module_interface_init_arrays, & |
---|
371 | module_interface_init, & |
---|
372 | module_interface_init_checks, & |
---|
373 | module_interface_header, & |
---|
374 | module_interface_actions, & |
---|
375 | module_interface_prognostic_equations, & |
---|
376 | module_interface_swap_timelevel, & |
---|
377 | module_interface_3d_data_averaging, & |
---|
378 | module_interface_data_output_2d, & |
---|
379 | module_interface_data_output_3d, & |
---|
380 | module_interface_statistics, & |
---|
381 | module_interface_rrd_global, & |
---|
382 | module_interface_wrd_global, & |
---|
383 | module_interface_rrd_local, & |
---|
384 | module_interface_wrd_local, & |
---|
385 | module_interface_last_actions |
---|
386 | |
---|
387 | |
---|
388 | INTERFACE module_interface_parin |
---|
389 | MODULE PROCEDURE module_interface_parin |
---|
390 | END INTERFACE module_interface_parin |
---|
391 | |
---|
392 | INTERFACE module_interface_check_parameters |
---|
393 | MODULE PROCEDURE module_interface_check_parameters |
---|
394 | END INTERFACE module_interface_check_parameters |
---|
395 | |
---|
396 | INTERFACE module_interface_check_data_output_ts |
---|
397 | MODULE PROCEDURE module_interface_check_data_output_ts |
---|
398 | END INTERFACE module_interface_check_data_output_ts |
---|
399 | |
---|
400 | INTERFACE module_interface_check_data_output_pr |
---|
401 | MODULE PROCEDURE module_interface_check_data_output_pr |
---|
402 | END INTERFACE module_interface_check_data_output_pr |
---|
403 | |
---|
404 | INTERFACE module_interface_check_data_output |
---|
405 | MODULE PROCEDURE module_interface_check_data_output |
---|
406 | END INTERFACE module_interface_check_data_output |
---|
407 | |
---|
408 | INTERFACE module_interface_init_masks |
---|
409 | MODULE PROCEDURE module_interface_init_masks |
---|
410 | END INTERFACE module_interface_init_masks |
---|
411 | |
---|
412 | INTERFACE module_interface_define_netcdf_grid |
---|
413 | MODULE PROCEDURE module_interface_define_netcdf_grid |
---|
414 | END INTERFACE module_interface_define_netcdf_grid |
---|
415 | |
---|
416 | INTERFACE module_interface_init_arrays |
---|
417 | MODULE PROCEDURE module_interface_init_arrays |
---|
418 | END INTERFACE module_interface_init_arrays |
---|
419 | |
---|
420 | INTERFACE module_interface_init |
---|
421 | MODULE PROCEDURE module_interface_init |
---|
422 | END INTERFACE module_interface_init |
---|
423 | |
---|
424 | INTERFACE module_interface_init_checks |
---|
425 | MODULE PROCEDURE module_interface_init_checks |
---|
426 | END INTERFACE module_interface_init_checks |
---|
427 | |
---|
428 | INTERFACE module_interface_header |
---|
429 | MODULE PROCEDURE module_interface_header |
---|
430 | END INTERFACE module_interface_header |
---|
431 | |
---|
432 | INTERFACE module_interface_actions |
---|
433 | MODULE PROCEDURE module_interface_actions |
---|
434 | MODULE PROCEDURE module_interface_actions_ij |
---|
435 | END INTERFACE module_interface_actions |
---|
436 | |
---|
437 | INTERFACE module_interface_prognostic_equations |
---|
438 | MODULE PROCEDURE module_interface_prognostic_equations |
---|
439 | MODULE PROCEDURE module_interface_prognostic_equations_ij |
---|
440 | END INTERFACE module_interface_prognostic_equations |
---|
441 | |
---|
442 | INTERFACE module_interface_swap_timelevel |
---|
443 | MODULE PROCEDURE module_interface_swap_timelevel |
---|
444 | END INTERFACE module_interface_swap_timelevel |
---|
445 | |
---|
446 | INTERFACE module_interface_3d_data_averaging |
---|
447 | MODULE PROCEDURE module_interface_3d_data_averaging |
---|
448 | END INTERFACE module_interface_3d_data_averaging |
---|
449 | |
---|
450 | INTERFACE module_interface_data_output_2d |
---|
451 | MODULE PROCEDURE module_interface_data_output_2d |
---|
452 | END INTERFACE module_interface_data_output_2d |
---|
453 | |
---|
454 | INTERFACE module_interface_data_output_3d |
---|
455 | MODULE PROCEDURE module_interface_data_output_3d |
---|
456 | END INTERFACE module_interface_data_output_3d |
---|
457 | |
---|
458 | INTERFACE module_interface_statistics |
---|
459 | MODULE PROCEDURE module_interface_statistics |
---|
460 | END INTERFACE module_interface_statistics |
---|
461 | |
---|
462 | INTERFACE module_interface_rrd_global |
---|
463 | MODULE PROCEDURE module_interface_rrd_global |
---|
464 | END INTERFACE module_interface_rrd_global |
---|
465 | |
---|
466 | INTERFACE module_interface_wrd_global |
---|
467 | MODULE PROCEDURE module_interface_wrd_global |
---|
468 | END INTERFACE module_interface_wrd_global |
---|
469 | |
---|
470 | INTERFACE module_interface_rrd_local |
---|
471 | MODULE PROCEDURE module_interface_rrd_local |
---|
472 | END INTERFACE module_interface_rrd_local |
---|
473 | |
---|
474 | INTERFACE module_interface_wrd_local |
---|
475 | MODULE PROCEDURE module_interface_wrd_local |
---|
476 | END INTERFACE module_interface_wrd_local |
---|
477 | |
---|
478 | INTERFACE module_interface_last_actions |
---|
479 | MODULE PROCEDURE module_interface_last_actions |
---|
480 | END INTERFACE module_interface_last_actions |
---|
481 | |
---|
482 | |
---|
483 | CONTAINS |
---|
484 | |
---|
485 | |
---|
486 | !------------------------------------------------------------------------------! |
---|
487 | ! Description: |
---|
488 | ! ------------ |
---|
489 | !> Read module-specific parameter namelists |
---|
490 | !------------------------------------------------------------------------------! |
---|
491 | SUBROUTINE module_interface_parin |
---|
492 | |
---|
493 | |
---|
494 | CALL bio_parin |
---|
495 | CALL bcm_parin |
---|
496 | CALL chem_parin |
---|
497 | CALL flight_parin ! ToDo: rename module to match filename |
---|
498 | CALL gust_parin |
---|
499 | CALL im_parin |
---|
500 | CALL lsm_parin |
---|
501 | ! ToDo: create parin routine for large_scale_forcing and nudging (should be seperate modules or new module switch) |
---|
502 | CALL mas_parin |
---|
503 | CALL nesting_offl_parin |
---|
504 | CALL ocean_parin |
---|
505 | CALL pcm_parin |
---|
506 | CALL radiation_parin |
---|
507 | CALL salsa_parin |
---|
508 | CALL spectra_parin |
---|
509 | CALL surface_data_output_parin |
---|
510 | CALL stg_parin |
---|
511 | CALL user_parin ! ToDo: make user code a single Fortran module |
---|
512 | CALL usm_parin |
---|
513 | CALL vm_parin |
---|
514 | CALL wtm_parin |
---|
515 | |
---|
516 | CALL package_parin ! ToDo: deprecated, needs to be dissolved |
---|
517 | |
---|
518 | |
---|
519 | END SUBROUTINE module_interface_parin |
---|
520 | |
---|
521 | |
---|
522 | !------------------------------------------------------------------------------! |
---|
523 | ! Description: |
---|
524 | ! ------------ |
---|
525 | !> Perform module-specific initialization checks |
---|
526 | !------------------------------------------------------------------------------! |
---|
527 | SUBROUTINE module_interface_check_parameters |
---|
528 | |
---|
529 | |
---|
530 | IF ( bulk_cloud_model ) CALL bcm_check_parameters |
---|
531 | IF ( air_chemistry ) CALL chem_check_parameters |
---|
532 | IF ( gust_module_enabled ) CALL gust_check_parameters |
---|
533 | IF ( indoor_model ) CALL im_check_parameters |
---|
534 | IF ( land_surface ) CALL lsm_check_parameters |
---|
535 | IF ( large_scale_forcing .OR. nudging ) CALL lsf_nudging_check_parameters ! ToDo: create single module switch |
---|
536 | IF ( nesting_offline ) CALL nesting_offl_check_parameters |
---|
537 | IF ( ocean_mode ) CALL ocean_check_parameters |
---|
538 | IF ( plant_canopy ) CALL pcm_check_parameters |
---|
539 | IF ( radiation ) CALL radiation_check_parameters |
---|
540 | IF ( salsa ) CALL salsa_check_parameters |
---|
541 | IF ( calculate_spectra ) CALL spectra_check_parameters |
---|
542 | IF ( surface_output ) CALL surface_data_output_check_parameters |
---|
543 | IF ( syn_turb_gen ) CALL stg_check_parameters |
---|
544 | IF ( urban_surface ) CALL usm_check_parameters |
---|
545 | IF ( virtual_measurement ) CALL vm_check_parameters |
---|
546 | IF ( wind_turbine ) CALL wtm_check_parameters |
---|
547 | IF ( user_module_enabled ) CALL user_check_parameters |
---|
548 | |
---|
549 | |
---|
550 | END SUBROUTINE module_interface_check_parameters |
---|
551 | |
---|
552 | |
---|
553 | !------------------------------------------------------------------------------! |
---|
554 | ! Description: |
---|
555 | ! ------------ |
---|
556 | !> Check module-specific data output of timeseries |
---|
557 | !------------------------------------------------------------------------------! |
---|
558 | SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) |
---|
559 | |
---|
560 | |
---|
561 | INTEGER(iwp), INTENT(IN) :: dots_max !< variable output array index |
---|
562 | INTEGER(iwp), INTENT(INOUT) :: dots_num !< variable output array index |
---|
563 | CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label |
---|
564 | CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit |
---|
565 | |
---|
566 | |
---|
567 | IF ( radiation ) THEN |
---|
568 | CALL radiation_check_data_output_ts( dots_max, dots_num ) |
---|
569 | ENDIF |
---|
570 | |
---|
571 | IF ( user_module_enabled ) THEN |
---|
572 | CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) |
---|
573 | ENDIF |
---|
574 | |
---|
575 | |
---|
576 | END SUBROUTINE module_interface_check_data_output_ts |
---|
577 | |
---|
578 | |
---|
579 | !------------------------------------------------------------------------------! |
---|
580 | ! Description: |
---|
581 | ! ------------ |
---|
582 | !> Check module-specific data output of profiles |
---|
583 | !------------------------------------------------------------------------------! |
---|
584 | SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit, & |
---|
585 | dopr_unit ) |
---|
586 | |
---|
587 | |
---|
588 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
589 | INTEGER(iwp), INTENT(IN) :: var_count !< variable output array index |
---|
590 | CHARACTER (LEN=*), INTENT(INOUT) :: unit !< physical unit of variable |
---|
591 | CHARACTER (LEN=*), INTENT(OUT) :: dopr_unit !< local value of dopr_unit |
---|
592 | |
---|
593 | IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN |
---|
594 | CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
595 | ENDIF |
---|
596 | |
---|
597 | IF ( unit == 'illegal' .AND. air_chemistry ) THEN |
---|
598 | CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
599 | ENDIF |
---|
600 | |
---|
601 | IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN |
---|
602 | CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
603 | ENDIF |
---|
604 | |
---|
605 | IF ( unit == 'illegal' ) THEN ! ToDo: add module switch if possible |
---|
606 | CALL lsm_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
607 | ENDIF |
---|
608 | |
---|
609 | IF ( unit == 'illegal' ) THEN ! ToDo: add module switch if possible |
---|
610 | CALL lsf_nudging_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
611 | ENDIF |
---|
612 | |
---|
613 | IF ( unit == 'illegal' .AND. ocean_mode ) THEN |
---|
614 | CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
615 | ENDIF |
---|
616 | |
---|
617 | IF ( unit == 'illegal' .AND. radiation ) THEN |
---|
618 | CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
619 | ENDIF |
---|
620 | |
---|
621 | IF ( unit == 'illegal' .AND. user_module_enabled ) THEN |
---|
622 | unit = '' ! ToDo: Seems like a hack. Find a general soultion! |
---|
623 | CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit ) |
---|
624 | ENDIF |
---|
625 | |
---|
626 | |
---|
627 | END SUBROUTINE module_interface_check_data_output_pr |
---|
628 | |
---|
629 | !------------------------------------------------------------------------------! |
---|
630 | ! Description: |
---|
631 | ! ------------ |
---|
632 | !> Check module-specific 2D and 3D data output |
---|
633 | !------------------------------------------------------------------------------! |
---|
634 | SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k ) |
---|
635 | |
---|
636 | |
---|
637 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
638 | CHARACTER (LEN=*), INTENT(INOUT) :: unit !< physical unit of variable |
---|
639 | |
---|
640 | INTEGER(iwp), INTENT(IN) :: i !< ToDo: remove dummy argument, instead pass string from data_output |
---|
641 | INTEGER(iwp), INTENT(IN) :: j !< average quantity? 0 = no, 1 = yes |
---|
642 | INTEGER(iwp), INTENT(IN) :: ilen !< ToDo: remove dummy argument, instead pass string from data_output |
---|
643 | INTEGER(iwp), INTENT(IN) :: k !< ToDo: remove dummy argument, instead pass string from data_output |
---|
644 | |
---|
645 | IF ( unit == 'illegal' .AND. biometeorology ) THEN |
---|
646 | CALL bio_check_data_output( variable, unit, i, j, ilen, k ) |
---|
647 | ENDIF |
---|
648 | |
---|
649 | IF ( unit == 'illegal' .AND. bulk_cloud_model ) THEN |
---|
650 | CALL bcm_check_data_output( variable, unit ) |
---|
651 | ENDIF |
---|
652 | |
---|
653 | IF ( unit == 'illegal' .AND. air_chemistry & |
---|
654 | .AND. (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') ) THEN ! ToDo: remove aditional conditions |
---|
655 | CALL chem_check_data_output( variable, unit, i, ilen, k ) |
---|
656 | ENDIF |
---|
657 | |
---|
658 | IF ( unit == 'illegal' .AND. gust_module_enabled ) THEN |
---|
659 | CALL gust_check_data_output( variable, unit ) |
---|
660 | ENDIF |
---|
661 | |
---|
662 | IF ( unit == 'illegal' ) THEN ! ToDo: add module switch if possible |
---|
663 | CALL lsm_check_data_output( variable, unit, i, ilen, k ) |
---|
664 | ENDIF |
---|
665 | |
---|
666 | IF ( unit == 'illegal' .AND. ocean_mode ) THEN |
---|
667 | CALL ocean_check_data_output( variable, unit ) |
---|
668 | ENDIF |
---|
669 | |
---|
670 | IF ( unit == 'illegal' .AND. plant_canopy & |
---|
671 | .AND. variable(1:4) == 'pcm_' ) THEN ! ToDo: remove aditional conditions |
---|
672 | CALL pcm_check_data_output( variable, unit ) |
---|
673 | ENDIF |
---|
674 | |
---|
675 | IF ( unit == 'illegal' .AND. radiation ) THEN |
---|
676 | CALL radiation_check_data_output( variable, unit, i, ilen, k ) |
---|
677 | ENDIF |
---|
678 | |
---|
679 | IF ( unit == 'illegal' .AND. salsa ) THEN |
---|
680 | CALL salsa_check_data_output( variable, unit ) |
---|
681 | ENDIF |
---|
682 | |
---|
683 | IF ( unit == 'illegal' .AND. indoor_model ) THEN |
---|
684 | CALL im_check_data_output( variable, unit ) |
---|
685 | ENDIF |
---|
686 | |
---|
687 | IF ( unit == 'illegal' .AND. urban_surface & |
---|
688 | .AND. variable(1:4) == 'usm_' ) THEN ! ToDo: remove aditional conditions |
---|
689 | CALL usm_check_data_output( variable, unit ) |
---|
690 | ENDIF |
---|
691 | |
---|
692 | IF ( unit == 'illegal' .AND. user_module_enabled ) THEN |
---|
693 | unit = '' |
---|
694 | CALL user_check_data_output( variable, unit ) |
---|
695 | ENDIF |
---|
696 | |
---|
697 | |
---|
698 | END SUBROUTINE module_interface_check_data_output |
---|
699 | |
---|
700 | |
---|
701 | !------------------------------------------------------------------------------! |
---|
702 | ! |
---|
703 | ! Description: |
---|
704 | ! ------------ |
---|
705 | !> Interface for init_masks. ToDo: get rid of these redundant calls! |
---|
706 | !------------------------------------------------------------------------------! |
---|
707 | SUBROUTINE module_interface_init_masks( variable, unit ) |
---|
708 | |
---|
709 | |
---|
710 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
711 | CHARACTER (LEN=*), INTENT(INOUT) :: unit !< physical unit of variable |
---|
712 | |
---|
713 | IF ( unit == 'illegal' .AND. air_chemistry & |
---|
714 | .AND. (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') ) THEN ! ToDo: remove aditional conditions |
---|
715 | CALL chem_check_data_output( variable, unit, 0, 0, 0 ) |
---|
716 | ENDIF |
---|
717 | |
---|
718 | IF ( unit == 'illegal' .AND. radiation ) THEN |
---|
719 | CALL radiation_check_data_output( variable, unit, 0, 0, 0 ) |
---|
720 | ENDIF |
---|
721 | |
---|
722 | IF ( unit == 'illegal' .AND. salsa ) THEN |
---|
723 | CALL salsa_check_data_output( variable, unit ) |
---|
724 | ENDIF |
---|
725 | |
---|
726 | IF ( unit == 'illegal' .AND. user_module_enabled ) THEN |
---|
727 | unit = '' |
---|
728 | CALL user_check_data_output( variable, unit ) |
---|
729 | ENDIF |
---|
730 | |
---|
731 | |
---|
732 | END SUBROUTINE module_interface_init_masks |
---|
733 | |
---|
734 | |
---|
735 | !------------------------------------------------------------------------------! |
---|
736 | ! |
---|
737 | ! Description: |
---|
738 | ! ------------ |
---|
739 | !> Define appropriate grid for module-specific netcdf output variables. |
---|
740 | !------------------------------------------------------------------------------! |
---|
741 | SUBROUTINE module_interface_define_netcdf_grid( var, found, & |
---|
742 | grid_x, grid_y, grid_z ) |
---|
743 | |
---|
744 | |
---|
745 | CHARACTER (LEN=*), INTENT(IN) :: var !< variable name |
---|
746 | LOGICAL, INTENT(OUT) :: found !< indicates if variable was found |
---|
747 | CHARACTER (LEN=*), INTENT(OUT) :: grid_x !< netcdf dimension in x-direction |
---|
748 | CHARACTER (LEN=*), INTENT(OUT) :: grid_y !< netcdf dimension in y-direction |
---|
749 | CHARACTER (LEN=*), INTENT(OUT) :: grid_z !< netcdf dimension in z-direction |
---|
750 | ! |
---|
751 | !-- As long as no action is done in this subroutine, initialize strings with |
---|
752 | !-- intent(out) attribute, in order to avoid compiler warnings. |
---|
753 | found = .FALSE. |
---|
754 | grid_x = 'none' |
---|
755 | grid_y = 'none' |
---|
756 | grid_z = 'none' |
---|
757 | ! |
---|
758 | !-- Use var to avoid compiler warning about unused variable |
---|
759 | IF ( var == ' ' ) RETURN |
---|
760 | |
---|
761 | END SUBROUTINE module_interface_define_netcdf_grid |
---|
762 | |
---|
763 | |
---|
764 | !------------------------------------------------------------------------------! |
---|
765 | ! Description: |
---|
766 | ! ------------ |
---|
767 | !> Allocate module-specific arrays and pointers |
---|
768 | !------------------------------------------------------------------------------! |
---|
769 | SUBROUTINE module_interface_init_arrays |
---|
770 | |
---|
771 | |
---|
772 | IF ( bulk_cloud_model ) CALL bcm_init_arrays |
---|
773 | IF ( air_chemistry ) CALL chem_init_arrays |
---|
774 | IF ( gust_module_enabled ) CALL gust_init_arrays |
---|
775 | IF ( land_surface ) CALL lsm_init_arrays |
---|
776 | IF ( ocean_mode ) CALL ocean_init_arrays |
---|
777 | IF ( salsa ) CALL salsa_init_arrays |
---|
778 | IF ( urban_surface ) CALL usm_init_arrays |
---|
779 | IF ( surface_output ) CALL surface_data_output_init_arrays |
---|
780 | IF ( wind_turbine ) CALL wtm_init_arrays |
---|
781 | IF ( user_module_enabled ) CALL user_init_arrays |
---|
782 | |
---|
783 | |
---|
784 | END SUBROUTINE module_interface_init_arrays |
---|
785 | |
---|
786 | |
---|
787 | !------------------------------------------------------------------------------! |
---|
788 | ! Description: |
---|
789 | ! ------------ |
---|
790 | !> Perform module-specific initialization |
---|
791 | !------------------------------------------------------------------------------! |
---|
792 | SUBROUTINE module_interface_init |
---|
793 | |
---|
794 | |
---|
795 | IF ( biometeorology ) CALL bio_init |
---|
796 | IF ( bulk_cloud_model ) CALL bcm_init |
---|
797 | IF ( air_chemistry ) CALL chem_init |
---|
798 | IF ( virtual_flight ) CALL flight_init |
---|
799 | IF ( gust_module_enabled ) CALL gust_init |
---|
800 | IF ( indoor_model ) CALL im_init |
---|
801 | IF ( large_scale_forcing ) CALL lsf_init |
---|
802 | IF ( land_surface ) CALL lsm_init |
---|
803 | IF ( nudging ) CALL nudge_init |
---|
804 | IF ( ocean_mode ) CALL ocean_init |
---|
805 | IF ( plant_canopy ) CALL pcm_init |
---|
806 | IF ( salsa ) CALL salsa_init |
---|
807 | IF ( urban_surface ) CALL usm_init |
---|
808 | IF ( virtual_measurement ) CALL vm_init |
---|
809 | IF ( wind_turbine ) CALL wtm_init |
---|
810 | IF ( radiation ) CALL radiation_init |
---|
811 | IF ( user_module_enabled ) CALL user_init |
---|
812 | |
---|
813 | |
---|
814 | END SUBROUTINE module_interface_init |
---|
815 | |
---|
816 | |
---|
817 | !------------------------------------------------------------------------------! |
---|
818 | ! Description: |
---|
819 | ! ------------ |
---|
820 | !> Perform module-specific post-initialization checks |
---|
821 | !------------------------------------------------------------------------------! |
---|
822 | SUBROUTINE module_interface_init_checks |
---|
823 | |
---|
824 | |
---|
825 | IF ( biometeorology ) CALL bio_init_checks |
---|
826 | |
---|
827 | |
---|
828 | END SUBROUTINE module_interface_init_checks |
---|
829 | |
---|
830 | |
---|
831 | !------------------------------------------------------------------------------! |
---|
832 | ! Description: |
---|
833 | ! ------------ |
---|
834 | !> Gather module-specific header output |
---|
835 | !------------------------------------------------------------------------------! |
---|
836 | SUBROUTINE module_interface_header( io ) |
---|
837 | |
---|
838 | |
---|
839 | INTEGER(iwp), INTENT(IN) :: io !< unit of the output file |
---|
840 | |
---|
841 | |
---|
842 | IF ( biometeorology ) CALL bio_header ( io ) |
---|
843 | IF ( bulk_cloud_model ) CALL bcm_header( io ) |
---|
844 | IF ( air_chemistry ) CALL chem_header ( io ) |
---|
845 | IF ( virtual_flight ) CALL flight_header( io ) |
---|
846 | IF ( gust_module_enabled ) CALL gust_header( io ) |
---|
847 | IF ( land_surface ) CALL lsm_header( io ) |
---|
848 | IF ( large_scale_forcing ) CALL lsf_nudging_header( io ) |
---|
849 | IF ( nesting_offline ) CALL nesting_offl_header( io ) |
---|
850 | IF ( ocean_mode ) CALL ocean_header( io ) |
---|
851 | IF ( plant_canopy ) CALL pcm_header( io ) |
---|
852 | IF ( radiation ) CALL radiation_header( io ) |
---|
853 | IF ( salsa ) CALL salsa_header( io ) |
---|
854 | IF ( calculate_spectra ) CALL spectra_header( io ) |
---|
855 | IF ( syn_turb_gen ) CALL stg_header( io ) |
---|
856 | IF ( user_module_enabled ) CALL user_header( io ) |
---|
857 | |
---|
858 | |
---|
859 | END SUBROUTINE module_interface_header |
---|
860 | |
---|
861 | |
---|
862 | !------------------------------------------------------------------------------! |
---|
863 | ! Description: |
---|
864 | ! ------------ |
---|
865 | !> Perform module-specific actions while in time-integration (cache-optimized) |
---|
866 | !------------------------------------------------------------------------------! |
---|
867 | SUBROUTINE module_interface_actions( location ) |
---|
868 | |
---|
869 | |
---|
870 | CHARACTER (LEN=*), INTENT(IN) :: location !< call location string |
---|
871 | |
---|
872 | |
---|
873 | IF ( gust_module_enabled ) CALL gust_actions( location ) |
---|
874 | IF ( user_module_enabled ) CALL user_actions( location ) |
---|
875 | |
---|
876 | |
---|
877 | END SUBROUTINE module_interface_actions |
---|
878 | |
---|
879 | |
---|
880 | !------------------------------------------------------------------------------! |
---|
881 | ! Description: |
---|
882 | ! ------------ |
---|
883 | !> Perform module-specific actions while in time-integration (vector-optimized) |
---|
884 | !------------------------------------------------------------------------------! |
---|
885 | SUBROUTINE module_interface_actions_ij( i, j, location ) |
---|
886 | |
---|
887 | |
---|
888 | INTEGER(iwp), INTENT(IN) :: i !< grid index in x-direction |
---|
889 | INTEGER(iwp), INTENT(IN) :: j !< grid index in y-direction |
---|
890 | CHARACTER (LEN=*), INTENT(IN) :: location !< call location string |
---|
891 | |
---|
892 | |
---|
893 | IF ( gust_module_enabled ) CALL gust_actions( i, j, location ) |
---|
894 | IF ( user_module_enabled ) CALL user_actions( i, j, location ) |
---|
895 | |
---|
896 | |
---|
897 | END SUBROUTINE module_interface_actions_ij |
---|
898 | |
---|
899 | |
---|
900 | !------------------------------------------------------------------------------! |
---|
901 | ! Description: |
---|
902 | ! ------------ |
---|
903 | !> Compute module-specific prognostic_equations (cache-optimized) |
---|
904 | !------------------------------------------------------------------------------! |
---|
905 | SUBROUTINE module_interface_prognostic_equations() |
---|
906 | |
---|
907 | |
---|
908 | IF ( gust_module_enabled ) CALL gust_prognostic_equations() |
---|
909 | |
---|
910 | |
---|
911 | END SUBROUTINE module_interface_prognostic_equations |
---|
912 | |
---|
913 | |
---|
914 | !------------------------------------------------------------------------------! |
---|
915 | ! Description: |
---|
916 | ! ------------ |
---|
917 | !> Compute module-specific prognostic_equations (vector-optimized) |
---|
918 | !------------------------------------------------------------------------------! |
---|
919 | SUBROUTINE module_interface_prognostic_equations_ij( i, j, i_omp_start, tn ) |
---|
920 | |
---|
921 | |
---|
922 | INTEGER(iwp), INTENT(IN) :: i !< grid index in x-direction |
---|
923 | INTEGER(iwp), INTENT(IN) :: j !< grid index in y-direction |
---|
924 | INTEGER(iwp), INTENT(IN) :: i_omp_start !< first loop index of i-loop in prognostic_equations |
---|
925 | INTEGER(iwp), INTENT(IN) :: tn !< task number of openmp task |
---|
926 | |
---|
927 | |
---|
928 | IF ( gust_module_enabled ) CALL gust_prognostic_equations( i, j, i_omp_start, tn ) |
---|
929 | |
---|
930 | |
---|
931 | END SUBROUTINE module_interface_prognostic_equations_ij |
---|
932 | |
---|
933 | |
---|
934 | !------------------------------------------------------------------------------! |
---|
935 | ! Description: |
---|
936 | ! ------------ |
---|
937 | !> Swap the timelevel pointers for module-specific arrays |
---|
938 | !------------------------------------------------------------------------------! |
---|
939 | SUBROUTINE module_interface_swap_timelevel ( swap_mode ) |
---|
940 | |
---|
941 | |
---|
942 | INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap |
---|
943 | |
---|
944 | IF ( bulk_cloud_model ) CALL bcm_swap_timelevel( swap_mode ) |
---|
945 | IF ( air_chemistry ) CALL chem_swap_timelevel( swap_mode ) |
---|
946 | IF ( gust_module_enabled ) CALL gust_swap_timelevel( swap_mode ) |
---|
947 | IF ( land_surface ) CALL lsm_swap_timelevel( swap_mode ) |
---|
948 | IF ( ocean_mode ) CALL ocean_swap_timelevel( swap_mode ) |
---|
949 | IF ( salsa ) CALL salsa_swap_timelevel( swap_mode ) |
---|
950 | IF ( urban_surface ) CALL usm_swap_timelevel( swap_mode ) |
---|
951 | |
---|
952 | |
---|
953 | END SUBROUTINE module_interface_swap_timelevel |
---|
954 | |
---|
955 | |
---|
956 | !------------------------------------------------------------------------------! |
---|
957 | ! |
---|
958 | ! Description: |
---|
959 | ! ------------ |
---|
960 | !> Perform module-specific averaging of 3D data |
---|
961 | !------------------------------------------------------------------------------! |
---|
962 | SUBROUTINE module_interface_3d_data_averaging( mode, variable ) |
---|
963 | |
---|
964 | |
---|
965 | CHARACTER (LEN=*), INTENT(IN) :: mode !< averaging interface mode |
---|
966 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
967 | |
---|
968 | IF ( biometeorology ) CALL bio_3d_data_averaging( mode, variable ) |
---|
969 | IF ( bulk_cloud_model ) CALL bcm_3d_data_averaging( mode, variable ) |
---|
970 | IF ( air_chemistry ) CALL chem_3d_data_averaging( mode, variable ) |
---|
971 | IF ( gust_module_enabled ) CALL gust_3d_data_averaging( mode, variable ) |
---|
972 | IF ( land_surface ) CALL lsm_3d_data_averaging( mode, variable ) |
---|
973 | IF ( ocean_mode ) CALL ocean_3d_data_averaging( mode, variable ) |
---|
974 | IF ( radiation ) CALL radiation_3d_data_averaging( mode, variable ) |
---|
975 | IF ( salsa ) CALL salsa_3d_data_averaging( mode, variable ) |
---|
976 | IF ( urban_surface ) CALL usm_3d_data_averaging( mode, variable ) |
---|
977 | IF ( user_module_enabled ) CALL user_3d_data_averaging( mode, variable ) |
---|
978 | |
---|
979 | |
---|
980 | END SUBROUTINE module_interface_3d_data_averaging |
---|
981 | |
---|
982 | !------------------------------------------------------------------------------! |
---|
983 | ! |
---|
984 | ! Description: |
---|
985 | ! ------------ |
---|
986 | !> Define module-specific 2D output variables |
---|
987 | !------------------------------------------------------------------------------! |
---|
988 | SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode, & |
---|
989 | local_pf, two_d, nzb_do, nzt_do, & |
---|
990 | fill_value ) |
---|
991 | |
---|
992 | INTEGER(iwp), INTENT(IN) :: av !< flag for (non-)average output |
---|
993 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
994 | LOGICAL, INTENT(INOUT) :: found !< flag if output variable is found |
---|
995 | CHARACTER (LEN=*), INTENT(INOUT) :: grid !< name of vertical grid |
---|
996 | CHARACTER (LEN=*), INTENT(IN) :: mode !< either 'xy', 'xz' or 'yz' |
---|
997 | LOGICAL, INTENT(OUT) :: two_d !< flag for 2D variables |
---|
998 | INTEGER(iwp), INTENT(IN) :: nzb_do !< vertical output index (bottom) (usually 0) |
---|
999 | INTEGER(iwp), INTENT(IN) :: nzt_do !< vertical output index (top) (usually nz_do3d) |
---|
1000 | REAL(wp), INTENT(IN) :: fill_value !< to be removed |
---|
1001 | |
---|
1002 | REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) :: local_pf !< ToDo: can also be kind=sp |
---|
1003 | |
---|
1004 | |
---|
1005 | IF ( .NOT. found .AND. biometeorology ) THEN |
---|
1006 | CALL bio_data_output_2d( & |
---|
1007 | av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do & |
---|
1008 | ) |
---|
1009 | ENDIF |
---|
1010 | |
---|
1011 | IF ( .NOT. found .AND. bulk_cloud_model ) THEN |
---|
1012 | CALL bcm_data_output_2d( & |
---|
1013 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do& |
---|
1014 | ) |
---|
1015 | ENDIF |
---|
1016 | |
---|
1017 | IF ( .NOT. found .AND. air_chemistry ) THEN |
---|
1018 | CALL chem_data_output_2d( & |
---|
1019 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value & |
---|
1020 | ) |
---|
1021 | ENDIF |
---|
1022 | |
---|
1023 | IF ( .NOT. found .AND. gust_module_enabled ) THEN |
---|
1024 | CALL gust_data_output_2d( & |
---|
1025 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value & |
---|
1026 | ) |
---|
1027 | ENDIF |
---|
1028 | |
---|
1029 | IF ( .NOT. found .AND. land_surface ) THEN |
---|
1030 | CALL lsm_data_output_2d( & |
---|
1031 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do& |
---|
1032 | ) |
---|
1033 | ENDIF |
---|
1034 | |
---|
1035 | IF ( .NOT. found .AND. ocean_mode ) THEN |
---|
1036 | CALL ocean_data_output_2d( & |
---|
1037 | av, variable, found, grid, mode, local_pf, nzb_do, nzt_do & |
---|
1038 | ) |
---|
1039 | ENDIF |
---|
1040 | |
---|
1041 | IF ( .NOT. found .AND. radiation ) THEN |
---|
1042 | CALL radiation_data_output_2d( & |
---|
1043 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do& |
---|
1044 | ) |
---|
1045 | ENDIF |
---|
1046 | |
---|
1047 | IF ( .NOT. found .AND. salsa ) THEN |
---|
1048 | CALL salsa_data_output_2d( & |
---|
1049 | av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do& |
---|
1050 | ) |
---|
1051 | ENDIF |
---|
1052 | |
---|
1053 | IF ( .NOT. found .AND. user_module_enabled ) THEN |
---|
1054 | CALL user_data_output_2d( & |
---|
1055 | av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do & |
---|
1056 | ) |
---|
1057 | ENDIF |
---|
1058 | |
---|
1059 | END SUBROUTINE module_interface_data_output_2d |
---|
1060 | |
---|
1061 | |
---|
1062 | !------------------------------------------------------------------------------! |
---|
1063 | ! |
---|
1064 | ! Description: |
---|
1065 | ! ------------ |
---|
1066 | !> Define module-specific 3D output variables |
---|
1067 | !------------------------------------------------------------------------------! |
---|
1068 | SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf, & |
---|
1069 | fill_value, resorted, nzb_do, nzt_do ) |
---|
1070 | |
---|
1071 | |
---|
1072 | INTEGER(iwp), INTENT(IN) :: av !< flag for (non-)average output |
---|
1073 | CHARACTER (LEN=*), INTENT(IN) :: variable !< variable name |
---|
1074 | LOGICAL, INTENT(INOUT) :: found !< flag if output variable is found |
---|
1075 | REAL(wp), INTENT(IN) :: fill_value !< ToDo: refactor |
---|
1076 | LOGICAL, INTENT(OUT) :: resorted !< flag if output has been resorted |
---|
1077 | INTEGER(iwp), INTENT(IN) :: nzb_do !< vertical output index (bottom) (usually 0) |
---|
1078 | INTEGER(iwp), INTENT(IN) :: nzt_do !< vertical output index (top) (usually nz_do3d) |
---|
1079 | |
---|
1080 | REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) :: local_pf |
---|
1081 | |
---|
1082 | |
---|
1083 | IF ( .NOT. found .AND. biometeorology ) THEN |
---|
1084 | CALL bio_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1085 | resorted = .FALSE. |
---|
1086 | ENDIF |
---|
1087 | |
---|
1088 | IF ( .NOT. found .AND. bulk_cloud_model ) THEN |
---|
1089 | CALL bcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1090 | resorted = .TRUE. |
---|
1091 | ENDIF |
---|
1092 | |
---|
1093 | IF ( .NOT. found .AND. air_chemistry ) THEN |
---|
1094 | CALL chem_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1095 | resorted = .TRUE. |
---|
1096 | ENDIF |
---|
1097 | |
---|
1098 | IF ( .NOT. found .AND. gust_module_enabled ) THEN |
---|
1099 | CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1100 | resorted = .TRUE. |
---|
1101 | ENDIF |
---|
1102 | |
---|
1103 | IF ( .NOT. found .AND. indoor_model ) THEN |
---|
1104 | CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1105 | resorted = .TRUE. |
---|
1106 | ENDIF |
---|
1107 | |
---|
1108 | IF ( .NOT. found .AND. ocean_mode ) THEN |
---|
1109 | CALL ocean_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1110 | resorted = .TRUE. |
---|
1111 | ENDIF |
---|
1112 | |
---|
1113 | IF ( .NOT. found .AND. plant_canopy ) THEN |
---|
1114 | CALL pcm_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do ) |
---|
1115 | resorted = .TRUE. |
---|
1116 | ENDIF |
---|
1117 | |
---|
1118 | IF ( .NOT. found .AND. radiation ) THEN |
---|
1119 | CALL radiation_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1120 | resorted = .TRUE. |
---|
1121 | ENDIF |
---|
1122 | |
---|
1123 | IF ( .NOT. found .AND. salsa ) THEN |
---|
1124 | CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1125 | resorted = .TRUE. |
---|
1126 | ENDIF |
---|
1127 | |
---|
1128 | IF ( .NOT. found .AND. user_module_enabled ) THEN |
---|
1129 | CALL user_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do ) |
---|
1130 | resorted = .TRUE. |
---|
1131 | ENDIF |
---|
1132 | |
---|
1133 | |
---|
1134 | END SUBROUTINE module_interface_data_output_3d |
---|
1135 | |
---|
1136 | |
---|
1137 | !------------------------------------------------------------------------------! |
---|
1138 | ! Description: |
---|
1139 | ! ------------ |
---|
1140 | !> Compute module-specific profile and timeseries data |
---|
1141 | !------------------------------------------------------------------------------! |
---|
1142 | SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max ) |
---|
1143 | |
---|
1144 | |
---|
1145 | CHARACTER (LEN=*), INTENT(IN) :: mode !< statistical analysis mode |
---|
1146 | INTEGER(iwp), INTENT(IN) :: sr !< |
---|
1147 | INTEGER(iwp), INTENT(IN) :: tn !< |
---|
1148 | INTEGER(iwp), INTENT(IN) :: dots_max !< maximum number of timeseries |
---|
1149 | |
---|
1150 | IF ( gust_module_enabled ) CALL gust_statistics( mode, sr, tn, dots_max ) |
---|
1151 | IF ( air_chemistry ) CALL chem_statistics( mode, sr, tn ) |
---|
1152 | IF ( user_module_enabled ) CALL user_statistics( mode, sr, tn ) |
---|
1153 | |
---|
1154 | |
---|
1155 | END SUBROUTINE module_interface_statistics |
---|
1156 | |
---|
1157 | |
---|
1158 | !------------------------------------------------------------------------------! |
---|
1159 | ! Description: |
---|
1160 | ! ------------ |
---|
1161 | !> Read module-specific restart data globaly shared by all MPI ranks |
---|
1162 | !------------------------------------------------------------------------------! |
---|
1163 | SUBROUTINE module_interface_rrd_global( found ) |
---|
1164 | |
---|
1165 | |
---|
1166 | LOGICAL, INTENT(INOUT) :: found !< flag if variable was found |
---|
1167 | |
---|
1168 | IF ( .NOT. found ) CALL bio_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1169 | IF ( .NOT. found ) CALL bcm_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1170 | IF ( .NOT. found ) CALL flight_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1171 | IF ( .NOT. found ) CALL gust_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1172 | IF ( .NOT. found ) CALL ocean_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1173 | IF ( .NOT. found ) CALL stg_rrd_global ( found ) ! ToDo: change interface to pass variable |
---|
1174 | IF ( .NOT. found ) CALL wtm_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1175 | IF ( .NOT. found ) CALL surface_data_output_rrd_global( found ) |
---|
1176 | IF ( .NOT. found ) CALL user_rrd_global( found ) ! ToDo: change interface to pass variable |
---|
1177 | |
---|
1178 | |
---|
1179 | END SUBROUTINE module_interface_rrd_global |
---|
1180 | |
---|
1181 | |
---|
1182 | !------------------------------------------------------------------------------! |
---|
1183 | ! Description: |
---|
1184 | ! ------------ |
---|
1185 | !> Write module-specific restart data globaly shared by all MPI ranks |
---|
1186 | !------------------------------------------------------------------------------! |
---|
1187 | SUBROUTINE module_interface_wrd_global |
---|
1188 | |
---|
1189 | |
---|
1190 | IF ( biometeorology ) CALL bio_wrd_global |
---|
1191 | IF ( bulk_cloud_model ) CALL bcm_wrd_global |
---|
1192 | IF ( virtual_flight ) CALL flight_wrd_global |
---|
1193 | IF ( gust_module_enabled ) CALL gust_wrd_global |
---|
1194 | IF ( ocean_mode ) CALL ocean_wrd_global |
---|
1195 | IF ( syn_turb_gen ) CALL stg_wrd_global |
---|
1196 | IF ( wind_turbine ) CALL wtm_wrd_global |
---|
1197 | IF ( surface_output ) CALL surface_data_output_wrd_global |
---|
1198 | IF ( user_module_enabled ) CALL user_wrd_global |
---|
1199 | |
---|
1200 | |
---|
1201 | END SUBROUTINE module_interface_wrd_global |
---|
1202 | |
---|
1203 | |
---|
1204 | !------------------------------------------------------------------------------! |
---|
1205 | ! Description: |
---|
1206 | ! ------------ |
---|
1207 | !> Read module-specific restart data specific to local MPI ranks |
---|
1208 | !------------------------------------------------------------------------------! |
---|
1209 | SUBROUTINE module_interface_rrd_local( map_index, & |
---|
1210 | nxlf, nxlc, nxl_on_file, & |
---|
1211 | nxrf, nxrc, nxr_on_file, & |
---|
1212 | nynf, nync, nyn_on_file, & |
---|
1213 | nysf, nysc, nys_on_file, & |
---|
1214 | tmp_2d, tmp_3d, found ) |
---|
1215 | |
---|
1216 | |
---|
1217 | INTEGER(iwp), INTENT(IN) :: map_index !< |
---|
1218 | INTEGER(iwp), INTENT(IN) :: nxlc !< |
---|
1219 | INTEGER(iwp), INTENT(IN) :: nxlf !< |
---|
1220 | INTEGER(iwp), INTENT(IN) :: nxl_on_file !< |
---|
1221 | INTEGER(iwp), INTENT(IN) :: nxrc !< |
---|
1222 | INTEGER(iwp), INTENT(IN) :: nxrf !< |
---|
1223 | INTEGER(iwp), INTENT(IN) :: nxr_on_file !< |
---|
1224 | INTEGER(iwp), INTENT(IN) :: nync !< |
---|
1225 | INTEGER(iwp), INTENT(IN) :: nynf !< |
---|
1226 | INTEGER(iwp), INTENT(IN) :: nyn_on_file !< |
---|
1227 | INTEGER(iwp), INTENT(IN) :: nysc !< |
---|
1228 | INTEGER(iwp), INTENT(IN) :: nysf !< |
---|
1229 | INTEGER(iwp), INTENT(IN) :: nys_on_file !< |
---|
1230 | LOGICAL, INTENT(INOUT) :: found !< flag if variable was found |
---|
1231 | |
---|
1232 | REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_2d !< |
---|
1233 | REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_3d !< |
---|
1234 | |
---|
1235 | |
---|
1236 | IF ( .NOT. found ) CALL bio_rrd_local( & |
---|
1237 | found & |
---|
1238 | ) |
---|
1239 | |
---|
1240 | IF ( .NOT. found ) CALL bcm_rrd_local( & |
---|
1241 | map_index, & |
---|
1242 | nxlf, nxlc, nxl_on_file, & |
---|
1243 | nxrf, nxrc, nxr_on_file, & |
---|
1244 | nynf, nync, nyn_on_file, & |
---|
1245 | nysf, nysc, nys_on_file, & |
---|
1246 | tmp_2d, tmp_3d, found & |
---|
1247 | ) ! ToDo: change interface to pass variable |
---|
1248 | |
---|
1249 | IF ( .NOT. found ) CALL chem_rrd_local( & |
---|
1250 | map_index, & |
---|
1251 | nxlf, nxlc, nxl_on_file, & |
---|
1252 | nxrf, nxrc, nxr_on_file, & |
---|
1253 | nynf, nync, nyn_on_file, & |
---|
1254 | nysf, nysc, nys_on_file, & |
---|
1255 | tmp_3d, found & |
---|
1256 | ) ! ToDo: change interface to pass variable |
---|
1257 | |
---|
1258 | IF ( .NOT. found ) CALL gust_rrd_local( & |
---|
1259 | map_index, & |
---|
1260 | nxlf, nxlc, nxl_on_file, & |
---|
1261 | nxrf, nxrc, nxr_on_file, & |
---|
1262 | nynf, nync, nyn_on_file, & |
---|
1263 | nysf, nysc, nys_on_file, & |
---|
1264 | tmp_2d, tmp_3d, found & |
---|
1265 | ) ! ToDo: change interface to pass variable |
---|
1266 | |
---|
1267 | IF ( .NOT. found ) CALL lsm_rrd_local( & |
---|
1268 | map_index, & |
---|
1269 | nxlf, nxlc, nxl_on_file, & |
---|
1270 | nxrf, nxrc, nxr_on_file, & |
---|
1271 | nynf, nync, nyn_on_file, & |
---|
1272 | nysf, nysc, nys_on_file, & |
---|
1273 | tmp_2d, found & |
---|
1274 | ) ! ToDo: change interface to pass variable |
---|
1275 | |
---|
1276 | IF ( .NOT. found ) CALL ocean_rrd_local( & |
---|
1277 | map_index, & |
---|
1278 | nxlf, nxlc, nxl_on_file, & |
---|
1279 | nxrf, nxrc, nxr_on_file, & |
---|
1280 | nynf, nync, nyn_on_file, & |
---|
1281 | nysf, nysc, nys_on_file, & |
---|
1282 | tmp_3d, found & |
---|
1283 | ) ! ToDo: change interface to pass variable |
---|
1284 | |
---|
1285 | IF ( .NOT. found ) CALL radiation_rrd_local( & |
---|
1286 | map_index, & |
---|
1287 | nxlf, nxlc, nxl_on_file, & |
---|
1288 | nxrf, nxrc, nxr_on_file, & |
---|
1289 | nynf, nync, nyn_on_file, & |
---|
1290 | nysf, nysc, nys_on_file, & |
---|
1291 | tmp_2d, tmp_3d, found & |
---|
1292 | ) ! ToDo: change interface to pass variable |
---|
1293 | |
---|
1294 | IF ( .NOT. found ) CALL salsa_rrd_local( & |
---|
1295 | map_index, & |
---|
1296 | nxlf, nxlc, nxl_on_file, & |
---|
1297 | nxrf, nxrc, nxr_on_file, & |
---|
1298 | nynf, nync, nyn_on_file, & |
---|
1299 | nysf, nysc, nys_on_file, & |
---|
1300 | tmp_3d, found & |
---|
1301 | ) ! ToDo: change interface to pass variable |
---|
1302 | |
---|
1303 | IF ( .NOT. found ) CALL usm_rrd_local( & |
---|
1304 | map_index, & |
---|
1305 | nxlf, nxlc, nxl_on_file, & |
---|
1306 | nxrf, nxr_on_file, & |
---|
1307 | nynf, nyn_on_file, & |
---|
1308 | nysf, nysc, nys_on_file, & |
---|
1309 | found & |
---|
1310 | ) ! ToDo: change interface to pass variable |
---|
1311 | ! |
---|
1312 | !-- Surface data do not need overlap data, so do not pass these information. |
---|
1313 | IF ( .NOT. found ) CALL surface_data_output_rrd_local( found ) |
---|
1314 | |
---|
1315 | IF ( .NOT. found ) CALL user_rrd_local( & |
---|
1316 | map_index, & |
---|
1317 | nxlf, nxlc, nxl_on_file, & |
---|
1318 | nxrf, nxrc, nxr_on_file, & |
---|
1319 | nynf, nync, nyn_on_file, & |
---|
1320 | nysf, nysc, nys_on_file, & |
---|
1321 | tmp_3d, found & |
---|
1322 | ) ! ToDo: change interface to pass variable |
---|
1323 | |
---|
1324 | |
---|
1325 | END SUBROUTINE module_interface_rrd_local |
---|
1326 | |
---|
1327 | |
---|
1328 | !------------------------------------------------------------------------------! |
---|
1329 | ! Description: |
---|
1330 | ! ------------ |
---|
1331 | !> Write module-specific restart data specific to local MPI ranks |
---|
1332 | !------------------------------------------------------------------------------! |
---|
1333 | SUBROUTINE module_interface_wrd_local |
---|
1334 | |
---|
1335 | |
---|
1336 | IF ( biometeorology ) CALL bio_wrd_local |
---|
1337 | IF ( bulk_cloud_model ) CALL bcm_wrd_local |
---|
1338 | IF ( air_chemistry ) CALL chem_wrd_local |
---|
1339 | IF ( gust_module_enabled ) CALL gust_wrd_local |
---|
1340 | IF ( land_surface ) CALL lsm_wrd_local |
---|
1341 | IF ( ocean_mode ) CALL ocean_wrd_local |
---|
1342 | IF ( radiation ) CALL radiation_wrd_local |
---|
1343 | IF ( salsa ) CALL salsa_wrd_local |
---|
1344 | IF ( urban_surface ) CALL usm_wrd_local |
---|
1345 | IF ( surface_output ) CALL surface_data_output_wrd_local |
---|
1346 | IF ( user_module_enabled ) CALL user_wrd_local |
---|
1347 | |
---|
1348 | |
---|
1349 | END SUBROUTINE module_interface_wrd_local |
---|
1350 | |
---|
1351 | |
---|
1352 | !------------------------------------------------------------------------------! |
---|
1353 | ! Description: |
---|
1354 | ! ------------ |
---|
1355 | !> Perform module-specific last actions before the program terminates |
---|
1356 | !------------------------------------------------------------------------------! |
---|
1357 | SUBROUTINE module_interface_last_actions |
---|
1358 | |
---|
1359 | |
---|
1360 | IF ( virtual_measurement ) CALL vm_last_actions |
---|
1361 | IF ( user_module_enabled ) CALL user_last_actions |
---|
1362 | |
---|
1363 | |
---|
1364 | END SUBROUTINE module_interface_last_actions |
---|
1365 | |
---|
1366 | |
---|
1367 | END MODULE module_interface |
---|