[ncl-talk] overwriting 4d array with 3d array values

Tabish Ansari tabishumaransari at gmail.com
Sun Jun 19 15:55:22 MDT 2016


Hi

I am trying to do an assignment operation in the following way:

a1->E_ALD(:,0,:,:)    = E_ALD_00z(:,:,:)

Here the LHS is a 4d array variable that I'm reading from a netcdf file a1.
RHS is another array which is 3d and matches the shape of E_ALD(:,0,:,:)

LHS dimensions are (Time, vert_level, lat, lon)
RHS dimensions are (Time, lat, lon)

I want the LHS array to retain all its attributes including dimension names
etc. but just want to replace the values inside the array.

I am getting the following error:

warning:Dimension names of left hand side and right hand side do not match,
overwriting dimension (Time), use (/ .. /) if this is not the desired result
ncdimrename: ncid 65536: NetCDF: String match to name in use
fatal:Could not change dimension (4) to (Time) for file
(wrfchemi_00z_d01_agri_Oct)
warning:Dimension names of left hand side and right hand side do not match,
overwriting dimension (south_north), 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 (south_north) for file
(wrfchemi_00z_d01_agri_Oct)
warning:Dimension names of left hand side and right hand side do not match,
overwriting dimension (west_east), use (/ .. /) if this is not the desired
result
ncdimrename: ncid 65536: NetCDF: String match to name in use
fatal:Could not change dimension (0) to (west_east) for file
(wrfchemi_00z_d01_agri_Oct)

Please help me get this right.

Many thanks!

Tabish


Tabish U Ansari
PhD student, Lancaster Environment Center
Lancaster Univeristy
Bailrigg, Lancaster,
LA1 4YW, United Kingdom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160619/cd0b6809/attachment.html 


More information about the ncl-talk mailing list