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

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

improvements/corrections of some *.pro headers

  • Property svn:keywords set to Id
File size: 1.3 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 Sebastien Masson (smasson\@lodyc.jussieu.fr)
30;                      July 01, 2002
31; @version $Id$
32;-
33;
34PRO write_oasis, filename, varname, z2d, I2 = i2, I4 = i4, I8 = i8, R4 = r4, APPEND = append
35;
36  compile_opt idl2, strictarrsubs
37;
38   openw, unit, filename , /F77_UNFORMATTED, /GET_LUN, /SWAP_IF_LITTLE_ENDIAN $
39    , error=err, APPEND = append
40   if err ne 0 then begin
41      print,!err_string
42      return
43   endif
44   
45   writeu, unit, string(varname, format='(a8)')
46   case 1 of
47      keyword_set(i2):writeu, unit, fix(z2d)
48      keyword_set(i4):writeu, unit, long(z2d)
49      keyword_set(i8):writeu, unit, long64(z2d)
50      keyword_set(r4):writeu, unit, float(z2d)
51      ELSE:writeu, unit, double(z2d)
52   endcase
53
54   free_lun,unit
55   return
56end
Note: See TracBrowser for help on using the repository browser.