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

Last change on this file since 4127 was 4127, checked in by suehring, 5 years ago

Merge with branch resler: biomet- output of bio_mrt added; plant_canopy - separate vertical dimension for 3D output (to save disk space); radiation - remove unused plant canopy variables; urban-surface model - do not add anthropogenic heat during wall spin-up

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