Changeset 192 for trunk/SRC/ToBeReviewed


Ignore:
Timestamp:
09/22/06 11:37:08 (18 years ago)
Author:
smasson
Message:

several bugfix + new strsed

Location:
trunk/SRC/ToBeReviewed
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/INIT/initncdf.pro

    r172 r192  
    125125  xvarid = (where(namevar EQ xaxisname OR namevar EQ 'longitude' $ 
    126126                  OR namevar EQ 'nav_lon' OR namevar EQ 'lon' $ 
    127                   OR namevar EQ 'lon_rho' OR namevar EQ 'NbLongitudes'))[0] 
    128   romsgrid = strmid(namevar[xvarid], 0, 4) EQ 'lon_' 
     127                  OR namevar EQ 'lon_rho' OR namevar EQ 'nblongitudes'))[0] 
    129128  if xvarid EQ -1 then begin 
    130129    print, 'the xaxis was not found, check the use of XAXISNAME keyword' 
    131130    stop 
    132131  endif 
     132  romsgrid = strmid(namevar[xvarid], 0, 4) EQ 'lon_' 
    133133; get the size of xaxis 
    134134  xinq = ncdf_varinq(cdfid, xvarid) 
     
    149149  yvarid = (where(namevar EQ yaxisname OR namevar EQ 'latitude' $ 
    150150                  OR namevar EQ 'nav_lat' OR namevar EQ 'lat' $ 
    151                   OR namevar EQ 'lat_rho' OR namevar EQ 'NbLatitudes'))[0] 
     151                  OR namevar EQ 'lat_rho' OR namevar EQ 'nblatitudes'))[0] 
    152152  yvarid = yvarid[0] 
    153153  if yvarid EQ -1 then begin 
  • trunk/SRC/ToBeReviewed/LECTURE/read_ncdf.pro

    r181 r192  
    6767; (the first 1D array with unlimited dimension) is not the good one. 
    6868; 
    69 ; @keyword HFILENAME {default=FILENAME}{type=string} 
    70 ; For ROMS outputs. The filename of the file where h vriable should be read 
    71 ; 
    7269; @keyword ZETAFILENAME {default=FILENAME}{type=string} 
    7370; For ROMS outputs. The filename of the file where zeta vriable should be read 
     
    103100                    , TOUT = tout, NOSTRUCT = nostruct, CONT_NOFILL = CONT_NOFILL, INIT = init $ 
    104101                    , GRID = grid, FBASE2TBASE = fbase2tbase, CALLITSELF = callitself $ 
    105                     , HFILENAME = hfilename, ZETAFILENAME = zetafilename, ZETAZERO = zetazero $ 
     102                    , ZETAFILENAME = zetafilename, ZETAZERO = zetazero $ 
    106103                    , _EXTRA = ex 
    107104;--------------------------------------------------------- 
     
    567564      ENDFOR 
    568565      CASE 1 OF 
    569         keyword_set(hfilename):  $ 
    570            hroms = read_ncdf('h', 0, 0, FILENAME = hfilename $ 
    571                              , /TIMESTEP, /NOSTRUCT, CONT_NOFILL = CONT_NOFILL $ 
    572                              , GRID = vargrid, /CALLITSELF, _EXTRA = ex) 
    573         (where(allvarnames EQ 'h'))[0] NE -1: $ 
    574            hroms = read_ncdf('h', 0, 0, FILENAME = filename $ 
    575                              , /TIMESTEP, /NOSTRUCT, CONT_NOFILL = CONT_NOFILL $ 
    576                              , GRID = vargrid, /CALLITSELF, _EXTRA = ex) 
    577         ELSE:return, report('The variable h was not found in the file, please use the keyword HFILENAME to specify the name of a file containing h') 
    578       ENDCASE 
    579       CASE 1 OF 
    580566        keyword_set(zetazero):zeta = fltarr(nx, ny, jpt) 
    581567        keyword_set(zetafilename):  $ 
     
    589575        ELSE:return, report('The variable zeta was not found in the file, please use the keyword ZETAFILENAME to specify the name of a file containing zeta or use  keyword ZETAZERO to define zeta to 0.') 
    590576      ENDCASE 
    591       romszinfos = {h:temporary(hroms), zeta:temporary(zeta), theta_s:theta_s, theta_b:theta_b, hc:hc} 
     577      romszinfos = {h:romszinfos.h, zeta:temporary(zeta), theta_s:theta_s, theta_b:theta_b, hc:hc} 
    592578    ENDIF ELSE romszinfos = {h:-1, zeta:-1, theta_s:-1, theta_b:-1, hc:-1} 
    593579  ENDIF 
  • trunk/SRC/ToBeReviewed/LECTURE/read_ncdf_varget.pro

    r142 r192  
    7575;,,,,,,,,,,,,,,,,,,,,,,,, 
    7676            ncdf_varget,cdfid,name,res,offset=[firstx+ixmin,firsty+iymin] $ 
    77              ,count=[nx,ny], _extra = ex 
     77             ,count=[nx,ny] 
    7878         END 
    7979;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    8383            ncdf_varget,cdfid,name,res,offset=[firstx*key_stride[0]+ixmin $ 
    8484                                               ,firsty*key_stride[1]+iymin] $ 
    85              ,count=[nx,ny], stride = key_stride[0:1], _extra = ex 
     85             ,count=[nx,ny], stride = key_stride[0:1] 
    8686         END 
    8787;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    9494                  ncdf_varget,cdfid,name,res,offset=[ixmin-key+firstx $ 
    9595                                                     ,firsty+iymin] $ 
    96                    ,count=[nx,ny], _extra = ex 
     96                   ,count=[nx,ny] 
    9797               END 
    9898; ......... part, we can directly extract the array in one piece 
     
    100100                  ncdf_varget,cdfid,name,res,offset=[jpi-key+ixmin+firstx $ 
    101101                                                     ,firsty+iymin] $ 
    102                    ,count=[nx,ny], _extra = ex 
     102                   ,count=[nx,ny] 
    103103               END 
    104104               ELSE:BEGIN  ; we have to extract the array in 2 pieces...   
     
    106106                  ncdf_varget,cdfid,name,tab1,offset=[jpi-key+ixmin+firstx $ 
    107107                                                      ,firsty+iymin] $ 
    108                    ,count=[key-1-firstx+1,ny], _extra = ex 
     108                   ,count=[key-1-firstx+1,ny] 
    109109; --------- part, second part... 
    110110                  ncdf_varget,cdfid,name,tab2,offset=[ixmin,firsty+iymin] $ 
    111                    ,count=[lastx-key+1,ny], _extra = ex 
     111                   ,count=[lastx-key+1,ny] 
    112112                  res = [temporary(tab1), temporary(tab2)] 
    113113               END 
     
    125125                                                     +(firstx-((key-1)/key_stride[0]+1))*key_stride[0] $ 
    126126                                                     ,firsty*key_stride[1]+iymin] $ 
    127                    ,count=[nx,ny], stride = key_stride[0:1], _extra = ex 
     127                   ,count=[nx,ny], stride = key_stride[0:1] 
    128128                END 
    129129; ......... part, we can directly extract the array in one piece 
     
    131131                  ncdf_varget,cdfid,name,res,offset=[jpitotal-key+ixmin+firstx*key_stride[0] $ 
    132132                                                     ,firsty*key_stride[1]+iymin] $ 
    133                    ,count=[nx,ny], stride = key_stride[0:1], _extra = ex 
     133                   ,count=[nx,ny], stride = key_stride[0:1] 
    134134               END 
    135135               ELSE:BEGIN ; we have to extract the array in 2 pieces... 
     
    138138                                                      ,firsty*key_stride[1]+iymin] $ 
    139139                   ,count=[(key-firstx*key_stride[0]-1)/key_stride[0]+1,ny] $ 
    140                     , stride = key_stride[0:1], _extra = ex 
     140                    , stride = key_stride[0:1] 
    141141; --------- part, second part... 
    142142                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
     
    144144                                                      , firsty*key_stride[1]+iymin] $ 
    145145                   ,count=[nx-(key-firstx*key_stride[0]-1)/key_stride[0]-1,ny] $ 
    146                     , stride = key_stride[0:1], _extra = ex 
     146                    , stride = key_stride[0:1] 
    147147; in one unique array... 
    148148                  res = [temporary(tab1), temporary(tab2)] 
     
    163163;,,,,,,,,,,,,,,,,,,,,,,,, 
    164164            ncdf_varget,cdfid,name,res,offset=[firstx+ixmin,firsty+iymin,firstz+izmin] $ 
    165              ,count=[nx,ny,nz], _extra = ex 
     165             ,count=[nx,ny,nz] 
    166166         END 
    167167;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    172172                                               ,firsty*key_stride[1]+iymin $ 
    173173                                               ,firstz*key_stride[2]+izmin] $ 
    174              ,count=[nx,ny,nz], stride = key_stride, _extra = ex 
     174             ,count=[nx,ny,nz], stride = key_stride 
    175175         END 
    176176;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    183183                                                     ,firsty+iymin $ 
    184184                                                     ,firstz+izmin] $ 
    185                    ,count=[nx,ny,nz], _extra = ex 
     185                   ,count=[nx,ny,nz] 
    186186               END 
    187187               lastx LE key-1:BEGIN ; on peut tout couper d''un coup 
     
    189189                                                     ,firsty+iymin $ 
    190190                                                     ,firstz+izmin] $ 
    191                    ,count=[nx,ny,nz], _extra = ex 
     191                   ,count=[nx,ny,nz] 
    192192               END 
    193193               ELSE:BEGIN       ; Le tableau est separe en 2 morceaux... 
     
    195195                                                      ,firsty+iymin $ 
    196196                                                      ,firstz+izmin] $ 
    197                    ,count=[key-1-firstx+1,ny,nz], _extra = ex 
     197                   ,count=[key-1-firstx+1,ny,nz] 
    198198                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
    199199                                                      ,firsty+iymin $ 
    200200                                                      ,firstz+izmin] $ 
    201                    ,count=[lastx-key+1,ny,nz], _extra = ex 
     201                   ,count=[lastx-key+1,ny,nz] 
    202202                  res = [temporary(tab1), temporary(tab2)] 
    203203               END 
     
    215215                                                     ,firsty*key_stride[1]+iymin $ 
    216216                                                     ,firstz*key_stride[2]+izmin] $ 
    217                    ,count=[nx,ny,nz], stride = key_stride, _extra = ex 
     217                   ,count=[nx,ny,nz], stride = key_stride 
    218218               END 
    219219               lastx*key_stride[0] LE key-1:BEGIN ; on peut tout couper d''un coup 
     
    221221                                                     ,firsty*key_stride[1]+iymin $ 
    222222                                                     ,firstz*key_stride[2]+izmin] $ 
    223                    ,count=[nx,ny,nz], stride = key_stride, _extra = ex 
     223                   ,count=[nx,ny,nz], stride = key_stride 
    224224               END 
    225225               ELSE:BEGIN       ; le tableau est separe en 2 morceaux... 
     
    228228                                                      ,firstz*key_stride[2]+izmin] $ 
    229229                   ,count=[(key-firstx*key_stride[0]-1)/key_stride[0]+1,ny,nz] $ 
    230                     , stride = key_stride, _extra = ex 
     230                    , stride = key_stride 
    231231; 2eme bout... 
    232232                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
     
    235235                                                      ,firstz*key_stride[2]+izmin] $ 
    236236                   ,count=[nx-(key-firstx*key_stride[0]-1)/key_stride[0]-1,ny,nz] $ 
    237                     , stride = key_stride, _extra = ex 
     237                    , stride = key_stride 
    238238; on recolle le tout 
    239239                  res = [temporary(tab1), temporary(tab2)] 
     
    256256                                               ,firsty+iymin $ 
    257257                                               ,firsttps] $ 
    258              ,count=[nx,ny,jpt], _extra = ex 
     258             ,count=[nx,ny,jpt] 
    259259         END 
    260260;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    265265                                               ,firsty*key_stride[1]+iymin $ 
    266266                                               ,firsttps] $ 
    267              ,count=[nx,ny,jpt], stride = [key_stride[0:1], 1], _extra = ex 
     267             ,count=[nx,ny,jpt], stride = [key_stride[0:1], 1] 
    268268         END 
    269269;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    277277                                                     ,firsty+iymin $ 
    278278                                                     ,firsttps] $ 
    279                    ,count=[nx,ny,jpt], _extra = ex 
     279                   ,count=[nx,ny,jpt] 
    280280               END 
    281281; ......... part, we can directly extract the array in one piece 
     
    284284                                                     ,firsty+iymin $ 
    285285                                                     ,firsttps] $ 
    286                    ,count=[nx,ny,jpt], _extra = ex 
     286                   ,count=[nx,ny,jpt] 
    287287               END 
    288288               ELSE:BEGIN       ; Le tableau est separe en 2 morceaux... 
     
    291291                                                      ,firsty+iymin $ 
    292292                                                      ,firsttps] $ 
    293                    ,count=[key-1-firstx+1,ny,jpt], _extra = ex 
     293                   ,count=[key-1-firstx+1,ny,jpt] 
    294294; --------- part, second part... 
    295295                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
    296296                                                      ,firsty+iymin $ 
    297297                                                      ,firsttps] $ 
    298                    ,count=[lastx-key+1,ny,jpt], _extra = ex 
     298                   ,count=[lastx-key+1,ny,jpt] 
    299299                  res = [temporary(tab1), temporary(tab2)] 
    300300               END 
     
    313313                                                     ,firsty*key_stride[1]+iymin $ 
    314314                                                     ,firsttps] $ 
    315                    ,count=[nx,ny,jpt], stride = [key_stride[0:1], 1], _extra = ex 
     315                   ,count=[nx,ny,jpt], stride = [key_stride[0:1], 1] 
    316316               END 
    317317; ......... part, we can directly extract the array in one piece 
     
    320320                                                     ,firsty*key_stride[1]+iymin $ 
    321321                                                     ,firsttps] $ 
    322                    ,count=[nx,ny,jpt], stride = [key_stride[0:1], 1], _extra = ex 
     322                   ,count=[nx,ny,jpt], stride = [key_stride[0:1], 1] 
    323323               END 
    324324               ELSE:BEGIN       
     
    328328                                                      ,firsttps] $ 
    329329                   ,count=[(key-firstx*key_stride[0]-1)/key_stride[0]+1,ny,jpt] $ 
    330                     , stride = [key_stride[0:1], 1], _extra = ex 
     330                    , stride = [key_stride[0:1], 1] 
    331331; --------- part, second part... 
    332332                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
     
    335335                                                      ,firsttps] $ 
    336336                   ,count=[nx-(key-firstx*key_stride[0]-1)/key_stride[0]-1,ny,jpt] $ 
    337                     , stride = [key_stride[0:1], 1], _extra = ex 
     337                    , stride = [key_stride[0:1], 1] 
    338338; on recolle le tout 
    339339                  res = [temporary(tab1), temporary(tab2)] 
     
    357357                                                      ,firstz+izmin $ 
    358358                                               ,firsttps] $ 
    359              ,count=[nx,ny,nz,jpt], _extra = ex 
     359             ,count=[nx,ny,nz,jpt] 
    360360         END 
    361361;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    367367                                               ,firstz*key_stride[2]+izmin $ 
    368368                                               ,firsttps] $ 
    369              ,count=[nx,ny,nz,jpt], stride = [key_stride, 1], _extra = ex 
     369             ,count=[nx,ny,nz,jpt], stride = [key_stride, 1] 
    370370         END 
    371371;,,,,,,,,,,,,,,,,,,,,,,,, 
     
    379379                                                     ,firstz+izmin $ 
    380380                                                     ,firsttps] $ 
    381                    ,count=[nx,ny,nz,jpt], _extra = ex 
     381                   ,count=[nx,ny,nz,jpt] 
    382382               END 
    383383               lastx LE key-1:BEGIN ; on peut tout couper d''un coup 
     
    386386                                                     ,firstz+izmin $ 
    387387                                                     ,firsttps] $ 
    388                    ,count=[nx,ny,nz,jpt], _extra = ex 
     388                   ,count=[nx,ny,nz,jpt] 
    389389               END 
    390390               ELSE:BEGIN       ; Le tableau est separe en 2 morceaux... 
     
    393393                                                      ,firstz+izmin $ 
    394394                                                      ,firsttps] $ 
    395                    ,count=[key-1-firstx+1,ny,nz,jpt], _extra = ex 
     395                   ,count=[key-1-firstx+1,ny,nz,jpt] 
    396396                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
    397397                                                      ,firsty+iymin $ 
    398398                                                      ,firstz+izmin $ 
    399399                                                      ,firsttps] $ 
    400                    ,count=[lastx-key+1,ny,nz,jpt], _extra = ex 
     400                   ,count=[lastx-key+1,ny,nz,jpt] 
    401401                  res = [temporary(tab1), temporary(tab2)] 
    402402               END 
     
    415415                                                     ,firstz*key_stride[2]+izmin $ 
    416416                                                     ,firsttps] $ 
    417                    ,count=[nx,ny,nz,jpt], stride = [key_stride, 1], _extra = ex 
     417                   ,count=[nx,ny,nz,jpt], stride = [key_stride, 1] 
    418418               END 
    419419               lastx*key_stride[0] LE key-1:BEGIN ; on peut tout coupe d''un coup 
     
    422422                                                     ,firstz*key_stride[2]+izmin $ 
    423423                                                     ,firsttps] $ 
    424                    ,count=[nx,ny,nz,jpt], stride = [key_stride, 1], _extra = ex 
     424                   ,count=[nx,ny,nz,jpt], stride = [key_stride, 1] 
    425425               END 
    426426               ELSE:BEGIN       ; le tableau est separe en 2 morceaux... 
     
    430430                                                      ,firsttps] $ 
    431431                   ,count=[(key-firstx*key_stride[0]-1)/key_stride[0]+1,ny,nz,jpt] $ 
    432                    , stride = [key_stride, 1], _extra = ex 
     432                   , stride = [key_stride, 1] 
    433433; 2eme bout... 
    434434                  ncdf_varget,cdfid,name,tab2,offset=[ixmin $ 
     
    438438                                                      , firsttps] $ 
    439439                   ,count=[nx-(key-firstx*key_stride[0]-1)/key_stride[0]-1,ny,nz,jpt] $ 
    440                    , stride = [key_stride, 1], _extra = ex 
     440                   , stride = [key_stride, 1] 
    441441; on recolle le tout 
    442442                  res = [temporary(tab1), temporary(tab2)] 
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltt.pro

    r172 r192  
    464464      z2d = remplit(z2d,nite=2+keyword_set(nan), mask = mask, /basique, _extra=ex) 
    465465      if NOT keyword_set(strictfill) then z2d = min > z2d <  max 
     466      usetri = 0 ; default definition 
    466467      if keyword_set(nan) then BEGIN 
    467468        triangulation = triangule(mask, /basic, coinmonte = coinmontemask $ 
     
    469470        usetri = 1 
    470471      ENDIF ELSE triangulation = -1  
    471        
    472472      IF size(gdep, /n_dimensions) EQ 2 THEN BEGIN 
    473473        usetri = 2 
  • trunk/SRC/ToBeReviewed/STRING/getfile.pro

    r163 r192  
    8181          endif 
    8282        ENDIF ELSE file = filein 
    83         if !version.os_family EQ 'unix' then begin 
    84           spawn, 'cat '+file,  res 
    85           if res[0] NE '' then return, res ELSE return, '' 
    86         endif 
    8783         
    8884        if (!version.release+0. ge 5.5) then begin 
  • trunk/SRC/ToBeReviewed/TRIANGULATION/ciseauxtri.pro

    r163 r192  
    1616; 
    1717; @param GPHI  
    18 ; 
    19 ; @keyword ALL 
    2018;  
    2119; @keyword _EXTRA 
     
    3634;------------------------------------------------------------ 
    3735;------------------------------------------------------------ 
    38 FUNCTION ciseauxtri, triang, glam, gphi, ALL = all, _EXTRA = ex 
     36FUNCTION ciseauxtri, triang, glam, gphi, _EXTRA = ex 
    3937;--------------------------------------------------------- 
    4038; 
     
    115113   endif 
    116114; 
    117 ; We delete all triangle which are out of the valid frame when  on supprime les triangles qui sont un peu trop hors du cadre 
    118 ; valable qd ALL is activated 
     115; We delete all triangle which are out of the valid frame 
    119116; 
    120117    if keyword_set(key_irregular) then begin 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/cutcmd.pro

    r150 r192  
    8888    stop 
    8989  ENDIF 
    90   other = cutted[1-start:*:2] 
     90  IF n_elements(cutted) EQ 1 THEN other = '' ELSE other = cutted[1-start:*:2] 
    9191; make sure that we have a prefix for each nameexp 
    9292  IF start EQ 0 THEN other = ['', other] 
  • trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.pro

    r181 r192  
    7272  IF strmid(listing, 0, 1) NE '@' THEN listing = listing + ', strcalling = ''' + meshfilein + ''', _extra = ex' 
    7373 
    74 print, listing 
    75  
    76  
    7774  createpro, listing, filename = myuniquetmpdir +'for_createpro.pro', _extra = ex 
    7875 
  • trunk/SRC/ToBeReviewed/WIDGET/xxx.pro

    r186 r192  
    356356; computation done on the files... 
    357357  if keyword_set(uvalue) then txtvalue = (extractatt(uvalue, 'txtcmd'))[numdessinin] $ 
    358   ELSE txtvalue = varexp 
     358  ELSE txtvalue = '"' + varexp + '"' 
    359359  dummyid = widget_text(base, value = txtvalue, uvalue = {name:'txtcmd'}, uname = 'txtcmd' $ 
    360360                        , /editable, yoffset = yoff, xsize = 54, /frame) 
Note: See TracChangeset for help on using the changeset viewer.