<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title><style type="text/css">.felamimail-body-blockquote {margin: 5px 10px 0 3px;padding-left: 10px;border-left: 2px solid #000088;} </style></head><body>Hello<br><br>I am trying to make estimates the number of independent values of a series of correlated
observations using equiv_sample_size based on annual values of my temperature which is below in part of script. However, i keep getting the error:(time) is not a dimension name in variable (t44), could not determine dimension number<br><br>My simple script is below:<br><br><br><br><br>; ==============================================================<br>; Open the file: Read only the user specified period <br>; ==============================================================<br>f= addfile("T2M_Cam5.nc", "r") ;Model Control<br>TIME   = f->time<br>;YYYY   = cd_calendar(TIME,-1)/100                 ; entire file<br>;iYYYY  = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)<br>T41    = f->TREFHT(:,:,:)<br>printVarSummary(T41)                                ; (time, lat,lon)<br>T4    = lonFlip(T41)<br>;printVarSummary(T4)                                ; (time, lat,lon)<br>T4@_FillValue = -9.96921e+36<br>t44 = month_to_annual(T4, 0)                   ;; average over the 0th dim<br>printVarSummary(t44)                                ; (lat,lon)<br>aveX = dim_avg_n_Wrap(t44, 0)                   ;; average over the 0th dim<br>printVarSummary(aveX)                                ; (lat,lon)<br>varX = dim_variance_n_Wrap(t44,0) ; compute variance<br>printVarSummary(varX)                                ; (lat,lon) <br>;================================================================================<br>;equiv_sample_size: Estimates the number of independent values of a series of correlated observations. Specify a critical significance level to test the lag-one auto-correlation coefficient <br>;=================================================================================<br>  sigr = 0.05                        ; critical sig lvl for r<br><br> xEqv = new(dimsizes(aveX),typeof(aveX),aveX@_FillValue)<br>printVarSummary(xEqv)                               ; (lat,lon)<br>  xEqv = equiv_sample_size (t44(lat|:,lon|:,time|:), sigr,0)   <br> copy_VarMeta(aveX,xEqv)<br>printVarSummary(xEqv)                               ; (lat,lon)<br><br>;=================================================================<br>The output of running that is here:<br><br>Variable: T41<br>Type: float<br>Total Size: 403439616 bytes<br>            100859904 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [time | 1824] x [lat | 192] x [lon | 288]<br>Coordinates: <br>            time: [  31..55480]<br>            lat: [ -90..  90]<br>            lon: [   0..358.75]<br>Number Of Attributes: 3<br>  units :    K<br>  long_name :    Reference height temperature<br>  cell_methods :    time: mean<br><br>Variable: t44<br>Type: float<br>Total Size: 33619968 bytes<br>            8404992 values<br>Number of Dimensions: 3<br>Dimensions and sizes:    [year | 152] x [lat | 192] x [lon | 288]<br>Coordinates: <br>            lat: [ -90..  90]<br>            lon: [-180..178.75]<br>Number Of Attributes: 6<br>  _FillValue :    -9.96921e+36<br>  units :    K<br>  long_name :    Reference height temperature<br>  cell_methods :    time: mean<br>  lonFlip :    longitude coordinate variable has been reordered via lonFlip<br>  NCL :    month_to_annual<br><br>Variable: aveX<br>Type: float<br>Total Size: 221184 bytes<br>            55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lat | 192] x [lon | 288]<br>Coordinates: <br>            lat: [ -90..  90]<br>            lon: [-180..178.75]<br>Number Of Attributes: 7<br>  _FillValue :    -9.96921e+36<br>  units :    K<br>  long_name :    Reference height temperature<br>  cell_methods :    time: mean<br>  lonFlip :    longitude coordinate variable has been reordered via lonFlip<br>  NCL :    month_to_annual<br>  average_op_ncl :    dim_avg_n over dimension(s): year<br><br>Variable: varX<br>Type: float<br>Total Size: 221184 bytes<br>            55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lat | 192] x [lon | 288]<br>Coordinates: <br>            lat: [ -90..  90]<br>            lon: [-180..178.75]<br>Number Of Attributes: 7<br>  _FillValue :    -9.96921e+36<br>  units :    K<br>  long_name :    Reference height temperature<br>  cell_methods :    time: mean<br>  lonFlip :    longitude coordinate variable has been reordered via lonFlip<br>  NCL :    month_to_annual<br>  variance_op_ncl :    dim_variance_n over dimension(s): year<br><br>Variable: xEqv<br>Type: float<br>Total Size: 221184 bytes<br>            55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [192] x [288]<br>Coordinates: <br>Number Of Attributes: 1<br>  _FillValue :    -9.96921e+36<br>fatal:(time) is not a dimension name in variable (t44), could not determine dimension number<br>fatal:["Execute.c":8575]:Execute: Error occurred at or near line 35 in file testing_T2M.ncl<br><br><br>Variable: xEqv<br>Type: float<br>Total Size: 221184 bytes<br>            55296 values<br>Number of Dimensions: 2<br>Dimensions and sizes:    [lat | 192] x [lon | 288]<br>Coordinates: <br>            lat: [ -90..  90]<br>            lon: [-180..178.75]<br>Number Of Attributes: 7<br>  average_op_ncl :    dim_avg_n over dimension(s): year<br>  NCL :    month_to_annual<br>  lonFlip :    longitude coordinate variable has been reordered via lonFlip<br>  cell_methods :    time: mean<br>  long_name :    Reference height temperature<br>  units :    K<br>  _FillValue :    -9.96921e+36<br><br>;=========================================================<br>Because, upon using month_to_annual i dont get time dimension nor attributes i cannot perform further analysis as it says i havnt defined time dimension. I have tried to use several methods by defining new varible, as well as VarMeta, VarCoords etc, but it doesnt change the outcome.<br><br>Can someone please advice on how to workaround this issue?<br>The bottom line being i need to use equiv_sample_size on my annual values and i cannot due to time dimension not being defined.<br>Much appreciated <br><br></body></html>