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