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

Last change on this file since 4360 was 4360, checked in by suehring, 4 years ago

Bugfix in output of time-averaged plant-canopy quanities; Output of plant-canopy data only where tall canopy is defined; land-surface model: fix wrong location strings; tests: update urban test case; all source code files: copyright update

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