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

Last change on this file since 200 was 175, checked in by smasson, 18 years ago

merge SAXO and IDL online_help

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