Re: month_to_annual function error

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Jun 25 2010 - 09:02:23 MDT

There is a fix for the 5.2.1 release.

Attached is the 'fix'. It may be implemented as follows:

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "./month_to_annual.ncl"

Good luck
D

On 6/25/10 7:29 AM, siswanto@climate.unibe.ch wrote:
>
>
> Hi all,
>
> I have the same problem with month_to_annual function as well,
> I tried with small test from Marry, and it worked properly. But, with my
> data, it did not work and the message is :
> fatal:mask: dimension sizes of parameter 0 and parameter 1 do not match
> fatal:Execute: Error occurred at or near line 8573 in file
> $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
>
> fatal:Execute: Error occurred at or near line 40 in file
> monthtoyearlySODA.ncl
>
> Here is my code :load
> "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> begin
> ;**********************************************
> ; file handling
> ;**********************************************i
>
> ; test
>
>
> var_raw = random_uniform(0.,2.,(/360,146,196/))
> var_raw!0 = "time"
> var_raw!1 = "lat"
> var_raw!2 = "lon"
> printVarSummary(var_raw)
> var = month_to_annual(var_raw, 1)
> printVarSummary(var)
>
>
> ; data
> a = addfile("/data03/siswanto/dataocn/TEMP_SODA_surface.nc","r") ; monthly
> data
>
>
> temp = a->TEMP(0:479,:,:,:)
> printVarSummary(temp)
> temp!0="TIME1"
> temp!1 = "DEPTH1_1"
> temp!2 = "LAT"
> temp!3 = "LON"
> temp@_FillValue=-999.
>
>
> ; annual analysis
> ;Tem = month_to_annual_weighted(196001, temp, 1)
> Tem = month_to_annual(temp, 1)
> ;Tem!0 = "year"
> ;Tem!1 = "lev"
> ;Tem!2 = "lat"
> ;Tem!3 = "lon"
> printVarSummary(Tem)
> Temp@_FillValue=-999.
> ano=dim_rmvmean_n(Tem,0) ; creating anomaly using NCL function remove
> mean flux
> annsst=dim_avg(dim_avg(ano))
> fout = addfile("TEMP_ySODA.nc","c")
> fout->TEMP = Tem
>
> end
>
> Thanks for any respons.
> Best, Siswanto
>
>
>
>
>> I just tried a ver simple test.
>>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>>
>>> diri = "./"
>>> fili = "camaqua.cam2.h1.1985-09-01-00000.nc"
>>> f = addfile(diri+fili, "r")
>>> x = f->LHFLX(0:23,:,:) ; read 2 years [24 months]
>>> printVarSummary(x)
>>>
>>> xAnn = month_to_annual( x, 0)
>>> printVarSummary(xAnn)
>>>
>>> =========
>>> No problem.
>>> =========
>>> Variable: x
>>> Type: float
>>> Total Size: 786432 bytes
>>> 196608 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes: [time | 24] x [lat | 64] x [lon | 128]
>>> Coordinates:
>>> time: [ 0.. 23]
>>> lat: [-87.86379883923262..87.86379883923262]
>>> lon: [ 0..357.1875]
>>> Number Of Attributes: 3
>>> units : W/m2
>>> long_name : Surface latent heat flux
>>> cell_method : time: mean
>>>
>>>
>>> Variable: xAnn
>>> Type: float
>>> Total Size: 65536 bytes
>>> 16384 values
>>> Number of Dimensions: 3
>>> Dimensions and sizes: [year | 2] x [lat | 64] x [lon | 128]
>>> Coordinates:
>>> lat: [-87.86379883923262..87.86379883923262]
>>> lon: [ 0..357.1875]
>>> Number Of Attributes: 4
>>> cell_method : time: mean
>>> long_name : Surface latent heat flux
>>> units : W/m2
>>> NCL : month_to_annual
>>>
>>>
>>>
>>> On 6/2/10 3:23 PM, Sanjiv Kumar wrote:
>>>> Hello Dennis,
>>>> Below are details:
>>>> printVarSummary( lht_cm20)
>>>> Variable: lht_cm20
>>>> Type: float
>>>> Total Size: 4718592 bytes
>>>> 1179648 values
>>>> Number of Dimensions: 3
>>>> Dimensions and sizes: [time | 144] x [lat | 64] x [lon | 128]
>>>> Coordinates:
>>>> time: [181071..185420]
>>>> lat: [-87.8638..87.8638]
>>>> lon: [ 0..357.1875]
>>>> Number Of Attributes: 5
>>>> long_name : runoff (mean) clm3.5
>>>> units : mm/s
>>>> cell_method : time: mean
>>>> _FillValue : 1e+36
>>>> missing_value : 1e+36
>>>> and
>>>> opt = 0
>>>> thanks
>>>> sanjiv
>>>>
>>>>
>>>> On Wed, Jun 2, 2010 at 4:12 PM, Dennis Shea<shea@ucar.edu
>>>> <mailto:shea@ucar.edu>> wrote:
>>>>
>>>> You must provide more information.
>>>>
>>>> Whenever you get an error like this, it is useful to proceed the
>>>> call with
>>>>
>>>> printVarSummary( data )
>>>>
>>>> tell us what 'opt' you are using.
>>>>
>>>> ann = month_to_annual( data, opt)
>>>>
>>>>
>>>> On 6/2/10 2:05 PM, Sanjiv Kumar wrote:
>>>>
>>>> Hello,
>>>> i am trying to use month_to_annual function to calculate annual
>>>> total
>>>> from monthly data (var(time|:, lat|:, lon|:)), but i am getting
>>>> following error message
>>>> fatal:mask: dimension sizes of parameter 0 and parameter 1 do
>>>> not match
>>>> fatal:Execute: Error occurred at or near line 8537 in file
>>>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
>>>> i have no idea, why i am getting this message..any clue is
>>>> highly
>>>> appreciated.
>>>> thanks
>>>> sanjiv
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>>
>> Siswanto
>> Climate and Environmental Physics siswanto@climate.unibe.ch
>> Physics Institute, University of Bern ph: +41 (0)31 631 48 71
>> Sidlerstrasse 5, 3012 Bern, Switzerland
>>
>>
>
>
> Siswanto
> Climate and Environmental Physics siswanto@climate.unibe.ch
> Physics Institute, University of Bern ph: +41 (0)31 631 48 71
> Sidlerstrasse 5, 3012 Bern, Switzerland
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Jun 25 09:02:28 2010

This archive was generated by hypermail 2.1.8 : Fri Jul 02 2010 - 07:45:13 MDT