SUBROUTINE check_parameters !------------------------------------------------------------------------------! ! Actual revisions: ! ----------------- ! "by_user" allowed as initializing action, -data_output_ts, ! leapfrog with non-flat topography not allowed any more, loop_optimization ! and pt_reference are checked, moisture renamed humidity, ! output of precipitation amount/rate and roughnes length + check ! possible negative humidities are avoided in initial profile, ! dirichlet/neumann changed to dirichlet/radiation, etc., ! revision added to run_description_header ! ! Former revisions: ! ----------------- ! $Id: check_parameters.f90 75 2007-03-22 09:54:05Z raasch $ ! ! 20 2007-02-26 00:12:32Z raasch ! Temperature and humidity gradients at top are now calculated for nzt+1, ! top_heatflux and respective boundary condition bc_pt_t is checked ! ! RCS Log replace by Id keyword, revision history cleaned up ! ! Revision 1.61 2006/08/04 14:20:25 raasch ! do2d_unit and do3d_unit now defined as 2d-arrays, check of ! use_upstream_for_tke, default value for dt_dopts, ! generation of file header moved from routines palm and header to here ! ! Revision 1.1 1997/08/26 06:29:23 raasch ! Initial revision ! ! ! Description: ! ------------ ! Check control parameters and deduce further quantities. !------------------------------------------------------------------------------! USE arrays_3d USE constants USE control_parameters USE grid_variables USE indices USE model_1d USE netcdf_control USE particle_attributes USE pegrid USE profil_parameter USE statistics USE transpose_indices IMPLICIT NONE CHARACTER (LEN=1) :: sq CHARACTER (LEN=6) :: var CHARACTER (LEN=7) :: unit CHARACTER (LEN=8) :: date CHARACTER (LEN=10) :: time CHARACTER (LEN=100) :: action INTEGER :: i, ilen, intervals, iter, j, k, nnxh, nnyh, position, prec LOGICAL :: found, ldum REAL :: gradient, maxn, maxp ! !-- Warning, if host is not set IF ( host(1:1) == ' ' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters:' PRINT*, ' "host" is not set. Please check that environment', & ' variable "localhost"' PRINT*, ' is set before running PALM' ENDIF ENDIF ! !-- Generate the file header which is used as a header for most of PALM's !-- output files CALL DATE_AND_TIME( date, time ) run_date = date(7:8)//'-'//date(5:6)//'-'//date(3:4) run_time = time(1:2)//':'//time(3:4)//':'//time(5:6) WRITE ( run_description_header, '(A,2X,A,2X,A,A,A,I2.2,2X,A,A,2X,A,1X,A)' )& TRIM( version ), TRIM( revision ), & 'run: ', TRIM( run_identifier ), '.', & runnr, 'host: ', TRIM( host ), run_date, run_time ! !-- Check the general loop optimization method IF ( loop_optimization == 'default' ) THEN IF ( host(1:3) == 'nec' ) THEN loop_optimization = 'vector' ELSE loop_optimization = 'cache' ENDIF ENDIF IF ( loop_optimization /= 'noopt' .AND. loop_optimization /= 'cache' & .AND. loop_optimization /= 'vector' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' illegal value given for loop_optimization: ', & TRIM( loop_optimization ) ENDIF CALL local_stop ENDIF ! !-- Check topography setting (check for illegal parameter combinations) IF ( topography /= 'flat' ) THEN action = ' ' IF ( scalar_advec /= 'pw-scheme' ) THEN WRITE( action, '(A,A)' ) 'scalar_advec = ', scalar_advec ENDIF IF ( momentum_advec /= 'pw-scheme' ) THEN WRITE( action, '(A,A)' ) 'momentum_advec = ', momentum_advec ENDIF IF ( timestep_scheme(1:8) == 'leapfrog' ) THEN WRITE( action, '(A,A)' ) 'timestep_scheme = ', timestep_scheme ENDIF IF ( psolver == 'multigrid' .OR. psolver == 'sor' ) THEN WRITE( action, '(A,A)' ) 'psolver = ', psolver ENDIF IF ( sloping_surface ) THEN WRITE( action, '(A)' ) 'sloping surface = .TRUE.' ENDIF IF ( galilei_transformation ) THEN WRITE( action, '(A)' ) 'galilei_transformation = .TRUE.' ENDIF IF ( cloud_physics ) THEN WRITE( action, '(A)' ) 'cloud_physics = .TRUE.' ENDIF IF ( cloud_droplets ) THEN WRITE( action, '(A)' ) 'cloud_droplets = .TRUE.' ENDIF IF ( humidity ) THEN WRITE( action, '(A)' ) 'humidity = .TRUE.' ENDIF IF ( .NOT. prandtl_layer ) THEN WRITE( action, '(A)' ) 'prandtl_layer = .FALSE.' ENDIF IF ( action /= ' ' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' a non-flat topography does not allow ', TRIM( action ) ENDIF CALL local_stop ENDIF ENDIF ! !-- Check whether there are any illegal values !-- Pressure solver: IF ( psolver /= 'poisfft' .AND. psolver /= 'poisfft_hybrid' .AND. & psolver /= 'sor' .AND. psolver /= 'multigrid' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown solver for perturbation pressure: psolver=', & psolver ENDIF CALL local_stop ENDIF #if defined( __parallel ) IF ( psolver == 'poisfft_hybrid' .AND. pdims(2) /= 1 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' psolver="', TRIM( psolver ), '" only works for a ', & '1d domain-decomposition along x' PRINT*, ' please do not set npey/=1 in the parameter file' ENDIF CALL local_stop ENDIF IF ( ( psolver == 'poisfft_hybrid' .OR. psolver == 'multigrid' ) .AND. & ( nxra > nxr .OR. nyna > nyn .OR. nza > nz ) ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' psolver="', TRIM( psolver ), '" does not work for ', & 'subdomains with unequal size' PRINT*, ' please set grid_matching = ''strict'' in the parameter',& ' file' ENDIF CALL local_stop ENDIF #else IF ( psolver == 'poisfft_hybrid' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' psolver="', TRIM( psolver ), '" only works for a ', & 'parallel environment' ENDIF CALL local_stop ENDIF #endif IF ( psolver == 'multigrid' ) THEN IF ( cycle_mg == 'w' ) THEN gamma_mg = 2 ELSEIF ( cycle_mg == 'v' ) THEN gamma_mg = 1 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown multigrid cycle: cycle_mg=', cycle_mg ENDIF CALL local_stop ENDIF ENDIF IF ( fft_method /= 'singleton-algorithm' .AND. & fft_method /= 'temperton-algorithm' .AND. & fft_method /= 'system-specific' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown fft-algorithm: fft_method=', fft_method ENDIF CALL local_stop ENDIF ! !-- Advection schemes: IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ups-scheme' ) & THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: unknown advection ', & 'scheme: momentum_advec=', momentum_advec CALL local_stop ENDIF IF ( ( momentum_advec == 'ups-scheme' .OR. scalar_advec == 'ups-scheme' )& .AND. timestep_scheme /= 'euler' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: momentum_advec=', & momentum_advec, ' is not allowed with ', & 'timestep_scheme=', timestep_scheme CALL local_stop ENDIF IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'bc-scheme' .AND.& scalar_advec /= 'ups-scheme' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: unknown advection ', & 'scheme: scalar_advec=', scalar_advec CALL local_stop ENDIF IF ( use_sgs_for_particles .AND. .NOT. use_upstream_for_tke ) THEN use_upstream_for_tke = .TRUE. IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters: use_upstream_for_tke set ', & '.TRUE. because use_sgs_for_particles = .TRUE.' ENDIF ENDIF IF ( use_upstream_for_tke .AND. timestep_scheme(1:8) == 'leapfrog' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: use_upstream_for_tke = .TRUE. ', & 'not allowed with timestep_scheme=', timestep_scheme ENDIF CALL local_stop ENDIF ! !-- Timestep schemes: SELECT CASE ( TRIM( timestep_scheme ) ) CASE ( 'euler' ) intermediate_timestep_count_max = 1 asselin_filter_factor = 0.0 CASE ( 'leapfrog', 'leapfrog+euler' ) intermediate_timestep_count_max = 1 CASE ( 'runge-kutta-2' ) intermediate_timestep_count_max = 2 asselin_filter_factor = 0.0 CASE ( 'runge-kutta-3' ) intermediate_timestep_count_max = 3 asselin_filter_factor = 0.0 CASE DEFAULT IF ( myid == 0 ) PRINT*, '+++ check_parameters: unknown timestep ',& 'scheme: timestep_scheme=', timestep_scheme CALL local_stop END SELECT IF ( scalar_advec == 'ups-scheme' .AND. timestep_scheme(1:5) == 'runge' )& THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: scalar advection scheme "', & TRIM( scalar_advec ), '"' PRINT*, ' does not work with timestep_scheme "', & TRIM( timestep_scheme ), '"' ENDIF CALL local_stop ENDIF IF ( momentum_advec /= 'pw-scheme' .AND. timestep_scheme(1:5) == 'runge' ) & THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: momentum advection scheme "', & TRIM( momentum_advec ), '"' PRINT*, ' does not work with timestep_scheme "', & TRIM( timestep_scheme ), '"' ENDIF CALL local_stop ENDIF IF ( initializing_actions == ' ' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check parameters:' PRINT*, ' no value found for initializing_actions' ENDIF CALL local_stop ENDIF IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN ! !-- No model continuation run; several initialising actions are possible action = initializing_actions DO WHILE ( TRIM( action ) /= '' ) position = INDEX( action, ' ' ) SELECT CASE ( action(1:position-1) ) CASE ( 'set_constant_profiles', 'set_1d-model_profiles', & 'by_user', 'initialize_vortex', 'initialize_ptanom' ) action = action(position+1:) CASE DEFAULT IF ( myid == 0 ) PRINT*, '+++ check_parameters: initializi', & 'ng_action unkown or not allowed: action = "', & TRIM(action), '"' CALL local_stop END SELECT ENDDO ENDIF IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: initializing_actions', & '"set_constant_profiles" and "set_1d-model_profiles" are not', & ' allowed simultaneously' CALL local_stop ENDIF IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & INDEX( initializing_actions, 'by_user' ) /= 0 ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: initializing_actions', & '"set_constant_profiles" and "by_user" are not', & ' allowed simultaneously' CALL local_stop ENDIF IF ( INDEX( initializing_actions, 'by_user' ) /= 0 .AND. & INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: initializing_actions', & '"by_user" and "set_1d-model_profiles" are not', & ' allowed simultaneously' CALL local_stop ENDIF IF ( cloud_physics .AND. .NOT. humidity ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: cloud_physics =', & cloud_physics, ' is not allowed with ', & 'humidity =', humidity CALL local_stop ENDIF IF ( precipitation .AND. .NOT. cloud_physics ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: precipitation =', & precipitation, ' is not allowed with ', & 'cloud_physics =', cloud_physics CALL local_stop ENDIF IF ( humidity .AND. sloping_surface ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: humidity = TRUE', & 'and hang = TRUE are not', & ' allowed simultaneously' CALL local_stop ENDIF IF ( humidity .AND. scalar_advec == 'ups-scheme' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: UPS-scheme', & 'is not implemented for humidity' CALL local_stop ENDIF IF ( passive_scalar .AND. humidity ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: humidity = TRUE and', & 'passive_scalar = TRUE is not allowed ', & 'simultaneously' CALL local_stop ENDIF IF ( passive_scalar .AND. scalar_advec == 'ups-scheme' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: UPS-scheme', & 'is not implemented for passive_scalar' CALL local_stop ENDIF IF ( grid_matching /= 'strict' .AND. grid_matching /= 'match' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: illegal value "', & TRIM( grid_matching ), & '" found for parameter grid_matching' CALL local_stop ENDIF ! !-- In case of no model continuation run, check initialising parameters and !-- deduce further quantities IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN ! !-- Initial profiles for 1D and 3D model, respectively u_init = ug_surface v_init = vg_surface pt_init = pt_surface IF ( humidity ) q_init = q_surface IF ( passive_scalar ) q_init = s_surface ! !-- !-- If required, compute initial profile of the geostrophic wind !-- (component ug) i = 1 gradient = 0.0 ug_vertical_gradient_level_ind(1) = 0 ug(0) = ug_surface DO k = 1, nzt+1 IF ( ug_vertical_gradient_level(i) < zu(k) .AND. & ug_vertical_gradient_level(i) >= 0.0 ) THEN gradient = ug_vertical_gradient(i) / 100.0 ug_vertical_gradient_level_ind(i) = k - 1 i = i + 1 IF ( i > 10 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: upper bound 10 of array', & ' "ug_vertical_gradient_level_ind" exceeded' ENDIF CALL local_stop ENDIF ENDIF IF ( gradient /= 0.0 ) THEN IF ( k /= 1 ) THEN ug(k) = ug(k-1) + dzu(k) * gradient ELSE ug(k) = ug_surface + 0.5 * dzu(k) * gradient ENDIF ELSE ug(k) = ug(k-1) ENDIF ENDDO u_init = ug ! !-- In case of no given gradients for ug, choose a vanishing gradient IF ( ug_vertical_gradient_level(1) == -1.0 ) THEN ug_vertical_gradient_level(1) = 0.0 ENDIF ! !-- !-- If required, compute initial profile of the geostrophic wind !-- (component vg) i = 1 gradient = 0.0 vg_vertical_gradient_level_ind(1) = 0 vg(0) = vg_surface DO k = 1, nzt+1 IF ( vg_vertical_gradient_level(i) < zu(k) .AND. & vg_vertical_gradient_level(i) >= 0.0 ) THEN gradient = vg_vertical_gradient(i) / 100.0 vg_vertical_gradient_level_ind(i) = k - 1 i = i + 1 IF ( i > 10 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: upper bound 10 of array', & ' "vg_vertical_gradient_level_ind" exceeded' ENDIF CALL local_stop ENDIF ENDIF IF ( gradient /= 0.0 ) THEN IF ( k /= 1 ) THEN vg(k) = vg(k-1) + dzu(k) * gradient ELSE vg(k) = vg_surface + 0.5 * dzu(k) * gradient ENDIF ELSE vg(k) = vg(k-1) ENDIF ENDDO v_init = vg ! !-- In case of no given gradients for vg, choose a vanishing gradient IF ( vg_vertical_gradient_level(1) == -1.0 ) THEN vg_vertical_gradient_level(1) = 0.0 ENDIF ! !-- If required, compute initial temperature profile using the given !-- temperature gradient i = 1 gradient = 0.0 pt_vertical_gradient_level_ind(1) = 0 DO k = 1, nzt+1 IF ( pt_vertical_gradient_level(i) < zu(k) .AND. & pt_vertical_gradient_level(i) >= 0.0 ) THEN gradient = pt_vertical_gradient(i) / 100.0 pt_vertical_gradient_level_ind(i) = k - 1 i = i + 1 IF ( i > 10 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: upper bound 10 of array', & ' "pt_vertical_gradient_level_ind" exceeded' ENDIF CALL local_stop ENDIF ENDIF IF ( gradient /= 0.0 ) THEN IF ( k /= 1 ) THEN pt_init(k) = pt_init(k-1) + dzu(k) * gradient ELSE pt_init(k) = pt_init(k-1) + 0.5 * dzu(k) * gradient ENDIF ELSE pt_init(k) = pt_init(k-1) ENDIF ENDDO ! !-- In case of no given temperature gradients, choose gradient of neutral !-- stratification IF ( pt_vertical_gradient_level(1) == -1.0 ) THEN pt_vertical_gradient_level(1) = 0.0 ENDIF ! !-- Store temperature gradient at the top boundary for possile Neumann !-- boundary condition bc_pt_t_val = ( pt_init(nzt+1) - pt_init(nzt) ) / dzu(nzt+1) ! !-- If required, compute initial humidity or scalar profile using the given !-- humidity/scalar gradient. In case of scalar transport, initially store !-- values of the scalar parameters on humidity parameters IF ( passive_scalar ) THEN bc_q_b = bc_s_b bc_q_t = bc_s_t q_surface = s_surface q_surface_initial_change = s_surface_initial_change q_vertical_gradient = s_vertical_gradient q_vertical_gradient_level = s_vertical_gradient_level surface_waterflux = surface_scalarflux ENDIF IF ( humidity .OR. passive_scalar ) THEN i = 1 gradient = 0.0 q_vertical_gradient_level_ind(1) = 0 DO k = 1, nzt+1 IF ( q_vertical_gradient_level(i) < zu(k) .AND. & q_vertical_gradient_level(i) >= 0.0 ) THEN gradient = q_vertical_gradient(i) / 100.0 q_vertical_gradient_level_ind(i) = k - 1 i = i + 1 IF ( i > 10 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: upper bound 10 of arr', & 'ay "q_vertical_gradient_level_ind" exceeded' ENDIF CALL local_stop ENDIF ENDIF IF ( gradient /= 0.0 ) THEN IF ( k /= 1 ) THEN q_init(k) = q_init(k-1) + dzu(k) * gradient ELSE q_init(k) = q_init(k-1) + 0.5 * dzu(k) * gradient ENDIF ELSE q_init(k) = q_init(k-1) ENDIF ! !-- Avoid negative humidities IF ( q_init(k) < 0.0 ) THEN q_init(k) = 0.0 ENDIF ENDDO ! !-- In case of no given humidity gradients, choose zero gradient !-- conditions IF ( q_vertical_gradient_level(1) == -1.0 ) THEN q_vertical_gradient_level(1) = 0.0 ENDIF ! !-- Store humidity gradient at the top boundary for possile Neumann !-- boundary condition bc_q_t_val = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1) ENDIF ENDIF ! !-- Compute Coriolis parameter f = 2.0 * omega * SIN( phi / 180.0 * pi ) fs = 2.0 * omega * COS( phi / 180.0 * pi ) ! !-- Reference temperature to be used in buoyancy terms IF ( pt_reference /= 9999999.9 ) use_pt_reference = .TRUE. ! !-- In case of a given slope, compute the relevant quantities IF ( alpha_surface /= 0.0 ) THEN IF ( ABS( alpha_surface ) > 90.0 ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: ABS( alpha_surface',& '=', alpha_surface, ' ) must be < 90.0' CALL local_stop ENDIF sloping_surface = .TRUE. cos_alpha_surface = COS( alpha_surface / 180.0 * pi ) sin_alpha_surface = SIN( alpha_surface / 180.0 * pi ) ENDIF ! !-- Check time step and cfl_factor IF ( dt /= -1.0 ) THEN IF ( dt <= 0.0 .AND. dt /= -1.0 ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: dt=', dt, ' <= 0.0' CALL local_stop ENDIF dt_3d = dt dt_fixed = .TRUE. ENDIF IF ( cfl_factor <= 0.0 .OR. cfl_factor > 1.0 ) THEN IF ( cfl_factor == -1.0 ) THEN IF ( momentum_advec == 'ups-scheme' .OR. & scalar_advec == 'ups-scheme' ) THEN cfl_factor = 0.8 ELSE IF ( timestep_scheme == 'runge-kutta-2' ) THEN cfl_factor = 0.8 ELSEIF ( timestep_scheme == 'runge-kutta-3' ) THEN cfl_factor = 0.9 ELSE cfl_factor = 0.1 ENDIF ENDIF ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: cfl_factor=', cfl_factor, & ' out of range' PRINT*, '+++ 0.0 < cfl_factor <= 1.0 is required' ENDIF CALL local_stop ENDIF ENDIF ! !-- Store simulated time at begin simulated_time_at_begin = simulated_time ! !-- Set wind speed in the Galilei-transformed system IF ( galilei_transformation ) THEN IF ( use_ug_for_galilei_tr .AND. & ug_vertical_gradient_level(1) == 0.0 .AND. & vg_vertical_gradient_level(1) == 0.0 ) THEN u_gtrans = ug_surface v_gtrans = vg_surface ELSEIF ( use_ug_for_galilei_tr .AND. & ug_vertical_gradient_level(1) /= 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' baroclinicity (ug) not allowed' PRINT*, ' simultaneously with galilei transformation' ENDIF CALL local_stop ELSEIF ( use_ug_for_galilei_tr .AND. & vg_vertical_gradient_level(1) /= 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' baroclinicity (vg) not allowed' PRINT*, ' simultaneously with galilei transformation' ENDIF CALL local_stop ELSE IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters:' PRINT*, ' variable translation speed used for galilei-tran' // & 'sformation, which' PRINT*, ' may cause instabilities in stably stratified regions' ENDIF ENDIF ENDIF ! !-- In case of using a prandtl-layer, calculated (or prescribed) surface !-- fluxes have to be used in the diffusion-terms IF ( prandtl_layer ) use_surface_fluxes = .TRUE. ! !-- Check boundary conditions and set internal variables: !-- Lateral boundary conditions IF ( bc_lr /= 'cyclic' .AND. bc_lr /= 'dirichlet/radiation' .AND. & bc_lr /= 'radiation/dirichlet' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_lr = ', bc_lr ENDIF CALL local_stop ENDIF IF ( bc_ns /= 'cyclic' .AND. bc_ns /= 'dirichlet/radiation' .AND. & bc_ns /= 'radiation/dirichlet' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_ns = ', bc_ns ENDIF CALL local_stop ENDIF ! !-- Non-cyclic lateral boundaries require the multigrid method and Piascek- !-- Willimas advection scheme. Several schemes and tools do not work with !-- non-cyclic boundary conditions. IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN IF ( psolver /= 'multigrid' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' non-cyclic lateral boundaries do not allow', & ' psolver = ', psolver ENDIF CALL local_stop ENDIF IF ( momentum_advec /= 'pw-scheme' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' non-cyclic lateral boundaries do not allow', & ' momentum_advec = ', momentum_advec ENDIF CALL local_stop ENDIF IF ( scalar_advec /= 'pw-scheme' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' non-cyclic lateral boundaries do not allow', & ' scalar_advec = ', scalar_advec ENDIF CALL local_stop ENDIF IF ( galilei_transformation ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' non-cyclic lateral boundaries do not allow', & ' galilei_transformation = .T.' ENDIF CALL local_stop ENDIF ! IF ( conserve_volume_flow ) THEN ! IF ( myid == 0 ) THEN ! PRINT*, '+++ check_parameters:' ! PRINT*, ' non-cyclic lateral boundaries do not allow', & ! ' conserve_volume_flow = .T.' ! ENDIF ! CALL local_stop ! ENDIF ENDIF ! !-- Bottom boundary condition for the turbulent Kinetic energy IF ( bc_e_b == 'neumann' ) THEN ibc_e_b = 1 IF ( adjust_mixing_length .AND. prandtl_layer ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters:' PRINT*, ' adjust_mixing_length = TRUE and bc_e_b = ', bc_e_b ENDIF ENDIF ELSEIF ( bc_e_b == '(u*)**2+neumann' ) THEN ibc_e_b = 2 IF ( .NOT. adjust_mixing_length .AND. prandtl_layer ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters:' PRINT*, ' adjust_mixing_length = FALSE and bc_e_b = ', bc_e_b ENDIF ENDIF IF ( .NOT. prandtl_layer ) THEN bc_e_b = 'neumann' ibc_e_b = 1 IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters:' PRINT*, ' boundary condition bc_e_b changed to "', bc_e_b, '"' ENDIF ENDIF ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_e_b = ', bc_e_b ENDIF CALL local_stop ENDIF ! !-- Boundary conditions for perturbation pressure IF ( bc_p_b == 'dirichlet' ) THEN ibc_p_b = 0 ELSEIF ( bc_p_b == 'neumann' ) THEN ibc_p_b = 1 ELSEIF ( bc_p_b == 'neumann+inhomo' ) THEN ibc_p_b = 2 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_p_b = ', bc_p_b ENDIF CALL local_stop ENDIF IF ( ibc_p_b == 2 .AND. .NOT. prandtl_layer ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' boundary condition: bc_p_b = ', TRIM( bc_p_b ), & ' not allowed with' PRINT*, ' prandtl_layer = .FALSE.' ENDIF CALL local_stop ENDIF IF ( bc_p_t == 'dirichlet' ) THEN ibc_p_t = 0 ELSEIF ( bc_p_t == 'neumann' ) THEN ibc_p_t = 1 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_p_t = ', bc_p_t ENDIF CALL local_stop ENDIF ! !-- Boundary conditions for potential temperature IF ( bc_pt_b == 'dirichlet' ) THEN ibc_pt_b = 0 ELSEIF ( bc_pt_b == 'neumann' ) THEN ibc_pt_b = 1 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_pt_b = ', bc_pt_b ENDIF CALL local_stop ENDIF IF ( bc_pt_t == 'dirichlet' ) THEN ibc_pt_t = 0 ELSEIF ( bc_pt_t == 'neumann' ) THEN ibc_pt_t = 1 ELSEIF ( bc_pt_t == 'initial_gradient' ) THEN ibc_pt_t = 2 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_pt_t = ', bc_pt_t ENDIF CALL local_stop ENDIF IF ( surface_heatflux == 9999999.9 ) constant_heatflux = .FALSE. IF ( top_heatflux == 9999999.9 ) constant_top_heatflux = .FALSE. ! !-- A given surface temperature implies Dirichlet boundary condition for !-- temperature. In this case specification of a constant heat flux is !-- forbidden. IF ( ibc_pt_b == 0 .AND. constant_heatflux .AND. & surface_heatflux /= 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' boundary_condition: bc_pt_b = ', bc_pt_b PRINT*, ' is not allowed with constant_heatflux = .TRUE.' ENDIF CALL local_stop ENDIF IF ( constant_heatflux .AND. pt_surface_initial_change /= 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: constant_heatflux = .TRUE. is not' PRINT*, ' allowed with pt_surface_initial_change (/=0) = ', & pt_surface_initial_change ENDIF CALL local_stop ENDIF ! !-- A given temperature at the top implies Dirichlet boundary condition for !-- temperature. In this case specification of a constant heat flux is !-- forbidden. IF ( ibc_pt_t == 0 .AND. constant_top_heatflux .AND. & top_heatflux /= 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' boundary_condition: bc_pt_t = ', bc_pt_t PRINT*, ' is not allowed with constant_top_heatflux = .TRUE.' ENDIF CALL local_stop ENDIF ! !-- In case of humidity or passive scalar, set boundary conditions for total !-- water content / scalar IF ( humidity .OR. passive_scalar ) THEN IF ( humidity ) THEN sq = 'q' ELSE sq = 's' ENDIF IF ( bc_q_b == 'dirichlet' ) THEN ibc_q_b = 0 ELSEIF ( bc_q_b == 'neumann' ) THEN ibc_q_b = 1 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_', sq, '_b = ', bc_q_b ENDIF CALL local_stop ENDIF IF ( bc_q_t == 'dirichlet' ) THEN ibc_q_t = 0 ELSEIF ( bc_q_t == 'neumann' ) THEN ibc_q_t = 1 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_', sq, '_t = ', bc_q_t ENDIF CALL local_stop ENDIF IF ( surface_waterflux == 0.0 ) constant_waterflux = .FALSE. ! !-- A given surface humidity implies Dirichlet boundary condition for !-- humidity. In this case specification of a constant water flux is !-- forbidden. IF ( ibc_q_b == 0 .AND. constant_waterflux ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' boundary_condition: bc_', sq, '_b = ', bc_q_b PRINT*, ' is not allowed with prescribed surface flux' ENDIF CALL local_stop ENDIF IF ( constant_waterflux .AND. q_surface_initial_change /= 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: a prescribed surface flux is not' PRINT*, ' allowed with ', sq, '_surface_initial_change (/=0)', & ' = ', q_surface_initial_change ENDIF CALL local_stop ENDIF ENDIF ! !-- Boundary conditions for horizontal components of wind speed IF ( bc_uv_b == 'dirichlet' ) THEN ibc_uv_b = 0 ELSEIF ( bc_uv_b == 'neumann' ) THEN ibc_uv_b = 1 IF ( prandtl_layer ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' boundary condition: bc_uv_b = ', TRIM( bc_uv_b ), & ' is not allowed with' PRINT*, ' prandtl_layer = .TRUE.' ENDIF CALL local_stop ENDIF ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_uv_b = ', bc_uv_b ENDIF CALL local_stop ENDIF IF ( bc_uv_t == 'dirichlet' ) THEN ibc_uv_t = 0 ELSEIF ( bc_uv_t == 'neumann' ) THEN ibc_uv_t = 1 ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown boundary condition: bc_uv_t = ', bc_uv_t ENDIF CALL local_stop ENDIF ! !-- Compute and check, respectively, the Rayleigh Damping parameter IF ( rayleigh_damping_factor == -1.0 ) THEN IF ( momentum_advec == 'ups-scheme' ) THEN rayleigh_damping_factor = 0.01 ELSE rayleigh_damping_factor = 0.0 ENDIF ELSE IF ( rayleigh_damping_factor < 0.0 .OR. rayleigh_damping_factor > 1.0 ) & THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' rayleigh_damping_factor = ', rayleigh_damping_factor,& ' out of range [0.0,1.0]' ENDIF CALL local_stop ENDIF ENDIF IF ( rayleigh_damping_height == -1.0 ) THEN rayleigh_damping_height = 0.66666666666 * zu(nzt) ELSE IF ( rayleigh_damping_height < 0.0 .OR. & rayleigh_damping_height > zu(nzt) ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' rayleigh_damping_height = ', rayleigh_damping_height,& ' out of range [0.0,', zu(nzt), ']' ENDIF CALL local_stop ENDIF ENDIF ! !-- Check limiters for Upstream-Spline scheme IF ( overshoot_limit_u < 0.0 .OR. overshoot_limit_v < 0.0 .OR. & overshoot_limit_w < 0.0 .OR. overshoot_limit_pt < 0.0 .OR. & overshoot_limit_e < 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' overshoot_limit_... < 0.0 is not allowed' ENDIF CALL local_stop ENDIF IF ( ups_limit_u < 0.0 .OR. ups_limit_v < 0.0 .OR. ups_limit_w < 0.0 .OR. & ups_limit_pt < 0.0 .OR. ups_limit_e < 0.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' ups_limit_... < 0.0 is not allowed' ENDIF CALL local_stop ENDIF ! !-- Check number of chosen statistic regions. More than 10 regions are not !-- allowed, because so far no more than 10 corresponding output files can !-- be opened (cf. check_open) IF ( statistic_regions > 9 .OR. statistic_regions < 0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: Number of statistic_regions = ', & statistic_regions+1 PRINT*, ' Only 10 regions are allowed' ENDIF CALL local_stop ENDIF IF ( normalizing_region > statistic_regions .OR. & normalizing_region < 0) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: normalizing_region = ', & normalizing_region, ' is unknown' PRINT*, ' Must be <= ', statistic_regions ENDIF CALL local_stop ENDIF ! !-- Set the default intervals for data output, if necessary !-- NOTE: dt_dosp has already been set in package_parin IF ( dt_data_output /= 9999999.9 ) THEN IF ( dt_dopr == 9999999.9 ) dt_dopr = dt_data_output IF ( dt_dopts == 9999999.9 ) dt_dopts = dt_data_output IF ( dt_do2d_xy == 9999999.9 ) dt_do2d_xy = dt_data_output IF ( dt_do2d_xz == 9999999.9 ) dt_do2d_xz = dt_data_output IF ( dt_do2d_yz == 9999999.9 ) dt_do2d_yz = dt_data_output IF ( dt_do3d == 9999999.9 ) dt_do3d = dt_data_output IF ( dt_data_output_av == 9999999.9 ) dt_data_output_av = dt_data_output ENDIF ! !-- Set the default skip time intervals for data output, if necessary IF ( skip_time_dopr == 9999999.9 ) & skip_time_dopr = skip_time_data_output IF ( skip_time_dosp == 9999999.9 ) & skip_time_dosp = skip_time_data_output IF ( skip_time_do2d_xy == 9999999.9 ) & skip_time_do2d_xy = skip_time_data_output IF ( skip_time_do2d_xz == 9999999.9 ) & skip_time_do2d_xz = skip_time_data_output IF ( skip_time_do2d_yz == 9999999.9 ) & skip_time_do2d_yz = skip_time_data_output IF ( skip_time_do3d == 9999999.9 ) & skip_time_do3d = skip_time_data_output IF ( skip_time_data_output_av == 9999999.9 ) & skip_time_data_output_av = skip_time_data_output ! !-- Check the average intervals (first for 3d-data, then for profiles and !-- spectra) IF ( averaging_interval > dt_data_output_av ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: average_interval=', & averaging_interval, ' must be <= dt_data_output=', & dt_data_output ENDIF CALL local_stop ENDIF IF ( averaging_interval_pr == 9999999.9 ) THEN averaging_interval_pr = averaging_interval ENDIF IF ( averaging_interval_pr > dt_dopr ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: averaging_interval_pr=', & averaging_interval_pr, ' must be <= dt_dopr=', dt_dopr ENDIF CALL local_stop ENDIF IF ( averaging_interval_sp == 9999999.9 ) THEN averaging_interval_sp = averaging_interval ENDIF IF ( averaging_interval_sp > dt_dosp ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: averaging_interval_sp=', & averaging_interval_sp, ' must be <= dt_dosp=', dt_dosp ENDIF CALL local_stop ENDIF ! !-- Set the default interval for profiles entering the temporal average IF ( dt_averaging_input_pr == 9999999.9 ) THEN dt_averaging_input_pr = dt_averaging_input ENDIF ! !-- Set the default interval for the output of timeseries to a reasonable !-- value (tries to minimize the number of calls of flow_statistics) IF ( dt_dots == 9999999.9 ) THEN IF ( averaging_interval_pr == 0.0 ) THEN dt_dots = MIN( dt_run_control, dt_dopr ) ELSE dt_dots = MIN( dt_run_control, dt_averaging_input_pr ) ENDIF ENDIF ! !-- Check the sample rate for averaging (first for 3d-data, then for profiles) IF ( dt_averaging_input > averaging_interval ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: dt_averaging_input=', & dt_averaging_input, ' must be <= averaging_interval=', & averaging_interval ENDIF CALL local_stop ENDIF IF ( dt_averaging_input_pr > averaging_interval_pr ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: dt_averaging_input_pr=', & dt_averaging_input_pr, & ' must be <= averaging_interval_pr=', & averaging_interval_pr ENDIF CALL local_stop ENDIF ! !-- Set the default value for the integration interval of precipitation amount IF ( precipitation ) THEN IF ( precipitation_amount_interval == 9999999.9 ) THEN precipitation_amount_interval = dt_do2d_xy ELSE IF ( precipitation_amount_interval > dt_do2d_xy ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: ', & 'precipitation_amount_interval =', & precipitation_amount_interval, & ' must not be larger than dt_do2d_xy', & ' = ', dt_do2d_xy CALL local_stop ENDIF ENDIF ENDIF ! !-- Determine the number of output profiles and check whether they are !-- permissible DO WHILE ( data_output_pr(dopr_n+1) /= ' ' ) dopr_n = dopr_n + 1 i = dopr_n ! !-- Determine internal profile number (for hom, homs) !-- and store height levels SELECT CASE ( TRIM( data_output_pr(i) ) ) CASE ( 'u', '#u' ) dopr_index(i) = 1 hom(:,2,1,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 5 hom(:,2,5,:) = SPREAD( zu, 2, statistic_regions+1 ) data_output_pr(i) = data_output_pr(i)(2:) ENDIF CASE ( 'v', '#v' ) dopr_index(i) = 2 hom(:,2,2,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 6 hom(:,2,6,:) = SPREAD( zu, 2, statistic_regions+1 ) data_output_pr(i) = data_output_pr(i)(2:) ENDIF CASE ( 'w' ) dopr_index(i) = 3 hom(:,2,3,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'pt', '#pt' ) IF ( .NOT. cloud_physics ) THEN dopr_index(i) = 4 hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 7 hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,7,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ELSE dopr_index(i) = 43 hom(:,2,43,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 28 hom(:,2,28,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,28,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ENDIF CASE ( 'e' ) dopr_index(i) = 8 hom(:,2,8,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,8,:) = 0.0 CASE ( 'km', '#km' ) dopr_index(i) = 9 hom(:,2,9,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,9,:) = 0.0 IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 23 hom(:,2,23,:) = hom(:,2,9,:) data_output_pr(i) = data_output_pr(i)(2:) ENDIF CASE ( 'kh', '#kh' ) dopr_index(i) = 10 hom(:,2,10,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,10,:) = 0.0 IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 24 hom(:,2,24,:) = hom(:,2,10,:) data_output_pr(i) = data_output_pr(i)(2:) ENDIF CASE ( 'l', '#l' ) dopr_index(i) = 11 hom(:,2,11,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,11,:) = 0.0 IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 25 hom(:,2,25,:) = hom(:,2,11,:) data_output_pr(i) = data_output_pr(i)(2:) ENDIF CASE ( 'w"u"' ) dopr_index(i) = 12 hom(:,2,12,:) = SPREAD( zw, 2, statistic_regions+1 ) IF ( prandtl_layer ) hom(nzb,2,12,:) = zu(1) CASE ( 'w*u*' ) dopr_index(i) = 13 hom(:,2,13,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w"v"' ) dopr_index(i) = 14 hom(:,2,14,:) = SPREAD( zw, 2, statistic_regions+1 ) IF ( prandtl_layer ) hom(nzb,2,14,:) = zu(1) CASE ( 'w*v*' ) dopr_index(i) = 15 hom(:,2,15,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w"pt"' ) dopr_index(i) = 16 hom(:,2,16,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w*pt*' ) dopr_index(i) = 17 hom(:,2,17,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'wpt' ) dopr_index(i) = 18 hom(:,2,18,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'wu' ) dopr_index(i) = 19 hom(:,2,19,:) = SPREAD( zw, 2, statistic_regions+1 ) IF ( prandtl_layer ) hom(nzb,2,19,:) = zu(1) CASE ( 'wv' ) dopr_index(i) = 20 hom(:,2,20,:) = SPREAD( zw, 2, statistic_regions+1 ) IF ( prandtl_layer ) hom(nzb,2,20,:) = zu(1) CASE ( 'w*pt*BC' ) dopr_index(i) = 21 hom(:,2,21,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'wptBC' ) dopr_index(i) = 22 hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'u*2' ) dopr_index(i) = 30 hom(:,2,30,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'v*2' ) dopr_index(i) = 31 hom(:,2,31,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'w*2' ) dopr_index(i) = 32 hom(:,2,32,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'pt*2' ) dopr_index(i) = 33 hom(:,2,33,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'e*' ) dopr_index(i) = 34 hom(:,2,34,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'w*2pt*' ) dopr_index(i) = 35 hom(:,2,35,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w*pt*2' ) dopr_index(i) = 36 hom(:,2,36,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w*e*' ) dopr_index(i) = 37 hom(:,2,37,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w*3' ) dopr_index(i) = 38 hom(:,2,38,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'Sw' ) dopr_index(i) = 39 hom(:,2,39,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'q', '#q' ) IF ( .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 41 hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 26 hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ENDIF CASE ( 's', '#s' ) IF ( .NOT. passive_scalar ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for passive_scalar = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 41 hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 26 hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ENDIF CASE ( 'qv', '#qv' ) IF ( .NOT. cloud_physics ) THEN dopr_index(i) = 41 hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 26 hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,26,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ELSE dopr_index(i) = 42 hom(:,2,42,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 27 hom(:,2,27,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,27,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ENDIF CASE ( 'lpt', '#lpt' ) IF ( .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 4 hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 7 hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,7,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF ENDIF CASE ( 'vpt', '#vpt' ) dopr_index(i) = 44 hom(:,2,44,:) = SPREAD( zu, 2, statistic_regions+1 ) IF ( data_output_pr(i)(1:1) == '#' ) THEN dopr_initial_index(i) = 29 hom(:,2,29,:) = SPREAD( zu, 2, statistic_regions+1 ) hom(nzb,2,29,:) = 0.0 ! weil zu(nzb) negativ ist data_output_pr(i) = data_output_pr(i)(2:) ENDIF CASE ( 'w"vpt"' ) dopr_index(i) = 45 hom(:,2,45,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w*vpt*' ) dopr_index(i) = 46 hom(:,2,46,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'wvpt' ) dopr_index(i) = 47 hom(:,2,47,:) = SPREAD( zw, 2, statistic_regions+1 ) CASE ( 'w"q"' ) IF ( .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 48 hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) ENDIF CASE ( 'w*q*' ) IF ( .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 49 hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) ENDIF CASE ( 'wq' ) IF ( .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 50 hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) ENDIF CASE ( 'w"s"' ) IF ( .NOT. passive_scalar ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for passive_scalar = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 48 hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) ENDIF CASE ( 'w*s*' ) IF ( .NOT. passive_scalar ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for passive_scalar = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 49 hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) ENDIF CASE ( 'ws' ) IF ( .NOT. passive_scalar ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for passive_scalar = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 50 hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) ENDIF CASE ( 'w"qv"' ) IF ( humidity .AND. .NOT. cloud_physics ) & THEN dopr_index(i) = 48 hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) ELSEIF( humidity .AND. cloud_physics ) THEN dopr_index(i) = 51 hom(:,2,51,:) = SPREAD( zw, 2, statistic_regions+1 ) ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE', & ' and humidity = FALSE' ENDIF CALL local_stop ENDIF CASE ( 'w*qv*' ) IF ( humidity .AND. .NOT. cloud_physics ) & THEN dopr_index(i) = 49 hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) ELSEIF( humidity .AND. cloud_physics ) THEN dopr_index(i) = 52 hom(:,2,52,:) = SPREAD( zw, 2, statistic_regions+1 ) ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE', & ' and humidity = FALSE' ENDIF CALL local_stop ENDIF CASE ( 'wqv' ) IF ( humidity .AND. .NOT. cloud_physics ) & THEN dopr_index(i) = 50 hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) ELSEIF( humidity .AND. cloud_physics ) THEN dopr_index(i) = 53 hom(:,2,53,:) = SPREAD( zw, 2, statistic_regions+1 ) ELSE IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE', & ' and humidity = FALSE' ENDIF CALL local_stop ENDIF CASE ( 'ql' ) IF ( .NOT. cloud_physics .AND. .NOT. cloud_droplets ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: data_output_pr = ', & data_output_pr(i), & ' is not implemented for cloud_physics = FALSE' ENDIF CALL local_stop ELSE dopr_index(i) = 54 hom(:,2,54,:) = SPREAD( zu, 2, statistic_regions+1 ) ENDIF CASE ( 'w*u*u*/dz' ) dopr_index(i) = 55 hom(:,2,55,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'w*p*/dz' ) dopr_index(i) = 56 hom(:,2,56,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'w"e/dz' ) dopr_index(i) = 57 hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'u"pt"' ) dopr_index(i) = 58 hom(:,2,58,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'u*pt*' ) dopr_index(i) = 59 hom(:,2,59,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'upt_t' ) dopr_index(i) = 60 hom(:,2,60,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'v"pt"' ) dopr_index(i) = 61 hom(:,2,61,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'v*pt*' ) dopr_index(i) = 62 hom(:,2,62,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE ( 'vpt_t' ) dopr_index(i) = 63 hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 ) CASE DEFAULT IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: unknown output profile: ', & 'data_output_pr = ', data_output_pr(i) ENDIF CALL local_stop END SELECT ! !-- Check to which of the predefined coordinate systems the profile belongs DO k = 1, crmax IF ( INDEX( cross_profiles(k), ' '//TRIM( data_output_pr(i) )//' ' ) & /=0 ) & THEN dopr_crossindex(i) = k EXIT ENDIF ENDDO ! !-- Generate the text for the labels of the PROFIL output file. "-characters !-- must be substituted, otherwise PROFIL would interpret them as TeX !-- control characters dopr_label(i) = data_output_pr(i) position = INDEX( dopr_label(i) , '"' ) DO WHILE ( position /= 0 ) dopr_label(i)(position:position) = '''' position = INDEX( dopr_label(i) , '"' ) ENDDO ENDDO ! !-- y-value range of the coordinate system (PROFIL). !-- x-value range determined in plot_1d. cross_uymin = 0.0 IF ( z_max_do1d == -1.0 ) THEN cross_uymax = zu(nzt+1) ELSEIF ( z_max_do1d < zu(nzb+1) .OR. z_max_do1d > zu(nzt+1) ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: z_max_do1d=', & z_max_do1d,' must be >= ', zu(nzb+1), & ' or <= ', zu(nzt+1) CALL local_stop ELSE cross_uymax = z_max_do1d ENDIF ! !-- Check whether the chosen normalizing factor for the coordinate systems is !-- permissible DO i = 1, crmax SELECT CASE ( TRIM( cross_normalized_x(i) ) ) ! TRIM required on IBM CASE ( '', 'wpt0', 'ws2', 'tsw2', 'ws3', 'ws2tsw', 'wstsw2' ) j = 0 CASE DEFAULT IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: unknown normalize method' PRINT*, ' cross_normalized_x="',cross_normalized_x(i),'"' ENDIF CALL local_stop END SELECT SELECT CASE ( TRIM( cross_normalized_y(i) ) ) ! TRIM required on IBM CASE ( '', 'z_i' ) j = 0 CASE DEFAULT IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: unknown normalize method' PRINT*, ' cross_normalized_y="',cross_normalized_y(i),'"' ENDIF CALL local_stop END SELECT ENDDO ! !-- Check normalized y-value range of the coordinate system (PROFIL) IF ( z_max_do1d_normalized /= -1.0 .AND. z_max_do1d_normalized <= 0.0 ) & THEN IF ( myid == 0 ) PRINT*,'+++ check_parameters: z_max_do1d_normalize', & 'd=', z_max_do1d_normalized, ' must be >= 0.0' CALL local_stop ENDIF ! !-- Append user-defined data output variables to the standard data output IF ( data_output_user(1) /= ' ' ) THEN i = 1 DO WHILE ( data_output(i) /= ' ' .AND. i <= 100 ) i = i + 1 ENDDO j = 1 DO WHILE ( data_output_user(j) /= ' ' .AND. j <= 100 ) IF ( i > 100 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: number of output quantitities', & ' given by data_output and data_output_user' PRINT*, ' exceeds the limit of 100' ENDIF CALL local_stop ENDIF data_output(i) = data_output_user(j) i = i + 1 j = j + 1 ENDDO ENDIF ! !-- Check and set steering parameters for 2d/3d data output and averaging i = 1 DO WHILE ( data_output(i) /= ' ' .AND. i <= 100 ) ! !-- Check for data averaging ilen = LEN_TRIM( data_output(i) ) j = 0 ! no data averaging IF ( ilen > 3 ) THEN IF ( data_output(i)(ilen-2:ilen) == '_av' ) THEN j = 1 ! data averaging data_output(i) = data_output(i)(1:ilen-3) ENDIF ENDIF ! !-- Check for cross section or volume data ilen = LEN_TRIM( data_output(i) ) k = 0 ! 3d data var = data_output(i)(1:ilen) IF ( ilen > 3 ) THEN IF ( data_output(i)(ilen-2:ilen) == '_xy' .OR. & data_output(i)(ilen-2:ilen) == '_xz' .OR. & data_output(i)(ilen-2:ilen) == '_yz' ) THEN k = 1 ! 2d data var = data_output(i)(1:ilen-3) ENDIF ENDIF ! !-- Check for allowed value and set units SELECT CASE ( TRIM( var ) ) CASE ( 'e' ) IF ( constant_diffusion ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires constant_diffusion = .FALSE.' ENDIF CALL local_stop ENDIF unit = 'm2/s2' CASE ( 'pc', 'pr' ) IF ( .NOT. particle_advection ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires particle package' PRINT*, ' (mrun-option "-p particles")' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'pc' ) unit = 'number' IF ( TRIM( var ) == 'pr' ) unit = 'm' CASE ( 'q', 'vpt' ) IF ( .NOT. humidity ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires humidity = .TRUE.' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'q' ) unit = 'kg/kg' IF ( TRIM( var ) == 'vpt' ) unit = 'K' CASE ( 'ql' ) IF ( .NOT. ( cloud_physics .OR. cloud_droplets ) ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires cloud_physics = .TRUE.' PRINT*, ' or cloud_droplets = .TRUE.' ENDIF CALL local_stop ENDIF unit = 'kg/kg' CASE ( 'ql_c', 'ql_v', 'ql_vp' ) IF ( .NOT. cloud_droplets ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires cloud_droplets = .TRUE.' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'ql_c' ) unit = 'kg/kg' IF ( TRIM( var ) == 'ql_v' ) unit = 'm3' IF ( TRIM( var ) == 'ql_vp' ) unit = 'none' CASE ( 'qv' ) IF ( .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires cloud_physics = .TRUE.' ENDIF CALL local_stop ENDIF unit = 'kg/kg' CASE ( 's' ) IF ( .NOT. passive_scalar ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires passive_scalar = .TRUE.' ENDIF CALL local_stop ENDIF unit = 'conc' CASE ( 'u*', 't*', 'lwp*', 'pra*', 'prr*', 'z0*' ) IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: illegal value for data_',& 'output: "', TRIM( var ), '" is only allowed' PRINT*, ' for horizontal cross section' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'lwp*' .AND. .NOT. cloud_physics ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires cloud_physics = .TRUE.' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires precipitation = .TRUE.' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'pra*' .AND. j == 1 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: temporal averaging of ', & ' precipitation amount "', TRIM( var ), & '" not possible' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'prr*' .AND. .NOT. precipitation ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: output of "', TRIM( var ), & '" requires precipitation = .TRUE.' ENDIF CALL local_stop ENDIF IF ( TRIM( var ) == 'u*' ) unit = 'm/s' IF ( TRIM( var ) == 't*' ) unit = 'K' IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/kg*m' IF ( TRIM( var ) == 'pra*' ) unit = 'mm' IF ( TRIM( var ) == 'prr*' ) unit = 'mm/s' IF ( TRIM( var ) == 'z0*' ) unit = 'm' CASE ( 'p', 'pt', 'u', 'v', 'w' ) IF ( TRIM( var ) == 'p' ) unit = 'Pa' IF ( TRIM( var ) == 'pt' ) unit = 'K' IF ( TRIM( var ) == 'u' ) unit = 'm/s' IF ( TRIM( var ) == 'v' ) unit = 'm/s' IF ( TRIM( var ) == 'w' ) unit = 'm/s' CONTINUE CASE DEFAULT CALL user_check_data_output( var, unit ) IF ( unit == 'illegal' ) THEN IF ( myid == 0 ) THEN IF ( data_output_user(1) /= ' ' ) THEN PRINT*, '+++ check_parameters: illegal value for data_',& 'output or data_output_user: "', & TRIM( data_output(i) ), '"' ELSE PRINT*, '+++ check_parameters: illegal value for data_',& 'output: "', TRIM( data_output(i) ), '"' ENDIF ENDIF CALL local_stop ENDIF END SELECT ! !-- Set the internal steering parameters appropriately IF ( k == 0 ) THEN do3d_no(j) = do3d_no(j) + 1 do3d(j,do3d_no(j)) = data_output(i) do3d_unit(j,do3d_no(j)) = unit ELSE do2d_no(j) = do2d_no(j) + 1 do2d(j,do2d_no(j)) = data_output(i) do2d_unit(j,do2d_no(j)) = unit IF ( data_output(i)(ilen-2:ilen) == '_xy' ) THEN data_output_xy(j) = .TRUE. ENDIF IF ( data_output(i)(ilen-2:ilen) == '_xz' ) THEN data_output_xz(j) = .TRUE. ENDIF IF ( data_output(i)(ilen-2:ilen) == '_yz' ) THEN data_output_yz(j) = .TRUE. ENDIF ENDIF IF ( j == 1 ) THEN ! !-- Check, if variable is already subject to averaging found = .FALSE. DO k = 1, doav_n IF ( TRIM( doav(k) ) == TRIM( var ) ) found = .TRUE. ENDDO IF ( .NOT. found ) THEN doav_n = doav_n + 1 doav(doav_n) = var ENDIF ENDIF i = i + 1 ENDDO ! !-- Store sectional planes in one shared array section(:,1) = section_xy section(:,2) = section_xz section(:,3) = section_yz ! !-- Upper plot limit (grid point value) for 1D profiles IF ( z_max_do1d == -1.0 ) THEN nz_do1d = nzt+1 ELSE DO k = nzb+1, nzt+1 nz_do1d = k IF ( zw(k) > z_max_do1d ) EXIT ENDDO ENDIF ! !-- Upper plot limit for 2D vertical sections IF ( z_max_do2d == -1.0 ) z_max_do2d = zu(nzt) IF ( z_max_do2d < zu(nzb+1) .OR. z_max_do2d > zu(nzt) ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: z_max_do2d=', & z_max_do2d, ' must be >= ', zu(nzb+1), & '(zu(nzb+1)) and <= ', zu(nzt), ' (zu(nzt))' CALL local_stop ENDIF ! !-- Upper plot limit for 3D arrays IF ( nz_do3d == -9999 ) nz_do3d = nzt + 1 ! !-- Determine and check accuracy for compressed 3D plot output IF ( do3d_compress ) THEN ! !-- Compression only permissible on T3E machines IF ( host(1:3) /= 't3e' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: do3d_compress = .TRUE. not allow', & 'ed on host "', TRIM( host ), '"' ENDIF CALL local_stop ENDIF i = 1 DO WHILE ( do3d_comp_prec(i) /= ' ' ) ilen = LEN_TRIM( do3d_comp_prec(i) ) IF ( LLT( do3d_comp_prec(i)(ilen:ilen), '0' ) .OR. & LGT( do3d_comp_prec(i)(ilen:ilen), '9' ) ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: illegal precision: ', & 'do3d_comp_prec(', i, ')="', TRIM(do3d_comp_prec(i)),'"' ENDIF CALL local_stop ENDIF prec = IACHAR( do3d_comp_prec(i)(ilen:ilen) ) - IACHAR( '0' ) var = do3d_comp_prec(i)(1:ilen-1) SELECT CASE ( var ) CASE ( 'u' ) j = 1 CASE ( 'v' ) j = 2 CASE ( 'w' ) j = 3 CASE ( 'p' ) j = 4 CASE ( 'pt' ) j = 5 CASE DEFAULT IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: unknown variable in ', & 'assignment' PRINT*, ' do3d_comp_prec(', i, ')="', & TRIM( do3d_comp_prec(i) ),'"' ENDIF CALL local_stop END SELECT plot_3d_precision(j)%precision = prec i = i + 1 ENDDO ENDIF ! !-- Check the data output format(s) IF ( data_output_format(1) == ' ' ) THEN ! !-- Default value netcdf_output = .TRUE. ELSE i = 1 DO WHILE ( data_output_format(i) /= ' ' ) SELECT CASE ( data_output_format(i) ) CASE ( 'netcdf' ) netcdf_output = .TRUE. CASE ( 'iso2d' ) iso2d_output = .TRUE. CASE ( 'profil' ) profil_output = .TRUE. CASE ( 'avs' ) avs_output = .TRUE. CASE DEFAULT IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown value for data_output_format "', & TRIM( data_output_format(i) ),'"' ENDIF CALL local_stop END SELECT i = i + 1 IF ( i > 10 ) EXIT ENDDO ENDIF ! !-- Check netcdf precison ldum = .FALSE. CALL define_netcdf_header( 'ch', ldum, 0 ) ! !-- Check, whether a constant diffusion coefficient shall be used IF ( km_constant /= -1.0 ) THEN IF ( km_constant < 0.0 ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: km_constant=', & km_constant, ' < 0.0' CALL local_stop ELSE IF ( prandtl_number < 0.0 ) THEN IF ( myid == 0 ) PRINT*,'+++ check_parameters: prandtl_number=',& prandtl_number, ' < 0.0' CALL local_stop ENDIF constant_diffusion = .TRUE. IF ( prandtl_layer ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: prandtl_layer ',& 'is not allowed with fixed value of km' CALL local_stop ENDIF ENDIF ENDIF ! !-- In case of non-cyclic lateral boundaries, set the default maximum value !-- for the horizontal diffusivity used within the outflow damping layer, !-- and check/set the width of the damping layer IF ( bc_lr /= 'cyclic' ) THEN IF ( km_damp_max == -1.0 ) THEN km_damp_max = 0.5 * dx ENDIF IF ( outflow_damping_width == -1.0 ) THEN outflow_damping_width = MIN( 20, nx/2 ) ENDIF IF ( outflow_damping_width <= 0 .OR. outflow_damping_width > nx ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: outflow_damping w',& 'idth out of range' CALL local_stop ENDIF ENDIF IF ( bc_ns /= 'cyclic' ) THEN IF ( km_damp_max == -1.0 ) THEN km_damp_max = 0.5 * dy ENDIF IF ( outflow_damping_width == -1.0 ) THEN outflow_damping_width = MIN( 20, ny/2 ) ENDIF IF ( outflow_damping_width <= 0 .OR. outflow_damping_width > ny ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: outflow_damping w',& 'idth out of range' CALL local_stop ENDIF ENDIF ! !-- Check value range for rif IF ( rif_min >= rif_max ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: rif_min=', rif_min, & ' must be less than rif_max=', rif_max CALL local_stop ENDIF ! !-- Determine upper and lower hight level indices for random perturbations IF ( disturbance_level_b == -1.0 ) THEN disturbance_level_b = zu(nzb+3) disturbance_level_ind_b = nzb + 3 ELSEIF ( disturbance_level_b < zu(3) ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: disturbance_level_b=',& disturbance_level_b, ' must be >= ',zu(3), & '(zu(3))' CALL local_stop ELSEIF ( disturbance_level_b > zu(nzt-2) ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: disturbance_level_b=',& disturbance_level_b, ' must be <= ',zu(nzt-2),& '(zu(nzt-2))' CALL local_stop ELSE DO k = 3, nzt-2 IF ( disturbance_level_b <= zu(k) ) THEN disturbance_level_ind_b = k EXIT ENDIF ENDDO ENDIF IF ( disturbance_level_t == -1.0 ) THEN disturbance_level_t = zu(nzt/3) disturbance_level_ind_t = nzt / 3 ELSEIF ( disturbance_level_t > zu(nzt-2) ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: disturbance_level_t=',& disturbance_level_t, ' must be <= ',zu(nzt-2),& '(zu(nzt-2))' CALL local_stop ELSEIF ( disturbance_level_t < disturbance_level_b ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: disturbance_level_t=',& disturbance_level_t, ' must be >= ', & 'disturbance_level_b=', disturbance_level_b CALL local_stop ELSE DO k = 3, nzt-2 IF ( disturbance_level_t <= zu(k) ) THEN disturbance_level_ind_t = k EXIT ENDIF ENDDO ENDIF ! !-- Check again whether the levels determined this way are ok. !-- Error may occur at automatic determination and too few grid points in !-- z-direction. IF ( disturbance_level_ind_t < disturbance_level_ind_b ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: ', & 'disturbance_level_ind_t=', & disturbance_level_ind_t, ' must be >= ', & 'disturbance_level_ind_b=', & disturbance_level_ind_b CALL local_stop ENDIF ! !-- Determine the horizontal index range for random perturbations. !-- In case of non-cyclic horizontal boundaries, no perturbations are imposed !-- near the inflow and the perturbation area is further limited to ...(1) !-- after the initial phase of the flow. dist_nxl = 0; dist_nxr = nx dist_nys = 0; dist_nyn = ny IF ( bc_lr /= 'cyclic' ) THEN IF ( inflow_disturbance_begin == -1 ) THEN inflow_disturbance_begin = MIN( 10, nx/2 ) ENDIF IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > nx )& THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: inflow_disturbance',& '_begin out of range' CALL local_stop ENDIF IF ( inflow_disturbance_end == -1 ) THEN inflow_disturbance_end = MIN( 100, 3*nx/4 ) ENDIF IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > nx ) & THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: inflow_disturbance',& '_end out of range' CALL local_stop ENDIF ELSEIF ( bc_ns /= 'cyclic' ) THEN IF ( inflow_disturbance_begin == -1 ) THEN inflow_disturbance_begin = MIN( 10, ny/2 ) ENDIF IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > ny )& THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: inflow_disturbance',& '_begin out of range' CALL local_stop ENDIF IF ( inflow_disturbance_end == -1 ) THEN inflow_disturbance_end = MIN( 100, 3*ny/4 ) ENDIF IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > ny ) & THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: inflow_disturbance',& '_end out of range' CALL local_stop ENDIF ENDIF IF ( bc_lr == 'radiation/dirichlet' ) THEN dist_nxr = nx - inflow_disturbance_begin dist_nxl(1) = nx - inflow_disturbance_end ELSEIF ( bc_lr == 'dirichlet/radiation' ) THEN dist_nxl = inflow_disturbance_begin dist_nxr(1) = inflow_disturbance_end ENDIF IF ( bc_ns == 'dirichlet/radiation' ) THEN dist_nyn = ny - inflow_disturbance_begin dist_nys(1) = ny - inflow_disturbance_end ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN dist_nys = inflow_disturbance_begin dist_nyn(1) = inflow_disturbance_end ENDIF ! !-- Check random generator IF ( random_generator /= 'system-specific' .AND. & random_generator /= 'numerical-recipes' ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters:' PRINT*, ' unknown random generator: random_generator=', & random_generator ENDIF CALL local_stop ENDIF ! !-- Determine damping level index for 1D model IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN IF ( damp_level_1d == -1.0 ) THEN damp_level_1d = zu(nzt+1) damp_level_ind_1d = nzt + 1 ELSEIF ( damp_level_1d < 0.0 .OR. damp_level_1d > zu(nzt+1) ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: damp_level_1d=', & damp_level_1d, ' must be > 0.0 and < ', & 'zu(nzt+1)', zu(nzt+1) CALL local_stop ELSE DO k = 1, nzt+1 IF ( damp_level_1d <= zu(k) ) THEN damp_level_ind_1d = k EXIT ENDIF ENDDO ENDIF ENDIF ! !-- Check some other 1d-model parameters IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & TRIM( mixing_length_1d ) /= 'blackadar' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: mixing_length_1d = "', & TRIM( mixing_length_1d ), '" is unknown' CALL local_stop ENDIF IF ( TRIM( dissipation_1d ) /= 'as_in_3d_model' .AND. & TRIM( dissipation_1d ) /= 'detering' ) THEN IF ( myid == 0 ) PRINT*, '+++ check_parameters: dissipation_1d = "', & TRIM( dissipation_1d ), '" is unknown' CALL local_stop ENDIF ! !-- Set time for the next user defined restart (time_restart is the !-- internal parameter for steering restart events) IF ( restart_time /= 9999999.9 ) THEN IF ( restart_time > simulated_time ) time_restart = restart_time ELSE ! !-- In case of a restart run, set internal parameter to default (no restart) !-- if the NAMELIST-parameter restart_time is omitted time_restart = 9999999.9 ENDIF ! !-- Set default value of the time needed to terminate a model run IF ( termination_time_needed == -1.0 ) THEN IF ( host(1:3) == 'ibm' ) THEN termination_time_needed = 300.0 ELSE termination_time_needed = 35.0 ENDIF ENDIF ! !-- Check the time needed to terminate a model run IF ( host(1:3) == 't3e' ) THEN ! !-- Time needed must be at least 30 seconds on all CRAY machines, because !-- MPP_TREMAIN gives the remaining CPU time only in steps of 30 seconds IF ( termination_time_needed <= 30.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ check_parameters: termination_time_needed', & termination_time_needed PRINT*, ' must be > 30.0 on host "', host, & '"' ENDIF CALL local_stop ENDIF ELSEIF ( host(1:3) == 'ibm' ) THEN ! !-- On IBM-regatta machines the time should be at least 300 seconds, !-- because the job time consumed before executing palm (for compiling, !-- copying of files, etc.) has to be regarded IF ( termination_time_needed < 300.0 ) THEN IF ( myid == 0 ) THEN PRINT*, '+++ WARNING: check_parameters: termination_time_', & 'needed', termination_time_needed PRINT*, ' should be >= 300.0', & ' on host "', host, '"' ENDIF ENDIF ENDIF END SUBROUTINE check_parameters