Re: xMon Avg in netcdf

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Nov 29 2011 - 16:02:24 MST

The problem with your nc files is that there is
**no time dimension**.

netcdf ei.oper.an.pl.regn128sc.1990010112 {
dimensions:
        lv_ISBL0 = 37 ;
        g4_lat_1 = 256 ;
        g4_lon_2 = 512 ;
variables:
        float R_GDS4_ISBL(lv_ISBL0, g4_lat_1, g4_lon_2) ;
[snip]

If you used

   %> ncl_convert2nc ec*.grb -itime

then there would a time dimension.

Also, I am not sure why there are no 'lev', 'lat' and 'lon' coordinate
variables. They should always be present.

=======================
ListSetType(f, "join") will result in a place for a time dimension
but there is no time coordinate information.

        f = addfiles( diri+fili, "r")
         ListSetType(f, "join")
         x = f[:]->$var$
         printVarSummary(x) ; <==== look at the output

         xMon = dim_avg_n_Wrap(x, 0)

Later, there is
         xMON!0 = "time"
         xMON&time = x&$x!0$(0) ; assign is day of month

                     ^^^^^^^^^

this wants/needs time coordinate information. There is none.

The only way to get this with the information available is to parse each
of the file names and create a time coordinate.

=============================
Also, the script has

         do year=yrStrt,yrLast
         do nmo=nmoStrt,nmoLast
[snip
         end do ; nmo
         end do ; year

The 'end do' are in the wrong place.

You commented out the correct location at the end.
Why was this done?

     ;end do ; nmo
  ;end do ; year

==================================================================
I have attached a modified version of your script.
I can not spend any more time on this.

Good Luck

On 11/29/2011 11:12 AM, Idowu, Oluseun S. (UMKC-Student) wrote:
> Thanks Dennis. I got that already fixed in the code I was running but I
> mistakenly attached the old code to the email. I used the ListSetFile(f,
> "join") as suggested by Mary and I still got the error
>
> average_op_ncl : dim_avg_n over dimension(s): ncl_join
> fatal:No coordinate variable exists for dimension (ncl_join) in variable
> (x)
> fatal:Execute: Error occurred at or near line 69 in file nc2monavgID_RH.ncl
>
>
>
>
> On 11/29/11 11:58 AM, "Dennis Shea"<shea@ucar.edu> wrote:
>
>> You have in your code
>>
>> addfiles( diri+fili+".grb", "r") ;<<< .grb
>>
>> if the files have been converted to nc and the fili
>> have a .nc extension, then
>>
>> addfiles( diri+fili", "r")
>>
>>
>> On 11/29/2011 10:52 AM, Idowu, Oluseun S. (UMKC-Student) wrote:
>>> addfiles( diri+fili+".grb", "r")
>>
>>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Nov 29 16:02:29 2011

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