Changeset 4559 for palm/trunk/SOURCE/check_parameters.f90
- Timestamp:
- Jun 11, 2020 8:51:48 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_parameters.f90
r4536 r4559 1 1 !> @file check_parameters.f90 2 !------------------------------------------------------------------------------ !2 !--------------------------------------------------------------------------------------------------! 3 3 ! This file is part of the PALM model system. 4 4 ! 5 ! PALM is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 8 ! version. 9 ! 10 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY 11 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 12 ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 ! 14 ! You should have received a copy of the GNU General Public License along with 15 ! PALM. If not, see <http://www.gnu.org/licenses/>. 5 ! PALM is free software: you can redistribute it and/or modify it under the terms of the GNU General 6 ! Public License as published by the Free Software Foundation, either version 3 of the License, or 7 ! (at your option) any later version. 8 ! 9 ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 10 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 11 ! Public License for more details. 12 ! 13 ! You should have received a copy of the GNU General Public License along with PALM. If not, see 14 ! <http://www.gnu.org/licenses/>. 16 15 ! 17 16 ! Copyright 1997-2020 Leibniz Universitaet Hannover 18 !------------------------------------------------------------------------------ !17 !--------------------------------------------------------------------------------------------------! 19 18 ! 20 19 ! Current revisions: … … 25 24 ! ----------------- 26 25 ! $Id$ 26 ! file re-formatted to follow the PALM coding standard 27 ! 28 ! 4536 2020-05-17 17:24:13Z raasch 27 29 ! unneccessary query for restart data format removed 28 ! 30 ! 29 31 ! 4534 2020-05-14 18:35:22Z raasch 30 32 ! adjustments for I/O on reduced number of cores using shared memory MPI 31 ! 33 ! 32 34 ! 4514 2020-04-30 16:29:59Z suehring 33 35 ! Enable output of qsurf and ssurf 34 ! 36 ! 35 37 ! 4513 2020-04-30 13:45:47Z raasch 36 38 ! unused modules removed 37 ! 39 ! 38 40 ! 4511 2020-04-30 12:20:40Z raasch 39 41 ! call of chem_boundary_conds removed (respective settings are now done in the chemistry module) 40 ! 42 ! 41 43 ! 4495 2020-04-13 20:11:20Z raasch 42 44 ! check new restart_data_format parameters 43 ! 45 ! 44 46 ! 4493 2020-04-10 09:49:43Z pavelkrc 45 47 ! Kolmogorov length scale eta added to profile output … … 134 136 ! ------------ 135 137 !> Check control parameters and deduce further quantities. 136 !------------------------------------------------------------------------------ !138 !--------------------------------------------------------------------------------------------------! 137 139 SUBROUTINE check_parameters 138 140 … … 142 144 USE basic_constants_and_equations_mod 143 145 144 USE bulk_cloud_model_mod, &146 USE bulk_cloud_model_mod, & 145 147 ONLY: bulk_cloud_model 146 148 … … 153 155 USE indices 154 156 155 USE model_1d_mod, &157 USE model_1d_mod, & 156 158 ONLY: damp_level_1d, damp_level_ind_1d 157 159 158 USE module_interface, &159 ONLY: module_interface_check_ parameters,&160 module_interface_check_data_output_ ts,&161 module_interface_check_data_output_ pr,&162 module_interface_check_ data_output163 164 USE netcdf_data_input_mod, &165 ONLY: init_model, input_pids_static, netcdf_data_input_check_dynamic, &160 USE module_interface, & 161 ONLY: module_interface_check_data_output, & 162 module_interface_check_data_output_pr, & 163 module_interface_check_data_output_ts, & 164 module_interface_check_parameters 165 166 USE netcdf_data_input_mod, & 167 ONLY: init_model, input_pids_static, netcdf_data_input_check_dynamic, & 166 168 netcdf_data_input_check_static 167 169 168 USE netcdf_interface, & 169 ONLY: dopr_unit, do2d_unit, do3d_unit, netcdf_data_format, & 170 netcdf_data_format_string, dots_unit, heatflux_output_unit, & 171 waterflux_output_unit, momentumflux_output_unit, & 172 dots_max, dots_num, dots_label 173 174 USE particle_attributes, & 170 USE netcdf_interface, & 171 ONLY: do2d_unit, do3d_unit, dopr_unit, dots_label, dots_max, dots_num, dots_unit, & 172 heatflux_output_unit, momentumflux_output_unit, netcdf_data_format, & 173 netcdf_data_format_string, waterflux_output_unit 174 175 USE particle_attributes, & 175 176 ONLY: particle_advection, use_sgs_for_particles 176 177 177 178 USE pegrid 178 179 179 USE pmc_interface, &180 USE pmc_interface, & 180 181 ONLY: cpl_id, nested_run 181 182 … … 189 190 190 191 #if defined( __parallel ) 191 USE vertical_nesting_mod, &192 ONLY: vnested, &192 USE vertical_nesting_mod, & 193 ONLY: vnested, & 193 194 vnest_check_parameters 194 195 #endif … … 228 229 CALL location_message( 'checking parameters', 'start' ) 229 230 ! 230 !-- At first, check static and dynamic input for consistency 231 !-- At first, check static and dynamic input for consistency. 231 232 CALL netcdf_data_input_check_dynamic 232 233 CALL netcdf_data_input_check_static … … 240 241 ! 241 242 !-- Check the coupling mode 242 IF ( coupling_mode /= 'uncoupled' .AND. &243 coupling_mode /= 'precursor_atmos' .AND. &244 coupling_mode /= 'precursor_ocean' .AND. &245 coupling_mode /= 'vnested_crse' .AND. &246 coupling_mode /= 'vnested_fine' .AND. &247 coupling_mode /= 'atmosphere_to_ocean' .AND. &243 IF ( coupling_mode /= 'uncoupled' .AND. & 244 coupling_mode /= 'precursor_atmos' .AND. & 245 coupling_mode /= 'precursor_ocean' .AND. & 246 coupling_mode /= 'vnested_crse' .AND. & 247 coupling_mode /= 'vnested_fine' .AND. & 248 coupling_mode /= 'atmosphere_to_ocean' .AND. & 248 249 coupling_mode /= 'ocean_to_atmosphere' ) THEN 249 250 message_string = 'illegal coupling mode: ' // TRIM( coupling_mode ) … … 252 253 253 254 ! 254 !-- Check if humidity is set to TRUEin case of the atmospheric run (for coupled runs)255 !-- Check if humidity is set to .TRUE. in case of the atmospheric run (for coupled runs) 255 256 IF ( coupling_mode == 'atmosphere_to_ocean' .AND. .NOT. humidity) THEN 256 message_string = ' Humidity has to be set to .T. in the _p3d file ' // &257 message_string = ' Humidity has to be set to .T. in the _p3d file ' // & 257 258 'for coupled runs between ocean and atmosphere.' 258 259 CALL message( 'check_parameters', 'PA0476', 1, 2, 0, 6, 0 ) … … 297 298 ! 298 299 !-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny 299 IF ( coupling_mode /= 'uncoupled' .AND.&300 coupling_mode(1:8) /= 'vnested_' .AND.&301 coupling_mode /= 'precursor_atmos' .AND.&300 IF ( coupling_mode /= 'uncoupled' .AND. & 301 coupling_mode(1:8) /= 'vnested_' .AND. & 302 coupling_mode /= 'precursor_atmos' .AND. & 302 303 coupling_mode /= 'precursor_ocean' ) THEN 303 304 304 305 IF ( dt_coupling == 9999999.9_wp ) THEN 305 message_string = 'dt_coupling is not set but required for coup ' //&306 'ling mode "' //TRIM( coupling_mode ) // '"'306 message_string = 'dt_coupling is not set but required for coupling mode "' // & 307 TRIM( coupling_mode ) // '"' 307 308 CALL message( 'check_parameters', 'PA0003', 1, 2, 0, 6, 0 ) 308 309 ENDIF … … 312 313 313 314 IF ( myid == 0 ) THEN 314 CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, & 315 ierr ) 316 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, & 317 status, ierr ) 315 CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, ierr ) 316 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, status, ierr ) 318 317 ENDIF 319 318 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 320 319 321 320 IF ( dt_coupling /= remote ) THEN 322 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 323 '": dt_coupling = ', dt_coupling, '& is not equal to ', & 324 'dt_coupling_remote = ', remote 321 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), '": dt_coupling = ',& 322 dt_coupling, '& is not equal to ', 'dt_coupling_remote = ', remote 325 323 CALL message( 'check_parameters', 'PA0004', 1, 2, 0, 6, 0 ) 326 324 ENDIF … … 329 327 IF ( myid == 0 ) THEN 330 328 CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr ) 331 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & 332 status, ierr ) 329 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, status, ierr ) 333 330 ENDIF 334 331 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 335 332 336 333 dt_coupling = MAX( dt_max, remote ) 337 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &338 '": dt_coupling <= 0.0 & is not allowed and is reset to ', 339 'MAX(dt_max(A,O)) = ',dt_coupling334 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 335 '": dt_coupling <= 0.0 & is not allowed and is reset to ', 'MAX(dt_max(A,O)) = ', & 336 dt_coupling 340 337 CALL message( 'check_parameters', 'PA0005', 0, 1, 0, 6, 0 ) 341 338 ENDIF 342 339 343 340 IF ( myid == 0 ) THEN 344 CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, & 345 ierr ) 346 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & 347 status, ierr ) 341 CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, ierr ) 342 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, status, ierr ) 348 343 ENDIF 349 344 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 350 345 351 346 IF ( restart_time /= remote ) THEN 352 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &353 '": restart_time = ', restart_time, '& is not equal to ', &347 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 348 '": restart_time = ', restart_time, '& is not equal to ', & 354 349 'restart_time_remote = ', remote 355 350 CALL message( 'check_parameters', 'PA0006', 1, 2, 0, 6, 0 ) … … 357 352 358 353 IF ( myid == 0 ) THEN 359 CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, & 360 ierr ) 361 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & 362 status, ierr ) 354 CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, ierr ) 355 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, status, ierr ) 363 356 ENDIF 364 357 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 365 358 366 359 IF ( dt_restart /= remote ) THEN 367 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 368 '": dt_restart = ', dt_restart, '& is not equal to ', & 369 'dt_restart_remote = ', remote 360 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), '": dt_restart = ', & 361 dt_restart, '& is not equal to ', 'dt_restart_remote = ', remote 370 362 CALL message( 'check_parameters', 'PA0007', 1, 2, 0, 6, 0 ) 371 363 ENDIF … … 373 365 time_to_be_simulated_from_reference_point = end_time-coupling_start_time 374 366 375 IF ( myid == 0 ) THEN 376 CALL MPI_SEND( time_to_be_simulated_from_reference_point, 1, & 377 MPI_REAL, target_id, 14, comm_inter, ierr ) 378 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & 379 status, ierr ) 367 IF ( myid == 0 ) THEN 368 CALL MPI_SEND( time_to_be_simulated_from_reference_point, 1, MPI_REAL, target_id, 14, & 369 comm_inter, ierr ) 370 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, status, ierr ) 380 371 ENDIF 381 372 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 382 373 383 374 IF ( time_to_be_simulated_from_reference_point /= remote ) THEN 384 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), &385 '": time_to_be_simulated_from_reference_point = ', &386 time_to_be_simulated_from_reference_point, '& is not equal ', &387 'to time_to_be_simulated_from_reference_point_remote = ', &375 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 376 '": time_to_be_simulated_from_reference_point = ', & 377 time_to_be_simulated_from_reference_point, '& is not equal ', & 378 'to time_to_be_simulated_from_reference_point_remote = ', & 388 379 remote 389 380 CALL message( 'check_parameters', 'PA0008', 1, 2, 0, 6, 0 ) … … 392 383 IF ( myid == 0 ) THEN 393 384 CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr ) 394 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, & 395 status, ierr ) 385 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, status, ierr ) 396 386 ENDIF 397 387 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) … … 401 391 402 392 IF ( dx < remote ) THEN 403 WRITE( message_string, * ) 'coupling mode "', & 404 TRIM( coupling_mode ), & 405 '": dx in Atmosphere is not equal to or not larger than dx in ocean' 393 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 394 '": dx in Atmosphere is not equal to or not larger than dx in ocean' 406 395 CALL message( 'check_parameters', 'PA0009', 1, 2, 0, 6, 0 ) 407 396 ENDIF 408 397 409 398 IF ( (nx_a+1)*dx /= (nx_o+1)*remote ) THEN 410 WRITE( message_string, * ) 'coupling mode "', & 411 TRIM( coupling_mode ), & 412 '": Domain size in x-direction is not equal in ocean and atmosphere' 399 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 400 '": Domain size in x-direction is not equal in ocean and atmosphere' 413 401 CALL message( 'check_parameters', 'PA0010', 1, 2, 0, 6, 0 ) 414 402 ENDIF … … 418 406 IF ( myid == 0) THEN 419 407 CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr ) 420 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, & 421 status, ierr ) 408 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, status, ierr ) 422 409 ENDIF 423 410 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) … … 426 413 427 414 IF ( dy < remote ) THEN 428 WRITE( message_string, * ) 'coupling mode "', & 429 TRIM( coupling_mode ), & 430 '": dy in Atmosphere is not equal to or not larger than dy in ocean' 415 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 416 '": dy in Atmosphere is not equal to or not larger than dy in ocean' 431 417 CALL message( 'check_parameters', 'PA0011', 1, 2, 0, 6, 0 ) 432 418 ENDIF 433 419 434 420 IF ( (ny_a+1)*dy /= (ny_o+1)*remote ) THEN 435 WRITE( message_string, * ) 'coupling mode "', & 436 TRIM( coupling_mode ), & 437 '": Domain size in y-direction is not equal in ocean and atmosphere' 421 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 422 '": Domain size in y-direction is not equal in ocean and atmosphere' 438 423 CALL message( 'check_parameters', 'PA0012', 1, 2, 0, 6, 0 ) 439 424 ENDIF 440 425 441 IF ( MOD(nx_o+1,nx_a+1) /= 0 ) THEN 442 WRITE( message_string, * ) 'coupling mode "', & 443 TRIM( coupling_mode ), & 444 '": nx+1 in ocean is not divisible by nx+1 in', & 445 ' atmosphere without remainder' 426 IF ( MOD( nx_o+1, nx_a+1 ) /= 0 ) THEN 427 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 428 '": nx+1 in ocean is not divisible by nx+1 in', ' atmosphere without remainder' 446 429 CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 ) 447 430 ENDIF 448 431 449 432 IF ( MOD(ny_o+1,ny_a+1) /= 0 ) THEN 450 WRITE( message_string, * ) 'coupling mode "', & 451 TRIM( coupling_mode ), & 452 '": ny+1 in ocean is not divisible by ny+1 in', & 453 ' atmosphere without remainder' 433 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 434 '": ny+1 in ocean is not divisible by ny+1 in', ' atmosphere without remainder' 454 435 455 436 CALL message( 'check_parameters', 'PA0340', 1, 2, 0, 6, 0 ) … … 458 439 ENDIF 459 440 #else 460 WRITE( message_string, * ) 'coupling requires PALM to be compiled with', &461 ' cpp-option "-D__parallel"'441 WRITE( message_string, * ) 'coupling requires PALM to be compiled with', & 442 ' cpp-option "-D__parallel"' 462 443 CALL message( 'check_parameters', 'PA0141', 1, 2, 0, 6, 0 ) 463 444 #endif … … 467 448 ! 468 449 !-- Exchange via intercommunicator 469 IF ( coupling_mode == 'atmosphere_to_ocean' .AND. myid == 0 ) THEN 470 CALL MPI_SEND( humidity, 1, MPI_LOGICAL, target_id, 19, comm_inter, & 471 ierr ) 472 ELSEIF ( coupling_mode == 'ocean_to_atmosphere' .AND. myid == 0) THEN 473 CALL MPI_RECV( humidity_remote, 1, MPI_LOGICAL, target_id, 19, & 474 comm_inter, status, ierr ) 450 IF ( coupling_mode == 'atmosphere_to_ocean' .AND. myid == 0 ) THEN 451 CALL MPI_SEND( humidity, 1, MPI_LOGICAL, target_id, 19, comm_inter, ierr ) 452 ELSEIF ( coupling_mode == 'ocean_to_atmosphere' .AND. myid == 0) THEN 453 CALL MPI_RECV( humidity_remote, 1, MPI_LOGICAL, target_id, 19, comm_inter, status, ierr ) 475 454 ENDIF 476 455 CALL MPI_BCAST( humidity_remote, 1, MPI_LOGICAL, 0, comm2d, ierr) … … 479 458 480 459 ! 481 !-- User settings for restart times requires that "restart" has been given as 482 !-- file activation string. Otherwise, binary output would not be saved by 483 !-- palmrun. 484 IF ( ( restart_time /= 9999999.9_wp .OR. dt_restart /= 9999999.9_wp ) & 460 !-- User settings for restart times requires that "restart" has been given as file activation 461 !-- string. Otherwise, binary output would not be saved by palmrun. 462 IF ( ( restart_time /= 9999999.9_wp .OR. dt_restart /= 9999999.9_wp ) & 485 463 .AND. .NOT. write_binary ) THEN 486 WRITE( message_string, * ) 'manual restart settings requires file ', &464 WRITE( message_string, * ) 'manual restart settings requires file ', & 487 465 'activation string "restart"' 488 466 CALL message( 'check_parameters', 'PA0001', 1, 2, 0, 6, 0 ) … … 491 469 492 470 ! 493 !-- Generate the file header which is used as a header for most of PALM's 494 !-- output files 471 !-- Generate the file header which is used as a header for most of PALM's output files 495 472 CALL DATE_AND_TIME( date, time, run_zone ) 496 run_date = date(1:4) //'-'//date(5:6)//'-'//date(7:8)497 run_time = time(1:2) //':'//time(3:4)//':'//time(5:6)473 run_date = date(1:4) // '-' // date(5:6) // '-' // date(7:8) 474 run_time = time(1:2) // ':' // time(3:4) // ':' // time(5:6) 498 475 IF ( coupling_mode == 'uncoupled' ) THEN 499 476 coupling_string = '' … … 518 495 ENDIF 519 496 520 WRITE ( run_description_header, & 521 '(A,2X,A,2X,A,A,A,I2.2,A,A,A,2X,A,A,2X,A,1X,A)' ) & 522 TRIM( version ), TRIM( revision ), 'run: ', & 523 TRIM( run_identifier ), '.', runnr, TRIM( coupling_string ), & 524 TRIM( nest_string ), TRIM( ensemble_string), 'host: ', TRIM( host ), & 525 run_date, run_time 497 WRITE ( run_description_header, '(A,2X,A,2X,A,A,A,I2.2,A,A,A,2X,A,A,2X,A,1X,A)' ) & 498 TRIM( version ), TRIM( revision ), 'run: ', TRIM( run_identifier ), '.', runnr, & 499 TRIM( coupling_string ), TRIM( nest_string ), TRIM( ensemble_string), 'host: ', & 500 TRIM( host ), run_date, run_time 526 501 527 502 ! … … 533 508 534 509 CASE DEFAULT 535 message_string = 'illegal value given for loop_optimization: "' // &510 message_string = 'illegal value given for loop_optimization: "' // & 536 511 TRIM( loop_optimization ) // '"' 537 512 CALL message( 'check_parameters', 'PA0013', 1, 2, 0, 6, 0 ) … … 543 518 IF ( topography /= 'flat' ) THEN 544 519 action = ' ' 545 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' & 546 ) THEN 520 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' ) THEN 547 521 WRITE( action, '(A,A)' ) 'scalar_advec = ', scalar_advec 548 522 ENDIF 549 IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' )& 550 THEN 523 IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) THEN 551 524 WRITE( action, '(A,A)' ) 'momentum_advec = ', momentum_advec 552 525 ENDIF … … 563 536 WRITE( action, '(A)' ) 'cloud_droplets = .TRUE.' 564 537 ENDIF 565 IF ( .NOT. constant_flux_layer .AND. topography /= 'closed_channel' ) & 566 THEN 538 IF ( .NOT. constant_flux_layer .AND. topography /= 'closed_channel' ) THEN 567 539 WRITE( action, '(A)' ) 'constant_flux_layer = .FALSE.' 568 540 ENDIF 569 541 IF ( action /= ' ' ) THEN 570 message_string = 'The specified topography does not allow ' // & 571 TRIM( action ) 542 message_string = 'The specified topography does not allow ' // TRIM( action ) 572 543 CALL message( 'check_parameters', 'PA0014', 1, 2, 0, 6, 0 ) 573 544 ENDIF 574 545 ! 575 546 !-- Check illegal/untested parameter combinations for closed channel 576 If ( topography == 'closed_channel' ) THEN547 If ( topography == 'closed_channel' ) THEN 577 548 symmetry_flag = 1 578 549 message_string = 'Bottom and top boundary are treated equal' 579 550 CALL message( 'check_parameters', 'PA0699', 0, 0, 0, 6, 0 ) 580 551 581 IF ( dz(1) /= dz(COUNT( dz /= -1.0_wp )) .OR. & 582 dz_stretch_level /= -9999999.9_wp) THEN 583 WRITE( message_string, * ) 'dz should be equal close to the ' // & 552 IF ( dz(1) /= dz(COUNT( dz /= -1.0_wp )) .OR. dz_stretch_level /= -9999999.9_wp) THEN 553 WRITE( message_string, * ) 'dz should be equal close to the ' // & 584 554 'boundaries due to symmetrical problem' 585 555 CALL message( 'check_parameters', 'PA0700', 1, 2, 0, 6, 0 ) 586 556 ENDIF 587 557 588 IF ( constant_flux_layer ) THEN 589 WRITE( message_string, * ) 'A constant flux layer is not '// & 590 'allowed if a closed channel '// & 591 'shall be used' 558 IF ( constant_flux_layer ) THEN 559 WRITE( message_string, * ) 'A constant flux layer is not ' // & 560 'allowed if a closed channel shall be used' 592 561 CALL message( 'check_parameters', 'PA0701', 1, 2, 0, 6, 0 ) 593 562 ENDIF 594 563 595 IF ( ocean_mode ) THEN596 WRITE( message_string, * ) 'The ocean mode is not allowed if ' //&564 IF ( ocean_mode ) THEN 565 WRITE( message_string, * ) 'The ocean mode is not allowed if ' // & 597 566 'a closed channel shall be used' 598 567 CALL message( 'check_parameters', 'PA0702', 1, 2, 0, 6, 0 ) 599 568 ENDIF 600 569 601 IF ( momentum_advec /= 'ws-scheme' .OR. & 602 scalar_advec /= 'ws-scheme' ) THEN 603 WRITE( message_string, * ) 'A closed channel require the '// & 604 'upwind scheme of Wicker and ' // & 605 'Skamarock as the advection scheme' 570 IF ( momentum_advec /= 'ws-scheme' .OR. & 571 scalar_advec /= 'ws-scheme' ) THEN 572 WRITE( message_string, * ) 'A closed channel require the upwind scheme of Wicker' // & 573 ' and Skamarock as the advection scheme' 606 574 CALL message( 'check_parameters', 'PA0703', 1, 2, 0, 6, 0 ) 607 575 ENDIF … … 611 579 ! 612 580 !-- Check approximation 613 IF ( TRIM( approximation ) /= 'boussinesq' .AND. & 614 TRIM( approximation ) /= 'anelastic' ) THEN 615 message_string = 'unknown approximation: approximation = "' // & 616 TRIM( approximation ) // '"' 581 IF ( TRIM( approximation ) /= 'boussinesq' .AND. TRIM( approximation ) /= 'anelastic' ) THEN 582 message_string = 'unknown approximation: approximation = "' // TRIM( approximation ) // '"' 617 583 CALL message( 'check_parameters', 'PA0446', 1, 2, 0, 6, 0 ) 618 584 ENDIF … … 620 586 ! 621 587 !-- Check approximation requirements 622 IF ( TRIM( approximation ) == 'anelastic' .AND. & 623 TRIM( momentum_advec ) /= 'ws-scheme' ) THEN 624 message_string = 'Anelastic approximation requires ' // & 625 'momentum_advec = "ws-scheme"' 588 IF ( TRIM( approximation ) == 'anelastic' .AND. TRIM( momentum_advec ) /= 'ws-scheme' ) THEN 589 message_string = 'Anelastic approximation requires momentum_advec = "ws-scheme"' 626 590 CALL message( 'check_parameters', 'PA0447', 1, 2, 0, 6, 0 ) 627 591 ENDIF 628 IF ( TRIM( approximation ) == 'anelastic' .AND. & 629 TRIM( psolver ) == 'multigrid' ) THEN 630 message_string = 'Anelastic approximation currently only supports ' // & 631 'psolver = "poisfft", ' // & 632 'psolver = "sor" and ' // & 633 'psolver = "multigrid_noopt"' 592 IF ( TRIM( approximation ) == 'anelastic' .AND. TRIM( psolver ) == 'multigrid' ) THEN 593 message_string = 'Anelastic approximation currently only supports psolver = "poisfft", ' // & 594 'psolver = "sor" and psolver = "multigrid_noopt"' 634 595 CALL message( 'check_parameters', 'PA0448', 1, 2, 0, 6, 0 ) 635 596 ENDIF 636 IF ( TRIM( approximation ) == 'anelastic' .AND. & 637 conserve_volume_flow ) THEN 638 message_string = 'Anelastic approximation is not allowed with ' // & 597 IF ( TRIM( approximation ) == 'anelastic' .AND. conserve_volume_flow ) THEN 598 message_string = 'Anelastic approximation is not allowed with ' // & 639 599 'conserve_volume_flow = .TRUE.' 640 600 CALL message( 'check_parameters', 'PA0449', 1, 2, 0, 6, 0 ) … … 643 603 ! 644 604 !-- Check flux input mode 645 IF ( TRIM( flux_input_mode ) /= 'dynamic' .AND. & 646 TRIM( flux_input_mode ) /= 'kinematic' .AND. & 647 TRIM( flux_input_mode ) /= 'approximation-specific' ) THEN 648 message_string = 'unknown flux input mode: flux_input_mode = "' // & 605 IF ( TRIM( flux_input_mode ) /= 'dynamic' .AND. TRIM( flux_input_mode ) /= 'kinematic' & 606 .AND. TRIM( flux_input_mode ) /= 'approximation-specific' ) THEN 607 message_string = 'unknown flux input mode: flux_input_mode = "' // & 649 608 TRIM( flux_input_mode ) // '"' 650 609 CALL message( 'check_parameters', 'PA0450', 1, 2, 0, 6, 0 ) … … 662 621 ! 663 622 !-- Check flux output mode 664 IF ( TRIM( flux_output_mode ) /= 'dynamic' .AND. & 665 TRIM( flux_output_mode ) /= 'kinematic' .AND. & 666 TRIM( flux_output_mode ) /= 'approximation-specific' ) THEN 667 message_string = 'unknown flux output mode: flux_output_mode = "' // & 623 IF ( TRIM( flux_output_mode ) /= 'dynamic' .AND. TRIM( flux_output_mode ) /= 'kinematic' & 624 .AND. TRIM( flux_output_mode ) /= 'approximation-specific' ) THEN 625 message_string = 'unknown flux output mode: flux_output_mode = "' // & 668 626 TRIM( flux_output_mode ) // '"' 669 627 CALL message( 'check_parameters', 'PA0451', 1, 2, 0, 6, 0 ) … … 681 639 682 640 ! 683 !-- When the land- or urban-surface model is used, the flux output must be 684 !-- dynamic. 641 !-- When the land- or urban-surface model is used, the flux output must be dynamic. 685 642 IF ( land_surface .OR. urban_surface ) THEN 686 643 flux_output_mode = 'dynamic' … … 689 646 ! 690 647 !-- Set the flux output units according to flux_output_mode 691 IF ( TRIM( flux_output_mode ) == 'kinematic' ) THEN648 IF ( TRIM( flux_output_mode ) == 'kinematic' ) THEN 692 649 heatflux_output_unit = 'K m/s' 693 650 waterflux_output_unit = 'kg/kg m/s' 694 651 momentumflux_output_unit = 'm2/s2' 695 ELSEIF ( TRIM( flux_output_mode ) == 'dynamic' ) THEN652 ELSEIF ( TRIM( flux_output_mode ) == 'dynamic' ) THEN 696 653 heatflux_output_unit = 'W/m2' 697 654 waterflux_output_unit = 'W/m2' … … 712 669 !-- Check if maximum number of allowed timeseries is exceeded 713 670 IF ( dots_num > dots_max ) THEN 714 WRITE( message_string, * ) 'number of time series quantities exceeds', &715 ' its maximum of dots_max = ', dots_max, &671 WRITE( message_string, * ) 'number of time series quantities exceeds', & 672 ' its maximum of dots_max = ', dots_max, & 716 673 '&Please increase dots_max in modules.f90.' 717 674 CALL message( 'init_3d_model', 'PA0194', 1, 2, 0, 6, 0 ) … … 721 678 !-- Check whether there are any illegal values 722 679 !-- Pressure solver: 723 IF ( psolver /= 'poisfft' .AND. psolver /= 'sor' .AND. 724 psolver /= 'multigrid ' .AND. psolver /= 'multigrid_noopt' ) THEN725 message_string = 'unknown solver for perturbation pressure: psolver' // &680 IF ( psolver /= 'poisfft' .AND. psolver /= 'sor' .AND. psolver /= 'multigrid' .AND. & 681 psolver /= 'multigrid_noopt' ) THEN 682 message_string = 'unknown solver for perturbation pressure: psolver' // & 726 683 ' = "' // TRIM( psolver ) // '"' 727 684 CALL message( 'check_parameters', 'PA0016', 1, 2, 0, 6, 0 ) … … 734 691 gamma_mg = 1 735 692 ELSE 736 message_string = 'unknown multigrid cycle: cycle_mg = "' // & 737 TRIM( cycle_mg ) // '"' 693 message_string = 'unknown multigrid cycle: cycle_mg = "' // TRIM( cycle_mg ) // '"' 738 694 CALL message( 'check_parameters', 'PA0020', 1, 2, 0, 6, 0 ) 739 695 ENDIF 740 696 ENDIF 741 697 742 IF ( fft_method /= 'singleton-algorithm' .AND. & 743 fft_method /= 'temperton-algorithm' .AND. & 744 fft_method /= 'fftw' .AND. & 745 fft_method /= 'system-specific' ) THEN 746 message_string = 'unknown fft-algorithm: fft_method = "' // & 747 TRIM( fft_method ) // '"' 698 IF ( fft_method /= 'singleton-algorithm' .AND. fft_method /= 'temperton-algorithm' .AND. & 699 fft_method /= 'fftw' .AND. fft_method /= 'system-specific' ) THEN 700 message_string = 'unknown fft-algorithm: fft_method = "' // TRIM( fft_method ) // '"' 748 701 CALL message( 'check_parameters', 'PA0021', 1, 2, 0, 6, 0 ) 749 702 ENDIF 750 703 751 IF( momentum_advec == 'ws-scheme' .AND. & 752 .NOT. call_psolver_at_all_substeps ) THEN 753 message_string = 'psolver must be called at each RK3 substep when "'// & 754 TRIM(momentum_advec) // ' "is used for momentum_advec' 704 IF( momentum_advec == 'ws-scheme' .AND. .NOT. call_psolver_at_all_substeps ) THEN 705 message_string = 'psolver must be called at each RK3 substep when "'// & 706 TRIM(momentum_advec) // ' "is used for momentum_advec' 755 707 CALL message( 'check_parameters', 'PA0344', 1, 2, 0, 6, 0 ) 756 708 END IF 757 709 ! 758 710 !-- Advection schemes: 759 IF ( momentum_advec /= 'pw-scheme' .AND. & 760 momentum_advec /= 'ws-scheme' .AND. & 761 momentum_advec /= 'up-scheme' ) & 762 THEN 763 message_string = 'unknown advection scheme: momentum_advec = "' // & 711 IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' .AND. & 712 momentum_advec /= 'up-scheme' ) THEN 713 message_string = 'unknown advection scheme: momentum_advec = "' // & 764 714 TRIM( momentum_advec ) // '"' 765 715 CALL message( 'check_parameters', 'PA0022', 1, 2, 0, 6, 0 ) 766 716 ENDIF 767 IF ( ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & 768 .AND. ( timestep_scheme == 'euler' .OR. & 769 timestep_scheme == 'runge-kutta-2' ) ) & 770 THEN 771 message_string = 'momentum_advec or scalar_advec = "' & 772 // TRIM( momentum_advec ) // '" is not allowed with ' // & 773 'timestep_scheme = "' // TRIM( timestep_scheme ) // '"' 717 IF ( ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & 718 .AND. ( timestep_scheme == 'euler' .OR. timestep_scheme == 'runge-kutta-2' ) ) THEN 719 message_string = 'momentum_advec or scalar_advec = "' // TRIM( momentum_advec ) // & 720 '" is not allowed with timestep_scheme = "' // & 721 TRIM( timestep_scheme ) // '"' 774 722 CALL message( 'check_parameters', 'PA0023', 1, 2, 0, 6, 0 ) 775 723 ENDIF 776 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' .AND. & 777 scalar_advec /= 'bc-scheme' .AND. scalar_advec /= 'up-scheme' ) & 778 THEN 779 message_string = 'unknown advection scheme: scalar_advec = "' // & 780 TRIM( scalar_advec ) // '"' 724 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' .AND. & 725 scalar_advec /= 'bc-scheme' .AND. scalar_advec /= 'up-scheme' ) THEN 726 message_string = 'unknown advection scheme: scalar_advec = "' // TRIM( scalar_advec ) // '"' 781 727 CALL message( 'check_parameters', 'PA0024', 1, 2, 0, 6, 0 ) 782 728 ENDIF 783 IF ( scalar_advec == 'bc-scheme' .AND. loop_optimization == 'cache' ) & 784 THEN 785 message_string = 'advection_scheme scalar_advec = "' & 786 // TRIM( scalar_advec ) // '" not implemented for ' // & 787 'loop_optimization = "' // TRIM( loop_optimization ) // '"' 729 IF ( scalar_advec == 'bc-scheme' .AND. loop_optimization == 'cache' ) THEN 730 message_string = 'advection_scheme scalar_advec = "' // TRIM( scalar_advec ) // & 731 '" not implemented for loop_optimization = "' // & 732 TRIM( loop_optimization ) // '"' 788 733 CALL message( 'check_parameters', 'PA0026', 1, 2, 0, 6, 0 ) 789 734 ENDIF 790 735 791 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets .AND. & 792 .NOT. use_upstream_for_tke .AND. & 793 scalar_advec /= 'ws-scheme' & 794 ) THEN 736 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets .AND. .NOT. use_upstream_for_tke & 737 .AND. scalar_advec /= 'ws-scheme' ) THEN 795 738 use_upstream_for_tke = .TRUE. 796 message_string = 'use_upstream_for_tke is set to .TRUE. because ' // & 797 'use_sgs_for_particles = .TRUE. ' // & 798 'and scalar_advec /= ws-scheme' 739 message_string = 'use_upstream_for_tke is set to .TRUE. because ' // & 740 'use_sgs_for_particles = .TRUE. and scalar_advec /= ws-scheme' 799 741 CALL message( 'check_parameters', 'PA0025', 0, 1, 0, 6, 0 ) 800 742 ENDIF … … 820 762 821 763 CASE DEFAULT 822 message_string = 'unknown timestep scheme: timestep_scheme = "' // &764 message_string = 'unknown timestep scheme: timestep_scheme = "' // & 823 765 TRIM( timestep_scheme ) // '"' 824 766 CALL message( 'check_parameters', 'PA0027', 1, 2, 0, 6, 0 ) … … 826 768 END SELECT 827 769 828 IF ( ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme')&829 .AND. timestep_scheme(1:5) == 'runge' ) THEN830 message_string = 'momentum advection scheme "' // &831 TRIM( momentum_advec ) // '" & does not work with ' //&832 'timestep_scheme "' // TRIM( timestep_scheme )// '"'770 IF ( ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) & 771 .AND. timestep_scheme(1:5) == 'runge' ) THEN 772 message_string = 'momentum advection scheme "' // TRIM( momentum_advec ) // & 773 '" & does not work with timestep_scheme "' // TRIM( timestep_scheme ) & 774 // '"' 833 775 CALL message( 'check_parameters', 'PA0029', 1, 2, 0, 6, 0 ) 834 776 ENDIF … … 836 778 !-- Check for proper settings for microphysics 837 779 IF ( bulk_cloud_model .AND. cloud_droplets ) THEN 838 message_string = 'bulk_cloud_model = .TRUE. is not allowed with ' // & 839 'cloud_droplets = .TRUE.' 780 message_string = 'bulk_cloud_model = .TRUE. is not allowed with cloud_droplets = .TRUE.' 840 781 CALL message( 'check_parameters', 'PA0442', 1, 2, 0, 6, 0 ) 841 782 ENDIF … … 848 789 ENDIF 849 790 850 IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. &791 IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & 851 792 TRIM( initializing_actions ) /= 'cyclic_fill' ) THEN 852 793 ! … … 857 798 SELECT CASE ( action(1:position-1) ) 858 799 859 CASE ( 'set_constant_profiles', 'set_1d-model_profiles', & 860 'by_user', 'initialize_vortex', 'initialize_ptanom', & 861 'initialize_bubble', 'inifor' ) 800 CASE ( 'set_constant_profiles', 'set_1d-model_profiles', 'by_user', & 801 'initialize_vortex', 'initialize_ptanom', 'initialize_bubble', 'inifor' ) 862 802 action = action(position+1:) 863 803 864 804 CASE DEFAULT 865 message_string = 'initializing_action = "' // &805 message_string = 'initializing_action = "' // & 866 806 TRIM( action ) // '" unknown or not allowed' 867 807 CALL message( 'check_parameters', 'PA0030', 1, 2, 0, 6, 0 ) … … 871 811 ENDIF 872 812 873 IF ( TRIM( initializing_actions ) == 'initialize_vortex' .AND. & 874 conserve_volume_flow ) THEN 875 message_string = 'initializing_actions = "initialize_vortex"' // & 876 ' is not allowed with conserve_volume_flow = .T.' 813 IF ( TRIM( initializing_actions ) == 'initialize_vortex' .AND. conserve_volume_flow ) THEN 814 message_string = 'initializing_actions = "initialize_vortex"' // & 815 ' is not allowed with conserve_volume_flow = .T.' 877 816 CALL message( 'check_parameters', 'PA0343', 1, 2, 0, 6, 0 ) 878 817 ENDIF 879 818 880 819 881 IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. &820 IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & 882 821 INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN 883 message_string = 'initializing_actions = "set_constant_profiles"' // & 884 ' and "set_1d-model_profiles" are not allowed ' // & 885 'simultaneously' 822 message_string = 'initializing_actions = "set_constant_profiles"' // & 823 ' and "set_1d-model_profiles" are not allowed simultaneously' 886 824 CALL message( 'check_parameters', 'PA0031', 1, 2, 0, 6, 0 ) 887 825 ENDIF 888 826 889 IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. &827 IF ( INDEX( initializing_actions, 'set_constant_profiles' ) /= 0 .AND. & 890 828 INDEX( initializing_actions, 'by_user' ) /= 0 ) THEN 891 message_string = 'initializing_actions = "set_constant_profiles"' // &829 message_string = 'initializing_actions = "set_constant_profiles"' // & 892 830 ' and "by_user" are not allowed simultaneously' 893 831 CALL message( 'check_parameters', 'PA0032', 1, 2, 0, 6, 0 ) 894 832 ENDIF 895 833 896 IF ( INDEX( initializing_actions, 'by_user' ) /= 0 .AND. &834 IF ( INDEX( initializing_actions, 'by_user' ) /= 0 .AND. & 897 835 INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) THEN 898 message_string = 'initializing_actions = "by_user" and ' // &836 message_string = 'initializing_actions = "by_user" and ' // & 899 837 '"set_1d-model_profiles" are not allowed simultaneously' 900 838 CALL message( 'check_parameters', 'PA0033', 1, 2, 0, 6, 0 ) 901 839 ENDIF 902 840 ! 903 !-- In case of spinup and nested run, spinup end time must be identical 904 !-- in order to havesynchronously running simulations.841 !-- In case of spinup and nested run, spinup end time must be identical in order to have 842 !-- synchronously running simulations. 905 843 IF ( nested_run ) THEN 906 844 #if defined( __parallel ) 907 CALL MPI_ALLREDUCE( spinup_time, spinup_time_max, 1, MPI_REAL, & 908 MPI_MAX, MPI_COMM_WORLD, ierr ) 909 CALL MPI_ALLREDUCE( dt_spinup, dt_spinup_max, 1, MPI_REAL, & 910 MPI_MAX, MPI_COMM_WORLD, ierr ) 911 912 IF ( spinup_time /= spinup_time_max .OR. dt_spinup /= dt_spinup_max ) & 913 THEN 914 message_string = 'In case of nesting, spinup_time and ' // & 915 'dt_spinup must be identical in all parent ' // & 916 'and child domains.' 845 CALL MPI_ALLREDUCE( spinup_time, spinup_time_max, 1, MPI_REAL, MPI_MAX, MPI_COMM_WORLD, & 846 ierr ) 847 CALL MPI_ALLREDUCE( dt_spinup, dt_spinup_max, 1, MPI_REAL, MPI_MAX, MPI_COMM_WORLD, & 848 ierr ) 849 850 IF ( spinup_time /= spinup_time_max .OR. dt_spinup /= dt_spinup_max ) THEN 851 message_string = 'In case of nesting, spinup_time and ' // & 852 'dt_spinup must be identical in all parent and child domains.' 917 853 CALL message( 'check_parameters', 'PA0489', 3, 2, 0, 6, 0 ) 918 854 ENDIF … … 920 856 ENDIF 921 857 922 IF ( bulk_cloud_model .AND. .NOT. 923 WRITE( message_string, * ) 'bulk_cloud_model = ', bulk_cloud_model, &858 IF ( bulk_cloud_model .AND. .NOT. humidity ) THEN 859 WRITE( message_string, * ) 'bulk_cloud_model = ', bulk_cloud_model, & 924 860 ' is not allowed with humidity = ', humidity 925 861 CALL message( 'check_parameters', 'PA0034', 1, 2, 0, 6, 0 ) … … 927 863 928 864 IF ( humidity .AND. sloping_surface ) THEN 929 message_string = 'humidity = .TRUE. and sloping_surface = .TRUE. ' // &865 message_string = 'humidity = .TRUE. and sloping_surface = .TRUE. ' // & 930 866 'are not allowed simultaneously' 931 867 CALL message( 'check_parameters', 'PA0036', 1, 2, 0, 6, 0 ) … … 936 872 937 873 ! 938 !-- In case of no restart run, check initialising parameters and calculate 939 !-- further quantities 874 !-- In case of no restart run, check initialising parameters and calculate further quantities 940 875 IF ( TRIM( initializing_actions ) /= 'read_restart_data' ) THEN 941 876 … … 947 882 948 883 !-- 949 !-- If required, compute initial profile of the geostrophic wind 950 !-- (component ug) 884 !-- If required, compute initial profile of the geostrophic wind (component ug) 951 885 i = 1 952 886 gradient = 0.0_wp … … 958 892 DO k = 1, nzt+1 959 893 IF ( i < 11 ) THEN 960 IF ( ug_vertical_gradient_level(i) < zu(k) .AND. &894 IF ( ug_vertical_gradient_level(i) < zu(k) .AND. & 961 895 ug_vertical_gradient_level(i) >= 0.0_wp ) THEN 962 896 gradient = ug_vertical_gradient(i) / 100.0_wp … … 982 916 DO k = nzt, nzb, -1 983 917 IF ( i < 11 ) THEN 984 IF ( ug_vertical_gradient_level(i) > zu(k) .AND. &918 IF ( ug_vertical_gradient_level(i) > zu(k) .AND. & 985 919 ug_vertical_gradient_level(i) <= 0.0_wp ) THEN 986 920 gradient = ug_vertical_gradient(i) / 100.0_wp … … 1011 945 ! 1012 946 !-- 1013 !-- If required, compute initial profile of the geostrophic wind 1014 !-- (component vg) 947 !-- If required, compute initial profile of the geostrophic wind (component vg) 1015 948 i = 1 1016 949 gradient = 0.0_wp … … 1022 955 DO k = 1, nzt+1 1023 956 IF ( i < 11 ) THEN 1024 IF ( vg_vertical_gradient_level(i) < zu(k) .AND. &957 IF ( vg_vertical_gradient_level(i) < zu(k) .AND. & 1025 958 vg_vertical_gradient_level(i) >= 0.0_wp ) THEN 1026 959 gradient = vg_vertical_gradient(i) / 100.0_wp … … 1046 979 DO k = nzt, nzb, -1 1047 980 IF ( i < 11 ) THEN 1048 IF ( vg_vertical_gradient_level(i) > zu(k) .AND. &981 IF ( vg_vertical_gradient_level(i) > zu(k) .AND. & 1049 982 vg_vertical_gradient_level(i) <= 0.0_wp ) THEN 1050 983 gradient = vg_vertical_gradient(i) / 100.0_wp … … 1074 1007 1075 1008 ! 1076 !-- Let the initial wind profiles be the calculated ug/vg profiles or 1077 !-- interpolate them from windprofile data (if given)1009 !-- Let the initial wind profiles be the calculated ug/vg profiles or interpolate them from wind 1010 !-- profile data (if given) 1078 1011 IF ( u_profile(1) == 9999999.9_wp .AND. v_profile(1) == 9999999.9_wp ) THEN 1079 1012 … … 1089 1022 1090 1023 IF ( omega /= 0.0_wp ) THEN 1091 message_string = 'Coriolis force must be switched off (by setting omega=0.0)' // &1024 message_string = 'Coriolis force must be switched off (by setting omega=0.0)' // & 1092 1025 ' when prescribing the forcing by u_profile and v_profile' 1093 1026 CALL message( 'check_parameters', 'PA0347', 1, 2, 0, 6, 0 ) … … 1110 1043 1111 1044 IF ( kk < 200 .AND. uv_heights(kk+1) /= 9999999.9_wp ) THEN 1112 u_init(k) = u_profile(kk) + ( zu(k) - uv_heights(kk) ) / &1113 ( uv_heights(kk+1) - uv_heights(kk) ) *&1114 ( u_profile(kk+1) - u_profile(kk) )1115 v_init(k) = v_profile(kk) + ( zu(k) - uv_heights(kk) ) / &1116 ( uv_heights(kk+1) - uv_heights(kk) ) *&1117 ( v_profile(kk+1) - v_profile(kk) )1045 u_init(k) = u_profile(kk) + ( zu(k) - uv_heights(kk) ) / & 1046 ( uv_heights(kk+1) - uv_heights(kk) ) * & 1047 ( u_profile(kk+1) - u_profile(kk) ) 1048 v_init(k) = v_profile(kk) + ( zu(k) - uv_heights(kk) ) / & 1049 ( uv_heights(kk+1) - uv_heights(kk) ) * & 1050 ( v_profile(kk+1) - v_profile(kk) ) 1118 1051 ELSE 1119 1052 u_init(k) = u_profile(kk) … … 1133 1066 !-- Compute initial temperature profile using the given temperature gradients 1134 1067 IF ( .NOT. neutral ) THEN 1135 CALL init_vertical_profiles( pt_vertical_gradient_level_ind, & 1136 pt_vertical_gradient_level, & 1137 pt_vertical_gradient, pt_init, & 1138 pt_surface, bc_pt_t_val ) 1068 CALL init_vertical_profiles( pt_vertical_gradient_level_ind, pt_vertical_gradient_level, & 1069 pt_vertical_gradient, pt_init, pt_surface, bc_pt_t_val ) 1139 1070 ENDIF 1140 1071 ! 1141 1072 !-- Compute initial humidity profile using the given humidity gradients 1142 1073 IF ( humidity ) THEN 1143 CALL init_vertical_profiles( q_vertical_gradient_level_ind, & 1144 q_vertical_gradient_level, & 1145 q_vertical_gradient, q_init, & 1146 q_surface, bc_q_t_val ) 1074 CALL init_vertical_profiles( q_vertical_gradient_level_ind, q_vertical_gradient_level, & 1075 q_vertical_gradient, q_init, q_surface, bc_q_t_val ) 1147 1076 ENDIF 1148 1077 ! 1149 1078 !-- Compute initial scalar profile using the given scalar gradients 1150 1079 IF ( passive_scalar ) THEN 1151 CALL init_vertical_profiles( s_vertical_gradient_level_ind, & 1152 s_vertical_gradient_level, & 1153 s_vertical_gradient, s_init, & 1154 s_surface, bc_s_t_val ) 1080 CALL init_vertical_profiles( s_vertical_gradient_level_ind, s_vertical_gradient_level, & 1081 s_vertical_gradient, s_init, s_surface, bc_s_t_val ) 1155 1082 ENDIF 1156 1083 ! … … 1164 1091 !-- Check if the control parameter use_subsidence_tendencies is used correctly 1165 1092 IF ( use_subsidence_tendencies .AND. .NOT. large_scale_subsidence ) THEN 1166 message_string = 'The usage of use_subsidence_tendencies ' // &1167 1093 message_string = 'The usage of use_subsidence_tendencies ' // & 1094 'requires large_scale_subsidence = .T..' 1168 1095 CALL message( 'check_parameters', 'PA0396', 1, 2, 0, 6, 0 ) 1169 1096 ELSEIF ( use_subsidence_tendencies .AND. .NOT. large_scale_forcing ) THEN 1170 1097 message_string = 'The usage of use_subsidence_tendencies ' // & 1171 1098 'requires large_scale_forcing = .T..' 1172 1099 CALL message( 'check_parameters', 'PA0397', 1, 2, 0, 6, 0 ) 1173 1100 ENDIF … … 1176 1103 !-- Initialize large scale subsidence if required 1177 1104 If ( large_scale_subsidence ) THEN 1178 IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp .AND. 1179 .NOT. large_scale_forcing )THEN1105 IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp .AND. .NOT. large_scale_forcing ) & 1106 THEN 1180 1107 CALL init_w_subsidence 1181 1108 ENDIF 1182 1109 ! 1183 !-- In case large_scale_forcing is used, profiles for subsidence velocity 1184 !-- are read in from file LSF_DATA 1185 1186 IF ( subs_vertical_gradient_level(1) == -9999999.9_wp .AND. & 1187 .NOT. large_scale_forcing ) THEN 1188 message_string = 'There is no default large scale vertical ' // & 1189 'velocity profile set. Specify the subsidence ' // & 1190 'velocity profile via subs_vertical_gradient ' // & 1191 'and subs_vertical_gradient_level.' 1110 !-- In case large_scale_forcing is used, profiles for subsidence velocity are read in from file 1111 !-- LSF_DATA 1112 1113 IF ( subs_vertical_gradient_level(1) == -9999999.9_wp .AND. .NOT. large_scale_forcing ) & 1114 THEN 1115 message_string = 'There is no default large scale vertical velocity profile set. ' // & 1116 'Specify the subsidence velocity profile via subs_vertical_gradient' // & 1117 ' and subs_vertical_gradient_level.' 1192 1118 CALL message( 'check_parameters', 'PA0380', 1, 2, 0, 6, 0 ) 1193 1119 ENDIF 1194 1120 ELSE 1195 1121 IF ( subs_vertical_gradient_level(1) /= -9999999.9_wp ) THEN 1196 message_string = 'Enable usage of large scale subsidence by ' // &1122 message_string = 'Enable usage of large scale subsidence by ' // & 1197 1123 'setting large_scale_subsidence = .T..' 1198 1124 CALL message( 'check_parameters', 'PA0381', 1, 2, 0, 6, 0 ) … … 1223 1149 vpt_reference = pt_reference * ( 1.0_wp + 0.61_wp * q_surface ) 1224 1150 ELSE 1225 message_string = 'illegal value for reference_state: "' // & 1226 TRIM( reference_state ) // '"' 1151 message_string = 'illegal value for reference_state: "' // TRIM( reference_state ) // '"' 1227 1152 CALL message( 'check_parameters', 'PA0056', 1, 2, 0, 6, 0 ) 1228 1153 ENDIF … … 1232 1157 IF ( alpha_surface /= 0.0_wp ) THEN 1233 1158 IF ( ABS( alpha_surface ) > 90.0_wp ) THEN 1234 WRITE( message_string, * ) 'ABS( alpha_surface = ', alpha_surface, & 1235 ' ) must be < 90.0' 1159 WRITE( message_string, * ) 'ABS( alpha_surface = ', alpha_surface, ' ) must be < 90.0' 1236 1160 CALL message( 'check_parameters', 'PA0043', 1, 2, 0, 6, 0 ) 1237 1161 ENDIF … … 1262 1186 ENDIF 1263 1187 ELSE 1264 WRITE( message_string, * ) 'cfl_factor = ', cfl_factor, &1188 WRITE( message_string, * ) 'cfl_factor = ', cfl_factor, & 1265 1189 ' out of range &0.0 < cfl_factor <= 1.0 is required' 1266 1190 CALL message( 'check_parameters', 'PA0045', 1, 2, 0, 6, 0 ) … … 1273 1197 1274 1198 ! 1275 !-- Store reference time for coupled runs and change the coupling flag, 1276 !-- if ... 1199 !-- Store reference time for coupled runs and change the coupling flag, if ... 1277 1200 IF ( simulated_time == 0.0_wp ) THEN 1278 1201 IF ( coupling_start_time == 0.0_wp ) THEN … … 1286 1209 !-- Set wind speed in the Galilei-transformed system 1287 1210 IF ( galilei_transformation ) THEN 1288 IF ( use_ug_for_galilei_tr .AND. &1289 ug_vertical_gradient_level(1) == 0.0_wp .AND. &1290 ug_vertical_gradient(1) == 0.0_wp .AND.&1291 vg_vertical_gradient_level(1) == 0.0_wp .AND. &1292 vg_vertical_gradient(1) == 0.0_wp ) THEN1211 IF ( use_ug_for_galilei_tr .AND. & 1212 ug_vertical_gradient_level(1) == 0.0_wp .AND. & 1213 ug_vertical_gradient(1) == 0.0_wp .AND. & 1214 vg_vertical_gradient_level(1) == 0.0_wp .AND. & 1215 vg_vertical_gradient(1) == 0.0_wp ) THEN 1293 1216 u_gtrans = ug_surface * 0.6_wp 1294 1217 v_gtrans = vg_surface * 0.6_wp 1295 ELSEIF ( use_ug_for_galilei_tr .AND. & 1296 ( ug_vertical_gradient_level(1) /= 0.0_wp .OR. & 1297 ug_vertical_gradient(1) /= 0.0_wp ) ) THEN 1298 message_string = 'baroclinity (ug) not allowed simultaneously' // & 1218 ELSEIF ( use_ug_for_galilei_tr .AND. ( ug_vertical_gradient_level(1) /= 0.0_wp .OR. & 1219 ug_vertical_gradient(1) /= 0.0_wp ) ) THEN 1220 message_string = 'baroclinity (ug) not allowed simultaneously' // & 1299 1221 ' with galilei transformation' 1300 1222 CALL message( 'check_parameters', 'PA0046', 1, 2, 0, 6, 0 ) 1301 ELSEIF ( use_ug_for_galilei_tr .AND. & 1302 ( vg_vertical_gradient_level(1) /= 0.0_wp .OR. & 1303 vg_vertical_gradient(1) /= 0.0_wp ) ) THEN 1304 message_string = 'baroclinity (vg) not allowed simultaneously' // & 1223 ELSEIF ( use_ug_for_galilei_tr .AND. ( vg_vertical_gradient_level(1) /= 0.0_wp .OR. & 1224 vg_vertical_gradient(1) /= 0.0_wp ) ) THEN 1225 message_string = 'baroclinity (vg) not allowed simultaneously' // & 1305 1226 ' with galilei transformation' 1306 1227 CALL message( 'check_parameters', 'PA0047', 1, 2, 0, 6, 0 ) 1307 1228 ELSE 1308 message_string = 'variable translation speed used for Galilei-' // & 1309 'transformation, which may cause & instabilities in stably ' // & 1310 'stratified regions' 1229 message_string = 'variable translation speed used for Galilei-transformation, which ' // & 1230 'may cause & instabilities in stably stratified regions' 1311 1231 CALL message( 'check_parameters', 'PA0048', 0, 1, 0, 6, 0 ) 1312 1232 ENDIF … … 1314 1234 1315 1235 ! 1316 !-- In case of using a prandtl-layer, calculated (or prescribed) surface 1317 !-- fluxes have to be used inthe diffusion-terms1236 !-- In case of using a prandtl-layer, calculated (or prescribed) surface fluxes have to be used in 1237 !-- the diffusion-terms 1318 1238 IF ( constant_flux_layer ) use_surface_fluxes = .TRUE. 1319 1239 1320 1240 ! 1321 1241 !-- Check boundary conditions and set internal variables: 1322 !-- Attention: the lateral boundary conditions have been already checked in 1323 !-- parin 1324 ! 1325 !-- Non-cyclic lateral boundaries require the multigrid method and Piascek- 1326 !-- Willimas or Wicker - Skamarock advection scheme. Several schemes 1327 !-- and tools do not work with non-cyclic boundary conditions. 1242 !-- Attention: the lateral boundary conditions have been already checked in parin 1243 ! 1244 !-- Non-cyclic lateral boundaries require the multigrid method and Piascek-Willimas or 1245 !-- Wicker - Skamarock advection scheme. Several schemes and tools do not work with non-cyclic 1246 !-- boundary conditions. 1328 1247 IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN 1329 1248 IF ( psolver(1:9) /= 'multigrid' ) THEN 1330 message_string = 'non-cyclic lateral boundaries do not allow ' // &1331 'psolver = "' //TRIM( psolver ) // '"'1249 message_string = 'non-cyclic lateral boundaries do not allow ' // 'psolver = "' // & 1250 TRIM( psolver ) // '"' 1332 1251 CALL message( 'check_parameters', 'PA0051', 1, 2, 0, 6, 0 ) 1333 1252 ENDIF 1334 IF ( momentum_advec /= 'pw-scheme' .AND. & 1335 momentum_advec /= 'ws-scheme' ) THEN 1336 1337 message_string = 'non-cyclic lateral boundaries do not allow ' // & 1338 'momentum_advec = "' // TRIM( momentum_advec ) // '"' 1253 IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' ) THEN 1254 1255 message_string = 'non-cyclic lateral boundaries do not allow momentum_advec = "' // & 1256 TRIM( momentum_advec ) // '"' 1339 1257 CALL message( 'check_parameters', 'PA0052', 1, 2, 0, 6, 0 ) 1340 1258 ENDIF 1341 IF ( scalar_advec /= 'pw-scheme' .AND. & 1342 scalar_advec /= 'ws-scheme' ) THEN 1343 message_string = 'non-cyclic lateral boundaries do not allow ' // & 1344 'scalar_advec = "' // TRIM( scalar_advec ) // '"' 1259 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' ) THEN 1260 message_string = 'non-cyclic lateral boundaries do not allow scalar_advec = "' // & 1261 TRIM( scalar_advec ) // '"' 1345 1262 CALL message( 'check_parameters', 'PA0053', 1, 2, 0, 6, 0 ) 1346 1263 ENDIF 1347 1264 IF ( galilei_transformation ) THEN 1348 message_string = 'non-cyclic lateral boundaries do not allow ' // & 1349 'galilei_transformation = .T.' 1265 message_string = 'non-cyclic lateral boundaries do not allow galilei_transformation = .T.' 1350 1266 CALL message( 'check_parameters', 'PA0054', 1, 2, 0, 6, 0 ) 1351 1267 ENDIF … … 1361 1277 bc_e_b = 'neumann' 1362 1278 ibc_e_b = 1 1363 message_string = 'boundary condition bc_e_b changed to "' // & 1364 TRIM( bc_e_b ) // '"' 1279 message_string = 'boundary condition bc_e_b changed to "' // TRIM( bc_e_b ) // '"' 1365 1280 CALL message( 'check_parameters', 'PA0057', 0, 1, 0, 6, 0 ) 1366 1281 ENDIF 1367 1282 ELSE 1368 message_string = 'unknown boundary condition: bc_e_b = "' // & 1369 TRIM( bc_e_b ) // '"' 1283 message_string = 'unknown boundary condition: bc_e_b = "' // TRIM( bc_e_b ) // '"' 1370 1284 CALL message( 'check_parameters', 'PA0058', 1, 2, 0, 6, 0 ) 1371 1285 ENDIF … … 1378 1292 ibc_p_b = 1 1379 1293 ELSE 1380 message_string = 'unknown boundary condition: bc_p_b = "' // & 1381 TRIM( bc_p_b ) // '"' 1294 message_string = 'unknown boundary condition: bc_p_b = "' // TRIM( bc_p_b ) // '"' 1382 1295 CALL message( 'check_parameters', 'PA0059', 1, 2, 0, 6, 0 ) 1383 1296 ENDIF … … 1389 1302 ibc_p_t = 1 1390 1303 ELSE 1391 message_string = 'unknown boundary condition: bc_p_t = "' // & 1392 TRIM( bc_p_t ) // '"' 1304 message_string = 'unknown boundary condition: bc_p_t = "' // TRIM( bc_p_t ) // '"' 1393 1305 CALL message( 'check_parameters', 'PA0061', 1, 2, 0, 6, 0 ) 1394 1306 ENDIF … … 1404 1316 ibc_pt_b = 1 1405 1317 ELSE 1406 message_string = 'unknown boundary condition: bc_pt_b = "' // & 1407 TRIM( bc_pt_b ) // '"' 1318 message_string = 'unknown boundary condition: bc_pt_b = "' // TRIM( bc_pt_b ) // '"' 1408 1319 CALL message( 'check_parameters', 'PA0062', 1, 2, 0, 6, 0 ) 1409 1320 ENDIF … … 1419 1330 ibc_pt_t = 3 1420 1331 ELSE 1421 message_string = 'unknown boundary condition: bc_pt_t = "' // & 1422 TRIM( bc_pt_t ) // '"' 1332 message_string = 'unknown boundary condition: bc_pt_t = "' // TRIM( bc_pt_t ) // '"' 1423 1333 CALL message( 'check_parameters', 'PA0063', 1, 2, 0, 6, 0 ) 1424 1334 ENDIF 1425 1335 1426 IF ( ANY( wall_heatflux /= 0.0_wp ) .AND. & 1427 surface_heatflux == 9999999.9_wp ) THEN 1428 message_string = 'wall_heatflux additionally requires ' // & 1429 'setting of surface_heatflux' 1336 IF ( ANY( wall_heatflux /= 0.0_wp ) .AND. surface_heatflux == 9999999.9_wp ) THEN 1337 message_string = 'wall_heatflux additionally requires setting of surface_heatflux' 1430 1338 CALL message( 'check_parameters', 'PA0443', 1, 2, 0, 6, 0 ) 1431 1339 ENDIF … … 1451 1359 IF ( neutral ) THEN 1452 1360 1453 IF ( surface_heatflux /= 0.0_wp .AND. & 1454 surface_heatflux /= 9999999.9_wp ) THEN 1361 IF ( surface_heatflux /= 0.0_wp .AND. surface_heatflux /= 9999999.9_wp ) THEN 1455 1362 message_string = 'heatflux must not be set for pure neutral flow' 1456 1363 CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) 1457 1364 ENDIF 1458 1365 1459 IF ( top_heatflux /= 0.0_wp .AND. top_heatflux /= 9999999.9_wp ) & 1460 THEN 1366 IF ( top_heatflux /= 0.0_wp .AND. top_heatflux /= 9999999.9_wp ) THEN 1461 1367 message_string = 'heatflux must not be set for pure neutral flow' 1462 1368 CALL message( 'check_parameters', 'PA0351', 1, 2, 0, 6, 0 ) … … 1465 1371 ENDIF 1466 1372 1467 IF ( top_momentumflux_u /= 9999999.9_wp .AND. & 1468 top_momentumflux_v /= 9999999.9_wp ) THEN 1373 IF ( top_momentumflux_u /= 9999999.9_wp .AND. top_momentumflux_v /= 9999999.9_wp ) THEN 1469 1374 constant_top_momentumflux = .TRUE. 1470 ELSEIF ( .NOT. ( top_momentumflux_u == 9999999.9_wp .AND.&1375 ELSEIF ( .NOT. ( top_momentumflux_u == 9999999.9_wp .AND. & 1471 1376 top_momentumflux_v == 9999999.9_wp ) ) THEN 1472 message_string = 'both, top_momentumflux_u AND top_momentumflux_v ' // & 1473 'must be set' 1377 message_string = 'both, top_momentumflux_u AND top_momentumflux_v must be set' 1474 1378 CALL message( 'check_parameters', 'PA0064', 1, 2, 0, 6, 0 ) 1475 1379 ENDIF 1476 1380 1477 1381 ! 1478 !-- A given surface temperature implies Dirichlet boundary condition for 1479 !-- temperature. In this case specification of a constant heat flux is 1480 !-- forbidden. 1481 IF ( ibc_pt_b == 0 .AND. constant_heatflux .AND. & 1482 surface_heatflux /= 0.0_wp ) THEN 1483 message_string = 'boundary_condition: bc_pt_b = "' // TRIM( bc_pt_b ) //& 1382 !-- A given surface temperature implies Dirichlet boundary condition for temperature. In this case 1383 !-- specification of a constant heat flux is forbidden. 1384 IF ( ibc_pt_b == 0 .AND. constant_heatflux .AND. surface_heatflux /= 0.0_wp ) THEN 1385 message_string = 'boundary_condition: bc_pt_b = "' // TRIM( bc_pt_b ) // & 1484 1386 '& is not allowed with constant_heatflux = .TRUE.' 1485 1387 CALL message( 'check_parameters', 'PA0065', 1, 2, 0, 6, 0 ) 1486 1388 ENDIF 1487 1389 IF ( constant_heatflux .AND. pt_surface_initial_change /= 0.0_wp ) THEN 1488 WRITE ( message_string, * ) 'constant_heatflux = .TRUE. is not allo', & 1489 'wed with pt_surface_initial_change (/=0) = ', & 1490 pt_surface_initial_change 1390 WRITE ( message_string, * ) 'constant_heatflux = .TRUE. is not allo', & 1391 'wed with pt_surface_initial_change (/=0) = ', pt_surface_initial_change 1491 1392 CALL message( 'check_parameters', 'PA0066', 1, 2, 0, 6, 0 ) 1492 1393 ENDIF 1493 1394 1494 1395 ! 1495 !-- A given temperature at the top implies Dirichlet boundary condition for 1496 !-- temperature. In this case specification of a constant heat flux is 1497 !-- forbidden. 1498 IF ( ibc_pt_t == 0 .AND. constant_top_heatflux .AND. & 1499 top_heatflux /= 0.0_wp ) THEN 1500 message_string = 'boundary_condition: bc_pt_t = "' // TRIM( bc_pt_t ) //& 1396 !-- A given temperature at the top implies Dirichlet boundary condition for temperature. In this 1397 !-- case specification of a constant heat flux is forbidden. 1398 IF ( ibc_pt_t == 0 .AND. constant_top_heatflux .AND. top_heatflux /= 0.0_wp ) THEN 1399 message_string = 'boundary_condition: bc_pt_t = "' // TRIM( bc_pt_t ) // & 1501 1400 '" is not allowed with constant_top_heatflux = .TRUE.' 1502 1401 CALL message( 'check_parameters', 'PA0067', 1, 2, 0, 6, 0 ) … … 1507 1406 IF ( humidity ) THEN 1508 1407 1509 IF ( ANY( wall_humidityflux /= 0.0_wp ) .AND. & 1510 surface_waterflux == 9999999.9_wp ) THEN 1511 message_string = 'wall_humidityflux additionally requires ' // & 1512 'setting of surface_waterflux' 1408 IF ( ANY( wall_humidityflux /= 0.0_wp ) .AND. surface_waterflux == 9999999.9_wp ) THEN 1409 message_string = 'wall_humidityflux additionally requires setting of surface_waterflux' 1513 1410 CALL message( 'check_parameters', 'PA0444', 1, 2, 0, 6, 0 ) 1514 1411 ENDIF 1515 1412 1516 CALL set_bc_scalars( 'q', bc_q_b, bc_q_t, ibc_q_b, ibc_q_t, & 1517 'PA0071', 'PA0072' ) 1413 CALL set_bc_scalars( 'q', bc_q_b, bc_q_t, ibc_q_b, ibc_q_t, 'PA0071', 'PA0072' ) 1518 1414 1519 1415 IF ( surface_waterflux == 9999999.9_wp ) THEN … … 1530 1426 ENDIF 1531 1427 1532 CALL check_bc_scalars( 'q', bc_q_b, ibc_q_b, 'PA0073', 'PA0074', &1533 constant_waterflux,q_surface_initial_change )1428 CALL check_bc_scalars( 'q', bc_q_b, ibc_q_b, 'PA0073', 'PA0074', constant_waterflux, & 1429 q_surface_initial_change ) 1534 1430 1535 1431 ENDIF … … 1537 1433 IF ( passive_scalar ) THEN 1538 1434 1539 IF ( ANY( wall_scalarflux /= 0.0_wp ) .AND. & 1540 surface_scalarflux == 9999999.9_wp ) THEN 1541 message_string = 'wall_scalarflux additionally requires ' // & 1542 'setting of surface_scalarflux' 1435 IF ( ANY( wall_scalarflux /= 0.0_wp ) .AND. surface_scalarflux == 9999999.9_wp ) THEN 1436 message_string = 'wall_scalarflux additionally requires setting of surface_scalarflux' 1543 1437 CALL message( 'check_parameters', 'PA0445', 1, 2, 0, 6, 0 ) 1544 1438 ENDIF … … 1546 1440 IF ( surface_scalarflux == 9999999.9_wp ) constant_scalarflux = .FALSE. 1547 1441 1548 CALL set_bc_scalars( 's', bc_s_b, bc_s_t, ibc_s_b, ibc_s_t, & 1549 'PA0071', 'PA0072' ) 1550 1551 CALL check_bc_scalars( 's', bc_s_b, ibc_s_b, 'PA0073', 'PA0074', & 1552 constant_scalarflux, s_surface_initial_change ) 1442 CALL set_bc_scalars( 's', bc_s_b, bc_s_t, ibc_s_b, ibc_s_t, 'PA0071', 'PA0072' ) 1443 1444 CALL check_bc_scalars( 's', bc_s_b, ibc_s_b, 'PA0073', 'PA0074', constant_scalarflux, & 1445 s_surface_initial_change ) 1553 1446 1554 1447 IF ( top_scalarflux == 9999999.9_wp ) constant_top_scalarflux = .FALSE. 1555 1448 ! 1556 !-- A fixed scalar concentration at the top implies Dirichlet boundary 1557 !-- condition for scalar. Hence, in this case specification of a constant 1558 !-- scalar flux is forbidden. 1559 IF ( ( ibc_s_t == 0 .OR. ibc_s_t == 2 ) .AND. constant_top_scalarflux & 1560 .AND. top_scalarflux /= 0.0_wp ) THEN 1561 message_string = 'boundary condition: bc_s_t = "' // & 1562 TRIM( bc_s_t ) // '" is not allowed with ' // & 1563 'top_scalarflux /= 0.0' 1449 !-- A fixed scalar concentration at the top implies Dirichlet boundary condition for scalar. 1450 !-- Hence, in this case specification of a constant scalar flux is forbidden. 1451 IF ( ( ibc_s_t == 0 .OR. ibc_s_t == 2 ) .AND. constant_top_scalarflux .AND. & 1452 top_scalarflux /= 0.0_wp ) THEN 1453 message_string = 'boundary condition: bc_s_t = "' // TRIM( bc_s_t ) // & 1454 '" is not allowed with top_scalarflux /= 0.0' 1564 1455 CALL message( 'check_parameters', 'PA0441', 1, 2, 0, 6, 0 ) 1565 1456 ENDIF … … 1573 1464 ibc_uv_b = 1 1574 1465 IF ( constant_flux_layer ) THEN 1575 message_string = 'boundary condition: bc_uv_b = "' // & 1576 TRIM( bc_uv_b ) // '" is not allowed with constant_flux_layer' & 1577 // ' = .TRUE.' 1466 message_string = 'boundary condition: bc_uv_b = "' // TRIM( bc_uv_b ) // & 1467 '" is not allowed with constant_flux_layer = .TRUE.' 1578 1468 CALL message( 'check_parameters', 'PA0075', 1, 2, 0, 6, 0 ) 1579 1469 ENDIF 1580 1470 ELSE 1581 message_string = 'unknown boundary condition: bc_uv_b = "' // & 1582 TRIM( bc_uv_b ) // '"' 1471 message_string = 'unknown boundary condition: bc_uv_b = "' // TRIM( bc_uv_b ) // '"' 1583 1472 CALL message( 'check_parameters', 'PA0076', 1, 2, 0, 6, 0 ) 1584 1473 ENDIF 1585 1474 ! 1586 !-- In case of coupled simulations u and v at the ground in atmosphere will be 1587 !-- a ssigned with the u and v values of the ocean surface1475 !-- In case of coupled simulations u and v at the ground in atmosphere will be assigned with the u 1476 !-- and v values of the ocean surface 1588 1477 IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN 1589 1478 ibc_uv_b = 2 … … 1598 1487 IF ( bc_uv_t == 'dirichlet_0' ) THEN 1599 1488 ! 1600 !-- Velocities for the initial u,v-profiles are set zero at the top 1601 !-- in case of dirichlet_0conditions1489 !-- Velocities for the initial u,v-profiles are set zero at the top in case of dirichlet_0 1490 !-- conditions 1602 1491 u_init(nzt+1) = 0.0_wp 1603 1492 v_init(nzt+1) = 0.0_wp … … 1608 1497 ibc_uv_t = 3 1609 1498 ELSE 1610 message_string = 'unknown boundary condition: bc_uv_t = "' // & 1611 TRIM( bc_uv_t ) // '"' 1499 message_string = 'unknown boundary condition: bc_uv_t = "' // TRIM( bc_uv_t ) // '"' 1612 1500 CALL message( 'check_parameters', 'PA0077', 1, 2, 0, 6, 0 ) 1613 1501 ENDIF … … 1619 1507 rayleigh_damping_factor = 0.0_wp 1620 1508 ELSE 1621 IF ( rayleigh_damping_factor < 0.0_wp .OR. & 1622 rayleigh_damping_factor > 1.0_wp ) THEN 1623 WRITE( message_string, * ) 'rayleigh_damping_factor = ', & 1624 rayleigh_damping_factor, ' out of range [0.0,1.0]' 1509 IF ( rayleigh_damping_factor < 0.0_wp .OR. rayleigh_damping_factor > 1.0_wp ) THEN 1510 WRITE( message_string, * ) 'rayleigh_damping_factor = ', rayleigh_damping_factor, & 1511 ' out of range [0.0,1.0]' 1625 1512 CALL message( 'check_parameters', 'PA0078', 1, 2, 0, 6, 0 ) 1626 1513 ENDIF … … 1628 1515 1629 1516 IF ( rayleigh_damping_height == -1.0_wp ) THEN 1630 IF ( .NOT.ocean_mode ) THEN1517 IF ( .NOT. ocean_mode ) THEN 1631 1518 rayleigh_damping_height = 0.66666666666_wp * zu(nzt) 1632 1519 ELSE … … 1634 1521 ENDIF 1635 1522 ELSE 1636 IF ( .NOT. ocean_mode ) THEN 1637 IF ( rayleigh_damping_height < 0.0_wp .OR. & 1638 rayleigh_damping_height > zu(nzt) ) THEN 1639 WRITE( message_string, * ) 'rayleigh_damping_height = ', & 1640 rayleigh_damping_height, ' out of range [0.0,', zu(nzt), ']' 1523 IF ( .NOT. ocean_mode ) THEN 1524 IF ( rayleigh_damping_height < 0.0_wp .OR. rayleigh_damping_height > zu(nzt) ) THEN 1525 WRITE( message_string, * ) 'rayleigh_damping_height = ', rayleigh_damping_height, & 1526 ' out of range [0.0,', zu(nzt), ']' 1641 1527 CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) 1642 1528 ENDIF 1643 1529 ELSE 1644 IF ( rayleigh_damping_height > 0.0_wp .OR. & 1645 rayleigh_damping_height < zu(nzb) ) THEN 1646 WRITE( message_string, * ) 'rayleigh_damping_height = ', & 1647 rayleigh_damping_height, ' out of range [0.0,', zu(nzb), ']' 1530 IF ( rayleigh_damping_height > 0.0_wp .OR. rayleigh_damping_height < zu(nzb) ) THEN 1531 WRITE( message_string, * ) 'rayleigh_damping_height = ', rayleigh_damping_height, & 1532 ' out of range [0.0,', zu(nzb), ']' 1648 1533 CALL message( 'check_parameters', 'PA0079', 1, 2, 0, 6, 0 ) 1649 1534 ENDIF … … 1654 1539 !-- Check number of chosen statistic regions 1655 1540 IF ( statistic_regions < 0 ) THEN 1656 WRITE ( message_string, * ) 'number of statistic_regions = ', &1657 statistic_regions+1,' is not allowed'1541 WRITE ( message_string, * ) 'number of statistic_regions = ', statistic_regions+1, & 1542 ' is not allowed' 1658 1543 CALL message( 'check_parameters', 'PA0082', 1, 2, 0, 6, 0 ) 1659 1544 ENDIF 1660 IF ( normalizing_region > statistic_regions .OR. & 1661 normalizing_region < 0) THEN 1662 WRITE ( message_string, * ) 'normalizing_region = ', & 1663 normalizing_region, ' must be >= 0 and <= ',statistic_regions, & 1664 ' (value of statistic_regions)' 1545 IF ( normalizing_region > statistic_regions .OR. normalizing_region < 0) THEN 1546 WRITE ( message_string, * ) 'normalizing_region = ', normalizing_region, & 1547 ' must be >= 0 and <= ',statistic_regions, ' (value of statistic_regions)' 1665 1548 CALL message( 'check_parameters', 'PA0083', 1, 2, 0, 6, 0 ) 1666 1549 ENDIF … … 1684 1567 ! 1685 1568 !-- Set the default skip time intervals for data output, if necessary 1686 IF ( skip_time_dopr == 9999999.9_wp ) & 1687 skip_time_dopr = skip_time_data_output 1688 IF ( skip_time_do2d_xy == 9999999.9_wp ) & 1689 skip_time_do2d_xy = skip_time_data_output 1690 IF ( skip_time_do2d_xz == 9999999.9_wp ) & 1691 skip_time_do2d_xz = skip_time_data_output 1692 IF ( skip_time_do2d_yz == 9999999.9_wp ) & 1693 skip_time_do2d_yz = skip_time_data_output 1694 IF ( skip_time_do3d == 9999999.9_wp ) & 1695 skip_time_do3d = skip_time_data_output 1696 IF ( skip_time_data_output_av == 9999999.9_wp ) & 1697 skip_time_data_output_av = skip_time_data_output 1569 IF ( skip_time_dopr == 9999999.9_wp ) skip_time_dopr = skip_time_data_output 1570 IF ( skip_time_do2d_xy == 9999999.9_wp ) skip_time_do2d_xy = skip_time_data_output 1571 IF ( skip_time_do2d_xz == 9999999.9_wp ) skip_time_do2d_xz = skip_time_data_output 1572 IF ( skip_time_do2d_yz == 9999999.9_wp ) skip_time_do2d_yz = skip_time_data_output 1573 IF ( skip_time_do3d == 9999999.9_wp ) skip_time_do3d = skip_time_data_output 1574 IF ( skip_time_data_output_av == 9999999.9_wp ) & 1575 skip_time_data_output_av = skip_time_data_output 1698 1576 DO mid = 1, max_masks 1699 IF ( skip_time_domask(mid) == 9999999.9_wp ) &1700 skip_time_domask(mid) = skip_time_data_output1577 IF ( skip_time_domask(mid) == 9999999.9_wp ) & 1578 skip_time_domask(mid) = skip_time_data_output 1701 1579 ENDDO 1702 1580 … … 1704 1582 !-- Check the average intervals (first for 3d-data, then for profiles) 1705 1583 IF ( averaging_interval > dt_data_output_av ) THEN 1706 WRITE( message_string, * ) 'averaging_interval = ', & 1707 averaging_interval, ' must be <= dt_data_output_av = ', & 1708 dt_data_output_av 1584 WRITE( message_string, * ) 'averaging_interval = ', averaging_interval, & 1585 ' must be <= dt_data_output_av = ', dt_data_output_av 1709 1586 CALL message( 'check_parameters', 'PA0085', 1, 2, 0, 6, 0 ) 1710 1587 ENDIF … … 1715 1592 1716 1593 IF ( averaging_interval_pr > dt_dopr ) THEN 1717 WRITE( message_string, * ) 'averaging_interval_pr = ', 1718 averaging_interval_pr,' must be <= dt_dopr = ', dt_dopr1594 WRITE( message_string, * ) 'averaging_interval_pr = ', averaging_interval_pr, & 1595 ' must be <= dt_dopr = ', dt_dopr 1719 1596 CALL message( 'check_parameters', 'PA0086', 1, 2, 0, 6, 0 ) 1720 1597 ENDIF … … 1727 1604 1728 1605 ! 1729 !-- Set the default interval for the output of timeseries to a reasonable 1730 !-- value (tries to minimizethe number of calls of flow_statistics)1606 !-- Set the default interval for the output of timeseries to a reasonable value (tries to minimize 1607 !-- the number of calls of flow_statistics) 1731 1608 IF ( dt_dots == 9999999.9_wp ) THEN 1732 1609 IF ( averaging_interval_pr == 0.0_wp ) THEN … … 1740 1617 !-- Check the sample rate for averaging (first for 3d-data, then for profiles) 1741 1618 IF ( dt_averaging_input > averaging_interval ) THEN 1742 WRITE( message_string, * ) 'dt_averaging_input = ', & 1743 dt_averaging_input, ' must be <= averaging_interval = ', & 1744 averaging_interval 1619 WRITE( message_string, * ) 'dt_averaging_input = ', dt_averaging_input, & 1620 ' must be <= averaging_interval = ', averaging_interval 1745 1621 CALL message( 'check_parameters', 'PA0088', 1, 2, 0, 6, 0 ) 1746 1622 ENDIF 1747 1623 1748 1624 IF ( dt_averaging_input_pr > averaging_interval_pr ) THEN 1749 WRITE( message_string, * ) 'dt_averaging_input_pr = ', & 1750 dt_averaging_input_pr, ' must be <= averaging_interval_pr = ', & 1751 averaging_interval_pr 1625 WRITE( message_string, * ) 'dt_averaging_input_pr = ', dt_averaging_input_pr, & 1626 ' must be <= averaging_interval_pr = ', averaging_interval_pr 1752 1627 CALL message( 'check_parameters', 'PA0089', 1, 2, 0, 6, 0 ) 1753 1628 ENDIF 1754 1629 1755 1630 ! 1756 !-- Determine the number of output profiles and check whether they are 1757 !-- permissible 1631 !-- Determine the number of output profiles and check whether they are permissible 1758 1632 DO WHILE ( data_output_pr(dopr_n+1) /= ' ' ) 1759 1633 … … 1762 1636 1763 1637 ! 1764 !-- Determine internal profile number (for hom, homs) 1765 !-- and store height levels 1638 !-- Determine internal profile number (for hom, homs) and store height levels 1766 1639 SELECT CASE ( TRIM( data_output_pr(i) ) ) 1767 1640 … … 1792 1665 1793 1666 CASE ( 'theta', '#theta' ) 1794 IF ( .NOT. bulk_cloud_model ) THEN1667 IF ( .NOT. bulk_cloud_model ) THEN 1795 1668 dopr_index(i) = 4 1796 1669 dopr_unit(i) = 'K' … … 1974 1847 CASE ( 'q', '#q' ) 1975 1848 IF ( .NOT. humidity ) THEN 1976 message_string = 'data_output_pr = ' // & 1977 TRIM( data_output_pr(i) ) // ' is not imp' // & 1978 'lemented for humidity = .FALSE.' 1849 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1850 ' is not implemented for humidity = .FALSE.' 1979 1851 CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) 1980 1852 ELSE … … 1992 1864 CASE ( 's', '#s' ) 1993 1865 IF ( .NOT. passive_scalar ) THEN 1994 message_string = 'data_output_pr = ' // & 1995 TRIM( data_output_pr(i) ) // ' is not imp' // & 1996 'lemented for passive_scalar = .FALSE.' 1866 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1867 ' is not implemented for passive_scalar = .FALSE.' 1997 1868 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) 1998 1869 ELSE … … 2033 1904 CASE ( 'thetal', '#thetal' ) 2034 1905 IF ( .NOT. bulk_cloud_model ) THEN 2035 message_string = 'data_output_pr = ' // & 2036 TRIM( data_output_pr(i) ) // ' is not imp' // & 2037 'lemented for bulk_cloud_model = .FALSE.' 1906 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1907 ' is not implemented for bulk_cloud_model = .FALSE.' 2038 1908 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2039 1909 ELSE … … 2076 1946 2077 1947 CASE ( 'w"q"' ) 2078 IF ( .NOT. humidity ) THEN 2079 message_string = 'data_output_pr = ' // & 2080 TRIM( data_output_pr(i) ) // ' is not imp' // & 2081 'lemented for humidity = .FALSE.' 1948 IF ( .NOT. humidity ) THEN 1949 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1950 ' is not implemented for humidity = .FALSE.' 2082 1951 CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) 2083 1952 ELSE … … 2088 1957 2089 1958 CASE ( 'w*q*' ) 2090 IF ( .NOT. humidity ) THEN 2091 message_string = 'data_output_pr = ' // & 2092 TRIM( data_output_pr(i) ) // ' is not imp' // & 2093 'lemented for humidity = .FALSE.' 1959 IF ( .NOT. humidity ) THEN 1960 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1961 ' is not implemented for humidity = .FALSE.' 2094 1962 CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) 2095 1963 ELSE … … 2100 1968 2101 1969 CASE ( 'wq' ) 2102 IF ( .NOT. humidity ) THEN 2103 message_string = 'data_output_pr = ' // & 2104 TRIM( data_output_pr(i) ) // ' is not imp' // & 2105 'lemented for humidity = .FALSE.' 1970 IF ( .NOT. humidity ) THEN 1971 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1972 ' is not implemented for humidity = .FALSE.' 2106 1973 CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) 2107 1974 ELSE … … 2112 1979 2113 1980 CASE ( 'w"s"' ) 2114 IF ( .NOT. passive_scalar ) THEN 2115 message_string = 'data_output_pr = ' // & 2116 TRIM( data_output_pr(i) ) // ' is not imp' // & 2117 'lemented for passive_scalar = .FALSE.' 1981 IF ( .NOT. passive_scalar ) THEN 1982 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1983 ' is not implemented for passive_scalar = .FALSE.' 2118 1984 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) 2119 1985 ELSE … … 2124 1990 2125 1991 CASE ( 'w*s*' ) 2126 IF ( .NOT. passive_scalar ) THEN 2127 message_string = 'data_output_pr = ' // & 2128 TRIM( data_output_pr(i) ) // ' is not imp' // & 2129 'lemented for passive_scalar = .FALSE.' 1992 IF ( .NOT. passive_scalar ) THEN 1993 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 1994 ' is not implemented for passive_scalar = .FALSE.' 2130 1995 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) 2131 1996 ELSE … … 2136 2001 2137 2002 CASE ( 'ws' ) 2138 IF ( .NOT. passive_scalar ) THEN 2139 message_string = 'data_output_pr = ' // & 2140 TRIM( data_output_pr(i) ) // ' is not imp' // & 2141 'lemented for passive_scalar = .FALSE.' 2003 IF ( .NOT. passive_scalar ) THEN 2004 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2005 ' is not implemented for passive_scalar = .FALSE.' 2142 2006 CALL message( 'check_parameters', 'PA0093', 1, 2, 0, 6, 0 ) 2143 2007 ELSE … … 2148 2012 2149 2013 CASE ( 'w"qv"' ) 2150 IF ( humidity .AND. .NOT. 2014 IF ( humidity .AND. .NOT. bulk_cloud_model ) THEN 2151 2015 dopr_index(i) = 48 2152 2016 dopr_unit(i) = TRIM ( waterflux_output_unit ) … … 2157 2021 hom(:,2,51,:) = SPREAD( zw, 2, statistic_regions+1 ) 2158 2022 ELSE 2159 message_string = 'data_output_pr = ' // & 2160 TRIM( data_output_pr(i) ) // ' is not imp' // & 2161 'lemented for bulk_cloud_model = .FALSE. ' // & 2023 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2024 ' is not implemented for bulk_cloud_model = .FALSE. ' // & 2162 2025 'and humidity = .FALSE.' 2163 2026 CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) … … 2169 2032 dopr_unit(i) = TRIM ( waterflux_output_unit ) 2170 2033 hom(:,2,49,:) = SPREAD( zw, 2, statistic_regions+1 ) 2171 ELSEIF( humidity .AND. bulk_cloud_model )THEN2034 ELSEIF( humidity .AND. bulk_cloud_model ) THEN 2172 2035 dopr_index(i) = 52 2173 2036 dopr_unit(i) = TRIM ( waterflux_output_unit ) 2174 2037 hom(:,2,52,:) = SPREAD( zw, 2, statistic_regions+1 ) 2175 2038 ELSE 2176 message_string = 'data_output_pr = ' // & 2177 TRIM( data_output_pr(i) ) // ' is not imp' // & 2178 'lemented for bulk_cloud_model = .FALSE. ' // & 2039 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2040 ' is not implemented for bulk_cloud_model = .FALSE. ' // & 2179 2041 'and humidity = .FALSE.' 2180 2042 CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) … … 2182 2044 2183 2045 CASE ( 'wqv' ) 2184 IF ( humidity .AND. .NOT. 2046 IF ( humidity .AND. .NOT. bulk_cloud_model ) THEN 2185 2047 dopr_index(i) = 50 2186 2048 dopr_unit(i) = TRIM ( waterflux_output_unit ) … … 2191 2053 hom(:,2,53,:) = SPREAD( zw, 2, statistic_regions+1 ) 2192 2054 ELSE 2193 message_string = 'data_output_pr = ' // & 2194 TRIM( data_output_pr(i) ) // ' is not imp' // & 2195 'lemented for bulk_cloud_model = .FALSE. ' // & 2055 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2056 ' is not implemented for bulk_cloud_model = .FALSE. ' // & 2196 2057 'and humidity = .FALSE.' 2197 2058 CALL message( 'check_parameters', 'PA0095', 1, 2, 0, 6, 0 ) … … 2199 2060 2200 2061 CASE ( 'ql' ) 2201 IF ( .NOT. bulk_cloud_model .AND. .NOT. cloud_droplets ) THEN 2202 message_string = 'data_output_pr = ' // & 2203 TRIM( data_output_pr(i) ) // ' is not imp' // & 2204 'lemented for bulk_cloud_model = .FALSE. ' // & 2062 IF ( .NOT. bulk_cloud_model .AND. .NOT. cloud_droplets ) THEN 2063 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2064 ' is not implemented for bulk_cloud_model = .FALSE. ' // & 2205 2065 'and cloud_droplets = .FALSE.' 2206 2066 CALL message( 'check_parameters', 'PA0096', 1, 2, 0, 6, 0 ) … … 2268 2128 CASE ( 'q*2' ) 2269 2129 IF ( .NOT. humidity ) THEN 2270 message_string = 'data_output_pr = ' // & 2271 TRIM( data_output_pr(i) ) // ' is not imp' // & 2272 'lemented for humidity = .FALSE.' 2130 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2131 ' is not implemented for humidity = .FALSE.' 2273 2132 CALL message( 'check_parameters', 'PA0092', 1, 2, 0, 6, 0 ) 2274 2133 ELSE … … 2305 2164 CASE ( 'w_subs' ) 2306 2165 IF ( .NOT. large_scale_subsidence ) THEN 2307 message_string = 'data_output_pr = ' // & 2308 TRIM( data_output_pr(i) ) // ' is not imp' // & 2309 'lemented for large_scale_subsidence = .FALSE.' 2166 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2167 ' is not implemented for large_scale_subsidence = .FALSE.' 2310 2168 CALL message( 'check_parameters', 'PA0382', 1, 2, 0, 6, 0 ) 2311 2169 ELSE … … 2317 2175 CASE ( 's*2' ) 2318 2176 IF ( .NOT. passive_scalar ) THEN 2319 message_string = 'data_output_pr = ' // & 2320 TRIM( data_output_pr(i) ) // ' is not imp' // & 2321 'lemented for passive_scalar = .FALSE.' 2177 message_string = 'data_output_pr = ' // TRIM( data_output_pr(i) ) // & 2178 ' is not implemented for passive_scalar = .FALSE.' 2322 2179 CALL message( 'check_parameters', 'PA0185', 1, 2, 0, 6, 0 ) 2323 2180 ELSE … … 2338 2195 ! 2339 2196 !-- Check for other modules 2340 CALL module_interface_check_data_output_pr( data_output_pr(i), i, & 2341 unit, dopr_unit(i) ) 2197 CALL module_interface_check_data_output_pr( data_output_pr(i), i, unit, dopr_unit(i) ) 2342 2198 2343 2199 ! … … 2345 2201 IF ( unit == 'illegal' ) THEN 2346 2202 IF ( data_output_pr_user(1) /= ' ' ) THEN 2347 message_string = 'illegal value for data_output_pr or ' // & 2348 'data_output_pr_user = "' // & 2349 TRIM( data_output_pr(i) ) // '"' 2203 message_string = 'illegal value for data_output_pr or ' // & 2204 'data_output_pr_user = "' // TRIM( data_output_pr(i) ) // '"' 2350 2205 CALL message( 'check_parameters', 'PA0097', 1, 2, 0, 6, 0 ) 2351 2206 ELSE 2352 message_string = 'illegal value for data_output_pr = "' // &2207 message_string = 'illegal value for data_output_pr = "' // & 2353 2208 TRIM( data_output_pr(i) ) // '"' 2354 2209 CALL message( 'check_parameters', 'PA0098', 1, 2, 0, 6, 0 ) … … 2371 2226 DO WHILE ( data_output_user(j) /= ' ' .AND. j <= 500 ) 2372 2227 IF ( i > 500 ) THEN 2373 message_string = 'number of output quantitities given by data' // &2374 '_output and data_output_user exceeds the limit of 500'2228 message_string = 'number of output quantitities given by data' // & 2229 '_output and data_output_user exceeds the limit of 500' 2375 2230 CALL message( 'check_parameters', 'PA0102', 1, 2, 0, 6, 0 ) 2376 2231 ENDIF … … 2401 2256 var = data_output(i)(1:ilen) 2402 2257 IF ( ilen > 3 ) THEN 2403 IF ( data_output(i)(ilen-2:ilen) == '_xy' .OR. & 2404 data_output(i)(ilen-2:ilen) == '_xz' .OR. & 2405 data_output(i)(ilen-2:ilen) == '_yz' ) THEN 2258 IF ( data_output(i)(ilen-2:ilen) == '_xy' .OR. data_output(i)(ilen-2:ilen) == '_xz' & 2259 .OR. data_output(i)(ilen-2:ilen) == '_yz' ) THEN 2406 2260 k = 1 ! 2d data 2407 2261 var = data_output(i)(1:ilen-3) … … 2415 2269 CASE ( 'e' ) 2416 2270 IF ( constant_diffusion ) THEN 2417 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2418 ' resconstant_diffusion = .FALSE.'2271 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2272 'constant_diffusion = .FALSE.' 2419 2273 CALL message( 'check_parameters', 'PA0103', 1, 2, 0, 6, 0 ) 2420 2274 ENDIF … … 2422 2276 2423 2277 CASE ( 'thetal' ) 2424 IF ( .NOT.bulk_cloud_model ) THEN2425 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2426 'resbulk_cloud_model = .TRUE.'2278 IF ( .NOT. bulk_cloud_model ) THEN 2279 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2280 'bulk_cloud_model = .TRUE.' 2427 2281 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2428 2282 ENDIF … … 2430 2284 2431 2285 CASE ( 'pc', 'pr' ) 2432 IF ( .NOT. particle_advection ) THEN 2433 message_string = 'output of "' // TRIM( var ) // '" requir' // & 2434 'es a "particle_parameters"-NAMELIST in the parameter ' // & 2435 'file (PARIN)' 2286 IF ( .NOT. particle_advection ) THEN 2287 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2288 'a "particle_parameters"-NAMELIST in the parameter file (PARIN)' 2436 2289 CALL message( 'check_parameters', 'PA0104', 1, 2, 0, 6, 0 ) 2437 2290 ENDIF … … 2440 2293 2441 2294 CASE ( 'q', 'thetav' ) 2442 IF ( .NOT. humidity ) THEN 2443 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2444 'res humidity = .TRUE.' 2295 IF ( .NOT. humidity ) THEN 2296 message_string = 'output of "' // TRIM( var ) // '" requires humidity = .TRUE.' 2445 2297 CALL message( 'check_parameters', 'PA0105', 1, 2, 0, 6, 0 ) 2446 2298 ENDIF … … 2450 2302 CASE ( 'ql' ) 2451 2303 IF ( .NOT. ( bulk_cloud_model .OR. cloud_droplets ) ) THEN 2452 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2453 'resbulk_cloud_model = .TRUE. or cloud_droplets = .TRUE.'2304 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2305 'bulk_cloud_model = .TRUE. or cloud_droplets = .TRUE.' 2454 2306 CALL message( 'check_parameters', 'PA0106', 1, 2, 0, 6, 0 ) 2455 2307 ENDIF … … 2457 2309 2458 2310 CASE ( 'ql_c', 'ql_v', 'ql_vp' ) 2459 IF ( .NOT.cloud_droplets ) THEN2460 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2461 ' rescloud_droplets = .TRUE.'2311 IF ( .NOT. cloud_droplets ) THEN 2312 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2313 'cloud_droplets = .TRUE.' 2462 2314 CALL message( 'check_parameters', 'PA0107', 1, 2, 0, 6, 0 ) 2463 2315 ENDIF … … 2467 2319 2468 2320 CASE ( 'qv' ) 2469 IF ( .NOT.bulk_cloud_model ) THEN2470 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2471 ' resbulk_cloud_model = .TRUE.'2321 IF ( .NOT. bulk_cloud_model ) THEN 2322 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2323 'bulk_cloud_model = .TRUE.' 2472 2324 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2473 2325 ENDIF … … 2475 2327 2476 2328 CASE ( 's' ) 2477 IF ( .NOT.passive_scalar ) THEN2478 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2479 ' respassive_scalar = .TRUE.'2329 IF ( .NOT. passive_scalar ) THEN 2330 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2331 'passive_scalar = .TRUE.' 2480 2332 CALL message( 'check_parameters', 'PA0110', 1, 2, 0, 6, 0 ) 2481 2333 ENDIF … … 2490 2342 CONTINUE 2491 2343 2492 CASE ( 'ghf*', 'lwp*', 'ol*', 'qsurf*', 'qsws*', 'r_a*', & 2493 'shf*', 'ssurf*', 'ssws*', 't*', 'tsurf*', 'us*', & 2494 'z0*', 'z0h*', 'z0q*' ) 2344 CASE ( 'ghf*', 'lwp*', 'ol*', 'qsurf*', 'qsws*', 'r_a*', 'shf*', 'ssurf*', 'ssws*', 't*',& 2345 'tsurf*', 'us*', 'z0*', 'z0h*', 'z0q*' ) 2495 2346 IF ( k == 0 .OR. data_output(i)(ilen-2:ilen) /= '_xy' ) THEN 2496 message_string = 'illegal value for data_output: "' // & 2497 TRIM( var ) // '" & only 2d-horizontal ' // & 2498 'cross sections are allowed for this value' 2347 message_string = 'illegal value for data_output: "' // TRIM( var ) // & 2348 '" & only 2d-horizontal cross sections are allowed for this value' 2499 2349 CALL message( 'check_parameters', 'PA0111', 1, 2, 0, 6, 0 ) 2500 2350 ENDIF 2501 2351 2502 2352 IF ( TRIM( var ) == 'lwp*' .AND. .NOT. bulk_cloud_model ) THEN 2503 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2504 ' resbulk_cloud_model = .TRUE.'2353 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2354 'bulk_cloud_model = .TRUE.' 2505 2355 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 2506 2356 ENDIF 2507 2357 IF ( TRIM( var ) == 'qsws*' .AND. .NOT. humidity ) THEN 2508 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2509 'res humidity = .TRUE.' 2358 message_string = 'output of "' // TRIM( var ) // '" requires humidity = .TRUE.' 2510 2359 CALL message( 'check_parameters', 'PA0322', 1, 2, 0, 6, 0 ) 2511 2360 ENDIF 2512 2361 2513 2362 IF ( TRIM( var ) == 'ghf*' .AND. .NOT. land_surface ) THEN 2514 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2515 'res land_surface = .TRUE.' 2363 message_string = 'output of "' // TRIM( var ) // '" requires land_surface = .TRUE.' 2516 2364 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 2517 2365 ENDIF 2518 2366 2519 IF ( ( TRIM( var ) == 'r_a*' .OR. TRIM( var ) == 'ghf*' ) & 2520 .AND. .NOT. land_surface .AND. .NOT. urban_surface ) & 2521 THEN 2522 message_string = 'output of "' // TRIM( var ) // '" requi' // & 2523 'res land_surface = .TRUE. or ' // & 2524 'urban_surface = .TRUE.' 2367 IF ( ( TRIM( var ) == 'r_a*' .OR. TRIM( var ) == 'ghf*' ) .AND. .NOT. land_surface & 2368 .AND. .NOT. urban_surface ) THEN 2369 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2370 'land_surface = .TRUE. or ' // 'urban_surface = .TRUE.' 2525 2371 CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 ) 2526 2372 ENDIF 2527 2373 2528 IF ( TRIM( var ) == 'ssws*' .AND. .NOT. 2529 message_string = 'output of "' // TRIM( var ) // '" requi ' //&2530 ' respassive_scalar = .TRUE.'2374 IF ( TRIM( var ) == 'ssws*' .AND. .NOT. passive_scalar ) THEN 2375 message_string = 'output of "' // TRIM( var ) // '" requires ' // & 2376 'passive_scalar = .TRUE.' 2531 2377 CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) 2532 2378 ENDIF … … 2547 2393 IF ( TRIM( var ) == 'z0h*' ) unit = 'm' 2548 2394 ! 2549 !-- Output of surface latent and sensible heat flux will be in W/m2 2550 !-- in case of natural- and urban-type surfaces, even if 2551 !-- flux_output_mode is set to kinematic units. 2395 !-- Output of surface latent and sensible heat flux will be in W/m2 in case of natural- and 2396 !-- urban-type surfaces, even if flux_output_mode is set to kinematic units. 2552 2397 IF ( land_surface .OR. urban_surface ) THEN 2553 2398 IF ( TRIM( var ) == 'shf*' ) unit = 'W/m2' … … 2562 2407 IF ( unit == 'illegal' ) THEN 2563 2408 IF ( data_output_user(1) /= ' ' ) THEN 2564 message_string = 'illegal value for data_output or ' // &2565 'data_output_user = "' // TRIM( data_output(i) ) // '"'2409 message_string = 'illegal value for data_output or ' // & 2410 'data_output_user = "' // TRIM( data_output(i) ) // '"' 2566 2411 CALL message( 'check_parameters', 'PA0114', 1, 2, 0, 6, 0 ) 2567 2412 ELSE 2568 message_string = 'illegal value for data_output = "' // &2413 message_string = 'illegal value for data_output = "' // & 2569 2414 TRIM( data_output(i) ) // '"' 2570 2415 CALL message( 'check_parameters', 'PA0115', 1, 2, 0, 6, 0 ) … … 2614 2459 !-- Averaged 2d or 3d output requires that an averaging interval has been set 2615 2460 IF ( doav_n > 0 .AND. averaging_interval == 0.0_wp ) THEN 2616 WRITE( message_string, * ) 'output of averaged quantity "', & 2617 TRIM( doav(1) ), '_av" requires to set a ', & 2618 'non-zero averaging interval' 2461 WRITE( message_string, * ) 'output of averaged quantity "', TRIM( doav(1) ), & 2462 '_av" requires to set a ', 'non-zero averaging interval' 2619 2463 CALL message( 'check_parameters', 'PA0323', 1, 2, 0, 6, 0 ) 2620 2464 ENDIF … … 2638 2482 section(:,3) = section_yz 2639 2483 2640 IF ( ANY( data_output_xy ) .AND. .NOT. ANY( section(:,1) /= -9999 ) ) THEN 2641 WRITE( message_string, * ) 'section_xy not defined for requested ' // & 2642 'xy-cross section output.&At least one ' // & 2643 'cross section must be given.' 2484 IF ( ANY( data_output_xy ) .AND. .NOT. ANY( section(:,1) /= -9999 ) ) THEN 2485 WRITE( message_string, * ) 'section_xy not defined for requested xy-cross section ' // & 2486 'output.&At least one cross section must be given.' 2644 2487 CALL message( 'check_parameters', 'PA0681', 1, 2, 0, 6, 0 ) 2645 2488 ENDIF 2646 IF ( ANY( data_output_xz ) .AND. .NOT. ANY( section(:,2) /= -9999 ) ) THEN 2647 WRITE( message_string, * ) 'section_xz not defined for requested ' // & 2648 'xz-cross section output.&At least one ' // & 2649 'cross section must be given.' 2489 IF ( ANY( data_output_xz ) .AND. .NOT. ANY( section(:,2) /= -9999 ) ) THEN 2490 WRITE( message_string, * ) 'section_xz not defined for requested xz-cross section ' // & 2491 'output.&At least one cross section must be given.' 2650 2492 CALL message( 'check_parameters', 'PA0681', 1, 2, 0, 6, 0 ) 2651 2493 ENDIF 2652 IF ( ANY( data_output_yz ) .AND. .NOT. ANY( section(:,3) /= -9999 ) ) THEN 2653 WRITE( message_string, * ) 'section_yz not defined for requested ' // & 2654 'yz-cross section output.&At least one ' // & 2655 'cross section must be given.' 2494 IF ( ANY( data_output_yz ) .AND. .NOT. ANY( section(:,3) /= -9999 ) ) THEN 2495 WRITE( message_string, * ) 'section_yz not defined for requested yz-cross section ' // & 2496 'output.&At least one cross section must be given.' 2656 2497 CALL message( 'check_parameters', 'PA0681', 1, 2, 0, 6, 0 ) 2657 2498 ENDIF … … 2681 2522 !-- Check mask conditions 2682 2523 DO mid = 1, max_masks 2683 IF ( data_output_masks(mid,1) /= ' ' .OR. & 2684 data_output_masks_user(mid,1) /= ' ' ) THEN 2524 IF ( data_output_masks(mid,1) /= ' ' .OR. data_output_masks_user(mid,1) /= ' ' ) THEN 2685 2525 masks = masks + 1 2686 2526 ENDIF … … 2688 2528 2689 2529 IF ( masks < 0 .OR. masks > max_masks ) THEN 2690 WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', &2691 '<= ', max_masks,' (=max_masks)'2530 WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', '<= ', max_masks, & 2531 ' (=max_masks)' 2692 2532 CALL message( 'check_parameters', 'PA0325', 1, 2, 0, 6, 0 ) 2693 2533 ENDIF … … 2697 2537 mask_scale(3) = mask_scale_z 2698 2538 IF ( ANY( mask_scale <= 0.0_wp ) ) THEN 2699 WRITE( message_string, * ) & 2700 'illegal value: mask_scale_x, mask_scale_y and mask_scale_z', & 2701 'must be > 0.0' 2539 WRITE( message_string, * ) 'illegal value: mask_scale_x, mask_scale_y and mask_scale_z',& 2540 'must be > 0.0' 2702 2541 CALL message( 'check_parameters', 'PA0326', 1, 2, 0, 6, 0 ) 2703 2542 ENDIF 2704 2543 ! 2705 !-- Generate masks for masked data output 2706 !-- Parallel netcdf output is not tested so far for masked data, hence 2707 !-- netcdf_data_format isswitched back to non-parallel output.2544 !-- Generate masks for masked data output. 2545 !-- Parallel netcdf output is not tested so far for masked data, hence netcdf_data_format is 2546 !-- switched back to non-parallel output. 2708 2547 netcdf_data_format_save = netcdf_data_format 2709 2548 IF ( netcdf_data_format > 4 ) THEN 2710 2549 IF ( netcdf_data_format == 5 ) netcdf_data_format = 3 2711 2550 IF ( netcdf_data_format == 6 ) netcdf_data_format = 4 2712 message_string = 'netCDF file formats '// & 2713 '5 (parallel netCDF 4) and ' // & 2714 '6 (parallel netCDF 4 Classic model) '// & 2715 '& are currently not supported (not yet tested) ' //& 2716 'for masked data. &Using respective non-parallel' //& 2551 message_string = 'netCDF file formats '// '5 (parallel netCDF 4) and 6 (parallel ' // & 2552 'netCDF 4 Classic model) & are currently not supported (not yet ' // & 2553 'tested) for masked data. &Using respective non-parallel' // & 2717 2554 ' output for masked data.' 2718 2555 CALL message( 'check_parameters', 'PA0383', 0, 0, 0, 6, 0 ) … … 2728 2565 CONTINUE 2729 2566 #else 2730 message_string = 'netCDF: netCDF4 format requested but no ' // & 2731 'cpp-directive __netcdf4 given & switch ' // & 2732 'back to 64-bit offset format' 2567 message_string = 'netCDF: netCDF4 format requested but no ' // & 2568 'cpp-directive __netcdf4 given & switch back to 64-bit offset format' 2733 2569 CALL message( 'check_parameters', 'PA0171', 0, 1, 0, 6, 0 ) 2734 2570 netcdf_data_format = 2 … … 2739 2575 CONTINUE 2740 2576 #else 2741 message_string = 'netCDF: netCDF4 parallel output requested but no ' // &2742 'cpp-directive __netcdf4_parallel given & switch ' //&2577 message_string = 'netCDF: netCDF4 parallel output requested but no ' // & 2578 'cpp-directive __netcdf4_parallel given & switch ' // & 2743 2579 'back to netCDF4 non-parallel output' 2744 2580 CALL message( 'check_parameters', 'PA0099', 0, 1, 0, 6, 0 ) … … 2749 2585 ! 2750 2586 !-- Calculate fixed number of output time levels for parallel netcdf output. 2751 !-- The time dimension has to be defined as limited for parallel output, 2752 !-- because otherwise the I/Operformance drops significantly.2587 !-- The time dimension has to be defined as limited for parallel output, because otherwise the I/O 2588 !-- performance drops significantly. 2753 2589 IF ( netcdf_data_format > 4 ) THEN 2754 2590 2755 2591 ! 2756 !-- Check if any of the follwoing data output interval is 0.0s, which is 2757 !-- not allowed for paralleloutput.2592 !-- Check if any of the follwoing data output interval is 0.0s, which is not allowed for parallel 2593 !-- output. 2758 2594 CALL check_dt_do( dt_do3d, 'dt_do3d' ) 2759 2595 CALL check_dt_do( dt_do2d_xy, 'dt_do2d_xy' ) … … 2762 2598 CALL check_dt_do( dt_data_output_av, 'dt_data_output_av' ) 2763 2599 2764 !-- Set needed time levels (ntdim) to 2765 !-- saved time levels + to be saved time levels. 2766 ntdim_3d(0) = do3d_time_count(0) + CEILING( & 2767 ( end_time - MAX( & 2768 MERGE(skip_time_do3d, skip_time_do3d + spinup_time, & 2769 data_output_during_spinup ), & 2770 simulated_time_at_begin ) & 2600 !-- Set needed time levels (ntdim) to saved time levels + to be saved time levels. 2601 ntdim_3d(0) = do3d_time_count(0) + CEILING( & 2602 ( end_time - MAX( & 2603 MERGE( skip_time_do3d, skip_time_do3d + spinup_time, & 2604 data_output_during_spinup ), & 2605 simulated_time_at_begin ) & 2771 2606 ) / dt_do3d ) 2772 2607 IF ( do3d_at_begin ) ntdim_3d(0) = ntdim_3d(0) + 1 2773 2608 2774 ntdim_3d(1) = do3d_time_count(1) + CEILING( &2775 ( end_time - MAX( &2776 MERGE( skip_time_data_output_av, skip_time_data_output_av&2777 + spinup_time, data_output_during_spinup ),&2778 simulated_time_at_begin ) &2609 ntdim_3d(1) = do3d_time_count(1) + CEILING( & 2610 ( end_time - MAX( & 2611 MERGE( skip_time_data_output_av, skip_time_data_output_av + spinup_time, & 2612 data_output_during_spinup ), & 2613 simulated_time_at_begin ) & 2779 2614 ) / dt_data_output_av ) 2780 2615 2781 ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING( &2782 ( end_time - MAX( &2783 MERGE(skip_time_do2d_xy, skip_time_do2d_xy + spinup_time,&2784 data_output_during_spinup ),&2785 simulated_time_at_begin )&2616 ntdim_2d_xy(0) = do2d_xy_time_count(0) + CEILING( & 2617 ( end_time - MAX( & 2618 MERGE( skip_time_do2d_xy, skip_time_do2d_xy + spinup_time, & 2619 data_output_during_spinup ), & 2620 simulated_time_at_begin ) & 2786 2621 ) / dt_do2d_xy ) 2787 2622 2788 ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING( &2789 ( end_time - MAX( &2790 MERGE(skip_time_do2d_xz, skip_time_do2d_xz + spinup_time,&2791 data_output_during_spinup ),&2792 simulated_time_at_begin )&2623 ntdim_2d_xz(0) = do2d_xz_time_count(0) + CEILING( & 2624 ( end_time - MAX( & 2625 MERGE( skip_time_do2d_xz, skip_time_do2d_xz + spinup_time, & 2626 data_output_during_spinup ), & 2627 simulated_time_at_begin ) & 2793 2628 ) / dt_do2d_xz ) 2794 2629 2795 ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING( &2796 ( end_time - MAX( &2797 MERGE(skip_time_do2d_yz, skip_time_do2d_yz + spinup_time,&2798 data_output_during_spinup ),&2799 simulated_time_at_begin )&2630 ntdim_2d_yz(0) = do2d_yz_time_count(0) + CEILING( & 2631 ( end_time - MAX( & 2632 MERGE( skip_time_do2d_yz, skip_time_do2d_yz + spinup_time, & 2633 data_output_during_spinup ), & 2634 simulated_time_at_begin ) & 2800 2635 ) / dt_do2d_yz ) 2801 2636 … … 2806 2641 ENDIF 2807 2642 ! 2808 !-- Please note, for averaged 2D data skip_time_data_output_av is the relavant 2809 !-- output controlparameter.2810 ntdim_2d_xy(1) = do2d_xy_time_count(1) + CEILING( &2811 ( end_time - MAX( MERGE( skip_time_data_output_av,&2812 skip_time_data_output_av + spinup_time,&2813 data_output_during_spinup ),&2814 simulated_time_at_begin )&2815 ) / dt_data_output_av )2816 2817 ntdim_2d_xz(1) = do2d_xz_time_count(1) + CEILING( &2818 ( end_time - MAX( MERGE( skip_time_data_output_av,&2819 skip_time_data_output_av + spinup_time,&2820 data_output_during_spinup ),&2821 simulated_time_at_begin )&2822 ) / dt_data_output_av )2823 2824 ntdim_2d_yz(1) = do2d_yz_time_count(1) + CEILING( &2825 ( end_time - MAX( MERGE( skip_time_data_output_av,&2826 skip_time_data_output_av + spinup_time,&2827 data_output_during_spinup ),&2828 simulated_time_at_begin )&2829 ) / dt_data_output_av )2643 !-- Please note, for averaged 2D data skip_time_data_output_av is the relavant output control 2644 !-- parameter. 2645 ntdim_2d_xy(1) = do2d_xy_time_count(1) + CEILING( & 2646 ( end_time - MAX( MERGE( skip_time_data_output_av, & 2647 skip_time_data_output_av + spinup_time, & 2648 data_output_during_spinup ), & 2649 simulated_time_at_begin ) & 2650 ) / dt_data_output_av ) 2651 2652 ntdim_2d_xz(1) = do2d_xz_time_count(1) + CEILING( & 2653 ( end_time - MAX( MERGE( skip_time_data_output_av, & 2654 skip_time_data_output_av + spinup_time, & 2655 data_output_during_spinup ), & 2656 simulated_time_at_begin ) & 2657 ) / dt_data_output_av ) 2658 2659 ntdim_2d_yz(1) = do2d_yz_time_count(1) + CEILING( & 2660 ( end_time - MAX( MERGE( skip_time_data_output_av, & 2661 skip_time_data_output_av + spinup_time, & 2662 data_output_during_spinup ), & 2663 simulated_time_at_begin ) & 2664 ) / dt_data_output_av ) 2830 2665 2831 2666 ENDIF … … 2839 2674 ELSE 2840 2675 IF ( prandtl_number < 0.0_wp ) THEN 2841 WRITE( message_string, * ) 'prandtl_number = ', prandtl_number, & 2842 ' < 0.0' 2676 WRITE( message_string, * ) 'prandtl_number = ', prandtl_number, ' < 0.0' 2843 2677 CALL message( 'check_parameters', 'PA0122', 1, 2, 0, 6, 0 ) 2844 2678 ENDIF … … 2846 2680 2847 2681 IF ( constant_flux_layer ) THEN 2848 message_string = 'constant_flux_layer is not allowed with fixed ' & 2849 // 'value of km' 2682 message_string = 'constant_flux_layer is not allowed with fixed value of km' 2850 2683 CALL message( 'check_parameters', 'PA0123', 1, 2, 0, 6, 0 ) 2851 2684 ENDIF … … 2854 2687 2855 2688 ! 2856 !-- In case of non-cyclic lateral boundaries and a damping layer for the 2857 !-- potential temperature,check the width of the damping layer2689 !-- In case of non-cyclic lateral boundaries and a damping layer for the potential temperature, 2690 !-- check the width of the damping layer 2858 2691 IF ( bc_lr /= 'cyclic' ) THEN 2859 IF ( pt_damping_width < 0.0_wp .OR. & 2860 pt_damping_width > REAL( (nx+1) * dx ) ) THEN 2692 IF ( pt_damping_width < 0.0_wp .OR. pt_damping_width > REAL( (nx+1) * dx ) ) THEN 2861 2693 message_string = 'pt_damping_width out of range' 2862 2694 CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) … … 2865 2697 2866 2698 IF ( bc_ns /= 'cyclic' ) THEN 2867 IF ( pt_damping_width < 0.0_wp .OR. & 2868 pt_damping_width > REAL( (ny+1) * dy ) ) THEN 2699 IF ( pt_damping_width < 0.0_wp .OR. pt_damping_width > REAL( (ny+1) * dy ) ) THEN 2869 2700 message_string = 'pt_damping_width out of range' 2870 2701 CALL message( 'check_parameters', 'PA0124', 1, 2, 0, 6, 0 ) … … 2875 2706 !-- Check value range for zeta = z/L 2876 2707 IF ( zeta_min >= zeta_max ) THEN 2877 WRITE( message_string, * ) 'zeta_min = ', zeta_min, ' must be less ', &2878 'than zeta_max = ',zeta_max2708 WRITE( message_string, * ) 'zeta_min = ', zeta_min, ' must be less ', 'than zeta_max = ', & 2709 zeta_max 2879 2710 CALL message( 'check_parameters', 'PA0125', 1, 2, 0, 6, 0 ) 2880 2711 ENDIF … … 2882 2713 ! 2883 2714 !-- Check random generator 2884 IF ( (random_generator /= 'system-specific' .AND. &2885 random_generator /= 'random-parallel' ) .AND. &2715 IF ( (random_generator /= 'system-specific' .AND. & 2716 random_generator /= 'random-parallel' ) .AND. & 2886 2717 random_generator /= 'numerical-recipes' ) THEN 2887 message_string = 'unknown random generator: random_generator = "' // &2718 message_string = 'unknown random generator: random_generator = "' // & 2888 2719 TRIM( random_generator ) // '"' 2889 2720 CALL message( 'check_parameters', 'PA0135', 1, 2, 0, 6, 0 ) … … 2901 2732 ENDIF 2902 2733 ELSEIF ( disturbance_level_b < zu(3) ) THEN 2903 WRITE( message_string, * ) 'disturbance_level_b = ', 2904 disturbance_level_b, ' must be >= ',zu(3), '(zu(3))'2734 WRITE( message_string, * ) 'disturbance_level_b = ', disturbance_level_b, ' must be >= ', & 2735 zu(3), '(zu(3))' 2905 2736 CALL message( 'check_parameters', 'PA0126', 1, 2, 0, 6, 0 ) 2906 2737 ELSEIF ( disturbance_level_b > zu(nzt-2) ) THEN 2907 WRITE( message_string, * ) 'disturbance_level_b = ', 2908 disturbance_level_b, ' must be <= ',zu(nzt-2), '(zu(nzt-2))'2738 WRITE( message_string, * ) 'disturbance_level_b = ', disturbance_level_b, ' must be <= ', & 2739 zu(nzt-2), '(zu(nzt-2))' 2909 2740 CALL message( 'check_parameters', 'PA0127', 1, 2, 0, 6, 0 ) 2910 2741 ELSE … … 2926 2757 ENDIF 2927 2758 ELSEIF ( disturbance_level_t > zu(nzt-2) ) THEN 2928 WRITE( message_string, * ) 'disturbance_level_t = ', 2929 disturbance_level_t, ' must be <= ',zu(nzt-2), '(zu(nzt-2))'2759 WRITE( message_string, * ) 'disturbance_level_t = ', disturbance_level_t, ' must be <= ', & 2760 zu(nzt-2), '(zu(nzt-2))' 2930 2761 CALL message( 'check_parameters', 'PA0128', 1, 2, 0, 6, 0 ) 2931 2762 ELSEIF ( disturbance_level_t < disturbance_level_b ) THEN 2932 WRITE( message_string, * ) 'disturbance_level_t = ', & 2933 disturbance_level_t, ' must be >= disturbance_level_b = ', & 2934 disturbance_level_b 2763 WRITE( message_string, * ) 'disturbance_level_t = ', disturbance_level_t, & 2764 ' must be >= disturbance_level_b = ', disturbance_level_b 2935 2765 CALL message( 'check_parameters', 'PA0129', 1, 2, 0, 6, 0 ) 2936 2766 ELSE … … 2945 2775 ! 2946 2776 !-- Check again whether the levels determined this way are ok. 2947 !-- Error may occur at automatic determination and too few grid points in 2948 !-- z-direction. 2777 !-- Error may occur at automatic determination and too few grid points in z-direction. 2949 2778 IF ( disturbance_level_ind_t < disturbance_level_ind_b ) THEN 2950 WRITE( message_string, * ) 'disturbance_level_ind_t = ', & 2951 disturbance_level_ind_t, ' must be >= ', & 2952 'disturbance_level_ind_b = ', disturbance_level_ind_b 2779 WRITE( message_string, * ) 'disturbance_level_ind_t = ', disturbance_level_ind_t, & 2780 ' must be >= ', 'disturbance_level_ind_b = ', disturbance_level_ind_b 2953 2781 CALL message( 'check_parameters', 'PA0130', 1, 2, 0, 6, 0 ) 2954 2782 ENDIF … … 2956 2784 ! 2957 2785 !-- Determine the horizontal index range for random perturbations. 2958 !-- In case of non-cyclic horizontal boundaries, no perturbations are imposed 2959 !-- near the inflow and the perturbation area is further limited to ...(1) 2960 !-- after the initial phase of the flow. 2786 !-- In case of non-cyclic horizontal boundaries, no perturbations are imposed near the inflow and 2787 !-- the perturbation area is further limited to ...(1) after the initial phase of the flow. 2961 2788 2962 2789 IF ( bc_lr /= 'cyclic' ) THEN … … 2964 2791 inflow_disturbance_begin = MIN( 10, nx/2 ) 2965 2792 ENDIF 2966 IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > nx )& 2967 THEN 2793 IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > nx ) THEN 2968 2794 message_string = 'inflow_disturbance_begin out of range' 2969 2795 CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) … … 2972 2798 inflow_disturbance_end = MIN( 100, 3*nx/4 ) 2973 2799 ENDIF 2974 IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > nx ) & 2975 THEN 2800 IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > nx ) THEN 2976 2801 message_string = 'inflow_disturbance_end out of range' 2977 2802 CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) … … 2981 2806 inflow_disturbance_begin = MIN( 10, ny/2 ) 2982 2807 ENDIF 2983 IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > ny )& 2984 THEN 2808 IF ( inflow_disturbance_begin < 0 .OR. inflow_disturbance_begin > ny ) THEN 2985 2809 message_string = 'inflow_disturbance_begin out of range' 2986 2810 CALL message( 'check_parameters', 'PA0131', 1, 2, 0, 6, 0 ) … … 2989 2813 inflow_disturbance_end = MIN( 100, 3*ny/4 ) 2990 2814 ENDIF 2991 IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > ny ) & 2992 THEN 2815 IF ( inflow_disturbance_end < 0 .OR. inflow_disturbance_end > ny ) THEN 2993 2816 message_string = 'inflow_disturbance_end out of range' 2994 2817 CALL message( 'check_parameters', 'PA0132', 1, 2, 0, 6, 0 ) … … 3045 2868 3046 2869 ! 3047 !-- A turbulent inflow requires Dirichlet conditions at the respective inflow 3048 !-- boundary (so far, a turbulent inflow is realized from the left side only)2870 !-- A turbulent inflow requires Dirichlet conditions at the respective inflow boundary (so far, a 2871 !-- turbulent inflow is realized from the left side only). 3049 2872 IF ( turbulent_inflow .AND. bc_lr /= 'dirichlet/radiation' ) THEN 3050 message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // &2873 message_string = 'turbulent_inflow = .T. requires a Dirichlet ' // & 3051 2874 'condition at the inflow boundary' 3052 2875 CALL message( 'check_parameters', 'PA0133', 1, 2, 0, 6, 0 ) … … 3054 2877 3055 2878 ! 3056 !-- Turbulent inflow requires that 3d arrays have been cyclically filled with 3057 !-- data from prerun inthe first main run3058 IF ( turbulent_inflow .AND. initializing_actions /= 'cyclic_fill' .AND. &2879 !-- Turbulent inflow requires that 3d arrays have been cyclically filled with data from prerun in 2880 !-- the first main run 2881 IF ( turbulent_inflow .AND. initializing_actions /= 'cyclic_fill' .AND. & 3059 2882 initializing_actions /= 'read_restart_data' ) THEN 3060 message_string = 'turbulent_inflow = .T. requires ' // &3061 'initializing_actions = ''cyclic_fill'' or ' // &2883 message_string = 'turbulent_inflow = .T. requires ' // & 2884 'initializing_actions = ''cyclic_fill'' or ' // & 3062 2885 'initializing_actions = ''read_restart_data'' ' 3063 2886 CALL message( 'check_parameters', 'PA0055', 1, 2, 0, 6, 0 ) … … 3071 2894 !-- Calculate the index of the recycling plane 3072 2895 IF ( recycling_width <= dx .OR. recycling_width >= nx * dx ) THEN 3073 WRITE( message_string, * ) 'illegal value for recycling_width: ', & 3074 recycling_width 2896 WRITE( message_string, * ) 'illegal value for recycling_width: ', recycling_width 3075 2897 CALL message( 'check_parameters', 'PA0134', 1, 2, 0, 6, 0 ) 3076 2898 ENDIF … … 3080 2902 ! 3081 2903 !-- Check for correct input of recycling method for thermodynamic quantities 3082 IF ( TRIM( recycling_method_for_thermodynamic_quantities ) /= 'turbulent_fluctuation' .AND.&2904 IF ( TRIM( recycling_method_for_thermodynamic_quantities ) /= 'turbulent_fluctuation' .AND.& 3083 2905 TRIM( recycling_method_for_thermodynamic_quantities ) /= 'absolute_value' ) THEN 3084 2906 WRITE( message_string, * ) 'unknown recycling method for thermodynamic quantities: ', & … … 3092 2914 IF ( turbulent_outflow ) THEN 3093 2915 ! 3094 !-- Turbulent outflow requires Dirichlet conditions at the respective inflow 3095 !-- boundary (so far, a turbulent outflow is realized at the right side only)2916 !-- Turbulent outflow requires Dirichlet conditions at the respective inflow boundary (so far, a 2917 !-- turbulent outflow is realized at the right side only). 3096 2918 IF ( bc_lr /= 'dirichlet/radiation' ) THEN 3097 message_string = 'turbulent_outflow = .T. requires ' // & 3098 'bc_lr = "dirichlet/radiation"' 2919 message_string = 'turbulent_outflow = .T. requires bc_lr = "dirichlet/radiation"' 3099 2920 CALL message( 'check_parameters', 'PA0038', 1, 2, 0, 6, 0 ) 3100 2921 ENDIF 3101 2922 ! 3102 2923 !-- The ouflow-source plane must lay inside the model domain 3103 IF ( outflow_source_plane < dx .OR. & 3104 outflow_source_plane > nx * dx ) THEN 3105 WRITE( message_string, * ) 'illegal value for outflow_source'// & 3106 '_plane: ', outflow_source_plane 2924 IF ( outflow_source_plane < dx .OR. outflow_source_plane > nx * dx ) THEN 2925 WRITE( message_string, * ) 'illegal value for outflow_source'// '_plane: ', & 2926 outflow_source_plane 3107 2927 CALL message( 'check_parameters', 'PA0145', 1, 2, 0, 6, 0 ) 3108 2928 ENDIF … … 3116 2936 damp_level_ind_1d = nzt + 1 3117 2937 ELSEIF ( damp_level_1d < 0.0_wp .OR. damp_level_1d > zu(nzt+1) ) THEN 3118 WRITE( message_string, * ) 'damp_level_1d = ', damp_level_1d, 3119 ' must be >= 0.0 and <= ',zu(nzt+1), '(zu(nzt+1))'2938 WRITE( message_string, * ) 'damp_level_1d = ', damp_level_1d, ' must be >= 0.0 and <= ',& 2939 zu(nzt+1), '(zu(nzt+1))' 3120 2940 CALL message( 'check_parameters', 'PA0136', 1, 2, 0, 6, 0 ) 3121 2941 ELSE … … 3131 2951 ! 3132 2952 !-- Check some other 1d-model parameters 3133 IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. &2953 IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & 3134 2954 TRIM( mixing_length_1d ) /= 'blackadar' ) THEN 3135 message_string = 'mixing_length_1d = "' // TRIM( mixing_length_1d ) // & 3136 '" is unknown' 2955 message_string = 'mixing_length_1d = "' // TRIM( mixing_length_1d ) // '" is unknown' 3137 2956 CALL message( 'check_parameters', 'PA0137', 1, 2, 0, 6, 0 ) 3138 2957 ENDIF 3139 IF ( TRIM( dissipation_1d ) /= 'as_in_3d_model' .AND. &3140 TRIM( dissipation_1d ) /= 'detering' .AND.&2958 IF ( TRIM( dissipation_1d ) /= 'as_in_3d_model' .AND. & 2959 TRIM( dissipation_1d ) /= 'detering' .AND. & 3141 2960 TRIM( dissipation_1d ) /= 'prognostic' ) THEN 3142 message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & 3143 '" is unknown' 2961 message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // '" is unknown' 3144 2962 CALL message( 'check_parameters', 'PA0138', 1, 2, 0, 6, 0 ) 3145 2963 ENDIF 3146 IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. &2964 IF ( TRIM( mixing_length_1d ) /= 'as_in_3d_model' .AND. & 3147 2965 TRIM( dissipation_1d ) == 'as_in_3d_model' ) THEN 3148 message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // &2966 message_string = 'dissipation_1d = "' // TRIM( dissipation_1d ) // & 3149 2967 '" requires mixing_length_1d = "as_in_3d_model"' 3150 2968 CALL message( 'check_parameters', 'PA0485', 1, 2, 0, 6, 0 ) … … 3152 2970 3153 2971 ! 3154 !-- Set time for the next user defined restart (time_restart is the 3155 !-- internal parameter for steeringrestart events)2972 !-- Set time for the next user defined restart (time_restart is the internal parameter for steering 2973 !-- restart events) 3156 2974 IF ( restart_time /= 9999999.9_wp ) THEN 3157 2975 IF ( restart_time > time_since_reference_point ) THEN … … 3160 2978 ELSE 3161 2979 ! 3162 !-- In case of a restart run, set internal parameter to default (no restart) 3163 !-- if theNAMELIST-parameter restart_time is omitted2980 !-- In case of a restart run, set internal parameter to default (no restart) if the 2981 !-- NAMELIST-parameter restart_time is omitted 3164 2982 time_restart = 9999999.9_wp 3165 2983 ENDIF … … 3168 2986 !-- Check pressure gradient conditions 3169 2987 IF ( dp_external .AND. conserve_volume_flow ) THEN 3170 WRITE( message_string, * ) 'Both dp_external and conserve_volume_flo', &3171 'w are .TRUE. but one of them must be .FALSE.'2988 WRITE( message_string, * ) 'Both dp_external and conserve_volume_flo', & 2989 'w are .TRUE. but one of them must be .FALSE.' 3172 2990 CALL message( 'check_parameters', 'PA0150', 1, 2, 0, 6, 0 ) 3173 2991 ENDIF 3174 2992 IF ( dp_external ) THEN 3175 2993 IF ( dp_level_b < zu(nzb) .OR. dp_level_b > zu(nzt) ) THEN 3176 WRITE( message_string, * ) 'dp_level_b = ', dp_level_b, ' is out ', &3177 ' of range [zu(nzb), zu(nzt)]'2994 WRITE( message_string, * ) 'dp_level_b = ', dp_level_b, ' is out ', & 2995 ' of range [zu(nzb), zu(nzt)]' 3178 2996 CALL message( 'check_parameters', 'PA0151', 1, 2, 0, 6, 0 ) 3179 2997 ENDIF 3180 2998 IF ( .NOT. ANY( dpdxy /= 0.0_wp ) ) THEN 3181 WRITE( message_string, * ) 'dp_external is .TRUE. but dpdxy is ze', &3182 'ro, i.e. the external pressure gradient will not be applied'2999 WRITE( message_string, * ) 'dp_external is .TRUE. but dpdxy is ze', & 3000 'ro, i.e. the external pressure gradient will not be applied' 3183 3001 CALL message( 'check_parameters', 'PA0152', 0, 1, 0, 6, 0 ) 3184 3002 ENDIF 3185 3003 ENDIF 3186 3004 IF ( ANY( dpdxy /= 0.0_wp ) .AND. .NOT. dp_external ) THEN 3187 WRITE( message_string, * ) 'dpdxy is nonzero but dp_external is ', &3188 '.FALSE., i.e. the external pressure gradient & will not be applied'3005 WRITE( message_string, * ) 'dpdxy is nonzero but dp_external is ', & 3006 '.FALSE., i.e. the external pressure gradient & will not be applied' 3189 3007 CALL message( 'check_parameters', 'PA0153', 0, 1, 0, 6, 0 ) 3190 3008 ENDIF … … 3194 3012 conserve_volume_flow_mode = 'initial_profiles' 3195 3013 3196 ELSEIF ( TRIM( conserve_volume_flow_mode ) /= 'initial_profiles' .AND.&3197 TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) THEN3198 WRITE( message_string, * ) 'unknown conserve_volume_flow_mode: ', &3199 conserve_volume_flow_mode3014 ELSEIF ( TRIM( conserve_volume_flow_mode ) /= 'initial_profiles' .AND. & 3015 TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) THEN 3016 WRITE( message_string, * ) 'unknown conserve_volume_flow_mode: ', & 3017 conserve_volume_flow_mode 3200 3018 CALL message( 'check_parameters', 'PA0154', 1, 2, 0, 6, 0 ) 3201 3019 ENDIF 3202 IF ( ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic') .AND.&3203 TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' ) THEN3204 WRITE( message_string, * ) 'non-cyclic boundary conditions ', &3205 'require conserve_volume_flow_mode = ''initial_profiles'''3020 IF ( ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic') .AND. & 3021 TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' ) THEN 3022 WRITE( message_string, * ) 'non-cyclic boundary conditions ', & 3023 'require conserve_volume_flow_mode = ''initial_profiles''' 3206 3024 CALL message( 'check_parameters', 'PA0155', 1, 2, 0, 6, 0 ) 3207 3025 ENDIF 3208 3026 ENDIF 3209 IF ( ( u_bulk /= 0.0_wp .OR. v_bulk /= 0.0_wp ) .AND. & 3210 ( .NOT. conserve_volume_flow .OR. & 3211 TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) ) THEN 3212 WRITE( message_string, * ) 'nonzero bulk velocity requires ', & 3213 'conserve_volume_flow = .T. and ', & 3214 'conserve_volume_flow_mode = ''bulk_velocity''' 3027 IF ( ( u_bulk /= 0.0_wp .OR. v_bulk /= 0.0_wp ) .AND. & 3028 ( .NOT. conserve_volume_flow .OR. TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) )& 3029 THEN 3030 WRITE( message_string, * ) 'nonzero bulk velocity requires ', & 3031 'conserve_volume_flow = .T. and ', 'conserve_volume_flow_mode = ''bulk_velocity''' 3215 3032 CALL message( 'check_parameters', 'PA0157', 1, 2, 0, 6, 0 ) 3216 3033 ENDIF 3217 3034 3218 3035 ! 3219 !-- Prevent empty time records in volume, cross-section and masked data in case 3220 !-- of non-parallelnetcdf-output in restart runs3036 !-- Prevent empty time records in volume, cross-section and masked data in case of non-parallel 3037 !-- netcdf-output in restart runs 3221 3038 IF ( netcdf_data_format < 5 ) THEN 3222 3039 IF ( TRIM( initializing_actions ) == 'read_restart_data' ) THEN … … 3232 3049 ! 3233 3050 !-- Check roughness length, which has to be smaller than dz/2 3234 IF ( ( constant_flux_layer .OR. & 3235 INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) & 3236 .AND. roughness_length >= 0.5 * dz(1) ) THEN 3051 IF ( ( constant_flux_layer .OR. INDEX( initializing_actions, 'set_1d-model_profiles' ) /= 0 ) & 3052 .AND. roughness_length >= 0.5 * dz(1) ) THEN 3237 3053 message_string = 'roughness_length must be smaller than dz/2' 3238 3054 CALL message( 'check_parameters', 'PA0424', 1, 2, 0, 6, 0 ) … … 3248 3064 !-- Check if topography is read from file in case of complex terrain simulations 3249 3065 IF ( complex_terrain .AND. TRIM( topography ) /= 'read_from_file' ) THEN 3250 message_string = 'complex_terrain requires topography' // & 3251 ' = ''read_from_file''' 3066 message_string = 'complex_terrain requires topography = ''read_from_file''' 3252 3067 CALL message( 'check_parameters', 'PA0295', 1, 2, 0, 6, 0 ) 3253 3068 ENDIF 3254 3069 3255 3070 ! 3256 !-- Check if vertical grid stretching is switched off in case of complex 3257 !-- terrain simulations 3258 IF ( complex_terrain .AND. & 3259 ANY( dz_stretch_level_start /= -9999999.9_wp ) ) THEN 3260 message_string = 'Vertical grid stretching is not allowed for ' // & 3261 'complex_terrain = .T.' 3071 !-- Check if vertical grid stretching is switched off in case of complex terrain simulations 3072 IF ( complex_terrain .AND. ANY( dz_stretch_level_start /= -9999999.9_wp ) ) THEN 3073 message_string = 'Vertical grid stretching is not allowed for complex_terrain = .TRUE.' 3262 3074 CALL message( 'check_parameters', 'PA0473', 1, 2, 0, 6, 0 ) 3263 3075 ENDIF … … 3267 3079 CONTAINS 3268 3080 3269 !------------------------------------------------------------------------------ !3081 !--------------------------------------------------------------------------------------------------! 3270 3082 ! Description: 3271 3083 ! ------------ 3272 !> Check the length of data output intervals. In case of parallel NetCDF output 3273 !> the time levels of the output files need to be fixed. Therefore setting the 3274 !> output interval to 0.0s (usually used to output each timestep) is not 3275 !> possible as long as a non-fixed timestep is used. 3276 !------------------------------------------------------------------------------! 3084 !> Check the length of data output intervals. In case of parallel NetCDF output the time levels of 3085 !> the output files need to be fixed. Therefore setting the output interval to 0.0s (usually used to 3086 !> output each timestep) is not possible as long as a non-fixed timestep is used. 3087 !--------------------------------------------------------------------------------------------------! 3277 3088 3278 3089 SUBROUTINE check_dt_do( dt_do, dt_do_name ) … … 3286 3097 IF ( dt_do == 0.0_wp ) THEN 3287 3098 IF ( dt_fixed ) THEN 3288 WRITE( message_string, '(A,F9.4,A)' ) 'Output at every ' // & 3289 'timestep is wanted (' // dt_do_name // ' = 0.0).&'// & 3290 'The output interval is set to the fixed timestep dt '// & 3291 '= ', dt, 's.' 3099 WRITE( message_string, '(A,F9.4,A)' ) 'Output at every timestep is wanted (' // & 3100 dt_do_name // ' = 0.0).&'// & 3101 'The output interval is set to the fixed timestep dt '// '= ', dt, 's.' 3292 3102 CALL message( 'check_parameters', 'PA0060', 0, 0, 0, 6, 0 ) 3293 3103 dt_do = dt 3294 3104 ELSE 3295 message_string = dt_do_name // ' = 0.0 while using a ' // & 3296 'variable timestep and parallel netCDF4 ' // & 3297 'is not allowed.' 3105 message_string = dt_do_name // ' = 0.0 while using a ' // & 3106 'variable timestep and parallel netCDF4 is not allowed.' 3298 3107 CALL message( 'check_parameters', 'PA0081', 1, 2, 0, 6, 0 ) 3299 3108 ENDIF … … 3304 3113 3305 3114 3306 !------------------------------------------------------------------------------ !3115 !--------------------------------------------------------------------------------------------------! 3307 3116 ! Description: 3308 3117 ! ------------ 3309 3118 !> Set the bottom and top boundary conditions for humidity and scalars. 3310 !------------------------------------------------------------------------------ !3119 !--------------------------------------------------------------------------------------------------! 3311 3120 3312 3121 SUBROUTINE set_bc_scalars( sq, bc_b, bc_t, ibc_b, ibc_t, err_nr_b, err_nr_t ) … … 3315 3124 IMPLICIT NONE 3316 3125 3317 CHARACTER (LEN=1) :: sq !< name of scalar quantity3318 3126 CHARACTER (LEN=*) :: bc_b !< bottom boundary condition 3319 3127 CHARACTER (LEN=*) :: bc_t !< top boundary condition 3320 3128 CHARACTER (LEN=*) :: err_nr_b !< error number if bottom bc is unknown 3321 3129 CHARACTER (LEN=*) :: err_nr_t !< error number if top bc is unknown 3130 CHARACTER (LEN=1) :: sq !< name of scalar quantity 3131 3322 3132 3323 3133 INTEGER(iwp) :: ibc_b !< index for bottom boundary condition … … 3325 3135 3326 3136 ! 3327 !-- Set Integer flags and check for possilbe errorneous settings for bottom 3328 !-- boundary condition 3137 !-- Set Integer flags and check for possilbe errorneous settings for bottom boundary condition 3329 3138 IF ( bc_b == 'dirichlet' ) THEN 3330 3139 ibc_b = 0 … … 3332 3141 ibc_b = 1 3333 3142 ELSE 3334 message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // &3335 '_b ="' //TRIM( bc_b ) // '"'3143 message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // '_b ="' // & 3144 TRIM( bc_b ) // '"' 3336 3145 CALL message( 'check_parameters', err_nr_b, 1, 2, 0, 6, 0 ) 3337 3146 ENDIF 3338 3147 ! 3339 !-- Set Integer flags and check for possilbe errorneous settings for top 3340 !-- boundary condition 3148 !-- Set Integer flags and check for possilbe errorneous settings for top boundary condition 3341 3149 IF ( bc_t == 'dirichlet' ) THEN 3342 3150 ibc_t = 0 … … 3348 3156 ibc_t = 3 3349 3157 ELSE 3350 message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // &3351 '_t ="' //TRIM( bc_t ) // '"'3158 message_string = 'unknown boundary condition: bc_' // TRIM( sq ) // '_t ="' // & 3159 TRIM( bc_t ) // '"' 3352 3160 CALL message( 'check_parameters', err_nr_t, 1, 2, 0, 6, 0 ) 3353 3161 ENDIF … … 3358 3166 3359 3167 3360 !------------------------------------------------------------------------------ !3168 !--------------------------------------------------------------------------------------------------! 3361 3169 ! Description: 3362 3170 ! ------------ 3363 !> Check for consistent settings of bottom boundary conditions for humidity 3364 !> and scalars. 3365 !------------------------------------------------------------------------------! 3366 3367 SUBROUTINE check_bc_scalars( sq, bc_b, ibc_b, & 3368 err_nr_1, err_nr_2, & 3369 constant_flux, surface_initial_change ) 3171 !> Check for consistent settings of bottom boundary conditions for humidity and scalars. 3172 !--------------------------------------------------------------------------------------------------! 3173 3174 SUBROUTINE check_bc_scalars( sq, bc_b, ibc_b, err_nr_1, err_nr_2, constant_flux, & 3175 surface_initial_change ) 3370 3176 3371 3177 3372 3178 IMPLICIT NONE 3373 3179 3374 CHARACTER (LEN=1) :: sq !< name of scalar quantity3375 3180 CHARACTER (LEN=*) :: bc_b !< bottom boundary condition 3376 3181 CHARACTER (LEN=*) :: err_nr_1 !< error number of first error 3377 3182 CHARACTER (LEN=*) :: err_nr_2 !< error number of second error 3183 CHARACTER (LEN=1) :: sq !< name of scalar quantity 3184 3378 3185 3379 3186 INTEGER(iwp) :: ibc_b !< index of bottom boundary condition … … 3384 3191 3385 3192 ! 3386 !-- A given surface value implies Dirichlet boundary condition for 3387 !-- the respective quantity. In this case specification of a constant flux is 3388 !-- forbidden. However, an exception is made for large-scale forcing as well 3389 !-- as land-surface model. 3193 !-- A given surface value implies Dirichlet boundary condition for the respective quantity. In 3194 !-- this case specification of a constant flux is forbidden. However, an exception is made for 3195 !-- large-scale forcing as well as land-surface model. 3390 3196 IF ( .NOT. land_surface .AND. .NOT. large_scale_forcing ) THEN 3391 3197 IF ( ibc_b == 0 .AND. constant_flux ) THEN 3392 message_string = 'boundary condition: bc_' // TRIM( sq ) // & 3393 '_b ' // '= "' // TRIM( bc_b ) // & 3394 '" is not allowed with prescribed surface flux' 3198 message_string = 'boundary condition: bc_' // TRIM( sq ) // '_b = "' // & 3199 TRIM( bc_b ) // '" is not allowed with prescribed surface flux' 3395 3200 CALL message( 'check_parameters', err_nr_1, 1, 2, 0, 6, 0 ) 3396 3201 ENDIF 3397 3202 ENDIF 3398 3203 IF ( constant_flux .AND. surface_initial_change /= 0.0_wp ) THEN 3399 WRITE( message_string, * ) 'a prescribed surface flux is not allo', & 3400 'wed with ', sq, '_surface_initial_change (/=0) = ', & 3401 surface_initial_change 3204 WRITE( message_string, * ) 'a prescribed surface flux is not allo', 'wed with ', sq, & 3205 '_surface_initial_change (/=0) = ', surface_initial_change 3402 3206 CALL message( 'check_parameters', err_nr_2, 1, 2, 0, 6, 0 ) 3403 3207 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.