[ncl-talk] Error on relative units conversion, string = day as %Y%m%d.%f

李嘉鹏 lijpbasin at 126.com
Sat Nov 1 20:29:13 MDT 2014


It should be floor, NOT round.

    ymd = floor(time)

Sorry.

于 2014年11月2日 格林尼治标准时间+0800上午10时17分30秒, "李嘉鹏" <lijpbasin at 126.com> 写到:
>Hi, I don't think cd_calendar supports units attribute "day as
>%Y%m%d.%f", see its documentation. Based on your data description, you
>can use
>
>    ymd = round(time, 3)
>
>---
>Regards
>
>于 2014年10月31日 格林尼治标准时间+0800下午11时30分20秒, Thomas Tobian
><thomastobian at gmail.com> 写到:
>>Hallo,
>>
>>Anyone know how to solve the problem with my historical model data,
>>1850 to
>>1875:
>>'
>>      institution : Max-Planck-Institute for Meteorology
>>      CDO : Climate Data Operators version 1.5.9 (
>>http://code.zmaw.de/projects/cdo)
>>   dimensions:
>>      lon = 192
>>      lat = 96
>>      lev = 1
>>      time = 9496  // unlimited
>>   variables:
>>      double lon ( lon )
>>         standard_name :        longitude
>>         long_name :    longitude
>>         units :        degrees_east
>>         axis : X
>>
>>      double lat ( lat )
>>         standard_name :        latitude
>>         long_name :    latitude
>>         units :        degrees_north
>>         axis : Y
>>
>>      double lev ( lev )
>>         standard_name :        air_pressure
>>         long_name :    pressure
>>         units :        Pa
>>         positive :     down
>>         axis : Z
>>
>>      double time ( time )
>>         standard_name :        time
>>         units :        day as %Y%m%d.%f
>>         calendar :     proleptic_gregorian
>>
>>      float var131 ( time, lev, lat, lon )
>>         table :        128
>>         grid_type :    gaussian
>>
>>I got errors once I tried to subset the data using NCL as follows:
>>
>>f1 = addfile ("day_data.1850.to.1875.131.25000.ano.nc","r")
>>ymdStrt  = 18500101
>>ymdLast = 18751231
>>time    = f2->time
>>
>>
>>*ymd     = cd_calendar(time,-2)CDMS error: Error on relative units
>>conversion, string = day as %Y%m%d.%f*
>>
>>
>>*CDMS error: Error on time conversion: invalid month = 3664*
>>;======
>>
>>ncl 9> print(time)
>>
>>
>>Variable: time
>>Type: double
>>Total Size: 75968 bytes
>>            9496 values
>>Number of Dimensions: 1
>>Dimensions and sizes:   [time | 9496]
>>Coordinates:
>>            time: [18500101.75..18751231.75]
>>Number Of Attributes: 3
>>  standard_name :       time
>>  units :       day as %Y%m%d.%f
>>  calendar :    proleptic_gregorian
>>(0)     18500101.75
>>(1)     18500102.75
>>(2)     18500103.75
>>(3)     18500104.75
>>(4)     18500105.75
>>(5)     18500106.75
>>(6)     18500107.75
>>(7)     18500108.75
>>(8)     18500109.75
>>(9)     18500110.75
>>(10)    18500111.75
>>(11)    18500112.75
>>(12)    18500113.75
>>
>>
>>Thank you
>>-- Thomas
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>ncl-talk mailing list
>>List instructions, subscriber options, unsubscribe:
>>http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk




More information about the ncl-talk mailing list