source: trunk/SRC/ForOldVersion/keep_compatibility.pro @ 378

Last change on this file since 378 was 372, checked in by pinsard, 16 years ago

improvements of headers (alignments)

  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1;+
2;
3; @file_comments
4; For internal use of SAXO
5;   1) define key_forgetold = 1b - keyword_set(flag)
6;   2) remove all oldcm_used.pro found in !path
7;   3) define and create myuniquetmpdir and add it to !path
8;   4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro'
9;   5) make sure that the common variables are correctly initialized.
10;   6) merge the online_help if possible...
11;
12; @categories
13; Compatibility
14;
15; @param flag {in}{optional}
16; 1 or 0 to keep or forget the compatibility
17;
18; @uses
19; <pro>cm_general</pro>
20;
21; @examples
22;
23;   IDL> keep_compatibility, 0
24;
25; @history
26; Sebastien Masson (smasson\@lodyc.jussieu.fr)
27;                      June 2005
28;
29; @version
30; $Id$
31;
32;-
33PRO keep_compatibility, flag
34;
35  compile_opt idl2, strictarrsubs
36;
37@cm_general
38;
39  IF n_elements(myuniquetmpdir) NE 0 THEN return
40;
41; version should be at least 6.0
42;
43  IF fix(strmid(!version.release, 0, 1)) LT 6 THEN BEGIN
44    print, '                   *** ***** ***'
45    print, '                   *** ERROR ***'
46    print, '                   *** ***** ***'
47    print, 'This version of SAXO needs at least IDL version 6.0'
48    print, '                   *** ***** ***'
49    print, '                   *** ERROR ***'
50    print, '                   *** ***** ***'
51    return
52  ENDIF
53; are we using the virtual machine??
54  IF n_elements(key_vm) EQ 0 THEN key_vm = lmgr(/vm)
55; are we using gdl or idl??
56  defsysv, '!gdl', exist = key_gdl
57;
58  if n_elements(flag) eq 0 then flag = 1b - keyword_set(key_forgetold)
59; 1) automatic definition of key_forgetold
60  key_forgetold = 1b - keyword_set(flag)
61;
62; 2) remove all oldcm_used.pro found in !path
63  to_rm = find('oldcm_used')
64  IF to_rm[0] NE 'NOT FOUND' THEN file_delete, to_rm
65;
66; 3) define and create myuniquetmpdir and add it to !path
67  def_myuniquetmpdir
68; if we are using the virtual machine, there is no need to do this
69  IF NOT keyword_set(key_vm) THEN BEGIN
70;
71; 4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro'
72; select which file should be copied to oldcm_used.pro
73    IF key_forgetold THEN BEGIN
74      oldcm = find('oldcm_empty')
75      print, 'We forget the compatibility with the old version'
76    ENDIF ELSE BEGIN
77      oldcm = find('oldcm_full')
78      print, 'We keep the compatibility with the old version'
79    ENDELSE
80;
81    oldcm = oldcm[0]
82    IF oldcm EQ 'NOT FOUND' THEN BEGIN
83      print, 'Error: oldcm_full or oldcm_empty must be found in the !path'
84      stop
85    ENDIF
86; copy
87    file_copy, oldcm, myuniquetmpdir + 'oldcm_used.pro', /overwrite
88;
89; make sure we can make the plots even if we are using the demo mode
90;
91    demomode_compatibility
92  ENDIF
93;
94; 5) make sure that the common variables are correctly initialized.
95;
96  IF size(ccmeshparameters, /type) NE 8 THEN BEGIN
97    computegrid, 1, 1, 1, 1, 1, 1, /fullcgrid
98@cm_4data
99    varname = ''
100    vargrid = 'T'
101    vardate = '0'
102    varexp = ''
103    varunit = ''
104    valmask = 1.e20
105  ENDIF
106;
107; 6) merge the online_help if possible...
108;
109  mergeonline_help
110;
111  return
112END
Note: See TracBrowser for help on using the repository browser.