Opened 15 months ago

Last modified 15 months ago

#193 accepted Defect

Wrong date format in output filename

Reported by: anphi Owned by: pesei
Priority: major Milestone:
Component: FP coding/compilation Version: flexpart_8.2-3
Keywords: caldate Cc:

Description

While using FLEPXARTv8.2.3 I found a wrong date format in some of the output files. I ran FLEXPART in backward mode and mostly the output filenames were named as expected such as

grid_time_20170405000000_001
grid_time_20170402000000_001

However, in some simulations I found problems with the date format during transition of dates so that it shows the hour '24' instead of '00', e.g.

grid_time_20170331240000_001
grid_time_20170401240000_001

This seems to be a bug in function caldate due to rounding errors.

Suggestion for solution:

The hour in caldate should be checked as it is already done for seconds and minutes.

Reproducability

Additionally, it should be checked if this behavior can be reproduced with other FLEXPART versions.

I used ifort and the ECCODES library version 2.6.0 for compilation of FLEXPART with the following setting of FLAGS:

FFLAGS   =  -O3 -mcmodel=medium -unroll -inline -heap-arrays 32 -I$(INCPATH)
LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) -Bstatic -leccodes_f90  -leccodes -Bdynamic -lm -ljasper -openmp

COMMAND file

Relevant parameter of the COMMAND file are:

-1 LDIRECT
20170331 040000
20170405 050000
3600 OUTPUT EVERY
3600 TIME AVERAGE OF OUTPUT
120 SAMPLING RATE OF OUTPUT
999999999 TIME CONSTANT FOR PARTICLE SPLITTING
60 SYNCHRONISATION INTERVAL
1.0 CTL

Change History (2)

comment:1 Changed 15 months ago by pesei

  • Owner set to pesei
  • Status changed from new to accepted

comment:2 Changed 15 months ago by pesei

  • Milestone FLEXPART 10 deleted
  • Priority changed from critical to major

This bug is specific to versions <=8 which use caldate.f rather than caldate.f90. It contains the following lines of code

      MI=INT(1440.*(JULDATE-FLOAT(JULDAY))-60.*FLOAT(HH))
      SS=NINT(86400.*(JULDATE-FLOAT(JULDAY))-3600.*FLOAT(HH))

Note that the products 60.*FLOAT(HH) and 3600.*FLOAT(HH) will be evaluated with single precision only. This is fixed in the newer versions.

A possible fix that we might wish to introduce to older versions would be to replace this by

      MI=INT(1440.*(JULDATE-FLOAT(JULDAY))-60.d0*FLOAT(HH))
      SS=NINT(86400.*(JULDATE-FLOAT(JULDAY))-3600.d0*FLOAT(HH))
Note: See TracTickets for help on using tickets.
hosted by ZAMG