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