[ncl-talk] Multiple_Timeser_annavg_O3CONOX

Najib Yusuf najibgal at yahoo.com
Thu Jun 9 07:55:45 MDT 2022


Hi Rick,
Yes, data = new((/3,dimsizes(var_ann_flip&lat),dimsizes(var_ann_flip&lon) /),float)
data(0,:) = var_ann_flip(55,:,:)
data(1,:) = var_ann_flip(55,:,:)
data(2,:) = var_ann_flip(55,:,:)left hand side is 2 dimension and right side is 3 dimension but the error is:Number of subscripts on left-hand-side do not match number of dimensions of variable: (2),  Subscripts used: (3)
It is not clear to me how I can make left hand side subscripting to 3 because the dimension is 2. Kindly clear my confusion.
Thank you sir


------------------------------------
Najib Yusuf Galadanci PhDAssistant Director (R & D)
Lower Atmospheric Dynamics

(Aerosol radiative forcing, air quality observations and modeling)

Centre for Atmospheric Research

National Space Research and Development Agency. Kogi State

University 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)
 

 

    On Thursday, June 9, 2022, 02:41:44 PM GMT+1, Rick Brownrigg <brownrig at ucar.edu> wrote:  
 
 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: stringTotal Size: 96 bytes            12 valuesNumber of Dimensions: 1Dimensions 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_annType: floatTotal Size: 12386304 bytes            3096576 valuesNumber of Dimensions: 3Dimensions 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_flipType: floatTotal Size: 12386304 bytes            3096576 valuesNumber of Dimensions: 3Dimensions 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: dataType: floatTotal Size: 2304 bytes            576 valuesNumber of Dimensions: 2Dimensions and sizes:   [3] x [192]Coordinates:Number Of Attributes: 1  _FillValue :  9.96921e+36fatal:VarVarWrite: Number of dimensions on left hand side does not match right hand sidefatal:["Execute.c":8637]:Execute: Error occurred at or near line 50 in file Timeser_annavg_O3CONOX.ncl



------------------------------------
Najib Yusuf Galadanci PhDAssistant Director (R & D)
Lower Atmospheric Dynamics

(Aerosol radiative forcing, air quality observations and modeling)

Centre for Atmospheric Research

National Space Research and Development Agency. Kogi State

University 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/16043a7c/attachment.htm>


More information about the ncl-talk mailing list