[ncl-talk] Multiple_Timeser_annavg_O3CONOX

Rick Brownrigg brownrig at ucar.edu
Thu Jun 9 07:41:32 MDT 2022


Hi,

The problem is just what the error message says; in these lines:

data(0,:) = var_ann_flip(55,:,:)
data(1,:) = var_ann_flip(55,:,:)
data(2,:) = var_ann_flip(55,:,:)

data is [3] x [192]
whereas var_ann_flip is [lev | 56] x [lat | 192] x [lon | 288]

I would speculate that the line that creates data should be something like:

data = new((/3,dimsizes(var_ann_flip&lat),dimsizes(var_ann_flip&lon)
/),float)

Hope that helps...
Rick


On Thu, Jun 9, 2022 at 7:23 AM Najib Yusuf via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Dear NCL experts and colleagues,
>
> I am trying to plot multiple time series annual averages(monthly files) of
> three variables from same files using xy2 example, but I am getting error
> of dimension subscripting, when I tried using only One File it plotted.
> Kindly assist. See attached the script, and below is the VarSummaries. The
> error message is fatal:VarVarWrite: Number of dimensions on left hand
> side does not match right hand side.
>
> data(0,:) = var_ann_flip(55,:,:)
> data(1,:) = var_ann_flip(55,:,:)
> data(2,:) = var_ann_flip(55,:,:)
>
>
> Thank you for your support always
>
>
> Variable: f_all
> Type: string
> Total Size: 96 bytes
>             12 values
> Number of Dimensions: 1
> Dimensions and sizes:   [12]
> Coordinates:
> (0)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-01.nc
> (1)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-02.nc
> (2)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-03.nc
> (3)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-04.nc
> (4)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-05.nc
> (5)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-06.nc
> (6)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-07.nc
> (7)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-08.nc
> (8)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-09.nc
> (9)     /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-10.nc
> (10)    /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-11.nc
> (11)    /glade/work/najiby/f.e20.FCSD/f.e20.FCSD/atm/hist/
> f.e20.FCSD.cam.h0.2013-12.nc
> (0)     1.016496e-05
> (0)     3.577813e-09
>
> Variable: var_ann
> Type: float
> Total Size: 12386304 bytes
>             3096576 values
> Number of Dimensions: 3
> Dimensions and sizes:   [lev | 56] x [lat | 192] x [lon | 288]
> Coordinates:
>             lev: [1.867879997007549..992.5000106104562]
>             lat: [ -90..  90]
>             lon: [   0..358.75]
> Number Of Attributes: 5
>   cell_methods :        time: mean
>   long_name :   O3 concentration
>   units :       mol/mol
>   mdims :       1
>   average_op_ncl :      dim_avg_n over dimension(s): time
>
> Variable: var_ann_flip
> Type: float
> Total Size: 12386304 bytes
>             3096576 values
> Number of Dimensions: 3
> Dimensions and sizes:   [lev | 56] x [lat | 192] x [lon | 288]
> Coordinates:
>             lev: [1.867879997007549..992.5000106104562]
>             lat: [ -90..  90]
>             lon: [-180..178.75]
> Number Of Attributes: 6
>   cell_methods :        time: mean
>   long_name :   O3 concentration
>   units :       mol/mol
>   mdims :       1
>   average_op_ncl :      dim_avg_n over dimension(s): time
>   lonFlip :     longitude coordinate variable has been reordered via
> lonFlip
>
> Variable: data
> Type: float
> Total Size: 2304 bytes
>             576 values
> Number of Dimensions: 2
> Dimensions and sizes:   [3] x [192]
> Coordinates:
> Number Of Attributes: 1
>   _FillValue :  9.96921e+36
> fatal:VarVarWrite: Number of dimensions on left hand side does not match
> right hand side
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 50 in
> file Timeser_annavg_O3CONOX.ncl
>
>
>
> *------------------------------------*
> *Najib Yusuf Galadanci PhD*
> *Assistant Director (R & D)*
>
> *Lower Atmospheric Dynamics(Aerosol radiative forcing, air quality
> observations and modeling)Centre for Atmospheric ResearchNational Space
> Research and Development Agency. Kogi StateUniversity Campus, Anyigba. Kogi
> State. Nigeria+234 80 3871 4158------------------------------------Know
> that Victory comes with Patience, Relief with Affliction, and Ease with
> Hardship.Prophet Muhammad Rasulullah (PBUH) *
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220609/c4e2ec3b/attachment.htm>


More information about the ncl-talk mailing list