source: trunk/SRC/ReadWrite/write_oasis.pro @ 106

Last change on this file since 106 was 106, checked in by pinsard, 18 years ago

start to modify headers of ReadWrite? *.pro files for better idldoc output

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments write an Oasis file (version < 2.5)
7;
8; @param filename {in}{required} the filename
9; @param varname {in}{required} the name of the variable to be written
10; @param z2d {in}{required} the variable (2D array) to be written
11;
12; @keyword /I2 ++ param ou mot clef
13; @keyword /I4
14; @keyword /I8
15; @keyword /R4
16; to change the defaut format (R8) of the data to be written.
17;
18; @keyword /APPEND to open the file with the file pointer at the end of
19;        the file, ready for data to be appended.
20;
21;
22; @restrictions varname is automatically written as a "charactere*8"
23;              by defaut z2d is written as an R8 array
24;
25; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
26;                      July 01, 2002
27;-
28;------------------------------------------------------------
29;------------------------------------------------------------
30;------------------------------------------------------------
31
32
33PRO write_oasis, filename, varname, z2d, I2, I4 = i4, I8 = i8, R4 = r4, APPEND = append
34   openw, unit, filename , /F77_UNFORMATTED, /GET_LUN, /SWAP_IF_LITTLE_ENDIAN $
35    , error=err, APPEND = append
36   if err ne 0 then begin
37      print,!err_string
38      return
39   endif
40   
41   writeu, unit, string(varname, format='(a8)')
42   case 1 of
43      keyword_set(i2):writeu, unit, fix(z2d)
44      keyword_set(i4):writeu, unit, long(z2d)
45      keyword_set(i8):writeu, unit, long64(z2d)
46      keyword_set(r4):writeu, unit, float(z2d)
47      ELSE:writeu, unit, double(z2d)
48   endcase
49
50   free_lun,unit
51   return
52end
Note: See TracBrowser for help on using the repository browser.