Time stamp of results in output netcdf file

General questions and postings pertaining to the use of HYSPLIT regardless of the platform. For platform specific questions, use the HYSPLIT Platform forums.
Post Reply
katerina.sindelarova
Posts: 7
Joined: October 7th, 2016, 7:40 am
Registered HYSPLIT User: Yes

Time stamp of results in output netcdf file

Post by katerina.sindelarova »

Hi,

I'm running Hysplit backward simulations. The model successfully produces bin outputs and I convert them to netcdf using conc2cdf. I noticed that in results for runs with 2017 data, the time stamp in output netcdf files is shifted with one day in comparison to my control file. E.g. in run for the period of 2.10.2017 to 23.9.2017 (backward run) I receive results for 1.10.2017 to 22.9.2017 (time variable values 17440 to 17431 [days since 1970-01-01 00:00:00]).

Previously I was running Hysplit with 2011 data and such problem didn't occur.

Could it be an error in calculation of the time stamp in Hysplit (a leap year problem)? Did anyone run into similar problem?

Thank you,
Katerina
ariel.stein
Posts: 653
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes
Contact:

Re: Time stamp of results in output netcdf file

Post by ariel.stein »

Have you switched between different versions ?
We made a change in the date handling back in 2012.
katerina.sindelarova
Posts: 7
Joined: October 7th, 2016, 7:40 am
Registered HYSPLIT User: Yes

Re: Time stamp of results in output netcdf file

Post by katerina.sindelarova »

Hi Ariel, I'm using the February 2015 release.

Do you think it could be only a question of wrong time stamps in the output file, and the actual data correspond to the dates and times as defined in the control file?

Katerina
ariel.stein
Posts: 653
Joined: November 7th, 2012, 3:14 pm
Registered HYSPLIT User: Yes
Contact:

Re: Time stamp of results in output netcdf file

Post by ariel.stein »

Here is the subroutine that calculates the time stamp. For some reason the date is stamped with the date of the day before (-1 day). See line in bold.

SUBROUTINE gettime(Icentury,Iyear,Imonth,Iday,Ihour,Iminute,IC)
!Subroutine to compute days since 1970-1-1 0:0:0 from date and time in file

Implicit None
Integer, Intent(In):: Iday,Imonth,Iyear,Icentury,Ihour,Iminute
Real*8, Intent(Out):: IC
Integer:: dmonth(12) !days in each month
Integer:: k, i
Integer:: IDY, INY, IYN

dmonth(1) = 31
If (Iyear/4*4 .ne. Iyear) Then
dmonth(2) = 28
Else
If (Iyear/400*400 .eq. Iyear) Then
dmonth(2) = 29
Else If (Iyear/100*100 .eq. Iyear) Then
dmonth(2) = 28
Else
dmonth(2) = 29
End If
End If
dmonth(3) = 31
dmonth(4) = 30
dmonth(5) = 31
dmonth(6) = 30
dmonth(7) = 31
dmonth(8) = 31
dmonth(9) = 30
dmonth(10) = 31
dmonth(11) = 30
dmonth(12) = 31
k = 0
Do i = 1, Imonth
k = k + dmonth(I)
End Do
k = k - dmonth(Imonth)
IDY = k + IDay - 1
INY = Iyear + Icentury*100
IYN = INY - 1970
If (IYN .gt. 0) Then
IC = IDY + IYN*365 + (IYN-1)/4 - (IYN-1)/100 + (IYN+299)/400
Else
IC = IDY + IYN*365 + IYN/4 - IYN/100
End If

! Add hours and minutes
IC = IC + (Ihour +(Iminute)/60.)/24.

END SUBROUTINE gettime
katerina.sindelarova
Posts: 7
Joined: October 7th, 2016, 7:40 am
Registered HYSPLIT User: Yes

Re: Time stamp of results in output netcdf file

Post by katerina.sindelarova »

OK, thank you for clarification, Ariel. So the output values do correspond to the dates and times configured in the control file. It is just the time stamp which is shifted and I just need to add one day to it, right?

Thank you,
Katerina
katerina.sindelarova
Posts: 7
Joined: October 7th, 2016, 7:40 am
Registered HYSPLIT User: Yes

Re: Time stamp of results in output netcdf file

Post by katerina.sindelarova »

OK, thank you for clarification, Ariel!

Katerina
Post Reply