metno / pysurfex

Python API to SURFEX. Tool to create offline SURFEX forcing, SURFEX files, running SURFEX and plot results.
10 stars 16 forks source link

Use total_seconds to avoid issues when fcint is over 24 hours in create_forcing #9

Closed joewkr closed 2 years ago

joewkr commented 2 years ago

Originally fcint is converted to a datetime.timedelta object, but then to convert it to the fcint value to seconds a corresponding member of the object is accessed. But when using datetime.timedelta.seconds the returned value is always less than 1 day. Thus, to get a correct conversion to seconds for long fcints the datetime.timedelta.total_seconds function should be used.