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

Last change on this file since 238 was 238, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

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