[1682] | 1 | !> @file check_parameters.f90 |
---|
[2000] | 2 | !------------------------------------------------------------------------------! |
---|
[2696] | 3 | ! This file is part of the PALM model system. |
---|
[1036] | 4 | ! |
---|
[2000] | 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
[1036] | 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[4360] | 17 | ! Copyright 1997-2020 Leibniz Universitaet Hannover |
---|
[2000] | 18 | !------------------------------------------------------------------------------! |
---|
[1036] | 19 | ! |
---|
[484] | 20 | ! Current revisions: |
---|
[1] | 21 | ! ----------------- |
---|
[3517] | 22 | ! |
---|
[3705] | 23 | ! |
---|
[3517] | 24 | ! Former revisions: |
---|
| 25 | ! ----------------- |
---|
[4384] | 26 | ! $Id: check_parameters.f90 4495 2020-04-13 20:11:20Z eckhard $ |
---|
[4495] | 27 | ! check new restart_data_format parameters |
---|
| 28 | ! |
---|
| 29 | ! 4493 2020-04-10 09:49:43Z pavelkrc |
---|
[4472] | 30 | ! Kolmogorov length scale eta added to profile output |
---|
| 31 | ! |
---|
| 32 | ! 4444 2020-03-05 15:59:50Z raasch |
---|
[4444] | 33 | ! bugfix: cpp-directives for serial mode added |
---|
[4472] | 34 | ! |
---|
[4444] | 35 | ! 4392 2020-01-31 16:14:57Z pavelkrc |
---|
[4383] | 36 | ! Some error numbers revised to prevent double usage |
---|
[4472] | 37 | ! |
---|
[4383] | 38 | ! 11:55:33Z oliver.maas |
---|
[4340] | 39 | ! Checks for closed channel flow implemented |
---|
[4472] | 40 | ! |
---|
[4340] | 41 | ! 11:55:33Z oliver.maas |
---|
[4331] | 42 | ! Move 2-m potential temperature output to diagnostic_output_quantities |
---|
[4472] | 43 | ! |
---|
[4331] | 44 | ! 11:55:33Z oliver.maas |
---|
[4301] | 45 | ! removed message PA0421, concerning old parameter recycling_yshift |
---|
[4472] | 46 | ! |
---|
[4301] | 47 | ! 11:55:33Z oliver.maas |
---|
[4297] | 48 | ! adjust message to the modified parameter recycling_yshift |
---|
[4472] | 49 | ! |
---|
[4297] | 50 | ! 11:55:33Z oliver.maas |
---|
[4234] | 51 | ! Check if a cross section is specified if any output cross-section quantity |
---|
| 52 | ! is given |
---|
[4472] | 53 | ! |
---|
[4234] | 54 | ! 11:55:33Z oliver.maas |
---|
[4196] | 55 | ! Overwrite rotation_angle from namelist by value from static driver |
---|
[4472] | 56 | ! |
---|
[4196] | 57 | ! 11:55:33Z oliver.maas |
---|
[4472] | 58 | ! removed conversion from recycle_absolute_quantities to raq, added check and |
---|
[4183] | 59 | ! error message for correct input of recycling_method_for_thermodynamic_quantities |
---|
[4472] | 60 | ! |
---|
[4183] | 61 | ! 11:55:33Z oliver.maas |
---|
[4182] | 62 | ! Corrected "Former revisions" section |
---|
[4472] | 63 | ! |
---|
[4182] | 64 | ! 11:55:33Z oliver.maas |
---|
[4176] | 65 | ! bugfix error message: replaced PA184 by PA0184 |
---|
[4472] | 66 | ! |
---|
[4176] | 67 | ! 11:55:33Z oliver.maas |
---|
[4472] | 68 | ! added conversion from recycle_absolute_quantities to raq for recycling of |
---|
[4172] | 69 | ! absolute quantities and added error message PA184 for not implemented quantities |
---|
[4472] | 70 | ! |
---|
[4172] | 71 | ! 4142 2019-08-05 12:38:31Z suehring |
---|
[4142] | 72 | ! Consider spinup in number of output timesteps for averaged 2D output (merge |
---|
| 73 | ! from branch resler). |
---|
[4472] | 74 | ! |
---|
[4142] | 75 | ! 4069 2019-07-01 14:05:51Z Giersch |
---|
[4472] | 76 | ! Masked output running index mid has been introduced as a local variable to |
---|
[4069] | 77 | ! avoid runtime error (Loop variable has been modified) in time_integration |
---|
[4472] | 78 | ! |
---|
[4069] | 79 | ! 4048 2019-06-21 21:00:21Z knoop |
---|
[4048] | 80 | ! Moved tcm_check_data_output to module_interface |
---|
[4472] | 81 | ! |
---|
[4048] | 82 | ! 4039 2019-06-18 10:32:41Z suehring |
---|
[4039] | 83 | ! Modularize diagnostic output |
---|
[4472] | 84 | ! |
---|
[4039] | 85 | ! 4017 2019-06-06 12:16:46Z schwenkel |
---|
[3994] | 86 | ! output of turbulence intensity added |
---|
[4472] | 87 | ! |
---|
[3994] | 88 | ! 3933 2019-04-25 12:33:20Z kanani |
---|
[3933] | 89 | ! Alphabetical resorting in CASE, condense settings for theta_2m* into one IF clause |
---|
[4472] | 90 | ! |
---|
[3933] | 91 | ! 3885 2019-04-11 11:29:34Z kanani |
---|
[4472] | 92 | ! Changes related to global restructuring of location messages and introduction |
---|
[3885] | 93 | ! of additional debug messages |
---|
[4472] | 94 | ! |
---|
[3885] | 95 | ! 3766 2019-02-26 16:23:41Z raasch |
---|
[3766] | 96 | ! trim added to avoid truncation compiler warnings |
---|
[4472] | 97 | ! |
---|
[3766] | 98 | ! 3761 2019-02-25 15:31:42Z raasch |
---|
[3761] | 99 | ! unused variables removed |
---|
[4472] | 100 | ! |
---|
[3761] | 101 | ! 3735 2019-02-12 09:52:40Z dom_dwd_user |
---|
[4472] | 102 | ! Passing variable j (averaged output?) to |
---|
[3735] | 103 | ! module_interface.f90:chem_check_data_output. |
---|
[4472] | 104 | ! |
---|
[3735] | 105 | ! 3705 2019-01-29 19:56:39Z suehring |
---|
[3705] | 106 | ! bugfix: renamed thetav_t to vtheta_t |
---|
[4472] | 107 | ! |
---|
[3705] | 108 | ! 3702 2019-01-28 13:19:30Z gronemeier |
---|
[3668] | 109 | ! most_method removed |
---|
[4472] | 110 | ! |
---|
[3668] | 111 | ! 3655 2019-01-07 16:51:22Z knoop |
---|
[3646] | 112 | ! Formatting |
---|
[3467] | 113 | ! |
---|
[4182] | 114 | ! Revision 1.1 1997/08/26 06:29:23 raasch |
---|
| 115 | ! Initial revision |
---|
| 116 | ! |
---|
| 117 | ! |
---|
[1] | 118 | ! Description: |
---|
| 119 | ! ------------ |
---|
[1682] | 120 | !> Check control parameters and deduce further quantities. |
---|
[1] | 121 | !------------------------------------------------------------------------------! |
---|
[1682] | 122 | SUBROUTINE check_parameters |
---|
[1] | 123 | |
---|
[2312] | 124 | |
---|
[1] | 125 | USE arrays_3d |
---|
[3274] | 126 | |
---|
[3294] | 127 | USE basic_constants_and_equations_mod |
---|
| 128 | |
---|
[3274] | 129 | USE bulk_cloud_model_mod, & |
---|
[3637] | 130 | ONLY: bulk_cloud_model |
---|
[3274] | 131 | |
---|
[3298] | 132 | USE chem_modules |
---|
| 133 | |
---|
[2696] | 134 | USE chemistry_model_mod, & |
---|
[3637] | 135 | ONLY: chem_boundary_conds |
---|
[3294] | 136 | |
---|
[1] | 137 | USE control_parameters |
---|
[3294] | 138 | |
---|
[1] | 139 | USE grid_variables |
---|
[3294] | 140 | |
---|
| 141 | USE kinds |
---|
| 142 | |
---|
[1] | 143 | USE indices |
---|
[3294] | 144 | |
---|
[2338] | 145 | USE model_1d_mod, & |
---|
| 146 | ONLY: damp_level_1d, damp_level_ind_1d |
---|
| 147 | |
---|
[3637] | 148 | USE module_interface, & |
---|
| 149 | ONLY: module_interface_check_parameters, & |
---|
[3700] | 150 | module_interface_check_data_output_ts, & |
---|
[3637] | 151 | module_interface_check_data_output_pr, & |
---|
| 152 | module_interface_check_data_output |
---|
| 153 | |
---|
[2696] | 154 | USE netcdf_data_input_mod, & |
---|
| 155 | ONLY: init_model, input_pids_static, netcdf_data_input_check_dynamic, & |
---|
| 156 | netcdf_data_input_check_static |
---|
| 157 | |
---|
[1783] | 158 | USE netcdf_interface, & |
---|
| 159 | ONLY: dopr_unit, do2d_unit, do3d_unit, netcdf_data_format, & |
---|
[2037] | 160 | netcdf_data_format_string, dots_unit, heatflux_output_unit, & |
---|
[3700] | 161 | waterflux_output_unit, momentumflux_output_unit, & |
---|
| 162 | dots_max, dots_num, dots_label |
---|
[1826] | 163 | |
---|
[4017] | 164 | USE particle_attributes, & |
---|
| 165 | ONLY: particle_advection, use_sgs_for_particles |
---|
[4472] | 166 | |
---|
[1] | 167 | USE pegrid |
---|
[3294] | 168 | |
---|
[1764] | 169 | USE pmc_interface, & |
---|
| 170 | ONLY: cpl_id, nested_run |
---|
[1826] | 171 | |
---|
[1] | 172 | USE profil_parameter |
---|
[3294] | 173 | |
---|
[1236] | 174 | USE statistics |
---|
[3294] | 175 | |
---|
[411] | 176 | USE subsidence_mod |
---|
[3294] | 177 | |
---|
[1] | 178 | USE transpose_indices |
---|
[3294] | 179 | |
---|
[4444] | 180 | #if defined( __parallel ) |
---|
[2365] | 181 | USE vertical_nesting_mod, & |
---|
[3637] | 182 | ONLY: vnested, & |
---|
| 183 | vnest_check_parameters |
---|
[4444] | 184 | #endif |
---|
[1] | 185 | |
---|
[1691] | 186 | |
---|
[1] | 187 | IMPLICIT NONE |
---|
| 188 | |
---|
[3048] | 189 | CHARACTER (LEN=varnamelength) :: var !< variable name |
---|
| 190 | CHARACTER (LEN=7) :: unit !< unit of variable |
---|
| 191 | CHARACTER (LEN=8) :: date !< current date string |
---|
| 192 | CHARACTER (LEN=10) :: time !< current time string |
---|
| 193 | CHARACTER (LEN=20) :: ensemble_string !< string containing number of ensemble member |
---|
| 194 | CHARACTER (LEN=15) :: nest_string !< string containing id of nested domain |
---|
| 195 | CHARACTER (LEN=40) :: coupling_string !< string containing type of coupling |
---|
| 196 | CHARACTER (LEN=100) :: action !< flag string |
---|
[1] | 197 | |
---|
[3048] | 198 | INTEGER(iwp) :: i !< loop index |
---|
| 199 | INTEGER(iwp) :: ilen !< string length |
---|
| 200 | INTEGER(iwp) :: j !< loop index |
---|
| 201 | INTEGER(iwp) :: k !< loop index |
---|
| 202 | INTEGER(iwp) :: kk !< loop index |
---|
[4069] | 203 | INTEGER(iwp) :: mid !< masked output running index |
---|
[3048] | 204 | INTEGER(iwp) :: netcdf_data_format_save !< initial value of netcdf_data_format |
---|
| 205 | INTEGER(iwp) :: position !< index position of string |
---|
[1] | 206 | |
---|
[3048] | 207 | LOGICAL :: found !< flag, true if output variable is already marked for averaging |
---|
[1384] | 208 | |
---|
[4444] | 209 | REAL(wp) :: gradient !< local gradient |
---|
| 210 | #if defined( __parallel ) |
---|
[2934] | 211 | REAL(wp) :: dt_spinup_max !< maximum spinup timestep in nested domains |
---|
[3048] | 212 | REAL(wp) :: remote = 0.0_wp !< MPI id of remote processor |
---|
[2934] | 213 | REAL(wp) :: spinup_time_max !< maximum spinup time in nested domains |
---|
[3048] | 214 | REAL(wp) :: time_to_be_simulated_from_reference_point !< time to be simulated from reference point |
---|
[4444] | 215 | #endif |
---|
[2312] | 216 | |
---|
| 217 | |
---|
[3885] | 218 | CALL location_message( 'checking parameters', 'start' ) |
---|
[1] | 219 | ! |
---|
[2696] | 220 | !-- At first, check static and dynamic input for consistency |
---|
| 221 | CALL netcdf_data_input_check_dynamic |
---|
| 222 | CALL netcdf_data_input_check_static |
---|
| 223 | ! |
---|
[1216] | 224 | !-- Check for overlap combinations, which are not realized yet |
---|
[3312] | 225 | IF ( transpose_compute_overlap .AND. numprocs == 1 ) THEN |
---|
| 226 | message_string = 'transpose-compute-overlap not implemented for single PE runs' |
---|
| 227 | CALL message( 'check_parameters', 'PA0000', 1, 2, 0, 6, 0 ) |
---|
[1216] | 228 | ENDIF |
---|
| 229 | |
---|
| 230 | ! |
---|
[102] | 231 | !-- Check the coupling mode |
---|
[3045] | 232 | IF ( coupling_mode /= 'uncoupled' .AND. & |
---|
| 233 | coupling_mode /= 'precursor_atmos' .AND. & |
---|
| 234 | coupling_mode /= 'precursor_ocean' .AND. & |
---|
| 235 | coupling_mode /= 'vnested_crse' .AND. & |
---|
| 236 | coupling_mode /= 'vnested_fine' .AND. & |
---|
| 237 | coupling_mode /= 'atmosphere_to_ocean' .AND. & |
---|
[2312] | 238 | coupling_mode /= 'ocean_to_atmosphere' ) THEN |
---|
[213] | 239 | message_string = 'illegal coupling mode: ' // TRIM( coupling_mode ) |
---|
[226] | 240 | CALL message( 'check_parameters', 'PA0002', 1, 2, 0, 6, 0 ) |
---|
[102] | 241 | ENDIF |
---|
| 242 | |
---|
| 243 | ! |
---|
[2688] | 244 | !-- Check if humidity is set to TRUE in case of the atmospheric run (for coupled runs) |
---|
[2689] | 245 | IF ( coupling_mode == 'atmosphere_to_ocean' .AND. .NOT. humidity) THEN |
---|
[3045] | 246 | message_string = ' Humidity has to be set to .T. in the _p3d file ' // & |
---|
| 247 | 'for coupled runs between ocean and atmosphere.' |
---|
[2688] | 248 | CALL message( 'check_parameters', 'PA0476', 1, 2, 0, 6, 0 ) |
---|
| 249 | ENDIF |
---|
[4472] | 250 | |
---|
[2688] | 251 | ! |
---|
[4495] | 252 | !-- Check and set the restart data format variables |
---|
| 253 | IF ( TRIM( restart_data_format ) /= 'fortran_binary' .AND. & |
---|
| 254 | TRIM( restart_data_format ) /= 'mpi' ) THEN |
---|
| 255 | message_string = 'illegal restart data format "' // TRIM( restart_data_format ) // '"' |
---|
| 256 | CALL message( 'check_parameters', 'PA....', 1, 2, 0, 6, 0 ) |
---|
| 257 | ENDIF |
---|
| 258 | |
---|
| 259 | IF ( TRIM( restart_data_format_input ) == 'undefined' ) THEN |
---|
| 260 | restart_data_format_input = restart_data_format |
---|
| 261 | ENDIF |
---|
| 262 | IF ( TRIM( restart_data_format_output ) == 'undefined' ) THEN |
---|
| 263 | restart_data_format_output = restart_data_format |
---|
| 264 | ENDIF |
---|
| 265 | |
---|
| 266 | IF ( TRIM( restart_data_format_input ) /= 'fortran_binary' .AND. & |
---|
| 267 | TRIM( restart_data_format_input ) /= 'mpi' ) THEN |
---|
| 268 | message_string = 'illegal restart data input format "' // & |
---|
| 269 | TRIM( restart_data_format_input ) // '"' |
---|
| 270 | CALL message( 'check_parameters', 'PA....', 1, 2, 0, 6, 0 ) |
---|
| 271 | ENDIF |
---|
| 272 | IF ( TRIM( restart_data_format_output ) /= 'fortran_binary' .AND. & |
---|
| 273 | TRIM( restart_data_format_output ) /= 'mpi' ) THEN |
---|
| 274 | message_string = 'illegal restart data output format "' // & |
---|
| 275 | TRIM( restart_data_format_output ) // '"' |
---|
| 276 | CALL message( 'check_parameters', 'PA....', 1, 2, 0, 6, 0 ) |
---|
| 277 | ENDIF |
---|
| 278 | |
---|
| 279 | ! |
---|
| 280 | !-- Set flag for including total domain boundaries in the restart data (MPI-IO) in case of |
---|
| 281 | !-- non-cyclic boundary conditions |
---|
| 282 | include_total_domain_boundaries = .NOT. ( bc_lr_cyc .AND. bc_ns_cyc ) |
---|
| 283 | |
---|
| 284 | ! |
---|
[108] | 285 | !-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny |
---|
[3045] | 286 | IF ( coupling_mode /= 'uncoupled' .AND. & |
---|
| 287 | coupling_mode(1:8) /= 'vnested_' .AND. & |
---|
| 288 | coupling_mode /= 'precursor_atmos' .AND. & |
---|
| 289 | coupling_mode /= 'precursor_ocean' ) THEN |
---|
[213] | 290 | |
---|
[1322] | 291 | IF ( dt_coupling == 9999999.9_wp ) THEN |
---|
[1788] | 292 | message_string = 'dt_coupling is not set but required for coup' // & |
---|
[213] | 293 | 'ling mode "' // TRIM( coupling_mode ) // '"' |
---|
[226] | 294 | CALL message( 'check_parameters', 'PA0003', 1, 2, 0, 6, 0 ) |
---|
[108] | 295 | ENDIF |
---|
[213] | 296 | |
---|
[206] | 297 | #if defined( __parallel ) |
---|
[807] | 298 | |
---|
[2696] | 299 | |
---|
[667] | 300 | IF ( myid == 0 ) THEN |
---|
[1788] | 301 | CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, & |
---|
[667] | 302 | ierr ) |
---|
[1788] | 303 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, & |
---|
[667] | 304 | status, ierr ) |
---|
| 305 | ENDIF |
---|
| 306 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[2312] | 307 | |
---|
[108] | 308 | IF ( dt_coupling /= remote ) THEN |
---|
[213] | 309 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 310 | '": dt_coupling = ', dt_coupling, '& is not equal to ', & |
---|
| 311 | 'dt_coupling_remote = ', remote |
---|
[226] | 312 | CALL message( 'check_parameters', 'PA0004', 1, 2, 0, 6, 0 ) |
---|
[108] | 313 | ENDIF |
---|
[1353] | 314 | IF ( dt_coupling <= 0.0_wp ) THEN |
---|
[1804] | 315 | |
---|
[667] | 316 | IF ( myid == 0 ) THEN |
---|
| 317 | CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr ) |
---|
[1788] | 318 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & |
---|
[667] | 319 | status, ierr ) |
---|
[2312] | 320 | ENDIF |
---|
[667] | 321 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[2312] | 322 | |
---|
[109] | 323 | dt_coupling = MAX( dt_max, remote ) |
---|
[213] | 324 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 325 | '": dt_coupling <= 0.0 & is not allowed and is reset to ', & |
---|
| 326 | 'MAX(dt_max(A,O)) = ', dt_coupling |
---|
[226] | 327 | CALL message( 'check_parameters', 'PA0005', 0, 1, 0, 6, 0 ) |
---|
[109] | 328 | ENDIF |
---|
[1804] | 329 | |
---|
[667] | 330 | IF ( myid == 0 ) THEN |
---|
| 331 | CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, & |
---|
| 332 | ierr ) |
---|
[1788] | 333 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & |
---|
[667] | 334 | status, ierr ) |
---|
[2312] | 335 | ENDIF |
---|
[667] | 336 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[2312] | 337 | |
---|
[108] | 338 | IF ( restart_time /= remote ) THEN |
---|
[213] | 339 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 340 | '": restart_time = ', restart_time, '& is not equal to ', & |
---|
| 341 | 'restart_time_remote = ', remote |
---|
[226] | 342 | CALL message( 'check_parameters', 'PA0006', 1, 2, 0, 6, 0 ) |
---|
[108] | 343 | ENDIF |
---|
[1804] | 344 | |
---|
[667] | 345 | IF ( myid == 0 ) THEN |
---|
[1788] | 346 | CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, & |
---|
[667] | 347 | ierr ) |
---|
[1788] | 348 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & |
---|
[667] | 349 | status, ierr ) |
---|
[2312] | 350 | ENDIF |
---|
[667] | 351 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[2312] | 352 | |
---|
[108] | 353 | IF ( dt_restart /= remote ) THEN |
---|
[213] | 354 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
| 355 | '": dt_restart = ', dt_restart, '& is not equal to ', & |
---|
| 356 | 'dt_restart_remote = ', remote |
---|
[226] | 357 | CALL message( 'check_parameters', 'PA0007', 1, 2, 0, 6, 0 ) |
---|
[108] | 358 | ENDIF |
---|
[213] | 359 | |
---|
[2765] | 360 | time_to_be_simulated_from_reference_point = end_time-coupling_start_time |
---|
[1804] | 361 | |
---|
[667] | 362 | IF ( myid == 0 ) THEN |
---|
[2765] | 363 | CALL MPI_SEND( time_to_be_simulated_from_reference_point, 1, & |
---|
| 364 | MPI_REAL, target_id, 14, comm_inter, ierr ) |
---|
[1788] | 365 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & |
---|
[2312] | 366 | status, ierr ) |
---|
| 367 | ENDIF |
---|
[667] | 368 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[2312] | 369 | |
---|
[2765] | 370 | IF ( time_to_be_simulated_from_reference_point /= remote ) THEN |
---|
[213] | 371 | WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & |
---|
[2765] | 372 | '": time_to_be_simulated_from_reference_point = ', & |
---|
| 373 | time_to_be_simulated_from_reference_point, '& is not equal ', & |
---|
| 374 | 'to time_to_be_simulated_from_reference_point_remote = ', & |
---|
| 375 | remote |
---|
[226] | 376 | CALL message( 'check_parameters', 'PA0008', 1, 2, 0, 6, 0 ) |
---|
[108] | 377 | ENDIF |
---|
[213] | 378 | |
---|
[667] | 379 | IF ( myid == 0 ) THEN |
---|
| 380 | CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr ) |
---|
[1788] | 381 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, & |
---|
[667] | 382 | status, ierr ) |
---|
[108] | 383 | ENDIF |
---|
[667] | 384 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[213] | 385 | |
---|
[1804] | 386 | |
---|
[667] | 387 | IF ( coupling_mode == 'atmosphere_to_ocean') THEN |
---|
| 388 | |
---|
| 389 | IF ( dx < remote ) THEN |
---|
[1788] | 390 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 391 | TRIM( coupling_mode ), & |
---|
[2248] | 392 | '": dx in Atmosphere is not equal to or not larger than dx in ocean' |
---|
[667] | 393 | CALL message( 'check_parameters', 'PA0009', 1, 2, 0, 6, 0 ) |
---|
| 394 | ENDIF |
---|
| 395 | |
---|
| 396 | IF ( (nx_a+1)*dx /= (nx_o+1)*remote ) THEN |
---|
[1788] | 397 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 398 | TRIM( coupling_mode ), & |
---|
[667] | 399 | '": Domain size in x-direction is not equal in ocean and atmosphere' |
---|
| 400 | CALL message( 'check_parameters', 'PA0010', 1, 2, 0, 6, 0 ) |
---|
| 401 | ENDIF |
---|
| 402 | |
---|
[108] | 403 | ENDIF |
---|
[213] | 404 | |
---|
[667] | 405 | IF ( myid == 0) THEN |
---|
| 406 | CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr ) |
---|
[1788] | 407 | CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, & |
---|
[667] | 408 | status, ierr ) |
---|
[108] | 409 | ENDIF |
---|
[667] | 410 | CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) |
---|
[1804] | 411 | |
---|
[667] | 412 | IF ( coupling_mode == 'atmosphere_to_ocean') THEN |
---|
| 413 | |
---|
| 414 | IF ( dy < remote ) THEN |
---|
[1788] | 415 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 416 | TRIM( coupling_mode ), & |
---|
[2250] | 417 | '": dy in Atmosphere is not equal to or not larger than dy in ocean' |
---|
[667] | 418 | CALL message( 'check_parameters', 'PA0011', 1, 2, 0, 6, 0 ) |
---|
| 419 | ENDIF |
---|
| 420 | |
---|
| 421 | IF ( (ny_a+1)*dy /= (ny_o+1)*remote ) THEN |
---|
[1788] | 422 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 423 | TRIM( coupling_mode ), & |
---|
[667] | 424 | '": Domain size in y-direction is not equal in ocean and atmosphere' |
---|
| 425 | CALL message( 'check_parameters', 'PA0012', 1, 2, 0, 6, 0 ) |
---|
| 426 | ENDIF |
---|
| 427 | |
---|
| 428 | IF ( MOD(nx_o+1,nx_a+1) /= 0 ) THEN |
---|
[1788] | 429 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 430 | TRIM( coupling_mode ), & |
---|
[3045] | 431 | '": nx+1 in ocean is not divisible by nx+1 in', & |
---|
[2271] | 432 | ' atmosphere without remainder' |
---|
[667] | 433 | CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 ) |
---|
| 434 | ENDIF |
---|
| 435 | |
---|
| 436 | IF ( MOD(ny_o+1,ny_a+1) /= 0 ) THEN |
---|
[1788] | 437 | WRITE( message_string, * ) 'coupling mode "', & |
---|
| 438 | TRIM( coupling_mode ), & |
---|
[2312] | 439 | '": ny+1 in ocean is not divisible by ny+1 in', & |
---|
[2271] | 440 | ' atmosphere without remainder' |
---|
| 441 | |
---|
[667] | 442 | CALL message( 'check_parameters', 'PA0340', 1, 2, 0, 6, 0 ) |
---|
| 443 | ENDIF |
---|
| 444 | |
---|
[108] | 445 | ENDIF |
---|
[222] | 446 | #else |
---|
[2422] | 447 | WRITE( message_string, * ) 'coupling requires PALM to be compiled with',& |
---|
| 448 | ' cpp-option "-D__parallel"' |
---|
[226] | 449 | CALL message( 'check_parameters', 'PA0141', 1, 2, 0, 6, 0 ) |
---|
[108] | 450 | #endif |
---|
| 451 | ENDIF |
---|
| 452 | |
---|
[1804] | 453 | #if defined( __parallel ) |
---|
[108] | 454 | ! |
---|
| 455 | !-- Exchange via intercommunicator |
---|
[667] | 456 | IF ( coupling_mode == 'atmosphere_to_ocean' .AND. myid == 0 ) THEN |
---|
[1788] | 457 | CALL MPI_SEND( humidity, 1, MPI_LOGICAL, target_id, 19, comm_inter, & |
---|
[206] | 458 | ierr ) |
---|
[667] | 459 | ELSEIF ( coupling_mode == 'ocean_to_atmosphere' .AND. myid == 0) THEN |
---|
[1788] | 460 | CALL MPI_RECV( humidity_remote, 1, MPI_LOGICAL, target_id, 19, & |
---|
[206] | 461 | comm_inter, status, ierr ) |
---|
[108] | 462 | ENDIF |
---|
[667] | 463 | CALL MPI_BCAST( humidity_remote, 1, MPI_LOGICAL, 0, comm2d, ierr) |
---|
[2312] | 464 | |
---|
[108] | 465 | #endif |
---|
| 466 | |
---|
[2422] | 467 | ! |
---|
| 468 | !-- User settings for restart times requires that "restart" has been given as |
---|
| 469 | !-- file activation string. Otherwise, binary output would not be saved by |
---|
| 470 | !-- palmrun. |
---|
| 471 | IF ( ( restart_time /= 9999999.9_wp .OR. dt_restart /= 9999999.9_wp ) & |
---|
| 472 | .AND. .NOT. write_binary ) THEN |
---|
| 473 | WRITE( message_string, * ) 'manual restart settings requires file ', & |
---|
| 474 | 'activation string "restart"' |
---|
| 475 | CALL message( 'check_parameters', 'PA0001', 1, 2, 0, 6, 0 ) |
---|
| 476 | ENDIF |
---|
[108] | 477 | |
---|
[2696] | 478 | |
---|
[108] | 479 | ! |
---|
[1] | 480 | !-- Generate the file header which is used as a header for most of PALM's |
---|
| 481 | !-- output files |
---|
[3529] | 482 | CALL DATE_AND_TIME( date, time, run_zone ) |
---|
| 483 | run_date = date(1:4)//'-'//date(5:6)//'-'//date(7:8) |
---|
[1] | 484 | run_time = time(1:2)//':'//time(3:4)//':'//time(5:6) |
---|
[102] | 485 | IF ( coupling_mode == 'uncoupled' ) THEN |
---|
| 486 | coupling_string = '' |
---|
[2365] | 487 | ELSEIF ( coupling_mode == 'vnested_crse' ) THEN |
---|
| 488 | coupling_string = ' nested (coarse)' |
---|
| 489 | ELSEIF ( coupling_mode == 'vnested_fine' ) THEN |
---|
| 490 | coupling_string = ' nested (fine)' |
---|
[102] | 491 | ELSEIF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
| 492 | coupling_string = ' coupled (atmosphere)' |
---|
| 493 | ELSEIF ( coupling_mode == 'ocean_to_atmosphere' ) THEN |
---|
| 494 | coupling_string = ' coupled (ocean)' |
---|
[1764] | 495 | ENDIF |
---|
[1429] | 496 | IF ( ensemble_member_nr /= 0 ) THEN |
---|
[1764] | 497 | WRITE( ensemble_string, '(2X,A,I2.2)' ) 'en-no: ', ensemble_member_nr |
---|
[1429] | 498 | ELSE |
---|
[1764] | 499 | ensemble_string = '' |
---|
[1429] | 500 | ENDIF |
---|
[1764] | 501 | IF ( nested_run ) THEN |
---|
| 502 | WRITE( nest_string, '(2X,A,I2.2)' ) 'nest-id: ', cpl_id |
---|
| 503 | ELSE |
---|
| 504 | nest_string = '' |
---|
| 505 | ENDIF |
---|
| 506 | |
---|
| 507 | WRITE ( run_description_header, & |
---|
| 508 | '(A,2X,A,2X,A,A,A,I2.2,A,A,A,2X,A,A,2X,A,1X,A)' ) & |
---|
| 509 | TRIM( version ), TRIM( revision ), 'run: ', & |
---|
| 510 | TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ), & |
---|
| 511 | TRIM( nest_string ), TRIM( ensemble_string), 'host: ', TRIM( host ), & |
---|
| 512 | run_date, run_time |
---|
| 513 | |
---|
[1] | 514 | ! |
---|
[63] | 515 | !-- Check the general loop optimization method |
---|
[1015] | 516 | SELECT CASE ( TRIM( loop_optimization ) ) |
---|
| 517 | |
---|
[2118] | 518 | CASE ( 'cache', 'vector' ) |
---|
[1015] | 519 | CONTINUE |
---|
| 520 | |
---|
| 521 | CASE DEFAULT |
---|
[1788] | 522 | message_string = 'illegal value given for loop_optimization: "' // & |
---|
[1015] | 523 | TRIM( loop_optimization ) // '"' |
---|
| 524 | CALL message( 'check_parameters', 'PA0013', 1, 2, 0, 6, 0 ) |
---|
| 525 | |
---|
| 526 | END SELECT |
---|
| 527 | |
---|
[63] | 528 | ! |
---|
[1] | 529 | !-- Check topography setting (check for illegal parameter combinations) |
---|
| 530 | IF ( topography /= 'flat' ) THEN |
---|
| 531 | action = ' ' |
---|
[1788] | 532 | IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' & |
---|
[2200] | 533 | ) THEN |
---|
[1] | 534 | WRITE( action, '(A,A)' ) 'scalar_advec = ', scalar_advec |
---|
| 535 | ENDIF |
---|
[1788] | 536 | IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' )& |
---|
[861] | 537 | THEN |
---|
[1] | 538 | WRITE( action, '(A,A)' ) 'momentum_advec = ', momentum_advec |
---|
| 539 | ENDIF |
---|
[114] | 540 | IF ( psolver == 'sor' ) THEN |
---|
[1] | 541 | WRITE( action, '(A,A)' ) 'psolver = ', psolver |
---|
| 542 | ENDIF |
---|
| 543 | IF ( sloping_surface ) THEN |
---|
| 544 | WRITE( action, '(A)' ) 'sloping surface = .TRUE.' |
---|
| 545 | ENDIF |
---|
| 546 | IF ( galilei_transformation ) THEN |
---|
| 547 | WRITE( action, '(A)' ) 'galilei_transformation = .TRUE.' |
---|
| 548 | ENDIF |
---|
| 549 | IF ( cloud_droplets ) THEN |
---|
[1115] | 550 | WRITE( action, '(A)' ) 'cloud_droplets = .TRUE.' |
---|
[1] | 551 | ENDIF |
---|
[4340] | 552 | IF ( .NOT. constant_flux_layer .AND. topography /= 'closed_channel' ) & |
---|
| 553 | THEN |
---|
[1691] | 554 | WRITE( action, '(A)' ) 'constant_flux_layer = .FALSE.' |
---|
[1] | 555 | ENDIF |
---|
| 556 | IF ( action /= ' ' ) THEN |
---|
[4340] | 557 | message_string = 'The specified topography does not allow ' // & |
---|
[213] | 558 | TRIM( action ) |
---|
[226] | 559 | CALL message( 'check_parameters', 'PA0014', 1, 2, 0, 6, 0 ) |
---|
[1] | 560 | ENDIF |
---|
[4340] | 561 | ! |
---|
| 562 | !-- Check illegal/untested parameter combinations for closed channel |
---|
[4472] | 563 | If ( topography == 'closed_channel' ) THEN |
---|
[4340] | 564 | symmetry_flag = 1 |
---|
| 565 | message_string = 'Bottom and top boundary are treated equal' |
---|
[4383] | 566 | CALL message( 'check_parameters', 'PA0699', 0, 0, 0, 6, 0 ) |
---|
[4472] | 567 | |
---|
[4340] | 568 | IF ( dz(1) /= dz(COUNT( dz /= -1.0_wp )) .OR. & |
---|
| 569 | dz_stretch_level /= -9999999.9_wp) THEN |
---|
| 570 | WRITE( message_string, * ) 'dz should be equal close to the ' // & |
---|
| 571 | 'boundaries due to symmetrical problem' |
---|
[4383] | 572 | CALL message( 'check_parameters', 'PA0700', 1, 2, 0, 6, 0 ) |
---|
[4340] | 573 | ENDIF |
---|
[4472] | 574 | |
---|
[4340] | 575 | IF ( constant_flux_layer ) THEN |
---|
| 576 | WRITE( message_string, * ) 'A constant flux layer is not '// & |
---|
| 577 | 'allowed if a closed channel '// & |
---|
| 578 | 'shall be used' |
---|
[4383] | 579 | CALL message( 'check_parameters', 'PA0701', 1, 2, 0, 6, 0 ) |
---|
[4340] | 580 | ENDIF |
---|
[4472] | 581 | |
---|
[4340] | 582 | IF ( ocean_mode ) THEN |
---|
| 583 | WRITE( message_string, * ) 'The ocean mode is not allowed if '// & |
---|
| 584 | 'a closed channel shall be used' |
---|
[4383] | 585 | CALL message( 'check_parameters', 'PA0702', 1, 2, 0, 6, 0 ) |
---|
[4340] | 586 | ENDIF |
---|
[4472] | 587 | |
---|
[4340] | 588 | IF ( momentum_advec /= 'ws-scheme' .OR. & |
---|
| 589 | scalar_advec /= 'ws-scheme' ) THEN |
---|
| 590 | WRITE( message_string, * ) 'A closed channel require the '// & |
---|
| 591 | 'upwind scheme of Wicker and ' // & |
---|
| 592 | 'Skamarock as the advection scheme' |
---|
[4383] | 593 | CALL message( 'check_parameters', 'PA0703', 1, 2, 0, 6, 0 ) |
---|
[4340] | 594 | ENDIF |
---|
| 595 | ENDIF |
---|
[1] | 596 | ENDIF |
---|
[94] | 597 | |
---|
[1] | 598 | ! |
---|
[2037] | 599 | !-- Check approximation |
---|
[3045] | 600 | IF ( TRIM( approximation ) /= 'boussinesq' .AND. & |
---|
[2037] | 601 | TRIM( approximation ) /= 'anelastic' ) THEN |
---|
[3045] | 602 | message_string = 'unknown approximation: approximation = "' // & |
---|
[2037] | 603 | TRIM( approximation ) // '"' |
---|
[2044] | 604 | CALL message( 'check_parameters', 'PA0446', 1, 2, 0, 6, 0 ) |
---|
[2037] | 605 | ENDIF |
---|
| 606 | |
---|
| 607 | ! |
---|
| 608 | !-- Check approximation requirements |
---|
[3045] | 609 | IF ( TRIM( approximation ) == 'anelastic' .AND. & |
---|
[2037] | 610 | TRIM( momentum_advec ) /= 'ws-scheme' ) THEN |
---|
[3045] | 611 | message_string = 'Anelastic approximation requires ' // & |
---|
[2037] | 612 | 'momentum_advec = "ws-scheme"' |
---|
[2044] | 613 | CALL message( 'check_parameters', 'PA0447', 1, 2, 0, 6, 0 ) |
---|
[2037] | 614 | ENDIF |
---|
[3045] | 615 | IF ( TRIM( approximation ) == 'anelastic' .AND. & |
---|
[2232] | 616 | TRIM( psolver ) == 'multigrid' ) THEN |
---|
[3045] | 617 | message_string = 'Anelastic approximation currently only supports ' // & |
---|
| 618 | 'psolver = "poisfft", ' // & |
---|
| 619 | 'psolver = "sor" and ' // & |
---|
[2232] | 620 | 'psolver = "multigrid_noopt"' |
---|
| 621 | CALL message( 'check_parameters', 'PA0448', 1, 2, 0, 6, 0 ) |
---|
| 622 | ENDIF |
---|
[3045] | 623 | IF ( TRIM( approximation ) == 'anelastic' .AND. & |
---|
[2037] | 624 | conserve_volume_flow ) THEN |
---|
[3045] | 625 | message_string = 'Anelastic approximation is not allowed with ' // & |
---|
[2037] | 626 | 'conserve_volume_flow = .TRUE.' |
---|
[2044] | 627 | CALL message( 'check_parameters', 'PA0449', 1, 2, 0, 6, 0 ) |
---|
[2037] | 628 | ENDIF |
---|
| 629 | |
---|
| 630 | ! |
---|
| 631 | !-- Check flux input mode |
---|
[3045] | 632 | IF ( TRIM( flux_input_mode ) /= 'dynamic' .AND. & |
---|
| 633 | TRIM( flux_input_mode ) /= 'kinematic' .AND. & |
---|
[2037] | 634 | TRIM( flux_input_mode ) /= 'approximation-specific' ) THEN |
---|
| 635 | message_string = 'unknown flux input mode: flux_input_mode = "' // & |
---|
| 636 | TRIM( flux_input_mode ) // '"' |
---|
[2044] | 637 | CALL message( 'check_parameters', 'PA0450', 1, 2, 0, 6, 0 ) |
---|
[2037] | 638 | ENDIF |
---|
[3294] | 639 | ! |
---|
[2037] | 640 | !-- Set flux input mode according to approximation if applicable |
---|
| 641 | IF ( TRIM( flux_input_mode ) == 'approximation-specific' ) THEN |
---|
| 642 | IF ( TRIM( approximation ) == 'anelastic' ) THEN |
---|
| 643 | flux_input_mode = 'dynamic' |
---|
| 644 | ELSEIF ( TRIM( approximation ) == 'boussinesq' ) THEN |
---|
| 645 | flux_input_mode = 'kinematic' |
---|
| 646 | ENDIF |
---|
| 647 | ENDIF |
---|
| 648 | |
---|
| 649 | ! |
---|
| 650 | !-- Check flux output mode |
---|
[3045] | 651 | IF ( TRIM( flux_output_mode ) /= 'dynamic' .AND. & |
---|
| 652 | TRIM( flux_output_mode ) /= 'kinematic' .AND. & |
---|
[2037] | 653 | TRIM( flux_output_mode ) /= 'approximation-specific' ) THEN |
---|
| 654 | message_string = 'unknown flux output mode: flux_output_mode = "' // & |
---|
| 655 | TRIM( flux_output_mode ) // '"' |
---|
[2044] | 656 | CALL message( 'check_parameters', 'PA0451', 1, 2, 0, 6, 0 ) |
---|
[2037] | 657 | ENDIF |
---|
[3294] | 658 | ! |
---|
[2037] | 659 | !-- Set flux output mode according to approximation if applicable |
---|
| 660 | IF ( TRIM( flux_output_mode ) == 'approximation-specific' ) THEN |
---|
| 661 | IF ( TRIM( approximation ) == 'anelastic' ) THEN |
---|
| 662 | flux_output_mode = 'dynamic' |
---|
| 663 | ELSEIF ( TRIM( approximation ) == 'boussinesq' ) THEN |
---|
| 664 | flux_output_mode = 'kinematic' |
---|
| 665 | ENDIF |
---|
| 666 | ENDIF |
---|
| 667 | |
---|
[2270] | 668 | |
---|
[2037] | 669 | ! |
---|
[4472] | 670 | !-- When the land- or urban-surface model is used, the flux output must be |
---|
[2743] | 671 | !-- dynamic. |
---|
| 672 | IF ( land_surface .OR. urban_surface ) THEN |
---|
[2270] | 673 | flux_output_mode = 'dynamic' |
---|
| 674 | ENDIF |
---|
[2312] | 675 | |
---|
[2270] | 676 | ! |
---|
[3294] | 677 | !-- Set the flux output units according to flux_output_mode |
---|
[2037] | 678 | IF ( TRIM( flux_output_mode ) == 'kinematic' ) THEN |
---|
| 679 | heatflux_output_unit = 'K m/s' |
---|
| 680 | waterflux_output_unit = 'kg/kg m/s' |
---|
| 681 | momentumflux_output_unit = 'm2/s2' |
---|
| 682 | ELSEIF ( TRIM( flux_output_mode ) == 'dynamic' ) THEN |
---|
| 683 | heatflux_output_unit = 'W/m2' |
---|
| 684 | waterflux_output_unit = 'W/m2' |
---|
| 685 | momentumflux_output_unit = 'N/m2' |
---|
| 686 | ENDIF |
---|
| 687 | |
---|
[3294] | 688 | ! |
---|
[2037] | 689 | !-- set time series output units for fluxes |
---|
[3766] | 690 | dots_unit(14:16) = TRIM( heatflux_output_unit ) |
---|
| 691 | dots_unit(21) = TRIM( waterflux_output_unit ) |
---|
| 692 | dots_unit(19:20) = TRIM( momentumflux_output_unit ) |
---|
[2037] | 693 | |
---|
| 694 | ! |
---|
[3700] | 695 | !-- Add other module specific timeseries |
---|
| 696 | CALL module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit ) |
---|
| 697 | |
---|
| 698 | ! |
---|
| 699 | !-- Check if maximum number of allowed timeseries is exceeded |
---|
| 700 | IF ( dots_num > dots_max ) THEN |
---|
| 701 | WRITE( message_string, * ) 'number of time series quantities exceeds', & |
---|
| 702 | ' its maximum of dots_max = ', dots_max, & |
---|
| 703 | '&Please increase dots_max in modules.f90.' |
---|
[4472] | 704 | CALL message( 'init_3d_model', 'PA0194', 1, 2, 0, 6, 0 ) |
---|
[3700] | 705 | ENDIF |
---|
| 706 | |
---|
| 707 | ! |
---|
[1] | 708 | !-- Check whether there are any illegal values |
---|
| 709 | !-- Pressure solver: |
---|
[1575] | 710 | IF ( psolver /= 'poisfft' .AND. psolver /= 'sor' .AND. & |
---|
[1931] | 711 | psolver /= 'multigrid' .AND. psolver /= 'multigrid_noopt' ) THEN |
---|
[213] | 712 | message_string = 'unknown solver for perturbation pressure: psolver' // & |
---|
| 713 | ' = "' // TRIM( psolver ) // '"' |
---|
[226] | 714 | CALL message( 'check_parameters', 'PA0016', 1, 2, 0, 6, 0 ) |
---|
[1] | 715 | ENDIF |
---|
| 716 | |
---|
[1575] | 717 | IF ( psolver(1:9) == 'multigrid' ) THEN |
---|
[1] | 718 | IF ( cycle_mg == 'w' ) THEN |
---|
| 719 | gamma_mg = 2 |
---|
| 720 | ELSEIF ( cycle_mg == 'v' ) THEN |
---|
| 721 | gamma_mg = 1 |
---|
| 722 | ELSE |
---|
[1788] | 723 | message_string = 'unknown multigrid cycle: cycle_mg = "' // & |
---|
[213] | 724 | TRIM( cycle_mg ) // '"' |
---|
[226] | 725 | CALL message( 'check_parameters', 'PA0020', 1, 2, 0, 6, 0 ) |
---|
[1] | 726 | ENDIF |
---|
| 727 | ENDIF |
---|
| 728 | |
---|
[1788] | 729 | IF ( fft_method /= 'singleton-algorithm' .AND. & |
---|
| 730 | fft_method /= 'temperton-algorithm' .AND. & |
---|
| 731 | fft_method /= 'fftw' .AND. & |
---|
[1] | 732 | fft_method /= 'system-specific' ) THEN |
---|
[1788] | 733 | message_string = 'unknown fft-algorithm: fft_method = "' // & |
---|
[213] | 734 | TRIM( fft_method ) // '"' |
---|
[226] | 735 | CALL message( 'check_parameters', 'PA0021', 1, 2, 0, 6, 0 ) |
---|
[1] | 736 | ENDIF |
---|
[2312] | 737 | |
---|
| 738 | IF( momentum_advec == 'ws-scheme' .AND. & |
---|
[688] | 739 | .NOT. call_psolver_at_all_substeps ) THEN |
---|
[1788] | 740 | message_string = 'psolver must be called at each RK3 substep when "'// & |
---|
[667] | 741 | TRIM(momentum_advec) // ' "is used for momentum_advec' |
---|
[685] | 742 | CALL message( 'check_parameters', 'PA0344', 1, 2, 0, 6, 0 ) |
---|
[667] | 743 | END IF |
---|
[1] | 744 | ! |
---|
| 745 | !-- Advection schemes: |
---|
[4472] | 746 | IF ( momentum_advec /= 'pw-scheme' .AND. & |
---|
[3045] | 747 | momentum_advec /= 'ws-scheme' .AND. & |
---|
| 748 | momentum_advec /= 'up-scheme' ) & |
---|
[1001] | 749 | THEN |
---|
[1788] | 750 | message_string = 'unknown advection scheme: momentum_advec = "' // & |
---|
[214] | 751 | TRIM( momentum_advec ) // '"' |
---|
[226] | 752 | CALL message( 'check_parameters', 'PA0022', 1, 2, 0, 6, 0 ) |
---|
[1] | 753 | ENDIF |
---|
[2200] | 754 | IF ( ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & |
---|
[1001] | 755 | .AND. ( timestep_scheme == 'euler' .OR. & |
---|
| 756 | timestep_scheme == 'runge-kutta-2' ) ) & |
---|
| 757 | THEN |
---|
[1788] | 758 | message_string = 'momentum_advec or scalar_advec = "' & |
---|
[3045] | 759 | // TRIM( momentum_advec ) // '" is not allowed with ' // & |
---|
| 760 | 'timestep_scheme = "' // TRIM( timestep_scheme ) // '"' |
---|
[226] | 761 | CALL message( 'check_parameters', 'PA0023', 1, 2, 0, 6, 0 ) |
---|
[1] | 762 | ENDIF |
---|
[667] | 763 | IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' .AND. & |
---|
[3045] | 764 | scalar_advec /= 'bc-scheme' .AND. scalar_advec /= 'up-scheme' ) & |
---|
[1001] | 765 | THEN |
---|
[1788] | 766 | message_string = 'unknown advection scheme: scalar_advec = "' // & |
---|
[214] | 767 | TRIM( scalar_advec ) // '"' |
---|
[226] | 768 | CALL message( 'check_parameters', 'PA0024', 1, 2, 0, 6, 0 ) |
---|
[1] | 769 | ENDIF |
---|
[1353] | 770 | IF ( scalar_advec == 'bc-scheme' .AND. loop_optimization == 'cache' ) & |
---|
[1019] | 771 | THEN |
---|
[1788] | 772 | message_string = 'advection_scheme scalar_advec = "' & |
---|
[3045] | 773 | // TRIM( scalar_advec ) // '" not implemented for ' // & |
---|
| 774 | 'loop_optimization = "' // TRIM( loop_optimization ) // '"' |
---|
[1019] | 775 | CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 ) |
---|
| 776 | ENDIF |
---|
[1] | 777 | |
---|
[2200] | 778 | IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets .AND. & |
---|
| 779 | .NOT. use_upstream_for_tke .AND. & |
---|
| 780 | scalar_advec /= 'ws-scheme' & |
---|
[1557] | 781 | ) THEN |
---|
[1] | 782 | use_upstream_for_tke = .TRUE. |
---|
[2274] | 783 | message_string = 'use_upstream_for_tke is set to .TRUE. because ' // & |
---|
[1353] | 784 | 'use_sgs_for_particles = .TRUE. ' // & |
---|
[1330] | 785 | 'and scalar_advec /= ws-scheme' |
---|
[226] | 786 | CALL message( 'check_parameters', 'PA0025', 0, 1, 0, 6, 0 ) |
---|
[1] | 787 | ENDIF |
---|
| 788 | |
---|
| 789 | ! |
---|
[1019] | 790 | !-- Set LOGICAL switches to enhance performance |
---|
[2200] | 791 | IF ( momentum_advec == 'ws-scheme' ) ws_scheme_mom = .TRUE. |
---|
| 792 | IF ( scalar_advec == 'ws-scheme' ) ws_scheme_sca = .TRUE. |
---|
[1019] | 793 | |
---|
[1557] | 794 | |
---|
[1019] | 795 | ! |
---|
[1] | 796 | !-- Timestep schemes: |
---|
| 797 | SELECT CASE ( TRIM( timestep_scheme ) ) |
---|
| 798 | |
---|
| 799 | CASE ( 'euler' ) |
---|
| 800 | intermediate_timestep_count_max = 1 |
---|
| 801 | |
---|
| 802 | CASE ( 'runge-kutta-2' ) |
---|
| 803 | intermediate_timestep_count_max = 2 |
---|
| 804 | |
---|
| 805 | CASE ( 'runge-kutta-3' ) |
---|
| 806 | intermediate_timestep_count_max = 3 |
---|
| 807 | |
---|
| 808 | CASE DEFAULT |
---|
[1353] | 809 | message_string = 'unknown timestep scheme: timestep_scheme = "' // & |
---|
[214] | 810 | TRIM( timestep_scheme ) // '"' |
---|
[226] | 811 | CALL message( 'check_parameters', 'PA0027', 1, 2, 0, 6, 0 ) |
---|
[1] | 812 | |
---|
| 813 | END SELECT |
---|
| 814 | |
---|
[1353] | 815 | IF ( (momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme') & |
---|
[667] | 816 | .AND. timestep_scheme(1:5) == 'runge' ) THEN |
---|
[214] | 817 | message_string = 'momentum advection scheme "' // & |
---|
| 818 | TRIM( momentum_advec ) // '" & does not work with ' // & |
---|
| 819 | 'timestep_scheme "' // TRIM( timestep_scheme ) // '"' |
---|
[226] | 820 | CALL message( 'check_parameters', 'PA0029', 1, 2, 0, 6, 0 ) |
---|
[1] | 821 | ENDIF |
---|
[1994] | 822 | ! |
---|
[2312] | 823 | !-- Check for proper settings for microphysics |
---|
[3274] | 824 | IF ( bulk_cloud_model .AND. cloud_droplets ) THEN |
---|
| 825 | message_string = 'bulk_cloud_model = .TRUE. is not allowed with ' // & |
---|
[1994] | 826 | 'cloud_droplets = .TRUE.' |
---|
| 827 | CALL message( 'check_parameters', 'PA0442', 1, 2, 0, 6, 0 ) |
---|
| 828 | ENDIF |
---|
[1] | 829 | |
---|
[825] | 830 | ! |
---|
[3034] | 831 | !-- Initializing actions must have been set by the user |
---|
| 832 | IF ( TRIM( initializing_actions ) == '' ) THEN |
---|
| 833 | message_string = 'no value specified for initializing_actions' |
---|
[3045] | 834 | CALL message( 'check_parameters', 'PA0149', 1, 2, 0, 6, 0 ) |
---|
[3034] | 835 | ENDIF |
---|
| 836 | |
---|
[1788] | 837 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & |
---|
[328] | 838 | TRIM( initializing_actions ) /= 'cyclic_fill' ) THEN |
---|
[1] | 839 | ! |
---|
[214] | 840 | !-- No restart run: several initialising actions are possible |
---|
[1] | 841 | action = initializing_actions |
---|
[1788] | 842 | DO WHILE ( TRIM( action ) /= '' ) |
---|
[1] | 843 | position = INDEX( action, ' ' ) |
---|
| 844 | SELECT CASE ( action(1:position-1) ) |
---|
| 845 | |
---|
[1788] | 846 | CASE ( 'set_constant_profiles', 'set_1d-model_profiles', & |
---|
[2696] | 847 | 'by_user', 'initialize_vortex', 'initialize_ptanom', & |
---|
[3035] | 848 | 'initialize_bubble', 'inifor' ) |
---|
[1] | 849 | action = action(position+1:) |
---|
| 850 | |
---|
| 851 | CASE DEFAULT |
---|
[3045] | 852 | message_string = 'initializing_action = "' // & |
---|
[3034] | 853 | TRIM( action ) // '" unknown or not allowed' |
---|
[226] | 854 | CALL message( 'check_parameters', 'PA0030', 1, 2, 0, 6, 0 ) |
---|
[1] | 855 | |
---|
| 856 | END SELECT |
---|
| 857 | ENDDO |
---|
| 858 | ENDIF |
---|
[214] | 859 | |
---|
[1788] | 860 | IF ( TRIM( initializing_actions ) == 'initialize_vortex' .AND. & |
---|
[680] | 861 | conserve_volume_flow ) THEN |
---|
[1788] | 862 | message_string = 'initializing_actions = "initialize_vortex"' // & |
---|
[2271] | 863 | ' is not allowed with conserve_volume_flow = .T.' |
---|
[680] | 864 | CALL message( 'check_parameters', 'PA0343', 1, 2, 0, 6, 0 ) |
---|
[2312] | 865 | ENDIF |
---|
[680] | 866 | |
---|
| 867 | |
---|
[1788] | 868 | IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & |
---|
[1] | 869 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
[1788] | 870 | message_string = 'initializing_actions = "set_constant_profiles"' // & |
---|
| 871 | ' and "set_1d-model_profiles" are not allowed ' // & |
---|
[214] | 872 | 'simultaneously' |
---|
[226] | 873 | CALL message( 'check_parameters', 'PA0031', 1, 2, 0, 6, 0 ) |
---|
[1] | 874 | ENDIF |
---|
[214] | 875 | |
---|
[1788] | 876 | IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & |
---|
[46] | 877 | INDEX( initializing_actions, 'by_user' ) /= 0 ) THEN |
---|
[1788] | 878 | message_string = 'initializing_actions = "set_constant_profiles"' // & |
---|
[214] | 879 | ' and "by_user" are not allowed simultaneously' |
---|
[226] | 880 | CALL message( 'check_parameters', 'PA0032', 1, 2, 0, 6, 0 ) |
---|
[46] | 881 | ENDIF |
---|
[214] | 882 | |
---|
[1788] | 883 | IF ( INDEX( initializing_actions, 'by_user' ) /= 0 .AND. & |
---|
[46] | 884 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
[1788] | 885 | message_string = 'initializing_actions = "by_user" and ' // & |
---|
[214] | 886 | '"set_1d-model_profiles" are not allowed simultaneously' |
---|
[226] | 887 | CALL message( 'check_parameters', 'PA0033', 1, 2, 0, 6, 0 ) |
---|
[46] | 888 | ENDIF |
---|
[2773] | 889 | ! |
---|
[4472] | 890 | !-- In case of spinup and nested run, spinup end time must be identical |
---|
| 891 | !-- in order to have synchronously running simulations. |
---|
[2980] | 892 | IF ( nested_run ) THEN |
---|
[2934] | 893 | #if defined( __parallel ) |
---|
| 894 | CALL MPI_ALLREDUCE( spinup_time, spinup_time_max, 1, MPI_REAL, & |
---|
| 895 | MPI_MAX, MPI_COMM_WORLD, ierr ) |
---|
| 896 | CALL MPI_ALLREDUCE( dt_spinup, dt_spinup_max, 1, MPI_REAL, & |
---|
| 897 | MPI_MAX, MPI_COMM_WORLD, ierr ) |
---|
[3182] | 898 | |
---|
[2934] | 899 | IF ( spinup_time /= spinup_time_max .OR. dt_spinup /= dt_spinup_max ) & |
---|
| 900 | THEN |
---|
| 901 | message_string = 'In case of nesting, spinup_time and ' // & |
---|
| 902 | 'dt_spinup must be identical in all parent ' // & |
---|
| 903 | 'and child domains.' |
---|
| 904 | CALL message( 'check_parameters', 'PA0489', 3, 2, 0, 6, 0 ) |
---|
| 905 | ENDIF |
---|
| 906 | #endif |
---|
| 907 | ENDIF |
---|
| 908 | |
---|
[3274] | 909 | IF ( bulk_cloud_model .AND. .NOT. humidity ) THEN |
---|
| 910 | WRITE( message_string, * ) 'bulk_cloud_model = ', bulk_cloud_model, & |
---|
| 911 | ' is not allowed with humidity = ', humidity |
---|
[226] | 912 | CALL message( 'check_parameters', 'PA0034', 1, 2, 0, 6, 0 ) |
---|
[1] | 913 | ENDIF |
---|
| 914 | |
---|
[75] | 915 | IF ( humidity .AND. sloping_surface ) THEN |
---|
[1788] | 916 | message_string = 'humidity = .TRUE. and sloping_surface = .TRUE. ' // & |
---|
[214] | 917 | 'are not allowed simultaneously' |
---|
[226] | 918 | CALL message( 'check_parameters', 'PA0036', 1, 2, 0, 6, 0 ) |
---|
[1] | 919 | ENDIF |
---|
| 920 | |
---|
[3637] | 921 | !-- Check the module settings |
---|
| 922 | CALL module_interface_check_parameters |
---|
[1496] | 923 | |
---|
[1] | 924 | ! |
---|
[3294] | 925 | !-- In case of no restart run, check initialising parameters and calculate |
---|
| 926 | !-- further quantities |
---|
[1] | 927 | IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN |
---|
| 928 | |
---|
| 929 | ! |
---|
[767] | 930 | !-- Initial profiles for 1D and 3D model, respectively (u,v further below) |
---|
[1] | 931 | pt_init = pt_surface |
---|
[1960] | 932 | IF ( humidity ) q_init = q_surface |
---|
| 933 | IF ( passive_scalar ) s_init = s_surface |
---|
[3637] | 934 | |
---|
[1] | 935 | !-- |
---|
| 936 | !-- If required, compute initial profile of the geostrophic wind |
---|
| 937 | !-- (component ug) |
---|
| 938 | i = 1 |
---|
[1353] | 939 | gradient = 0.0_wp |
---|
[97] | 940 | |
---|
[3294] | 941 | IF ( .NOT. ocean_mode ) THEN |
---|
[97] | 942 | |
---|
| 943 | ug_vertical_gradient_level_ind(1) = 0 |
---|
| 944 | ug(0) = ug_surface |
---|
| 945 | DO k = 1, nzt+1 |
---|
[1788] | 946 | IF ( i < 11 ) THEN |
---|
| 947 | IF ( ug_vertical_gradient_level(i) < zu(k) .AND. & |
---|
[1353] | 948 | ug_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
| 949 | gradient = ug_vertical_gradient(i) / 100.0_wp |
---|
[177] | 950 | ug_vertical_gradient_level_ind(i) = k - 1 |
---|
| 951 | i = i + 1 |
---|
[1] | 952 | ENDIF |
---|
[2312] | 953 | ENDIF |
---|
[1353] | 954 | IF ( gradient /= 0.0_wp ) THEN |
---|
[97] | 955 | IF ( k /= 1 ) THEN |
---|
| 956 | ug(k) = ug(k-1) + dzu(k) * gradient |
---|
| 957 | ELSE |
---|
[1174] | 958 | ug(k) = ug_surface + dzu(k) * gradient |
---|
[97] | 959 | ENDIF |
---|
[1] | 960 | ELSE |
---|
[97] | 961 | ug(k) = ug(k-1) |
---|
[1] | 962 | ENDIF |
---|
[97] | 963 | ENDDO |
---|
[1] | 964 | |
---|
[97] | 965 | ELSE |
---|
| 966 | |
---|
| 967 | ug_vertical_gradient_level_ind(1) = nzt+1 |
---|
[121] | 968 | ug(nzt+1) = ug_surface |
---|
[667] | 969 | DO k = nzt, nzb, -1 |
---|
[1788] | 970 | IF ( i < 11 ) THEN |
---|
| 971 | IF ( ug_vertical_gradient_level(i) > zu(k) .AND. & |
---|
[1353] | 972 | ug_vertical_gradient_level(i) <= 0.0_wp ) THEN |
---|
| 973 | gradient = ug_vertical_gradient(i) / 100.0_wp |
---|
[177] | 974 | ug_vertical_gradient_level_ind(i) = k + 1 |
---|
| 975 | i = i + 1 |
---|
[97] | 976 | ENDIF |
---|
| 977 | ENDIF |
---|
[1353] | 978 | IF ( gradient /= 0.0_wp ) THEN |
---|
[97] | 979 | IF ( k /= nzt ) THEN |
---|
| 980 | ug(k) = ug(k+1) - dzu(k+1) * gradient |
---|
| 981 | ELSE |
---|
[1353] | 982 | ug(k) = ug_surface - 0.5_wp * dzu(k+1) * gradient |
---|
| 983 | ug(k+1) = ug_surface + 0.5_wp * dzu(k+1) * gradient |
---|
[97] | 984 | ENDIF |
---|
| 985 | ELSE |
---|
| 986 | ug(k) = ug(k+1) |
---|
| 987 | ENDIF |
---|
| 988 | ENDDO |
---|
| 989 | |
---|
| 990 | ENDIF |
---|
| 991 | |
---|
[1] | 992 | ! |
---|
[767] | 993 | !-- In case of no given gradients for ug, choose a zero gradient |
---|
[1322] | 994 | IF ( ug_vertical_gradient_level(1) == -9999999.9_wp ) THEN |
---|
[1353] | 995 | ug_vertical_gradient_level(1) = 0.0_wp |
---|
[2312] | 996 | ENDIF |
---|
[1] | 997 | |
---|
| 998 | ! |
---|
| 999 | !-- |
---|
| 1000 | !-- If required, compute initial profile of the geostrophic wind |
---|
| 1001 | !-- (component vg) |
---|
| 1002 | i = 1 |
---|
[1353] | 1003 | gradient = 0.0_wp |
---|
[97] | 1004 | |
---|
[3294] | 1005 | IF ( .NOT. ocean_mode ) THEN |
---|
[97] | 1006 | |
---|
| 1007 | vg_vertical_gradient_level_ind(1) = 0 |
---|
| 1008 | vg(0) = vg_surface |
---|
| 1009 | DO k = 1, nzt+1 |
---|
[2312] | 1010 | IF ( i < 11 ) THEN |
---|
[1788] | 1011 | IF ( vg_vertical_gradient_level(i) < zu(k) .AND. & |
---|
[1353] | 1012 | vg_vertical_gradient_level(i) >= 0.0_wp ) THEN |
---|
| 1013 | gradient = vg_vertical_gradient(i) / 100.0_wp |
---|
[177] | 1014 | vg_vertical_gradient_level_ind(i) = k - 1 |
---|
| 1015 | i = i + 1 |
---|
[1] | 1016 | ENDIF |
---|
| 1017 | ENDIF |
---|
[1353] | 1018 | IF ( gradient /= 0.0_wp ) THEN |
---|
[97] | 1019 | IF ( k /= 1 ) THEN |
---|
| 1020 | vg(k) = vg(k-1) + dzu(k) * gradient |
---|
| 1021 | ELSE |
---|
[1174] | 1022 | vg(k) = vg_surface + dzu(k) * gradient |
---|
[97] | 1023 | ENDIF |
---|
[1] | 1024 | ELSE |
---|
[97] | 1025 | vg(k) = vg(k-1) |
---|
[1] | 1026 | ENDIF |
---|
[97] | 1027 | ENDDO |
---|
[1] | 1028 | |
---|
[97] | 1029 | ELSE |
---|
| 1030 | |
---|
[121] | 1031 | vg_vertical_gradient_level_ind(1) = nzt+1 |
---|
| 1032 | vg(nzt+1) = vg_surface |
---|
[667] | 1033 | DO k = nzt, nzb, -1 |
---|
[1788] | 1034 | IF ( i < 11 ) THEN |
---|
| 1035 | IF ( vg_vertical_gradient_level(i) > zu(k) .AND. & |
---|
[1353] | 1036 | vg_vertical_gradient_level(i) <= 0.0_wp ) THEN |
---|
| 1037 | gradient = vg_vertical_gradient(i) / 100.0_wp |
---|
[177] | 1038 | vg_vertical_gradient_level_ind(i) = k + 1 |
---|
| 1039 | i = i + 1 |
---|
[97] | 1040 | ENDIF |
---|
| 1041 | ENDIF |
---|
[1353] | 1042 | IF ( gradient /= 0.0_wp ) THEN |
---|
[97] | 1043 | IF ( k /= nzt ) THEN |
---|
| 1044 | vg(k) = vg(k+1) - dzu(k+1) * gradient |
---|
| 1045 | ELSE |
---|
[1353] | 1046 | vg(k) = vg_surface - 0.5_wp * dzu(k+1) * gradient |
---|
| 1047 | vg(k+1) = vg_surface + 0.5_wp * dzu(k+1) * gradient |
---|
[97] | 1048 | ENDIF |
---|
| 1049 | ELSE |
---|
| 1050 | vg(k) = vg(k+1) |
---|
| 1051 | ENDIF |
---|
| 1052 | ENDDO |
---|
| 1053 | |
---|
| 1054 | ENDIF |
---|
| 1055 | |
---|
[1] | 1056 | ! |
---|
[767] | 1057 | !-- In case of no given gradients for vg, choose a zero gradient |
---|
[1322] | 1058 | IF ( vg_vertical_gradient_level(1) == -9999999.9_wp ) THEN |
---|
[1353] | 1059 | vg_vertical_gradient_level(1) = 0.0_wp |
---|
[1] | 1060 | ENDIF |
---|
| 1061 | |
---|
| 1062 | ! |
---|
[767] | 1063 | !-- Let the initial wind profiles be the calculated ug/vg profiles or |
---|
| 1064 | !-- interpolate them from wind profile data (if given) |
---|
[1322] | 1065 | IF ( u_profile(1) == 9999999.9_wp .AND. v_profile(1) == 9999999.9_wp ) THEN |
---|
[767] | 1066 | |
---|
| 1067 | u_init = ug |
---|
| 1068 | v_init = vg |
---|
| 1069 | |
---|
[1353] | 1070 | ELSEIF ( u_profile(1) == 0.0_wp .AND. v_profile(1) == 0.0_wp ) THEN |
---|
[767] | 1071 | |
---|
[1353] | 1072 | IF ( uv_heights(1) /= 0.0_wp ) THEN |
---|
[767] | 1073 | message_string = 'uv_heights(1) must be 0.0' |
---|
| 1074 | CALL message( 'check_parameters', 'PA0345', 1, 2, 0, 6, 0 ) |
---|
| 1075 | ENDIF |
---|
| 1076 | |
---|
[2348] | 1077 | IF ( omega /= 0.0_wp ) THEN |
---|
| 1078 | message_string = 'Coriolis force must be switched off (by setting omega=0.0)' // & |
---|
| 1079 | ' when prescribing the forcing by u_profile and v_profile' |
---|
| 1080 | CALL message( 'check_parameters', 'PA0347', 1, 2, 0, 6, 0 ) |
---|
| 1081 | ENDIF |
---|
| 1082 | |
---|
[767] | 1083 | use_prescribed_profile_data = .TRUE. |
---|
| 1084 | |
---|
| 1085 | kk = 1 |
---|
[1353] | 1086 | u_init(0) = 0.0_wp |
---|
| 1087 | v_init(0) = 0.0_wp |
---|
[767] | 1088 | |
---|
| 1089 | DO k = 1, nz+1 |
---|
| 1090 | |
---|
[3337] | 1091 | IF ( kk < 200 ) THEN |
---|
[1788] | 1092 | DO WHILE ( uv_heights(kk+1) <= zu(k) ) |
---|
[767] | 1093 | kk = kk + 1 |
---|
[3337] | 1094 | IF ( kk == 200 ) EXIT |
---|
[767] | 1095 | ENDDO |
---|
| 1096 | ENDIF |
---|
| 1097 | |
---|
[3337] | 1098 | IF ( kk < 200 .AND. uv_heights(kk+1) /= 9999999.9_wp ) THEN |
---|
[767] | 1099 | u_init(k) = u_profile(kk) + ( zu(k) - uv_heights(kk) ) / & |
---|
| 1100 | ( uv_heights(kk+1) - uv_heights(kk) ) * & |
---|
| 1101 | ( u_profile(kk+1) - u_profile(kk) ) |
---|
| 1102 | v_init(k) = v_profile(kk) + ( zu(k) - uv_heights(kk) ) / & |
---|
| 1103 | ( uv_heights(kk+1) - uv_heights(kk) ) * & |
---|
| 1104 | ( v_profile(kk+1) - v_profile(kk) ) |
---|
| 1105 | ELSE |
---|
| 1106 | u_init(k) = u_profile(kk) |
---|
| 1107 | v_init(k) = v_profile(kk) |
---|
| 1108 | ENDIF |
---|
| 1109 | |
---|
| 1110 | ENDDO |
---|
| 1111 | |
---|
| 1112 | ELSE |
---|
| 1113 | |
---|
| 1114 | message_string = 'u_profile(1) and v_profile(1) must be 0.0' |
---|
| 1115 | CALL message( 'check_parameters', 'PA0346', 1, 2, 0, 6, 0 ) |
---|
| 1116 | |
---|
| 1117 | ENDIF |
---|
| 1118 | |
---|
| 1119 | ! |
---|
[94] | 1120 | !-- Compute initial temperature profile using the given temperature gradients |
---|
[1788] | 1121 | IF ( .NOT. neutral ) THEN |
---|
[1960] | 1122 | CALL init_vertical_profiles( pt_vertical_gradient_level_ind, & |
---|
| 1123 | pt_vertical_gradient_level, & |
---|
| 1124 | pt_vertical_gradient, pt_init, & |
---|
| 1125 | pt_surface, bc_pt_t_val ) |
---|
[94] | 1126 | ENDIF |
---|
[1] | 1127 | ! |
---|
[1960] | 1128 | !-- Compute initial humidity profile using the given humidity gradients |
---|
| 1129 | IF ( humidity ) THEN |
---|
| 1130 | CALL init_vertical_profiles( q_vertical_gradient_level_ind, & |
---|
| 1131 | q_vertical_gradient_level, & |
---|
| 1132 | q_vertical_gradient, q_init, & |
---|
| 1133 | q_surface, bc_q_t_val ) |
---|
[1] | 1134 | ENDIF |
---|
| 1135 | ! |
---|
[1960] | 1136 | !-- Compute initial scalar profile using the given scalar gradients |
---|
[1] | 1137 | IF ( passive_scalar ) THEN |
---|
[1960] | 1138 | CALL init_vertical_profiles( s_vertical_gradient_level_ind, & |
---|
| 1139 | s_vertical_gradient_level, & |
---|
| 1140 | s_vertical_gradient, s_init, & |
---|
| 1141 | s_surface, bc_s_t_val ) |
---|
[1] | 1142 | ENDIF |
---|
| 1143 | ! |
---|
[3298] | 1144 | !-- TODO |
---|
[2696] | 1145 | !-- Compute initial chemistry profile using the given chemical species gradients |
---|
[3298] | 1146 | !-- Russo: Is done in chem_init --> kanani: Revise |
---|
[94] | 1147 | |
---|
[138] | 1148 | ENDIF |
---|
[411] | 1149 | |
---|
| 1150 | ! |
---|
[1365] | 1151 | !-- Check if the control parameter use_subsidence_tendencies is used correctly |
---|
[1788] | 1152 | IF ( use_subsidence_tendencies .AND. .NOT. large_scale_subsidence ) THEN |
---|
| 1153 | message_string = 'The usage of use_subsidence_tendencies ' // & |
---|
[1365] | 1154 | 'requires large_scale_subsidence = .T..' |
---|
| 1155 | CALL message( 'check_parameters', 'PA0396', 1, 2, 0, 6, 0 ) |
---|
| 1156 | ELSEIF ( use_subsidence_tendencies .AND. .NOT. large_scale_forcing ) THEN |
---|
[1788] | 1157 | message_string = 'The usage of use_subsidence_tendencies ' // & |
---|
[1365] | 1158 | 'requires large_scale_forcing = .T..' |
---|
| 1159 | CALL message( 'check_parameters', 'PA0397', 1, 2, 0, 6, 0 ) |
---|
| 1160 | ENDIF |
---|
| 1161 | |
---|
| 1162 | ! |
---|
[411] | 1163 | !-- Initialize large scale subsidence if required |
---|
[1299] | 1164 | If ( large_scale_subsidence ) THEN |
---|
[1788] | 1165 | IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp .AND. & |
---|
| 1166 | .NOT. large_scale_forcing ) THEN |
---|
[1299] | 1167 | CALL init_w_subsidence |
---|
| 1168 | ENDIF |
---|
| 1169 | ! |
---|
| 1170 | !-- In case large_scale_forcing is used, profiles for subsidence velocity |
---|
| 1171 | !-- are read in from file LSF_DATA |
---|
[667] | 1172 | |
---|
[1788] | 1173 | IF ( subs_vertical_gradient_level(1) == -9999999.9_wp .AND. & |
---|
| 1174 | .NOT. large_scale_forcing ) THEN |
---|
| 1175 | message_string = 'There is no default large scale vertical ' // & |
---|
| 1176 | 'velocity profile set. Specify the subsidence ' // & |
---|
| 1177 | 'velocity profile via subs_vertical_gradient ' // & |
---|
| 1178 | 'and subs_vertical_gradient_level.' |
---|
[1299] | 1179 | CALL message( 'check_parameters', 'PA0380', 1, 2, 0, 6, 0 ) |
---|
| 1180 | ENDIF |
---|
| 1181 | ELSE |
---|
[1322] | 1182 | IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp ) THEN |
---|
[1788] | 1183 | message_string = 'Enable usage of large scale subsidence by ' // & |
---|
[1299] | 1184 | 'setting large_scale_subsidence = .T..' |
---|
| 1185 | CALL message( 'check_parameters', 'PA0381', 1, 2, 0, 6, 0 ) |
---|
| 1186 | ENDIF |
---|
[2312] | 1187 | ENDIF |
---|
[1299] | 1188 | |
---|
[138] | 1189 | ! |
---|
[4472] | 1190 | !-- Overwrite parameters from namelist if necessary and compute Coriolis parameter. |
---|
[3182] | 1191 | !-- @todo - move initialization of f and fs to coriolis_mod. |
---|
[2696] | 1192 | IF ( input_pids_static ) THEN |
---|
[4196] | 1193 | latitude = init_model%latitude |
---|
| 1194 | longitude = init_model%longitude |
---|
| 1195 | rotation_angle = init_model%rotation_angle |
---|
[2696] | 1196 | ENDIF |
---|
| 1197 | |
---|
[2575] | 1198 | f = 2.0_wp * omega * SIN( latitude / 180.0_wp * pi ) |
---|
| 1199 | fs = 2.0_wp * omega * COS( latitude / 180.0_wp * pi ) |
---|
[1] | 1200 | |
---|
| 1201 | ! |
---|
[1179] | 1202 | !-- Check and set buoyancy related parameters and switches |
---|
| 1203 | IF ( reference_state == 'horizontal_average' ) THEN |
---|
| 1204 | CONTINUE |
---|
| 1205 | ELSEIF ( reference_state == 'initial_profile' ) THEN |
---|
| 1206 | use_initial_profile_as_reference = .TRUE. |
---|
| 1207 | ELSEIF ( reference_state == 'single_value' ) THEN |
---|
| 1208 | use_single_reference_value = .TRUE. |
---|
[1322] | 1209 | IF ( pt_reference == 9999999.9_wp ) pt_reference = pt_surface |
---|
[1353] | 1210 | vpt_reference = pt_reference * ( 1.0_wp + 0.61_wp * q_surface ) |
---|
[1179] | 1211 | ELSE |
---|
[1788] | 1212 | message_string = 'illegal value for reference_state: "' // & |
---|
[1179] | 1213 | TRIM( reference_state ) // '"' |
---|
| 1214 | CALL message( 'check_parameters', 'PA0056', 1, 2, 0, 6, 0 ) |
---|
| 1215 | ENDIF |
---|
[57] | 1216 | |
---|
| 1217 | ! |
---|
[1] | 1218 | !-- In case of a given slope, compute the relevant quantities |
---|
[1353] | 1219 | IF ( alpha_surface /= 0.0_wp ) THEN |
---|
| 1220 | IF ( ABS( alpha_surface ) > 90.0_wp ) THEN |
---|
[1788] | 1221 | WRITE( message_string, * ) 'ABS( alpha_surface = ', alpha_surface, & |
---|
[215] | 1222 | ' ) must be < 90.0' |
---|
[226] | 1223 | CALL message( 'check_parameters', 'PA0043', 1, 2, 0, 6, 0 ) |
---|
[1] | 1224 | ENDIF |
---|
| 1225 | sloping_surface = .TRUE. |
---|
[1353] | 1226 | cos_alpha_surface = COS( alpha_surface / 180.0_wp * pi ) |
---|
| 1227 | sin_alpha_surface = SIN( alpha_surface / 180.0_wp * pi ) |
---|
[1] | 1228 | ENDIF |
---|
| 1229 | |
---|
| 1230 | ! |
---|
| 1231 | !-- Check time step and cfl_factor |
---|
[1353] | 1232 | IF ( dt /= -1.0_wp ) THEN |
---|
[3045] | 1233 | IF ( dt <= 0.0_wp ) THEN |
---|
[215] | 1234 | WRITE( message_string, * ) 'dt = ', dt , ' <= 0.0' |
---|
[226] | 1235 | CALL message( 'check_parameters', 'PA0044', 1, 2, 0, 6, 0 ) |
---|
[1] | 1236 | ENDIF |
---|
| 1237 | dt_3d = dt |
---|
| 1238 | dt_fixed = .TRUE. |
---|
| 1239 | ENDIF |
---|
| 1240 | |
---|
[1353] | 1241 | IF ( cfl_factor <= 0.0_wp .OR. cfl_factor > 1.0_wp ) THEN |
---|
| 1242 | IF ( cfl_factor == -1.0_wp ) THEN |
---|
[1001] | 1243 | IF ( timestep_scheme == 'runge-kutta-2' ) THEN |
---|
[1353] | 1244 | cfl_factor = 0.8_wp |
---|
[1001] | 1245 | ELSEIF ( timestep_scheme == 'runge-kutta-3' ) THEN |
---|
[1353] | 1246 | cfl_factor = 0.9_wp |
---|
[1] | 1247 | ELSE |
---|
[1353] | 1248 | cfl_factor = 0.9_wp |
---|
[1] | 1249 | ENDIF |
---|
| 1250 | ELSE |
---|
[1788] | 1251 | WRITE( message_string, * ) 'cfl_factor = ', cfl_factor, & |
---|
[3046] | 1252 | ' out of range &0.0 < cfl_factor <= 1.0 is required' |
---|
[226] | 1253 | CALL message( 'check_parameters', 'PA0045', 1, 2, 0, 6, 0 ) |
---|
[1] | 1254 | ENDIF |
---|
| 1255 | ENDIF |
---|
| 1256 | |
---|
| 1257 | ! |
---|
| 1258 | !-- Store simulated time at begin |
---|
| 1259 | simulated_time_at_begin = simulated_time |
---|
| 1260 | |
---|
| 1261 | ! |
---|
[291] | 1262 | !-- Store reference time for coupled runs and change the coupling flag, |
---|
| 1263 | !-- if ... |
---|
[1353] | 1264 | IF ( simulated_time == 0.0_wp ) THEN |
---|
| 1265 | IF ( coupling_start_time == 0.0_wp ) THEN |
---|
| 1266 | time_since_reference_point = 0.0_wp |
---|
| 1267 | ELSEIF ( time_since_reference_point < 0.0_wp ) THEN |
---|
[291] | 1268 | run_coupled = .FALSE. |
---|
| 1269 | ENDIF |
---|
| 1270 | ENDIF |
---|
| 1271 | |
---|
| 1272 | ! |
---|
[1] | 1273 | !-- Set wind speed in the Galilei-transformed system |
---|
| 1274 | IF ( galilei_transformation ) THEN |
---|
[1788] | 1275 | IF ( use_ug_for_galilei_tr .AND. & |
---|
| 1276 | ug_vertical_gradient_level(1) == 0.0_wp .AND. & |
---|
[2312] | 1277 | ug_vertical_gradient(1) == 0.0_wp .AND. & |
---|
[1788] | 1278 | vg_vertical_gradient_level(1) == 0.0_wp .AND. & |
---|
[1353] | 1279 | vg_vertical_gradient(1) == 0.0_wp ) THEN |
---|
| 1280 | u_gtrans = ug_surface * 0.6_wp |
---|
| 1281 | v_gtrans = vg_surface * 0.6_wp |
---|
[1788] | 1282 | ELSEIF ( use_ug_for_galilei_tr .AND. & |
---|
| 1283 | ( ug_vertical_gradient_level(1) /= 0.0_wp .OR. & |
---|
[1353] | 1284 | ug_vertical_gradient(1) /= 0.0_wp ) ) THEN |
---|
[1788] | 1285 | message_string = 'baroclinity (ug) not allowed simultaneously' // & |
---|
[215] | 1286 | ' with galilei transformation' |
---|
[226] | 1287 | CALL message( 'check_parameters', 'PA0046', 1, 2, 0, 6, 0 ) |
---|
[1788] | 1288 | ELSEIF ( use_ug_for_galilei_tr .AND. & |
---|
| 1289 | ( vg_vertical_gradient_level(1) /= 0.0_wp .OR. & |
---|
[1353] | 1290 | vg_vertical_gradient(1) /= 0.0_wp ) ) THEN |
---|
[1788] | 1291 | message_string = 'baroclinity (vg) not allowed simultaneously' // & |
---|
[215] | 1292 | ' with galilei transformation' |
---|
[226] | 1293 | CALL message( 'check_parameters', 'PA0047', 1, 2, 0, 6, 0 ) |
---|
[1] | 1294 | ELSE |
---|
[3045] | 1295 | message_string = 'variable translation speed used for Galilei-' // & |
---|
[3046] | 1296 | 'transformation, which may cause & instabilities in stably ' // & |
---|
[215] | 1297 | 'stratified regions' |
---|
[226] | 1298 | CALL message( 'check_parameters', 'PA0048', 0, 1, 0, 6, 0 ) |
---|
[1] | 1299 | ENDIF |
---|
| 1300 | ENDIF |
---|
| 1301 | |
---|
| 1302 | ! |
---|
| 1303 | !-- In case of using a prandtl-layer, calculated (or prescribed) surface |
---|
| 1304 | !-- fluxes have to be used in the diffusion-terms |
---|
[1691] | 1305 | IF ( constant_flux_layer ) use_surface_fluxes = .TRUE. |
---|
[1] | 1306 | |
---|
| 1307 | ! |
---|
| 1308 | !-- Check boundary conditions and set internal variables: |
---|
[1764] | 1309 | !-- Attention: the lateral boundary conditions have been already checked in |
---|
| 1310 | !-- parin |
---|
[1] | 1311 | ! |
---|
| 1312 | !-- Non-cyclic lateral boundaries require the multigrid method and Piascek- |
---|
[667] | 1313 | !-- Willimas or Wicker - Skamarock advection scheme. Several schemes |
---|
| 1314 | !-- and tools do not work with non-cyclic boundary conditions. |
---|
[1] | 1315 | IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN |
---|
[1575] | 1316 | IF ( psolver(1:9) /= 'multigrid' ) THEN |
---|
[1788] | 1317 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
[215] | 1318 | 'psolver = "' // TRIM( psolver ) // '"' |
---|
[226] | 1319 | CALL message( 'check_parameters', 'PA0051', 1, 2, 0, 6, 0 ) |
---|
[1] | 1320 | ENDIF |
---|
[1788] | 1321 | IF ( momentum_advec /= 'pw-scheme' .AND. & |
---|
[2200] | 1322 | momentum_advec /= 'ws-scheme' ) THEN |
---|
[1557] | 1323 | |
---|
[1788] | 1324 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
[215] | 1325 | 'momentum_advec = "' // TRIM( momentum_advec ) // '"' |
---|
[226] | 1326 | CALL message( 'check_parameters', 'PA0052', 1, 2, 0, 6, 0 ) |
---|
[1] | 1327 | ENDIF |
---|
[1788] | 1328 | IF ( scalar_advec /= 'pw-scheme' .AND. & |
---|
[2200] | 1329 | scalar_advec /= 'ws-scheme' ) THEN |
---|
[1788] | 1330 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
[215] | 1331 | 'scalar_advec = "' // TRIM( scalar_advec ) // '"' |
---|
[226] | 1332 | CALL message( 'check_parameters', 'PA0053', 1, 2, 0, 6, 0 ) |
---|
[1] | 1333 | ENDIF |
---|
| 1334 | IF ( galilei_transformation ) THEN |
---|
[1788] | 1335 | message_string = 'non-cyclic lateral boundaries do not allow ' // & |
---|
[215] | 1336 | 'galilei_transformation = .T.' |
---|
[226] | 1337 | CALL message( 'check_parameters', 'PA0054', 1, 2, 0, 6, 0 ) |
---|
[1] | 1338 | ENDIF |
---|
| 1339 | ENDIF |
---|
| 1340 | |
---|
| 1341 | ! |
---|
| 1342 | !-- Bottom boundary condition for the turbulent Kinetic energy |
---|
| 1343 | IF ( bc_e_b == 'neumann' ) THEN |
---|
| 1344 | ibc_e_b = 1 |
---|
| 1345 | ELSEIF ( bc_e_b == '(u*)**2+neumann' ) THEN |
---|
| 1346 | ibc_e_b = 2 |
---|
[1691] | 1347 | IF ( .NOT. constant_flux_layer ) THEN |
---|
[1] | 1348 | bc_e_b = 'neumann' |
---|
| 1349 | ibc_e_b = 1 |
---|
[1788] | 1350 | message_string = 'boundary condition bc_e_b changed to "' // & |
---|
[215] | 1351 | TRIM( bc_e_b ) // '"' |
---|
[226] | 1352 | CALL message( 'check_parameters', 'PA0057', 0, 1, 0, 6, 0 ) |
---|
[1] | 1353 | ENDIF |
---|
| 1354 | ELSE |
---|
[1788] | 1355 | message_string = 'unknown boundary condition: bc_e_b = "' // & |
---|
[215] | 1356 | TRIM( bc_e_b ) // '"' |
---|
[226] | 1357 | CALL message( 'check_parameters', 'PA0058', 1, 2, 0, 6, 0 ) |
---|
[1] | 1358 | ENDIF |
---|
| 1359 | |
---|
| 1360 | ! |
---|
| 1361 | !-- Boundary conditions for perturbation pressure |
---|
| 1362 | IF ( bc_p_b == 'dirichlet' ) THEN |
---|
| 1363 | ibc_p_b = 0 |
---|
| 1364 | ELSEIF ( bc_p_b == 'neumann' ) THEN |
---|
| 1365 | ibc_p_b = 1 |
---|
| 1366 | ELSE |
---|
[1788] | 1367 | message_string = 'unknown boundary condition: bc_p_b = "' // & |
---|
[215] | 1368 | TRIM( bc_p_b ) // '"' |
---|
[226] | 1369 | CALL message( 'check_parameters', 'PA0059', 1, 2, 0, 6, 0 ) |
---|
[1] | 1370 | ENDIF |
---|
[1111] | 1371 | |
---|
[1] | 1372 | IF ( bc_p_t == 'dirichlet' ) THEN |
---|
| 1373 | ibc_p_t = 0 |
---|
[1762] | 1374 | !-- TO_DO: later set bc_p_t to neumann before, in case of nested domain |
---|
[3347] | 1375 | ELSEIF ( bc_p_t == 'neumann' .OR. bc_p_t == 'nested' ) THEN |
---|
[1] | 1376 | ibc_p_t = 1 |
---|
| 1377 | ELSE |
---|
[1788] | 1378 | message_string = 'unknown boundary condition: bc_p_t = "' // & |
---|
[215] | 1379 | TRIM( bc_p_t ) // '"' |
---|
[226] | 1380 | CALL message( 'check_parameters', 'PA0061', 1, 2, 0, 6, 0 ) |
---|
[1] | 1381 | ENDIF |
---|
| 1382 | |
---|
| 1383 | ! |
---|
| 1384 | !-- Boundary conditions for potential temperature |
---|
[102] | 1385 | IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
| 1386 | ibc_pt_b = 2 |
---|
[1] | 1387 | ELSE |
---|
[102] | 1388 | IF ( bc_pt_b == 'dirichlet' ) THEN |
---|
| 1389 | ibc_pt_b = 0 |
---|
| 1390 | ELSEIF ( bc_pt_b == 'neumann' ) THEN |
---|
| 1391 | ibc_pt_b = 1 |
---|
| 1392 | ELSE |
---|
[1788] | 1393 | message_string = 'unknown boundary condition: bc_pt_b = "' // & |
---|
[215] | 1394 | TRIM( bc_pt_b ) // '"' |
---|
[226] | 1395 | CALL message( 'check_parameters', 'PA0062', 1, 2, 0, 6, 0 ) |
---|
[1] | 1396 | ENDIF |
---|
| 1397 | ENDIF |
---|
[102] | 1398 | |
---|
[1] | 1399 | IF ( bc_pt_t == 'dirichlet' ) THEN |
---|
| 1400 | ibc_pt_t = 0 |
---|
| 1401 | ELSEIF ( bc_pt_t == 'neumann' ) THEN |
---|
| 1402 | ibc_pt_t = 1 |
---|
[19] | 1403 | ELSEIF ( bc_pt_t == 'initial_gradient' ) THEN |
---|
| 1404 | ibc_pt_t = 2 |
---|
[3182] | 1405 | ELSEIF ( bc_pt_t == 'nested' .OR. bc_pt_t == 'nesting_offline' ) THEN |
---|
[1762] | 1406 | ibc_pt_t = 3 |
---|
[1] | 1407 | ELSE |
---|
[1788] | 1408 | message_string = 'unknown boundary condition: bc_pt_t = "' // & |
---|
[215] | 1409 | TRIM( bc_pt_t ) // '"' |
---|
[226] | 1410 | CALL message( 'check_parameters', 'PA0063', 1, 2, 0, 6, 0 ) |
---|
[1] | 1411 | ENDIF |
---|
| 1412 | |
---|
[2042] | 1413 | IF ( ANY( wall_heatflux /= 0.0_wp ) .AND. & |
---|
| 1414 | surface_heatflux == 9999999.9_wp ) THEN |
---|
| 1415 | message_string = 'wall_heatflux additionally requires ' // & |
---|
| 1416 | 'setting of surface_heatflux' |
---|
| 1417 | CALL message( 'check_parameters', 'PA0443', 1, 2, 0, 6, 0 ) |
---|
| 1418 | ENDIF |
---|
| 1419 | |
---|
[2007] | 1420 | ! |
---|
| 1421 | ! This IF clause needs revision, got too complex!! |
---|
[1322] | 1422 | IF ( surface_heatflux == 9999999.9_wp ) THEN |
---|
[1276] | 1423 | constant_heatflux = .FALSE. |
---|
[2007] | 1424 | IF ( large_scale_forcing .OR. land_surface .OR. urban_surface ) THEN |
---|
[1276] | 1425 | IF ( ibc_pt_b == 0 ) THEN |
---|
| 1426 | constant_heatflux = .FALSE. |
---|
| 1427 | ELSEIF ( ibc_pt_b == 1 ) THEN |
---|
| 1428 | constant_heatflux = .TRUE. |
---|
[2970] | 1429 | surface_heatflux = 0.0_wp |
---|
[1276] | 1430 | ENDIF |
---|
| 1431 | ENDIF |
---|
[1241] | 1432 | ELSE |
---|
[2970] | 1433 | constant_heatflux = .TRUE. |
---|
[1241] | 1434 | ENDIF |
---|
| 1435 | |
---|
[1322] | 1436 | IF ( top_heatflux == 9999999.9_wp ) constant_top_heatflux = .FALSE. |
---|
[940] | 1437 | |
---|
| 1438 | IF ( neutral ) THEN |
---|
| 1439 | |
---|
[1788] | 1440 | IF ( surface_heatflux /= 0.0_wp .AND. & |
---|
| 1441 | surface_heatflux /= 9999999.9_wp ) THEN |
---|
[940] | 1442 | message_string = 'heatflux must not be set for pure neutral flow' |
---|
| 1443 | CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) |
---|
| 1444 | ENDIF |
---|
| 1445 | |
---|
[1788] | 1446 | IF ( top_heatflux /= 0.0_wp .AND. top_heatflux /= 9999999.9_wp ) & |
---|
[940] | 1447 | THEN |
---|
| 1448 | message_string = 'heatflux must not be set for pure neutral flow' |
---|
| 1449 | CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) |
---|
| 1450 | ENDIF |
---|
| 1451 | |
---|
| 1452 | ENDIF |
---|
| 1453 | |
---|
[1788] | 1454 | IF ( top_momentumflux_u /= 9999999.9_wp .AND. & |
---|
[1322] | 1455 | top_momentumflux_v /= 9999999.9_wp ) THEN |
---|
[103] | 1456 | constant_top_momentumflux = .TRUE. |
---|
[1788] | 1457 | ELSEIF ( .NOT. ( top_momentumflux_u == 9999999.9_wp .AND. & |
---|
[1322] | 1458 | top_momentumflux_v == 9999999.9_wp ) ) THEN |
---|
[1788] | 1459 | message_string = 'both, top_momentumflux_u AND top_momentumflux_v ' // & |
---|
[215] | 1460 | 'must be set' |
---|
[226] | 1461 | CALL message( 'check_parameters', 'PA0064', 1, 2, 0, 6, 0 ) |
---|
[103] | 1462 | ENDIF |
---|
[1] | 1463 | |
---|
| 1464 | ! |
---|
| 1465 | !-- A given surface temperature implies Dirichlet boundary condition for |
---|
| 1466 | !-- temperature. In this case specification of a constant heat flux is |
---|
| 1467 | !-- forbidden. |
---|
[1788] | 1468 | IF ( ibc_pt_b == 0 .AND. constant_heatflux .AND. & |
---|
[1353] | 1469 | surface_heatflux /= 0.0_wp ) THEN |
---|
[215] | 1470 | message_string = 'boundary_condition: bc_pt_b = "' // TRIM( bc_pt_b ) //& |
---|
[3046] | 1471 | '& is not allowed with constant_heatflux = .TRUE.' |
---|
[226] | 1472 | CALL message( 'check_parameters', 'PA0065', 1, 2, 0, 6, 0 ) |
---|
[1] | 1473 | ENDIF |
---|
[1353] | 1474 | IF ( constant_heatflux .AND. pt_surface_initial_change /= 0.0_wp ) THEN |
---|
[1788] | 1475 | WRITE ( message_string, * ) 'constant_heatflux = .TRUE. is not allo', & |
---|
| 1476 | 'wed with pt_surface_initial_change (/=0) = ', & |
---|
[215] | 1477 | pt_surface_initial_change |
---|
[226] | 1478 | CALL message( 'check_parameters', 'PA0066', 1, 2, 0, 6, 0 ) |
---|
[1] | 1479 | ENDIF |
---|
| 1480 | |
---|
| 1481 | ! |
---|
[19] | 1482 | !-- A given temperature at the top implies Dirichlet boundary condition for |
---|
| 1483 | !-- temperature. In this case specification of a constant heat flux is |
---|
| 1484 | !-- forbidden. |
---|
[1788] | 1485 | IF ( ibc_pt_t == 0 .AND. constant_top_heatflux .AND. & |
---|
[1353] | 1486 | top_heatflux /= 0.0_wp ) THEN |
---|
[215] | 1487 | message_string = 'boundary_condition: bc_pt_t = "' // TRIM( bc_pt_t ) //& |
---|
| 1488 | '" is not allowed with constant_top_heatflux = .TRUE.' |
---|
[226] | 1489 | CALL message( 'check_parameters', 'PA0067', 1, 2, 0, 6, 0 ) |
---|
[19] | 1490 | ENDIF |
---|
| 1491 | |
---|
| 1492 | ! |
---|
[1960] | 1493 | !-- Set boundary conditions for total water content |
---|
| 1494 | IF ( humidity ) THEN |
---|
[2042] | 1495 | |
---|
| 1496 | IF ( ANY( wall_humidityflux /= 0.0_wp ) .AND. & |
---|
| 1497 | surface_waterflux == 9999999.9_wp ) THEN |
---|
| 1498 | message_string = 'wall_humidityflux additionally requires ' // & |
---|
| 1499 | 'setting of surface_waterflux' |
---|
| 1500 | CALL message( 'check_parameters', 'PA0444', 1, 2, 0, 6, 0 ) |
---|
| 1501 | ENDIF |
---|
| 1502 | |
---|
[1984] | 1503 | CALL set_bc_scalars( 'q', bc_q_b, bc_q_t, ibc_q_b, ibc_q_t, & |
---|
| 1504 | 'PA0071', 'PA0072' ) |
---|
[1] | 1505 | |
---|
[1322] | 1506 | IF ( surface_waterflux == 9999999.9_wp ) THEN |
---|
[1276] | 1507 | constant_waterflux = .FALSE. |
---|
[1691] | 1508 | IF ( large_scale_forcing .OR. land_surface ) THEN |
---|
[1276] | 1509 | IF ( ibc_q_b == 0 ) THEN |
---|
| 1510 | constant_waterflux = .FALSE. |
---|
| 1511 | ELSEIF ( ibc_q_b == 1 ) THEN |
---|
| 1512 | constant_waterflux = .TRUE. |
---|
| 1513 | ENDIF |
---|
| 1514 | ENDIF |
---|
[1241] | 1515 | ELSE |
---|
[1276] | 1516 | constant_waterflux = .TRUE. |
---|
[1241] | 1517 | ENDIF |
---|
[1] | 1518 | |
---|
[1984] | 1519 | CALL check_bc_scalars( 'q', bc_q_b, ibc_q_b, 'PA0073', 'PA0074', & |
---|
| 1520 | constant_waterflux, q_surface_initial_change ) |
---|
| 1521 | |
---|
[1] | 1522 | ENDIF |
---|
[2312] | 1523 | |
---|
[1960] | 1524 | IF ( passive_scalar ) THEN |
---|
[2042] | 1525 | |
---|
[3045] | 1526 | IF ( ANY( wall_scalarflux /= 0.0_wp ) .AND. & |
---|
[2042] | 1527 | surface_scalarflux == 9999999.9_wp ) THEN |
---|
[3045] | 1528 | message_string = 'wall_scalarflux additionally requires ' // & |
---|
[2042] | 1529 | 'setting of surface_scalarflux' |
---|
| 1530 | CALL message( 'check_parameters', 'PA0445', 1, 2, 0, 6, 0 ) |
---|
| 1531 | ENDIF |
---|
| 1532 | |
---|
| 1533 | IF ( surface_scalarflux == 9999999.9_wp ) constant_scalarflux = .FALSE. |
---|
| 1534 | |
---|
[1984] | 1535 | CALL set_bc_scalars( 's', bc_s_b, bc_s_t, ibc_s_b, ibc_s_t, & |
---|
| 1536 | 'PA0071', 'PA0072' ) |
---|
| 1537 | |
---|
| 1538 | CALL check_bc_scalars( 's', bc_s_b, ibc_s_b, 'PA0073', 'PA0074', & |
---|
| 1539 | constant_scalarflux, s_surface_initial_change ) |
---|
[1992] | 1540 | |
---|
| 1541 | IF ( top_scalarflux == 9999999.9_wp ) constant_top_scalarflux = .FALSE. |
---|
| 1542 | ! |
---|
| 1543 | !-- A fixed scalar concentration at the top implies Dirichlet boundary |
---|
[2312] | 1544 | !-- condition for scalar. Hence, in this case specification of a constant |
---|
[1992] | 1545 | !-- scalar flux is forbidden. |
---|
| 1546 | IF ( ( ibc_s_t == 0 .OR. ibc_s_t == 2 ) .AND. constant_top_scalarflux & |
---|
| 1547 | .AND. top_scalarflux /= 0.0_wp ) THEN |
---|
| 1548 | message_string = 'boundary condition: bc_s_t = "' // & |
---|
[3294] | 1549 | TRIM( bc_s_t ) // '" is not allowed with ' // & |
---|
[1992] | 1550 | 'top_scalarflux /= 0.0' |
---|
| 1551 | CALL message( 'check_parameters', 'PA0441', 1, 2, 0, 6, 0 ) |
---|
| 1552 | ENDIF |
---|
[1960] | 1553 | ENDIF |
---|
[2696] | 1554 | |
---|
[1] | 1555 | ! |
---|
[2696] | 1556 | !-- Boundary conditions for chemical species |
---|
| 1557 | IF ( air_chemistry ) CALL chem_boundary_conds( 'init' ) |
---|
| 1558 | |
---|
| 1559 | ! |
---|
[1] | 1560 | !-- Boundary conditions for horizontal components of wind speed |
---|
| 1561 | IF ( bc_uv_b == 'dirichlet' ) THEN |
---|
| 1562 | ibc_uv_b = 0 |
---|
| 1563 | ELSEIF ( bc_uv_b == 'neumann' ) THEN |
---|
| 1564 | ibc_uv_b = 1 |
---|
[1691] | 1565 | IF ( constant_flux_layer ) THEN |
---|
[1788] | 1566 | message_string = 'boundary condition: bc_uv_b = "' // & |
---|
[1691] | 1567 | TRIM( bc_uv_b ) // '" is not allowed with constant_flux_layer' & |
---|
| 1568 | // ' = .TRUE.' |
---|
[226] | 1569 | CALL message( 'check_parameters', 'PA0075', 1, 2, 0, 6, 0 ) |
---|
[1] | 1570 | ENDIF |
---|
| 1571 | ELSE |
---|
[1788] | 1572 | message_string = 'unknown boundary condition: bc_uv_b = "' // & |
---|
[215] | 1573 | TRIM( bc_uv_b ) // '"' |
---|
[226] | 1574 | CALL message( 'check_parameters', 'PA0076', 1, 2, 0, 6, 0 ) |
---|
[1] | 1575 | ENDIF |
---|
[667] | 1576 | ! |
---|
| 1577 | !-- In case of coupled simulations u and v at the ground in atmosphere will be |
---|
| 1578 | !-- assigned with the u and v values of the ocean surface |
---|
| 1579 | IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN |
---|
| 1580 | ibc_uv_b = 2 |
---|
| 1581 | ENDIF |
---|
[215] | 1582 | |
---|
[108] | 1583 | IF ( coupling_mode == 'ocean_to_atmosphere' ) THEN |
---|
| 1584 | bc_uv_t = 'neumann' |
---|
[1] | 1585 | ibc_uv_t = 1 |
---|
| 1586 | ELSE |
---|
[132] | 1587 | IF ( bc_uv_t == 'dirichlet' .OR. bc_uv_t == 'dirichlet_0' ) THEN |
---|
[108] | 1588 | ibc_uv_t = 0 |
---|
[767] | 1589 | IF ( bc_uv_t == 'dirichlet_0' ) THEN |
---|
| 1590 | ! |
---|
| 1591 | !-- Velocities for the initial u,v-profiles are set zero at the top |
---|
| 1592 | !-- in case of dirichlet_0 conditions |
---|
[1353] | 1593 | u_init(nzt+1) = 0.0_wp |
---|
| 1594 | v_init(nzt+1) = 0.0_wp |
---|
[767] | 1595 | ENDIF |
---|
[108] | 1596 | ELSEIF ( bc_uv_t == 'neumann' ) THEN |
---|
| 1597 | ibc_uv_t = 1 |
---|
[3182] | 1598 | ELSEIF ( bc_uv_t == 'nested' .OR. bc_uv_t == 'nesting_offline' ) THEN |
---|
[1762] | 1599 | ibc_uv_t = 3 |
---|
[108] | 1600 | ELSE |
---|
[1788] | 1601 | message_string = 'unknown boundary condition: bc_uv_t = "' // & |
---|
[215] | 1602 | TRIM( bc_uv_t ) // '"' |
---|
[226] | 1603 | CALL message( 'check_parameters', 'PA0077', 1, 2, 0, 6, 0 ) |
---|
[1] | 1604 | ENDIF |
---|
| 1605 | ENDIF |
---|
| 1606 | |
---|
| 1607 | ! |
---|
| 1608 | !-- Compute and check, respectively, the Rayleigh Damping parameter |
---|
[1353] | 1609 | IF ( rayleigh_damping_factor == -1.0_wp ) THEN |
---|
| 1610 | rayleigh_damping_factor = 0.0_wp |
---|
[1] | 1611 | ELSE |
---|
[1788] | 1612 | IF ( rayleigh_damping_factor < 0.0_wp .OR. & |
---|
| 1613 | rayleigh_damping_factor > 1.0_wp ) THEN |
---|
| 1614 | WRITE( message_string, * ) 'rayleigh_damping_factor = ', & |
---|
[215] | 1615 | rayleigh_damping_factor, ' out of range [0.0,1.0]' |
---|
[226] | 1616 | CALL message( 'check_parameters', 'PA0078', 1, 2, 0, 6, 0 ) |
---|
[1] | 1617 | ENDIF |
---|
| 1618 | ENDIF |
---|
| 1619 | |
---|
[1353] | 1620 | IF ( rayleigh_damping_height == -1.0_wp ) THEN |
---|
[3294] | 1621 | IF ( .NOT. ocean_mode ) THEN |
---|
[1353] | 1622 | rayleigh_damping_height = 0.66666666666_wp * zu(nzt) |
---|
[108] | 1623 | ELSE |
---|
[1353] | 1624 | rayleigh_damping_height = 0.66666666666_wp * zu(nzb) |
---|
[108] | 1625 | ENDIF |
---|
[1] | 1626 | ELSE |
---|
[3294] | 1627 | IF ( .NOT. ocean_mode ) THEN |
---|
[1788] | 1628 | IF ( rayleigh_damping_height < 0.0_wp .OR. & |
---|
[108] | 1629 | rayleigh_damping_height > zu(nzt) ) THEN |
---|
[1788] | 1630 | WRITE( message_string, * ) 'rayleigh_damping_height = ', & |
---|
[215] | 1631 | rayleigh_damping_height, ' out of range [0.0,', zu(nzt), ']' |
---|
[226] | 1632 | CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) |
---|
[1] | 1633 | ENDIF |
---|
[108] | 1634 | ELSE |
---|
[1788] | 1635 | IF ( rayleigh_damping_height > 0.0_wp .OR. & |
---|
[108] | 1636 | rayleigh_damping_height < zu(nzb) ) THEN |
---|
[1788] | 1637 | WRITE( message_string, * ) 'rayleigh_damping_height = ', & |
---|
[215] | 1638 | rayleigh_damping_height, ' out of range [0.0,', zu(nzb), ']' |
---|
[226] | 1639 | CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) |
---|
[108] | 1640 | ENDIF |
---|
[1] | 1641 | ENDIF |
---|
| 1642 | ENDIF |
---|
| 1643 | |
---|
| 1644 | ! |
---|
[2039] | 1645 | !-- Check number of chosen statistic regions |
---|
| 1646 | IF ( statistic_regions < 0 ) THEN |
---|
[1788] | 1647 | WRITE ( message_string, * ) 'number of statistic_regions = ', & |
---|
[2039] | 1648 | statistic_regions+1, ' is not allowed' |
---|
[226] | 1649 | CALL message( 'check_parameters', 'PA0082', 1, 2, 0, 6, 0 ) |
---|
[1] | 1650 | ENDIF |
---|
[1788] | 1651 | IF ( normalizing_region > statistic_regions .OR. & |
---|
[1] | 1652 | normalizing_region < 0) THEN |
---|
[1788] | 1653 | WRITE ( message_string, * ) 'normalizing_region = ', & |
---|
[215] | 1654 | normalizing_region, ' must be >= 0 and <= ',statistic_regions, & |
---|
| 1655 | ' (value of statistic_regions)' |
---|
[226] | 1656 | CALL message( 'check_parameters', 'PA0083', 1, 2, 0, 6, 0 ) |
---|
[1] | 1657 | ENDIF |
---|
| 1658 | |
---|
| 1659 | ! |
---|
| 1660 | !-- Set the default intervals for data output, if necessary |
---|
[1833] | 1661 | !-- NOTE: dt_dosp has already been set in spectra_parin |
---|
[1322] | 1662 | IF ( dt_data_output /= 9999999.9_wp ) THEN |
---|
| 1663 | IF ( dt_dopr == 9999999.9_wp ) dt_dopr = dt_data_output |
---|
| 1664 | IF ( dt_dopts == 9999999.9_wp ) dt_dopts = dt_data_output |
---|
| 1665 | IF ( dt_do2d_xy == 9999999.9_wp ) dt_do2d_xy = dt_data_output |
---|
| 1666 | IF ( dt_do2d_xz == 9999999.9_wp ) dt_do2d_xz = dt_data_output |
---|
| 1667 | IF ( dt_do2d_yz == 9999999.9_wp ) dt_do2d_yz = dt_data_output |
---|
| 1668 | IF ( dt_do3d == 9999999.9_wp ) dt_do3d = dt_data_output |
---|
| 1669 | IF ( dt_data_output_av == 9999999.9_wp ) dt_data_output_av = dt_data_output |
---|
[564] | 1670 | DO mid = 1, max_masks |
---|
[1322] | 1671 | IF ( dt_domask(mid) == 9999999.9_wp ) dt_domask(mid) = dt_data_output |
---|
[410] | 1672 | ENDDO |
---|
[1] | 1673 | ENDIF |
---|
| 1674 | |
---|
| 1675 | ! |
---|
| 1676 | !-- Set the default skip time intervals for data output, if necessary |
---|
[1788] | 1677 | IF ( skip_time_dopr == 9999999.9_wp ) & |
---|
[1] | 1678 | skip_time_dopr = skip_time_data_output |
---|
[1788] | 1679 | IF ( skip_time_do2d_xy == 9999999.9_wp ) & |
---|
[1] | 1680 | skip_time_do2d_xy = skip_time_data_output |
---|
[1788] | 1681 | IF ( skip_time_do2d_xz == 9999999.9_wp ) & |
---|
[1] | 1682 | skip_time_do2d_xz = skip_time_data_output |
---|
[1788] | 1683 | IF ( skip_time_do2d_yz == 9999999.9_wp ) & |
---|
[1] | 1684 | skip_time_do2d_yz = skip_time_data_output |
---|
[1788] | 1685 | IF ( skip_time_do3d == 9999999.9_wp ) & |
---|
[1] | 1686 | skip_time_do3d = skip_time_data_output |
---|
[1788] | 1687 | IF ( skip_time_data_output_av == 9999999.9_wp ) & |
---|
[1] | 1688 | skip_time_data_output_av = skip_time_data_output |
---|
[564] | 1689 | DO mid = 1, max_masks |
---|
[1788] | 1690 | IF ( skip_time_domask(mid) == 9999999.9_wp ) & |
---|
[410] | 1691 | skip_time_domask(mid) = skip_time_data_output |
---|
| 1692 | ENDDO |
---|
[1] | 1693 | |
---|
| 1694 | ! |
---|
[1833] | 1695 | !-- Check the average intervals (first for 3d-data, then for profiles) |
---|
[1] | 1696 | IF ( averaging_interval > dt_data_output_av ) THEN |
---|
[1788] | 1697 | WRITE( message_string, * ) 'averaging_interval = ', & |
---|
[3045] | 1698 | averaging_interval, ' must be <= dt_data_output_av = ', & |
---|
| 1699 | dt_data_output_av |
---|
[226] | 1700 | CALL message( 'check_parameters', 'PA0085', 1, 2, 0, 6, 0 ) |
---|
[1] | 1701 | ENDIF |
---|
| 1702 | |
---|
[1322] | 1703 | IF ( averaging_interval_pr == 9999999.9_wp ) THEN |
---|
[1] | 1704 | averaging_interval_pr = averaging_interval |
---|
| 1705 | ENDIF |
---|
| 1706 | |
---|
| 1707 | IF ( averaging_interval_pr > dt_dopr ) THEN |
---|
[1788] | 1708 | WRITE( message_string, * ) 'averaging_interval_pr = ', & |
---|
[215] | 1709 | averaging_interval_pr, ' must be <= dt_dopr = ', dt_dopr |
---|
[226] | 1710 | CALL message( 'check_parameters', 'PA0086', 1, 2, 0, 6, 0 ) |
---|
[1] | 1711 | ENDIF |
---|
| 1712 | |
---|
| 1713 | ! |
---|
| 1714 | !-- Set the default interval for profiles entering the temporal average |
---|
[1322] | 1715 | IF ( dt_averaging_input_pr == 9999999.9_wp ) THEN |
---|
[1] | 1716 | dt_averaging_input_pr = dt_averaging_input |
---|
| 1717 | ENDIF |
---|
| 1718 | |
---|
| 1719 | ! |
---|
| 1720 | !-- Set the default interval for the output of timeseries to a reasonable |
---|
| 1721 | !-- value (tries to minimize the number of calls of flow_statistics) |
---|
[1322] | 1722 | IF ( dt_dots == 9999999.9_wp ) THEN |
---|
[1353] | 1723 | IF ( averaging_interval_pr == 0.0_wp ) THEN |
---|
[1] | 1724 | dt_dots = MIN( dt_run_control, dt_dopr ) |
---|
| 1725 | ELSE |
---|
| 1726 | dt_dots = MIN( dt_run_control, dt_averaging_input_pr ) |
---|
| 1727 | ENDIF |
---|
| 1728 | ENDIF |
---|
| 1729 | |
---|
| 1730 | ! |
---|
| 1731 | !-- Check the sample rate for averaging (first for 3d-data, then for profiles) |
---|
| 1732 | IF ( dt_averaging_input > averaging_interval ) THEN |
---|
[1788] | 1733 | WRITE( message_string, * ) 'dt_averaging_input = ', & |
---|
| 1734 | dt_averaging_input, ' must be <= averaging_interval = ', & |
---|
[215] | 1735 | averaging_interval |
---|
[226] | 1736 | CALL message( 'check_parameters', 'PA0088', 1, 2, 0, 6, 0 ) |
---|
[1] | 1737 | ENDIF |
---|
| 1738 | |
---|
| 1739 | IF ( dt_averaging_input_pr > averaging_interval_pr ) THEN |
---|
[1788] | 1740 | WRITE( message_string, * ) 'dt_averaging_input_pr = ', & |
---|
[215] | 1741 | dt_averaging_input_pr, ' must be <= averaging_interval_pr = ', & |
---|
| 1742 | averaging_interval_pr |
---|
[226] | 1743 | CALL message( 'check_parameters', 'PA0089', 1, 2, 0, 6, 0 ) |
---|
[1] | 1744 | ENDIF |
---|
| 1745 | |
---|
| 1746 | ! |
---|
| 1747 | !-- Determine the number of output profiles and check whether they are |
---|
| 1748 | !-- permissible |
---|
| 1749 | DO WHILE ( data_output_pr(dopr_n+1) /= ' ' ) |
---|
| 1750 | |
---|
| 1751 | dopr_n = dopr_n + 1 |
---|
| 1752 | i = dopr_n |
---|
| 1753 | |
---|
| 1754 | ! |
---|
| 1755 | !-- Determine internal profile number (for hom, homs) |
---|
| 1756 | !-- and store height levels |
---|
| 1757 | SELECT CASE ( TRIM( data_output_pr(i) ) ) |
---|
| 1758 | |
---|
| 1759 | CASE ( 'u', '#u' ) |
---|
| 1760 | dopr_index(i) = 1 |
---|
[87] | 1761 | dopr_unit(i) = 'm/s' |
---|
[1] | 1762 | hom(:,2,1,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1763 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1764 | dopr_initial_index(i) = 5 |
---|
| 1765 | hom(:,2,5,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1766 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1767 | ENDIF |
---|
| 1768 | |
---|
| 1769 | CASE ( 'v', '#v' ) |
---|
| 1770 | dopr_index(i) = 2 |
---|
[87] | 1771 | dopr_unit(i) = 'm/s' |
---|
| 1772 | hom(:,2,2,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 1773 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1774 | dopr_initial_index(i) = 6 |
---|
| 1775 | hom(:,2,6,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1776 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1777 | ENDIF |
---|
| 1778 | |
---|
| 1779 | CASE ( 'w' ) |
---|
| 1780 | dopr_index(i) = 3 |
---|
[87] | 1781 | dopr_unit(i) = 'm/s' |
---|
| 1782 | hom(:,2,3,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 1783 | |
---|
[3421] | 1784 | CASE ( 'theta', '#theta' ) |
---|
[3274] | 1785 | IF ( .NOT. bulk_cloud_model ) THEN |
---|
[1] | 1786 | dopr_index(i) = 4 |
---|
[87] | 1787 | dopr_unit(i) = 'K' |
---|
[1] | 1788 | hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1789 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1790 | dopr_initial_index(i) = 7 |
---|
| 1791 | hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1792 | hom(nzb,2,7,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 1793 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1794 | ENDIF |
---|
| 1795 | ELSE |
---|
| 1796 | dopr_index(i) = 43 |
---|
[87] | 1797 | dopr_unit(i) = 'K' |
---|
[1] | 1798 | hom(:,2,43,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1799 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1800 | dopr_initial_index(i) = 28 |
---|
| 1801 | hom(:,2,28,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1802 | hom(nzb,2,28,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 1803 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1804 | ENDIF |
---|
| 1805 | ENDIF |
---|
| 1806 | |
---|
[3083] | 1807 | CASE ( 'e', '#e' ) |
---|
[1] | 1808 | dopr_index(i) = 8 |
---|
[87] | 1809 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 1810 | hom(:,2,8,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1811 | hom(nzb,2,8,:) = 0.0_wp |
---|
[3083] | 1812 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1813 | dopr_initial_index(i) = 8 |
---|
| 1814 | hom(:,2,8,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1815 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1816 | ENDIF |
---|
[1] | 1817 | |
---|
| 1818 | CASE ( 'km', '#km' ) |
---|
| 1819 | dopr_index(i) = 9 |
---|
[87] | 1820 | dopr_unit(i) = 'm2/s' |
---|
[1] | 1821 | hom(:,2,9,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1822 | hom(nzb,2,9,:) = 0.0_wp |
---|
[1] | 1823 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1824 | dopr_initial_index(i) = 23 |
---|
| 1825 | hom(:,2,23,:) = hom(:,2,9,:) |
---|
| 1826 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1827 | ENDIF |
---|
| 1828 | |
---|
| 1829 | CASE ( 'kh', '#kh' ) |
---|
| 1830 | dopr_index(i) = 10 |
---|
[87] | 1831 | dopr_unit(i) = 'm2/s' |
---|
[1] | 1832 | hom(:,2,10,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1833 | hom(nzb,2,10,:) = 0.0_wp |
---|
[1] | 1834 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1835 | dopr_initial_index(i) = 24 |
---|
| 1836 | hom(:,2,24,:) = hom(:,2,10,:) |
---|
| 1837 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1838 | ENDIF |
---|
| 1839 | |
---|
| 1840 | CASE ( 'l', '#l' ) |
---|
| 1841 | dopr_index(i) = 11 |
---|
[87] | 1842 | dopr_unit(i) = 'm' |
---|
[1] | 1843 | hom(:,2,11,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1844 | hom(nzb,2,11,:) = 0.0_wp |
---|
[1] | 1845 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1846 | dopr_initial_index(i) = 25 |
---|
| 1847 | hom(:,2,25,:) = hom(:,2,11,:) |
---|
| 1848 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1849 | ENDIF |
---|
| 1850 | |
---|
| 1851 | CASE ( 'w"u"' ) |
---|
| 1852 | dopr_index(i) = 12 |
---|
[2037] | 1853 | dopr_unit(i) = TRIM ( momentumflux_output_unit ) |
---|
[1] | 1854 | hom(:,2,12,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1691] | 1855 | IF ( constant_flux_layer ) hom(nzb,2,12,:) = zu(1) |
---|
[1] | 1856 | |
---|
| 1857 | CASE ( 'w*u*' ) |
---|
| 1858 | dopr_index(i) = 13 |
---|
[2037] | 1859 | dopr_unit(i) = TRIM ( momentumflux_output_unit ) |
---|
[1] | 1860 | hom(:,2,13,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1861 | |
---|
| 1862 | CASE ( 'w"v"' ) |
---|
| 1863 | dopr_index(i) = 14 |
---|
[2037] | 1864 | dopr_unit(i) = TRIM ( momentumflux_output_unit ) |
---|
[1] | 1865 | hom(:,2,14,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1691] | 1866 | IF ( constant_flux_layer ) hom(nzb,2,14,:) = zu(1) |
---|
[1] | 1867 | |
---|
| 1868 | CASE ( 'w*v*' ) |
---|
| 1869 | dopr_index(i) = 15 |
---|
[2037] | 1870 | dopr_unit(i) = TRIM ( momentumflux_output_unit ) |
---|
[1] | 1871 | hom(:,2,15,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1872 | |
---|
[3421] | 1873 | CASE ( 'w"theta"' ) |
---|
[1] | 1874 | dopr_index(i) = 16 |
---|
[2037] | 1875 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 1876 | hom(:,2,16,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1877 | |
---|
[3421] | 1878 | CASE ( 'w*theta*' ) |
---|
[1] | 1879 | dopr_index(i) = 17 |
---|
[2037] | 1880 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 1881 | hom(:,2,17,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1882 | |
---|
[3421] | 1883 | CASE ( 'wtheta' ) |
---|
[1] | 1884 | dopr_index(i) = 18 |
---|
[2037] | 1885 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 1886 | hom(:,2,18,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1887 | |
---|
| 1888 | CASE ( 'wu' ) |
---|
| 1889 | dopr_index(i) = 19 |
---|
[2037] | 1890 | dopr_unit(i) = TRIM ( momentumflux_output_unit ) |
---|
[1] | 1891 | hom(:,2,19,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1691] | 1892 | IF ( constant_flux_layer ) hom(nzb,2,19,:) = zu(1) |
---|
[1] | 1893 | |
---|
| 1894 | CASE ( 'wv' ) |
---|
| 1895 | dopr_index(i) = 20 |
---|
[2037] | 1896 | dopr_unit(i) = TRIM ( momentumflux_output_unit ) |
---|
[1] | 1897 | hom(:,2,20,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1691] | 1898 | IF ( constant_flux_layer ) hom(nzb,2,20,:) = zu(1) |
---|
[1] | 1899 | |
---|
[3421] | 1900 | CASE ( 'w*theta*BC' ) |
---|
[1] | 1901 | dopr_index(i) = 21 |
---|
[2037] | 1902 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 1903 | hom(:,2,21,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1904 | |
---|
[3421] | 1905 | CASE ( 'wthetaBC' ) |
---|
[1] | 1906 | dopr_index(i) = 22 |
---|
[2037] | 1907 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 1908 | hom(:,2,22,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1909 | |
---|
| 1910 | CASE ( 'u*2' ) |
---|
| 1911 | dopr_index(i) = 30 |
---|
[87] | 1912 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 1913 | hom(:,2,30,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1914 | |
---|
| 1915 | CASE ( 'v*2' ) |
---|
| 1916 | dopr_index(i) = 31 |
---|
[87] | 1917 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 1918 | hom(:,2,31,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1919 | |
---|
| 1920 | CASE ( 'w*2' ) |
---|
| 1921 | dopr_index(i) = 32 |
---|
[87] | 1922 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 1923 | hom(:,2,32,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1924 | |
---|
[3421] | 1925 | CASE ( 'theta*2' ) |
---|
[1] | 1926 | dopr_index(i) = 33 |
---|
[87] | 1927 | dopr_unit(i) = 'K2' |
---|
[1] | 1928 | hom(:,2,33,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1929 | |
---|
| 1930 | CASE ( 'e*' ) |
---|
| 1931 | dopr_index(i) = 34 |
---|
[87] | 1932 | dopr_unit(i) = 'm2/s2' |
---|
[1] | 1933 | hom(:,2,34,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1934 | |
---|
[3517] | 1935 | CASE ( 'w*2theta*' ) |
---|
[1] | 1936 | dopr_index(i) = 35 |
---|
[87] | 1937 | dopr_unit(i) = 'K m2/s2' |
---|
[1] | 1938 | hom(:,2,35,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1939 | |
---|
[3517] | 1940 | CASE ( 'w*theta*2' ) |
---|
[1] | 1941 | dopr_index(i) = 36 |
---|
[87] | 1942 | dopr_unit(i) = 'K2 m/s' |
---|
[1] | 1943 | hom(:,2,36,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1944 | |
---|
| 1945 | CASE ( 'w*e*' ) |
---|
| 1946 | dopr_index(i) = 37 |
---|
[87] | 1947 | dopr_unit(i) = 'm3/s3' |
---|
[1] | 1948 | hom(:,2,37,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1949 | |
---|
| 1950 | CASE ( 'w*3' ) |
---|
| 1951 | dopr_index(i) = 38 |
---|
[87] | 1952 | dopr_unit(i) = 'm3/s3' |
---|
[1] | 1953 | hom(:,2,38,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1954 | |
---|
| 1955 | CASE ( 'Sw' ) |
---|
| 1956 | dopr_index(i) = 39 |
---|
[89] | 1957 | dopr_unit(i) = 'none' |
---|
[1] | 1958 | hom(:,2,39,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 1959 | |
---|
[232] | 1960 | CASE ( 'p' ) |
---|
| 1961 | dopr_index(i) = 40 |
---|
| 1962 | dopr_unit(i) = 'Pa' |
---|
| 1963 | hom(:,2,40,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1964 | |
---|
[1] | 1965 | CASE ( 'q', '#q' ) |
---|
[108] | 1966 | IF ( .NOT. humidity ) THEN |
---|
[3045] | 1967 | message_string = 'data_output_pr = ' // & |
---|
[215] | 1968 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 1969 | 'lemented for humidity = .FALSE.' |
---|
[226] | 1970 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 1971 | ELSE |
---|
| 1972 | dopr_index(i) = 41 |
---|
[87] | 1973 | dopr_unit(i) = 'kg/kg' |
---|
| 1974 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 1975 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 1976 | dopr_initial_index(i) = 26 |
---|
| 1977 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 1978 | hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 1979 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1980 | ENDIF |
---|
| 1981 | ENDIF |
---|
| 1982 | |
---|
| 1983 | CASE ( 's', '#s' ) |
---|
| 1984 | IF ( .NOT. passive_scalar ) THEN |
---|
[1788] | 1985 | message_string = 'data_output_pr = ' // & |
---|
[215] | 1986 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 1987 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 1988 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 1989 | ELSE |
---|
[2513] | 1990 | dopr_index(i) = 115 |
---|
[87] | 1991 | dopr_unit(i) = 'kg/m3' |
---|
[2513] | 1992 | hom(:,2,115,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 1993 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
[2513] | 1994 | dopr_initial_index(i) = 121 |
---|
| 1995 | hom(:,2,121,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 1996 | hom(nzb,2,121,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 1997 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 1998 | ENDIF |
---|
| 1999 | ENDIF |
---|
| 2000 | |
---|
| 2001 | CASE ( 'qv', '#qv' ) |
---|
[3274] | 2002 | IF ( .NOT. bulk_cloud_model ) THEN |
---|
[1] | 2003 | dopr_index(i) = 41 |
---|
[87] | 2004 | dopr_unit(i) = 'kg/kg' |
---|
| 2005 | hom(:,2,41,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2006 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2007 | dopr_initial_index(i) = 26 |
---|
| 2008 | hom(:,2,26,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 2009 | hom(nzb,2,26,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 2010 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2011 | ENDIF |
---|
| 2012 | ELSE |
---|
| 2013 | dopr_index(i) = 42 |
---|
[87] | 2014 | dopr_unit(i) = 'kg/kg' |
---|
| 2015 | hom(:,2,42,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2016 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2017 | dopr_initial_index(i) = 27 |
---|
| 2018 | hom(:,2,27,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 2019 | hom(nzb,2,27,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 2020 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2021 | ENDIF |
---|
| 2022 | ENDIF |
---|
| 2023 | |
---|
[3421] | 2024 | CASE ( 'thetal', '#thetal' ) |
---|
[3274] | 2025 | IF ( .NOT. bulk_cloud_model ) THEN |
---|
[1788] | 2026 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2027 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
[3274] | 2028 | 'lemented for bulk_cloud_model = .FALSE.' |
---|
[226] | 2029 | CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) |
---|
[1] | 2030 | ELSE |
---|
| 2031 | dopr_index(i) = 4 |
---|
[87] | 2032 | dopr_unit(i) = 'K' |
---|
[1] | 2033 | hom(:,2,4,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2034 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2035 | dopr_initial_index(i) = 7 |
---|
| 2036 | hom(:,2,7,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 2037 | hom(nzb,2,7,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 2038 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2039 | ENDIF |
---|
| 2040 | ENDIF |
---|
| 2041 | |
---|
[3421] | 2042 | CASE ( 'thetav', '#thetav' ) |
---|
[1] | 2043 | dopr_index(i) = 44 |
---|
[87] | 2044 | dopr_unit(i) = 'K' |
---|
| 2045 | hom(:,2,44,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1] | 2046 | IF ( data_output_pr(i)(1:1) == '#' ) THEN |
---|
| 2047 | dopr_initial_index(i) = 29 |
---|
| 2048 | hom(:,2,29,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[1353] | 2049 | hom(nzb,2,29,:) = 0.0_wp ! because zu(nzb) is negative |
---|
[1] | 2050 | data_output_pr(i) = data_output_pr(i)(2:) |
---|
| 2051 | ENDIF |
---|
| 2052 | |
---|
[3421] | 2053 | CASE ( 'w"thetav"' ) |
---|
[1] | 2054 | dopr_index(i) = 45 |
---|
[2037] | 2055 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2056 | hom(:,2,45,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2057 | |
---|
[3421] | 2058 | CASE ( 'w*thetav*' ) |
---|
[1] | 2059 | dopr_index(i) = 46 |
---|
[2037] | 2060 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2061 | hom(:,2,46,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2062 | |
---|
[3421] | 2063 | CASE ( 'wthetav' ) |
---|
[1] | 2064 | dopr_index(i) = 47 |
---|
[2037] | 2065 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2066 | hom(:,2,47,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2067 | |
---|
| 2068 | CASE ( 'w"q"' ) |
---|
[1788] | 2069 | IF ( .NOT. humidity ) THEN |
---|
| 2070 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2071 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2072 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2073 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2074 | ELSE |
---|
| 2075 | dopr_index(i) = 48 |
---|
[2037] | 2076 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2077 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2078 | ENDIF |
---|
| 2079 | |
---|
| 2080 | CASE ( 'w*q*' ) |
---|
[1788] | 2081 | IF ( .NOT. humidity ) THEN |
---|
| 2082 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2083 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2084 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2085 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2086 | ELSE |
---|
| 2087 | dopr_index(i) = 49 |
---|
[2037] | 2088 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2089 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2090 | ENDIF |
---|
| 2091 | |
---|
| 2092 | CASE ( 'wq' ) |
---|
[1788] | 2093 | IF ( .NOT. humidity ) THEN |
---|
| 2094 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2095 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2096 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2097 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[1] | 2098 | ELSE |
---|
| 2099 | dopr_index(i) = 50 |
---|
[2037] | 2100 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2101 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2102 | ENDIF |
---|
| 2103 | |
---|
| 2104 | CASE ( 'w"s"' ) |
---|
[1788] | 2105 | IF ( .NOT. passive_scalar ) THEN |
---|
| 2106 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2107 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2108 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2109 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2110 | ELSE |
---|
[2513] | 2111 | dopr_index(i) = 117 |
---|
[87] | 2112 | dopr_unit(i) = 'kg/m3 m/s' |
---|
[2513] | 2113 | hom(:,2,117,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 2114 | ENDIF |
---|
| 2115 | |
---|
| 2116 | CASE ( 'w*s*' ) |
---|
[1788] | 2117 | IF ( .NOT. passive_scalar ) THEN |
---|
| 2118 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2119 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2120 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2121 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2122 | ELSE |
---|
[2513] | 2123 | dopr_index(i) = 114 |
---|
[87] | 2124 | dopr_unit(i) = 'kg/m3 m/s' |
---|
[2513] | 2125 | hom(:,2,114,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 2126 | ENDIF |
---|
| 2127 | |
---|
| 2128 | CASE ( 'ws' ) |
---|
[1788] | 2129 | IF ( .NOT. passive_scalar ) THEN |
---|
| 2130 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2131 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2132 | 'lemented for passive_scalar = .FALSE.' |
---|
[226] | 2133 | CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) |
---|
[1] | 2134 | ELSE |
---|
[2513] | 2135 | dopr_index(i) = 118 |
---|
[87] | 2136 | dopr_unit(i) = 'kg/m3 m/s' |
---|
[2513] | 2137 | hom(:,2,118,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 2138 | ENDIF |
---|
| 2139 | |
---|
| 2140 | CASE ( 'w"qv"' ) |
---|
[3274] | 2141 | IF ( humidity .AND. .NOT. bulk_cloud_model ) THEN |
---|
[1] | 2142 | dopr_index(i) = 48 |
---|
[2037] | 2143 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2144 | hom(:,2,48,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[3274] | 2145 | ELSEIF ( humidity .AND. bulk_cloud_model ) THEN |
---|
[1] | 2146 | dopr_index(i) = 51 |
---|
[2037] | 2147 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2148 | hom(:,2,51,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2149 | ELSE |
---|
[1788] | 2150 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2151 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
[3274] | 2152 | 'lemented for bulk_cloud_model = .FALSE. ' // & |
---|
| 2153 | 'and humidity = .FALSE.' |
---|
[226] | 2154 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
[1] | 2155 | ENDIF |
---|
| 2156 | |
---|
| 2157 | CASE ( 'w*qv*' ) |
---|
[3274] | 2158 | IF ( humidity .AND. .NOT. bulk_cloud_model ) THEN |
---|
[1] | 2159 | dopr_index(i) = 49 |
---|
[2037] | 2160 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2161 | hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[3274] | 2162 | ELSEIF( humidity .AND. bulk_cloud_model ) THEN |
---|
[1] | 2163 | dopr_index(i) = 52 |
---|
[2037] | 2164 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2165 | hom(:,2,52,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2166 | ELSE |
---|
[1788] | 2167 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2168 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
[3274] | 2169 | 'lemented for bulk_cloud_model = .FALSE. ' // & |
---|
| 2170 | 'and humidity = .FALSE.' |
---|
[226] | 2171 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
[1] | 2172 | ENDIF |
---|
| 2173 | |
---|
| 2174 | CASE ( 'wqv' ) |
---|
[3274] | 2175 | IF ( humidity .AND. .NOT. bulk_cloud_model ) THEN |
---|
[1] | 2176 | dopr_index(i) = 50 |
---|
[2037] | 2177 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2178 | hom(:,2,50,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[3274] | 2179 | ELSEIF ( humidity .AND. bulk_cloud_model ) THEN |
---|
[1] | 2180 | dopr_index(i) = 53 |
---|
[2037] | 2181 | dopr_unit(i) = TRIM ( waterflux_output_unit ) |
---|
[1] | 2182 | hom(:,2,53,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
| 2183 | ELSE |
---|
[1425] | 2184 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2185 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
[3274] | 2186 | 'lemented for bulk_cloud_model = .FALSE. ' // & |
---|
| 2187 | 'and humidity = .FALSE.' |
---|
[226] | 2188 | CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) |
---|
[1] | 2189 | ENDIF |
---|
| 2190 | |
---|
| 2191 | CASE ( 'ql' ) |
---|
[3274] | 2192 | IF ( .NOT. bulk_cloud_model .AND. .NOT. cloud_droplets ) THEN |
---|
[1425] | 2193 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2194 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
[3274] | 2195 | 'lemented for bulk_cloud_model = .FALSE. ' // & |
---|
| 2196 | 'and cloud_droplets = .FALSE.' |
---|
[226] | 2197 | CALL message( 'check_parameters', 'PA0096', 1, 2, 0, 6, 0 ) |
---|
[1] | 2198 | ELSE |
---|
| 2199 | dopr_index(i) = 54 |
---|
[87] | 2200 | dopr_unit(i) = 'kg/kg' |
---|
[1] | 2201 | hom(:,2,54,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2202 | ENDIF |
---|
| 2203 | |
---|
[524] | 2204 | CASE ( 'w*u*u*:dz' ) |
---|
[1] | 2205 | dopr_index(i) = 55 |
---|
[87] | 2206 | dopr_unit(i) = 'm2/s3' |
---|
[1] | 2207 | hom(:,2,55,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2208 | |
---|
[524] | 2209 | CASE ( 'w*p*:dz' ) |
---|
[1] | 2210 | dopr_index(i) = 56 |
---|
[87] | 2211 | dopr_unit(i) = 'm2/s3' |
---|
[106] | 2212 | hom(:,2,56,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[1] | 2213 | |
---|
[524] | 2214 | CASE ( 'w"e:dz' ) |
---|
[1] | 2215 | dopr_index(i) = 57 |
---|
[87] | 2216 | dopr_unit(i) = 'm2/s3' |
---|
[1] | 2217 | hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2218 | |
---|
[3421] | 2219 | CASE ( 'u"theta"' ) |
---|
[1] | 2220 | dopr_index(i) = 58 |
---|
[2037] | 2221 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2222 | hom(:,2,58,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2223 | |
---|
[3421] | 2224 | CASE ( 'u*theta*' ) |
---|
[1] | 2225 | dopr_index(i) = 59 |
---|
[2037] | 2226 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2227 | hom(:,2,59,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2228 | |
---|
[3421] | 2229 | CASE ( 'utheta_t' ) |
---|
[1] | 2230 | dopr_index(i) = 60 |
---|
[2037] | 2231 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2232 | hom(:,2,60,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2233 | |
---|
[3421] | 2234 | CASE ( 'v"theta"' ) |
---|
[1] | 2235 | dopr_index(i) = 61 |
---|
[2037] | 2236 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2237 | hom(:,2,61,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[2312] | 2238 | |
---|
[3421] | 2239 | CASE ( 'v*theta*' ) |
---|
[1] | 2240 | dopr_index(i) = 62 |
---|
[2037] | 2241 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2242 | hom(:,2,62,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2243 | |
---|
[3702] | 2244 | CASE ( 'vtheta_t' ) |
---|
[1] | 2245 | dopr_index(i) = 63 |
---|
[2037] | 2246 | dopr_unit(i) = TRIM ( heatflux_output_unit ) |
---|
[1] | 2247 | hom(:,2,63,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2248 | |
---|
[106] | 2249 | CASE ( 'w*p*' ) |
---|
| 2250 | dopr_index(i) = 68 |
---|
| 2251 | dopr_unit(i) = 'm3/s3' |
---|
| 2252 | hom(:,2,68,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[96] | 2253 | |
---|
[106] | 2254 | CASE ( 'w"e' ) |
---|
| 2255 | dopr_index(i) = 69 |
---|
| 2256 | dopr_unit(i) = 'm3/s3' |
---|
| 2257 | hom(:,2,69,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2258 | |
---|
[197] | 2259 | CASE ( 'q*2' ) |
---|
[1788] | 2260 | IF ( .NOT. humidity ) THEN |
---|
[1425] | 2261 | message_string = 'data_output_pr = ' // & |
---|
[215] | 2262 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2263 | 'lemented for humidity = .FALSE.' |
---|
[226] | 2264 | CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) |
---|
[197] | 2265 | ELSE |
---|
| 2266 | dopr_index(i) = 70 |
---|
| 2267 | dopr_unit(i) = 'kg2/kg2' |
---|
| 2268 | hom(:,2,70,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2269 | ENDIF |
---|
[106] | 2270 | |
---|
[388] | 2271 | CASE ( 'hyp' ) |
---|
| 2272 | dopr_index(i) = 72 |
---|
[2037] | 2273 | dopr_unit(i) = 'hPa' |
---|
[388] | 2274 | hom(:,2,72,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2275 | |
---|
[3421] | 2276 | CASE ( 'rho' ) |
---|
[2329] | 2277 | dopr_index(i) = 119 |
---|
[2037] | 2278 | dopr_unit(i) = 'kg/m3' |
---|
[2329] | 2279 | hom(:,2,119,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[2037] | 2280 | |
---|
[3421] | 2281 | CASE ( 'rho_zw' ) |
---|
[2329] | 2282 | dopr_index(i) = 120 |
---|
[2037] | 2283 | dopr_unit(i) = 'kg/m3' |
---|
[2329] | 2284 | hom(:,2,120,:) = SPREAD( zw, 2, statistic_regions+1 ) |
---|
[2037] | 2285 | |
---|
[1241] | 2286 | CASE ( 'ug' ) |
---|
| 2287 | dopr_index(i) = 78 |
---|
| 2288 | dopr_unit(i) = 'm/s' |
---|
| 2289 | hom(:,2,78,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2290 | |
---|
| 2291 | CASE ( 'vg' ) |
---|
| 2292 | dopr_index(i) = 79 |
---|
| 2293 | dopr_unit(i) = 'm/s' |
---|
| 2294 | hom(:,2,79,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2295 | |
---|
[1299] | 2296 | CASE ( 'w_subs' ) |
---|
[1788] | 2297 | IF ( .NOT. large_scale_subsidence ) THEN |
---|
[1425] | 2298 | message_string = 'data_output_pr = ' // & |
---|
[1299] | 2299 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2300 | 'lemented for large_scale_subsidence = .FALSE.' |
---|
| 2301 | CALL message( 'check_parameters', 'PA0382', 1, 2, 0, 6, 0 ) |
---|
| 2302 | ELSE |
---|
| 2303 | dopr_index(i) = 80 |
---|
| 2304 | dopr_unit(i) = 'm/s' |
---|
| 2305 | hom(:,2,80,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2306 | ENDIF |
---|
| 2307 | |
---|
[2026] | 2308 | CASE ( 's*2' ) |
---|
| 2309 | IF ( .NOT. passive_scalar ) THEN |
---|
| 2310 | message_string = 'data_output_pr = ' // & |
---|
| 2311 | TRIM( data_output_pr(i) ) // ' is not imp' // & |
---|
| 2312 | 'lemented for passive_scalar = .FALSE.' |
---|
| 2313 | CALL message( 'check_parameters', 'PA0185', 1, 2, 0, 6, 0 ) |
---|
| 2314 | ELSE |
---|
[2513] | 2315 | dopr_index(i) = 116 |
---|
| 2316 | dopr_unit(i) = 'kg2/m6' |
---|
| 2317 | hom(:,2,116,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
[2026] | 2318 | ENDIF |
---|
| 2319 | |
---|
[4472] | 2320 | CASE ( 'eta' ) |
---|
| 2321 | dopr_index(i) = 121 |
---|
| 2322 | dopr_unit(i) = 'mm' |
---|
| 2323 | hom(:,2,121,:) = SPREAD( zu, 2, statistic_regions+1 ) |
---|
| 2324 | |
---|
| 2325 | kolmogorov_length_scale = .TRUE. |
---|
| 2326 | |
---|
[1] | 2327 | CASE DEFAULT |
---|
[3452] | 2328 | unit = 'illegal' |
---|
[3274] | 2329 | ! |
---|
[3294] | 2330 | !-- Check for other modules |
---|
[3637] | 2331 | CALL module_interface_check_data_output_pr( data_output_pr(i), i, & |
---|
| 2332 | unit, dopr_unit(i) ) |
---|
[87] | 2333 | |
---|
[2817] | 2334 | ! |
---|
[3294] | 2335 | !-- No valid quantity found |
---|
[1817] | 2336 | IF ( unit == 'illegal' ) THEN |
---|
[215] | 2337 | IF ( data_output_pr_user(1) /= ' ' ) THEN |
---|
[1425] | 2338 | message_string = 'illegal value for data_output_pr or ' // & |
---|
| 2339 | 'data_output_pr_user = "' // & |
---|
[215] | 2340 | TRIM( data_output_pr(i) ) // '"' |
---|
[226] | 2341 | CALL message( 'check_parameters', 'PA0097', 1, 2, 0, 6, 0 ) |
---|
[215] | 2342 | ELSE |
---|
[1425] | 2343 | message_string = 'illegal value for data_output_pr = "' // & |
---|
[215] | 2344 | TRIM( data_output_pr(i) ) // '"' |
---|
[226] | 2345 | CALL message( 'check_parameters', 'PA0098', 1, 2, 0, 6, 0 ) |
---|
[87] | 2346 | ENDIF |
---|
[1] | 2347 | ENDIF |
---|
| 2348 | |
---|
| 2349 | END SELECT |
---|
[667] | 2350 | |
---|
[1] | 2351 | ENDDO |
---|
| 2352 | |
---|
| 2353 | |
---|
| 2354 | ! |
---|
| 2355 | !-- Append user-defined data output variables to the standard data output |
---|
| 2356 | IF ( data_output_user(1) /= ' ' ) THEN |
---|
| 2357 | i = 1 |
---|
[2024] | 2358 | DO WHILE ( data_output(i) /= ' ' .AND. i <= 500 ) |
---|
[1] | 2359 | i = i + 1 |
---|
| 2360 | ENDDO |
---|
| 2361 | j = 1 |
---|
[2024] | 2362 | DO WHILE ( data_output_user(j) /= ' ' .AND. j <= 500 ) |
---|
| 2363 | IF ( i > 500 ) THEN |
---|
[215] | 2364 | message_string = 'number of output quantitities given by data' // & |
---|
[2024] | 2365 | '_output and data_output_user exceeds the limit of 500' |
---|
[226] | 2366 | CALL message( 'check_parameters', 'PA0102', 1, 2, 0, 6, 0 ) |
---|
[1] | 2367 | ENDIF |
---|
| 2368 | data_output(i) = data_output_user(j) |
---|
| 2369 | i = i + 1 |
---|
| 2370 | j = j + 1 |
---|
| 2371 | ENDDO |
---|
| 2372 | ENDIF |
---|
| 2373 | |
---|
| 2374 | ! |
---|
| 2375 | !-- Check and set steering parameters for 2d/3d data output and averaging |
---|
| 2376 | i = 1 |
---|
[2007] | 2377 | DO WHILE ( data_output(i) /= ' ' .AND. i <= 500 ) |
---|
[1] | 2378 | ! |
---|
| 2379 | !-- Check for data averaging |
---|
| 2380 | ilen = LEN_TRIM( data_output(i) ) |
---|
| 2381 | j = 0 ! no data averaging |
---|
| 2382 | IF ( ilen > 3 ) THEN |
---|
| 2383 | IF ( data_output(i)(ilen-2:ilen) == '_av' ) THEN |
---|
| 2384 | j = 1 ! data averaging |
---|
| 2385 | data_output(i) = data_output(i)(1:ilen-3) |
---|
| 2386 | ENDIF |
---|
| 2387 | ENDIF |
---|
| 2388 | ! |
---|
| 2389 | !-- Check for cross section or volume data |
---|
| 2390 | ilen = LEN_TRIM( data_output(i) ) |
---|
| 2391 | k = 0 ! 3d data |
---|
| 2392 | var = data_output(i)(1:ilen) |
---|
| 2393 | IF ( ilen > 3 ) THEN |
---|
[1425] | 2394 | IF ( data_output(i)(ilen-2:ilen) == '_xy' .OR. & |
---|
| 2395 | data_output(i)(ilen-2:ilen) == '_xz' .OR. & |
---|
[1] | 2396 | data_output(i)(ilen-2:ilen) == '_yz' ) THEN |
---|
| 2397 | k = 1 ! 2d data |
---|
| 2398 | var = data_output(i)(1:ilen-3) |
---|
| 2399 | ENDIF |
---|
| 2400 | ENDIF |
---|
[1551] | 2401 | |
---|
[1] | 2402 | ! |
---|
| 2403 | !-- Check for allowed value and set units |
---|
| 2404 | SELECT CASE ( TRIM( var ) ) |
---|
| 2405 | |
---|
| 2406 | CASE ( 'e' ) |
---|
| 2407 | IF ( constant_diffusion ) THEN |
---|
[1425] | 2408 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[215] | 2409 | 'res constant_diffusion = .FALSE.' |
---|
[226] | 2410 | CALL message( 'check_parameters', 'PA0103', 1, 2, 0, 6, 0 ) |
---|
[1] | 2411 | ENDIF |
---|
| 2412 | unit = 'm2/s2' |
---|
| 2413 | |
---|
[3421] | 2414 | CASE ( 'thetal' ) |
---|
[3274] | 2415 | IF ( .NOT. bulk_cloud_model ) THEN |
---|
[1425] | 2416 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[3274] | 2417 | 'res bulk_cloud_model = .TRUE.' |
---|
[773] | 2418 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
[771] | 2419 | ENDIF |
---|
| 2420 | unit = 'K' |
---|
| 2421 | |
---|
[1] | 2422 | CASE ( 'pc', 'pr' ) |
---|
[1788] | 2423 | IF ( .NOT. particle_advection ) THEN |
---|
[215] | 2424 | message_string = 'output of "' // TRIM( var ) // '" requir' // & |
---|
[3045] | 2425 | 'es a "particle_parameters"-NAMELIST in the parameter ' // & |
---|
| 2426 | 'file (PARIN)' |
---|
[226] | 2427 | CALL message( 'check_parameters', 'PA0104', 1, 2, 0, 6, 0 ) |
---|
[1] | 2428 | ENDIF |
---|
| 2429 | IF ( TRIM( var ) == 'pc' ) unit = 'number' |
---|
| 2430 | IF ( TRIM( var ) == 'pr' ) unit = 'm' |
---|
| 2431 | |
---|
[3421] | 2432 | CASE ( 'q', 'thetav' ) |
---|
[1788] | 2433 | IF ( .NOT. humidity ) THEN |
---|
[1425] | 2434 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[215] | 2435 | 'res humidity = .TRUE.' |
---|
[226] | 2436 | CALL message( 'check_parameters', 'PA0105', 1, 2, 0, 6, 0 ) |
---|
[1] | 2437 | ENDIF |
---|
| 2438 | IF ( TRIM( var ) == 'q' ) unit = 'kg/kg' |
---|
[3421] | 2439 | IF ( TRIM( var ) == 'thetav' ) unit = 'K' |
---|
[1] | 2440 | |
---|
| 2441 | CASE ( 'ql' ) |
---|
[3274] | 2442 | IF ( .NOT. ( bulk_cloud_model .OR. cloud_droplets ) ) THEN |
---|
[1425] | 2443 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[3274] | 2444 | 'res bulk_cloud_model = .TRUE. or cloud_droplets = .TRUE.' |
---|
[226] | 2445 | CALL message( 'check_parameters', 'PA0106', 1, 2, 0, 6, 0 ) |
---|
[1] | 2446 | ENDIF |
---|
| 2447 | unit = 'kg/kg' |
---|
| 2448 | |
---|
| 2449 | CASE ( 'ql_c', 'ql_v', 'ql_vp' ) |
---|
[1788] | 2450 | IF ( .NOT. cloud_droplets ) THEN |
---|
[1425] | 2451 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[215] | 2452 | 'res cloud_droplets = .TRUE.' |
---|
[226] | 2453 | CALL message( 'check_parameters', 'PA0107', 1, 2, 0, 6, 0 ) |
---|
[1] | 2454 | ENDIF |
---|
| 2455 | IF ( TRIM( var ) == 'ql_c' ) unit = 'kg/kg' |
---|
| 2456 | IF ( TRIM( var ) == 'ql_v' ) unit = 'm3' |
---|
| 2457 | IF ( TRIM( var ) == 'ql_vp' ) unit = 'none' |
---|
| 2458 | |
---|
| 2459 | CASE ( 'qv' ) |
---|
[3274] | 2460 | IF ( .NOT. bulk_cloud_model ) THEN |
---|
[1425] | 2461 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[3274] | 2462 | 'res bulk_cloud_model = .TRUE.' |
---|
[226] | 2463 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
[1] | 2464 | ENDIF |
---|
| 2465 | unit = 'kg/kg' |
---|
| 2466 | |
---|
| 2467 | CASE ( 's' ) |
---|
[1788] | 2468 | IF ( .NOT. passive_scalar ) THEN |
---|
[1425] | 2469 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[215] | 2470 | 'res passive_scalar = .TRUE.' |
---|
[226] | 2471 | CALL message( 'check_parameters', 'PA0110', 1, 2, 0, 6, 0 ) |
---|
[1] | 2472 | ENDIF |
---|
[2513] | 2473 | unit = 'kg/m3' |
---|
[1] | 2474 | |
---|
[3421] | 2475 | CASE ( 'p', 'theta', 'u', 'v', 'w' ) |
---|
[1817] | 2476 | IF ( TRIM( var ) == 'p' ) unit = 'Pa' |
---|
[3421] | 2477 | IF ( TRIM( var ) == 'theta' ) unit = 'K' |
---|
[1817] | 2478 | IF ( TRIM( var ) == 'u' ) unit = 'm/s' |
---|
| 2479 | IF ( TRIM( var ) == 'v' ) unit = 'm/s' |
---|
| 2480 | IF ( TRIM( var ) == 'w' ) unit = 'm/s' |
---|
| 2481 | CONTINUE |
---|
[1551] | 2482 | |
---|
[3933] | 2483 | CASE ( 'ghf*', 'lwp*', 'ol*', 'qsws*', 'r_a*', & |
---|
[4331] | 2484 | 'shf*', 'ssws*', 't*', 'tsurf*', 'us*', & |
---|
[3933] | 2485 | 'z0*', 'z0h*', 'z0q*' ) |
---|
[1] | 2486 | IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN |
---|
[1425] | 2487 | message_string = 'illegal value for data_output: "' // & |
---|
[3046] | 2488 | TRIM( var ) // '" & only 2d-horizontal ' // & |
---|
[215] | 2489 | 'cross sections are allowed for this value' |
---|
[226] | 2490 | CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 ) |
---|
[1] | 2491 | ENDIF |
---|
[1826] | 2492 | |
---|
[3274] | 2493 | IF ( TRIM( var ) == 'lwp*' .AND. .NOT. bulk_cloud_model ) THEN |
---|
[1425] | 2494 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[3274] | 2495 | 'res bulk_cloud_model = .TRUE.' |
---|
[226] | 2496 | CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) |
---|
[1] | 2497 | ENDIF |
---|
[1788] | 2498 | IF ( TRIM( var ) == 'qsws*' .AND. .NOT. humidity ) THEN |
---|
[1425] | 2499 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
[354] | 2500 | 'res humidity = .TRUE.' |
---|
| 2501 | CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 ) |
---|
| 2502 | ENDIF |
---|
[2797] | 2503 | |
---|
[3045] | 2504 | IF ( TRIM( var ) == 'ghf*' .AND. .NOT. land_surface ) THEN |
---|
| 2505 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2506 | 'res land_surface = .TRUE.' |
---|
| 2507 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
| 2508 | ENDIF |
---|
[2797] | 2509 | |
---|
[2798] | 2510 | IF ( ( TRIM( var ) == 'r_a*' .OR. TRIM( var ) == 'ghf*' ) & |
---|
[4472] | 2511 | .AND. .NOT. land_surface .AND. .NOT. urban_surface ) & |
---|
[2735] | 2512 | THEN |
---|
| 2513 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2514 | 'res land_surface = .TRUE. or ' // & |
---|
| 2515 | 'urban_surface = .TRUE.' |
---|
| 2516 | CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) |
---|
| 2517 | ENDIF |
---|
[4472] | 2518 | |
---|
[2024] | 2519 | IF ( TRIM( var ) == 'ssws*' .AND. .NOT. passive_scalar ) THEN |
---|
| 2520 | message_string = 'output of "' // TRIM( var ) // '" requi' // & |
---|
| 2521 | 'res passive_scalar = .TRUE.' |
---|
| 2522 | CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) |
---|
[2312] | 2523 | ENDIF |
---|
[3597] | 2524 | |
---|
[2797] | 2525 | IF ( TRIM( var ) == 'ghf*' ) unit = 'W/m2' |
---|
[1691] | 2526 | IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/m2' |
---|
[2735] | 2527 | IF ( TRIM( var ) == 'ol*' ) unit = 'm' |
---|
[354] | 2528 | IF ( TRIM( var ) == 'qsws*' ) unit = 'kgm/kgs' |
---|
[3933] | 2529 | IF ( TRIM( var ) == 'r_a*' ) unit = 's/m' |
---|
[354] | 2530 | IF ( TRIM( var ) == 'shf*' ) unit = 'K*m/s' |
---|
[2312] | 2531 | IF ( TRIM( var ) == 'ssws*' ) unit = 'kg/m2*s' |
---|
[354] | 2532 | IF ( TRIM( var ) == 't*' ) unit = 'K' |
---|
[3933] | 2533 | IF ( TRIM( var ) == 'tsurf*' ) unit = 'K' |
---|
[3421] | 2534 | IF ( TRIM( var ) == 'us*' ) unit = 'm/s' |
---|
[354] | 2535 | IF ( TRIM( var ) == 'z0*' ) unit = 'm' |
---|
[2312] | 2536 | IF ( TRIM( var ) == 'z0h*' ) unit = 'm' |
---|
[2743] | 2537 | ! |
---|
[4472] | 2538 | !-- Output of surface latent and sensible heat flux will be in W/m2 |
---|
| 2539 | !-- in case of natural- and urban-type surfaces, even if |
---|
[2743] | 2540 | !-- flux_output_mode is set to kinematic units. |
---|
| 2541 | IF ( land_surface .OR. urban_surface ) THEN |
---|
| 2542 | IF ( TRIM( var ) == 'shf*' ) unit = 'W/m2' |
---|
| 2543 | IF ( TRIM( var ) == 'qsws*' ) unit = 'W/m2' |
---|
| 2544 | ENDIF |
---|
[2312] | 2545 | |
---|
[1] | 2546 | CASE DEFAULT |
---|
[3274] | 2547 | ! |
---|
[3294] | 2548 | !-- Check for other modules |
---|
[3735] | 2549 | CALL module_interface_check_data_output( var, unit, i, j, ilen, k ) |
---|
[3274] | 2550 | |
---|
[2696] | 2551 | IF ( unit == 'illegal' ) THEN |
---|
[215] | 2552 | IF ( data_output_user(1) /= ' ' ) THEN |
---|
[1425] | 2553 | message_string = 'illegal value for data_output or ' // & |
---|
[215] | 2554 | 'data_output_user = "' // TRIM( data_output(i) ) // '"' |
---|
[226] | 2555 | CALL message( 'check_parameters', 'PA0114', 1, 2, 0, 6, 0 ) |
---|
[215] | 2556 | ELSE |
---|
[1551] | 2557 | message_string = 'illegal value for data_output = "' // & |
---|
[215] | 2558 | TRIM( data_output(i) ) // '"' |
---|
[226] | 2559 | CALL message( 'check_parameters', 'PA0115', 1, 2, 0, 6, 0 ) |
---|
[1] | 2560 | ENDIF |
---|
| 2561 | ENDIF |
---|
| 2562 | |
---|
| 2563 | END SELECT |
---|
| 2564 | ! |
---|
| 2565 | !-- Set the internal steering parameters appropriately |
---|
| 2566 | IF ( k == 0 ) THEN |
---|
| 2567 | do3d_no(j) = do3d_no(j) + 1 |
---|
| 2568 | do3d(j,do3d_no(j)) = data_output(i) |
---|
| 2569 | do3d_unit(j,do3d_no(j)) = unit |
---|
| 2570 | ELSE |
---|
| 2571 | do2d_no(j) = do2d_no(j) + 1 |
---|
| 2572 | do2d(j,do2d_no(j)) = data_output(i) |
---|
| 2573 | do2d_unit(j,do2d_no(j)) = unit |
---|
| 2574 | IF ( data_output(i)(ilen-2:ilen) == '_xy' ) THEN |
---|
| 2575 | data_output_xy(j) = .TRUE. |
---|
| 2576 | ENDIF |
---|
| 2577 | IF ( data_output(i)(ilen-2:ilen) == '_xz' ) THEN |
---|
| 2578 | data_output_xz(j) = .TRUE. |
---|
| 2579 | ENDIF |
---|
| 2580 | IF ( data_output(i)(ilen-2:ilen) == '_yz' ) THEN |
---|
| 2581 | data_output_yz(j) = .TRUE. |
---|
| 2582 | ENDIF |
---|
| 2583 | ENDIF |
---|
| 2584 | |
---|
| 2585 | IF ( j == 1 ) THEN |
---|
| 2586 | ! |
---|
| 2587 | !-- Check, if variable is already subject to averaging |
---|
| 2588 | found = .FALSE. |
---|
| 2589 | DO k = 1, doav_n |
---|
| 2590 | IF ( TRIM( doav(k) ) == TRIM( var ) ) found = .TRUE. |
---|
| 2591 | ENDDO |
---|
| 2592 | |
---|
| 2593 | IF ( .NOT. found ) THEN |
---|
| 2594 | doav_n = doav_n + 1 |
---|
| 2595 | doav(doav_n) = var |
---|
| 2596 | ENDIF |
---|
| 2597 | ENDIF |
---|
| 2598 | |
---|
| 2599 | i = i + 1 |
---|
| 2600 | ENDDO |
---|
| 2601 | |
---|
| 2602 | ! |
---|
[376] | 2603 | !-- Averaged 2d or 3d output requires that an averaging interval has been set |
---|
[1353] | 2604 | IF ( doav_n > 0 .AND. averaging_interval == 0.0_wp ) THEN |
---|
[376] | 2605 | WRITE( message_string, * ) 'output of averaged quantity "', & |
---|
| 2606 | TRIM( doav(1) ), '_av" requires to set a ', & |
---|
[3045] | 2607 | 'non-zero averaging interval' |
---|
[376] | 2608 | CALL message( 'check_parameters', 'PA0323', 1, 2, 0, 6, 0 ) |
---|
| 2609 | ENDIF |
---|
| 2610 | |
---|
| 2611 | ! |
---|
[308] | 2612 | !-- Check sectional planes and store them in one shared array |
---|
| 2613 | IF ( ANY( section_xy > nz + 1 ) ) THEN |
---|
| 2614 | WRITE( message_string, * ) 'section_xy must be <= nz + 1 = ', nz + 1 |
---|
| 2615 | CALL message( 'check_parameters', 'PA0319', 1, 2, 0, 6, 0 ) |
---|
| 2616 | ENDIF |
---|
| 2617 | IF ( ANY( section_xz > ny + 1 ) ) THEN |
---|
| 2618 | WRITE( message_string, * ) 'section_xz must be <= ny + 1 = ', ny + 1 |
---|
| 2619 | CALL message( 'check_parameters', 'PA0320', 1, 2, 0, 6, 0 ) |
---|
| 2620 | ENDIF |
---|
| 2621 | IF ( ANY( section_yz > nx + 1 ) ) THEN |
---|
| 2622 | WRITE( message_string, * ) 'section_yz must be <= nx + 1 = ', nx + 1 |
---|
| 2623 | CALL message( 'check_parameters', 'PA0321', 1, 2, 0, 6, 0 ) |
---|
| 2624 | ENDIF |
---|
[1] | 2625 | section(:,1) = section_xy |
---|
| 2626 | section(:,2) = section_xz |
---|
| 2627 | section(:,3) = section_yz |
---|
| 2628 | |
---|
[4234] | 2629 | IF ( ANY( data_output_xy ) .AND. .NOT. ANY( section(:,1) /= -9999 ) ) THEN |
---|
| 2630 | WRITE( message_string, * ) 'section_xy not defined for requested ' // & |
---|
| 2631 | 'xy-cross section output.&At least one ' // & |
---|
| 2632 | 'cross section must be given.' |
---|
| 2633 | CALL message( 'check_parameters', 'PA0681', 1, 2, 0, 6, 0 ) |
---|
| 2634 | ENDIF |
---|
| 2635 | IF ( ANY( data_output_xz ) .AND. .NOT. ANY( section(:,2) /= -9999 ) ) THEN |
---|
| 2636 | WRITE( message_string, * ) 'section_xz not defined for requested ' // & |
---|
| 2637 | 'xz-cross section output.&At least one ' // & |
---|
| 2638 | 'cross section must be given.' |
---|
| 2639 | CALL message( 'check_parameters', 'PA0681', 1, 2, 0, 6, 0 ) |
---|
| 2640 | ENDIF |
---|
| 2641 | IF ( ANY( data_output_yz ) .AND. .NOT. ANY( section(:,3) /= -9999 ) ) THEN |
---|
| 2642 | WRITE( message_string, * ) 'section_yz not defined for requested ' // & |
---|
| 2643 | 'yz-cross section output.&At least one ' // & |
---|
| 2644 | 'cross section must be given.' |
---|
| 2645 | CALL message( 'check_parameters', 'PA0681', 1, 2, 0, 6, 0 ) |
---|
| 2646 | ENDIF |
---|
[1] | 2647 | ! |
---|
| 2648 | !-- Upper plot limit for 3D arrays |
---|
| 2649 | IF ( nz_do3d == -9999 ) nz_do3d = nzt + 1 |
---|
| 2650 | |
---|
| 2651 | ! |
---|
[1031] | 2652 | !-- Set output format string (used in header) |
---|
[1327] | 2653 | SELECT CASE ( netcdf_data_format ) |
---|
| 2654 | CASE ( 1 ) |
---|
[1783] | 2655 | netcdf_data_format_string = 'netCDF classic' |
---|
[1327] | 2656 | CASE ( 2 ) |
---|
[1783] | 2657 | netcdf_data_format_string = 'netCDF 64bit offset' |
---|
[1327] | 2658 | CASE ( 3 ) |
---|
[1783] | 2659 | netcdf_data_format_string = 'netCDF4/HDF5' |
---|
[1327] | 2660 | CASE ( 4 ) |
---|
[1783] | 2661 | netcdf_data_format_string = 'netCDF4/HDF5 classic' |
---|
[1327] | 2662 | CASE ( 5 ) |
---|
[1783] | 2663 | netcdf_data_format_string = 'parallel netCDF4/HDF5' |
---|
[1327] | 2664 | CASE ( 6 ) |
---|
[1783] | 2665 | netcdf_data_format_string = 'parallel netCDF4/HDF5 classic' |
---|
[1031] | 2666 | |
---|
[1327] | 2667 | END SELECT |
---|
[1031] | 2668 | |
---|
[1] | 2669 | ! |
---|
[410] | 2670 | !-- Check mask conditions |
---|
[553] | 2671 | DO mid = 1, max_masks |
---|
[1788] | 2672 | IF ( data_output_masks(mid,1) /= ' ' .OR. & |
---|
[567] | 2673 | data_output_masks_user(mid,1) /= ' ' ) THEN |
---|
[553] | 2674 | masks = masks + 1 |
---|
| 2675 | ENDIF |
---|
| 2676 | ENDDO |
---|
[2312] | 2677 | |
---|
[1788] | 2678 | IF ( masks < 0 .OR. masks > max_masks ) THEN |
---|
[1425] | 2679 | WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', & |
---|
[410] | 2680 | '<= ', max_masks, ' (=max_masks)' |
---|
[564] | 2681 | CALL message( 'check_parameters', 'PA0325', 1, 2, 0, 6, 0 ) |
---|
[410] | 2682 | ENDIF |
---|
| 2683 | IF ( masks > 0 ) THEN |
---|
| 2684 | mask_scale(1) = mask_scale_x |
---|
| 2685 | mask_scale(2) = mask_scale_y |
---|
| 2686 | mask_scale(3) = mask_scale_z |
---|
[1353] | 2687 | IF ( ANY( mask_scale <= 0.0_wp ) ) THEN |
---|
[1425] | 2688 | WRITE( message_string, * ) & |
---|
| 2689 | 'illegal value: mask_scale_x, mask_scale_y and mask_scale_z', & |
---|
[410] | 2690 | 'must be > 0.0' |
---|
[564] | 2691 | CALL message( 'check_parameters', 'PA0326', 1, 2, 0, 6, 0 ) |
---|
[410] | 2692 | ENDIF |
---|
| 2693 | ! |
---|
| 2694 | !-- Generate masks for masked data output |
---|
[2312] | 2695 | !-- Parallel netcdf output is not tested so far for masked data, hence |
---|
[3048] | 2696 | !-- netcdf_data_format is switched back to non-parallel output. |
---|
[1308] | 2697 | netcdf_data_format_save = netcdf_data_format |
---|
| 2698 | IF ( netcdf_data_format > 4 ) THEN |
---|
| 2699 | IF ( netcdf_data_format == 5 ) netcdf_data_format = 3 |
---|
| 2700 | IF ( netcdf_data_format == 6 ) netcdf_data_format = 4 |
---|
| 2701 | message_string = 'netCDF file formats '// & |
---|
| 2702 | '5 (parallel netCDF 4) and ' // & |
---|
| 2703 | '6 (parallel netCDF 4 Classic model) '// & |
---|
[3046] | 2704 | '& are currently not supported (not yet tested) ' //& |
---|
| 2705 | 'for masked data. &Using respective non-parallel' //& |
---|
[1308] | 2706 | ' output for masked data.' |
---|
| 2707 | CALL message( 'check_parameters', 'PA0383', 0, 0, 0, 6, 0 ) |
---|
| 2708 | ENDIF |
---|
[410] | 2709 | CALL init_masks |
---|
[1308] | 2710 | netcdf_data_format = netcdf_data_format_save |
---|
[410] | 2711 | ENDIF |
---|
| 2712 | |
---|
| 2713 | ! |
---|
[493] | 2714 | !-- Check the NetCDF data format |
---|
[1034] | 2715 | IF ( netcdf_data_format > 2 ) THEN |
---|
[924] | 2716 | #if defined( __netcdf4 ) |
---|
[493] | 2717 | CONTINUE |
---|
| 2718 | #else |
---|
[1425] | 2719 | message_string = 'netCDF: netCDF4 format requested but no ' // & |
---|
[3046] | 2720 | 'cpp-directive __netcdf4 given & switch ' // & |
---|
[493] | 2721 | 'back to 64-bit offset format' |
---|
| 2722 | CALL message( 'check_parameters', 'PA0171', 0, 1, 0, 6, 0 ) |
---|
| 2723 | netcdf_data_format = 2 |
---|
| 2724 | #endif |
---|
| 2725 | ENDIF |
---|
[1031] | 2726 | IF ( netcdf_data_format > 4 ) THEN |
---|
| 2727 | #if defined( __netcdf4 ) && defined( __netcdf4_parallel ) |
---|
| 2728 | CONTINUE |
---|
| 2729 | #else |
---|
| 2730 | message_string = 'netCDF: netCDF4 parallel output requested but no ' // & |
---|
[3046] | 2731 | 'cpp-directive __netcdf4_parallel given & switch ' //& |
---|
[1031] | 2732 | 'back to netCDF4 non-parallel output' |
---|
| 2733 | CALL message( 'check_parameters', 'PA0099', 0, 1, 0, 6, 0 ) |
---|
| 2734 | netcdf_data_format = netcdf_data_format - 2 |
---|
[892] | 2735 | #endif |
---|
[1031] | 2736 | ENDIF |
---|
[667] | 2737 | |
---|
[1308] | 2738 | ! |
---|
| 2739 | !-- Calculate fixed number of output time levels for parallel netcdf output. |
---|
[1327] | 2740 | !-- The time dimension has to be defined as limited for parallel output, |
---|
| 2741 | !-- because otherwise the I/O performance drops significantly. |
---|
| 2742 | IF ( netcdf_data_format > 4 ) THEN |
---|
| 2743 | |
---|
[1745] | 2744 | ! |
---|
| 2745 | !-- Check if any of the follwoing data output interval is 0.0s, which is |
---|
| 2746 | !-- not allowed for parallel output. |
---|
[2974] | 2747 | CALL check_dt_do( dt_do3d, 'dt_do3d' ) |
---|
| 2748 | CALL check_dt_do( dt_do2d_xy, 'dt_do2d_xy' ) |
---|
| 2749 | CALL check_dt_do( dt_do2d_xz, 'dt_do2d_xz' ) |
---|
| 2750 | CALL check_dt_do( dt_do2d_yz, 'dt_do2d_yz' ) |
---|
| 2751 | CALL check_dt_do( dt_data_output_av, 'dt_data_output_av' ) |
---|
[1745] | 2752 | |
---|
[4472] | 2753 | !-- Set needed time levels (ntdim) to |
---|
[2964] | 2754 | !-- saved time levels + to be saved time levels. |
---|
[3575] | 2755 | ntdim_3d(0) = do3d_time_count(0) + CEILING( & |
---|
| 2756 | ( end_time - MAX( & |
---|
| 2757 | MERGE(skip_time_do3d, skip_time_do3d + spinup_time, & |
---|
| 2758 | data_output_during_spinup ), & |
---|
| 2759 | simulated_time_at_begin ) & |
---|
[2964] | 2760 | ) / dt_do3d ) |
---|
[1327] | 2761 | IF ( do3d_at_begin ) ntdim_3d(0) = ntdim_3d(0) + 1 |
---|
[2964] | 2762 | |
---|
[3575] | 2763 | ntdim_3d(1) = do3d_time_count(1) + CEILING( & |
---|
| 2764 | ( end_time - MAX( & |
---|
[3646] | 2765 | MERGE( skip_time_data_output_av, skip_time_data_output_av & |
---|
| 2766 | + spinup_time, data_output_during_spinup ), & |
---|
[3575] | 2767 | simulated_time_at_begin ) & |
---|
[2964] | 2768 | ) / dt_data_output_av ) |
---|
| 2769 | |
---|
[3575] | 2770 | ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING( & |
---|
| 2771 | ( end_time - MAX( & |
---|
| 2772 | MERGE(skip_time_do2d_xy, skip_time_do2d_xy + spinup_time, & |
---|
[3646] | 2773 | data_output_during_spinup ), & |
---|
| 2774 | simulated_time_at_begin ) & |
---|
[2964] | 2775 | ) / dt_do2d_xy ) |
---|
| 2776 | |
---|
[3575] | 2777 | ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING( & |
---|
| 2778 | ( end_time - MAX( & |
---|
| 2779 | MERGE(skip_time_do2d_xz, skip_time_do2d_xz + spinup_time, & |
---|
| 2780 | data_output_during_spinup ), & |
---|
| 2781 | simulated_time_at_begin ) & |
---|
[2964] | 2782 | ) / dt_do2d_xz ) |
---|
| 2783 | |
---|
[3575] | 2784 | ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING( & |
---|
| 2785 | ( end_time - MAX( & |
---|
| 2786 | MERGE(skip_time_do2d_yz, skip_time_do2d_yz + spinup_time, & |
---|
| 2787 | data_output_during_spinup ), & |
---|
| 2788 | simulated_time_at_begin ) & |
---|
[2964] | 2789 | ) / dt_do2d_yz ) |
---|
| 2790 | |
---|
[1327] | 2791 | IF ( do2d_at_begin ) THEN |
---|
| 2792 | ntdim_2d_xy(0) = ntdim_2d_xy(0) + 1 |
---|
| 2793 | ntdim_2d_xz(0) = ntdim_2d_xz(0) + 1 |
---|
| 2794 | ntdim_2d_yz(0) = ntdim_2d_yz(0) + 1 |
---|
[1308] | 2795 | ENDIF |
---|
[4142] | 2796 | ! |
---|
[4472] | 2797 | !-- Please note, for averaged 2D data skip_time_data_output_av is the relavant |
---|
| 2798 | !-- output control parameter. |
---|
[4142] | 2799 | ntdim_2d_xy(1) = do2d_xy_time_count(1) + CEILING( & |
---|
| 2800 | ( end_time - MAX( MERGE( skip_time_data_output_av, & |
---|
| 2801 | skip_time_data_output_av + spinup_time, & |
---|
| 2802 | data_output_during_spinup ), & |
---|
| 2803 | simulated_time_at_begin ) & |
---|
| 2804 | ) / dt_data_output_av ) |
---|
[1762] | 2805 | |
---|
[4142] | 2806 | ntdim_2d_xz(1) = do2d_xz_time_count(1) + CEILING( & |
---|
| 2807 | ( end_time - MAX( MERGE( skip_time_data_output_av, & |
---|
| 2808 | skip_time_data_output_av + spinup_time, & |
---|
| 2809 | data_output_during_spinup ), & |
---|
| 2810 | simulated_time_at_begin ) & |
---|
| 2811 | ) / dt_data_output_av ) |
---|
[2964] | 2812 | |
---|
[4142] | 2813 | ntdim_2d_yz(1) = do2d_yz_time_count(1) + CEILING( & |
---|
| 2814 | ( end_time - MAX( MERGE( skip_time_data_output_av, & |
---|
| 2815 | skip_time_data_output_av + spinup_time, & |
---|
| 2816 | data_output_during_spinup ), & |
---|
| 2817 | simulated_time_at_begin ) & |
---|
| 2818 | ) / dt_data_output_av ) |
---|
[2964] | 2819 | |
---|
[1308] | 2820 | ENDIF |
---|
| 2821 | |
---|
[1031] | 2822 | ! |
---|
[1] | 2823 | !-- Check, whether a constant diffusion coefficient shall be used |
---|
[1353] | 2824 | IF ( km_constant /= -1.0_wp ) THEN |
---|
| 2825 | IF ( km_constant < 0.0_wp ) THEN |
---|
[215] | 2826 | WRITE( message_string, * ) 'km_constant = ', km_constant, ' < 0.0' |
---|
[226] | 2827 | CALL message( 'check_parameters', 'PA0121', 1, 2, 0, 6, 0 ) |
---|
[1] | 2828 | ELSE |
---|
[1353] | 2829 | IF ( prandtl_number < 0.0_wp ) THEN |
---|
[1425] | 2830 | WRITE( message_string, * ) 'prandtl_number = ', prandtl_number, & |
---|
[215] | 2831 | ' < 0.0' |
---|
[226] | 2832 | CALL message( 'check_parameters', 'PA0122', 1, 2, 0, 6, 0 ) |
---|
[1] | 2833 | ENDIF |
---|
| 2834 | constant_diffusion = .TRUE. |
---|
| 2835 | |
---|
[1691] | 2836 | IF ( constant_flux_layer ) THEN |
---|
| 2837 | message_string = 'constant_flux_layer is not allowed with fixed ' & |
---|
| 2838 | // 'value of km' |
---|
[226] | 2839 | CALL message( 'check_parameters', 'PA0123', 1, 2, 0, 6, 0 ) |
---|
[1] | 2840 | ENDIF |
---|
| 2841 | ENDIF |
---|
| 2842 | ENDIF |
---|
| 2843 | |
---|
| 2844 | ! |
---|
[978] | 2845 | !-- In case of non-cyclic lateral boundaries and a damping layer for the |
---|
| 2846 | !-- potential temperature, check the width of the damping layer |
---|
[1] | 2847 | IF ( bc_lr /= 'cyclic' ) THEN |
---|
[1425] | 2848 | IF ( pt_damping_width < 0.0_wp .OR. & |
---|
[2274] | 2849 | pt_damping_width > REAL( (nx+1) * dx ) ) THEN |
---|
[978] | 2850 | message_string = 'pt_damping_width out of range' |
---|
[226] | 2851 | CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) |
---|
[1] | 2852 | ENDIF |
---|
| 2853 | ENDIF |
---|
| 2854 | |
---|
| 2855 | IF ( bc_ns /= 'cyclic' ) THEN |
---|
[1425] | 2856 | IF ( pt_damping_width < 0.0_wp .OR. & |
---|
[2274] | 2857 | pt_damping_width > REAL( (ny+1) * dy ) ) THEN |
---|
[978] | 2858 | message_string = 'pt_damping_width out of range' |
---|
[226] | 2859 | CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) |
---|
[1] | 2860 | ENDIF |
---|
| 2861 | ENDIF |
---|
| 2862 | |
---|
| 2863 | ! |
---|
[1691] | 2864 | !-- Check value range for zeta = z/L |
---|
| 2865 | IF ( zeta_min >= zeta_max ) THEN |
---|
| 2866 | WRITE( message_string, * ) 'zeta_min = ', zeta_min, ' must be less ', & |
---|
| 2867 | 'than zeta_max = ', zeta_max |
---|
[226] | 2868 | CALL message( 'check_parameters', 'PA0125', 1, 2, 0, 6, 0 ) |
---|
[1] | 2869 | ENDIF |
---|
| 2870 | |
---|
| 2871 | ! |
---|
[1425] | 2872 | !-- Check random generator |
---|
[1788] | 2873 | IF ( (random_generator /= 'system-specific' .AND. & |
---|
| 2874 | random_generator /= 'random-parallel' ) .AND. & |
---|
[1425] | 2875 | random_generator /= 'numerical-recipes' ) THEN |
---|
| 2876 | message_string = 'unknown random generator: random_generator = "' // & |
---|
| 2877 | TRIM( random_generator ) // '"' |
---|
| 2878 | CALL message( 'check_parameters', 'PA0135', 1, 2, 0, 6, 0 ) |
---|
| 2879 | ENDIF |
---|
| 2880 | |
---|
| 2881 | ! |
---|
[1] | 2882 | !-- Determine upper and lower hight level indices for random perturbations |
---|
[1322] | 2883 | IF ( disturbance_level_b == -9999999.9_wp ) THEN |
---|
[3294] | 2884 | IF ( ocean_mode ) THEN |
---|
[97] | 2885 | disturbance_level_b = zu((nzt*2)/3) |
---|
| 2886 | disturbance_level_ind_b = ( nzt * 2 ) / 3 |
---|
| 2887 | ELSE |
---|
| 2888 | disturbance_level_b = zu(nzb+3) |
---|
| 2889 | disturbance_level_ind_b = nzb + 3 |
---|
| 2890 | ENDIF |
---|
[1] | 2891 | ELSEIF ( disturbance_level_b < zu(3) ) THEN |
---|
[1425] | 2892 | WRITE( message_string, * ) 'disturbance_level_b = ', & |
---|
[215] | 2893 | disturbance_level_b, ' must be >= ', zu(3), '(zu(3))' |
---|
[226] | 2894 | CALL message( 'check_parameters', 'PA0126', 1, 2, 0, 6, 0 ) |
---|
[1] | 2895 | ELSEIF ( disturbance_level_b > zu(nzt-2) ) THEN |
---|
[1425] | 2896 | WRITE( message_string, * ) 'disturbance_level_b = ', & |
---|
[215] | 2897 | disturbance_level_b, ' must be <= ', zu(nzt-2), '(zu(nzt-2))' |
---|
[226] | 2898 | CALL message( 'check_parameters', 'PA0127', 1, 2, 0, 6, 0 ) |
---|
[1] | 2899 | ELSE |
---|
| 2900 | DO k = 3, nzt-2 |
---|
| 2901 | IF ( disturbance_level_b <= zu(k) ) THEN |
---|
| 2902 | disturbance_level_ind_b = k |
---|
| 2903 | EXIT |
---|
| 2904 | ENDIF |
---|
| 2905 | ENDDO |
---|
| 2906 | ENDIF |
---|
| 2907 | |
---|
[1322] | 2908 | IF ( disturbance_level_t == -9999999.9_wp ) THEN |
---|
[3294] | 2909 | IF ( ocean_mode ) THEN |
---|
[97] | 2910 | disturbance_level_t = zu(nzt-3) |
---|
| 2911 | disturbance_level_ind_t = nzt - 3 |
---|
| 2912 | ELSE |
---|
| 2913 | disturbance_level_t = zu(nzt/3) |
---|
| 2914 | disturbance_level_ind_t = nzt / 3 |
---|
| 2915 | ENDIF |
---|
[1] | 2916 | ELSEIF ( disturbance_level_t > zu(nzt-2) ) THEN |
---|
[1425] | 2917 | WRITE( message_string, * ) 'disturbance_level_t = ', & |
---|
[215] | 2918 | disturbance_level_t, ' must be <= ', zu(nzt-2), '(zu(nzt-2))' |
---|
[226] | 2919 | CALL message( 'check_parameters', 'PA0128', 1, 2, 0, 6, 0 ) |
---|
[1] | 2920 | ELSEIF ( disturbance_level_t < disturbance_level_b ) THEN |
---|
[1425] | 2921 | WRITE( message_string, * ) 'disturbance_level_t = ', & |
---|
| 2922 | disturbance_level_t, ' must be >= disturbance_level_b = ', & |
---|
[215] | 2923 | disturbance_level_b |
---|
[226] | 2924 | CALL message( 'check_parameters', 'PA0129', 1, 2, 0, 6, 0 ) |
---|
[1] | 2925 | ELSE |
---|
| 2926 | DO k = 3, nzt-2 |
---|
| 2927 | IF ( disturbance_level_t <= zu(k) ) THEN |
---|
| 2928 | disturbance_level_ind_t = k |
---|
| 2929 | EXIT |
---|
| 2930 | ENDIF |
---|
| 2931 | ENDDO |
---|
| 2932 | ENDIF |
---|
| 2933 | |
---|
| 2934 | ! |
---|
| 2935 | !-- Check again whether the levels determined this way are ok. |
---|
| 2936 | !-- Error may occur at automatic determination and too few grid points in |
---|
| 2937 | !-- z-direction. |
---|
| 2938 | IF ( disturbance_level_ind_t < disturbance_level_ind_b ) THEN |
---|
[1425] | 2939 | WRITE( message_string, * ) 'disturbance_level_ind_t = ', & |
---|
[3045] | 2940 | disturbance_level_ind_t, ' must be >= ', & |
---|
| 2941 | 'disturbance_level_ind_b = ', disturbance_level_ind_b |
---|
[226] | 2942 | CALL message( 'check_parameters', 'PA0130', 1, 2, 0, 6, 0 ) |
---|
[1] | 2943 | ENDIF |
---|
| 2944 | |
---|
| 2945 | ! |
---|
| 2946 | !-- Determine the horizontal index range for random perturbations. |
---|
| 2947 | !-- In case of non-cyclic horizontal boundaries, no perturbations are imposed |
---|
| 2948 | !-- near the inflow and the perturbation area is further limited to ...(1) |
---|
| 2949 | !-- after the initial phase of the flow. |
---|
[2312] | 2950 | |
---|
[1] | 2951 | IF ( bc_lr /= 'cyclic' ) THEN |
---|
| 2952 | IF ( inflow_disturbance_begin == -1 ) THEN |
---|
| 2953 | inflow_disturbance_begin = MIN( 10, nx/2 ) |
---|
| 2954 | ENDIF |
---|
| 2955 | IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > nx )& |
---|
| 2956 | THEN |
---|
[215] | 2957 | message_string = 'inflow_disturbance_begin out of range' |
---|
[226] | 2958 | CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) |
---|
[1] | 2959 | ENDIF |
---|
| 2960 | IF ( inflow_disturbance_end == -1 ) THEN |
---|
| 2961 | inflow_disturbance_end = MIN( 100, 3*nx/4 ) |
---|
| 2962 | ENDIF |
---|
| 2963 | IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > nx ) & |
---|
| 2964 | THEN |
---|
[215] | 2965 | message_string = 'inflow_disturbance_end out of range' |
---|
[226] | 2966 | CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) |
---|
[1] | 2967 | ENDIF |
---|
| 2968 | ELSEIF ( bc_ns /= 'cyclic' ) THEN |
---|
| 2969 | IF ( inflow_disturbance_begin == -1 ) THEN |
---|
| 2970 | inflow_disturbance_begin = MIN( 10, ny/2 ) |
---|
| 2971 | ENDIF |
---|
| 2972 | IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > ny )& |
---|
| 2973 | THEN |
---|
[215] | 2974 | message_string = 'inflow_disturbance_begin out of range' |
---|
[226] | 2975 | CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) |
---|
[1] | 2976 | ENDIF |
---|
| 2977 | IF ( inflow_disturbance_end == -1 ) THEN |
---|
| 2978 | inflow_disturbance_end = MIN( 100, 3*ny/4 ) |
---|
| 2979 | ENDIF |
---|
| 2980 | IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > ny ) & |
---|
| 2981 | THEN |
---|
[215] | 2982 | message_string = 'inflow_disturbance_end out of range' |
---|
[226] | 2983 | CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) |
---|
[1] | 2984 | ENDIF |
---|
| 2985 | ENDIF |
---|
| 2986 | |
---|
[2312] | 2987 | IF ( random_generator == 'random-parallel' ) THEN |
---|
[1425] | 2988 | dist_nxl = nxl; dist_nxr = nxr |
---|
| 2989 | dist_nys = nys; dist_nyn = nyn |
---|
| 2990 | IF ( bc_lr == 'radiation/dirichlet' ) THEN |
---|
| 2991 | dist_nxr = MIN( nx - inflow_disturbance_begin, nxr ) |
---|
| 2992 | dist_nxl(1) = MAX( nx - inflow_disturbance_end, nxl ) |
---|
| 2993 | ELSEIF ( bc_lr == 'dirichlet/radiation' ) THEN |
---|
| 2994 | dist_nxl = MAX( inflow_disturbance_begin, nxl ) |
---|
| 2995 | dist_nxr(1) = MIN( inflow_disturbance_end, nxr ) |
---|
[3182] | 2996 | ELSEIF ( bc_lr == 'nested' .OR. bc_lr == 'nesting_offline' ) THEN |
---|
[2938] | 2997 | dist_nxl = MAX( inflow_disturbance_begin, nxl ) |
---|
| 2998 | dist_nxr = MIN( nx - inflow_disturbance_begin, nxr ) |
---|
[1425] | 2999 | ENDIF |
---|
| 3000 | IF ( bc_ns == 'dirichlet/radiation' ) THEN |
---|
| 3001 | dist_nyn = MIN( ny - inflow_disturbance_begin, nyn ) |
---|
| 3002 | dist_nys(1) = MAX( ny - inflow_disturbance_end, nys ) |
---|
| 3003 | ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN |
---|
| 3004 | dist_nys = MAX( inflow_disturbance_begin, nys ) |
---|
| 3005 | dist_nyn(1) = MIN( inflow_disturbance_end, nyn ) |
---|
[3182] | 3006 | ELSEIF ( bc_ns == 'nested' .OR. bc_ns == 'nesting_offline' ) THEN |
---|
[2938] | 3007 | dist_nys = MAX( inflow_disturbance_begin, nys ) |
---|
| 3008 | dist_nyn = MIN( ny - inflow_disturbance_begin, nyn ) |
---|
[1425] | 3009 | ENDIF |
---|
| 3010 | ELSE |
---|
| 3011 | dist_nxl = 0; dist_nxr = nx |
---|
| 3012 | dist_nys = 0; dist_nyn = ny |
---|
| 3013 | IF ( bc_lr == 'radiation/dirichlet' ) THEN |
---|
| 3014 | dist_nxr = nx - inflow_disturbance_begin |
---|
| 3015 | dist_nxl(1) = nx - inflow_disturbance_end |
---|
| 3016 | ELSEIF ( bc_lr == 'dirichlet/radiation' ) THEN |
---|
| 3017 | dist_nxl = inflow_disturbance_begin |
---|
| 3018 | dist_nxr(1) = inflow_disturbance_end |
---|
[3182] | 3019 | ELSEIF ( bc_lr == 'nested' .OR. bc_lr == 'nesting_offline' ) THEN |
---|
[2938] | 3020 | dist_nxr = nx - inflow_disturbance_begin |
---|
| 3021 | dist_nxl = inflow_disturbance_begin |
---|
[1425] | 3022 | ENDIF |
---|
| 3023 | IF ( bc_ns == 'dirichlet/radiation' ) THEN |
---|
| 3024 | dist_nyn = ny - inflow_disturbance_begin |
---|
| 3025 | dist_nys(1) = ny - inflow_disturbance_end |
---|
| 3026 | ELSEIF ( bc_ns == 'radiation/dirichlet' ) THEN |
---|
| 3027 | dist_nys = inflow_disturbance_begin |
---|
| 3028 | dist_nyn(1) = inflow_disturbance_end |
---|
[3182] | 3029 | ELSEIF ( bc_ns == 'nested' .OR. bc_ns == 'nesting_offline' ) THEN |
---|
[2938] | 3030 | dist_nyn = ny - inflow_disturbance_begin |
---|
| 3031 | dist_nys = inflow_disturbance_begin |
---|
[1425] | 3032 | ENDIF |
---|
[73] | 3033 | ENDIF |
---|
[1] | 3034 | |
---|
| 3035 | ! |
---|
[151] | 3036 | !-- A turbulent inflow requires Dirichlet conditions at the respective inflow |
---|
| 3037 | !-- boundary (so far, a turbulent inflow is realized from the left side only) |
---|
[1159] | 3038 | IF ( turbulent_inflow .AND. bc_lr /= 'dirichlet/radiation' ) THEN |
---|
[1425] | 3039 | message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // & |
---|
[215] | 3040 | 'condition at the inflow boundary' |
---|
[226] | 3041 | CALL message( 'check_parameters', 'PA0133', 1, 2, 0, 6, 0 ) |
---|
[151] | 3042 | ENDIF |
---|
| 3043 | |
---|
| 3044 | ! |
---|
[1060] | 3045 | !-- Turbulent inflow requires that 3d arrays have been cyclically filled with |
---|
[1103] | 3046 | !-- data from prerun in the first main run |
---|
| 3047 | IF ( turbulent_inflow .AND. initializing_actions /= 'cyclic_fill' .AND. & |
---|
| 3048 | initializing_actions /= 'read_restart_data' ) THEN |
---|
[1425] | 3049 | message_string = 'turbulent_inflow = .T. requires ' // & |
---|
[2274] | 3050 | 'initializing_actions = ''cyclic_fill'' or ' // & |
---|
| 3051 | 'initializing_actions = ''read_restart_data'' ' |
---|
[1060] | 3052 | CALL message( 'check_parameters', 'PA0055', 1, 2, 0, 6, 0 ) |
---|
| 3053 | ENDIF |
---|
| 3054 | |
---|
| 3055 | ! |
---|
[4183] | 3056 | !-- In case of turbulent inflow |
---|
[151] | 3057 | IF ( turbulent_inflow ) THEN |
---|
[4183] | 3058 | |
---|
| 3059 | ! |
---|
| 3060 | !-- Calculate the index of the recycling plane |
---|
[2274] | 3061 | IF ( recycling_width <= dx .OR. recycling_width >= nx * dx ) THEN |
---|
[3045] | 3062 | WRITE( message_string, * ) 'illegal value for recycling_width: ', & |
---|
| 3063 | recycling_width |
---|
[2052] | 3064 | CALL message( 'check_parameters', 'PA0134', 1, 2, 0, 6, 0 ) |
---|
[151] | 3065 | ENDIF |
---|
| 3066 | ! |
---|
| 3067 | !-- Calculate the index |
---|
| 3068 | recycling_plane = recycling_width / dx |
---|
[1806] | 3069 | ! |
---|
[4183] | 3070 | !-- Check for correct input of recycling method for thermodynamic quantities |
---|
| 3071 | IF ( TRIM( recycling_method_for_thermodynamic_quantities ) /= 'turbulent_fluctuation' .AND. & |
---|
| 3072 | TRIM( recycling_method_for_thermodynamic_quantities ) /= 'absolute_value' ) THEN |
---|
| 3073 | WRITE( message_string, * ) 'unknown recycling method for thermodynamic quantities: ', & |
---|
| 3074 | TRIM( recycling_method_for_thermodynamic_quantities ) |
---|
| 3075 | CALL message( 'check_parameters', 'PA0184', 1, 2, 0, 6, 0 ) |
---|
| 3076 | ENDIF |
---|
| 3077 | |
---|
[151] | 3078 | ENDIF |
---|
| 3079 | |
---|
[2050] | 3080 | |
---|
| 3081 | IF ( turbulent_outflow ) THEN |
---|
[151] | 3082 | ! |
---|
[2050] | 3083 | !-- Turbulent outflow requires Dirichlet conditions at the respective inflow |
---|
| 3084 | !-- boundary (so far, a turbulent outflow is realized at the right side only) |
---|
| 3085 | IF ( bc_lr /= 'dirichlet/radiation' ) THEN |
---|
| 3086 | message_string = 'turbulent_outflow = .T. requires ' // & |
---|
| 3087 | 'bc_lr = "dirichlet/radiation"' |
---|
| 3088 | CALL message( 'check_parameters', 'PA0038', 1, 2, 0, 6, 0 ) |
---|
| 3089 | ENDIF |
---|
| 3090 | ! |
---|
| 3091 | !-- The ouflow-source plane must lay inside the model domain |
---|
| 3092 | IF ( outflow_source_plane < dx .OR. & |
---|
| 3093 | outflow_source_plane > nx * dx ) THEN |
---|
| 3094 | WRITE( message_string, * ) 'illegal value for outflow_source'// & |
---|
| 3095 | '_plane: ', outflow_source_plane |
---|
| 3096 | CALL message( 'check_parameters', 'PA0145', 1, 2, 0, 6, 0 ) |
---|
| 3097 | ENDIF |
---|
| 3098 | ENDIF |
---|
| 3099 | |
---|
| 3100 | ! |
---|
[1] | 3101 | !-- Determine damping level index for 1D model |
---|
| 3102 | IF ( INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN |
---|
[1353] | 3103 | IF ( damp_level_1d == -1.0_wp ) THEN |
---|
[1] | 3104 | damp_level_1d = zu(nzt+1) |
---|
| 3105 | damp_level_ind_1d = nzt + 1 |
---|
[1353] | 3106 | ELSEIF ( damp_level_1d < 0.0_wp .OR. damp_level_1d > zu(nzt+1) ) THEN |
---|
[1425] | 3107 | WRITE( message_string, * ) 'damp_level_1d = ', damp_level_1d, & |
---|
[2274] | 3108 | ' must be >= 0.0 and <= ', zu(nzt+1), '(zu(nzt+1))' |
---|
[226] | 3109 | CALL message( 'check_parameters', 'PA0136', 1, 2, 0, 6, 0 ) |
---|
[1] | 3110 | ELSE |
---|
| 3111 | DO k = 1, nzt+1 |
---|
| 3112 | IF ( damp_level_1d <= zu(k) ) THEN |
---|
| 3113 | damp_level_ind_1d = k |
---|
| 3114 | EXIT |
---|
| 3115 | ENDIF |
---|
| 3116 | ENDDO |
---|
| 3117 | ENDIF |
---|
| 3118 | ENDIF |
---|
[215] | 3119 | |
---|
[1] | 3120 | ! |
---|
| 3121 | !-- Check some other 1d-model parameters |
---|
[1425] | 3122 | IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & |
---|
[1] | 3123 | TRIM( mixing_length_1d ) /= 'blackadar' ) THEN |
---|
[1425] | 3124 | message_string = 'mixing_length_1d = "' // TRIM( mixing_length_1d ) // & |
---|
[215] | 3125 | '" is unknown' |
---|
[226] | 3126 | CALL message( 'check_parameters', 'PA0137', 1, 2, 0, 6, 0 ) |
---|
[1] | 3127 | ENDIF |
---|
[1425] | 3128 | IF ( TRIM( dissipation_1d ) /= 'as_in_3d_model' .AND. & |
---|
[2696] | 3129 | TRIM( dissipation_1d ) /= 'detering' .AND. & |
---|
| 3130 | TRIM( dissipation_1d ) /= 'prognostic' ) THEN |
---|
[1425] | 3131 | message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & |
---|
[215] | 3132 | '" is unknown' |
---|
[226] | 3133 | CALL message( 'check_parameters', 'PA0138', 1, 2, 0, 6, 0 ) |
---|
[1] | 3134 | ENDIF |
---|
[2918] | 3135 | IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & |
---|
| 3136 | TRIM( dissipation_1d ) == 'as_in_3d_model' ) THEN |
---|
| 3137 | message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & |
---|
| 3138 | '" requires mixing_length_1d = "as_in_3d_model"' |
---|
| 3139 | CALL message( 'check_parameters', 'PA0485', 1, 2, 0, 6, 0 ) |
---|
| 3140 | ENDIF |
---|
[1] | 3141 | |
---|
| 3142 | ! |
---|
| 3143 | !-- Set time for the next user defined restart (time_restart is the |
---|
| 3144 | !-- internal parameter for steering restart events) |
---|
[1322] | 3145 | IF ( restart_time /= 9999999.9_wp ) THEN |
---|
[291] | 3146 | IF ( restart_time > time_since_reference_point ) THEN |
---|
| 3147 | time_restart = restart_time |
---|
| 3148 | ENDIF |
---|
[1] | 3149 | ELSE |
---|
| 3150 | ! |
---|
| 3151 | !-- In case of a restart run, set internal parameter to default (no restart) |
---|
| 3152 | !-- if the NAMELIST-parameter restart_time is omitted |
---|
[1322] | 3153 | time_restart = 9999999.9_wp |
---|
[1] | 3154 | ENDIF |
---|
| 3155 | |
---|
| 3156 | ! |
---|
[240] | 3157 | !-- Check pressure gradient conditions |
---|
[1788] | 3158 | IF ( dp_external .AND. conserve_volume_flow ) THEN |
---|
[388] | 3159 | WRITE( message_string, * ) 'Both dp_external and conserve_volume_flo', & |
---|
| 3160 | 'w are .TRUE. but one of them must be .FALSE.' |
---|
[240] | 3161 | CALL message( 'check_parameters', 'PA0150', 1, 2, 0, 6, 0 ) |
---|
| 3162 | ENDIF |
---|
| 3163 | IF ( dp_external ) THEN |
---|
[1788] | 3164 | IF ( dp_level_b < zu(nzb) .OR. dp_level_b > zu(nzt) ) THEN |
---|
[240] | 3165 | WRITE( message_string, * ) 'dp_level_b = ', dp_level_b, ' is out ', & |
---|
[3045] | 3166 | ' of range [zu(nzb), zu(nzt)]' |
---|
[240] | 3167 | CALL message( 'check_parameters', 'PA0151', 1, 2, 0, 6, 0 ) |
---|
| 3168 | ENDIF |
---|
[1353] | 3169 | IF ( .NOT. ANY( dpdxy /= 0.0_wp ) ) THEN |
---|
[388] | 3170 | WRITE( message_string, * ) 'dp_external is .TRUE. but dpdxy is ze', & |
---|
[3045] | 3171 | 'ro, i.e. the external pressure gradient will not be applied' |
---|
[240] | 3172 | CALL message( 'check_parameters', 'PA0152', 0, 1, 0, 6, 0 ) |
---|
| 3173 | ENDIF |
---|
| 3174 | ENDIF |
---|
[1788] | 3175 | IF ( ANY( dpdxy /= 0.0_wp ) .AND. .NOT. dp_external ) THEN |
---|
[1425] | 3176 | WRITE( message_string, * ) 'dpdxy is nonzero but dp_external is ', & |
---|
[240] | 3177 | '.FALSE., i.e. the external pressure gradient & will not be applied' |
---|
| 3178 | CALL message( 'check_parameters', 'PA0153', 0, 1, 0, 6, 0 ) |
---|
| 3179 | ENDIF |
---|
[241] | 3180 | IF ( conserve_volume_flow ) THEN |
---|
| 3181 | IF ( TRIM( conserve_volume_flow_mode ) == 'default' ) THEN |
---|
[667] | 3182 | |
---|
| 3183 | conserve_volume_flow_mode = 'initial_profiles' |
---|
| 3184 | |
---|
[241] | 3185 | ELSEIF ( TRIM( conserve_volume_flow_mode ) /= 'initial_profiles' .AND. & |
---|
| 3186 | TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) THEN |
---|
[1425] | 3187 | WRITE( message_string, * ) 'unknown conserve_volume_flow_mode: ', & |
---|
[241] | 3188 | conserve_volume_flow_mode |
---|
| 3189 | CALL message( 'check_parameters', 'PA0154', 1, 2, 0, 6, 0 ) |
---|
| 3190 | ENDIF |
---|
[1425] | 3191 | IF ( (bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic') .AND. & |
---|
[667] | 3192 | TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' ) THEN |
---|
[1425] | 3193 | WRITE( message_string, * ) 'non-cyclic boundary conditions ', & |
---|
[667] | 3194 | 'require conserve_volume_flow_mode = ''initial_profiles''' |
---|
[241] | 3195 | CALL message( 'check_parameters', 'PA0155', 1, 2, 0, 6, 0 ) |
---|
| 3196 | ENDIF |
---|
| 3197 | ENDIF |
---|
[1788] | 3198 | IF ( ( u_bulk /= 0.0_wp .OR. v_bulk /= 0.0_wp ) .AND. & |
---|
| 3199 | ( .NOT. conserve_volume_flow .OR. & |
---|
[241] | 3200 | TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) ) THEN |
---|
[1425] | 3201 | WRITE( message_string, * ) 'nonzero bulk velocity requires ', & |
---|
| 3202 | 'conserve_volume_flow = .T. and ', & |
---|
[241] | 3203 | 'conserve_volume_flow_mode = ''bulk_velocity''' |
---|
| 3204 | CALL message( 'check_parameters', 'PA0157', 1, 2, 0, 6, 0 ) |
---|
| 3205 | ENDIF |
---|
[4472] | 3206 | |
---|
[240] | 3207 | ! |
---|
[1841] | 3208 | !-- Prevent empty time records in volume, cross-section and masked data in case |
---|
| 3209 | !-- of non-parallel netcdf-output in restart runs |
---|
[1455] | 3210 | IF ( netcdf_data_format < 5 ) THEN |
---|
| 3211 | IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN |
---|
| 3212 | do3d_time_count = 0 |
---|
| 3213 | do2d_xy_time_count = 0 |
---|
| 3214 | do2d_xz_time_count = 0 |
---|
| 3215 | do2d_yz_time_count = 0 |
---|
| 3216 | domask_time_count = 0 |
---|
[2312] | 3217 | ENDIF |
---|
[1455] | 3218 | ENDIF |
---|
| 3219 | |
---|
[1691] | 3220 | |
---|
| 3221 | ! |
---|
[1824] | 3222 | !-- Check roughness length, which has to be smaller than dz/2 |
---|
| 3223 | IF ( ( constant_flux_layer .OR. & |
---|
[3045] | 3224 | INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) & |
---|
[3065] | 3225 | .AND. roughness_length >= 0.5 * dz(1) ) THEN |
---|
[1824] | 3226 | message_string = 'roughness_length must be smaller than dz/2' |
---|
| 3227 | CALL message( 'check_parameters', 'PA0424', 1, 2, 0, 6, 0 ) |
---|
| 3228 | ENDIF |
---|
| 3229 | |
---|
[4444] | 3230 | #if defined( __parallel ) |
---|
[2550] | 3231 | ! |
---|
[2365] | 3232 | !-- Vertical nesting: check fine and coarse grid compatibility for data exchange |
---|
| 3233 | IF ( vnested ) CALL vnest_check_parameters |
---|
[4444] | 3234 | #endif |
---|
[2365] | 3235 | |
---|
[2550] | 3236 | ! |
---|
| 3237 | !-- Check if topography is read from file in case of complex terrain simulations |
---|
| 3238 | IF ( complex_terrain .AND. TRIM( topography ) /= 'read_from_file' ) THEN |
---|
| 3239 | message_string = 'complex_terrain requires topography' // & |
---|
| 3240 | ' = ''read_from_file''' |
---|
[3046] | 3241 | CALL message( 'check_parameters', 'PA0295', 1, 2, 0, 6, 0 ) |
---|
[2550] | 3242 | ENDIF |
---|
| 3243 | |
---|
| 3244 | ! |
---|
[4472] | 3245 | !-- Check if vertical grid stretching is switched off in case of complex |
---|
[2550] | 3246 | !-- terrain simulations |
---|
[3065] | 3247 | IF ( complex_terrain .AND. & |
---|
| 3248 | ANY( dz_stretch_level_start /= -9999999.9_wp ) ) THEN |
---|
[2550] | 3249 | message_string = 'Vertical grid stretching is not allowed for ' // & |
---|
| 3250 | 'complex_terrain = .T.' |
---|
| 3251 | CALL message( 'check_parameters', 'PA0473', 1, 2, 0, 6, 0 ) |
---|
| 3252 | ENDIF |
---|
| 3253 | |
---|
[3885] | 3254 | CALL location_message( 'checking parameters', 'finished' ) |
---|
[1] | 3255 | |
---|
[1745] | 3256 | CONTAINS |
---|
[217] | 3257 | |
---|
[1745] | 3258 | !------------------------------------------------------------------------------! |
---|
| 3259 | ! Description: |
---|
| 3260 | ! ------------ |
---|
| 3261 | !> Check the length of data output intervals. In case of parallel NetCDF output |
---|
| 3262 | !> the time levels of the output files need to be fixed. Therefore setting the |
---|
[2312] | 3263 | !> output interval to 0.0s (usually used to output each timestep) is not |
---|
[1745] | 3264 | !> possible as long as a non-fixed timestep is used. |
---|
| 3265 | !------------------------------------------------------------------------------! |
---|
| 3266 | |
---|
| 3267 | SUBROUTINE check_dt_do( dt_do, dt_do_name ) |
---|
| 3268 | |
---|
| 3269 | IMPLICIT NONE |
---|
| 3270 | |
---|
| 3271 | CHARACTER (LEN=*), INTENT (IN) :: dt_do_name !< parin variable name |
---|
| 3272 | |
---|
| 3273 | REAL(wp), INTENT (INOUT) :: dt_do !< data output interval |
---|
| 3274 | |
---|
| 3275 | IF ( dt_do == 0.0_wp ) THEN |
---|
| 3276 | IF ( dt_fixed ) THEN |
---|
[1788] | 3277 | WRITE( message_string, '(A,F9.4,A)' ) 'Output at every ' // & |
---|
[3046] | 3278 | 'timestep is wanted (' // dt_do_name // ' = 0.0).&'// & |
---|
[3045] | 3279 | 'The output interval is set to the fixed timestep dt '// & |
---|
| 3280 | '= ', dt, 's.' |
---|
[1745] | 3281 | CALL message( 'check_parameters', 'PA0060', 0, 0, 0, 6, 0 ) |
---|
| 3282 | dt_do = dt |
---|
| 3283 | ELSE |
---|
[1788] | 3284 | message_string = dt_do_name // ' = 0.0 while using a ' // & |
---|
| 3285 | 'variable timestep and parallel netCDF4 ' // & |
---|
[1745] | 3286 | 'is not allowed.' |
---|
| 3287 | CALL message( 'check_parameters', 'PA0081', 1, 2, 0, 6, 0 ) |
---|
| 3288 | ENDIF |
---|
| 3289 | ENDIF |
---|
| 3290 | |
---|
| 3291 | END SUBROUTINE check_dt_do |
---|
[2312] | 3292 | |
---|
| 3293 | |
---|
| 3294 | |
---|
[1960] | 3295 | !------------------------------------------------------------------------------! |
---|
| 3296 | ! Description: |
---|
| 3297 | ! ------------ |
---|
[1984] | 3298 | !> Set the bottom and top boundary conditions for humidity and scalars. |
---|
[1960] | 3299 | !------------------------------------------------------------------------------! |
---|
| 3300 | |
---|
[2312] | 3301 | SUBROUTINE set_bc_scalars( sq, bc_b, bc_t, ibc_b, ibc_t, err_nr_b, err_nr_t ) |
---|
[1960] | 3302 | |
---|
| 3303 | |
---|
[2312] | 3304 | IMPLICIT NONE |
---|
| 3305 | |
---|
[3048] | 3306 | CHARACTER (LEN=1) :: sq !< name of scalar quantity |
---|
| 3307 | CHARACTER (LEN=*) :: bc_b !< bottom boundary condition |
---|
| 3308 | CHARACTER (LEN=*) :: bc_t !< top boundary condition |
---|
| 3309 | CHARACTER (LEN=*) :: err_nr_b !< error number if bottom bc is unknown |
---|
| 3310 | CHARACTER (LEN=*) :: err_nr_t !< error number if top bc is unknown |
---|
[1984] | 3311 | |
---|
[3048] | 3312 | INTEGER(iwp) :: ibc_b !< index for bottom boundary condition |
---|
| 3313 | INTEGER(iwp) :: ibc_t !< index for top boundary condition |
---|
[1960] | 3314 | |
---|
[1984] | 3315 | ! |
---|
| 3316 | !-- Set Integer flags and check for possilbe errorneous settings for bottom |
---|
| 3317 | !-- boundary condition |
---|
[1960] | 3318 | IF ( bc_b == 'dirichlet' ) THEN |
---|
| 3319 | ibc_b = 0 |
---|
| 3320 | ELSEIF ( bc_b == 'neumann' ) THEN |
---|
| 3321 | ibc_b = 1 |
---|
| 3322 | ELSE |
---|
| 3323 | message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // & |
---|
| 3324 | '_b ="' // TRIM( bc_b ) // '"' |
---|
| 3325 | CALL message( 'check_parameters', err_nr_b, 1, 2, 0, 6, 0 ) |
---|
| 3326 | ENDIF |
---|
[1984] | 3327 | ! |
---|
| 3328 | !-- Set Integer flags and check for possilbe errorneous settings for top |
---|
| 3329 | !-- boundary condition |
---|
[1960] | 3330 | IF ( bc_t == 'dirichlet' ) THEN |
---|
| 3331 | ibc_t = 0 |
---|
| 3332 | ELSEIF ( bc_t == 'neumann' ) THEN |
---|
| 3333 | ibc_t = 1 |
---|
[1992] | 3334 | ELSEIF ( bc_t == 'initial_gradient' ) THEN |
---|
| 3335 | ibc_t = 2 |
---|
[3182] | 3336 | ELSEIF ( bc_t == 'nested' .OR. bc_t == 'nesting_offline' ) THEN |
---|
[1960] | 3337 | ibc_t = 3 |
---|
| 3338 | ELSE |
---|
| 3339 | message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // & |
---|
| 3340 | '_t ="' // TRIM( bc_t ) // '"' |
---|
| 3341 | CALL message( 'check_parameters', err_nr_t, 1, 2, 0, 6, 0 ) |
---|
| 3342 | ENDIF |
---|
[1984] | 3343 | |
---|
| 3344 | |
---|
[2312] | 3345 | END SUBROUTINE set_bc_scalars |
---|
[1984] | 3346 | |
---|
[2312] | 3347 | |
---|
| 3348 | |
---|
[1984] | 3349 | !------------------------------------------------------------------------------! |
---|
| 3350 | ! Description: |
---|
| 3351 | ! ------------ |
---|
[2312] | 3352 | !> Check for consistent settings of bottom boundary conditions for humidity |
---|
[1984] | 3353 | !> and scalars. |
---|
| 3354 | !------------------------------------------------------------------------------! |
---|
| 3355 | |
---|
[3048] | 3356 | SUBROUTINE check_bc_scalars( sq, bc_b, ibc_b, & |
---|
| 3357 | err_nr_1, err_nr_2, & |
---|
[1984] | 3358 | constant_flux, surface_initial_change ) |
---|
| 3359 | |
---|
| 3360 | |
---|
[2312] | 3361 | IMPLICIT NONE |
---|
| 3362 | |
---|
[3048] | 3363 | CHARACTER (LEN=1) :: sq !< name of scalar quantity |
---|
| 3364 | CHARACTER (LEN=*) :: bc_b !< bottom boundary condition |
---|
| 3365 | CHARACTER (LEN=*) :: err_nr_1 !< error number of first error |
---|
| 3366 | CHARACTER (LEN=*) :: err_nr_2 !< error number of second error |
---|
[2312] | 3367 | |
---|
[3048] | 3368 | INTEGER(iwp) :: ibc_b !< index of bottom boundary condition |
---|
[2312] | 3369 | |
---|
[3048] | 3370 | LOGICAL :: constant_flux !< flag for constant-flux layer |
---|
[2312] | 3371 | |
---|
[3048] | 3372 | REAL(wp) :: surface_initial_change !< value of initial change at the surface |
---|
[2312] | 3373 | |
---|
[1960] | 3374 | ! |
---|
| 3375 | !-- A given surface value implies Dirichlet boundary condition for |
---|
| 3376 | !-- the respective quantity. In this case specification of a constant flux is |
---|
[1970] | 3377 | !-- forbidden. However, an exception is made for large-scale forcing as well |
---|
| 3378 | !-- as land-surface model. |
---|
| 3379 | IF ( .NOT. land_surface .AND. .NOT. large_scale_forcing ) THEN |
---|
| 3380 | IF ( ibc_b == 0 .AND. constant_flux ) THEN |
---|
[3048] | 3381 | message_string = 'boundary condition: bc_' // TRIM( sq ) // & |
---|
| 3382 | '_b ' // '= "' // TRIM( bc_b ) // & |
---|
| 3383 | '" is not allowed with prescribed surface flux' |
---|
[1984] | 3384 | CALL message( 'check_parameters', err_nr_1, 1, 2, 0, 6, 0 ) |
---|
[1970] | 3385 | ENDIF |
---|
[1960] | 3386 | ENDIF |
---|
[1984] | 3387 | IF ( constant_flux .AND. surface_initial_change /= 0.0_wp ) THEN |
---|
[1960] | 3388 | WRITE( message_string, * ) 'a prescribed surface flux is not allo', & |
---|
| 3389 | 'wed with ', sq, '_surface_initial_change (/=0) = ', & |
---|
| 3390 | surface_initial_change |
---|
[1984] | 3391 | CALL message( 'check_parameters', err_nr_2, 1, 2, 0, 6, 0 ) |
---|
[2312] | 3392 | ENDIF |
---|
[1960] | 3393 | |
---|
[2312] | 3394 | |
---|
| 3395 | END SUBROUTINE check_bc_scalars |
---|
| 3396 | |
---|
| 3397 | |
---|
| 3398 | |
---|
[1] | 3399 | END SUBROUTINE check_parameters |
---|