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