Changeset 3458 for palm/trunk/SOURCE/chem_emissions_mod.f90
- Timestamp:
- Oct 30, 2018 2:51:23 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/chem_emissions_mod.f90
r3373 r3458 27 27 ! ----------------- 28 28 ! $Id$ 29 ! from chemistry branch r3443, banzhafs, Russo: 30 ! Additional correction for index of input file of pre-processed mode 31 ! Removed atomic and molecular weights as now available in chem_modules and 32 ! added par_emis_time_factor (formerly in netcdf_data_input_mod) 33 ! Added correction for index of input file of pre-processed mode 34 ! Added a condition for default mode necessary for information read from ncdf file 35 ! in pre-processed and default mode 36 ! Correction of multiplying factor necessary for scaling emission values in time 37 ! Introduced correction for scaling units in the case of DEFAULT emission mode 38 ! 39 ! 3373 2018-10-18 15:25:56Z kanani 29 40 ! Fix wrong location of __netcdf directive 30 41 ! … … 40 51 ! Authors: 41 52 ! -------- 42 ! Emmanuele Russo Fu-Berlin43 ! Sabine Banzhaf FU-Berlin44 ! Martijn Schaap FU-Berlin, TNO Utrecht53 ! @author Emmanuele Russo (Fu-Berlin) 54 ! @author Sabine Banzhaf (FU-Berlin) 55 ! @author Martijn Schaap (FU-Berlin, TNO Utrecht) 45 56 ! 46 57 ! Description: … … 49 60 !> 50 61 !> @todo Check_parameters routine should be developed: for now it includes just one condition 51 !> @todo Add option for capital or small letters in the matching routine52 62 !> @todo Use of Restart files not contempled at the moment 63 !> @todo revise indices of files read from the netcdf: preproc_emission_data and expert_emission_data 64 !> @todo for now emission data may be passed on a singular vertical level: need to be more flexible 53 65 !> @note <Enter notes on the module> 54 66 !> @bug <Enter known bugs here> … … 61 73 62 74 USE control_parameters, & 63 ONLY: initializing_actions, end_time, message_string,&75 ONLY: initializing_actions, end_time, message_string, & 64 76 intermediate_timestep_count, dt_3d 65 77 … … 67 79 68 80 USE kinds 81 82 #if defined ( __netcdf ) 69 83 70 84 USE netcdf_data_input_mod, & 71 85 ONLY: chem_emis_att_type, chem_emis_val_type 72 86 73 #if defined ( __netcdf )74 87 USE NETCDF 88 75 89 #endif 76 90 77 91 USE date_and_time_mod, & 78 ONLY: time_default_indices, month_of_year, day_of_month, hour_of_day, & 92 ONLY: time_default_indices, time_preprocessed_indices, & 93 month_of_year, day_of_month, hour_of_day, & 79 94 index_mm, index_dd, index_hh 80 95 … … 92 107 93 108 CHARACTER (LEN=80) :: filename_emis !> Variable for the name of the netcdf input file 94 CHARACTER (LEN=80), ALLOCATABLE, DIMENSION(:) :: string_values !> Output of string variables read from netcdf input file 95 96 INTEGER(iwp) :: n_dims !> Number of dimensions of input variable netcdf file 109 97 110 INTEGER(iwp) :: i !> index 1st selected dimension (some dims are not spatial) 98 111 INTEGER(iwp) :: j !> index 2nd selected dimension … … 103 116 INTEGER(iwp) :: z_start !> Index to start read variable from netcdf in additional dims 104 117 INTEGER(iwp) :: z_end !> Index to end read variable from netcdf in additional dims 105 INTEGER(iwp), ALLOCATABLE, DIMENSION(:) :: id_dims !> id of dimension of selected variable netcdf input106 INTEGER(iwp), ALLOCATABLE, DIMENSION(:) :: dum_var !> value of variable read from netcdf input107 INTEGER(iwp) :: id_ncfile !> id netcdf file108 INTEGER(iwp) :: errno !> error number NF90_???? function109 INTEGER(iwp) :: id_var !< variable id110 118 INTEGER(iwp) :: dt_emis !> Time Step Emissions 111 119 INTEGER(iwp) :: len_index !> length of index (used for several indices) … … 124 132 !> Dobson units: 125 133 REAL, PARAMETER :: Dobs = 2.68668e16 ! (mlc/cm2) / DU 126 127 ! molar weights of components128 129 !> atomic weights:130 REAL, PARAMETER :: xm_H = 1.00790e-3 ! kg/mol131 REAL, PARAMETER :: xm_N = 14.00670e-3 ! kg/mol132 REAL, PARAMETER :: xm_C = 12.01115e-3 ! kg/mol133 REAL, PARAMETER :: xm_S = 32.06400e-3 ! kg/mol134 REAL, PARAMETER :: xm_O = 15.99940e-3 ! kg/mol135 REAL, PARAMETER :: xm_F = 18.99840e-3 ! kg/mol136 REAL, PARAMETER :: xm_Na = 22.98977e-3 ! kg/mol137 REAL, PARAMETER :: xm_Cl = 35.45300e-3 ! kg/mol138 REAL, PARAMETER :: xm_Rn222 = 222.00000e-3 ! kg/mol139 REAL, PARAMETER :: xm_Pb210 = 210.00000e-3 ! kg/mol140 REAL, PARAMETER :: xm_Ca = 40.07800e-3 ! kg/mol141 REAL, PARAMETER :: xm_K = 39.09800e-3 ! kg/mol142 REAL, PARAMETER :: xm_Mg = 24.30500e-3 ! kg/mol143 REAL, PARAMETER :: xm_Pb = 207.20000e-3 ! kg/mol144 REAL, PARAMETER :: xm_Cd = 112.41000e-3 ! kg/mol145 REAL, PARAMETER :: xm_Rh = 102.90550e-3 ! kg/mol146 147 !> molecule weights:148 REAL, PARAMETER :: xm_h2o = xm_H * 2 + xm_O ! kg/mol149 REAL, PARAMETER :: xm_o3 = xm_O * 3 ! kg/mol150 REAL, PARAMETER :: xm_N2O5 = xm_N * 2 + xm_O * 5 ! kg/mol151 REAL, PARAMETER :: xm_HNO3 = xm_H + xm_N + xm_O * 3 ! kg/mol152 REAL, PARAMETER :: xm_NH4 = xm_N + xm_H * 4 ! kg/mol153 REAL, PARAMETER :: xm_SO4 = xm_S + xm_O * 4 ! kg/mol154 REAL, PARAMETER :: xm_NO3 = xm_N + xm_O * 3 ! kg/mol155 REAL, PARAMETER :: xm_CO2 = xm_C + xm_O * 2 ! kg/mol156 157 !> mass of air158 REAL, PARAMETER :: xm_air = 28.964e-3 ! kg/mol159 REAL, PARAMETER :: xmair = 28.94 ! g/mol; old name!160 134 161 135 !> sesalt composition: … … 263 237 !-- Public Variables 264 238 265 PUBLIC id_ncfile,errno,id_dims,n_dims,dum_var, con_factor, &266 len_index,len_index_voc,len_index_pm, string_values 239 PUBLIC con_factor, len_index,len_index_voc,len_index_pm 240 267 241 CONTAINS 268 242 … … 275 249 276 250 277 !TBD: Where Should we put the call to chem_emissions_check_parameters? In chem_init or in check_parameters?251 !TBD: Where Should we put the call to chem_emissions_check_parameters? In chem_init or in check_parameters? 278 252 279 253 IMPLICIT NONE … … 548 522 IF (len_index_voc>0) THEN 549 523 ALLOCATE(match_spec_voc_model(len_index_voc)) !> contains indices of the VOC model species 550 ALLOCATE(match_spec_voc_input(len_index_voc)) !> In input there is only one value for VOCs in the DEFAULT mode. This array contains the indices of the different values of VOC compositions of the input variable VOC_composition 524 ALLOCATE(match_spec_voc_input(len_index_voc)) !> In input there is only one value for VOCs in the DEFAULT mode. 525 ! This array contains the indices of the different values of VOC compositions of the input variable VOC_composition 551 526 ENDIF 552 527 … … 661 636 ' DO NOT MATCH' // & 662 637 ' model chemical species' // & 663 ' Chemistry Emissions routine is not called' !TBD: IMPORTANT:Add a condition in chem init that sets the emission_output_required to false when len_index==0 so that the chem_emissions modules are not used638 ' Chemistry Emissions routine is not called' 664 639 CALL message( 'chem_emissions_matching', 'CM0440', 0, 0, 0, 6, 0 ) 665 640 … … 724 699 DO ispec = 1 , len_index 725 700 726 IF ( emiss_factor_main(match_spec_input(ispec)) .LT. 0 .AND. & 727 emiss_factor_side(match_spec_input(ispec)) .LT. 0 ) THEN 728 729 message_string = 'PARAMETERIZED emissions mode selected:' // & 701 IF ( emiss_factor_main(match_spec_input(ispec)) .LT. 0 .AND. emiss_factor_side(match_spec_input(ispec)) .LT. 0 ) THEN 702 703 message_string = 'PARAMETERIZED emissions mode selected:' // & 730 704 ' EMISSIONS POSSIBLE ONLY ON STREET SURFACES' // & 731 705 ' but values of scaling factors for street types' // & … … 780 754 SUBROUTINE chem_emissions_init(emt_att,emt,nspec_out) 781 755 782 756 #if defined( __netcdf ) 783 757 784 758 USE surface_mod, & … … 799 773 800 774 INTEGER(iwp) :: ispec !> Index to go through the emission chemical species 801 #if defined( __netcdf ) 775 802 776 803 777 !-- Actions for initial runs : TBD: needs to be updated … … 854 828 SELECT CASE(TRIM(mode_emis)) !TBD: Add the option for CApital or small letters 855 829 830 831 !> PRE-PROCESSED case 832 CASE ("PRE-PROCESSED") 833 834 IF ( .NOT. ALLOCATED( emis_distribution) ) ALLOCATE(emis_distribution(nzb:nzt+1,0:ny,0:nx,nspec_out)) 835 836 CALL location_message( 'emis_distribution array allocated in PRE-PROCESSED mode', .FALSE. ) 837 838 !> Calculate the values of the emissions at the first time step 839 CALL chem_emissions_setup(emt_att,emt,nspec_out) 840 856 841 !> Default case 857 842 CASE ("DEFAULT") … … 864 849 CALL chem_emissions_setup(emt_att,emt,nspec_out) 865 850 866 867 !> PRE-PROCESSED case 868 CASE ("PRE-PROCESSED") 869 870 IF ( .NOT. ALLOCATED( emis_distribution) ) ALLOCATE(emis_distribution(nzb:nzt+1,0:ny,0:nx,nspec_out)) 871 872 CALL location_message( 'emis_distribution array allocated in PRE-PROCESSED mode', .FALSE. ) 873 874 !> Calculate the values of the emissions at the first time step 875 CALL chem_emissions_setup(emt_att,emt,nspec_out) 876 851 !> PARAMETERIZED case 877 852 CASE ("PARAMETERIZED") 878 853 879 854 CALL location_message( 'emis_distribution array allocated in PARAMETERIZED mode', .FALSE. ) 880 855 881 ! For now for PAR and DEF values only, first vertical level of emis_distribution is allocated, while for EXPall.856 ! For now for PAR and DEF values only, first vertical level of emis_distribution is allocated, while for PRE-PROCESSED all. 882 857 IF ( .NOT. ALLOCATED( emis_distribution) ) ALLOCATE(emis_distribution(1,0:ny,0:nx,nspec_out)) 883 858 … … 919 894 IMPLICIT NONE 920 895 921 896 #if defined( __netcdf ) 922 897 923 898 !--- IN/OUT … … 949 924 REAL(wp),ALLOCATABLE, DIMENSION(:,:) :: emis 950 925 926 REAL(wp), DIMENSION(24) :: par_emis_time_factor !< time factors 927 ! for the parameterized mode: these are fixed for each hour 928 ! of a single day. 951 929 REAL(wp), DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) :: conv_to_ratio !> factor used for converting input 952 930 ! to adimensional concentration ratio … … 964 942 ! --- const ------------------------------- 965 943 !-CONVERSION FACTORS: TIME 944 ! number of sec per hour = 3600 945 REAL, PARAMETER :: s_per_hour = 3600.0 ! (s)/(hour) 946 ! number of sec per day = 86400 947 REAL, PARAMETER :: s_per_day = 86400.0 ! (s)/(day) 966 948 ! number of hours in a year of 365 days: 967 REAL, PARAMETER :: hour_per_year = 8760.0 !> TBD: What about leap years? 949 REAL, PARAMETER :: hour_per_year = 8760.0 !> TBD: What about leap years? 950 ! number of hours in a day: 951 REAL, PARAMETER :: hour_per_day = 24.0 952 968 953 ! conversion from hours to seconds (s/hour) = 1/3600.0 ~ 0.2777778 969 REAL, PARAMETER :: hour_to_s = 0.0002777778! (hour)/(s)954 REAL, PARAMETER :: hour_to_s = 1/s_per_hour ! (hour)/(s) 970 955 ! conversion from day to seconds (s/day) = 1/86400.0 ~ 1.157407e-05 971 REAL, PARAMETER :: day_to_s = 1 .157407e-05! (day)/(s)956 REAL, PARAMETER :: day_to_s = 1/s_per_day ! (day)/(s) 972 957 ! conversion from year to sec (s/year) = 1/31536000.0 ~ 3.170979e-08 973 REAL, PARAMETER :: year_to_s = 3.170979e-08! (year)/(s)958 REAL, PARAMETER :: year_to_s = 1/(s_per_hour*hour_per_year) ! (year)/(s) 974 959 975 960 !-CONVERSION FACTORS: WEIGHT … … 984 969 REAL(wp), PARAMETER :: ratio2ppm = 1.0e06_wp 985 970 !------------------------------------------------------ 986 #if defined( __netcdf ) 971 987 972 IF ( emission_output_required ) THEN 988 973 989 !> Set emis_dt !TBD: this is the same as dt_chem. We should consider the fact that dt_emis should be the timestep of input emissions or better defined, the timestep at which the emission routines are calle : for now one hour. It should be made changeable.974 !> Set emis_dt !TBD: this is the same as dt_chem. We should consider the fact that dt_emis should be the timestep of input emissions or better defined, the timestep at which the emission routines are called: for now one hour. It should be made changeable. 990 975 991 976 IF ( call_chem_at_all_substeps ) THEN … … 1093 1078 1094 1079 message_string = 'No Units conversion required for units of chemistry emissions' // & 1095 ' of the PARAMETERIZED mode: units have to be provided in mole/m**2/s ' 1080 ' of the PARAMETERIZED mode: units have to be provided in' // & 1081 ' micromole/m**2/day for GASES and' // & 1082 ' kg/m**2/day for PMs' 1096 1083 CALL message( 'chem_emissions_setup', 'CM0447', 0, 0, 0, 6, 0 ) 1097 1084 … … 1110 1097 ! V/N=RT/P 1111 1098 1112 !> m**3/Nmole (J/mol)*K^-1 K Pa1099 !> m**3/Nmole (J/mol)*K^-1 K Pa 1113 1100 conv_to_ratio(nzb:nzt+1,j,i) = ( (Rgas * tmp_temp(nzb:nzt+1,j,i)) / ((hyp(nzb:nzt+1))) ) 1114 1101 ENDDO … … 1125 1112 !> PRE-PROCESSED MODE 1126 1113 IF (TRIM(mode_emis)=="PRE-PROCESSED") THEN 1114 1115 !> Update time indices 1116 CALL time_preprocessed_indices(index_hh) 1127 1117 1128 1118 CALL location_message( 'PRE-PROCESSED MODE: No time-factor specification required', .FALSE. ) … … 1194 1184 ' 24 values for every day of the year ', .FALSE. ) 1195 1185 1186 !Assign Constant Values of time factors, diurnal time profile for traffic sector: 1187 par_emis_time_factor( : ) = (/ 0.009, 0.004, 0.004, 0.009, 0.029, 0.039, 0.056, 0.053, 0.051, 0.051, 0.052, 0.055, & 1188 0.059, 0.061, 0.064, 0.067, 0.069, 0.069, 0.049, 0.039, 0.039, 0.029, 0.024, 0.019 /) 1189 1196 1190 !> in this case allocate time factor each hour in a day 1197 1191 IF (.NOT. ALLOCATED(time_factor)) ALLOCATE(time_factor(1)) … … 1200 1194 index_hh=hour_of_day 1201 1195 1202 time_factor(1) =emt_att%par_emis_time_factor(index_hh)1196 time_factor(1) = par_emis_time_factor(index_hh) 1203 1197 1204 1198 ENDIF … … 1212 1206 DO ispec=1,nspec_out 1213 1207 1214 !> Values are still micromoles/(m**2*s). Units are not given by the user for this mode and are always micromoles (or microgramsfor PMs)1215 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=surface_csflux(match_spec_input(ispec))*time_factor(1) 1208 !> Values are still micromoles/(m**2*s). Units in this case are always micromoles/m**2*day (or kilograms/m**2*day for PMs) 1209 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=surface_csflux(match_spec_input(ispec))*time_factor(1)*hour_to_s 1216 1210 1217 1211 ENDDO … … 1223 1217 DO ispec=1,nspec_out !> nspec_out represents the number of species in common between 1224 1218 ! the emission input data and the chemistry mechanism used 1225 1226 emis_distribution( nzb:nzt+1,nys:nyn,nxl:nxr,ispec) = emt(match_spec_input(ispec))%&1227 preproc_emission_data(index_hh,nzb:nzt+1,nys:nyn,nxl:nxr)* &1228 con_factor1229 1219 1220 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = emt(match_spec_input(ispec))% & 1221 preproc_emission_data(index_hh,1,nys+1:nyn+1,nxl+1:nxr+1)* & 1222 con_factor 1223 1230 1224 ENDDO 1231 1225 … … 1249 1243 !TBD: The consideration of dt_emis of the input data is still missing. Basically the emissions could be provided every 10, 30 minutes and not always at one hour. This should be eventually solved in the date_and_time mode routine. 1250 1244 1245 !> the time factors are 24 for each day. When multiplied by a daily value, they allow to have an hourly value. Then to convert it to seconds, we still have to divide this value by 3600. 1246 ! So given any units, we convert them to seconds and finally multiply them by 24 ((value/sec)*(24*3600)=value/day ---- (value/day)*time_factor=value/hour ---(value/hour)/(3600)=value/sec ) 1247 ! ((value/sec)*(24*3600)*time_factor)/3600=24*(value/sec)*time_factor 1248 1251 1249 !> NOX Compositions 1252 1250 IF (TRIM(spc_names(match_spec_model(ispec)))=="NO") THEN 1253 !> Kg/m2 kg/m2*s 1254 delta_emis(nys:nyn,nxl:nxr) = & 1255 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%nox_comp(icat,1)*con_factor 1251 !> Kg/m2*s kg/m2*s 1252 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%nox_comp(icat,1)*con_factor*hour_per_day 1256 1253 1257 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1258 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1254 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1259 1255 1260 1256 ELSE IF (TRIM(spc_names(match_spec_model(ispec)))=="NO2") THEN 1261 1257 1262 delta_emis(nys:nyn,nxl:nxr) = & 1263 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%nox_comp(icat,2)*con_factor 1264 1265 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1266 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1258 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%nox_comp(icat,2)*con_factor*hour_per_day 1259 1260 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1267 1261 1268 1262 !> SOX Compositions 1269 1263 1270 1264 ELSE IF (TRIM(spc_names(match_spec_model(ispec)))=="SO2") THEN 1271 1272 delta_emis(nys:nyn,nxl:nxr) = & 1273 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%sox_comp(icat,1)*con_factor 1274 1275 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1276 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1265 !> Kg/m2*s kg/m2*s 1266 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%sox_comp(icat,1)*con_factor*hour_per_day 1267 1268 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1277 1269 1278 1270 ELSE IF (TRIM(spc_names(match_spec_model(ispec)))=="SO4") THEN 1279 1280 delta_emis(nys:nyn,nxl:nxr) = & 1281 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%sox_comp(icat,2)*con_factor 1282 1283 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1284 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1271 !> Kg/m2*s kg/m2*s 1272 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%sox_comp(icat,2)*con_factor*hour_per_day 1273 1274 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1285 1275 1286 1276 … … 1292 1282 DO i_pm_comp= 1,SIZE(emt_att%pm_comp(1,:,1)) 1293 1283 1294 delta_emis(nys:nyn,nxl:nxr) = & 1295 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%pm_comp(icat,i_pm_comp,1)*con_factor 1284 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%pm_comp(icat,i_pm_comp,1)*con_factor*hour_per_day 1296 1285 1297 1286 1298 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1299 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1287 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1300 1288 1301 1289 ENDDO … … 1307 1295 DO i_pm_comp= 1,SIZE(emt_att%pm_comp(1,:,2)) 1308 1296 1309 delta_emis(nys:nyn,nxl:nxr) = & 1310 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%pm_comp(icat,i_pm_comp,2)*con_factor 1297 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%pm_comp(icat,i_pm_comp,2)*con_factor*hour_per_day 1311 1298 1312 1299 1313 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1314 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1300 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1315 1301 1316 1302 ENDDO … … 1322 1308 DO i_pm_comp= 1,SIZE(emt_att%pm_comp(1,:,3)) 1323 1309 1324 delta_emis(nys:nyn,nxl:nxr) = & 1325 emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%pm_comp(icat,i_pm_comp,3)*con_factor 1310 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*emt_att%pm_comp(icat,i_pm_comp,3)*con_factor*hour_per_day 1326 1311 1327 1312 1328 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1329 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1313 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1330 1314 1331 1315 ENDDO … … 1339 1323 IF (TRIM(spc_names(match_spec_model(ispec)))==TRIM(emt_att%voc_name(ivoc))) THEN 1340 1324 1341 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)* & 1342 emt_att%voc_comp(icat,match_spec_voc_input(ivoc))*con_factor 1343 1344 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1345 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1325 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)* & 1326 emt_att%voc_comp(icat,match_spec_voc_input(ivoc))*con_factor*hour_per_day 1327 1328 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1346 1329 1347 1330 ENDIF … … 1352 1335 ELSE 1353 1336 1354 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*con_factor 1355 1356 emis_distribution(1,nys:nyn,nxl:nxr,ispec) = & 1357 emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1337 delta_emis(nys:nyn,nxl:nxr) = emis(nys:nyn,nxl:nxr)*time_factor(icat)*con_factor*hour_per_day 1338 1339 emis_distribution(1,nys:nyn,nxl:nxr,ispec)=emis_distribution(1,nys:nyn,nxl:nxr,ispec)+delta_emis(nys:nyn,nxl:nxr) 1358 1340 1359 1341 ENDIF ! IF (spc_names==) … … 1396 1378 DO ispec=1,nspec_out 1397 1379 1398 !> PMs are already in mass units:micrograms:they have to be converted to kilograms 1399 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" & 1400 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1380 !> PMs are already in mass units: kilograms 1381 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1401 1382 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1402 1383 … … 1412 1393 !> Other Species: inputs are micromoles: they have to be converted in moles 1413 1394 ! ppm/s *m *kg/m^3 1414 surf_lsm_h%cssws(match_spec_model(ispec),m) = emiss_factor_main(match_spec_input(ispec))* &1395 surf_lsm_h%cssws(match_spec_model(ispec),m) = emiss_factor_main(match_spec_input(ispec))* & 1415 1396 ! micromoles/(m^2*s) 1416 emis_distribution(1,j,i,ispec) * &1417 ! m **3/Nmole1418 conv_to_ratio(k,j,i)* &1397 emis_distribution(1,j,i,ispec) * & 1398 ! m^3/Nmole 1399 conv_to_ratio(k,j,i)* & 1419 1400 ! kg/m^3 1420 1401 rho_air(k) … … 1426 1407 1427 1408 1428 ELSEIF ( street_type_f%var(j,i) >= side_street_id .AND. & 1429 street_type_f%var(j,i) < main_street_id ) THEN 1409 ELSEIF ( street_type_f%var(j,i) >= side_street_id .AND. street_type_f%var(j,i) < main_street_id ) THEN 1430 1410 1431 1411 !> Cycle over already matched species … … 1433 1413 1434 1414 !> PMs are already in mass units: micrograms 1435 IF ( TRIM(spc_names(match_spec_model(ispec)))=="PM1" & 1436 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1415 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1437 1416 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1438 1417 1439 1418 ! kg/(m^2*s) *kg/m^3 1440 surf_lsm_h%cssws(match_spec_model(ispec),m)= emiss_factor_side(match_spec_input(ispec)) * &1419 surf_lsm_h%cssws(match_spec_model(ispec),m)= emiss_factor_side(match_spec_input(ispec)) * & 1441 1420 ! kg/(m^2*s) 1442 1421 emis_distribution(1,j,i,ispec)* & … … 1448 1427 !>Other Species: inputs are micromoles 1449 1428 ! ppm/s *m *kg/m^3 1450 surf_lsm_h%cssws(match_spec_model(ispec),m) = emiss_factor_side(match_spec_input(ispec)) * &1429 surf_lsm_h%cssws(match_spec_model(ispec),m) = emiss_factor_side(match_spec_input(ispec)) * & 1451 1430 ! micromoles/(m^2*s) 1452 emis_distribution(1,j,i,ispec) * &1453 ! m **3/Nmole1454 conv_to_ratio(k,j,i)* &1431 emis_distribution(1,j,i,ispec) * & 1432 ! m^3/Nmole 1433 conv_to_ratio(k,j,i)* & 1455 1434 ! kg/m^3 1456 1435 rho_air(k) … … 1486 1465 j = surf_def_h(0)%j(m) 1487 1466 1488 !> Distinguish between PMs (no needing conversion in ppms), 1489 ! VOC (already converted to moles/(m**2*s) using conv_factors: they do not need molar masses for their conversion to PPMs ) and 1490 ! other Species (still expressed in Kg/(m**2*s) at this point) 1491 1492 !> PMs 1493 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" & 1494 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1495 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1467 IF ( emis_distribution(1,j,i,ispec) > 0.0_wp ) THEN 1468 1469 1470 !> Distinguish between PMs (no needing conversion in ppms), 1471 ! VOC (already converted to moles/(m**2*s) using conv_factors: they do not need molar masses for their conversion to PPMs ) and 1472 ! other Species (still expressed in Kg/(m**2*s) at this point) 1473 1474 !> PMs 1475 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1476 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1496 1477 1497 ! kg/(m^2*s) *kg/m^3 kg/(m^2*s) 1498 surf_def_h(0)%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec)* & 1499 ! kg/m^3 1500 rho_air(k) 1501 1502 1503 ELSE 1504 1505 !> VOCs 1506 IF ( len_index_voc .GT. 0 .AND. emt_att%species_name(match_spec_input(ispec))=="VOC" ) THEN 1507 ! ( ppm/s) * m * kg/m^3 mole/(m**2/s) 1508 surf_def_h(0)%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1509 ! m**3/mole ppm 1510 conv_to_ratio(k,j,i)*ratio2ppm * & 1511 ! kg/m^3 1512 rho_air(k) 1513 1514 1515 !> OTHER SPECIES 1478 ! kg/(m^2*s) *kg/m^3 kg/(m^2*s) 1479 surf_def_h(0)%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec)* & 1480 ! kg/m^3 1481 rho_air(nzb) 1482 1483 1516 1484 ELSE 1517 1485 1518 ! ( ppm/s )*m * kg/m^3 kg/(m**2/s) 1519 surf_def_h(0)%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1520 ! mole/Kg 1521 (1/emt_att%xm(ispec))* & 1522 ! m**3/mole ppm 1523 conv_to_ratio(k,j,i)*ratio2ppm* & 1524 ! kg/m^3 1525 rho_air(k) 1526 1486 !> VOCs 1487 IF ( len_index_voc .GT. 0 .AND. emt_att%species_name(match_spec_input(ispec))=="VOC" ) THEN 1488 ! ( ppm/s) * m * kg/m^3 mole/(m^2/s) 1489 surf_def_h(0)%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1490 ! m^3/mole ppm 1491 conv_to_ratio(nzb,j,i)*ratio2ppm * & 1492 ! kg/m^3 1493 rho_air(nzb) 1494 1495 1496 !> OTHER SPECIES 1497 ELSE 1498 1499 ! ( ppm/s )*m * kg/m^3 kg/(m^2/s) 1500 surf_def_h(0)%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1501 ! mole/Kg 1502 (1/emt_att%xm(ispec))* & 1503 ! m^3/mole ppm 1504 conv_to_ratio(nzb,j,i)*ratio2ppm* & 1505 ! kg/m^3 1506 rho_air(nzb) 1507 1508 1509 ENDIF 1527 1510 1528 1511 ENDIF … … 1543 1526 k = surf_lsm_h%k(m) 1544 1527 1545 !> Distinguish between PMs (no needing conversion in ppms), 1546 ! VOC (already converted to moles/(m**2*s) using conv_factors: they do not need molar masses for their conversion to PPMs ) and 1547 ! other Species (still expressed in Kg/(m**2*s) at this point) 1548 1549 !> PMs 1550 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" & 1551 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1552 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1553 1554 ! kg/(m^2*s) * kg/m^3 kg/(m^2*s) 1555 surf_lsm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1556 ! kg/m^3 1557 rho_air(k) 1558 1559 ELSE 1560 1561 !> VOCs 1562 IF ( len_index_voc .GT. 0 .AND. emt_att%species_name(match_spec_input(ispec))=="VOC" ) THEN 1563 ! ( ppm/s) * m * kg/m^3 mole/(m**2/s) 1564 surf_lsm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1565 ! m**3/mole ppm 1566 conv_to_ratio(k,j,i)*ratio2ppm* & 1567 ! kg/m^3 1568 rho_air(k) 1569 1570 1571 !> OTHER SPECIES 1528 IF ( emis_distribution(1,j,i,ispec) > 0.0_wp ) THEN 1529 1530 !> Distinguish between PMs (no needing conversion in ppms), 1531 ! VOC (already converted to moles/(m**2*s) using conv_factors: they do not need molar masses for their conversion to PPMs ) and 1532 ! other Species (still expressed in Kg/(m**2*s) at this point) 1533 1534 !> PMs 1535 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1536 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1537 1538 ! kg/(m^2*s) * kg/m^3 kg/(m^2*s) 1539 surf_lsm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1540 ! kg/m^3 1541 rho_air(k) 1542 1572 1543 ELSE 1573 1544 1574 ! ( ppm/s) * m * kg/m^3 kg/(m**2/s) 1575 surf_lsm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1576 ! mole/Kg 1577 (1/emt_att%xm(ispec))* & 1578 ! m**3/mole ppm 1579 conv_to_ratio(k,j,i)*ratio2ppm* & 1580 ! kg/m^3 1581 rho_air(k) 1545 !> VOCs 1546 IF ( len_index_voc .GT. 0 .AND. emt_att%species_name(match_spec_input(ispec))=="VOC" ) THEN 1547 ! ( ppm/s) * m * kg/m^3 mole/(m^2/s) 1548 surf_lsm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1549 ! m^3/mole ppm 1550 conv_to_ratio(k,j,i)*ratio2ppm* & 1551 ! kg/m^3 1552 rho_air(k) 1553 1554 !> OTHER SPECIES 1555 ELSE 1556 1557 ! ( ppm/s) * m * kg/m^3 kg/(m^2/s) 1558 surf_lsm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1559 ! mole/Kg 1560 (1/emt_att%xm(ispec))* & 1561 ! m^3/mole ppm 1562 conv_to_ratio(k,j,i)*ratio2ppm* & 1563 ! kg/m^3 1564 rho_air(k) 1582 1565 1566 ENDIF 1567 1583 1568 ENDIF 1584 1569 1585 1570 ENDIF 1571 1586 1572 ENDDO 1587 1573 … … 1598 1584 k = surf_usm_h%k(m) 1599 1585 1600 1601 !> PMs 1602 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" & 1603 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1604 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1605 1606 ! kg/(m^2*s) *kg/m^3 kg/(m^2*s) 1607 surf_usm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec)* & 1608 ! kg/m^3 1609 rho_air(k) 1610 1611 1612 ELSE 1613 1614 !> VOCs 1615 IF ( len_index_voc .GT. 0 .AND. emt_att%species_name(match_spec_input(ispec))=="VOC" ) THEN 1616 ! ( ppm/s) * m * kg/m^3 mole/(m**2/s) 1617 surf_usm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1618 ! m**3/mole ppm 1619 conv_to_ratio(k,j,i)*ratio2ppm* & 1620 ! kg/m^3 1586 IF ( emis_distribution(1,j,i,ispec) > 0.0_wp ) THEN 1587 1588 !> PMs 1589 IF (TRIM(spc_names(match_spec_model(ispec)))=="PM1" .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM25" & 1590 .OR. TRIM(spc_names(match_spec_model(ispec)))=="PM10") THEN 1591 1592 ! kg/(m^2*s) *kg/m^3 kg/(m^2*s) 1593 surf_usm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec)* & 1594 ! kg/m^3 1621 1595 rho_air(k) 1622 1596 1623 !> OTHER SPECIES1597 1624 1598 ELSE 1625 1599 1626 1627 ! ( ppm/s) * m * kg/m^3 kg/(m**2/s) 1628 surf_usm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1629 ! mole/Kg 1630 (1/emt_att%xm(ispec))* & 1631 ! m**3/mole ppm 1632 conv_to_ratio(k,j,i)*ratio2ppm* & 1633 ! kg/m^3 1634 rho_air(k) 1635 1600 !> VOCs 1601 IF ( len_index_voc .GT. 0 .AND. emt_att%species_name(match_spec_input(ispec))=="VOC" ) THEN 1602 ! ( ppm/s) * m * kg/m^3 mole/(m^2/s) 1603 surf_usm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1604 ! m^3/mole ppm 1605 conv_to_ratio(k,j,i)*ratio2ppm* & 1606 ! kg/m^3 1607 rho_air(k) 1608 1609 !> OTHER SPECIES 1610 ELSE 1611 1612 1613 ! ( ppm/s) * m * kg/m^3 kg/(m^2/s) 1614 surf_usm_h%cssws(match_spec_model(ispec),m) = emis_distribution(1,j,i,ispec) * & 1615 ! mole/Kg 1616 (1/emt_att%xm(ispec))* & 1617 ! m^3/mole ppm 1618 conv_to_ratio(k,j,i)*ratio2ppm* & 1619 ! kg/m^3 1620 rho_air(k) 1621 1622 1623 ENDIF 1636 1624 1637 1625 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.