Changeset 667 for palm/trunk/SOURCE/check_parameters.f90
- Timestamp:
- Dec 23, 2010 12:06:00 PM (13 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
/palm/branches/suehring 423-666 /palm/branches/letzel/masked_output/SOURCE 296-409
-
Property
svn:mergeinfo
set to
(toggle deleted branches)
-
palm/trunk/SOURCE/check_parameters.f90
r601 r667 4 4 ! Current revisions: 5 5 ! ----------------- 6 ! 6 7 ! 8 ! Exchange of parameters between ocean and atmosphere via PE0 9 ! Check for illegal combination of ws-scheme and timestep scheme. 10 ! Check for topography and ws-scheme. 11 ! Check for not cyclic boundary conditions in combination with ws-scheme and 12 ! loop_optimization = 'vector'. 13 ! Check for call_psolver_at_all_substeps and ws-scheme for momentum_advec. 14 ! 15 ! Different processor/grid topology in atmosphere and ocean is now allowed! 16 ! 17 ! Bugfixes in checking for conserve_volume_flow_mode 18 ! 19 ! Adapt error messages. 7 20 ! 8 21 ! Former revisions: … … 180 193 ! 181 194 !-- Check dt_coupling, restart_time, dt_restart, end_time, dx, dy, nx and ny 182 IF ( coupling_mode /= 'uncoupled' 195 IF ( coupling_mode /= 'uncoupled') THEN 183 196 184 197 IF ( dt_coupling == 9999999.9 ) THEN … … 189 202 190 203 #if defined( __parallel ) 191 CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, & 192 ierr ) 193 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, & 194 status, ierr ) 204 IF ( myid == 0 ) THEN 205 CALL MPI_SEND( dt_coupling, 1, MPI_REAL, target_id, 11, comm_inter, & 206 ierr ) 207 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 11, comm_inter, & 208 status, ierr ) 209 ENDIF 210 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 211 195 212 IF ( dt_coupling /= remote ) THEN 196 213 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 200 217 ENDIF 201 218 IF ( dt_coupling <= 0.0 ) THEN 202 CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr ) 203 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & 204 status, ierr ) 219 IF ( myid == 0 ) THEN 220 CALL MPI_SEND( dt_max, 1, MPI_REAL, target_id, 19, comm_inter, ierr ) 221 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & 222 status, ierr ) 223 ENDIF 224 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 225 205 226 dt_coupling = MAX( dt_max, remote ) 206 227 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 209 230 CALL message( 'check_parameters', 'PA0005', 0, 1, 0, 6, 0 ) 210 231 ENDIF 211 212 CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, & 213 ierr ) 214 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & 215 status, ierr ) 232 IF ( myid == 0 ) THEN 233 CALL MPI_SEND( restart_time, 1, MPI_REAL, target_id, 12, comm_inter, & 234 ierr ) 235 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & 236 status, ierr ) 237 ENDIF 238 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 239 216 240 IF ( restart_time /= remote ) THEN 217 241 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 220 244 CALL message( 'check_parameters', 'PA0006', 1, 2, 0, 6, 0 ) 221 245 ENDIF 222 223 CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, & 224 ierr ) 225 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & 226 status, ierr ) 246 IF ( myid == 0 ) THEN 247 CALL MPI_SEND( dt_restart, 1, MPI_REAL, target_id, 13, comm_inter, & 248 ierr ) 249 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & 250 status, ierr ) 251 ENDIF 252 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 253 227 254 IF ( dt_restart /= remote ) THEN 228 255 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 233 260 234 261 simulation_time_since_reference = end_time - coupling_start_time 235 CALL MPI_SEND( simulation_time_since_reference, 1, MPI_REAL, target_id, & 236 14, comm_inter, ierr ) 237 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & 238 status, ierr ) 262 IF ( myid == 0 ) THEN 263 CALL MPI_SEND( simulation_time_since_reference, 1, MPI_REAL, target_id, & 264 14, comm_inter, ierr ) 265 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & 266 status, ierr ) 267 ENDIF 268 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 269 239 270 IF ( simulation_time_since_reference /= remote ) THEN 240 271 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 245 276 ENDIF 246 277 247 CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr ) 248 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, & 249 status, ierr ) 250 IF ( dx /= remote ) THEN 251 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 252 '": dx = ', dx, '& is not equal to dx_remote = ', remote 253 CALL message( 'check_parameters', 'PA0009', 1, 2, 0, 6, 0 ) 254 ENDIF 255 256 CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr ) 257 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, & 258 status, ierr ) 259 IF ( dy /= remote ) THEN 260 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 261 '": dy = ', dy, '& is not equal to dy_remote = ', remote 262 CALL message( 'check_parameters', 'PA0010', 1, 2, 0, 6, 0 ) 263 ENDIF 264 265 CALL MPI_SEND( nx, 1, MPI_INTEGER, target_id, 17, comm_inter, ierr ) 266 CALL MPI_RECV( iremote, 1, MPI_INTEGER, target_id, 17, comm_inter, & 267 status, ierr ) 268 IF ( nx /= iremote ) THEN 269 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 270 '": nx = ', nx, '& is not equal to nx_remote = ', iremote 271 CALL message( 'check_parameters', 'PA0011', 1, 2, 0, 6, 0 ) 272 ENDIF 273 274 CALL MPI_SEND( ny, 1, MPI_INTEGER, target_id, 18, comm_inter, ierr ) 275 CALL MPI_RECV( iremote, 1, MPI_INTEGER, target_id, 18, comm_inter, & 276 status, ierr ) 277 IF ( ny /= iremote ) THEN 278 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & 279 '": ny = ', ny, '& is not equal to ny_remote = ', iremote 280 CALL message( 'check_parameters', 'PA0012', 1, 2, 0, 6, 0 ) 278 279 IF ( myid == 0 ) THEN 280 CALL MPI_SEND( dx, 1, MPI_REAL, target_id, 15, comm_inter, ierr ) 281 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 15, comm_inter, & 282 status, ierr ) 283 ENDIF 284 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 285 286 287 IF ( coupling_mode == 'atmosphere_to_ocean') THEN 288 289 IF ( dx < remote ) THEN 290 WRITE( message_string, * ) 'coupling mode "', & 291 TRIM( coupling_mode ), & 292 '": dx in Atmosphere is not equal to or not larger then dx in ocean' 293 CALL message( 'check_parameters', 'PA0009', 1, 2, 0, 6, 0 ) 294 ENDIF 295 296 IF ( (nx_a+1)*dx /= (nx_o+1)*remote ) THEN 297 WRITE( message_string, * ) 'coupling mode "', & 298 TRIM( coupling_mode ), & 299 '": Domain size in x-direction is not equal in ocean and atmosphere' 300 CALL message( 'check_parameters', 'PA0010', 1, 2, 0, 6, 0 ) 301 ENDIF 302 303 ENDIF 304 305 IF ( myid == 0) THEN 306 CALL MPI_SEND( dy, 1, MPI_REAL, target_id, 16, comm_inter, ierr ) 307 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 16, comm_inter, & 308 status, ierr ) 309 ENDIF 310 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 311 312 IF ( coupling_mode == 'atmosphere_to_ocean') THEN 313 314 IF ( dy < remote ) THEN 315 WRITE( message_string, * ) 'coupling mode "', & 316 TRIM( coupling_mode ), & 317 '": dy in Atmosphere is not equal to or not larger then dy in ocean' 318 CALL message( 'check_parameters', 'PA0011', 1, 2, 0, 6, 0 ) 319 ENDIF 320 321 IF ( (ny_a+1)*dy /= (ny_o+1)*remote ) THEN 322 WRITE( message_string, * ) 'coupling mode "', & 323 TRIM( coupling_mode ), & 324 '": Domain size in y-direction is not equal in ocean and atmosphere' 325 CALL message( 'check_parameters', 'PA0012', 1, 2, 0, 6, 0 ) 326 ENDIF 327 328 IF ( MOD(nx_o+1,nx_a+1) /= 0 ) THEN 329 WRITE( message_string, * ) 'coupling mode "', & 330 TRIM( coupling_mode ), & 331 '": nx+1 in ocean is not divisible without remainder with nx+1 in', & 332 ' atmosphere' 333 CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 ) 334 ENDIF 335 336 IF ( MOD(ny_o+1,ny_a+1) /= 0 ) THEN 337 WRITE( message_string, * ) 'coupling mode "', & 338 TRIM( coupling_mode ), & 339 '": ny+1 in ocean is not divisible without remainder with ny+1 in', & 340 ' atmosphere' 341 CALL message( 'check_parameters', 'PA0340', 1, 2, 0, 6, 0 ) 342 ENDIF 343 281 344 ENDIF 282 345 #else … … 290 353 ! 291 354 !-- Exchange via intercommunicator 292 IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN355 IF ( coupling_mode == 'atmosphere_to_ocean' .AND. myid == 0 ) THEN 293 356 CALL MPI_SEND( humidity, 1, MPI_LOGICAL, target_id, 19, comm_inter, & 294 357 ierr ) 295 ELSEIF ( coupling_mode == 'ocean_to_atmosphere' ) THEN358 ELSEIF ( coupling_mode == 'ocean_to_atmosphere' .AND. myid == 0) THEN 296 359 CALL MPI_RECV( humidity_remote, 1, MPI_LOGICAL, target_id, 19, & 297 360 comm_inter, status, ierr ) 298 361 ENDIF 362 CALL MPI_BCAST( humidity_remote, 1, MPI_LOGICAL, 0, comm2d, ierr) 363 299 364 #endif 300 365 … … 372 437 CALL message( 'check_parameters', 'PA0014', 1, 2, 0, 6, 0 ) 373 438 ENDIF 439 IF ( momentum_advec == 'ws-scheme' .OR. scalar_advec == 'ws-scheme' ) & 440 THEN 441 message_string = 'topography is still not allowed with ' // & 442 'momentum_advec = "' // TRIM( momentum_advec ) // & 443 '"or scalar_advec = "' // TRIM( scalar_advec ) //'"' 444 ! message number still needs modification 445 CALL message( 'check_parameters', 'PA0341', 1, 2, 0, 6, 0 ) 446 END IF 447 374 448 ! 375 449 !-- In case of non-flat topography, check whether the convention how to … … 492 566 CALL message( 'check_parameters', 'PA0021', 1, 2, 0, 6, 0 ) 493 567 ENDIF 494 568 569 IF( momentum_advec == 'ws-scheme' .AND. & 570 call_psolver_at_all_substeps == .FALSE. ) THEN 571 message_string = 'psolver must be called at each RK3 substep when "'//& 572 TRIM(momentum_advec) // ' "is used for momentum_advec' 573 CALL message( 'check_parameters', 'PA0343', 1, 2, 0, 6, 0 ) 574 END IF 495 575 ! 496 576 !-- Advection schemes: 497 IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= ' ups-scheme' )&498 THEN577 IF ( momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme' .AND. & 578 momentum_advec /= 'ups-scheme' ) THEN 499 579 message_string = 'unknown advection scheme: momentum_advec = "' // & 500 580 TRIM( momentum_advec ) // '"' 501 581 CALL message( 'check_parameters', 'PA0022', 1, 2, 0, 6, 0 ) 502 582 ENDIF 503 IF ( ( momentum_advec == 'ups-scheme' .OR. scalar_advec == 'ups-scheme' )& 504 .AND. timestep_scheme /= 'euler' ) THEN 505 message_string = 'momentum_advec = "' // TRIM( momentum_advec ) // & 506 '" is not allowed with timestep_scheme = "' // & 507 TRIM( timestep_scheme ) // '"' 583 IF ((( momentum_advec == 'ups-scheme' .OR. scalar_advec == 'ups-scheme' )& 584 .AND. timestep_scheme /= 'euler' ) .OR. (( momentum_advec == 'ws-scheme'& 585 .OR. scalar_advec == 'ws-scheme') .AND. (timestep_scheme == 'euler' .OR. & 586 timestep_scheme == 'leapfrog+euler' .OR. timestep_scheme == 'leapfrog' & 587 .OR. timestep_scheme == 'runge-kutta-2'))) THEN 588 message_string = 'momentum_advec or scalar_advec = "' & 589 // TRIM( momentum_advec ) // '" is not allowed with timestep_scheme = "' // & 590 TRIM( timestep_scheme ) // '"' 508 591 CALL message( 'check_parameters', 'PA0023', 1, 2, 0, 6, 0 ) 509 592 ENDIF 510 511 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'bc-scheme' .AND.& 512 scalar_advec /= 'ups-scheme' ) THEN 593 IF ( scalar_advec /= 'pw-scheme' .AND. scalar_advec /= 'ws-scheme' .AND. & 594 scalar_advec /= 'bc-scheme' .AND. scalar_advec /= 'ups-scheme' ) THEN 513 595 message_string = 'unknown advection scheme: scalar_advec = "' // & 514 596 TRIM( scalar_advec ) // '"' … … 563 645 ENDIF 564 646 565 IF ( momentum_advec /= 'pw-scheme' .AND. timestep_scheme(1:5) == 'runge') &566 THEN647 IF ( (momentum_advec /= 'pw-scheme' .AND. momentum_advec /= 'ws-scheme') & 648 .AND. timestep_scheme(1:5) == 'runge' ) THEN 567 649 message_string = 'momentum advection scheme "' // & 568 650 TRIM( momentum_advec ) // '" & does not work with ' // & … … 712 794 ug_vertical_gradient_level_ind(1) = nzt+1 713 795 ug(nzt+1) = ug_surface 714 DO k = nzt, 0, -1796 DO k = nzt, nzb, -1 715 797 IF ( i < 11 ) THEN 716 798 IF ( ug_vertical_gradient_level(i) > zu(k) .AND. & … … 778 860 vg_vertical_gradient_level_ind(1) = nzt+1 779 861 vg(nzt+1) = vg_surface 780 DO k = nzt, 0, -1862 DO k = nzt, nzb, -1 781 863 IF ( i < 11 ) THEN 782 864 IF ( vg_vertical_gradient_level(i) > zu(k) .AND. & … … 1020 1102 1021 1103 1104 1022 1105 ! 1023 1106 !-- Compute Coriolis parameter … … 1159 1242 ! 1160 1243 !-- Non-cyclic lateral boundaries require the multigrid method and Piascek- 1161 !-- Willimas advection scheme. Several schemes and tools do not work with1162 !-- non-cyclic boundary conditions.1244 !-- Willimas or Wicker - Skamarock advection scheme. Several schemes 1245 !-- and tools do not work with non-cyclic boundary conditions. 1163 1246 IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN 1164 1247 IF ( psolver /= 'multigrid' ) THEN … … 1167 1250 CALL message( 'check_parameters', 'PA0051', 1, 2, 0, 6, 0 ) 1168 1251 ENDIF 1169 IF ( momentum_advec /= 'pw-scheme' ) THEN 1252 IF ( momentum_advec /= 'pw-scheme' .AND. & 1253 momentum_advec /= 'ws-scheme') THEN 1170 1254 message_string = 'non-cyclic lateral boundaries do not allow ' // & 1171 1255 'momentum_advec = "' // TRIM( momentum_advec ) // '"' 1172 1256 CALL message( 'check_parameters', 'PA0052', 1, 2, 0, 6, 0 ) 1173 1257 ENDIF 1174 IF ( scalar_advec /= 'pw-scheme' ) THEN 1258 IF ( scalar_advec /= 'pw-scheme' .AND. & 1259 scalar_advec /= 'ws-scheme' ) THEN 1175 1260 message_string = 'non-cyclic lateral boundaries do not allow ' // & 1176 1261 'scalar_advec = "' // TRIM( scalar_advec ) // '"' 1177 1262 CALL message( 'check_parameters', 'PA0053', 1, 2, 0, 6, 0 ) 1178 1263 ENDIF 1264 IF ( (scalar_advec == 'ws-scheme' .OR. momentum_advec == 'ws-scheme' ) & 1265 .AND. loop_optimization == 'vector' ) THEN 1266 message_string = 'non-cyclic lateral boundaries do not allow ' // & 1267 'loop_optimization = vector and ' // & 1268 'scalar_advec = "' // TRIM( scalar_advec ) // '"' 1269 ! The error message number still needs modification. 1270 CALL message( 'check_parameters', 'PA0342', 1, 2, 0, 6, 0 ) 1271 END IF 1179 1272 IF ( galilei_transformation ) THEN 1180 1273 message_string = 'non-cyclic lateral boundaries do not allow ' // & … … 1407 1500 TRIM( bc_uv_b ) // '"' 1408 1501 CALL message( 'check_parameters', 'PA0076', 1, 2, 0, 6, 0 ) 1502 ENDIF 1503 ! 1504 !-- In case of coupled simulations u and v at the ground in atmosphere will be 1505 !-- assigned with the u and v values of the ocean surface 1506 IF ( coupling_mode == 'atmosphere_to_ocean' ) THEN 1507 ibc_uv_b = 2 1409 1508 ENDIF 1410 1509 … … 2109 2208 hom(:,2,57,:) = SPREAD( zu, 2, statistic_regions+1 ) 2110 2209 2210 2111 2211 CASE ( 'u"pt"' ) 2112 2212 dopr_index(i) = 58 … … 2244 2344 2245 2345 END SELECT 2346 2246 2347 ! 2247 2348 !-- Check to which of the predefined coordinate systems the profile belongs … … 2584 2685 !-- Upper plot limit (grid point value) for 1D profiles 2585 2686 IF ( z_max_do1d == -1.0 ) THEN 2687 2586 2688 nz_do1d = nzt+1 2689 2587 2690 ELSE 2588 2691 DO k = nzb+1, nzt+1 … … 2737 2840 2738 2841 ! 2842 2739 2843 !-- Check netcdf precison 2740 2844 ldum = .FALSE. … … 3070 3174 IF ( conserve_volume_flow ) THEN 3071 3175 IF ( TRIM( conserve_volume_flow_mode ) == 'default' ) THEN 3072 IF ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ) THEN 3073 conserve_volume_flow_mode = 'inflow_profile' 3074 ELSE 3075 conserve_volume_flow_mode = 'initial_profiles' 3076 ENDIF 3176 3177 conserve_volume_flow_mode = 'initial_profiles' 3178 3077 3179 ELSEIF ( TRIM( conserve_volume_flow_mode ) /= 'initial_profiles' .AND. & 3078 3180 TRIM( conserve_volume_flow_mode ) /= 'inflow_profile' .AND. & … … 3082 3184 CALL message( 'check_parameters', 'PA0154', 1, 2, 0, 6, 0 ) 3083 3185 ENDIF 3084 IF ( ( bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic' ).AND. &3085 TRIM( conserve_volume_flow_mode ) /= 'inflow_profile' ) THEN3086 WRITE( message_string, * ) 'non cyclic boundary conditions ', &3087 'require & conserve_volume_flow_mode = ''inflow_profile'''3186 IF ( (bc_lr /= 'cyclic' .OR. bc_ns /= 'cyclic') .AND. & 3187 TRIM( conserve_volume_flow_mode ) == 'bulk_velocity' ) THEN 3188 WRITE( message_string, * ) 'non-cyclic boundary conditions ', & 3189 'require conserve_volume_flow_mode = ''initial_profiles''' 3088 3190 CALL message( 'check_parameters', 'PA0155', 1, 2, 0, 6, 0 ) 3089 3191 ENDIF … … 3091 3193 TRIM( conserve_volume_flow_mode ) == 'inflow_profile' ) THEN 3092 3194 WRITE( message_string, * ) 'cyclic boundary conditions ', & 3093 'require &conserve_volume_flow_mode = ''initial_profiles''', &3195 'require conserve_volume_flow_mode = ''initial_profiles''', & 3094 3196 ' or ''bulk_velocity''' 3095 3197 CALL message( 'check_parameters', 'PA0156', 1, 2, 0, 6, 0 ) … … 3100 3202 TRIM( conserve_volume_flow_mode ) /= 'bulk_velocity' ) ) THEN 3101 3203 WRITE( message_string, * ) 'nonzero bulk velocity requires ', & 3102 'conserve_volume_flow = .T. and &', &3204 'conserve_volume_flow = .T. and ', & 3103 3205 'conserve_volume_flow_mode = ''bulk_velocity''' 3104 3206 CALL message( 'check_parameters', 'PA0157', 1, 2, 0, 6, 0 ) … … 3139 3241 3140 3242 3243 3141 3244 END SUBROUTINE check_parameters
Note: See TracChangeset
for help on using the changeset viewer.