[ncl-talk] computing daily anomalies from a high resolution data
Dennis Shea
shea at ucar.edu
Thu Apr 21 12:13:28 MDT 2022
You will have to experiment to determine how much data you can process.
The variable is type double
*double *CHLIO(TIME, LAT361_472, LON161_408)
so it uses twice the memory.
---------------------------------------------------------
The memory issue is 'machine dependent'
You will have to experiment.
------------------------------------------------------
DEBUG: To test if your code is correct, use only a few spatial locations.
Foe example:
ilat1 = 0
ilat2 = 3
ilon1 = 0
ilon2 = 6
CHLIO = data1->CHLIO(:,ilat1:ilat2,ilon1:ilon2) ; all times and
spatial subset
printVarSummary(CHLIO)
your script
-------------------------------------------------------
You could also experiment with converting double to float
CHLIO = *dble2flt*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/dble2flt.shtml>(
data1->CHLIO(:,ilat1:ilat2,ilon1:ilon2) ) ; all times and spatial subset
printVarSummary(CHLIO)
---------------------------------------------------
You will have to experiment with subsetting the subset you have.
On Thu, Apr 21, 2022 at 8:34 AM saurabh rathore <rohitsrb2020 at gmail.com>
wrote:
> Hello Denis
> G'day
>
> The data I am using is already subsetted for the Indian Ocean (40E-100E
> and 0-28N). Sorry if I am not getting your point.
>
> Cheers, Saurabh
>
> On Thu, Apr 21, 2022 at 3:57 PM Dennis Shea <shea at ucar.edu> wrote:
>
>> Obviously, you have exceeded available memory.
>>
>> You will have to calculate 'geographical subsets' of the anomalies. Then
>> You must always read all the time steps.
>>
>> ilat1 =
>> ilat2 =
>> ilon1 =
>> ilon2 =
>> CHLIO = data1->CHLIO(:,ilat1:ilat2,ilon1:1lon2) ; all times
>> printVarSummary(CHLIO)
>>
>> ===
>> See Example of function *calcDayAnomTLL*
>> <https://www.ncl.ucar.edu/Document/Functions/Contributed/calcDayAnomTLL.shtml>
>>
>> Also, unless you are using a very old version of NCL, you do not need to
>> explicitly 'load' the libraries. The following can be eliminated:
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>
>>
>>
>> On Thu, Apr 21, 2022 at 5:18 AM saurabh rathore via ncl-talk <
>> ncl-talk at mailman.ucar.edu> wrote:
>>
>>> Hello NCL users
>>> G'day
>>>
>>> I am trying to compute the daily anomalies from a high-resolution daily
>>> data as shown below from the ncdump. I am just showing the dimension of the
>>> variable CHLIO.
>>>
>>> dimensions:
>>> LON161_408 = 248 ;
>>> LAT361_472 = 112 ;
>>> TIME = UNLIMITED ; // (8362 currently)
>>> bnds = 2 ;
>>> variables:
>>> double CHLIO(TIME, LAT361_472, LON161_408) ;
>>> CHLIO:missing_value = -1.e+34 ;
>>> CHLIO:_FillValue = -1.e+34 ;
>>>
>>> The ncl code that I am using is below but it gets killed as the memory
>>> gets fulled during the opration.
>>>
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>>>
>>>
>>> data1 = addfile("/media/srathore/Binny5/cmes-oras/chl/
>>> chlio-1998-2020.nc","r")
>>> print(data1)
>>>
>>> ;***********************************************************
>>> ; Read time and create required yyyyddd
>>> ;***********************************************************
>>> time = data1->TIME ; time:units = "hours
>>> since 1-1-1 00:00:0.0"
>>> TIME = cd_calendar(time, 0) ; type float
>>> year = toint( TIME(:,0) )
>>> month = toint( TIME(:,1) )
>>> day = toint( TIME(:,2) )
>>> ddd = day_of_year(year, month, day)
>>> yyyyddd = year*1000 + ddd ; needed for input
>>> print(yyyyddd)
>>>
>>> ;***********************************************************
>>> ; Read data: short2flt
>>> ;***********************************************************
>>> CHLIO = data1->CHLIO
>>> printVarSummary( chl )
>>>
>>> So how to compute the daily anomalies in this case?
>>>
>>> Cheers, Saurabh
>>>
>>> --
>>>
>>>
>>> *REGARDS*
>>>
>>> *Saurabh Rathore*
>>> *Research Scholar (PhD.)*
>>> *Centre For Oceans, Rivers, Atmosphere & Land Science Technology*
>>> *Indian Institute Of Technology, Kharagpur*
>>> *contact :- 91- 8345984434*
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at mailman.ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> --
>
>
> *REGARDS*
>
> *Saurabh Rathore*
> *Research Scholar (PhD.)*
> *Centre For Oceans, Rivers, Atmosphere & Land Science Technology*
> *Indian Institute Of Technology, Kharagpur*
> *contact :- 91- 8345984434*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220421/d9066c16/attachment.html>
More information about the ncl-talk
mailing list