Accommodation for no-leap calendars
Posted: June 16th, 2020, 4:37 pm
I'm using MeteoInfo to convert netCDF files output by the Community Atmosphere Model, version 4, into ARL format to use with HYSPLIT. The script that I use was based in part on the WRF to ARL script found here: http://meteothink.org/examples/meteoinf ... t2arl.html. However, I noticed that the .gettime() method used to generate timestamps required by .writeindexrec() was not matching up with the actual timestamps in my input netCDF files. CAM uses a no-leap calendar, so February only has 28 days every year, but the timestamp used by MeteoInfo is from python's datetime module, which assumes a proleptic Gregorian calendar, so my data was accumulating errors in the date when writing to ARL. Is there an option to specify the calendar system to MeteoInfo, or does the ARL format itself require a leap year calendar? I tried generating timestamps myself, by converting the netCDF ordinal time to year-month-day-hour format and using that as a timestamp, but HYSPLIT will not read those files because it registers a discontinuity in the time step when going from Feb 28 to Mar 1 because of the missing leap day on some years.