Re: Time dimension & UTC conversion

From: Ditiro Moalafhi <d.moalafhi_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 13 2013 - 23:24:56 MDT

Dear NCL Users

I have joined AIRS Relative humidity daily data for 10 years and over a domain with some interpolations to different pressure levels of interest and below is summary of the final AIRSRH_DT
Variable: f
Type: file
filename: AIRSRH_DT

   file global attributes:
      title : AIRSRH
   dimensions:
      time = 3592
      pnew = 11
      LAT = 3
      LON = 47
   variables:
      float AIRSRH ( time, pnew, LAT, LON )
         _FillValue : -9999
         hdf_name : RelHum_A

      float pnew ( pnew )
         units : mb

      float LAT ( LAT )
         units : degrees_south

      float LON ( LON )
         units : degrees_east

(0) Type of 'LON' is float
(1) Type of 'LAT' is float
(2) Type of 'pnew' is float
(3) Type of 'AIRSRH' is float

I am not sure about the file generated in terms of listed variables since when I proceed to try and change time to UTC i get an error message that list subscripting has been done on a non-list variable as below.I do not understand the "non-list variable" part. Maybe I did not create the time dimension correctly while joining the files.
fatal:List subscripting used on non-list variable, can't continue
fatal:Execute: Error occurred at or near line 7 in file utc3.ncl

Could someone advice. part of the code for conversion to UTC is as below

a= addfile ("/.../AIRSRH_DT.nc","r")
f = a[:]->f
time@units = "hours since 2003-01-01 00:00:0.0"
utc_date = ut_calendar(time, 0)

year = tointeger(utc_date(:,0))
month = tointeger(utc_date(:,1))
day = tointeger(utc_date(:,2))
hour = tointeger(utc_date(:,3))
minute = tointeger(utc_date(:,4))
second = utc_date(:,5)

date_str = sprinti("%0.2iZ ", hour) + sprinti("%0.2i ", day) + \
              month_abbr(month) + " " + sprinti("%0.4i", year)

   print(date_str)
  dymdh = ut_calendar(time, 3)
print(dymdh)

Thank you

Ditiro

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 13 23:25:10 2013

This archive was generated by hypermail 2.1.8 : Mon Sep 16 2013 - 13:43:52 MDT