;+ ; ; @file_comments ; For internal use of SAXO ; 1) define key_forgetold = 1b - keyword_set(flag) ; 2) remove all oldcm_used.pro found in !path ; 3) define and create myuniquetmpdir and add it to !path ; 4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro' ; 5) make sure that the common variables are correctly initialized. ; 6) merge the online_help if possible... ; ; @categories ; Compatibility ; ; @param flag {in}{optional} ; 1 or 0 to keep or forget the compatibility ; ; @uses ; cm_general ; ; @examples ; keep_compatibility, 0 ; ; @history ; Sebastien Masson (smasson\@lodyc.jussieu.fr) ; June 2005 ; ; @version ; $Id$ ; ;- PRO keep_compatibility, flag ; compile_opt idl2, strictarrsubs ; @cm_general ; IF n_elements(myuniquetmpdir) NE 0 THEN return ; ; version should be at least 6.0 ; IF fix(strmid(!version.release, 0, 1)) LT 6 THEN BEGIN print, ' *** ***** ***' print, ' *** ERROR ***' print, ' *** ***** ***' print, 'This version of SAXO needs at least IDL version 6.0' print, ' *** ***** ***' print, ' *** ERROR ***' print, ' *** ***** ***' return ENDIF ; are we using the virtual machine?? IF n_elements(key_vm) EQ 0 THEN key_vm = lmgr(/vm) ; are we using gdl or idl?? defsysv, '!gdl', exist = key_gdl ; if n_elements(flag) eq 0 then flag = 1b - keyword_set(key_forgetold) ; 1) automatic definition of key_forgetold key_forgetold = 1b - keyword_set(flag) ; ; 2) remove all oldcm_used.pro found in !path to_rm = find('oldcm_used') IF to_rm[0] NE 'NOT FOUND' THEN file_delete, to_rm ; ; 3) define and create myuniquetmpdir and add it to !path def_myuniquetmpdir ; if we are using the virtual machine, there is no need to do this IF NOT keyword_set(key_vm) THEN BEGIN ; ; 4) copy oldcm_full(_empty) to myuniquetmpdir+'oldcm_used.pro' ; select which file should be copied to oldcm_used.pro IF key_forgetold THEN BEGIN oldcm = find('oldcm_empty') print, 'We forget the compatibility with the old version' ENDIF ELSE BEGIN oldcm = find('oldcm_full') print, 'We keep the compatibility with the old version' ENDELSE ; oldcm = oldcm[0] IF oldcm EQ 'NOT FOUND' THEN BEGIN print, 'Error: oldcm_full or oldcm_empty must be found in the !path' stop ENDIF ; copy file_copy, oldcm, myuniquetmpdir + 'oldcm_used.pro', /overwrite ; ; make sure we can make the plots even if we are using the demo mode ; demomode_compatibility ENDIF ; ; 5) make sure that the common variables are correctly initialized. ; IF size(ccmeshparameters, /type) NE 8 THEN BEGIN computegrid, 1, 1, 1, 1, 1, 1, /fullcgrid @cm_4data varname = '' vargrid = 'T' vardate = '0' varexp = '' varunit = '' valmask = 1.e20 ENDIF ; ; 6) merge the online_help if possible... ; mergeonline_help ; return END