Index: palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 4196)
+++ palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 4227)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Replace function date_time_string by call to get_date_time
+! 
+! 4223 2019-09-10 09:20:47Z gronemeier
 ! replaced rotation angle from input-netCDF file
 ! by namelist parameter 'rotation_angle'
@@ -6869,13 +6872,13 @@
         ONLY:  revision, run_date, run_time, run_zone, runnr, version
 
-    USE date_and_time_mod,                                                     &
-       ONLY:   day_of_year_init, time_utc_init
-
     USE netcdf_data_input_mod,                                                 &
         ONLY:  input_file_atts
 
+    USE palm_date_time_mod,                                                    &
+        ONLY:  date_time_str_len, get_date_time
+
     IMPLICIT NONE
 
-    CHARACTER(LEN=23) ::  origin_time_string  !< string containing date and time of origin
+    CHARACTER(LEN=date_time_str_len) ::  origin_time_string  !< string containing date-time of origin
 
     CHARACTER(LEN=*), INTENT(IN)  ::  data_content  !< describes the type of data in file
@@ -6885,6 +6888,6 @@
     INTEGER, INTENT(IN)  ::  ncid      !< file id
 !
-!-- Compose date-time string for origin_time
-    origin_time_string = date_time_string( day_of_year_init, time_utc_init )
+!-- Get date-time string for origin_time
+    CALL get_date_time( 0.0_wp, date_time_str=origin_time_string )
 
 #if defined( __netcdf )
@@ -7242,92 +7245,3 @@
  END SUBROUTINE convert_utm_to_geographic
 
- !------------------------------------------------------------------------------!
- ! Description:
- ! ------------
- !> Compose string containing date and time of format 'YYYY-MM-DD hh:mm:ss ZZZ'
- !> from day_of_year and second_of_day.
- !------------------------------------------------------------------------------!
- FUNCTION date_time_string( day_of_year, second_of_day )
-
-    IMPLICIT NONE
-
-    CHARACTER(LEN=1) ::  plus_minus  !< either '+' or '-'
-
-    CHARACTER(LEN=23) ::  date_time_string  !< string containing date and time
-
-    INTEGER(iwp) ::  day          !< day of month
-    INTEGER(iwp) ::  err          !< error code
-    INTEGER(iwp) ::  i            !< loop index
-    INTEGER(iwp) ::  hour         !< hour of the day
-    INTEGER(iwp) ::  minute       !< minute of the hour
-    INTEGER(iwp) ::  month        !< month of year
-    INTEGER(iwp) ::  year = 2019  !< year (no leap year)
-    INTEGER(iwp) ::  zone = 0     !< time zone
-
-    INTEGER(iwp), INTENT(IN) ::  day_of_year  !< day of year to start with
-
-    INTEGER, DIMENSION(12) :: days_per_month = &  !< total number of days for
-    (/31,28,31,30,31,30,31,31,30,31,30,31/)       !< each month (no leap year)
-
-    REAL(wp) ::  second  !< second of the minute
-
-    REAL(wp), INTENT(IN) ::  second_of_day  !< second of the day
-
-
-    err = 0_iwp
-!
-!-- Check day_of_year
-    IF ( day_of_year < 1_iwp .OR. day_of_year > SUM(days_per_month) )  THEN
-       err = err + 1_iwp
-    ENDIF
-!
-!-- Check second_of_day
-    IF ( second_of_day < 0.0_wp  .OR.  second_of_day > 86400.0_wp )  THEN
-       err = err + 2_iwp
-    ENDIF
-!
-!-- Execute only if given values are valid
-    IF ( err == 0_iwp )  THEN
-
-       day = day_of_year
-       month = 0_iwp
-
-       DO  i = 1, 12
-          day = day - days_per_month(i)
-          IF ( day < 0 )  THEN
-             day = day + days_per_month(i)
-             month = i
-             EXIT
-          ENDIF
-       ENDDO
-
-       hour = INT( second_of_day / 3600.0_wp, KIND=iwp )
-
-       second = second_of_day - 3600.0_wp * REAL( hour, KIND=wp )
-
-       minute =  INT( second / 60.0_wp, KIND=iwp )
-
-       second = second - 60.0_wp * REAL( minute, KIND=wp )
-
-       IF ( zone < 0_iwp )  THEN
-          plus_minus = '-'
-       ELSE
-          plus_minus = '+'
-       ENDIF
-
-       WRITE( date_time_string, 100 )                               &
-          year, month, day, hour, minute, INT( second, KIND=iwp ),  &
-          plus_minus, zone
-
-    ELSE
-!
-!--   Return empty string if input is invalid
-      date_time_string = REPEAT( " ", LEN(date_time_string) )
-
-    ENDIF
-
- 100 FORMAT (I4,'-',I2.2,'-',I2.2,1X,I2.2,':',I2.2,':',I2.2,1X,A1,I2.2)
-
- END FUNCTION date_time_string
-
  END MODULE netcdf_interface
