[Thread Prev][Thread Next][Index]

Re: [ferret_users] Cancel Data SET problem

Hi Jorge -

Once you have CANCELed the dataset, Ferret has nothing to work with.

I think the confusion may be that Ferret is philosophically different than, say, fortran, where an assignment statement (a=b) does a calculation. In Ferret, assignments (let a=b) do nothing but specify the algorithm to define a variable. Until you do a calculation (plot or list, etc) with that definition, no calculation has been done. Thus when you define "let intermediate_variable=original_variable", and then cancel the dataset that informs Ferret about what original_variable is, Ferret, cannot evaluate intermediate_variable.

If you are having memory problems with a big dataset, two possibilities come to mind:

1. increase the allocated memory (see SET MEMORY in the documentation)
2. work with a smaller subset of the data (SET REGION, or specify a limited region in the definition of intermediate_variable)

If you need the whole region and your machine does not have enough memory, then the calculation may have to be done in several parts.

One implication of Ferret's philosophy of not doing a calculation until asked by plot or list, is to limit repeated redoing of a calculation in the case of very large datasets. (If you are plotting intermediate_variable repeatedly, it may be a good idea to SAVE it and read it back in, thereby doing the calculation only once):

SAVE/file=intermediate_variable.cdf intermediate_variable
CAN VAR intermediate_variable ! very important, so Ferret will not use this algorithm again!
USE intermediate_variable.cdf ! now you can plot intermediate_variable without doing any calculation

Although Ferret will try to avoid this problem by retaining calculated quantities in memory, with large datasets that might not be possible, in which case the writing of an intermediate file as above might be the simplest solution.

Billy K

On Dec 22, 2006, at 5:55 AM, Jorge Urrego Blanco wrote:

Dear all,

In the next script I am trying to cancel the original dataset and use only and intermediate variable dependant on such original dataset. However once the dataset is cancelled, further calculations with the intermediate variable are not longer possible since Ferret tries to use the original dataset again.

use original_dataset (contains original_variable)

let intermediate_variable=original_variable

list original_variable
list intermediate_variable

cancel data_set original_dataset

list intermediate_variable

Ferret does the firt two listings but after cancel original dataset it says:

**ERROR: variable unknown or not in data set ORIGINAL_VARIABLE

Can somebody tell me what is wrong with that? I am trying to free memory in calculations with very big files.

---------------------------------------------------------------------- -------------------------------------------------------------
Zie ook/see also: http://www.knmi.nl/maildisclaimer.html

William S. Kessler
NOAA / Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115 USA

Tel: 206-526-6221
Fax: 206-526-6744
Home page: http://www.pmel.noaa.gov/people/kessler/

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement