Changeset 2312
- Timestamp:
- Jul 14, 2017 8:26:51 PM (7 years ago)
- Location:
- palm/trunk/SOURCE
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/check_parameters.f90
r2300 r2312 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! PA0349 and PA0420 removed. 28 ! 29 ! 2300 2017-06-29 13:31:14Z raasch 27 30 ! host-specific settings and checks removed 28 ! 31 ! 29 32 ! 2292 2017-06-20 09:51:42Z schwenkel 30 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 31 ! includes two more prognostic equations for cloud drop concentration (nc) 32 ! and cloud water content (qc). 33 ! 33 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 34 ! includes two more prognostic equations for cloud drop concentration (nc) 35 ! and cloud water content (qc). 36 ! 34 37 ! 2274 2017-06-09 13:27:48Z Giersch 35 ! Changed error messages 36 ! 38 ! Changed error messages 39 ! 37 40 ! 2271 2017-06-09 12:34:55Z sward 38 41 ! roughness-length check altered 39 42 ! Error messages fixed 40 ! 43 ! 41 44 ! 2270 2017-06-09 12:18:47Z maronga 42 45 ! Revised numbering (removed 2 timeseries) 43 ! 46 ! 44 47 ! 2259 2017-06-08 09:09:11Z gronemeier 45 48 ! Implemented synthetic turbulence generator … … 50 53 ! Doxygen comment added 51 54 ! 52 ! 2248 2017-06-06 13:52:54Z sward 55 ! 2248 2017-06-06 13:52:54Z sward 53 56 ! Error message fixed 54 57 ! 55 58 ! 2209 2017-04-19 09:34:46Z kanani 56 59 ! Check for plant canopy model output 57 ! 60 ! 58 61 ! 2200 2017-04-11 11:37:51Z suehring 59 62 ! monotonic_adjustment removed 60 ! 63 ! 61 64 ! 2178 2017-03-17 11:07:39Z hellstea 62 65 ! Index limits for perturbations are now set also in case of nested … … 65 68 ! 2169 2017-03-06 18:16:35Z suehring 66 69 ! Bugfix, move setting for topography grid convention to init_grid 67 ! 70 ! 68 71 ! 2118 2017-01-17 16:38:49Z raasch 69 72 ! OpenACC related parts of code removed 70 ! 73 ! 71 74 ! 2088 2016-12-19 16:30:25Z suehring 72 75 ! Bugfix in initial salinity profile 73 ! 76 ! 74 77 ! 2084 2016-12-09 15:59:42Z knoop 75 78 ! Removed anelastic + multigrid error message 76 ! 79 ! 77 80 ! 2052 2016-11-08 15:14:59Z gronemeier 78 81 ! Bugfix: remove setting of default value for recycling_width 79 ! 82 ! 80 83 ! 2050 2016-11-08 15:00:55Z gronemeier 81 84 ! Implement turbulent outflow condition 82 ! 85 ! 83 86 ! 2044 2016-11-02 16:44:25Z knoop 84 87 ! Added error code for anelastic approximation 85 ! 88 ! 86 89 ! 2042 2016-11-02 13:47:31Z suehring 87 90 ! Additional checks for wall_heatflux, wall_humidityflux and wall_scalarflux. 88 91 ! Bugfix, check for constant_scalarflux. 89 ! 92 ! 90 93 ! 2040 2016-10-26 16:58:09Z gronemeier 91 94 ! Removed check for statistic_regions > 9. 92 ! 95 ! 93 96 ! 2037 2016-10-26 11:15:40Z knoop 94 97 ! Anelastic approximation implemented 95 ! 98 ! 96 99 ! 2031 2016-10-21 15:11:58Z knoop 97 100 ! renamed variable rho to rho_ocean 98 ! 101 ! 99 102 ! 2026 2016-10-18 10:27:02Z suehring 100 103 ! Bugfix, enable output of s*2 101 ! 104 ! 102 105 ! 2024 2016-10-12 16:42:37Z kanani 103 106 ! Added missing CASE, error message and unit for ssws*, 104 107 ! increased number of possible output quantities to 500. 105 ! 108 ! 106 109 ! 2011 2016-09-19 17:29:57Z kanani 107 110 ! Flag urban_surface is now defined in module control_parameters, 108 111 ! changed prefix for urban surface model output to "usm_", 109 ! added flag lsf_exception (inipar-Namelist parameter) to allow explicit 112 ! added flag lsf_exception (inipar-Namelist parameter) to allow explicit 110 113 ! enabling of large scale forcing together with buildings on flat terrain, 111 114 ! introduced control parameter varnamelength for LEN of var. 112 ! 115 ! 113 116 ! 2007 2016-08-24 15:47:17Z kanani 114 117 ! Added checks for the urban surface model, 115 118 ! increased counter in DO WHILE loop over data_output (for urban surface output) 116 ! 119 ! 117 120 ! 2000 2016-08-20 18:09:15Z knoop 118 121 ! Forced header and separation lines into 80 columns 119 ! 122 ! 120 123 ! 1994 2016-08-15 09:52:21Z suehring 121 124 ! Add missing check for cloud_physics and cloud_droplets 122 ! 125 ! 123 126 ! 1992 2016-08-12 15:14:59Z suehring 124 127 ! New checks for top_scalarflux 125 128 ! Bugfixes concerning data output of profiles in case of passive_scalar 126 ! 129 ! 127 130 ! 1984 2016-08-01 14:48:05Z suehring 128 131 ! Bugfix: checking for bottom and top boundary condition for humidity and scalars 129 ! 132 ! 130 133 ! 1972 2016-07-26 07:52:02Z maronga 131 134 ! Removed check of lai* (done in land surface module) 132 ! 135 ! 133 136 ! 1970 2016-07-18 14:27:12Z suehring 134 137 ! Bugfix, check for ibc_q_b and constant_waterflux in case of land-surface scheme 135 ! 138 ! 136 139 ! 1962 2016-07-13 09:16:44Z suehring 137 140 ! typo removed 138 ! 141 ! 139 142 ! 1960 2016-07-12 16:34:24Z suehring 140 143 ! Separate checks and calculations for humidity and passive scalar. Therefore, 141 144 ! a subroutine to calculate vertical gradients is introduced, in order to reduce 142 ! redundance. 145 ! redundance. 143 146 ! Additional check - large-scale forcing is not implemented for passive scalars 144 147 ! so far. 145 ! 148 ! 146 149 ! 1931 2016-06-10 12:06:59Z suehring 147 150 ! Rename multigrid into multigrid_noopt and multigrid_fast into multigrid … … 158 161 ! 1841 2016-04-07 19:14:06Z raasch 159 162 ! redundant location message removed 160 ! 163 ! 161 164 ! 1833 2016-04-07 14:23:03Z raasch 162 165 ! check of spectra quantities moved to spectra_mod 163 ! 166 ! 164 167 ! 1829 2016-04-07 12:16:29Z maronga 165 168 ! Bugfix: output of user defined data required reset of the string 'unit' 166 ! 169 ! 167 170 ! 1826 2016-04-07 12:01:39Z maronga 168 171 ! Moved checks for radiation model to the respective module. … … 172 175 ! 1824 2016-04-07 09:55:29Z gronemeier 173 176 ! Check if roughness_length < dz/2. Moved location_message(finished) to the end. 174 ! 177 ! 175 178 ! 1822 2016-04-07 07:49:42Z hoffmann 176 179 ! PALM collision kernel deleted. Collision algorithms are checked for correct … … 186 189 ! 1817 2016-04-06 15:44:20Z maronga 187 190 ! Moved checks for land_surface model to the respective module 188 ! 191 ! 189 192 ! 1806 2016-04-05 18:55:35Z gronemeier 190 193 ! Check for recycling_yshift … … 200 203 ! surface presribed in the land surface model. Added output of z0q. 201 204 ! Syntax layout improved. 202 ! 205 ! 203 206 ! 1786 2016-03-08 05:49:27Z raasch 204 207 ! cpp-direktives for spectra removed, check of spectra level removed … … 217 220 ! 1745 2016-02-05 13:06:51Z gronemeier 218 221 ! Bugfix: check data output intervals to be /= 0.0 in case of parallel NetCDF4 219 ! 222 ! 220 223 ! 1701 2015-11-02 07:43:04Z maronga 221 224 ! Bugfix: definition of rad_net timeseries was missing 222 ! 225 ! 223 226 ! 1691 2015-10-26 16:17:44Z maronga 224 ! Added output of Obukhov length (ol) and radiative heating rates for RRTMG. 227 ! Added output of Obukhov length (ol) and radiative heating rates for RRTMG. 225 228 ! Added checks for use of radiation / lsm with topography. 226 ! 229 ! 227 230 ! 1682 2015-10-07 23:56:08Z knoop 228 ! Code annotations made doxygen readable 229 ! 231 ! Code annotations made doxygen readable 232 ! 230 233 ! 1606 2015-06-29 10:43:37Z maronga 231 234 ! Added check for use of RRTMG without netCDF. 232 ! 235 ! 233 236 ! 1587 2015-05-04 14:19:01Z maronga 234 237 ! Added check for set of albedos when using RRTMG 235 ! 238 ! 236 239 ! 1585 2015-04-30 07:05:52Z maronga 237 240 ! Added support for RRTMG … … 248 251 ! 1555 2015-03-04 17:44:27Z maronga 249 252 ! Added output of r_a and r_s. Renumbering of LSM PA-messages. 250 ! 253 ! 251 254 ! 1553 2015-03-03 17:33:54Z maronga 252 255 ! Removed check for missing soil temperature profile as default values were added. 253 ! 256 ! 254 257 ! 1551 2015-03-03 14:18:16Z maronga 255 258 ! Added various checks for land surface and radiation model. In the course of this 256 259 ! action, the length of the variable var has to be increased 257 ! 260 ! 258 261 ! 1504 2014-12-04 09:23:49Z maronga 259 262 ! Bugfix: check for large_scale forcing got lost. 260 ! 263 ! 261 264 ! 1500 2014-12-03 17:42:41Z maronga 262 265 ! Boundary conditions changed to dirichlet for land surface model … … 264 267 ! 1496 2014-12-02 17:25:50Z maronga 265 268 ! Added checks for the land surface model 266 ! 269 ! 267 270 ! 1484 2014-10-21 10:53:05Z kanani 268 271 ! Changes due to new module structure of the plant canopy model: 269 272 ! module plant_canopy_model_mod added, 270 ! checks regarding usage of new method for leaf area density profile 273 ! checks regarding usage of new method for leaf area density profile 271 274 ! construction added, 272 ! lad-profile construction moved to new subroutine init_plant_canopy within 275 ! lad-profile construction moved to new subroutine init_plant_canopy within 273 276 ! the module plant_canopy_model_mod, 274 277 ! drag_coefficient renamed to canopy_drag_coeff. 275 278 ! Missing KIND-attribute for REAL constant added 276 ! 279 ! 277 280 ! 1455 2014-08-29 10:47:47Z heinze 278 ! empty time records in volume, cross-section and masked data output prevented 281 ! empty time records in volume, cross-section and masked data output prevented 279 282 ! in case of non-parallel netcdf-output in restart runs 280 ! 283 ! 281 284 ! 1429 2014-07-15 12:53:45Z knoop 282 285 ! run_description_header exended to provide ensemble_member_nr if specified 283 ! 286 ! 284 287 ! 1425 2014-07-05 10:57:53Z knoop 285 288 ! bugfix: perturbation domain modified for parallel random number generator 286 ! 289 ! 287 290 ! 1402 2014-05-09 14:25:13Z raasch 288 291 ! location messages modified 289 ! 292 ! 290 293 ! 1400 2014-05-09 14:03:54Z knoop 291 294 ! Check random generator extended by option random-parallel 292 ! 295 ! 293 296 ! 1384 2014-05-02 14:31:06Z raasch 294 297 ! location messages added 295 ! 298 ! 296 299 ! 1365 2014-04-22 15:03:56Z boeske 297 300 ! Usage of large scale forcing for pt and q enabled: 298 ! output for profiles of large scale advection (td_lsa_lpt, td_lsa_q), 299 ! large scale subsidence (td_sub_lpt, td_sub_q) 301 ! output for profiles of large scale advection (td_lsa_lpt, td_lsa_q), 302 ! large scale subsidence (td_sub_lpt, td_sub_q) 300 303 ! and nudging tendencies (td_nud_lpt, td_nud_q, td_nud_u and td_nud_v) added, 301 304 ! check if use_subsidence_tendencies is used correctly 302 ! 305 ! 303 306 ! 1361 2014-04-16 15:17:48Z hoffmann 304 307 ! PA0363 removed 305 ! PA0362 changed 308 ! PA0362 changed 306 309 ! 307 310 ! 1359 2014-04-11 17:15:14Z hoffmann … … 310 313 ! 311 314 ! PA0084 not necessary for new particle structure 312 ! 315 ! 313 316 ! 1353 2014-04-08 15:21:23Z heinze 314 317 ! REAL constants provided with KIND-attribute 315 ! 318 ! 316 319 ! 1330 2014-03-24 17:29:32Z suehring 317 ! In case of SGS-particle velocity advection of TKE is also allowed with 320 ! In case of SGS-particle velocity advection of TKE is also allowed with 318 321 ! dissipative 5th-order scheme. 319 ! 322 ! 320 323 ! 1327 2014-03-21 11:00:16Z raasch 321 324 ! "baroclinicity" renamed "baroclinity", "ocean version" replaced by "ocean mode" … … 348 351 ! 1241 2013-10-30 11:36:58Z heinze 349 352 ! output for profiles of ug and vg added 350 ! set surface_heatflux and surface_waterflux also in dependence on 353 ! set surface_heatflux and surface_waterflux also in dependence on 351 354 ! large_scale_forcing 352 355 ! checks for nudging and large scale forcing from external file … … 395 398 ! 396 399 ! 1065 2012-11-22 17:42:36Z hoffmann 397 ! Bugfix: It is not allowed to use cloud_scheme = seifert_beheng without 400 ! Bugfix: It is not allowed to use cloud_scheme = seifert_beheng without 398 401 ! precipitation in order to save computational resources. 399 402 ! … … 405 408 ! - check cloud physics scheme (Kessler or Seifert and Beheng) 406 409 ! - plant_canopy is not allowed 407 ! - currently, only cache loop_optimization is allowed 410 ! - currently, only cache loop_optimization is allowed 408 411 ! - initial profiles of nr, qr 409 412 ! - boundary condition of nr, qr … … 483 486 !------------------------------------------------------------------------------! 484 487 SUBROUTINE check_parameters 485 488 486 489 487 490 USE arrays_3d … … 507 510 USE plant_canopy_model_mod, & 508 511 ONLY: pcm_check_data_output, pcm_check_parameters, plant_canopy 509 512 510 513 USE pmc_interface, & 511 514 ONLY: cpl_id, nested_run … … 531 534 IMPLICIT NONE 532 535 533 CHARACTER (LEN=1) :: sq !< 534 CHARACTER (LEN=varnamelength) :: var !< 536 CHARACTER (LEN=1) :: sq !< 537 CHARACTER (LEN=varnamelength) :: var !< 535 538 CHARACTER (LEN=7) :: unit !< 536 CHARACTER (LEN=8) :: date !< 537 CHARACTER (LEN=10) :: time !< 539 CHARACTER (LEN=8) :: date !< 540 CHARACTER (LEN=10) :: time !< 538 541 CHARACTER (LEN=20) :: ensemble_string !< 539 542 CHARACTER (LEN=15) :: nest_string !< 540 CHARACTER (LEN=40) :: coupling_string !< 541 CHARACTER (LEN=100) :: action !< 542 543 INTEGER(iwp) :: i !< 543 CHARACTER (LEN=40) :: coupling_string !< 544 CHARACTER (LEN=100) :: action !< 545 546 INTEGER(iwp) :: i !< 544 547 INTEGER(iwp) :: ilen !< 545 INTEGER(iwp) :: j !< 546 INTEGER(iwp) :: k !< 547 INTEGER(iwp) :: kk !< 548 INTEGER(iwp) :: netcdf_data_format_save !< 548 INTEGER(iwp) :: j !< 549 INTEGER(iwp) :: k !< 550 INTEGER(iwp) :: kk !< 551 INTEGER(iwp) :: netcdf_data_format_save !< 549 552 INTEGER(iwp) :: position !< 550 551 LOGICAL :: found !< 552 553 REAL(wp) :: dum !< 554 REAL(wp) :: gradient !< 555 REAL(wp) :: remote = 0.0_wp !< 556 REAL(wp) :: simulation_time_since_reference !< 553 554 LOGICAL :: found !< 555 556 REAL(wp) :: dum !< 557 REAL(wp) :: gradient !< 558 REAL(wp) :: remote = 0.0_wp !< 559 REAL(wp) :: simulation_time_since_reference !< 557 560 558 561 … … 568 571 !-- Check the coupling mode 569 572 !> @todo Check if any queries for other coupling modes (e.g. precursor_ocean) are missing 570 IF ( coupling_mode /= 'uncoupled' .AND. & 571 coupling_mode /= 'atmosphere_to_ocean' .AND. & 572 coupling_mode /= 'ocean_to_atmosphere' ) THEN 573 IF ( coupling_mode /= 'uncoupled' .AND. & 574 coupling_mode /= 'atmosphere_to_ocean' .AND. & 575 coupling_mode /= 'ocean_to_atmosphere' ) THEN 573 576 message_string = 'illegal coupling mode: ' // TRIM( coupling_mode ) 574 577 CALL message( 'check_parameters', 'PA0002', 1, 2, 0, 6, 0 ) … … 590 593 !-- NOTE: coupled runs have not been implemented in the check_namelist_files 591 594 !-- program. 592 !-- check_namelist_files will need the following information of the other 595 !-- check_namelist_files will need the following information of the other 593 596 !-- model (atmosphere/ocean). 594 597 ! dt_coupling = remote … … 607 610 ENDIF 608 611 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 609 612 610 613 IF ( dt_coupling /= remote ) THEN 611 614 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 620 623 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 19, comm_inter, & 621 624 status, ierr ) 622 ENDIF 625 ENDIF 623 626 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 624 627 625 628 dt_coupling = MAX( dt_max, remote ) 626 629 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 635 638 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 12, comm_inter, & 636 639 status, ierr ) 637 ENDIF 640 ENDIF 638 641 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 639 642 640 643 IF ( restart_time /= remote ) THEN 641 644 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 650 653 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 13, comm_inter, & 651 654 status, ierr ) 652 ENDIF 655 ENDIF 653 656 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 654 657 655 658 IF ( dt_restart /= remote ) THEN 656 659 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 666 669 14, comm_inter, ierr ) 667 670 CALL MPI_RECV( remote, 1, MPI_REAL, target_id, 14, comm_inter, & 668 status, ierr ) 669 ENDIF 671 status, ierr ) 672 ENDIF 670 673 CALL MPI_BCAST( remote, 1, MPI_REAL, 0, comm2d, ierr) 671 674 672 675 IF ( simulation_time_since_reference /= remote ) THEN 673 676 WRITE( message_string, * ) 'coupling mode "', TRIM( coupling_mode ), & … … 730 733 WRITE( message_string, * ) 'coupling mode "', & 731 734 TRIM( coupling_mode ), & 732 '": nx+1 in ocean is not divisible by nx+1 in', & 735 '": nx+1 in ocean is not divisible by nx+1 in', & 733 736 ' atmosphere without remainder' 734 737 CALL message( 'check_parameters', 'PA0339', 1, 2, 0, 6, 0 ) … … 738 741 WRITE( message_string, * ) 'coupling mode "', & 739 742 TRIM( coupling_mode ), & 740 '": ny+1 in ocean is not divisible by ny+1 in', & 743 '": ny+1 in ocean is not divisible by ny+1 in', & 741 744 ' atmosphere without remainder' 742 745 … … 763 766 ENDIF 764 767 CALL MPI_BCAST( humidity_remote, 1, MPI_LOGICAL, 0, comm2d, ierr) 765 768 766 769 #endif 767 770 … … 932 935 flux_output_mode = 'dynamic' 933 936 ENDIF 934 937 935 938 ! 936 939 !-- set the flux output units according to flux_output_mode … … 1024 1027 CALL message( 'check_parameters', 'PA0021', 1, 2, 0, 6, 0 ) 1025 1028 ENDIF 1026 1027 IF( momentum_advec == 'ws-scheme' .AND. & 1029 1030 IF( momentum_advec == 'ws-scheme' .AND. & 1028 1031 .NOT. call_psolver_at_all_substeps ) THEN 1029 1032 message_string = 'psolver must be called at each RK3 substep when "'// & … … 1074 1077 ENDIF 1075 1078 1076 IF ( use_sgs_for_particles .AND. curvature_solution_effects ) THEN1077 message_string = 'use_sgs_for_particles = .TRUE. not allowed with ' // &1078 'curvature_solution_effects = .TRUE.'1079 CALL message( 'check_parameters', 'PA0349', 1, 2, 0, 6, 0 )1080 ENDIF1081 1082 1079 ! 1083 1080 !-- Set LOGICAL switches to enhance performance … … 1114 1111 ENDIF 1115 1112 ! 1116 !-- Check for proper settings for microphysics 1113 !-- Check for proper settings for microphysics 1117 1114 IF ( cloud_physics .AND. cloud_droplets ) THEN 1118 1115 message_string = 'cloud_physics = .TRUE. is not allowed with ' // & … … 1141 1138 END SELECT 1142 1139 IF ( collision_kernel(6:9) == 'fast' ) use_kernel_tables = .TRUE. 1143 1144 !1145 !-- Collision algorithms:1146 SELECT CASE ( TRIM( collision_algorithm ) )1147 1148 CASE ( 'all_or_nothing' )1149 all_or_nothing = .TRUE.1150 1151 CASE ( 'average_impact' )1152 average_impact = .TRUE.1153 1154 CASE DEFAULT1155 message_string = 'unknown collision algorithm: collision_algorithm = "' // &1156 TRIM( collision_algorithm ) // '"'1157 CALL message( 'check_parameters', 'PA0420', 1, 2, 0, 6, 0 )1158 1159 END SELECT1160 1140 1161 1141 IF ( TRIM( initializing_actions ) /= 'read_restart_data' .AND. & … … 1186 1166 ' is not allowed with conserve_volume_flow = .T.' 1187 1167 CALL message( 'check_parameters', 'PA0343', 1, 2, 0, 6, 0 ) 1188 ENDIF 1168 ENDIF 1189 1169 1190 1170 … … 1229 1209 !-- When plant canopy model is used, peform addtional checks 1230 1210 IF ( plant_canopy ) CALL pcm_check_parameters 1231 1211 1232 1212 ! 1233 1213 !-- Additional checks for spectra … … 1255 1235 'loop_optimization = "cache" or "vector"' 1256 1236 CALL message( 'check_parameters', 'PA0362', 1, 2, 0, 6, 0 ) 1257 ENDIF 1237 ENDIF 1258 1238 1259 1239 ! … … 1288 1268 i = i + 1 1289 1269 ENDIF 1290 ENDIF 1270 ENDIF 1291 1271 IF ( gradient /= 0.0_wp ) THEN 1292 1272 IF ( k /= 1 ) THEN … … 1331 1311 IF ( ug_vertical_gradient_level(1) == -9999999.9_wp ) THEN 1332 1312 ug_vertical_gradient_level(1) = 0.0_wp 1333 ENDIF 1313 ENDIF 1334 1314 1335 1315 ! … … 1345 1325 vg(0) = vg_surface 1346 1326 DO k = 1, nzt+1 1347 IF ( i < 11 ) THEN 1327 IF ( i < 11 ) THEN 1348 1328 IF ( vg_vertical_gradient_level(i) < zu(k) .AND. & 1349 1329 vg_vertical_gradient_level(i) >= 0.0_wp ) THEN … … 1482 1462 ENDIF 1483 1463 1484 1464 1485 1465 ENDIF 1486 1466 … … 1522 1502 CALL message( 'check_parameters', 'PA0381', 1, 2, 0, 6, 0 ) 1523 1503 ENDIF 1524 ENDIF 1504 ENDIF 1525 1505 1526 1506 ! … … 1616 1596 IF ( use_ug_for_galilei_tr .AND. & 1617 1597 ug_vertical_gradient_level(1) == 0.0_wp .AND. & 1618 ug_vertical_gradient(1) == 0.0_wp .AND. & 1598 ug_vertical_gradient(1) == 0.0_wp .AND. & 1619 1599 vg_vertical_gradient_level(1) == 0.0_wp .AND. & 1620 1600 vg_vertical_gradient(1) == 0.0_wp ) THEN … … 1913 1893 1914 1894 ENDIF 1915 1895 1916 1896 IF ( passive_scalar ) THEN 1917 1897 … … 1934 1914 ! 1935 1915 !-- A fixed scalar concentration at the top implies Dirichlet boundary 1936 !-- condition for scalar. Hence, in this case specification of a constant 1916 !-- condition for scalar. Hence, in this case specification of a constant 1937 1917 !-- scalar flux is forbidden. 1938 1918 IF ( ( ibc_s_t == 0 .OR. ibc_s_t == 2 ) .AND. constant_top_scalarflux & … … 2652 2632 dopr_unit(i) = TRIM ( heatflux_output_unit ) 2653 2633 hom(:,2,61,:) = SPREAD( zu, 2, statistic_regions+1 ) 2654 2634 2655 2635 CASE ( 'v*pt*' ) 2656 2636 dopr_index(i) = 62 … … 2976 2956 ENDIF 2977 2957 2978 2958 2979 2959 2980 2960 CASE DEFAULT … … 2987 2967 unit, dopr_unit(i) ) 2988 2968 ENDIF 2989 2969 2990 2970 IF ( unit == 'illegal' ) THEN 2991 2971 unit = '' … … 3251 3231 'res passive_scalar = .TRUE.' 3252 3232 CALL message( 'check_parameters', 'PA0361', 1, 2, 0, 6, 0 ) 3253 ENDIF 3233 ENDIF 3254 3234 3255 3235 IF ( TRIM( var ) == 'lwp*' ) unit = 'kg/m2' … … 3259 3239 IF ( TRIM( var ) == 'qsws*' ) unit = 'kgm/kgs' 3260 3240 IF ( TRIM( var ) == 'shf*' ) unit = 'K*m/s' 3261 IF ( TRIM( var ) == 'ssws*' ) unit = 'kg/m2*s' 3241 IF ( TRIM( var ) == 'ssws*' ) unit = 'kg/m2*s' 3262 3242 IF ( TRIM( var ) == 't*' ) unit = 'K' 3263 3243 IF ( TRIM( var ) == 'u*' ) unit = 'm/s' 3264 3244 IF ( TRIM( var ) == 'z0*' ) unit = 'm' 3265 IF ( TRIM( var ) == 'z0h*' ) unit = 'm' 3266 3245 IF ( TRIM( var ) == 'z0h*' ) unit = 'm' 3246 3267 3247 CASE DEFAULT 3268 3248 3269 3249 CALL lsm_check_data_output ( var, unit, i, ilen, k ) 3270 3250 3271 3251 IF ( unit == 'illegal' ) THEN 3272 3252 CALL radiation_check_data_output( var, unit, i, ilen, k ) … … 3284 3264 CALL pcm_check_data_output( var, unit ) 3285 3265 ENDIF 3286 3266 3287 3267 IF ( unit == 'illegal' ) THEN 3288 3268 unit = '' … … 3408 3388 ENDIF 3409 3389 ENDDO 3410 3390 3411 3391 IF ( masks < 0 .OR. masks > max_masks ) THEN 3412 3392 WRITE( message_string, * ) 'illegal value: masks must be >= 0 and ', & … … 3426 3406 ! 3427 3407 !-- Generate masks for masked data output 3428 !-- Parallel netcdf output is not tested so far for masked data, hence 3408 !-- Parallel netcdf output is not tested so far for masked data, hence 3429 3409 !-- netcdf_data_format is switched back to non-paralell output. 3430 3410 netcdf_data_format_save = netcdf_data_format … … 3436 3416 '6 (parallel netCDF 4 Classic model) '// & 3437 3417 '&are currently not supported (not yet tested) ' // & 3438 'for masked data.&Using respective non-parallel' // & 3418 'for masked data.&Using respective non-parallel' // & 3439 3419 ' output for masked data.' 3440 3420 CALL message( 'check_parameters', 'PA0383', 0, 0, 0, 6, 0 ) … … 3629 3609 !-- near the inflow and the perturbation area is further limited to ...(1) 3630 3610 !-- after the initial phase of the flow. 3631 3611 3632 3612 IF ( bc_lr /= 'cyclic' ) THEN 3633 3613 IF ( inflow_disturbance_begin == -1 ) THEN … … 3666 3646 ENDIF 3667 3647 3668 IF ( random_generator == 'random-parallel' ) THEN 3648 IF ( random_generator == 'random-parallel' ) THEN 3669 3649 dist_nxl = nxl; dist_nxr = nxr 3670 3650 dist_nys = nys; dist_nyn = nyn … … 3921 3901 3922 3902 IF ( large_scale_forcing .AND. ( .NOT. humidity ) ) THEN 3923 message_string = 'The usage of large scale forcing from external &'// & 3903 message_string = 'The usage of large scale forcing from external &'// & 3924 3904 'file LSF_DATA requires humidity = .T..' 3925 3905 CALL message( 'check_parameters', 'PA0376', 1, 2, 0, 6, 0 ) … … 3927 3907 3928 3908 IF ( large_scale_forcing .AND. passive_scalar ) THEN 3929 message_string = 'The usage of large scale forcing from external &'// & 3909 message_string = 'The usage of large scale forcing from external &'// & 3930 3910 'file LSF_DATA is not implemented for passive scalars' 3931 3911 CALL message( 'check_parameters', 'PA0440', 1, 2, 0, 6, 0 ) … … 3934 3914 IF ( large_scale_forcing .AND. topography /= 'flat' & 3935 3915 .AND. .NOT. lsf_exception ) THEN 3936 message_string = 'The usage of large scale forcing from external &'// & 3916 message_string = 'The usage of large scale forcing from external &'// & 3937 3917 'file LSF_DATA is not implemented for non-flat topography' 3938 3918 CALL message( 'check_parameters', 'PA0377', 1, 2, 0, 6, 0 ) … … 3940 3920 3941 3921 IF ( large_scale_forcing .AND. ocean ) THEN 3942 message_string = 'The usage of large scale forcing from external &'// & 3922 message_string = 'The usage of large scale forcing from external &'// & 3943 3923 'file LSF_DATA is not implemented for ocean runs' 3944 3924 CALL message( 'check_parameters', 'PA0378', 1, 2, 0, 6, 0 ) … … 3955 3935 do2d_yz_time_count = 0 3956 3936 domask_time_count = 0 3957 ENDIF 3937 ENDIF 3958 3938 ENDIF 3959 3939 … … 3989 3969 !> Check the length of data output intervals. In case of parallel NetCDF output 3990 3970 !> the time levels of the output files need to be fixed. Therefore setting the 3991 !> output interval to 0.0s (usually used to output each timestep) is not 3971 !> output interval to 0.0s (usually used to output each timestep) is not 3992 3972 !> possible as long as a non-fixed timestep is used. 3993 3973 !------------------------------------------------------------------------------! … … 4018 3998 4019 3999 END SUBROUTINE check_dt_do 4020 4021 4022 4023 4000 4001 4002 4003 4024 4004 !------------------------------------------------------------------------------! 4025 4005 ! Description: … … 4034 4014 4035 4015 4036 IMPLICIT NONE 4037 4016 IMPLICIT NONE 4017 4038 4018 INTEGER(iwp) :: i !< counter 4039 4019 INTEGER(iwp), DIMENSION(1:10) :: vertical_gradient_level_ind !< vertical grid indices for gradient levels 4040 4041 REAL(wp) :: bc_t_val !< model top gradient 4042 REAL(wp) :: gradient !< vertica gradient of the respective quantity 4020 4021 REAL(wp) :: bc_t_val !< model top gradient 4022 REAL(wp) :: gradient !< vertica gradient of the respective quantity 4043 4023 REAL(wp) :: surface_value !< surface value of the respecitve quantity 4044 4024 4045 4025 4046 4026 REAL(wp), DIMENSION(0:nz+1) :: pr_init !< initialisation profile 4047 4027 REAL(wp), DIMENSION(1:10) :: vertical_gradient !< given vertical gradient 4048 4028 REAL(wp), DIMENSION(1:10) :: vertical_gradient_level !< given vertical gradient level 4049 4029 4050 4030 i = 1 4051 4031 gradient = 0.0_wp … … 4109 4089 4110 4090 ENDIF 4111 4091 4112 4092 ! 4113 4093 !-- In case of no given gradients, choose zero gradient conditions … … 4118 4098 !-- Store gradient at the top boundary for possible Neumann boundary condition 4119 4099 bc_t_val = ( pr_init(nzt+1) - pr_init(nzt) ) / dzu(nzt+1) 4120 4100 4121 4101 END SUBROUTINE init_vertical_profiles 4122 4123 4124 4102 4103 4104 4125 4105 !------------------------------------------------------------------------------! 4126 4106 ! Description: … … 4129 4109 !------------------------------------------------------------------------------! 4130 4110 4131 SUBROUTINE set_bc_scalars( sq, bc_b, bc_t, ibc_b, ibc_t, err_nr_b, err_nr_t ) 4132 4133 4134 IMPLICIT NONE 4135 4136 CHARACTER (LEN=1) :: sq !< 4111 SUBROUTINE set_bc_scalars( sq, bc_b, bc_t, ibc_b, ibc_t, err_nr_b, err_nr_t ) 4112 4113 4114 IMPLICIT NONE 4115 4116 CHARACTER (LEN=1) :: sq !< 4137 4117 CHARACTER (LEN=*) :: bc_b 4138 4118 CHARACTER (LEN=*) :: bc_t … … 4171 4151 CALL message( 'check_parameters', err_nr_t, 1, 2, 0, 6, 0 ) 4172 4152 ENDIF 4173 4174 4175 END SUBROUTINE set_bc_scalars 4153 4154 4155 END SUBROUTINE set_bc_scalars 4176 4156 4177 4157 … … 4180 4160 ! Description: 4181 4161 ! ------------ 4182 !> Check for consistent settings of bottom boundary conditions for humidity 4162 !> Check for consistent settings of bottom boundary conditions for humidity 4183 4163 !> and scalars. 4184 4164 !------------------------------------------------------------------------------! … … 4189 4169 4190 4170 4191 IMPLICIT NONE 4192 4193 CHARACTER (LEN=1) :: sq !< 4171 IMPLICIT NONE 4172 4173 CHARACTER (LEN=1) :: sq !< 4194 4174 CHARACTER (LEN=*) :: bc_b 4195 4175 CHARACTER (LEN=*) :: err_nr_1 4196 4176 CHARACTER (LEN=*) :: err_nr_2 4197 4177 4198 4178 INTEGER(iwp) :: ibc_b 4199 4179 4200 4180 LOGICAL :: constant_flux 4201 4181 4202 4182 REAL(wp) :: surface_initial_change 4203 4183 4204 4184 ! 4205 4185 !-- A given surface value implies Dirichlet boundary condition for … … 4220 4200 surface_initial_change 4221 4201 CALL message( 'check_parameters', err_nr_2, 1, 2, 0, 6, 0 ) 4222 ENDIF 4223 4224 4225 END SUBROUTINE check_bc_scalars 4226 4227 4202 ENDIF 4203 4204 4205 END SUBROUTINE check_bc_scalars 4206 4207 4228 4208 4229 4209 END SUBROUTINE check_parameters -
palm/trunk/SOURCE/data_output_ptseries.f90
r2101 r2312 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! SGS velocities also possible for curvature_solution_effects = .TRUE. 27 28 ! 28 29 ! 2000 2016-08-20 18:09:15Z knoop … … 36 37 ! 37 38 ! 1682 2015-10-07 23:56:08Z knoop 38 ! Code annotations made doxygen readable 39 ! 39 ! Code annotations made doxygen readable 40 ! 40 41 ! 1359 2014-04-11 17:15:14Z hoffmann 41 ! New particle structure integrated. 42 ! 42 ! New particle structure integrated. 43 ! 43 44 ! 1353 2014-04-08 15:21:23Z heinze 44 45 ! REAL constants provided with KIND-attribute 45 ! 46 ! 46 47 ! 1327 2014-03-21 11:00:16Z raasch 47 48 ! -netcdf output queries … … 75 76 !------------------------------------------------------------------------------! 76 77 SUBROUTINE data_output_ptseries 77 78 78 79 79 80 USE control_parameters, & … … 97 98 98 99 USE particle_attributes, & 99 ONLY: curvature_solution_effects, grid_particles, number_of_particles,&100 number_of_particle_groups,particles, prt_count100 ONLY: grid_particles, number_of_particles, number_of_particle_groups, & 101 particles, prt_count 101 102 102 103 USE pegrid … … 164 165 pts_value_l(0,7) = pts_value_l(0,7) + particles(n)%speed_y ! mean v 165 166 pts_value_l(0,8) = pts_value_l(0,8) + particles(n)%speed_z ! mean w 166 IF ( .NOT. curvature_solution_effects ) THEN 167 pts_value_l(0,9) = pts_value_l(0,9) + particles(n)%rvar1 ! mean sgsu 168 pts_value_l(0,10) = pts_value_l(0,10) + particles(n)%rvar2 ! mean sgsv 169 pts_value_l(0,11) = pts_value_l(0,11) + particles(n)%rvar3 ! mean sgsw 170 ENDIF 167 pts_value_l(0,9) = pts_value_l(0,9) + particles(n)%rvar1 ! mean sgsu 168 pts_value_l(0,10) = pts_value_l(0,10) + particles(n)%rvar2 ! mean sgsv 169 pts_value_l(0,11) = pts_value_l(0,11) + particles(n)%rvar3 ! mean sgsw 171 170 IF ( particles(n)%speed_z > 0.0_wp ) THEN 172 171 pts_value_l(0,12) = pts_value_l(0,12) + 1.0_wp ! # of upward moving prts … … 198 197 pts_value_l(jg,7) = pts_value_l(jg,7) + particles(n)%speed_y 199 198 pts_value_l(jg,8) = pts_value_l(jg,8) + particles(n)%speed_z 200 IF ( .NOT. curvature_solution_effects ) THEN 201 pts_value_l(jg,9) = pts_value_l(jg,9) + particles(n)%rvar1 202 pts_value_l(jg,10) = pts_value_l(jg,10) + particles(n)%rvar2 203 pts_value_l(jg,11) = pts_value_l(jg,11) + particles(n)%rvar3 204 ENDIF 199 pts_value_l(jg,9) = pts_value_l(jg,9) + particles(n)%rvar1 200 pts_value_l(jg,10) = pts_value_l(jg,10) + particles(n)%rvar2 201 pts_value_l(jg,11) = pts_value_l(jg,11) + particles(n)%rvar3 205 202 IF ( particles(n)%speed_z > 0.0_wp ) THEN 206 203 pts_value_l(jg,12) = pts_value_l(jg,12) + 1.0_wp … … 299 296 pts_value_l(0,25) = pts_value_l(0,25) + ( particles(n)%speed_z - & 300 297 pts_value(0,8) )**2 ! w*2 301 IF ( .NOT. curvature_solution_effects ) THEN 302 pts_value_l(0,26) = pts_value_l(0,26) + ( particles(n)%rvar1 - & 303 pts_value(0,9) )**2 ! u"2 304 pts_value_l(0,27) = pts_value_l(0,27) + ( particles(n)%rvar2 - & 305 pts_value(0,10) )**2 ! v"2 306 pts_value_l(0,28) = pts_value_l(0,28) + ( particles(n)%rvar3 - & 307 pts_value(0,11) )**2 ! w"2 308 ENDIF 298 pts_value_l(0,26) = pts_value_l(0,26) + ( particles(n)%rvar1 - & 299 pts_value(0,9) )**2 ! u"2 300 pts_value_l(0,27) = pts_value_l(0,27) + ( particles(n)%rvar2 - & 301 pts_value(0,10) )**2 ! v"2 302 pts_value_l(0,28) = pts_value_l(0,28) + ( particles(n)%rvar3 - & 303 pts_value(0,11) )**2 ! w"2 309 304 ! 310 305 !-- Repeat the same for the respective particle group … … 324 319 pts_value_l(jg,25) = pts_value_l(jg,25) + ( particles(n)%speed_z - & 325 320 pts_value(jg,8) )**2 326 IF ( .NOT. curvature_solution_effects ) THEN 327 pts_value_l(jg,26) = pts_value_l(jg,26) + ( particles(n)%rvar1 - & 328 pts_value(jg,9) )**2 329 pts_value_l(jg,27) = pts_value_l(jg,27) + ( particles(n)%rvar2 - & 330 pts_value(jg,10) )**2 331 pts_value_l(jg,28) = pts_value_l(jg,28) + ( particles(n)%rvar3 - & 332 pts_value(jg,11) )**2 333 ENDIF 321 pts_value_l(jg,26) = pts_value_l(jg,26) + ( particles(n)%rvar1 - & 322 pts_value(jg,9) )**2 323 pts_value_l(jg,27) = pts_value_l(jg,27) + ( particles(n)%rvar2 - & 324 pts_value(jg,10) )**2 325 pts_value_l(jg,28) = pts_value_l(jg,28) + ( particles(n)%rvar3 - & 326 pts_value(jg,11) )**2 334 327 ENDIF 335 328 -
palm/trunk/SOURCE/lpm_droplet_collision.f90
r2274 r2312 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Consideration of aerosol mass during collision. Average impact algorithm has 28 ! been removed. 29 ! 30 ! 2274 2017-06-09 13:27:48Z Giersch 27 31 ! Changed error messages 28 32 ! … … 39 43 ! 40 44 ! 1860 2016-04-13 13:21:28Z hoffmann 41 ! Interpolation of dissipation rate adjusted to more reasonable values. 45 ! Interpolation of dissipation rate adjusted to more reasonable values. 42 46 ! 43 47 ! 1822 2016-04-07 07:49:42Z hoffmann … … 49 53 ! 50 54 ! 1682 2015-10-07 23:56:08Z knoop 51 ! Code annotations made doxygen readable 52 ! 55 ! Code annotations made doxygen readable 56 ! 53 57 ! 1359 2014-04-11 17:15:14Z hoffmann 54 ! New particle structure integrated. 58 ! New particle structure integrated. 55 59 ! Kind definition added to all floating point numbers. 56 60 ! … … 96 100 !> the modification of the relative velocity between the droplets, 97 101 !> the effect of preferential concentration, and the enhancement of 98 !> collision efficiencies. 102 !> collision efficiencies. 99 103 !------------------------------------------------------------------------------! 100 104 SUBROUTINE lpm_droplet_collision (i,j,k) 101 102 103 105 104 106 USE arrays_3d, & … … 126 128 127 129 USE particle_attributes, & 128 ONLY: all_or_nothing, average_impact, dissipation_classes,&129 hall_kernel, iran_part, number_of_particles, particles,&130 p article_type, prt_count, use_kernel_tables, wang_kernel130 ONLY: curvature_solution_effects, dissipation_classes, hall_kernel, & 131 iran_part, number_of_particles, particles, particle_type, & 132 prt_count, rho_s, use_kernel_tables, wang_kernel 131 133 132 134 USE random_function_mod, & … … 150 152 REAL(wp) :: epsilon !< dissipation rate 151 153 REAL(wp) :: factor_volume_to_mass !< 4.0 / 3.0 * pi * rho_l 152 REAL(wp) :: xm !< mean mass of droplet m 153 REAL(wp) :: xn !< mean mass of droplet n 154 155 REAL(wp), DIMENSION(:), ALLOCATABLE :: weight !< weighting factor 156 REAL(wp), DIMENSION(:), ALLOCATABLE :: mass !< total mass of super droplet 154 REAL(wp) :: xm !< droplet mass of super-droplet m 155 REAL(wp) :: xn !< droplet mass of super-droplet n 156 REAL(wp) :: xsm !< aerosol mass of super-droplet m 157 REAL(wp) :: xsn !< aerosol mass of super-droplet n 158 159 REAL(wp), DIMENSION(:), ALLOCATABLE :: weight !< weighting factor 160 REAL(wp), DIMENSION(:), ALLOCATABLE :: mass !< total mass of super droplet 161 REAL(wp), DIMENSION(:), ALLOCATABLE :: aero_mass !< total aerosol mass of super droplet 157 162 158 163 CALL cpu_log( log_point_s(43), 'lpm_droplet_coll', 'start' ) 159 164 160 165 number_of_particles = prt_count(k,j,i) 161 factor_volume_to_mass = 4.0_wp / 3.0_wp * pi * rho_l 162 ddV = 1 / ( dx * dy * dz )166 factor_volume_to_mass = 4.0_wp / 3.0_wp * pi * rho_l 167 ddV = 1.0_wp / ( dx * dy * dz ) 163 168 ! 164 169 !-- Collision requires at least one super droplet inside the box 165 170 IF ( number_of_particles > 0 ) THEN 166 171 167 !168 !-- Now apply the different kernels169 172 IF ( use_kernel_tables ) THEN 170 173 ! 171 174 !-- Fast method with pre-calculated collection kernels for 172 175 !-- discrete radius- and dissipation-classes. 173 !--174 !-- Determine dissipation class index of this gridbox175 176 IF ( wang_kernel ) THEN 176 177 eclass = INT( diss(k,j,i) * 1.0E4_wp / 600.0_wp * & … … 180 181 epsilon = 0.0_wp 181 182 ENDIF 183 182 184 IF ( hall_kernel .OR. epsilon * 1.0E4_wp < 0.001_wp ) THEN 183 185 eclass = 0 ! Hall kernel is used … … 186 188 ENDIF 187 189 188 ! 189 !-- Droplet collision are calculated using collision-coalescence 190 !-- formulation proposed by Wang (see PALM documentation) 191 !-- Temporary fields for total mass of super-droplet and weighting factors 192 !-- are allocated. 193 ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) 194 195 mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & 196 particles(1:number_of_particles)%radius**3 * & 197 factor_volume_to_mass 198 weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor 199 200 IF ( average_impact ) THEN ! select collision algorithm 201 202 DO n = 1, number_of_particles 203 204 rclass_l = particles(n)%class 205 xn = mass(n) / weight(n) 206 207 DO m = n, number_of_particles 208 209 rclass_s = particles(m)%class 210 xm = mass(m) / weight(m) 211 212 IF ( xm .LT. xn ) THEN 213 214 ! 215 !-- Particle n collects smaller particle m 216 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 217 weight(n) * ddV * dt_3d 218 219 mass(n) = mass(n) + mass(m) * collection_probability 220 weight(m) = weight(m) - weight(m) * collection_probability 221 mass(m) = mass(m) - mass(m) * collection_probability 222 ELSEIF ( xm .GT. xn ) THEN 223 ! 224 !-- Particle m collects smaller particle n 225 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 226 weight(m) * ddV * dt_3d 227 228 mass(m) = mass(m) + mass(n) * collection_probability 229 weight(n) = weight(n) - weight(n) * collection_probability 230 mass(n) = mass(n) - mass(n) * collection_probability 231 ELSE 232 ! 233 !-- Same-size collections. If n = m, weight is reduced by the 234 !-- number of possible same-size collections; the total mass 235 !-- is not changed during same-size collection. 236 !-- Same-size collections of different 237 !-- particles ( n /= m ) are treated as same-size collections 238 !-- of ONE partilce with weight = weight(n) + weight(m) and 239 !-- mass = mass(n) + mass(m). 240 !-- Accordingly, each particle loses the same number of 241 !-- droplets to the other particle, but this has no effect on 242 !-- total mass mass, since the exchanged droplets have the 243 !-- same radius. 244 245 !-- Note: For m = n this equation is an approximation only 246 !-- valid for weight >> 1 (which is usually the case). The 247 !-- approximation is weight(n)-1 = weight(n). 248 weight(n) = weight(n) - 0.5_wp * weight(n) * & 249 ckernel(rclass_l,rclass_s,eclass) * & 250 weight(m) * ddV * dt_3d 251 IF ( n .NE. m ) THEN 252 weight(m) = weight(m) - 0.5_wp * weight(m) * & 253 ckernel(rclass_l,rclass_s,eclass) * & 254 weight(n) * ddV * dt_3d 255 ENDIF 256 ENDIF 257 258 ENDDO 259 260 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 261 262 ENDDO 263 264 ELSEIF ( all_or_nothing ) THEN ! select collision algorithm 265 266 DO n = 1, number_of_particles 267 268 rclass_l = particles(n)%class 269 xn = mass(n) / weight(n) ! mean mass of droplet n 270 271 DO m = n, number_of_particles 272 273 rclass_s = particles(m)%class 274 xm = mass(m) / weight(m) ! mean mass of droplet m 275 276 IF ( weight(n) .LT. weight(m) ) THEN 277 ! 278 !-- Particle n collects weight(n) droplets of particle m 279 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 280 weight(m) * ddV * dt_3d 281 282 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 283 mass(n) = mass(n) + weight(n) * xm 284 weight(m) = weight(m) - weight(n) 285 mass(m) = mass(m) - weight(n) * xm 286 ENDIF 287 288 ELSEIF ( weight(m) .LT. weight(n) ) THEN 289 ! 290 !-- Particle m collects weight(m) droplets of particle n 291 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 292 weight(n) * ddV * dt_3d 293 294 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 295 mass(m) = mass(m) + weight(m) * xn 296 weight(n) = weight(n) - weight(m) 297 mass(n) = mass(n) - weight(m) * xn 298 ENDIF 299 ELSE 300 ! 301 !-- Collisions of particles of the same weighting factor. 302 !-- Particle n collects 1/2 weight(n) droplets of particle m, 303 !-- particle m collects 1/2 weight(m) droplets of particle n. 304 !-- The total mass mass changes accordingly. 305 !-- If n = m, the first half of the droplets coalesces with the 306 !-- second half of the droplets; mass is unchanged because 307 !-- xm = xn for n = m. 308 309 !-- Note: For m = n this equation is an approximation only 310 !-- valid for weight >> 1 (which is usually the case). The 311 !-- approximation is weight(n)-1 = weight(n). 312 collection_probability = ckernel(rclass_l,rclass_s,eclass) * & 313 weight(n) * ddV * dt_3d 314 315 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 316 mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) 317 mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) 318 weight(n) = weight(n) - 0.5_wp * weight(m) 319 weight(m) = weight(n) 320 ENDIF 321 ENDIF 322 323 ENDDO 324 325 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 326 327 ENDDO 328 329 ENDIF 330 331 332 333 334 IF ( ANY(weight < 0.0_wp) ) THEN 335 WRITE( message_string, * ) 'negative weighting factor' 336 CALL message( 'lpm_droplet_collision', 'PA0028', & 337 2, 2, -1, 6, 1 ) 338 ENDIF 339 340 particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & 341 ( weight(1:number_of_particles) & 342 * factor_volume_to_mass & 343 ) & 344 )**0.33333333333333_wp 345 346 particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) 347 348 DEALLOCATE(weight, mass) 349 350 ELSEIF ( .NOT. use_kernel_tables ) THEN 351 ! 352 !-- Collection kernels are calculated for every new 190 ELSE 191 ! 192 !-- Collection kernels are re-calculated for every new 353 193 !-- grid box. First, allocate memory for kernel table. 354 194 !-- Third dimension is 1, because table is re-calculated for … … 359 199 !-- the kernel is based on the previous time step 360 200 CALL recalculate_kernel( i, j, k ) 361 ! 362 !-- Droplet collision are calculated using collision-coalescence 363 !-- formulation proposed by Wang (see PALM documentation) 364 !-- Temporary fields for total mass of super-droplet and weighting factors 365 !-- are allocated. 366 ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) 367 368 mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & 369 particles(1:number_of_particles)%radius**3 * & 370 factor_volume_to_mass 371 372 weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor 373 374 IF ( average_impact ) THEN ! select collision algorithm 375 376 DO n = 1, number_of_particles 377 378 xn = mass(n) / weight(n) ! mean mass of droplet n 379 380 DO m = n, number_of_particles 381 382 xm = mass(m) / weight(m) !mean mass of droplet m 383 384 IF ( xm .LT. xn ) THEN 385 ! 386 !-- Particle n collects smaller particle m 387 collection_probability = ckernel(n,m,1) * weight(n) * & 388 ddV * dt_3d 389 390 mass(n) = mass(n) + mass(m) * collection_probability 391 weight(m) = weight(m) - weight(m) * collection_probability 392 mass(m) = mass(m) - mass(m) * collection_probability 393 ELSEIF ( xm .GT. xn ) THEN 394 ! 395 !-- Particle m collects smaller particle n 396 collection_probability = ckernel(n,m,1) * weight(m) * & 397 ddV * dt_3d 398 399 mass(m) = mass(m) + mass(n) * collection_probability 400 weight(n) = weight(n) - weight(n) * collection_probability 401 mass(n) = mass(n) - mass(n) * collection_probability 402 ELSE 403 ! 404 !-- Same-size collections. If n = m, weight is reduced by the 405 !-- number of possible same-size collections; the total mass 406 !-- mass is not changed during same-size collection. 407 !-- Same-size collections of different 408 !-- particles ( n /= m ) are treated as same-size collections 409 !-- of ONE partilce with weight = weight(n) + weight(m) and 410 !-- mass = mass(n) + mass(m). 411 !-- Accordingly, each particle loses the same number of 412 !-- droplets to the other particle, but this has no effect on 413 !-- total mass mass, since the exchanged droplets have the 414 !-- same radius. 201 202 ENDIF 203 ! 204 !-- Temporary fields for total mass of super-droplet, aerosol mass, and 205 !-- weighting factor are allocated. 206 ALLOCATE(mass(1:number_of_particles), weight(1:number_of_particles)) 207 IF ( curvature_solution_effects ) ALLOCATE(aero_mass(1:number_of_particles)) 208 209 mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & 210 particles(1:number_of_particles)%radius**3 * & 211 factor_volume_to_mass 212 213 weight(1:number_of_particles) = particles(1:number_of_particles)%weight_factor 214 215 IF ( curvature_solution_effects ) THEN 216 aero_mass(1:number_of_particles) = particles(1:number_of_particles)%weight_factor * & 217 particles(1:number_of_particles)%aux1**3 * & 218 4.0 / 3.0 * pi * rho_s 219 ENDIF 220 ! 221 !-- Calculate collision/coalescence 222 DO n = 1, number_of_particles 223 224 DO m = n, number_of_particles 225 ! 226 !-- For collisions, the weighting factor of at least one super-droplet 227 !-- needs to be larger or equal to one. 228 IF ( MIN( weight(n), weight(m) ) .LT. 1.0 ) CYCLE 229 ! 230 !-- Get mass of individual droplets (aerosols) 231 xn = mass(n) / weight(n) 232 xm = mass(m) / weight(m) 233 IF ( curvature_solution_effects ) THEN 234 xsn = aero_mass(n) / weight(n) 235 xsm = aero_mass(m) / weight(m) 236 ENDIF 237 ! 238 !-- Probability that the necessary collisions take place 239 IF ( use_kernel_tables ) THEN 240 rclass_l = particles(n)%class 241 rclass_s = particles(m)%class 242 243 collection_probability = MAX( weight(n), weight(m) ) * & 244 ckernel(rclass_l,rclass_s,eclass) * ddV * dt_3d 245 ELSE 246 collection_probability = MAX( weight(n), weight(m) ) * & 247 ckernel(n,m,1) * ddV * dt_3d 248 ENDIF 249 ! 250 !-- Calculate the number of collections and consider multiple collections. 251 !-- (Accordingly, p_crit will be 0.0, 1.0, 2.0, ...) 252 IF ( collection_probability - FLOOR(collection_probability) & 253 .GT. random_function( iran_part ) ) THEN 254 collection_probability = FLOOR(collection_probability) + 1.0_wp 255 ELSE 256 collection_probability = FLOOR(collection_probability) 257 ENDIF 258 259 IF ( collection_probability .GT. 0.0 ) THEN 260 ! 261 !-- Super-droplet n collects droplets of super-droplet m 262 IF ( weight(n) .LT. weight(m) ) THEN 263 264 mass(n) = mass(n) + weight(n) * xm * collection_probability 265 weight(m) = weight(m) - weight(n) * collection_probability 266 mass(m) = mass(m) - weight(n) * xm * collection_probability 267 IF ( curvature_solution_effects ) THEN 268 aero_mass(n) = aero_mass(n) + weight(n) * xsm * collection_probability 269 aero_mass(m) = aero_mass(m) - weight(n) * xsm * collection_probability 270 ENDIF 271 272 ELSEIF ( weight(m) .LT. weight(n) ) THEN 273 274 mass(m) = mass(m) + weight(m) * xn * collection_probability 275 weight(n) = weight(n) - weight(m) * collection_probability 276 mass(n) = mass(n) - weight(m) * xn * collection_probability 277 IF ( curvature_solution_effects ) THEN 278 aero_mass(m) = aero_mass(m) + weight(m) * xsn * collection_probability 279 aero_mass(n) = aero_mass(n) - weight(m) * xsn * collection_probability 280 ENDIF 281 282 ELSE 283 ! 284 !-- Collisions of particles of the same weighting factor. 285 !-- Particle n collects 1/2 weight(n) droplets of particle m, 286 !-- particle m collects 1/2 weight(m) droplets of particle n. 287 !-- The total mass mass changes accordingly. 288 !-- If n = m, the first half of the droplets coalesces with the 289 !-- second half of the droplets; mass is unchanged because 290 !-- xm = xn for n = m. 415 291 !-- 416 !-- Note: For m = n this equation is an approximation only 417 !-- valid for weight >> 1 (which is usually the case). The 418 !-- approximation is weight(n)-1 = weight(n). 419 weight(n) = weight(n) - 0.5_wp * weight(n) * & 420 ckernel(n,m,1) * weight(m) * & 421 ddV * dt_3d 422 IF ( n .NE. m ) THEN 423 weight(m) = weight(m) - 0.5_wp * weight(m) * & 424 ckernel(n,m,1) * weight(n) * & 425 ddV * dt_3d 426 ENDIF 292 !-- Note: For m = n this equation is an approximation only 293 !-- valid for weight >> 1 (which is usually the case). The 294 !-- approximation is weight(n)-1 = weight(n). 295 mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) 296 mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) 297 IF ( curvature_solution_effects ) THEN 298 aero_mass(n) = aero_mass(n) + 0.5_wp * weight(n) * ( xsm - xsn ) 299 aero_mass(m) = aero_mass(m) + 0.5_wp * weight(m) * ( xsn - xsm ) 427 300 ENDIF 428 429 430 ENDDO 431 432 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 433 434 ENDDO 435 436 ELSEIF ( all_or_nothing ) THEN ! select collision algorithm 437 438 DO n = 1, number_of_particles 439 440 xn = mass(n) / weight(n) ! mean mass of droplet n 441 442 DO m = n, number_of_particles 443 444 xm = mass(m) / weight(m) !mean mass of droplet m 445 446 IF ( weight(n) .LT. weight(m) ) THEN 447 ! 448 !-- Particle n collects smaller particle m 449 collection_probability = ckernel(n,m,1) * weight(m) * & 450 ddV * dt_3d 451 452 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 453 mass(n) = mass(n) + weight(n) * xm 454 weight(m) = weight(m) - weight(n) 455 mass(m) = mass(m) - weight(n) * xm 456 ENDIF 457 458 ELSEIF ( weight(m) .LT. weight(n) ) THEN 459 ! 460 !-- Particle m collects smaller particle n 461 collection_probability = ckernel(n,m,1) * weight(n) * & 462 ddV * dt_3d 463 464 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 465 mass(m) = mass(m) + weight(m) * xn 466 weight(n) = weight(n) - weight(m) 467 mass(n) = mass(n) - weight(m) * xn 468 ENDIF 469 ELSE 470 ! 471 !-- Collisions of particles of the same weighting factor. 472 !-- Particle n collects 1/2 weight(n) droplets of particle m, 473 !-- particle m collects 1/2 weight(m) droplets of particle n. 474 !-- The total mass mass changes accordingly. 475 !-- If n = m, the first half of the droplets coalesces with the 476 !-- second half of the droplets; mass is unchanged because 477 !-- xm = xn for n = m. 478 !-- 479 !-- Note: For m = n this equation is an approximation only 480 !-- valid for weight >> 1 (which is usually the case). The 481 !-- approximation is weight(n)-1 = weight(n). 482 collection_probability = ckernel(n,m,1) * weight(n) * & 483 ddV * dt_3d 484 485 IF ( collection_probability .GT. random_function( iran_part ) ) THEN 486 mass(n) = mass(n) + 0.5_wp * weight(n) * ( xm - xn ) 487 mass(m) = mass(m) + 0.5_wp * weight(m) * ( xn - xm ) 488 weight(n) = weight(n) - 0.5_wp * weight(m) 489 weight(m) = weight(n) 490 ENDIF 491 ENDIF 492 493 494 ENDDO 495 496 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 497 498 ENDDO 499 500 ENDIF 501 502 IF ( ANY(weight < 0.0_wp) ) THEN 503 WRITE( message_string, * ) 'negative weighting factor' 504 CALL message( 'lpm_droplet_collision', 'PA0028', & 505 2, 2, -1, 6, 1 ) 506 ENDIF 507 508 particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & 509 ( weight(1:number_of_particles) & 510 * factor_volume_to_mass & 511 ) & 512 )**0.33333333333333_wp 513 514 particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) 515 516 DEALLOCATE( weight, mass, ckernel ) 517 518 ENDIF 519 301 weight(n) = weight(n) - 0.5_wp * weight(m) 302 weight(m) = weight(n) 303 304 ENDIF 305 306 ENDIF 307 308 ENDDO 309 310 ql_vp(k,j,i) = ql_vp(k,j,i) + mass(n) / factor_volume_to_mass 311 312 ENDDO 313 314 IF ( ANY(weight < 0.0_wp) ) THEN 315 WRITE( message_string, * ) 'negative weighting factor' 316 CALL message( 'lpm_droplet_collision', 'PA0028', & 317 2, 2, -1, 6, 1 ) 318 ENDIF 319 320 particles(1:number_of_particles)%radius = ( mass(1:number_of_particles) / & 321 ( weight(1:number_of_particles) & 322 * factor_volume_to_mass & 323 ) & 324 )**0.33333333333333_wp 325 326 IF ( curvature_solution_effects ) THEN 327 particles(1:number_of_particles)%aux1 = ( aero_mass(1:number_of_particles) / & 328 ( weight(1:number_of_particles) & 329 * 4.0_wp / 3.0_wp * pi * rho_s & 330 ) & 331 )**0.33333333333333_wp 332 ENDIF 333 334 particles(1:number_of_particles)%weight_factor = weight(1:number_of_particles) 335 336 DEALLOCATE( weight, mass ) 337 IF ( curvature_solution_effects ) DEALLOCATE( aero_mass ) 338 IF ( .NOT. use_kernel_tables ) DEALLOCATE( ckernel ) 339 520 340 ! 521 341 !-- Check if LWC is conserved during collision process … … 532 352 533 353 ENDIF 534 354 535 355 CALL cpu_log( log_point_s(43), 'lpm_droplet_coll', 'stop' ) 536 356 -
palm/trunk/SOURCE/lpm_droplet_condensation.f90
r2101 r2312 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Rosenbrock scheme improved. Gas-kinetic effect added. 27 28 ! 28 29 ! 2000 2016-08-20 18:09:15Z knoop 29 30 ! Forced header and separation lines into 80 columns 30 ! 31 ! 31 32 ! 1890 2016-04-22 08:52:11Z hoffmann 32 33 ! Some improvements of the Rosenbrock method. If the Rosenbrock method needs more 33 34 ! than 40 iterations to find a sufficient time setp, the model is not aborted. 34 ! This might lead to small erros. But they can be assumend as negligible, since 35 ! the maximum timesetp of the Rosenbrock method after 40 iterations will be 36 ! smaller than 10^-16 s. 37 ! 35 ! This might lead to small erros. But they can be assumend as negligible, since 36 ! the maximum timesetp of the Rosenbrock method after 40 iterations will be 37 ! smaller than 10^-16 s. 38 ! 38 39 ! 1871 2016-04-15 11:46:09Z hoffmann 39 40 ! Initialization of aerosols added. … … 53 54 ! 54 55 ! 1682 2015-10-07 23:56:08Z knoop 55 ! Code annotations made doxygen readable 56 ! 56 ! Code annotations made doxygen readable 57 ! 57 58 ! 1359 2014-04-11 17:15:14Z hoffmann 58 ! New particle structure integrated. 59 ! New particle structure integrated. 59 60 ! Kind definition added to all floating point numbers. 60 61 ! 61 62 ! 1346 2014-03-27 13:18:20Z heinze 62 ! Bugfix: REAL constants provided with KIND-attribute especially in call of 63 ! Bugfix: REAL constants provided with KIND-attribute especially in call of 63 64 ! intrinsic function like MAX, MIN, SIGN 64 65 ! … … 108 109 !------------------------------------------------------------------------------! 109 110 SUBROUTINE lpm_droplet_condensation (ip,jp,kp) 110 111 111 112 112 113 USE arrays_3d, & 113 ONLY: hyp, pt, q, 114 ONLY: hyp, pt, q, ql_c, ql_v 114 115 115 116 USE cloud_parameters, & … … 139 140 use_kernel_tables, vanthoff, wang_kernel 140 141 141 142 142 IMPLICIT NONE 143 143 144 144 INTEGER(iwp) :: ip !< 145 INTEGER(iwp) :: internal_timestep_count !<146 145 INTEGER(iwp) :: jp !< 147 INTEGER(iwp) :: jtry !<148 146 INTEGER(iwp) :: kp !< 149 147 INTEGER(iwp) :: n !< 150 INTEGER(iwp) :: ros_count !< 151 152 INTEGER(iwp), PARAMETER :: maxtry = 40 !< 153 154 LOGICAL :: repeat !< 155 156 REAL(wp) :: aa !< 148 157 149 REAL(wp) :: afactor !< curvature effects 158 150 REAL(wp) :: arg !< … … 161 153 REAL(wp) :: delta_r !< 162 154 REAL(wp) :: diameter !< diameter of cloud droplets 163 REAL(wp) :: diff_coeff _v!< diffusivity for water vapor155 REAL(wp) :: diff_coeff !< diffusivity for water vapor 164 156 REAL(wp) :: drdt !< 165 REAL(wp) :: drdt_ini !<166 157 REAL(wp) :: dt_ros !< 167 REAL(wp) :: dt_ros_next !<168 158 REAL(wp) :: dt_ros_sum !< 169 REAL(wp) :: dt_ros_sum_ini !<170 159 REAL(wp) :: d2rdtdr !< 171 REAL(wp) :: errmax !<172 160 REAL(wp) :: e_a !< current vapor pressure 173 161 REAL(wp) :: e_s !< current saturation vapor pressure 174 REAL(wp) :: err _ros !<175 REAL(wp) :: g1 !<176 REAL(wp) :: g2 !<177 REAL(wp) :: g3 !<178 REAL(wp) :: g4 !<179 REAL(wp) :: r_ros !<180 REAL(wp) :: r _ros_ini !<181 REAL(wp) :: sigma !< 182 REAL(wp) :: thermal_conductivity _v!< thermal conductivity for water162 REAL(wp) :: error !< local truncation error in Rosenbrock 163 REAL(wp) :: k1 !< 164 REAL(wp) :: k2 !< 165 REAL(wp) :: r_err !< First order estimate of Rosenbrock radius 166 REAL(wp) :: r_ros !< Rosenbrock radius 167 REAL(wp) :: r_ros_ini !< initial Rosenbrock radius 168 REAL(wp) :: r0 !< gas-kinetic lengthscale 169 REAL(wp) :: sigma !< surface tension of water 170 REAL(wp) :: thermal_conductivity !< thermal conductivity for water 183 171 REAL(wp) :: t_int !< temperature 184 172 REAL(wp) :: w_s !< terminal velocity of droplets 185 REAL(wp) :: re_p !< 186 187 ! 188 !-- Parameters for Rosenbrock method 189 REAL(wp), PARAMETER :: a21 = 2.0_wp !< 190 REAL(wp), PARAMETER :: a31 = 48.0_wp / 25.0_wp !< 191 REAL(wp), PARAMETER :: a32 = 6.0_wp / 25.0_wp !< 192 REAL(wp), PARAMETER :: b1 = 19.0_wp / 9.0_wp !< 193 REAL(wp), PARAMETER :: b2 = 0.5_wp !< 194 REAL(wp), PARAMETER :: b3 = 25.0_wp / 108.0_wp !< 195 REAL(wp), PARAMETER :: b4 = 125.0_wp / 108.0_wp !< 196 REAL(wp), PARAMETER :: c21 = -8.0_wp !< 197 REAL(wp), PARAMETER :: c31 = 372.0_wp / 25.0_wp !< 198 REAL(wp), PARAMETER :: c32 = 12.0_wp / 5.0_wp !< 199 REAL(wp), PARAMETER :: c41 = -112.0_wp / 125.0_wp !< 200 REAL(wp), PARAMETER :: c42 = -54.0_wp / 125.0_wp !< 201 REAL(wp), PARAMETER :: c43 = -2.0_wp / 5.0_wp !< 202 REAL(wp), PARAMETER :: errcon = 0.1296_wp !< 203 REAL(wp), PARAMETER :: e1 = 17.0_wp / 54.0_wp !< 204 REAL(wp), PARAMETER :: e2 = 7.0_wp / 36.0_wp !< 205 REAL(wp), PARAMETER :: e3 = 0.0_wp !< 206 REAL(wp), PARAMETER :: e4 = 125.0_wp / 108.0_wp !< 207 REAL(wp), PARAMETER :: eps_ros = 1.0E-3_wp !< accuracy of Rosenbrock method 208 REAL(wp), PARAMETER :: gam = 0.5_wp !< 209 REAL(wp), PARAMETER :: grow = 1.5_wp !< 210 REAL(wp), PARAMETER :: pgrow = -0.25_wp !< 211 REAL(wp), PARAMETER :: pshrnk = -1.0_wp /3.0_wp !< 212 REAL(wp), PARAMETER :: shrnk = 0.5_wp !< 213 173 REAL(wp) :: re_p !< particle Reynolds number 174 ! 175 !-- Parameters for Rosenbrock method (see Verwer et al., 1999) 176 REAL(wp), PARAMETER :: prec = 1.0E-3_wp !< precision of Rosenbrock solution 177 REAL(wp), PARAMETER :: q_increase = 1.5_wp !< increase factor in timestep 178 REAL(wp), PARAMETER :: q_decrease = 0.9_wp !< decrease factor in timestep 179 REAL(wp), PARAMETER :: gamma = 0.292893218814_wp !< = 1.0 - 1.0 / SQRT(2.0) 214 180 ! 215 181 !-- Parameters for terminal velocity … … 224 190 REAL(wp), DIMENSION(number_of_particles) :: new_r !< 225 191 226 227 228 192 CALL cpu_log( log_point_s(42), 'lpm_droplet_condens', 'start' ) 229 193 230 194 ! 231 !-- Calculate temperature, saturation vapor pressure and current vapor pressure195 !-- Absolute temperature 232 196 t_int = pt(kp,jp,ip) * ( hyp(kp) / 100000.0_wp )**0.286_wp 233 e_s = 611.0_wp * EXP( l_d_rv * ( 3.6609E-3_wp - 1.0_wp / t_int ) ) 234 e_a = q(kp,jp,ip) * hyp(kp) / ( 0.378_wp * q(kp,jp,ip) + 0.622_wp ) 235 ! 236 !-- Thermal conductivity for water (from Rogers and Yau, Table 7.1), 237 !-- diffusivity for water vapor (after Hall und Pruppacher, 1976) 238 thermal_conductivity_v = 7.94048E-05_wp * t_int + 0.00227011_wp 239 diff_coeff_v = 0.211E-4_wp * ( t_int / 273.15_wp )**1.94_wp * & 240 ( 101325.0_wp / hyp(kp) ) 241 ! 242 !-- Calculate effects of heat conductivity and diffusion of water vapor on the 243 !-- condensation/evaporation process (typically known as 1.0 / (F_k + F_d) ) 244 ddenom = 1.0_wp / ( rho_l * r_v * t_int / ( e_s * diff_coeff_v ) + & 197 ! 198 !-- Saturation vapor pressure (Eq. 10 in Bolton, 1980) 199 e_s = 611.2_wp * EXP( 17.62_wp * ( t_int - 273.15_wp ) / ( t_int - 29.65_wp ) ) 200 ! 201 !-- Current vapor pressure 202 e_a = q(kp,jp,ip) * hyp(kp) / ( q(kp,jp,ip) + 0.622_wp ) 203 ! 204 !-- Thermal conductivity for water (from Rogers and Yau, Table 7.1) 205 thermal_conductivity = 7.94048E-05_wp * t_int + 0.00227011_wp 206 ! 207 !-- Moldecular diffusivity of water vapor in air (Hall und Pruppacher, 1976) 208 diff_coeff = 0.211E-4_wp * ( t_int / 273.15_wp )**1.94_wp * & 209 ( 101325.0_wp / hyp(kp) ) 210 ! 211 !-- Lengthscale for gas-kinetic effects (from Mordy, 1959, p. 23): 212 r0 = diff_coeff / 0.036_wp * SQRT( 2.0_wp * pi / ( r_v * t_int ) ) 213 ! 214 !-- Calculate effects of heat conductivity and diffusion of water vapor on the 215 !-- diffusional growth process (usually known as 1.0 / (F_k + F_d) ) 216 ddenom = 1.0_wp / ( rho_l * r_v * t_int / ( e_s * diff_coeff ) + & 245 217 ( l_v / ( r_v * t_int ) - 1.0_wp ) * rho_l * & 246 l_v / ( thermal_conductivity _v * t_int )&218 l_v / ( thermal_conductivity * t_int ) & 247 219 ) 248 249 220 new_r = 0.0_wp 250 251 221 ! 252 222 !-- Determine ventilation effect on evaporation of large drops … … 264 234 ENDIF 265 235 ! 266 !-- First calculate droplet's Reynolds number236 !-- Calculate droplet's Reynolds number 267 237 re_p = 2.0_wp * particles(n)%radius * w_s / molecular_viscosity 268 238 ! … … 275 245 ELSE 276 246 ! 277 !-- For small droplets or in supersaturated environments, the ventilation 247 !-- For small droplets or in supersaturated environments, the ventilation 278 248 !-- effect does not play a role 279 249 ventilation_effect(n) = 1.0_wp … … 281 251 ENDDO 282 252 283 !284 !-- Use analytic model for condensational growth285 253 IF( .NOT. curvature_solution_effects ) then 254 ! 255 !-- Use analytic model for diffusional growth including gas-kinetic 256 !-- effects (Mordy, 1959) but without the impact of aerosols. 286 257 DO n = 1, number_of_particles 287 arg = particles(n)%radius**2 + 2.0_wp * dt_3d * ddenom *&288 ventilation_effect(n) *&289 ( e_a / e_s - 1.0_wp )290 arg = MAX( arg, 1.0E-16_wp)291 new_r(n) = SQRT( arg ) 258 arg = ( particles(n)%radius + r0 )**2 + 2.0_wp * dt_3d * ddenom * & 259 ventilation_effect(n) * & 260 ( e_a / e_s - 1.0_wp ) 261 arg = MAX( arg, ( 0.01E-6 + r0 )**2 ) 262 new_r(n) = SQRT( arg ) - r0 292 263 ENDDO 293 ENDIF 294 295 ! 296 !-- If selected, use numerical solution of the condensational growth 297 !-- equation (e.g., for studying the activation of aerosols). 298 !-- Curvature and solutions effects are included in growth equation. 299 !-- Change in Radius is calculated with a 4th-order Rosenbrock method 300 !-- for stiff o.d.e's with monitoring local truncation error to adjust 301 !-- stepsize (see Numerical recipes in FORTRAN, 2nd edition, p. 731). 302 DO n = 1, number_of_particles 303 IF ( curvature_solution_effects ) THEN 304 305 ros_count = 0 306 repeat = .TRUE. 307 ! 308 !-- Carry out the Rosenbrock algorithm. In case of unreasonable results 309 !-- the switch "repeat" will be set true and the algorithm will be carried 310 !-- out again with the internal time step set to its initial (small) value. 311 !-- Unreasonable results may occur if the external conditions, especially 312 !-- the supersaturation, has significantly changed compared to the last 313 !-- PALM timestep. 314 DO WHILE ( repeat ) 315 316 repeat = .FALSE. 317 ! 318 !-- Curvature effect (afactor) with surface tension parameterization 319 !-- by Straka (2009) 320 sigma = 0.0761_wp - 0.000155_wp * ( t_int - 273.15_wp ) 321 afactor = 2.0_wp * sigma / ( rho_l * r_v * t_int ) 322 ! 323 !-- Solute effect (bfactor) 324 bfactor = vanthoff * rho_s * particles(n)%rvar2**3 * & 325 molecular_weight_of_water / & 326 ( rho_l * molecular_weight_of_solute ) 327 328 r_ros = particles(n)%radius 329 dt_ros_sum = 0.0_wp ! internal integrated time (s) 330 internal_timestep_count = 0 331 ! 332 !-- Take internal time step values from the end of last PALM time step 333 dt_ros_next = particles(n)%rvar1 334 335 ! 336 !-- Internal time step should not be > 1.0E-2 and < 1.0E-6 337 IF ( dt_ros_next > 1.0E-2_wp ) THEN 338 dt_ros_next = 1.0E-2_wp 339 ELSEIF ( dt_ros_next < 1.0E-6_wp ) THEN 340 dt_ros_next = 1.0E-6_wp 341 ENDIF 342 343 ! 344 !-- If calculation of Rosenbrock method is repeated due to unreasonalble 345 !-- results during previous try the initial internal time step has to be 346 !-- reduced 347 IF ( ros_count > 1 ) THEN 348 dt_ros_next = dt_ros_next * 0.1_wp 349 ELSEIF ( ros_count > 5 ) THEN 350 ! 351 !-- Prevent creation of infinite loop 352 message_string = 'ros_count > 5 in Rosenbrock method' 353 CALL message( 'lpm_droplet_condensation', 'PA0018', 2, 2, & 354 0, 6, 0 ) 355 ENDIF 356 357 ! 358 !-- Internal time step must not be larger than PALM time step 359 dt_ros = MIN( dt_ros_next, dt_3d ) 360 361 ! 362 !-- Integrate growth equation in time unless PALM time step is reached 363 DO WHILE ( dt_ros_sum < dt_3d ) 364 365 internal_timestep_count = internal_timestep_count + 1 366 367 ! 368 !-- Derivative at starting value 369 drdt = ddenom * ventilation_effect(n) * ( e_a / e_s - 1.0_wp - & 264 265 ELSE 266 ! 267 !-- Integrate the diffusional growth including gas-kinetic (Mordy, 1959), 268 !-- as well as curvature and solute effects (e.g., Köhler, 1936). 269 ! 270 !-- Curvature effect (afactor) with surface tension (sigma) by Straka (2009) 271 sigma = 0.0761_wp - 0.000155_wp * ( t_int - 273.15_wp ) 272 ! 273 !-- Solute effect (afactor) 274 afactor = 2.0_wp * sigma / ( rho_l * r_v * t_int ) 275 276 DO n = 1, number_of_particles 277 ! 278 !-- Solute effect (bfactor) 279 bfactor = vanthoff * rho_s * particles(n)%aux1**3 * & 280 molecular_weight_of_water / ( rho_l * molecular_weight_of_solute ) 281 282 dt_ros = particles(n)%aux2 ! use previously stored Rosenbrock timestep 283 dt_ros_sum = 0.0_wp 284 285 r_ros = particles(n)%radius ! initialize Rosenbrock particle radius 286 r_ros_ini = r_ros 287 ! 288 !-- Integrate growth equation using a 2nd-order Rosenbrock method 289 !-- (see Verwer et al., 1999, Eq. (3.2)). The Rosenbrock method adjusts 290 !-- its with internal timestep to minimize the local truncation error. 291 DO WHILE ( dt_ros_sum < dt_3d ) 292 293 dt_ros = MIN( dt_ros, dt_3d - dt_ros_sum ) 294 295 DO 296 297 drdt = ddenom * ventilation_effect(n) * ( e_a / e_s - 1.0 - & 370 298 afactor / r_ros + & 371 299 bfactor / r_ros**3 & 372 ) / r_ros 373 374 drdt_ini = drdt 375 dt_ros_sum_ini = dt_ros_sum 376 r_ros_ini = r_ros 377 378 ! 379 !-- Calculate radial derivative of dr/dt 380 d2rdtdr = ddenom * ventilation_effect(n) * & 381 ( ( 1.0_wp - e_a / e_s ) / r_ros**2 + & 382 2.0_wp * afactor / r_ros**3 - & 383 4.0_wp * bfactor / r_ros**5 & 384 ) 385 ! 386 !-- Adjust stepsize unless required accuracy is reached 387 DO jtry = 1, maxtry+1 388 389 IF ( jtry == maxtry+1 ) THEN 390 message_string = 'maxtry > 40 in Rosenbrock method' 391 CALL message( 'lpm_droplet_condensation', 'PA0347', 0, & 392 1, 0, 6, 0 ) 393 ENDIF 394 395 aa = 1.0_wp / ( gam * dt_ros ) - d2rdtdr 396 g1 = drdt_ini / aa 397 r_ros = r_ros_ini + a21 * g1 398 drdt = ddenom * ventilation_effect(n) * ( e_a / e_s - 1.0_wp - & 399 afactor / r_ros + & 400 bfactor / r_ros**3 & 401 ) / r_ros 402 403 g2 = ( drdt + c21 * g1 / dt_ros )& 404 / aa 405 r_ros = r_ros_ini + a31 * g1 + a32 * g2 406 drdt = ddenom * ventilation_effect(n) * ( e_a / e_s - 1.0_wp - & 407 afactor / r_ros + & 408 bfactor / r_ros**3 & 409 ) / r_ros 410 411 g3 = ( drdt + & 412 ( c31 * g1 + c32 * g2 ) / dt_ros ) / aa 413 g4 = ( drdt + & 414 ( c41 * g1 + c42 * g2 + c43 * g3 ) / dt_ros ) / aa 415 r_ros = r_ros_ini + b1 * g1 + b2 * g2 + b3 * g3 + b4 * g4 416 417 dt_ros_sum = dt_ros_sum_ini + dt_ros 418 419 IF ( dt_ros_sum == dt_ros_sum_ini ) THEN 420 message_string = 'zero stepsize in Rosenbrock method' 421 CALL message( 'lpm_droplet_condensation', 'PA0348', 2, & 422 2, 0, 6, 0 ) 423 ENDIF 424 ! 425 !-- Calculate error 426 err_ros = e1 * g1 + e2 * g2 + e3 * g3 + e4 * g4 427 errmax = 0.0_wp 428 errmax = MAX( errmax, ABS( err_ros / r_ros_ini ) ) / eps_ros 429 ! 430 !-- Leave loop if accuracy is sufficient, otherwise try again 431 !-- with a reduced stepsize 432 IF ( errmax <= 1.0_wp ) THEN 433 EXIT 434 ELSE 435 dt_ros = MAX( ABS( 0.9_wp * dt_ros * errmax**pshrnk ), & 436 shrnk * ABS( dt_ros ) ) 437 ENDIF 438 439 ENDDO ! loop for stepsize adjustment 440 441 ! 442 !-- Calculate next internal time step 443 IF ( errmax > errcon ) THEN 444 dt_ros_next = 0.9_wp * dt_ros * errmax**pgrow 300 ) / ( r_ros + r0 ) 301 302 d2rdtdr = -ddenom * ventilation_effect(n) * ( & 303 (e_a / e_s - 1.0) * r_ros**4 - & 304 afactor * r0 * r_ros**2 - & 305 2.0 * afactor * r_ros**3 + & 306 3.0 * bfactor * r0 + & 307 4.0 * bfactor * r_ros & 308 ) & 309 / ( r_ros**4 * ( r_ros + r0 )**2 ) 310 311 k1 = drdt / ( 1.0 - gamma * dt_ros * d2rdtdr ) 312 313 r_ros = MAX(r_ros_ini + k1 * dt_ros, particles(n)%aux1) 314 r_err = r_ros 315 316 drdt = ddenom * ventilation_effect(n) * ( e_a / e_s - 1.0 - & 317 afactor / r_ros + & 318 bfactor / r_ros**3 & 319 ) / ( r_ros + r0 ) 320 321 k2 = ( drdt - dt_ros * 2.0 * gamma * d2rdtdr * k1 ) / & 322 ( 1.0 - dt_ros * gamma * d2rdtdr ) 323 324 r_ros = MAX(r_ros_ini + dt_ros * ( 1.5 * k1 + 0.5 * k2), particles(n)%aux1) 325 ! 326 !-- Check error of the solution, and reduce dt_ros if necessary. 327 error = ABS(r_err - r_ros) / r_ros 328 IF ( error .GT. prec ) THEN 329 dt_ros = SQRT( q_decrease * prec / error ) * dt_ros 330 r_ros = r_ros_ini 445 331 ELSE 446 dt_ros_next = grow * dt_ros 332 dt_ros_sum = dt_ros_sum + dt_ros 333 dt_ros = q_increase * dt_ros 334 r_ros_ini = r_ros 335 EXIT 447 336 ENDIF 448 337 449 ! 450 !-- Estimated time step is reduced if the PALM time step is exceeded 451 IF ( ( dt_ros_next + dt_ros_sum ) >= dt_3d ) THEN 452 dt_ros = dt_3d - dt_ros_sum 453 ELSE 454 dt_ros = dt_ros_next 455 ENDIF 456 457 ENDDO 458 ! 459 !-- Store internal time step value for next PALM step 460 particles(n)%rvar1 = dt_ros_next 461 462 ! 463 !-- Radius should not fall below 1E-8 because Rosenbrock method may 464 !-- lead to errors otherwise 465 new_r(n) = MAX( r_ros, particles(n)%rvar2 ) 466 ! 467 !-- Check if calculated droplet radius change is reasonable since in 468 !-- case of droplet evaporation the Rosenbrock method may lead to 469 !-- secondary solutions which are physically unlikely. 470 !-- Due to the solution effect the droplets may grow for relative 471 !-- humidities below 100%, but change of radius should not be too 472 !-- large. In case of unreasonable droplet growth the Rosenbrock 473 !-- method is recalculated using a smaller initial time step. 474 !-- Limiting values are tested for droplets down to 1.0E-7 475 IF ( new_r(n) - particles(n)%radius >= 3.0E-7_wp .AND. & 476 e_a / e_s < 0.97_wp ) THEN 477 ros_count = ros_count + 1 478 repeat = .TRUE. 479 ENDIF 480 481 ENDDO ! Rosenbrock method 482 483 ENDIF 484 485 delta_r = new_r(n) - particles(n)%radius 486 487 ! 488 !-- Sum up the change in volume of liquid water for the respective grid 489 !-- volume (this is needed later in lpm_calc_liquid_water_content for 490 !-- calculating the release of latent heat) 338 END DO 339 340 END DO !Rosenbrock loop 341 ! 342 !-- Store new particle radius 343 new_r(n) = r_ros 344 ! 345 !-- Store internal time step value for next PALM step 346 particles(n)%aux2 = dt_ros 347 348 ENDDO !Particle loop 349 350 ENDIF 351 352 DO n = 1, number_of_particles 353 ! 354 !-- Sum up the change in liquid water for the respective grid 355 !-- box for the computation of the release/depletion of water vapor 356 !-- and heat. 491 357 ql_c(kp,jp,ip) = ql_c(kp,jp,ip) + particles(n)%weight_factor * & 492 358 rho_l * 1.33333333_wp * pi * & 493 359 ( new_r(n)**3 - particles(n)%radius**3 ) / & 494 360 ( rho_surface * dx * dy * dz ) 361 ! 362 !-- Check if the increase in liqid water is not too big. If this is the case, 363 !-- the model timestep might be too long. 495 364 IF ( ql_c(kp,jp,ip) > 100.0_wp ) THEN 496 365 WRITE( message_string, * ) 'k=',kp,' j=',jp,' i=',ip, & … … 499 368 CALL message( 'lpm_droplet_condensation', 'PA0143', 2, 2, -1, 6, 1 ) 500 369 ENDIF 501 502 ! 503 !-- Change the droplet radius504 IF ( ( new_r(n) - particles(n)%radius ) < 0.0_wp .AND. &505 370 ! 371 !-- Check if the change in the droplet radius is not too big. If this is the 372 !-- case, the model timestep might be too long. 373 delta_r = new_r(n) - particles(n)%radius 374 IF ( delta_r < 0.0_wp .AND. new_r(n) < 0.0_wp ) THEN 506 375 WRITE( message_string, * ) '#1 k=',kp,' j=',jp,' i=',ip, & 507 376 ' e_s=',e_s, ' e_a=',e_a,' t_int=',t_int, & … … 510 379 CALL message( 'lpm_droplet_condensation', 'PA0144', 2, 2, -1, 6, 1 ) 511 380 ENDIF 512 513 381 ! 514 382 !-- Sum up the total volume of liquid water (needed below for 515 383 !-- re-calculating the weighting factors) 516 384 ql_v(kp,jp,ip) = ql_v(kp,jp,ip) + particles(n)%weight_factor * new_r(n)**3 517 518 particles(n)%radius = new_r(n)519 520 385 ! 521 386 !-- Determine radius class of the particle needed for collision 522 IF ( ( hall_kernel .OR. wang_kernel ) .AND. use_kernel_tables ) & 523 THEN 387 IF ( use_kernel_tables ) THEN 524 388 particles(n)%class = ( LOG( new_r(n) ) - rclass_lbound ) / & 525 389 ( rclass_ubound - rclass_lbound ) * & … … 528 392 particles(n)%class = MAX( particles(n)%class, 1 ) 529 393 ENDIF 394 ! 395 !-- Store new radius to particle features 396 particles(n)%radius = new_r(n) 530 397 531 398 ENDDO -
palm/trunk/SOURCE/lpm_init.f90
r2305 r2312 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Extended particle data type. Aerosol initialization improved. 28 ! 29 ! 2305 2017-07-06 11:18:47Z hoffmann 27 30 ! Improved calculation of particle IDs. 28 ! 31 ! 29 32 ! 2274 2017-06-09 13:27:48Z Giersch 30 33 ! Changed error messages 31 ! 34 ! 32 35 ! 2265 2017-06-08 16:58:28Z schwenkel 33 36 ! Unused variables removed. 34 ! 37 ! 35 38 ! 2263 2017-06-08 14:59:01Z schwenkel 36 39 ! Implemented splitting and merging algorithm 37 ! 40 ! 38 41 ! 2233 2017-05-30 18:08:54Z suehring 39 42 ! 40 43 ! 2232 2017-05-30 17:47:52Z suehring 41 44 ! Adjustments according to new topography realization 42 ! 43 ! 45 ! 46 ! 44 47 ! 2223 2017-05-15 16:38:09Z suehring 45 48 ! Add check for particle release at model top 46 ! 49 ! 47 50 ! 2182 2017-03-17 14:27:40Z schwenkel 48 51 ! Added parameters for simplified particle initialization. 49 52 ! 50 53 ! 2122 2017-01-18 12:22:54Z hoffmann 51 ! Improved initialization of equilibrium aerosol radii 54 ! Improved initialization of equilibrium aerosol radii 52 55 ! Calculation of particle ID 53 56 ! 54 57 ! 2000 2016-08-20 18:09:15Z knoop 55 58 ! Forced header and separation lines into 80 columns 56 ! 59 ! 57 60 ! 2016-06-09 16:25:25Z suehring 58 ! Bugfix in determining initial particle height and grid index in case of 61 ! Bugfix in determining initial particle height and grid index in case of 59 62 ! seed_follows_topography. 60 ! Bugfix concerning random positions, ensure that particles do not move more 63 ! Bugfix concerning random positions, ensure that particles do not move more 61 64 ! than one grid length. 62 65 ! Bugfix logarithmic interpolation. … … 64 67 ! 65 68 ! 1890 2016-04-22 08:52:11Z hoffmann 66 ! Initialization of aerosol equilibrium radius not possible in supersaturated 69 ! Initialization of aerosol equilibrium radius not possible in supersaturated 67 70 ! environments. Therefore, a maximum supersaturation of -1 % is assumed during 68 71 ! initialization. … … 70 73 ! 1873 2016-04-18 14:50:06Z maronga 71 74 ! Module renamed (removed _mod 72 ! 75 ! 73 76 ! 1871 2016-04-15 11:46:09Z hoffmann 74 77 ! Initialization of aerosols added. … … 86 89 ! netcdf module added 87 90 ! 88 ! 1725 2015-11-17 13:01:51Z hoffmann 89 ! Bugfix: Processor-dependent seed for random function is generated before it is 91 ! 1725 2015-11-17 13:01:51Z hoffmann 92 ! Bugfix: Processor-dependent seed for random function is generated before it is 90 93 ! used. 91 94 ! … … 97 100 ! 98 101 ! 1682 2015-10-07 23:56:08Z knoop 99 ! Code annotations made doxygen readable 102 ! Code annotations made doxygen readable 100 103 ! 101 104 ! 1575 2015-03-27 09:56:27Z raasch … … 103 106 ! 104 107 ! 1359 2014-04-11 17:15:14Z hoffmann 105 ! New particle structure integrated. 108 ! New particle structure integrated. 106 109 ! Kind definition added to all floating point numbers. 107 110 ! lpm_init changed form a subroutine to a module. 108 ! 111 ! 109 112 ! 1327 2014-03-21 11:00:16Z raasch 110 113 ! -netcdf_output … … 123 126 ! 124 127 ! 1314 2014-03-14 18:25:17Z suehring 125 ! Vertical logarithmic interpolation of horizontal particle speed for particles 128 ! Vertical logarithmic interpolation of horizontal particle speed for particles 126 129 ! between roughness height and first vertical grid level. 127 130 ! … … 146 149 ! 147 150 ! 667 2010-12-23 12:06:00Z suehring/gryschka 148 ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng for allocation 151 ! nxl-1, nxr+1, nys-1, nyn+1 replaced by nxlg, nxrg, nysg, nyng for allocation 149 152 ! of arrays. 150 153 ! … … 159 162 !------------------------------------------------------------------------------! 160 163 MODULE lpm_init_mod 161 164 162 165 USE, INTRINSIC :: ISO_C_BINDING 163 166 … … 167 170 USE control_parameters, & 168 171 ONLY: cloud_droplets, constant_flux_layer, current_timestep_number, & 169 dz, initializing_actions, message_string, ocean, simulated_time 172 dt_3d, dz, initializing_actions, message_string, ocean, & 173 simulated_time 170 174 171 175 USE grid_variables, & … … 197 201 particles, particle_advection_start, particle_groups, & 198 202 particle_groups_type, particles_per_point, & 199 particle_type, pdx, pdy, pdz, prt_count, psb, psl, psn, psr, & 200 pss, pst, radius, random_start_position, & 203 particle_type, pdx, pdy, pdz, prt_count, psb, psl, psn, psr, & 204 pss, pst, radius, random_start_position, & 201 205 read_particles_from_restartfile, seed_follows_topography, & 202 206 sgs_wf_part, sort_count, splitting_function, splitting_mode, & … … 247 251 INTEGER(iwp) :: k !< 248 252 249 REAL(wp) :: div !< 253 REAL(wp) :: div !< 250 254 REAL(wp) :: height_int !< 251 255 REAL(wp) :: height_p !< … … 286 290 !-- Check if downward-facing walls exist. This case, reflection boundary 287 291 !-- conditions (as well as subgrid-scale velocities) may do not work 288 !-- propably (not realized so far). 292 !-- propably (not realized so far). 289 293 IF ( surf_def_h(1)%ns >= 1 ) THEN 290 WRITE( message_string, * ) 'Overhanging topography do not work '// & 291 'with particles' 294 WRITE( message_string, * ) 'Overhanging topography do not work '// & 295 'with particles' 292 296 CALL message( 'lpm_init', 'PA0212', 0, 1, 0, 6, 0 ) 293 297 294 ENDIF 298 ENDIF 295 299 296 300 ! … … 310 314 !-- If number_particles_per_gridbox is set, the parametres pdx, pdy and pdz are 311 315 !-- calculated diagnostically. Therfore an isotropic distribution is prescribed. 312 IF ( number_particles_per_gridbox /= -1 .AND. & 316 IF ( number_particles_per_gridbox /= -1 .AND. & 313 317 number_particles_per_gridbox >= 1 ) THEN 314 pdx(1) = (( dx * dy * ( zu(2) - zu(1) ) ) / & 318 pdx(1) = (( dx * dy * ( zu(2) - zu(1) ) ) / & 315 319 REAL(number_particles_per_gridbox))**0.3333333_wp 316 320 ! 317 !-- Ensure a smooth value (two significant digits) of distance between 321 !-- Ensure a smooth value (two significant digits) of distance between 318 322 !-- particles (pdx, pdy, pdz). 319 323 div = 1000.0_wp … … 340 344 341 345 ! 342 !-- Allocate arrays required for calculating particle SGS velocities. 346 !-- Allocate arrays required for calculating particle SGS velocities. 343 347 !-- Initialize prefactor required for stoachastic Weil equation. 344 348 IF ( use_sgs_for_particles .AND. .NOT. cloud_droplets ) THEN … … 347 351 de_dz(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 348 352 349 sgs_wf_part = 1.0_wp / 3.0_wp 353 sgs_wf_part = 1.0_wp / 3.0_wp 350 354 ENDIF 351 355 352 356 ! 353 !-- Allocate array required for logarithmic vertical interpolation of 357 !-- Allocate array required for logarithmic vertical interpolation of 354 358 !-- horizontal particle velocities between the surface and the first vertical 355 !-- grid level. In order to avoid repeated CPU cost-intensive CALLS of 356 !-- intrinsic FORTRAN procedure LOG(z/z0), LOG(z/z0) is precalculated for 357 !-- several heights. Splitting into 20 sublayers turned out to be sufficient. 359 !-- grid level. In order to avoid repeated CPU cost-intensive CALLS of 360 !-- intrinsic FORTRAN procedure LOG(z/z0), LOG(z/z0) is precalculated for 361 !-- several heights. Splitting into 20 sublayers turned out to be sufficient. 358 362 !-- To obtain exact height levels of particles, linear interpolation is applied 359 363 !-- (see lpm_advec.f90). 360 364 IF ( constant_flux_layer ) THEN 361 362 ALLOCATE ( log_z_z0(0:number_of_sublayers) ) 365 366 ALLOCATE ( log_z_z0(0:number_of_sublayers) ) 363 367 z_p = zu(nzb+1) - zw(nzb) 364 368 365 369 ! 366 370 !-- Calculate horizontal mean value of z0 used for logartihmic 367 !-- interpolation. Note: this is not exact for heterogeneous z0. 368 !-- However, sensitivity studies showed that the effect is 369 !-- negligible. 371 !-- interpolation. Note: this is not exact for heterogeneous z0. 372 !-- However, sensitivity studies showed that the effect is 373 !-- negligible. 370 374 z0_av_local = SUM( surf_def_h(0)%z0 ) + SUM( surf_lsm_h%z0 ) + & 371 375 SUM( surf_usm_h%z0 ) … … 401 405 !-- Check boundary condition and set internal variables 402 406 SELECT CASE ( bc_par_b ) 403 407 404 408 CASE ( 'absorb' ) 405 409 ibc_par_b = 1 … … 407 411 CASE ( 'reflect' ) 408 412 ibc_par_b = 2 409 413 410 414 CASE DEFAULT 411 415 WRITE( message_string, * ) 'unknown boundary condition ', & 412 416 'bc_par_b = "', TRIM( bc_par_b ), '"' 413 417 CALL message( 'lpm_init', 'PA0217', 1, 2, 0, 6, 0 ) 414 418 415 419 END SELECT 416 420 SELECT CASE ( bc_par_t ) 417 421 418 422 CASE ( 'absorb' ) 419 423 ibc_par_t = 1 … … 421 425 CASE ( 'reflect' ) 422 426 ibc_par_t = 2 423 427 424 428 CASE DEFAULT 425 429 WRITE( message_string, * ) 'unknown boundary condition ', & 426 430 'bc_par_t = "', TRIM( bc_par_t ), '"' 427 431 CALL message( 'lpm_init', 'PA0218', 1, 2, 0, 6, 0 ) 428 432 429 433 END SELECT 430 434 SELECT CASE ( bc_par_lr ) … … 438 442 CASE ( 'reflect' ) 439 443 ibc_par_lr = 2 440 444 441 445 CASE DEFAULT 442 446 WRITE( message_string, * ) 'unknown boundary condition ', & 443 447 'bc_par_lr = "', TRIM( bc_par_lr ), '"' 444 448 CALL message( 'lpm_init', 'PA0219', 1, 2, 0, 6, 0 ) 445 449 446 450 END SELECT 447 451 SELECT CASE ( bc_par_ns ) … … 455 459 CASE ( 'reflect' ) 456 460 ibc_par_ns = 2 457 461 458 462 CASE DEFAULT 459 463 WRITE( message_string, * ) 'unknown boundary condition ', & 460 464 'bc_par_ns = "', TRIM( bc_par_ns ), '"' 461 465 CALL message( 'lpm_init', 'PA0220', 1, 2, 0, 6, 0 ) 462 466 463 467 END SELECT 464 468 SELECT CASE ( splitting_mode ) 465 469 466 470 CASE ( 'const' ) 467 471 i_splitting_mode = 1 … … 472 476 CASE ( 'gb_av' ) 473 477 i_splitting_mode = 3 474 478 475 479 CASE DEFAULT 476 480 WRITE( message_string, * ) 'unknown splitting condition ', & 477 481 'splitting_mode = "', TRIM( splitting_mode ), '"' 478 482 CALL message( 'lpm_init', 'PA0146', 1, 2, 0, 6, 0 ) 479 483 480 484 END SELECT 481 485 SELECT CASE ( splitting_function ) 482 486 483 487 CASE ( 'gamma' ) 484 488 isf = 1 … … 489 493 CASE ( 'exp' ) 490 494 isf = 3 491 495 492 496 CASE DEFAULT 493 497 WRITE( message_string, * ) 'unknown splitting function ', & 494 498 'splitting_function = "', TRIM( splitting_function ), '"' 495 499 CALL message( 'lpm_init', 'PA0147', 1, 2, 0, 6, 0 ) 496 500 497 501 END SELECT 498 502 499 503 500 504 ! … … 524 528 525 529 ! 526 !-- initialize counter for particle IDs 530 !-- initialize counter for particle IDs 527 531 grid_particles%id_counter = 1 528 532 … … 534 538 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 535 539 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 536 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 540 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 537 541 0, 0, 0_idp, .FALSE., -1 ) 538 542 … … 577 581 CALL check_open( 80 ) 578 582 WRITE ( 80, 8000 ) current_timestep_number, simulated_time, & 579 number_of_particles 583 number_of_particles 580 584 CALL close_file( 80 ) 581 585 ENDIF … … 584 588 585 589 ! 586 !-- To avoid programm abort, assign particles array to the local version of 590 !-- To avoid programm abort, assign particles array to the local version of 587 591 !-- first grid cell 588 592 number_of_particles = prt_count(nzb+1,nys,nxl) … … 608 612 609 613 USE particle_attributes, & 610 ONLY: deleted_particles , monodisperse_aerosols614 ONLY: deleted_particles 611 615 612 616 IMPLICIT NONE … … 631 635 LOGICAL :: first_stride !< flag for initialization 632 636 633 REAL(wp) :: pos_x !< increment for particle position in x 634 REAL(wp) :: pos_y !< increment for particle position in y 635 REAL(wp) :: pos_z !< increment for particle position in z 637 REAL(wp) :: pos_x !< increment for particle position in x 638 REAL(wp) :: pos_y !< increment for particle position in y 639 REAL(wp) :: pos_z !< increment for particle position in z 636 640 REAL(wp) :: rand_contr !< dummy argument for random position 637 641 … … 652 656 !-- Calculate initial_weighting_factor diagnostically 653 657 IF ( number_concentration /= -1.0_wp .AND. number_concentration > 0.0_wp ) THEN 654 initial_weighting_factor = number_concentration * 1.0E6_wp * & 655 pdx(1) * pdy(1) * pdz(1) 658 initial_weighting_factor = number_concentration * 1.0E6_wp * & 659 pdx(1) * pdy(1) * pdz(1) 656 660 END IF 657 661 … … 677 681 xloop: DO WHILE ( pos_x <= psr(i) ) 678 682 679 IF ( pos_x >= ( nxl - 0.5_wp ) * dx .AND. & 683 IF ( pos_x >= ( nxl - 0.5_wp ) * dx .AND. & 680 684 pos_x < ( nxr + 0.5_wp ) * dx ) THEN 681 685 … … 690 694 tmp_particle%age_m = 0.0_wp 691 695 tmp_particle%dt_sum = 0.0_wp 692 tmp_particle%user = 0.0_wp !unused, free for the user693 696 tmp_particle%e_m = 0.0_wp 694 IF ( curvature_solution_effects ) THEN 695 ! 696 !-- Initial values (internal timesteps, derivative) 697 !-- for Rosenbrock method 698 tmp_particle%rvar1 = 1.0E-6_wp !last Rosenbrock timestep 699 tmp_particle%rvar2 = 0.1E-6_wp !dry aerosol radius 700 tmp_particle%rvar3 = -9999999.9_wp !unused in this configuration 701 ELSE 702 ! 703 !-- Initial values for SGS velocities 704 tmp_particle%rvar1 = 0.0_wp 705 tmp_particle%rvar2 = 0.0_wp 706 tmp_particle%rvar3 = 0.0_wp 707 ENDIF 697 tmp_particle%rvar1 = 0.0_wp 698 tmp_particle%rvar2 = 0.0_wp 699 tmp_particle%rvar3 = 0.0_wp 708 700 tmp_particle%speed_x = 0.0_wp 709 701 tmp_particle%speed_y = 0.0_wp … … 712 704 tmp_particle%origin_y = pos_y 713 705 tmp_particle%origin_z = pos_z 706 IF ( curvature_solution_effects ) THEN 707 tmp_particle%aux1 = 0.0_wp ! dry aerosol radius 708 tmp_particle%aux2 = dt_3d ! last Rosenbrock timestep 709 ELSE 710 tmp_particle%aux1 = 0.0_wp ! free to use 711 tmp_particle%aux2 = 0.0_wp ! free to use 712 ENDIF 714 713 tmp_particle%radius = particle_groups(i)%radius 715 714 tmp_particle%weight_factor = initial_weighting_factor … … 726 725 ! 727 726 !-- Determine surface level. Therefore, check for 728 !-- upward-facing wall on w-grid. MAXLOC will return 727 !-- upward-facing wall on w-grid. MAXLOC will return 729 728 !-- the index of the lowest upward-facing wall. 730 729 k_surf = MAXLOC( & … … 748 747 ENDIF 749 748 ! 750 !-- Skip particle release if particle position is 749 !-- Skip particle release if particle position is 751 750 !-- below surface, or within topography in case 752 751 !-- of overhanging structures. … … 756 755 THEN 757 756 pos_x = pos_x + pdx(i) 758 CYCLE xloop 757 CYCLE xloop 759 758 ENDIF 760 759 … … 840 839 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 841 840 842 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 841 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 843 842 844 843 particles(n)%id = 10000_idp**3 * grid_particles(kp,jp,ip)%id_counter + & … … 857 856 ! 858 857 !-- Initialize aerosol background spectrum 859 IF ( curvature_solution_effects .AND. .NOT. monodisperse_aerosols) THEN858 IF ( curvature_solution_effects ) THEN 860 859 CALL lpm_init_aerosols(local_start) 861 860 ENDIF … … 871 870 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 872 871 ! 873 !-- Move only new particles. Moreover, limit random fluctuation 874 !-- in order to prevent that particles move more than one grid box, 875 !-- which would lead to problems concerning particle exchange 876 !-- between processors in case pdx/pdy are larger than dx/dy, 877 !-- respectively. 872 !-- Move only new particles. Moreover, limit random fluctuation 873 !-- in order to prevent that particles move more than one grid box, 874 !-- which would lead to problems concerning particle exchange 875 !-- between processors in case pdx/pdy are larger than dx/dy, 876 !-- respectively. 878 877 DO n = local_start(kp,jp,ip), number_of_particles 879 878 IF ( psl(particles(n)%group) /= psr(particles(n)%group) ) THEN … … 883 882 MERGE( rand_contr, SIGN( dx, rand_contr ), & 884 883 ABS( rand_contr ) < dx & 885 ) 884 ) 886 885 ENDIF 887 886 IF ( pss(particles(n)%group) /= psn(particles(n)%group) ) THEN … … 891 890 MERGE( rand_contr, SIGN( dy, rand_contr ), & 892 891 ABS( rand_contr ) < dy & 893 ) 892 ) 894 893 ENDIF 895 894 IF ( psb(particles(n)%group) /= pst(particles(n)%group) ) THEN … … 899 898 MERGE( rand_contr, SIGN( dz, rand_contr ), & 900 899 ABS( rand_contr ) < dz & 901 ) 900 ) 902 901 ENDIF 903 902 ENDDO … … 908 907 ! 909 908 !-- Furthermore, remove particles located in topography. Note, as 910 !-- the particle speed is still zero at this point, wall 909 !-- the particle speed is still zero at this point, wall 911 910 !-- reflection boundary conditions will not work in this case. 912 911 particles => & … … 934 933 ENDIF 935 934 ! 936 !-- In case of random_start_position, delete particles identified by 937 !-- lpm_exchange_horiz and lpm_boundary_conds. Then sort particles into blocks, 938 !-- which is needed for a fast interpolation of the LES fields on the particle 935 !-- In case of random_start_position, delete particles identified by 936 !-- lpm_exchange_horiz and lpm_boundary_conds. Then sort particles into blocks, 937 !-- which is needed for a fast interpolation of the LES fields on the particle 939 938 !-- position. 940 939 CALL lpm_pack_all_arrays … … 967 966 968 967 USE arrays_3d, & 969 ONLY: hyp, pt, q 968 ONLY: hyp, pt, q 970 969 971 970 USE cloud_parameters, & … … 978 977 979 978 USE particle_attributes, & 980 ONLY: init_aerosol_probabilistic, molecular_weight_of_solute, & 981 molecular_weight_of_water, n1, n2, n3, rho_s, rm1, rm2, rm3, & 982 s1, s2, s3, vanthoff 979 ONLY: aero_type, aero_weight, log_sigma, molecular_weight_of_solute, & 980 molecular_weight_of_water, na, rho_s, rm, vanthoff 983 981 984 982 IMPLICIT NONE 985 986 REAL(wp), DIMENSION(:), ALLOCATABLE :: cdf !< CDF of aerosol spectrum987 REAL(wp), DIMENSION(:), ALLOCATABLE :: r_temp !< dry aerosol radius spectrum988 983 989 984 REAL(wp) :: afactor !< curvature effects 990 985 REAL(wp) :: bfactor !< solute effects 991 REAL(wp) :: d r !<width of radius bin986 REAL(wp) :: dlogr !< logarithmic width of radius bin 992 987 REAL(wp) :: e_a !< vapor pressure 993 988 REAL(wp) :: e_s !< saturation vapor pressure 994 REAL(wp) :: n_init !< sum of all aerosol concentrations 995 REAL(wp) :: pdf !< PDF of aerosol spectrum 996 REAL(wp) :: rmin = 1.0e-8_wp !< minimum aerosol radius 997 REAL(wp) :: rmax = 1.0e-6_wp !< maximum aerosol radius 998 REAL(wp) :: rs_rand !< random number 999 REAL(wp) :: r_mid !< mean radius 989 REAL(wp) :: rmin = 0.005e-6_wp !< minimum aerosol radius 990 REAL(wp) :: rmax = 10.0e-6_wp !< maximum aerosol radius 991 REAL(wp) :: r_mid !< mean radius of bin 992 REAL(wp) :: r_l !< left radius of bin 993 REAL(wp) :: r_r !< right radius of bin 1000 994 REAL(wp) :: sigma !< surface tension 1001 995 REAL(wp) :: t_int !< temperature 1002 REAL(wp) :: weight_sum !< sum of all weighting factors1003 996 1004 997 INTEGER(iwp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg), INTENT(IN) :: local_start !< 1005 998 1006 999 INTEGER(iwp) :: n !< 1007 INTEGER(iwp) :: nn !<1008 INTEGER(iwp) :: no_bins = 999 !< number of bins1009 1000 INTEGER(iwp) :: ip !< 1010 1001 INTEGER(iwp) :: jp !< 1011 1002 INTEGER(iwp) :: kp !< 1012 1003 1013 LOGICAL :: new_pdf = .FALSE. !< check if aerosol PDF has to be recalculated 1014 1015 ! 1016 !-- Compute aerosol background distribution 1017 IF ( init_aerosol_probabilistic ) THEN 1018 ALLOCATE( cdf(0:no_bins), r_temp(0:no_bins) ) 1019 DO n = 0, no_bins 1020 r_temp(n) = EXP( LOG(rmin) + ( LOG(rmax) - LOG(rmin ) ) / & 1021 REAL(no_bins, KIND=wp) * REAL(n, KIND=wp) ) 1022 1023 cdf(n) = 0.0_wp 1024 n_init = n1 + n2 + n3 1025 IF ( n1 > 0.0_wp ) THEN 1026 cdf(n) = cdf(n) + n1 / n_init * ( 0.5_wp + 0.5_wp * & 1027 ERF( LOG( r_temp(n) / rm1 ) / & 1028 ( SQRT(2.0_wp) * LOG(s1) ) & 1029 ) ) 1030 ENDIF 1031 IF ( n2 > 0.0_wp ) THEN 1032 cdf(n) = cdf(n) + n2 / n_init * ( 0.5_wp + 0.5_wp * & 1033 ERF( LOG( r_temp(n) / rm2 ) / & 1034 ( SQRT(2.0_wp) * LOG(s2) ) & 1035 ) ) 1036 ENDIF 1037 IF ( n3 > 0.0_wp ) THEN 1038 cdf(n) = cdf(n) + n3 / n_init * ( 0.5_wp + 0.5_wp * & 1039 ERF( LOG( r_temp(n) / rm3 ) / & 1040 ( SQRT(2.0_wp) * LOG(s3) ) & 1041 ) ) 1042 ENDIF 1043 1044 ENDDO 1004 ! 1005 !-- The following typical aerosol spectra are taken from Jaenicke (1993): 1006 !-- Tropospheric aerosols. Published in Aerosol-Cloud-Climate Interactions. 1007 IF ( TRIM(aero_type) .EQ. 'polar' ) THEN 1008 na = (/ 2.17e1, 1.86e-1, 3.04e-4 /) * 1.0E6 1009 rm = (/ 0.0689, 0.375, 4.29 /) * 1.0E-6 1010 log_sigma = (/ 0.245, 0.300, 0.291 /) 1011 ELSEIF ( TRIM(aero_type) .EQ. 'background' ) THEN 1012 na = (/ 1.29e2, 5.97e1, 6.35e1 /) * 1.0E6 1013 rm = (/ 0.0036, 0.127, 0.259 /) * 1.0E-6 1014 log_sigma = (/ 0.645, 0.253, 0.425 /) 1015 ELSEIF ( TRIM(aero_type) .EQ. 'maritime' ) THEN 1016 na = (/ 1.33e2, 6.66e1, 3.06e0 /) * 1.0E6 1017 rm = (/ 0.0039, 0.133, 0.29 /) * 1.0E-6 1018 log_sigma = (/ 0.657, 0.210, 0.396 /) 1019 ELSEIF ( TRIM(aero_type) .EQ. 'continental' ) THEN 1020 na = (/ 3.20e3, 2.90e3, 3.00e-1 /) * 1.0E6 1021 rm = (/ 0.01, 0.058, 0.9 /) * 1.0E-6 1022 log_sigma = (/ 0.161, 0.217, 0.380 /) 1023 ELSEIF ( TRIM(aero_type) .EQ. 'desert' ) THEN 1024 na = (/ 7.26e2, 1.14e3, 1.78e-1 /) * 1.0E6 1025 rm = (/ 0.001, 0.0188, 10.8 /) * 1.0E-6 1026 log_sigma = (/ 0.247, 0.770, 0.438 /) 1027 ELSEIF ( TRIM(aero_type) .EQ. 'rural' ) THEN 1028 na = (/ 6.65e3, 1.47e2, 1.99e3 /) * 1.0E6 1029 rm = (/ 0.00739, 0.0269, 0.0419 /) * 1.0E-6 1030 log_sigma = (/ 0.225, 0.557, 0.266 /) 1031 ELSEIF ( TRIM(aero_type) .EQ. 'urban' ) THEN 1032 na = (/ 9.93e4, 1.11e3, 3.64e4 /) * 1.0E6 1033 rm = (/ 0.00651, 0.00714, 0.0248 /) * 1.0E-6 1034 log_sigma = (/ 0.245, 0.666, 0.337 /) 1035 ELSEIF ( TRIM(aero_type) .EQ. 'user' ) THEN 1036 CONTINUE 1037 ELSE 1038 WRITE( message_string, * ) 'unknown aerosol type ', & 1039 'aero_type = "', TRIM( aero_type ), '"' 1040 CALL message( 'lpm_init', 'PA0459', 1, 2, 0, 6, 0 ) 1045 1041 ENDIF 1046 1042 … … 1052 1048 IF ( number_of_particles <= 0 ) CYCLE 1053 1049 particles => grid_particles(kp,jp,ip)%particles(1:number_of_particles) 1050 1051 dlogr = ( LOG10(rmax) - LOG10(rmin) ) / ( number_of_particles - local_start(kp,jp,ip) + 1 ) 1054 1052 ! 1055 1053 !-- Initialize the aerosols with a predefined spectral distribution 1056 !-- of the dry radius (logarithmically increasing bins) and a varying 1054 !-- of the dry radius (logarithmically increasing bins) and a varying 1057 1055 !-- weighting factor 1058 IF ( .NOT. init_aerosol_probabilistic ) THEN 1059 1060 new_pdf = .FALSE. 1061 IF ( .NOT. ALLOCATED( r_temp ) ) THEN 1062 new_pdf = .TRUE. 1056 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1057 1058 r_l = 10.0**( LOG10( rmin ) + (n-1) * dlogr ) 1059 r_r = 10.0**( LOG10( rmin ) + n * dlogr ) 1060 r_mid = SQRT( r_l * r_r ) 1061 1062 particles(n)%aux1 = r_mid 1063 particles(n)%weight_factor = & 1064 ( na(1) / ( SQRT( 2.0 * pi ) * log_sigma(1) ) * & 1065 EXP( - LOG10( r_mid / rm(1) )**2 / ( 2.0 * log_sigma(1)**2 ) ) + & 1066 na(2) / ( SQRT( 2.0 * pi ) * log_sigma(2) ) * & 1067 EXP( - LOG10( r_mid / rm(2) )**2 / ( 2.0 * log_sigma(2)**2 ) ) + & 1068 na(3) / ( SQRT( 2.0 * pi ) * log_sigma(3) ) * & 1069 EXP( - LOG10( r_mid / rm(3) )**2 / ( 2.0 * log_sigma(3)**2 ) ) & 1070 ) * ( LOG10(r_r) - LOG10(r_l) ) * ( dx * dy * dz ) 1071 1072 ! 1073 !-- Multiply weight_factor with the namelist parameter aero_weight 1074 !-- to increase or decrease the number of simulated aerosols 1075 particles(n)%weight_factor = particles(n)%weight_factor * aero_weight 1076 1077 IF ( particles(n)%weight_factor - FLOOR(particles(n)%weight_factor,KIND=wp) & 1078 .GT. random_function( iran_part ) ) THEN 1079 particles(n)%weight_factor = FLOOR(particles(n)%weight_factor,KIND=wp) + 1.0 1063 1080 ELSE 1064 IF ( SIZE( r_temp ) .NE. & 1065 number_of_particles - local_start(kp,jp,ip) + 2 ) THEN 1066 new_pdf = .TRUE. 1067 DEALLOCATE( r_temp ) 1068 ENDIF 1081 particles(n)%weight_factor = FLOOR(particles(n)%weight_factor,KIND=wp) 1069 1082 ENDIF 1070 1071 IF ( new_pdf ) THEN 1072 1073 no_bins = number_of_particles + 1 - local_start(kp,jp,ip) 1074 ALLOCATE( r_temp(0:no_bins) ) 1075 1076 DO n = 0, no_bins 1077 r_temp(n) = EXP( LOG(rmin) + ( LOG(rmax) - LOG(rmin ) ) / & 1078 REAL(no_bins, KIND=wp) * & 1079 REAL(n, KIND=wp) ) 1080 ENDDO 1081 1082 ENDIF 1083 1084 ! 1085 !-- Calculate radius and concentration of each aerosol 1086 DO n = local_start(kp,jp,ip), number_of_particles 1087 1088 nn = n - local_start(kp,jp,ip) 1089 1090 r_mid = SQRT( r_temp(nn) * r_temp(nn+1) ) 1091 dr = r_temp(nn+1) - r_temp(nn) 1092 1093 pdf = 0.0_wp 1094 n_init = n1 + n2 + n3 1095 IF ( n1 > 0.0_wp ) THEN 1096 pdf = pdf + n1 / n_init * ( 1.0_wp / ( r_mid * LOG(s1) * & 1097 SQRT( 2.0_wp * pi ) & 1098 ) * & 1099 EXP( -( LOG( r_mid / rm1 ) )**2 / & 1100 ( 2.0_wp * LOG(s1)**2 ) & 1101 ) & 1102 ) 1103 ENDIF 1104 IF ( n2 > 0.0_wp ) THEN 1105 pdf = pdf + n2 / n_init * ( 1.0_wp / ( r_mid * LOG(s2) * & 1106 SQRT( 2.0_wp * pi ) & 1107 ) * & 1108 EXP( -( LOG( r_mid / rm2 ) )**2 / & 1109 ( 2.0_wp * LOG(s2)**2 ) & 1110 ) & 1111 ) 1112 ENDIF 1113 IF ( n3 > 0.0_wp ) THEN 1114 pdf = pdf + n3 / n_init * ( 1.0_wp / ( r_mid * LOG(s3) * & 1115 SQRT( 2.0_wp * pi ) & 1116 ) * & 1117 EXP( -( LOG( r_mid / rm3 ) )**2 / & 1118 ( 2.0_wp * LOG(s3)**2 ) & 1119 ) & 1120 ) 1121 ENDIF 1122 1123 particles(n)%rvar2 = r_mid 1124 particles(n)%weight_factor = pdf * dr 1125 1126 END DO 1127 ! 1128 !-- Adjust weighting factors to initialize the same number of aerosols 1129 !-- in every grid box 1130 weight_sum = SUM(particles(local_start(kp,jp,ip):number_of_particles)%weight_factor) 1131 1132 particles(local_start(kp,jp,ip):number_of_particles)%weight_factor = & 1133 particles(local_start(kp,jp,ip):number_of_particles)%weight_factor / & 1134 weight_sum * initial_weighting_factor * ( no_bins + 1 ) 1135 1136 ENDIF 1137 ! 1138 !-- Initialize the aerosols with a predefined weighting factor but 1139 !-- a randomly choosen dry radius 1140 IF ( init_aerosol_probabilistic ) THEN 1141 1142 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1143 1144 rs_rand = -1.0_wp 1145 DO WHILE ( rs_rand .LT. cdf(0) .OR. rs_rand .GE. cdf(no_bins) ) 1146 rs_rand = random_function( iran_part ) 1147 ENDDO 1148 ! 1149 !-- Determine aerosol dry radius by a random number generator 1150 DO nn = 0, no_bins-1 1151 IF ( cdf(nn) .LE. rs_rand .AND. cdf(nn+1) .GT. rs_rand ) THEN 1152 particles(n)%rvar2 = r_temp(nn) + ( r_temp(nn+1) - r_temp(nn) ) / & 1153 ( cdf(nn+1) - cdf(nn) ) * ( rs_rand - cdf(nn) ) 1154 EXIT 1155 ENDIF 1156 ENDDO 1157 1158 ENDDO 1159 1160 ENDIF 1161 1083 ! 1084 !-- Unnecessary particles will be deleted 1085 IF ( particles(n)%weight_factor .LE. 0.0 ) particles(n)%particle_mask = .FALSE. 1086 1087 ENDDO 1162 1088 ! 1163 1089 !-- Set particle radius to equilibrium radius based on the environmental 1164 1090 !-- supersaturation (Khvorostyanov and Curry, 2007, JGR). This avoids 1165 !-- the sometimes lengthy growth toward their equilibrium radius within 1091 !-- the sometimes lengthy growth toward their equilibrium radius within 1166 1092 !-- the simulation. 1167 1093 t_int = pt(kp,jp,ip) * ( hyp(kp) / 100000.0_wp )**0.286_wp … … 1176 1102 rho_s / ( molecular_weight_of_solute * rho_l ) 1177 1103 ! 1178 !-- The formula is only valid for subsaturated environments. For 1104 !-- The formula is only valid for subsaturated environments. For 1179 1105 !-- supersaturations higher than -5 %, the supersaturation is set to -5%. 1180 1106 IF ( e_a / e_s >= 0.95_wp ) e_a = 0.95_wp * e_s 1181 1107 1182 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1183 ! 1184 !-- For details on this equation, see Eq. (14) of Khvorostyanov and 1185 !-- Curry (2007, JGR) 1108 DO n = local_start(kp,jp,ip), number_of_particles !only new particles 1109 ! 1110 !-- For details on this equation, see Eq. (14) of Khvorostyanov and 1111 !-- Curry (2007, JGR) 1186 1112 particles(n)%radius = bfactor**0.3333333_wp * & 1187 particles(n)% rvar2/ ( 1.0_wp - e_a / e_s )**0.3333333_wp / &1113 particles(n)%aux1 / ( 1.0_wp - e_a / e_s )**0.3333333_wp / & 1188 1114 ( 1.0_wp + ( afactor / ( 3.0_wp * bfactor**0.3333333_wp * & 1189 particles(n)% rvar2) ) / &1115 particles(n)%aux1 ) ) / & 1190 1116 ( 1.0_wp - e_a / e_s )**0.6666666_wp & 1191 1117 ) … … 1196 1122 ENDDO 1197 1123 ENDDO 1198 !1199 !-- Deallocate used arrays1200 IF ( ALLOCATED(r_temp) ) DEALLOCATE( r_temp )1201 IF ( ALLOCATED(cdf) ) DEALLOCATE( cdf )1202 1124 1203 1125 END SUBROUTINE lpm_init_aerosols -
palm/trunk/SOURCE/lpm_read_restart_file.f90
r2305 r2312 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Extended particle data type. 28 ! 29 ! 2305 2017-07-06 11:18:47Z hoffmann 27 30 ! Improved calculation of particle IDs. 28 ! 31 ! 29 32 ! 2265 2017-06-08 16:58:28Z schwenkel 30 33 ! Unused variables removed. 31 ! 34 ! 32 35 ! 2101 2017-01-05 16:42:31Z suehring 33 36 ! 34 37 ! 2000 2016-08-20 18:09:15Z knoop 35 38 ! Forced header and separation lines into 80 columns 36 ! 39 ! 37 40 ! 1822 2016-04-07 07:49:42Z hoffmann 38 41 ! Tails removed. Unused variables removed. 39 42 ! 40 43 ! 1682 2015-10-07 23:56:08Z knoop 41 ! Code annotations made doxygen readable 42 ! 44 ! Code annotations made doxygen readable 45 ! 43 46 ! 1359 2014-04-11 17:15:14Z hoffmann 44 ! New particle structure integrated. 47 ! New particle structure integrated. 45 48 ! 46 49 ! 1320 2014-03-20 08:40:49Z raasch … … 61 64 !------------------------------------------------------------------------------! 62 65 SUBROUTINE lpm_read_restart_file 63 66 64 67 65 68 USE control_parameters, & … … 119 122 120 123 ! 121 !-- If less particles are stored on the restart file than prescribed by 124 !-- If less particles are stored on the restart file than prescribed by 122 125 !-- min_nr_particle, the remainder is initialized by zero_particle to avoid 123 126 !-- errors. … … 125 128 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 126 129 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 127 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 130 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, 0.0_wp, & 128 131 0, 0, 0_idp, .FALSE., -1 ) 129 132 ! … … 173 176 CLOSE ( 90 ) 174 177 ! 175 !-- Must be called to sort particles into blocks, which is needed for a fast 178 !-- Must be called to sort particles into blocks, which is needed for a fast 176 179 !-- interpolation of the LES fields on the particle position. 177 180 CALL lpm_pack_all_arrays -
palm/trunk/SOURCE/microphysics_mod.f90
r2292 r2312 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 28 ! includes two more prognostic equations for cloud drop concentration (nc) 29 ! and cloud water content (qc). 30 ! - The process of activation is parameterized with a simple Twomey 31 ! activion scheme or with considering solution and curvature 27 ! s1 changed to log_sigma 28 ! 29 ! 2292 2017-06-20 09:51:42Z schwenkel 30 ! Implementation of new microphysic scheme: cloud_scheme = 'morrison' 31 ! includes two more prognostic equations for cloud drop concentration (nc) 32 ! and cloud water content (qc). 33 ! - The process of activation is parameterized with a simple Twomey 34 ! activion scheme or with considering solution and curvature 32 35 ! effects (Khvorostyanov and Curry ,2006). 33 36 ! - The saturation adjustment scheme is replaced by the parameterization 34 37 ! of condensation rates (Khairoutdinov and Kogan, 2000, Mon. Wea. Rev.,128). 35 38 ! - All other microphysical processes of Seifert and Beheng are used. 36 ! Additionally, in those processes the reduction of cloud number concentration 37 ! is considered. 38 ! 39 ! Additionally, in those processes the reduction of cloud number concentration 40 ! is considered. 41 ! 39 42 ! 2233 2017-05-30 18:08:54Z suehring 40 43 ! 41 44 ! 2232 2017-05-30 17:47:52Z suehring 42 45 ! Adjustments to new topography and surface concept 43 ! 46 ! 44 47 ! 2155 2017-02-21 09:57:40Z hoffmann 45 48 ! Bugfix in the calculation of microphysical quantities on ghost points. … … 207 210 limiter_sedimentation, na_init, nc_const, sigma_gc, & 208 211 ventilation_effect 209 212 210 213 211 214 INTERFACE microphysics_control … … 463 466 IF ( nr(k,j,i) * xrmin > qr(k,j,i) * hyrho(k) ) THEN 464 467 nr(k,j,i) = qr(k,j,i) * hyrho(k) / xrmin * & 465 MERGE( 1.0_wp, 0.0_wp, & 468 MERGE( 1.0_wp, 0.0_wp, & 466 469 BTEST( wall_flags_0(k,j,i), 0 ) ) 467 470 ELSEIF ( nr(k,j,i) * xrmax < qr(k,j,i) * hyrho(k) ) THEN 468 471 nr(k,j,i) = qr(k,j,i) * hyrho(k) / xrmax * & 469 MERGE( 1.0_wp, 0.0_wp, & 472 MERGE( 1.0_wp, 0.0_wp, & 470 473 BTEST( wall_flags_0(k,j,i), 0 ) ) 471 474 ENDIF … … 478 481 IF ( nc(k,j,i) * xcmin > qc(k,j,i) * hyrho(k) ) THEN 479 482 nc(k,j,i) = qc(k,j,i) * hyrho(k) / xcmin * & 480 MERGE( 1.0_wp, 0.0_wp, & 483 MERGE( 1.0_wp, 0.0_wp, & 481 484 BTEST( wall_flags_0(k,j,i), 0 ) ) 482 485 ENDIF … … 521 524 USE particle_attributes, & 522 525 ONLY: molecular_weight_of_solute, molecular_weight_of_water, rho_s, & 523 s1, s2, s3, vanthoff526 log_sigma, vanthoff 524 527 525 528 IMPLICIT NONE … … 578 581 !-- Prescribe parameters for activation 579 582 !-- (see: Bott + Trautmann, 2002, Atm. Res., 64) 580 k_act = 0.7_wp 583 k_act = 0.7_wp 581 584 582 585 IF ( sat >= 0.0 .AND. .NOT. curvature_solution_effects_bulk ) THEN 583 586 ! 584 !-- Compute the number of activated Aerosols 587 !-- Compute the number of activated Aerosols 585 588 !-- (see: Twomey, 1959, Pure and applied Geophysics, 43) 586 589 n_act = na_init * sat**k_act … … 592 595 ! 593 596 !-- Compute activation rate after Khairoutdinov and Kogan 594 !-- (see: Khairoutdinov + Kogan, 2000, Mon. Wea. Rev., 128) 595 sat_max = 1.0_wp / 100.0_wp 596 activ = MAX( 0.0_wp, ( (na_init + nc(k,j,i) ) * MIN & 597 ( 1.0_wp, ( sat / sat_max )**k_act) - nc(k,j,i) ) ) / & 597 !-- (see: Khairoutdinov + Kogan, 2000, Mon. Wea. Rev., 128) 598 sat_max = 1.0_wp / 100.0_wp 599 activ = MAX( 0.0_wp, ( (na_init + nc(k,j,i) ) * MIN & 600 ( 1.0_wp, ( sat / sat_max )**k_act) - nc(k,j,i) ) ) / & 598 601 dt_micro 599 602 ELSEIF ( sat >= 0.0 .AND. curvature_solution_effects_bulk ) THEN 600 603 ! 601 !-- Curvature effect (afactor) with surface tension 604 !-- Curvature effect (afactor) with surface tension 602 605 !-- parameterization by Straka (2009) 603 606 sigma = 0.0761_wp - 0.000155_wp * ( t_int - 273.15_wp ) … … 609 612 610 613 ! 611 !-- Prescribe power index that describes the soluble fraction 614 !-- Prescribe power index that describes the soluble fraction 612 615 !-- of an aerosol particle (beta) and mean geometric radius of 613 616 !-- dry aerosol spectrum … … 616 619 rd0 = 0.05E-6_wp 617 620 ! 618 !-- Calculate mean geometric supersaturation (s_0) with 621 !-- Calculate mean geometric supersaturation (s_0) with 619 622 !-- parameterization by Khvorostyanov and Curry (2006) 620 623 s_0 = rd0 **(- ( 1.0_wp + beta_act ) ) * & … … 622 625 623 626 ! 624 !-- Calculate number of activated CCN as a function of 627 !-- Calculate number of activated CCN as a function of 625 628 !-- supersaturation and taking Koehler theory into account 626 !-- (see: Khvorostyanov + Curry, 2006, J. Geo. Res., 111) 627 n_ccn = ( na_init / 2.0_wp ) * ( 1.0_wp - ERF( & 628 LOG( s_0 / sat ) / ( SQRT(2.0_wp) * LOG(s1) ) ) )629 !-- (see: Khvorostyanov + Curry, 2006, J. Geo. Res., 111) 630 n_ccn = ( na_init / 2.0_wp ) * ( 1.0_wp - ERF( & 631 LOG( s_0 / sat ) / ( SQRT(2.0_wp) * log_sigma(1) ) ) ) 629 632 activ = MAX( ( n_ccn - nc(k,j,i) ) / dt_micro, 0.0_wp ) 630 633 ENDIF … … 644 647 ! Description: 645 648 ! ------------ 646 !> Calculate condensation rate for cloud water content (after Khairoutdinov and 649 !> Calculate condensation rate for cloud water content (after Khairoutdinov and 647 650 !> Kogan, 2000). 648 651 !------------------------------------------------------------------------------! … … 724 727 !-- Mean weight of cloud drops 725 728 IF ( nc(k,j,i) <= 0.0_wp) CYCLE 726 xc = MAX( (hyrho(k) * qc(k,j,i) / nc(k,j,i)), xcmin) 729 xc = MAX( (hyrho(k) * qc(k,j,i) / nc(k,j,i)), xcmin) 727 730 ! 728 731 !-- Weight averaged diameter of cloud drops: … … 730 733 ! 731 734 !-- Integral diameter of cloud drops 732 nc_0 = nc(k,j,i) * dc 735 nc_0 = nc(k,j,i) * dc 733 736 ! 734 737 !-- Condensation needs only to be calculated in supersaturated regions … … 741 744 cond_max = q(k,j,i) - q_s - qc(k,j,i) - qr(k,j,i) 742 745 cond = MIN( cond, cond_max / dt_micro ) 743 746 744 747 qc(k,j,i) = qc(k,j,i) + cond * dt_micro 745 748 ELSEIF ( sat < 0.0_wp ) THEN … … 891 894 * flag 892 895 IF ( microphysics_morrison ) THEN 893 nc(k,j,i) = nc(k,j,i) - MIN( nc(k,j,i), 2.0_wp * & 896 nc(k,j,i) = nc(k,j,i) - MIN( nc(k,j,i), 2.0_wp * & 894 897 autocon / x0 * hyrho(k) * dt_micro * flag ) 895 898 ENDIF … … 1033 1036 ! 1034 1037 !-- Mean weight of cloud drops 1035 xc = MAX( (hyrho(k) * qc(k,j,i) / nc_accr), xcmin) 1038 xc = MAX( (hyrho(k) * qc(k,j,i) / nc_accr), xcmin) 1036 1039 ! 1037 1040 !-- Parameterized turbulence effects on autoconversion (Seifert, … … 1321 1324 1322 1325 USE control_parameters, & 1323 ONLY: call_microphysics_at_all_substeps, & 1326 ONLY: call_microphysics_at_all_substeps, & 1324 1327 intermediate_timestep_count, microphysics_morrison 1325 1328 … … 1366 1369 IF ( microphysics_morrison ) THEN 1367 1370 IF ( qc(k,j,i) > eps_sb .AND. nc(k,j,i) > eps_mr ) THEN 1368 sed_nc(k) = sed_qc_const * & 1371 sed_nc(k) = sed_qc_const * & 1369 1372 ( qc(k,j,i) * hyrho(k) )**( 2.0_wp / 3.0_wp ) * & 1370 1373 ( nc(k,j,i) )**( 1.0_wp / 3.0_wp ) … … 1449 1452 USE surface_mod, & 1450 1453 ONLY : bc_h 1451 1454 1452 1455 IMPLICIT NONE 1453 1456 … … 1455 1458 INTEGER(iwp) :: j !< running index y direction 1456 1459 INTEGER(iwp) :: k !< running index z direction 1457 INTEGER(iwp) :: k_run !< 1460 INTEGER(iwp) :: k_run !< 1458 1461 INTEGER(iwp) :: l !< running index of surface type 1459 1462 INTEGER(iwp) :: m !< running index surface elements … … 1528 1531 ENDDO 1529 1532 ! 1530 !-- Adjust boundary values using surface data type. 1533 !-- Adjust boundary values using surface data type. 1531 1534 !-- Upward-facing 1532 surf_s = bc_h(0)%start_index(j,i) 1535 surf_s = bc_h(0)%start_index(j,i) 1533 1536 surf_e = bc_h(0)%end_index(j,i) 1534 1537 DO m = surf_s, surf_e … … 1539 1542 ! 1540 1543 !-- Downward-facing 1541 surf_s = bc_h(1)%start_index(j,i) 1544 surf_s = bc_h(1)%start_index(j,i) 1542 1545 surf_e = bc_h(1)%end_index(j,i) 1543 1546 DO m = surf_s, surf_e … … 1607 1610 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) 1608 1611 ! 1609 !-- Sum up all rain drop number densities which contribute to the flux 1612 !-- Sum up all rain drop number densities which contribute to the flux 1610 1613 !-- through k-1/2 1611 1614 flux = 0.0_wp … … 1730 1733 THEN 1731 1734 ! 1732 !-- Run over all upward-facing surface elements, i.e. non-natural, 1735 !-- Run over all upward-facing surface elements, i.e. non-natural, 1733 1736 !-- natural and urban 1734 1737 DO m = 1, bc_h(0)%ns 1735 i = bc_h(0)%i(m) 1738 i = bc_h(0)%i(m) 1736 1739 j = bc_h(0)%j(m) 1737 1740 k = bc_h(0)%k(m) … … 1961 1964 USE particle_attributes, & 1962 1965 ONLY: molecular_weight_of_solute, molecular_weight_of_water, rho_s, & 1963 s1, s2, s3, vanthoff1966 log_sigma, vanthoff 1964 1967 1965 1968 IMPLICIT NONE … … 2013 2016 !-- Prescribe parameters for activation 2014 2017 !-- (see: Bott + Trautmann, 2002, Atm. Res., 64) 2015 k_act = 0.7_wp 2018 k_act = 0.7_wp 2016 2019 2017 2020 IF ( sat >= 0.0 .AND. .NOT. curvature_solution_effects_bulk ) THEN 2018 2021 ! 2019 !-- Compute the number of activated Aerosols 2022 !-- Compute the number of activated Aerosols 2020 2023 !-- (see: Twomey, 1959, Pure and applied Geophysics, 43) 2021 2024 n_act = na_init * sat**k_act … … 2027 2030 ! 2028 2031 !-- Compute activation rate after Khairoutdinov and Kogan 2029 !-- (see: Khairoutdinov + Kogan, 2000, Mon. Wea. Rev., 128) 2030 sat_max = 0.8_wp / 100.0_wp 2031 activ = MAX( 0.0_wp, ( (na_init + nc_1d(k) ) * MIN & 2032 ( 1.0_wp, ( sat / sat_max )**k_act) - nc_1d(k) ) ) / & 2032 !-- (see: Khairoutdinov + Kogan, 2000, Mon. Wea. Rev., 128) 2033 sat_max = 0.8_wp / 100.0_wp 2034 activ = MAX( 0.0_wp, ( (na_init + nc_1d(k) ) * MIN & 2035 ( 1.0_wp, ( sat / sat_max )**k_act) - nc_1d(k) ) ) / & 2033 2036 dt_micro 2034 2037 … … 2036 2039 ELSEIF ( sat >= 0.0 .AND. curvature_solution_effects_bulk ) THEN 2037 2040 ! 2038 !-- Curvature effect (afactor) with surface tension 2041 !-- Curvature effect (afactor) with surface tension 2039 2042 !-- parameterization by Straka (2009) 2040 2043 sigma = 0.0761_wp - 0.000155_wp * ( t_int - 273.15_wp ) … … 2046 2049 2047 2050 ! 2048 !-- Prescribe power index that describes the soluble fraction 2051 !-- Prescribe power index that describes the soluble fraction 2049 2052 !-- of an aerosol particle (beta) and mean geometric radius of 2050 2053 !-- dry aerosol spectrum … … 2053 2056 rd0 = 0.05E-6_wp 2054 2057 ! 2055 !-- Calculate mean geometric supersaturation (s_0) with 2058 !-- Calculate mean geometric supersaturation (s_0) with 2056 2059 !-- parameterization by Khvorostyanov and Curry (2006) 2057 2060 s_0 = rd0 **(- ( 1.0_wp + beta_act ) ) * & … … 2059 2062 2060 2063 ! 2061 !-- Calculate number of activated CCN as a function of 2064 !-- Calculate number of activated CCN as a function of 2062 2065 !-- supersaturation and taking Koehler theory into account 2063 2066 !-- (see: Khvorostyanov + Curry, 2006, J. Geo. Res., 111) 2064 n_ccn = ( na_init / 2.0_wp ) * ( 1.0_wp - ERF( & 2065 LOG( s_0 / sat ) / ( SQRT(2.0_wp) * LOG(s1) ) ) )2067 n_ccn = ( na_init / 2.0_wp ) * ( 1.0_wp - ERF( & 2068 LOG( s_0 / sat ) / ( SQRT(2.0_wp) * log_sigma(1) ) ) ) 2066 2069 activ = MAX( ( n_ccn ) / dt_micro, 0.0_wp ) 2067 2068 nc_1d(k) = MIN( (nc_1d(k) + activ * dt_micro), na_init) 2070 2071 nc_1d(k) = MIN( (nc_1d(k) + activ * dt_micro), na_init) 2069 2072 ENDIF 2070 2073 … … 2076 2079 ! Description: 2077 2080 ! ------------ 2078 !> Calculate condensation rate for cloud water content (after Khairoutdinov and 2081 !> Calculate condensation rate for cloud water content (after Khairoutdinov and 2079 2082 !> Kogan, 2000). 2080 2083 !------------------------------------------------------------------------------! … … 2154 2157 !-- Mean weight of cloud drops 2155 2158 IF ( nc_1d(k) <= 0.0_wp) CYCLE 2156 xc = MAX( (hyrho(k) * qc_1d(k) / nc_1d(k)), xcmin) 2159 xc = MAX( (hyrho(k) * qc_1d(k) / nc_1d(k)), xcmin) 2157 2160 ! 2158 2161 !-- Weight averaged diameter of cloud drops: … … 2160 2163 ! 2161 2164 !-- Integral diameter of cloud drops 2162 nc_0 = nc_1d(k) * dc 2165 nc_0 = nc_1d(k) * dc 2163 2166 ! 2164 2167 !-- Condensation needs only to be calculated in supersaturated regions … … 2171 2174 cond_max = q_1d(k) - q_s - qc_1d(k) - qr_1d(k) 2172 2175 cond = MIN( cond, cond_max / dt_micro ) 2173 2176 2174 2177 qc_1d(k) = qc_1d(k) + cond * dt_micro 2175 2178 ELSEIF ( sat < 0.0_wp ) THEN … … 2302 2305 nr_1d(k) = nr_1d(k) + autocon / x0 * hyrho(k) * dt_micro * flag 2303 2306 IF ( microphysics_morrison ) THEN 2304 nc_1d(k) = nc_1d(k) - MIN( nc_1d(k), 2.0_wp * & 2307 nc_1d(k) = nc_1d(k) - MIN( nc_1d(k), 2.0_wp * & 2305 2308 autocon / x0 * hyrho(k) * dt_micro * flag ) 2306 2309 ENDIF … … 2425 2428 ! 2426 2429 !-- Mean weight of cloud drops 2427 xc = MAX( (hyrho(k) * qc_1d(k) / nc_accr), xcmin) 2430 xc = MAX( (hyrho(k) * qc_1d(k) / nc_accr), xcmin) 2428 2431 ! 2429 2432 !-- Parameterized turbulence effects on autoconversion (Seifert, … … 2716 2719 IF ( microphysics_morrison ) THEN 2717 2720 IF ( qc_1d(k) > eps_sb .AND. nc_1d(k) > eps_mr ) THEN 2718 sed_nc(k) = sed_qc_const * & 2721 sed_nc(k) = sed_qc_const * & 2719 2722 ( qc_1d(k) * hyrho(k) )**( 2.0_wp / 3.0_wp ) * & 2720 2723 ( nc_1d(k) )**( 1.0_wp / 3.0_wp ) … … 2790 2793 USE surface_mod, & 2791 2794 ONLY : bc_h 2792 2795 2793 2796 IMPLICIT NONE 2794 2797 … … 2859 2862 ENDDO 2860 2863 ! 2861 !-- Adjust boundary values using surface data type. 2864 !-- Adjust boundary values using surface data type. 2862 2865 !-- Upward facing non-natural 2863 surf_s = bc_h(0)%start_index(j,i) 2866 surf_s = bc_h(0)%start_index(j,i) 2864 2867 surf_e = bc_h(0)%end_index(j,i) 2865 2868 DO m = surf_s, surf_e … … 2870 2873 ! 2871 2874 !-- Downward facing non-natural 2872 surf_s = bc_h(1)%start_index(j,i) 2875 surf_s = bc_h(1)%start_index(j,i) 2873 2876 surf_e = bc_h(1)%end_index(j,i) 2874 2877 DO m = surf_s, surf_e … … 2935 2938 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_0(k,j,i), 0 ) ) 2936 2939 ! 2937 !-- Sum up all rain drop number densities which contribute to the flux 2940 !-- Sum up all rain drop number densities which contribute to the flux 2938 2941 !-- through k-1/2 2939 2942 flux = 0.0_wp … … 3044 3047 THEN 3045 3048 3046 surf_s = bc_h(0)%start_index(j,i) 3049 surf_s = bc_h(0)%start_index(j,i) 3047 3050 surf_e = bc_h(0)%end_index(j,i) 3048 3051 DO m = surf_s, surf_e -
palm/trunk/SOURCE/mod_particle_attributes.f90
r2305 r2312 20 20 ! Current revisions: 21 21 ! ------------------ 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Aerosol initialization improved. 28 ! 29 ! 2305 2017-07-06 11:18:47Z hoffmann 27 30 ! Improved calculation of particle IDs. 28 ! 31 ! 29 32 ! 2278 2017-06-12 13:08:18Z schwenkel 30 33 ! Added comments 31 ! 34 ! 32 35 ! 2265 2017-06-08 16:58:28Z schwenkel 33 36 ! Unused variables removed. 34 ! 37 ! 35 38 ! 2263 2017-06-08 14:59:01Z schwenkel 36 39 ! Implemented splitting and merging algorithm 37 ! 40 ! 38 41 ! 2183 2017-03-17 14:29:15Z schwenkel 39 42 ! 40 43 ! 2182 2017-03-17 14:27:40Z schwenkel 41 44 ! Added parameters for simplified particle initialization. 42 ! 45 ! 43 46 ! 2122 2017-01-18 12:22:54Z hoffmann 44 47 ! Calculation of particle ID … … 48 51 ! 2000 2016-08-20 18:09:15Z knoop 49 52 ! Forced header and separation lines into 80 columns 50 ! 53 ! 51 54 ! 1936 2016-06-13 13:37:44Z suehring 52 55 ! +deallocate_memory, step_dealloc … … 71 74 ! 72 75 ! 1727 2015-11-20 07:22:02Z knoop 73 ! Bugfix: Cause of syntax warning gfortran preprocessor removed 74 ! 76 ! Bugfix: Cause of syntax warning gfortran preprocessor removed 77 ! 75 78 ! 1682 2015-10-07 23:56:08Z knoop 76 ! Code annotations made doxygen readable 79 ! Code annotations made doxygen readable 77 80 ! 78 81 ! 1575 2015-03-27 09:56:27Z raasch … … 88 91 !------------------------------------------------------------------------------! 89 92 MODULE particle_attributes 90 93 91 94 92 95 USE kinds 93 96 94 CHARACTER(LEN=15) :: bc_par_lr = 'cyclic' !< left/right boundary condition 95 CHARACTER(LEN=15) :: bc_par_ns = 'cyclic' !< north/south boundary condition 96 CHARACTER(LEN=15) :: bc_par_b = 'reflect' !< bottom boundary condition 97 CHARACTER(LEN=15) :: bc_par_t = 'absorb' !< top boundary condition 98 CHARACTER(LEN=15) :: collision_algorithm = 'all_or_nothing' !< collision algorithm 99 CHARACTER(LEN=15) :: collision_kernel = 'none' !< collision kernel 100 CHARACTER(LEN=5) :: splitting_function = 'gamma' !< function for calculation critical weighting factor 101 CHARACTER(LEN=5) :: splitting_mode = 'const' !< splitting mode 102 103 104 INTEGER(iwp) :: deleted_particles = 0 !< number of deleted particles per time step 97 CHARACTER(LEN=15) :: aero_type = 'maritime' !< aerosol type 98 CHARACTER(LEN=15) :: bc_par_lr = 'cyclic' !< left/right boundary condition 99 CHARACTER(LEN=15) :: bc_par_ns = 'cyclic' !< north/south boundary condition 100 CHARACTER(LEN=15) :: bc_par_b = 'reflect' !< bottom boundary condition 101 CHARACTER(LEN=15) :: bc_par_t = 'absorb' !< top boundary condition 102 CHARACTER(LEN=15) :: collision_kernel = 'none' !< collision kernel 103 CHARACTER(LEN=5) :: splitting_function = 'gamma' !< function for calculation critical weighting factor 104 CHARACTER(LEN=5) :: splitting_mode = 'const' !< splitting mode 105 106 INTEGER(iwp) :: deleted_particles = 0 !< number of deleted particles per time step 105 107 INTEGER(iwp) :: dissipation_classes = 10 !< namelist parameter (see documentation) 106 108 INTEGER(iwp) :: ibc_par_b !< particle bottom boundary condition dummy … … 113 115 INTEGER(iwp) :: max_number_particles_per_gridbox = 100 !< namelist parameter (see documentation) 114 116 INTEGER(iwp) :: merge_drp = 0 !< number of merged droplets 115 INTEGER(iwp) :: min_nr_particle = 50 !< namelist parameter (see documentation) 117 INTEGER(iwp) :: min_nr_particle = 50 !< namelist parameter (see documentation) 116 118 INTEGER(iwp) :: new_particles = 0 !< number of new particles 117 INTEGER(iwp) :: n_max = 100 !< number of radii bin for splitting functions 118 INTEGER(iwp) :: number_of_particles = 0 !< number of particles for each grid box (3d array is saved on prt_count) 119 INTEGER(iwp) :: number_of_particle_groups = 1 !< namelist parameter (see documentation) 120 INTEGER(iwp) :: number_of_sublayers = 20 !< number of sublayers for particle velocities betwenn surface and first grid level 121 INTEGER(iwp) :: number_particles_per_gridbox = -1 !< namelist parameter (see documentation) 122 INTEGER(iwp) :: offset_ocean_nzt = 0 !< in case of oceans runs, the vertical index calculations need an offset 119 INTEGER(iwp) :: n_max = 100 !< number of radii bin for splitting functions 120 INTEGER(iwp) :: number_of_particles = 0 !< number of particles for each grid box (3d array is saved on prt_count) 121 INTEGER(iwp) :: number_of_particle_groups = 1 !< namelist parameter (see documentation) 122 INTEGER(iwp) :: number_of_sublayers = 20 !< number of sublayers for particle velocities betwenn surface and first grid level 123 INTEGER(iwp) :: number_particles_per_gridbox = -1 !< namelist parameter (see documentation) 124 INTEGER(iwp) :: offset_ocean_nzt = 0 !< in case of oceans runs, the vertical index calculations need an offset 123 125 INTEGER(iwp) :: offset_ocean_nzt_m1 = 0 !< in case of oceans runs, the vertical index calculations need an offset 124 126 INTEGER(iwp) :: particles_per_point = 1 !< namelist parameter (see documentation) … … 130 132 INTEGER(iwp) :: sum_merge_drp = 0 !< sum of merged super droplets 131 133 INTEGER(iwp) :: sum_new_particles = 0 !< sum of created particles (in splitting algorithm) 132 INTEGER(iwp) :: total_number_of_particles !< total number of particles in the whole model domain 134 INTEGER(iwp) :: total_number_of_particles !< total number of particles in the whole model domain 133 135 INTEGER(iwp) :: trlp_count_sum !< parameter for particle exchange of PEs 134 136 INTEGER(iwp) :: trlp_count_recv_sum !< parameter for particle exchange of PEs … … 144 146 INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE :: prt_count !< 3d array of number of particles of every grid box 145 147 146 LOGICAL :: all_or_nothing = .FALSE. !< flag for collision algorithm 147 LOGICAL :: average_impact = .FALSE. !< flag for collision algortihm 148 LOGICAL :: curvature_solution_effects = .FALSE. !< namelist parameter (see documentation) 149 LOGICAL :: deallocate_memory = .TRUE. !< namelist parameter (see documentation) 148 LOGICAL :: curvature_solution_effects = .FALSE. !< namelist parameter (see documentation) 149 LOGICAL :: deallocate_memory = .TRUE. !< namelist parameter (see documentation) 150 150 LOGICAL :: hall_kernel = .FALSE. !< flag for collision kernel 151 LOGICAL :: init_aerosol_probabilistic = .FALSE. !< namelist parameter (see documentation)152 151 LOGICAL :: merging = .FALSE. !< namelist parameter (see documentation) 153 LOGICAL :: monodisperse_aerosols = .FALSE. !< namelist parameter (see documentation)154 152 LOGICAL :: particle_advection = .FALSE. !< parameter to steer the advection of particles 155 LOGICAL :: random_start_position = .FALSE. !< namelist parameter (see documentation) 156 LOGICAL :: read_particles_from_restartfile = .TRUE. !< namelist parameter (see documentation) 153 LOGICAL :: random_start_position = .FALSE. !< namelist parameter (see documentation) 154 LOGICAL :: read_particles_from_restartfile = .TRUE. !< namelist parameter (see documentation) 157 155 LOGICAL :: seed_follows_topography = .FALSE. !< namelist parameter (see documentation) 158 156 LOGICAL :: splitting = .FALSE. !< namelist parameter (see documentation) 159 157 LOGICAL :: use_kernel_tables = .FALSE. !< parameter, which turns on the use of precalculated collision kernels 160 LOGICAL :: use_sgs_for_particles = .FALSE. !< namelist parameter (see documentation) 158 LOGICAL :: use_sgs_for_particles = .FALSE. !< namelist parameter (see documentation) 161 159 LOGICAL :: wang_kernel = .FALSE. !< flag for collision kernel 162 160 LOGICAL :: write_particle_statistics = .FALSE. !< namelist parameter (see documentation) 163 161 164 162 LOGICAL, DIMENSION(max_number_of_particle_groups) :: & 165 163 vertical_particle_advection = .TRUE. !< Switch on/off vertical particle transport 166 164 165 REAL(wp) :: aero_weight = 1.0_wp !< namelist parameter (see documentation) 167 166 REAL(wp) :: alloc_factor = 20.0_wp !< namelist parameter (see documentation) 168 167 REAL(wp) :: c_0 = 3.0_wp !< parameter for lagrangian timescale 169 168 REAL(wp) :: dt_min_part = 0.0002_wp !< minimum particle time step when SGS velocities are used (s) 170 169 REAL(wp) :: dt_prel = 9999999.9_wp !< namelist parameter (see documentation) 171 REAL(wp) :: dt_write_particle_data = 9999999.9_wp !< namelist parameter (see documentation) 172 REAL(wp) :: end_time_prel = 9999999.9_wp !< namelist parameter (see documentation) 170 REAL(wp) :: dt_write_particle_data = 9999999.9_wp !< namelist parameter (see documentation) 171 REAL(wp) :: end_time_prel = 9999999.9_wp !< namelist parameter (see documentation) 173 172 REAL(wp) :: initial_weighting_factor = 1.0_wp !< namelist parameter (see documentation) 173 REAL(wp) :: log_sigma(3) = 1.0_wp !< namelist parameter (see documentation) 174 174 REAL(wp) :: molecular_weight_of_solute = 0.05844_wp !< mol. m. NaCl (kg mol-1) 175 175 REAL(wp) :: molecular_weight_of_water = 0.01801528_wp !< mol. m. H2O (kg mol-1) 176 REAL(wp) :: n1 = 100.0_wp !< namelist parameter (see documentation) 177 REAL(wp) :: n2 = 0.0_wp !< namelist parameter (see documentation) 178 REAL(wp) :: n3 = 0.0_wp !< namelist parameter (see documentation) 176 REAL(wp) :: na(3) = 0.0_wp !< namelist parameter (see documentation) 179 177 REAL(wp) :: number_concentration = -1.0_wp !< namelist parameter (see documentation) 180 178 REAL(wp) :: particle_advection_start = 0.0_wp !< namelist parameter (see documentation) 181 179 REAL(wp) :: radius_merge = 1.0E-7_wp !< namelist parameter (see documentation) 182 180 REAL(wp) :: radius_split = 40.0E-6_wp !< namelist parameter (see documentation) 183 REAL(wp) :: rho_s = 2165.0_wp !< density of NaCl (kg m-3) 184 REAL(wp) :: rm1 = 0.05E-6_wp !< namelist parameter (see documentation) 185 REAL(wp) :: rm2 = 0.05E-6_wp !< namelist parameter (see documentation) 186 REAL(wp) :: rm3 = 0.05E-6_wp !< namelist parameter (see documentation) 187 REAL(wp) :: s1 = 2.0_wp !< namelist parameter (see documentation) 188 REAL(wp) :: s2 = 2.0_wp !< namelist parameter (see documentation) 189 REAL(wp) :: s3 = 2.0_wp !< namelist parameter (see documentation) 190 REAL(wp) :: sgs_wf_part !< parameter for sgs 181 REAL(wp) :: rho_s = 2165.0_wp !< density of NaCl (kg m-3) 182 REAL(wp) :: rm(3) = 1.0E-6_wp !< namelist parameter (see documentation) 183 REAL(wp) :: sgs_wf_part !< parameter for sgs 191 184 REAL(wp) :: time_prel = 0.0_wp !< time for particle release 192 185 REAL(wp) :: time_write_particle_data = 0.0_wp !< write particle data at current time on file … … 210 203 REAL(wp), DIMENSION(:), ALLOCATABLE :: log_z_z0 !< Precalculate LOG(z/z0) 211 204 212 205 213 206 TYPE particle_type 207 REAL(wp) :: aux1 !< auxiliary multi-purpose feature 208 REAL(wp) :: aux2 !< auxiliary multi-purpose feature 214 209 REAL(wp) :: radius !< radius of particle 215 210 REAL(wp) :: age !< age of particle 216 REAL(wp) :: age_m !< 211 REAL(wp) :: age_m !< 217 212 REAL(wp) :: dt_sum !< 218 REAL(wp) :: user !< varible for user 219 REAL(wp) :: e_m !< interpolated sgs tke 213 REAL(wp) :: e_m !< interpolated sgs tke 220 214 REAL(wp) :: origin_x !< origin x-position of particle (changed cyclic bc) 221 215 REAL(wp) :: origin_y !< origin y-position of particle (changed cyclic bc) 222 216 REAL(wp) :: origin_z !< origin z-position of particle (changed cyclic bc) 223 REAL(wp) :: rvar1 !< 217 REAL(wp) :: rvar1 !< 224 218 REAL(wp) :: rvar2 !< 225 REAL(wp) :: rvar3 !< 219 REAL(wp) :: rvar3 !< 226 220 REAL(wp) :: speed_x !< speed of particle in x 227 221 REAL(wp) :: speed_y !< speed of particle in y 228 222 REAL(wp) :: speed_z !< speed of particle in z 229 REAL(wp) :: weight_factor !< weighting factor 230 REAL(wp) :: x !< x-position 231 REAL(wp) :: y !< y-position 232 REAL(wp) :: z !< z-position 223 REAL(wp) :: weight_factor !< weighting factor 224 REAL(wp) :: x !< x-position 225 REAL(wp) :: y !< y-position 226 REAL(wp) :: z !< z-position 233 227 INTEGER(iwp) :: class !< radius class needed for collision 234 228 INTEGER(iwp) :: group !< number of particle group … … 274 268 275 269 END MODULE particle_attributes 276 -
palm/trunk/SOURCE/package_parin.f90
r2263 r2312 20 20 ! Current revisions: 21 21 ! ----------------- 22 ! 23 ! 22 ! 23 ! 24 24 ! Former revisions: 25 25 ! ----------------- 26 26 ! $Id$ 27 ! Aerosol initialization improved. 28 ! 29 ! 2263 2017-06-08 14:59:01Z schwenkel 27 30 ! Implemented splitting and merging algorithm 28 ! 31 ! 29 32 ! 2183 2017-03-17 14:29:15Z schwenkel 30 33 ! 31 34 ! 2182 2017-03-17 14:27:40Z schwenkel 32 35 ! Added parameters for simplified particle initialization. 33 ! 36 ! 34 37 ! 2000 2016-08-20 18:09:15Z knoop 35 38 ! Forced header and separation lines into 80 columns 36 ! 39 ! 37 40 ! 1936 2016-06-13 13:37:44Z suehring 38 41 ! +deallocate_memory, step_dealloc 39 ! 42 ! 40 43 ! 1871 2016-04-15 11:46:09Z hoffmann 41 44 ! Initialization of aerosols added. 42 ! 45 ! 43 46 ! 1833 2016-04-07 14:23:03Z raasch 44 47 ! reading of spectra_par moved to spectra_mod 45 ! 48 ! 46 49 ! 1831 2016-04-07 13:15:51Z hoffmann 47 50 ! curvature_solution_effects added … … 50 53 ! Reading of &radiation_par moved to radiation_model_mod. 51 54 ! Reading of &canopy_par moved to plant_canopy_model_mod. 52 ! 55 ! 53 56 ! 822 2016-04-07 07:49:42Z hoffmann 54 57 ! +collision_algorithm … … 57 60 ! 1817 2016-04-06 15:44:20Z maronga 58 61 ! Reading of &lsm_par moved to land_surface_model_mod. 59 ! 62 ! 60 63 ! 1788 2016-03-10 11:01:04Z maronga 61 64 ! Parameter dewfall removed. … … 66 69 ! 1757 2016-02-22 15:49:32Z maronga 67 70 ! Added parameter unscheduled_radiation_calls 68 ! 71 ! 69 72 ! 1691 2015-10-26 16:17:44Z maronga 70 73 ! Added skip_time_do_lsm, skip_time_do_radiation, and emissivity 71 ! 74 ! 72 75 ! 1682 2015-10-07 23:56:08Z knoop 73 ! Code annotations made doxygen readable 74 ! 76 ! Code annotations made doxygen readable 77 ! 75 78 ! 1585 2015-04-30 07:05:52Z maronga 76 79 ! Added several radiation_par parameters … … 81 84 ! 1553 2015-03-03 17:33:54Z maronga 82 85 ! Resorting of lsm_par 83 ! 86 ! 84 87 ! 1551 2015-03-03 14:18:16Z maronga 85 88 ! Several changes in the liste for land surface model and radiation model 86 ! 89 ! 87 90 ! 1496 2014-12-02 17:25:50Z maronga 88 91 ! Added support for the land surface model and radiation scheme 89 ! 92 ! 90 93 ! 1484 2014-10-21 10:53:05Z kanani 91 94 ! Changes due to new module structure of the plant canopy model: 92 95 ! module plant_canopy_model_mod added, 93 ! new package/namelist canopy_par added, i.e. the canopy model is no longer 96 ! new package/namelist canopy_par added, i.e. the canopy model is no longer 94 97 ! steered over the inipar-namelist, 95 98 ! drag_coefficient, leaf_surface_concentration and scalar_exchange_coefficient 96 99 ! renamed to canopy_drag_coeff, leaf_surface_conc and leaf_scalar_exch_coeff. 97 100 ! Changed statement tags in CONTINUE-statement 98 ! 101 ! 99 102 ! 1367 2014-04-23 15:18:30Z witha 100 103 ! Bugfix: module kinds must be used … … 103 106 ! +alloc_factor, + min_nr_particle 104 107 ! -dt_sort_particles, -maximum_number_of_particles 105 ! 108 ! 106 109 ! 1340 2014-03-25 19:45:13Z kanani 107 110 ! REAL constants defined as wp-kinds … … 138 141 !> software packages which are used optionally in the run. 139 142 !> 140 !> @todo Perform all actions in the respective submodules and remove 143 !> @todo Perform all actions in the respective submodules and remove 141 144 !> package_parin 142 145 !------------------------------------------------------------------------------! 143 146 SUBROUTINE package_parin 144 147 145 148 146 149 USE control_parameters, & … … 165 168 166 169 USE particle_attributes, & 167 ONLY: a lloc_factor, bc_par_b, bc_par_lr, bc_par_ns, bc_par_t,&168 collision_algorithm, collision_kernel, &170 ONLY: aero_type, aero_weight, alloc_factor, bc_par_b, bc_par_lr, & 171 bc_par_ns, bc_par_t, collision_kernel, & 169 172 curvature_solution_effects, deallocate_memory, density_ratio, & 170 173 dissipation_classes, dt_min_part, dt_prel, & 171 174 dt_write_particle_data, end_time_prel, initial_weighting_factor,& 172 init_aerosol_probabilistic, max_number_particles_per_gridbox, &173 merging, min_nr_particle, monodisperse_aerosols, n1, n2, n3,&175 log_sigma, max_number_particles_per_gridbox, & 176 merging, min_nr_particle, na, & 174 177 number_concentration, number_of_particle_groups, & 175 178 number_particles_per_gridbox, particles_per_point, & … … 177 180 psb, psl, psn, psr, pss, pst, radius, radius_classes, & 178 181 radius_merge, radius_split, random_start_position, & 179 read_particles_from_restartfile, rm 1, rm2, rm3,&180 seed_follows_topography, splitting, splitting_factor, & 182 read_particles_from_restartfile, rm, & 183 seed_follows_topography, splitting, splitting_factor, & 181 184 splitting_factor_max, splitting_function, splitting_mode, & 182 step_dealloc, s1, s2, s3, use_sgs_for_particles,&185 step_dealloc, use_sgs_for_particles, & 183 186 vertical_particle_advection, weight_factor_merge, & 184 weight_factor_split, write_particle_statistics 187 weight_factor_split, write_particle_statistics 185 188 186 189 IMPLICIT NONE … … 206 209 vc_size_y, vc_size_z 207 210 208 NAMELIST /particles_par/ alloc_factor, bc_par_b, bc_par_lr, & 209 bc_par_ns, bc_par_t, collision_algorithm, & 211 NAMELIST /particles_par/ aero_type, aero_weight, alloc_factor, & 212 bc_par_b, bc_par_lr, & 213 bc_par_ns, bc_par_t, & 210 214 collision_kernel, curvature_solution_effects,& 211 215 deallocate_memory, density_ratio, & … … 214 218 dt_write_particle_data, & 215 219 end_time_prel, initial_weighting_factor, & 216 init_aerosol_probabilistic,&220 log_sigma, & 217 221 max_number_particles_per_gridbox, merging, & 218 min_nr_particle, monodisperse_aerosols,&219 n 1, n2, n3, number_concentration,&222 min_nr_particle, & 223 na, number_concentration, & 220 224 number_of_particle_groups, & 221 225 number_particles_per_gridbox, & … … 224 228 particle_maximum_age, pdx, pdy, pdz, psb, & 225 229 psl, psn, psr, pss, pst, radius, & 226 radius_classes, radius_merge, radius_split, & 230 radius_classes, radius_merge, radius_split, & 227 231 random_start_position, & 228 read_particles_from_restartfile, & 229 rm1, rm2, rm3, & 232 read_particles_from_restartfile, rm, & 230 233 seed_follows_topography, & 231 234 splitting, splitting_factor, & 232 235 splitting_factor_max, splitting_function, & 233 splitting_mode, step_dealloc, s1, s2, s3,&236 splitting_mode, step_dealloc, & 234 237 use_sgs_for_particles, & 235 238 vertical_particle_advection, &
Note: See TracChangeset
for help on using the changeset viewer.