[Thread Prev][Thread Next][Index]

Ferret how-to: what "LET" really does




On Aug 24,  6:40pm, Stefan Rahmstorf, IfM Kiel 24-AUG-1995 16:16:15.76 wrote:
> Subject:
> Hi Steve,
>
> thanks for the irregular mask hint - the trick of doing a save/append
> is really clever. Why doesn't ferret allow to overwrite part of a
> variable in memory, without having to put it into a file?
> E.g.  let x[i=1:10,j=4:7,k=1] = 1   ?? That would be simpler.

Hi Stefan,

This question points to a fundamental aspect of Ferret:  The statement
"LET my_variable = expression"    does **not** represent an assignment of
values from the right hand side of the equal sign to the left (as it usually
would in computer code); rather it represents a definition (as it would in
mathematics).  It is because of this that Ferret can deal with a gigabyte-sized
data set as easily as it deals with a kilobyte-sized data set -- the variable
on
the left of the equal sign does not exist as a block of memory.

To achieve the above in a **definition** one could use IF-THEN-ELSE as in

    LET my_variable = IF (i LE 10 AND j GE 4 AND j LE 7) THEN 1 ELSE expression

The technique that I outlined in the Aug. 19 message uses a file on disk
(instead of a block of memory) and the SAVE/APPEND statement to achieve the
style of assignment that you've described above.

	- steve



-- 

		|  NOAA/PMEL               |  ph. (206) 526-6080  
Steve Hankin	|  7600 Sand Point Way NE  |  FAX (206) 526-6744
		|  Seattle, WA 98115-0070  |  hankin@pmel.noaa.gov


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / ERL / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement