source: palm/trunk/SOURCE/modules.f90 @ 1

Last change on this file since 1 was 1, checked in by raasch, 17 years ago

Initial repository layout and content

File size: 53.5 KB
Line 
1 MODULE advection
2
3
4!------------------------------------------------------------------------------!
5! Actual revisions:
6! -----------------
7!
8!
9! Former revisions:
10! -----------------
11! $Log: modules.f90,v $
12! Revision 1.95  2007/02/11 13:18:30  raasch
13! version 3.1b (last under RCS control)
14!
15! Revision 1.94  2006/08/22 14:12:18  raasch
16! +dz_max,
17! id_var_dopts extended for second dimension
18!
19! Revision 1.93  2006/08/04 14:50:58  raasch
20! +c_0, diss, dt_min_part, end_time_prel, particles_per_point, sgs_wfu/v/w_part,
21! use_sgs_for_particles, use_upstream_for_tke needed for the particle package,
22! +dt_sum, e_m, speed_x/y/z/_sgs in particle_type,
23! +dt_dopts, time_dopts, netcdf ids for output of particle time series,
24! do2d_unit and do3d_unit now defined as 2d-arrays, izuf renamed iran
25!
26! Revision 1.92  2006/06/02 15:21:45  raasch
27! +NetCDF ids for the shifted u- and v-grid, +data_output_xy/xz/yz
28!
29! Revision 1.91  2006/04/26 12:22:52  raasch
30! +threads_per_task,
31! sums_l, sums_l_l arrays changed to three dimensions
32!
33! Revision 1.90  2006/04/11 14:58:27  raasch
34! pl_spectra renamed data_output_sp, length of run_identifier increased to 80
35!
36! Revision 1.89  2006/03/14 12:55:52  raasch
37! Default for number_of_particle_groups changed to 1
38!
39! Revision 1.88  2006/03/03 14:26:53  letzel
40! control parameter topography now has length 40
41!
42! Revision 1.87  2006/03/03 08:50:25  raasch
43! Default value for surface_heatflux changed to 9999999.9
44!
45! Revision 1.86  2006/02/23 12:39:14  raasch
46! Version 3.0 with topography
47! index arrays nzb_2d replaced by several new variable dependend arrays
48! (e.g. nzb_u_inner), nzb_diff_2d removed, +new grid point
49! counters ngp_2dh_outer and ngp_3d_inner,
50! +skip time control parameters skip_time_..., +log_message,
51! particle parameters psl, psr, pss, psn, psb, pst, pdx, pdy, pdz
52! are now 1D arrays (1:max_number_of_particle_groups), default of
53! number_of_particle_groups changed to 999999, idum in particle_type renamed
54! tail_id,
55! +data_output, data_output_user, do2d, do3d, doav for new steering of data
56! output,
57! +type_x_int for ghost exchange of integer arrays,
58! +netcdf_64bit for supporting NetCDF 64-bit offset format,
59! +mixing_length_1d, dissipation_1d for steering the 1d-model,
60! +e_min (control parameter for minimum tke), +parameters for assuring a
61! constant volume flow, +prt_count, prt_start_index, particle_advection,
62! ebene renamed section, nt_anz renamed current_timestep_number, anz_y..
63! renamed ngp_y.., nanz_sums, nanz_2dh, nanz_3d renamed ngp_sums, ngp_2dh,
64! ngp_3d, respectively, pl1d_anz, pl2d_.._anz, plts_anz, pl3d_anz renamed
65! dopr_n, pl2d_.._no, dots_n, do3d_n, respectively,
66! ql_v and ql_vp now have the target attribute,
67! average_period_pr1d removed
68!
69! Revision 1.85  2005/12/06 16:40:56  raasch
70! Version 2.11c
71!
72! Revision 1.84  2005/10/20 15:38:23  raasch
73! +id_var_rnop_prt, some values of prt_var_names and prt_var_units changed
74!
75! Revision 1.83  2005/06/29 10:40:30  steinfeld
76! Scalars ug and vg changed into one-dimensional arrays;
77! +ug_surface, ug_vertical_gradient, ug_vertical_gradient_level,
78!  ug_vertical_gradient_level_ind,
79!  vg_surface, vg_vertical_gradient, vg_vertical_gradient_level,
80!  vg_vertical_gradient_level_ind
81!
82! Revision 1.82  2005/06/26 20:03:33  raasch
83! +ql_1, ql_2, ql_m, ql is now a pointer, +variables for cloud droplets (arrays
84! ql_v,ql_vp, pointer ql_c), gas_constant renamed r_d, latent_heat renamed l_v,
85! radius instead of diameter, radius + weighting factor included in
86! particle_type, pl2d and pl3d string length increased from 6 to 10,
87! default of call_psolver_at_all_substeps is TRUE
88!
89! Revision 1.81  2005/05/18 15:36:46  raasch
90! New module netcdf_control, +data_output_format, pl1d_callcount renamed
91! dopr_time_count,
92! default values of pl_spectra and spectra_direction changed
93!
94! Revision 1.80  2005/04/23 09:31:14  raasch
95! Implicit counters i renamed i9 due to declaration conflicts with i in other
96! subroutines (reported by Portland compiler),
97! crmax increased to 100, fcl_factor renamed cfl_factor
98!
99! Revision 1.79  2005/03/26 20:40:48  raasch
100! +variables for non-cyclic boundary conditions, call_psolver_at_all_substeps,
101! default value for residual limit increased from 1E-6 to 1E-4
102!
103! Revision 1.78  2004/04/30 12:30:01  raasch
104! idum added in particle_type for better alignment (decalpha),
105! DATA statements replaced by (/ .../) because of internal compiler errors
106! on decalpha, + indices for direct transpositions z --> y,
107! dt_max_1d increased to 300.0 (from 60.0), +grid_matching,
108! arrays cross_ts_numbers and cross_ts_number_count enlarged,
109! impulse_advec renamed momentum_advec
110!
111! Revision 1.77  2004/01/30 10:30:26  raasch
112! +index arrays nzb_2d, nzb_diff_2d
113!
114! Revision 1.76  2004/01/28 15:25:15  raasch
115! +array tsc for timestep steering, +tu_m, tv_m etc. pointer for additional
116! tendencies needed for Runge-Kutta scheme, +intermediate_timestep_count(_max)
117! type log changed to logpoint due to name conflict with intrinsic log
118!
119! Revision 1.75  2003/10/29 08:58:54  raasch
120! +mg_cycles, mg_switch_to_pe0, mg_switch_to_pe0_level in module
121! control_parameters,
122! +mg_loc_ind in module indices, variables related to particle groups added
123! to module particle_attributes
124!
125! Revision 1.74  2003/08/01 08:40:59  raasch
126! +isclice_dvrp, lock_steering_update, slicer_position_dvrp,
127! slicer_range_limits_dvrp in module dvrp_variables
128!
129! Revision 1.73  2003/05/09 14:41:11  raasch
130! New version number 2.7
131!
132! Revision 1.72  2003/04/25 18:54:39  raasch
133! Module mpi added in module pegrid in case of linux cluster
134!
135! Revision 1.71  2003/04/16 13:27:33  raasch
136! Arrays cross_ts_uy... enlarged
137!
138! Revision 1.70  2003/04/16 13:07:43  raasch
139! Array cross_ts_profiles enlarged
140!
141! Revision 1.69  2003/03/16 09:42:07  raasch
142! Two underscores (_) are placed in front of all define-strings
143!
144! Revision 1.68  2003/03/14 13:44:52  raasch
145! +random_generator in control_parameters
146!
147! Revision 1.67  2003/03/12 16:34:19  raasch
148! +tasks_per_node in pegrid
149!
150! Revision 1.66  2003/03/04 11:32:50  raasch
151! +type steering, +steering_dvrp in dvrp_variables
152!
153! Revision 1.65  2002/12/19 15:52:37  raasch
154! +initial_wallclock_time in cpulog, +myid_char_14 in pegrid,
155! default value for termination_time_needed now set in check_parameters,
156! array dl_grid removed, +wall_adjustment_factor, dt_restart, restart_time,
157! time_restart
158!
159! Revision 1.64  2002/09/12 13:05:44  raasch
160! Default values of *_vertical_gradient_level changed from 100000.0 to -1.0,
161! +molecular_viscosity, density_ratio
162!
163! Revision 1.63  2002/06/11 13:12:29  raasch
164! Entrys buoyancy, diffusion_e, diffusion_s, diffusion_u, diffusion_v and
165! diffusion_w removed from module pointer_interfaces,
166! length of character variables host + psolver increased to 64 and 16
167!
168! Revision 1.62  2002/05/02 18:53:18  raasch
169! Module singleton moved to a separate file. Arrays e_3, pt_3, q_3, u_3, v_3,
170! w_3 re-introduced. Pointer e_p, pt_p, q_p, u_p, v_p, w_p re-introduced.
171!
172! Revision 1.61  2002/04/16 08:09:32  raasch
173! Information about speed components and start positions included in
174! particle_type, +dt_write_particle_data, particle_advection_start,
175! time_write_particle_data and parameters for particle boundary conditions,
176! +vertical_particle_advection,
177! + variables for scalar boundary conditions and initialization
178!
179! Revision 1.60  2001/11/12 16:05:01  raasch
180! +read_particles_from_restartfile
181!
182! Revision 1.58  2001/09/04 12:00:52  raasch
183! New version number 2.3b
184!
185! Revision 1.57  2001/08/21 09:52:08  raasch
186! +comm_palm, maximum_number_of_tailpoints, maximum_tailpoint_age,
187! minimum_tailpoint_distance, particle_tail_coordinates, superelevation_x,
188! superelevation_y, wall_adjustment
189!
190! Revision 1.56  2001/07/20 13:09:07  raasch
191! +grid_level, maximum_grid_level, cycle_mg, gamma_mg, ngsrb,
192! residual_limit in control_parameters, +dzu_mg, dzw_mg, f1_mg, f2_mg, f3_mg
193! in arrays_3d, +superelevation in dvrp_variables, +nxl_mg .. nzt_mg in
194! indices, +ddx2_mg, ddy2_mg in grid_variables
195!
196! Revision 1.55  2001/07/12 12:13:24  raasch
197! default of bc_e_b changed from (u*)**2+neumann to neumann,
198! +particle_maximum_age, psl-pst, pdx-pdz,
199! default values defined for dvrp_directory, dvrp_file, dvrp_host, dvrp_password
200! SAVE-statements added to all modules
201!
202! Revision 1.54  2001/03/30 07:35:57  raasch
203! Interface for advec_s_bc changed, interface for production_e eliminated,
204! arrays work, work1, e_3, pt_3, q_3, u_3, v_3, w_3 removed,
205! pointer e_p, pt_p, q_p, u_p, v_p, w_p removed,
206! -nw, nw1,
207! Translation of remaining German identifiers (variables, subroutines, etc.)
208!
209! Revision 1.53  2001/01/30 01:57:16  raasch
210! +passive_scalar
211!
212! Revision 1.51  2001/01/26 00:31:49  raasch
213! +fft_method, use_surface_fluxes in steuer, +module singleton,
214! +write_particle_informations in particle_attributes
215!
216! Revision 1.49  2001/01/05 15:13:16  raasch
217! new module spectrum for computing spectra, +average_count_sp,
218! averaging_interval_sp, dt_dosp, time_average_sp, time_dosp in module steuer,
219! +spectrum_x, spectrum_y in module statistik
220!
221! Revision 1.48  2001/01/02 17:31:36  raasch
222! openfile has the new type file_status, version updated to 2.1a
223!
224! Revision 1.47  2000/12/30 18:48:53  raasch
225! Default value of mode_dvrp changed
226!
227! Revision 1.46  2000/12/28 13:21:35  raasch
228! version updated to 2.1
229!
230! Revision 1.45  2000/12/28 13:19:35  raasch
231! +mode_dvrp, +interval_..._dvrp, REAL*4 changed to REAL in particle_attributes,
232! +dt_prel, time_prel, -particle_transport
233!
234! Revision 1.44  2000/07/03 13:02:32  raasch
235! version updated to 2.0b
236!
237! Revision 1.43  2000/07/03 12:59:53  raasch
238! +dvrp_directory, dvrp_host, dvrp_password, dvrp_username,
239! new module pointer_interfaces which includes interfaces for subroutines with
240! pointer arguments called in prognostic_equations
241!
242! Revision 1.42  2000/04/27 07:35:56  raasch
243! npex and npey must be defined in general (not only for parallel case)
244!
245! Revision 1.41  2000/04/27 07:07:14  raasch
246! +pt_slope_offset, pt_slope_ref, npex, npey, dt_dvrp, time_dvrp,
247! new module dvrp_variables
248! -dt_plisos, dt_plpart, isosurface_filecount, time_plisos, time_plpart
249! Version 2.0a, all comments translated into English, old revision remarks
250! deleted
251!
252! Revision 1.40  2000/04/13 13:17:25  schroeter
253! Felder fuer Wolkenphysik zu Modul arrays3d hinzugefuegt, neues Modul
254! (cloud_parameters) fuer Wolkenphysikparameter eingefuegt
255!
256! Revision 1.39  2000/01/10  10:05:11  10:05:11  raasch (Siegfried Raasch)
257! +use_ug_for_galilei_tr, Aufteilung der zeitabhaengigen Groessen in pointer
258! und targets, + timestep_count
259!
260! Revision 1.38  1999/12/28 10:06:52  raasch
261! +Variablen fuer Plot von Isooberflaechen
262!
263! Revision 1.37  1999/11/25 16:26:38  raasch
264! Neues Modul particle_attributes,
265! +Variablen fuer Partikelverlagerung: particle_transport, dt_plpart,
266! Version 1.1e
267!
268! Revision 1.1  1997/07/24 11:21:26  raasch
269! Initial revision
270!
271!
272! Description:
273! ------------
274! Definition of variables for special advection schemes
275!------------------------------------------------------------------------------!
276
277    REAL ::  spl_gamma_x, spl_gamma_y
278
279    REAL, DIMENSION(:), ALLOCATABLE   ::  aex, bex, dex, eex, spl_z_x, spl_z_y
280    REAL, DIMENSION(:,:), ALLOCATABLE ::  spl_tri_x, spl_tri_y, spl_tri_zu, &
281                                          spl_tri_zw
282
283    SAVE
284
285 END MODULE advection
286
287
288
289
290 MODULE array_kind
291
292!------------------------------------------------------------------------------!
293! Description:
294! ------------
295! Definition of type parameters (used for the definition of single or double
296! precision variables)
297!------------------------------------------------------------------------------!
298
299    INTEGER, PARAMETER ::  dpk = SELECTED_REAL_KIND( 12 ), &
300                           spk = SELECTED_REAL_KIND( 6 )
301
302    SAVE
303
304 END MODULE array_kind
305
306
307
308
309 MODULE arrays_3d
310
311!------------------------------------------------------------------------------!
312! Description:
313! ------------
314! Definition of all arrays defined on the computational grid
315!------------------------------------------------------------------------------!
316
317    USE array_kind
318
319    REAL, DIMENSION(:), ALLOCATABLE ::                                         &
320          ddzu, dd2zu, dzu, ddzw, dzw, km_damp_x, km_damp_y, l_grid, pt_init,  &
321          q_init, rdf, ug, u_init, uvmean_outflow, uvmean_outflow_l, vg,       &
322          v_init, zu, zw
323
324    REAL, DIMENSION(:,:), ALLOCATABLE ::                                       &
325          dzu_mg, dzw_mg, f1_mg, f2_mg, f3_mg, pt_slope_ref, qs, ts, us, z0
326
327    REAL, DIMENSION(:,:), ALLOCATABLE, TARGET ::                               &
328          qsws_1, qsws_2, rif_1, rif_2, shf_1, shf_2, usws_1, usws_2,          &
329          vsws_1, vsws_2
330
331    REAL, DIMENSION(:,:), POINTER ::                                           &
332          qsws, qsws_m, rif, rif_m, shf, shf_m, usws, usws_m, vsws, vsws_m
333
334    REAL, DIMENSION(:,:,:), ALLOCATABLE ::                                     &
335          d, diss, l_wall, tend
336
337    REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                             &
338          ql_v, ql_vp
339
340    REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET ::                             &
341          e_1, e_2, e_3, kh_1, kh_2, km_1, km_2, pt_1, pt_2, pt_3, q_1, q_2,   &
342          q_3, ql_1, ql_2, u_1, u_2, u_3, v_1, v_2, v_3, vpt_1, vpt_2, w_1,    &
343          w_2, w_3
344
345    REAL, DIMENSION(:,:,:), POINTER ::                                         &
346          e, e_m, e_p, kh, kh_m, km, km_m, p, pt, pt_m, pt_p, q, q_m, q_p, ql, &
347          ql_c, te_m, tpt_m, tq_m, tu_m, tv_m, tw_m, u, u_m, u_p, v, v_m, v_p, &
348          vpt, vpt_m, w, w_m, w_p
349                                                   
350
351    SAVE
352
353 END MODULE arrays_3d
354
355
356
357
358 MODULE averaging
359
360!------------------------------------------------------------------------------!
361! Description:
362! ------------
363! Definition of variables needed for time-averaging of 2d/3d data
364!------------------------------------------------------------------------------!
365
366    REAL, DIMENSION(:,:), ALLOCATABLE ::  lwp_av, ts_av, us_av
367
368    REAL, DIMENSION(:,:,:), ALLOCATABLE, TARGET :: &
369          e_av, p_av, pc_av, pr_av, pt_av, q_av, ql_av, ql_c_av, ql_v_av, &
370          ql_vp_av, qv_av, s_av, u_av, v_av, vpt_av, w_av
371
372 END MODULE averaging
373
374
375
376
377 MODULE cloud_parameters
378
379!------------------------------------------------------------------------------!
380! Description:
381! ------------
382! Definition of variables and constants for cloud physics
383!------------------------------------------------------------------------------!
384
385    REAL  ::  b_cond, cp = 1005.0, diff_coeff_l = 0.23E-4,                     &
386              effective_coll_efficiency, l_d_cp, l_d_r, l_d_rv, l_v = 2.5E+06, &
387              mass_of_solute, molecular_weight_of_solute,                      &
388              prec_time_const = 0.001, ql_crit = 0.0005, rho_l = 1.0E3,        &
389              r_d = 287.0, r_v = 461.51, rho_surface,                          &
390              thermal_conductivity_l = 2.43E-2
391
392    REAL, DIMENSION(:), ALLOCATABLE :: hydro_press, pt_d_t, t_d_pt
393
394    SAVE
395
396 END MODULE cloud_parameters
397
398
399
400
401 MODULE constants
402
403!------------------------------------------------------------------------------!
404! Description:
405! ------------
406! Definition of general constants
407!------------------------------------------------------------------------------!
408
409    REAL    ::  pi = 3.141592654
410
411    SAVE
412
413 END MODULE constants
414
415
416
417
418 MODULE control_parameters
419
420!------------------------------------------------------------------------------!
421! Description:
422! ------------
423! Definition of parameters for program control
424!------------------------------------------------------------------------------!
425
426    TYPE plot_precision
427       CHARACTER (LEN=6) ::  variable
428       INTEGER           ::  precision
429    END TYPE plot_precision
430
431    TYPE(plot_precision), DIMENSION(100) ::  plot_3d_precision =               &
432                        (/ plot_precision( 'u', 2 ), plot_precision( 'v', 2 ), &
433                           plot_precision( 'w', 2 ), plot_precision( 'p', 5 ), &
434                           plot_precision( 'pt', 2 ),                          &
435                           ( plot_precision( ' ', 1 ), i9 = 1,95 ) /)
436
437    TYPE file_status
438       LOGICAL ::  opened, opened_before
439    END TYPE file_status
440
441    TYPE(file_status), DIMENSION(200) :: openfile = file_status(.FALSE.,.FALSE.)
442
443
444    CHARACTER (LEN=1)   ::  cycle_mg = 'w', timestep_reason = ' '
445    CHARACTER (LEN=5)   ::  write_binary = 'false'
446    CHARACTER (LEN=6)   ::  grid_matching = 'match'
447    CHARACTER (LEN=8)   ::  run_date, run_time
448    CHARACTER (LEN=9)   ::  simulated_time_chr
449    CHARACTER (LEN=12)  ::  version = 'PALM   3.1b'
450    CHARACTER (LEN=16)  ::  momentum_advec = 'pw-scheme', &
451                            psolver = 'poisfft', &
452                            scalar_advec = 'pw-scheme'
453    CHARACTER (LEN=20)  ::  bc_e_b = 'neumann', bc_lr = 'cyclic', &
454                            bc_ns = 'cyclic', &
455                            bc_p_b = 'neumann', bc_p_t = 'dirichlet', &
456                            bc_pt_b = 'dirichlet', bc_pt_t = 'neumann', &
457                            bc_q_b = 'dirichlet', bc_q_t = 'neumann', &
458                            bc_s_b = 'dirichlet', bc_s_t = 'neumann', &
459                            bc_uv_b = 'dirichlet', bc_uv_t = 'dirichlet', &
460                            dissipation_1d = 'as_in_3d_model', &
461                            fft_method = 'system-specific', &
462                            mixing_length_1d = 'as_in_3d_model', &
463                            random_generator = 'numerical-recipes', &
464                            timestep_scheme = 'runge-kutta-3'
465    CHARACTER (LEN=40)  ::  avs_data_file, topography = 'flat'
466    CHARACTER (LEN=64)  ::  host
467    CHARACTER (LEN=80)  ::  log_message, run_description_header, run_identifier
468    CHARACTER (LEN=100) ::  initializing_actions = ' '
469
470    CHARACTER (LEN=7),  DIMENSION(100) ::  do3d_comp_prec = ' '
471    CHARACTER (LEN=10), DIMENSION(10)  ::  data_output_format = ' '
472    CHARACTER (LEN=10), DIMENSION(100) ::  data_output = ' ',    &
473                                           data_output_pr = ' ', &
474                                           data_output_ts = ' ', &
475                                           data_output_user = ' ', doav = ' '
476    CHARACTER (LEN=20), DIMENSION(10)  ::  netcdf_precision = ' '
477
478    CHARACTER (LEN=10), DIMENSION(0:1,100) ::  do2d = ' ', do3d = ' '
479
480    INTEGER ::  average_count_pr = 0, average_count_sp = 0, &
481                average_count_3d = 0, current_timestep_number = 0, &
482                dist_range = 0, disturbance_level_ind_b, &
483                disturbance_level_ind_t, doav_n = 0, dopr_n = 0, &
484                dopr_time_count = 0, dopts_time_count = 0, &
485                dosp_time_count = 0, dots_n = 0, dots_time_count = 0, &
486                do2d_xy_n = 0, do2d_xz_n = 0, do2d_yz_n = 0, do3d_avs_n = 0, &
487                dvrp_filecount = 0, dz_stretch_level_index, gamma_mg, &
488                grid_level, ibc_e_b, ibc_p_b, ibc_p_t, ibc_pt_b, ibc_pt_t, &
489                ibc_q_b, ibc_q_t, ibc_uv_b, ibc_uv_t, &
490                inflow_disturbance_begin = -1, inflow_disturbance_end = -1, &
491                intermediate_timestep_count, intermediate_timestep_count_max, &
492                iran = -1234567, last_dt_change = 0, maximum_grid_level, &
493                mgcycles = 0, mg_cycles = -1, mg_switch_to_pe0_level = 0, &
494                ngsrb = 2, nsor = 20, nsor_ini = 100, n_sor, &
495                normalizing_region = 0, nz_do1d, nz_do3d = -9999, &
496                outflow_damping_width = -1, prt_time_count = 0, runnr = 0, &
497                skip_do_avs = 0, timestep_count = 0
498
499    INTEGER ::  dist_nxl(0:1), dist_nxr(0:1), dist_nyn(0:1), dist_nys(0:1), &
500                do2d_no(0:1) = 0, do2d_xy_time_count(0:1), &
501                do2d_xz_time_count(0:1), do2d_yz_time_count(0:1), &
502                do3d_no(0:1) = 0, do3d_time_count(0:1), &
503                pt_vertical_gradient_level_ind(10) = -9999, &
504                q_vertical_gradient_level_ind(10) = -9999, &
505                section(100,3), section_xy(100) = -9999, &
506                section_xz(100) = -9999, section_yz(100) = -9999, &
507                ug_vertical_gradient_level_ind(10) = -9999, &
508                vg_vertical_gradient_level_ind(10) = -9999
509
510    INTEGER, DIMENSION(:), ALLOCATABLE ::  grid_level_count
511
512    LOGICAL ::  adjust_mixing_length = .FALSE., avs_output = .FALSE., &
513                call_psolver_at_all_substeps = .TRUE., &
514                cloud_droplets = .FALSE., cloud_physics = .FALSE., &
515                conserve_volume_flow = .FALSE., constant_diffusion = .FALSE., &
516                constant_heatflux = .TRUE., constant_waterflux = .TRUE., &
517                create_disturbances = .TRUE., cut_spline_overshoot = .TRUE., &
518                data_output_2d_on_each_pe = .TRUE., do2d_at_begin = .FALSE., &
519                do3d_at_begin = .FALSE., do3d_compress = .FALSE., &
520                do_sum = .FALSE., dt_changed = .FALSE., dt_fixed = .FALSE., &
521                disturbance_created = .FALSE., &
522                first_call_advec_particles = .TRUE., &
523                force_print_header = .FALSE., galilei_transformation = .FALSE., &
524                inflow_l = .FALSE., inflow_n = .FALSE., inflow_r = .FALSE., &
525                inflow_s = .FALSE., iso2d_output = .FALSE., &
526                mg_switch_to_pe0 = .FALSE., moisture = .FALSE., &
527                netcdf_output = .FALSE., netcdf_64bit = .FALSE., &
528                outflow_l = .FALSE., outflow_n = .FALSE., outflow_r = .FALSE., &
529                outflow_s = .FALSE., passive_scalar = .FALSE., &
530                prandtl_layer = .TRUE., precipitation = .FALSE., &
531                profil_output = .FALSE., radiation = .FALSE., &
532                random_heatflux = .FALSE., run_control_header = .FALSE., &
533                sloping_surface = .FALSE., stop_dt = .FALSE., &
534                terminate_run = .FALSE., use_prior_plot1d_parameters = .FALSE., &
535                use_surface_fluxes = .FALSE., use_ug_for_galilei_tr = .TRUE., &
536                use_upstream_for_tke = .FALSE., wall_adjustment = .TRUE.
537
538    LOGICAL ::  data_output_xy(0:1) = .FALSE., data_output_xz(0:1) = .FALSE., &
539                data_output_yz(0:1) = .FALSE.
540
541    REAL ::  advected_distance_x = 0.0, advected_distance_y = 0.0, &
542             alpha_surface = 0.0, asselin_filter_factor = 0.1, &
543             averaging_interval = 0.0, averaging_interval_pr = 9999999.9, &
544             averaging_interval_sp = 9999999.9, bc_pt_t_val, bc_q_t_val, &
545             building_height = 50.0, building_length_x = 50.0, &
546             building_length_y = 50.0, building_wall_left = 9999999.9, &
547             building_wall_south = 9999999.9, cfl_factor = -1.0, &
548             cos_alpha_surface, disturbance_amplitude = 0.25, &
549             disturbance_energy_limit = 0.01, disturbance_level_b = -1.0, &
550             disturbance_level_t = -1.0, dt = -1.0, dt_averaging_input = 0.0, &
551             dt_averaging_input_pr = 9999999.9, dt_data_output = 9999999.9, &
552             dt_data_output_av = 9999999.9, dt_disturb = 9999999.9, &
553             dt_dopr = 9999999.9, dt_dopr_listing = 9999999.9, &
554             dt_dopts = 9999999.9, dt_dosp = 9999999.9, dt_dots = 9999999.9, &
555             dt_do2d_xy = 9999999.9, dt_do2d_xz = 9999999.9, &
556             dt_do2d_yz = 9999999.9, dt_do3d = 9999999.9, dt_dvrp = 9999999.9, &
557             dt_max = 20.0, dt_prel = 9999999.9, dt_restart = 9999999.9, &
558             dt_run_control = 60.0, dt_3d = -1.0, dz = -1.0, &
559             dz_max = 9999999.9, dz_stretch_factor = 1.08, &
560             dz_stretch_level = 100000.0, e_min = 0.0, end_time = 0.0, &
561             f = 0.0, fs = 0.0, g = 9.81, kappa = 0.4, km_constant = -1.0, &
562             km_damp_max = -1.0, long_filter_factor = 0.0, &
563             maximum_cpu_time_allowed = 0.0, molecular_viscosity = 1.461E-5, &
564             old_dt = 1.0E-10, omega = 7.29212E-5, omega_sor = 1.8, &
565             overshoot_limit_e = 0.0, overshoot_limit_pt = 0.0, &
566             overshoot_limit_u = 0.0, overshoot_limit_v = 0.0, &
567             overshoot_limit_w = 0.0, particle_maximum_age = 9999999.9, &
568             phi = 55.0, prandtl_number = 1.0, pt_slope_offset = 0.0, &
569             pt_surface = 300.0, pt_surface_initial_change = 0.0, &
570             q_surface = 0.0, q_surface_initial_change = 0.0, &
571             rayleigh_damping_factor = -1.0, rayleigh_damping_height = -1.0, &
572             residual_limit = 1.0E-4, restart_time = 9999999.9, rif_max = 1.0, &
573             rif_min = -5.0, roughness_length = 0.1, simulated_time = 0.0, &
574             simulated_time_at_begin, sin_alpha_surface, &
575             skip_time_data_output = 0.0, skip_time_data_output_av = 9999999.9,&
576             skip_time_dopr = 9999999.9, skip_time_dosp = 9999999.9, &
577             skip_time_do2d_xy = 9999999.9, skip_time_do2d_xz = 9999999.9, &
578             skip_time_do2d_yz = 9999999.9, skip_time_do3d = 9999999.9, &
579             surface_heatflux = 9999999.9, surface_pressure = 1013.25, &
580             surface_scalarflux = 0.0, surface_waterflux = 0.0, &
581             s_surface = 0.0, s_surface_initial_change = 0.0, &
582             termination_time_needed = -1.0, time_disturb = 0.0, &
583             time_dopr = 0.0, time_dopr_av = 0.0, time_dopr_listing = 0.0, &
584             time_dopts = 0.0, time_dosp = 0.0, time_dosp_av = 0.0, &
585             time_dots = 0.0, time_do2d_xy = 0.0, time_do2d_xz = 0.0, &
586             time_do2d_yz = 0.0, time_do3d = 0.0, time_do_av = 0.0, &
587             time_do_sla = 0.0, time_dvrp = 0.0, time_prel = 0.0, &
588             time_restart = 9999999.9, time_run_control = 0.0, &
589             ug_surface = 0.0, u_gtrans = 0.0, ups_limit_e = 0.0, &
590             ups_limit_pt = 0.0, ups_limit_u = 0.0, ups_limit_v = 0.0, &
591             ups_limit_w = 0.0, vg_surface = 0.0, v_gtrans = 0.0, &
592             wall_adjustment_factor = 1.8, z_max_do1d = -1.0, &
593             z_max_do1d_normalized = -1.0, z_max_do2d = -1.0
594
595    REAL ::  do2d_xy_last_time(0:1) = -1.0, do2d_xz_last_time(0:1) = -1.0, &
596             do2d_yz_last_time(0:1) = -1.0, pt_vertical_gradient(10) = 0.0, &
597             pt_vertical_gradient_level(10) = -1.0, &
598             q_vertical_gradient(10) = 0.0, &
599             q_vertical_gradient_level(10) = -1.0, &
600             s_vertical_gradient(10) = 0.0, &
601             s_vertical_gradient_level(10) = -1.0, threshold(20) = 0.0, &
602             tsc(10) = (/ 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 /), &
603             ug_vertical_gradient(10) = 0.0, &
604             ug_vertical_gradient_level(10) = -1.0, &
605             vg_vertical_gradient(10) = 0.0, &
606             vg_vertical_gradient_level(10) = -1.0, &
607             volume_flow(1:2) = 0.0, volume_flow_area(1:2) = 0.0, &
608             volume_flow_initial(1:2) = 0.0, wall_heatflux(0:4) = 0.0
609
610
611    SAVE
612
613 END MODULE control_parameters
614
615
616
617
618 MODULE cpulog
619
620!------------------------------------------------------------------------------!
621! Description:
622! ------------
623! Definition of variables for cpu-time measurements
624!------------------------------------------------------------------------------!
625
626    REAL ::  initial_wallclock_time
627
628    TYPE logpoint
629       REAL               ::  isum, ivect, mean, mtime, mtimevec, sum, vector
630       INTEGER            ::  counts
631       CHARACTER (LEN=20) ::  place
632    END TYPE logpoint
633
634    TYPE(logpoint), DIMENSION(100) ::  log_point = logpoint( 0.0, 0.0, 0.0,   &
635                                       0.0, 0.0, 0.0, 0.0, 0, ' ' ),          &
636                                       log_point_s = logpoint( 0.0, 0.0, 0.0, &
637                                       0.0, 0.0, 0.0, 0.0, 0, ' ' )
638
639    SAVE
640
641 END MODULE cpulog
642
643
644
645
646 MODULE dvrp_variables
647
648!------------------------------------------------------------------------------!
649! Description:
650! ------------
651! Definition of variables used with dvrp-software
652!------------------------------------------------------------------------------!
653
654    CHARACTER (LEN=10) ::  dvrp_output = 'rtsp'
655
656    CHARACTER (LEN=20), DIMENSION(10) ::  mode_dvrp = &
657                                     (/ ( '                    ', i9 = 1,10 ) /)
658
659    CHARACTER (LEN=80) ::  dvrp_directory = 'default',                    &
660                           dvrp_file      = 'default',                    &
661                           dvrp_host      = 'origin.rvs.uni-hannover.de', &
662                           dvrp_password  = '********',                   &
663                           dvrp_username  = ' '
664
665    INTEGER ::  dvrp_colourtable_entries = 4, islice_dvrp, nx_dvrp, ny_dvrp, &
666                nz_dvrp
667
668    INTEGER, DIMENSION(10) ::  slicer_position_dvrp
669
670    LOGICAL ::  cyclic_dvrp = .FALSE., lock_steering_update = .FALSE., &
671                use_seperate_pe_for_dvrp_output = .FALSE.
672
673    REAL    ::  superelevation = 1.0, superelevation_x = 1.0, &
674                superelevation_y = 1.0
675
676#if defined( __decalpha )
677    REAL, DIMENSION(2,10)  ::  slicer_range_limits_dvrp = (/ &
678                                -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, &
679                                -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, &
680                                -1.0, 1.0, -1.0, 1.0 /)
681
682    REAL, DIMENSION(2,100) ::  interval_values_dvrp, interval_h_dvrp =       &
683                               (/ 270.0, 225.0, 225.0, 180.0, 70.0, 25.0,    &
684                                  25.0, -25.0, ( 0.0, i9 = 1, 192 ) /),      &
685                               interval_l_dvrp = 0.5, interval_s_dvrp = 1.0, &
686                               interval_a_dvrp = 0.0
687#else
688    REAL, DIMENSION(2,10)  ::  slicer_range_limits_dvrp
689
690    REAL, DIMENSION(2,100) ::  interval_values_dvrp, interval_h_dvrp,        &
691                               interval_l_dvrp = 0.5, interval_s_dvrp = 1.0, &
692                               interval_a_dvrp = 0.0
693
694    DATA  slicer_range_limits_dvrp / -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, &
695                                     -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, &
696                                     -1.0, 1.0, -1.0, 1.0, -1.0, 1.0, &
697                                     -1.0, 1.0 /
698
699    DATA  interval_h_dvrp / 270.0, 225.0, 225.0, 180.0, 70.0, 25.0, &
700                            25.0, -25.0, 192 * 0.0 /
701#endif
702
703    REAL, DIMENSION(:), ALLOCATABLE ::  xcoor_dvrp, ycoor_dvrp, zcoor_dvrp
704
705    TYPE steering
706       CHARACTER (LEN=20) ::  name
707       REAL               ::  min, max
708       INTEGER            ::  imin, imax
709    END TYPE steering
710
711    TYPE(steering), DIMENSION(:), ALLOCATABLE ::  steering_dvrp
712
713    SAVE
714
715 END MODULE dvrp_variables
716
717
718
719
720 MODULE grid_variables
721
722!------------------------------------------------------------------------------!
723! Description:
724! ------------
725! Definition of grid spacings
726!------------------------------------------------------------------------------!
727
728    REAL ::  ddx, ddx2, dx = 1.0, dx2, ddy, ddy2, dy = 1.0, dy2
729
730    REAL, DIMENSION(:), ALLOCATABLE ::  ddx2_mg, ddy2_mg
731
732    REAL, DIMENSION(:,:), ALLOCATABLE ::  fwxm, fwxp, fwym, fwyp, fxm, fxp, &
733                                          fym, fyp, wall_e_x, wall_e_y, &
734                                          wall_u, wall_v, wall_w_x, wall_w_y
735
736    SAVE
737
738 END MODULE grid_variables
739
740
741
742
743 MODULE indices
744
745!------------------------------------------------------------------------------!
746! Description:
747! ------------
748! Definition of array bounds and number of gridpoints
749!------------------------------------------------------------------------------!
750
751    INTEGER ::  ngp_sums, nnx, nx = 0, nxa, nxl, nxr, nxra, nny, ny = 0, nya,  &
752                nyn, nyna, nys, nnz, nz = 0, nza, nzb, nzb_diff, nzt, nzta,    &
753                uxrp = 0, vynp = 0
754
755    INTEGER, DIMENSION(:), ALLOCATABLE ::                                      &
756                ngp_2dh, ngp_3d, ngp_3d_inner,                                 &
757                nnx_pe, nny_pe, nxl_mg, nxr_mg, nyn_mg, nys_mg, nzt_mg
758
759    INTEGER, DIMENSION(:,:), ALLOCATABLE ::                                    &
760                ngp_2dh_outer, mg_loc_ind, nzb_diff_s_inner, nzb_diff_s_outer, &
761                nzb_diff_u, nzb_diff_v, nzb_inner, nzb_outer, nzb_s_inner,     &
762                nzb_s_outer, nzb_u_inner, nzb_u_outer, nzb_v_inner,            &
763                nzb_v_outer, nzb_w_inner, nzb_w_outer, nzb_2d
764
765    SAVE
766
767 END MODULE indices
768
769
770
771
772 MODULE interfaces
773
774!------------------------------------------------------------------------------!
775! Description:
776! ------------
777! Interfaces for special subroutines which use optional parameters
778!------------------------------------------------------------------------------!
779
780    INTERFACE
781
782       SUBROUTINE cpu_log( log_event, place, modus, barrierwait )
783
784          USE cpulog
785
786          CHARACTER (LEN=*)           ::  modus, place
787          CHARACTER (LEN=*), OPTIONAL ::  barrierwait
788          TYPE(logpoint)              ::  log_event
789
790       END SUBROUTINE cpu_log
791
792    END INTERFACE
793
794
795
796    INTERFACE
797
798       SUBROUTINE global_min_max ( i1, i2, j1, j2, k1, k2, feld, mode, wert, &
799                                   wert_ijk, wert1, wert1_ijk )
800          CHARACTER (LEN=*), INTENT(IN) ::  mode
801          INTEGER, INTENT(IN)           ::  i1, i2, j1, j2, k1, k2
802          INTEGER                       ::  wert_ijk(3)
803          INTEGER, OPTIONAL             ::  wert1_ijk(3)
804          REAL                          ::  wert
805          REAL, OPTIONAL                ::  wert1
806          REAL, INTENT(IN)              ::  feld(i1:i2,j1:j2,k1:k2)
807
808       END SUBROUTINE global_min_max
809
810    END INTERFACE
811
812    SAVE
813
814 END MODULE interfaces
815
816
817
818 MODULE pointer_interfaces
819
820!------------------------------------------------------------------------------!
821! Description:
822! ------------
823! Interfaces for subroutines with pointer arguments called in
824! prognostic_equations
825!------------------------------------------------------------------------------!
826
827    INTERFACE
828
829       SUBROUTINE advec_s_bc( sk, sk_char )
830
831          CHARACTER (LEN=*), INTENT(IN)   ::  sk_char
832          REAL, DIMENSION(:,:,:), POINTER ::  sk
833
834       END SUBROUTINE advec_s_bc
835
836    END INTERFACE
837
838
839    SAVE
840
841 END MODULE pointer_interfaces
842
843
844
845
846 MODULE model_1d
847
848!------------------------------------------------------------------------------!
849! Description:
850! ------------
851! Definition of variables for the 1D-model
852!------------------------------------------------------------------------------!
853
854    INTEGER ::  current_timestep_number_1d = 0, damp_level_ind_1d, &
855                last_dt_change_1d = 0 
856
857    LOGICAL ::  run_control_header_1d = .FALSE., stop_dt_1d = .FALSE. 
858
859    REAL ::     damp_level_1d = -1.0, dt_1d = 60.0, dt_max_1d = 300.0, &
860                dt_pr_1d = 9999999.9, dt_run_control_1d = 60.0, &
861                end_time_1d = 864000.0, old_dt_1d = 1.0E-10, &
862                qs1d, simulated_time_1d = 0.0, time_pr_1d = 0.0, &
863                time_run_control_1d = 0.0, ts1d, us1d, usws1d, usws1d_m, &
864                vsws1d, vsws1d_m, z01d
865
866
867    REAL, DIMENSION(:), ALLOCATABLE ::  e1d, e1d_m, e1d_p, kh1d, kh1d_m, km1d, &
868                                        km1d_m, l_black, l1d, l1d_m, rif1d,    &
869                                        te_e, te_em, te_u, te_um, te_v, te_vm, &
870                                        u1d, u1d_m, u1d_p, v1d, v1d_m, v1d_p
871
872    SAVE
873
874 END MODULE model_1d
875
876
877
878
879 MODULE netcdf_control
880
881!------------------------------------------------------------------------------!
882! Description:
883! ------------
884! Definition of parameters and variables for netcdf control.
885!------------------------------------------------------------------------------!
886
887#if defined( __netcdf )
888    USE netcdf
889#endif
890
891    INTEGER, PARAMETER ::  dopr_norm_num = 7, dopts_num = 26, dots_num = 22, &
892                           replace_num = 6
893
894    CHARACTER, DIMENSION( replace_num ) :: &
895                           replace_char = (/ '''', '"', '*', '/', '(', ')' /), &
896                           replace_by   = (/ 'p' , 'p', 's', 'o', '_', '_' /)
897
898    CHARACTER (LEN=6), DIMENSION(dopr_norm_num) ::  dopr_norm_names =   &
899         (/ 'wpt0  ', 'ws2   ', 'tsw2  ', 'ws3   ', 'ws2tsw', 'wstsw2', &
900            'z_i   ' /)
901
902    CHARACTER (LEN=6), DIMENSION(dopr_norm_num) ::  dopr_norm_longnames = &
903         (/ 'wpt0  ', 'w*2   ', 't*w2  ', 'w*3   ', 'w*2t*w', 'w*t*w2',   &
904            'z_i   ' /)
905
906    CHARACTER (LEN=7), DIMENSION(dopts_num) :: dopts_label = &
907          (/ 'tnpt   ', 'x_     ', 'y_     ', 'z_     ', 'z_abs  ', 'u      ', &
908             'v      ', 'w      ', 'u"     ', 'v"     ', 'w"     ', 'npt_up ', &
909             'w_up   ', 'w_down ', 'npt_max', 'npt_min', 'x*2    ', 'y*2    ', &
910             'z*2    ', 'u*2    ', 'v*2    ', 'w*2    ', 'u"2    ', 'v"2    ', &
911             'w"2    ', 'npt*2  ' /)
912
913    CHARACTER (LEN=7), DIMENSION(dopts_num) :: dopts_unit = &
914          (/ 'number ', 'm      ', 'm      ', 'm      ', 'm      ', 'm/s    ', &
915             'm/s    ', 'm/s    ', 'm/s    ', 'm/s    ', 'm/s    ', 'number ', &
916             'm/s    ', 'm/s    ', 'number ', 'number ', 'm2     ', 'm2     ', &
917             'm2     ', 'm2/s2  ', 'm2/s2  ', 'm2/s2  ', 'm2/s2  ', 'm2/s2  ', &
918             'm2/s2  ', 'number2' /)
919
920    CHARACTER (LEN=7), DIMENSION(dots_num) :: dots_label = &
921          (/ 'E      ', 'E*     ', 'dt     ', 'u*     ', 'th*    ', 'umax   ', &
922             'vmax   ', 'wmax   ', 'div_new', 'div_old', 'z_i_wpt', 'z_i_pt ', &
923             'w*     ', 'w"pt"0 ', 'w"pt"  ', 'wpt    ', 'pt(0)  ', 'pt(zp) ', &
924             'splptx ', 'splpty ', 'splptz ', 'mo_L   ' /)
925
926    CHARACTER (LEN=7), DIMENSION(dots_num) :: dots_unit = &
927          (/ 'm2/s2  ', 'm2/s2  ', 's      ', 'm/s    ', 'K      ', 'm/s    ', &
928             'm/s    ', 'm/s    ', 's-1    ', 's-1    ', 'm      ', 'm      ', &
929             'm/s    ', 'K m/s  ', 'K m/s  ', 'k m/s  ', 'K      ', 'K      ', &
930             '%      ', '%      ', '%      ', 'm      ' /)
931
932    CHARACTER (LEN=7), DIMENSION(100) ::  dopr_unit = 'unknown'
933
934    CHARACTER (LEN=7), DIMENSION(0:1,100) ::  do2d_unit, do3d_unit
935
936    CHARACTER (LEN=16), DIMENSION(25) ::  prt_var_names = &
937          (/ 'pt_age          ', 'pt_dvrp_size    ', 'pt_origin_x     ', &
938             'pt_origin_y     ', 'pt_origin_z     ', 'pt_radius       ', &
939             'pt_speed_x      ', 'pt_speed_y      ', 'pt_speed_z      ', &
940             'pt_weight_factor', 'pt_x            ', 'pt_y            ', &
941             'pt_z            ', 'pt_color        ', 'pt_group        ', &
942             'pt_tailpoints   ', 'pt_tail_id      ', 'pt_density_ratio', &
943             'pt_exp_arg      ', 'pt_exp_term     ', 'not_used        ', &
944             'not_used        ', 'not_used        ', 'not_used        ', &
945             'not_used        ' /)
946
947    CHARACTER (LEN=16), DIMENSION(25) ::  prt_var_units = &
948          (/ 'seconds         ', 'meters          ', 'meters          ', &
949             'meters          ', 'meters          ', 'meters          ', &
950             'm/s             ', 'm/s             ', 'm/s             ', &
951             'factor          ', 'meters          ', 'meters          ', &
952             'meters          ', 'none            ', 'none            ', &
953             'none            ', 'none            ', 'ratio           ', &
954             'none            ', 'none            ', 'not_used        ', &
955             'not_used        ', 'not_used        ', 'not_used        ', &
956             'not_used        ' /)
957
958    INTEGER ::  id_dim_prtnum, id_dim_time_pr, id_dim_time_prt, &
959                id_dim_time_pts, id_dim_time_sp, id_dim_time_ts, id_dim_x_sp, &
960                id_dim_y_sp, id_dim_zu_sp, id_dim_zw_sp, id_set_pr, &
961                id_set_prt, id_set_pts, id_set_sp, id_set_ts, id_var_prtnum, &
962                id_var_rnop_prt, id_var_time_pr, id_var_time_prt, &
963                id_var_time_pts, id_var_time_sp, id_var_time_ts, id_var_x_sp, &
964                id_var_y_sp, id_var_zu_sp, id_var_zw_sp, nc_stat
965
966    INTEGER, DIMENSION(0:1) ::  id_dim_time_xy, id_dim_time_xz, &
967                id_dim_time_yz, id_dim_time_3d, id_dim_x_xy, id_dim_xu_xy, &
968                id_dim_x_xz, id_dim_xu_xz, id_dim_x_yz, id_dim_xu_yz, &
969                id_dim_x_3d, id_dim_xu_3d, id_dim_y_xy, id_dim_yv_xy, &
970                id_dim_y_xz, id_dim_yv_xz, id_dim_y_yz, id_dim_yv_yz, &
971                id_dim_y_3d, id_dim_yv_3d, id_dim_zu_xy, id_dim_zu1_xy, &
972                id_dim_zu_xz, id_dim_zu_yz, id_dim_zu_3d, id_dim_zw_xy, &
973                id_dim_zw_xz, id_dim_zw_yz, id_dim_zw_3d, id_set_xy, &
974                id_set_xz, id_set_yz, id_set_3d, id_var_ind_x_yz, &
975                id_var_ind_y_xz, id_var_ind_z_xy, id_var_time_xy, &
976                id_var_time_xz, id_var_time_yz, id_var_time_3d, id_var_x_xy, &
977                id_var_xu_xy, id_var_x_xz, id_var_xu_xz, id_var_x_yz, &
978                id_var_xu_yz, id_var_x_3d, id_var_xu_3d, id_var_y_xy, &
979                id_var_yv_xy, id_var_y_xz, id_var_yv_xz, id_var_y_yz, &
980                id_var_yv_yz, id_var_y_3d, id_var_yv_3d, id_var_zu_xy, &
981                id_var_zu1_xy, id_var_zu_xz, id_var_zu_yz, id_var_zu_3d, &
982                id_var_zw_xy, id_var_zw_xz, id_var_zw_yz, id_var_zw_3d
983
984    INTEGER, DIMENSION(10)  ::  id_var_dospx, id_var_dospy, nc_precision 
985    INTEGER, DIMENSION(20)  ::  id_var_prt
986    INTEGER, DIMENSION(dopr_norm_num) ::  id_var_norm_dopr
987
988    INTEGER, DIMENSION(dopts_num,0:10) ::  id_var_dopts
989    INTEGER, DIMENSION(0:1,100)        ::  id_var_do2d, id_var_do3d
990    INTEGER, DIMENSION(100,0:9)        ::  id_dim_z_pr, id_var_dopr, &
991                                           id_var_z_pr
992    INTEGER, DIMENSION(dots_num,0:9)   ::  id_var_dots
993
994
995    SAVE
996
997 END MODULE netcdf_control
998
999
1000
1001 MODULE particle_attributes
1002
1003!------------------------------------------------------------------------------!
1004! Description:
1005! ------------
1006! Definition of variables used to compute particle transport
1007!------------------------------------------------------------------------------!
1008
1009    USE array_kind
1010
1011    CHARACTER (LEN=15)  ::  bc_par_lr = 'cyclic',  bc_par_ns = 'cyclic', &
1012                            bc_par_b  = 'reflect', bc_par_t  = 'absorb'
1013
1014#if defined( __parallel )
1015    INTEGER ::  mpi_particle_type
1016#endif
1017    INTEGER ::  ibc_par_lr, ibc_par_ns, ibc_par_b, ibc_par_t,                  &
1018                iran_part = -1234567, maximum_number_of_particles = 1000,      &
1019                maximum_number_of_tailpoints = 100,                            &
1020                maximum_number_of_tails = 0,                                   &
1021                number_of_initial_particles = 0, number_of_particles = 0,      &
1022                number_of_particle_groups = 1, number_of_tails = 0,            &
1023                number_of_initial_tails = 0, particles_per_point = 1,          &
1024                particle_file_count = 0, skip_particles_for_tail = 100,        &
1025                total_number_of_particles, total_number_of_tails = 0
1026
1027    INTEGER, PARAMETER ::  max_number_of_particle_groups = 10
1028
1029    INTEGER, DIMENSION(:), ALLOCATABLE     ::  new_tail_id
1030    INTEGER, DIMENSION(:,:,:), ALLOCATABLE ::  prt_count, prt_start_index
1031
1032    LOGICAL ::  particle_advection = .FALSE., random_start_position = .FALSE., &
1033                read_particles_from_restartfile = .TRUE.,                      &
1034                uniform_particles = .TRUE., use_particle_tails = .FALSE.,      &
1035                use_sgs_for_particles = .FALSE.,                               &
1036                vertical_particle_advection = .TRUE.,                          &
1037                write_particle_statistics = .FALSE.
1038    LOGICAL, DIMENSION(:), ALLOCATABLE ::  particle_mask, tail_mask
1039
1040    REAL    ::  c_0 = 3.0, dt_min_part = 0.0002,                               &
1041                dt_write_particle_data = 9999999.9, dvrp_psize = 9999999.9,    &
1042                end_time_prel = 9999999.9, initial_weighting_factor = 1.0,     &
1043                maximum_tailpoint_age = 100000.0,                              &
1044                minimum_tailpoint_distance = 0.0,                              &
1045                particle_advection_start = 0.0, sgs_wfu_part = 0.3333333,      &
1046                sgs_wfv_part = 0.3333333, sgs_wfw_part = 0.3333333,            &
1047                time_write_particle_data = 0.0
1048
1049    REAL, DIMENSION(max_number_of_particle_groups) ::  &
1050                density_ratio = 9999999.9, pdx = 9999999.9, pdy = 9999999.9, &
1051                pdz = 9999999.9, psb = 9999999.9, psl = 9999999.9,           &
1052                psn = 9999999.9, psr = 9999999.9, pss = 9999999.9,           &
1053                pst = 9999999.9, radius = 9999999.9
1054
1055    REAL, DIMENSION(:,:,:), ALLOCATABLE ::  particle_tail_coordinates
1056
1057
1058    TYPE particle_type
1059       SEQUENCE
1060       REAL    ::  age, dt_sum, dvrp_psize, e_m, origin_x, origin_y, origin_z, &
1061                   radius, speed_x, speed_x_sgs, speed_y, speed_y_sgs,         &
1062                   speed_z, speed_z_sgs, weight_factor, x, y, z
1063       INTEGER ::  color, group, tailpoints, tail_id
1064    END TYPE particle_type
1065
1066    TYPE(particle_type), DIMENSION(:), ALLOCATABLE ::  initial_particles, &
1067                                                       particles
1068
1069    TYPE particle_groups_type
1070       SEQUENCE
1071       REAL    ::  density_ratio, radius, exp_arg, exp_term
1072    END TYPE particle_groups_type
1073
1074    TYPE(particle_groups_type), DIMENSION(max_number_of_particle_groups) ::&
1075                   particle_groups
1076
1077    SAVE
1078
1079 END MODULE particle_attributes
1080
1081
1082
1083
1084
1085 MODULE pegrid
1086
1087!------------------------------------------------------------------------------!
1088! Description:
1089! ------------
1090! Definition of variables which define processor topology and the exchange of
1091! ghost point layers. This modules must be placed in all routines which contain
1092! MPI-calls.
1093!------------------------------------------------------------------------------!
1094
1095#if defined( __parallel )
1096#if defined( __lcmuk )
1097    USE MPI
1098!    INCLUDE "mpif.h"
1099#else
1100    INCLUDE "mpif.h"
1101#endif
1102#endif
1103    CHARACTER(LEN=5)       ::  myid_char = '', myid_char_14 = ''
1104    INTEGER                ::  myid=0, npex = -1, npey = -1, numprocs = 1, &
1105                               tasks_per_node = -9999, threads_per_task = 1
1106
1107#if defined( __parallel )
1108    INTEGER ::  comm1dx, comm1dy, comm2d, comm_palm, ierr, myidx, myidy,       &
1109                ndim = 2, ngp_y, ngp_yz_p, pleft, pnorth, pright, psouth,      &
1110                sendrecvcount_xy, sendrecvcount_yz, sendrecvcount_zx,          &
1111                sendrecvcount_zyd, sendrecvcount_yxd,                          &
1112                type_x, type_x_int, type_xz_p, ibuf(12), pcoord(2), pdims(2),  &
1113                status(MPI_STATUS_SIZE)
1114
1115    INTEGER, DIMENSION(:), ALLOCATABLE ::  ngp_yz, type_xz
1116
1117    LOGICAL ::  reorder = .TRUE.
1118    LOGICAL, DIMENSION(2) ::  cyclic = (/ .TRUE. , .TRUE. /), &
1119                              remain_dims
1120#endif
1121
1122    SAVE
1123
1124 END MODULE pegrid
1125
1126
1127
1128
1129 MODULE profil_parameter
1130
1131!------------------------------------------------------------------------------!
1132! Description:
1133! ------------
1134! Definition of variables which control PROFIL-output
1135!------------------------------------------------------------------------------!
1136
1137    INTEGER, PARAMETER ::  crmax = 100
1138
1139    CHARACTER (LEN=10), DIMENSION(100) ::  dopr_label = ' '
1140
1141    CHARACTER (LEN=10), DIMENSION(crmax) ::  cross_normalized_x = ' ', &
1142                                             cross_normalized_y = ' '
1143
1144    CHARACTER (LEN=20), DIMENSION(20) ::  cross_ts_profiles = &
1145                           (/ ' E E*               ', ' dt                 ', &
1146                              ' u* w*              ', ' th*                ', &
1147                              ' umax vmax wmax     ', ' div_old div_new    ', &
1148                              ' z_i_wpt z_i_pt     ', ' w"pt"0 w"pt" wpt   ', &
1149                              ' pt(0) pt(zp)       ', ' splux spluy spluz  ', &
1150                              ' L                  ',                         &
1151                            ( '                    ', i9 = 1, 9 ) /)
1152
1153    CHARACTER (LEN=40), DIMENSION(crmax) ::  cross_xtext = &
1154                           (/ 'windspeed in ms>->1         ', &
1155                              'pot. temperature in K       ', &
1156                              'heat flux in K ms>->1       ', &
1157                              'momentum flux in m>2s>2     ', &
1158                              'eddy diffusivity in m>2s>->1', &
1159                              'mixing length in m          ', &
1160                            ( '                            ', i9 = 1, 94 ) /)
1161
1162    CHARACTER (LEN=100), DIMENSION(crmax) ::  cross_profiles = &
1163                           (/ ' u v                           ', &
1164                              ' pt                            ', &
1165                              ' w"pt" w*pt* w*pt*BC wpt wptBC ', &
1166                              ' w"u" w*u* wu w"v" w*v* wv     ', &
1167                              ' km kh                         ', &
1168                              ' l                             ', &
1169                         ( '                               ', i9 = 1, 94 ) /)
1170
1171    INTEGER ::  profile_columns = 3, profile_rows = 2, profile_number = 0
1172
1173    INTEGER ::  cross_linecolors(100,crmax) = 1, &
1174                cross_linestyles(100,crmax) = 0, &
1175                cross_profile_numbers(100,crmax) = 0, &
1176                cross_pnc_local(crmax), cross_profile_number_count(crmax) = 0, &
1177                cross_ts_numbers(crmax,crmax) = 0, &
1178                cross_ts_number_count(crmax) = 0, dopr_crossindex(100) = 0, &
1179                dopr_index(100) = 0, dopr_initial_index(100) = 0, &
1180                dots_crossindex(100) = 0, dots_index(100) = 0, &
1181                linecolors(10) = (/ 2, 3, 4,  5, 7, 8, 12, 15, 16, 23 /), &
1182                linestyles(11) = (/ 0, 7, 3, 10, 4, 1,  9,  2,  5,  8, 6 /)
1183               
1184
1185    REAL ::  cross_normx_factor(100,crmax) = 1.0, &
1186             cross_normy_factor(100,crmax) = 1.0, &
1187             cross_ts_uymax(20) = &
1188                             (/ 999.999, 999.999, 999.999, 999.999, 999.999,   &
1189                                999.999, 999.999, 999.999, 999.999, 999.999,   &
1190                                999.999, 999.999, 999.999, 999.999, 999.999,   &
1191                                999.999, 999.999, 999.999, 999.999, 999.999 /),&
1192             cross_ts_uymax_computed(20) = 999.999, &
1193             cross_ts_uymin(20) = &
1194                             (/ 999.999, 999.999, 999.999,  -5.000, 999.999,   &
1195                                999.999,   0.000, 999.999, 999.999, 999.999,   &
1196                                999.999, 999.999, 999.999, 999.999, 999.999,   &
1197                                999.999, 999.999, 999.999, 999.999, 999.999 /),&
1198             cross_ts_uymin_computed(20) = 999.999, &
1199             cross_uxmax(crmax) = 0.0, cross_uxmax_computed(crmax) = -1.0, &
1200             cross_uxmax_normalized(crmax) = 0.0, &
1201             cross_uxmax_normalized_computed(crmax) = -1.0, &
1202             cross_uxmin(crmax) = 0.0, cross_uxmin_computed(crmax) =  1.0, &
1203             cross_uxmin_normalized(crmax) = 0.0, &
1204             cross_uxmin_normalized_computed(crmax) = 1.0, &
1205             cross_uymax(crmax), cross_uymin(crmax)
1206
1207    SAVE
1208
1209 END MODULE profil_parameter
1210
1211
1212
1213
1214 MODULE spectrum
1215
1216!------------------------------------------------------------------------------!
1217! Description:
1218! ------------
1219! Definition of quantities used for computing spectra
1220!------------------------------------------------------------------------------!
1221
1222    CHARACTER (LEN=6),  DIMENSION(1:5) ::  header_char = (/ 'PS(u) ', 'PS(v) ',&
1223                                           'PS(w) ', 'PS(pt)', 'PS(q) ' /)
1224    CHARACTER (LEN=2),  DIMENSION(10)  ::  spectra_direction = 'x'
1225    CHARACTER (LEN=10), DIMENSION(10)  ::  data_output_sp  = ' '
1226    CHARACTER (LEN=25), DIMENSION(1:5) ::  utext_char =                    &
1227                                           (/ '-power spectrum of u     ', &
1228                                              '-power spectrum of v     ', &
1229                                              '-power spectrum of w     ', &
1230                                              '-power spectrum of ^1185 ', &
1231                                              '-power spectrum of q     ' /)
1232    CHARACTER (LEN=39), DIMENSION(1:5) ::  ytext_char =                        &
1233                                 (/ 'k ^2236 ^2566^2569<u(k) in m>2s>->2    ', &
1234                                    'k ^2236 ^2566^2569<v(k) in m>2s>->2    ', &
1235                                    'k ^2236 ^2566^2569<w(k) in m>2s>->2    ', &
1236                                    'k ^2236 ^2566^2569<^1185(k) in m>2s>->2', &
1237                                    'k ^2236 ^2566^2569<q(k) in m>2s>->2    ' /)
1238
1239    INTEGER ::  klist_x = 0, klist_y = 0, n_sp_x = 0, n_sp_y = 0
1240
1241    INTEGER ::  comp_spectra_level(10) = 999999,                   &
1242                lstyles(10) = (/ 0, 7, 3, 10, 1, 4, 9, 2, 6, 8 /), &
1243                plot_spectra_level(10) = 999999
1244
1245    REAL    ::  time_to_start_sp = 0.0
1246
1247    SAVE
1248
1249 END MODULE spectrum
1250
1251
1252
1253
1254 MODULE statistics
1255
1256!------------------------------------------------------------------------------!
1257! Description:
1258! ------------
1259! Definition of statistical quantities, e.g. global sums
1260!------------------------------------------------------------------------------!
1261
1262    CHARACTER (LEN=40) ::  region(0:9)
1263    INTEGER ::  statistic_regions = 0, var_hom = 80, var_sum = 80
1264    INTEGER ::  u_max_ijk(3), v_max_ijk(3), w_max_ijk(3)
1265    LOGICAL ::  flow_statistics_called = .FALSE.
1266    REAL ::     u_max, v_max, w_max
1267    REAL, DIMENSION(:), ALLOCATABLE       ::  sums_divnew_l, sums_divold_l
1268    REAL, DIMENSION(:,:), ALLOCATABLE     ::  sums, sums_wsts_bc_l
1269    REAL, DIMENSION(:,:,:), ALLOCATABLE   ::  hom_sum, rmask, spectrum_x, &
1270                                              spectrum_y, sums_l, sums_l_l, &
1271                                              sums_up_fraction_l
1272    REAL, DIMENSION(:,:,:,:), ALLOCATABLE ::  hom
1273
1274    SAVE
1275
1276 END MODULE statistics
1277
1278
1279
1280
1281 MODULE transpose_indices
1282
1283!------------------------------------------------------------------------------!
1284! Description:
1285! ------------
1286! Definition of indices for transposed arrays
1287!------------------------------------------------------------------------------!
1288
1289    INTEGER ::  nxl_y, nxl_yd, nxl_z, nxr_y, nxr_ya, nxr_yd, nxr_yda, nxr_z, &
1290                nxr_za, nyn_x, nyn_xa, nyn_z, nyn_za, nys_x, nys_z, nzb_x,   &
1291                nzb_y, nzb_yd, nzt_x, nzt_xa, nzt_y, nzt_ya, nzt_yd, nzt_yda
1292               
1293
1294    SAVE
1295
1296 END MODULE transpose_indices
Note: See TracBrowser for help on using the repository browser.