Changeset 4842 for palm/trunk/SOURCE/salsa_mod.f90
- Timestamp:
- Jan 14, 2021 10:42:28 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/salsa_mod.f90
r4828 r4842 3 3 ! This file is part of PALM-4U. 4 4 ! 5 ! PALM-4U is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 5 ! PALM-4U is free software: you can redistribute it and/or modify it under the 6 ! terms of the GNU General Public License as published by the Free Software 7 ! Foundation, either version 3 of the License, or (at your option) any later 8 8 ! version. 9 9 ! … … 26 26 ! ----------------- 27 27 ! $Id$ 28 ! reading of namelist file and actions in case of namelist errors revised so that statement labels 29 ! and goto statements are not required any more 30 ! 31 ! 4828 2021-01-05 11:21:41Z Giersch 28 32 ! Bugfix in obtaining the correct timestamp in case of restart runs 29 33 ! … … 39 43 ! 4671 2020-09-09 20:27:58Z pavelkrc 40 44 ! Implementation of downward facing USM and LSM surfaces 41 ! 45 ! 42 46 ! 4535 2020-05-15 12:07:23Z raasch 43 47 ! bugfix for restart data format query 44 ! 48 ! 45 49 ! 4527 2020-05-11 09:39:55Z monakurppa 46 50 ! Correct a bug in salsa_wrd_global and salsa_check_data_output, 47 51 ! and add reglim to be read/written in the restart data 48 ! 52 ! 49 53 ! 4525 2020-05-10 17:05:07Z raasch 50 54 ! added reading/writing of global restart data, 51 55 ! added reading/writing restart data with MPI-IO, 52 56 ! variable write_binary_salsa removed 53 ! 57 ! 54 58 ! 4512 2020-04-30 12:55:34Z monakurppa 55 59 ! Fixed a bug in component_index_constructor: index out of bounds if all chemical 56 60 ! components are used 57 ! 61 ! 58 62 ! 4508 2020-04-24 13:32:20Z raasch 59 63 ! decycling replaced by explicit setting of lateral boundary conditions (Siggi) 60 ! 64 ! 61 65 ! 4487 2020-04-03 09:38:20Z raasch 62 66 ! bugfix for subroutine calls that contain the decycle_salsa switches as arguments 63 ! 67 ! 64 68 ! 4481 2020-03-31 18:55:54Z maronga 65 69 ! Bug fix to the previous commit: the logical switch monotonic_limiter_z missing 66 70 ! from advec_s_ws in salsa_tendency_ij 67 ! 71 ! 68 72 ! 4478 2020-03-27 14:06:23Z monakurppa 69 73 ! Bug fixes: 70 74 ! - call salsa_driver in salsa_init also for the ghost points 71 75 ! - decycle flags missing from advec_s_ws call in salsa_tendency 72 ! 76 ! 73 77 ! 4457 2020-03-11 14:20:43Z raasch 74 78 ! use statement for exchange horiz added 75 ! 79 ! 76 80 ! 4442 2020-03-04 19:21:13Z suehring 77 ! Change order of dimension in surface array %frac to allow for better 81 ! Change order of dimension in surface array %frac to allow for better 78 82 ! vectorization. 79 ! 83 ! 80 84 ! 4441 2020-03-04 19:20:35Z suehring 81 85 ! Bug fixes and reformatting for the restart data and averaged data output … … 86 90 ! chemical components: set to 4d arrays instead of separate arrays 87 91 ! - add allocation checks for averaged data output arrays 88 ! 92 ! 89 93 ! 4416 2020-02-20 17:53:57Z monakurppa 90 94 ! Time index error in salsa_emission_setup 91 ! 95 ! 92 96 ! 4380 2020-01-17 23:39:51Z monakurppa 93 97 ! - Error in saving the surface fluxes in an array that is applied in the … … 95 99 ! - Corrections in the header: aerosol bin diameters and lower bin limits not 96 100 ! printed correctly 97 ! 101 ! 98 102 ! 4364 2020-01-08 02:12:31Z monakurppa 99 103 ! Set time coordinate in the input data relative to origin_time rather than to 100 104 ! 00:00:00 UTC 101 ! 105 ! 102 106 ! 4360 2020-01-07 11:25:50Z suehring 103 107 ! Introduction of wall_flags_total_0, which currently sets bits based on static 104 108 ! topography information used in wall_flags_static_0 105 ! 109 ! 106 110 ! 4342 2019-12-16 13:49:14Z Giersch 107 111 ! cdc replaced by canopy_drag_coeff 108 ! 112 ! 109 113 ! 4329 2019-12-10 15:46:36Z motisi 110 114 ! Renamed wall_flags_0 to wall_flags_static_0 111 ! 115 ! 112 116 ! 4315 2019-12-02 09:20:07Z monakurppa 113 117 ! Add an additional check for the time dimension PIDS_SALSA in 114 118 ! salsa_emission_setup and correct some error message identifiers. 115 ! 119 ! 116 120 ! 4298 2019-11-21 15:59:16Z suehring 117 121 ! Bugfix, close netcdf input files after reading 118 ! 122 ! 119 123 ! 4295 2019-11-14 06:15:31Z monakurppa 120 ! 121 ! 124 ! 125 ! 122 126 ! 4280 2019-10-29 14:34:15Z monakurppa 123 127 ! Corrected a bug in boundary conditions and fac_dt in offline nesting 124 ! 128 ! 125 129 ! 4273 2019-10-24 13:40:54Z monakurppa 126 130 ! - Rename nest_salsa to nesting_salsa … … 129 133 ! chemistry module is applied 130 134 ! - Set the default value of nesting_salsa and nesting_offline_salsa to .TRUE. 131 ! 135 ! 132 136 ! 4272 2019-10-23 15:18:57Z schwenkel 133 137 ! Further modularization of boundary conditions: moved boundary conditions to … … 144 148 ! - Reformat salsa emission data with LOD=2: size distribution given for each 145 149 ! emission category 146 ! 150 ! 147 151 ! 4268 2019-10-17 11:29:38Z schwenkel 148 152 ! Moving module specific boundary conditions from time_integration to module 149 ! 153 ! 150 154 ! 4256 2019-10-07 10:08:52Z monakurppa 151 155 ! Document previous changes: use global variables nx, ny and nz in salsa_header 152 ! 156 ! 153 157 ! 4227 2019-09-10 18:04:34Z gronemeier 154 158 ! implement new palm_date_time_mod 155 ! 159 ! 156 160 ! 4226 2019-09-10 17:03:24Z suehring 157 161 ! Netcdf input routine for dimension length renamed 158 ! 162 ! 159 163 ! 4182 2019-08-22 15:20:23Z scharf 160 164 ! Corrected "Former revisions" section 161 ! 165 ! 162 166 ! 4167 2019-08-16 11:01:48Z suehring 163 ! Changed behaviour of masked output over surface to follow terrain and ignore 167 ! Changed behaviour of masked output over surface to follow terrain and ignore 164 168 ! buildings (J.Resler, T.Gronemeier) 165 ! 169 ! 166 170 ! 4131 2019-08-02 11:06:18Z monakurppa 167 171 ! - Add "salsa_" before each salsa output variable … … 174 178 ! - Add the z-dimension for gaseous emissions to correspond the implementation 175 179 ! in the chemistry module 176 ! 180 ! 177 181 ! 4118 2019-07-25 16:11:45Z suehring 178 182 ! - When Dirichlet condition is applied in decycling, the boundary conditions are … … 189 193 ! This is done to overcome high concentration peaks due to stationary numerical 190 194 ! oscillations caused by horizontal advection discretization. 191 ! 195 ! 192 196 ! 4117 2019-07-25 08:54:02Z monakurppa 193 ! Pass integer flag array as well as boundary flags to WS scalar advection 197 ! Pass integer flag array as well as boundary flags to WS scalar advection 194 198 ! routine 195 ! 199 ! 196 200 ! 4109 2019-07-22 17:00:34Z suehring 197 ! Slightly revise setting of boundary conditions at horizontal walls, use 201 ! Slightly revise setting of boundary conditions at horizontal walls, use 198 202 ! data-structure offset index instead of pre-calculate it for each facing 199 ! 203 ! 200 204 ! 4079 2019-07-09 18:04:41Z suehring 201 ! Application of monotonic flux limiter for the vertical scalar advection 202 ! up to the topography top (only for the cache-optimized version at the 205 ! Application of monotonic flux limiter for the vertical scalar advection 206 ! up to the topography top (only for the cache-optimized version at the 203 207 ! moment). 204 ! 208 ! 205 209 ! 4069 2019-07-01 14:05:51Z Giersch 206 ! Masked output running index mid has been introduced as a local variable to 210 ! Masked output running index mid has been introduced as a local variable to 207 211 ! avoid runtime error (Loop variable has been modified) in time_integration 208 ! 212 ! 209 213 ! 4058 2019-06-27 15:25:42Z knoop 210 214 ! Bugfix: to_be_resorted was uninitialized in case of s_H2O in 3d_data_averaging 211 ! 215 ! 212 216 ! 4012 2019-05-31 15:19:05Z monakurppa 213 217 ! Merge salsa branch to trunk. List of changes: … … 221 225 ! - stuff from salsa_util_mod.f90 moved into salsa_mod.f90 222 226 ! - calls for closing the netcdf input files added 223 ! 227 ! 224 228 ! 3956 2019-05-07 12:32:52Z monakurppa 225 229 ! - Conceptual bug in depo_surf correct for urban and land surface model … … 229 233 ! salsa_exchange_horiz_bounds after calling salsa_driver only when needed 230 234 ! (i.e. every dt_salsa). 231 ! 235 ! 232 236 ! 3924 2019-04-23 09:33:06Z monakurppa 233 237 ! Correct a bug introduced by the previous update. 234 ! 238 ! 235 239 ! 3899 2019-04-16 14:05:27Z monakurppa 236 240 ! - remove unnecessary error / location messages … … 239 243 ! 240 244 ! 3885 2019-04-11 11:29:34Z kanani 241 ! Changes related to global restructuring of location messages and introduction 245 ! Changes related to global restructuring of location messages and introduction 242 246 ! of additional debug messages 243 ! 247 ! 244 248 ! 3876 2019-04-08 18:41:49Z knoop 245 249 ! Introduced salsa_actions module interface 246 ! 250 ! 247 251 ! 3871 2019-04-08 14:38:39Z knoop 248 252 ! Major changes in formatting, performance and data input structure (see branch … … 255 259 ! surface_aerosol_flux, aerosol_flux_dpg/sigmag/mass_fracs_a/mass_fracs_b. 256 260 ! - All emissions are now implemented as surface fluxes! No 3D sources anymore. 257 ! - Update the emission information by calling salsa_emission_update if 261 ! - Update the emission information by calling salsa_emission_update if 258 262 ! skip_time_do_salsa >= time_since_reference_point and 259 263 ! next_aero_emission_update <= time_since_reference_point … … 280 284 ! - Removed tailing white spaces and unused variables 281 285 ! - Change error message to start by PA instead of SA 282 ! 286 ! 283 287 ! 3833 2019-03-28 15:04:04Z forkel 284 ! added USE chem_gasphase_mod for nvar, nspec and spc_names 285 ! 288 ! added USE chem_gasphase_mod for nvar, nspec and spc_names 289 ! 286 290 ! 3787 2019-03-07 08:43:54Z raasch 287 291 ! unused variables removed 288 ! 292 ! 289 293 ! 3780 2019-03-05 11:19:45Z forkel 290 294 ! unused variable for file index removed from rrd-subroutines parameter list 291 ! 295 ! 292 296 ! 3685 2019-01-21 01:02:11Z knoop 293 297 ! Some interface calls moved to module_interface + cleanup 294 ! 298 ! 295 299 ! 3655 2019-01-07 16:51:22Z knoop 296 300 ! Implementation of the PALM module interface … … 438 442 (/0.0, 0.056, 0.0, 0.056, 0.056, 0.042, 0.056, -99., 0.042,0.014,0.056, -99., -99., -99., 0.056/) 439 443 ! 440 !-- Constants for the dry deposition model by Zhang et al. (2001): 441 !-- empirical constants "alpha" and "gamma" and characteristic radius "A" for 444 !-- Constants for the dry deposition model by Zhang et al. (2001): 445 !-- empirical constants "alpha" and "gamma" and characteristic radius "A" for 442 446 !-- each land use category (15) and season (5) 443 447 REAL(wp), DIMENSION(1:15), PARAMETER :: alpha_z01 = & … … 445 449 REAL(wp), DIMENSION(1:15), PARAMETER :: gamma_z01 = & 446 450 (/0.56, 0.58, 0.56, 0.56, 0.56, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.54, 0.50, 0.50, 0.56/) 447 REAL(wp), DIMENSION(1:15,1:5), PARAMETER :: A_z01 = RESHAPE( (/& 451 REAL(wp), DIMENSION(1:15,1:5), PARAMETER :: A_z01 = RESHAPE( (/& 448 452 2.0, 5.0, 2.0, 5.0, 5.0, 2.0, 2.0, -99., -99., 10.0, 10.0, -99., -99., -99., 10.0,& ! SC1 449 453 2.0, 5.0, 2.0, 5.0, 5.0, 2.0, 2.0, -99., -99., 10.0, 10.0, -99., -99., -99., 10.0,& ! SC2 … … 1113 1117 CONTAINS 1114 1118 1115 !------------------- -----------------------------------------------------------!1119 !------------------- -----------------------------------------------------------------------------! 1116 1120 ! Description: 1117 1121 ! ------------ 1118 1122 !> Parin for &salsa_par for new modules 1119 !--------------------- ---------------------------------------------------------!1123 !--------------------- ---------------------------------------------------------! 1120 1124 SUBROUTINE salsa_parin 1121 1125 … … 1125 1129 IMPLICIT NONE 1126 1130 1127 CHARACTER(LEN= 80) :: line !< dummy string that contains the current line of parameter file1131 CHARACTER(LEN=100) :: line !< dummy string that contains the current line of parameter file 1128 1132 1129 1133 INTEGER(iwp) :: i !< loop index 1134 INTEGER(iwp) :: io_status !< status after reading the namelist file 1130 1135 INTEGER(iwp) :: max_pr_salsa_tmp !< dummy variable 1131 1136 1132 NAMELIST /salsa_parameters/ aerosol_flux_dpg, &1133 aerosol_flux_mass_fracs_a, &1134 aerosol_flux_mass_fracs_b, &1135 aerosol_flux_sigmag, &1136 advect_particle_water, &1137 bc_aer_b, &1138 bc_aer_l, &1139 bc_aer_n, &1140 bc_aer_r, &1141 bc_aer_s, &1142 bc_aer_t, &1143 depo_pcm_par, &1144 depo_pcm_type, &1145 depo_surf_par, &1146 dpg, &1147 dt_salsa, &1148 emiss_factor_main, &1149 emiss_factor_side, &1150 feedback_to_palm, &1151 h2so4_init, &1152 hno3_init, &1153 listspec, &1154 main_street_id, &1155 mass_fracs_a, &1156 mass_fracs_b, &1157 max_street_id, &1158 n_lognorm, &1159 nbin, &1160 nesting_salsa, &1161 nesting_offline_salsa, &1162 nf2a, &1163 nh3_init, &1164 nj3, &1165 nlcnd, &1166 nlcndgas, &1167 nlcndh2oae, &1168 nlcoag, &1169 nldepo, &1170 nldepo_pcm, &1171 nldepo_surf, &1172 nldistupdate, &1173 nsnucl, &1174 ocnv_init, &1175 ocsv_init, &1176 reglim, &1177 salsa, &1178 salsa_emission_mode, &1179 season_z01, &1180 sigmag, &1181 side_street_id, &1182 skip_time_do_salsa, &1183 surface_aerosol_flux, &1137 NAMELIST /salsa_parameters/ aerosol_flux_dpg, & 1138 aerosol_flux_mass_fracs_a, & 1139 aerosol_flux_mass_fracs_b, & 1140 aerosol_flux_sigmag, & 1141 advect_particle_water, & 1142 bc_aer_b, & 1143 bc_aer_l, & 1144 bc_aer_n, & 1145 bc_aer_r, & 1146 bc_aer_s, & 1147 bc_aer_t, & 1148 depo_pcm_par, & 1149 depo_pcm_type, & 1150 depo_surf_par, & 1151 dpg, & 1152 dt_salsa, & 1153 emiss_factor_main, & 1154 emiss_factor_side, & 1155 feedback_to_palm, & 1156 h2so4_init, & 1157 hno3_init, & 1158 listspec, & 1159 main_street_id, & 1160 mass_fracs_a, & 1161 mass_fracs_b, & 1162 max_street_id, & 1163 n_lognorm, & 1164 nbin, & 1165 nesting_salsa, & 1166 nesting_offline_salsa, & 1167 nf2a, & 1168 nh3_init, & 1169 nj3, & 1170 nlcnd, & 1171 nlcndgas, & 1172 nlcndh2oae, & 1173 nlcoag, & 1174 nldepo, & 1175 nldepo_pcm, & 1176 nldepo_surf, & 1177 nldistupdate, & 1178 nsnucl, & 1179 ocnv_init, & 1180 ocsv_init, & 1181 reglim, & 1182 salsa, & 1183 salsa_emission_mode, & 1184 season_z01, & 1185 sigmag, & 1186 side_street_id, & 1187 skip_time_do_salsa, & 1188 surface_aerosol_flux, & 1184 1189 van_der_waals_coagc 1185 1190 1186 line = ' ' 1187 ! 1188 !-- Try to find salsa package 1189 REWIND ( 11 ) 1190 line = ' ' 1191 DO WHILE ( INDEX( line, '&salsa_parameters' ) == 0 ) 1192 READ ( 11, '(A)', END=10 ) line 1193 ENDDO 1194 BACKSPACE ( 11 ) 1195 ! 1196 !-- Read user-defined namelist 1197 READ ( 11, salsa_parameters ) 1198 ! 1199 !-- Enable salsa (salsa switch in modules.f90) 1200 salsa = .TRUE. 1201 1202 10 CONTINUE 1191 1192 ! 1193 !-- Move to the beginning of the namelist file and try to find and read the namelist. 1194 REWIND( 11 ) 1195 READ( 11, salsa_parameters, IOSTAT=io_status ) 1196 1197 ! 1198 !-- Action depending on the READ status 1199 IF ( io_status == 0 ) THEN 1200 ! 1201 !-- salsa_parameters namelist was found and read correctly. Enable salsa (salsa switch in 1202 !-- modules.f90) 1203 salsa = .TRUE. 1204 1205 ELSEIF ( io_status > 0 ) THEN 1206 ! 1207 !-- salsa_parameters namelist was found but contained errors. Print an error message including 1208 !-- the line that caused the problem. 1209 BACKSPACE( 11 ) 1210 READ( 11 , '(A)' ) line 1211 CALL parin_fail_message( 'salsa_parameters', line ) 1212 1213 ENDIF 1214 1203 1215 ! 1204 1216 !-- Update the number of output profiles … … 1212 1224 1213 1225 END SUBROUTINE salsa_parin 1226 1214 1227 1215 1228 !------------------------------------------------------------------------------! … … 1445 1458 1446 1459 IMPLICIT NONE 1447 1460 1448 1461 INTEGER(iwp), INTENT(IN) :: io !< Unit of the output file 1449 1462 ! … … 1748 1761 !-- (number concentration (#/m3) ) 1749 1762 ! 1750 !-- If chemistry is on, read gas phase concentrations from there. Otherwise, 1763 !-- If chemistry is on, read gas phase concentrations from there. Otherwise, 1751 1764 !-- allocate salsa_gas array. 1752 1765 … … 1822 1835 ENDDO 1823 1836 ! 1824 !-- Vertical surfaces: northward (l=0), southward (l=1), eastward (l=2) and 1837 !-- Vertical surfaces: northward (l=0), southward (l=1), eastward (l=2) and 1825 1838 !-- westward (l=3) facing 1826 1839 DO l = 0, 3 … … 1999 2012 ! Description: 2000 2013 ! ------------ 2001 !> Initializes particle size distribution grid by calculating size bin limits 2002 !> and mid-size for *dry* particles in each bin. Called from salsa_initialize 2014 !> Initializes particle size distribution grid by calculating size bin limits 2015 !> and mid-size for *dry* particles in each bin. Called from salsa_initialize 2003 2016 !> (only at the beginning of simulation). 2004 2017 !> Size distribution described using: … … 2009 2022 !> based on given subrange size limits and bin number. 2010 2023 ! 2011 !> Mona changed 06/2017: Use geometric mean diameter to describe the mean 2024 !> Mona changed 06/2017: Use geometric mean diameter to describe the mean 2012 2025 !> particle diameter in a size bin, not the arithmeric mean which clearly 2013 !> overestimates the total particle volume concentration. 2026 !> overestimates the total particle volume concentration. 2014 2027 ! 2015 2028 !> Coded by: … … 2089 2102 !> Initilize altitude-dependent aerosol size distributions and compositions. 2090 2103 !> 2091 !> Mona added 06/2017: Correct the number and mass concentrations by normalizing 2104 !> Mona added 06/2017: Correct the number and mass concentrations by normalizing 2092 2105 !< by the given total number and mass concentration. 2093 2106 !> … … 2268 2281 CALL get_variable( id_dyn, 'Dmid', pr_dmid ) 2269 2282 ! 2270 !-- Check whether the sectional representation conform to the one 2283 !-- Check whether the sectional representation conform to the one 2271 2284 !-- applied in the model 2272 2285 IF ( ANY( ABS( ( aero(1:nbins_aerosol)%dmid - pr_dmid ) / & … … 2323 2336 message_string = 'Error in initialising mass fractions of chemical components. ' // & 2324 2337 'Check that all chemical components are included in parameter file!' 2325 CALL message( 'salsa_mod: aerosol_init', 'PA0606', 2, 2, 0, 6, 0 ) 2338 CALL message( 'salsa_mod: aerosol_init', 'PA0606', 2, 2, 0, 6, 0 ) 2326 2339 ENDIF 2327 2340 ! … … 2550 2563 ENDIF 2551 2564 ib = ib+1 2552 ENDDO 2565 ENDDO 2553 2566 ENDIF 2554 2567 ENDDO !< k … … 2593 2606 ! Description: 2594 2607 ! ------------ 2595 !> Create a lognormal size distribution and discretise to a sectional 2608 !> Create a lognormal size distribution and discretise to a sectional 2596 2609 !> representation. 2597 2610 !------------------------------------------------------------------------------! … … 2687 2700 ! 2688 2701 !-- Predetermine flag to mask topography 2689 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 0 ) ) 2702 flag = MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 0 ) ) 2690 2703 ! 2691 2704 !-- Regime 2a: … … 2717 2730 IF ( prunmode == 1 ) THEN 2718 2731 aerosol_mass(ic)%init(k) = MAX( 0.0_wp, pmf2b(k) ) * ( 1.0_wp - pnf2a(k) ) * & 2719 pndist(k,ib) * pcore(ib) * prho 2732 pndist(k,ib) * pcore(ib) * prho 2720 2733 ENDIF 2721 2734 ib = ib + 1 … … 3630 3643 ! Description: 3631 3644 ! ------------ 3632 !> Performs necessary unit and dimension conversion between the host model and 3645 !> Performs necessary unit and dimension conversion between the host model and 3633 3646 !> SALSA module, and calls the main SALSA routine. 3634 3647 !> Partially adobted form the original SALSA boxmodel version. 3635 3648 !> Now takes masses in as kg/kg from LES!! Converted to m3/m3 for SALSA 3636 !> 05/2016 Juha: This routine is still pretty much in its original shape. 3649 !> 05/2016 Juha: This routine is still pretty much in its original shape. 3637 3650 !> It's dumb as a mule and twice as ugly, so implementation of 3638 3651 !> an improved solution is necessary sooner or later. … … 3752 3765 ! 3753 3766 !-- Set volume concentrations: 3754 !-- Sulphate (SO4) or sulphuric acid H2SO4 3767 !-- Sulphate (SO4) or sulphuric acid H2SO4 3755 3768 IF ( index_so4 > 0 ) THEN 3756 3769 vc = 1 … … 3820 3833 IF ( index_no > 0 ) THEN 3821 3834 vc = 6 3822 str = ( index_no-1 ) * nbins_aerosol + 1 3835 str = ( index_no-1 ) * nbins_aerosol + 1 3823 3836 endi = index_no * nbins_aerosol 3824 3837 ic = 1 … … 3859 3872 aero_old(1:nbins_aerosol)%volc(vc) = lo_aero(1:nbins_aerosol)%volc(vc) 3860 3873 ! 3861 !-- Number concentrations (numc) and particle sizes 3874 !-- Number concentrations (numc) and particle sizes 3862 3875 !-- (dwet = wet diameter, core = dry volume) 3863 3876 DO ib = 1, nbins_aerosol … … 4114 4127 ! 4115 4128 !-- Set surfaces and wall fluxes due to deposition 4116 IF ( lsdepo .AND. lsdepo_surf .AND. prunmode == 3 ) THEN 4129 IF ( lsdepo .AND. lsdepo_surf .AND. prunmode == 3 ) THEN 4117 4130 IF ( .NOT. land_surface .AND. .NOT. urban_surface ) THEN 4118 4131 CALL depo_surf( i, j, surf_def_h(0), vd, schmidt_num, kvis, in_u, .TRUE. ) … … 4189 4202 4190 4203 END SUBROUTINE set_salsa_runtime 4191 4204 4192 4205 !------------------------------------------------------------------------------! 4193 4206 ! Description: 4194 4207 ! ------------ 4195 !> Calculates the absolute temperature (using hydrostatic pressure), saturation 4196 !> vapour pressure and mixing ratio over water, relative humidity and air 4208 !> Calculates the absolute temperature (using hydrostatic pressure), saturation 4209 !> vapour pressure and mixing ratio over water, relative humidity and air 4197 4210 !> density needed in the SALSA model. 4198 !> NOTE, no saturation adjustment takes place -> the resulting water vapour 4211 !> NOTE, no saturation adjustment takes place -> the resulting water vapour 4199 4212 !> mixing ratio can be supersaturated, allowing the microphysical calculations 4200 4213 !> in SALSA. … … 4254 4267 ! Description: 4255 4268 ! ------------ 4256 !> Calculates ambient sizes of particles by equilibrating soluble fraction of 4269 !> Calculates ambient sizes of particles by equilibrating soluble fraction of 4257 4270 !> particles with water using the ZSR method (Stokes and Robinson, 1966). 4258 4271 !> Method: … … 4260 4273 !> - (ammonium) sulphate (100%) 4261 4274 !> - sea salt (100 %) 4262 !> - organic carbon (epsoc * 100%) 4275 !> - organic carbon (epsoc * 100%) 4263 4276 !> Exact thermodynamic considerations neglected. 4264 !> - If particles contain no sea salt, calculation according to sulphate 4277 !> - If particles contain no sea salt, calculation according to sulphate 4265 4278 !> properties 4266 !> - If contain sea salt but no sulphate, calculation according to sea salt 4279 !> - If contain sea salt but no sulphate, calculation according to sea salt 4267 4280 !> properties 4268 !> - If contain both sulphate and sea salt -> the molar fraction of these 4281 !> - If contain both sulphate and sea salt -> the molar fraction of these 4269 4282 !> compounds determines which one of them is used as the basis of calculation. 4270 !> If sulphate and sea salt coexist in a particle, it is assumed that the Cl is 4271 !> replaced by sulphate; thus only either sulphate + organics or sea salt + 4283 !> If sulphate and sea salt coexist in a particle, it is assumed that the Cl is 4284 !> replaced by sulphate; thus only either sulphate + organics or sea salt + 4272 4285 !> organics is included in the calculation of soluble fraction. 4273 !> Molality parameterizations taken from Table 1 of Tang: Thermodynamic and 4274 !> optical properties of mixed-salt aerosols of atmospheric importance, 4286 !> Molality parameterizations taken from Table 1 of Tang: Thermodynamic and 4287 !> optical properties of mixed-salt aerosols of atmospheric importance, 4275 4288 !> J. Geophys. Res., 102 (D2), 1883-1893 (1997) 4276 4289 ! 4277 4290 !> Coded by: 4278 !> Hannele Korhonen (FMI) 2005 4291 !> Hannele Korhonen (FMI) 2005 4279 4292 !> Harri Kokkola (FMI) 2006 4280 4293 !> Matti Niskanen(FMI) 2012 … … 4282 4295 !> Modified for the new aerosol datatype, Juha Tonttila (FMI) 2014 4283 4296 ! 4284 !> fxm: should sea salt form a solid particle when prh is very low (even though 4297 !> fxm: should sea salt form a solid particle when prh is very low (even though 4285 4298 !> it could be mixed with e.g. sulphate)? 4286 4299 !> fxm: crashes if no sulphate or sea salt … … 4335 4348 zvpart(6:7) = paero(ib)%volc(6:7) / paero(ib)%numc 4336 4349 ! 4337 !-- Total volume and wet diameter of one dry particle 4350 !-- Total volume and wet diameter of one dry particle 4338 4351 zcore = SUM( zvpart(1:2) ) 4339 4352 zdwet = paero(ib)%dwet … … 4345 4358 zaw = MAX( 1.0E-3_wp, zrh / zke ) ! To avoid underflow 4346 4359 ! 4347 !-- Binary molalities (mol/kg): 4360 !-- Binary molalities (mol/kg): 4348 4361 !-- Sulphate 4349 4362 zbinmol(1) = 1.1065495E+2_wp - 3.6759197E+2_wp * zaw + 5.0462934E+2_wp * zaw**2 - & … … 4367 4380 zcore / api6 )**0.33333333_wp 4368 4381 ! 4369 !-- Kelvin effect (Eq. 10.85 in in Seinfeld and Pandis (2006)). Avoid 4382 !-- Kelvin effect (Eq. 10.85 in in Seinfeld and Pandis (2006)). Avoid 4370 4383 !-- overflow. 4371 4384 zke = EXP( MIN( 50.0_wp, 4.0_wp * surfw0 * amvh2so4 / ( abo * ptemp * zdwet ) ) ) 4372 4385 4373 4386 counti = counti + 1 4374 IF ( counti > 1000 ) THEN 4387 IF ( counti > 1000 ) THEN 4375 4388 message_string = 'Subrange 1: no convergence!' 4376 4389 CALL message( 'salsa_mod: equilibration', 'PA0617', 1, 2, 0, 6, 0 ) … … 4378 4391 ENDDO 4379 4392 ! 4380 !-- Instead of lwc, use the volume concentration of water from now on 4393 !-- Instead of lwc, use the volume concentration of water from now on 4381 4394 !-- (easy to convert...) 4382 4395 paero(ib)%volc(8) = zlwc / arhoh2o … … 4438 4451 6.210577919E+1_wp * zaw**2 + 5.510176187E+2_wp * zaw**3 - & 4439 4452 1.460055286E+3_wp * zaw**4 + 1.894467542E+3_wp * zaw**5 - & 4440 1.220611402E+3_wp * zaw**6 + 3.098597737E+2_wp * zaw**7 4453 1.220611402E+3_wp * zaw**6 + 3.098597737E+2_wp * zaw**7 4441 4454 !-- Sea salt (natrium chloride) 4442 4455 zbinmol(5) = 5.875248E+1_wp - 1.8781997E+2_wp * zaw + 2.7211377E+2_wp * zaw**2 - & … … 4457 4470 4458 4471 counti = counti + 1 4459 IF ( counti > 1000 ) THEN 4472 IF ( counti > 1000 ) THEN 4460 4473 message_string = 'Subrange 2: no convergence!' 4461 4474 CALL message( 'salsa_mod: equilibration', 'PA0618', 1, 2, 0, 6, 0 ) … … 4482 4495 !> Description: 4483 4496 !> ------------ 4484 !> Calculation of the settling velocity vc (m/s) per aerosol size bin and 4497 !> Calculation of the settling velocity vc (m/s) per aerosol size bin and 4485 4498 !> deposition on plant canopy (lsdepo_pcm). 4486 4499 ! … … 4750 4763 !> Calculate the dry deposition on horizontal and vertical surfaces. Implement 4751 4764 !> as a surface flux. 4752 !> @todo aerodynamic resistance ignored for now (not important for 4765 !> @todo aerodynamic resistance ignored for now (not important for 4753 4766 ! high-resolution simulations) 4754 4767 !------------------------------------------------------------------------------! … … 5010 5023 ! ------------ 5011 5024 !> Calculates particle loss and change in size distribution due to (Brownian) 5012 !> coagulation. Only for particles with dwet < 30 micrometres. 5025 !> coagulation. Only for particles with dwet < 30 micrometres. 5013 5026 ! 5014 5027 !> Method: 5015 5028 !> Semi-implicit, non-iterative method: (Jacobson, 1994) 5016 5029 !> Volume concentrations of the smaller colliding particles added to the bin of 5017 !> the larger colliding particles. Start from first bin and use the updated 5030 !> the larger colliding particles. Start from first bin and use the updated 5018 5031 !> number and volume for calculation of following bins. NB! Our bin numbering 5019 5032 !> does not follow particle size in subrange 2. … … 5028 5041 !> Exact coagulation coefficients for each pressure level are scaled according 5029 5042 !> to current particle wet size (linear scaling). 5030 !> Bins are organized in terms of the dry size of the condensation nucleus, 5043 !> Bins are organized in terms of the dry size of the condensation nucleus, 5031 5044 !> while coagulation kernell is calculated with the actual hydrometeor 5032 5045 !> size. … … 5078 5091 !-- CoagSink ~ Dp in continuum subrange --> 'effective' number conc. of coarse particles 5079 5092 5080 !-- 2) Updating coagulation coefficients 5093 !-- 2) Updating coagulation coefficients 5081 5094 ! 5082 5095 !-- Aerosol mass (kg). Density of 1500 kg/m3 assumed … … 5268 5281 mfp = ( 1.656E-10_wp * temp + 1.828E-8_wp ) * ( p_0 + 1325.0_wp ) / pres 5269 5282 ! 5270 !-- 2) Slip correction factor for small particles 5283 !-- 2) Slip correction factor for small particles 5271 5284 knud = 2.0_wp * EXP( LOG(mfp) - LOG(diam) )! Knudsen number for air (15.23) 5272 5285 ! … … 5325 5338 ! Description: 5326 5339 ! ------------ 5327 !> Calculates the change in particle volume and gas phase 5340 !> Calculates the change in particle volume and gas phase 5328 5341 !> concentrations due to nucleation, condensation and dissolutional growth. 5329 5342 ! 5330 5343 !> Sulphuric acid and organic vapour: only condensation and no evaporation. 5331 5344 ! 5332 !> New gas and aerosol phase concentrations calculated according to Jacobson 5345 !> New gas and aerosol phase concentrations calculated according to Jacobson 5333 5346 !> (1997): Numerical techniques to solve condensational and dissolutional growth 5334 5347 !> equations when growth is coupled to reversible reactions, Aerosol Sci. Tech., … … 5336 5349 ! 5337 5350 !> Following parameterization has been used: 5338 !> Molecular diffusion coefficient of condensing vapour (m2/s) 5351 !> Molecular diffusion coefficient of condensing vapour (m2/s) 5339 5352 !> (Reid et al. (1987): Properties of gases and liquids, McGraw-Hill, New York.) 5340 5353 !> D = {1.d-7*sqrt(1/M_air + 1/M_gas)*T^1.75} / & … … 5343 5356 !> d_air = 19.70 : diffusion volume of air 5344 5357 !> M_h2so4 = 98.08 : molar mass of h2so4 (g/mol) 5345 !> d_h2so4 = 51.96 : diffusion volume of h2so4 5358 !> d_h2so4 = 51.96 : diffusion volume of h2so4 5346 5359 ! 5347 5360 !> Called from main aerosol model … … 5447 5460 zknud(ss:ee) = 2.0_wp * zmfp / paero(ss:ee)%dwet 5448 5461 ! 5449 !-- Transitional correction factor: aerosol + gas (the semi-empirical Fuchs- Sutugin 5462 !-- Transitional correction factor: aerosol + gas (the semi-empirical Fuchs- Sutugin 5450 5463 !-- interpolation function (Fuchs and Sutugin, 1971)) 5451 5464 zbeta = ( zknud + 1.0_wp ) / ( 0.377_wp * zknud + 1.0_wp + 4.0_wp / ( 3.0_wp * massacc ) * & … … 5459 5472 * paero(start_subrange_1a:start_subrange_1a+1)%dwet) 5460 5473 ! 5461 !-- Collision rate (mass-transfer coefficient): gases on aerosols (1/s) (Eq. 16.64 in 5474 !-- Collision rate (mass-transfer coefficient): gases on aerosols (1/s) (Eq. 16.64 in 5462 5475 !-- Jacobson (2005)) 5463 5476 ss = start_subrange_1a … … 5475 5488 !-- 5) Changes in gas-phase concentrations and particle volume 5476 5489 ! 5477 !-- 5.1) Organic vapours 5490 !-- 5.1) Organic vapours 5478 5491 ! 5479 5492 !-- 5.1.1) Non-volatile organic compound: condenses onto all bins … … 5527 5540 ! 5528 5541 !-- Change in gas concentration (#/m3) 5529 zdvap3 = pcocsv - zcvap_new3 5542 zdvap3 = pcocsv - zcvap_new3 5530 5543 ! 5531 5544 !-- Updated gas concentration (#/m3) … … 5590 5603 ! 5591 5604 !-- Condensation of water vapour 5592 IF ( lscndh2oae ) THEN 5605 IF ( lscndh2oae ) THEN 5593 5606 CALL gpparth2o( paero, ptemp, ppres, pcs, pcw, ptstep ) 5594 5607 ENDIF … … 5600 5613 ! ------------ 5601 5614 !> Calculates the particle number and volume increase, and gas-phase 5602 !> concentration decrease due to nucleation subsequent growth to detectable size 5615 !> concentration decrease due to nucleation subsequent growth to detectable size 5603 5616 !> of 3 nm. 5604 5617 ! … … 5659 5672 REAL(wp) :: zdelta_vap !< change of H2SO4 and organic vapour concentration (#/m3) 5660 5673 REAL(wp) :: zdfvap !< air diffusion coefficient (m2/s) 5661 REAL(wp) :: zdmean !< mean diameter of existing particles (m) 5674 REAL(wp) :: zdmean !< mean diameter of existing particles (m) 5662 5675 REAL(wp) :: zeta !< constant: proportional to ratio of CS/GR (m) 5663 5676 !< (condensation sink / growth rate) … … 5674 5687 REAL(wp) :: zlambda !< parameter for adjusting the growth rate due to self-coagulation 5675 5688 REAL(wp) :: zm_c !< particle mass (kg) for c = critical (1nm) 5676 REAL(wp) :: zm_para !< Parameter m for calculating the coagulation sink (Eq. 5&6 in 5689 REAL(wp) :: zm_para !< Parameter m for calculating the coagulation sink (Eq. 5&6 in 5677 5690 !< Lehtinen et al. 2007) 5678 5691 REAL(wp) :: zm_x !< particle mass (kg) for x = 3nm … … 5684 5697 REAL(wp) :: znsa !< number of H2SO4 molecules in critical cluster 5685 5698 5686 REAL(wp), INTENT(in) :: pc_nh3 !< ammonia concentration (#/m3) 5699 REAL(wp), INTENT(in) :: pc_nh3 !< ammonia concentration (#/m3) 5687 5700 REAL(wp), INTENT(in) :: pc_ocnv !< conc. of non-volatile OC (#/m3) 5688 5701 REAL(wp), INTENT(in) :: pc_sa !< sulphuric acid conc. (#/m3) … … 5812 5825 znsa = 1.0_wp 5813 5826 ! 5814 !-- Heteromolecular nucleation, J~[H2SO4]*[ORG] 5827 !-- Heteromolecular nucleation, J~[H2SO4]*[ORG] 5815 5828 !-- (See Paasonen et al. (2010), Atmos. Chem. Phys., 10, 11223-11242.) 5816 5829 CASE(7) … … 5864 5877 ! 5865 5878 !-- 2.1) Check that there is enough H2SO4 and organic vapour to produce the nucleation 5866 IF ( nsnucl <= 4 ) THEN 5879 IF ( nsnucl <= 4 ) THEN 5867 5880 ! 5868 5881 !-- If the chosen nucleation scheme is 1-4, nucleation occurs only due to H2SO4. All of the total … … 5881 5894 pxocnv = 0.0_wp 5882 5895 ELSE 5883 pxsa = pc_sa * znsa / ( pc_sa * znsa + pc_ocnv * znoc ) 5896 pxsa = pc_sa * znsa / ( pc_sa * znsa + pc_ocnv * znoc ) 5884 5897 pxocnv = pc_ocnv * znoc / ( pc_sa * znsa + pc_ocnv * znoc ) 5885 5898 ENDIF … … 6009 6022 ( 3.0_wp * z_r_c2 * zgamma_f_2 ) - z_r_c2 6010 6023 zomega_2x = ( ( z_r_x2 + zgamma_f_2 )**3 - ( z_r_x2**2 + zgamma_f_2 )**1.5_wp ) / & 6011 ( 3.0_wp * z_r_x2 * zgamma_f_2 ) - z_r_x2 6024 ( 3.0_wp * z_r_x2 * zgamma_f_2 ) - z_r_x2 6012 6025 ! 6013 6026 !-- The distance (m) at which the two fluxes are matched (condensation and coagulation sinks) … … 6025 6038 zcoags_x = MAX( 1.0E-20_wp, SUM( z_k_x2 * paero(:)%numc ) ) 6026 6039 ! 6027 !-- Parameter m for calculating the coagulation sink onto background particles (Eq. 5&6 in 6040 !-- Parameter m for calculating the coagulation sink onto background particles (Eq. 5&6 in 6028 6041 !-- Lehtinen et al. 2007) 6029 6042 zm_para = LOG( zcoags_x / zcoags_c ) / LOG( reglim(1) / zdcrit ) … … 6041 6054 ELSEIF ( nj3 == 3 ) THEN ! Anttila et al. (2010): coagulation sink and self-coag. 6042 6055 ! 6043 !-- If air is polluted, the self-coagulation becomes important. Self-coagulation of small 6056 !-- If air is polluted, the self-coagulation becomes important. Self-coagulation of small 6044 6057 !-- particles < 3 nm. 6045 6058 ! … … 6198 6211 ! 6199 6212 !-- Nucleation rate in #/(cm3 s) 6200 pnuc_rate = EXP( pnuc_rate ) 6213 pnuc_rate = EXP( pnuc_rate ) 6201 6214 ! 6202 6215 !-- Check the validity of parameterization 6203 IF ( pnuc_rate < 1.0E-7_wp ) THEN 6216 IF ( pnuc_rate < 1.0E-7_wp ) THEN 6204 6217 pnuc_rate = 0.0_wp 6205 6218 pd_crit = 1.0E-9_wp … … 6252 6265 ! 6253 6266 !-- 6) Organic compounds not involved when binary nucleation is assumed 6254 pn_crit_ocnv = 0.0_wp ! number of organic molecules 6267 pn_crit_ocnv = 0.0_wp ! number of organic molecules 6255 6268 pk_sa = 1.0_wp ! if = 1, H2SO4 involved in nucleation 6256 6269 pk_ocnv = 0.0_wp ! if = 1, organic compounds involved … … 6299 6312 6300 6313 END SUBROUTINE binnucl 6301 6314 6302 6315 !------------------------------------------------------------------------------! 6303 6316 ! Description: … … 6353 6366 zlogsa = LOG( pc_sa ) 6354 6367 ! 6355 !-- 2) Nucleation rate (Eq. 7 in Napari et al., 2002: Parameterization of 6368 !-- 2) Nucleation rate (Eq. 7 in Napari et al., 2002: Parameterization of 6356 6369 !-- ternary nucleation of sulfuric acid - ammonia - water. 6357 6370 zlnj = - 84.7551114741543_wp + 0.3117595133628944_wp * prh + & … … 6461 6474 ! Description: 6462 6475 ! ------------ 6463 !> Function z_n_nuc_tayl is connected to the calculation of self-coagualtion of 6476 !> Function z_n_nuc_tayl is connected to the calculation of self-coagualtion of 6464 6477 !> small particles. It calculates number of the particles in the size range 6465 !> [zdcrit,dx] using Taylor-expansion (please note that the expansion is not 6478 !> [zdcrit,dx] using Taylor-expansion (please note that the expansion is not 6466 6479 !> valid for certain rational numbers, e.g. -4/3 and -3/2) 6467 6480 !------------------------------------------------------------------------------! … … 6506 6519 ! Description: 6507 6520 ! ------------ 6508 !> Calculates the condensation of water vapour on aerosol particles. Follows the 6521 !> Calculates the condensation of water vapour on aerosol particles. Follows the 6509 6522 !> analytical predictor method by Jacobson (2005). 6510 !> For equations, see Jacobson (2005), Fundamentals of atmospheric modelling 6523 !> For equations, see Jacobson (2005), Fundamentals of atmospheric modelling 6511 6524 !> (2nd edition). 6512 6525 !------------------------------------------------------------------------------! … … 6690 6703 ! Description: 6691 6704 ! ------------ 6692 !> Calculates the activity coefficient of liquid water 6705 !> Calculates the activity coefficient of liquid water 6693 6706 !------------------------------------------------------------------------------! 6694 6707 REAL(wp) FUNCTION acth2o( ppart, pcw ) … … 6723 6736 ! Description: 6724 6737 ! ------------ 6725 !> Calculates the dissolutional growth of particles (i.e. gas transfers to a 6726 !> particle surface and dissolves in liquid water on the surface). Treated here 6727 !> as a non-equilibrium (time-dependent) process. Gases: HNO3 and NH3 6738 !> Calculates the dissolutional growth of particles (i.e. gas transfers to a 6739 !> particle surface and dissolves in liquid water on the surface). Treated here 6740 !> as a non-equilibrium (time-dependent) process. Gases: HNO3 and NH3 6728 6741 !> (Chapter 17.14 in Jacobson, 2005). 6729 6742 ! 6730 !> Called from subroutine condensation. 6743 !> Called from subroutine condensation. 6731 6744 !> Coded by: 6732 6745 !> Harri Kokkola (FMI) 6733 !------------------------------------------------------------------------------! 6746 !------------------------------------------------------------------------------! 6734 6747 SUBROUTINE gpparthno3( ppres, ptemp, paero, pghno3, pgnh3, pcw, pcs, pbeta, ptstep ) 6735 6748 … … 7270 7283 !< 1: HNO3, 2: HCL, 3: NH4+/H+ (NH3), 4: HHSO4**2/H2SO4, 7271 7284 !< 5: H2SO4**3/HHSO4**2, 6: NH4HSO2, 7: HHSO4 7272 REAL(wp), DIMENSION(:) :: ions !< ion molarities (mol/m3): 1: H+, 2: NH4+, 3: Na+, 7285 REAL(wp), DIMENSION(:) :: ions !< ion molarities (mol/m3): 1: H+, 2: NH4+, 3: Na+, 7273 7286 !< 4: SO4(2-), 5: HSO4-, 6: NO3-, 7: Cl- 7274 REAL(wp), DIMENSION(7) :: ions_mol !< ion molalities (mol/kg): 1: H+, 2: NH4+, 3: Na+, 7287 REAL(wp), DIMENSION(7) :: ions_mol !< ion molalities (mol/kg): 1: H+, 2: NH4+, 3: Na+, 7275 7288 !< 4: SO4(2-), 5: HSO4-, 6: NO3-, 7: Cl- 7276 REAL(wp), DIMENSION(:) :: mols_out !< ion molality output (mol/kg): 1: H+, 2: NH4+, 3: Na+, 7289 REAL(wp), DIMENSION(:) :: mols_out !< ion molality output (mol/kg): 1: H+, 2: NH4+, 3: Na+, 7277 7290 !< 4: SO4(2-), 5: HSO4-, 6: NO3-, 7: Cl- 7278 7291 ! … … 7560 7573 sodium_nitrate_eq_frac * nano3_h2so4 + sodium_chloride_eq_frac * nacl_h2so4 7561 7574 7562 gamma_h2so4 = EXP( ln_h2so4_act ) ! molal activity coefficient 7575 gamma_h2so4 = EXP( ln_h2so4_act ) ! molal activity coefficient 7563 7576 ! 7564 7577 !-- Export activity coefficients … … 7589 7602 ENDIF 7590 7603 ! 7591 !-- Calculate the new hydrogen ion, bisulphate ion and sulphate ion 7604 !-- Calculate the new hydrogen ion, bisulphate ion and sulphate ion 7592 7605 !-- concentration 7593 7606 h_real = ions(1) … … 7615 7628 !-- 4) ACTIVITY COEFFICIENTS -for vapour pressures of HNO3,HCL and NH3 7616 7629 ! 7617 !-- This section evaluates activity coefficients and vapour pressures using the water content 7630 !-- This section evaluates activity coefficients and vapour pressures using the water content 7618 7631 !-- calculated above) for each inorganic condensing species: a - HNO3, b - NH3, c - HCL. 7619 !-- The following procedure is used: Zaveri et al (2005) found that one could express the variation 7632 !-- The following procedure is used: Zaveri et al (2005) found that one could express the variation 7620 7633 !-- of activity coefficients linearly in log-space if equivalent mole fractions were used. 7621 7634 !-- So, by a taylor series expansion LOG( activity coefficient ) = … … 7927 7940 !> Update the particle size distribution. Put particles into corrects bins. 7928 7941 !> 7929 !> Moving-centre method assumed, i.e. particles are allowed to grow to their 7930 !> exact size as long as they are not crossing the fixed diameter bin limits. 7931 !> If the particles in a size bin cross the lower or upper diameter limit, they 7942 !> Moving-centre method assumed, i.e. particles are allowed to grow to their 7943 !> exact size as long as they are not crossing the fixed diameter bin limits. 7944 !> If the particles in a size bin cross the lower or upper diameter limit, they 7932 7945 !> are all moved to the adjacent diameter bin and their volume is averaged with 7933 !> the particles in the new bin, which then get a new diameter. 7934 ! 7935 !> Moving-centre method minimises numerical diffusion. 7946 !> the particles in the new bin, which then get a new diameter. 7947 ! 7948 !> Moving-centre method minimises numerical diffusion. 7936 7949 !------------------------------------------------------------------------------! 7937 7950 SUBROUTINE distr_update( paero ) … … 7996 8009 ! 7997 8010 !-- If size bin has not grown, cycle. 7998 !-- Changed by Mona: compare to the arithmetic mean volume, as done originally. Now 7999 !-- particle volume is derived from the geometric mean diameter, not arithmetic (see 8011 !-- Changed by Mona: compare to the arithmetic mean volume, as done originally. Now 8012 !-- particle volume is derived from the geometric mean diameter, not arithmetic (see 8000 8013 !-- SUBROUTINE set_sizebins). 8001 8014 IF ( zvpart <= api6 * ( ( aero(ib)%vhilim + aero(ib)%vlolim ) / ( 2.0_wp * api6 ) ) ) & … … 9537 9550 REAL(wp), DIMENSION(:), INTENT(out) :: mconc !< total dry or wet mass concentration 9538 9551 9539 !-- Number of components 9552 !-- Number of components 9540 9553 IF ( itype == 'dry' ) THEN 9541 iend = prtcl%ncomp - 1 9554 iend = prtcl%ncomp - 1 9542 9555 ELSE IF ( itype == 'wet' ) THEN 9543 9556 iend = prtcl%ncomp … … 10027 10040 message_string = 'end_time of the simulation exceeds the time dimension in ' // & 10028 10041 'the salsa input file.' 10029 CALL message( 'salsa_emission_setup', 'PA0692', 1, 2, 0, 6, 0 ) 10042 CALL message( 'salsa_emission_setup', 'PA0692', 1, 2, 0, 6, 0 ) 10030 10043 ENDIF 10031 10044 ! … … 10093 10106 inn = def_modes%cat_input_to_model(in) 10094 10107 ! 10095 !-- Calculate the number concentration (1/m3) of a log-normal size distribution 10108 !-- Calculate the number concentration (1/m3) of a log-normal size distribution 10096 10109 !-- following Jacobson (2005): Eq 13.25. 10097 10110 def_modes%ntot_table = 6.0_wp * def_modes%pm_frac_table(:,inn) / ( pi * & … … 10643 10656 MAX( time_since_reference_point, 0.0_wp ) ), DIM = 1 ) - 1 10644 10657 ! 10645 !-- Allocate the data input array always before reading in the data and deallocate after (NOTE 10658 !-- Allocate the data input array always before reading in the data and deallocate after (NOTE 10646 10659 !-- that "preprocessed" input data array is applied now here) 10647 10660 ALLOCATE( dum_var_5d(1,1,nys:nyn,nxl:nxr,1:chem_emission_att%n_emiss_species) ) … … 11762 11775 ! 11763 11776 !-- Diameter in micrometres 11764 mean_d = 1.0E+6_wp * ra_dry(k,j,i,ib) * 2.0_wp 11777 mean_d = 1.0E+6_wp * ra_dry(k,j,i,ib) * 2.0_wp 11765 11778 ! 11766 11779 !-- Deposition factor: alveolar … … 12112 12125 DO k = nzb_do, nzt_do 12113 12126 local_pf(i,j,k) = MERGE( nbins_av(k,j,i,ib), REAL( fill_value, KIND = wp ), & 12114 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12127 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12115 12128 ENDDO 12116 12129 ENDDO … … 12146 12159 DO k = nzb_do, nzt_do 12147 12160 local_pf(i,j,k) = MERGE( mbins_av(k,j,i,ib), REAL( fill_value, KIND = wp ), & 12148 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12161 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12149 12162 ENDDO 12150 12163 ENDDO … … 12225 12238 DO k = nzb_do, nzt_do 12226 12239 local_pf(i,j,k) = MERGE( ldsa_av(k,j,i), REAL( fill_value, KIND = wp ), & 12227 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12240 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12228 12241 ENDDO 12229 12242 ENDDO … … 12256 12269 DO k = nzb_do, nzt_do 12257 12270 local_pf(i,j,k) = MERGE( nufp_av(k,j,i), REAL( fill_value, KIND = wp ), & 12258 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12271 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12259 12272 ENDDO 12260 12273 ENDDO … … 12285 12298 DO k = nzb_do, nzt_do 12286 12299 local_pf(i,j,k) = MERGE( ntot_av(k,j,i), REAL( fill_value, KIND = wp ), & 12287 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12300 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12288 12301 ENDDO 12289 12302 ENDDO … … 12305 12318 ENDDO 12306 12319 local_pf(i,j,k) = MERGE( temp_bin, REAL( fill_value, KIND = wp ), & 12307 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12320 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12308 12321 ENDDO 12309 12322 ENDDO … … 12318 12331 DO k = nzb_do, nzt_do 12319 12332 local_pf(i,j,k) = MERGE( pm01_av(k,j,i), REAL( fill_value, KIND = wp ), & 12320 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12333 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12321 12334 ENDDO 12322 12335 ENDDO … … 12338 12351 ENDDO 12339 12352 local_pf(i,j,k) = MERGE( temp_bin, REAL( fill_value, KIND = wp ), & 12340 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12353 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12341 12354 ENDDO 12342 12355 ENDDO … … 12351 12364 DO k = nzb_do, nzt_do 12352 12365 local_pf(i,j,k) = MERGE( pm25_av(k,j,i), REAL( fill_value, KIND = wp ), & 12353 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12366 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12354 12367 ENDDO 12355 12368 ENDDO … … 12371 12384 ENDDO 12372 12385 local_pf(i,j,k) = MERGE( temp_bin, REAL( fill_value, KIND = wp ), & 12373 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12386 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12374 12387 ENDDO 12375 12388 ENDDO … … 12402 12415 ENDDO 12403 12416 local_pf(i,j,k) = MERGE( temp_bin, REAL( fill_value, KIND = wp ), & 12404 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12417 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12405 12418 ENDDO 12406 12419 ENDDO … … 12434 12447 ENDDO 12435 12448 local_pf(i,j,k) = MERGE( temp_bin, REAL( fill_value, KIND = wp ), & 12436 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12449 BTEST( wall_flags_total_0(k,j,i), 0 ) ) 12437 12450 ENDDO 12438 12451 ENDDO … … 12585 12598 ENDDO 12586 12599 ENDDO 12587 ELSE 12600 ELSE 12588 12601 DO i = 1, mask_size_l(mid,1) 12589 12602 DO j = 1, mask_size_l(mid,2) … … 12666 12679 ENDDO 12667 12680 ENDDO 12668 ELSE 12681 ELSE 12669 12682 DO i = 1, mask_size_l(mid,1) 12670 12683 DO j = 1, mask_size_l(mid,2) … … 12755 12768 ENDDO 12756 12769 ENDDO 12757 ENDDO 12770 ENDDO 12758 12771 IF ( .NOT. mask_surface(mid) ) THEN 12759 12772 DO i = 1, mask_size_l(mid,1) … … 12764 12777 ENDDO 12765 12778 ENDDO 12766 ELSE 12779 ELSE 12767 12780 DO i = 1, mask_size_l(mid,1) 12768 12781 DO j = 1, mask_size_l(mid,2) … … 12807 12820 ENDDO 12808 12821 ENDDO 12809 ENDDO 12822 ENDDO 12810 12823 IF ( .NOT. mask_surface(mid) ) THEN 12811 12824 DO i = 1, mask_size_l(mid,1) … … 12816 12829 ENDDO 12817 12830 ENDDO 12818 ELSE 12831 ELSE 12819 12832 DO i = 1, mask_size_l(mid,1) 12820 12833 DO j = 1, mask_size_l(mid,2) … … 12868 12881 ENDDO 12869 12882 ENDDO 12870 ELSE 12883 ELSE 12871 12884 DO i = 1, mask_size_l(mid,1) 12872 12885 DO j = 1, mask_size_l(mid,2) … … 12911 12924 ENDDO 12912 12925 ENDDO 12913 ENDDO 12926 ENDDO 12914 12927 IF ( .NOT. mask_surface(mid) ) THEN 12915 12928 DO i = 1, mask_size_l(mid,1) … … 12920 12933 ENDDO 12921 12934 ENDDO 12922 ELSE 12935 ELSE 12923 12936 DO i = 1, mask_size_l(mid,1) 12924 12937 DO j = 1, mask_size_l(mid,2) … … 13098 13111 ! Description: 13099 13112 ! ------------ 13100 !> Creates index tables for different (aerosol) components 13113 !> Creates index tables for different (aerosol) components 13101 13114 !------------------------------------------------------------------------------! 13102 13115 SUBROUTINE component_index_constructor( self, ncomp, nlist, listcomp ) … … 13583 13596 message_string = 'end_time of the simulation exceeds the time dimension in the dynamic'//& 13584 13597 ' input file.' 13585 CALL message( 'salsa_nesting_offl_init', 'PA0690', 1, 2, 0, 6, 0 ) 13598 CALL message( 'salsa_nesting_offl_init', 'PA0690', 1, 2, 0, 6, 0 ) 13586 13599 ENDIF 13587 13600 … … 13747 13760 CALL message( 'salsa_mod: salsa_nesting_offl_input', 'PA0693', 2, 2, 0, 6, 0 ) 13748 13761 ENDIF 13749 13762 13750 13763 CALL close_input_file( salsa_nest_offl%id_dynamic ) 13751 13764 #endif
Note: See TracChangeset
for help on using the changeset viewer.