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