Changeset 4227 for palm/trunk/SOURCE/salsa_mod.f90
- Timestamp:
- Sep 10, 2019 6:04:34 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/salsa_mod.f90
r4226 r4227 26 26 ! ----------------- 27 27 ! $Id$ 28 ! implement new palm_date_time_mod 29 ! 30 ! 4226 2019-09-10 17:03:24Z suehring 28 31 ! Netcdf input routine for dimension length renamed 29 32 ! … … 8385 8388 SUBROUTINE salsa_emission_setup( init ) 8386 8389 8387 USE date_and_time_mod, &8388 ONLY: day_of_month, hour_of_day, index_dd, index_hh, index_mm, month_of_year, &8389 time_default_indices, time_utc_init8390 8391 8390 USE netcdf_data_input_mod, & 8392 8391 ONLY: check_existence, close_input_file, get_attribute, get_variable, & … … 8394 8393 get_dimension_length, open_read_file, street_type_f 8395 8394 8395 USE palm_date_time_mod, & 8396 ONLY: days_per_week, get_date_time, hours_per_day, months_per_year, seconds_per_hour 8397 8396 8398 USE surface_mod, & 8397 8399 ONLY: surf_def_h, surf_lsm_h, surf_usm_h … … 8403 8405 CHARACTER(LEN=25) :: mod_name !< name in the input file 8404 8406 8405 INTEGER(iwp) :: i !< loop index 8406 INTEGER(iwp) :: ib !< loop index: aerosol number bins 8407 INTEGER(iwp) :: ic !< loop index: aerosol chemical components 8408 INTEGER(iwp) :: id_salsa !< NetCDF id of aerosol emission input file 8409 INTEGER(iwp) :: in !< loop index: emission category 8410 INTEGER(iwp) :: inn !< loop index 8411 INTEGER(iwp) :: j !< loop index 8412 INTEGER(iwp) :: ss !< loop index 8407 INTEGER(iwp) :: day_of_month !< day of the month 8408 INTEGER(iwp) :: day_of_week !< day of the week 8409 INTEGER(iwp) :: day_of_year !< day of the year 8410 INTEGER(iwp) :: hour_of_day !< hour of the day 8411 INTEGER(iwp) :: i !< loop index 8412 INTEGER(iwp) :: ib !< loop index: aerosol number bins 8413 INTEGER(iwp) :: ic !< loop index: aerosol chemical components 8414 INTEGER(iwp) :: id_salsa !< NetCDF id of aerosol emission input file 8415 INTEGER(iwp) :: in !< loop index: emission category 8416 INTEGER(iwp) :: index_dd !< index day 8417 INTEGER(iwp) :: index_hh !< index hour 8418 INTEGER(iwp) :: index_mm !< index month 8419 INTEGER(iwp) :: inn !< loop index 8420 INTEGER(iwp) :: j !< loop index 8421 INTEGER(iwp) :: month_of_year !< month of the year 8422 INTEGER(iwp) :: ss !< loop index 8413 8423 8414 8424 INTEGER(iwp), DIMENSION(maxspec) :: cc_i2m !< … … 8417 8427 8418 8428 LOGICAL, INTENT(in) :: init !< if .TRUE. --> initialisation call 8429 8430 REAL(wp) :: second_of_day !< second of the day 8419 8431 8420 8432 REAL(wp), DIMENSION(:), ALLOCATABLE :: nsect_emission !< sectional number emission … … 8662 8674 ! 8663 8675 !-- Next emission update 8664 next_aero_emission_update = MOD( time_utc_init, 3600.0_wp ) - 3600.0_wp 8676 CALL get_date_time( 0.0_wp, second_of_day=second_of_day ) 8677 next_aero_emission_update = MOD( second_of_day, seconds_per_hour ) - seconds_per_hour 8665 8678 ! 8666 8679 !-- Get chemical composition (i.e. mass fraction of different species) in aerosols … … 8818 8831 ! 8819 8832 !-- Get the index of the current hour 8820 CALL time_default_indices( month_of_year, day_of_month, hour_of_day, index_hh ) 8833 CALL get_date_time( time_since_reference_point, & 8834 day_of_year=day_of_year, hour=hour_of_day ) 8835 index_hh = ( day_of_year - 1_iwp ) * hours_per_day + hour_of_day 8821 8836 aero_emission_att%time_factor = aero_emission_att%etf(:,index_hh) 8822 8837 … … 8825 8840 !-- Get the index of current hour (index_hh) (TODO: Now "workday" is always assumed. 8826 8841 !-- Needs to be calculated.) 8827 CALL time_default_indices( daytype, month_of_year, day_of_month, hour_of_day, & 8828 index_mm, index_dd, index_hh ) 8842 CALL get_date_time( time_since_reference_point, & 8843 month=month_of_year, & 8844 day=day_of_month, & 8845 hour=hour_of_day, & 8846 day_of_week=day_of_week ) 8847 index_mm = month_of_year 8848 index_dd = months_per_year + day_of_week 8849 SELECT CASE(TRIM(daytype)) 8850 8851 CASE ("workday") 8852 index_hh = months_per_year + days_per_week + hour_of_day 8853 8854 CASE ("weekend") 8855 index_hh = months_per_year + days_per_week + hours_per_day + hour_of_day 8856 8857 CASE ("holiday") 8858 index_hh = months_per_year + days_per_week + 2*hours_per_day + hour_of_day 8859 8860 END SELECT 8829 8861 aero_emission_att%time_factor = aero_emission_att%etf(:,index_mm) * & 8830 8862 aero_emission_att%etf(:,index_dd) * & … … 9119 9151 SUBROUTINE salsa_gas_emission_setup( init ) 9120 9152 9121 USE date_and_time_mod, &9122 ONLY: day_of_month, hour_of_day, index_dd, index_hh, index_mm, month_of_year, &9123 time_default_indices, time_utc_init9124 9125 9153 USE netcdf_data_input_mod, & 9126 9154 ONLY: check_existence, close_input_file, get_attribute, get_variable, & … … 9128 9156 get_dimension_length, open_read_file 9129 9157 9158 USE palm_date_time_mod, & 9159 ONLY: days_per_week, get_date_time, hours_per_day, months_per_year, seconds_per_hour 9160 9130 9161 USE surface_mod, & 9131 9162 ONLY: surf_def_h, surf_lsm_h, surf_usm_h … … 9138 9169 CHARACTER(LEN=100), DIMENSION(:), ALLOCATABLE :: var_names !< variable names in input data 9139 9170 9171 9172 INTEGER(iwp) :: day_of_month !< day of the month 9173 INTEGER(iwp) :: day_of_week !< day of the week 9174 INTEGER(iwp) :: day_of_year !< day of the year 9175 INTEGER(iwp) :: hour_of_day !< hour of the day 9140 9176 INTEGER(iwp) :: id_chem !< NetCDF id of chemistry emission file 9141 9177 INTEGER(iwp) :: i !< loop index 9142 9178 INTEGER(iwp) :: ig !< loop index 9143 9179 INTEGER(iwp) :: in !< running index for emission categories 9180 INTEGER(iwp) :: index_dd !< index day 9181 INTEGER(iwp) :: index_hh !< index hour 9182 INTEGER(iwp) :: index_mm !< index month 9144 9183 INTEGER(iwp) :: j !< loop index 9184 INTEGER(iwp) :: month_of_year !< month of the year 9145 9185 INTEGER(iwp) :: num_vars !< number of variables 9146 9186 … … 9148 9188 9149 9189 LOGICAL, INTENT(in) :: init !< if .TRUE. --> initialisation call 9190 9191 REAL(wp) :: second_of_day !< second of the day 9150 9192 9151 9193 REAL(wp), DIMENSION(:), ALLOCATABLE :: time_factor !< emission time factor … … 9258 9300 ! 9259 9301 !-- Next emission update 9260 next_gas_emission_update = MOD( time_utc_init, 3600.0_wp ) - 3600.0_wp 9302 CALL get_date_time( time_since_reference_point, second_of_day=second_of_day ) 9303 next_gas_emission_update = MOD( second_of_day, seconds_per_hour ) - seconds_per_hour 9261 9304 ! 9262 9305 !-- Allocate and read surface emission data (in total PM) (NOTE that "preprocessed" input data … … 9303 9346 ! 9304 9347 !-- Get the index of the current hour 9305 CALL time_default_indices( month_of_year, day_of_month, hour_of_day, index_hh ) 9348 CALL get_date_time( time_since_reference_point, & 9349 day_of_year=day_of_year, hour=hour_of_day ) 9350 index_hh = ( day_of_year - 1_iwp ) * hours_per_day + hour_of_day 9306 9351 time_factor = chem_emission_att%hourly_emis_time_factor(:,index_hh) 9307 9352 … … 9310 9355 !-- Get the index of current hour (index_hh) (TODO: Now "workday" is always assumed. 9311 9356 !-- Needs to be calculated.) 9312 CALL time_default_indices( daytype, month_of_year, day_of_month, hour_of_day, & 9313 index_mm, index_dd, index_hh ) 9357 CALL get_date_time( time_since_reference_point, & 9358 month=month_of_year, & 9359 day=day_of_month, & 9360 hour=hour_of_day, & 9361 day_of_week=day_of_week ) 9362 index_mm = month_of_year 9363 index_dd = months_per_year + day_of_week 9364 SELECT CASE(TRIM(daytype)) 9365 9366 CASE ("workday") 9367 index_hh = months_per_year + days_per_week + hour_of_day 9368 9369 CASE ("weekend") 9370 index_hh = months_per_year + days_per_week + hours_per_day + hour_of_day 9371 9372 CASE ("holiday") 9373 index_hh = months_per_year + days_per_week + 2*hours_per_day + hour_of_day 9374 9375 END SELECT 9314 9376 time_factor = chem_emission_att%mdh_emis_time_factor(:,index_mm) * & 9315 9377 chem_emission_att%mdh_emis_time_factor(:,index_dd) * &
Note: See TracChangeset
for help on using the changeset viewer.