Changeset 11 for trunk/ToBeReviewed


Ignore:
Timestamp:
04/27/06 11:05:35 (18 years ago)
Author:
pinsard
Message:

upgrade of UTILITAIRE/Utilities according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

Location:
trunk/ToBeReviewed/UTILITAIRE
Files:
1 added
14 moved

Legend:

Unmodified
Added
Removed
  • trunk/ToBeReviewed/UTILITAIRE/fitintobox.pro

    r9 r11  
    55; NAME:fitintobox 
    66; 
    7 ; PURPOSE:verifie qu''un tableau correspond bien au domaine 4d 
    8 ; specifie lors du dernier domdef et pat jpt. 
     7; PURPOSE: check that the input array has size and dimensions 
     8; compatible with the domain that was defined with the previous call 
     9; of domdef. 
    910; 
    10 ; CATEGORY:pour les debuts de noumbreux programme (blindage) 
     11; CATEGORY: domain compatibility 
    1112; 
    12 ; CALLING SEQUENCE:res=fitintobox(field) 
     13; CALLING SEQUENCE:  
     14;     res = fitintobox(field[, nx, ny, nz, firstx, firsty, firstz  
     15;                                        ,  lastx,  lasty,  lastz]) 
    1316;  
    14 ; INPUTS:field un tableau ou une structure verifiant les 
    15 ; caracteristiques speficfies ds litchamp.pro 
     17; INPUTS: 
     18;     field: an array or a structure that can be read by the function 
     19;     litchamp.pro 
     20;  
     21;     nx, ny, nz, firstx, firsty, firstz,  lastx,  lasty,  lastz: 
     22;     optional parameters. If not given they will be define with a 
     23;     call to the procedure grille.pro 
     24;      
     25; KEYWORD PARAMETERS: none 
    1626; 
    17 ; KEYWORD PARAMETERS: 
     27; OUTPUTS: an array with dimensions matching the domain 
     28;          or -1 if there is an error... 
    1829; 
    19 ; OUTPUTS:un tableau a la taille du domaine 4d. 
    20 ; 
    21 ; COMMON BLOCKS:common.pro 
     30; COMMON BLOCKS: cm_4mesh and cm_4cal 
    2231; 
    2332; SIDE EFFECTS: 
    2433; 
    25 ; RESTRICTIONS:utilise pour se reperer dans l''espace les variables 
    26 ; globales jpi,jpj,jpk,premier...,dernier...,nx...,ny...,nz,... 
    27 ; pour differencier un tableau 3d xyz d''un tableau 3d xyt, on utilise 
    28 ; jpt qui doit etre egale a 1 ds le cas xyz et different de 1 dans 
    29 ; l''autre cas. 
     34; RESTRICTIONS: 
    3035; 
    3136; EXAMPLE: 
    3237; 
     38;   IDL> help, fitintobox(findgen(jpi,jpj)) 
     39;   <Expression>    FLOAT     = Array[41, 3] 
     40;   IDL> help, fitintobox(findgen(jpi,jpj,78)) 
     41;   Error:  
     42;   the array dimensions [180,148,78] are incompatible 
     43;   with the the domain dimensions  
     44;   [jpi/nx, jpj/ny, jpk/nz, jpt] = [180/41, 148/3, 31/31, 1] 
     45;   <Expression>    INT       =       -1 
     46; 
    3347; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3448;                     10 juin 2000. 
     49; June 2005: S. Masson rewrite all. 
    3550;- 
    3651;------------------------------------------------------------ 
    3752;------------------------------------------------------------ 
    3853;------------------------------------------------------------ 
    39 FUNCTION fitintobox, field 
    40 @common 
     54FUNCTION err_mess, sz, jpi, nx, jpj, ny, jpk, nz, jpt 
     55  IF n_elements(sz EQ 1) THEN $ 
     56    RETURN, report(['Error: ' $ 
     57                  , 'the vector size (' + tostr(sz) + ') is incompatible' $ 
     58                  , 'with the the domain dimensions ' $ 
     59                  , '[jpi/nx, jpj/ny, jpk/nz, jpt] = [' $ 
     60                  + strtrim(jpi, 1) + '/' + strtrim(nx, 1) $ 
     61                  + ', ' + strtrim(jpj, 1) + '/' + strtrim(ny, 1) $ 
     62                  + ', ' + strtrim(jpk, 1) + '/' + strtrim(nz, 1) $ 
     63                  + ', ' + strtrim(jpt, 1) + ']'], /simple) 
     64  RETURN, report(['Error: ' $ 
     65                  , 'the array dimensions ' + tostr(sz) + ' are incompatible' $ 
     66                  , 'with the the domain dimensions ' $ 
     67                  , '[jpi/nx, jpj/ny, jpk/nz, jpt] = [' $ 
     68                  + strtrim(jpi, 1) + '/' + strtrim(nx, 1) $ 
     69                  + ', ' + strtrim(jpj, 1) + '/' + strtrim(ny, 1) $ 
     70                  + ', ' + strtrim(jpk, 1) + '/' + strtrim(nz, 1) $ 
     71                  + ', ' + strtrim(jpt, 1) + ']'], /simple) 
     72END 
     73;------------------------------------------------------------ 
     74FUNCTION fitintobox, field, nx, ny, nz, firstx, firsty $ 
     75                     , firstz, lastx, lasty, lastz, WDEPTH = wdepth 
     76;------------------------------------------------------------ 
     77; include commons 
     78@cm_4mesh 
     79@cm_4cal 
     80  IF NOT keyword_set(key_forgetold) THEN BEGIN 
     81@updatenew 
     82  ENDIF 
    4183;--------------------- 
    42    array = litchamp(field) 
    43    grille, mask, glam, gphi, gdep, nx, ny,nz,premierx,premiery,premierz,dernierx, derniery, dernierz 
     84  arr = litchamp(field) 
     85  IF n_params() EQ 1 THEN grille, -1, -1, -1, -1, nx, ny, nz $ 
     86    , firstx, firsty, firstz, lastx, lasty, lastz, WDEPTH = wdepth 
     87;-------------------------------------------------------------- 
     88;-------------------------------------------------------------- 
     89; case according the number of dimensions of the array 
     90;-------------------------------------------------------------- 
     91;-------------------------------------------------------------- 
     92  sz = size(arr) 
     93  case sz[0] of 
     94;-------------------------------------------------------------- 
     95    0:BEGIN                     ; scalar 
     96;-------------------------------------------------------------- 
     97      return, report('Error: scalar value = ' + strtrim(arr, 1), /simple) 
     98    END 
     99;-------------------------------------------------------------- 
     100    1:BEGIN                     ; 1D arrays 
     101;-------------------------------------------------------------- 
     102      CASE 1 OF 
     103; x arrays 
     104        sz[1] EQ jpi                                                   :arr = (temporary(arr))[firstx:lastx                               ]  
     105        sz[1] EQ  nx                                                   :                                                       
     106; y arrays 
     107        sz[1] EQ jpj                                                   :arr = (temporary(arr))[              firsty:lasty                 ]  
     108        sz[1] EQ  ny                                                   :                                                       
     109; z arrays 
     110        sz[1] EQ jpk                                                   :arr = (temporary(arr))[                            firstz:lastz   ]  
     111        sz[1] EQ  nz                                                   :                                                       
     112; t arrays 
     113        sz[1] EQ jpt                                                   : 
     114        ELSE:return, err_mess(sz[1], jpi, nx, jpj, ny, jpk, nz, jpt)  
     115      ENDCASE 
     116    END 
     117;-------------------------------------------------------------- 
     118    2:BEGIN                     ; 2D arrays 
     119;-------------------------------------------------------------- 
     120      CASE 1 OF 
     121; xy arrays 
     122        sz[1] EQ jpi AND sz[2] EQ jpj                                  :arr = (temporary(arr))[firstx:lastx, firsty:lasty                 ]  
     123        sz[1] EQ jpi AND sz[2] EQ  ny                                  :arr = (temporary(arr))[firstx:lastx,            *                 ] 
     124        sz[1] EQ  nx AND sz[2] EQ jpj                                  :arr = (temporary(arr))[           *, firsty:lasty                 ] 
     125        sz[1] EQ  nx AND sz[2] EQ  ny                                  :arr = (temporary(arr))[           *,            *                 ] 
     126; x(y)z arrays 
     127        sz[1] EQ jpi AND ny EQ 1      AND sz[2] EQ jpk                 :arr = (temporary(arr))[firstx:lastx, firstz:lastz   ]  
     128        sz[1] EQ jpi AND ny EQ 1      AND sz[2] EQ  nz                 :arr = (temporary(arr))[firstx:lastx,            *   ] 
     129        sz[1] EQ  nx AND ny EQ 1      AND sz[2] EQ jpk                 :arr = (temporary(arr))[           *, firstz:lastz   ] 
     130        sz[1] EQ  nx AND ny EQ 1      AND sz[2] EQ  nz                 : 
     131; (x)yz arrays 
     132        nx EQ 1      AND sz[1] EQ jpj AND sz[2] EQ jpk                 :arr = (temporary(arr))[              firsty:lasty, firstz:lastz   ]  
     133        nx EQ 1      AND sz[1] EQ jpj AND sz[2] EQ  nz                 :arr = (temporary(arr))[              firsty:lasty,            *   ] 
     134        nx EQ 1      AND sz[1] EQ  ny AND sz[2] EQ jpk                 :arr = (temporary(arr))[                         *, firstz:lastz   ] 
     135        nx EQ 1      AND sz[1] EQ  ny AND sz[2] EQ  nz                 : 
     136; xt arrays 
     137        sz[1] EQ jpi                                   AND sz[2] EQ jpt:arr = (temporary(arr))[firstx:lastx                            , *]  
     138        sz[1] EQ  nx                                   AND sz[2] EQ jpt: 
     139; yt arrays 
     140                         sz[1] EQ jpj                  AND sz[2] EQ jpt:arr = (temporary(arr))[              firsty:lasty              , *] 
     141                         sz[1] EQ  ny                  AND sz[2] EQ jpt: 
     142; zt arrays 
     143                                          sz[1] EQ jpk AND sz[2] EQ jpt:arr = (temporary(arr))[                            firstz:lastz, *]  
     144                                          sz[1] EQ  nz AND sz[2] EQ jpt: 
     145        ELSE:return, err_mess(sz[1:2], jpi, nx, jpj, ny, jpk, nz, jpt) 
     146      ENDCASE 
     147    END 
     148;-------------------------------------------------------------- 
     149    3:BEGIN                     ; 3D arrays 
     150;-------------------------------------------------------------- 
     151      CASE 1 OF 
     152; xyz arrays 
     153        sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpk                 :arr = (temporary(arr))[firstx:lastx, firsty:lasty, firstz:lastz   ]  
     154        sz[1] EQ jpi AND sz[2] EQ  ny AND sz[3] EQ jpk                 :arr = (temporary(arr))[firstx:lastx,            *, firstz:lastz   ] 
     155        sz[1] EQ  nx AND sz[2] EQ jpj AND sz[3] EQ jpk                 :arr = (temporary(arr))[           *, firsty:lasty, firstz:lastz   ] 
     156        sz[1] EQ  nx AND sz[2] EQ  ny AND sz[3] EQ jpk                 :arr = (temporary(arr))[           *,            *, firstz:lastz   ] 
     157        sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ  nz                 :arr = (temporary(arr))[firstx:lastx, firsty:lasty,            *   ]  
     158        sz[1] EQ jpi AND sz[2] EQ  ny AND sz[3] EQ  nz                 :arr = (temporary(arr))[firstx:lastx,            *,            *   ] 
     159        sz[1] EQ  nx AND sz[2] EQ jpj AND sz[3] EQ  nz                 :arr = (temporary(arr))[           *, firsty:lasty,            *   ] 
     160        sz[1] EQ  nx AND sz[2] EQ  ny AND sz[3] EQ  nz                 : 
     161; xyt arrays 
     162        sz[1] EQ jpi AND sz[2] EQ jpj                  AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty,               *]  
     163        sz[1] EQ jpi AND sz[2] EQ  ny                  AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx,            *,               *] 
     164        sz[1] EQ  nx AND sz[2] EQ jpj                  AND sz[3] EQ jpt:arr = (temporary(arr))[           *, firsty:lasty,               *] 
     165        sz[1] EQ  nx AND sz[2] EQ  ny                  AND sz[3] EQ jpt: 
     166; (x)yzt arrays 
     167        nx EQ 1      AND sz[1] EQ jpj AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[              firsty:lasty, firstz:lastz, *]  
     168        nx EQ 1      AND sz[1] EQ jpj AND sz[2] EQ  nz AND sz[3] EQ jpt:arr = (temporary(arr))[              firsty:lasty,            *, *] 
     169        nx EQ 1      AND sz[1] EQ  ny AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[                         *, firstz:lastz, *] 
     170        nx EQ 1      AND sz[1] EQ  ny AND sz[2] EQ  nz AND sz[3] EQ jpt: 
     171; x(y)zt arrays 
     172        sz[1] EQ jpi AND ny EQ 1      AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx,               firstz:lastz, *]  
     173        sz[1] EQ jpi AND ny EQ 1      AND sz[2] EQ  nz AND sz[3] EQ jpt:arr = (temporary(arr))[firstx:lastx,                          *, *] 
     174        sz[1] EQ  nx AND ny EQ 1      AND sz[2] EQ jpk AND sz[3] EQ jpt:arr = (temporary(arr))[           *,               firstz:lastz, *] 
     175        sz[1] EQ  nx AND ny EQ 1      AND sz[2] EQ  nz AND sz[3] EQ jpt: 
     176        ELSE:return, err_mess(sz[1:3], jpi, nx, jpj, ny, jpk, nz, jpt) 
     177      ENDCASE 
     178    END 
     179;-------------------------------------------------------------- 
     180    4:BEGIN                     ; 4D arrays 
     181;-------------------------------------------------------------- 
     182      CASE 1 OF 
     183; xyzt arrays 
     184        sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty, firstz:lastz, *]  
     185        sz[1] EQ jpi AND sz[2] EQ  ny AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx,            *, firstz:lastz, *] 
     186        sz[1] EQ  nx AND sz[2] EQ jpj AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[           *, firsty:lasty, firstz:lastz, *] 
     187        sz[1] EQ  nx AND sz[2] EQ  ny AND sz[3] EQ jpk AND sz[4] EQ jpt:arr = (temporary(arr))[           *,            *, firstz:lastz, *] 
     188        sz[1] EQ jpi AND sz[2] EQ jpj AND sz[3] EQ  nz AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx, firsty:lasty,            *, *]  
     189        sz[1] EQ jpi AND sz[2] EQ  ny AND sz[3] EQ  nz AND sz[4] EQ jpt:arr = (temporary(arr))[firstx:lastx,            *,            *, *] 
     190        sz[1] EQ  nx AND sz[2] EQ jpj AND sz[3] EQ  nz AND sz[4] EQ jpt:arr = (temporary(arr))[           *, firsty:lasty,            *, *] 
     191        sz[1] EQ  nx AND sz[2] EQ  ny AND sz[3] EQ  nz AND sz[4] EQ jpt: 
     192        ELSE:return, err_mess(sz[1:4], jpi, nx, jpj, ny, jpk, nz, jpt) 
     193      ENDCASE 
     194    END 
     195    ELSE:return, report('Error: fitintobox is managing arrays with a maximum of 4 dimensions', /simple) 
     196  ENDCASE 
    44197 
    45 ;--------------------- 
    46    taille=size(array) 
    47    case 1 of 
    48 ;---------------------------------------------------------------------------- 
    49 ;xy 
    50 ;---------------------------------------------------------------------------- 
    51       taille[0] EQ 2:BEGIN 
    52          case 1 of 
    53             taille[1] eq  nx and taille[2] eq  ny: 
    54             taille[1] eq jpi and taille[2] eq jpj:array=array[premierx:dernierx, premiery:derniery] 
    55             else:return, report('Probleme d''adequation entre les tailles !C du domaine nx*ny '+strtrim(nx, 1)+'*'+strtrim(ny, 1)+' !C et du tableau '+strtrim(taille[1], 1)+'*'+strtrim(taille[2], 1)) 
    56          endcase 
    57       END 
    58 ;---------------------------------------------------------------------------- 
    59 ;xyz 
    60 ;---------------------------------------------------------------------------- 
    61       taille[0] EQ 3 AND jpt EQ 1:BEGIN 
    62          case 1 of 
    63             taille[1] eq  nx and taille[2] eq  ny and taille[3] eq  nz: 
    64             taille[1] eq  nx and taille[2] eq  ny and taille[3] eq  jpk: $ 
    65              array=array[*, *, premierz:dernierz] 
    66             taille[1] eq jpi and taille[2] eq jpj and taille[3] eq  jpk: $ 
    67              array=array[premierx:dernierx, premiery:derniery, premierz:dernierz] 
    68             taille[1] eq nx and taille[2] eq ny and taille[3] eq  jpk: $ 
    69              array=array[premierx:dernierx, premiery:derniery, *] 
    70             else:return, report('Probleme d''adequation entre les tailles !C du domaine nx*ny*nz '+strtrim(nx, 1)+'*'+strtrim(ny, 1)+'*'+strtrim(nz, 1)+' !C et du tableau '+strtrim(taille[1], 1)+'*'+strtrim(taille[2], 1)+'*'+strtrim(taille[3], 1)) 
    71          endcase 
    72       END 
    73 ;---------------------------------------------------------------------------- 
    74 ;xyt 
    75 ;---------------------------------------------------------------------------- 
    76       taille[0] EQ 3 AND jpt NE 1:BEGIN 
    77          case 1 of 
    78             taille[1] eq  nx and taille[2] eq  ny AND taille[3] eq jpt: 
    79             taille[1] eq jpi and taille[2] eq jpj AND taille[3] eq jpt:array=array[premierx:dernierx, premiery:derniery, *] 
    80             else:return, report('Probleme d''adequation entre les tailles !C du domaine nx*ny*jpt '+strtrim(nx, 1)+'*'+strtrim(ny, 1)+'*'+strtrim(jpt, 1)+'!C et du tableau '+strtrim(taille[1], 1)+'*'+strtrim(taille[2], 1)+'*'+strtrim(taille[3], 1)) 
    81          endcase 
    82       END 
    83 ;---------------------------------------------------------------------------- 
    84 ;xyzt 
    85 ;---------------------------------------------------------------------------- 
    86       taille[0] EQ 4:BEGIN 
    87          case 1 of 
    88             taille[1] eq  nx and taille[2] eq  ny and taille[3] eq  nz AND taille[4] eq jpt: 
    89             taille[1] eq  nx and taille[2] eq  ny and taille[3] eq  jpk AND taille[4] eq jpt: $ 
    90              array=array[*, *, premierz:dernierz, *] 
    91             taille[1] eq jpi and taille[2] eq jpj and taille[3] eq  jpk AND taille[4] eq jpt: $ 
    92              array=array[premierx:dernierx, premiery:derniery, premierz:dernierz, *] 
    93             taille[1] eq nx and taille[2] eq ny and taille[3] eq  jpk AND taille[4] eq jpt: $ 
    94              array=array[premierx:dernierx, premiery:derniery, *, *] 
    95             else:return, report('Probleme d''adequation entre les tailles  !C du domainenx*ny*nz*jpt '+strtrim(nx, 1)+'*'+strtrim(ny, 1)+'*'+strtrim(nz, 1)+'*'+strtrim(jpt, 1)+' !C et du tableau '+strtrim(taille[1], 1)+'*'+strtrim(taille[2], 1)+'*'+strtrim(taille[3], 1)+'*'+strtrim(taille[4], 1)) 
    96          endcase 
    97       END 
    98    endcase 
    99 ;---------------------------------------------------------------------------- 
    100  
    101  
    102    return, array 
     198  return, arr 
    103199end 
  • trunk/ToBeReviewed/UTILITAIRE/oups.pro

    r9 r11  
    3232 journal 
    3333; on recupere le journal sous la forme d''un vecteur de string: 
    34    vectjournal = getfile(homedir+'idlsave.pro') 
     34   vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    3535; on coupe la derniere ligne qui est oups 
    3636   vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
     
    6868 ELSE vectjournal[n_elements(vectjournal)-1] = ''  
    6969; on reecrit idlsave.pro 
    70 putfile, homedir+'idlsave.pro', vectjournal 
     70putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    7171; on compile puis applique idlsave 
    72 cd, homedir 
     72cd,  current = curdir 
     73cd, myuniquetmpdir 
    7374@idlsave    
     75cd, curdir 
    7476; le journal vient d'etre reouvert, et on y met les elements de 
    7577; vectjournal  
    7678for i = 0, n_elements(vectjournal)-1 DO $ 
    77 printf, !journal, vectjournal[i] 
     79journal, vectjournal[i] 
    7880       
    7981 
  • trunk/ToBeReviewed/UTILITAIRE/report.pro

    r9 r11  
    1818; array element is displayed as a separate line of text. 
    1919; 
    20 ; KEYWORD PARAMETERS: ceux dialog_message.pro et message.pro avec en + 
     20; KEYWORD PARAMETERS:  
     21;         SIMPLE: activate to print only the message without the name 
     22;             and the line of the routine (defined by calling routine_name) 
     23; 
     24; ceux dialog_message.pro et message.pro avec en + 
    2125; PARENT qui fait la meme chose que DIALOG_PARENT de dialog_message.pro 
    2226; 
     
    5559;------------------------------------------------------------ 
    5660;------------------------------------------------------------ 
    57 FUNCTION report, text, DEFAULT_NO = default_no, PARENT = parent, QUESTION = question, _extra = ex 
     61FUNCTION report, text, DEFAULT_NO = default_no, PARENT = parent, QUESTION = question, SIMPLE = simple, _extra = ex 
    5862   res = -1                     ; 
    59 ; on separe le text en differentes lignes (separees par !C) si ce 
     63; on separe le texte en differentes lignes (separees par !C) si ce 
    6064; n''est pas deja fait... 
    6165   if n_elements(text) EQ 1 then text = str_sep(text, '!C', /trim) 
     
    8993      endif ELSE BEGIN 
    9094; si on ne pose pas de question on fait juste un print 
     95        IF keyword_set(simple) THEN prefix = '' ELSE prefix = '% '+routine_name(1)+': ' 
    9196         if n_elements(text) GT 1 THEN $ 
    92           for i = 0, n_elements(text)-2 do print,'% '+routine_name(1)+': '+text[i]  
    93          print, '% '+routine_name(1)+': '+text[n_elements(text)-1] 
     97          for i = 0, n_elements(text)-2 do print, prefix+text[i]  
     98         print, prefix+text[n_elements(text)-1] 
    9499      ENDELSE 
    95100   ENDELSE 
  • trunk/ToBeReviewed/UTILITAIRE/routine_name.pro

    r9 r11  
    5252FUNCTION routine_name,  remonte 
    5353; 
    54    version=strmid(!version.release,0,3) 
    55    if version EQ '5.2' OR version EQ '5.3' OR version EQ '5.4' OR version EQ '5.5' OR version EQ '5.6' then begin 
    56       help,  /traceback, output = name 
    57       name = strtrim(name, 1)   ; on enleve les blancs en debut de ligne 
    58 ; on vat mettre les elements du vecteur bout a bout pour former un 
     54  help,  /traceback, output = name 
     55  name = strtrim(name, 1)     ; on enleve les blancs en debut de ligne 
     56; on va mettre les elements du vecteur bout a bout pour former un 
    5957; unique sring 
    60       allnames = '' 
    61       for i = 0, n_elements(name)-1 do allnames = allnames+name[i] 
     58  allnames = '' 
     59  for i = 0, n_elements(name)-1 do allnames = allnames+name[i] 
    6260; 
    63       name = str_sep(allnames, '%') ; on le redecoupe  
    64       name = strtrim(name, 2)   ; on eleve les blancs devant et derriere 
    65       name = strcompress(name)  ; on compresse les blancs 
     61  name = str_sep(allnames, '%') ; on le redecoupe  
     62  name = strtrim(name, 2)     ; on eleve les blancs devant et derriere 
     63  name = strcompress(name)      ; on compresse les blancs 
    6664; on ne retient pas les 2 premiers elements qui sont 1  un vide et la 
    6765; ligne concernant routine_name  
    68       name = name[2: n_elements(name)-1] 
     66  name = name[2: n_elements(name)-1] 
    6967; on choisit la ligne qui nous concerne 
    70       if NOT keyword_set(remonte) then remonte = 0 
    71       if remonte GE n_elements(name) then return,  '$MAIN$' 
    72       name = name[remonte] 
    73       if strpos(name, '$MAIN$') NE -1 then return,  '$MAIN$' 
    74       name = str_sep(name, ' ') 
    75       if n_elements(name) LT 3  then name = name[0] ELSE name = 'L.'+name[1]+' '+name[2] 
    76    ENDIF ELSE BEGIN 
    77       print, 'attention la fonction routine_name a ete ecrite pour les versions: IDL 5.2, IDL 5.2.1, 5.3 ou 5.4. ou 5.4.1 ou 5.5  ou 5.6 Verifier qu''elle marche bien avec la version '+!version.release 
    78       return, 'Error' 
    79    ENDELSE  
    80    return, name 
     68  if NOT keyword_set(remonte) then remonte = 0 
     69  if remonte GE n_elements(name) then return,  '$MAIN$' 
     70  name = name[remonte] 
     71  if strpos(name, '$MAIN$') NE -1 then return,  '$MAIN$' 
     72  name = str_sep(name, ' ') 
     73  if n_elements(name) LT 3  then name = name[0] ELSE name = 'L.'+name[1]+' '+name[2] 
     74; 
     75  return, name 
    8176end 
  • trunk/ToBeReviewed/UTILITAIRE/vzoom.pro

    r9 r11  
    3030   y = [y1, y2] 
    3131   y = y[sort(y)] 
    32    domdef, [x, y, prof1, prof2] 
     32   domdef, [x, y, vert1, vert2] 
    3333; il faut fermer le journal! 
    3434   journal 
    3535; on recupere le journal sous la forme d''un vecteur de string: 
    36    vectjournal = getfile(homedir+'idlsave.pro') 
     36   vectjournal = getfile(myuniquetmpdir+'idlsave.pro') 
    3737; on coupe la derniere ligne qui est vraizoom 
    3838   vectjournal = vectjournal[0:n_elements(vectjournal)-2 ] 
     
    6666; 
    6767; on reecrit idlsave.pro 
    68 putfile, homedir+'idlsave.pro', vectjournal 
     68putfile, myuniquetmpdir+'idlsave.pro', vectjournal 
    6969; applique idlsave 
    70    cd, homedir 
     70   cd,  current = curdir 
     71   cd, myuniquetmpdir 
    7172@idlsave    
     73   cd, curdir 
    7274; le journal vient d'etre reouvert, et on y met les elements de 
    7375; vectjournal  
    7476for i = 0, n_elements(vectjournal)-1 DO $ 
    75 printf,  !journal, vectjournal[i] 
     77journal, vectjournal[i] 
    7678 
    7779 
Note: See TracChangeset for help on using the changeset viewer.