Re: FW: monthly lag-lead correlations

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 01 2013 - 12:01:21 MST

Hi Nkese,
The error message is telling you exactly what is wrong:
fatal:Number of subscripts on rhs do not match number of dimensions of
variable,(1) Subscripts used, (3) Subscripts expected
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 99 in
file hadsst3.ncl

Looking at line 99 of your script you have this:
ccr(:,:,nmo((0:mxlag-1)) = ccrmo2(1:mxlag:-1) ; "negative lag", -1
reverses order

Output from your printVarSummary(ccrmo2) call confirms that ccrmo2 is a
3D array:

Variable: ccrmo2
Type: float
Total Size: 187944 bytes
             46986 values
Number of Dimensions: 3
Dimensions and sizes: [82] x [191] x [3]

So I think you want to change line 99 to this:
ccr(:,:,nmo((0:mxlag-1)) = ccrmo2(:,:,1:mxlag:-1) ; "negative lag", -1
reverses order

You will also need to update line 100 to reflect that ccr and ccrmo1 are
also 3D arrays.

Hope that helps. If not, please respond to ncl-talk.
Adam

On 03/01/2013 08:36 AM, Nkese Mc Shine wrote:
>
> ------------------------------------------------------------------------
> *From:* ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] on
> behalf of Nkese Mc Shine [Nkese.McShine@sta.uwi.edu]
> *Sent:* 26 February 2013 11:53
> *To:* ncl-talk@ucar.edu
> *Subject:* [ncl-talk] monthly lag-lead correlations
>
> Dear All,
>
> I would like to perform a monthly lag-lead cross-correlation between
> my sst anomalies and precipitation anomalies. However I am getting the
> error at the end of the page. Attached is my script can someone
> suggest where I went wrong?
>
> Copyright (C) 1995-2012 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.1.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
> Variable: time1
> Type: double
> Total Size: 13344 bytes
> 1668 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 1668]
> Coordinates:
> time: [16383360..17601072]
> Number Of Attributes: 6
> long_name : Time
> bounds : time_bnds
> standard_name : time
> units : hours since 1-1-1 00:00:0.0
> actual_range : ( 16383360, 17601072 )
> delta_t : 0000-00-01 00:00:00
>
> Variable: sstnew
> Type: float
> Total Size: 432345600 bytes
> 108086400 values
> Number of Dimensions: 3
> Dimensions and sizes: [lat | 180] x [lon | 360] x [time | 1668]
> Coordinates:
> lat: [89.5..-89.5]
> lon: [-179.5..179.5]
> time: [187001..200812]
> Number Of Attributes: 10
> description : HadISST 1.1 monthly average sea surface temperature
> actual_range : ( -1.8, 34.76296 )
> missing_value : -1e+30
> _FillValue : -1e+30
> scale_factor : 1
> cell_methods : time: lat: lon: mean
> add_offset : 0
> units : degC
> standard_name : sea_surface_temperature
> long_name : Monthly 1 degree resolution SST
> (0)
> (0) Monthly 1 degree resolution SST: min=-1.8 max=34.763
>
> Variable: sst_region
> Type: float
> Total Size: 45858336 bytes
> 11464584 values
> Number of Dimensions: 3
> Dimensions and sizes: [lat | 82] x [lon | 191] x [time | 732]
> Coordinates:
> lat: [40.5..-40.5]
> lon: [-179.5..10.5]
> time: [194601..200612]
> Number Of Attributes: 10
> long_name : Monthly 1 degree resolution SST
> standard_name : sea_surface_temperature
> units : degC
> add_offset : 0
> cell_methods : time: lat: lon: mean
> scale_factor : 1
> _FillValue : -1e+30
> missing_value : -1e+30
> actual_range : ( -1.8, 34.76296 )
> description : HadISST 1.1 monthly average sea surface temperature
> (0)
> (0) Monthly 1 degree resolution SST: min=1.66987 max=32.8006
>
> Variable: sst_anom
> Type: float
> Total Size: 45858336 bytes
> 11464584 values
> Number of Dimensions: 3
> Dimensions and sizes: [lat | 82] x [lon | 191] x [time | 732]
> Coordinates:
> lat: [40.5..-40.5]
> lon: [-179.5..10.5]
> time: [194601..200612]
> Number Of Attributes: 12
> anomaly_op_ncl : Annual Cycle Removed:function
> rmMonAnnCycLLT:contributed.ncl
> description : HadISST 1.1 monthly average sea surface temperature
> actual_range : ( -1.8, 34.76296 )
> missing_value : -1e+30
> _FillValue : -1e+30
> scale_factor : 1
> cell_methods : time: lat: lon: mean
> add_offset : 0
> units : degC
> standard_name : sea_surface_temperature
> long_name : Monthly 1 degree resolution SST
> reference : function rmMonAnnCycLLT in contrib.ncl
> (0)
> (0) Monthly 1 degree resolution SST: min=-4.30175 max=6.04899
>
> Variable: precipanom_data_ts
> Type: float
> Total Size: 2928 bytes
> 732 values
> Number of Dimensions: 1
> Dimensions and sizes: [732]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 9.96921e+36
> warning:esccr: Non-fatal conditions encountered: all missing or
> constant values
>
> warning:esccr: Non-fatal conditions encountered: all missing or
> constant values
>
> Variable: ccrmo1
> Type: float
> Total Size: 187944 bytes
> 46986 values
> Number of Dimensions: 3
> Dimensions and sizes: [82] x [191] x [3]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : -1e+30
>
> Variable: ccrmo2
> Type: float
> Total Size: 187944 bytes
> 46986 values
> Number of Dimensions: 3
> Dimensions and sizes: [82] x [191] x [3]
> Coordinates:
> Number Of Attributes: 1
> _FillValue : 9.96921e+36
> fatal:Number of subscripts on rhs do not match number of dimensions of
> variable,(1) Subscripts used, (3) Subscripts expected
>
> fatal:["Execute.c":7743]:Execute: Error occurred at or near line 99 in
> file hadsst3.ncl
>
>
> Regards,
> Nkese.
>
>
> CONFIDENTIALITY: This email (including any attachments) may contain
> confidential, proprietary and/or privileged information. Any
> duplication, copying, distribution, dissemination, transmission,
> disclosure or use in any manner of this email (including any
> attachments) without the authorisation of the sender is strictly
> prohibited. If you receive this email (including any attachments) in
> error, please notify the sender and delete this email (including any
> attachments) from your system. Thank you.
>
> CONFIDENTIALITY: This email (including any attachments) may contain
> confidential, proprietary and/or privileged information. Any
> duplication, copying, distribution, dissemination, transmission,
> disclosure or use in any manner of this email (including any
> attachments) without the authorisation of the sender is strictly
> prohibited. If you receive this email (including any attachments) in
> error, please notify the sender and delete this email (including any
> attachments) from your system. Thank you.
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 1 12:01:29 2013

This archive was generated by hypermail 2.1.8 : Thu Mar 07 2013 - 08:55:58 MST