Index: palm/trunk/SOURCE/salsa_mod.f90
===================================================================
--- palm/trunk/SOURCE/salsa_mod.f90	(revision 4360)
+++ palm/trunk/SOURCE/salsa_mod.f90	(revision 4364)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Set time coordinate in the input data relative to origin_time rather than to
+! 00:00:00 UTC
+! 
+! 4360 2020-01-07 11:25:50Z suehring
 ! Introduction of wall_flags_total_0, which currently sets bits based on static
 ! topography information used in wall_flags_static_0
@@ -526,5 +530,4 @@
     REAL(wp) ::  ocsv_init = nclim                   !< Init value for semi-volatile organic gases
     REAL(wp) ::  rhlim = 1.20_wp                     !< RH limit in %/100. Prevents unrealistical RH
-    REAL(wp) ::  time_utc_init                       !< time in seconds-of-day of origin_date_time
     REAL(wp) ::  skip_time_do_salsa = 0.0_wp         !< Starting time of SALSA (s)
 !
@@ -8579,7 +8582,4 @@
  SUBROUTINE salsa_emission_update
 
-    USE palm_date_time_mod,                                                                        &
-        ONLY:  get_date_time
-
     IMPLICIT NONE
 
@@ -8587,15 +8587,12 @@
 
        IF ( time_since_reference_point >= skip_time_do_salsa  )  THEN
-!
-!--       Get time_utc_init from origin_date_time
-          CALL get_date_time( 0.0_wp, second_of_day = time_utc_init )
 
           IF ( next_aero_emission_update <=                                                        &
-               MAX( time_since_reference_point, 0.0_wp ) + time_utc_init )  THEN
+               MAX( time_since_reference_point, 0.0_wp ) )  THEN
              CALL salsa_emission_setup( .FALSE. )
           ENDIF
 
           IF ( next_gas_emission_update <=                                                         &
-               MAX( time_since_reference_point, 0.0_wp ) + time_utc_init )  THEN
+               MAX( time_since_reference_point, 0.0_wp ) )  THEN
              IF ( salsa_emission_mode == 'read_from_file'  .AND.  .NOT. salsa_gases_from_chem )    &
              THEN
@@ -9143,12 +9140,8 @@
           ELSEIF ( aero_emission_att%lod == 2 )  THEN
 !
-!--          Get time_utc_init from origin_date_time
-             CALL get_date_time( 0.0_wp, second_of_day = time_utc_init )
-!
-!--          Obtain time index for current point in time. Note, the time coordinate in the input
-!--          file is relative to time_utc_init.
-             aero_emission_att%tind = MINLOC( ABS( aero_emission_att%time - (                      &
-                                                   time_utc_init + MAX( time_since_reference_point,&
-                                                                        0.0_wp) ) ), DIM = 1 ) - 1
+!--          Obtain time index for current point in time.
+             aero_emission_att%tind = MINLOC( ABS( aero_emission_att%time -                        &
+                                                   MAX( time_since_reference_point, 0.0_wp ) ),    &
+                                              DIM = 1 ) - 1
 !
 !--          Allocate the data input array always before reading in the data and deallocate after
@@ -9653,11 +9646,7 @@
     ELSEIF ( lod_gas_emissions == 2 )  THEN
 !
-!--    Get time_utc_init from origin_date_time
-       CALL get_date_time( 0.0_wp, second_of_day = time_utc_init )
-!
-!--    Obtain time index for current point in time. Note, the time coordinate in the input file is
-!--    relative to time_utc_init.
-       chem_emission_att%i_hour = MINLOC( ABS( gas_emission_time - ( time_utc_init +               &
-                                         MAX( time_since_reference_point, 0.0_wp) ) ), DIM = 1 ) - 1
+!--    Obtain time index for current point in time.
+       chem_emission_att%i_hour = MINLOC( ABS( gas_emission_time -                                 &
+                                          MAX( time_since_reference_point, 0.0_wp ) ), DIM = 1 ) - 1
 !
 !--    Allocate the data input array always before reading in the data and deallocate after (NOTE 
@@ -12245,6 +12234,5 @@
 !-- Determine interpolation factor and limit it to 1. This is because t+dt can slightly exceed
 !-- time(tind_p) before boundary data is updated again.
-    fac_dt = ( time_utc_init + time_since_reference_point -                                        &
-               salsa_nest_offl%time(salsa_nest_offl%tind) + dt_3d ) /                              &
+    fac_dt = ( time_since_reference_point - salsa_nest_offl%time(salsa_nest_offl%tind) + dt_3d ) / &
              ( salsa_nest_offl%time(salsa_nest_offl%tind_p) -                                      &
                salsa_nest_offl%time(salsa_nest_offl%tind) )
@@ -12532,7 +12520,4 @@
     nmass_bins = nbins_aerosol * ncomponents_mass
 !
-!-- Get time_utc_init from origin_date_time
-    CALL get_date_time( 0.0_wp, second_of_day = time_utc_init )
-!
 !-- Allocate arrays for reading boundary values. Arrays will incorporate 2 time levels in order to
 !-- interpolate in between.
@@ -12580,6 +12565,5 @@
 !--    input is only required for the 3D simulation, not for the soil/wall spinup. However, as the
 !--    spinup time is added to the end_time, this must be considered here.
-       IF ( end_time - spinup_time >                                           &
-            salsa_nest_offl%time(salsa_nest_offl%nt-1) - time_utc_init )  THEN
+       IF ( end_time - spinup_time > salsa_nest_offl%time(salsa_nest_offl%nt-1) )  THEN
           message_string = 'end_time of the simulation exceeds the time dimension in the dynamic'//&
                            ' input file.'
@@ -12587,6 +12571,6 @@
        ENDIF
 
-       IF ( salsa_nest_offl%time(0) /= time_utc_init )  THEN
-          message_string = 'Offline nesting: time dimension must start at time_utc_init.'
+       IF ( salsa_nest_offl%time(0) /= 0.0_wp )  THEN
+          message_string = 'Offline nesting: time dimension must start at 0.0.'
           CALL message( 'salsa_nesting_offl_init', 'PA0691', 1, 2, 0, 6, 0 )
        ENDIF
@@ -12756,5 +12740,5 @@
 !-- Check if dynamic driver data input is required.
     IF ( salsa_nest_offl%time(salsa_nest_offl%tind_p) <= MAX( time_since_reference_point, 0.0_wp)  &
-         + time_utc_init  .OR.  .NOT.  salsa_nest_offl%init )  THEN
+         .OR.  .NOT.  salsa_nest_offl%init )  THEN
        CONTINUE
 !
@@ -12765,6 +12749,6 @@
 !
 !-- Obtain time index for current point in time.
-    salsa_nest_offl%tind = MINLOC( ABS( salsa_nest_offl%time - ( time_utc_init +                   &
-                                        MAX( time_since_reference_point, 0.0_wp) ) ), DIM = 1 ) - 1
+    salsa_nest_offl%tind = MINLOC( ABS( salsa_nest_offl%time -                                     &
+                                   MAX( time_since_reference_point, 0.0_wp ) ), DIM = 1 ) - 1
     salsa_nest_offl%tind_p = salsa_nest_offl%tind + 1
 !
