Changeset 1822
- Timestamp:
- Apr 7, 2016 7:49:42 AM (9 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 5 deleted
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/Makefile
r1818 r1822 20 20 # Current revisions: 21 21 # ------------------ 22 # 22 # Tails removed. lpm_release_set removed. calc_precipitation, impact_of_latent_heat 23 # removed. 23 24 # 24 25 # Former revisions: … … 246 247 advec_w_pw.f90 advec_w_up.f90 average_3d_data.f90 boundary_conds.f90 \ 247 248 buoyancy.f90 calc_liquid_water_content.f90 calc_mean_profile.f90 \ 248 calc_ precipitation.f90 calc_radiation.f90 \249 calc_radiation.f90 \ 249 250 check_for_restart.f90 check_open.f90 check_parameters.f90 \ 250 251 close_file.f90 compute_vpt.f90 coriolis.f90 cpulog.f90 \ … … 257 258 disturb_heatflux.f90 eqn_state_seawater.f90 exchange_horiz.f90 \ 258 259 exchange_horiz_2d.f90 fft_xy.f90 flow_statistics.f90 \ 259 global_min_max.f90 header.f90 impact_of_latent_heat.f90\260 global_min_max.f90 header.f90 \ 260 261 inflow_turbulence.f90 init_1d_model.f90 init_3d_model.f90 \ 261 262 init_advec.f90 init_cloud_physics.f90 init_coupling.f90 init_dvrp.f90 \ … … 268 269 lpm_data_output_particles.f90 lpm_droplet_collision.f90 \ 269 270 lpm_droplet_condensation.f90 lpm_exchange_horiz.f90 \ 270 lpm_extend_tails.f90 \ 271 lpm_extend_tail_array.f90 lpm_init.f90 lpm_init_sgs_tke.f90 \ 272 lpm_pack_arrays.f90 lpm_read_restart_file.f90 lpm_release_set.f90 \ 271 lpm_init.f90 lpm_init_sgs_tke.f90 \ 272 lpm_pack_arrays.f90 lpm_read_restart_file.f90 \ 273 273 lpm_set_attributes.f90 \ 274 274 lpm_write_exchange_statistics.f90 lpm_write_restart_file.f90 \ … … 349 349 calc_mean_profile.o: modules.o mod_kinds.o 350 350 calc_liquid_water_content.o: modules.o mod_kinds.o 351 calc_precipitation.o: modules.o mod_kinds.o352 351 calc_radiation.o: modules.o mod_kinds.o 353 352 check_for_restart.o: modules.o mod_kinds.o pmc_interface.o … … 395 394 plant_canopy_model.o pmc_handle_communicator.o pmc_interface.o \ 396 395 radiation_model.o spectrum.o subsidence.o 397 impact_of_latent_heat.o: modules.o mod_kinds.o398 396 inflow_turbulence.o: modules.o cpulog.o mod_kinds.o 399 397 init_1d_model.o: modules.o mod_kinds.o … … 418 416 local_tremain.o: modules.o cpulog.o mod_kinds.o 419 417 local_tremain_ini.o: modules.o cpulog.o mod_kinds.o 420 lpm.o: modules.o cpulog.o lpm_exchange_horiz.o lpm_ pack_arrays.o mod_kinds.o \421 mod_ particle_attributes.o418 lpm.o: modules.o cpulog.o lpm_exchange_horiz.o lpm_init.o lpm_pack_arrays.o \ 419 mod_kinds.o mod_particle_attributes.o 422 420 lpm_advec.o: modules.o cpulog.o mod_kinds.o mod_particle_attributes.o 423 421 lpm_boundary_conds.o: modules.o cpulog.o mod_kinds.o mod_particle_attributes.o … … 434 432 lpm_exchange_horiz.o: modules.o cpulog.o lpm_pack_arrays.o mod_kinds.o \ 435 433 mod_particle_attributes.o netcdf_interface.o 436 lpm_extend_tails.o: modules.o mod_kinds.o mod_particle_attributes.o437 lpm_extend_tail_array.o: modules.o mod_kinds.o mod_particle_attributes.o438 434 lpm_init.o: modules.o lpm_collision_kernels.o mod_kinds.o \ 439 435 netcdf_interface.o random_function.o mod_particle_attributes.o \ … … 443 439 lpm_read_restart_file.o: modules.o mod_kinds.o mod_particle_attributes.o \ 444 440 lpm_pack_arrays.o 445 lpm_release_set.o: modules.o mod_kinds.o random_function.o \446 mod_particle_attributes.o lpm_init.o random_generator_parallel.o447 441 lpm_set_attributes.o: modules.o cpulog.o mod_kinds.o mod_particle_attributes.o 448 442 lpm_write_exchange_statistics.o: modules.o mod_kinds.o mod_particle_attributes.o … … 480 474 prognostic_equations.o: modules.o advec_s_pw.o advec_s_up.o advec_s_bc.o advec_u_pw.o \ 481 475 advec_u_up.o advec_v_pw.o advec_v_up.o advec_w_pw.o advec_w_up.o \ 482 advec_ws.o buoyancy.o calc_ precipitation.o calc_radiation.o coriolis.o \476 advec_ws.o buoyancy.o calc_radiation.o coriolis.o \ 483 477 cpulog.o diffusion_e.o diffusion_s.o diffusion_u.o diffusion_v.o diffusion_w.o \ 484 eqn_state_seawater.o impact_of_latent_heat.omod_kinds.o microphysics.o \478 eqn_state_seawater.o mod_kinds.o microphysics.o \ 485 479 nudging.o plant_canopy_model.o production_e.o radiation_model.o \ 486 480 subsidence.o user_actions.o -
palm/trunk/SOURCE/advec_ws.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! icloud_scheme removed, microphysics_seifert added 22 22 ! 23 23 ! Former revisions: … … 222 222 223 223 USE control_parameters, & 224 ONLY: cloud_physics, humidity, icloud_scheme, loop_optimization,&225 monotonic_adjustment, passive_scalar, precipitation, ocean, &226 ws_scheme_mom, ws_scheme_sca224 ONLY: cloud_physics, humidity, loop_optimization, & 225 monotonic_adjustment, passive_scalar, microphysics_seifert, & 226 ocean, ws_scheme_mom, ws_scheme_sca 227 227 228 228 USE indices, & … … 274 274 ENDIF 275 275 276 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 277 precipitation ) THEN 276 IF ( cloud_physics .AND. microphysics_seifert ) THEN 278 277 ALLOCATE( sums_wsqrs_ws_l(nzb:nzt+1,0:threads_per_task-1) ) 279 278 ALLOCATE( sums_wsnrs_ws_l(nzb:nzt+1,0:threads_per_task-1) ) … … 331 330 ENDIF 332 331 333 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 334 precipitation ) THEN 332 IF ( cloud_physics .AND. microphysics_seifert ) THEN 335 333 ALLOCATE( flux_s_qr(nzb+1:nzt,0:threads_per_task-1), & 336 334 diss_s_qr(nzb+1:nzt,0:threads_per_task-1), & … … 365 363 366 364 USE control_parameters, & 367 ONLY: cloud_physics, humidity, icloud_scheme, passive_scalar,&368 precipitation, ocean, ws_scheme_mom, ws_scheme_sca365 ONLY: cloud_physics, humidity, passive_scalar, ocean, & 366 microphysics_seifert, ws_scheme_mom, ws_scheme_sca 369 367 370 368 USE kinds … … 391 389 sums_wspts_ws_l = 0.0_wp 392 390 IF ( humidity .OR. passive_scalar ) sums_wsqs_ws_l = 0.0_wp 393 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 394 precipitation ) THEN 391 IF ( cloud_physics .AND. microphysics_seifert ) THEN 395 392 sums_wsqrs_ws_l = 0.0_wp 396 393 sums_wsnrs_ws_l = 0.0_wp -
palm/trunk/SOURCE/boundary_conds.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! icloud_scheme removed. microphyisics_seifert added. 22 22 ! 23 23 ! Former revisions: … … 139 139 cloud_physics, dt_3d, humidity, & 140 140 ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, ibc_sa_t, ibc_uv_b, & 141 ibc_uv_t, i cloud_scheme, inflow_l, inflow_n, inflow_r, inflow_s,&142 intermediate_timestep_count, large_scale_forcing, nest_domain,&143 nest_bound_l, nest_bound_s, nudging, ocean,&144 outflow_l, outflow_n, outflow_r, outflow_s, passive_scalar, &145 p recipitation, tsc, use_cmax141 ibc_uv_t, inflow_l, inflow_n, inflow_r, inflow_s, & 142 intermediate_timestep_count, large_scale_forcing, & 143 microphysics_seifert, nest_domain, nest_bound_l, nest_bound_s, & 144 nudging, ocean, outflow_l, outflow_n, outflow_r, outflow_s, & 145 passive_scalar, tsc, use_cmax 146 146 147 147 USE grid_variables, & … … 319 319 ENDIF 320 320 321 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. precipitation) THEN321 IF ( cloud_physics .AND. microphysics_seifert ) THEN 322 322 ! 323 323 !-- Surface conditions rain water (Dirichlet) … … 373 373 IF ( humidity .OR. passive_scalar ) THEN 374 374 q_p(:,nys-1,:) = q_p(:,nys,:) 375 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 376 precipitation) THEN 375 IF ( cloud_physics .AND. microphysics_seifert ) THEN 377 376 qr_p(:,nys-1,:) = qr_p(:,nys,:) 378 377 nr_p(:,nys-1,:) = nr_p(:,nys,:) … … 384 383 IF ( humidity .OR. passive_scalar ) THEN 385 384 q_p(:,nyn+1,:) = q_p(:,nyn,:) 386 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 387 precipitation ) THEN 385 IF ( cloud_physics .AND. microphysics_seifert ) THEN 388 386 qr_p(:,nyn+1,:) = qr_p(:,nyn,:) 389 387 nr_p(:,nyn+1,:) = nr_p(:,nyn,:) … … 395 393 IF ( humidity .OR. passive_scalar ) THEN 396 394 q_p(:,:,nxl-1) = q_p(:,:,nxl) 397 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 398 precipitation ) THEN 395 IF ( cloud_physics .AND. microphysics_seifert ) THEN 399 396 qr_p(:,:,nxl-1) = qr_p(:,:,nxl) 400 397 nr_p(:,:,nxl-1) = nr_p(:,:,nxl) … … 406 403 IF ( humidity .OR. passive_scalar ) THEN 407 404 q_p(:,:,nxr+1) = q_p(:,:,nxr) 408 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. precipitation) THEN405 IF ( cloud_physics .AND. microphysics_seifert ) THEN 409 406 qr_p(:,:,nxr+1) = qr_p(:,:,nxr) 410 407 nr_p(:,:,nxr+1) = nr_p(:,:,nxr) -
palm/trunk/SOURCE/calc_liquid_water_content.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! icloud_scheme removed. microphysics_seifert added. 22 22 ! 23 23 ! Former revisions: … … 73 73 74 74 USE control_parameters, & 75 ONLY: icloud_scheme, precipitation75 ONLY: microphysics_seifert 76 76 77 77 USE indices, & … … 122 122 ! 123 123 !-- Compute the liquid water content 124 IF ( icloud_scheme == 0 .AND. precipitation) THEN124 IF ( microphysics_seifert ) THEN 125 125 IF ( ( q(k,j,i) - q_s - qr(k,j,i) ) > 0.0_wp ) THEN 126 126 qc(k,j,i) = q(k,j,i) - q_s - qr(k,j,i) … … 131 131 ql(k,j,i) = qr(k,j,i) 132 132 ENDIF 133 ELSE IF ( icloud_scheme == 0 .AND. .NOT. precipitation ) THEN133 ELSE 134 134 IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN 135 135 qc(k,j,i) = q(k,j,i) - q_s 136 136 ql(k,j,i) = qc(k,j,i) 137 137 ELSE 138 qc(k,j,i) = 0.0_wp 138 qc(k,j,i) = 0.0_wp 139 139 ql(k,j,i) = 0.0_wp 140 ENDIF141 ELSE142 IF ( ( q(k,j,i) - q_s ) > 0.0_wp ) THEN143 ql(k,j,i) = q(k,j,i) - q_s144 ELSE145 ql(k,j,i) = 0.0_wp146 140 ENDIF 147 141 ENDIF -
palm/trunk/SOURCE/check_parameters.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! PALM collision kernel deleted. Collision algorithms are checked for correct 22 ! spelling. 23 ! 24 ! Tails removed. 25 ! 26 ! Checks for use_sgs_for_particles adopted for the use of droplets with 27 ! use_sgs_for_particles adopted. 28 ! 29 ! Unused variables removed. 22 30 ! 23 31 ! Former revisions: … … 358 366 CHARACTER (LEN=1) :: sq !< 359 367 CHARACTER (LEN=15) :: var !< 360 CHARACTER (LEN=7) :: unit !< 368 CHARACTER (LEN=7) :: unit !< 361 369 CHARACTER (LEN=8) :: date !< 362 370 CHARACTER (LEN=10) :: time !< … … 367 375 368 376 INTEGER(iwp) :: i !< 369 INTEGER(iwp) :: ilen !< 370 INTEGER(iwp) :: iremote = 0 !< 377 INTEGER(iwp) :: ilen !< 371 378 INTEGER(iwp) :: j !< 372 379 INTEGER(iwp) :: k !< … … 374 381 INTEGER(iwp) :: netcdf_data_format_save !< 375 382 INTEGER(iwp) :: position !< 376 INTEGER(iwp) :: prec !<377 383 378 384 LOGICAL :: found !< … … 661 667 'with particle advection.' 662 668 CALL message( 'check_parameters', 'PA0017', 1, 2, 0, 6, 0 ) 663 ENDIF664 665 !666 !--667 IF ( use_particle_tails ) THEN668 message_string = 'Particle tails are currently not available due ' // &669 'to the new particle structure.'670 CALL message( 'check_parameters', 'PA0392', 1, 2, 0, 6, 0 )671 669 ENDIF 672 670 … … 767 765 ! 768 766 !-- Check cloud scheme 769 IF ( cloud_scheme == 'seifert_beheng' ) THEN 770 icloud_scheme = 0 767 IF ( cloud_scheme == 'saturation_adjust' ) THEN 768 microphysics_sat_adjust = .TRUE. 769 microphysics_seifert = .FALSE. 770 microphysics_kessler = .FALSE. 771 precipitation = .FALSE. 772 ELSEIF ( cloud_scheme == 'seifert_beheng' ) THEN 773 microphysics_sat_adjust = .FALSE. 774 microphysics_seifert = .TRUE. 775 microphysics_kessler = .FALSE. 776 precipitation = .TRUE. 771 777 ELSEIF ( cloud_scheme == 'kessler' ) THEN 772 icloud_scheme = 1 778 microphysics_sat_adjust = .FALSE. 779 microphysics_seifert = .FALSE. 780 microphysics_kessler = .TRUE. 781 precipitation = .TRUE. 773 782 ELSE 774 783 message_string = 'unknown cloud microphysics scheme cloud_scheme ="' // & … … 846 855 ENDIF 847 856 848 IF ( use_sgs_for_particles .AND. .NOT. use_upstream_for_tke .AND.&849 ( scalar_advec /= 'ws-scheme' .OR.&850 scalar_advec /= 'ws-scheme-mono' )&857 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets .AND. & 858 .NOT. use_upstream_for_tke .AND. & 859 ( scalar_advec /= 'ws-scheme' .OR. scalar_advec /= 'ws-scheme-mono' ) & 851 860 ) THEN 852 861 use_upstream_for_tke = .TRUE. … … 906 915 hall_kernel = .TRUE. 907 916 908 CASE ( 'palm' )909 palm_kernel = .TRUE.910 911 917 CASE ( 'wang', 'wang_fast' ) 912 918 wang_kernel = .TRUE. … … 922 928 END SELECT 923 929 IF ( collision_kernel(6:9) == 'fast' ) use_kernel_tables = .TRUE. 930 931 ! 932 !-- Collision algorithms: 933 SELECT CASE ( TRIM( collision_algorithm ) ) 934 935 CASE ( 'all_or_nothing' ) 936 all_or_nothing = .TRUE. 937 938 CASE ( 'average_impact' ) 939 average_impact = .TRUE. 940 941 CASE DEFAULT 942 message_string = 'unknown collision algorithm: collision_algorithm = "' // & 943 TRIM( collision_algorithm ) // '"' 944 CALL message( 'check_parameters', 'PA0420', 1, 2, 0, 6, 0 ) 945 946 END SELECT 924 947 925 948 IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & … … 979 1002 'not allowed with humidity = ', humidity 980 1003 CALL message( 'check_parameters', 'PA0034', 1, 2, 0, 6, 0 ) 981 ENDIF982 983 IF ( precipitation .AND. .NOT. cloud_physics ) THEN984 WRITE( message_string, * ) 'precipitation = ', precipitation, ' is ', &985 'not allowed with cloud_physics = ', cloud_physics986 CALL message( 'check_parameters', 'PA0035', 1, 2, 0, 6, 0 )987 1004 ENDIF 988 1005 … … 1032 1049 ENDIF 1033 1050 1034 IF ( cloud_physics .AND. icloud_scheme == 0) THEN1051 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1035 1052 message_string = 'plant_canopy = .TRUE. requires cloud_scheme /=' // & 1036 1053 ' seifert_beheng' … … 1095 1112 IF ( .NOT. ( loop_optimization == 'cache' .OR. & 1096 1113 loop_optimization == 'vector' ) & 1097 .AND. cloud_physics .AND. icloud_scheme == 0) THEN1114 .AND. cloud_physics .AND. microphysics_seifert ) THEN 1098 1115 message_string = 'cloud_scheme = seifert_beheng requires ' // & 1099 1116 'loop_optimization = "cache" or "vector"' … … 2152 2169 ! 2153 2170 !-- Set the default value for the integration interval of precipitation amount 2154 IF ( precipitation) THEN2171 IF ( microphysics_seifert .OR. microphysics_kessler ) THEN 2155 2172 IF ( precipitation_amount_interval == 9999999.9_wp ) THEN 2156 2173 precipitation_amount_interval = dt_do2d_xy … … 2782 2799 'lemented for cloud_physics = .FALSE.' 2783 2800 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2784 ELSEIF ( icloud_scheme /= 0) THEN2801 ELSEIF ( .NOT. microphysics_seifert ) THEN 2785 2802 message_string = 'data_output_pr = ' // & 2786 2803 TRIM( data_output_pr(i) ) // ' is not imp' // & 2787 2804 'lemented for cloud_scheme /= seifert_beheng' 2788 2805 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2789 ELSEIF ( .NOT. precipitation ) THEN2790 message_string = 'data_output_pr = ' // &2791 TRIM( data_output_pr(i) ) // ' is not imp' // &2792 'lemented for precipitation = .FALSE.'2793 CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 )2794 2806 ELSE 2795 2807 dopr_index(i) = 73 … … 2804 2816 'lemented for cloud_physics = .FALSE.' 2805 2817 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2806 ELSEIF ( icloud_scheme /= 0) THEN2818 ELSEIF ( .NOT. microphysics_seifert ) THEN 2807 2819 message_string = 'data_output_pr = ' // & 2808 2820 TRIM( data_output_pr(i) ) // ' is not imp' // & 2809 2821 'lemented for cloud_scheme /= seifert_beheng' 2810 2822 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2811 ELSEIF ( .NOT. precipitation ) THEN2812 message_string = 'data_output_pr = ' // &2813 TRIM( data_output_pr(i) ) // ' is not imp' // &2814 'lemented for precipitation = .FALSE.'2815 CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 )2816 2823 ELSE 2817 2824 dopr_index(i) = 74 … … 2826 2833 'lemented for cloud_physics = .FALSE.' 2827 2834 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2828 ELSEIF ( icloud_scheme /= 0 ) THEN2829 message_string = 'data_output_pr = ' // &2830 TRIM( data_output_pr(i) ) // ' is not imp' // &2831 'lemented for cloud_scheme /= seifert_beheng'2832 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 )2833 2835 ELSE 2834 2836 dopr_index(i) = 75 … … 2843 2845 'lemented for cloud_physics = .FALSE.' 2844 2846 CALL message( 'check_parameters', 'PA0094', 1, 2, 0, 6, 0 ) 2845 ELSEIF ( icloud_scheme /= 0 ) THEN 2846 message_string = 'data_output_pr = ' // & 2847 TRIM( data_output_pr(i) ) // ' is not imp' // & 2848 'lemented for cloud_scheme /= seifert_beheng' 2849 CALL message( 'check_parameters', 'PA0358', 1, 2, 0, 6, 0 ) 2850 ELSEIF ( .NOT. precipitation ) THEN 2851 message_string = 'data_output_pr = ' // & 2852 TRIM( data_output_pr(i) ) // ' is not imp' // & 2853 'lemented for precipitation = .FALSE.' 2854 CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) 2855 2847 ELSEIF ( microphysics_sat_adjust ) THEN 2848 message_string = 'data_output_pr = ' // & 2849 TRIM( data_output_pr(i) ) // ' is not ava' // & 2850 'ilable for cloud_scheme = saturation_adjust' 2851 CALL message( 'check_parameters', 'PA0422', 1, 2, 0, 6, 0 ) 2856 2852 ELSE 2857 2853 dopr_index(i) = 76 … … 3203 3199 'res cloud_physics = .TRUE.' 3204 3200 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 3205 ELSEIF ( icloud_scheme /= 0) THEN3201 ELSEIF ( .NOT. microphysics_seifert ) THEN 3206 3202 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3207 3203 'res cloud_scheme = seifert_beheng' … … 3224 3220 'res cloud_physics = .TRUE.' 3225 3221 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 3226 ELSEIF ( icloud_scheme /= 0 ) THEN 3227 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3228 'res cloud_scheme = seifert_beheng' 3229 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 3230 ELSEIF ( .NOT. precipitation ) THEN 3231 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3232 'res precipitation = .TRUE.' 3233 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) 3222 ELSEIF ( microphysics_sat_adjust ) THEN 3223 message_string = 'output of "' // TRIM( var ) // '" is ' // & 3224 'not available for cloud_scheme = saturation_adjust' 3225 CALL message( 'check_parameters', 'PA0423', 1, 2, 0, 6, 0 ) 3234 3226 ENDIF 3235 3227 unit = 'kg/kg m/s' … … 3249 3241 'res cloud_physics = .TRUE.' 3250 3242 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 3251 ELSEIF ( icloud_scheme /= 0 ) THEN3252 message_string = 'output of "' // TRIM( var ) // '" requi' // &3253 'res cloud_scheme = seifert_beheng'3254 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 )3255 3243 ENDIF 3256 3244 unit = 'kg/kg' … … 3279 3267 'res cloud_physics = .TRUE.' 3280 3268 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 3281 ELSEIF ( icloud_scheme /= 0) THEN3269 ELSEIF ( .NOT. microphysics_seifert ) THEN 3282 3270 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3283 3271 'res cloud_scheme = seifert_beheng' 3284 3272 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 3285 ELSEIF ( .NOT. precipitation ) THEN3286 message_string = 'output of "' // TRIM( var ) // '" requi' // &3287 'res precipitation = .TRUE.'3288 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 )3289 3273 ENDIF 3290 3274 unit = 'kg/kg' … … 3371 3355 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 3372 3356 ENDIF 3373 IF ( TRIM( var ) == 'pra*' .AND. .NOT. precipitation ) THEN 3357 IF ( TRIM( var ) == 'pra*' .AND. & 3358 .NOT. ( microphysics_kessler .OR. microphysics_seifert ) ) THEN 3374 3359 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3375 'res precipitation = .TRUE.'3360 'res cloud_scheme = kessler or seifert_beheng' 3376 3361 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) 3377 3362 ENDIF … … 3381 3366 CALL message( 'check_parameters', 'PA0113', 1, 2, 0, 6, 0 ) 3382 3367 ENDIF 3383 IF ( TRIM( var ) == 'prr*' .AND. .NOT. precipitation ) THEN 3368 IF ( TRIM( var ) == 'prr*' .AND. & 3369 .NOT. ( microphysics_kessler .OR. microphysics_seifert ) ) THEN 3384 3370 message_string = 'output of "' // TRIM( var ) // '" requi' // & 3385 'res precipitation = .TRUE.'3371 'res cloud_scheme = kessler or seifert_beheng' 3386 3372 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 ) 3387 3373 ENDIF -
palm/trunk/SOURCE/data_output_2d.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Output of bulk cloud physics simplified. 22 22 ! 23 23 ! Former revisions: … … 146 146 do2d_xz_last_time, do2d_xz_n, do2d_xz_time_count, & 147 147 do2d_yz_last_time, do2d_yz_n, do2d_yz_time_count, & 148 ibc_uv_b, i cloud_scheme, io_blocks, io_group,&149 message_string,&150 ntdim_2d_xy, ntdim_2d_xz, ntdim_2d_yz, psolver, section,&151 simulated_time, simulated_time_chr,time_since_reference_point148 ibc_uv_b, io_blocks, io_group, message_string, & 149 ntdim_2d_xy, ntdim_2d_xz, ntdim_2d_yz, & 150 psolver, section, simulated_time, simulated_time_chr, & 151 time_since_reference_point 152 152 153 153 USE cpulog, & … … 683 683 684 684 CASE ( 'prr*_xy' ) ! 2d-array 685 IF ( icloud_scheme == 1 ) THEN 686 IF ( av == 0 ) THEN 687 CALL exchange_horiz_2d( precipitation_rate ) 688 DO i = nxlg, nxrg 689 DO j = nysg, nyng 690 local_pf(i,j,nzb+1) = precipitation_rate(j,i) 685 IF ( av == 0 ) THEN 686 CALL exchange_horiz_2d( prr(nzb+1,:,:) ) 687 DO i = nxlg, nxrg 688 DO j = nysg, nyng 689 local_pf(i,j,nzb+1) = prr(nzb+1,j,i) * hyrho(nzb+1) 690 ENDDO 691 ENDDO 692 ELSE 693 CALL exchange_horiz_2d( prr_av(nzb+1,:,:) ) 694 DO i = nxlg, nxrg 695 DO j = nysg, nyng 696 local_pf(i,j,nzb+1) = prr_av(nzb+1,j,i) * hyrho(nzb+1) 697 ENDDO 698 ENDDO 699 ENDIF 700 resorted = .TRUE. 701 two_d = .TRUE. 702 level_z(nzb+1) = zu(nzb+1) 703 704 CASE ( 'prr_xy', 'prr_xz', 'prr_yz' ) 705 IF ( av == 0 ) THEN 706 CALL exchange_horiz( prr, nbgp ) 707 DO i = nxlg, nxrg 708 DO j = nysg, nyng 709 DO k = nzb, nzt+1 710 local_pf(i,j,k) = prr(k,j,i) * hyrho(nzb+1) 691 711 ENDDO 692 712 ENDDO 693 ELSE 694 CALL exchange_horiz_2d( precipitation_rate_av ) 695 DO i = nxlg, nxrg 696 DO j = nysg, nyng 697 local_pf(i,j,nzb+1) = precipitation_rate_av(j,i) 698 ENDDO 699 ENDDO 700 ENDIF 701 ELSE 702 IF ( av == 0 ) THEN 703 CALL exchange_horiz_2d( prr(nzb+1,:,:) ) 704 DO i = nxlg, nxrg 705 DO j = nysg, nyng 706 local_pf(i,j,nzb+1) = prr(nzb+1,j,i) * hyrho(nzb+1) 707 ENDDO 708 ENDDO 709 ELSE 710 CALL exchange_horiz_2d( prr_av(nzb+1,:,:) ) 711 DO i = nxlg, nxrg 712 DO j = nysg, nyng 713 local_pf(i,j,nzb+1) = prr_av(nzb+1,j,i) * & 714 hyrho(nzb+1) 715 ENDDO 716 ENDDO 717 ENDIF 718 ENDIF 719 resorted = .TRUE. 720 two_d = .TRUE. 721 level_z(nzb+1) = zu(nzb+1) 722 723 CASE ( 'prr_xy', 'prr_xz', 'prr_yz' ) 724 IF ( av == 0 ) THEN 725 CALL exchange_horiz( prr, nbgp ) 713 ENDDO 714 ELSE 715 CALL exchange_horiz( prr_av, nbgp ) 726 716 DO i = nxlg, nxrg 727 717 DO j = nysg, nyng 728 718 DO k = nzb, nzt+1 729 local_pf(i,j,k) = prr(k,j,i) 730 ENDDO 731 ENDDO 732 ENDDO 733 ELSE 734 CALL exchange_horiz( prr_av, nbgp ) 735 DO i = nxlg, nxrg 736 DO j = nysg, nyng 737 DO k = nzb, nzt+1 738 local_pf(i,j,k) = prr_av(k,j,i) 719 local_pf(i,j,k) = prr_av(k,j,i) * hyrho(nzb+1) 739 720 ENDDO 740 721 ENDDO -
palm/trunk/SOURCE/data_output_3d.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! prr vertical dimensions set to nzb_do to nzt_do. Unused variables deleted. 22 22 ! 23 23 ! Former revisions: … … 122 122 123 123 USE control_parameters, & 124 ONLY: avs_data_file, cloud_physics, do3d, do3d_avs_n, & 125 do3d_no, do3d_time_count, io_blocks, io_group, & 126 message_string, ntdim_3d, & 127 nz_do3d, plot_3d_precision, psolver, simulated_time, & 128 simulated_time_chr, skip_do_avs, time_since_reference_point 124 ONLY: cloud_physics, do3d, do3d_no, do3d_time_count, io_blocks, & 125 io_group, message_string, ntdim_3d, nz_do3d, psolver, & 126 simulated_time, time_since_reference_point 129 127 130 128 USE cpulog, & … … 132 130 133 131 USE indices, & 134 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzt, & 135 nzb 132 ONLY: nbgp, nx, nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nzb 136 133 137 134 USE kinds … … 163 160 IMPLICIT NONE 164 161 165 CHARACTER (LEN=9) :: simulated_time_mod !<166 167 162 INTEGER(iwp) :: av !< 168 163 INTEGER(iwp) :: i !< … … 173 168 INTEGER(iwp) :: nzb_do !< vertical lower limit for data output 174 169 INTEGER(iwp) :: nzt_do !< vertical upper limit for data output 175 INTEGER(iwp) :: pos !<176 INTEGER(iwp) :: prec !<177 INTEGER(iwp) :: psi !<178 170 179 171 LOGICAL :: found !< … … 374 366 DO i = nxlg, nxrg 375 367 DO j = nysg, nyng 376 DO k = nzb , nzt+1368 DO k = nzb_do, nzt_do 377 369 local_pf(i,j,k) = prr(k,j,i) 378 370 ENDDO … … 383 375 DO i = nxlg, nxrg 384 376 DO j = nysg, nyng 385 DO k = nzb , nzt+1377 DO k = nzb_do, nzt_do 386 378 local_pf(i,j,k) = prr_av(k,j,i) 387 379 ENDDO -
palm/trunk/SOURCE/data_output_dvrp.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Particles and tails removed. 22 22 ! 23 23 ! Former revisions: … … 58 58 ! Description: 59 59 ! ------------ 60 !> Plot of isosurface , particlesand slicers with dvrp-software60 !> Plot of isosurface and slicers with dvrp-software 61 61 !------------------------------------------------------------------------------! 62 62 MODULE dvrp_color … … 130 130 131 131 USE kinds 132 133 USE particle_attributes, & 134 ONLY: maximum_number_of_tailpoints, number_of_particles, & 135 number_of_tails, particle_advection, particle_advection_start, & 136 particle_tail_coordinates, particles, uniform_particles, & 137 use_particle_tails 138 132 139 133 USE pegrid 140 134 … … 234 228 !-- Select the plot mode (in case of isosurface or slicer only if user has 235 229 !-- defined a variable which shall be plotted; otherwise do nothing) 236 IF ( mode_dvrp(m)(1:9) == 'particles' .AND. particle_advection .AND. & 237 simulated_time >= particle_advection_start ) THEN 238 ! 239 !-- DVRP-Calls for plotting particles: 240 CALL cpu_log( log_point_s(28), 'dvrp_particles', 'start' ) 241 242 ! 243 !-- Definition of characteristics of particle material 244 ! tmp_r = 0.1; tmp_g = 0.7; tmp_b = 0.1; tmp_t = 0.0 245 tmp_r = 0.0_wp; tmp_g = 0.0_wp; tmp_b = 0.0_wp; tmp_t = 0.0_wp 246 CALL DVRP_MATERIAL_RGB( m-1, 1, tmp_r, tmp_g, tmp_b, tmp_t ) 247 248 ! 249 !-- If clipping is active and if this subdomain is clipped, find out the 250 !-- number of particles and tails to be plotted; otherwise, all 251 !-- particles/tails are plotted. dvrp_mask is used to mark the partikles. 252 ALLOCATE( dvrp_mask(number_of_particles) ) 253 254 IF ( dvrp_total_overlap ) THEN 255 dvrp_mask = .TRUE. 256 dvrp_nop = number_of_particles 257 dvrp_not = number_of_tails 258 ELSE 259 dvrp_mask = .FALSE. 260 dvrp_nop = 0 261 dvrp_not = 0 262 IF ( dvrp_overlap ) THEN 263 IF ( .NOT. use_particle_tails ) THEN 264 DO n = 1, number_of_particles 265 ip = particles(n)%x / dx 266 jp = particles(n)%y / dy 267 IF ( ip >= nxl_dvrp .AND. ip <= nxr_dvrp .AND. & 268 jp >= nys_dvrp .AND. jp <= nyn_dvrp ) THEN 269 dvrp_nop = dvrp_nop + 1 270 dvrp_mask(n) = .TRUE. 271 ENDIF 272 ENDDO 273 ELSE 274 k = 0 275 DO n = 1, number_of_particles 276 IF ( particles(n)%tail_id /= 0 ) THEN 277 k = k + 1 278 ip = particles(n)%x / dx 279 jp = particles(n)%y / dy 280 IF ( ip >= nxl_dvrp .AND. ip <= nxr_dvrp .AND. & 281 jp >= nys_dvrp .AND. jp <= nyn_dvrp ) THEN 282 dvrp_not = dvrp_not + 1 283 dvrp_mask(n) = .TRUE. 284 ENDIF 285 ENDIF 286 ENDDO 287 ENDIF 288 ENDIF 289 ENDIF 290 291 ! 292 !-- Move particle coordinates to one-dimensional arrays 293 IF ( .NOT. use_particle_tails ) THEN 294 ! 295 !-- All particles are output 296 ALLOCATE( psize(dvrp_nop), p_t(dvrp_nop), p_c(dvrp_nop), & 297 p_x(dvrp_nop), p_y(dvrp_nop), p_z(dvrp_nop) ) 298 psize = 0.0_wp; p_t = 0_wp; p_c = 0.0_wp 299 p_x = 0.0_wp; p_y = 0.0_wp 300 p_z = 0.0_wp 301 k = 0 302 DO n = 1, number_of_particles 303 IF ( dvrp_mask(n) ) THEN 304 k = k + 1 305 psize(k) = particles(n)%dvrp_psize 306 p_x(k) = particles(n)%x * superelevation_x 307 p_y(k) = particles(n)%y * superelevation_y 308 p_z(k) = particles(n)%z * superelevation 309 p_c(k) = particles(n)%class 310 ENDIF 311 ENDDO 312 ELSE 313 ! 314 !-- Particles have a tail 315 ALLOCATE( psize(dvrp_not), p_t(dvrp_not), & 316 p_c(dvrp_not*maximum_number_of_tailpoints), & 317 p_x(dvrp_not*maximum_number_of_tailpoints), & 318 p_y(dvrp_not*maximum_number_of_tailpoints), & 319 p_z(dvrp_not*maximum_number_of_tailpoints) ) 320 psize = 0.0_wp; p_t = 0_wp; p_c = 0.0_wp 321 p_x = 0.0_wp; p_y = 0.0_wp 322 p_z = 0.0_wp 323 i = 0 324 k = 0 325 326 DO n = 1, number_of_particles 327 nn = particles(n)%tail_id 328 IF ( nn /= 0 .AND. dvrp_mask(n) ) THEN 329 k = k + 1 330 DO j = 1, particles(n)%tailpoints 331 i = i + 1 332 p_x(i) = particle_tail_coordinates(j,1,nn) * & 333 superelevation_x 334 p_y(i) = particle_tail_coordinates(j,2,nn) * & 335 superelevation_y 336 p_z(i) = particle_tail_coordinates(j,3,nn) * & 337 superelevation 338 p_c(i) = particle_tail_coordinates(j,4,nn) 339 ENDDO 340 psize(k) = particles(n)%dvrp_psize 341 p_t(k) = particles(n)%tailpoints - 1 342 ENDIF 343 ENDDO 344 ENDIF 345 346 ! 347 !-- Compute and plot particles in dvr-format 348 IF ( uniform_particles .AND. .NOT. use_particle_tails ) THEN 349 ! 350 !-- All particles have the same color. Use simple routine to set 351 !-- the particle attributes (produces less output data) 352 CALL DVRP_PARTICLES( m-1, p_x, p_y, p_z, psize ) 353 ELSE 354 ! 355 !-- Set color definitions 356 CALL user_dvrp_coltab( 'particles', 'none' ) 357 358 CALL DVRP_COLORTABLE_HLS( m-1, 0, interval_values_dvrp_prt, & 359 interval_h_dvrp_prt, & 360 interval_l_dvrp_prt, & 361 interval_s_dvrp_prt, & 362 interval_a_dvrp_prt ) 363 364 IF ( .NOT. use_particle_tails ) THEN 365 CALL DVRP_PARTICLES( m-1, dvrp_nop, p_x, p_y, p_z, 3, psize, & 366 p_c, p_t ) 367 ELSE 368 CALL DVRP_PARTICLES( m-1, dvrp_not, p_x, p_y, p_z, 15, psize, & 369 p_c, p_t ) 370 ENDIF 371 ENDIF 372 373 CALL DVRP_VISUALIZE( m-1, 3, dvrp_filecount ) 374 375 DEALLOCATE( dvrp_mask, psize, p_c, p_t, p_x, p_y, p_z ) 376 377 CALL cpu_log( log_point_s(28), 'dvrp_particles', 'stop' ) 378 379 380 ELSEIF ( ( mode_dvrp(m)(1:10) == 'isosurface' .OR. & 230 IF ( ( mode_dvrp(m)(1:10) == 'isosurface' .OR. & 381 231 mode_dvrp(m)(1:6) == 'slicer' ) & 382 232 .AND. output_variable /= ' ' ) THEN -
palm/trunk/SOURCE/flow_statistics.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Output of bulk microphysics simplified. 22 22 ! 23 23 ! Former revisions: … … 193 193 USE control_parameters, & 194 194 ONLY: average_count_pr, cloud_droplets, cloud_physics, do_sum, & 195 dt_3d, g, humidity, icloud_scheme, kappa, large_scale_forcing,&195 dt_3d, g, humidity, kappa, large_scale_forcing, & 196 196 large_scale_subsidence, max_pr_user, message_string, neutral, & 197 ocean, passive_scalar, precipitation, simulated_time,&197 microphysics_seifert, ocean, passive_scalar, simulated_time, & 198 198 use_subsidence_tendencies, use_surface_fluxes, use_top_fluxes, & 199 199 ws_scheme_mom, ws_scheme_sca … … 898 898 sums_l(k,46,tn) = sums_l(k,46,tn) + pts * w(k,j,i) * & 899 899 rmask(j,i,sr) 900 sums_l(k,54,tn) = sums_l(k,54,tn) + ql(k,j,i) * rmask(j,i,sr) 901 900 902 IF ( .NOT. cloud_droplets ) THEN 901 903 pts = 0.5_wp * & … … 906 908 sums_l(k,52,tn) = sums_l(k,52,tn) + pts * w(k,j,i) * & 907 909 rmask(j,i,sr) 908 IF ( icloud_scheme == 0 ) THEN 909 sums_l(k,54,tn) = sums_l(k,54,tn) + ql(k,j,i) * & 910 sums_l(k,75,tn) = sums_l(k,75,tn) + qc(k,j,i) * & 911 rmask(j,i,sr) 912 sums_l(k,76,tn) = sums_l(k,76,tn) + prr(k,j,i) * & 913 rmask(j,i,sr) 914 IF ( microphysics_seifert ) THEN 915 sums_l(k,73,tn) = sums_l(k,73,tn) + nr(k,j,i) * & 910 916 rmask(j,i,sr) 911 sums_l(k,75,tn) = sums_l(k,75,tn) + qc(k,j,i) * & 912 rmask(j,i,sr) 913 IF ( precipitation ) THEN 914 sums_l(k,73,tn) = sums_l(k,73,tn) + nr(k,j,i) * & 915 rmask(j,i,sr) 916 sums_l(k,74,tn) = sums_l(k,74,tn) + qr(k,j,i) * & 917 rmask(j,i,sr) 918 sums_l(k,76,tn) = sums_l(k,76,tn) + prr(k,j,i) *& 919 rmask(j,i,sr) 920 ENDIF 921 ELSE 922 sums_l(k,54,tn) = sums_l(k,54,tn) + ql(k,j,i) * & 917 sums_l(k,74,tn) = sums_l(k,74,tn) + qr(k,j,i) * & 923 918 rmask(j,i,sr) 924 919 ENDIF 925 ELSE926 sums_l(k,54,tn) = sums_l(k,54,tn) + ql(k,j,i) * &927 rmask(j,i,sr)928 920 ENDIF 921 929 922 ELSE 930 923 IF( .NOT. ws_scheme_sca .OR. sr /= 0 ) THEN … … 1662 1655 USE control_parameters, & 1663 1656 ONLY : average_count_pr, cloud_droplets, cloud_physics, do_sum, & 1664 dt_3d, g, humidity, icloud_scheme, kappa, large_scale_forcing,&1665 large_scale_subsidence, max_pr_user, message_string, neutral,&1666 ocean, passive_scalar, precipitation, simulated_time, &1667 use_subsidence_tendencies, use_surface_fluxes, use_top_fluxes, &1668 ws_scheme_mom, ws_scheme_sca1657 dt_3d, g, humidity, kappa, large_scale_forcing, & 1658 large_scale_subsidence, max_pr_user, message_string, & 1659 microphysics_seifert, neutral, ocean, passive_scalar, & 1660 simulated_time, use_subsidence_tendencies, use_surface_fluxes, & 1661 use_top_fluxes, ws_scheme_mom, ws_scheme_sca 1669 1662 1670 1663 USE cpulog, & … … 2774 2767 !$acc end parallel loop 2775 2768 2776 IF ( icloud_scheme == 0) THEN2769 IF ( microphysics_seifert ) THEN 2777 2770 2778 2771 !$acc parallel loop gang present( qc, ql, rflags_invers, rmask, sums_l ) create( s1, s2 ) … … 2791 2784 !$acc end parallel loop 2792 2785 2793 IF ( precipitation ) THEN 2794 2795 !$acc parallel loop gang present( nr, qr, prr, rflags_invers, rmask, sums_l ) create( s1, s2, s3 ) 2796 DO k = nzb, nzt_diff 2797 s1 = 0 2798 s2 = 0 2799 s3 = 0 2800 !$acc loop vector collapse( 2 ) reduction( +: s1, s2, s3 ) 2801 DO i = nxl, nxr 2802 DO j = nys, nyn 2803 s1 = s1 + nr(k,j,i) * rmask(j,i,sr) * rflags_invers(j,i,k+1) 2804 s2 = s2 + qr(k,j,i) * rmask(j,i,sr) * rflags_invers(j,i,k+1) 2805 s3 = s3 + prr(k,j,i) * rmask(j,i,sr) * rflags_invers(j,i,k+1) 2806 ENDDO 2786 !$acc parallel loop gang present( nr, qr, prr, rflags_invers, rmask, sums_l ) create( s1, s2, s3 ) 2787 DO k = nzb, nzt_diff 2788 s1 = 0 2789 s2 = 0 2790 s3 = 0 2791 !$acc loop vector collapse( 2 ) reduction( +: s1, s2, s3 ) 2792 DO i = nxl, nxr 2793 DO j = nys, nyn 2794 s1 = s1 + nr(k,j,i) * rmask(j,i,sr) * rflags_invers(j,i,k+1) 2795 s2 = s2 + qr(k,j,i) * rmask(j,i,sr) * rflags_invers(j,i,k+1) 2796 s3 = s3 + prr(k,j,i) * rmask(j,i,sr) * rflags_invers(j,i,k+1) 2807 2797 ENDDO 2808 sums_l(k,73,tn) = s12809 sums_l(k,74,tn) = s22810 sums_l(k,76,tn) = s32811 2798 ENDDO 2812 !$acc end parallel loop 2813 2814 ENDIF 2799 sums_l(k,73,tn) = s1 2800 sums_l(k,74,tn) = s2 2801 sums_l(k,76,tn) = s3 2802 ENDDO 2803 !$acc end parallel loop 2815 2804 2816 2805 ELSE -
palm/trunk/SOURCE/header.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 22 ! 21 ! Tails removed. icloud_scheme replaced by microphysics_* 22 ! 23 23 ! Former revisions: 24 24 ! ----------------- … … 275 275 density_ratio, dissipation_classes, dt_min_part, dt_prel, & 276 276 dt_write_particle_data, end_time_prel, & 277 maximum_number_of_tailpoints, maximum_tailpoint_age, & 278 minimum_tailpoint_distance, number_of_particle_groups, & 279 particle_advection, particle_advection_start, & 277 number_of_particle_groups, particle_advection, & 278 particle_advection_start, & 280 279 particles_per_point, pdx, pdy, pdz, psb, psl, psn, psr, pss, & 281 280 pst, radius, radius_classes, random_start_position, & 282 281 seed_follows_topography, & 283 total_number_of_particles, use_particle_tails, & 284 use_sgs_for_particles, total_number_of_tails, & 282 total_number_of_particles, use_sgs_for_particles, & 285 283 vertical_particle_advection, write_particle_statistics 286 284 … … 1700 1698 slicer_range_limits_dvrp(:,m) 1701 1699 ENDIF 1702 ELSEIF ( mode_dvrp(i)(1:9) == 'particles' ) THEN1703 WRITE ( io, 363 ) dvrp_psize1704 IF ( particle_dvrpsize /= 'none' ) THEN1705 WRITE ( io, 364 ) 'size', TRIM( particle_dvrpsize ), &1706 dvrpsize_interval1707 ENDIF1708 IF ( particle_color /= 'none' ) THEN1709 WRITE ( io, 364 ) 'color', TRIM( particle_color ), &1710 color_interval1711 ENDIF1712 1700 ENDIF 1713 1701 i = i + 1 … … 1782 1770 WRITE ( io, 415 ) 1783 1771 WRITE ( io, 416 ) surface_pressure, r_d, rho_surface, cp, l_v 1784 IF ( icloud_scheme == 0) THEN1772 IF ( microphysics_seifert ) THEN 1785 1773 WRITE ( io, 510 ) 1.0E-6_wp * nc_const 1786 IF ( precipitation )WRITE ( io, 511 ) c_sedimentation1774 WRITE ( io, 511 ) c_sedimentation 1787 1775 ENDIF 1788 1776 ENDIF … … 1796 1784 WRITE ( io, 432 ) 1797 1785 IF ( cloud_top_radiation ) WRITE ( io, 132 ) 1798 IF ( icloud_scheme == 1) THEN1799 IF ( precipitation )WRITE ( io, 133 )1800 ELSEIF ( icloud_scheme == 0) THEN1786 IF ( microphysics_kessler ) THEN 1787 WRITE ( io, 133 ) 1788 ELSEIF ( microphysics_seifert ) THEN 1801 1789 IF ( drizzle ) WRITE ( io, 506 ) 1802 IF ( precipitation ) THEN 1803 WRITE ( io, 505 ) 1804 IF ( turbulence ) WRITE ( io, 507 ) 1805 IF ( ventilation_effect ) WRITE ( io, 508 ) 1806 IF ( limiter_sedimentation ) WRITE ( io, 509 ) 1807 ENDIF 1790 WRITE ( io, 505 ) 1791 IF ( turbulence ) WRITE ( io, 507 ) 1792 IF ( ventilation_effect ) WRITE ( io, 508 ) 1793 IF ( limiter_sedimentation ) WRITE ( io, 509 ) 1808 1794 ENDIF 1809 1795 ELSEIF ( humidity .AND. cloud_droplets ) THEN … … 1872 1858 IF ( particles_per_point > 1 ) WRITE ( io, 489 ) particles_per_point 1873 1859 WRITE ( io, 495 ) total_number_of_particles 1874 IF ( use_particle_tails .AND. maximum_number_of_tailpoints /= 0 ) THEN1875 WRITE ( io, 483 ) maximum_number_of_tailpoints1876 IF ( minimum_tailpoint_distance /= 0 ) THEN1877 WRITE ( io, 484 ) total_number_of_tails, &1878 minimum_tailpoint_distance, &1879 maximum_tailpoint_age1880 ENDIF1881 ENDIF1882 1860 IF ( dt_write_particle_data /= 9999999.9_wp ) THEN 1883 1861 WRITE ( io, 485 ) dt_write_particle_data … … 2215 2193 362 FORMAT (/' Slicer plane ',A/ & 2216 2194 ' Slicer limits: [',F6.2,',',F6.2,']') 2217 363 FORMAT (/' Particles'/ &2218 ' particle size: ',F7.2,' m')2219 364 FORMAT (' particle ',A,' controlled by "',A,'" with interval [', &2220 F6.2,',',F6.2,']')2221 2195 365 FORMAT (/' Groundplate color: (',F4.2,',',F4.2,',',F4.2,') (R,G,B)'/ & 2222 2196 ' Superelevation along (x,y,z): (',F4.1,',',F4.1,',',F4.1, & … … 2377 2351 481 FORMAT (' Particles have random start positions'/) 2378 2352 482 FORMAT (' Particles are advected only horizontally'/) 2379 483 FORMAT (' Particles have tails with a maximum of ',I3,' points')2380 484 FORMAT (' Number of tails of the total domain: ',I10/ &2381 ' Minimum distance between tailpoints: ',F8.2,' m'/ &2382 ' Maximum age of the end of the tail: ',F8.2,' s')2383 2353 485 FORMAT (' Particle data are written on file every ', F9.1, ' s') 2384 2354 486 FORMAT (' Particle statistics are written on file'/) -
palm/trunk/SOURCE/init_3d_model.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 465 465 precipitation_rate(nysg:nyng,nxlg:nxrg) ) 466 466 467 IF ( icloud_scheme == 0 ) THEN 468 ! 469 !-- 1D-arrays 470 ALLOCATE ( nc_1d(nzb:nzt+1), pt_1d(nzb:nzt+1), & 471 q_1d(nzb:nzt+1), qc_1d(nzb:nzt+1) ) 472 ! 473 !-- 3D-cloud water content 467 ! 468 !-- 1D-arrays 469 ALLOCATE ( nc_1d(nzb:nzt+1), pt_1d(nzb:nzt+1), & 470 q_1d(nzb:nzt+1), qc_1d(nzb:nzt+1) ) 471 ! 472 !-- 3D-cloud water content 474 473 #if defined( __nopointer ) 475 474 ALLOCATE( qc(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 476 475 #else 477 476 ALLOCATE( qc_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 478 477 #endif 479 480 IF ( precipitation ) THEN 481 ! 482 !-- 1D-arrays 483 ALLOCATE ( nr_1d(nzb:nzt+1), qr_1d(nzb:nzt+1) ) 484 485 ! 486 !-- 2D-rain water content and rain drop concentration arrays 487 ALLOCATE ( qrs(nysg:nyng,nxlg:nxrg), & 488 qrsws(nysg:nyng,nxlg:nxrg), & 489 qrswst(nysg:nyng,nxlg:nxrg), & 490 nrs(nysg:nyng,nxlg:nxrg), & 491 nrsws(nysg:nyng,nxlg:nxrg), & 492 nrswst(nysg:nyng,nxlg:nxrg) ) 493 ! 494 !-- 3D-rain water content, rain drop concentration arrays 478 ! 479 !-- 3d-precipitation rate 480 ALLOCATE( prr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 481 482 IF ( microphysics_seifert ) THEN 483 ! 484 !-- 1D-arrays 485 ALLOCATE ( nr_1d(nzb:nzt+1), qr_1d(nzb:nzt+1) ) 486 487 ! 488 !-- 2D-rain water content and rain drop concentration arrays 489 ALLOCATE ( qrs(nysg:nyng,nxlg:nxrg), & 490 qrsws(nysg:nyng,nxlg:nxrg), & 491 qrswst(nysg:nyng,nxlg:nxrg), & 492 nrs(nysg:nyng,nxlg:nxrg), & 493 nrsws(nysg:nyng,nxlg:nxrg), & 494 nrswst(nysg:nyng,nxlg:nxrg) ) 495 ! 496 !-- 3D-rain water content, rain drop concentration arrays 495 497 #if defined( __nopointer ) 496 497 498 499 500 501 498 ALLOCATE( nr(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 499 nr_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 500 qr(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 501 qr_p(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 502 tnr_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 503 tqr_m(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 502 504 #else 503 504 505 506 507 508 505 ALLOCATE( nr_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 506 nr_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 507 nr_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 508 qr_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 509 qr_2(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 510 qr_3(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 509 511 #endif 510 ! 511 !-- 3d-precipitation rate 512 ALLOCATE( prr(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 513 ENDIF 514 515 ENDIF 512 ENDIF 513 516 514 ENDIF 517 515 … … 658 656 IF ( cloud_physics ) THEN 659 657 ql => ql_1 660 IF ( icloud_scheme == 0 ) THEN 661 qc => qc_1 662 IF ( precipitation ) THEN 663 qr => qr_1; qr_p => qr_2; tqr_m => qr_3 664 nr => nr_1; nr_p => nr_2; tnr_m => nr_3 665 ENDIF 658 qc => qc_1 659 IF ( microphysics_seifert ) THEN 660 qr => qr_1; qr_p => qr_2; tqr_m => qr_3 661 nr => nr_1; nr_p => nr_2; tnr_m => nr_3 666 662 ENDIF 667 663 ENDIF … … 733 729 ENDDO 734 730 ENDDO 735 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 736 precipitation ) THEN 731 IF ( cloud_physics .AND. microphysics_seifert ) THEN 737 732 DO i = nxlg, nxrg 738 733 DO j = nysg, nyng … … 790 785 IF ( humidity .OR. passive_scalar ) THEN 791 786 qs = 0.0_wp 792 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 793 precipitation ) THEN 787 IF ( cloud_physics .AND. microphysics_seifert ) THEN 794 788 qrs = 0.0_wp 795 789 nrs = 0.0_wp … … 880 874 ENDDO 881 875 ENDDO 882 IF ( cloud_physics .AND. icloud_scheme == 0) THEN876 IF ( cloud_physics .AND. microphysics_seifert ) THEN 883 877 ! 884 878 !-- Initialze nc_1d with default value 885 879 nc_1d(:) = nc_const 886 880 887 IF ( precipitation ) THEN 888 DO i = nxlg, nxrg 889 DO j = nysg, nyng 890 qr(:,j,i) = 0.0_wp 891 nr(:,j,i) = 0.0_wp 892 ENDDO 881 DO i = nxlg, nxrg 882 DO j = nysg, nyng 883 qr(:,j,i) = 0.0_wp 884 nr(:,j,i) = 0.0_wp 893 885 ENDDO 894 END IF886 ENDDO 895 887 896 888 ENDIF … … 1078 1070 !-- Determine the near-surface water flux 1079 1071 IF ( humidity .OR. passive_scalar ) THEN 1080 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1081 precipitation ) THEN 1072 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1082 1073 qrsws = 0.0_wp 1083 1074 nrsws = 0.0_wp … … 1116 1107 IF ( humidity .OR. passive_scalar ) THEN 1117 1108 qswst = 0.0_wp 1118 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1119 precipitation ) THEN 1109 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1120 1110 nrswst = 0.0_wp 1121 1111 qrswst = 0.0_wp … … 1157 1147 IF ( humidity .OR. passive_scalar ) THEN 1158 1148 IF ( .NOT. constant_waterflux ) qsws = 0.0_wp 1159 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1160 precipitation ) THEN 1149 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1161 1150 qrsws = 0.0_wp 1162 1151 nrsws = 0.0_wp … … 1200 1189 IF ( cloud_physics ) THEN 1201 1190 ql = 0.0_wp 1202 IF ( precipitation ) precipitation_amount = 0.0_wp 1203 IF ( icloud_scheme == 0 ) THEN 1204 qc = 0.0_wp 1191 qc = 0.0_wp 1192 1193 precipitation_amount = 0.0_wp 1194 1195 IF ( microphysics_seifert ) THEN 1205 1196 nc_1d = nc_const 1206 1197 ENDIF … … 1240 1231 tq_m = 0.0_wp 1241 1232 q_p = q 1242 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1243 precipitation ) THEN 1233 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1244 1234 tqr_m = 0.0_wp 1245 qr_p = qr1235 qr_p = qr 1246 1236 tnr_m = 0.0_wp 1247 nr_p = nr1237 nr_p = nr 1248 1238 ENDIF 1249 1239 ENDIF … … 1426 1416 IF ( humidity .OR. passive_scalar ) THEN 1427 1417 q_p = q 1428 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1429 precipitation ) THEN 1418 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1430 1419 qr_p = qr 1431 1420 nr_p = nr … … 1441 1430 IF ( humidity .OR. passive_scalar ) THEN 1442 1431 tq_m = 0.0_wp 1443 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1444 precipitation ) THEN 1432 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1445 1433 tqr_m = 0.0_wp 1446 1434 tnr_m = 0.0_wp -
palm/trunk/SOURCE/init_cloud_physics.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 92 92 93 93 USE control_parameters, & 94 ONLY: g, icloud_scheme, message_string, precipitation, pt_surface,&94 ONLY: g, message_string, microphysics_seifert, pt_surface, & 95 95 rho_surface, surface_pressure 96 96 … … 126 126 ! 127 127 !-- Calculate timestep according to precipitation 128 IF ( icloud_scheme == 0 .AND. precipitation) THEN128 IF ( microphysics_seifert ) THEN 129 129 dt_precipitation = c_sedimentation * MINVAL( dzu(nzb+2:nzt) ) / & 130 130 w_precipitation -
palm/trunk/SOURCE/init_masks.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 97 97 data_output_masks, data_output_masks_user, & 98 98 doav, doav_n, domask, domask_no, dz, dz_stretch_level, humidity,& 99 icloud_scheme, mask, masks, mask_scale, mask_i,&99 mask, masks, mask_scale, mask_i, & 100 100 mask_i_global, mask_j, mask_j_global, mask_k, mask_k_global, & 101 101 mask_loop, mask_size, mask_size_l, mask_start_l, mask_x, & 102 102 mask_x_loop, mask_xyz_dimension, mask_y, mask_y_loop, mask_z, & 103 103 mask_z_loop, max_masks, message_string, mid, & 104 passive_scalar, precipitation, ocean104 microphysics_seifert, passive_scalar, ocean 105 105 106 106 USE grid_variables, & … … 270 270 '" requires cloud_physics = .TRUE.' 271 271 CALL message( 'init_masks', 'PA0108', 1, 2, 0, 6, 0 ) 272 ELSEIF ( icloud_scheme /= 0) THEN272 ELSEIF ( .NOT. microphysics_seifert ) THEN 273 273 message_string = 'output of "' // TRIM( var ) // '" requi' // & 274 274 'res cloud_scheme = seifert_beheng' 275 275 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 276 ELSEIF ( .NOT. precipitation ) THEN277 message_string = 'output of "' // TRIM( var ) // '" requi' // &278 'res precipitation = .TRUE.'279 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 )280 276 ENDIF 281 277 unit = '1/m3' … … 305 301 'res cloud_physics = .TRUE.' 306 302 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 307 ELSEIF ( icloud_scheme /= 0 ) THEN308 message_string = 'output of "' // TRIM( var ) // '" requi' // &309 'res cloud_scheme = seifert_beheng'310 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 )311 303 ENDIF 312 304 unit = 'kg/kg' … … 344 336 'res cloud_physics = .TRUE.' 345 337 CALL message( 'check_parameters', 'PA0108', 1, 2, 0, 6, 0 ) 346 ELSEIF ( icloud_scheme /= 0) THEN338 ELSEIF ( .NOT. microphysics_seifert ) THEN 347 339 message_string = 'output of "' // TRIM( var ) // '" requi' // & 348 340 'res cloud_scheme = seifert_beheng' 349 341 CALL message( 'check_parameters', 'PA0359', 1, 2, 0, 6, 0 ) 350 ELSEIF ( .NOT. precipitation ) THEN351 message_string = 'output of "' // TRIM( var ) // '" requi' // &352 'res precipitation = .TRUE.'353 CALL message( 'check_parameters', 'PA0112', 1, 2, 0, 6, 0 )354 342 ENDIF 355 343 unit = 'kg/kg' -
palm/trunk/SOURCE/interaction_droplets_ptq.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 127 127 128 128 USE indices, & 129 ONLY: n xl, nxr, nyn, nys, nzb_2d, nzt129 ONLY: nzb_2d, nzt 130 130 131 131 USE kinds, & -
palm/trunk/SOURCE/lpm.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Tails removed. 22 ! 23 ! Initialization of sgs model not necessary for the use of cloud_droplets and 24 ! use_sgs_for_particles. 25 ! 26 ! lpm_release_set integrated. 27 ! 28 ! Unused variabled removed. 22 29 ! 23 30 ! Former revisions: … … 108 115 ONLY: lpm_exchange_horiz, lpm_move_particle 109 116 117 USE lpm_init_mod, & 118 ONLY: lpm_create_particle, PHASE_RELEASE 119 110 120 USE lpm_pack_arrays_mod, & 111 121 ONLY: lpm_pack_all_arrays 112 122 113 123 USE particle_attributes, & 114 ONLY: collision_kernel, deleted_particles, deleted_tails,&124 ONLY: collision_kernel, deleted_particles, & 115 125 dt_write_particle_data, dt_prel, end_time_prel, & 116 126 grid_particles, number_of_particles, number_of_particle_groups, & 117 127 particles, particle_groups, prt_count, trlp_count_sum, & 118 t ail_mask, time_prel, time_sort_particles,&128 time_prel, & 119 129 time_write_particle_data, trlp_count_recv_sum, trnp_count_sum, & 120 130 trnp_count_recv_sum, trrp_count_sum, trrp_count_recv_sum, & 121 trsp_count_sum, trsp_count_recv_sum, use_particle_tails,&131 trsp_count_sum, trsp_count_recv_sum, & 122 132 use_sgs_for_particles, write_particle_statistics 123 133 … … 159 169 160 170 ! 161 !-- Initialize arrays for marking those particles /tailsto be deleted after the171 !-- Initialize arrays for marking those particles to be deleted after the 162 172 !-- (sub-) timestep 163 173 deleted_particles = 0 164 165 IF ( use_particle_tails ) THEN166 tail_mask = .TRUE.167 ENDIF168 deleted_tails = 0169 170 174 171 175 ! … … 202 206 IF ( time_prel >= dt_prel .AND. end_time_prel > simulated_time ) THEN 203 207 204 CALL lpm_ release_set208 CALL lpm_create_particle(PHASE_RELEASE) 205 209 ! 206 210 !-- The MOD function allows for changes in the output interval with … … 240 244 !-- velocity variances) 241 245 242 IF ( use_sgs_for_particles ) CALL lpm_init_sgs_tke 246 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets ) THEN 247 CALL lpm_init_sgs_tke 248 ENDIF 243 249 244 250 DO i = nxl, nxr … … 361 367 deleted_particles = 0 362 368 363 IF ( use_particle_tails ) THEN364 tail_mask = .TRUE.365 ENDIF366 deleted_tails = 0367 368 369 369 IF ( dt_3d_reached ) EXIT 370 370 … … 387 387 IF ( collision_kernel == 'none' ) CALL lpm_set_attributes 388 388 389 390 389 ! 391 390 !-- Set particle attributes defined by the user 392 391 CALL user_lpm_set_attributes 393 394 395 !396 !-- particle tails currently not available397 !398 !-- If required, add the current particle positions to the particle tails399 ! IF ( use_particle_tails ) CALL lpm_extend_tails400 401 392 402 393 ! -
palm/trunk/SOURCE/lpm_advec.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Random velocity fluctuations for particles added. Terminal fall velocity 22 ! for droplets is calculated from a parameterization (which is better than 23 ! the previous, physically correct calculation, which demands a very short 24 ! time step that is not used in the model). 25 ! 26 ! Unused variables deleted. 22 27 ! 23 28 ! Former revisions: … … 78 83 79 84 USE arrays_3d, & 80 ONLY: de_dx, de_dy, de_dz, diss, e, u, us, usws, v, vsws, w, z0, zu, & 81 zw 85 ONLY: de_dx, de_dy, de_dz, diss, e, km, u, us, usws, v, vsws, w, zu, zw 82 86 83 87 USE cpulog … … 87 91 USE control_parameters, & 88 92 ONLY: atmos_ocean_sign, cloud_droplets, constant_flux_layer, dt_3d, & 89 dt_3d_reached_l, dz, g, kappa, molecular_viscosity, topography, & 90 u_gtrans, v_gtrans, simulated_time 93 dt_3d_reached_l, dz, g, kappa, topography, u_gtrans, v_gtrans 91 94 92 95 USE grid_variables, & … … 99 102 100 103 USE particle_attributes, & 101 ONLY: block_offset, c_0, d ensity_ratio, dt_min_part, grid_particles,&104 ONLY: block_offset, c_0, dt_min_part, grid_particles, & 102 105 iran_part, log_z_z0, number_of_particles, number_of_sublayers, & 103 106 particles, particle_groups, offset_ocean_nzt, sgs_wfu_part, & … … 140 143 REAL(wp) :: de_dz_int_l !< 141 144 REAL(wp) :: de_dz_int_u !< 145 REAL(wp) :: diameter !< diamter of droplet 142 146 REAL(wp) :: diss_int_l !< 143 147 REAL(wp) :: diss_int_u !< … … 150 154 REAL(wp) :: exp_term !< 151 155 REAL(wp) :: gg !< 152 REAL(wp) :: height_int !<153 156 REAL(wp) :: height_p !< 154 REAL(wp) :: lagr_timescale !< 157 REAL(wp) :: lagr_timescale !< Lagrangian timescale 155 158 REAL(wp) :: location(1:30,1:3) !< 156 159 REAL(wp) :: random_gauss !< 160 REAL(wp) :: RL !< Lagrangian autocorrelation coefficient 161 REAL(wp) :: rg1 !< Gaussian distributed random number 162 REAL(wp) :: rg2 !< Gaussian distributed random number 163 REAL(wp) :: rg3 !< Gaussian distributed random number 164 REAL(wp) :: sigma !< velocity standard deviation 157 165 REAL(wp) :: u_int_l !< 158 166 REAL(wp) :: u_int_u !< … … 163 171 REAL(wp) :: w_int_l !< 164 172 REAL(wp) :: w_int_u !< 173 REAL(wp) :: w_s !< terminal velocity of droplets 165 174 REAL(wp) :: x !< 166 175 REAL(wp) :: y !< 167 REAL(wp) :: z_p !< 176 REAL(wp) :: z_p !< 177 178 REAL(wp), PARAMETER :: a_rog = 9.65_wp !< parameter for fall velocity 179 REAL(wp), PARAMETER :: b_rog = 10.43_wp !< parameter for fall velocity 180 REAL(wp), PARAMETER :: c_rog = 0.6_wp !< parameter for fall velocity 181 REAL(wp), PARAMETER :: k_cap_rog = 4.0_wp !< parameter for fall velocity 182 REAL(wp), PARAMETER :: k_low_rog = 12.0_wp !< parameter for fall velocity 183 REAL(wp), PARAMETER :: d0_rog = 0.745_wp !< separation diameter 168 184 169 185 REAL(wp), DIMENSION(1:30) :: d_gp_pl !< … … 388 404 !-- Interpolate and calculate quantities needed for calculating the SGS 389 405 !-- velocities 390 IF ( use_sgs_for_particles ) THEN406 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets ) THEN 391 407 392 408 IF ( topography == 'flat' ) THEN … … 1336 1352 !-- Update of the particle velocity 1337 1353 IF ( cloud_droplets ) THEN 1338 exp_arg = 4.5_wp * dens_ratio(n) * molecular_viscosity / & 1339 ( particles(n)%radius )**2 * & 1340 ( 1.0_wp + 0.15_wp * ( 2.0_wp * particles(n)%radius & 1341 * SQRT( ( u_int(n) - particles(n)%speed_x )**2 + & 1342 ( v_int(n) - particles(n)%speed_y )**2 + & 1343 ( w_int(n) - particles(n)%speed_z )**2 ) & 1344 / molecular_viscosity )**0.687_wp & 1345 ) 1346 1347 exp_term = EXP( -exp_arg * dt_particle(n) ) 1348 ELSEIF ( use_sgs_for_particles ) THEN 1354 ! 1355 !-- Terminal velocity is computed for vertical direction (Rogers et 1356 !-- al., 1993, J. Appl. Meteorol.) 1357 diameter = particles(n)%radius * 2000.0_wp !diameter in mm 1358 IF ( diameter <= d0_rog ) THEN 1359 w_s = k_cap_rog * diameter * ( 1.0_wp - EXP( -k_low_rog * diameter ) ) 1360 ELSE 1361 w_s = a_rog - b_rog * EXP( -c_rog * diameter ) 1362 ENDIF 1363 1364 ! 1365 !-- If selected, add random velocities following Soelch and Kaercher 1366 !-- (2010, Q. J. R. Meteorol. Soc.) 1367 IF ( use_sgs_for_particles ) THEN 1368 lagr_timescale = km(kp,jp,ip) / MAX( e(kp,jp,ip), 1.0E-20_wp ) 1369 RL = EXP( -1.0_wp * dt_3d / lagr_timescale ) 1370 sigma = SQRT( e(kp,jp,ip) ) 1371 1372 rg1 = random_gauss( iran_part, 5.0_wp ) - 1.0_wp 1373 rg2 = random_gauss( iran_part, 5.0_wp ) - 1.0_wp 1374 rg3 = random_gauss( iran_part, 5.0_wp ) - 1.0_wp 1375 1376 particles(n)%rvar1 = RL * particles(n)%rvar1 + & 1377 SQRT( 1.0_wp - RL**2 ) * sigma * rg1 1378 particles(n)%rvar2 = RL * particles(n)%rvar2 + & 1379 SQRT( 1.0_wp - RL**2 ) * sigma * rg2 1380 particles(n)%rvar3 = RL * particles(n)%rvar3 + & 1381 SQRT( 1.0_wp - RL**2 ) * sigma * rg3 1382 1383 particles(n)%speed_x = u_int(n) + particles(n)%rvar1 1384 particles(n)%speed_y = v_int(n) + particles(n)%rvar2 1385 particles(n)%speed_z = w_int(n) + particles(n)%rvar3 - w_s 1386 ELSE 1387 particles(n)%speed_x = u_int(n) 1388 particles(n)%speed_y = v_int(n) 1389 particles(n)%speed_z = w_int(n) - w_s 1390 ENDIF 1391 1392 ELSE 1393 1394 IF ( use_sgs_for_particles ) THEN 1395 exp_arg = particle_groups(particles(n)%group)%exp_arg 1396 exp_term = EXP( -exp_arg * dt_particle(n) ) 1397 ELSE 1398 exp_arg = particle_groups(particles(n)%group)%exp_arg 1399 exp_term = particle_groups(particles(n)%group)%exp_term 1400 ENDIF 1401 particles(n)%speed_x = particles(n)%speed_x * exp_term + & 1402 u_int(n) * ( 1.0_wp - exp_term ) 1403 particles(n)%speed_y = particles(n)%speed_y * exp_term + & 1404 v_int(n) * ( 1.0_wp - exp_term ) 1405 particles(n)%speed_z = particles(n)%speed_z * exp_term + & 1406 ( w_int(n) - ( 1.0_wp - dens_ratio(n) ) * & 1407 g / exp_arg ) * ( 1.0_wp - exp_term ) 1408 ENDIF 1409 1410 ENDIF 1411 1412 ENDDO 1413 1414 ELSE 1415 1416 DO n = 1, number_of_particles 1417 1418 !-- Transport of particles with inertia 1419 particles(n)%x = xv(n) + particles(n)%speed_x * dt_particle(n) 1420 particles(n)%y = yv(n) + particles(n)%speed_y * dt_particle(n) 1421 particles(n)%z = zv(n) + particles(n)%speed_z * dt_particle(n) 1422 ! 1423 !-- Update of the particle velocity 1424 IF ( cloud_droplets ) THEN 1425 ! 1426 !-- Terminal velocity is computed for vertical direction (Rogers et al., 1427 !-- 1993, J. Appl. Meteorol.) 1428 diameter = particles(n)%radius * 2000.0_wp !diameter in mm 1429 IF ( diameter <= d0_rog ) THEN 1430 w_s = k_cap_rog * diameter * ( 1.0_wp - EXP( -k_low_rog * diameter ) ) 1431 ELSE 1432 w_s = a_rog - b_rog * EXP( -c_rog * diameter ) 1433 ENDIF 1434 1435 ! 1436 !-- If selected, add random velocities following Soelch and Kaercher 1437 !-- (2010, Q. J. R. Meteorol. Soc.) 1438 IF ( use_sgs_for_particles ) THEN 1439 lagr_timescale = km(kp,jp,ip) / MAX( e(kp,jp,ip), 1.0E-20_wp ) 1440 RL = EXP( -1.0_wp * dt_3d / lagr_timescale ) 1441 sigma = SQRT( e(kp,jp,ip) ) 1442 1443 rg1 = random_gauss( iran_part, 5.0_wp ) - 1.0_wp 1444 rg2 = random_gauss( iran_part, 5.0_wp ) - 1.0_wp 1445 rg3 = random_gauss( iran_part, 5.0_wp ) - 1.0_wp 1446 1447 particles(n)%rvar1 = RL * particles(n)%rvar1 + & 1448 SQRT( 1.0_wp - RL**2 ) * sigma * rg1 1449 particles(n)%rvar2 = RL * particles(n)%rvar2 + & 1450 SQRT( 1.0_wp - RL**2 ) * sigma * rg2 1451 particles(n)%rvar3 = RL * particles(n)%rvar3 + & 1452 SQRT( 1.0_wp - RL**2 ) * sigma * rg3 1453 1454 particles(n)%speed_x = u_int(n) + particles(n)%rvar1 1455 particles(n)%speed_y = v_int(n) + particles(n)%rvar2 1456 particles(n)%speed_z = w_int(n) + particles(n)%rvar3 - w_s 1457 ELSE 1458 particles(n)%speed_x = u_int(n) 1459 particles(n)%speed_y = v_int(n) 1460 particles(n)%speed_z = w_int(n) - w_s 1461 ENDIF 1462 1463 ELSE 1464 1465 IF ( use_sgs_for_particles ) THEN 1349 1466 exp_arg = particle_groups(particles(n)%group)%exp_arg 1350 1467 exp_term = EXP( -exp_arg * dt_particle(n) ) … … 1353 1470 exp_term = particle_groups(particles(n)%group)%exp_term 1354 1471 ENDIF 1355 particles(n)%speed_x = particles(n)%speed_x * exp_term + &1472 particles(n)%speed_x = particles(n)%speed_x * exp_term + & 1356 1473 u_int(n) * ( 1.0_wp - exp_term ) 1357 particles(n)%speed_y = particles(n)%speed_y * exp_term + &1474 particles(n)%speed_y = particles(n)%speed_y * exp_term + & 1358 1475 v_int(n) * ( 1.0_wp - exp_term ) 1359 particles(n)%speed_z = particles(n)%speed_z * exp_term + &1360 ( w_int(n) - ( 1.0_wp - dens_ratio(n) ) * &1361 g /exp_arg ) * ( 1.0_wp - exp_term )1476 particles(n)%speed_z = particles(n)%speed_z * exp_term + & 1477 ( w_int(n) - ( 1.0_wp - dens_ratio(n) ) * g / & 1478 exp_arg ) * ( 1.0_wp - exp_term ) 1362 1479 ENDIF 1363 1480 1364 ENDDO1365 1366 ELSE1367 1368 DO n = 1, number_of_particles1369 1370 !-- Transport of particles with inertia1371 particles(n)%x = xv(n) + particles(n)%speed_x * dt_particle(n)1372 particles(n)%y = yv(n) + particles(n)%speed_y * dt_particle(n)1373 particles(n)%z = zv(n) + particles(n)%speed_z * dt_particle(n)1374 !1375 !-- Update of the particle velocity1376 IF ( cloud_droplets ) THEN1377 1378 exp_arg = 4.5_wp * dens_ratio(n) * molecular_viscosity / &1379 ( particles(n)%radius )**2 * &1380 ( 1.0_wp + 0.15_wp * ( 2.0_wp * particles(n)%radius * &1381 SQRT( ( u_int(n) - particles(n)%speed_x )**2 + &1382 ( v_int(n) - particles(n)%speed_y )**2 + &1383 ( w_int(n) - particles(n)%speed_z )**2 ) / &1384 molecular_viscosity )**0.687_wp &1385 )1386 1387 exp_term = EXP( -exp_arg * dt_particle(n) )1388 ELSEIF ( use_sgs_for_particles ) THEN1389 exp_arg = particle_groups(particles(n)%group)%exp_arg1390 exp_term = EXP( -exp_arg * dt_particle(n) )1391 ELSE1392 exp_arg = particle_groups(particles(n)%group)%exp_arg1393 exp_term = particle_groups(particles(n)%group)%exp_term1394 ENDIF1395 particles(n)%speed_x = particles(n)%speed_x * exp_term + &1396 u_int(n) * ( 1.0_wp - exp_term )1397 particles(n)%speed_y = particles(n)%speed_y * exp_term + &1398 v_int(n) * ( 1.0_wp - exp_term )1399 particles(n)%speed_z = particles(n)%speed_z * exp_term + &1400 ( w_int(n) - ( 1.0_wp - dens_ratio(n) ) * g / &1401 exp_arg ) * ( 1.0_wp - exp_term )1402 1481 ENDDO 1403 1482 -
palm/trunk/SOURCE/lpm_boundary_conds.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Tails removed. Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 75 75 76 76 USE control_parameters, & 77 ONLY: dz, message_string, particle_maximum_age , simulated_time77 ONLY: dz, message_string, particle_maximum_age 78 78 79 79 USE cpulog, & … … 89 89 90 90 USE particle_attributes, & 91 ONLY: deleted_particles, deleted_tails, ibc_par_b, ibc_par_t, & 92 number_of_particles, particles, & 93 particle_tail_coordinates, particle_type, offset_ocean_nzt_m1, & 94 tail_mask, use_particle_tails, use_sgs_for_particles 91 ONLY: deleted_particles, ibc_par_b, ibc_par_t, number_of_particles, & 92 particles, particle_type, offset_ocean_nzt_m1, & 93 use_sgs_for_particles 95 94 96 95 USE pegrid … … 119 118 INTEGER(iwp) :: k5 !< 120 119 INTEGER(iwp) :: n !< 121 INTEGER(iwp) :: nn !<122 120 INTEGER(iwp) :: t_index !< 123 121 INTEGER(iwp) :: t_index_number !< … … 150 148 DO n = 1, number_of_particles 151 149 152 nn = particles(n)%tail_id153 154 150 ! 155 151 !-- Stop if particles have moved further than the length of one … … 171 167 particles(n)%particle_mask = .FALSE. 172 168 deleted_particles = deleted_particles + 1 173 IF ( use_particle_tails .AND. nn /= 0 ) THEN174 tail_mask(nn) = .FALSE.175 deleted_tails = deleted_tails + 1176 ENDIF177 169 ENDIF 178 170 … … 183 175 particles(n)%particle_mask = .FALSE. 184 176 deleted_particles = deleted_particles + 1 185 IF ( use_particle_tails .AND. nn /= 0 ) THEN186 tail_mask(nn) = .FALSE.187 deleted_tails = deleted_tails + 1188 ENDIF189 177 ELSEIF ( ibc_par_t == 2 ) THEN 190 178 ! … … 196 184 particles(n)%rvar3 = -particles(n)%rvar3 197 185 ENDIF 198 IF ( use_particle_tails .AND. nn /= 0 ) THEN199 particle_tail_coordinates(1,3,nn) = 2.0_wp * zu(nz) - &200 particle_tail_coordinates(1,3,nn)201 ENDIF202 186 ENDIF 203 187 ENDIF … … 209 193 particles(n)%particle_mask = .FALSE. 210 194 deleted_particles = deleted_particles + 1 211 IF ( use_particle_tails .AND. nn /= 0 ) THEN212 tail_mask(nn) = .FALSE.213 deleted_tails = deleted_tails + 1214 ENDIF215 195 ELSEIF ( ibc_par_b == 2 ) THEN 216 196 ! … … 221 201 particles(n)%rvar3 < 0.0_wp ) THEN 222 202 particles(n)%rvar3 = -particles(n)%rvar3 223 ENDIF224 IF ( use_particle_tails .AND. nn /= 0 ) THEN225 particle_tail_coordinates(1,3,nn) = 2.0_wp * zu(nz) - &226 particle_tail_coordinates(1,3,nn)227 ENDIF228 IF ( use_particle_tails .AND. nn /= 0 ) THEN229 particle_tail_coordinates(1,3,nn) = 2.0_wp * zw(0) - &230 particle_tail_coordinates(1,3,nn)231 203 ENDIF 232 204 ENDIF -
palm/trunk/SOURCE/lpm_calc_liquid_water_content.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 85 85 INTEGER(iwp) :: k !< 86 86 INTEGER(iwp) :: n !< 87 INTEGER(iwp) :: psi !<88 87 89 88 CALL cpu_log( log_point_s(45), 'lpm_calc_ql', 'start' ) -
palm/trunk/SOURCE/lpm_collision_kernels.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! PALM kernel has been deleted. 22 ! Bugfix in the calculation of the turbulent enhancement factor of the 23 ! collection efficiency. 24 ! 25 ! Unused variables removed. 22 26 ! 23 27 ! Former revisions: … … 96 100 !> This module calculates collision efficiencies either due to pure gravitational 97 101 !> effects (Hall kernel, see Hall, 1980: J. Atmos. Sci., 2486-2507) or 98 !> including the effects of (SGS) turbulence (Wang kernel, see Wang and 99 !> Grabowski, 2009: Atmos. Sci. Lett., 10, 1-8). The original code has been 102 !> including the effects of turbulence (Wang kernel, see Wang and 103 !> Grabowski, 2009: Atmos. Sci. Lett., 10, 1-8, and Ayala et al., 2008: 104 !> New J. Phys., 10, 075016). The original code has been 100 105 !> provided by L.-P. Wang but is substantially reformatted and speed optimized 101 106 !> here. 102 !>103 !> @attention Physical quantities (like g, densities, etc.) used in this module104 !> still have to be adjusted to those values used in the main PALM code.105 !> Also, quantities in CGS-units should be converted to SI-units eventually.106 107 !------------------------------------------------------------------------------! 107 108 MODULE lpm_collision_kernels_mod … … 114 115 115 116 USE particle_attributes, & 116 ONLY: collision_kernel, dissipation_classes, particles, radius_classes 117 ONLY: collision_kernel, dissipation_classes, particles, & 118 radius_classes 117 119 118 120 USE pegrid … … 123 125 PRIVATE 124 126 125 PUBLIC ckernel, collision_efficiency_rogers, init_kernels,&126 r class_lbound, rclass_ubound, recalculate_kernel127 PUBLIC ckernel, init_kernels, rclass_lbound, rclass_ubound, & 128 recalculate_kernel 127 129 128 130 REAL(wp) :: epsilon !< 129 REAL(wp) :: eps2 !<130 131 REAL(wp) :: rclass_lbound !< 131 132 REAL(wp) :: rclass_ubound !< 132 133 REAL(wp) :: urms !< 133 REAL(wp) :: urms2 !< 134 135 REAL(wp), DIMENSION(:), ALLOCATABLE :: epsclass !< 136 REAL(wp), DIMENSION(:), ALLOCATABLE :: radclass !< 137 REAL(wp), DIMENSION(:), ALLOCATABLE :: winf !< 134 135 REAL(wp), DIMENSION(:), ALLOCATABLE :: epsclass !< dissipation rate class 136 REAL(wp), DIMENSION(:), ALLOCATABLE :: radclass !< radius class 137 REAL(wp), DIMENSION(:), ALLOCATABLE :: winf !< 138 138 139 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ec !<140 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ecf !<141 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: gck !<142 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: hkernel !<143 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: hwratio !<139 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ec !< 140 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: ecf !< 141 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: gck !< 142 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: hkernel !< 143 REAL(wp), DIMENSION(:,:), ALLOCATABLE :: hwratio !< 144 144 145 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE 145 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ckernel !< 146 146 147 147 SAVE … … 149 149 ! 150 150 !-- Public interfaces 151 INTERFACE collision_efficiency_rogers152 MODULE PROCEDURE collision_efficiency_rogers153 END INTERFACE collision_efficiency_rogers154 155 151 INTERFACE init_kernels 156 152 MODULE PROCEDURE init_kernels … … 186 182 IF ( collision_kernel(6:9) == 'fast' ) THEN 187 183 188 ALLOCATE( ckernel(1:radius_classes,1:radius_classes, &189 0:dissipation_classes), epsclass(1:dissipation_classes), &184 ALLOCATE( ckernel(1:radius_classes,1:radius_classes, & 185 0:dissipation_classes), epsclass(1:dissipation_classes), & 190 186 radclass(1:radius_classes) ) 191 187 … … 195 191 rclass_lbound = LOG( 1.0E-6_wp ) 196 192 rclass_ubound = LOG( 2.0E-4_wp ) 197 radclass(1) = 1.0E-6_wp193 radclass(1) = EXP( rclass_lbound ) 198 194 DO i = 2, radius_classes 199 195 radclass(i) = EXP( rclass_lbound + & … … 377 373 ! Description: 378 374 ! ------------ 379 !> Calculation of gck 380 !> This is from Aayala 2008b, page 37ff. 381 !> Necessary input parameters: water density, radii of droplets, air density, 382 !> air viscosity, turbulent dissipation rate, taylor microscale reynolds number, 383 !> gravitational acceleration --> to be replaced by PALM parameters 375 !> Calculation of effects of turbulence on the geometric collision kernel 376 !> (by including the droplets' average radial relative velocities and their 377 !> radial distribution function) following the analytic model by Aayala et al. 378 !> (2008, New J. Phys.). For details check the second part 2 of the publication, 379 !> page 37ff. 380 !> 381 !> Input parameters, which need to be replaced by PALM parameters: 382 !> water density, air density 384 383 !------------------------------------------------------------------------------! 385 384 SUBROUTINE turbsd … … 392 391 393 392 IMPLICIT NONE 394 395 LOGICAL, SAVE :: first = .TRUE. !<396 393 397 394 INTEGER(iwp) :: i !< … … 442 439 REAL(wp) :: z !< 443 440 444 REAL(wp), DIMENSION(1:radius_classes) :: st !< 445 REAL(wp), DIMENSION(1:radius_classes) :: tau !< 446 447 ! 448 !-- Initial assignment of constants 449 IF ( first ) THEN 450 451 first = .FALSE. 452 453 ENDIF 454 455 lambda = urms * SQRT( 15.0_wp * molecular_viscosity / epsilon ) ! in m 441 REAL(wp), DIMENSION(1:radius_classes) :: st !< Stokes number 442 REAL(wp), DIMENSION(1:radius_classes) :: tau !< inertial time scale 443 444 lambda = urms * SQRT( 15.0_wp * molecular_viscosity / epsilon ) 456 445 lambda_re = urms**2 * SQRT( 15.0_wp / epsilon / molecular_viscosity ) 457 tl = urms**2 / epsilon ! in s458 lf = 0.5_wp * urms**3 / epsilon ! in m459 tauk = SQRT( molecular_viscosity / epsilon ) ! in s460 eta = ( molecular_viscosity**3 / epsilon )**0.25_wp ! in m446 tl = urms**2 / epsilon 447 lf = 0.5_wp * urms**3 / epsilon 448 tauk = SQRT( molecular_viscosity / epsilon ) 449 eta = ( molecular_viscosity**3 / epsilon )**0.25_wp 461 450 vk = eta / tauk 462 451 463 452 ao = ( 11.0_wp + 7.0_wp * lambda_re ) / ( 205.0_wp + lambda_re ) 464 tt = SQRT( 2.0_wp * lambda_re / ( SQRT( 15.0_wp ) * ao ) ) * tauk ! in s 465 466 CALL fallg ! gives winf in m/s 453 tt = SQRT( 2.0_wp * lambda_re / ( SQRT( 15.0_wp ) * ao ) ) * tauk 454 455 ! 456 !-- Get terminal velocity of droplets 457 CALL fallg 467 458 468 459 DO i = 1, radius_classes 469 tau(i) = winf(i) / g ! in s470 st(i) = tau(i) / tauk 460 tau(i) = winf(i) / g ! inertial time scale 461 st(i) = tau(i) / tauk ! Stokes number 471 462 ENDDO 472 463 473 464 ! 474 !-- Calculate wr (from Aayala 2008b, page 38f)465 !-- Calculate average radial relative velocity at contact (wrfin) 475 466 z = tt / tl 476 467 be = SQRT( 2.0_wp ) * lambda / lf 477 468 bbb = SQRT( 1.0_wp - 2.0_wp * be**2 ) 478 469 d1 = ( 1.0_wp + bbb ) / ( 2.0_wp * bbb ) 479 e1 = lf * ( 1.0_wp + bbb ) * 0.5_wp ! in m470 e1 = lf * ( 1.0_wp + bbb ) * 0.5_wp 480 471 d2 = ( 1.0_wp - bbb ) * 0.5_wp / bbb 481 e2 = lf * ( 1.0_wp - bbb ) * 0.5_wp ! in m472 e2 = lf * ( 1.0_wp - bbb ) * 0.5_wp 482 473 ccc = SQRT( 1.0_wp - 2.0_wp * z**2 ) 483 474 b1 = ( 1.0_wp + ccc ) * 0.5_wp / ccc 484 c1 = tl * ( 1.0_wp + ccc ) * 0.5_wp ! in s475 c1 = tl * ( 1.0_wp + ccc ) * 0.5_wp 485 476 b2 = ( 1.0_wp - ccc ) * 0.5_wp / ccc 486 c2 = tl * ( 1.0_wp - ccc ) * 0.5_wp ! in s477 c2 = tl * ( 1.0_wp - ccc ) * 0.5_wp 487 478 488 479 DO i = 1, radius_classes 489 480 490 v1 = winf(i) ! in m/s491 t1 = tau(i) ! in s481 v1 = winf(i) 482 t1 = tau(i) 492 483 493 484 DO j = 1, i 494 485 rrp = radclass(i) + radclass(j) 495 v2 = winf(j) ! in m/s496 t2 = tau(j) ! in s486 v2 = winf(j) 487 t2 = tau(j) 497 488 498 489 v1xysq = b1 * d1 * phi_w(c1,e1,v1,t1) - b1 * d2 * phi_w(c1,e2,v1,t1) & 499 490 - b2 * d1 * phi_w(c2,e1,v1,t1) + b2 * d2 * phi_w(c2,e2,v1,t1) 500 v1xysq = v1xysq * urms**2 / t1 ! in m**2/s**2501 vrms1xy = SQRT( v1xysq ) ! in m/s491 v1xysq = v1xysq * urms**2 / t1 492 vrms1xy = SQRT( v1xysq ) 502 493 503 494 v2xysq = b1 * d1 * phi_w(c1,e1,v2,t2) - b1 * d2 * phi_w(c1,e2,v2,t2) & 504 495 - b2 * d1 * phi_w(c2,e1,v2,t2) + b2 * d2 * phi_w(c2,e2,v2,t2) 505 v2xysq = v2xysq * urms**2 / t2 ! in m**2/s**2506 vrms2xy = SQRT( v2xysq ) ! in m/s496 v2xysq = v2xysq * urms**2 / t2 497 vrms2xy = SQRT( v2xysq ) 507 498 508 499 IF ( winf(i) >= winf(j) ) THEN … … 523 514 b2 * d2* zhi(c2,e2,v1,t1,v2,t2) 524 515 fr = d1 * EXP( -rrp / e1 ) - d2 * EXP( -rrp / e2 ) 525 v1v2xy = v1v2xy * fr * urms**2 / tau(i) / tau(j) ! in m**2/s**2526 wrtur2xy = vrms1xy**2 + vrms2xy**2 - 2.0_wp * v1v2xy ! in m**2/s**2516 v1v2xy = v1v2xy * fr * urms**2 / tau(i) / tau(j) 517 wrtur2xy = vrms1xy**2 + vrms2xy**2 - 2.0_wp * v1v2xy 527 518 IF ( wrtur2xy < 0.0_wp ) wrtur2xy = 0.0_wp 528 519 wrgrav2 = pi / 8.0_wp * ( winf(j) - winf(i) )**2 529 wrfin = SQRT( ( 2.0_wp / pi ) * ( wrtur2xy + wrgrav2) ) ! in m/s530 531 ! 532 !-- Calculate gr520 wrfin = SQRT( ( 2.0_wp / pi ) * ( wrtur2xy + wrgrav2) ) 521 522 ! 523 !-- Calculate radial distribution function (grfin) 533 524 IF ( st(j) > st(i) ) THEN 534 525 sst = st(j) … … 546 537 ao_gr = ao + ( pi / 8.0_wp) * ( g / vk * tauk )**2 547 538 fao_gr = 20.115_wp * SQRT( ao_gr / lambda_re ) 548 rc = SQRT( fao_gr * ABS( st(j) - st(i) ) ) * eta ! in cm539 rc = SQRT( fao_gr * ABS( st(j) - st(i) ) ) * eta 549 540 550 541 grfin = ( ( eta**2 + rc**2 ) / ( rrp**2 + rc**2) )**( c1_gr*0.5_wp ) 551 542 IF ( grfin < 1.0_wp ) grfin = 1.0_wp 552 543 553 gck(i,j) = 2.0_wp * pi * rrp**2 * wrfin * grfin ! in cm**3/s 544 ! 545 !-- Calculate general collection kernel (without the consideration of 546 !-- collection efficiencies) 547 gck(i,j) = 2.0_wp * pi * rrp**2 * wrfin * grfin 554 548 gck(j,i) = gck(i,j) 555 549 … … 559 553 END SUBROUTINE turbsd 560 554 561 562 !------------------------------------------------------------------------------!563 ! Description:564 ! ------------565 !> phi_w as a function566 !------------------------------------------------------------------------------!567 555 REAL(wp) FUNCTION phi_w( a, b, vsett, tau0 ) 568 556 ! 557 !-- Function used in the Ayala et al. (2008) analytical model for turbulent 558 !-- effects on the collision kernel 569 559 IMPLICIT NONE 570 560 … … 576 566 577 567 aa1 = 1.0_wp / tau0 + 1.0_wp / a + vsett / b 578 phi_w = 1.0_wp / aa1 - 0.5_wp * vsett / b / aa1**2 ! in s568 phi_w = 1.0_wp / aa1 - 0.5_wp * vsett / b / aa1**2 579 569 580 570 END FUNCTION phi_w 581 571 582 583 !------------------------------------------------------------------------------!584 ! Description:585 ! ------------586 !> zhi as a function587 !------------------------------------------------------------------------------!588 572 REAL(wp) FUNCTION zhi( a, b, vsett1, tau1, vsett2, tau2 ) 589 573 ! 574 !-- Function used in the Ayala et al. (2008) analytical model for turbulent 575 !-- effects on the collision kernel 590 576 IMPLICIT NONE 591 577 … … 613 599 b / aa3**2 + ( 4.0_wp / aa4 - 1.0_wp / aa5**2 - 1.0_wp / aa1**2 ) & 614 600 * vsett2 * 0.5_wp / b /aa6 + ( 2.0_wp * ( b / aa2 - b / aa1 ) - & 615 vsett1 / aa2**2 + vsett2 / aa1**2 ) * 0.5_wp / b / aa3 ! in s**2601 vsett1 / aa2**2 + vsett2 / aa1**2 ) * 0.5_wp / b / aa3 616 602 617 603 END FUNCTION zhi … … 621 607 ! Description: 622 608 ! ------------ 623 !> Calculation of terminal velocity winf following Equations 10-138 to 10-145624 !> from (Pruppacher and Klett, 1997)609 !> Parameterization of terminal velocity following Rogers et al. (1993, J. Appl. 610 !> Meteorol.) 625 611 !------------------------------------------------------------------------------! 626 612 SUBROUTINE fallg 627 628 USE cloud_parameters, &629 ONLY: rho_l630 631 USE control_parameters, &632 ONLY: g633 613 634 614 USE particle_attributes, & 635 615 ONLY: radius_classes 636 616 637 638 617 IMPLICIT NONE 639 618 640 INTEGER(iwp) :: i !< 641 INTEGER(iwp) :: j !< 642 643 LOGICAL, SAVE :: first = .TRUE. !< 644 645 REAL(wp), SAVE :: cunh !< 646 REAL(wp), SAVE :: eta !< 647 REAL(wp), SAVE :: phy !< 648 REAL(wp), SAVE :: py !< 649 REAL(wp), SAVE :: rho_a !< 650 REAL(wp), SAVE :: sigma !< 651 REAL(wp), SAVE :: stb !< 652 REAL(wp), SAVE :: stok !< 653 REAL(wp), SAVE :: xlamb !< 654 655 REAL(wp) :: bond !< 656 REAL(wp) :: x !< 657 REAL(wp) :: xrey !< 658 REAL(wp) :: y !< 659 660 REAL(wp), DIMENSION(1:7), SAVE :: b !< 661 REAL(wp), DIMENSION(1:6), SAVE :: c !< 662 663 ! 664 !-- Initial assignment of constants 665 IF ( first ) THEN 666 667 first = .FALSE. 668 b = (/ -0.318657E1_wp, 0.992696E0_wp, -0.153193E-2_wp, & 669 -0.987059E-3_wp, -0.578878E-3_wp, 0.855176E-4_wp, & 670 -0.327815E-5_wp /) 671 c = (/ -0.500015E1_wp, 0.523778E1_wp, -0.204914E1_wp, & 672 0.475294E0_wp, -0.542819E-1_wp, 0.238449E-2_wp /) 673 674 ! 675 !-- Parameter values for p = 1013,25 hPa and T = 293,15 K 676 eta = 1.818E-5_wp ! in kg/(m s) 677 xlamb = 6.6E-8_wp ! in m 678 rho_a = 1.204_wp ! in kg/m**3 679 cunh = 1.26_wp * xlamb ! in m 680 sigma = 0.07363_wp ! in kg/s**2 681 stok = 2.0_wp * g * ( rho_l - rho_a ) / ( 9.0_wp * eta ) ! in 1/(m s) 682 stb = 32.0_wp * rho_a * ( rho_l - rho_a) * g / (3.0_wp * eta * eta) 683 phy = sigma**3 * rho_a**2 / ( eta**4 * g * ( rho_l - rho_a ) ) 684 py = phy**( 1.0_wp / 6.0_wp ) 685 686 ENDIF 619 INTEGER(iwp) :: j !< 620 621 REAL(wp), PARAMETER :: k_cap_rog = 4.0_wp !< parameter 622 REAL(wp), PARAMETER :: k_low_rog = 12.0_wp !< parameter 623 REAL(wp), PARAMETER :: a_rog = 9.65_wp !< parameter 624 REAL(wp), PARAMETER :: b_rog = 10.43_wp !< parameter 625 REAL(wp), PARAMETER :: c_rog = 0.6_wp !< parameter 626 REAL(wp), PARAMETER :: d0_rog = 0.745_wp !< seperation diameter 627 628 REAL(wp) :: diameter !< droplet diameter in mm 629 687 630 688 631 DO j = 1, radius_classes 689 632 690 IF ( radclass(j) <= 1.0E-5_wp ) THEN 691 692 winf(j) = stok * ( radclass(j)**2 + cunh * radclass(j) ) 693 694 ELSEIF ( radclass(j) > 1.0E-5_wp .AND. radclass(j) <= 5.35E-4_wp ) THEN 695 696 x = LOG( stb * radclass(j)**3 ) 697 y = 0.0_wp 698 699 DO i = 1, 7 700 y = y + b(i) * x**(i-1) 701 ENDDO 702 ! 703 !-- Note: this Eq. is wrong in (Pruppacher and Klett, 1997, p. 418) 704 !-- for correct version see (Beard, 1976) 705 xrey = ( 1.0_wp + cunh / radclass(j) ) * EXP( y ) 706 707 winf(j) = xrey * eta / ( 2.0_wp * rho_a * radclass(j) ) 708 709 ELSEIF ( radclass(j) > 5.35E-4_wp ) THEN 710 711 IF ( radclass(j) > 0.0035_wp ) THEN 712 bond = g * ( rho_l - rho_a ) * 0.0035_wp**2 / sigma 713 ELSE 714 bond = g * ( rho_l - rho_a ) * radclass(j)**2 / sigma 715 ENDIF 716 717 x = LOG( 16.0_wp * bond * py / 3.0_wp ) 718 y = 0.0_wp 719 720 DO i = 1, 6 721 y = y + c(i) * x**(i-1) 722 ENDDO 723 724 xrey = py * EXP( y ) 725 726 IF ( radclass(j) > 0.0035_wp ) THEN 727 winf(j) = xrey * eta / ( 2.0_wp * rho_a * 0.0035_wp ) 728 ELSE 729 winf(j) = xrey * eta / ( 2.0_wp * rho_a * radclass(j) ) 730 ENDIF 731 633 diameter = radclass(j) * 2000.0_wp 634 635 IF ( diameter <= d0_rog ) THEN 636 winf(j) = k_cap_rog * diameter * ( 1.0_wp - & 637 EXP( -k_low_rog * diameter ) ) 638 ELSE 639 winf(j) = a_rog - b_rog * EXP( -c_rog * diameter ) 732 640 ENDIF 733 641 … … 740 648 ! Description: 741 649 ! ------------ 742 !> Calculation of collision efficiencies for the Hall kernel650 !> Interpolation of collision efficiencies (Hall, 1980, J. Atmos. Sci.) 743 651 !------------------------------------------------------------------------------! 744 652 SUBROUTINE effic … … 776 684 777 685 first = .FALSE. 778 r0 = (/ 6.0_wp, 8.0_wp, 10.0_wp, 15.0_wp, 20.0_wp, 25.0_wp, &779 30.0_wp, 40.0_wp, 50.0_wp, 60.0_wp, 70.0_wp, 100.0_wp, &686 r0 = (/ 6.0_wp, 8.0_wp, 10.0_wp, 15.0_wp, 20.0_wp, 25.0_wp, & 687 30.0_wp, 40.0_wp, 50.0_wp, 60.0_wp, 70.0_wp, 100.0_wp, & 780 688 150.0_wp, 200.0_wp, 300.0_wp /) 781 689 782 rat = (/ 0.00_wp, 0.05_wp, 0.10_wp, 0.15_wp, 0.20_wp, 0.25_wp, &783 0.30_wp, 0.35_wp, 0.40_wp, 0.45_wp, 0.50_wp, 0.55_wp, &784 0.60_wp, 0.65_wp, 0.70_wp, 0.75_wp, 0.80_wp, 0.85_wp, &690 rat = (/ 0.00_wp, 0.05_wp, 0.10_wp, 0.15_wp, 0.20_wp, 0.25_wp, & 691 0.30_wp, 0.35_wp, 0.40_wp, 0.45_wp, 0.50_wp, 0.55_wp, & 692 0.60_wp, 0.65_wp, 0.70_wp, 0.75_wp, 0.80_wp, 0.85_wp, & 785 693 0.90_wp, 0.95_wp, 1.00_wp /) 786 694 787 ecoll(:,1) = (/ 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, &788 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, &695 ecoll(:,1) = (/ 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, & 696 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, & 789 697 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp, 0.001_wp /) 790 ecoll(:,2) = (/ 0.003_wp, 0.003_wp, 0.003_wp, 0.004_wp, 0.005_wp, &791 0.005_wp, 0.005_wp, 0.010_wp, 0.100_wp, 0.050_wp, &698 ecoll(:,2) = (/ 0.003_wp, 0.003_wp, 0.003_wp, 0.004_wp, 0.005_wp, & 699 0.005_wp, 0.005_wp, 0.010_wp, 0.100_wp, 0.050_wp, & 792 700 0.200_wp, 0.500_wp, 0.770_wp, 0.870_wp, 0.970_wp /) 793 ecoll(:,3) = (/ 0.007_wp, 0.007_wp, 0.007_wp, 0.008_wp, 0.009_wp, &794 0.010_wp, 0.010_wp, 0.070_wp, 0.400_wp, 0.430_wp, &701 ecoll(:,3) = (/ 0.007_wp, 0.007_wp, 0.007_wp, 0.008_wp, 0.009_wp, & 702 0.010_wp, 0.010_wp, 0.070_wp, 0.400_wp, 0.430_wp, & 795 703 0.580_wp, 0.790_wp, 0.930_wp, 0.960_wp, 1.000_wp /) 796 ecoll(:,4) = (/ 0.009_wp, 0.009_wp, 0.009_wp, 0.012_wp, 0.015_wp, &797 0.010_wp, 0.020_wp, 0.280_wp, 0.600_wp, 0.640_wp, &704 ecoll(:,4) = (/ 0.009_wp, 0.009_wp, 0.009_wp, 0.012_wp, 0.015_wp, & 705 0.010_wp, 0.020_wp, 0.280_wp, 0.600_wp, 0.640_wp, & 798 706 0.750_wp, 0.910_wp, 0.970_wp, 0.980_wp, 1.000_wp /) 799 ecoll(:,5) = (/ 0.014_wp, 0.014_wp, 0.014_wp, 0.015_wp, 0.016_wp, &800 0.030_wp, 0.060_wp, 0.500_wp, 0.700_wp, 0.770_wp, &707 ecoll(:,5) = (/ 0.014_wp, 0.014_wp, 0.014_wp, 0.015_wp, 0.016_wp, & 708 0.030_wp, 0.060_wp, 0.500_wp, 0.700_wp, 0.770_wp, & 801 709 0.840_wp, 0.950_wp, 0.970_wp, 1.000_wp, 1.000_wp /) 802 ecoll(:,6) = (/ 0.017_wp, 0.017_wp, 0.017_wp, 0.020_wp, 0.022_wp, &803 0.060_wp, 0.100_wp, 0.620_wp, 0.780_wp, 0.840_wp, &710 ecoll(:,6) = (/ 0.017_wp, 0.017_wp, 0.017_wp, 0.020_wp, 0.022_wp, & 711 0.060_wp, 0.100_wp, 0.620_wp, 0.780_wp, 0.840_wp, & 804 712 0.880_wp, 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 805 ecoll(:,7) = (/ 0.030_wp, 0.030_wp, 0.024_wp, 0.022_wp, 0.032_wp, &806 0.062_wp, 0.200_wp, 0.680_wp, 0.830_wp, 0.870_wp, &713 ecoll(:,7) = (/ 0.030_wp, 0.030_wp, 0.024_wp, 0.022_wp, 0.032_wp, & 714 0.062_wp, 0.200_wp, 0.680_wp, 0.830_wp, 0.870_wp, & 807 715 0.900_wp, 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 808 ecoll(:,8) = (/ 0.025_wp, 0.025_wp, 0.025_wp, 0.036_wp, 0.043_wp, &809 0.130_wp, 0.270_wp, 0.740_wp, 0.860_wp, 0.890_wp, &716 ecoll(:,8) = (/ 0.025_wp, 0.025_wp, 0.025_wp, 0.036_wp, 0.043_wp, & 717 0.130_wp, 0.270_wp, 0.740_wp, 0.860_wp, 0.890_wp, & 810 718 0.920_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 811 ecoll(:,9) = (/ 0.027_wp, 0.027_wp, 0.027_wp, 0.040_wp, 0.052_wp, &812 0.200_wp, 0.400_wp, 0.780_wp, 0.880_wp, 0.900_wp, &719 ecoll(:,9) = (/ 0.027_wp, 0.027_wp, 0.027_wp, 0.040_wp, 0.052_wp, & 720 0.200_wp, 0.400_wp, 0.780_wp, 0.880_wp, 0.900_wp, & 813 721 0.940_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 814 ecoll(:,10) = (/ 0.030_wp, 0.030_wp, 0.030_wp, 0.047_wp, 0.064_wp, &815 0.250_wp, 0.500_wp, 0.800_wp, 0.900_wp, 0.910_wp, &722 ecoll(:,10) = (/ 0.030_wp, 0.030_wp, 0.030_wp, 0.047_wp, 0.064_wp, & 723 0.250_wp, 0.500_wp, 0.800_wp, 0.900_wp, 0.910_wp, & 816 724 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 817 ecoll(:,11) = (/ 0.040_wp, 0.040_wp, 0.033_wp, 0.037_wp, 0.068_wp, &818 0.240_wp, 0.550_wp, 0.800_wp, 0.900_wp, 0.910_wp, &725 ecoll(:,11) = (/ 0.040_wp, 0.040_wp, 0.033_wp, 0.037_wp, 0.068_wp, & 726 0.240_wp, 0.550_wp, 0.800_wp, 0.900_wp, 0.910_wp, & 819 727 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 820 ecoll(:,12) = (/ 0.035_wp, 0.035_wp, 0.035_wp, 0.055_wp, 0.079_wp, &821 0.290_wp, 0.580_wp, 0.800_wp, 0.900_wp, 0.910_wp, &728 ecoll(:,12) = (/ 0.035_wp, 0.035_wp, 0.035_wp, 0.055_wp, 0.079_wp, & 729 0.290_wp, 0.580_wp, 0.800_wp, 0.900_wp, 0.910_wp, & 822 730 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 823 ecoll(:,13) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.062_wp, 0.082_wp, &824 0.290_wp, 0.590_wp, 0.780_wp, 0.900_wp, 0.910_wp, &731 ecoll(:,13) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.062_wp, 0.082_wp, & 732 0.290_wp, 0.590_wp, 0.780_wp, 0.900_wp, 0.910_wp, & 825 733 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 826 ecoll(:,14) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.060_wp, 0.080_wp, &827 0.290_wp, 0.580_wp, 0.770_wp, 0.890_wp, 0.910_wp, &734 ecoll(:,14) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.060_wp, 0.080_wp, & 735 0.290_wp, 0.580_wp, 0.770_wp, 0.890_wp, 0.910_wp, & 828 736 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 829 ecoll(:,15) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.041_wp, 0.075_wp, &830 0.250_wp, 0.540_wp, 0.760_wp, 0.880_wp, 0.920_wp, &737 ecoll(:,15) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.041_wp, 0.075_wp, & 738 0.250_wp, 0.540_wp, 0.760_wp, 0.880_wp, 0.920_wp, & 831 739 0.950_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 832 ecoll(:,16) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.052_wp, 0.067_wp, &833 0.250_wp, 0.510_wp, 0.770_wp, 0.880_wp, 0.930_wp, &740 ecoll(:,16) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.052_wp, 0.067_wp, & 741 0.250_wp, 0.510_wp, 0.770_wp, 0.880_wp, 0.930_wp, & 834 742 0.970_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 835 ecoll(:,17) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.047_wp, 0.057_wp, &836 0.250_wp, 0.490_wp, 0.770_wp, 0.890_wp, 0.950_wp, &743 ecoll(:,17) = (/ 0.037_wp, 0.037_wp, 0.037_wp, 0.047_wp, 0.057_wp, & 744 0.250_wp, 0.490_wp, 0.770_wp, 0.890_wp, 0.950_wp, & 837 745 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp, 1.000_wp /) 838 ecoll(:,18) = (/ 0.036_wp, 0.036_wp, 0.036_wp, 0.042_wp, 0.048_wp, &839 0.230_wp, 0.470_wp, 0.780_wp, 0.920_wp, 1.000_wp, &746 ecoll(:,18) = (/ 0.036_wp, 0.036_wp, 0.036_wp, 0.042_wp, 0.048_wp, & 747 0.230_wp, 0.470_wp, 0.780_wp, 0.920_wp, 1.000_wp, & 840 748 1.020_wp, 1.020_wp, 1.020_wp, 1.020_wp, 1.020_wp /) 841 ecoll(:,19) = (/ 0.040_wp, 0.040_wp, 0.035_wp, 0.033_wp, 0.040_wp, &842 0.112_wp, 0.450_wp, 0.790_wp, 1.010_wp, 1.030_wp, &749 ecoll(:,19) = (/ 0.040_wp, 0.040_wp, 0.035_wp, 0.033_wp, 0.040_wp, & 750 0.112_wp, 0.450_wp, 0.790_wp, 1.010_wp, 1.030_wp, & 843 751 1.040_wp, 1.040_wp, 1.040_wp, 1.040_wp, 1.040_wp /) 844 ecoll(:,20) = (/ 0.033_wp, 0.033_wp, 0.033_wp, 0.033_wp, 0.033_wp, &845 0.119_wp, 0.470_wp, 0.950_wp, 1.300_wp, 1.700_wp, &752 ecoll(:,20) = (/ 0.033_wp, 0.033_wp, 0.033_wp, 0.033_wp, 0.033_wp, & 753 0.119_wp, 0.470_wp, 0.950_wp, 1.300_wp, 1.700_wp, & 846 754 2.300_wp, 2.300_wp, 2.300_wp, 2.300_wp, 2.300_wp /) 847 ecoll(:,21) = (/ 0.027_wp, 0.027_wp, 0.027_wp, 0.027_wp, 0.027_wp, &848 0.125_wp, 0.520_wp, 1.400_wp, 2.300_wp, 3.000_wp, &755 ecoll(:,21) = (/ 0.027_wp, 0.027_wp, 0.027_wp, 0.027_wp, 0.027_wp, & 756 0.125_wp, 0.520_wp, 1.400_wp, 2.300_wp, 3.000_wp, & 849 757 4.000_wp, 4.000_wp, 4.000_wp, 4.000_wp, 4.000_wp /) 850 758 ENDIF … … 852 760 ! 853 761 !-- Calculate the radius class index of particles with respect to array r 854 !-- Radius has to be in µm762 !-- Radius has to be in microns 855 763 ALLOCATE( ira(1:radius_classes) ) 856 764 DO j = 1, radius_classes … … 867 775 ! 868 776 !-- Two-dimensional linear interpolation of the collision efficiency. 869 !-- Radius has to be in µm777 !-- Radius has to be in microns 870 778 DO j = 1, radius_classes 871 779 DO i = 1, j … … 878 786 IF ( ir < 16 ) THEN 879 787 IF ( ir >= 2 ) THEN 880 pp = ( ( MAX( radclass(j),radclass(i)) * 1.0E06_wp ) - r0(ir-1) ) /&881 ( r0(ir) - r0(ir-1) )788 pp = ( ( MAX( radclass(j), radclass(i) ) * 1.0E6_wp ) - & 789 r0(ir-1) ) / ( r0(ir) - r0(ir-1) ) 882 790 qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) ) 883 791 ec(j,i) = ( 1.0_wp - pp ) * ( 1.0_wp - qq ) & … … 911 819 ! Description: 912 820 ! ------------ 913 !> Calculation of enhancement factor for collision efficencies due to turbulence 821 !> Interpolation of turbulent enhancement factor for collision efficencies 822 !> following Wang and Grabowski (2009, Atmos. Sci. Let.) 914 823 !------------------------------------------------------------------------------! 915 824 SUBROUTINE turb_enhance_eff … … 940 849 941 850 REAL(wp), DIMENSION(1:11), SAVE :: rat !< 942 943 851 REAL(wp), DIMENSION(1:7), SAVE :: r0 !< 944 852 … … 958 866 0.7_wp, 0.8_wp, 0.9_wp, 1.0_wp /) 959 867 ! 960 !-- for100 cm**2/s**3868 !-- Tabulated turbulent enhancement factor at 100 cm**2/s**3 961 869 ecoll_100(:,1) = (/ 1.74_wp, 1.74_wp, 1.773_wp, 1.49_wp, & 962 870 1.207_wp, 1.207_wp, 1.0_wp /) … … 979 887 ecoll_100(:,10) = (/ 1.570_wp, 1.570_wp, 1.244_wp, 1.166_wp, & 980 888 1.088_wp, 1.088_wp, 1.0_wp /) 981 ecoll_100(:,11) = (/ 20.3_wp, 20.3_wp, 14.6_wp, 8.61_wp, &889 ecoll_100(:,11) = (/ 20.3_wp, 20.3_wp, 14.6_wp, 8.61_wp, & 982 890 2.60_wp, 2.60_wp, 1.0_wp /) 983 891 ! 984 !-- for400 cm**2/s**3892 !-- Tabulated turbulent enhancement factor at 400 cm**2/s**3 985 893 ecoll_400(:,1) = (/ 4.976_wp, 4.976_wp, 3.593_wp, 2.519_wp, & 986 894 1.445_wp, 1.445_wp, 1.0_wp /) … … 1010 918 ! 1011 919 !-- Calculate the radius class index of particles with respect to array r0 1012 !-- Radius has to be in µm920 !-- The droplet radius has to be given in microns. 1013 921 ALLOCATE( ira(1:radius_classes) ) 1014 922 … … 1025 933 1026 934 ! 1027 !-- Two-dimensional linear interpolation of the collision efficiencies1028 !-- Radius has to be in µm935 !-- Two-dimensional linear interpolation of the turbulent enhancement factor. 936 !-- The droplet radius has to be given in microns. 1029 937 DO j = 1, radius_classes 1030 938 DO i = 1, j … … 1040 948 ENDDO 1041 949 1042 y1 = 0.0001_wp ! for0 m**2/s**3950 y1 = 1.0_wp ! turbulent enhancement factor at 0 m**2/s**3 1043 951 1044 952 IF ( ir < 8 ) THEN 1045 953 IF ( ir >= 2 ) THEN 1046 pp = ( MAX( radclass(j),radclass(i))*1.0E6_wp - r0(ir-1) ) /&1047 ( r0(ir) - r0(ir-1) )954 pp = ( MAX( radclass(j), radclass(i) ) * 1.0E6_wp - & 955 r0(ir-1) ) / ( r0(ir) - r0(ir-1) ) 1048 956 qq = ( rq - rat(iq-1) ) / ( rat(iq) - rat(iq-1) ) 1049 957 y2 = ( 1.0_wp - pp ) * ( 1.0_wp - qq ) * ecoll_100(ir-1,iq-1) + & … … 1066 974 ENDIF 1067 975 ! 1068 !-- Linear interpolation of dissipation rate in m**2/s**3976 !-- Linear interpolation of turbulent enhancement factor 1069 977 IF ( epsilon <= 0.01_wp ) THEN 1070 978 ecf(j,i) = ( epsilon - 0.01_wp ) / ( 0.0_wp - 0.01_wp ) * y1 & … … 1087 995 END SUBROUTINE turb_enhance_eff 1088 996 1089 1090 1091 !------------------------------------------------------------------------------!1092 ! Description:1093 ! ------------1094 !> Collision efficiencies from table 8.2 in Rogers and Yau (1989, 3rd edition).1095 !> Values are calculated from table by bilinear interpolation.1096 !------------------------------------------------------------------------------!1097 1098 SUBROUTINE collision_efficiency_rogers( mean_r, r, e)1099 1100 IMPLICIT NONE1101 1102 INTEGER(iwp) :: i !<1103 INTEGER(iwp) :: j !<1104 INTEGER(iwp) :: k !<1105 1106 LOGICAL, SAVE :: first = .TRUE. !<1107 1108 REAL(wp) :: aa !<1109 REAL(wp) :: bb !<1110 REAL(wp) :: cc !<1111 REAL(wp) :: dd !<1112 REAL(wp) :: dx !<1113 REAL(wp) :: dy !<1114 REAL(wp) :: e !<1115 REAL(wp) :: gg !<1116 REAL(wp) :: mean_r !<1117 REAL(wp) :: mean_rm !<1118 REAL(wp) :: r !<1119 REAL(wp) :: rm !<1120 REAL(wp) :: x !<1121 REAL(wp) :: y !<1122 1123 REAL(wp), DIMENSION(1:9), SAVE :: collected_r = 0.0_wp !<1124 1125 REAL(wp), DIMENSION(1:19), SAVE :: collector_r = 0.0_wp !<1126 1127 REAL(wp), DIMENSION(1:9,1:19), SAVE :: ef = 0.0_wp !<1128 1129 mean_rm = mean_r * 1.0E06_wp1130 rm = r * 1.0E06_wp1131 1132 IF ( first ) THEN1133 1134 collected_r = (/ 2.0_wp, 3.0_wp, 4.0_wp, 6.0_wp, 8.0_wp, &1135 10.0_wp, 15.0_wp, 20.0_wp, 25.0_wp /)1136 collector_r = (/ 10.0_wp, 20.0_wp, 30.0_wp, 40.0_wp, 50.0_wp, &1137 60.0_wp, 80.0_wp, 100.0_wp, 150.0_wp, 200.0_wp, &1138 300.0_wp, 400.0_wp, 500.0_wp, 600.0_wp, 1000.0_wp, &1139 1400.0_wp, 1800.0_wp, 2400.0_wp, 3000.0_wp /)1140 1141 ef(:,1) = (/ 0.017_wp, 0.027_wp, 0.037_wp, 0.052_wp, 0.052_wp, &1142 0.052_wp, 0.052_wp, 0.0_wp, 0.0_wp /)1143 ef(:,2) = (/ 0.001_wp, 0.016_wp, 0.027_wp, 0.060_wp, 0.12_wp, &1144 0.17_wp, 0.17_wp, 0.17_wp, 0.0_wp /)1145 ef(:,3) = (/ 0.001_wp, 0.001_wp, 0.02_wp, 0.13_wp, 0.28_wp, &1146 0.37_wp, 0.54_wp, 0.55_wp, 0.47_wp/)1147 ef(:,4) = (/ 0.001_wp, 0.001_wp, 0.02_wp, 0.23_wp, 0.4_wp, &1148 0.55_wp, 0.7_wp, 0.75_wp, 0.75_wp/)1149 ef(:,5) = (/ 0.01_wp, 0.01_wp, 0.03_wp, 0.3_wp, 0.4_wp, &1150 0.58_wp, 0.73_wp, 0.75_wp, 0.79_wp/)1151 ef(:,6) = (/ 0.01_wp, 0.01_wp, 0.13_wp, 0.38_wp, 0.57_wp, &1152 0.68_wp, 0.80_wp, 0.86_wp, 0.91_wp/)1153 ef(:,7) = (/ 0.01_wp, 0.085_wp, 0.23_wp, 0.52_wp, 0.68_wp, &1154 0.76_wp, 0.86_wp, 0.92_wp, 0.95_wp/)1155 ef(:,8) = (/ 0.01_wp, 0.14_wp, 0.32_wp, 0.60_wp, 0.73_wp, &1156 0.81_wp, 0.90_wp, 0.94_wp, 0.96_wp/)1157 ef(:,9) = (/ 0.025_wp, 0.25_wp, 0.43_wp, 0.66_wp, 0.78_wp, &1158 0.83_wp, 0.92_wp, 0.95_wp, 0.96_wp/)1159 ef(:,10) = (/ 0.039_wp, 0.3_wp, 0.46_wp, 0.69_wp, 0.81_wp, &1160 0.87_wp, 0.93_wp, 0.95_wp, 0.96_wp/)1161 ef(:,11) = (/ 0.095_wp, 0.33_wp, 0.51_wp, 0.72_wp, 0.82_wp, &1162 0.87_wp, 0.93_wp, 0.96_wp, 0.97_wp/)1163 ef(:,12) = (/ 0.098_wp, 0.36_wp, 0.51_wp, 0.73_wp, 0.83_wp, &1164 0.88_wp, 0.93_wp, 0.96_wp, 0.97_wp/)1165 ef(:,13) = (/ 0.1_wp, 0.36_wp, 0.52_wp, 0.74_wp, 0.83_wp, &1166 0.88_wp, 0.93_wp, 0.96_wp, 0.97_wp/)1167 ef(:,14) = (/ 0.17_wp, 0.4_wp, 0.54_wp, 0.72_wp, 0.83_wp, &1168 0.88_wp, 0.94_wp, 0.98_wp, 1.0_wp /)1169 ef(:,15) = (/ 0.15_wp, 0.37_wp, 0.52_wp, 0.74_wp, 0.82_wp, &1170 0.88_wp, 0.94_wp, 0.98_wp, 1.0_wp /)1171 ef(:,16) = (/ 0.11_wp, 0.34_wp, 0.49_wp, 0.71_wp, 0.83_wp, &1172 0.88_wp, 0.94_wp, 0.95_wp, 1.0_wp /)1173 ef(:,17) = (/ 0.08_wp, 0.29_wp, 0.45_wp, 0.68_wp, 0.8_wp, &1174 0.86_wp, 0.96_wp, 0.94_wp, 1.0_wp /)1175 ef(:,18) = (/ 0.04_wp, 0.22_wp, 0.39_wp, 0.62_wp, 0.75_wp, &1176 0.83_wp, 0.92_wp, 0.96_wp, 1.0_wp /)1177 ef(:,19) = (/ 0.02_wp, 0.16_wp, 0.33_wp, 0.55_wp, 0.71_wp, &1178 0.81_wp, 0.90_wp, 0.94_wp, 1.0_wp /)1179 1180 ENDIF1181 1182 DO k = 1, 81183 IF ( collected_r(k) <= mean_rm ) i = k1184 ENDDO1185 1186 DO k = 1, 181187 IF ( collector_r(k) <= rm ) j = k1188 ENDDO1189 1190 IF ( rm < 10.0_wp ) THEN1191 e = 0.0_wp1192 ELSEIF ( mean_rm < 2.0_wp ) THEN1193 e = 0.001_wp1194 ELSEIF ( mean_rm >= 25.0_wp ) THEN1195 IF( j <= 2 ) e = 0.0_wp1196 IF( j == 3 ) e = 0.47_wp1197 IF( j == 4 ) e = 0.8_wp1198 IF( j == 5 ) e = 0.9_wp1199 IF( j >=6 ) e = 1.0_wp1200 ELSEIF ( rm >= 3000.0_wp ) THEN1201 IF( i == 1 ) e = 0.02_wp1202 IF( i == 2 ) e = 0.16_wp1203 IF( i == 3 ) e = 0.33_wp1204 IF( i == 4 ) e = 0.55_wp1205 IF( i == 5 ) e = 0.71_wp1206 IF( i == 6 ) e = 0.81_wp1207 IF( i == 7 ) e = 0.90_wp1208 IF( i >= 8 ) e = 0.94_wp1209 ELSE1210 x = mean_rm - collected_r(i)1211 y = rm - collector_r(j)1212 dx = collected_r(i+1) - collected_r(i)1213 dy = collector_r(j+1) - collector_r(j)1214 aa = x**2 + y**21215 bb = ( dx - x )**2 + y**21216 cc = x**2 + ( dy - y )**21217 dd = ( dx - x )**2 + ( dy - y )**21218 gg = aa + bb + cc + dd1219 1220 e = ( (gg-aa)*ef(i,j) + (gg-bb)*ef(i+1,j) + (gg-cc)*ef(i,j+1) + &1221 (gg-dd)*ef(i+1,j+1) ) / (3.0_wp * gg)1222 ENDIF1223 1224 END SUBROUTINE collision_efficiency_rogers1225 1226 997 END MODULE lpm_collision_kernels_mod -
palm/trunk/SOURCE/lpm_data_output_particles.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Tails removed. Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 58 58 59 59 USE control_parameters, & 60 ONLY: prt_time_count,simulated_time60 ONLY: simulated_time 61 61 62 62 USE cpulog, & … … 68 68 USE kinds 69 69 70 USE netcdf_interface, &71 ONLY: nc_stat72 73 70 USE particle_attributes, & 74 ONLY: grid_particles, maximum_number_of_particles, & 75 maximum_number_of_tailpoints, maximum_number_of_tails, & 76 number_of_particles, number_of_tails, particles, & 77 particle_tail_coordinates, prt_count 71 ONLY: grid_particles, number_of_particles, particles, prt_count 78 72 79 73 IMPLICIT NONE … … 103 97 ENDDO 104 98 ENDDO 105 !106 !-- particle tails currently not available107 ! WRITE ( 85 ) maximum_number_of_tailpoints, maximum_number_of_tails, &108 ! number_of_tails109 ! IF ( maximum_number_of_tails > 0 ) THEN110 ! WRITE ( 85 ) particle_tail_coordinates, prt_time_count111 ! ENDIF112 99 113 100 CALL close_file( 85 ) -
palm/trunk/SOURCE/lpm_droplet_collision.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Integration of a new collision algortithm based on Shima et al. (2009) and 22 ! Soelch and Kaercher (2010) called all_or_nothing. The previous implemented 23 ! collision algorithm is called average_impact. Moreover, both algorithms are 24 ! now positive definit due to their construction, i.e., no negative weighting 25 ! factors should occur. 22 26 ! 23 27 ! Former revisions: … … 63 67 !> Calculates change in droplet radius by collision. Droplet collision is 64 68 !> calculated for each grid box seperately. Collision is parameterized by 65 !> using collision kernels. Three different kernels are available: 66 !> PALM kernel: Kernel is approximated using a method from Rogers and 67 !> Yau (1989, A Short Course in Cloud Physics, Pergamon Press). 68 !> All droplets smaller than the treated one are represented by 69 !> one droplet with mean features. Collision efficiencies are taken 70 !> from the respective table in Rogers and Yau. 69 !> using collision kernels. Two different kernels are available: 71 70 !> Hall kernel: Kernel from Hall (1980, J. Atmos. Sci., 2486-2507), which 72 71 !> considers collision due to pure gravitational effects. … … 85 84 86 85 USE arrays_3d, & 87 ONLY: diss, ql , ql_v, ql_vp, u, v, w, zu, zw86 ONLY: diss, ql_v, ql_vp 88 87 89 88 USE cloud_parameters, & 90 ONLY: effective_coll_efficiency89 ONLY: rho_l 91 90 92 91 USE constants, & … … 94 93 95 94 USE control_parameters, & 96 ONLY: dt_3d, message_string, u_gtrans, v_gtrans,dz95 ONLY: dt_3d, message_string, dz 97 96 98 97 USE cpulog, & … … 100 99 101 100 USE grid_variables, & 102 ONLY: ddx, dx, ddy, dy 103 104 USE indices, & 105 ONLY: nxl, nxr, nyn, nys, nzb, nzt 101 ONLY: dx, dy 106 102 107 103 USE kinds 108 104 109 105 USE lpm_collision_kernels_mod, & 110 ONLY: ckernel, collision_efficiency_rogers,recalculate_kernel106 ONLY: ckernel, recalculate_kernel 111 107 112 108 USE particle_attributes, & 113 ONLY: deleted_particles, dissipation_classes, hall_kernel, & 114 palm_kernel, particles, particle_type, & 115 prt_count, use_kernel_tables, wang_kernel 109 ONLY: all_or_nothing, average_impact, dissipation_classes, & 110 hall_kernel, iran_part, number_of_particles, particles, & 111 particle_type, prt_count, use_kernel_tables, wang_kernel 112 113 USE random_function_mod, & 114 ONLY: random_function 116 115 117 116 USE pegrid … … 121 120 INTEGER(iwp) :: eclass !< 122 121 INTEGER(iwp) :: i !< 123 INTEGER(iwp) :: ii !<124 INTEGER(iwp) :: inc !<125 INTEGER(iwp) :: is !<126 122 INTEGER(iwp) :: j !< 127 INTEGER(iwp) :: jj !<128 INTEGER(iwp) :: js !<129 123 INTEGER(iwp) :: k !< 130 INTEGER(iwp) :: kk !<131 124 INTEGER(iwp) :: n !< 132 INTEGER(iwp) :: pse !< 133 INTEGER(iwp) :: psi !< 125 INTEGER(iwp) :: m !< 134 126 INTEGER(iwp) :: rclass_l !< 135 127 INTEGER(iwp) :: rclass_s !< 136 128 137 INTEGER(iwp), DIMENSION(prt_count(k,j,i)) :: rclass_v !< 138 139 LOGICAL, SAVE :: first_flag = .TRUE. !< 140 141 TYPE(particle_type) :: tmp_particle !< 142 143 REAL(wp) :: aa !< 144 REAL(wp) :: auxn !< temporary variables 145 REAL(wp) :: auxs !< temporary variables 146 REAL(wp) :: bb !< 147 REAL(wp) :: cc !< 148 REAL(wp) :: dd !< 149 REAL(wp) :: ddV !< 150 REAL(wp) :: delta_r !< 151 REAL(wp) :: delta_v !< 152 REAL(wp) :: epsilon !< 153 REAL(wp) :: gg !< 154 REAL(wp) :: mean_r !< 155 REAL(wp) :: ql_int !< 156 REAL(wp) :: ql_int_l !< 157 REAL(wp) :: ql_int_u !< 158 REAL(wp) :: r3 !< 159 REAL(wp) :: sl_r3 !< 160 REAL(wp) :: sl_r4 !< 161 REAL(wp) :: sum1 !< 162 REAL(wp) :: sum2 !< 163 REAL(wp) :: sum3 !< 164 REAL(wp) :: u_int !< 165 REAL(wp) :: u_int_l !< 166 REAL(wp) :: u_int_u !< 167 REAL(wp) :: v_int !< 168 REAL(wp) :: v_int_l !< 169 REAL(wp) :: v_int_u !< 170 REAL(wp) :: w_int !< 171 REAL(wp) :: w_int_l !< 172 REAL(wp) :: w_int_u !< 173 REAL(wp) :: x !< 174 REAL(wp) :: y !< 175 176 REAL(wp), DIMENSION(:), ALLOCATABLE :: rad !< 177 REAL(wp), DIMENSION(:), ALLOCATABLE :: weight !< 178 179 REAL, DIMENSION(prt_count(k,j,i)) :: ck 180 REAL, DIMENSION(prt_count(k,j,i)) :: r3v 181 REAL, DIMENSION(prt_count(k,j,i)) :: sum1v 182 REAL, DIMENSION(prt_count(k,j,i)) :: sum2v 129 REAL(wp) :: collection_probability !< probability for collection 130 REAL(wp) :: ddV !< inverse grid box volume 131 REAL(wp) :: epsilon !< dissipation rate 132 REAL(wp) :: factor_volume_to_mass !< 4.0 / 3.0 * pi * rho_l 133 REAL(wp) :: xm !< mean mass of droplet m 134 REAL(wp) :: xn !< mean mass of droplet n 135 136 REAL(wp), DIMENSION(:), ALLOCATABLE :: weight !< weighting factor 137 REAL(wp), DIMENSION(:), ALLOCATABLE :: mass !< total mass of super droplet 183 138 184 139 CALL cpu_log( log_point_s(43), 'lpm_droplet_coll', 'start' ) 185 140 186 ! 187 !-- Collision requires at least two particles in the box 188 IF ( prt_count(k,j,i) > 1 ) THEN 189 ! 190 !-- First, sort particles within the gridbox by their size, 191 !-- using Shell's method (see Numerical Recipes) 192 !-- NOTE: In case of using particle tails, the re-sorting of 193 !-- ---- tails would have to be included here! 194 IF ( .NOT. ( ( hall_kernel .OR. wang_kernel ) .AND. & 195 use_kernel_tables ) ) THEN 196 psi = 0 197 inc = 1 198 DO WHILE ( inc <= prt_count(k,j,i) ) 199 inc = 3 * inc + 1 200 ENDDO 201 202 DO WHILE ( inc > 1 ) 203 inc = inc / 3 204 DO is = inc+1, prt_count(k,j,i) 205 tmp_particle = particles(psi+is) 206 js = is 207 DO WHILE ( particles(psi+js-inc)%radius > & 208 tmp_particle%radius ) 209 particles(psi+js) = particles(psi+js-inc) 210 js = js - inc 211 IF ( js <= inc ) EXIT 212 ENDDO 213 particles(psi+js) = tmp_particle 214 ENDDO 215 ENDDO 216 ENDIF 217 218 psi = 1 219 pse = prt_count(k,j,i) 141 number_of_particles = prt_count(k,j,i) 142 factor_volume_to_mass = 4.0_wp / 3.0_wp * pi * rho_l 143 ddV = 1 / ( dx * dy * dz ) 144 ! 145 !-- Collision requires at least one super droplet inside the box 146 IF ( number_of_particles > 0 ) THEN 220 147 221 148 ! 222 149 !-- Now apply the different kernels 223 IF ( ( hall_kernel .OR. wang_kernel ) .AND. & 224 use_kernel_tables ) THEN 225 ! 226 !-- Fast method with pre-calculated efficiencies for 150 IF ( use_kernel_tables ) THEN 151 ! 152 !-- Fast method with pre-calculated collection kernels for 227 153 !-- discrete radius- and dissipation-classes. 228 154 !-- … … 244 170 !-- Droplet collision are calculated using collision-coalescence 245 171 !-- formulation proposed by Wang (see PALM documentation) 246 !-- Since new radii after collision are defined by radii of all 247 !-- droplets before collision, temporary fields for new radii and 248 !-- weighting factors are needed 249 ALLOCATE(rad(1:prt_count(k,j,i)), weight(1:prt_count(k,j,i))) 250 251 rad = 0.0_wp 252 weight = 0.0_wp 253 254 sum1v(1:prt_count(k,j,i)) = 0.0_wp 255 sum2v(1:prt_count(k,j,i)) = 0.0_wp 256 257 DO n = 1, prt_count(k,j,i) 258 259 rclass_l = particles(n)%class 260 ! 261 !-- Mass added due to collisions with smaller droplets 262 DO is = n+1, prt_count(k,j,i) 263 rclass_s = particles(is)%class 264 auxs = ckernel(rclass_l,rclass_s,eclass) * particles(is)%weight_factor 265 auxn = ckernel(rclass_s,rclass_l,eclass) * particles(n)%weight_factor 266 IF ( particles(is)%radius < particles(n)%radius ) THEN 267 sum1v(n) = sum1v(n) + particles(is)%radius**3 * auxs 268 sum2v(is) = sum2v(is) + auxn 269 ELSE 270 sum2v(n) = sum2v(n) + auxs 271 sum1v(is) = sum1v(is) + particles(n)%radius**3 * auxn 272 ENDIF 172 !-- Temporary fields for total mass of super-droplet and weighting factors 173 !-- are allocated. 174 ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) 175 176 mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & 177 particles(1:number_of_particles)%radius**3 * & 178 factor_volume_to_mass 179 weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor 180 181 IF ( average_impact ) THEN ! select collision algorithm 182 183 DO n = 1, number_of_particles 184 185 rclass_l = particles(n)%class 186 xn = mass(n) / weight(n) 187 188 DO m = n, number_of_particles 189 190 rclass_s = particles(m)%class 191 xm = mass(m) / weight(m) 192 193 IF ( xm .LT. xn ) THEN 194 195 ! 196 !-- Particle n collects smaller particle m 197 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 198 weight(n) * ddV * dt_3d 199 200 mass(n) = mass(n) + mass(m) * collection_probability 201 weight(m) = weight(m) - weight(m) * collection_probability 202 mass(m) = mass(m) - mass(m) * collection_probability 203 ELSEIF ( xm .GT. xn ) THEN 204 ! 205 !-- Particle m collects smaller particle n 206 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 207 weight(m) * ddV * dt_3d 208 209 mass(m) = mass(m) + mass(n) * collection_probability 210 weight(n) = weight(n) - weight(n) * collection_probability 211 mass(n) = mass(n) - mass(n) * collection_probability 212 ELSE 213 ! 214 !-- Same-size collections. If n = m, weight is reduced by the 215 !-- number of possible same-size collections; the total mass 216 !-- is not changed during same-size collection. 217 !-- Same-size collections of different 218 !-- particles ( n /= m ) are treated as same-size collections 219 !-- of ONE partilce with weight = weight(n) + weight(m) and 220 !-- mass = mass(n) + mass(m). 221 !-- Accordingly, each particle loses the same number of 222 !-- droplets to the other particle, but this has no effect on 223 !-- total mass mass, since the exchanged droplets have the 224 !-- same radius. 225 226 !-- Note: For m = n this equation is an approximation only 227 !-- valid for weight >> 1 (which is usually the case). The 228 !-- approximation is weight(n)-1 = weight(n). 229 weight(n) = weight(n) - 0.5_wp * weight(n) * & 230 ckernel(rclass_l,rclass_s,eclass) * & 231 weight(m) * ddV * dt_3d 232 IF ( n .NE. m ) THEN 233 weight(m) = weight(m) - 0.5_wp * weight(m) * & 234 ckernel(rclass_l,rclass_s,eclass) * & 235 weight(n) * ddV * dt_3d 236 ENDIF 237 ENDIF 238 239 ENDDO 240 241 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 242 273 243 ENDDO 274 ENDDO 275 rclass_v = particles(1:prt_count(k,j,i))%class 276 DO n = 1, prt_count(k,j,i) 277 ck(n) = ckernel(rclass_v(n),rclass_v(n),eclass) 278 ENDDO 279 r3v = particles(1:prt_count(k,j,i))%radius**3 280 DO n = 1, prt_count(k,j,i) 281 sum3 = 0.0_wp 282 ddV = ddx * ddy / dz 283 ! 284 !-- Change of the current weighting factor 285 sum3 = 1 - dt_3d * ddV * & 286 ck(n) * & 287 ( particles(n)%weight_factor - 1 ) * 0.5_wp - & 288 dt_3d * ddV * sum2v(n) 289 weight(n) = particles(n)%weight_factor * sum3 290 ! 291 !-- Change of the current droplet radius 292 rad(n) = ( (r3v(n) + dt_3d * ddV * (sum1v(n) - sum2v(n) * r3v(n)) )/& 293 sum3 )**0.33333333333333_wp 294 295 ql_vp(k,j,i) = ql_vp(k,j,i) + weight(n) & 296 * rad(n)**3 297 298 ENDDO 244 245 ELSEIF ( all_or_nothing ) THEN ! select collision algorithm 246 247 DO n = 1, number_of_particles 248 249 rclass_l = particles(n)%class 250 xn = mass(n) / weight(n) ! mean mass of droplet n 251 252 DO m = n, number_of_particles 253 254 rclass_s = particles(m)%class 255 xm = mass(m) / weight(m) ! mean mass of droplet m 256 257 IF ( weight(n) .LT. weight(m) ) THEN 258 ! 259 !-- Particle n collects weight(n) droplets of particle m 260 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 261 weight(m) * ddV * dt_3d 262 263 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 264 mass(n) = mass(n) + weight(n) * xm 265 weight(m) = weight(m) - weight(n) 266 mass(m) = mass(m) - weight(n) * xm 267 ENDIF 268 269 ELSEIF ( weight(m) .LT. weight(n) ) THEN 270 ! 271 !-- Particle m collects weight(m) droplets of particle n 272 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 273 weight(n) * ddV * dt_3d 274 275 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 276 mass(m) = mass(m) + weight(m) * xn 277 weight(n) = weight(n) - weight(m) 278 mass(n) = mass(n) - weight(m) * xn 279 ENDIF 280 ELSE 281 ! 282 !-- Collisions of particles of the same weighting factor. 283 !-- Particle n collects 1/2 weight(n) droplets of particle m, 284 !-- particle m collects 1/2 weight(m) droplets of particle n. 285 !-- The total mass mass changes accordingly. 286 !-- If n = m, the first half of the droplets coalesces with the 287 !-- second half of the droplets; mass is unchanged because 288 !-- xm = xn for n = m. 289 290 !-- Note: For m = n this equation is an approximation only 291 !-- valid for weight >> 1 (which is usually the case). The 292 !-- approximation is weight(n)-1 = weight(n). 293 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 294 weight(n) * ddV * dt_3d 295 296 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 297 mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) 298 mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) 299 weight(n) = weight(n) - 0.5_wp * weight(m) 300 weight(m) = weight(n) 301 ENDIF 302 ENDIF 303 304 ENDDO 305 306 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 307 308 ENDDO 309 310 ENDIF 311 312 313 314 299 315 IF ( ANY(weight < 0.0_wp) ) THEN 300 316 WRITE( message_string, * ) 'negative weighting' … … 303 319 ENDIF 304 320 305 particles(psi:pse)%radius = rad(1:prt_count(k,j,i)) 306 particles(psi:pse)%weight_factor = weight(1:prt_count(k,j,i)) 307 308 DEALLOCATE(rad, weight) 309 310 ELSEIF ( ( hall_kernel .OR. wang_kernel ) .AND. & 311 .NOT. use_kernel_tables ) THEN 312 ! 313 !-- Collision efficiencies are calculated for every new 321 particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & 322 ( weight(1:number_of_particles) & 323 * factor_volume_to_mass & 324 ) & 325 )**0.33333333333333_wp 326 327 particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) 328 329 DEALLOCATE(weight, mass) 330 331 ELSEIF ( .NOT. use_kernel_tables ) THEN 332 ! 333 !-- Collection kernels are calculated for every new 314 334 !-- grid box. First, allocate memory for kernel table. 315 335 !-- Third dimension is 1, because table is re-calculated for 316 336 !-- every new dissipation value. 317 ALLOCATE( ckernel(1:prt_count(k,j,i),1:prt_count(k,j,i),1:1) ) 318 ! 319 !-- Now calculate collision efficiencies for this box 337 ALLOCATE( ckernel(1:number_of_particles,1:number_of_particles,1:1) ) 338 ! 339 !-- Now calculate collection kernel for this box. Note that 340 !-- the kernel is based on the previous time step 320 341 CALL recalculate_kernel( i, j, k ) 321 322 342 ! 323 343 !-- Droplet collision are calculated using collision-coalescence 324 344 !-- formulation proposed by Wang (see PALM documentation) 325 !-- Since new radii after collision are defined by radii of all 326 !-- droplets before collision, temporary fields for new radii and 327 !-- weighting factors are needed 328 ALLOCATE(rad(1:prt_count(k,j,i)), weight(1:prt_count(k,j,i))) 329 330 rad = 0.0_wp 331 weight = 0.0_wp 332 333 DO n = psi, pse, 1 334 335 sum1 = 0.0_wp 336 sum2 = 0.0_wp 337 sum3 = 0.0_wp 338 ! 339 !-- Mass added due to collisions with smaller droplets 340 DO is = psi, n-1 341 sum1 = sum1 + ( particles(is)%radius**3 * & 342 ckernel(n,is,1) * & 343 particles(is)%weight_factor ) 345 !-- Temporary fields for total mass of super-droplet and weighting factors 346 !-- are allocated. 347 ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) 348 349 mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & 350 particles(1:number_of_particles)%radius**3 * & 351 factor_volume_to_mass 352 353 weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor 354 355 IF ( average_impact ) THEN ! select collision algorithm 356 357 DO n = 1, number_of_particles 358 359 xn = mass(n) / weight(n) ! mean mass of droplet n 360 361 DO m = n, number_of_particles 362 363 xm = mass(m) / weight(m) !mean mass of droplet m 364 365 IF ( xm .LT. xn ) THEN 366 ! 367 !-- Particle n collects smaller particle m 368 collection_probability = ckernel(n,m,1) * weight(n) * & 369 ddV * dt_3d 370 371 mass(n) = mass(n) + mass(m) * collection_probability 372 weight(m) = weight(m) - weight(m) * collection_probability 373 mass(m) = mass(m) - mass(m) * collection_probability 374 ELSEIF ( xm .GT. xn ) THEN 375 ! 376 !-- Particle m collects smaller particle n 377 collection_probability = ckernel(n,m,1) * weight(m) * & 378 ddV * dt_3d 379 380 mass(m) = mass(m) + mass(n) * collection_probability 381 weight(n) = weight(n) - weight(n) * collection_probability 382 mass(n) = mass(n) - mass(n) * collection_probability 383 ELSE 384 ! 385 !-- Same-size collections. If n = m, weight is reduced by the 386 !-- number of possible same-size collections; the total mass 387 !-- mass is not changed during same-size collection. 388 !-- Same-size collections of different 389 !-- particles ( n /= m ) are treated as same-size collections 390 !-- of ONE partilce with weight = weight(n) + weight(m) and 391 !-- mass = mass(n) + mass(m). 392 !-- Accordingly, each particle loses the same number of 393 !-- droplets to the other particle, but this has no effect on 394 !-- total mass mass, since the exchanged droplets have the 395 !-- same radius. 396 !-- 397 !-- Note: For m = n this equation is an approximation only 398 !-- valid for weight >> 1 (which is usually the case). The 399 !-- approximation is weight(n)-1 = weight(n). 400 weight(n) = weight(n) - 0.5_wp * weight(n) * & 401 ckernel(n,m,1) * weight(m) * & 402 ddV * dt_3d 403 IF ( n .NE. m ) THEN 404 weight(m) = weight(m) - 0.5_wp * weight(m) * & 405 ckernel(n,m,1) * weight(n) * & 406 ddV * dt_3d 407 ENDIF 408 ENDIF 409 410 411 ENDDO 412 413 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 414 344 415 ENDDO 345 ! 346 !-- Rate of collisions with larger droplets 347 DO is = n+1, pse 348 sum2 = sum2 + ( ckernel(n,is,1) * & 349 particles(is)%weight_factor ) 416 417 ELSEIF ( all_or_nothing ) THEN ! select collision algorithm 418 419 DO n = 1, number_of_particles 420 421 xn = mass(n) / weight(n) ! mean mass of droplet n 422 423 DO m = n, number_of_particles 424 425 xm = mass(m) / weight(m) !mean mass of droplet m 426 427 IF ( weight(n) .LT. weight(m) ) THEN 428 ! 429 !-- Particle n collects smaller particle m 430 collection_probability = ckernel(n,m,1) * weight(m) * & 431 ddV * dt_3d 432 433 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 434 mass(n) = mass(n) + weight(n) * xm 435 weight(m) = weight(m) - weight(n) 436 mass(m) = mass(m) - weight(n) * xm 437 ENDIF 438 439 ELSEIF ( weight(m) .LT. weight(n) ) THEN 440 ! 441 !-- Particle m collects smaller particle n 442 collection_probability = ckernel(n,m,1) * weight(n) * & 443 ddV * dt_3d 444 445 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 446 mass(m) = mass(m) + weight(m) * xn 447 weight(n) = weight(n) - weight(m) 448 mass(n) = mass(n) - weight(m) * xn 449 ENDIF 450 ELSE 451 ! 452 !-- Collisions of particles of the same weighting factor. 453 !-- Particle n collects 1/2 weight(n) droplets of particle m, 454 !-- particle m collects 1/2 weight(m) droplets of particle n. 455 !-- The total mass mass changes accordingly. 456 !-- If n = m, the first half of the droplets coalesces with the 457 !-- second half of the droplets; mass is unchanged because 458 !-- xm = xn for n = m. 459 !-- 460 !-- Note: For m = n this equation is an approximation only 461 !-- valid for weight >> 1 (which is usually the case). The 462 !-- approximation is weight(n)-1 = weight(n). 463 collection_probability = ckernel(n,m,1) * weight(n) * & 464 ddV * dt_3d 465 466 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 467 mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) 468 mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) 469 weight(n) = weight(n) - 0.5_wp * weight(m) 470 weight(m) = weight(n) 471 ENDIF 472 ENDIF 473 474 475 ENDDO 476 477 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 478 350 479 ENDDO 351 480 352 r3 = particles(n)%radius**3 353 ddV = ddx * ddy / dz 354 is = 1 355 ! 356 !-- Change of the current weighting factor 357 sum3 = 1 - dt_3d * ddV * & 358 ckernel(n,n,1) * & 359 ( particles(n)%weight_factor - 1 ) * 0.5_wp - & 360 dt_3d * ddV * sum2 361 weight(n-is+1) = particles(n)%weight_factor * sum3 362 ! 363 !-- Change of the current droplet radius 364 rad(n-is+1) = ( (r3 + dt_3d * ddV * (sum1 - sum2 * r3) )/& 365 sum3 )**0.33333333333333_wp 366 367 IF ( weight(n-is+1) < 0.0_wp ) THEN 368 WRITE( message_string, * ) 'negative weighting', & 369 'factor: ', weight(n-is+1) 370 CALL message( 'lpm_droplet_collision', 'PA0037', & 481 ENDIF 482 483 IF ( ANY(weight < 0.0_wp) ) THEN 484 WRITE( message_string, * ) 'negative weighting' 485 CALL message( 'lpm_droplet_collision', 'PA0028', & 371 486 2, 2, -1, 6, 1 ) 372 ENDIF373 374 ql_vp(k,j,i) = ql_vp(k,j,i) + weight(n-is+1) &375 * rad(n-is+1)**3376 377 ENDDO378 379 particles(psi:pse)%radius = rad(1:prt_count(k,j,i))380 particles(psi:pse)%weight_factor = weight(1:prt_count(k,j,i))381 382 DEALLOCATE( rad, weight, ckernel )383 384 ELSEIF ( palm_kernel ) THEN385 !386 !-- PALM collision kernel387 !388 !-- Calculate the mean radius of all those particles which389 !-- are of smaller size than the current particle and390 !-- use this radius for calculating the collision efficiency391 DO n = psi+prt_count(k,j,i)-1, psi+1, -1392 393 sl_r3 = 0.0_wp394 sl_r4 = 0.0_wp395 396 DO is = n-1, psi, -1397 IF ( particles(is)%radius < particles(n)%radius ) &398 THEN399 sl_r3 = sl_r3 + particles(is)%weight_factor &400 * particles(is)%radius**3401 sl_r4 = sl_r4 + particles(is)%weight_factor &402 * particles(is)%radius**4403 ENDIF404 ENDDO405 406 IF ( ( sl_r3 ) > 0.0_wp ) THEN407 mean_r = ( sl_r4 ) / ( sl_r3 )408 409 CALL collision_efficiency_rogers( mean_r, &410 particles(n)%radius, &411 effective_coll_efficiency )412 413 ELSE414 effective_coll_efficiency = 0.0_wp415 ENDIF416 417 IF ( effective_coll_efficiency > 1.0_wp .OR. &418 effective_coll_efficiency < 0.0_wp ) &419 THEN420 WRITE( message_string, * ) 'collision_efficien' , &421 'cy out of range:' ,effective_coll_efficiency422 CALL message( 'lpm_droplet_collision', 'PA0145', 2, &423 2, -1, 6, 1 )424 ENDIF425 426 !427 !-- Interpolation of liquid water content428 ii = particles(n)%x * ddx429 jj = particles(n)%y * ddy430 kk = ( particles(n)%z + 0.5_wp * dz ) / dz431 432 x = particles(n)%x - ii * dx433 y = particles(n)%y - jj * dy434 aa = x**2 + y**2435 bb = ( dx - x )**2 + y**2436 cc = x**2 + ( dy - y )**2437 dd = ( dx - x )**2 + ( dy - y )**2438 gg = aa + bb + cc + dd439 440 ql_int_l = ( (gg-aa) * ql(kk,jj,ii) + (gg-bb) * &441 ql(kk,jj,ii+1) &442 + (gg-cc) * ql(kk,jj+1,ii) + ( gg-dd ) * &443 ql(kk,jj+1,ii+1) &444 ) / ( 3.0_wp * gg )445 446 ql_int_u = ( (gg-aa) * ql(kk+1,jj,ii) + (gg-bb) * &447 ql(kk+1,jj,ii+1) &448 + (gg-cc) * ql(kk+1,jj+1,ii) + (gg-dd) * &449 ql(kk+1,jj+1,ii+1) &450 ) / ( 3.0_wp * gg )451 452 ql_int = ql_int_l + ( particles(n)%z - zu(kk) ) / dz *&453 ( ql_int_u - ql_int_l )454 455 !456 !-- Interpolate u velocity-component457 ii = ( particles(n)%x + 0.5_wp * dx ) * ddx458 jj = particles(n)%y * ddy459 kk = ( particles(n)%z + 0.5_wp * dz ) / dz ! only if equidistant460 461 IF ( ( particles(n)%z - zu(kk) ) > ( 0.5_wp * dz ) ) kk = kk+1462 463 x = particles(n)%x + ( 0.5_wp - ii ) * dx464 y = particles(n)%y - jj * dy465 aa = x**2 + y**2466 bb = ( dx - x )**2 + y**2467 cc = x**2 + ( dy - y )**2468 dd = ( dx - x )**2 + ( dy - y )**2469 gg = aa + bb + cc + dd470 471 u_int_l = ( (gg-aa) * u(kk,jj,ii) + (gg-bb) * &472 u(kk,jj,ii+1) &473 + (gg-cc) * u(kk,jj+1,ii) + (gg-dd) * &474 u(kk,jj+1,ii+1) &475 ) / ( 3.0_wp * gg ) - u_gtrans476 IF ( kk+1 == nzt+1 ) THEN477 u_int = u_int_l478 ELSE479 u_int_u = ( (gg-aa) * u(kk+1,jj,ii) + (gg-bb) * &480 u(kk+1,jj,ii+1) &481 + (gg-cc) * u(kk+1,jj+1,ii) + (gg-dd) * &482 u(kk+1,jj+1,ii+1) &483 ) / ( 3.0_wp * gg ) - u_gtrans484 u_int = u_int_l + ( particles(n)%z - zu(kk) ) / dz &485 * ( u_int_u - u_int_l )486 ENDIF487 488 !489 !-- Same procedure for interpolation of the v velocity-component490 !-- (adopt index k from u velocity-component)491 ii = particles(n)%x * ddx492 jj = ( particles(n)%y + 0.5_wp * dy ) * ddy493 494 x = particles(n)%x - ii * dx495 y = particles(n)%y + ( 0.5_wp - jj ) * dy496 aa = x**2 + y**2497 bb = ( dx - x )**2 + y**2498 cc = x**2 + ( dy - y )**2499 dd = ( dx - x )**2 + ( dy - y )**2500 gg = aa + bb + cc + dd501 502 v_int_l = ( ( gg-aa ) * v(kk,jj,ii) + ( gg-bb ) * &503 v(kk,jj,ii+1) &504 + ( gg-cc ) * v(kk,jj+1,ii) + ( gg-dd ) * &505 v(kk,jj+1,ii+1) &506 ) / ( 3.0_wp * gg ) - v_gtrans507 IF ( kk+1 == nzt+1 ) THEN508 v_int = v_int_l509 ELSE510 v_int_u = ( (gg-aa) * v(kk+1,jj,ii) + (gg-bb) * &511 v(kk+1,jj,ii+1) &512 + (gg-cc) * v(kk+1,jj+1,ii) + (gg-dd) * &513 v(kk+1,jj+1,ii+1) &514 ) / ( 3.0_wp * gg ) - v_gtrans515 v_int = v_int_l + ( particles(n)%z - zu(kk) ) / dz &516 * ( v_int_u - v_int_l )517 ENDIF518 519 !520 !-- Same procedure for interpolation of the w velocity-component521 !-- (adopt index i from v velocity-component)522 jj = particles(n)%y * ddy523 kk = particles(n)%z / dz524 525 x = particles(n)%x - ii * dx526 y = particles(n)%y - jj * dy527 aa = x**2 + y**2528 bb = ( dx - x )**2 + y**2529 cc = x**2 + ( dy - y )**2530 dd = ( dx - x )**2 + ( dy - y )**2531 gg = aa + bb + cc + dd532 533 w_int_l = ( ( gg-aa ) * w(kk,jj,ii) + ( gg-bb ) * &534 w(kk,jj,ii+1) &535 + ( gg-cc ) * w(kk,jj+1,ii) + ( gg-dd ) * &536 w(kk,jj+1,ii+1) &537 ) / ( 3.0_wp * gg )538 IF ( kk+1 == nzt+1 ) THEN539 w_int = w_int_l540 ELSE541 w_int_u = ( (gg-aa) * w(kk+1,jj,ii) + (gg-bb) * &542 w(kk+1,jj,ii+1) &543 + (gg-cc) * w(kk+1,jj+1,ii) + (gg-dd) * &544 w(kk+1,jj+1,ii+1) &545 ) / ( 3.0_wp * gg )546 w_int = w_int_l + ( particles(n)%z - zw(kk) ) / dz &547 * ( w_int_u - w_int_l )548 ENDIF549 550 !551 !-- Change in radius due to collision552 delta_r = effective_coll_efficiency / 3.0_wp &553 * pi * sl_r3 * ddx * ddy / dz &554 * SQRT( ( u_int - particles(n)%speed_x )**2 &555 + ( v_int - particles(n)%speed_y )**2 &556 + ( w_int - particles(n)%speed_z )**2 &557 ) * dt_3d558 !559 !-- Change in volume due to collision560 delta_v = particles(n)%weight_factor &561 * ( ( particles(n)%radius + delta_r )**3 &562 - particles(n)%radius**3 )563 564 !565 !-- Check if collected particles provide enough LWC for566 !-- volume change of collector particle567 IF ( delta_v >= sl_r3 .AND. sl_r3 > 0.0_wp ) THEN568 569 delta_r = ( ( sl_r3/particles(n)%weight_factor ) &570 + particles(n)%radius**3 )**( 1.0_wp / 3.0_wp ) &571 - particles(n)%radius572 573 DO is = n-1, psi, -1574 IF ( particles(is)%radius < particles(n)%radius ) THEN575 particles(is)%weight_factor = 0.0_wp576 particles(is)%particle_mask = .FALSE.577 deleted_particles = deleted_particles + 1578 ENDIF579 ENDDO580 581 ELSE IF ( delta_v < sl_r3 .AND. sl_r3 > 0.0_wp ) THEN582 583 DO is = n-1, psi, -1584 IF ( particles(is)%radius < particles(n)%radius &585 .AND. sl_r3 > 0.0_wp ) THEN586 particles(is)%weight_factor = &587 ( ( particles(is)%weight_factor &588 * ( particles(is)%radius**3 ) ) &589 - ( delta_v &590 * particles(is)%weight_factor &591 * ( particles(is)%radius**3 ) &592 / sl_r3 ) ) &593 / ( particles(is)%radius**3 )594 595 IF ( particles(is)%weight_factor < 0.0_wp ) THEN596 WRITE( message_string, * ) 'negative ', &597 'weighting factor: ', &598 particles(is)%weight_factor599 CALL message( 'lpm_droplet_collision', &600 'PA0039', &601 2, 2, -1, 6, 1 )602 ENDIF603 ENDIF604 ENDDO605 606 ENDIF607 608 particles(n)%radius = particles(n)%radius + delta_r609 ql_vp(k,j,i) = ql_vp(k,j,i) + &610 particles(n)%weight_factor * &611 ( particles(n)%radius**3 )612 ENDDO613 614 ql_vp(k,j,i) = ql_vp(k,j,i) + particles(psi)%weight_factor &615 * particles(psi)%radius**3616 617 ENDIF ! collision kernel618 619 ELSE IF ( prt_count(k,j,i) == 1 ) THEN620 621 psi = 1622 623 !624 !-- Calculate change of weighting factor due to self collision625 IF ( ( hall_kernel .OR. wang_kernel ) .AND. &626 use_kernel_tables ) THEN627 628 IF ( wang_kernel ) THEN629 eclass = INT( diss(k,j,i) * 1.0E4_wp / 1000.0_wp * &630 dissipation_classes ) + 1631 epsilon = diss(k,j,i)632 ELSE633 epsilon = 0.0_wp634 487 ENDIF 635 IF ( hall_kernel .OR. epsilon * 1.0E4_wp < 0.001_wp ) THEN 636 eclass = 0 ! Hall kernel is used 637 ELSE 638 eclass = MIN( dissipation_classes, eclass ) 639 ENDIF 640 641 ddV = ddx * ddy / dz 642 rclass_l = particles(psi)%class 643 sum3 = 1 - dt_3d * ddV * & 644 ( ckernel(rclass_l,rclass_l,eclass) * & 645 ( particles(psi)%weight_factor-1 ) * 0.5_wp ) 646 647 particles(psi)%radius = ( particles(psi)%radius**3 / & 648 sum3 )**0.33333333333333_wp 649 particles(psi)%weight_factor = particles(psi)%weight_factor & 650 * sum3 651 652 ELSE IF ( ( hall_kernel .OR. wang_kernel ) .AND. & 653 .NOT. use_kernel_tables ) THEN 654 ! 655 !-- Collision efficiencies are calculated for every new 656 !-- grid box. First, allocate memory for kernel table. 657 !-- Third dimension is 1, because table is re-calculated for 658 !-- every new dissipation value. 659 ALLOCATE( ckernel(psi:psi, psi:psi, 1:1) ) 660 ! 661 !-- Now calculate collision efficiencies for this box 662 CALL recalculate_kernel( i, j, k ) 663 664 ddV = ddx * ddy / dz 665 sum3 = 1 - dt_3d * ddV * ( ckernel(psi,psi,1) * & 666 ( particles(psi)%weight_factor - 1 ) * 0.5_wp ) 667 668 particles(psi)%radius = ( particles(psi)%radius**3 / & 669 sum3 )**0.33333333333333_wp 670 particles(psi)%weight_factor = particles(psi)%weight_factor & 671 * sum3 672 673 DEALLOCATE( ckernel ) 674 ENDIF 675 676 ql_vp(k,j,i) = particles(psi)%weight_factor * & 677 particles(psi)%radius**3 488 489 particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & 490 ( weight(1:number_of_particles) & 491 * factor_volume_to_mass & 492 ) & 493 )**0.33333333333333_wp 494 495 particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) 496 497 DEALLOCATE( weight, mass, ckernel ) 498 499 ENDIF 500 678 501 ENDIF 679 680 ! 681 !-- Check if condensation of LWC was conserved during collision process 502 503 504 ! 505 !-- Check if LWC is conserved during collision process 682 506 IF ( ql_v(k,j,i) /= 0.0_wp ) THEN 683 IF ( ql_vp(k,j,i) / ql_v(k,j,i) >= 1.0001_wp .OR. &507 IF ( ql_vp(k,j,i) / ql_v(k,j,i) >= 1.0001_wp .OR. & 684 508 ql_vp(k,j,i) / ql_v(k,j,i) <= 0.9999_wp ) THEN 685 WRITE( message_string, * ) 'LWC is not conserved during',& 686 ' collision! ', & 687 'LWC after condensation: ', & 688 ql_v(k,j,i), & 689 ' LWC after collision: ', & 690 ql_vp(k,j,i) 691 CALL message( 'lpm_droplet_collision', 'PA0040', & 692 2, 2, -1, 6, 1 ) 509 WRITE( message_string, * ) ' LWC is not conserved during', & 510 ' collision! ', & 511 ' LWC after condensation: ', ql_v(k,j,i), & 512 ' LWC after collision: ', ql_vp(k,j,i) 513 CALL message( 'lpm_droplet_collision', 'PA0040', 2, 2, -1, 6, 1 ) 693 514 ENDIF 694 515 ENDIF -
palm/trunk/SOURCE/lpm_droplet_condensation.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 87 87 88 88 USE cloud_parameters, & 89 ONLY: bfactor, curvature_solution_effects, diff_coeff_l,&90 eps_ros, l_d_rv, l_v, rho_l, r_v, thermal_conductivity_l89 ONLY: bfactor, curvature_solution_effects, eps_ros, l_d_rv, l_v, & 90 rho_l, r_v 91 91 92 92 USE constants, & … … 94 94 95 95 USE control_parameters, & 96 ONLY: atmos_ocean_sign, dt_3d, dz, message_string, &97 molecular_viscosity, rho_surface 96 ONLY: dt_3d, dz, message_string, molecular_viscosity, rho_surface 97 98 98 USE cpulog, & 99 99 ONLY: cpu_log, log_point_s 100 100 101 101 USE grid_variables, & 102 ONLY: dx, d dx, dy, ddy102 ONLY: dx, dy 103 103 104 104 USE lpm_collision_kernels_mod, & … … 109 109 USE particle_attributes, & 110 110 ONLY: block_offset, grid_particles, hall_kernel, number_of_particles, & 111 offset_ocean_nzt, offset_ocean_nzt_m1, particles, & 112 radius_classes, use_kernel_tables, wang_kernel 111 particles, radius_classes, use_kernel_tables, wang_kernel 113 112 114 113 -
palm/trunk/SOURCE/lpm_exchange_horiz.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Tails removed. Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 67 67 ! Description: 68 68 ! ------------ 69 ! > Exchange of particles (and tails)between the subdomains.69 ! Exchange of particles between the subdomains. 70 70 !------------------------------------------------------------------------------! 71 71 MODULE lpm_exchange_horiz_mod … … 93 93 94 94 USE particle_attributes, & 95 ONLY: alloc_factor, deleted_particles, deleted_tails, grid_particles, & 96 ibc_par_lr, ibc_par_ns, maximum_number_of_tails, & 97 maximum_number_of_tailpoints, min_nr_particle, & 98 mpi_particle_type, number_of_tails, number_of_particles, & 99 offset_ocean_nzt, particles, & 100 particle_tail_coordinates, particle_type, prt_count, & 101 tail_mask, trlp_count_sum, & 95 ONLY: alloc_factor, deleted_particles, grid_particles, & 96 ibc_par_lr, ibc_par_ns, min_nr_particle, & 97 mpi_particle_type, number_of_particles, & 98 offset_ocean_nzt, offset_ocean_nzt_m1, particles, & 99 particle_type, prt_count, trlp_count_sum, & 102 100 trlp_count_recv_sum, trnp_count_sum, trnp_count_recv_sum, & 103 101 trrp_count_sum, trrp_count_recv_sum, trsp_count_sum, & 104 trsp_count_recv_sum, use_particle_tails,zero_particle102 trsp_count_recv_sum, zero_particle 105 103 106 104 USE pegrid … … 156 154 INTEGER(iwp) :: j !< 157 155 INTEGER(iwp) :: jp !< 158 INTEGER(iwp) :: k !<159 156 INTEGER(iwp) :: kp !< 160 157 INTEGER(iwp) :: n !< 161 INTEGER(iwp) :: nn !<162 INTEGER(iwp) :: tlength !<163 158 INTEGER(iwp) :: trlp_count !< 164 159 INTEGER(iwp) :: trlp_count_recv !< … … 178 173 INTEGER(iwp) :: trspt_count_recv !< 179 174 180 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: trlpt !<181 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: trnpt !<182 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: trrpt !<183 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: trspt !<184 185 175 TYPE(particle_type), DIMENSION(:), ALLOCATABLE :: rvlp !< 186 176 TYPE(particle_type), DIMENSION(:), ALLOCATABLE :: rvnp !< … … 196 186 #if defined( __parallel ) 197 187 188 ! 189 !-- Exchange between subdomains. 190 !-- As soon as one particle has moved beyond the boundary of the domain, it 191 !-- is included in the relevant transfer arrays and marked for subsequent 192 !-- deletion on this PE. 193 !-- First sweep for crossings in x direction. Find out first the number of 194 !-- particles to be transferred and allocate temporary arrays needed to store 195 !-- them. 196 !-- For a one-dimensional decomposition along y, no transfer is necessary, 197 !-- because the particle remains on the PE, but the particle coordinate has to 198 !-- be adjusted. 198 199 trlp_count = 0 199 200 trlpt_count = 0 … … 226 227 IF ( i < nxl ) THEN 227 228 trlp_count = trlp_count + 1 228 IF ( particles(n)%tail_id /= 0 ) trlpt_count = trlpt_count + 1229 229 ELSEIF ( i > nxr ) THEN 230 230 trrp_count = trrp_count + 1 231 IF ( particles(n)%tail_id /= 0 ) trrpt_count = trrpt_count + 1232 231 ENDIF 233 232 ENDIF … … 247 246 trlp = zero_particle 248 247 trrp = zero_particle 249 250 IF ( use_particle_tails ) THEN251 ALLOCATE( trlpt(maximum_number_of_tailpoints,5,trlpt_count), &252 trrpt(maximum_number_of_tailpoints,5,trrpt_count) )253 tlength = maximum_number_of_tailpoints * 5254 ENDIF255 248 256 249 trlp_count = 0 … … 269 262 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 270 263 DO n = 1, number_of_particles 271 272 nn = particles(n)%tail_id273 264 ! 274 265 !-- Only those particles that have not been marked as 'deleted' may … … 292 283 particles(n)%origin_x = ( nx + 1 ) * dx + & 293 284 particles(n)%origin_x 294 IF ( use_particle_tails .AND. nn /= 0 ) THEN295 i = particles(n)%tailpoints296 particle_tail_coordinates(1:i,1,nn) = ( nx + 1 ) * dx &297 + particle_tail_coordinates(1:i,1,nn)298 ENDIF299 285 ELSE 300 286 trlp_count = trlp_count + 1 … … 312 298 ENDIF 313 299 314 IF ( use_particle_tails .AND. nn /= 0 ) THEN315 trlpt_count = trlpt_count + 1316 trlpt(:,:,trlpt_count) = particle_tail_coordinates(:,:,nn)317 trlpt(:,1,trlpt_count) = ( nx + 1 ) * dx + &318 trlpt(:,1,trlpt_count)319 tail_mask(nn) = .FALSE.320 deleted_tails = deleted_tails + 1321 ENDIF322 300 ENDIF 323 301 … … 327 305 particles(n)%particle_mask = .FALSE. 328 306 deleted_particles = deleted_particles + 1 329 IF ( use_particle_tails .AND. nn /= 0 ) THEN330 tail_mask(nn) = .FALSE.331 deleted_tails = deleted_tails + 1332 ENDIF333 307 334 308 ELSEIF ( ibc_par_lr == 2 ) THEN … … 348 322 deleted_particles = deleted_particles + 1 349 323 350 IF ( use_particle_tails .AND. nn /= 0 ) THEN351 trlpt_count = trlpt_count + 1352 trlpt(:,:,trlpt_count) = particle_tail_coordinates(:,:,nn)353 tail_mask(nn) = .FALSE.354 deleted_tails = deleted_tails + 1355 ENDIF356 324 ENDIF 357 325 … … 367 335 particles(n)%origin_x = particles(n)%origin_x - & 368 336 ( nx + 1 ) * dx 369 IF ( use_particle_tails .AND. nn /= 0 ) THEN370 i = particles(n)%tailpoints371 particle_tail_coordinates(1:i,1,nn) = - ( nx+1 ) * dx &372 + particle_tail_coordinates(1:i,1,nn)373 ENDIF374 337 ELSE 375 338 trrp_count = trrp_count + 1 … … 381 344 deleted_particles = deleted_particles + 1 382 345 383 IF ( use_particle_tails .AND. nn /= 0 ) THEN384 trrpt_count = trrpt_count + 1385 trrpt(:,:,trrpt_count) = particle_tail_coordinates(:,:,nn)386 trrpt(:,1,trrpt_count) = trrpt(:,1,trrpt_count) - &387 ( nx + 1 ) * dx388 tail_mask(nn) = .FALSE.389 deleted_tails = deleted_tails + 1390 ENDIF391 346 ENDIF 392 347 … … 396 351 particles(n)%particle_mask = .FALSE. 397 352 deleted_particles = deleted_particles + 1 398 IF ( use_particle_tails .AND. nn /= 0 ) THEN399 tail_mask(nn) = .FALSE.400 deleted_tails = deleted_tails + 1401 ENDIF402 353 403 354 ELSEIF ( ibc_par_lr == 2 ) THEN … … 417 368 deleted_particles = deleted_particles + 1 418 369 419 IF ( use_particle_tails .AND. nn /= 0 ) THEN420 trrpt_count = trrpt_count + 1421 trrpt(:,:,trrpt_count) = particle_tail_coordinates(:,:,nn)422 tail_mask(nn) = .FALSE.423 deleted_tails = deleted_tails + 1424 ENDIF425 370 ENDIF 426 371 … … 452 397 DEALLOCATE(rvrp) 453 398 454 IF ( use_particle_tails ) THEN455 456 CALL MPI_SENDRECV( trlpt_count, 1, MPI_INTEGER, pleft, 0, &457 trrpt_count_recv, 1, MPI_INTEGER, pright, 0, &458 comm2d, status, ierr )459 460 IF ( number_of_tails+trrpt_count_recv > maximum_number_of_tails ) &461 THEN462 IF ( netcdf_data_format < 3 ) THEN463 message_string = 'maximum_number_of_tails ' // &464 'needs to be increased ' // &465 '&but this is not allowed wi'// &466 'th netcdf_data_format < 3'467 CALL message( 'lpm_exch_horiz', 'PA0147', 2, 2, -1, 6, 1 )468 ELSE469 CALL lpm_extend_tail_array( trrpt_count_recv )470 ENDIF471 ENDIF472 473 CALL MPI_SENDRECV( trlpt(1,1,1), trlpt_count*tlength, MPI_REAL, &474 pleft, 1, &475 particle_tail_coordinates(1,1,number_of_tails+1), &476 trrpt_count_recv*tlength, MPI_REAL, pright, 1, &477 comm2d, status, ierr )478 !479 !-- Update the tail ids for the transferred particles480 nn = number_of_tails481 DO n = number_of_particles+1, number_of_particles+trrp_count_recv482 IF ( particles(n)%tail_id /= 0 ) THEN483 nn = nn + 1484 particles(n)%tail_id = nn485 ENDIF486 ENDDO487 488 ENDIF489 490 399 ! 491 400 !-- Send right boundary, receive left boundary … … 503 412 IF ( trlp_count_recv > 0 ) CALL Add_particles_to_gridcell(rvlp(1:trlp_count_recv)) 504 413 505 DEALLOCATE(rvlp) 506 507 IF ( use_particle_tails ) THEN 508 509 CALL MPI_SENDRECV( trrpt_count, 1, MPI_INTEGER, pright, 0, & 510 trlpt_count_recv, 1, MPI_INTEGER, pleft, 0, & 511 comm2d, status, ierr ) 512 513 IF ( number_of_tails+trlpt_count_recv > maximum_number_of_tails ) & 514 THEN 515 IF ( netcdf_data_format < 3 ) THEN 516 message_string = 'maximum_number_of_tails ' // & 517 'needs to be increased ' // & 518 '&but this is not allowed wi'// & 519 'th netcdf_data_format < 3' 520 CALL message( 'lpm_exch_horiz', 'PA0147', 2, 2, -1, 6, 1 ) 521 ELSE 522 CALL lpm_extend_tail_array( trlpt_count_recv ) 523 ENDIF 524 ENDIF 525 526 CALL MPI_SENDRECV( trrpt(1,1,1), trrpt_count*tlength, MPI_REAL, & 527 pright, 1, & 528 particle_tail_coordinates(1,1,number_of_tails+1), & 529 trlpt_count_recv*tlength, MPI_REAL, pleft, 1, & 530 comm2d, status, ierr ) 531 ! 532 !-- Update the tail ids for the transferred particles 533 nn = number_of_tails 534 DO n = number_of_particles+1, number_of_particles+trlp_count_recv 535 IF ( particles(n)%tail_id /= 0 ) THEN 536 nn = nn + 1 537 particles(n)%tail_id = nn 538 ENDIF 539 ENDDO 540 541 ENDIF 542 543 ! number_of_particles = number_of_particles + trlp_count_recv 544 ! number_of_tails = number_of_tails + trlpt_count_recv 545 546 IF ( use_particle_tails ) THEN 547 DEALLOCATE( trlpt, trrpt ) 548 ENDIF 414 DEALLOCATE( rvlp ) 549 415 DEALLOCATE( trlp, trrp ) 550 416 … … 589 455 IF ( j < nys ) THEN 590 456 trsp_count = trsp_count + 1 591 IF ( particles(n)%tail_id /= 0 ) trspt_count = trspt_count + 1592 457 ELSEIF ( j > nyn ) THEN 593 458 trnp_count = trnp_count + 1 594 IF ( particles(n)%tail_id /= 0 ) trnpt_count = trnpt_count + 1595 459 ENDIF 596 460 ENDIF … … 609 473 trsp = zero_particle 610 474 trnp = zero_particle 611 612 IF ( use_particle_tails ) THEN613 ALLOCATE( trspt(maximum_number_of_tailpoints,5,trspt_count), &614 trnpt(maximum_number_of_tailpoints,5,trnpt_count) )615 tlength = maximum_number_of_tailpoints * 5616 ENDIF617 475 618 476 trsp_count = nr_move_south … … 633 491 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 634 492 DO n = 1, number_of_particles 635 636 nn = particles(n)%tail_id637 493 ! 638 494 !-- Only those particles that have not been marked as 'deleted' may … … 655 511 particles(n)%origin_y = ( ny + 1 ) * dy + & 656 512 particles(n)%origin_y 657 IF ( use_particle_tails .AND. nn /= 0 ) THEN658 i = particles(n)%tailpoints659 particle_tail_coordinates(1:i,2,nn) = &660 ( ny+1 ) * dy + particle_tail_coordinates(1:i,2,nn)661 ENDIF662 513 ELSE 663 514 trsp_count = trsp_count + 1 … … 677 528 ENDIF 678 529 679 IF ( use_particle_tails .AND. nn /= 0 ) THEN680 trspt_count = trspt_count + 1681 trspt(:,:,trspt_count) = &682 particle_tail_coordinates(:,:,nn)683 trspt(:,2,trspt_count) = ( ny + 1 ) * dy + &684 trspt(:,2,trspt_count)685 tail_mask(nn) = .FALSE.686 deleted_tails = deleted_tails + 1687 ENDIF688 530 ENDIF 689 531 … … 693 535 particles(n)%particle_mask = .FALSE. 694 536 deleted_particles = deleted_particles + 1 695 IF ( use_particle_tails .AND. nn /= 0 ) THEN696 tail_mask(nn) = .FALSE.697 deleted_tails = deleted_tails + 1698 ENDIF699 537 700 538 ELSEIF ( ibc_par_ns == 2 ) THEN … … 714 552 deleted_particles = deleted_particles + 1 715 553 716 IF ( use_particle_tails .AND. nn /= 0 ) THEN717 trspt_count = trspt_count + 1718 trspt(:,:,trspt_count) = particle_tail_coordinates(:,:,nn)719 tail_mask(nn) = .FALSE.720 deleted_tails = deleted_tails + 1721 ENDIF722 554 ENDIF 723 555 … … 733 565 particles(n)%origin_y = & 734 566 particles(n)%origin_y - ( ny + 1 ) * dy 735 IF ( use_particle_tails .AND. nn /= 0 ) THEN736 i = particles(n)%tailpoints737 particle_tail_coordinates(1:i,2,nn) = &738 - (ny+1) * dy + particle_tail_coordinates(1:i,2,nn)739 ENDIF740 567 ELSE 741 568 trnp_count = trnp_count + 1 … … 747 574 particles(n)%particle_mask = .FALSE. 748 575 deleted_particles = deleted_particles + 1 749 IF ( use_particle_tails .AND. nn /= 0 ) THEN750 trnpt_count = trnpt_count + 1751 trnpt(:,:,trnpt_count) = &752 particle_tail_coordinates(:,:,nn)753 trnpt(:,2,trnpt_count) = &754 trnpt(:,2,trnpt_count) - ( ny + 1 ) * dy755 tail_mask(nn) = .FALSE.756 deleted_tails = deleted_tails + 1757 ENDIF758 576 ENDIF 759 577 … … 763 581 particles(n)%particle_mask = .FALSE. 764 582 deleted_particles = deleted_particles + 1 765 IF ( use_particle_tails .AND. nn /= 0 ) THEN766 tail_mask(nn) = .FALSE.767 deleted_tails = deleted_tails + 1768 ENDIF769 583 770 584 ELSEIF ( ibc_par_ns == 2 ) THEN … … 784 598 deleted_particles = deleted_particles + 1 785 599 786 IF ( use_particle_tails .AND. nn /= 0 ) THEN787 trnpt_count = trnpt_count + 1788 trnpt(:,:,trnpt_count) = particle_tail_coordinates(:,:,nn)789 tail_mask(nn) = .FALSE.790 deleted_tails = deleted_tails + 1791 ENDIF792 600 ENDIF 793 601 … … 819 627 DEALLOCATE(rvnp) 820 628 821 IF ( use_particle_tails ) THEN822 823 CALL MPI_SENDRECV( trspt_count, 1, MPI_INTEGER, psouth, 0, &824 trnpt_count_recv, 1, MPI_INTEGER, pnorth, 0, &825 comm2d, status, ierr )826 827 IF ( number_of_tails+trnpt_count_recv > maximum_number_of_tails ) &828 THEN829 IF ( netcdf_data_format < 3 ) THEN830 message_string = 'maximum_number_of_tails ' // &831 'needs to be increased ' // &832 '&but this is not allowed wi' // &833 'th netcdf_data_format < 3'834 CALL message( 'lpm_exch_horiz', 'PA0147', 2, 2, -1, 6, 1 )835 ELSE836 CALL lpm_extend_tail_array( trnpt_count_recv )837 ENDIF838 ENDIF839 840 CALL MPI_SENDRECV( trspt(1,1,1), trspt_count*tlength, MPI_REAL, &841 psouth, 1, &842 particle_tail_coordinates(1,1,number_of_tails+1), &843 trnpt_count_recv*tlength, MPI_REAL, pnorth, 1, &844 comm2d, status, ierr )845 846 !847 !-- Update the tail ids for the transferred particles848 nn = number_of_tails849 DO n = number_of_particles+1, number_of_particles+trnp_count_recv850 IF ( particles(n)%tail_id /= 0 ) THEN851 nn = nn + 1852 particles(n)%tail_id = nn853 ENDIF854 ENDDO855 856 ENDIF857 858 ! number_of_particles = number_of_particles + trnp_count_recv859 ! number_of_tails = number_of_tails + trnpt_count_recv860 861 629 ! 862 630 !-- Send back boundary, receive front boundary … … 876 644 DEALLOCATE(rvsp) 877 645 878 IF ( use_particle_tails ) THEN879 880 CALL MPI_SENDRECV( trnpt_count, 1, MPI_INTEGER, pnorth, 0, &881 trspt_count_recv, 1, MPI_INTEGER, psouth, 0, &882 comm2d, status, ierr )883 884 IF ( number_of_tails+trspt_count_recv > maximum_number_of_tails ) &885 THEN886 IF ( netcdf_data_format < 3 ) THEN887 message_string = 'maximum_number_of_tails ' // &888 'needs to be increased ' // &889 '&but this is not allowed wi'// &890 'th NetCDF output switched on'891 CALL message( 'lpm_exch_horiz', 'PA0147', 2, 2, -1, 6, 1 )892 ELSE893 CALL lpm_extend_tail_array( trspt_count_recv )894 ENDIF895 ENDIF896 897 CALL MPI_SENDRECV( trnpt(1,1,1), trnpt_count*tlength, MPI_REAL, &898 pnorth, 1, &899 particle_tail_coordinates(1,1,number_of_tails+1), &900 trspt_count_recv*tlength, MPI_REAL, psouth, 1, &901 comm2d, status, ierr )902 !903 !-- Update the tail ids for the transferred particles904 nn = number_of_tails905 DO n = number_of_particles+1, number_of_particles+trsp_count_recv906 IF ( particles(n)%tail_id /= 0 ) THEN907 nn = nn + 1908 particles(n)%tail_id = nn909 ENDIF910 ENDDO911 912 ENDIF913 914 646 number_of_particles = number_of_particles + trsp_count_recv 915 number_of_tails = number_of_tails + trspt_count_recv 916 917 IF ( use_particle_tails ) THEN 918 DEALLOCATE( trspt, trnpt ) 919 ENDIF 647 920 648 DEALLOCATE( trsp, trnp ) 921 649 … … 928 656 DO n = 1, number_of_particles 929 657 930 nn = particles(n)%tail_id931 932 658 IF ( particles(n)%x < -0.5_wp * dx ) THEN 933 659 … … 936 662 !-- Cyclic boundary. Relevant coordinate has to be changed. 937 663 particles(n)%x = ( nx + 1 ) * dx + particles(n)%x 938 IF ( use_particle_tails .AND. nn /= 0 ) THEN 939 i = particles(n)%tailpoints 940 particle_tail_coordinates(1:i,1,nn) = ( nx + 1 ) * dx + & 941 particle_tail_coordinates(1:i,1,nn) 942 ENDIF 664 943 665 ELSEIF ( ibc_par_lr == 1 ) THEN 944 666 ! … … 946 668 particles(n)%particle_mask = .FALSE. 947 669 deleted_particles = deleted_particles + 1 948 IF ( use_particle_tails .AND. nn /= 0 ) THEN 949 tail_mask(nn) = .FALSE. 950 deleted_tails = deleted_tails + 1 951 ENDIF 670 952 671 ELSEIF ( ibc_par_lr == 2 ) THEN 953 672 ! … … 963 682 !-- Cyclic boundary. Relevant coordinate has to be changed. 964 683 particles(n)%x = particles(n)%x - ( nx + 1 ) * dx 965 IF ( use_particle_tails .AND. nn /= 0 ) THEN 966 i = particles(n)%tailpoints 967 particle_tail_coordinates(1:i,1,nn) = - ( nx + 1 ) * dx + & 968 particle_tail_coordinates(1:i,1,nn) 969 ENDIF 684 970 685 ELSEIF ( ibc_par_lr == 1 ) THEN 971 686 ! … … 973 688 particles(n)%particle_mask = .FALSE. 974 689 deleted_particles = deleted_particles + 1 975 IF ( use_particle_tails .AND. nn /= 0 ) THEN 976 tail_mask(nn) = .FALSE. 977 deleted_tails = deleted_tails + 1 978 ENDIF 690 979 691 ELSEIF ( ibc_par_lr == 2 ) THEN 980 692 ! … … 992 704 !-- Cyclic boundary. Relevant coordinate has to be changed. 993 705 particles(n)%y = ( ny + 1 ) * dy + particles(n)%y 994 IF ( use_particle_tails .AND. nn /= 0 ) THEN 995 i = particles(n)%tailpoints 996 particle_tail_coordinates(1:i,2,nn) = ( ny + 1 ) * dy + & 997 particle_tail_coordinates(1:i,2,nn) 998 ENDIF 706 999 707 ELSEIF ( ibc_par_ns == 1 ) THEN 1000 708 ! … … 1002 710 particles(n)%particle_mask = .FALSE. 1003 711 deleted_particles = deleted_particles + 1 1004 IF ( use_particle_tails .AND. nn /= 0 ) THEN 1005 tail_mask(nn) = .FALSE. 1006 deleted_tails = deleted_tails + 1 1007 ENDIF 712 1008 713 ELSEIF ( ibc_par_ns == 2 ) THEN 1009 714 ! … … 1019 724 !-- Cyclic boundary. Relevant coordinate has to be changed. 1020 725 particles(n)%y = particles(n)%y - ( ny + 1 ) * dy 1021 IF ( use_particle_tails .AND. nn /= 0 ) THEN 1022 i = particles(n)%tailpoints 1023 particle_tail_coordinates(1:i,2,nn) = - ( ny + 1 ) * dy + & 1024 particle_tail_coordinates(1:i,2,nn) 1025 ENDIF 726 1026 727 ELSEIF ( ibc_par_ns == 1 ) THEN 1027 728 ! … … 1029 730 particles(n)%particle_mask = .FALSE. 1030 731 deleted_particles = deleted_particles + 1 1031 IF ( use_particle_tails .AND. nn /= 0 ) THEN 1032 tail_mask(nn) = .FALSE. 1033 deleted_tails = deleted_tails + 1 1034 ENDIF 732 1035 733 ELSEIF ( ibc_par_ns == 2 ) THEN 1036 734 ! … … 1287 985 INTEGER(iwp), INTENT(in) :: j !< 1288 986 INTEGER(iwp), INTENT(in) :: k !< 1289 INTEGER(iwp), INTENT(in), optional:: size_in !<987 INTEGER(iwp), INTENT(in), OPTIONAL :: size_in !< 1290 988 1291 989 INTEGER(iwp) :: old_size !< … … 1300 998 new_size = size_in 1301 999 ELSE 1302 new_size = old_size * ( 1.0 + alloc_factor / 100.0)1000 new_size = old_size * ( 1.0_wp + alloc_factor / 100.0_wp ) 1303 1001 ENDIF 1304 1002 -
palm/trunk/SOURCE/lpm_init.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 113 113 dz, initializing_actions, message_string, ocean, simulated_time 114 114 115 USE dvrp_variables, &116 ONLY: particle_color, particle_dvrpsize117 118 115 USE grid_variables, & 119 116 ONLY: ddx, dx, ddy, dy … … 134 131 ONLY: alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & 135 132 block_offset, block_offset_def, collision_kernel, & 136 density_ratio, dvrp_psize, grid_particles,&133 density_ratio, grid_particles, & 137 134 initial_weighting_factor, ibc_par_b, ibc_par_lr, ibc_par_ns, & 138 135 ibc_par_t, iran_part, log_z_z0, & 139 136 max_number_of_particle_groups, maximum_number_of_particles, & 140 maximum_number_of_tailpoints, maximum_number_of_tails, & 141 minimum_tailpoint_distance, min_nr_particle, & 142 mpi_particle_type, new_tail_id, & 143 number_of_initial_tails, number_of_particles, & 137 min_nr_particle, mpi_particle_type, & 138 number_of_particles, & 144 139 number_of_particle_groups, number_of_sublayers, & 145 number_of_tails, offset_ocean_nzt, offset_ocean_nzt_m1,&140 offset_ocean_nzt, offset_ocean_nzt_m1, & 146 141 particles, particle_advection_start, particle_groups, & 147 142 particle_groups_type, particles_per_point, & 148 particle_t ail_coordinates, particle_type, pdx, pdy, pdz,&143 particle_type, pdx, pdy, pdz, & 149 144 prt_count, psb, psl, psn, psr, pss, pst, & 150 145 radius, random_start_position, read_particles_from_restartfile,& 151 seed_follows_topography, s kip_particles_for_tail, sort_count,&152 t ail_mask, total_number_of_particles, total_number_of_tails,&153 use_ particle_tails, use_sgs_for_particles,&146 seed_follows_topography, sort_count, & 147 total_number_of_particles, & 148 use_sgs_for_particles, & 154 149 write_particle_statistics, uniform_particles, zero_particle, & 155 150 z0_av_global … … 192 187 193 188 INTEGER(iwp) :: i !< 194 INTEGER(iwp) :: ip !<195 189 INTEGER(iwp) :: j !< 196 INTEGER(iwp) :: jp !<197 190 INTEGER(iwp) :: k !< 198 INTEGER(iwp) :: kp !<199 INTEGER(iwp) :: n !<200 INTEGER(iwp) :: nn !<201 191 202 192 #if defined( __parallel ) … … 205 195 INTEGER(iwp), DIMENSION(3) :: types !< 206 196 #endif 207 LOGICAL :: uniform_particles_l !<208 197 209 198 REAL(wp) :: height_int !< … … 216 205 !-- Define MPI derived datatype for FORTRAN datatype particle_type (see module 217 206 !-- particle_attributes). Integer length is 4 byte, Real is 8 byte 218 #if defined( __twocachelines )219 blocklengths(1) = 7; blocklengths(2) = 18; blocklengths(3) = 1220 displacements(1) = 0; displacements(2) = 64; displacements(3) = 128221 222 types(1) = MPI_REAL ! 64 bit words223 types(2) = MPI_INTEGER ! 32 Bit words224 types(3) = MPI_UB225 #else226 207 blocklengths(1) = 19; blocklengths(2) = 6; blocklengths(3) = 1 227 208 displacements(1) = 0; displacements(2) = 152; displacements(3) = 176 … … 230 211 types(2) = MPI_INTEGER 231 212 types(3) = MPI_UB 232 #endif233 213 CALL MPI_TYPE_STRUCT( 3, blocklengths, displacements, types, & 234 214 mpi_particle_type, ierr ) … … 293 273 ! 294 274 !-- Allocate arrays required for calculating particle SGS velocities 295 IF ( use_sgs_for_particles ) THEN275 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets ) THEN 296 276 ALLOCATE( de_dx(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 297 277 de_dy(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & … … 429 409 !-- Allocate particle arrays and set attributes of the initial set of 430 410 !-- particles, which can be also periodically released at later times. 431 !-- Also allocate array for particle tail coordinates, if needed.432 411 ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & 433 412 grid_particles(nzb+1:nzt,nys:nyn,nxl:nxr) ) … … 443 422 !-- occur within restart runs). The reason for this is still not clear 444 423 !-- and may be presumably caused by errors in the respective user-interface. 445 #if defined( __twocachelines )446 zero_particle = particle_type( 0.0_wp, 0.0_sp, 0.0_sp, 0.0_sp, 0.0_sp, &447 0.0_sp, 0.0_sp, 0.0_wp, 0.0_wp, 0.0_wp, &448 0, .FALSE., 0.0_wp, 0.0_wp, 0.0_wp, &449 0.0_sp, 0.0_sp, 0.0_sp, 0.0_sp, 0.0_sp, &450 0.0_sp, 0, 0, 0, -1)451 #else452 424 zero_particle = particle_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 453 425 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & … … 455 427 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0, 0, 0, & 456 428 0, .FALSE., -1) 457 #endif 429 458 430 particle_groups = particle_groups_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp ) 459 460 !461 !-- Set the default particle size used for dvrp plots462 IF ( dvrp_psize == 9999999.9_wp ) dvrp_psize = 0.2_wp * dx463 431 464 432 ! … … 506 474 ENDIF 507 475 508 !509 !-- Check if particles are really uniform in color and radius (dvrp_size)510 !-- (uniform_particles is preset TRUE)511 IF ( uniform_particles ) THEN512 DO ip = nxl, nxr513 DO jp = nys, nyn514 DO kp = nzb+1, nzt515 516 n = prt_count(kp,jp,ip)517 IF ( MINVAL( grid_particles(kp,jp,ip)%particles(1:n)%dvrp_psize ) == &518 MAXVAL( grid_particles(kp,jp,ip)%particles(1:n)%dvrp_psize ) .AND. &519 MINVAL( grid_particles(kp,jp,ip)%particles(1:n)%class ) == &520 MAXVAL( grid_particles(kp,jp,ip)%particles(1:n)%class ) ) THEN521 uniform_particles_l = .TRUE.522 ELSE523 uniform_particles_l = .FALSE.524 ENDIF525 526 ENDDO527 ENDDO528 ENDDO529 530 #if defined( __parallel )531 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr )532 CALL MPI_ALLREDUCE( uniform_particles_l, uniform_particles, 1, &533 MPI_LOGICAL, MPI_LAND, comm2d, ierr )534 #else535 uniform_particles = uniform_particles_l536 #endif537 538 ENDIF539 540 !541 !-- Particles will probably become none-uniform, if their size and color542 !-- will be determined by flow variables543 IF ( particle_color /= 'none' .OR. particle_dvrpsize /= 'none' ) THEN544 uniform_particles = .FALSE.545 ENDIF546 547 ! !kk Not implemented aft individual particle array fort every gridcell548 ! !549 ! !-- Set the beginning of the particle tails and their age550 ! IF ( use_particle_tails ) THEN551 ! !552 ! !-- Choose the maximum number of tails with respect to the maximum number553 ! !-- of particles and skip_particles_for_tail554 ! maximum_number_of_tails = maximum_number_of_particles / &555 ! skip_particles_for_tail556 !557 ! !558 ! !-- Create a minimum number of tails in case that there is no tail559 ! !-- initially (otherwise, index errors will occur when adressing the560 ! !-- arrays below)561 ! IF ( maximum_number_of_tails == 0 ) maximum_number_of_tails = 10562 !563 ! ALLOCATE( particle_tail_coordinates(maximum_number_of_tailpoints,5, &564 ! maximum_number_of_tails), &565 ! new_tail_id(maximum_number_of_tails), &566 ! tail_mask(maximum_number_of_tails) )567 !568 ! particle_tail_coordinates = 0.0_wp569 ! minimum_tailpoint_distance = minimum_tailpoint_distance**2570 ! number_of_initial_tails = number_of_tails571 !572 ! nn = 0573 ! DO n = 1, number_of_particles574 ! !575 ! !-- Only for those particles marked above with a provisional tail_id576 ! !-- tails will be created. Particles now get their final tail_id.577 ! IF ( particles(n)%tail_id /= 0 ) THEN578 !579 ! nn = nn + 1580 ! particles(n)%tail_id = nn581 !582 ! particle_tail_coordinates(1,1,nn) = particles(n)%x583 ! particle_tail_coordinates(1,2,nn) = particles(n)%y584 ! particle_tail_coordinates(1,3,nn) = particles(n)%z585 ! particle_tail_coordinates(1,4,nn) = particles(n)%class586 ! particles(n)%tailpoints = 1587 ! IF ( minimum_tailpoint_distance /= 0.0_wp ) THEN588 ! particle_tail_coordinates(2,1,nn) = particles(n)%x589 ! particle_tail_coordinates(2,2,nn) = particles(n)%y590 ! particle_tail_coordinates(2,3,nn) = particles(n)%z591 ! particle_tail_coordinates(2,4,nn) = particles(n)%class592 ! particle_tail_coordinates(1:2,5,nn) = 0.0_wp593 ! particles(n)%tailpoints = 2594 ! ENDIF595 !596 ! ENDIF597 ! ENDDO598 ! ENDIF599 !600 ! !601 ! !-- Plot initial positions of particles (only if particle advection is602 ! !-- switched on from the beginning of the simulation (t=0))603 ! IF ( particle_advection_start == 0.0_wp ) CALL data_output_dvrp604 605 476 ENDIF 606 477 … … 641 512 INTEGER(iwp) :: n !< 642 513 INTEGER(iwp) :: new_size !< 643 INTEGER(iwp) :: nn !<644 514 645 515 INTEGER(iwp), INTENT(IN) :: phase !< … … 691 561 692 562 n = n + 1 693 #if defined( __twocachelines )694 tmp_particle%x = pos_x695 tmp_particle%y = pos_y696 tmp_particle%z = pos_z697 tmp_particle%age = 0.0_sp698 tmp_particle%age_m = 0.0_sp699 tmp_particle%dt_sum = 0.0_wp700 tmp_particle%dvrp_psize = dvrp_psize701 tmp_particle%e_m = 0.0_sp702 IF ( curvature_solution_effects ) THEN703 !704 !-- Initial values (internal timesteps, derivative)705 !-- for Rosenbrock method706 tmp_particle%rvar1 = 1.0E-12_wp707 tmp_particle%rvar2 = 1.0E-3_wp708 tmp_particle%rvar3 = -9999999.9_wp709 ELSE710 !711 !-- Initial values for SGS velocities712 tmp_particle%rvar1 = 0.0_wp713 tmp_particle%rvar2 = 0.0_wp714 tmp_particle%rvar3 = 0.0_wp715 ENDIF716 tmp_particle%speed_x = 0.0_sp717 tmp_particle%speed_y = 0.0_sp718 tmp_particle%speed_z = 0.0_sp719 tmp_particle%origin_x = pos_x720 tmp_particle%origin_y = pos_y721 tmp_particle%origin_z = pos_z722 tmp_particle%radius = particle_groups(i)%radius723 tmp_particle%weight_factor = initial_weighting_factor724 tmp_particle%class = 1725 tmp_particle%group = i726 tmp_particle%tailpoints = 0727 tmp_particle%particle_mask = .TRUE.728 #else729 563 tmp_particle%x = pos_x 730 564 tmp_particle%y = pos_y … … 733 567 tmp_particle%age_m = 0.0_wp 734 568 tmp_particle%dt_sum = 0.0_wp 735 tmp_particle%dvrp_psize = dvrp_psize569 tmp_particle%dvrp_psize = 0.0_wp !unused 736 570 tmp_particle%e_m = 0.0_wp 737 571 IF ( curvature_solution_effects ) THEN … … 759 593 tmp_particle%class = 1 760 594 tmp_particle%group = i 761 tmp_particle%tailpoints = 0 595 tmp_particle%tailpoints = 0 !unused 762 596 tmp_particle%particle_mask = .TRUE. 763 #endif 764 IF ( use_particle_tails .AND. & 765 MOD( n, skip_particles_for_tail ) == 0 ) THEN 766 number_of_tails = number_of_tails + 1 767 ! 768 !-- This is a temporary provisional setting (see 769 !-- further below!) 770 tmp_particle%tail_id = number_of_tails 771 ELSE 772 tmp_particle%tail_id = 0 773 ENDIF 597 tmp_particle%tail_id = 0 !unused 598 774 599 ! 775 600 !-- Determine the grid indices of the particle position … … 913 738 ENDDO 914 739 ! 915 !-- Calculate the number of particles and tailsof the total domain740 !-- Calculate the number of particles of the total domain 916 741 #if defined( __parallel ) 917 742 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr ) 918 743 CALL MPI_ALLREDUCE( number_of_particles, total_number_of_particles, 1, & 919 744 MPI_INTEGER, MPI_SUM, comm2d, ierr ) 920 IF ( collective_wait ) CALL MPI_BARRIER( comm2d, ierr )921 CALL MPI_ALLREDUCE( number_of_tails, total_number_of_tails, 1, &922 MPI_INTEGER, MPI_SUM, comm2d, ierr )923 745 #else 924 746 total_number_of_particles = number_of_particles 925 total_number_of_tails = number_of_tails926 747 #endif 927 748 -
palm/trunk/SOURCE/lpm_init_sgs_tke.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 63 63 64 64 USE indices, & 65 ONLY: nbgp, ngp_2dh_outer, nx , nxl, nxr, ny, nyn, nys, nz, nzb,&66 nzb_s_inner,nzb_s_outer, nzt65 ONLY: nbgp, ngp_2dh_outer, nxl, nxr, nyn, nys, nzb, nzb_s_inner, & 66 nzb_s_outer, nzt 67 67 68 68 USE kinds -
palm/trunk/SOURCE/lpm_pack_arrays.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Tails removed. Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 51 51 ! Description: 52 52 ! ------------ 53 !> Pack particle a nd tail arrays, which means eliminate those elements marked for53 !> Pack particle arrays, which means eliminate those elements marked for 54 54 !> deletion and move data with higher index values to these free indices. 55 55 !> Determine the new number of particles. … … 59 59 60 60 USE particle_attributes, & 61 ONLY: deleted_tails, grid_particles, new_tail_id, & 62 number_of_particles, number_of_tails, offset_ocean_nzt, & 63 particles, particle_type, prt_count, & 64 particle_tail_coordinates, tail_mask, use_particle_tails 61 ONLY: grid_particles, number_of_particles, offset_ocean_nzt, & 62 particles, particle_type, prt_count 65 63 66 64 PRIVATE … … 127 125 128 126 INTEGER(iwp) :: n !< 129 INTEGER(iwp) :: nd !<130 127 INTEGER(iwp) :: nn !< 131 128 ! … … 158 155 number_of_particles = nn 159 156 160 !161 !-- particle tails are currently not available162 !163 !-- Handle tail array in the same way, store the new tail ids and re-assign it164 !-- to the respective particles165 ! IF ( use_particle_tails ) THEN166 !167 ! nn = 0168 ! nd = 0169 !170 ! DO n = 1, number_of_tails171 !172 ! IF ( tail_mask(n) ) THEN173 ! nn = nn + 1174 ! particle_tail_coordinates(:,:,nn) = &175 ! particle_tail_coordinates(:,:,n)176 ! new_tail_id(n) = nn177 ! ELSE178 ! nd = nd + 1179 ! ENDIF180 !181 ! ENDDO182 !183 ! DO n = 1, number_of_particles184 ! IF ( particles(n)%tail_id /= 0 ) THEN185 ! particles(n)%tail_id = new_tail_id(particles(n)%tail_id)186 ! ENDIF187 ! ENDDO188 !189 ! ENDIF190 191 !192 !-- The number of deleted tails has been determined in routines193 !-- lpm_boundary_conds and lpm_exchange_horiz194 ! number_of_tails = number_of_tails - deleted_tails195 196 197 157 END SUBROUTINE lpm_pack_arrays 198 158 … … 206 166 USE control_parameters, & 207 167 ONLY: dz 208 209 USE indices, &210 ONLY: nxl, nxr, nys, nyn, nzb, nzt211 168 212 169 USE kinds -
palm/trunk/SOURCE/lpm_read_restart_file.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Tails removed. Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 54 54 55 55 USE indices, & 56 ONLY: nx , nxl, nxlg, nxr, nxrg, ny, nyn, nyng, nys, nysg, nz, nzb, nzt56 ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt 57 57 58 58 USE kinds … … 64 64 ONLY: alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & 65 65 grid_particles, maximum_number_of_particles, & 66 maximum_number_of_tailpoints, maximum_number_of_tails, & 67 min_nr_particle, new_tail_id, number_of_particles, & 68 number_of_particle_groups, number_of_tails, particles, & 69 particle_groups, particle_tail_coordinates, particle_type, & 70 prt_count, sort_count, tail_mask, time_prel, & 71 time_write_particle_data, uniform_particles, & 72 use_particle_tails, zero_particle 66 min_nr_particle, number_of_particles, number_of_particle_groups,& 67 particle_groups, particle_type, prt_count, time_prel, & 68 time_write_particle_data, uniform_particles, zero_particle 73 69 74 70 USE pegrid … … 100 96 !-- First compare the version numbers 101 97 READ ( 90 ) version_on_file 102 particle_binary_version = ' 3.2'98 particle_binary_version = '4.0' 103 99 IF ( TRIM( version_on_file ) /= TRIM( particle_binary_version ) ) THEN 104 100 message_string = 'version mismatch concerning data from prior ' // & … … 114 110 !-- min_nr_particle, the remainder is initialized by zero_particle to avoid 115 111 !-- errors. 116 #if defined( __twocachelines )117 zero_particle = particle_type( 0.0_wp, 0.0_sp, 0.0_sp, 0.0_sp, 0.0_sp, &118 0.0_sp, 0.0_sp, 0.0_wp, 0.0_wp, 0.0_wp, &119 0, .FALSE., 0.0_wp, 0.0_wp, 0.0_wp, &120 0.0_sp, 0.0_sp, 0.0_sp, 0.0_sp, 0.0_sp, &121 0.0_sp, 0, 0, 0, -1)122 #else123 112 zero_particle = particle_type( 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 124 113 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & … … 126 115 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0, 0, 0, & 127 116 0, .FALSE., -1) 128 #endif129 130 117 ! 131 118 !-- Read some particle parameters and the size of the particle arrays, 132 119 !-- allocate them and read their contents. 133 120 READ ( 90 ) bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & 134 maximum_number_of_tailpoints, maximum_number_of_tails, & 135 number_of_particle_groups, number_of_tails, & 136 particle_groups, time_prel, time_write_particle_data, & 137 uniform_particles 121 number_of_particle_groups, particle_groups, time_prel, & 122 time_write_particle_data, uniform_particles 138 123 139 124 ALLOCATE( prt_count(nzb:nzt+1,nysg:nyng,nxlg:nxrg), & … … 177 162 ENDDO 178 163 179 !180 !-- particle tails currently not available181 ! IF ( use_particle_tails ) THEN182 ! ALLOCATE( particle_tail_coordinates(maximum_number_of_tailpoints,5, &183 ! maximum_number_of_tails), &184 ! new_tail_id(maximum_number_of_tails), &185 ! tail_mask(maximum_number_of_tails) )186 ! READ ( 90 ) particle_tail_coordinates187 ! ENDIF188 189 164 CLOSE ( 90 ) 190 165 ! -
palm/trunk/SOURCE/lpm_set_attributes.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 67 67 68 68 USE control_parameters, & 69 ONLY: atmos_ocean_sign,u_gtrans, v_gtrans, dz69 ONLY: u_gtrans, v_gtrans, dz 70 70 71 71 USE cpulog, & … … 77 77 78 78 USE grid_variables, & 79 ONLY: d dx, dx, ddy, dy79 ONLY: dx, dy 80 80 81 81 USE indices, & … … 85 85 86 86 USE particle_attributes, & 87 ONLY: block_offset, grid_particles, number_of_particles, 88 offset_ocean_nzt, particles,prt_count87 ONLY: block_offset, grid_particles, number_of_particles, particles, & 88 prt_count 89 89 90 90 USE pegrid -
palm/trunk/SOURCE/lpm_write_exchange_statistics.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 62 62 USE particle_attributes, & 63 63 ONLY: grid_particles, maximum_number_of_particles, & 64 number_of_particles, p articles, prt_count,&64 number_of_particles, prt_count, & 65 65 trlp_count_sum, trlp_count_recv_sum, trnp_count_sum, & 66 66 trnp_count_recv_sum, trrp_count_sum, trrp_count_recv_sum, & -
palm/trunk/SOURCE/lpm_write_restart_file.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Tails removed. Unused variables removed. 22 22 ! 23 23 ! Former revisions: … … 50 50 !------------------------------------------------------------------------------! 51 51 SUBROUTINE lpm_write_restart_file 52 53 52 54 USE control_parameters, &55 ONLY: io_blocks, io_group56 53 57 54 USE indices, & … … 62 59 USE particle_attributes, & 63 60 ONLY: bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, grid_particles, & 64 maximum_number_of_tails, maximum_number_of_tailpoints, &65 61 number_of_particles, number_of_particle_groups, & 66 number_of_tails, particles, particle_groups, & 67 particle_tail_coordinates, prt_count, time_prel, & 68 time_write_particle_data, uniform_particles, & 69 use_particle_tails, zero_particle 62 particles, particle_groups, prt_count, time_prel, & 63 time_write_particle_data, uniform_particles 70 64 71 65 USE pegrid … … 75 69 CHARACTER (LEN=10) :: particle_binary_version !< 76 70 77 INTEGER(iwp) :: i !<78 71 INTEGER(iwp) :: ip !< 79 72 INTEGER(iwp) :: jp !< … … 97 90 ENDIF 98 91 99 ! DO i = 0, io_blocks-1 100 101 ! IF ( i == io_group ) THEN 92 ! 93 !-- Write the version number of the binary format. 94 !-- Attention: After changes to the following output commands the version 95 !-- --------- number of the variable particle_binary_version must be 96 !-- changed! Also, the version number and the list of arrays 97 !-- to be read in lpm_read_restart_file must be adjusted 98 !-- accordingly. 99 particle_binary_version = '4.0' 100 WRITE ( 90 ) particle_binary_version 102 101 103 102 ! 104 !-- Write the version number of the binary format. 105 !-- Attention: After changes to the following output commands the version 106 !-- --------- number of the variable particle_binary_version must be 107 !-- changed! Also, the version number and the list of arrays 108 !-- to be read in lpm_read_restart_file must be adjusted 109 !-- accordingly. 110 particle_binary_version = '3.2' 111 WRITE ( 90 ) particle_binary_version 103 !-- Write some particle parameters, the size of the particle arrays as 104 !-- well as other dvrp-plot variables. 105 WRITE ( 90 ) bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & 106 number_of_particle_groups, particle_groups, time_prel, & 107 time_write_particle_data, uniform_particles 112 108 113 ! 114 !-- Write some particle parameters, the size of the particle arrays as 115 !-- well as other dvrp-plot variables. 116 WRITE ( 90 ) bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & 117 maximum_number_of_tailpoints, maximum_number_of_tails, & 118 number_of_particle_groups, number_of_tails, & 119 particle_groups, time_prel, time_write_particle_data, & 120 uniform_particles 109 WRITE ( 90 ) prt_count 110 111 DO ip = nxl, nxr 112 DO jp = nys, nyn 113 DO kp = nzb+1, nzt 114 number_of_particles = prt_count(kp,jp,ip) 115 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 116 IF ( number_of_particles <= 0 ) CYCLE 117 WRITE ( 90 ) particles 118 ENDDO 119 ENDDO 120 ENDDO 121 121 122 WRITE ( 90 ) prt_count 123 124 DO ip = nxl, nxr 125 DO jp = nys, nyn 126 DO kp = nzb+1, nzt 127 number_of_particles = prt_count(kp,jp,ip) 128 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 129 IF ( number_of_particles <= 0 ) CYCLE 130 WRITE ( 90 ) particles 131 ENDDO 132 ENDDO 133 ENDDO 134 135 ! 136 !-- particle tails currently not available 137 ! IF ( use_particle_tails ) THEN 138 ! WRITE ( 90 ) particle_tail_coordinates 139 ! ENDIF 140 141 CLOSE ( 90 ) 142 143 ! ENDIF 122 CLOSE ( 90 ) 144 123 145 124 #if defined( __parallel ) … … 147 126 #endif 148 127 149 ! ENDDO150 151 128 152 129 END SUBROUTINE lpm_write_restart_file -
palm/trunk/SOURCE/microphysics.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Unused variables removed. 22 ! 23 ! Kessler scheme integrated. 22 24 ! 23 25 ! Former revisions: … … 109 111 END INTERFACE autoconversion 110 112 113 INTERFACE autoconversion_kessler 114 MODULE PROCEDURE autoconversion_kessler 115 MODULE PROCEDURE autoconversion_kessler_ij 116 END INTERFACE autoconversion_kessler 117 111 118 INTERFACE accretion 112 119 MODULE PROCEDURE accretion … … 151 158 152 159 USE arrays_3d, & 153 ONLY: hyp, nr, pt, pt_init, q, qc, qr, zu160 ONLY: hyp, pt_init, zu 154 161 155 162 USE cloud_parameters, & 156 ONLY: cp, hyrho, nc_const, pt_d_t, r_d, t_d_pt163 ONLY: cp, hyrho, prr, pt_d_t, r_d, t_d_pt 157 164 158 165 USE control_parameters, & 159 166 ONLY: call_microphysics_at_all_substeps, drizzle, dt_3d, dt_micro, & 160 g, intermediate_timestep_count, 161 l arge_scale_forcing, lsf_surf, precipitation, pt_surface,&162 rho_surface,surface_pressure167 g, intermediate_timestep_count, large_scale_forcing, & 168 lsf_surf, microphysics_kessler, microphysics_seifert, & 169 pt_surface, rho_surface,surface_pressure 163 170 164 171 USE indices, & … … 172 179 IMPLICIT NONE 173 180 174 INTEGER(iwp) :: i !<175 INTEGER(iwp) :: j !<176 181 INTEGER(iwp) :: k !< 177 182 … … 193 198 hyrho(k) = hyp(k) / ( r_d * t_d_pt(k) * pt_init(k) ) 194 199 ENDDO 200 195 201 ! 196 202 !-- Compute reference density … … 207 213 208 214 ! 215 !-- Reset precipitation rate 216 IF ( intermediate_timestep_count == 1 ) prr = 0.0_wp 217 218 ! 209 219 !-- Compute cloud physics 210 IF ( precipitation ) THEN 220 IF ( microphysics_kessler ) THEN 221 222 CALL autoconversion_kessler 223 224 ELSEIF ( microphysics_seifert ) THEN 225 211 226 CALL adjust_cloud 212 227 CALL autoconversion … … 215 230 CALL evaporation_rain 216 231 CALL sedimentation_rain 232 233 IF ( drizzle ) CALL sedimentation_cloud 234 217 235 ENDIF 218 236 219 IF ( drizzle ) CALL sedimentation_cloud 220 221 IF ( precipitation ) THEN 222 CALL calc_precipitation_amount 223 ENDIF 237 CALL calc_precipitation_amount 224 238 225 239 END SUBROUTINE microphysics_control … … 238 252 239 253 USE cloud_parameters, & 240 ONLY: eps_sb, xrmin, xrmax, hyrho , k_cc, x0254 ONLY: eps_sb, xrmin, xrmax, hyrho 241 255 242 256 USE cpulog, & … … 244 258 245 259 USE indices, & 246 ONLY: nxl, nxr, nys, nyn, nzb , nzb_s_inner, nzt260 ONLY: nxl, nxr, nys, nyn, nzb_s_inner, nzt 247 261 248 262 USE kinds … … 303 317 304 318 USE indices, & 305 ONLY: nxl, nxr, nys, nyn, nzb , nzb_s_inner, nzt319 ONLY: nxl, nxr, nys, nyn, nzb_s_inner, nzt 306 320 307 321 USE kinds … … 323 337 REAL(wp) :: rc !< 324 338 REAL(wp) :: re_lambda !< 325 REAL(wp) :: selfcoll !<326 339 REAL(wp) :: sigma_cc !< 327 340 REAL(wp) :: tau_cloud !< … … 417 430 ! Description: 418 431 ! ------------ 432 !> Autoconversion process (Kessler, 1969). 433 !------------------------------------------------------------------------------! 434 SUBROUTINE autoconversion_kessler 435 436 USE arrays_3d, & 437 ONLY: dzw, pt, q, qc 438 439 USE cloud_parameters, & 440 ONLY: l_d_cp, pt_d_t, prec_time_const, prr, ql_crit 441 442 USE control_parameters, & 443 ONLY: dt_micro 444 445 USE indices, & 446 ONLY: nxl, nxr, nyn, nys, nzb_2d, nzt 447 448 USE kinds 449 450 451 IMPLICIT NONE 452 453 INTEGER(iwp) :: i !< 454 INTEGER(iwp) :: j !< 455 INTEGER(iwp) :: k !< 456 457 REAL(wp) :: dqdt_precip !< 458 459 DO i = nxl, nxr 460 DO j = nys, nyn 461 DO k = nzb_2d(j,i)+1, nzt 462 463 IF ( qc(k,j,i) > ql_crit ) THEN 464 dqdt_precip = prec_time_const * ( qc(k,j,i) - ql_crit ) 465 ELSE 466 dqdt_precip = 0.0_wp 467 ENDIF 468 469 qc(k,j,i) = qc(k,j,i) - dqdt_precip * dt_micro 470 q(k,j,i) = q(k,j,i) - dqdt_precip * dt_micro 471 pt(k,j,i) = pt(k,j,i) + dqdt_precip * dt_micro * l_d_cp * pt_d_t(k) 472 473 ! 474 !-- Compute the rain rate 475 prr(nzb_2d(j,i)+1,j,i) = prr(nzb_2d(j,i)+1,j,i) + dqdt_precip * dzw(k) 476 477 ENDDO 478 ENDDO 479 ENDDO 480 481 END SUBROUTINE autoconversion_kessler 482 483 484 !------------------------------------------------------------------------------! 485 ! Description: 486 ! ------------ 419 487 !> Accretion rate (Seifert and Beheng, 2006). 420 488 !------------------------------------------------------------------------------! … … 434 502 435 503 USE indices, & 436 ONLY: nxl, nxr, nys, nyn, nzb , nzb_s_inner, nzt504 ONLY: nxl, nxr, nys, nyn, nzb_s_inner, nzt 437 505 438 506 USE kinds … … 448 516 REAL(wp) :: phi_ac !< 449 517 REAL(wp) :: tau_cloud !< 450 REAL(wp) :: xc !<451 518 452 519 CALL cpu_log( log_point_s(56), 'accretion', 'start' ) … … 516 583 517 584 USE indices, & 518 ONLY: nxl, nxr, nys, nyn, nzb , nzb_s_inner, nzt585 ONLY: nxl, nxr, nys, nyn, nzb_s_inner, nzt 519 586 520 587 USE kinds … … 579 646 580 647 USE cloud_parameters, & 581 ONLY: a_term, a_vent, b_term, b_vent, c_evap, c_term, diff_coeff_l,&582 d pirho_l, eps_sb, hyrho, kin_vis_air, k_st, l_d_cp, l_d_r,&583 l_ v, rho_l, r_v, schmidt_p_1d3, thermal_conductivity_l,&584 t _d_pt, ventilation_effect648 ONLY: a_term, a_vent, b_term, b_vent, c_evap, c_term, & 649 diff_coeff_l, dpirho_l, eps_sb, hyrho, kin_vis_air, & 650 l_d_cp, l_d_r, l_v, r_v, schmidt_p_1d3, & 651 thermal_conductivity_l, t_d_pt, ventilation_effect 585 652 586 653 USE constants, & … … 594 661 595 662 USE indices, & 596 ONLY: nxl, nxr, nys, nyn, nzb , nzb_s_inner, nzt663 ONLY: nxl, nxr, nys, nyn, nzb_s_inner, nzt 597 664 598 665 USE kinds … … 742 809 ONLY: eps_sb, hyrho, l_d_cp, nc_const, prr, pt_d_t, sed_qc_const 743 810 744 USE constants, &745 ONLY: pi746 747 811 USE control_parameters, & 748 812 ONLY: call_microphysics_at_all_substeps, dt_micro, & 749 intermediate_timestep_count , precipitation813 intermediate_timestep_count 750 814 751 815 USE cpulog, & … … 798 862 ! 799 863 !-- Compute the precipitation rate due to cloud (fog) droplets 800 IF ( precipitation ) THEN 801 IF ( call_microphysics_at_all_substeps ) THEN 802 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) & 803 * weight_substep(intermediate_timestep_count) 804 ELSE 805 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) 806 ENDIF 864 IF ( call_microphysics_at_all_substeps ) THEN 865 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) & 866 * weight_substep(intermediate_timestep_count) 867 ELSE 868 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) 807 869 ENDIF 808 870 … … 828 890 829 891 USE cloud_parameters, & 830 ONLY: a_term, b_term, c_term, cof, dpirho_l, eps_sb, hyrho,&831 limiter_sedimentation, l_d_cp, prr, pt_d_t, stp892 ONLY: a_term, b_term, c_term, dpirho_l, eps_sb, hyrho, & 893 limiter_sedimentation, l_d_cp, prr, pt_d_t 832 894 833 895 USE control_parameters, & … … 857 919 REAL(wp) :: d_min !< 858 920 REAL(wp) :: dr !< 859 REAL(wp) :: dt_sedi !<860 921 REAL(wp) :: flux !< 861 922 REAL(wp) :: lambda_r !< … … 865 926 REAL(wp), DIMENSION(nzb:nzt+1) :: c_nr !< 866 927 REAL(wp), DIMENSION(nzb:nzt+1) :: c_qr !< 867 REAL(wp), DIMENSION(nzb:nzt+1) :: d_nr !<868 REAL(wp), DIMENSION(nzb:nzt+1) :: d_qr !<869 928 REAL(wp), DIMENSION(nzb:nzt+1) :: nr_slope !< 870 929 REAL(wp), DIMENSION(nzb:nzt+1) :: qr_slope !< … … 876 935 CALL cpu_log( log_point_s(60), 'sed_rain', 'start' ) 877 936 878 IF ( intermediate_timestep_count == 1 ) prr(:,:,:) = 0.0_wp879 937 ! 880 938 !-- Compute velocities … … 1105 1163 1106 1164 USE cloud_parameters, & 1107 ONLY: cp, hyrho, nc_const, p t_d_t, r_d, t_d_pt1165 ONLY: cp, hyrho, nc_const, prr, pt_d_t, r_d, t_d_pt 1108 1166 1109 1167 USE control_parameters, & 1110 1168 ONLY: call_microphysics_at_all_substeps, drizzle, dt_3d, dt_micro, & 1111 1169 g, intermediate_timestep_count, large_scale_forcing, & 1112 lsf_surf, precipitation, pt_surface,&1113 rho_surface,surface_pressure1170 lsf_surf, microphysics_seifert, microphysics_kessler, & 1171 pt_surface, rho_surface, surface_pressure 1114 1172 1115 1173 USE indices, & … … 1162 1220 qc_1d(:) = qc(:,j,i) 1163 1221 nc_1d(:) = nc_const 1164 IF ( precipitation) THEN1222 IF ( microphysics_seifert ) THEN 1165 1223 qr_1d(:) = qr(:,j,i) 1166 1224 nr_1d(:) = nr(:,j,i) … … 1168 1226 1169 1227 ! 1228 !-- Reset precipitation rate 1229 IF ( intermediate_timestep_count == 1 ) prr(:,j,i) = 0.0_wp 1230 1231 ! 1170 1232 !-- Compute cloud physics 1171 IF ( precipitation ) THEN 1172 CALL adjust_cloud( i,j ) 1233 IF( microphysics_kessler ) THEN 1234 1235 CALL autoconversion_kessler( i,j ) 1236 1237 ELSEIF ( microphysics_seifert ) THEN 1238 1239 CALL adjust_cloud( i,j ) 1173 1240 CALL autoconversion( i,j ) 1174 1241 CALL accretion( i,j ) … … 1176 1243 CALL evaporation_rain( i,j ) 1177 1244 CALL sedimentation_rain( i,j ) 1245 1246 IF ( drizzle ) CALL sedimentation_cloud( i,j ) 1247 1178 1248 ENDIF 1179 1249 1180 IF ( drizzle ) CALL sedimentation_cloud( i,j ) 1181 1182 IF ( precipitation ) THEN 1183 CALL calc_precipitation_amount( i,j ) 1184 ENDIF 1250 CALL calc_precipitation_amount( i,j ) 1185 1251 1186 1252 ! … … 1188 1254 q(:,j,i) = q_1d(:) 1189 1255 pt(:,j,i) = pt_1d(:) 1190 IF ( precipitation) THEN1256 IF ( microphysics_seifert ) THEN 1191 1257 qr(:,j,i) = qr_1d(:) 1192 1258 nr(:,j,i) = nr_1d(:) … … 1210 1276 1211 1277 USE cloud_parameters, & 1212 ONLY: eps_sb, xrmin, xrmax, hyrho , k_cc, x01278 ONLY: eps_sb, xrmin, xrmax, hyrho 1213 1279 1214 1280 USE indices, & 1215 ONLY: nzb , nzb_s_inner, nzt1281 ONLY: nzb_s_inner, nzt 1216 1282 1217 1283 USE kinds … … 1258 1324 USE cloud_parameters, & 1259 1325 ONLY: a_1, a_2, a_3, b_1, b_2, b_3, beta_cc, c_1, c_2, c_3, & 1260 c_const, dpirho_l, eps_sb, hyrho, k _cc, kin_vis_air, x01326 c_const, dpirho_l, eps_sb, hyrho, kin_vis_air, k_cc, x0 1261 1327 1262 1328 USE control_parameters, & … … 1267 1333 1268 1334 USE indices, & 1269 ONLY: nzb , nzb_s_inner, nzt1335 ONLY: nzb_s_inner, nzt 1270 1336 1271 1337 USE kinds … … 1287 1353 REAL(wp) :: rc !< 1288 1354 REAL(wp) :: re_lambda !< 1289 REAL(wp) :: selfcoll !<1290 1355 REAL(wp) :: sigma_cc !< 1291 1356 REAL(wp) :: tau_cloud !< … … 1366 1431 END SUBROUTINE autoconversion_ij 1367 1432 1433 !------------------------------------------------------------------------------! 1434 ! Description: 1435 ! ------------ 1436 !> Autoconversion process (Kessler, 1969). 1437 !------------------------------------------------------------------------------! 1438 SUBROUTINE autoconversion_kessler_ij( i, j ) 1439 1440 USE arrays_3d, & 1441 ONLY: dzw, pt_1d, q_1d, qc_1d 1442 1443 USE cloud_parameters, & 1444 ONLY: l_d_cp, pt_d_t, prec_time_const, prr, ql_crit 1445 1446 USE control_parameters, & 1447 ONLY: dt_micro 1448 1449 USE indices, & 1450 ONLY: nzb_2d, nzt 1451 1452 USE kinds 1453 1454 1455 IMPLICIT NONE 1456 1457 INTEGER(iwp) :: i !< 1458 INTEGER(iwp) :: j !< 1459 INTEGER(iwp) :: k !< 1460 1461 REAL(wp) :: dqdt_precip !< 1462 1463 DO k = nzb_2d(j,i)+1, nzt 1464 1465 IF ( qc_1d(k) > ql_crit ) THEN 1466 dqdt_precip = prec_time_const * ( qc_1d(k) - ql_crit ) 1467 ELSE 1468 dqdt_precip = 0.0_wp 1469 ENDIF 1470 1471 qc_1d(k) = qc_1d(k) - dqdt_precip * dt_micro 1472 q_1d(k) = q_1d(k) - dqdt_precip * dt_micro 1473 pt_1d(k) = pt_1d(k) + dqdt_precip * dt_micro * l_d_cp * pt_d_t(k) 1474 1475 ! 1476 !-- Compute the rain rate 1477 prr(nzb_2d(j,i)+1,j,i) = prr(nzb_2d(j,i)+1,j,i) + & 1478 dqdt_precip * dzw(k) 1479 1480 ENDDO 1481 1482 END SUBROUTINE autoconversion_kessler_ij 1368 1483 1369 1484 !------------------------------------------------------------------------------! … … 1384 1499 1385 1500 USE indices, & 1386 ONLY: nzb , nzb_s_inner, nzt1501 ONLY: nzb_s_inner, nzt 1387 1502 1388 1503 USE kinds … … 1398 1513 REAL(wp) :: phi_ac !< 1399 1514 REAL(wp) :: tau_cloud !< 1400 REAL(wp) :: xc !<1401 1515 1402 1516 DO k = nzb_s_inner(j,i)+1, nzt … … 1453 1567 1454 1568 USE indices, & 1455 ONLY: nzb , nzb_s_inner, nzt1569 ONLY: nzb_s_inner, nzt 1456 1570 1457 1571 USE kinds … … 1507 1621 USE cloud_parameters, & 1508 1622 ONLY: a_term, a_vent, b_term, b_vent, c_evap, c_term, diff_coeff_l,& 1509 dpirho_l, eps_sb, hyrho, kin_vis_air, k_st, l_d_cp, l_d_r,&1510 l_v, r ho_l, r_v, schmidt_p_1d3, thermal_conductivity_l,&1623 dpirho_l, eps_sb, hyrho, kin_vis_air, l_d_cp, l_d_r, & 1624 l_v, r_v, schmidt_p_1d3, thermal_conductivity_l, & 1511 1625 t_d_pt, ventilation_effect 1512 1626 … … 1518 1632 1519 1633 USE indices, & 1520 ONLY: nzb , nzb_s_inner, nzt1634 ONLY: nzb_s_inner, nzt 1521 1635 1522 1636 USE kinds … … 1655 1769 ONLY: eps_sb, hyrho, l_d_cp, prr, pt_d_t, sed_qc_const 1656 1770 1657 USE constants, &1658 ONLY: pi1659 1660 1771 USE control_parameters, & 1661 ONLY: call_microphysics_at_all_substeps, dt_ do2d_xy, dt_micro,&1662 intermediate_timestep_count , precipitation1772 ONLY: call_microphysics_at_all_substeps, dt_micro, & 1773 intermediate_timestep_count 1663 1774 1664 1775 USE indices, & … … 1701 1812 ! 1702 1813 !-- Compute the precipitation rate of cloud (fog) droplets 1703 IF ( precipitation ) THEN 1704 IF ( call_microphysics_at_all_substeps ) THEN 1705 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) * & 1814 IF ( call_microphysics_at_all_substeps ) THEN 1815 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) * & 1706 1816 weight_substep(intermediate_timestep_count) 1707 ELSE 1708 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) 1709 ENDIF 1817 ELSE 1818 prr(k,j,i) = prr(k,j,i) + sed_qc(k) / hyrho(k) 1710 1819 ENDIF 1711 1820 … … 1727 1836 1728 1837 USE cloud_parameters, & 1729 ONLY: a_term, b_term, c_term, cof, dpirho_l, eps_sb, hyrho, & 1730 limiter_sedimentation, l_d_cp, precipitation_amount, prr, & 1731 pt_d_t, stp 1838 ONLY: a_term, b_term, c_term, dpirho_l, eps_sb, hyrho, & 1839 limiter_sedimentation, l_d_cp, prr, pt_d_t 1732 1840 1733 1841 USE control_parameters, & 1734 ONLY: call_microphysics_at_all_substeps, dt_do2d_xy, dt_micro, & 1735 dt_3d, intermediate_timestep_count, & 1736 intermediate_timestep_count_max, & 1737 precipitation_amount_interval, time_do2d_xy 1842 ONLY: call_microphysics_at_all_substeps, dt_micro, & 1843 intermediate_timestep_count 1738 1844 1739 1845 USE indices, & … … 1757 1863 REAL(wp) :: d_min !< 1758 1864 REAL(wp) :: dr !< 1759 REAL(wp) :: dt_sedi !<1760 1865 REAL(wp) :: flux !< 1761 1866 REAL(wp) :: lambda_r !< … … 1765 1870 REAL(wp), DIMENSION(nzb:nzt+1) :: c_nr !< 1766 1871 REAL(wp), DIMENSION(nzb:nzt+1) :: c_qr !< 1767 REAL(wp), DIMENSION(nzb:nzt+1) :: d_nr !<1768 REAL(wp), DIMENSION(nzb:nzt+1) :: d_qr !<1769 1872 REAL(wp), DIMENSION(nzb:nzt+1) :: nr_slope !< 1770 1873 REAL(wp), DIMENSION(nzb:nzt+1) :: qr_slope !< … … 1774 1877 REAL(wp), DIMENSION(nzb:nzt+1) :: w_qr !< 1775 1878 1776 IF ( intermediate_timestep_count == 1 ) prr(:,j,i) = 0.0_wp1777 1879 ! 1778 1880 !-- Compute velocities … … 1939 2041 ONLY: call_microphysics_at_all_substeps, dt_do2d_xy, dt_3d, & 1940 2042 intermediate_timestep_count, intermediate_timestep_count_max,& 1941 precipitation_amount_interval, & 1942 time_do2d_xy 2043 precipitation_amount_interval, time_do2d_xy 1943 2044 1944 2045 USE indices, & -
palm/trunk/SOURCE/mod_particle_attributes.f90
r1728 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! +collision_algorithm, all_or_nothing, average_impact 21 22 ! 22 ! 23 ! Tails removed. 24 ! 23 25 ! Former revisions: 24 26 ! ----------------- … … 47 49 USE kinds 48 50 49 CHARACTER(LEN=15) :: bc_par_lr = 'cyclic', bc_par_ns = 'cyclic', & 50 bc_par_b = 'reflect', bc_par_t = 'absorb', & 51 collision_kernel = 'none' 51 CHARACTER(LEN=15) :: bc_par_lr = 'cyclic' !< left/right boundary condition 52 CHARACTER(LEN=15) :: bc_par_ns = 'cyclic' !< north/south boundary condition 53 CHARACTER(LEN=15) :: bc_par_b = 'reflect' !< bottom boundary condition 54 CHARACTER(LEN=15) :: bc_par_t = 'absorb' !< top boundary condition 55 CHARACTER(LEN=15) :: collision_algorithm = 'all_or_nothing' !< collision algorithm 56 CHARACTER(LEN=15) :: collision_kernel = 'none' !< collision kernel 52 57 53 INTEGER(iwp) :: deleted_particles = 0, deleted_tails = 0,&58 INTEGER(iwp) :: deleted_particles = 0, & 54 59 dissipation_classes = 10, ibc_par_lr, & 55 60 ibc_par_ns, ibc_par_b, ibc_par_t, iran_part = -1234567, & 56 61 maximum_number_of_particles = 0, & 57 maximum_number_of_tailpoints = 100, &58 maximum_number_of_tails = 0, &59 62 min_nr_particle = 50, & 60 63 mpi_particle_type, & 61 64 number_of_particles = 0, & 62 number_of_particle_groups = 1, number_of_tails = 0,&63 number_of_ initial_tails = 0, number_of_sublayers = 20,&65 number_of_particle_groups = 1, & 66 number_of_sublayers = 20, & 64 67 offset_ocean_nzt = 0, & 65 68 offset_ocean_nzt_m1 = 0, particles_per_point = 1, & 66 69 particle_file_count = 0, radius_classes = 20, & 67 s kip_particles_for_tail = 100, sort_count = 0,&68 total_number_of_particles, total_number_of_tails = 0,&70 sort_count = 0, & 71 total_number_of_particles, & 69 72 trlp_count_sum, trlp_count_recv_sum, trrp_count_sum, & 70 73 trrp_count_recv_sum, trsp_count_sum, trsp_count_recv_sum, & … … 73 76 INTEGER(iwp), PARAMETER :: max_number_of_particle_groups = 10 74 77 75 INTEGER(iwp), DIMENSION(:), ALLOCATABLE :: new_tail_id76 78 INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE :: prt_count 77 79 78 LOGICAL :: hall_kernel = .FALSE., palm_kernel = .FALSE., & 80 LOGICAL :: all_or_nothing = .FALSE., average_impact = .FALSE., & 81 hall_kernel = .FALSE., palm_kernel = .FALSE., & 79 82 particle_advection = .FALSE., random_start_position = .FALSE., & 80 83 read_particles_from_restartfile = .TRUE., & 81 84 seed_follows_topography = .FALSE., & 82 85 uniform_particles = .TRUE., use_kernel_tables = .FALSE., & 83 use_ particle_tails = .FALSE., use_sgs_for_particles = .FALSE.,&84 w ang_kernel = .FALSE., write_particle_statistics = .FALSE.86 use_sgs_for_particles = .FALSE., wang_kernel = .FALSE., & 87 write_particle_statistics = .FALSE. 85 88 86 89 LOGICAL, DIMENSION(max_number_of_particle_groups) :: & 87 90 vertical_particle_advection = .TRUE. 88 91 89 LOGICAL, DIMENSION(:), ALLOCATABLE :: tail_mask90 91 92 REAL(wp) :: alloc_factor = 20.0_wp, c_0 = 3.0_wp, & 92 93 dt_min_part = 0.0002_wp, dt_prel = 9999999.9_wp, & 93 94 dt_write_particle_data = 9999999.9_wp, & 94 dvrp_psize = 9999999.9_wp, end_time_prel = 9999999.9_wp,&95 end_time_prel = 9999999.9_wp, & 95 96 initial_weighting_factor = 1.0_wp, & 96 maximum_tailpoint_age = 100000.0_wp, &97 minimum_tailpoint_distance = 0.0_wp, &98 97 particle_advection_start = 0.0_wp, & 99 98 sgs_wfu_part = 0.3333333_wp, sgs_wfv_part = 0.3333333_wp, & … … 108 107 pss = 9999999.9_wp, pst = 9999999.9_wp, radius = 9999999.9_wp 109 108 110 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: particle_tail_coordinates111 112 109 REAL(wp), DIMENSION(:), ALLOCATABLE :: log_z_z0 113 110 114 111 TYPE particle_type 115 112 SEQUENCE 116 #if defined( __twocachelines )117 REAL(wp) :: radius118 REAL(sp) :: x, y, z, speed_x, speed_y, speed_z119 REAL(wp) :: weight_factor, rvar1, dt_sum120 INTEGER(iwp) :: class121 LOGICAL :: particle_mask122 123 REAL(wp) :: dvrp_psize, rvar2, rvar3124 REAL(sp) :: age, origin_x, origin_y, origin_z, e_m, age_m125 INTEGER(iwp) :: group, tailpoints, tail_id, block_nr126 #else127 113 REAL(wp) :: radius, age, age_m, dt_sum, dvrp_psize, e_m, & 128 114 origin_x, origin_y, origin_z, rvar1, rvar2, rvar3, & … … 131 117 LOGICAL :: particle_mask 132 118 INTEGER(iwp) :: block_nr 133 #endif134 !-- One 32 Bit word for 64 Bit alignment in Type declaration135 119 END TYPE particle_type 136 120 137 TYPE(particle_type), DIMENSION(:), POINTER 138 TYPE(particle_type) 121 TYPE(particle_type), DIMENSION(:), POINTER :: particles 122 TYPE(particle_type) :: zero_particle 139 123 140 124 TYPE particle_groups_type -
palm/trunk/SOURCE/modules.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! icloud_scheme removed. microphysics_sat_adjust, microphysics_kessler, 22 ! microphysics_seifert added. 22 23 ! 23 24 ! Former revisions: … … 626 627 bc_sa_t = 'neumann', & 627 628 bc_uv_b = 'dirichlet', bc_uv_t = 'dirichlet', & 628 cloud_scheme = 's eifert_beheng', &629 cloud_scheme = 'saturation_adjust', & 629 630 coupling_mode = 'uncoupled', & 630 631 coupling_mode_remote = 'uncoupled', & … … 665 666 grid_level, ibc_e_b, ibc_p_b, ibc_p_t, & 666 667 ibc_pt_b, ibc_pt_t, ibc_q_b, ibc_q_t, & 667 ibc_sa_t, ibc_uv_b, ibc_uv_t, icloud_scheme,&668 ibc_sa_t, ibc_uv_b, ibc_uv_t, & 668 669 inflow_disturbance_begin = -1, inflow_disturbance_end = -1, & 669 670 intermediate_timestep_count, intermediate_timestep_count_max, & … … 734 735 lsf_vert = .TRUE., lptnudge = .FALSE., lqnudge = .FALSE., & 735 736 lunudge = .FALSE., lvnudge = .FALSE., lwnudge = .FALSE., & 736 masking_method = .FALSE., mg_switch_to_pe0 = .FALSE., & 737 masking_method = .FALSE., & 738 microphysics_sat_adjust = .FALSE., & 739 microphysics_kessler = .FALSE., & 740 microphysics_seifert = .FALSE., & 741 mg_switch_to_pe0 = .FALSE., & 737 742 monotonic_adjustment = .FALSE. 738 743 LOGICAL :: nest_bound_l = .FALSE. !< nested boundary on left side -
palm/trunk/SOURCE/package_parin.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! +collision_algorithm 22 ! 23 ! Tails removed. 22 24 ! 23 25 ! Former revisions: … … 137 139 USE particle_attributes, & 138 140 ONLY: alloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t, & 139 collision_kernel, density_ratio, dissipation_classes, & 140 dt_min_part, dt_prel, dt_write_particle_data, dvrp_psize, & 141 collision_algorithm, collision_kernel, density_ratio, & 142 dissipation_classes, dt_min_part, dt_prel, & 143 dt_write_particle_data, & 141 144 end_time_prel, initial_weighting_factor, & 142 maximum_number_of_tailpoints, &143 maximum_tailpoint_age, minimum_tailpoint_distance, &144 145 min_nr_particle, number_of_particle_groups, particles_per_point,& 145 146 particle_advection, particle_advection_start, pdx, pdy, pdz, & 146 147 psb, psl, psn, psr, pss, pst, radius, radius_classes, & 147 148 random_start_position, read_particles_from_restartfile, & 148 seed_follows_topography, skip_particles_for_tail, & 149 use_particle_tails, use_sgs_for_particles, & 149 seed_follows_topography, use_sgs_for_particles, & 150 150 vertical_particle_advection, write_particle_statistics 151 151 … … 186 186 dt_dvrp, dvrpsize_interval, dvrp_directory, & 187 187 dvrp_file, dvrp_host, dvrp_output, & 188 dvrp_password, dvrp_ psize, dvrp_username,&188 dvrp_password, dvrp_username, & 189 189 groundplate_color, isosurface_color, & 190 190 mode_dvrp, particle_color, particle_dvrpsize,& … … 199 199 200 200 NAMELIST /particles_par/ alloc_factor, bc_par_b, bc_par_lr, & 201 bc_par_ns, bc_par_t, collision_kernel, & 201 bc_par_ns, bc_par_t, collision_algorithm, & 202 collision_kernel, & 202 203 density_ratio, dissipation_classes, dt_dopts,& 203 204 dt_min_part, dt_prel, & 204 205 dt_write_particle_data, & 205 206 end_time_prel, initial_weighting_factor, & 206 maximum_number_of_tailpoints, &207 maximum_tailpoint_age, &208 minimum_tailpoint_distance, &209 207 min_nr_particle, & 210 208 number_of_particle_groups, & … … 216 214 read_particles_from_restartfile, & 217 215 seed_follows_topography, & 218 skip_particles_for_tail, & 219 use_particle_tails, use_sgs_for_particles, & 216 use_sgs_for_particles, & 220 217 vertical_particle_advection, & 221 218 write_particle_statistics -
palm/trunk/SOURCE/prognostic_equations.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! Kessler microphysics scheme moved to microphysics. 22 22 ! 23 23 ! Former revisions: … … 190 190 USE control_parameters, & 191 191 ONLY: call_microphysics_at_all_substeps, cloud_physics, & 192 cloud_top_radiation, constant_diffusion, dp_external, &192 cloud_top_radiation, constant_diffusion, dp_external, & 193 193 dp_level_ind_b, dp_smooth_factor, dpdxy, dt_3d, humidity, & 194 i cloud_scheme, inflow_l, intermediate_timestep_count,&194 inflow_l, intermediate_timestep_count, & 195 195 intermediate_timestep_count_max, large_scale_forcing, & 196 large_scale_subsidence, neutral, nudging, ocean, outflow_l,&197 outflow_s, passive_scalar, precipitation,&198 prho_reference, prho_reference, prho_reference, pt_reference,&199 p t_reference, pt_reference, scalar_advec, scalar_advec,&200 s imulated_time, sloping_surface,&196 large_scale_subsidence, microphysics_seifert, & 197 microphysics_sat_adjust, neutral, nudging, ocean, outflow_l, & 198 outflow_s, passive_scalar, prho_reference, prho_reference, & 199 prho_reference, pt_reference, pt_reference, pt_reference, & 200 scalar_advec, scalar_advec, simulated_time, sloping_surface, & 201 201 timestep_scheme, tsc, use_subsidence_tendencies, & 202 202 use_upstream_for_tke, wall_heatflux, & … … 247 247 USE buoyancy_mod, & 248 248 ONLY: buoyancy, buoyancy_acc 249 250 USE calc_precipitation_mod, &251 ONLY: calc_precipitation252 249 253 250 USE calc_radiation_mod, & … … 271 268 USE diffusion_w_mod, & 272 269 ONLY: diffusion_w, diffusion_w_acc 273 274 USE impact_of_latent_heat_mod, &275 ONLY: impact_of_latent_heat276 270 277 271 USE kinds … … 377 371 DO j = nys, nyn 378 372 ! 379 !-- If required, calculate cloud microphysic al impacts (two-moment scheme)380 IF ( cloud_physics .AND. icloud_scheme == 0 .AND.&373 !-- If required, calculate cloud microphysics 374 IF ( cloud_physics .AND. .NOT. microphysics_sat_adjust .AND. & 381 375 ( intermediate_timestep_count == 1 .OR. & 382 376 call_microphysics_at_all_substeps ) & … … 584 578 IF ( cloud_top_radiation ) THEN 585 579 CALL calc_radiation( i, j ) 586 ENDIF587 588 !589 !-- If required compute impact of latent heat due to precipitation590 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. &591 precipitation ) THEN592 CALL impact_of_latent_heat( i, j )593 580 ENDIF 594 581 … … 729 716 730 717 ! 731 !-- If required compute decrease of total water content due to732 !-- precipitation733 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. &734 precipitation ) THEN735 CALL calc_precipitation( i, j )736 ENDIF737 738 !739 718 !-- Sink or source of scalar concentration due to canopy elements 740 719 IF ( plant_canopy ) CALL plant_canopy_model( i, j, 5 ) … … 788 767 !-- If required, calculate prognostic equations for rain water content 789 768 !-- and rain drop concentration 790 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 791 precipitation ) THEN 769 IF ( cloud_physics .AND. microphysics_seifert ) THEN 792 770 ! 793 771 !-- Calculate prognostic equation for rain water content … … 807 785 CALL diffusion_s( i, j, qr, qrsws, qrswst, wall_qrflux ) 808 786 809 CALL user_actions( i, j, 'qr-tendency' )810 787 ! 811 788 !-- Prognostic equation for rain water content … … 848 825 CALL diffusion_s( i, j, nr, nrsws, nrswst, wall_nrflux ) 849 826 850 CALL user_actions( i, j, 'nr-tendency' )851 827 ! 852 828 !-- Prognostic equation for rain drop concentration … … 971 947 972 948 ! 973 !-- If required, calculate cloud microphysical impacts (two-moment scheme)974 IF ( cloud_physics .AND. icloud_scheme == 0 .AND.&949 !-- If required, calculate cloud microphysical impacts 950 IF ( cloud_physics .AND. .NOT. microphysics_sat_adjust .AND. & 975 951 ( intermediate_timestep_count == 1 .OR. & 976 952 call_microphysics_at_all_substeps ) & … … 1254 1230 1255 1231 ! 1256 !-- If required compute impact of latent heat due to precipitation1257 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. precipitation ) THEN1258 CALL impact_of_latent_heat1259 ENDIF1260 1261 !1262 1232 !-- Consideration of heat sources within the plant canopy 1263 1233 IF ( plant_canopy .AND. ( cthf /= 0.0_wp ) ) THEN … … 1459 1429 1460 1430 ! 1461 !-- If required compute decrease of total water content due to1462 !-- precipitation1463 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. precipitation ) THEN1464 CALL calc_precipitation1465 ENDIF1466 1467 !1468 1431 !-- Sink or source of scalar concentration due to canopy elements 1469 1432 IF ( plant_canopy ) CALL plant_canopy_model( 5 ) … … 1530 1493 !-- If required, calculate prognostic equations for rain water content 1531 1494 !-- and rain drop concentration 1532 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. precipitation) THEN1495 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1533 1496 1534 1497 CALL cpu_log( log_point(52), 'qr-equation', 'start' ) … … 1565 1528 1566 1529 CALL diffusion_s( qr, qrsws, qrswst, wall_qrflux ) 1567 1568 CALL user_actions( 'qr-tendency' )1569 1530 1570 1531 ! … … 1639 1600 1640 1601 CALL diffusion_s( nr, nrsws, nrswst, wall_nrflux ) 1641 1642 CALL user_actions( 'nr-tendency' )1643 1602 1644 1603 ! … … 1821 1780 ! 1822 1781 !-- If required, calculate cloud microphysical impacts (two-moment scheme) 1823 IF ( cloud_physics .AND. icloud_scheme == 0 .AND.&1782 IF ( cloud_physics .AND. .NOT. microphysics_sat_adjust .AND. & 1824 1783 ( intermediate_timestep_count == 1 .OR. & 1825 1784 call_microphysics_at_all_substeps ) & … … 2079 2038 2080 2039 ! 2081 !-- If required compute impact of latent heat due to precipitation2082 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. precipitation ) THEN2083 CALL impact_of_latent_heat2084 ENDIF2085 2086 !2087 2040 !-- Consideration of heat sources within the plant canopy 2088 2041 IF ( plant_canopy .AND. ( cthf /= 0.0_wp ) ) THEN … … 2256 2209 2257 2210 ! 2258 !-- If required compute decrease of total water content due to2259 !-- precipitation2260 IF ( cloud_physics .AND. icloud_scheme == 1 .AND. precipitation ) THEN2261 CALL calc_precipitation2262 ENDIF2263 2264 !2265 2211 !-- Sink or source of scalar concentration due to canopy elements 2266 2212 IF ( plant_canopy ) CALL plant_canopy_model( 5 ) … … 2311 2257 !-- If required, calculate prognostic equations for rain water content 2312 2258 !-- and rain drop concentration 2313 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. precipitation) THEN2259 IF ( cloud_physics .AND. microphysics_seifert ) THEN 2314 2260 2315 2261 CALL cpu_log( log_point(52), 'qr-equation', 'start' ) … … 2346 2292 CALL diffusion_s( qr, qrsws, qrswst, wall_qrflux ) 2347 2293 2348 CALL user_actions( 'qr-tendency' )2349 2350 2294 ! 2351 2295 !-- Prognostic equation for rain water content … … 2403 2347 2404 2348 CALL diffusion_s( nr, nrsws, nrswst, wall_nrflux ) 2405 2406 CALL user_actions( 'nr-tendency' )2407 2349 2408 2350 ! -
palm/trunk/SOURCE/surface_layer_fluxes.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 134 134 USE control_parameters, & 135 135 ONLY: cloud_physics, constant_heatflux, constant_waterflux, & 136 coupling_mode, g, humidity, ibc_e_b, ibc_pt_b, icloud_scheme,&136 coupling_mode, g, humidity, ibc_e_b, ibc_pt_b, & 137 137 initializing_actions, kappa, intermediate_timestep_count, & 138 138 intermediate_timestep_count_max, large_scale_forcing, lsf_surf, & 139 message_string, m ost_method, neutral, passive_scalar,&140 p recipitation, pt_surface, q_surface, run_coupled,&139 message_string, microphysics_seifert, most_method, neutral, & 140 passive_scalar, pt_surface, q_surface, run_coupled, & 141 141 surface_pressure, simulated_time, terminate_run, zeta_max, & 142 142 zeta_min … … 906 906 ! 907 907 !-- If required compute qr* and nr* 908 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. precipitation) &908 IF ( cloud_physics .AND. microphysics_seifert ) & 909 909 THEN 910 910 … … 1040 1040 ! 1041 1041 !-- Compute (turbulent) fluxes of rain water content and rain drop conc. 1042 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 1043 precipitation ) THEN 1042 IF ( cloud_physics .AND. microphysics_seifert ) THEN 1044 1043 !$OMP PARALLEL DO 1045 1044 !$acc kernels loop independent present( nrs, nrsws, qrs, qrsws, us ) -
palm/trunk/SOURCE/swap_timelevel.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 97 97 98 98 USE control_parameters, & 99 ONLY: cloud_physics, constant_diffusion, humidity, icloud_scheme, & 100 neutral, ocean, passive_scalar, precipitation, timestep_count 99 ONLY: cloud_physics, constant_diffusion, humidity, & 100 microphysics_seifert, neutral, ocean, passive_scalar, & 101 timestep_count 101 102 102 103 USE indices, & … … 160 161 IF ( humidity .OR. passive_scalar ) THEN 161 162 q = q_p 162 IF ( cloud_physics .AND. icloud_scheme == 0) THEN163 IF ( cloud_physics .AND. microphysics_seifert ) THEN 163 164 qr = qr_p 164 165 nr = nr_p … … 193 194 IF ( humidity .OR. passive_scalar ) THEN 194 195 q => q_1; q_p => q_2 195 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 196 precipitation ) THEN 196 IF ( cloud_physics .AND. microphysics_seifert ) THEN 197 197 qr => qr_1; qr_p => qr_2 198 198 nr => nr_1; nr_p => nr_2 … … 222 222 IF ( humidity .OR. passive_scalar ) THEN 223 223 q => q_2; q_p => q_1 224 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 225 precipitation) THEN 224 IF ( cloud_physics .AND. microphysics_seifert ) THEN 226 225 qr => qr_2; qr_p => qr_1 227 226 nr => nr_2; nr_p => nr_1 -
palm/trunk/SOURCE/time_integration.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 213 213 dt_dopr_listing, dt_dosp, dt_dots, dt_dvrp, dt_run_control, & 214 214 end_time, first_call_lpm, galilei_transformation, humidity, & 215 i cloud_scheme, intermediate_timestep_count,&215 intermediate_timestep_count, & 216 216 intermediate_timestep_count_max, large_scale_forcing, & 217 loop_optimization, lsf_surf, lsf_vert, masks, mid, nest_domain, & 217 loop_optimization, lsf_surf, lsf_vert, masks, & 218 microphysics_seifert, mid, nest_domain, & 218 219 neutral, nr_timesteps_this_run, nudging, & 219 ocean, on_device, passive_scalar, precipitation,&220 ocean, on_device, passive_scalar, & 220 221 prho_reference, pt_reference, pt_slope_offset, random_heatflux, & 221 222 run_coupled, simulated_time, simulated_time_chr, & … … 486 487 IF (humidity .OR. passive_scalar) THEN 487 488 CALL exchange_horiz( q_p, nbgp ) 488 IF ( cloud_physics .AND. icloud_scheme == 0) THEN489 IF ( cloud_physics .AND. microphysics_seifert ) THEN 489 490 CALL exchange_horiz( qr_p, nbgp ) 490 491 CALL exchange_horiz( nr_p, nbgp ) … … 553 554 IF (humidity .OR. passive_scalar) THEN 554 555 CALL exchange_horiz( q_p, nbgp ) 555 IF ( cloud_physics .AND. icloud_scheme == 0) THEN556 IF ( cloud_physics .AND. microphysics_seifert ) THEN 556 557 CALL exchange_horiz( qr_p, nbgp ) 557 558 CALL exchange_horiz( nr_p, nbgp ) … … 642 643 IF (humidity .OR. passive_scalar) THEN 643 644 CALL exchange_horiz( q_p, nbgp ) 644 IF ( cloud_physics .AND. icloud_scheme == 0 .AND. & 645 precipitation ) THEN 645 IF ( cloud_physics .AND. microphysics_seifert ) THEN 646 646 CALL exchange_horiz( qr_p, nbgp ) 647 647 CALL exchange_horiz( nr_p, nbgp ) -
palm/trunk/SOURCE/user_actions.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ------------------ 21 ! 21 ! qr/nr-tendency removed. 22 22 ! 23 23 ! Former revisions: … … 161 161 162 162 163 CASE ( 'qr-tendency' )164 165 166 CASE ( 'nr-tendency' )167 168 169 163 CASE DEFAULT 170 164 message_string = 'unknown location "' // location // '"' … … 225 219 226 220 227 CASE ( 'qr-tendency' )228 229 230 CASE ( 'nr-tendency' )231 232 233 221 CASE ( 'before_timestep', 'after_integration', 'after_timestep' ) 234 222 message_string = 'location "' // location // '" is not ' // & -
palm/trunk/SOURCE/write_3d_binary.f90
r1818 r1822 19 19 ! Current revisions: 20 20 ! ----------------- 21 ! 21 ! icloud_scheme replaced by microphysics_* 22 22 ! 23 23 ! Former revisions: … … 102 102 USE control_parameters, & 103 103 ONLY: iran, humidity, passive_scalar, cloud_physics, cloud_droplets, & 104 icloud_scheme, precipitation, ocean, topography104 microphysics_seifert, ocean, topography 105 105 106 106 USE indices, & … … 240 240 WRITE ( 14 ) 'ql_av '; WRITE ( 14 ) ql_av 241 241 ENDIF 242 IF ( icloud_scheme == 0 .AND..NOT. cloud_droplets ) THEN242 IF ( .NOT. cloud_droplets ) THEN 243 243 WRITE ( 14 ) 'qc '; WRITE ( 14 ) qc 244 244 IF ( ALLOCATED( qc_av ) ) THEN 245 245 WRITE ( 14 ) 'qc_av '; WRITE ( 14 ) qc_av 246 246 ENDIF 247 IF ( precipitation) THEN247 IF ( microphysics_seifert ) THEN 248 248 WRITE ( 14 ) 'nr '; WRITE ( 14 ) nr 249 249 IF ( ALLOCATED( nr_av ) ) THEN
Note: See TracChangeset
for help on using the changeset viewer.