Re: xMon Avg in netcdf

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Nov 29 2011 - 10:07:37 MST

You are reading grib files.
    addfiles( diri+fili+".grb", "r")

In your case each grib file has only
one time step. To force a time dimension in this case you should have

Please change
    setfileoption("nc", "SuppressClose", False)
to
setfileoption("grb", "SuppressClose", False)

On 11/29/11 7:50 AM, Mary Haley wrote:
> Sam,
>
> You need to read your error messages carefully. This one is telling you exactly what the problem is.
>
> On line 68 you have:
>
> xMON&time = x&$x!0$(0) ; assign is day of month
>
> The error is telling you that no coordinate variable exists for the "0"th dimension (leftmost dimension) of the variable "x".
> In this case, you are trying to access a coordinate variable called "lv_ISBL0", which doesn't exist.
>
> It is possible for a variable to have a named dimension, but to not have a coordinate variable of the same name.
>
> You didn't include the output from "printVarSummary(x)", but you probably need to look at this closely
> to make sure you are reading in the variable correctly. It looks like you are expecting a "time" dimension,
> but the leftmost dimension here is actually "lv_ISBL0".
>
> Perhaps you need to read the files in with the "join" mode, instead of "cat" mode, which is the default mode.
>
> In "cat" mode, "addfiles" will simply concatenate each new set of values from a new file, causing the leftmost dimension
> to grow in size. In "join" mode, a new dimension will actually be added, representing the number of files you are
> reading in as the leftmost dimension.
>
> For example, say you have a variable "T" on the file that is dimensioned 10 x 64 x 128 (lev x lat x lon). Further,
> say you have 5 files each with a "T" variable that is 10 x 64 x 128.
>
> If you read in "T" using addfiles in default "cat" mode, you will have a variable of size 50 x 64 x 128.
>
> If you read in "T" using addfiles in "join" mode, you will have a variable of size 5 x 10 x 64 x 128.
>
> To get addfiles to use the join mode, you need to do this right after the call to addfiles:
>
> ListSetType(f, "join")
>
> --Mary
>
> On Nov 29, 2011, at 3:30 AM, Idowu, Oluseun S. (UMKC-Student) wrote:
>
>> Dear Users,
>>
>> I fixed the systemfunc failure issue with this script and I still continue
>> to get the error message below. Please help. Thank you!
>>
>> Sam
>>
>>
>>
>> Variable: xMon
>> Type: float
>> Total Size: 524288 bytes
>> 131072 values
>> Number of Dimensions: 2
>> Dimensions and sizes: [g4_lat_1 | 256] x [g4_lon_2 | 512]
>> Coordinates:
>> Number Of Attributes: 12
>> initial_time : 01/01/1990 (00:00)
>> forecast_time_units : hours
>> forecast_time : 0
>> parameter_number : 157
>> parameter_table_version : 128
>> gds_grid_type : 4
>> level_indicator : 100
>> _FillValue : 1e+20
>> units : %
>> long_name : Relative humidity
>> center : European Center for Medium-Range Weather Forecasts (RSMC)
>> average_op_ncl : dim_avg_n over dimension(s): lv_ISBL0
>> fatal:No coordinate variable exists for dimension (lv_ISBL0) in variable
>> (x)
>> fatal:Execute: Error occurred at or near line 68 in file nc2monavgID_RH.ncl
>>
>> (0) Writing out netcdf
>>
>> Variable: xMON
>> Type: float
>> Total Size: 524288 bytes
>> 131072 values
>> Number of Dimensions: 3
>> Dimensions and sizes: [time | 1] x [g4_lat_1 | 256] x [g4_lon_2 | 512]
>> Coordinates:
>> Number Of Attributes: 1
>> _FillValue : 1e+20
>>
>>
>>
>>
>>>
>>
>> <nc2monavgID_RH.ncl>_______________________________________________
>> 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
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Nov 29 10:07:43 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 30 2011 - 19:52:47 MST