source: palm/trunk/SOURCE/module_interface.f90 @ 4186

Last change on this file since 4186 was 4182, checked in by scharf, 5 years ago
  • corrected "Former revisions" section
  • minor formatting in "Former revisions" section
  • added "Author" section
  • Property svn:keywords set to Id
File size: 82.5 KB
Line 
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 4182 2019-08-22 15:20:23Z suehring $
27! Corrected "Former revisions" section
28!
29! 4173 2019-08-20 12:04:06Z gronemeier
30! add vdi_internal_controls
31!
32! 4157 2019-08-14 09:19:12Z suehring
33! Call doq_init from module interface
34!
35! 4132 2019-08-02 12:34:17Z suehring
36! Bugfix in masked data output for diagnostic quantities
37!
38! 4131 2019-08-02 11:06:18Z monakurppa
39! Add output of 3D plant-canopy outputs (merge from branch resler)
40!
41! 4048 2019-06-21 21:00:21Z knoop
42! Moved turbulence_closure_mod calls into this module_interface
43!
44! 4047 2019-06-21 18:58:09Z knoop
45! Introduction of the dynamics module
46!
47! 4039 2019-06-18 10:32:41Z suehring
48! Introduce diagnostic output
49!
50! 4028 2019-06-13 12:21:37Z schwenkel
51! Further modularization of particle code components
52!
53! 4017 2019-06-06 12:16:46Z schwenkel
54! local_pf need INTENT(INOUT) attribute rather than INTENT(OUT). This is
55! because INTENT(OUT) sets the array to not-defined. Especially for outputs that
56! are not defined everywhere, e.g. land-surface outputs, this will be
57! problematic as NaN will be output.
58!
59! 3987 2019-05-22 09:52:13Z kanani
60! Introduce switchable DEBUG file output via debug_message routine
61!
62! 3956 2019-05-07 12:32:52Z monakurppa
63! - Added calls for salsa_non_advective_processes and
64!   salsa_exchange_horiz_bounds
65! - Moved the call for salsa_data_output_2d/3d before that of
66!   radiation_data_output_2d/3d. radiation_data_output_2d/3d tries to read a
67!   salsa output variable and encounters a segmentation fault for "Ntot" due
68!   to the shortoutput name
69!
70! 3931 2019-04-24 16:34:28Z schwenkel
71! Changed non_transport_physics to non_advective_processes
72!
73! 3930 2019-04-24 14:57:18Z forkel
74! Correct/complete module_interface introduction for chemistry model
75!
76! 3887 2019 -04-12 08:47:41Z schwenkel
77! Changes related to global restructuring of location messages and introduction
78! of additional debug messages
79!
80! 3880 2019 -04-08 21:43:02Z knoop
81! Add a call for salsa_prognostic_equations
82!
83! 3840 2019-03-29 10:35:52Z knoop
84! bugfix: intent of dummy arguments changed to inout
85!
86! 3770 2019-02-28 11:22:32Z moh.hefny
87! removed unused variables in module_interface_check_data_output_ts
88!
89! 3767 08:18:02Z raasch
90! unused variable file_index removed from subroutine parameter list
91!
92! 3766 2019-02-26 16:23:41Z raasch
93! first argument removed from module_interface_rrd_*, statement added to avoid
94! compiler warning about unused variable, file reformatted with respect to coding
95! standards
96!
97! 3762 2019-02-25 16:54:16Z suehring
98! only pass required arguments to surface_data_output_rrd_local
99!
100! 3747 2019-02-16 15:15:23Z gronemeier
101! Call user_init_arrays
102!
103! 3745 2019-02-15 18:57:56Z suehring
104! Add indoor model
105!
106! 3744 2019-02-15 18:38:58Z suehring
107! Removed bio_check_parameters as the method is empty.
108!
109! 3735 2019-02-12 09:52:40Z dom_dwd_user
110! Accepting variable j from check_parameters and passing it to
111! bio_check_data_output
112! Add required restart data for surface output module
113!
114! 3731 2019-02-11 13:06:27Z suehring
115! Add check_parameters routine for virtual measurements
116!
117! 3711 2019-01-31 13:44:26Z knoop
118! Introduced module_interface_init_checks for post-init checks
119!
120! 3705 2019-01-29 19:56:39Z suehring
121! Add last_actions for virtual measurements
122!
123! 3704 2019-01-29 19:51:41Z suehring
124! Some interface calls moved to module_interface + cleanup
125!
126! 3684 2019-01-20 20:20:58Z knoop
127! Bugfix: made unit intend INOUT
128!
129! 3650 2019-01-04 13:01:33Z kanani
130! Add restart routines for biometeorology
131!
132! 3649 2019-01-02 16:52:21Z suehring
133! Initialize strings, in order to avoid compiler warnings for non-initialized
134! characters with intent(out) attribute
135!
136! 3648 2019-01-02 16:35:46Z suehring
137! 3641 2018-12-23 22:10:01Z knoop
138! Initial implementation of the PALM module interface
139!
140!
141! Description:
142! ------------
143!> This is the interface between the PALM model core and all its modules.
144!>
145!> @todo Re-format module to be consistent with coding standard
146!------------------------------------------------------------------------------!
147 MODULE module_interface
148
149    USE indices,                                                               &
150        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt
151
152    USE kinds
153
154!
155!-- load module-specific control parameters.
156!-- ToDo: move all of them to respective module or a dedicated central module
157
158    USE dynamics_mod, &
159        ONLY:  dynamics_parin, &
160               dynamics_check_parameters, &
161               dynamics_check_data_output_ts, &
162               dynamics_check_data_output_pr, &
163               dynamics_check_data_output, &
164               dynamics_init_masks, &
165               dynamics_define_netcdf_grid, &
166               dynamics_init_arrays, &
167               dynamics_init, &
168               dynamics_init_checks, &
169               dynamics_header, &
170               dynamics_actions, &
171               dynamics_non_advective_processes, &
172               dynamics_exchange_horiz, &
173               dynamics_prognostic_equations, &
174               dynamics_swap_timelevel, &
175               dynamics_3d_data_averaging, &
176               dynamics_data_output_2d, &
177               dynamics_data_output_3d, &
178               dynamics_statistics, &
179               dynamics_rrd_global, &
180               dynamics_rrd_local, &
181               dynamics_wrd_global, &
182               dynamics_wrd_local, &
183               dynamics_last_actions
184
185    USE turbulence_closure_mod, &
186        ONLY:  tcm_check_parameters, &
187               tcm_check_data_output, &
188               tcm_init_arrays, &
189               tcm_init, &
190               tcm_actions, &
191               tcm_prognostic_equations, &
192               tcm_swap_timelevel, &
193               tcm_3d_data_averaging, &
194               tcm_data_output_2d, &
195               tcm_data_output_3d
196
197    USE control_parameters,                                                    &
198        ONLY:  air_chemistry,                                                  &
199               biometeorology,                                                 &
200               debug_output,                                                   &
201               debug_output_timestep,                                          &
202               indoor_model,                                                   &
203               land_surface,                                                   &
204               large_scale_forcing,                                            &
205               nesting_offline,                                                &
206               nudging,                                                        &
207               ocean_mode,                                                     &
208               plant_canopy,                                                   &
209               salsa,                                                          &
210               surface_output,                                                 &
211               syn_turb_gen,                                                   &
212               urban_surface,                                                  &
213               vdi_checks,                                                     &
214               virtual_flight,                                                 &
215               virtual_measurement,                                            &
216               wind_turbine
217
218!
219!-- load interface routines of all PALM modules
220    USE biometeorology_mod,                                                    &
221        ONLY:  bio_parin,                                                      &
222               bio_check_data_output,                                          &
223               bio_init,                                                       &
224               bio_init_checks,                                                &
225               bio_header,                                                     &
226               bio_3d_data_averaging,                                          &
227               bio_data_output_2d,                                             &
228               bio_data_output_3d,                                             &
229               bio_rrd_global,                                                 &
230               bio_rrd_local,                                                  &
231               bio_wrd_global,                                                 &
232               bio_wrd_local
233
234    USE bulk_cloud_model_mod,                                                  &
235        ONLY:  bulk_cloud_model,                                               &
236               bcm_parin,                                                      &
237               bcm_check_parameters,                                           &
238               bcm_check_data_output_pr,                                       &
239               bcm_check_data_output,                                          &
240               bcm_init_arrays,                                                &
241               bcm_init,                                                       &
242               bcm_header,                                                     &
243               bcm_actions,                                                    &
244               bcm_non_advective_processes,                                    &
245               bcm_exchange_horiz,                                             &
246               bcm_prognostic_equations,                                       &
247               bcm_swap_timelevel,                                             &
248               bcm_3d_data_averaging,                                          &
249               bcm_data_output_2d,                                             &
250               bcm_data_output_3d,                                             &
251               bcm_rrd_global,                                                 &
252               bcm_wrd_global,                                                 &
253               bcm_rrd_local,                                                  &
254               bcm_wrd_local
255
256   USE chemistry_model_mod,                                                    &
257       ONLY:  chem_parin,                                                      &
258              chem_check_parameters,                                           &
259              chem_check_data_output_pr,                                       &
260              chem_check_data_output,                                          &
261              chem_exchange_horiz_bounds,                                      &
262              chem_init_arrays,                                                &
263              chem_init,                                                       &
264              chem_header,                                                     &
265              chem_actions,                                                    &
266              chem_non_advective_processes,                                    &
267              chem_prognostic_equations,                                       &
268              chem_swap_timelevel,                                             &
269              chem_3d_data_averaging,                                          &
270              chem_data_output_2d,                                             &
271              chem_data_output_3d,                                             &
272              chem_statistics,                                                 &
273              chem_rrd_local,                                                  &
274              chem_wrd_local
275
276    USE diagnostic_output_quantities_mod,                                      &
277        ONLY:  doq_3d_data_averaging,                                          &
278               doq_check_data_output,                                          &
279               doq_define_netcdf_grid,                                         &
280               doq_init,                                                       &
281               doq_output_2d,                                                  &
282               doq_output_3d,                                                  &
283               doq_wrd_local
284!                doq_rrd_local,                                                  &
285
286    USE flight_mod,                                                            &
287        ONLY:  flight_parin,                                                   &
288               flight_header,                                                  &
289               flight_init,                                                    &
290               flight_rrd_global,                                              &
291               flight_wrd_global
292
293    USE gust_mod,                                                              &
294        ONLY:  gust_module_enabled,                                            &
295               gust_parin,                                                     &
296               gust_check_parameters,                                          &
297               gust_check_data_output_pr,                                      &
298               gust_check_data_output,                                         &
299               gust_init_arrays,                                               &
300               gust_init,                                                      &
301               gust_header,                                                    &
302               gust_actions,                                                   &
303               gust_prognostic_equations,                                      &
304               gust_swap_timelevel,                                            &
305               gust_3d_data_averaging,                                         &
306               gust_data_output_2d,                                            &
307               gust_data_output_3d,                                            &
308               gust_statistics,                                                &
309               gust_rrd_global,                                                &
310               gust_wrd_global,                                                &
311               gust_rrd_local,                                                 &
312               gust_wrd_local
313
314    USE indoor_model_mod,                                                      &
315        ONLY:  im_parin,                                                       &
316               im_check_data_output,                                           &
317               im_check_parameters,                                            &
318               im_data_output_3d,                                              &
319               im_init
320
321    USE lagrangian_particle_model_mod,                                         &
322        ONLY:  lpm_parin,                                                      &
323               lpm_header,                                                     &
324               lpm_check_parameters,                                           &
325               lpm_init_arrays,                                                &
326               lpm_init,                                                       &
327               lpm_actions,                                                    &
328               lpm_rrd_global,                                                 &
329               lpm_rrd_local,                                                  &
330               lpm_wrd_local,                                                  &
331               lpm_wrd_global
332
333    USE land_surface_model_mod,                                                &
334        ONLY:  lsm_parin,                                                      &
335               lsm_check_parameters,                                           &
336               lsm_check_data_output_pr,                                       &
337               lsm_check_data_output,                                          &
338               lsm_init_arrays,                                                &
339               lsm_init,                                                       &
340               lsm_header,                                                     &
341               lsm_swap_timelevel,                                             &
342               lsm_3d_data_averaging,                                          &
343               lsm_data_output_2d,                                             &
344               lsm_rrd_local,                                                  &
345               lsm_wrd_local
346
347    USE lsf_nudging_mod,                                                       &
348        ONLY:  lsf_nudging_check_parameters,                                   &
349               lsf_nudging_check_data_output_pr,                               &
350               lsf_init,                                                       &
351               nudge_init,                                                     &
352               lsf_nudging_header
353
354    USE multi_agent_system_mod,                                                &
355        ONLY:  mas_parin
356
357    USE nesting_offl_mod,                                                      &
358        ONLY:  nesting_offl_parin,                                             &
359               nesting_offl_check_parameters,                                  &
360               nesting_offl_header
361
362    USE ocean_mod,                                                             &
363        ONLY:  ocean_parin,                                                    &
364               ocean_check_parameters,                                         &
365               ocean_check_data_output_pr,                                     &
366               ocean_check_data_output,                                        &
367               ocean_init_arrays,                                              &
368               ocean_init,                                                     &
369               ocean_header,                                                   &
370               ocean_actions,                                                  &
371               ocean_prognostic_equations,                                     &
372               ocean_swap_timelevel,                                           &
373               ocean_3d_data_averaging,                                        &
374               ocean_data_output_2d,                                           &
375               ocean_data_output_3d,                                           &
376               ocean_rrd_global,                                               &
377               ocean_wrd_global,                                               &
378               ocean_rrd_local,                                                &
379               ocean_wrd_local
380
381    USE particle_attributes,                                                   &
382        ONLY:  particle_advection
383
384    USE plant_canopy_model_mod,                                                &
385         ONLY: pcm_parin,                                                      &
386               pcm_check_parameters,                                           &
387               pcm_check_data_output,                                          &
388               pcm_init,                                                       &
389               pcm_header,                                                     &
390               pcm_3d_data_averaging,                                          &
391               pcm_data_output_3d
392
393    USE radiation_model_mod,                                                   &
394        ONLY:  radiation,                                                      &
395               radiation_parin,                                                &
396               radiation_check_parameters,                                     &
397               radiation_check_data_output_ts,                                 &
398               radiation_check_data_output_pr,                                 &
399               radiation_check_data_output,                                    &
400               radiation_init,                                                 &
401               radiation_header,                                               &
402               radiation_3d_data_averaging,                                    &
403               radiation_data_output_2d,                                       &
404               radiation_data_output_3d,                                       &
405               radiation_rrd_local,                                            &
406               radiation_wrd_local
407
408    USE salsa_mod,                                                             &
409        ONLY:  salsa_parin,                                                    &
410               salsa_check_parameters,                                         &
411               salsa_check_data_output_pr,                                     &
412               salsa_check_data_output,                                        &
413               salsa_init_arrays,                                              &
414               salsa_init,                                                     &
415               salsa_header,                                                   &
416               salsa_actions,                                                  &
417               salsa_non_advective_processes,                                  &
418               salsa_exchange_horiz_bounds,                                    &
419               salsa_prognostic_equations,                                     &
420               salsa_swap_timelevel,                                           &
421               salsa_3d_data_averaging,                                        &
422               salsa_data_output_2d,                                           &
423               salsa_data_output_3d,                                           &
424               salsa_statistics,                                               &
425               salsa_rrd_local,                                                &
426               salsa_wrd_local
427
428    USE spectra_mod,                                                           &
429        ONLY:  calculate_spectra,                                              &
430               spectra_parin,                                                  &
431               spectra_check_parameters,                                       &
432               spectra_header
433
434    USE surface_data_output_mod,                                               &
435        ONLY:  surface_data_output_parin,                                      &
436               surface_data_output_check_parameters,                           &
437               surface_data_output_init_arrays,                                &
438               surface_data_output_rrd_local,                                  &
439               surface_data_output_rrd_global,                                 &
440               surface_data_output_wrd_local,                                  &
441               surface_data_output_wrd_global
442
443    USE synthetic_turbulence_generator_mod,                                    &
444        ONLY:  stg_parin,                                                      &
445               stg_check_parameters,                                           &
446               stg_header,                                                     &
447               stg_rrd_global,                                                 &
448               stg_wrd_global
449
450    USE urban_surface_mod,                                                     &
451        ONLY:  usm_parin,                                                      &
452               usm_check_parameters,                                           &
453               usm_check_data_output,                                          &
454               usm_init_arrays,                                                &
455               usm_init,                                                       &
456               usm_swap_timelevel,                                             &
457               usm_3d_data_averaging,                                          &
458               usm_rrd_local,                                                  &
459               usm_wrd_local
460
461    USE vdi_internal_controls,                                                 &
462        ONLY:  vdi_actions
463               
464    USE virtual_measurement_mod,                                               &
465        ONLY:  vm_check_parameters,                                            &
466               vm_init,                                                        &
467               vm_last_actions,                                                &
468               vm_parin
469
470    USE wind_turbine_model_mod,                                                &
471        ONLY:  wtm_parin,                                                      &
472               wtm_check_parameters,                                           &
473               wtm_init_arrays,                                                &
474               wtm_init,                                                       &
475               wtm_actions,                                                    &
476               wtm_rrd_global,                                                 &
477               wtm_wrd_global
478
479    USE user,                                                                  &
480        ONLY:  user_module_enabled,                                            &
481               user_parin,                                                     &
482               user_check_parameters,                                          &
483               user_check_data_output_ts,                                      &
484               user_check_data_output_pr,                                      &
485               user_check_data_output,                                         &
486               user_init,                                                      &
487               user_init_arrays,                                               &
488               user_header,                                                    &
489               user_actions,                                                   &
490               user_3d_data_averaging,                                         &
491               user_data_output_2d,                                            &
492               user_data_output_3d,                                            &
493               user_statistics,                                                &
494               user_rrd_global,                                                &
495               user_rrd_local,                                                 &
496               user_wrd_global,                                                &
497               user_wrd_local,                                                 &
498               user_last_actions
499
500    IMPLICIT NONE
501
502    PRIVATE
503
504!
505!-- Public functions
506    PUBLIC                                                                     &
507       module_interface_parin,                                                 &
508       module_interface_check_parameters,                                      &
509       module_interface_check_data_output_ts,                                  &
510       module_interface_check_data_output_pr,                                  &
511       module_interface_check_data_output,                                     &
512       module_interface_init_masks,                                            &
513       module_interface_define_netcdf_grid,                                    &
514       module_interface_init_arrays,                                           &
515       module_interface_init,                                                  &
516       module_interface_init_checks,                                           &
517       module_interface_header,                                                &
518       module_interface_actions,                                               &
519       module_interface_non_advective_processes,                               &
520       module_interface_exchange_horiz,                                        &
521       module_interface_prognostic_equations,                                  &
522       module_interface_swap_timelevel,                                        &
523       module_interface_3d_data_averaging,                                     &
524       module_interface_data_output_2d,                                        &
525       module_interface_data_output_3d,                                        &
526       module_interface_statistics,                                            &
527       module_interface_rrd_global,                                            &
528       module_interface_wrd_global,                                            &
529       module_interface_rrd_local,                                             &
530       module_interface_wrd_local,                                             &
531       module_interface_last_actions
532
533
534    INTERFACE module_interface_parin
535       MODULE PROCEDURE module_interface_parin
536    END INTERFACE module_interface_parin
537
538    INTERFACE module_interface_check_parameters
539       MODULE PROCEDURE module_interface_check_parameters
540    END INTERFACE module_interface_check_parameters
541
542    INTERFACE module_interface_check_data_output_ts
543       MODULE PROCEDURE module_interface_check_data_output_ts
544    END INTERFACE module_interface_check_data_output_ts
545
546    INTERFACE module_interface_check_data_output_pr
547       MODULE PROCEDURE module_interface_check_data_output_pr
548    END INTERFACE module_interface_check_data_output_pr
549
550    INTERFACE module_interface_check_data_output
551       MODULE PROCEDURE module_interface_check_data_output
552    END INTERFACE module_interface_check_data_output
553
554    INTERFACE module_interface_init_masks
555       MODULE PROCEDURE module_interface_init_masks
556    END INTERFACE module_interface_init_masks
557
558    INTERFACE module_interface_define_netcdf_grid
559       MODULE PROCEDURE module_interface_define_netcdf_grid
560    END INTERFACE module_interface_define_netcdf_grid
561
562    INTERFACE module_interface_init_arrays
563       MODULE PROCEDURE module_interface_init_arrays
564    END INTERFACE module_interface_init_arrays
565
566    INTERFACE module_interface_init
567       MODULE PROCEDURE module_interface_init
568    END INTERFACE module_interface_init
569
570    INTERFACE module_interface_init_checks
571       MODULE PROCEDURE module_interface_init_checks
572    END INTERFACE module_interface_init_checks
573
574    INTERFACE module_interface_header
575       MODULE PROCEDURE module_interface_header
576    END INTERFACE module_interface_header
577
578    INTERFACE module_interface_actions
579       MODULE PROCEDURE module_interface_actions
580       MODULE PROCEDURE module_interface_actions_ij
581    END INTERFACE module_interface_actions
582
583    INTERFACE module_interface_non_advective_processes
584       MODULE PROCEDURE module_interface_non_advective_processes
585       MODULE PROCEDURE module_interface_non_advective_processes_ij
586    END INTERFACE module_interface_non_advective_processes
587
588    INTERFACE module_interface_exchange_horiz
589       MODULE PROCEDURE module_interface_exchange_horiz
590    END INTERFACE module_interface_exchange_horiz
591
592    INTERFACE module_interface_prognostic_equations
593       MODULE PROCEDURE module_interface_prognostic_equations
594       MODULE PROCEDURE module_interface_prognostic_equations_ij
595    END INTERFACE module_interface_prognostic_equations
596
597    INTERFACE module_interface_swap_timelevel
598       MODULE PROCEDURE module_interface_swap_timelevel
599    END INTERFACE module_interface_swap_timelevel
600
601    INTERFACE module_interface_3d_data_averaging
602       MODULE PROCEDURE module_interface_3d_data_averaging
603    END INTERFACE module_interface_3d_data_averaging
604
605    INTERFACE module_interface_data_output_2d
606       MODULE PROCEDURE module_interface_data_output_2d
607    END INTERFACE module_interface_data_output_2d
608
609    INTERFACE module_interface_data_output_3d
610       MODULE PROCEDURE module_interface_data_output_3d
611    END INTERFACE module_interface_data_output_3d
612
613    INTERFACE module_interface_statistics
614       MODULE PROCEDURE module_interface_statistics
615    END INTERFACE module_interface_statistics
616
617    INTERFACE module_interface_rrd_global
618       MODULE PROCEDURE module_interface_rrd_global
619    END INTERFACE module_interface_rrd_global
620
621    INTERFACE module_interface_wrd_global
622       MODULE PROCEDURE module_interface_wrd_global
623    END INTERFACE module_interface_wrd_global
624
625    INTERFACE module_interface_rrd_local
626       MODULE PROCEDURE module_interface_rrd_local
627    END INTERFACE module_interface_rrd_local
628
629    INTERFACE module_interface_wrd_local
630       MODULE PROCEDURE module_interface_wrd_local
631    END INTERFACE module_interface_wrd_local
632
633    INTERFACE module_interface_last_actions
634       MODULE PROCEDURE module_interface_last_actions
635    END INTERFACE module_interface_last_actions
636
637
638 CONTAINS
639
640
641!------------------------------------------------------------------------------!
642! Description:
643! ------------
644!> Read module-specific parameter namelists
645!------------------------------------------------------------------------------!
646 SUBROUTINE module_interface_parin
647
648
649    IF ( debug_output )  CALL debug_message( 'reading module-specific parameters', 'start' )
650
651    CALL dynamics_parin
652
653    CALL bio_parin
654    CALL bcm_parin
655    CALL chem_parin
656    CALL flight_parin ! ToDo: rename module to match filename
657    CALL gust_parin
658    CALL im_parin
659    CALL lpm_parin
660    CALL lsm_parin
661    ! ToDo: create parin routine for large_scale_forcing and nudging (should be seperate modules or new module switch)
662    CALL mas_parin
663    CALL nesting_offl_parin
664    CALL ocean_parin
665    CALL pcm_parin
666    CALL radiation_parin
667    CALL salsa_parin
668    CALL spectra_parin
669    CALL surface_data_output_parin
670    CALL stg_parin
671    CALL usm_parin
672    CALL vm_parin
673    CALL wtm_parin
674
675    CALL user_parin
676
677    IF ( debug_output )  CALL debug_message( 'reading module-specific parameters', 'end' )
678
679
680 END SUBROUTINE module_interface_parin
681
682
683!------------------------------------------------------------------------------!
684! Description:
685! ------------
686!> Perform module-specific initialization checks
687!------------------------------------------------------------------------------!
688 SUBROUTINE module_interface_check_parameters
689
690
691    IF ( debug_output )  CALL debug_message( 'checking module-specific parameters', 'start' )
692
693    CALL dynamics_check_parameters
694    CALL tcm_check_parameters
695
696    IF ( bulk_cloud_model )     CALL bcm_check_parameters
697    IF ( air_chemistry )        CALL chem_check_parameters
698    IF ( gust_module_enabled )  CALL gust_check_parameters
699    IF ( indoor_model )         CALL im_check_parameters
700    IF ( particle_advection )   CALL lpm_check_parameters
701    IF ( land_surface )         CALL lsm_check_parameters
702    IF ( large_scale_forcing  .OR.  nudging )  CALL lsf_nudging_check_parameters ! ToDo: create single module switch
703    IF ( nesting_offline )      CALL nesting_offl_check_parameters
704    IF ( ocean_mode )           CALL ocean_check_parameters
705    IF ( plant_canopy )         CALL pcm_check_parameters
706    IF ( radiation )            CALL radiation_check_parameters
707    IF ( salsa )                CALL salsa_check_parameters
708    IF ( calculate_spectra )    CALL spectra_check_parameters
709    IF ( surface_output )       CALL surface_data_output_check_parameters
710    IF ( syn_turb_gen )         CALL stg_check_parameters
711    IF ( urban_surface )        CALL usm_check_parameters
712    IF ( virtual_measurement )  CALL vm_check_parameters
713    IF ( wind_turbine )         CALL wtm_check_parameters
714
715    IF ( user_module_enabled )  CALL user_check_parameters
716
717    IF ( debug_output )  CALL debug_message( 'checking module-specific parameters', 'end' )
718
719
720 END SUBROUTINE module_interface_check_parameters
721
722
723!------------------------------------------------------------------------------!
724! Description:
725! ------------
726!> Check module-specific data output of timeseries
727!------------------------------------------------------------------------------!
728 SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
729
730
731    INTEGER(iwp),      INTENT(IN)    ::  dots_max !< variable output array index
732    INTEGER(iwp),      INTENT(INOUT)    ::  dots_num !< variable output array index
733    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label
734    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit
735
736
737    IF ( debug_output )  CALL debug_message( 'checking module-specific data output ts', 'start' )
738
739    CALL dynamics_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
740
741    IF ( radiation )  THEN
742       CALL radiation_check_data_output_ts( dots_max, dots_num )
743    ENDIF
744
745    IF ( user_module_enabled )  THEN
746       CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
747    ENDIF
748
749    IF ( debug_output )  CALL debug_message( 'checking module-specific data output ts', 'end' )
750
751
752 END SUBROUTINE module_interface_check_data_output_ts
753
754
755!------------------------------------------------------------------------------!
756! Description:
757! ------------
758!> Check module-specific data output of profiles
759!------------------------------------------------------------------------------!
760 SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit,  &
761                                                   dopr_unit )
762
763
764    CHARACTER (LEN=*), INTENT(IN)    ::  variable  !< variable name
765    INTEGER(iwp),      INTENT(IN)    ::  var_count !< variable output array index
766    CHARACTER (LEN=*), INTENT(INOUT) ::  unit      !< physical unit of variable
767    CHARACTER (LEN=*), INTENT(OUT)   ::  dopr_unit !< local value of dopr_unit
768
769
770    IF ( debug_output )  CALL debug_message( 'checking module-specific data output pr', 'start' )
771
772    CALL dynamics_check_data_output_pr( variable, var_count, unit, dopr_unit )
773
774    IF ( unit == 'illegal' .AND.  bulk_cloud_model )  THEN
775       CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit )
776    ENDIF
777
778    IF ( unit == 'illegal' .AND.  air_chemistry )  THEN
779       CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit )
780    ENDIF
781
782    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
783       CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit )
784    ENDIF
785
786    IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
787       CALL lsm_check_data_output_pr( variable, var_count, unit, dopr_unit )
788    ENDIF
789
790    IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
791       CALL lsf_nudging_check_data_output_pr( variable, var_count, unit, dopr_unit )
792    ENDIF
793
794    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
795       CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit )
796    ENDIF
797
798    IF ( unit == 'illegal'  .AND.  radiation )  THEN
799       CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit )
800    ENDIF
801
802    IF ( unit == 'illegal'  .AND.  salsa )  THEN
803       CALL salsa_check_data_output_pr( variable, var_count, unit, dopr_unit )
804    ENDIF
805
806    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
807       unit = '' ! ToDo: Seems like a hack. Find a general soultion!
808       CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit )
809    ENDIF
810
811    IF ( debug_output )  CALL debug_message( 'checking module-specific data output pr', 'end' )
812
813
814 END SUBROUTINE module_interface_check_data_output_pr
815
816!------------------------------------------------------------------------------!
817! Description:
818! ------------
819!> Check module-specific 2D and 3D data output
820!------------------------------------------------------------------------------!
821 SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k )
822
823
824    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
825    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
826
827    INTEGER(iwp),      INTENT(IN)    :: i         !< ToDo: remove dummy argument, instead pass string from data_output
828    INTEGER(iwp),      INTENT(IN)    :: j         !< average quantity? 0 = no, 1 = yes
829    INTEGER(iwp),      INTENT(IN)    :: ilen      !< ToDo: remove dummy argument, instead pass string from data_output
830    INTEGER(iwp),      INTENT(IN)    :: k         !< ToDo: remove dummy argument, instead pass string from data_output
831
832
833    IF ( debug_output )  CALL debug_message( 'checking module-specific data output 2d/3d', 'start' )
834
835    CALL dynamics_check_data_output( variable, unit )
836
837    CALL tcm_check_data_output( variable, unit )
838
839    IF ( unit == 'illegal'  .AND.  biometeorology )  THEN
840       CALL bio_check_data_output( variable, unit, i, j, ilen, k )
841    ENDIF
842
843    IF ( unit == 'illegal'  .AND.  bulk_cloud_model  )  THEN
844       CALL bcm_check_data_output( variable, unit )
845    ENDIF
846
847    IF ( unit == 'illegal'  .AND.  air_chemistry                               &
848         .AND.  (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
849       CALL chem_check_data_output( variable, unit, i, ilen, k )
850    ENDIF
851
852    IF ( unit == 'illegal' )  THEN
853       CALL doq_check_data_output( variable, unit )
854    ENDIF
855
856    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
857       CALL gust_check_data_output( variable, unit )
858    ENDIF
859
860    IF ( unit == 'illegal' )  THEN  ! ToDo: add module switch if possible
861       CALL lsm_check_data_output( variable, unit, i, ilen, k )
862    ENDIF
863
864    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
865       CALL ocean_check_data_output( variable, unit )
866    ENDIF
867
868    IF ( unit == 'illegal'  .AND.  plant_canopy                                &
869         .AND.  variable(1:4) == 'pcm_' )  THEN  ! ToDo: remove aditional conditions
870       CALL pcm_check_data_output( variable, unit )
871    ENDIF
872
873    IF ( unit == 'illegal'  .AND.  radiation )  THEN
874       CALL radiation_check_data_output( variable, unit, i, ilen, k )
875    ENDIF
876
877    IF ( unit == 'illegal' .AND. salsa ) THEN
878       CALL salsa_check_data_output( variable, unit )
879    ENDIF
880
881    IF ( unit == 'illegal' .AND. indoor_model ) THEN
882       CALL im_check_data_output( variable, unit )
883    ENDIF
884
885    IF ( unit == 'illegal'  .AND.  urban_surface                      &
886        .AND.  variable(1:4) == 'usm_' )  THEN  ! ToDo: remove aditional conditions
887       CALL usm_check_data_output( variable, unit )
888    ENDIF
889
890    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
891       unit = ''
892       CALL user_check_data_output( variable, unit )
893    ENDIF
894
895    IF ( debug_output )  CALL debug_message( 'checking module-specific data output 2d/3d', 'end' )
896
897
898 END SUBROUTINE module_interface_check_data_output
899
900
901!------------------------------------------------------------------------------!
902!
903! Description:
904! ------------
905!> Interface for init_masks. ToDo: get rid of these redundant calls!
906!------------------------------------------------------------------------------!
907 SUBROUTINE module_interface_init_masks( variable, unit )
908
909
910    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
911    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
912
913
914    IF ( debug_output )  CALL debug_message( 'initializing module-specific masks', 'start' )
915
916    CALL dynamics_init_masks( variable, unit )
917
918    IF ( unit == 'illegal'  .AND.  air_chemistry                               &
919         .AND.  (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
920       CALL chem_check_data_output( variable, unit, 0, 0, 0 )
921    ENDIF
922   
923    IF ( unit == 'illegal' )  THEN
924       CALL doq_check_data_output( variable, unit )
925    ENDIF
926
927    IF ( unit == 'illegal'  .AND.  radiation )  THEN
928       CALL radiation_check_data_output( variable, unit, 0, 0, 0 )
929    ENDIF
930
931    IF ( unit == 'illegal'  .AND.  salsa )  THEN
932       CALL salsa_check_data_output( variable, unit )
933    ENDIF
934
935    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
936       unit = ''
937       CALL user_check_data_output( variable, unit )
938    ENDIF
939
940    IF ( debug_output )  CALL debug_message( 'initializing module-specific masks', 'end' )
941
942
943 END SUBROUTINE module_interface_init_masks
944
945
946!------------------------------------------------------------------------------!
947!
948! Description:
949! ------------
950!> Define appropriate grid for module-specific netcdf output variables.
951!------------------------------------------------------------------------------!
952 SUBROUTINE module_interface_define_netcdf_grid( var, found,                   &
953                                                 grid_x, grid_y, grid_z )
954
955
956    CHARACTER (LEN=*), INTENT(IN)  ::  var    !< variable name
957    LOGICAL,           INTENT(OUT) ::  found  !< indicates if variable was found
958    CHARACTER (LEN=*), INTENT(OUT) ::  grid_x !< netcdf dimension in x-direction
959    CHARACTER (LEN=*), INTENT(OUT) ::  grid_y !< netcdf dimension in y-direction
960    CHARACTER (LEN=*), INTENT(OUT) ::  grid_z !< netcdf dimension in z-direction
961
962
963    IF ( debug_output )  CALL debug_message( 'defining module-specific netcdf grids', 'start' )
964!
965!-- As long as no action is done in this subroutine, initialize strings with
966!-- intent(out) attribute, in order to avoid compiler warnings.
967    found  = .FALSE.
968    grid_x = 'none'
969    grid_y = 'none'
970    grid_z = 'none'
971!
972!-- Use var to avoid compiler warning about unused variable
973    IF ( var == ' ' )  RETURN
974
975    IF ( debug_output )  CALL debug_message( 'defining module-specific netcdf grids', 'end' )
976
977
978 END SUBROUTINE module_interface_define_netcdf_grid
979
980
981!------------------------------------------------------------------------------!
982! Description:
983! ------------
984!> Allocate module-specific arrays and pointers
985!------------------------------------------------------------------------------!
986 SUBROUTINE module_interface_init_arrays
987
988
989    IF ( debug_output )  CALL debug_message( 'initializing module-specific arrays', 'start' )
990
991    CALL dynamics_init_arrays
992    CALL tcm_init_arrays
993
994    IF ( bulk_cloud_model    )  CALL bcm_init_arrays
995    IF ( air_chemistry       )  CALL chem_init_arrays
996    IF ( gust_module_enabled )  CALL gust_init_arrays
997    IF ( particle_advection  )  CALL lpm_init_arrays
998    IF ( land_surface        )  CALL lsm_init_arrays
999    IF ( ocean_mode          )  CALL ocean_init_arrays
1000    IF ( salsa               )  CALL salsa_init_arrays
1001    IF ( urban_surface       )  CALL usm_init_arrays
1002    IF ( surface_output      )  CALL surface_data_output_init_arrays
1003    IF ( wind_turbine        )  CALL wtm_init_arrays
1004
1005    IF ( user_module_enabled )  CALL user_init_arrays
1006
1007    IF ( debug_output )  CALL debug_message( 'initializing module-specific arrays', 'end' )
1008
1009
1010 END SUBROUTINE module_interface_init_arrays
1011
1012
1013!------------------------------------------------------------------------------!
1014! Description:
1015! ------------
1016!> Perform module-specific initialization
1017!------------------------------------------------------------------------------!
1018 SUBROUTINE module_interface_init
1019
1020
1021    IF ( debug_output )  CALL debug_message( 'module-specific initialization', 'start' )
1022
1023    CALL dynamics_init
1024    CALL tcm_init
1025
1026    IF ( biometeorology      )  CALL bio_init
1027    IF ( bulk_cloud_model    )  CALL bcm_init
1028    IF ( air_chemistry       )  CALL chem_init
1029    IF ( virtual_flight      )  CALL flight_init
1030    IF ( gust_module_enabled )  CALL gust_init
1031    IF ( indoor_model        )  CALL im_init
1032    IF ( particle_advection  )  CALL lpm_init
1033    IF ( large_scale_forcing )  CALL lsf_init
1034    IF ( land_surface        )  CALL lsm_init
1035    IF ( nudging             )  CALL nudge_init
1036    IF ( ocean_mode          )  CALL ocean_init
1037    IF ( plant_canopy        )  CALL pcm_init
1038    IF ( salsa               )  CALL salsa_init
1039    IF ( urban_surface       )  CALL usm_init
1040    IF ( virtual_measurement )  CALL vm_init
1041    IF ( wind_turbine        )  CALL wtm_init
1042    IF ( radiation           )  CALL radiation_init
1043
1044    CALL doq_init
1045
1046    IF ( user_module_enabled )  CALL user_init
1047
1048    IF ( debug_output )  CALL debug_message( 'module-specific initialization', 'end' )
1049
1050
1051 END SUBROUTINE module_interface_init
1052
1053
1054!------------------------------------------------------------------------------!
1055! Description:
1056! ------------
1057!> Perform module-specific post-initialization checks
1058!------------------------------------------------------------------------------!
1059 SUBROUTINE module_interface_init_checks
1060
1061
1062    IF ( debug_output )  CALL debug_message( 'module-specific post-initialization checks', 'start' )
1063
1064    CALL dynamics_init_checks
1065
1066    IF ( biometeorology      )  CALL bio_init_checks
1067
1068    IF ( debug_output )  CALL debug_message( 'module-specific post-initialization checks', 'end' )
1069
1070
1071 END SUBROUTINE module_interface_init_checks
1072
1073
1074!------------------------------------------------------------------------------!
1075! Description:
1076! ------------
1077!> Gather module-specific header output
1078!------------------------------------------------------------------------------!
1079 SUBROUTINE module_interface_header( io )
1080
1081
1082    INTEGER(iwp), INTENT(IN) ::  io  !< unit of the output file
1083
1084
1085    IF ( debug_output )  CALL debug_message( 'module-specific header output', 'start' )
1086
1087    CALL dynamics_header( io )
1088
1089    IF ( biometeorology      )  CALL bio_header ( io )
1090    IF ( bulk_cloud_model    )  CALL bcm_header( io )
1091    IF ( air_chemistry       )  CALL chem_header ( io )
1092    IF ( virtual_flight      )  CALL flight_header( io )
1093    IF ( gust_module_enabled )  CALL gust_header( io )
1094    IF ( particle_advection  )  CALL lpm_header( io )
1095    IF ( land_surface        )  CALL lsm_header( io )
1096    IF ( large_scale_forcing )  CALL lsf_nudging_header( io )
1097    IF ( nesting_offline     )  CALL nesting_offl_header( io )
1098    IF ( ocean_mode          )  CALL ocean_header( io )
1099    IF ( plant_canopy        )  CALL pcm_header( io )
1100    IF ( radiation           )  CALL radiation_header( io )
1101    IF ( salsa               )  CALL salsa_header( io )
1102    IF ( calculate_spectra   )  CALL spectra_header( io )
1103    IF ( syn_turb_gen        )  CALL stg_header( io )
1104
1105    IF ( user_module_enabled )  CALL user_header( io )
1106
1107    IF ( debug_output )  CALL debug_message( 'module-specific header output', 'end' )
1108
1109
1110 END SUBROUTINE module_interface_header
1111
1112
1113!------------------------------------------------------------------------------!
1114! Description:
1115! ------------
1116!> Perform module-specific actions while in time-integration (vector-optimized)
1117!------------------------------------------------------------------------------!
1118 SUBROUTINE module_interface_actions( location )
1119
1120
1121    CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
1122
1123    CALL dynamics_actions( location )
1124    CALL tcm_actions( location )
1125
1126    IF ( bulk_cloud_model    )  CALL bcm_actions( location )
1127    IF ( air_chemistry       )  CALL chem_actions( location )
1128    IF ( gust_module_enabled )  CALL gust_actions( location )
1129    IF ( particle_advection  )  CALL lpm_actions( location )
1130    IF ( ocean_mode          )  CALL ocean_actions( location )
1131    IF ( salsa               )  CALL salsa_actions( location )
1132    IF ( wind_turbine        )  CALL wtm_actions( location )
1133
1134    IF ( user_module_enabled )  CALL user_actions( location )
1135    IF ( vdi_checks          )  CALL vdi_actions( location )
1136
1137
1138 END SUBROUTINE module_interface_actions
1139
1140
1141!------------------------------------------------------------------------------!
1142! Description:
1143! ------------
1144!> Perform module-specific actions while in time-integration (cache-optimized)
1145!------------------------------------------------------------------------------!
1146 SUBROUTINE module_interface_actions_ij( i, j, location )
1147
1148
1149    INTEGER(iwp),      INTENT(IN) ::  i         !< grid index in x-direction
1150    INTEGER(iwp),      INTENT(IN) ::  j         !< grid index in y-direction
1151    CHARACTER (LEN=*), INTENT(IN) ::  location  !< call location string
1152
1153    CALL dynamics_actions( i, j, location )
1154    CALL tcm_actions( i, j, location )
1155
1156    IF ( bulk_cloud_model    )  CALL bcm_actions( i, j, location )
1157    IF ( air_chemistry       )  CALL chem_actions( i, j, location )
1158    IF ( gust_module_enabled )  CALL gust_actions( i, j, location )
1159    IF ( ocean_mode          )  CALL ocean_actions( i, j, location )
1160    IF ( salsa               )  CALL salsa_actions( i, j, location )
1161    IF ( wind_turbine        )  CALL wtm_actions( i, j, location )
1162
1163    IF ( user_module_enabled )  CALL user_actions( i, j, location )
1164
1165
1166 END SUBROUTINE module_interface_actions_ij
1167
1168
1169!------------------------------------------------------------------------------!
1170! Description:
1171! ------------
1172!> Compute module-specific non_advective_processes (vector-optimized)
1173!------------------------------------------------------------------------------!
1174 SUBROUTINE module_interface_non_advective_processes
1175
1176
1177    CALL dynamics_non_advective_processes
1178
1179    IF ( bulk_cloud_model    )  CALL bcm_non_advective_processes
1180    IF ( air_chemistry       )  CALL chem_non_advective_processes
1181    IF ( salsa               )  CALL salsa_non_advective_processes
1182
1183
1184 END SUBROUTINE module_interface_non_advective_processes
1185
1186
1187!------------------------------------------------------------------------------!
1188! Description:
1189! ------------
1190!> Compute module-specific non_advective_processes (cache-optimized)
1191!------------------------------------------------------------------------------!
1192 SUBROUTINE module_interface_non_advective_processes_ij( i, j )
1193
1194
1195    INTEGER(iwp), INTENT(IN) ::  i            !< grid index in x-direction
1196    INTEGER(iwp), INTENT(IN) ::  j            !< grid index in y-direction
1197
1198    CALL dynamics_non_advective_processes( i, j )
1199
1200    IF ( bulk_cloud_model    )  CALL bcm_non_advective_processes( i, j )
1201    IF ( air_chemistry       )  CALL chem_non_advective_processes( i, j )
1202    IF ( salsa               )  CALL salsa_non_advective_processes( i, j )
1203
1204
1205 END SUBROUTINE module_interface_non_advective_processes_ij
1206
1207!------------------------------------------------------------------------------!
1208! Description:
1209! ------------
1210!> Exchange horiz for module-specific quantities
1211!------------------------------------------------------------------------------!
1212 SUBROUTINE module_interface_exchange_horiz
1213
1214
1215    IF ( debug_output_timestep )  CALL debug_message( 'module-specific exchange_horiz', 'start' )
1216
1217    CALL dynamics_exchange_horiz
1218
1219    IF ( bulk_cloud_model    )  CALL bcm_exchange_horiz
1220    IF ( air_chemistry       )  CALL chem_exchange_horiz_bounds
1221    IF ( salsa               )  CALL salsa_exchange_horiz_bounds
1222
1223    IF ( debug_output_timestep )  CALL debug_message( 'module-specific exchange_horiz', 'end' )
1224
1225
1226 END SUBROUTINE module_interface_exchange_horiz
1227
1228
1229!------------------------------------------------------------------------------!
1230! Description:
1231! ------------
1232!> Compute module-specific prognostic_equations (vector-optimized)
1233!------------------------------------------------------------------------------!
1234 SUBROUTINE module_interface_prognostic_equations
1235
1236
1237    CALL dynamics_prognostic_equations
1238    CALL tcm_prognostic_equations
1239
1240    IF ( bulk_cloud_model    )  CALL bcm_prognostic_equations
1241    IF ( air_chemistry       )  CALL chem_prognostic_equations
1242    IF ( gust_module_enabled )  CALL gust_prognostic_equations
1243    IF ( ocean_mode          )  CALL ocean_prognostic_equations
1244    IF ( salsa               )  CALL salsa_prognostic_equations
1245
1246
1247 END SUBROUTINE module_interface_prognostic_equations
1248
1249
1250!------------------------------------------------------------------------------!
1251! Description:
1252! ------------
1253!> Compute module-specific prognostic_equations (cache-optimized)
1254!------------------------------------------------------------------------------!
1255 SUBROUTINE module_interface_prognostic_equations_ij( i, j, i_omp_start, tn )
1256
1257
1258    INTEGER(iwp), INTENT(IN) ::  i            !< grid index in x-direction
1259    INTEGER(iwp), INTENT(IN) ::  j            !< grid index in y-direction
1260    INTEGER(iwp), INTENT(IN) ::  i_omp_start  !< first loop index of i-loop in prognostic_equations
1261    INTEGER(iwp), INTENT(IN) ::  tn           !< task number of openmp task
1262
1263    CALL dynamics_prognostic_equations( i, j, i_omp_start, tn )
1264    CALL tcm_prognostic_equations( i, j, i_omp_start, tn )
1265
1266    IF ( bulk_cloud_model    )  CALL bcm_prognostic_equations( i, j, i_omp_start, tn )
1267    IF ( air_chemistry       )  CALL chem_prognostic_equations( i, j, i_omp_start, tn )
1268    IF ( gust_module_enabled )  CALL gust_prognostic_equations( i, j, i_omp_start, tn )
1269    IF ( ocean_mode          )  CALL ocean_prognostic_equations( i, j, i_omp_start, tn )
1270    IF ( salsa               )  CALL salsa_prognostic_equations( i, j, i_omp_start, tn )
1271
1272
1273 END SUBROUTINE module_interface_prognostic_equations_ij
1274
1275
1276!------------------------------------------------------------------------------!
1277! Description:
1278! ------------
1279!> Swap the timelevel pointers for module-specific arrays
1280!------------------------------------------------------------------------------!
1281 SUBROUTINE module_interface_swap_timelevel ( swap_mode )
1282
1283
1284    INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap
1285
1286
1287    IF ( debug_output_timestep )  CALL debug_message( 'module-specific swap timelevel', 'start' )
1288
1289    CALL dynamics_swap_timelevel( swap_mode )
1290    CALL tcm_swap_timelevel( swap_mode )
1291
1292    IF ( bulk_cloud_model    )  CALL bcm_swap_timelevel( swap_mode )
1293    IF ( air_chemistry       )  CALL chem_swap_timelevel( swap_mode )
1294    IF ( gust_module_enabled )  CALL gust_swap_timelevel( swap_mode )
1295    IF ( land_surface        )  CALL lsm_swap_timelevel( swap_mode )
1296    IF ( ocean_mode          )  CALL ocean_swap_timelevel( swap_mode )
1297    IF ( salsa               )  CALL salsa_swap_timelevel( swap_mode )
1298    IF ( urban_surface       )  CALL usm_swap_timelevel( swap_mode )
1299
1300    IF ( debug_output_timestep )  CALL debug_message( 'module-specific swap timelevel', 'end' )
1301
1302
1303 END SUBROUTINE module_interface_swap_timelevel
1304
1305
1306!------------------------------------------------------------------------------!
1307!
1308! Description:
1309! ------------
1310!> Perform module-specific averaging of 3D data
1311!------------------------------------------------------------------------------!
1312 SUBROUTINE module_interface_3d_data_averaging( mode, variable )
1313
1314
1315    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< averaging interface mode
1316    CHARACTER (LEN=*), INTENT(IN) ::  variable !< variable name
1317
1318
1319    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data averaging', 'start' )
1320
1321    CALL dynamics_3d_data_averaging( mode, variable )
1322    CALL tcm_3d_data_averaging( mode, variable )
1323
1324    IF ( biometeorology      )  CALL bio_3d_data_averaging( mode, variable )
1325    IF ( bulk_cloud_model    )  CALL bcm_3d_data_averaging( mode, variable )
1326    IF ( air_chemistry       )  CALL chem_3d_data_averaging( mode, variable )
1327    CALL doq_3d_data_averaging( mode, variable )  ! ToDo: this seems to be not according to the design
1328    IF ( gust_module_enabled )  CALL gust_3d_data_averaging( mode, variable )
1329    IF ( land_surface        )  CALL lsm_3d_data_averaging( mode, variable )
1330    IF ( ocean_mode          )  CALL ocean_3d_data_averaging( mode, variable )
1331    IF ( plant_canopy        )  CALL pcm_3d_data_averaging( mode, variable )
1332    IF ( radiation           )  CALL radiation_3d_data_averaging( mode, variable )
1333    IF ( salsa               )  CALL salsa_3d_data_averaging( mode, variable )
1334    IF ( urban_surface       )  CALL usm_3d_data_averaging( mode, variable )
1335
1336    IF ( user_module_enabled )  CALL user_3d_data_averaging( mode, variable )
1337
1338    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data averaging', 'end' )
1339
1340
1341 END SUBROUTINE module_interface_3d_data_averaging
1342
1343!------------------------------------------------------------------------------!
1344!
1345! Description:
1346! ------------
1347!> Define module-specific 2D output variables
1348!------------------------------------------------------------------------------!
1349 SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode,  &
1350                                             local_pf, two_d, nzb_do, nzt_do,  &
1351                                             fill_value )
1352
1353    INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
1354    CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
1355    LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
1356    CHARACTER (LEN=*), INTENT(INOUT) ::  grid       !< name of vertical grid
1357    CHARACTER (LEN=*), INTENT(IN)    ::  mode       !< either 'xy', 'xz' or 'yz'
1358    LOGICAL,           INTENT(OUT)   ::  two_d      !< flag for 2D variables
1359    INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
1360    INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
1361    REAL(wp),          INTENT(IN)    ::  fill_value !< to be removed
1362
1363    REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) ::  local_pf !< ToDo: can also be kind=sp
1364
1365
1366    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 2d data output', 'start' )
1367
1368    CALL dynamics_data_output_2d(                                                  &
1369               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
1370            )
1371
1372    IF ( .NOT. found )  THEN
1373       CALL tcm_data_output_2d(                                                  &
1374               av, variable, found, grid, mode, local_pf, nzb_do, nzt_do &
1375            )
1376    ENDIF
1377
1378    IF ( .NOT. found  .AND.  biometeorology )  THEN
1379       CALL bio_data_output_2d(                                                &
1380               av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do      &
1381            )
1382    ENDIF
1383
1384    IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
1385       CALL bcm_data_output_2d(                                                &
1386               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
1387            )
1388    ENDIF
1389
1390    IF ( .NOT. found  .AND.  air_chemistry )  THEN
1391       CALL chem_data_output_2d(                                               &
1392               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
1393            )
1394    ENDIF
1395
1396    IF ( .NOT. found )  THEN
1397       CALL doq_output_2d(                                                     &
1398               av, variable, found, grid, mode, local_pf, two_d,               &
1399               nzb_do, nzt_do, fill_value )
1400    ENDIF
1401
1402    IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
1403       CALL gust_data_output_2d(                                               &
1404               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
1405            )
1406    ENDIF
1407
1408    IF ( .NOT. found  .AND.  land_surface )  THEN
1409       CALL lsm_data_output_2d(                                                &
1410               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
1411            )
1412    ENDIF
1413
1414    IF ( .NOT. found  .AND.  ocean_mode )  THEN
1415       CALL ocean_data_output_2d(                                              &
1416               av, variable, found, grid, mode, local_pf, nzb_do, nzt_do       &
1417            )
1418    ENDIF
1419
1420    IF ( .NOT. found  .AND.  radiation )  THEN
1421       CALL radiation_data_output_2d(                                          &
1422               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
1423            )
1424    ENDIF
1425
1426    IF ( .NOT. found  .AND.  salsa )  THEN
1427       CALL salsa_data_output_2d(                                              &
1428               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
1429            )
1430    ENDIF
1431
1432    IF ( .NOT. found  .AND.  user_module_enabled )  THEN
1433       CALL user_data_output_2d(                                               &
1434               av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do      &
1435            )
1436    ENDIF
1437
1438    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 2d data output', 'end' )
1439
1440
1441 END SUBROUTINE module_interface_data_output_2d
1442
1443
1444!------------------------------------------------------------------------------!
1445!
1446! Description:
1447! ------------
1448!> Define module-specific 3D output variables
1449!------------------------------------------------------------------------------!
1450 SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf,    &
1451                                             fill_value, resorted, nzb_do, nzt_do )
1452
1453
1454    INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
1455    CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
1456    LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
1457    REAL(wp),          INTENT(IN)    ::  fill_value !< ToDo: refactor
1458    LOGICAL,           INTENT(OUT)   ::  resorted   !< flag if output has been resorted
1459    INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
1460    INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
1461
1462    REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(INOUT) ::  local_pf
1463
1464
1465    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data output', 'start' )
1466
1467    CALL dynamics_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1468    resorted = .FALSE.
1469
1470    IF ( .NOT. found )  THEN
1471       CALL tcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1472       resorted = .TRUE.
1473    ENDIF
1474
1475    IF ( .NOT. found  .AND.  biometeorology )  THEN
1476       CALL bio_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1477       resorted = .FALSE.
1478    ENDIF
1479
1480    IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
1481       CALL bcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1482       resorted = .TRUE.
1483    ENDIF
1484
1485    IF ( .NOT. found  .AND.  air_chemistry )  THEN
1486       CALL chem_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1487       resorted = .TRUE.
1488    ENDIF
1489
1490    IF ( .NOT. found )  THEN
1491       CALL doq_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1492       resorted = .TRUE.
1493    ENDIF
1494
1495    IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
1496       CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1497       resorted = .TRUE.
1498    ENDIF
1499
1500    IF ( .NOT. found  .AND.  indoor_model )  THEN
1501       CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1502       resorted = .TRUE.
1503    ENDIF
1504
1505    IF ( .NOT. found  .AND.  ocean_mode )  THEN
1506       CALL ocean_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1507       resorted = .TRUE.
1508    ENDIF
1509
1510    IF ( .NOT. found  .AND.  plant_canopy )  THEN
1511       CALL pcm_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
1512       resorted = .TRUE.
1513    ENDIF
1514
1515    IF ( .NOT. found  .AND.  radiation )  THEN
1516       CALL radiation_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1517       resorted = .TRUE.
1518    ENDIF
1519
1520    IF ( .NOT. found  .AND.  salsa )  THEN
1521       CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1522       resorted = .TRUE.
1523    ENDIF
1524
1525    IF ( .NOT. found  .AND.  user_module_enabled )  THEN
1526       CALL user_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
1527       resorted = .TRUE.
1528    ENDIF
1529
1530    IF ( debug_output_timestep )  CALL debug_message( 'module-specific 3d data output', 'end' )
1531
1532
1533 END SUBROUTINE module_interface_data_output_3d
1534
1535
1536!------------------------------------------------------------------------------!
1537! Description:
1538! ------------
1539!> Compute module-specific profile and timeseries data
1540!------------------------------------------------------------------------------!
1541 SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max )
1542
1543
1544    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< statistical analysis mode
1545    INTEGER(iwp),      INTENT(IN) ::  sr       !<
1546    INTEGER(iwp),      INTENT(IN) ::  tn       !<
1547    INTEGER(iwp),      INTENT(IN) ::  dots_max !< maximum number of timeseries
1548
1549
1550    IF ( debug_output_timestep )  CALL debug_message( 'module-specific statistics', 'start' )
1551
1552    CALL dynamics_statistics( mode, sr, tn )
1553
1554    IF ( gust_module_enabled )  CALL gust_statistics( mode, sr, tn, dots_max )
1555    IF ( air_chemistry       )  CALL chem_statistics( mode, sr, tn )
1556    IF ( salsa               )  CALL salsa_statistics( mode, sr, tn )
1557
1558    IF ( user_module_enabled )  CALL user_statistics( mode, sr, tn )
1559
1560    IF ( debug_output_timestep )  CALL debug_message( 'module-specific statistics', 'end' )
1561
1562
1563 END SUBROUTINE module_interface_statistics
1564
1565
1566!------------------------------------------------------------------------------!
1567! Description:
1568! ------------
1569!> Read module-specific restart data globaly shared by all MPI ranks
1570!------------------------------------------------------------------------------!
1571 SUBROUTINE module_interface_rrd_global( found )
1572
1573
1574    LOGICAL, INTENT(INOUT) ::  found    !< flag if variable was found
1575
1576
1577    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'start' )
1578
1579    CALL dynamics_rrd_global( found ) ! ToDo: change interface to pass variable
1580
1581    IF ( .NOT. found )  CALL bio_rrd_global( found ) ! ToDo: change interface to pass variable
1582    IF ( .NOT. found )  CALL bcm_rrd_global( found ) ! ToDo: change interface to pass variable
1583    IF ( .NOT. found )  CALL flight_rrd_global( found ) ! ToDo: change interface to pass variable
1584    IF ( .NOT. found )  CALL gust_rrd_global( found ) ! ToDo: change interface to pass variable
1585    IF ( .NOT. found )  CALL lpm_rrd_global( found ) ! ToDo: change interface to pass variable
1586    IF ( .NOT. found )  CALL ocean_rrd_global( found ) ! ToDo: change interface to pass variable
1587    IF ( .NOT. found )  CALL stg_rrd_global ( found ) ! ToDo: change interface to pass variable
1588    IF ( .NOT. found )  CALL wtm_rrd_global( found ) ! ToDo: change interface to pass variable
1589    IF ( .NOT. found )  CALL surface_data_output_rrd_global( found )
1590
1591    IF ( .NOT. found )  CALL user_rrd_global( found ) ! ToDo: change interface to pass variable
1592
1593    IF ( debug_output )  CALL debug_message( 'module-specific read global restart data', 'end' )
1594
1595
1596 END SUBROUTINE module_interface_rrd_global
1597
1598
1599!------------------------------------------------------------------------------!
1600! Description:
1601! ------------
1602!> Write module-specific restart data globaly shared by all MPI ranks
1603!------------------------------------------------------------------------------!
1604 SUBROUTINE module_interface_wrd_global
1605
1606
1607    IF ( debug_output )  CALL debug_message( 'module-specific write global restart data', 'start' )
1608
1609    CALL dynamics_wrd_global
1610
1611    IF ( biometeorology )       CALL bio_wrd_global
1612    IF ( bulk_cloud_model )     CALL bcm_wrd_global
1613    IF ( virtual_flight )       CALL flight_wrd_global
1614    IF ( gust_module_enabled )  CALL gust_wrd_global
1615    IF ( ocean_mode )           CALL ocean_wrd_global
1616    IF ( syn_turb_gen )         CALL stg_wrd_global
1617    IF ( wind_turbine )         CALL wtm_wrd_global
1618    IF ( surface_output )       CALL surface_data_output_wrd_global
1619
1620    IF ( user_module_enabled )  CALL user_wrd_global
1621
1622    IF ( debug_output )  CALL debug_message( 'module-specific write global restart data', 'end' )
1623
1624
1625 END SUBROUTINE module_interface_wrd_global
1626
1627
1628!------------------------------------------------------------------------------!
1629! Description:
1630! ------------
1631!> Read module-specific restart data specific to local MPI ranks
1632!------------------------------------------------------------------------------!
1633 SUBROUTINE module_interface_rrd_local( map_index,                             &
1634                                        nxlf, nxlc, nxl_on_file,               &
1635                                        nxrf, nxrc, nxr_on_file,               &
1636                                        nynf, nync, nyn_on_file,               &
1637                                        nysf, nysc, nys_on_file,               &
1638                                        tmp_2d, tmp_3d, found )
1639
1640
1641    INTEGER(iwp), INTENT(IN)  ::  map_index    !<
1642    INTEGER(iwp), INTENT(IN)  ::  nxlc         !<
1643    INTEGER(iwp), INTENT(IN)  ::  nxlf         !<
1644    INTEGER(iwp), INTENT(IN)  ::  nxl_on_file  !<
1645    INTEGER(iwp), INTENT(IN)  ::  nxrc         !<
1646    INTEGER(iwp), INTENT(IN)  ::  nxrf         !<
1647    INTEGER(iwp), INTENT(IN)  ::  nxr_on_file  !<
1648    INTEGER(iwp), INTENT(IN)  ::  nync         !<
1649    INTEGER(iwp), INTENT(IN)  ::  nynf         !<
1650    INTEGER(iwp), INTENT(IN)  ::  nyn_on_file  !<
1651    INTEGER(iwp), INTENT(IN)  ::  nysc         !<
1652    INTEGER(iwp), INTENT(IN)  ::  nysf         !<
1653    INTEGER(iwp), INTENT(IN)  ::  nys_on_file  !<
1654    LOGICAL,      INTENT(INOUT) ::  found        !< flag if variable was found
1655
1656    REAL(wp), &
1657       DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), &
1658       INTENT(OUT) :: tmp_2d   !<
1659    REAL(wp), &
1660       DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), &
1661       INTENT(OUT) :: tmp_3d   !<
1662
1663
1664    IF ( debug_output )  CALL debug_message( 'module-specific read local restart data', 'start' )
1665
1666    CALL dynamics_rrd_local(                                                   &
1667           map_index,                                                          &
1668           nxlf, nxlc, nxl_on_file,                                            &
1669           nxrf, nxrc, nxr_on_file,                                            &
1670           nynf, nync, nyn_on_file,                                            &
1671           nysf, nysc, nys_on_file,                                            &
1672           tmp_2d, tmp_3d, found                                               &
1673        ) ! ToDo: change interface to pass variable
1674
1675    IF ( .NOT. found )  CALL bio_rrd_local(                                    &
1676                               found                                           &
1677                            )
1678
1679    IF ( .NOT. found )  CALL bcm_rrd_local(                                    &
1680                               map_index,                                      &
1681                               nxlf, nxlc, nxl_on_file,                        &
1682                               nxrf, nxrc, nxr_on_file,                        &
1683                               nynf, nync, nyn_on_file,                        &
1684                               nysf, nysc, nys_on_file,                        &
1685                               tmp_2d, tmp_3d, found                           &
1686                            ) ! ToDo: change interface to pass variable
1687
1688    IF ( .NOT. found )  CALL chem_rrd_local(                                   &
1689                               map_index,                                      &
1690                               nxlf, nxlc, nxl_on_file,                        &
1691                               nxrf, nxrc, nxr_on_file,                        &
1692                               nynf, nync, nyn_on_file,                        &
1693                               nysf, nysc, nys_on_file,                        &
1694                               tmp_3d, found                                   &
1695                            ) ! ToDo: change interface to pass variable
1696
1697!     IF ( .NOT. found )  CALL doq_rrd_local(                                    &
1698!                                map_index,                                      &
1699!                                nxlf, nxlc, nxl_on_file,                        &
1700!                                nxrf, nxrc, nxr_on_file,                        &
1701!                                nynf, nync, nyn_on_file,                        &
1702!                                nysf, nysc, nys_on_file,                        &
1703!                                tmp_3d_non_standard, found                      &
1704!                             ) ! ToDo: change interface to pass variable CALL doq_wrd_local
1705
1706    IF ( .NOT. found )  CALL gust_rrd_local(                                   &
1707                               map_index,                                      &
1708                               nxlf, nxlc, nxl_on_file,                        &
1709                               nxrf, nxrc, nxr_on_file,                        &
1710                               nynf, nync, nyn_on_file,                        &
1711                               nysf, nysc, nys_on_file,                        &
1712                               tmp_2d, tmp_3d, found                           &
1713                            ) ! ToDo: change interface to pass variable
1714
1715    IF ( .NOT. found )  CALL lpm_rrd_local(                                    &
1716                               map_index,                                      &
1717                               nxlf, nxlc, nxl_on_file,                        &
1718                               nxrf, nxrc, nxr_on_file,                        &
1719                               nynf, nync, nyn_on_file,                        &
1720                               nysf, nysc, nys_on_file,                        &
1721                               tmp_3d, found                                   &
1722                            ) ! ToDo: change interface to pass variable
1723
1724    IF ( .NOT. found )  CALL lsm_rrd_local(                                    &
1725                               map_index,                                      &
1726                               nxlf, nxlc, nxl_on_file,                        &
1727                               nxrf, nxrc, nxr_on_file,                        &
1728                               nynf, nync, nyn_on_file,                        &
1729                               nysf, nysc, nys_on_file,                        &
1730                               tmp_2d, found                                   &
1731                            ) ! ToDo: change interface to pass variable
1732
1733    IF ( .NOT. found )  CALL ocean_rrd_local(                                  &
1734                               map_index,                                      &
1735                               nxlf, nxlc, nxl_on_file,                        &
1736                               nxrf, nxrc, nxr_on_file,                        &
1737                               nynf, nync, nyn_on_file,                        &
1738                               nysf, nysc, nys_on_file,                        &
1739                               tmp_3d, found                                   &
1740                            ) ! ToDo: change interface to pass variable
1741
1742    IF ( .NOT. found )  CALL radiation_rrd_local(                              &
1743                               map_index,                                      &
1744                               nxlf, nxlc, nxl_on_file,                        &
1745                               nxrf, nxrc, nxr_on_file,                        &
1746                               nynf, nync, nyn_on_file,                        &
1747                               nysf, nysc, nys_on_file,                        &
1748                               tmp_2d, tmp_3d, found                           &
1749                            ) ! ToDo: change interface to pass variable
1750
1751    IF ( .NOT. found )  CALL salsa_rrd_local(                                  &
1752                               map_index,                                      &
1753                               nxlf, nxlc, nxl_on_file,                        &
1754                               nxrf, nxrc, nxr_on_file,                        &
1755                               nynf, nync, nyn_on_file,                        &
1756                               nysf, nysc, nys_on_file,                        &
1757                               tmp_3d, found                                   &
1758                            ) ! ToDo: change interface to pass variable
1759
1760    IF ( .NOT. found )  CALL usm_rrd_local(                                    &
1761                               map_index,                                      &
1762                               nxlf, nxlc, nxl_on_file,                        &
1763                               nxrf, nxr_on_file,                              &
1764                               nynf, nyn_on_file,                              &
1765                               nysf, nysc, nys_on_file,                        &
1766                               found                                           &
1767                            ) ! ToDo: change interface to pass variable
1768!
1769!-- Surface data do not need overlap data, so do not pass these information.
1770    IF ( .NOT. found )  CALL surface_data_output_rrd_local( found )
1771
1772    IF ( .NOT. found )  CALL user_rrd_local(                                   &
1773                               map_index,                                      &
1774                               nxlf, nxlc, nxl_on_file,                        &
1775                               nxrf, nxrc, nxr_on_file,                        &
1776                               nynf, nync, nyn_on_file,                        &
1777                               nysf, nysc, nys_on_file,                        &
1778                               tmp_3d, found                                   &
1779                            ) ! ToDo: change interface to pass variable
1780
1781    IF ( debug_output )  CALL debug_message( 'module-specific read local restart data', 'end' )
1782
1783
1784 END SUBROUTINE module_interface_rrd_local
1785
1786
1787!------------------------------------------------------------------------------!
1788! Description:
1789! ------------
1790!> Write module-specific restart data specific to local MPI ranks
1791!------------------------------------------------------------------------------!
1792 SUBROUTINE module_interface_wrd_local
1793
1794
1795    IF ( debug_output )  CALL debug_message( 'module-specific write local restart data', 'start' )
1796
1797    CALL dynamics_wrd_local
1798
1799    IF ( biometeorology )       CALL bio_wrd_local
1800    IF ( bulk_cloud_model )     CALL bcm_wrd_local
1801    IF ( air_chemistry )        CALL chem_wrd_local
1802    CALL doq_wrd_local
1803    IF ( gust_module_enabled )  CALL gust_wrd_local
1804    IF ( particle_advection )   CALL lpm_wrd_local
1805    IF ( land_surface )         CALL lsm_wrd_local
1806    IF ( ocean_mode )           CALL ocean_wrd_local
1807    IF ( radiation )            CALL radiation_wrd_local
1808    IF ( salsa )                CALL salsa_wrd_local
1809    IF ( urban_surface )        CALL usm_wrd_local
1810    IF ( surface_output )       CALL surface_data_output_wrd_local
1811
1812    IF ( user_module_enabled )  CALL user_wrd_local
1813
1814    IF ( debug_output )  CALL debug_message( 'module-specific write local restart data', 'end' )
1815
1816
1817 END SUBROUTINE module_interface_wrd_local
1818
1819
1820!------------------------------------------------------------------------------!
1821! Description:
1822! ------------
1823!> Perform module-specific last actions before the program terminates
1824!------------------------------------------------------------------------------!
1825 SUBROUTINE module_interface_last_actions
1826
1827
1828    IF ( debug_output )  CALL debug_message( 'module-specific last actions', 'start' )
1829
1830    CALL dynamics_last_actions
1831
1832    IF ( virtual_measurement )  CALL vm_last_actions
1833
1834    IF ( user_module_enabled )  CALL user_last_actions
1835
1836    IF ( debug_output )  CALL debug_message( 'module-specific last actions', 'end' )
1837
1838
1839 END SUBROUTINE module_interface_last_actions
1840
1841
1842 END MODULE module_interface
Note: See TracBrowser for help on using the repository browser.