[ncl-talk] ERROR: correlation of principal components (PCs)

Adam Phillips asphilli at ucar.edu
Tue Mar 3 13:36:05 MST 2020


Hi Edwin,
I put a few print/printVarSummary statements into your script:
      ind_store_end:=ind_store_start+92*tres-1
      print(ind_extract_start+" "+ind_extract_end)
      printVarSummary(var)

var_lag(ind_store_start:ind_store_end)=var(y,ind_extract_start:ind_extract_end)

Output:
(0) -20 347

Variable: var
Type: float
Total Size: 182400 bytes
            45600 values
Number of Dimensions: 2
Dimensions and sizes: [evn | 8] x [time | 5700]
Coordinates:
            evn: [1..8]
            time: [396..14050]
Number Of Attributes: 4
  long_name : EOF: Amplitude: Climate Hazards group InfraRed Precipitation
with Stations
  _FillValue : -9999
  matrix : covariance
  ts_mean : ( 1.154463e-10, 5.018545e-10, -3.159135e-10, 5.93204e-10,
-1.381243e-09, -3.113667e-10, -1.764017e-10, -6.856012e-10 )

So your ind_extract_start value is -20, which is outside the valid index
range of (0-5699) as is shown in the output of printVarSummary. My guess as
to the problem is that you are asking for data early on in your record and
you do not have 48 timesteps before your chosen day to calculate your
lead/lag correlation. Outside of that recommendation I am afraid I cannot
offer any further advice.
Good luck,
Adam



On Tue, Mar 3, 2020 at 7:45 AM Edwin Marco via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Dear ncl users,
>
> I was wondering if could help me to find out the source of error I got in plotting
> correlation of principal components (PCs). I have used filtered
> precipitation datasets to calculate and plot eofs and generate associate
> PCs and write them into netcdf file (EOF_my.nc).
>
> Then using the written netcdf file (EOF_my.nc), I am getting error in
> plotting correlation of the PCs.
>
> *fatal: Subscript out of range, error in subscript #1*
>
> *fatal:["Execute.c":8637]:Execute: Error occurred at or near line 98 in
> file plot_correlation.ncl*
>
> I have done a thorough investigation of the script and suspect line 75 to
> be a source of error of line 98, however, I have not been able to solve the
> problem.
>
> *Line 75: *
>
> *ind_mar_1_1981=ind(cd_cal(:,0) .eq. yrs .and. cd_cal(:,1) .eq. mns .and.
> cd_cal(:,2) .eq. 1 .and. cd_cal(:,3) .eq. 0)*
>
>  Please I need your help!!
>
> I attach the script and the eof_my.nc datasets.
>
> Thanks
>
> Edwin
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk



-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200303/e824d954/attachment.html>


More information about the ncl-talk mailing list