Re: NCL - read/write netcdf problem

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Tue Sep 17 2013 - 14:24:58 MDT

Justin,

You probably should do:

begin
     in = addfile("/storage/jbeaudry/WRFV3/test/em_real/folder/wrfout_d01_2011-06-29_00:00:00.nc","w")

ZSU = (/0.5,0.7,0.9,1.2/)

in->ZSU(0, :) =(/ZSU/)
end

as usually WRF variable also have a time dimension,
and here ZSU's dimension is ZSU(time, some-thing), where the size of time could be "1".
So, when you do ncdump, you need to pay attention to its dimension as well.

Wei

huangwei@ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

On Sep 17, 2013, at 1:38 PM, Justin B <justin.beaudry@mail.mcgill.ca> wrote:

> Hi,
>
> I am using the following code snippet
>
> begin
> in = addfile("/storage/jbeaudry/WRFV3/test/em_real/folder/wrfout_d01_2011-06-29_00:00:00.nc","w")
>
> ZSU = (/0.5,0.7,0.9,1.2/)
>
> in->ZSU=(/ZSU/)
> end
>
> When I try to replace the old ZSU values with the new ones I keep getting the error
> fatal:Dimension sizes of left hand side do not match right hand side (the line in->ZSU=(/ZSU/)
>
> I understand the problem but can't get around it. I am certain that the elements/variables are the same, that is ZSU has 4 values as found by ncdump but this code does not work. I've tried it for single value variables, that is only 1 value and it works fine (I confirmed using ncdump before and after running the code)
>
> Any help would be great..
>
> Thank you,
>
> Justin Beaudry
> PhD Student
> McGill University
> _______________________________________________
> 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 Sep 17 14:25:12 2013

This archive was generated by hypermail 2.1.8 : Wed Sep 18 2013 - 17:07:30 MDT