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