[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to find the number of seconds in a timestep




Hi Billy,

How about using the embedded _expression_ `var,return=tunits`? You'd have to do your own conversion from days->seconds or whatever via an IF-ELSE block.

Cheers,
Russ

From: owner-ferret_users@xxxxxxxx <owner-ferret_users@xxxxxxxx> on behalf of William Kessler <william.s.kessler@xxxxxxxx>
Sent: Monday, 2 December 2019 9:20 AM
To: Ferret <ferret_users@xxxxxxxx>
Cc: William S. Kessler <william.s.kessler@xxxxxxxx>
Subject: [ferret_users] How to find the number of seconds in a timestep
 
I'm sure I'm just missing something here ....

I'm reading variables from a netcdf file that has a regular time axis in days (as I know by listing a few timesteps).
I can also see by this listing that the timesteps are 2 hours, but neither the axis unit nor the timestep length is a number I can use (without listing and looking each time).

How can I reliably find the number of seconds in a timestep?
Alternately, how can I find the units of the time axis?

yes? sho axis time
 name       axis              # pts   start                end
 TIME      TIME              7149 r   17-JUL-2012 04:00    04-MAR-2014 20:00
T0 = 01-JAN-1970 00:00:00

let TT = t[gt=u]   ! listing a few TT values shows by eye that the time axis is days, and the timestep 2 hours, but these are not numbers I can use except manually

list TBOX[gt=u]  ! shows that TBOX=1/12 of the time axis unit, but I don't know that unit length except by eye-balling a listing

let TAXIS_UNIT = 1/TT[l=@ddf]   ! length of a time axis unit in seconds (because Ferret takes time derivatives in seconds)
 
let TSEC = TBOX[gt=u] * TAXIS_UNIT   ! this calculation finally tells me the length of a timestep, in seconds

Clearly Ferret knows this information but won't tell me without a calculation. Am I missing something obvious?

It seems that TAXIS_UNIT should be a keyword like TBOX, TBOXLO, TBOXHI. Those are all similar to index units in that they are only meaningful once you know what the geophysical time axis unit is. TAXIS_UNIT (or equivalently TSEC) would make these available for calculations.

And note that my method above fails at the final timestep (because of @ddf). In the present case that doesn't matter because I know that the axis is regular, but if it wasn't I would have a hard time getting this information.

Thanks ... Billy K

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement