Re: Error in reading variables

From: Tabish Ansari <tabishumaransari_at_nyahnyahspammersnyahnyah>
Date: Sat Apr 19 2014 - 11:48:09 MDT

Dear Dennis,

Thanks for your mail.

I tried the above suggestion. There was no error but there is an issue with
the metadata.

The original ebu_in_co variable in files a1/a2/a3 etc. is of the form:
(Time, z_dim, south_north, west_east) though Time and z_dim have only 1
index.

So the actual size is (1,1,109,99)

When I create a new variable ebu_in_co (4,1,109,99)

I want 4 dimensions for Time and one dimension for z_dim and so on.

However, I am getting 4 dimensions for z_dim and 1 dimension for Time
(which is still called as ncl(0))

See below:
Variable: ebu_in_co
Type: float
Total Size: 172656 bytes
            43164 values
Number of Dimensions: 4
Dimensions and sizes: [emissions_zdim_stag | 4] x [1] x [south_north | 109]
x [west_east | 99]
Coordinates:
Number Of Attributes: 6
  FieldType : 104
  stagger : Z
  units : mole km-2 hr-1
  description : EMISSIONS
  MemoryOrder : XYZ
  _FillValue : 9.96921e+36

On 18 April 2014 18:49, Dennis Shea <shea@ucar.edu> wrote:

> Oops!
>
> ebu_in_co = new ((/4,1,109,99/) , float) ; create array
>
>
> ebu_in_co(0,:,:,:) = a1->ebu_in_co(0,:,:,:) ; assigns values &
> meta data
> ebu_in_co(1,:,:,:) = (/ a2->ebu_in_co(0,:,:,:) /) ; values only
> ebu_in_co(2,:,:,:) = (/ a3->ebu_in_co(0,:,:,:) /)
> ebu_in_co(3,:,:,:) = (/ a4->ebu_in_co(0,:,:,:) /)
>
> printVarSummary(ebu_in_co)
>
> a0->ebu_in_co = ebu_in_co
>
>
>
> On 4/18/14, 7:13 AM, Dennis Shea wrote:
>
>> a0->ebu_in_co = new ((/4,1,109,99/) , float)
>>
>
> a0->ebu_in_co(0,:,:,:) = a1->ebu_in_co(0,:,:,:) ; assigns values &
>> meta data
>> a0->ebu_in_co(1,:,:,:) = (/ a2->ebu_in_co(0,:,:,:) /) ; values only
>> a0->ebu_in_co(2,:,:,:) = (/ a3->ebu_in_co(0,:,:,:) /)
>> a0->ebu_in_co(3,:,:,:) = (/ a4->ebu_in_co(0,:,:,:) /)
>>
>> On 4/18/14, 6:44 AM, Tabish Ansari wrote:
>>
>>> Hello
>>>
>>> I am trying to merge 4 3d arrays from corresponding 4 files into a single
>>> 4d array in a new file.
>>>
>>> My script is:
>>>
>>> begin
>>>
>>> a0 = addfile("./dummy.nc","c")
>>> a1 = addfile("./wrffirechemi_d01_2012-06-30_01:00:00.nc","r")
>>> a2 = addfile("./wrffirechemi_d01_2012-06-30_02:00:00.nc","r")
>>> a3 = addfile("./wrffirechemi_d01_2012-06-30_03:00:00.nc","r")
>>> a4 = addfile("./wrffirechemi_d01_2012-06-30_04:00:00.nc","r")
>>>
>>> a0->ebu_in_co = new ((/4,1,109,99/) , float)
>>> a0->ebu_in_co(0,:,:,:) = a1->ebu_in_co(0,:,:,:)
>>> a0->ebu_in_co(1,:,:,:) = a2->ebu_in_co(0,:,:,:)
>>> a0->ebu_in_co(2,:,:,:) = a3->ebu_in_co(0,:,:,:)
>>> a0->ebu_in_co(3,:,:,:) = a4->ebu_in_co(0,:,:,:)
>>>
>>> end
>>>
>>>
>>> Though the file is getting created, the variable indices names
>>> (attributes)
>>> are not being copied and I am getting the following error:
>>>
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl1), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (1) to (ncl1) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl2), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (2) to (ncl2) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl3), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (3) to (ncl3) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl1), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (1) to (ncl1) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl2), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (2) to (ncl2) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl3), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (3) to (ncl3) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl1), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (1) to (ncl1) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl2), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (2) to (ncl2) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl3), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (3) to (ncl3) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl1), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (1) to (ncl1) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl2), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (2) to (ncl2) for file (dummy)
>>> warning:Dimension names of left hand side and right hand side do not
>>> match,
>>> overwriting dimension (ncl3), use (/ .. /) if this is not the desired
>>> result
>>> ncdimrename: ncid 65536: NetCDF: String match to name in use
>>> fatal:Could not change dimension (3) to (ncl3) for file (dummy)
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> 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
>>
>>

-- 
Thanks & Regards
Tabish Umar Ansari
MS Research Scholar
Environmental & Water Resources Engineering Division
Department of Civil Engineering
IIT Madras

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Apr 19 11:48:28 2014

This archive was generated by hypermail 2.1.8 : Tue Apr 29 2014 - 09:04:20 MDT