Changeset 2122
- Timestamp:
- Jan 18, 2017 12:22:54 PM (8 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/lpm_data_output_particles.f90
r2101 r2122 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Calculation of particle ID 23 23 ! 24 24 ! Former revisions: … … 136 136 ! CALL netcdf_handle_error( 'lpm_data_output_particles', 3 ) 137 137 ! 138 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(2), particles% dvrp_psize,&139 ! start = (/ 1, prt_time_count /), 138 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(2), particles%user, & 139 ! start = (/ 1, prt_time_count /), & 140 140 ! count = (/ maximum_number_of_particles /) ) 141 141 ! CALL netcdf_handle_error( 'lpm_data_output_particles', 4 ) … … 208 208 ! 209 209 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(16), & 210 ! particles% tailpoints,&210 ! particles%id2, & 211 211 ! start = (/ 1, prt_time_count /), & 212 212 ! count = (/ maximum_number_of_particles /) ) 213 213 ! CALL netcdf_handle_error( 'lpm_data_output_particles', 18 ) 214 214 ! 215 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(17), particles% tail_id,&215 ! nc_stat = NF90_PUT_VAR( id_set_prt, id_var_prt(17), particles%id1, & 216 216 ! start = (/ 1, prt_time_count /), & 217 217 ! count = (/ maximum_number_of_particles /) ) -
palm/trunk/SOURCE/lpm_droplet_collision.f90
r2101 r2122 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 23 ! 22 ! Some reformatting of the code. 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- … … 445 445 446 446 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 447 mass(n) = mass(n)+ weight(n) * xm448 weight(m) = weight(m)- weight(n)449 mass(m) = mass(m)- weight(n) * xm447 mass(n) = mass(n) + weight(n) * xm 448 weight(m) = weight(m) - weight(n) 449 mass(m) = mass(m) - weight(n) * xm 450 450 ENDIF 451 451 … … 457 457 458 458 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 459 mass(m) = mass(m)+ weight(m) * xn460 weight(n) = weight(n)- weight(m)461 mass(n) = mass(n)- weight(m) * xn459 mass(m) = mass(m) + weight(m) * xn 460 weight(n) = weight(n) - weight(m) 461 mass(n) = mass(n) - weight(m) * xn 462 462 ENDIF 463 463 ELSE -
palm/trunk/SOURCE/lpm_init.f90
r2101 r2122 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! Improved initialization of equilibrium aerosol radii 23 ! Calculation of particle ID 23 24 ! 24 25 ! Former revisions: … … 44 45 ! 1873 2016-04-18 14:50:06Z maronga 45 46 ! Module renamed (removed _mod 46 47 47 ! 48 48 ! 1871 2016-04-15 11:46:09Z hoffmann … … 236 236 !-- Define MPI derived datatype for FORTRAN datatype particle_type (see module 237 237 !-- particle_attributes). Integer length is 4 byte, Real is 8 byte 238 ! blocklengths(1) = 20; blocklengths(2) = 5; blocklengths(3) = 1 239 ! displacements(1) = 0; displacements(2) = 160; displacements(3) = 180 238 240 blocklengths(1) = 19; blocklengths(2) = 6; blocklengths(3) = 1 239 241 displacements(1) = 0; displacements(2) = 152; displacements(3) = 176 242 243 ! 244 !-- WARNING: the double precision integer 'id' is treated as a double precision 245 !-- integer here, i.e., there are 20 real variables and only 5 integer variables 246 !-- instead of 19 and 6, respectively. 240 247 241 248 types(1) = MPI_REAL … … 452 459 453 460 ! 461 !-- initialize counter for particle IDs 462 grid_particles%id_counter = 0 463 464 ! 454 465 !-- Initialize all particles with dummy values (otherwise errors may 455 466 !-- occur within restart runs). The reason for this is still not clear … … 458 469 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 459 470 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 460 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0, 0, 0,&461 0, .FALSE., -1 )471 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 472 0, 0, 0, 0, .FALSE., -1 ) 462 473 463 474 particle_groups = particle_groups_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp ) … … 602 613 tmp_particle%age_m = 0.0_wp 603 614 tmp_particle%dt_sum = 0.0_wp 604 tmp_particle% dvrp_psize = 0.0_wp !unused615 tmp_particle%user = 0.0_wp !unused, free for the user 605 616 tmp_particle%e_m = 0.0_wp 606 617 IF ( curvature_solution_effects ) THEN … … 610 621 tmp_particle%rvar1 = 1.0E-6_wp !last Rosenbrock timestep 611 622 tmp_particle%rvar2 = 0.1E-6_wp !dry aerosol radius 612 tmp_particle%rvar3 = -9999999.9_wp !unused 623 tmp_particle%rvar3 = -9999999.9_wp !unused in this configuration 613 624 ELSE 614 625 ! … … 628 639 tmp_particle%class = 1 629 640 tmp_particle%group = i 630 tmp_particle%tailpoints = 0 !unused 641 tmp_particle%id1 = 0 642 tmp_particle%id2 = 0 631 643 tmp_particle%particle_mask = .TRUE. 632 tmp_particle%tail_id = 0 !unused 633 634 644 tmp_particle%block_nr = -1 635 645 ! 636 646 !-- Determine the grid indices of the particle position … … 722 732 local_start = prt_count+1 723 733 prt_count = local_count 734 735 ! 736 !-- Calculate particle IDs 737 DO ip = nxl, nxr 738 DO jp = nys, nyn 739 DO kp = nzb+1, nzt 740 number_of_particles = prt_count(kp,jp,ip) 741 IF ( number_of_particles <= 0 ) CYCLE 742 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 743 744 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 745 746 particles(n)%id1 = 10000 * grid_particles(kp,jp,ip)%id_counter + kp 747 particles(n)%id2 = 10000 * jp + ip 748 749 grid_particles(kp,jp,ip)%id_counter = & 750 grid_particles(kp,jp,ip)%id_counter + 1 751 752 ENDDO 753 754 ENDDO 755 ENDDO 756 ENDDO 724 757 725 758 ! … … 837 870 838 871 USE cloud_parameters, & 839 ONLY: l_d_rv, rho_l 872 ONLY: l_d_rv, rho_l, r_v 840 873 841 874 USE constants, & … … 854 887 REAL(wp), DIMENSION(:), ALLOCATABLE :: r_temp !< dry aerosol radius spectrum 855 888 889 REAL(wp) :: afactor !< curvature effects 856 890 REAL(wp) :: bfactor !< solute effects 857 891 REAL(wp) :: dr !< width of radius bin … … 864 898 REAL(wp) :: rs_rand !< random number 865 899 REAL(wp) :: r_mid !< mean radius 900 REAL(wp) :: sigma !< surface tension 866 901 REAL(wp) :: t_int !< temperature 867 902 REAL(wp) :: weight_sum !< sum of all weighting factors … … 1035 1070 e_a = q(kp,jp,ip) * hyp(kp) / ( 0.378_wp * q(kp,jp,ip) + 0.622_wp ) 1036 1071 1072 sigma = 0.0761_wp - 0.000155_wp * ( t_int - 273.15_wp ) 1073 afactor = 2.0_wp * sigma / ( rho_l * r_v * t_int ) 1074 1075 bfactor = vanthoff * molecular_weight_of_water * & 1076 rho_s / ( molecular_weight_of_solute * rho_l ) 1037 1077 ! 1038 1078 !-- The formula is only valid for subsaturated environments. For 1039 !-- supersaturations higher than -1 %, the supersaturation is set to -1%. 1040 IF ( e_a / e_s < 0.99_wp ) THEN 1041 1042 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1043 1044 bfactor = vanthoff * molecular_weight_of_water * & 1045 rho_s * particles(n)%rvar2**3 / & 1046 ( molecular_weight_of_solute * rho_l ) 1047 particles(n)%radius = particles(n)%rvar2 * ( bfactor / & 1048 particles(n)%rvar2**3 )**(1.0_wp/3.0_wp) *& 1049 ( 1.0_wp - e_a / e_s )**(-1.0_wp/3.0_wp) 1050 1051 ENDDO 1052 1053 ELSE 1054 1055 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1056 1057 bfactor = vanthoff * molecular_weight_of_water * & 1058 rho_s * particles(n)%rvar2**3 / & 1059 ( molecular_weight_of_solute * rho_l ) 1060 particles(n)%radius = particles(n)%rvar2 * ( bfactor / & 1061 particles(n)%rvar2**3 )**(1.0_wp/3.0_wp) *& 1062 0.01_wp**(-1.0_wp/3.0_wp) 1063 1064 ENDDO 1065 1066 ENDIF 1079 !-- supersaturations higher than -5 %, the supersaturation is set to -5%. 1080 IF ( e_a / e_s >= 0.95_wp ) e_a = 0.95_wp * e_s 1081 1082 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1083 ! 1084 !-- For details on this equation, see Eq. (14) of Khvorostyanov and 1085 !-- Curry (2007, JGR) 1086 particles(n)%radius = bfactor**0.3333333_wp * & 1087 particles(n)%rvar2 / ( 1.0_wp - e_a / e_s )**0.3333333_wp / & 1088 ( 1.0_wp + ( afactor / ( 3.0_wp * bfactor**0.3333333_wp * & 1089 particles(n)%rvar2 ) ) / & 1090 ( 1.0_wp - e_a / e_s )**0.6666666_wp & 1091 ) 1092 1093 ENDDO 1067 1094 1068 1095 ENDDO -
palm/trunk/SOURCE/lpm_set_attributes.f90
r2101 r2122 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 22 ! DVRP routine removed 23 23 ! 24 24 ! Former revisions: … … 397 397 ENDIF 398 398 399 !400 !-- Set particle size for dvrp graphics401 IF ( particle_dvrpsize == 'absw' ) THEN402 403 DO ip = nxl, nxr404 DO jp = nys, nyn405 DO kp = nzb+1, nzt406 407 number_of_particles = prt_count(kp,jp,ip)408 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles)409 IF ( number_of_particles <= 0 ) CYCLE410 start_index = grid_particles(kp,jp,ip)%start_index411 end_index = grid_particles(kp,jp,ip)%end_index412 413 ALLOCATE( xv(1:number_of_particles), &414 yv(1:number_of_particles) )415 416 xv = particles(1:number_of_particles)%x417 yv = particles(1:number_of_particles)%y418 zv = particles(1:number_of_particles)%z419 420 DO nb = 0,7421 422 i = ip + block_offset(nb)%i_off423 j = jp + block_offset(nb)%j_off424 k = kp-1425 426 DO n = start_index(nb), end_index(nb)427 !428 !-- Interpolate w-component to the current particle position429 x = xv(n) - i * dx430 y = yv(n) - j * dy431 aa = x**2 + y**2432 bb = ( dx - x )**2 + y**2433 cc = x**2 + ( dy - y )**2434 dd = ( dx - x )**2 + ( dy - y )**2435 gg = aa + bb + cc + dd436 437 w_int_l = ( ( gg - aa ) * w(k,j,i) + ( gg - bb ) * &438 w(k,j,i+1) + ( gg - cc ) * w(k,j+1,i) + &439 ( gg - dd ) * w(k,j+1,i+1) &440 ) / ( 3.0_wp * gg )441 442 IF ( k+1 == nzt+1 ) THEN443 w_int = w_int_l444 ELSE445 w_int_u = ( ( gg - aa ) * w(k+1,j,i) + ( gg - bb ) * &446 w(k+1,j,i+1) + ( gg - cc ) * w(k+1,j+1,i) + &447 ( gg - dd ) * w(k+1,j+1,i+1) &448 ) / ( 3.0_wp * gg )449 w_int = w_int_l + ( zv(n) - zw(k) ) / dz * &450 ( w_int_u - w_int_l )451 ENDIF452 453 !454 !-- Limit values by the given interval and normalize to455 !-- interval [0,1]456 w_int = ABS( w_int )457 w_int = MIN( w_int, dvrpsize_interval(2) )458 w_int = MAX( w_int, dvrpsize_interval(1) )459 460 w_int = ( w_int - dvrpsize_interval(1) ) / &461 ( dvrpsize_interval(2) - dvrpsize_interval(1) )462 463 particles(n)%dvrp_psize = ( 0.25_wp + w_int * 0.6_wp ) * &464 dx465 466 ENDDO467 ENDDO468 469 DEALLOCATE( xv, yv, zv )470 471 ENDDO472 ENDDO473 ENDDO474 475 ENDIF476 477 399 CALL cpu_log( log_point_s(49), 'lpm_set_attributes', 'stop' ) 478 400 -
palm/trunk/SOURCE/mod_particle_attributes.f90
r2101 r2122 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 22 ! Calculation of particle ID 23 ! Particle attribute dvrp_psize renamed to user: this attribute can be used by 24 ! by the user to store any variable 23 25 ! 24 26 ! Former revisions: … … 134 136 TYPE particle_type 135 137 SEQUENCE 136 REAL(wp) :: radius, age, age_m, dt_sum, dvrp_psize, e_m,&138 REAL(wp) :: radius, age, age_m, dt_sum, user, e_m, & 137 139 origin_x, origin_y, origin_z, rvar1, rvar2, rvar3, & 138 140 speed_x, speed_y, speed_z, weight_factor, x, y, z 139 INTEGER(iwp) :: class, group, tailpoints, tail_id141 INTEGER(iwp) :: class, group, id1, id2 140 142 LOGICAL :: particle_mask 141 143 INTEGER(iwp) :: block_nr … … 156 158 INTEGER(iwp), DIMENSION(0:7) :: start_index 157 159 INTEGER(iwp), DIMENSION(0:7) :: end_index 160 INTEGER(iwp) :: id_counter 158 161 LOGICAL :: time_loop_done 159 162 TYPE(particle_type), POINTER, DIMENSION(:) :: particles !Particle array for this grid cell
Note: See TracChangeset
for help on using the changeset viewer.