Changeset 2223
- Timestamp:
- May 15, 2017 4:38:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/lpm_init.f90
r2183 r2223 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Add check for particle release at model top 23 23 ! 24 24 ! Former revisions: … … 618 618 DO WHILE ( pos_z <= pst(i) ) 619 619 620 pos_y = pss(i) 621 622 DO WHILE ( pos_y <= psn(i) ) 623 624 IF ( pos_y >= ( nys - 0.5_wp ) * dy .AND. & 625 pos_y < ( nyn + 0.5_wp ) * dy ) THEN 626 627 pos_x = psl(i) 628 629 xloop: DO WHILE ( pos_x <= psr(i) ) 630 631 IF ( pos_x >= ( nxl - 0.5_wp ) * dx .AND. & 632 pos_x < ( nxr + 0.5_wp ) * dx ) THEN 633 634 DO j = 1, particles_per_point 635 636 n = n + 1 637 tmp_particle%x = pos_x 638 tmp_particle%y = pos_y 639 tmp_particle%z = pos_z 640 tmp_particle%age = 0.0_wp 641 tmp_particle%age_m = 0.0_wp 642 tmp_particle%dt_sum = 0.0_wp 643 tmp_particle%user = 0.0_wp !unused, free for the user 644 tmp_particle%e_m = 0.0_wp 645 IF ( curvature_solution_effects ) THEN 646 ! 647 !-- Initial values (internal timesteps, derivative) 648 !-- for Rosenbrock method 649 tmp_particle%rvar1 = 1.0E-6_wp !last Rosenbrock timestep 650 tmp_particle%rvar2 = 0.1E-6_wp !dry aerosol radius 651 tmp_particle%rvar3 = -9999999.9_wp !unused in this configuration 652 ELSE 653 ! 654 !-- Initial values for SGS velocities 655 tmp_particle%rvar1 = 0.0_wp 656 tmp_particle%rvar2 = 0.0_wp 657 tmp_particle%rvar3 = 0.0_wp 658 ENDIF 659 tmp_particle%speed_x = 0.0_wp 660 tmp_particle%speed_y = 0.0_wp 661 tmp_particle%speed_z = 0.0_wp 662 tmp_particle%origin_x = pos_x 663 tmp_particle%origin_y = pos_y 664 tmp_particle%origin_z = pos_z 665 tmp_particle%radius = particle_groups(i)%radius 666 tmp_particle%weight_factor = initial_weighting_factor 667 tmp_particle%class = 1 668 tmp_particle%group = i 669 tmp_particle%id1 = 0 670 tmp_particle%id2 = 0 671 tmp_particle%particle_mask = .TRUE. 672 tmp_particle%block_nr = -1 673 ! 674 !-- Determine the grid indices of the particle position 675 ip = ( tmp_particle%x + 0.5_wp * dx ) * ddx 676 jp = ( tmp_particle%y + 0.5_wp * dy ) * ddy 677 kp = tmp_particle%z / dz + 1 + offset_ocean_nzt 678 679 IF ( seed_follows_topography ) THEN 680 ! 681 !-- Particle height is given relative to topography 682 kp = kp + nzb_w_inner(jp,ip) 683 tmp_particle%z = tmp_particle%z + & 620 IF ( pos_z >= 0.0_wp .AND. pos_z < zw(nzt) ) THEN 621 622 623 pos_y = pss(i) 624 625 DO WHILE ( pos_y <= psn(i) ) 626 627 IF ( pos_y >= ( nys - 0.5_wp ) * dy .AND. & 628 pos_y < ( nyn + 0.5_wp ) * dy ) THEN 629 630 pos_x = psl(i) 631 632 xloop: DO WHILE ( pos_x <= psr(i) ) 633 634 IF ( pos_x >= ( nxl - 0.5_wp ) * dx .AND. & 635 pos_x < ( nxr + 0.5_wp ) * dx ) THEN 636 637 DO j = 1, particles_per_point 638 639 n = n + 1 640 tmp_particle%x = pos_x 641 tmp_particle%y = pos_y 642 tmp_particle%z = pos_z 643 tmp_particle%age = 0.0_wp 644 tmp_particle%age_m = 0.0_wp 645 tmp_particle%dt_sum = 0.0_wp 646 tmp_particle%user = 0.0_wp !unused, free for the user 647 tmp_particle%e_m = 0.0_wp 648 IF ( curvature_solution_effects ) THEN 649 ! 650 !-- Initial values (internal timesteps, derivative) 651 !-- for Rosenbrock method 652 tmp_particle%rvar1 = 1.0E-6_wp !last Rosenbrock timestep 653 tmp_particle%rvar2 = 0.1E-6_wp !dry aerosol radius 654 tmp_particle%rvar3 = -9999999.9_wp !unused in this configuration 655 ELSE 656 ! 657 !-- Initial values for SGS velocities 658 tmp_particle%rvar1 = 0.0_wp 659 tmp_particle%rvar2 = 0.0_wp 660 tmp_particle%rvar3 = 0.0_wp 661 ENDIF 662 tmp_particle%speed_x = 0.0_wp 663 tmp_particle%speed_y = 0.0_wp 664 tmp_particle%speed_z = 0.0_wp 665 tmp_particle%origin_x = pos_x 666 tmp_particle%origin_y = pos_y 667 tmp_particle%origin_z = pos_z 668 tmp_particle%radius = particle_groups(i)%radius 669 tmp_particle%weight_factor = initial_weighting_factor 670 tmp_particle%class = 1 671 tmp_particle%group = i 672 tmp_particle%id1 = 0 673 tmp_particle%id2 = 0 674 tmp_particle%particle_mask = .TRUE. 675 tmp_particle%block_nr = -1 676 ! 677 !-- Determine the grid indices of the particle position 678 ip = ( tmp_particle%x + 0.5_wp * dx ) * ddx 679 jp = ( tmp_particle%y + 0.5_wp * dy ) * ddy 680 kp = tmp_particle%z / dz + 1 + offset_ocean_nzt 681 682 IF ( seed_follows_topography ) THEN 683 ! 684 !-- Particle height is given relative to topography 685 kp = kp + nzb_w_inner(jp,ip) 686 tmp_particle%z = tmp_particle%z + & 684 687 zw(nzb_w_inner(jp,ip)) 685 IF ( kp > nzt ) THEN 688 IF ( kp > nzt ) THEN 689 pos_x = pos_x + pdx(i) 690 CYCLE xloop 691 ENDIF 692 ELSEIF ( .NOT. seed_follows_topography .AND. & 693 tmp_particle%z <= zw(nzb_w_inner(jp,ip)) ) THEN 686 694 pos_x = pos_x + pdx(i) 687 CYCLE xloop 695 CYCLE xloop 688 696 ENDIF 689 ELSEIF ( .NOT. seed_follows_topography .AND. & 690 tmp_particle%z <= zw(nzb_w_inner(jp,ip)) ) THEN 691 pos_x = pos_x + pdx(i) 692 CYCLE xloop 693 ENDIF 694 695 local_count(kp,jp,ip) = local_count(kp,jp,ip) + 1 696 697 IF ( .NOT. first_stride ) THEN 698 IF ( ip < nxl .OR. jp < nys .OR. kp < nzb+1 ) THEN 699 write(6,*) 'xl ',ip,jp,kp,nxl,nys,nzb+1 697 698 local_count(kp,jp,ip) = local_count(kp,jp,ip) + 1 699 700 IF ( .NOT. first_stride ) THEN 701 IF ( ip < nxl .OR. jp < nys .OR. kp < nzb+1 ) THEN 702 write(6,*) 'xl ',ip,jp,kp,nxl,nys,nzb+1 703 ENDIF 704 IF ( ip > nxr .OR. jp > nyn .OR. kp > nzt ) THEN 705 write(6,*) 'xu ',ip,jp,kp,nxr,nyn,nzt 706 ENDIF 707 grid_particles(kp,jp,ip)%particles(local_count(kp,jp,ip)) = tmp_particle 708 700 709 ENDIF 701 IF ( ip > nxr .OR. jp > nyn .OR. kp > nzt ) THEN 702 write(6,*) 'xu ',ip,jp,kp,nxr,nyn,nzt 703 ENDIF 704 grid_particles(kp,jp,ip)%particles(local_count(kp,jp,ip)) = tmp_particle 705 706 ENDIF 707 ENDDO 708 709 ENDIF 710 711 pos_x = pos_x + pdx(i) 712 713 ENDDO xloop 714 715 ENDIF 716 717 pos_y = pos_y + pdy(i) 718 719 ENDDO 710 ENDDO 711 712 ENDIF 713 714 pos_x = pos_x + pdx(i) 715 716 ENDDO xloop 717 718 ENDIF 719 720 pos_y = pos_y + pdy(i) 721 722 ENDDO 723 724 ENDIF 720 725 721 726 pos_z = pos_z + pdz(i)
Note: See TracChangeset
for help on using the changeset viewer.