Changeset 48 for trunk/grad.pro


Ignore:
Timestamp:
03/16/14 20:38:39 (10 years ago)
Author:
pinsard
Message:

fix thanks to coding rules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grad.pro

    r41 r48  
    1111   res = litchamp(field) 
    1212   taille=size(res) 
    13    grille, mask, glam, gphi, gdep, nx, ny,nz,premierx,premiery,premierz,dernierx, derniery, dernierz      
     13   grille, mask, glam, gphi, gdep, nx, ny,nz,premierx,premiery,premierz,dernierx, derniery, dernierz 
    1414   if n_elements(valmask) EQ 0 then valmask = 1e20 
    1515   case strupcase(vargrid) of 
    1616      'T':BEGIN 
    1717         case direc of 
    18             'x':BEGIN  
     18            'x':BEGIN 
    1919               divi = e1u[premierx:dernierx, premiery:derniery] 
    2020               newmask = (umask())[premierx:dernierx, premiery:derniery, premierz:dernierz] 
     
    3535               vargrid = 'W' 
    3636            END 
    37             ELSE:return, report('Bad definition of direction argument') 
     37            ELSE : return, report('Bad definition of direction argument') 
    3838         ENDCASE 
    3939      END 
     
    4747               vargrid = 'T' 
    4848            END 
    49             ELSE:return, report('Bad definition of direction argument') 
     49            ELSE : return, report('Bad definition of direction argument') 
    5050         endcase 
    5151      END 
     
    7171               vargrid = 'W' 
    7272            END 
    73             ELSE:return, report('Bad definition of direction argument') 
     73            ELSE : return, report('Bad definition of direction argument') 
    7474         endcase 
    7575      END 
     
    9595               vargrid = 'W' 
    9696            END 
    97             ELSE:return, report('Bad definition of direction argument') 
     97            ELSE : return, report('Bad definition of direction argument') 
    9898         endcase 
    9999      END 
     
    103103;             'y':divi = (shift(e2u, 0, -1))[premierx:dernierx, premiery:derniery] 
    104104;             'z':divi = e3w[premierz:dernierz] 
    105 ;             ELSE:return, report('Bad definition of direction argument') 
     105;             ELSE : return, report('Bad definition of direction argument') 
    106106;          endcase 
    107107;       END 
    108       ELSE:return, report('Bad definition of vargrid') 
     108      ELSE : return, report('Bad definition of vargrid') 
    109109   ENDCASE 
    110110   res = fitintobox(res) 
     
    117117         if earth[0] NE -1 then res[earth] = !values.f_nan 
    118118         case direc of 
    119             'x':BEGIN  
     119            'x':BEGIN 
    120120               res = (shift(res, -1, 0)-res)/divi 
    121121               if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *] = !values.f_nan 
    122122               if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0) 
    123123            END 
    124             'y':BEGIN  
     124            'y':BEGIN 
    125125               res = (shift(res, 0, -1)-res)/divi 
    126126               res[*, ny-1] = !values.f_nan 
    127                if vargrid EQ 'T' OR vargrid EQ 'U' then res =   shift(res, 0, 1)            
    128             END 
    129             ELSE:return,  report('Bad definition of direction argument for the type of array') 
     127               if vargrid EQ 'T' OR vargrid EQ 'U' then res =   shift(res, 0, 1) 
     128            END 
     129            ELSE : return,  report('Bad definition of direction argument for the type of array') 
    130130         ENDCASE 
    131131         earth = where(newmask[*, *, premierz] EQ 0) 
     
    143143         divi = divi[*]#replicate(1, jpt) 
    144144         case direc of 
    145             'x':BEGIN  
     145            'x':BEGIN 
    146146               res = (shift(res, -1, 0, 0)-res)/divi 
    147147               if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *, *] = !values.f_nan 
    148148               if vargrid EQ 'T' OR vargrid EQ 'V'  then res = shift(res, 1, 0, 0) 
    149149            END 
    150             'y':BEGIN  
     150            'y':BEGIN 
    151151               res = (shift(res, 0, -1, 0)-res)/divi 
    152152               res[*, ny-1, *] = !values.f_nan 
    153                if vargrid EQ 'T' OR vargrid EQ 'U'  then res = shift(res, 0, 1, 0)         
    154             END 
    155             ELSE:return,  report('Bad definition of direction argument for the type of array') 
     153               if vargrid EQ 'T' OR vargrid EQ 'U'  then res = shift(res, 0, 1, 0) 
     154            END 
     155            ELSE : return,  report('Bad definition of direction argument for the type of array') 
    156156         ENDCASE 
    157157         earth = where(newmask[*, *, premierz] EQ 0) 
    158          if earth[0] NE -1 then BEGIN  
     158         if earth[0] NE -1 then BEGIN 
    159159            earth = earth#replicate(1, jpt)+replicate(1, n_elements(earth))#(nx*ny*lindgen(jpt)) 
    160160            res[earth] = valmask 
     
    168168         if earth[0] NE -1 then res[earth] = !values.f_nan 
    169169         case direc OF 
    170             'x':BEGIN  
     170            'x':BEGIN 
    171171               divi = divi[*]#replicate(1, nz) 
    172172               res = (shift(res, -1, 0, 0)-res)/divi 
     
    174174               if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0, 0) 
    175175            END 
    176             'y':BEGIN  
     176            'y':BEGIN 
    177177               divi = divi[*]#replicate(1, nz) 
    178178               res = (shift(res, 0, -1, 0)-res)/divi 
    179179               res[*, ny-1, *] = !values.f_nan 
    180                if vargrid EQ 'T' OR vargrid EQ 'U'  then res = shift(res, 0, 1, 0)         
     180               if vargrid EQ 'T' OR vargrid EQ 'U'  then res = shift(res, 0, 1, 0) 
    181181            END 
    182182            'z':BEGIN 
    183183               divi = reform(replicate(1, nx*ny)#divi, nx, ny, nz) 
    184184               if nx EQ 1 OR ny EQ 1 then res = reform(res, nx, ny, nz) 
    185                if vargrid EQ 'W' THEN BEGIN  
     185               if vargrid EQ 'W' THEN BEGIN 
    186186                  res = (shift(res, 0, 0, 1)-res)/divi 
    187187                  res[*, *, 0] = !values.f_nan 
     
    206206               divi = reform(divi[*]#replicate(1, jpt), nx, ny, nz, jpt, /over) 
    207207               if nx EQ 1 OR ny EQ 1 then res = reform(res, nx, ny, nz, jpt) 
    208                if vargrid EQ 'W' THEN BEGIN  
     208               if vargrid EQ 'W' THEN BEGIN 
    209209                  res = (shift(res, 0, 0, 1, 0)-res)/divi 
    210210                  res[*, *, 0, *] = !values.f_nan 
     
    227227   return, res 
    228228end 
    229  
    230  
    231  
    232  
    233  
    234  
Note: See TracChangeset for help on using the changeset viewer.