Changeset 61 for palm/trunk/SOURCE
- Timestamp:
- Mar 12, 2007 5:42:06 AM (18 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/CURRENT_MODIFICATIONS
r60 r61 7 7 8 8 new d3par-parameter netcdf_64bit_3d to switch on 64bit offset only for 3D files 9 10 new d3par-parameter dt_max to define the maximum value for the allowed timestep 9 11 10 12 new inipar-parameter pt_refrence. If given, this value is used as the reference that in buoyancy terms (otherwise, the instantaneous horizontally averaged temperature is used). -
palm/trunk/SOURCE/parin.f90
r57 r61 4 4 ! Actual revisions: 5 5 ! ----------------- 6 ! + netcdf_64bit_3d in d3par, +pt_reference in inipar, -data_output_ts6 ! +dt_max, netcdf_64bit_3d in d3par, +pt_reference in inipar, -data_output_ts 7 7 ! 8 8 ! Former revisions: … … 99 99 dt_data_output_av, dt_disturb, dt_dopr, & 100 100 dt_dopr_listing, dt_dots, dt_do2d_xy, dt_do2d_xz, & 101 dt_do2d_yz, dt_do3d, dt_ restart, dt_run_control,&101 dt_do2d_yz, dt_do3d, dt_max, dt_restart, dt_run_control,& 102 102 end_time, force_print_header, mg_cycles, & 103 103 mg_switch_to_pe0_level, netcdf_64bit, netcdf_64bit_3d, & -
palm/trunk/SOURCE/particle_boundary_conds.f90
r60 r61 15 15 ! Calculates the reflection of particles from vertical walls. 16 16 ! Routine developed by Jin Zhang (2006-2007) 17 ! To do: Code structure for finding the t_index values and for checking the 18 ! reflection conditions is basically the same for all four cases, so it 19 ! should be possible to further simplify/shorten it. 17 20 !------------------------------------------------------------------------------! 18 21 … … 30 33 k3, k5, n, t_index, t_index_number 31 34 35 LOGICAL :: reflect_x, reflect_y, reflect_z 36 32 37 REAL :: dt_particle, pos_x, pos_x_old, pos_y, pos_y_old, pos_z, & 33 38 pos_z_old, prt_x, prt_y, prt_z, tmp_t, xline, yline, zline … … 38 43 39 44 45 46 reflect_x = .FALSE. 47 reflect_y = .FALSE. 48 reflect_z = .FALSE. 40 49 41 50 DO n = 1, number_of_particles … … 51 60 prt_z = particles(n)%z 52 61 53 62 ! 63 !-- If the particle position is below the surface, it has to be reflected 54 64 IF ( k2 <= nzb_s_inner(j2,i2) .AND. nzb_s_inner(j2,i2) /=0 ) THEN 55 65 … … 114 124 ENDDO 115 125 116 126 case1: DO t_index = 1, t_index_number 117 127 118 128 pos_x = pos_x_old + t(t_index) * ( prt_x - pos_x_old ) … … 128 138 k5 = pos_z / dz 129 139 130 IF ( k5 <= nzb_s_inner(j5,i3) .AND. nzb_s_inner(j5,i3) /= 0 )& 131 THEN 140 IF ( k5 <= nzb_s_inner(j5,i3) .AND. & 141 nzb_s_inner(j5,i3) /= 0 ) THEN 142 132 143 IF ( pos_z == nzb_s_inner(j5,i3) * dz .AND. & 133 144 k3 == nzb_s_inner(j5,i3) ) THEN 134 particles(n)%z = 2.0 * pos_z - prt_z 135 particles(n)%speed_z = - particles(n)%speed_z 136 137 IF ( use_sgs_for_particles ) THEN 138 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 139 ENDIF 140 GOTO 999 141 ENDIF 142 ENDIF 143 144 IF ( k5 <= nzb_s_inner(j3,i5) .AND. nzb_s_inner(j3,i5) /= 0 )& 145 THEN 145 reflect_z = .TRUE. 146 EXIT case1 147 ENDIF 148 149 ENDIF 150 151 IF ( k5 <= nzb_s_inner(j3,i5) .AND. & 152 nzb_s_inner(j3,i5) /= 0 ) THEN 153 146 154 IF ( pos_z == nzb_s_inner(j3,i5) * dz .AND. & 147 155 k3 == nzb_s_inner(j3,i5) ) THEN 148 particles(n)%z = 2.0 * pos_z - prt_z 149 particles(n)%speed_z = - particles(n)%speed_z 150 151 IF ( use_sgs_for_particles ) THEN 152 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 153 ENDIF 154 GOTO 999 155 ENDIF 156 ENDIF 157 158 IF ( k3 <= nzb_s_inner(j3,i3) .AND. nzb_s_inner(j3,i3) /= 0 )& 159 THEN 156 reflect_z = .TRUE. 157 EXIT case1 158 ENDIF 159 160 ENDIF 161 162 IF ( k3 <= nzb_s_inner(j3,i3) .AND. & 163 nzb_s_inner(j3,i3) /= 0 ) THEN 164 160 165 IF ( pos_z == nzb_s_inner(j3,i3) * dz .AND. & 161 166 k3 == nzb_s_inner(j3,i3) ) THEN 162 particles(n)%z = 2.0 * pos_z - prt_z 163 particles(n)%speed_z = - particles(n)%speed_z 164 165 IF ( use_sgs_for_particles ) THEN 166 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 167 ENDIF 168 GOTO 999 167 reflect_z = .TRUE. 168 EXIT case1 169 169 ENDIF 170 170 171 171 IF ( pos_y == ( j3 * dy - 0.5 * dy ) .AND. & 172 172 pos_z < nzb_s_inner(j3,i3) * dz ) THEN 173 particles(n)%y = 2.0 * pos_y - prt_y 174 particles(n)%speed_y = - particles(n)%speed_y 175 176 IF ( use_sgs_for_particles ) THEN 177 particles(n)%speed_y_sgs = - particles(n)%speed_y_sgs 178 ENDIF 179 GOTO 999 173 reflect_y = .TRUE. 174 EXIT case1 180 175 ENDIF 181 176 182 177 IF ( pos_x == ( i3 * dx - 0.5 * dx ) .AND. & 183 178 pos_z < nzb_s_inner(j3,i3) * dz ) THEN 184 particles(n)%x = 2.0 * pos_x - prt_x 185 particles(n)%speed_x = - particles(n)%speed_x 186 187 IF ( use_sgs_for_particles ) THEN 188 particles(n)%speed_x_sgs = - particles(n)%speed_x_sgs 189 ENDIF 190 GOTO 999 191 ENDIF 192 ENDIF 193 194 ENDDO 195 196 ENDIF 179 reflect_x = .TRUE. 180 EXIT case1 181 ENDIF 182 183 ENDIF 184 185 ENDDO case1 197 186 198 187 ! 199 188 !-- Case 2 200 IF ( particles(n)%x > pos_x_old .AND. particles(n)%y < pos_y_old ) & 201 THEN 189 ELSEIF ( particles(n)%x > pos_x_old .AND. & 190 particles(n)%y < pos_y_old ) THEN 191 202 192 t_index = 1 203 193 … … 248 238 ENDDO 249 239 250 240 case2: DO t_index = 1, t_index_number 251 241 252 242 pos_x = pos_x_old + t(t_index) * ( prt_x - pos_x_old ) … … 262 252 k5 = pos_z / dz 263 253 264 IF ( k5 <= nzb_s_inner(j3,i5) .AND. nzb_s_inner(j3,i5) /= 0 )& 265 THEN 254 IF ( k5 <= nzb_s_inner(j3,i5) .AND. & 255 nzb_s_inner(j3,i5) /= 0 ) THEN 256 266 257 IF ( pos_z == nzb_s_inner(j3,i5) * dz .AND. & 267 258 k3 == nzb_s_inner(j3,i5) ) THEN 268 particles(n)%z = 2.0 * pos_z - prt_z 269 particles(n)%speed_z = - particles(n)%speed_z 270 271 IF ( use_sgs_for_particles ) THEN 272 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 273 ENDIF 274 GOTO 999 275 ENDIF 276 ENDIF 277 278 IF ( k3 <= nzb_s_inner(j3,i3) .AND. nzb_s_inner(j3,i3) /= 0 )& 279 THEN 259 reflect_z = .TRUE. 260 EXIT case2 261 ENDIF 262 263 ENDIF 264 265 IF ( k3 <= nzb_s_inner(j3,i3) .AND. & 266 nzb_s_inner(j3,i3) /= 0 ) THEN 267 280 268 IF ( pos_z == nzb_s_inner(j3,i3) * dz .AND. & 281 269 k3 == nzb_s_inner(j3,i3) ) THEN 282 particles(n)%z = 2.0 * pos_z - prt_z 283 particles(n)%speed_z = - particles(n)%speed_z 284 285 IF ( use_sgs_for_particles ) THEN 286 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 287 ENDIF 288 GOTO 999 270 reflect_z = .TRUE. 271 EXIT case2 289 272 ENDIF 290 273 291 274 IF ( pos_x == ( i3 * dx - 0.5 * dx ) .AND. & 292 275 pos_z < nzb_s_inner(j3,i3) * dz ) THEN 293 particles(n)%x = 2.0 * pos_x - prt_x 294 particles(n)%speed_x = - particles(n)%speed_x 295 296 IF ( use_sgs_for_particles ) THEN 297 particles(n)%speed_x_sgs = - particles(n)%speed_x_sgs 298 ENDIF 299 GOTO 999 300 ENDIF 301 ENDIF 302 303 IF ( k5 <= nzb_s_inner(j5,i3) .AND. nzb_s_inner(j5,i3) /= 0 )& 304 THEN 276 reflect_x = .TRUE. 277 EXIT case2 278 ENDIF 279 280 ENDIF 281 282 IF ( k5 <= nzb_s_inner(j5,i3) .AND. & 283 nzb_s_inner(j5,i3) /= 0 ) THEN 284 305 285 IF ( pos_z == nzb_s_inner(j5,i3) * dz .AND. & 306 286 k3 == nzb_s_inner(j5,i3) ) THEN 307 particles(n)%z = 2.0 * pos_z - prt_z 308 particles(n)%speed_z = - particles(n)%speed_z 309 IF ( use_sgs_for_particles ) THEN 310 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 311 ENDIF 312 GOTO 999 287 reflect_z = .TRUE. 288 EXIT case2 313 289 ENDIF 314 290 315 291 IF ( pos_y == ( j5 * dy + 0.5 * dy ) .AND. & 316 292 pos_z < nzb_s_inner(j5,i3) * dz ) THEN 317 particles(n)%y = 2.0 * pos_y - prt_y 318 particles(n)%speed_y = - particles(n)%speed_y 319 320 IF ( use_sgs_for_particles ) THEN 321 particles(n)%speed_y_sgs = - particles(n)%speed_y_sgs 322 ENDIF 323 GOTO 999 324 ENDIF 325 ENDIF 326 ENDDO 327 ENDIF 293 reflect_y = .TRUE. 294 EXIT case2 295 ENDIF 296 297 ENDIF 298 299 ENDDO case2 328 300 329 301 ! 330 302 !-- Case 3 331 IF ( particles(n)%x < pos_x_old .AND. particles(n)%y > pos_y_old ) & 332 THEN 303 ELSEIF ( particles(n)%x < pos_x_old .AND. & 304 particles(n)%y > pos_y_old ) THEN 305 333 306 t_index = 1 334 307 … … 380 353 ENDDO 381 354 382 355 case3: DO t_index = 1, t_index_number 383 356 384 357 pos_x = pos_x_old + t(t_index) * ( prt_x - pos_x_old ) … … 394 367 k5 = pos_z / dz 395 368 396 IF ( k5 <= nzb_s_inner(j5,i3) .AND. nzb_s_inner(j5,i3) /= 0 )& 397 THEN 369 IF ( k5 <= nzb_s_inner(j5,i3) .AND. & 370 nzb_s_inner(j5,i3) /= 0 ) THEN 371 398 372 IF ( pos_z == nzb_s_inner(j5,i3) * dz .AND. & 399 373 k3 == nzb_s_inner(j5,i3) ) THEN 400 particles(n)%z = 2.0 * pos_z - prt_z 401 particles(n)%speed_z = - particles(n)%speed_z 402 403 IF ( use_sgs_for_particles ) THEN 404 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 405 ENDIF 406 GOTO 999 407 ENDIF 408 ENDIF 409 410 IF ( k3 <= nzb_s_inner(j3,i3) .AND. nzb_s_inner(j3,i3) /= 0 )& 411 THEN 374 reflect_z = .TRUE. 375 EXIT case3 376 ENDIF 377 378 ENDIF 379 380 IF ( k3 <= nzb_s_inner(j3,i3) .AND. & 381 nzb_s_inner(j3,i3) /= 0 ) THEN 382 412 383 IF ( pos_z == nzb_s_inner(j3,i3) * dz .AND. & 413 384 k3 == nzb_s_inner(j3,i3) ) THEN 414 particles(n)%z = 2.0 * pos_z - prt_z 415 particles(n)%speed_z = - particles(n)%speed_z 416 417 IF ( use_sgs_for_particles ) THEN 418 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 419 ENDIF 420 GOTO 999 385 reflect_z = .TRUE. 386 EXIT case3 421 387 ENDIF 422 388 423 389 IF ( pos_y == ( j3 * dy - 0.5 * dy ) .AND. & 424 390 pos_z < nzb_s_inner(j3,i3) * dz ) THEN 425 particles(n)%y = 2.0 * pos_y - prt_y 426 particles(n)%speed_y = - particles(n)%speed_y 427 428 IF ( use_sgs_for_particles ) THEN 429 particles(n)%speed_y_sgs = - particles(n)%speed_y_sgs 430 ENDIF 431 GOTO 999 432 ENDIF 433 ENDIF 434 435 IF ( k5 <= nzb_s_inner(j3,i5) .AND. nzb_s_inner(j3,i5) /= 0 )& 436 THEN 391 reflect_y = .TRUE. 392 EXIT case3 393 ENDIF 394 395 ENDIF 396 397 IF ( k5 <= nzb_s_inner(j3,i5) .AND. & 398 nzb_s_inner(j3,i5) /= 0 ) THEN 399 437 400 IF ( pos_z == nzb_s_inner(j3,i5) * dz .AND. & 438 401 k3 == nzb_s_inner(j3,i5) ) THEN 439 particles(n)%z = 2.0 * pos_z - prt_z 440 particles(n)%speed_z = - particles(n)%speed_z 441 442 IF ( use_sgs_for_particles ) THEN 443 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 444 ENDIF 445 GOTO 999 402 reflect_z = .TRUE. 403 EXIT case3 446 404 ENDIF 447 405 448 406 IF ( pos_x == ( i5 * dx + 0.5 * dx ) .AND. & 449 407 pos_z < nzb_s_inner(j3,i5) * dz ) THEN 450 particles(n)%x = 2.0 * pos_x - prt_x 451 particles(n)%speed_x = - particles(n)%speed_x 452 453 IF ( use_sgs_for_particles ) THEN 454 particles(n)%speed_x_sgs = - particles(n)%speed_x_sgs 455 ENDIF 456 GOTO 999 457 ENDIF 458 ENDIF 459 ENDDO 460 ENDIF 408 reflect_x = .TRUE. 409 EXIT case3 410 ENDIF 411 412 ENDIF 413 414 ENDDO case3 461 415 462 416 ! 463 417 !-- Case 4 464 IF ( particles(n)%x < pos_x_old .AND. particles(n)%y < pos_y_old )& 465 THEN 418 ELSEIF ( particles(n)%x < pos_x_old .AND. & 419 particles(n)%y < pos_y_old ) THEN 420 466 421 t_index = 1 467 422 … … 513 468 ENDDO 514 469 515 470 case4: DO t_index = 1, t_index_number 516 471 517 472 pos_x = pos_x_old + t(t_index) * ( prt_x - pos_x_old ) … … 527 482 k5 = pos_z / dz 528 483 529 IF ( k3 <= nzb_s_inner(j3,i3) .AND. nzb_s_inner(j3,i3) /= 0 )& 530 THEN 484 IF ( k3 <= nzb_s_inner(j3,i3) .AND. & 485 nzb_s_inner(j3,i3) /= 0 ) THEN 486 531 487 IF ( pos_z == nzb_s_inner(j3,i3) * dz .AND. & 532 488 k3 == nzb_s_inner(j3,i3) ) THEN 533 particles(n)%z = 2.0 * pos_z - prt_z 534 particles(n)%speed_z = - particles(n)%speed_z 535 536 IF ( use_sgs_for_particles ) THEN 537 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 538 ENDIF 539 GOTO 999 540 ENDIF 541 ENDIF 542 543 IF ( k5 <= nzb_s_inner(j3,i5) .AND. nzb_s_inner(j3,i5) /= 0 )& 544 THEN 489 reflect_z = .TRUE. 490 EXIT case4 491 ENDIF 492 493 ENDIF 494 495 IF ( k5 <= nzb_s_inner(j3,i5) .AND. & 496 nzb_s_inner(j3,i5) /= 0 ) THEN 497 545 498 IF ( pos_z == nzb_s_inner(j3,i5) * dz .AND. & 546 499 k3 == nzb_s_inner(j3,i5) ) THEN 547 particles(n)%z = 2.0 * pos_z - prt_z 548 particles(n)%speed_z = - particles(n)%speed_z 549 550 IF ( use_sgs_for_particles ) THEN 551 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 552 ENDIF 553 GOTO 999 500 reflect_z = .TRUE. 501 EXIT case4 554 502 ENDIF 555 503 … … 557 505 nzb_s_inner(j3,i5) /=0 .AND. & 558 506 pos_z < nzb_s_inner(j3,i5) * dz ) THEN 559 particles(n)%x = 2.0 * pos_x - prt_x 560 particles(n)%speed_x = - particles(n)%speed_x 561 562 IF ( use_sgs_for_particles ) THEN 563 particles(n)%speed_x_sgs = - particles(n)%speed_x_sgs 564 ENDIF 565 GOTO 999 566 ENDIF 567 ENDIF 568 569 IF ( k5 <= nzb_s_inner(j5,i3) .AND. nzb_s_inner(j5,i3) /= 0 )& 570 THEN 507 reflect_x = .TRUE. 508 EXIT case4 509 ENDIF 510 511 ENDIF 512 513 IF ( k5 <= nzb_s_inner(j5,i3) .AND. & 514 nzb_s_inner(j5,i3) /= 0 ) THEN 515 571 516 IF ( pos_z == nzb_s_inner(j5,i3) * dz .AND. & 572 517 k5 == nzb_s_inner(j5,i3) ) THEN 573 particles(n)%z = 2.0 * pos_z - prt_z 574 particles(n)%speed_z = - particles(n)%speed_z 575 576 IF ( use_sgs_for_particles ) THEN 577 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 578 ENDIF 579 GOTO 999 518 reflect_z = .TRUE. 519 EXIT case4 580 520 ENDIF 581 521 … … 583 523 nzb_s_inner(j5,i3) /= 0 .AND. & 584 524 pos_z < nzb_s_inner(j5,i3) * dz ) THEN 585 particles(n)%y = 2.0 * pos_y - prt_y 586 particles(n)%speed_y = - particles(n)%speed_y 587 588 IF ( use_sgs_for_particles ) THEN 589 particles(n)%speed_y_sgs = - particles(n)%speed_y_sgs 590 ENDIF 591 GOTO 999 592 ENDIF 593 ENDIF 594 ENDDO 525 reflect_y = .TRUE. 526 EXIT case4 527 ENDIF 528 529 ENDIF 530 531 ENDDO case4 532 595 533 ENDIF 596 534 597 999 CONTINUE 535 ENDIF ! Check, if particle position is below the surface 536 537 ! 538 !-- Do the respective reflection, in case that one of the above conditions 539 !-- is found to be true 540 IF ( reflect_z ) THEN 541 542 particles(n)%z = 2.0 * pos_z - prt_z 543 particles(n)%speed_z = - particles(n)%speed_z 544 545 IF ( use_sgs_for_particles ) THEN 546 particles(n)%speed_z_sgs = - particles(n)%speed_z_sgs 547 ENDIF 548 reflect_z = .FALSE. 549 550 ELSEIF ( reflect_y ) THEN 551 552 particles(n)%y = 2.0 * pos_y - prt_y 553 particles(n)%speed_y = - particles(n)%speed_y 554 555 IF ( use_sgs_for_particles ) THEN 556 particles(n)%speed_y_sgs = - particles(n)%speed_y_sgs 557 ENDIF 558 reflect_y = .FALSE. 559 560 ELSEIF ( reflect_x ) THEN 561 562 particles(n)%x = 2.0 * pos_x - prt_x 563 particles(n)%speed_x = - particles(n)%speed_x 564 565 IF ( use_sgs_for_particles ) THEN 566 particles(n)%speed_x_sgs = - particles(n)%speed_x_sgs 567 ENDIF 568 reflect_x = .FALSE. 569 570 ENDIF 598 571 599 ENDIF600 601 572 ENDDO 602 573 603 574 CALL cpu_log( log_point_s(48), 'advec_part_refle', 'stop' ) 604 575 576 605 577 END SUBROUTINE particle_boundary_conds
Note: See TracChangeset
for help on using the changeset viewer.