[Thread Prev][Thread Next][Index]

Re: [ferret_users] Writting a sample netcdf file with Julian calendar (unit=days)

Hi Mubashar
You want to define an irregularly-spaced axis, so that the months have the right number of days for each.  This is discussed under the heading "calendar" in the Users Guide,  In the index see, CALENDAR, DEFINE AXIS/CALENDAR.


and particularly, scroll down in that section to the part about using /EDGES to make a true monthly axis. Noted in that same section there is a script that will define a monthly axis in units of days, for the standard Gregorian calendar, the NOLEAP, ALL_LEAP, and 360-day calendars.

yes? go/help def_monthaxis_days

Now, for a Julian calendar, the logic doesn't quite work.  One could think of make February 28.25 days long, but then the months after February would start not at hour 00 but elsewhere.  I suppose there could be a 4-year calendar defined with all of the correct month lengths. 

Can your work possibly use the Gregorian calendar?


On 1/2/2014 5:45 AM, Star Physicist wrote:
Dear Ferret users,

I am trying to create a sample file for temperature and zonal velocity by using Julian calendar with units as days. Follwing script works fine but there is a small issue. I need the increment (delta) in define statement to be exact number of days (Jan=31, Feb=28 or 29 and so on) instead of fixed 31 that I am using currently. Can you please help me to modify my script in order to fulfil the requirement.



!********************************Script to create a dummy netcdf file

define the axes and grids
! temperature axes
define axis/x=130e:80w:2/unit="degrees" xt
define axis/y=20s:20n:2/unit="degrees" yt

! velocity axes (staggered relative to temperature)
define axis/x=131e:79w:2/unit="degrees" xu
define axis/y=19s:21n:2/unit="degrees" yu

! time axis
define axis/t="16-jan-1850:00:00":"16-dec-2013:00:00":31/calendar=julian/unit="days" time
! define the grids
define grid/x=xt/y=yt/t=time gt
define grid/x=xu/y=yu/t=time gu

! define the (dummy) variables
let u = SIN((x[g=gu]+y[g=gu]+t[g=gu])/100)
let temp = SIN((x[g=gt]+y[g=gt]+t[g=gt])/100)
set variable/title="Temperature"/units="centigrade" temp
set variable/title="Zonal Velocity"/units="m/sec" u
! create the template NetCDF file
save/file=template.cdf temp,u

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

Privacy Policy | Disclaimer | Accessibility Statement