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