Changeset 169


Ignore:
Timestamp:
11/16/09 15:39:10 (15 years ago)
Author:
pinsard
Message:

add compile_opt idl2, strictarrsubs and subsequent modifications

Location:
trunk
Files:
151 edited

Legend:

Unmodified
Added
Removed
  • trunk/procs/ajoutvectz.pro

    r165 r169  
    4949    , TYPE = type $ 
    5050    , BOITE = boite 
     51; 
     52  compile_opt idl2, strictarrsubs 
    5153; 
    5254@common 
     
    129131 
    130132      terre = where(u GE valmask/10.) 
    131       IF terre[0] NE -1 THEN u(terre) = !VALUES.F_NAN 
     133      IF terre[0] NE -1 THEN u[terre] = !VALUES.F_NAN 
    132134      terre = where(w GE valmask/10.) 
    133       IF terre[0] NE -1 THEN w(terre) = !VALUES.F_NAN 
    134  
    135       a=u(0,*) 
     135      IF terre[0] NE -1 THEN w[terre] = !VALUES.F_NAN 
     136 
     137      a=u[0,*] 
    136138      u=(u+shift(u,1,0))/2. 
    137       u(0,*)=a 
    138  
    139       a=w(*,0) 
     139      u[0,*]=a 
     140 
     141      a=w[*,0] 
    140142      w=(w+shift(w,0,1))/2. 
    141       w(*,0) = a 
     143      w[*,0] = a 
    142144 
    143145      vargrid='T' 
     
    171173 
    172174   CASE type OF  
    173       'yz': xgrid = gphit((firstxt+lastxt)/2, indicex[0]:indicex[nx-1]) 
    174       'xz': xgrid = glamt(indicex[0]:indicex[nx-1], (firstyt+lastyt)/2) 
     175      'yz': xgrid = gphit[(firstxt+lastxt)/2, indicex[0]:indicex[nx-1]] 
     176      'xz': xgrid = glamt[indicex[0]:indicex[nx-1], (firstyt+lastyt)/2] 
    175177   ENDCASE  
    176178 
    177179   x0 = xgrid[*]#replicate(1, nz) 
    178    y0 = replicate(1, nx)#gdept(indicez[0]:indicez[nz-1]) 
     180   y0 = replicate(1, nx)#gdept[indicez[0]:indicez[nz-1]] 
    179181 
    180182 
  • trunk/procs/alpha.pro

    r165 r169  
    99FUNCTION alpha, t, s, p 
    1010; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113   dt = 0.05 
    1214   siga = eos(t, s)-1000. 
  • trunk/procs/betar.pro

    r165 r169  
    99FUNCTION betar, t, s, p 
    1010; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113   ds = 0.01 
    1214   siga = eos(t, s)-1000. 
  • trunk/procs/bin_sigma.pro

    r168 r169  
    2424PRO bin_sigma, cmd, pfildi 
    2525; 
    26  
     26  compile_opt idl2, strictarrsubs 
     27; 
    2728@common 
    2829@com_eg 
  • trunk/procs/bining2.pro

    r168 r169  
    8888    , E3W=e3w $ 
    8989    , TMASK=tmask 
    90  
     90; 
     91  compile_opt idl2, strictarrsubs 
     92; 
    9193   size3d = size(density) 
    92    jpi = size3d(1) 
    93    jpj = size3d(2) 
    94    jpk = size3d(3) 
     94   jpi = size3d[1] 
     95   jpj = size3d[2] 
     96   jpk = size3d[3] 
    9597;print, 'size3d=', size3d 
    9698;print, 'size(tmask)=', size(tmask) 
     
    194196         IF i_ocean[0] NE -1 THEN BEGIN ; on n entre que si il y a des points ocean 
    195197;            print, 'ocean point' 
    196             i_bottom = i_ocean(n_elements(i_ocean)-1) 
     198            i_bottom = i_ocean[n_elements[i_ocean]-1] 
    197199;print, 'i_bottom=', i_bottom 
    198             z_s(N_s) = z_zw(i_bottom) 
    199             c1_s(N_s) = x1_content(i, j, jpk-1) 
     200            z_s(N_s) = z_zw[i_bottom] 
     201            c1_s(N_s) = x1_content(i, j, jpk-1] 
    200202             
    201             s_z(*) = density(i, j, *) 
    202             c1_z(*) = x1_content(i, j, *) 
     203            s_z[*] = density[i, j, *] 
     204            c1_z[*] = x1_content[i, j, *] 
    203205;            print, 'density profile s_z', s_z 
    204206;            print, 'field profile c1_z', c1_z 
     
    207209 
    208210; extraction d'un sous profil strictement croissant 
    209 ;            print, 's_z(i_ocean)=', s_z(i_ocean) 
    210             mini = min(s_z(i_ocean)) 
    211             maxi = max(s_z(i_ocean)) 
    212             i_min = where(s_z(i_ocean) EQ mini) 
    213             i_max = where(s_z(i_ocean) EQ maxi) 
     211;            print, 's_z[i_ocean]=', s_z[i_ocean] 
     212            mini = min(s_z[i_ocean]) 
     213            maxi = max(s_z[i_ocean]) 
     214            i_min = where(s_z[i_ocean] EQ mini) 
     215            i_max = where(s_z[i_ocean] EQ maxi) 
    214216;            print, 'mini, maxi', mini, maxi 
    215217;            print, 'i_min, i_max', i_min, i_max 
     
    228230; l isopycne est mise en surface (z_s=0) 
    229231; 
    230 ;            print, 's_z(i_min)', s_z(i_min) 
     232;            print, 's_z[i_min]', s_z[i_min] 
    231233;print, 's_s=', s_s 
    232             ind = where(s_s LT s_z(i_min)) 
     234            ind = where(s_s LT s_z[i_min]) 
    233235            IF ind[0] NE -1 THEN BEGIN  
    234236;               IF i_min GT i_max THEN print, 'min reached at sigma indices', ind 
    235                z_s(ind) = 0 
    236                c1_s(ind) = !VALUES.F_NAN 
     237               z_s[ind] = 0 
     238               c1_s[ind] = !VALUES.F_NAN 
    237239            ENDIF  
    238240 
     
    240242; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
    241243; 
    242 ;            print, 's_z(i_max)', s_z(i_max) 
    243             ind = where(s_s GT s_z(i_max)) 
     244;            print, 's_z[i_max]', s_z[i_max] 
     245            ind = where(s_s GT s_z[i_max]) 
    244246 
    245247            IF ind[0] NE -1 THEN BEGIN  
    246248;               IF i_min GT i_max THEN print, 'max reached at sigma indices', ind 
    247                z_s(ind) = z_s(N_s) 
    248                c1_s(ind) = c1_s(N_s) 
    249                c1_s(ind) = !VALUES.F_NAN 
     249               z_s[ind] = z_s(N_s) 
     250               c1_s[ind] = c1_s(N_s) 
     251               c1_s[ind] = !VALUES.F_NAN 
    250252            ENDIF  
    251253; cas general 
    252             ind = where( (s_s GE s_z(i_min)) AND (s_s LE s_z(i_max)) ) 
     254            ind = where( (s_s GE s_z[i_min]) AND (s_s LE s_z[i_max]) ) 
    253255;            IF i_min GT i_max THEN print, 's_s indices inside min/max', ind 
    254256            IF ind[0] NE -1 THEN BEGIN  
    255                i_profil = i_ocean(i_min:i_max) ; problem line 
    256  
    257                z_s(ind) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) ; original 
    258 ;               z_s(ind) = interpol(z_zw(i_profil), s_z(i_profil), s_s(ind)) ; changed to z_zw 1/7/04 
     257               i_profil = i_ocean[i_min:i_max] ; problem line 
     258 
     259               z_s[ind] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) ; original 
     260;               z_s[ind] = interpol(z_zw[i_profil], s_z[i_profil], s_s[ind]) ; changed to z_zw 1/7/04 
    259261 
    260262; 
     
    263265; me semble moins propre. Je la donne en remarque. 
    264266; 
    265                IF n_elements(i_profil) GT 2 THEN BEGIN  
    266 ;                  c1_s(ind) = spline(z_zw(i_profil), c1_z(i_profil), z_s(ind), 1)     ; cubic spline 
    267                   c1_s(ind) = interpol(c1_z(i_profil), z_zt(i_profil), z_s(ind))      ; linear interpolation 
    268 ;                   SPLINE_P, z_zw(i_profil), c1_z(i_profil), z_s(ind), c1_s(ind)     ; generalization of spline(*) 
    269 ;print, z_zw(i_profil), c1_z(i_profil), z_s(ind), c1_s(ind) 
     267               IF n_elements[i_profil] GT 2 THEN BEGIN  
     268;                  c1_s[ind] = spline(z_zw[i_profil], c1_z[i_profil], z_s[ind], 1)     ; cubic spline 
     269                  c1_s[ind] = interpol(c1_z[i_profil], z_zt[i_profil], z_s[ind])      ; linear interpolation 
     270;                   SPLINE_P, z_zw[i_profil], c1_z[i_profil], z_s[ind], c1_s[ind]     ; generalization of spline(*) 
     271;print, z_zw[i_profil], c1_z[i_profil], z_s[ind], c1_s[ind] 
    270272               ENDIF ELSE BEGIN 
    271                   c1_s(ind) = interpol(c1_z(i_profil), z_zt(i_profil), z_s(ind)) 
     273                  c1_s[ind] = interpol(c1_z[i_profil], z_zt[i_profil], z_s[ind]) 
    272274               ENDELSE  
    273275; 
     
    275277 
    276278               IF sig_bowl EQ 1 THEN BEGIN 
    277                   bowl_s = interpol(s_z(i_profil), z_zt(i_profil), sobwlmax(i, j)) 
     279                  bowl_s = interpol(s_z[i_profil], z_zt[i_profil], sobwlmax(i, j)) 
    278280               ENDIF ELSE bowl_s = 0 
    279281                   
     
    281283; 
    282284; 
    283 ;               x1_s(ind) = (c1_s(ind+1)-c1_s(ind))/(z_s(ind+1)-z_s(ind)) 
     285;               x1_s[ind] = (c1_s(ind+1)-c1_s[ind])/(z_s(ind+1)-z_s[ind]) 
    284286;                     x1_s = c1_s 
    285287 
  • trunk/procs/bining3.pro

    r165 r169  
    6767    , E3T=e3t $ 
    6868    , TMASK=tmask 
    69  
     69; 
     70  compile_opt idl2, strictarrsubs 
     71; 
    7072   size3d = size(density) 
    71    jpi = size3d(1) 
    72    jpj = size3d(2) 
    73    jpk = size3d(3) 
     73   jpi = size3d[1] 
     74   jpj = size3d[2] 
     75   jpk = size3d[3] 
    7476    
    7577   s_s = sigma 
     
    8385   vol_bin2 = fltarr(N_s) 
    8486 
    85    x1_bin(*, *, *) = !VALUES.F_NAN  
    86    depth_bin(*, *, *) = !VALUES.F_NAN  
    87    thick_bin(*, *, *) = !VALUES.F_NAN  
    88    bowl_bin(*, *) = !VALUES.F_NAN  
    89    vol_bin(*, *, *) =0 
    90    vol_bin2(*) =0 
     87   x1_bin[*, *, *] = !VALUES.F_NAN  
     88   depth_bin[*, *, *] = !VALUES.F_NAN  
     89   thick_bin[*, *, *] = !VALUES.F_NAN  
     90   bowl_bin[*, *] = !VALUES.F_NAN  
     91   vol_bin[*, *, *] =0 
     92   vol_bin2[*] =0 
    9193 
    92    delta_sig = s_s(1)-s_s(0) 
     94   delta_sig = s_s[1]-s_s[0] 
    9395 
    9496   vol_tot = 0. 
    9597   count_bin = fltarr(jpi, jpj, N_s) 
    9698   count_bin2 = fltarr(N_s) 
    97    count_bin(*, *, *) =0 
    98    count_bin2(*) =0 
     99   count_bin[*, *, *] =0 
     100   count_bin2[*] =0 
    99101 
    100102; perform bining - loop over i,j,k 
     
    102104   FOR i = 0, (jpi-1) DO BEGIN  
    103105      FOR j = 0, (jpj-1) DO BEGIN  
    104          i_ocean = where(tmask(i, j, *) EQ 1) 
     106         i_ocean = where(tmask[i, j, *] EQ 1) 
    105107         IF i_ocean[0] NE -1 THEN BEGIN ; on n entre que si il y a des points ocean 
    106             i_bottom = i_ocean(n_elements(i_ocean)-1) 
     108            i_bottom = i_ocean[n_elements(i_ocean)-1] 
    107109            FOR k = 0, i_bottom-1 DO BEGIN 
    108                bin_index = floor((density(i, j, k)-s_s(0))/delta_sig+0.5) 
     110               bin_index = floor((density[i, j, k]-s_s[0])/delta_sig+0.5) 
    109111               IF bin_index LT 0 OR bin_index GT (N_s-1) THEN BEGIN 
    110 ;                  print, ' WARNING: bin index out of bounds - density(i, j, k), bin_index, N_s = ', density(i, j, k), bin_index, N_s 
     112;                  print, ' WARNING: bin index out of bounds - density[i, j, k], bin_index, N_s = ', density[i, j, k], bin_index, N_s 
    111113               ENDIF ELSE BEGIN  
    112                   vol_bin(i, j, bin_index) = vol_bin(i, j, bin_index) + e1t(i,j)*e2t(i,j)*e3t(k) 
    113                   vol_bin2(bin_index) = vol_bin2(bin_index) + e1t(i,j)*e2t(i,j)*e3t(k) 
    114                   vol_tot = vol_tot + e1t(i,j)*e2t(i,j)*e3t(k) 
    115                   count_bin(i, j, bin_index) = count_bin(i, j, bin_index)+1 
    116                   count_bin2(bin_index) = count_bin2(bin_index)+1 
     114                  vol_bin[i, j, bin_index] = vol_bin[i, j, bin_index] + e1t[i,j]*e2t[i,j]*e3t[k] 
     115                  vol_bin2[bin_index] = vol_bin2[bin_index] + e1t[i,j]*e2t[i,j]*e3t[k] 
     116                  vol_tot = vol_tot + e1t[i,j]*e2t[i,j]*e3t[k] 
     117                  count_bin[i, j, bin_index] = count_bin[i, j, bin_index]+1 
     118                  count_bin2[bin_index] = count_bin2[bin_index]+1 
    117119               ENDELSE   
    118120            ENDFOR  
     
    122124    
    123125   mask_index = where(count_bin EQ 0) 
    124    vol_bin(mask_index) = !VALUES.F_NAN 
     126   vol_bin[mask_index] = !VALUES.F_NAN 
    125127   mask_index2 = where(count_bin2 EQ 0) 
    126 ;   vol_bin2(mask_index2) = !VALUES.F_NAN 
     128;   vol_bin2[mask_index2] = !VALUES.F_NAN 
    127129 
    128130   print, ' total volume of box (m3) = ', vol_tot 
  • trunk/procs/compute_time.pro

    r165 r169  
    1515FUNCTION compute_time, timeave, date1, date2 $ 
    1616         , NEXT=next 
     17; 
     18  compile_opt idl2, strictarrsubs 
    1719; 
    1820@common 
  • trunk/procs/cpsw.pro

    r165 r169  
    88;- 
    99FUNCTION cpsw, t, s, p 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113      CP1 = 0. 
  • trunk/procs/data_read.pro

    r165 r169  
    1212         , _EXTRA=extra 
    1313; 
     14  compile_opt idl2, strictarrsubs 
     15; 
    1416@common 
    1517@com_eg 
    16   
    17  
     18; 
    1819; same data as previous read ? 
    1920 
     
    330331            FOR i = 0, timedim-1 DO BEGIN 
    331332               print, 'data_read: Performing monthly bining. Indices: first, last, current = 0,', timedim-1, i 
    332                sfild2 = {name: sfild.name, data: sfild.data(*, *, *, i), legend: sfild.legend, units: sfild.units, origin: sfild.origin, dim: sfild.dim-1} 
     333               sfild2 = {name: sfild.name, data: sfild.data[*, *, *, i], legend: sfild.legend, units: sfild.units, origin: sfild.origin, dim: sfild.dim-1} 
    333334               bin_sigma, cmd, sfild2, BOXZOOM = box_plot, ALL_DATA = all_data  
    334                fldrd(*, *, *, i)= sfild2.data 
     335               fldrd[*, *, *, i]= sfild2.data 
    335336            ENDFOR  
    336337            fldr = {name: sfild.name, data:fldrd, legend: sfild.legend, units: sfild.units, origin: sfild.origin, dim: sfild.dim} 
     
    407408         print, 'Be careful some data are null. They will be masked ! ' 
    408409         idx0 = where(field2.data EQ 0.0) 
    409          field2.data(idx0) = valmask 
    410          fldr.data(idx0) = valmask 
    411          div(idx0) = valmask 
     410         field2.data[idx0] = valmask 
     411         fldr.data[idx0] = valmask 
     412         div[idx0] = valmask 
    412413      ENDIF 
    413414 
    414415      idx = where(field2.data NE valmask) 
    415       div(idx) = fldr.data(idx) / field2.data(idx) 
     416      div[idx] = fldr.data[idx] / field2.data[idx] 
    416417 
    417418      fldr.data = div 
  • trunk/procs/daypm.pro

    r165 r169  
    99FUNCTION daypm, month_i, year_i 
    1010; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113@common 
    1214@com_eg 
    13 ; 
    1415; 
    1516   IF calendar_type LE 1 THEN BEGIN 
  • trunk/procs/decode_cmd.pro

    r165 r169  
    88;- 
    99FUNCTION decode_cmd, cmdline, index 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/def_box.pro

    r165 r169  
    99FUNCTION def_box, plt, dimplot, boxdef, stride 
    1010; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113@common 
    1214@com_eg 
    13 ; 
    1415; 
    1516   IF debug_w THEN print, '   ENTER def_box...' 
  • trunk/procs/def_dbase.pro

    r165 r169  
    88;- 
    99FUNCTION def_dbase, expid 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/def_dptyp.pro

    r165 r169  
    88;- 
    99FUNCTION def_dptyp, cmd 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/def_file_name.pro

    r165 r169  
    99;- 
    1010PRO def_file_name, cmd, ncdf_db, file_name, delta_t1 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
  • trunk/procs/def_grid.pro

    r165 r169  
    88;- 
    99PRO def_grid, cmd 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/def_month.pro

    r165 r169  
    88;- 
    99FUNCTION def_month, timave, date 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/def_time_origin.pro

    r165 r169  
    1111;- 
    1212FUNCTION def_time_origin, timeave, date1 
    13  
     13; 
     14  compile_opt idl2, strictarrsubs 
     15; 
    1416   len1 = strlen(date1) 
    1517 
  • trunk/procs/def_work.pro

    r165 r169  
    1414;- 
    1515PRO def_work, data_base_list, out_ps, cmdline, out_all, other_file, spec_base_list 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
  • trunk/procs/densit_pltmap_plot.pro

    r165 r169  
    99 
    1010                  sizefld=size(fld) 
    11                   fld=fld(*,*,round((sig_surface-sig_min)/sig_del),*) 
    12                   fld = reform(fld, sizefld(1), sizefld(2), sizefld(4)) 
    13                   fld2 = fltarr(sizefld(4)) 
    14                   ;FOR count = 0, sizefld(4)-1 DO fld2(count) = mean(fld(*,*,count), /nan) 
    15                   FOR count = 0, sizefld(4)-1 DO fld2(count) = stddev(fld(*,*,count), /nan) 
     11                  fld=fld[*,*,round((sig_surface-sig_min)/sig_del),*] 
     12                  fld = reform(fld, sizefld[1], sizefld[2], sizefld[4]) 
     13                  fld2 = fltarr(sizefld[4]) 
     14                  ;FOR count = 0, sizefld[4]-1 DO fld2[count] = mean(fld[*,*,count], /nan) 
     15                  FOR count = 0, sizefld[4]-1 DO fld2[count] = stddev(fld[*,*,count], /nan) 
    1616                  fld = fld2 
    1717                  mask_z, fld, cmd, boite_plt1d, dimplot, legz 
  • trunk/procs/densit_pltmap_read.pro

    r165 r169  
    3535            cumulative = cumulative + fields.data 
    3636         ENDFOR 
    37          output(*, *, *, year_s-uint(start_year)) = cumulative/12. 
     37         output[*, *, *, year_s-uint(start_year)] = cumulative/12. 
    3838      ENDFOR 
    3939;   redefine cmd.* to be their initial values before the monthly loop 
  • trunk/procs/eos.pro

    r165 r169  
    88;- 
    99FUNCTION eos, t, s 
    10  
     10; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113   sr=sqrt(abs(s)) 
    1214   r1=((((6.536332E-9*t-1.120083E-6)*t+1.001685E-4)*t $ 
  • trunk/procs/extract_str.pro

    r165 r169  
    88;- 
    99FUNCTION extract_str, line, char1, char2 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113   pos_char1 = strpos(line,char1) 
  • trunk/procs/find_jptmax.pro

    r165 r169  
    88         , IODIRECTORY=iodirectory $  
    99         , _EXTRA=extra 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/fld_pltext.pro

    r165 r169  
    2424FUNCTION fld_pltext, var_name, plttyp, dimplot, hotyp 
    2525; 
     26  compile_opt idl2, strictarrsubs 
     27; 
    2628@common 
    2729@com_eg 
     
    4648      print, '     *** no min & max found for field ', var_name, $ 
    4749       ' in file fld_glo_mmx.def' 
    48          fldextr.min = min(field.data(where(field.data NE valmask))) 
    49          fldextr.max = max(field.data(where(field.data NE valmask))) 
     50         fldextr.min = min(field.data[where(field.data NE valmask)]) 
     51         fldextr.max = max(field.data[where(field.data NE valmask)]) 
    5052         fldextr.homin = fldextr.min 
    5153         fldextr.homax = fldextr.max 
  • trunk/procs/fld_pltint.pro

    r165 r169  
    2424;- 
    2525FUNCTION fld_pltint, var_name, plttyp, dimplot, hotyp 
     26; 
     27  compile_opt idl2, strictarrsubs 
    2628; 
    2729@common 
  • trunk/procs/get_file.pro

    r165 r169  
    88;- 
    99PRO get_file, file_name, ncdf_db 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/gfunct.pro

    r165 r169  
    2323    , pder 
    2424 
     25; 
     26  compile_opt idl2, strictarrsubs 
     27; 
    2528F = A[0] * EXP(A[1] * X) + A[2] 
    2629pder = [[EXP(A[1] * X)], [A[0] * X * EXP(A[1] * X)], [replicate(1.0, N_ELEMENTS(X))]] 
  • trunk/procs/grep.pro

    r165 r169  
    99FUNCTION grep, command, separator, index 
    1010; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113   spawn, command, line 
    1214   line = strcompress(strtrim(line[0])) 
  • trunk/procs/grepsed.pro

    r164 r169  
    99 
    1010FUNCTION grepsed, command1,command2 
    11  
     11; 
     12  compile_opt idl2, strictarrsubs 
     13; 
    1214   spawn, command1+'|'+command2, line 
    1315 
  • trunk/procs/lec_pal_gmt.pro

    r165 r169  
    1010;- 
    1111PRO lec_pal_gmt, var_name, c_anot_str, fmt, found, readpal 
     12; 
     13  compile_opt idl2, strictarrsubs 
    1214; 
    1315@common 
     
    7072 
    7173         spawn, 'grep piso '+file_cpt, line 
    72          IF n_elements(line) NE 0 AND (strpos(line, 'piso'))(0) NE -1 THEN BEGIN 
     74         IF n_elements(line) NE 0 AND (strpos(line, 'piso'))[0] NE -1 THEN BEGIN 
    7375            iso = abs(float(line[0]))     
    7476            IF iso EQ 0.1 THEN BEGIN 
  • trunk/procs/macro_read.pro

    r165 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , _EXTRA=extra 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_anomaly.pro

    r168 r169  
    1414         , ALL_DATA=all_data $ 
    1515         , ZMTYP=zmtyp 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
  • trunk/procs/macros/make_bsf.pro

    r165 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
     
    7476      FOR t = 0, jpt DO BEGIN  
    7577 
    76          bsf= diag_bsf(u.data(*, *, *, t), v.data(*, *, *, t)) 
     78         bsf= diag_bsf(u.data[*, *, *, t], v.data[*, *, *, t]) 
    7779         bsft = bsf[1:jpi-2, 0:jpj-2] 
    78          bsfr(*, *, t) = shift(bsft, key_shift_old, 0) 
     80         bsfr[*, *, t] = shift(bsft, key_shift_old, 0) 
    7981      ENDFOR  
    8082 
     
    100102 
    101103   isign=where(glamt gt 380.) 
    102    IF isign(0) NE -1 THEN glamt(isign) = glamt(isign)-360. 
     104   IF isign[0] NE -1 THEN glamt[isign] = glamt[isign]-360. 
    103105   isign=where(glamu gt 380.) 
    104    IF isign(0) NE -1 THEN glamu(isign) = glamu(isign)-360. 
     106   IF isign[0] NE -1 THEN glamu[isign] = glamu[isign]-360. 
    105107   isign=where(glamv gt 380.) 
    106    IF isign(0) NE -1 THEN glamv(isign) = glamv(isign)-360. 
     108   IF isign[0] NE -1 THEN glamv[isign] = glamv[isign]-360. 
    107109   isign=where(glamf gt 380.) 
    108    IF isign(0) NE -1 THEN glamf(isign) = glamf(isign)-360. 
     110   IF isign[0] NE -1 THEN glamf[isign] = glamf[isign]-360. 
    109111;   domdef, old_boite 
    110112 
  • trunk/procs/macros/make_correlation.pro

    r165 r169  
    1212         , TIME_2=time_2 $ 
    1313         , ALL_DATA=all_data 
     14; 
     15  compile_opt idl2, strictarrsubs 
    1416; 
    1517@common 
     
    5153      IF debug_w THEN print, '   month idx/value: ', imth, strd(imth) 
    5254 
    53       data1 = (var1.data)[*, *, reform(idxm(imth,*), njpt)]         
    54       data2 = (var2.data)[*, *, reform(idxm(imth,*), njpt)]         
     55      data1 = (var1.data)[*, *, reform(idxm[imth,*], njpt)]         
     56      data2 = (var2.data)[*, *, reform(idxm[imth,*], njpt)]         
    5557      nval = njpt 
    5658 
     
    6567   pt_correl = pt_correl/float(nmth) 
    6668 
    67    IF idm[0] NE -1 THEN pt_correl(idm) = valmask 
     69   IF idm[0] NE -1 THEN pt_correl[idm] = valmask 
    6870 
    6971   varname = varname+' '+ntxt 
  • trunk/procs/macros/make_correldomain.pro

    r165 r169  
    1313         , TIME_2=time_2 $ 
    1414         , ALL_DATA=all_data 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
     
    6264      IF debug_w THEN print, '   month idx/value: ', imth, strd(imth) 
    6365 
    64       data = (var.data)[*, *, reform(idxm(imth,*), njpt)]         
    65       var_domc = (var_dom)[reform(idxm(imth,*), njpt)]         
     66      data = (var.data)[*, *, reform(idxm[imth,*], njpt)]         
     67      var_domc = (var_dom)[reform(idxm[imth,*], njpt)]         
    6668      var_domc = var_domc-mean(var_domc) 
    6769      nval = njpt 
     
    7072      FOR idx = 0, nxa-1 DO FOR idy = 0, nya-1 DO BEGIN 
    7173 
    72          IF data(idx, idy, 0) NE valmask THEN BEGIN  
    73             x1i = reform(data(idx, idy, *), nval) 
    74             x1 = x1i-mean(x1i) 
    75             zcor = c_timecorrelate(x1, var_domc) 
    76             correl(idx, idy)= correl(idx, idy) + zcor 
     74         IF data[idx, idy, 0] NE valmask THEN BEGIN  
     75            x1i = reform(data[idx, idy, *], nval) 
     76            x1 = x1i-mean[x1i] 
     77            zcor = c_timecorrelate[x1, var_domc] 
     78            correl[idx, idy]= correl[idx, idy] + zcor 
    7779         ENDIF ELSE BEGIN  
    78             correl(idx, idy) = valmask 
     80            correl[idx, idy] = valmask 
    7981         ENDELSE  
    8082      ENDFOR  
     
    8587   correl = correl/float(nmth) 
    8688 
    87    IF idm[0] NE -1 THEN correl(idm) = valmask 
     89   IF idm[0] NE -1 THEN correl[idm] = valmask 
    8890 
    8991   varname = varname+' '+ntxt 
  • trunk/procs/macros/make_crtm.pro

    r168 r169  
    1414         , ALL_DATA=all_data $ 
    1515         , ZMTYP=zmtyp 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
  • trunk/procs/macros/make_curltau.pro

    r165 r169  
    1414         , ALL_DATA=all_data $ 
    1515         , ZMTYP=zmtyp 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
  • trunk/procs/macros/make_denflw.pro

    r165 r169  
    1111         , ALL_DATA=all_data $ 
    1212         , ZMTYP=zmtyp 
     13; 
     14  compile_opt idl2, strictarrsubs 
    1315; 
    1416@common 
  • trunk/procs/macros/make_denflx.pro

    r168 r169  
    88         , TIME_1=time_1 $ 
    99         , TIME_2=time_2 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/procs/macros/make_depth.pro

    r165 r169  
    1414        , ZMTYP=zmtyp $  
    1515        , _EXTRA=extra 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
  • trunk/procs/macros/make_energetics.pro

    r168 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
     
    126128         valmask = 1.e20 
    127129         idxw = where (tmaskr EQ 0) 
    128          IF idxw[0] NE -1 THEN w(idxw) = valmask 
     130         IF idxw[0] NE -1 THEN w[idxw] = valmask 
    129131         idxt = where (tmaskr EQ 0) 
    130          IF idxt[0] NE -1 THEN t (idxt) = 0. 
    131          IF idxt[0] NE -1 THEN s (idxt) = 0. 
     132         IF idxt[0] NE -1 THEN t [idxt] = 0. 
     133         IF idxt[0] NE -1 THEN s [idxt] = 0. 
    132134         tmaskr = 0 ; free memory 
    133135      ENDIF ELSE BEGIN  
    134136         idxt = where (t EQ valmask) 
    135          IF idxt(0) NE -1 THEN t (idxt) = 0. 
    136          IF idxt(0) NE -1 THEN s (idxt) = 0. 
     137         IF idxt[0] NE -1 THEN t [idxt] = 0. 
     138         IF idxt[0] NE -1 THEN s [idxt] = 0. 
    137139      ENDELSE  
    138140 
     
    140142      maskw = w LT valmask/10. 
    141143      w_T = 0.5*( w*maskw + shift(w, 0, 0, -1, 0)*shift(maskw, 0, 0, -1, 0) ) 
    142       w_T(*, *, (size(w))(3)-1, *) = w_T(*, *, (size(w))(3)-2, *) 
     144      w_T[*, *, (size(w))[3]-1, *] = w_T[*, *, (size(w))[3]-2, *] 
    143145      w = 0  
    144146      maskw = 0  ; free memory 
     
    152154         maskw = w LT valmask/10. 
    153155         w_T = 0.5*( w*maskw + shift(w, 0, 0, -1, 0)*shift(maskw, 0, 0, -1, 0) ) 
    154          w_T(*, *, (size(w))(3)-1, *) = w_T(*, *, (size(w))(3)-2, *) 
     156         w_T[*, *, (size(w))[3]-1, *] = w_T[*, *, (size(w))[3]-2, *] 
    155157         w = 0  
    156          w_T(idx_t) = valmask 
     158         w_T[idx_t] = valmask 
    157159         maskw = 0 ; free memory 
    158160      ENDIF ELSE w_T = w 
    159161       
    160       idx_2d = where (u(*, *, 0, 0) GT valmask/10.) 
    161       IF idx_2d(0) NE -1 THEN tx(idx_2d) = valmask 
    162       idx_2d = where (v(*, *, 0, 0) GT valmask/10.) 
    163       IF idx_2d(0) NE -1 THEN ty(idx_2d) = valmask 
     162      idx_2d = where (u[*, *, 0, 0] GT valmask/10.) 
     163      IF idx_2d[0] NE -1 THEN tx[idx_2d] = valmask 
     164      idx_2d = where (v[*, *, 0, 0] GT valmask/10.) 
     165      IF idx_2d[0] NE -1 THEN ty[idx_2d] = valmask 
    164166      idx = where (t LT valmask/10.) 
    165167      IF t_unit NE "C" THEN BEGIN  
    166          IF idx(0) NE -1 THEN t(idx) = t(idx)-273.15 
     168         IF idx[0] NE -1 THEN t[idx] = t[idx]-273.15 
    167169      ENDIF  
    168170      idx1 = n_elements(idx_t) 
     
    172174         print, ' *** WARNING wo and thetao do not have same masks !', idx1, idx2, min(idx_t -idx_w), max(idx_t- idx_w) 
    173175         print, ' *** Setting wo to zero on all masked points' 
    174          w_T(idx_w) = 0. 
     176         w_T[idx_w] = 0. 
    175177      ENDIF ELSE print, '       check these are 0 (W,T): ', min(idx_t -idx_w), max(idx_t- idx_w) 
    176178      w = 0 & idx = 0 & idx_t = 0 & idx_w = 0 ; free memory 
     
    178180      idxs=where(s GT valmask/10.) 
    179181      IF source_model EQ 'ipcc' THEN print, '       check these are 0 (T,S): ', min(idxt -idxs), max(idxt-idxs) 
    180       IF idxt[0] NE -1 THEN t(idxt)=0. 
    181       IF idxs[0] NE -1 THEN s(idxs)=0. 
     182      IF idxt[0] NE -1 THEN t[idxt]=0. 
     183      IF idxs[0] NE -1 THEN s[idxs]=0. 
    182184      idxs = 0                  ; free memory 
    183185 
     
    198200   rhop = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1)   
    199201   print, '      rhop min/max', min(rhop), max(rhop) 
    200    IF idxt[0] NE -1 THEN rhop(idxt) = valmask 
     202   IF idxt[0] NE -1 THEN rhop[idxt] = valmask 
    201203   sr = 0 & r1 = 0 &  r2 = 0 &  r3 = 0 & t = 0 & s = 0 ; free memory 
    202204 
     
    216218   rho_diff = (rho_s-shift(rho_s,-1))/shift(e3w, -1) 
    217219   rho_diff = shift(temporary(rho_diff), 1) 
    218    rho_diff(0) = 0. 
     220   rho_diff[0] = 0. 
    219221 
    220222; transform onto T grid 
    221223 
    222224   rho_diff_T = 0.5*(rho_diff+shift(rho_diff, -1)) 
    223    rho_diff_T((size(rho_diff))(1)-1) = rho_diff((size(rho_diff))(1)-2) 
     225   rho_diff_T[(size(rho_diff))[1]-1] = rho_diff[(size(rho_diff))[1]-2] 
    224226 
    225227   stab_inv = ABS(1./rho_diff_T) 
     
    241243 
    242244   int_val2 = ((rhop-rho_s4d)^2)*stab_inv 
    243    IF idxt[0] NE -1 THEN int_val2(idxt) = 0. 
     245   IF idxt[0] NE -1 THEN int_val2[idxt] = 0. 
    244246 
    245247   print, '     compute APE...' 
     
    257259 
    258260   int_val = (rhop-rho_s4d)*(w_T) 
    259    IF idxt[0] NE -1 THEN int_val(idxt) = 0. 
     261   IF idxt[0] NE -1 THEN int_val[idxt] = 0. 
    260262 
    261263; remove first 2 levels (MXL too unstable) 
     
    284286   idyv = where(vmean GT valmask/10.) 
    285287 
    286    IF idx[0] NE -1 THEN tx(idx) = 0. 
    287    IF idy[0] NE -1 THEN ty(idy) = 0. 
    288    IF idxu[0] NE -1 THEN umean(idxu) = 0. 
    289    IF idyv[0] NE -1 THEN vmean(idyv) = 0. 
     288   IF idx[0] NE -1 THEN tx[idx] = 0. 
     289   IF idy[0] NE -1 THEN ty[idy] = 0. 
     290   IF idxu[0] NE -1 THEN umean[idxu] = 0. 
     291   IF idyv[0] NE -1 THEN vmean[idyv] = 0. 
    290292 
    291293   dot_prodx = tx*umean 
     
    358360 
    359361   maxdepth = 10 
    360    IF gdept(0) GT maxdepth THEN maxdepth = gdept(0) 
     362   IF gdept[0] GT maxdepth THEN maxdepth = gdept[0] 
    361363 
    362364   ;domdef, [210., 280., -5., 5., 0., maxdepth] 
  • trunk/procs/macros/make_eos.pro

    r168 r169  
    6262         , ZMTYP=zmtyp 
    6363; 
     64  compile_opt idl2, strictarrsubs 
     65; 
    6466@common 
    6567@com_eg 
     
    7779   idxt=where(t eq valmask) 
    7880   idxs=where(s eq valmask) 
    79    IF idxt[0] NE -1 THEN t(idxt)=0. 
    80    IF idxs[0] NE -1 THEN s(idxs)=0. 
     81   IF idxt[0] NE -1 THEN t[idxt]=0. 
     82   IF idxs[0] NE -1 THEN s[idxs]=0. 
    8183; 
    8284; potential volumic mass 
     
    8991   rhopn = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1) 
    9092 
    91    IF idxs[0] NE -1 THEN rhopn(idxt) = valmask 
     93   IF idxs[0] NE -1 THEN rhopn[idxt] = valmask 
    9294 
    9395   fdirec = tn.direc 
     
    108110      remove_dim = 1 
    109111      fdirec = 'xyt' 
    110       name_suff = ' averaged in '+vert_type+'['+strtrim(string(vert_mean(0)), 2)+','+strtrim(string(vert_mean(1)), 2)+']' 
     112      name_suff = ' averaged in '+vert_type+'['+strtrim(string(vert_mean[0]), 2)+','+strtrim(string(vert_mean[1]), 2)+']' 
    111113      flegend = name_suff 
    112114   ENDIF  
  • trunk/procs/macros/make_eos_sal.pro

    r168 r169  
    5252         , ZMTYP=zmtyp 
    5353; 
     54  compile_opt idl2, strictarrsubs 
     55; 
    5456@common 
    5557@com_eg 
     
    6769   idxt=where(t eq valmask) 
    6870   idxs=where(s eq valmask) 
    69    IF idxt[0] NE -1 THEN t(idxt)=0. 
    70    IF idxs[0] NE -1 THEN s(idxs)=0. 
     71   IF idxt[0] NE -1 THEN t[idxt]=0. 
     72   IF idxs[0] NE -1 THEN s[idxs]=0. 
    7173; 
    7274; potential volumic mass 
     
    7981   rhopn = ( ( 0.0E-4*s + 0.0*r3*sr +r2)*s +0.0*r1) 
    8082 
    81    IF idxs[0] NE -1 THEN rhopn(idxt) = valmask 
     83   IF idxs[0] NE -1 THEN rhopn[idxt] = valmask 
    8284 
    8385   fdirec = tn.direc 
     
    98100      remove_dim = 1 
    99101      fdirec = 'xyt' 
    100       name_suff = ' averaged in '+vert_type+'['+strtrim(string(vert_mean(0)), 2)+','+strtrim(string(vert_mean(1)), 2)+']' 
     102      name_suff = ' averaged in '+vert_type+'['+strtrim(string(vert_mean[0]), 2)+','+strtrim(string(vert_mean[1]), 2)+']' 
    101103      flegend = name_suff 
    102104   ENDIF  
  • trunk/procs/macros/make_eos_tem.pro

    r168 r169  
    4949         , ZMTYP=zmtyp 
    5050; 
     51  compile_opt idl2, strictarrsubs 
     52; 
    5153@common 
    5254@com_eg 
     
    6466   idxt=where(t eq valmask) 
    6567   idxs=where(s eq valmask) 
    66    IF idxt[0] NE -1 THEN t(idxt)=0. 
    67    IF idxs[0] NE -1 THEN s(idxs)=0. 
     68   IF idxt[0] NE -1 THEN t[idxt]=0. 
     69   IF idxs[0] NE -1 THEN s[idxs]=0. 
    6870; 
    6971; potential volumic mass 
     
    7678   rhopn = ( ( 4.8314E-4*s + r3*sr +r2)*s +r1) 
    7779 
    78    IF idxs[0] NE -1 THEN rhopn(idxt) = valmask 
     80   IF idxs[0] NE -1 THEN rhopn[idxt] = valmask 
    7981 
    8082   fdirec = tn.direc 
     
    9597      remove_dim = 1 
    9698      fdirec = 'xyt' 
    97       name_suff = ' averaged in '+vert_type+'['+strtrim(string(vert_mean(0)), 2)+','+strtrim(string(vert_mean(1)), 2)+']' 
     99      name_suff = ' averaged in '+vert_type+'['+strtrim(string(vert_mean[0]), 2)+','+strtrim(string(vert_mean[1]), 2)+']' 
    98100      flegend = name_suff 
    99101   ENDIF  
  • trunk/procs/macros/make_grad.pro

    r165 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_interp.pro

    r165 r169  
    1616         , ALL_DATA=all_data $ 
    1717         , ZMTYP=zmtyp 
     18; 
     19  compile_opt idl2, strictarrsubs 
    1820; 
    1921@common 
     
    5658   IF( idx[0] EQ -1 ) THEN STOP, 'STOP. Something wrong in the data' 
    5759    
    58    interp(idx) = ( nb EQ 6 ) ? coef1*var1.data(idx) + coef2*var2.data(idx) + coef3*var3.data(idx) : coef1*var1.data(idx) + coef2*var2.data(idx) 
     60   interp[idx] = ( nb EQ 6 ) ? coef1*var1.data[idx] + coef2*var2.data[idx] + coef3*var3.data[idx] : coef1*var1.data[idx] + coef2*var2.data[idx] 
    5961 
    6062   legend = ( nb EQ 6 ) ? ' : ('+strtrim(string(coef1), 2)+')*'+varname1+'+('+ strtrim(string(coef2), 2)+')*'+varname2+'+('+ strtrim(string(coef3), 2)+')*'+varname3 : ' : ('+strtrim(string(coef1), 2)+')*'+varname1+'+('+ strtrim(string(coef2), 2)+')*'+varname2 
     
    7274 
    7375END 
    74  
    75  
    76  
  • trunk/procs/macros/make_linfit.pro

    r168 r169  
    1212         , TIME_2=time_2 $ 
    1313         , ALL_DATA=all_data 
     14; 
     15  compile_opt idl2, strictarrsubs 
    1416; 
    1517@common 
     
    5557      IF debug_w THEN print, '   month idx/value: ', imth, strd(imth) 
    5658 
    57       data1 = (var1.data)[*, *, reform(idxm(imth,*), njpt)]         
    58       data2 = (var2.data)[*, *, reform(idxm(imth,*), njpt)]         
     59      data1 = (var1.data)[*, *, reform(idxm[imth,*], njpt)]         
     60      data2 = (var2.data)[*, *, reform(idxm[imth,*], njpt)]         
    5961      nval = njpt 
    6062    
     
    6668         IF data1(idx, idy, 0) LT valmask/10. THEN BEGIN  
    6769 
    68             x1i = reform(data1(idx, idy, *), nval) 
    69             x2i = reform(data2(idx, idy, *), nval) 
    70             x1 = x1i-mean(x1i) 
    71             x2 = x2i-mean(x2i) 
     70            x1i = reform(data1[idx, idy, *], nval) 
     71            x2i = reform(data2[idx, idy, *], nval) 
     72            x1 = x1i-mean[x1i] 
     73            x2 = x2i-mean[x2i] 
    7274 
    7375            no_compute = 0 
     
    8183               IF (size(idt))[1] GE 3  THEN BEGIN  
    8284                  IF idt[0] NE -1 THEN BEGIN  
    83                      x1 = x1(idt) 
    84                      x2 = x2(idt) 
     85                     x1 = x1[idt] 
     86                     x2 = x2[idt] 
    8587                  ENDIF  
    8688               ENDIF ELSE BEGIN  
     
    98100 
    99101               coeffl = linfit(x2, x1, CHISQ = linerrl, PROB = proberrl, SIGMA = sigmaerrl) 
    100                correl = c_timecorrelate(x2,x1) 
    101                pt_linfit(idx, idy) = pt_linfit(idx, idy)+coeffl(1) 
    102                pt_err(idx, idy) = min(pt_err(idx, idy), proberrl) 
    103                pt_corr(idx, idy) = pt_corr(idx, idy) + correl 
     102               correl = c_timecorrelate[x2,x1] 
     103               pt_linfit[idx, idy] = pt_linfit[idx, idy]+coeffl[1] 
     104               pt_err[idx, idy] = min(pt_err[idx, idy], proberrl) 
     105               pt_corr[idx, idy] = pt_corr[idx, idy] + correl 
    104106                
    105107               IF debug_w THEN BEGIN   
     
    107109                     print, '  idx, idy, linfit_map ', idx, idy, linfit_map 
    108110                     print, '  size(idt)',size(idt) 
    109                      print, '  pt_linfit, correl = ',coeffl(1), correl 
     111                     print, '  pt_linfit, correl = ',coeffl[1], correl 
    110112                  ENDIF  
    111113               ENDIF  
    112114            ENDIF ELSE BEGIN  
    113                pt_linfit(idx, idy) = valmask 
    114                pt_err(idx, idy) = 0. 
    115                pt_corr(idx, idy) = 0. 
     115               pt_linfit[idx, idy] = valmask 
     116               pt_err[idx, idy] = 0. 
     117               pt_corr[idx, idy] = 0. 
    116118            ENDELSE  
    117119 
    118120         ENDIF ELSE BEGIN  
    119             pt_linfit(idx, idy) = valmask 
    120             pt_err(idx, idy) = 0. 
    121             pt_corr(idx, idy) = 0. 
     121            pt_linfit[idx, idy] = valmask 
     122            pt_err[idx, idy] = 0. 
     123            pt_corr[idx, idy] = 0. 
    122124         ENDELSE  
    123125 
     
    130132   pt_linfit = pt_linfit/float(nmth) 
    131133   pt_corr = pt_corr/float(nmth) 
    132    IF idm[0] NE -1 THEN pt_linfit(idm) = valmask 
     134   IF idm[0] NE -1 THEN pt_linfit[idm] = valmask 
    133135 
    134136  ; only take points where correlation larger than 0.2 
    135137 
    136138   idc = where(abs(pt_corr) LT corr_thres) 
    137    IF idc[0] NE -1 THEN pt_linfit(idc) = !values.f_nan 
     139   IF idc[0] NE -1 THEN pt_linfit[idc] = !values.f_nan 
    138140 
    139141   corr_txt = '[r>'+strtrim(string(corr_thres, format = '(f5.2)'), 2)+']' 
  • trunk/procs/macros/make_linfitdom.pro

    r168 r169  
    1212         , TIME_2=time_2 $ 
    1313         , ALL_DATA=all_data 
     14; 
     15  compile_opt idl2, strictarrsubs 
    1416; 
    1517@common 
     
    6264      IF debug_w THEN print, '   month idx/value: ', imth, strd(imth) 
    6365 
    64       data1 = (var1.data)[*, *, reform(idxm(imth,*), njpt)]         
    65       var_domc = (var_dom)[reform(idxm(imth,*), njpt)]         
     66      data1 = (var1.data)[*, *, reform(idxm[imth,*], njpt)]         
     67      var_domc = (var_dom)[reform(idxm[imth,*], njpt)]         
    6668      var_domc = var_domc-mean(var_domc) 
    6769      nval = njpt 
     
    7173      FOR idx = 0, nxa-1 DO FOR idy = 0, nya-1 DO BEGIN 
    7274 
    73          IF data1(idx, idy, 0) NE valmask THEN BEGIN  
     75         IF data1[idx, idy, 0] NE valmask THEN BEGIN  
    7476 
    75             x1i = reform(data1(idx, idy, *), nval) 
    76             x1 = x1i-mean(x1i) 
     77            x1i = reform(data1[idx, idy, *], nval) 
     78            x1 = x1i-mean[x1i] 
    7779  
    7880            IF linfit_map NE '' THEN BEGIN 
     
    8284                  ELSE: idt = where (var_domc GE linfit_sep) 
    8385               ENDCASE  
    84                x1 = x1(idt) 
    85                var_domc = var_domc(idt) 
     86               x1 = x1[idt] 
     87               var_domc = var_domc[idt] 
    8688            ENDIF  
    8789             
    8890            coeffl = linfit(var_domc, x1, CHISQ = linerrl, PROB = proberrl, SIGMA = sigmaerrl) 
    89             correl = c_timecorrelate(var_domc,x1) 
    90             pt_linfit(idx, idy) = pt_linfit(idx, idy)+coeffl(1) 
    91             pt_err(idx, idy) = min(pt_err(idx, idy), proberrl) 
    92             pt_corr(idx, idy) = pt_corr(idx, idy) + correl 
     91            correl = c_timecorrelate[var_domc,x1] 
     92            pt_linfit[idx, idy] = pt_linfit[idx, idy]+coeffl[1] 
     93            pt_err[idx, idy] = min[pt_err[idx, idy], proberrl] 
     94            pt_corr[idx, idy] = pt_corr[idx, idy] + correl 
    9395 
    9496            IF debug_w THEN BEGIN   
     
    9698                  print, '  idx, idy, linfit_map ', idx, idy, linfit_map 
    9799                  print, '  size(idt)',size(idt) 
    98                   print, '  pt_linfit, correl = ',coeffl(1), correl 
     100                  print, '  pt_linfit, correl = ',coeffl[1], correl 
    99101                  stop 
    100102               ENDIF  
     
    102104 
    103105         ENDIF ELSE BEGIN  
    104             pt_linfit(idx, idy) = valmask 
    105             pt_err(idx, idy) = 0. 
    106             pt_corr(idx, idy) = 0. 
     106            pt_linfit[idx, idy] = valmask 
     107            pt_err[idx, idy] = 0. 
     108            pt_corr[idx, idy] = 0. 
    107109         ENDELSE  
    108110 
     
    115117   pt_linfit = pt_linfit/float(nmth) 
    116118   pt_corr = pt_corr/float(nmth) 
    117    IF idm[0] NE -1 THEN pt_linfit(idm) = valmask 
     119   IF idm[0] NE -1 THEN pt_linfit[idm] = valmask 
    118120 
    119121  ; only take points where ABS(correlation) larger than a value 
    120122 
    121123   idc = where(abs(pt_corr) LT corr_thres) 
    122    pt_linfit(idc) = !values.f_nan 
     124   pt_linfit[idc] = !values.f_nan 
    123125   corr_txt = '[r>'+strtrim(string(corr_thres, format = '(f5.2)'), 2)+']' 
    124126 
  • trunk/procs/macros/make_msf.pro

    r168 r169  
    1414         , ZMTYP=zmtyp 
    1515; 
     16  compile_opt idl2, strictarrsubs 
     17; 
    1618@common 
    1719@com_eg 
     
    2729 
    2830   idx = where(v.data EQ valmask) 
    29    IF idx(0) NE -1 THEN v.data(idx) = 0.0 
     31   IF idx[0] NE -1 THEN v.data[idx] = 0.0 
    3032; 
    3133; Mask bathymetry ? 
     
    4951   IF full_name EQ 'atlantic' OR full_name EQ 'pacific' $ 
    5052    OR full_name EQ 'indopacific' OR full_name EQ 'indian' THEN BEGIN 
    51       idx = where (gphit(diaznl_idx+key_shift, *) LE -32.) 
     53      idx = where (gphit[diaznl_idx+key_shift, *] LE -32.) 
    5254      msf[idx, *] = valmask 
    5355   ENDIF ELSE BEGIN 
  • trunk/procs/macros/make_msf2.pro

    r165 r169  
    1313         , ZMTYP=zmtyp 
    1414; 
     15  compile_opt idl2, strictarrsubs 
     16; 
    1517@common 
    1618@com_eg 
     
    2628 
    2729   idx = where(v.data EQ valmask) 
    28    IF idx(0) NE -1 THEN v.data(idx) = 0.0 
     30   IF idx[0] NE -1 THEN v.data[idx] = 0.0 
    2931; 
    3032; Mask bathymetry ? 
     
    3941            full_name = strmid(full_name, 5, 50) 
    4042            maskzm = maskread(full_name, 'orca', /d3) 
    41             maskzm = reform((reform(maskzm(*, *, *), jpi*jpj*jpk, /overwrite)#replicate(1, jpt)),jpi, jpj, jpk, jpt, /overwrite) 
     43            maskzm = reform((reform(maskzm[*, *, *], jpi*jpj*jpk, /overwrite)#replicate(1, jpt)),jpi, jpj, jpk, jpt, /overwrite) 
    4244            v.data = v.data*maskzm 
    4345; reduction du champ de vitesse meridienne a la bathymetrique. 
     
    5658   IF full_name EQ 'atlantic' OR full_name EQ 'pacific' $ 
    5759    OR full_name EQ 'indopacific' OR full_name EQ 'indian' THEN BEGIN 
    58       idx = where (gphit(diaznl_idx+key_shift, *) LE -32.) 
     60      idx = where (gphit[diaznl_idx+key_shift, *] LE -32.) 
    5961      msf[idx, *,*] = valmask 
    6062   ENDIF ELSE BEGIN 
     
    8284;pas de condition : equivalent a msf_mean=0  ---> plot yz a la date T 
    8385IF msf_mean EQ 1 THEN BEGIN 
    84 field = {name: '', data: msf(*,*,0), legend: '', units: 'm3/s', origin: '', dim: 2, direc:'yz'} 
     86field = {name: '', data: msf[*,*,0], legend: '', units: 'm3/s', origin: '', dim: 2, direc:'yz'} 
    8587ENDIF 
    8688 
  • trunk/procs/macros/make_ratio.pro

    r165 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
     
    5355    IF( idx[0] EQ -1 ) THEN STOP, 'STOP. Division cannot be computed' 
    5456 
    55     div(idx) = ( var_a.data(idx) - var_b.data(idx) )/( diff(idx) ) 
     57    div[idx] = ( var_a.data[idx] - var_b.data[idx] )/( diff[idx] ) 
    5658    legend = ' : ( '+a+' - '+b+' ) / ( '+c+' - '+d+' )' 
    5759 
     
    6062   IF ( (size(tab_var))[1] EQ 2 ) THEN BEGIN 
    6163 
    62     a = strtrim(tab_var(0), 2) 
    63     b = strtrim(tab_var(1), 2) 
     64    a = strtrim(tab_var[0], 2) 
     65    b = strtrim(tab_var[1], 2) 
    6466 
    6567    print, 'a : ', a 
     
    7577    IF( idx[0] EQ -1 ) THEN STOP, 'STOP. Division cannot be computed' 
    7678 
    77     div(idx) = ( var_a.data(idx) )/( var_b.data(idx)  ) 
     79    div[idx] = ( var_a.data[idx] )/( var_b.data[idx]  ) 
    7880    legend = ' : '+a+' / '+b 
    7981 
     
    9294 
    9395END 
    94  
    95    
    96  
    97  
    98  
    99  
    100  
    101  
    102  
    103  
    104  
    105  
    106  
    107  
    108   
  • trunk/procs/macros/make_skewness.pro

    r168 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_sobwlmax.pro

    r165 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_stddev.pro

    r168 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
     
    4446      IF debug_w THEN print, '   month idx/value: ', imth, strd(imth) 
    4547 
    46       data = (mfld.data)[*, *, reform(idxm(imth,*), njpt)]         
     48      data = (mfld.data)[*, *, reform(idxm[imth,*], njpt)]         
    4749      nval = njpt 
    4850   ; compute std dev 
     
    5658   stdw = stdw/float(nmth) 
    5759 
    58    IF idm[0] NE -1 THEN stdw(idm) = valmask 
     60   IF idm[0] NE -1 THEN stdw[idm] = valmask 
    5961 
    6062   varname = varname+' '+ntxt 
     
    6466      std_tot = a_timecorrelate(mfld.data, 0,/covariance) 
    6567      std_tot = sqrt( jpt/(jpt-1)*std_tot ) 
    66       IF idm[0] NE -1 THEN std_tot(idm) = valmask 
     68      IF idm[0] NE -1 THEN std_tot[idm] = valmask 
    6769      idx_diff = WHERE (stdw NE valmask) 
    68       stdw(idx_diff) = stdw(idx_diff) - std_tot(idx_diff) 
     70      stdw[idx_diff] = stdw[idx_diff] - std_tot[idx_diff] 
    6971   ENDIF 
    7072 
  • trunk/procs/macros/make_thdepth.pro

    r168 r169  
    1212         , TIME_2=time_2 $ 
    1313         , ALL_DATA=all_data 
     14; 
     15  compile_opt idl2, strictarrsubs 
    1416; 
    1517@common 
     
    4345; depth is a linear interpolation 
    4446 
    45    hd20 = gdept(ik20c)  
     47   hd20 = gdept[ik20c] 
    4648   IF debug_w THEN help, hd20 
    4749   IF debug_w THEN print, 'min(hd20), max(hd20) : ', min(hd20), max(hd20) 
    4850 
    4951   IF valmask EQ 0. THEN BEGIN  
    50       tempm = tmask(firstxt:lastxt, firstyt:lastyt, firstzt:lastzt) 
     52      tempm = tmask[firstxt:lastxt, firstyt:lastyt, firstzt:lastzt] 
    5153      idm = where (tempm EQ 0) 
    52       tn.data(idm) = 1.e20 
     54      tn.data[idm] = 1.e20 
    5355      valmask = 1.e20 
    5456      tempm = 0 
     
    5759   FOR jj = 0, (size(tn.data))[2]-1 DO BEGIN  
    5860      FOR ji = 0, (size(tn.data))[1]-1 DO BEGIN  
    59          IF tn.data(ji, jj, 0) LT valmask/10. THEN BEGIN  
    60             hd20[ji, jj] = gdept(ik20c[ji, jj]) + $ 
    61              ( gdept(ik20c[ji, jj]+1)-gdept(ik20c[ji, jj]) ) $ 
    62              * tmask(ji, jj, ik20c[ji, jj]+1) * ( 20. - tn.data(ji, jj, ik20c[ji, jj]) ) $ 
    63              / ( tn.data(ji, jj, ik20c[ji, jj]+1) - tn.data(ji, jj, ik20c[ji, jj]) )  
     61         IF tn.data[ji, jj, 0] LT valmask/10. THEN BEGIN  
     62            hd20[ji, jj] = gdept[ik20c[ji, jj]] + $ 
     63             ( gdept[ik20c[ji, jj]+1]-gdept[ik20c[ji, jj]] ) $ 
     64             * tmask[ji, jj, ik20c[ji, jj]+1] * ( 20. - tn.data[ji, jj, ik20c[ji, jj]] ) $ 
     65             / ( tn.data[ji, jj, ik20c[ji, jj]+1] - tn.data[ji, jj, ik20c[ji, jj]] )  
    6466         ENDIF ELSE hd20[ji, jj] = !values.f_nan 
    6567      ENDFOR   
     
    7274 
    7375; bound by the ocean depth, minimum value, first T-point depth 
    74 ;          hd20(ji,jj) = min( zd20, fsdepw(ji,jj,mbathy(ji,jj)) ) 
     76;          hd20[ji,jj] = min( zd20, fsdepw(ji,jj,mbathy(ji,jj)) ) 
    7577 
    7678   field = {name: '', data: hd20, legend: '', units: '', origin: '', dim: 2, direc:'xy'} 
  • trunk/procs/macros/make_transfo.pro

    r168 r169  
    2121         , ZMTYP=zmtyp 
    2222; 
     23  compile_opt idl2, strictarrsubs 
     24; 
    2325@common 
    2426@com_eg 
     
    3840   idxt=where(sst eq valmask) 
    3941   idxs=where(sss eq valmask) 
    40    IF idxt[0] NE -1 THEN sst(idxt)=0. 
    41    IF idxs[0] NE -1 THEN sss(idxs)=0.    
     42   IF idxt[0] NE -1 THEN sst[idxt]=0. 
     43   IF idxs[0] NE -1 THEN sss[idxs]=0.    
    4244 
    4345; Compute potential density (sigma_0) 
    4446                                                      
    45    rho0 = eos(sst, sss)-1000. 
    46    IF idxs[0] NE -1 THEN rho0(idxt) = valmask    
    47  
     47   rho0 = eos[sst, sss]-1000. 
     48   IF idxs[0] NE -1 THEN rho0[idxt] = valmask    
    4849 
    4950; Define density grid 
     
    8990 
    9091   trf_bin = fltarr(n_sig+1) 
    91    trf_bin(*) = 0.  
     92   trf_bin[*] = 0.  
    9293; 
    9394;  Loop on 2D domain (and time as '*' dimension) 
     
    9697      FOR jj = 0, (jpj-1) DO BEGIN  
    9798  
    98          IF rho0(ji, jj, 0) NE valmask THEN BEGIN  
     99         IF rho0[ji, jj, 0] NE valmask THEN BEGIN  
    99100; 
    100101;        input fields 
    101             t = sst(ji, jj, *) 
    102             s = sss(ji, jj, *) 
    103             hf = hef(ji, jj, *) 
    104             ep = emp(ji, jj, *) 
    105             sig = rho0(ji, jj, *)  
     102            t = sst[ji, jj, *] 
     103            s = sss[ji, jj, *] 
     104            hf = hef[ji, jj, *] 
     105            ep = emp[ji, jj, *] 
     106            sig = rho0[ji, jj, *]  
    106107 
    107108;        compte alpha, beta, Cp 
    108             al = alpha(t, s, P) 
    109             be = betar(t, s, P) 
    110             Cp = Cpsw(t, s, P) 
     109            al = alpha[t, s, P] 
     110            be = betar[t, s, P] 
     111            Cp = Cpsw[t, s, P] 
    111112 
    112113;        find density bin 
     
    118119;        compute area and integral of fluxes 
    119120 
    120             dA = e1t(ji, jj)*e2t(ji, jj) 
     121            dA = e1t[ji, jj]*e2t[ji, jj] 
    121122        ; conv = m2 -> 1.e6 km2 
    122123            conv = 1.e-6*1.e-6 
     
    132133 
    133134            FOR jt = 0, (jpt-1) DO BEGIN  
    134                area(ib(jt), jt) = area(ib(jt), jt) + dA 
    135                nval(ib(jt), jt) = nval(ib(jt), jt) + 1 
     135               area[ib[jt], jt] = area[ib[jt], jt] + dA 
     136               nval[ib[jt], jt] = nval[ib[jt], jt] + 1 
    136137            ENDFOR  
    137138 
     
    139140;        convwf : kg/m2/s=mm/s -> m/s 
    140141            convwf = 1.e-3 
    141             fheat(ji, jj, *) = ( -al/Cp)*hf 
    142             fwafl(ji, jj, *) = (1000.+sig)*be*s*ep*convwf 
     142            fheat[ji, jj, *] = ( -al/Cp)*hf 
     143            fwafl[ji, jj, *] = (1000.+sig)*be*s*ep*convwf 
    143144 
    144145;        volume transport per density class (m3/s) 
    145146;        period averaged density flux 
    146147            FOR jt = 0, (jpt-1) DO BEGIN  
    147                fht = fheat(ji, jj, jt)*dA 
    148                fwf = fwafl(ji, jj, jt)*dA 
    149                hist(ib(jt), jt) = hist(ib(jt), jt) + (fht+fwf)/drho 
    150                histwf(ib(jt), jt) = histwf(ib(jt), jt) + fwf/drho 
     148               fht = fheat[ji, jj, jt]*dA 
     149               fwf = fwafl[ji, jj, jt]*dA 
     150               hist[ib[jt], jt] = hist[ib[jt], jt] + (fht+fwf)/drho 
     151               histwf[ib[jt], jt] = histwf[ib[jt], jt] + fwf/drho 
    151152               fluxbar = fluxbar + (fht+fwf)*dt 
    152153               fluxsal = fluxsal + (fwf)*dt 
  • trunk/procs/macros/make_wcurl.pro

    r168 r169  
    1313         , ZMTYP=zmtyp $ 
    1414         , ALL_DATA=all_data 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_wdiv.pro

    r165 r169  
    1313         , ZMTYP=zmtyp $ 
    1414         , ALL_DATA=all_data 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_wm.pro

    r168 r169  
    1313         , ALL_DATA=all_data $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/macros/make_work.pro

    r165 r169  
    1111         , TIME_2=time_2 $ 
    1212         , ZMTYP=zmtyp 
     13; 
     14  compile_opt idl2, strictarrsubs 
    1315; 
    1416@common 
     
    4244 
    4345   work = glamt 
    44    work(*, *) = 0. 
     46   work[*, *] = 0. 
    4547   alpha = glamt 
    46    alpha(*, *) = 0. 
     48   alpha[*, *] = 0. 
    4749 
    4850   A = ((glamu-x0)^2)/(a1^2) + ((gphiu-y0)^2)/b1^2 
     
    5052 
    5153   idx = where(A LE 1.)  
    52    work(idx) = 1. 
     54   work[idx] = 1. 
    5355   idx = where((A0-A) NE 0)  
    54    alpha(idx) = (A0(idx)-1)*A(idx)/(A0(idx)-A(idx)) 
     56   alpha[idx] = (A0[idx]-1)*A[idx]/(A0[idx]-A[idx]) 
    5557   idx = where(A GT 1 AND A0 LE 1) 
    56    work(idx) = alpha(idx) 
     58   work[idx] = alpha[idx] 
    5759 
    58    VALMASK = 1.e20 
     60   valmask = 1.e20 
    5961 
    6062   field = {name: '', data: work, legend: '', units: '', origin: '', dim: 0, direc:''} 
     
    6567 
    6668   return, field 
    67 END  
     69END 
  • trunk/procs/macros/make_wwv.pro

    r165 r169  
    1212         , TIME_2=time_2 $ 
    1313         , ALL_DATA=all_data 
     14; 
     15  compile_opt idl2, strictarrsubs 
    1416; 
    1517@common 
     
    6971      FOR jj = 0, nyt-1 DO BEGIN  
    7072         FOR ji = 0, nxt-1 DO BEGIN 
    71             IF tn.data(ji, jj, 0, jt) LT valmask/10. THEN BEGIN  
    72                idx20 = ik20c(ji, jj, jt) 
     73            IF tn.data[ji, jj, 0, jt] LT valmask/10. THEN BEGIN  
     74               idx20 = ik20c[ji, jj, jt] 
    7375               IF idx20 GE 0 THEN BEGIN 
    74                   hd20[ji, jj, jt] = gdept(idx20) +$ 
     76                  hd20[ji, jj, jt] = gdept[idx20] +$ 
    7577                    
    76                   ( gdept(idx20+1)- gdept(idx20) ) * $ ;DELTAZ entre les niveaux i et i+1 
    77                    mask(ji, jj, idx20+1) * ( thermo - tn.data(ji, jj, idx20, jt) )  $ ;DELTAT entre la hd20 et le niveau i 
    78                    / ( tn.data(ji, jj, idx20+1, jt) - tn.data(ji, jj, idx20, jt) ) ;variation de T entre les niveau i et i+1(dT/dz)  
     78                  ( gdept[idx20+1]- gdept[idx20] ) * $ ;DELTAZ entre les niveaux i et i+1 
     79                   mask[ji, jj, idx20+1] * ( thermo - tn.data[ji, jj, idx20, jt] )  $ ;DELTAT entre la hd20 et le niveau i 
     80                   / ( tn.data[ji, jj, idx20+1, jt] - tn.data[ji, jj, idx20, jt] ) ;variation de T entre les niveau i et i+1(dT/dz)  
    7981               ENDIF 
    8082            ENDIF ELSE BEGIN hd20[ji, jj, *] = -1. 
     
    9597         FOR ji = 0, nxt-1 DO BEGIN 
    9698            IF hd20[ji, jj, jt] NE -1. THEN BEGIN 
    97                wwv(jt) = wwv(jt) + hd20[ji, jj,jt]*e1t[firstx+ji, firsty+jj]*e2t[firstx+ji, firsty+jj] 
     99               wwv[jt] = wwv[jt] + hd20[ji, jj,jt]*e1t[firstx+ji, firsty+jj]*e2t[firstx+ji, firsty+jj] 
    98100            ENDIF 
    99101         ENDFOR 
     
    105107;-------------------------------------------------------------------------------- 
    106108; bound by the ocean depth, minimum value, first T-point depth 
    107 ;          hd20(ji,jj) = min( zd20, fsdepw(ji,jj,mbathy(ji,jj)) ) 
     109;          hd20[ji,jj] = min( zd20, fsdepw[ji,jj,mbathy[ji,jj]] ) 
    108110   field = {name: '', data: wwv, legend: '', units: '', origin: '', dim: 1, direc:'t'} 
    109111 
  • trunk/procs/macros/make_ytran.pro

    r168 r169  
    1414         , ZMTYP=zmtyp 
    1515; 
     16  compile_opt idl2, strictarrsubs 
     17; 
    1618@common 
    1719@com_eg 
     
    2830 
    2931   idx = where(v.data EQ valmask) 
    30    IF idx(0) NE -1 THEN v.data(idx) = 0.0 
     32   IF idx[0] NE -1 THEN v.data[idx] = 0.0 
    3133 
    3234;  Transport along Y : try = v*e1t*e3t (Sv) 
  • trunk/procs/macros/make_ztran.pro

    r168 r169  
    1313         , TIME_2=time_2 $ 
    1414         , ZMTYP=zmtyp 
     15; 
     16  compile_opt idl2, strictarrsubs 
    1517; 
    1618@common 
  • trunk/procs/mask_z.pro

    r165 r169  
    1010;- 
    1111PRO mask_z, fld, cmd, boite_pltz, dimplot, legz 
     12; 
     13  compile_opt idl2, strictarrsubs 
    1214; 
    1315@common 
     
    3739;               vertical_domain] 
    3840                idxmsk=where(fld eq valmask) 
    39                 IF idxmsk(0) ne -1 THEN BEGIN  
     41                IF idxmsk[0] ne -1 THEN BEGIN  
    4042                    print, '     mask_z: building mask from fld valmask' 
    41                     IF (size(fld))(0) EQ 3 THEN BEGIN 
    42                         zmsk = fld(*,*,1) LT valmask/10. 
     43                    IF (size(fld))[0] EQ 3 THEN BEGIN 
     44                        zmsk = fld[*,*,1] LT valmask/10. 
    4345                    ENDIF ELSE BEGIN  
    4446                        zmsk = fld LT valmask/10. 
     
    6971                     ; mask MSF as field=valmask 
    7072                     idx=where (fld eq valmask) 
    71                      fld (idx) = !values.f_nan 
     73                     fld[idx] = !values.f_nan 
    7274                     boite_pltz = [box_h, vertical_domain] 
    7375                  ENDELSE  
     
    100102                                ; mask MSF as field=valmask 
    101103                           idx=where (fld eq valmask) 
    102                            fld (idx) = !values.f_nan 
     104                           fld[idx] = !values.f_nan 
    103105                           boite_pltz = [box_h, vertical_domain] 
    104106                        ENDELSE   
     
    140142                   boite_pltz = [idx[0], idx[0], boite_pltz[2:5]] 
    141143                   domdef, boite_pltz, /xindex ; indice pour x 
    142                    IF (size(fld))(0) EQ 3 THEN BEGIN 
    143                        tmask[idx[0], firstyt:lastyt, *] = fld(*,*,1) LT valmask/10. 
     144                   IF (size(fld))[0] EQ 3 THEN BEGIN 
     145                       tmask[idx[0], firstyt:lastyt, *] = fld[*,*,1] LT valmask/10. 
    144146                   ENDIF ELSE BEGIN  
    145147                       tmask[idx[0], firstyt:lastyt, *] = fld LT valmask/10. 
     
    190192            zbox = def_box(cmd.plt, dimplot, legz, time_stride) 
    191193            boite_pltz = zbox 
    192             prof1 = gdept(0) 
    193             prof2 = gdept(0) 
     194            prof1 = gdept[0] 
     195            prof2 = gdept[0] 
    194196            IF dimplot EQ 2 THEN BEGIN 
    195197               CASE strmid(cmd.plt, 1, 1) OF  
  • trunk/procs/maskread.pro

    r165 r169  
    2424FUNCTION maskread, bathy, model $ 
    2525         , D3=d3 
     26; 
     27  compile_opt idl2, strictarrsubs 
    2628; 
    2729@common 
     
    103105         iformat = string('(', il3+2, 'i3)') 
    104106         FOR jj = jpjglo-1, 0, -1  DO BEGIN 
    105             zbati(0:ifreq-1) = 0 
     107            zbati[0:ifreq-1] = 0 
    106108            readf, iunit, FORMAT = iformat, ij, zbati 
    107             zbat(il1:il2, jj) = zbati(0:il3) 
     109            zbat[il1:il2, jj] = zbati[0:il3] 
    108110         END 
    109111         il1 = il1 + ifreq 
     
    118120      iformat = string('(', il3+2, 'i3)') 
    119121      FOR jj = jpjglo-1, 0, -1  DO BEGIN 
    120          zbati2(0:irest-1) = 0 
     122         zbati2[0:irest-1] = 0 
    121123         readf, iunit, FORMAT = iformat, ij, zbati2 
    122          zbat(il1:il2, jj) = zbati2(0:il3) 
     124         zbat[il1:il2, jj] = zbati2[0:il3] 
    123125      END 
    124126      ;; 
  • trunk/procs/meshes/build_mesh_glosea.pro

    r168 r169  
    1313    , DELTA_K=delta_k $ 
    1414    , ZONAL=zonal 
    15  
     15; 
     16  compile_opt idl2, strictarrsubs 
     17; 
    1618@common 
    1719@com_eg 
     
    188190 
    189191   isign=where(glamt gt 380.) 
    190    IF isign(0) NE -1 THEN glamt(isign) = glamt(isign)-360. 
     192   IF isign[0] NE -1 THEN glamt[isign] = glamt[isign]-360. 
    191193   isign=where(glamu gt 380.) 
    192    IF isign(0) NE -1 THEN glamu(isign) = glamu(isign)-360. 
     194   IF isign[0] NE -1 THEN glamu[isign] = glamu[isign]-360. 
    193195   isign=where(glamv gt 380.) 
    194    IF isign(0) NE -1 THEN glamv(isign) = glamv(isign)-360. 
     196   IF isign[0] NE -1 THEN glamv[isign] = glamv[isign]-360. 
    195197   isign=where(glamf gt 380.) 
    196    IF isign(0) NE -1 THEN glamf(isign) = glamf(isign)-360. 
     198   IF isign[0] NE -1 THEN glamf[isign] = glamf[isign]-360. 
    197199 
    198200; reduce grid to zonal mean 
  • trunk/procs/meshes/mesh_from_file.pro

    r165 r169  
    77PRO mesh_from_file, model, file_name, ncdf_db, var_name $ 
    88    , ALL_DATA=all_data 
     9; 
     10  compile_opt idl2, strictarrsubs 
    911; 
    1012@common 
     
    3941      idx = where(tmask EQ valmask) 
    4042 
    41       IF idx(0) NE -1 THEN tmask(idx) = 0. 
     43      IF idx[0] NE -1 THEN tmask[idx] = 0. 
    4244      idx = where(tmask LE 50.) 
    43       tmask(idx) = 0. 
     45      tmask[idx] = 0. 
    4446      tmask = tmask < 1 
    4547      tmask = 1-tmask 
  • trunk/procs/meshes/mesh_gaussian.pro

    r165 r169  
    1414    , WHOLE_ARRAYS=whole_arrays $ 
    1515    , GLAMBOUNDARY=glamboundary 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
  • trunk/procs/meshes/mesh_glosea.pro

    r165 r169  
    1515    , NO_SHIFT = no_shift $ 
    1616    , WHOLE_ARRAYS=whole_arrays 
    17  
     17; 
     18  compile_opt idl2, strictarrsubs 
     19; 
    1820@common 
    1921@com_eg 
     
    137139   umask = shift(umask,key_shift, 0, 0) 
    138140 
    139    isign=where(glamt LE glamt(0, 0)) 
    140    IF isign(0) NE -1 THEN glamt(isign) = glamt(isign)+360. 
    141    isign=where(glamu LE glamu(0, 0)) 
    142    IF isign(0) NE -1 THEN glamu(isign) = glamu(isign)+360. 
     141   isign=where(glamt LE glamt[0,0]) 
     142   IF isign(0) NE -1 THEN glamt[isign] = glamt[isign]+360. 
     143   isign=where(glamu LE glamu[0,0]) 
     144   IF isign(0) NE -1 THEN glamu[isign] = glamu[isign]+360. 
    143145 
    144146   glamv = glamu 
  • trunk/procs/meshes/mesh_micom.pro

    r165 r169  
    1717    , H_CONFIG=h_config $ 
    1818    , V_CONFIG=V_config  
    19  
     19; 
     20  compile_opt idl2, strictarrsubs 
     21; 
    2022@common 
    2123@com_eg 
  • trunk/procs/meshes/mesh_orca.pro

    r165 r169  
    1717    , H_CONFIG=h_config $ 
    1818    , V_CONFIG=V_config 
    19  
     19; 
     20  compile_opt idl2, strictarrsubs 
     21; 
    2022@common 
    2123@com_eg 
  • trunk/procs/meshes/mesh_pcmdi.pro

    r165 r169  
    88    , NO_SHIFT=no_shift $ 
    99    , WHOLE_ARRAYS=whole_arrays 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
     
    6062       
    6163      idx = where(tmask EQ valmask)          
    62       IF idx(0) NE -1 THEN tmask(idx) = 0. 
     64      IF idx[0] NE -1 THEN tmask[idx] = 0. 
    6365       
    6466      idx = where(tmask LE 50.) 
    65       tmask(idx) = 0. 
     67      tmask[idx] = 0. 
    6668      tmask = tmask < 1       
    6769      tmask = 1-tmask 
     
    8991    
    9092   return 
    91 END  
    92  
     93END 
  • trunk/procs/meshes/mesh_regular.pro

    r165 r169  
    1818    , REVERSE_Y=reverse_y $ 
    1919    , GLAMBOUNDARY=glamboundary 
     20; 
     21  compile_opt idl2, strictarrsubs 
    2022; 
    2123@common 
  • trunk/procs/meshes/mesh_tao.pro

    r165 r169  
    88    , NO_SHIFT=no_shift $ 
    99    , WHOLE_ARRAYS=whole_arrays 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
     
    5759   ybot = (shift(gphit, 0, +1)+gphit)*0.5*!pi/180.0 
    5860    
    59    ytop(*, jpj-1) = !pi/2 
    60    ybot(*,     0) = -!pi/2 
     61   ytop[*, jpj-1] = !pi/2 
     62   ybot[*,     0] = -!pi/2 
    6163 
    6264   e2t = zrad*(ytop-ybot) 
     
    98100   glamf = 0.5*(shift(glamt, -1, 0)+glamt) 
    99101   gphif = 0.5*(shift(gphit, 0, -1)+gphit) 
    100    glamf(jpi-1, *) = glamf(jpi-2, *) + (glamf(jpi-2, *)-glamf(jpi-3, *)) 
    101    gphif(*, jpj-1) = gphif(*, jpj-2) + (gphif(*, jpj-2)-gphif(*, jpj-3)) 
     102   glamf[jpi-1, *] = glamf[jpi-2, *] + (glamf[jpi-2, *]-glamf[jpi-3, *]) 
     103   gphif[*, jpj-1] = gphif[*, jpj-2] + (gphif[*, jpj-2]-gphif[*, jpj-3]) 
    102104   e1f = e1t 
    103105   e2f = e2t 
  • trunk/procs/meshes/mesh_um.pro

    r165 r169  
    99    , WHOLE_ARRAYS=whole_arrays $ 
    1010    , REVERSE_Y=reverse_y 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
     
    8789      ybot = (shift(gphit, 0, +1)+gphit)*0.5*!pi/180.0 
    8890       
    89       ytop(*, jpj-1) = !pi/2 
    90       ybot(*,     0) = -!pi/2 
     91      ytop[*, jpj-1] = !pi/2 
     92      ybot[*,     0] = -!pi/2 
    9193       
    9294      e2t = zrad*(-ytop+ybot) 
     
    140142            e1t = nc_get(s_file, 'umat.srf') 
    141143            e2t = e1t 
    142             e2t(*) = 1. 
     144            e2t[*] = 1. 
    143145            s_file = hom_idl+'grids/masks_um_N144_nofrac.nc'  
    144146            tmask = nc_get(s_file, 'umat.msk') 
     
    151153            e1t = nc_get(s_file, 'umau.srf') 
    152154            e2t = e1t 
    153             e2t(*) = 1. 
     155            e2t[*] = 1. 
    154156            s_file = hom_idl+'grids/masks_um_N144_nofrac.nc'  
    155157            tmask = nc_get(s_file, 'umau.msk') 
  • trunk/procs/msf_mult.pro

    r165 r169  
    1414PRO msf_mult, v, msf, msfmsk $ 
    1515    , MSK=msk 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
     
    3638; donc cette procedure est ineffective. 
    3739      zvmask = boundperio( (msk +shift(msk, 0, -1) ) < 1 ) 
    38       zvmask = zvmask(*)#vert 
     40      zvmask = zvmask[*]#vert 
    3941      zv = zv*zvmask 
    4042ENDIF  
     
    4648;  calcul du flux 
    4749; 
    48 FOR i = 0, jpi-1 DO BEGIN for j= 0, jpj-1 do begin ze1v(i,j,*,*) = replicate(e1v(i,j),jpk*jpt) & endfor &endfor 
    49 FOR k = 0, jpk-1 DO BEGIN ze3v(*,*,k,*)=replicate(e3t(k),jpi*jpj*jpt) & endfor 
     50FOR i = 0, jpi-1 DO BEGIN for j= 0, jpj-1 do begin ze1v[i,j,*,*] = replicate(e1v[i,j],jpk*jpt) & endfor &endfor 
     51FOR k = 0, jpk-1 DO BEGIN ze3v[*,*,k,*]=replicate(e3t[k],jpi*jpj*jpt) & endfor 
    5052; 
    5153z= -v*ze1v*ze3v 
     
    5860;  calcul de la msf en integrant depuis le fond 
    5961; 
    60 FOR k = jpk-2, 0, -1 DO begin msf[*, k,*] = msf[*, k+1,*]-fm(*, k,*) & endfor 
     62FOR k = jpk-2, 0, -1 DO begin msf[*, k,*] = msf[*, k+1,*]-fm[*, k,*] & endfor 
    6163; 
    6264;  msfmsk est le masque associe a msf (utilise pour les graphiques) 
  • trunk/procs/msf_simple.pro

    r165 r169  
    1515PRO msf_simple, v, msf, msfmsk $ 
    1616    , MSK=msk 
     17; 
     18  compile_opt idl2, strictarrsubs 
    1719; 
    1820@common 
     
    3537IF n_elements(msk) NE 0 THEN BEGIN  
    3638      zvmask = boundperio( (msk +shift(msk, 0, -1) ) < 1 ) 
    37       zvmask = zvmask(*)#vert 
     39      zvmask = zvmask[*]#vert 
    3840      zv = zv*zvmask 
    3941ENDIF  
     
    4547;  calcul du flux 
    4648; 
    47 FOR i = 0, jpi-1 DO BEGIN for j= 0, jpj-1 do begin ze1v(i,j,*) = replicate(e1v(i,j),jpk) & endfor &endfor 
    48 FOR k = 0, jpk-1 DO BEGIN ze3v(*,*,k)=replicate(e3t(k),jpi*jpj) & endfor 
     49FOR i = 0, jpi-1 DO BEGIN for j= 0, jpj-1 do begin ze1v[i,j,*] = replicate(e1v[i,j],jpk) & endfor &endfor 
     50FOR k = 0, jpk-1 DO BEGIN ze3v[*,*,k]=replicate(e3t[k],jpi*jpj) & endfor 
    4951; 
    5052z= -v*ze1v*ze3v 
     
    5658;  calcul de la msf en integrant depuis le fond 
    5759; 
    58 FOR k = jpk-2, 0, -1 DO begin msf[*, k] = msf[*, k+1]-fm(*, k) & endfor 
     60FOR k = jpk-2, 0, -1 DO begin msf[*, k] = msf[*, k+1]-fm[*, k] & endfor 
    5961; 
    6062;  msfmsk est le masque associe a msf (utilise pour les graphiques) 
  • trunk/procs/mth_decode.pro

    r165 r169  
    4040 
    4141      FOR imth = 0, nmth-1 DO BEGIN  
    42          idxm (imth, *)= (lindgen(jpt))[strd(imth)-1:*:12] 
     42         idxm[imth, *]= (lindgen(jpt))[strd[imth]-1:*:12] 
    4343      ENDFOR  
    4444 
  • trunk/procs/nc_build.pro

    r165 r169  
    66;- 
    77FUNCTION nc_build, cmd, fld, direc, grid_type 
     8; 
     9  compile_opt idl2, strictarrsubs 
    810; 
    911@com_eg 
  • trunk/procs/nc_get.pro

    r165 r169  
    66;- 
    77FUNCTION nc_get, file_name, var_name 
     8; 
     9  compile_opt idl2, strictarrsubs 
    810; 
    911; ouverture fichier netCDF + contenu ? 
  • trunk/procs/nc_put.pro

    r165 r169  
    1212    , T=t $ 
    1313    , GLOBAL=global 
    14  
     14; 
     15  compile_opt idl2, strictarrsubs 
     16; 
    1517@common 
    1618@com_eg 
     
    178180   NCDF_ATTPUT, cdfid, fldid, 'short_name', varn 
    179181   NCDF_ATTPUT, cdfid, fldid, 'missing_value', fld.missing_value 
    180    NCDF_ATTPUT, cdfid, fldid, 'valid_min', min(fld.data(where (fld.data NE fld.missing_value))), /float 
    181    NCDF_ATTPUT, cdfid, fldid, 'valid_max', max(fld.data(where (fld.data NE fld.missing_value))), /float 
     182   NCDF_ATTPUT, cdfid, fldid, 'valid_min', min(fld.data[where (fld.data NE fld.missing_value)]), /float 
     183   NCDF_ATTPUT, cdfid, fldid, 'valid_max', max(fld.data[where (fld.data NE fld.missing_value)]), /float 
    182184    
    183185    
     
    223225    print, '       Field legend = ',fld.long_name 
    224226    print, '       Field dimensions = ',size(fld.data) 
    225     print, '       Field min/max/unit = ',min(fld.data(where (fld.data NE fld.missing_value))), max(fld.data(where (fld.data NE fld.missing_value))), '   ', fld.units 
     227    print, '       Field min/max/unit = ',min(fld.data[where (fld.data NE fld.missing_value)]), max(fld.data[where (fld.data NE fld.missing_value)]), '   ', fld.units 
    226228    print, '       Global attributes= Conventions:  ', global.conventions 
    227229    print, '                           Title:        ', global.title 
  • trunk/procs/nc_read.pro

    r165 r169  
    2424         , ALL_DATA=all_data $ 
    2525         , NO_MEAN=no_mean 
     26; 
     27  compile_opt idl2, strictarrsubs 
    2628; 
    2729@common 
     
    116118         print, '      *** Warning valmask is negative - changing sign: ', valmask 
    117119         idx_t = where (field.data EQ valmask) 
    118          IF idx_t[0] NE -1 THEN field.data(idx_t) = -valmask 
     120         IF idx_t[0] NE -1 THEN field.data[idx_t] = -valmask 
    119121         valmask = -valmask 
    120122         idx_t=0                ; free memory 
     
    136138   idx_valmsk = (where (field.data EQ valmask)) 
    137139   idx_novalmsk = (where (field.data NE valmask)) 
    138    minf = idx_valmsk[0] EQ -1 ? min(field.data) : min(field.data(idx_novalmsk)) 
    139    maxf = idx_valmsk[0] EQ -1 ? max(field.data) : max(field.data(idx_novalmsk)) 
     140   minf = idx_valmsk[0] EQ -1 ? min(field.data) : min(field.data[idx_novalmsk]) 
     141   maxf = idx_valmsk[0] EQ -1 ? max(field.data) : max(field.data[idx_novalmsk]) 
    140142 
    141143   print, ' = ',field.legend, '    [min/max = ',minf , maxf,'  ', field.units,' - masked values = ',valmask, chardim, ']' 
  • trunk/procs/new_filename.pro

    r165 r169  
    88;- 
    99FUNCTION new_filename, file_in, oldgrid, newgrid 
    10  
     10; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113@common 
    1214@com_eg 
  • trunk/procs/npc.pro

    r165 r169  
    2525FUNCTION npc, s3d 
    2626; 
     27  compile_opt idl2, strictarrsubs 
     28; 
    2729@common 
    2830;; 
     
    4850 
    4951        ;  Indices des points T dans l ocean 
    50          i_ocean = where(tmask(i,j,*) EQ 1) 
     52         i_ocean = where(tmask[i,j,*] EQ 1) 
    5153 
    5254         IF (i_ocean[0] NE -1) THEN BEGIN         ; on n'entre que si il y a des points ocean 
    5355            ;  
    5456            ; density profil 
    55                        s_z(*)= s3d(i,j,*) 
    56                        ;s_z(*) = rho(i,j,*) 
     57                       s_z[*)= s3d[i,j,*) 
     58                       ;s_z[*) = rho[i,j,*) 
    5759            ;   
    5860            ; 1. Static instability pointer 
    5961            ; ----------------------------- 
    6062            ; 
    61               ds =(shift(s_z,-1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
     63              ds =(shift(s_z,-1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    6264              ind_c = where(ds LT 0.) 
    6365            ; 
    6466            ; 2. Vertical mixing for each instable portion of the density profil 
    6567            ; 
    66               IF ( ind_c(0) NE -1 ) THEN BEGIN 
     68              IF ( ind_c[0] NE -1 ) THEN BEGIN 
    6769                  ncompt=ncompt+1 
    6870            ;      print, 'static instability at i,j=', i,j 
     
    7375            ; vertical iteration 
    7476                  jiter = 0 
    75                   WHILE ( (ind_c(0) NE -1) AND (jiter LT jpk-1) ) DO BEGIN               
     77                  WHILE ( (ind_c[0] NE -1) AND (jiter LT jpk-1) ) DO BEGIN               
    7678                    jiter = jiter+1                                                      
    7779                  ; ikup : the first static instability from the sea surface             
    78                     ikup = ind_c(0)                                                                                                              
     80                    ikup = ind_c[0]                                                                                                              
    7981                  ; the density profil is instable below ikup                            
    8082                  ; ikdown : bottom of the instable portion of the density profil        
    8183                  ; search of ikdown and vertical mixing from ikup to ikdown             
    82                     ze3tot= e3t(ikup)                                                    
    83                     zraua = s_z(ikup)                                                    
     84                    ze3tot= e3t[ikup]                                                    
     85                    zraua = s_z[ikup]                                                    
    8486                    jkdown = ikup+1 
    8587;                                                                                        
    86                     WHILE (jkdown LE ikbot AND zraua GT s_z(jkdown) ) DO BEGIN      
    87                       ze3dwn = e3t(jkdown) 
     88                    WHILE (jkdown LE ikbot AND zraua GT s_z[jkdown] ) DO BEGIN      
     89                      ze3dwn = e3t[jkdown] 
    8890                      ze3tot = ze3tot+ze3dwn 
    89                       zraua = ( zraua*(ze3tot-ze3dwn) + s_z(jkdown)*ze3dwn )/ze3tot 
     91                      zraua = ( zraua*(ze3tot-ze3dwn) + s_z[jkdown]*ze3dwn )/ze3tot 
    9092                      jkdown = jkdown + 1 
    9193                    ENDWHILE 
    9294 
    9395                    FOR jkp = ikup,jkdown-1 DO BEGIN 
    94                        s_z(jkp) = zraua 
     96                       s_z[jpk] = zraua 
    9597                    ENDFOR 
    96                     ds =(shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2))           
     98                    ds =(shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    9799                    ind_c = where(ds LT 0.)                                              
    98100                  ENDWHILE 
    99101              ENDIF 
    100102            ; save the modifications 
    101               rhos(i,j,*) = s_z(*) 
     103              rhos[i,j,*] = s_z[*] 
    102104; 
    103105; <<-- no more static instability on slab jj 
  • trunk/procs/overlay_type.pro

    r165 r169  
    88;- 
    99FUNCTION overlay_type, iover, dimplot 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@com_eg 
  • trunk/procs/plt_map.pro

    r165 r169  
    2020;- 
    2121PRO plt_map, cmd, iplot, win, iover, landscape 
     22; 
     23  compile_opt idl2, strictarrsubs 
    2224; 
    2325@common 
     
    213215      idx = where(field.data EQ valmask) 
    214216      field.data = field.data > (-1.8) 
    215       IF idx[0] NE -1 THEN field.data(idx) = valmask 
     217      IF idx[0] NE -1 THEN field.data[idx] = valmask 
    216218   ENDIF  
    217219 
     
    828830                  IF strpos(cmd.plt, '@z') GT 1 THEN BEGIN 
    829831                     fldzm = moyenne(fld, 'x', boite=[20,380,-90,90], /NAN) 
    830                      fldzm = replicate(1, (size(fld))(1))#fldzm 
     832                     fldzm = replicate(1, (size(fld))[1])#fldzm 
    831833                     fld = fld-fldzm 
    832834                     edd_txt = ' Eddy ' 
     
    11471149               ENDIF ELSE BEGIN  
    11481150                  time_int = time-shift(time, 1) 
    1149                   time_int(0) = 0. 
     1151                  time_int[0] = 0. 
    11501152                  divi = total(time_int^2) 
    11511153                  rms_spec = sqrt( total( ((fld-spec_prev)*time_int)^2) / (divi > 0.)) 
  • trunk/procs/saxo_mods/pltsc.pro

    r165 r169  
    1515    , FRACTION=fraction $ 
    1616    , _EXTRA=extra 
     17; 
     18  compile_opt idl2, strictarrsubs 
    1719; 
    1820@common 
  • trunk/procs/saxo_mods/plttg.pro

    r165 r169  
    252252    , _EXTRA=extra 
    253253; 
     254  compile_opt idl2, strictarrsubs 
     255; 
    254256@common 
    255257 
  • trunk/procs/search_time_file.pro

    r165 r169  
    1010;- 
    1111PRO search_time_file, cmd, ncdf_db, suffix, date1, date2, delta_t1, timavef 
     12; 
     13  compile_opt idl2, strictarrsubs 
    1214; 
    1315@common 
  • trunk/procs/set_ps_devices.pro

    r165 r169  
    99PRO set_ps_devices 
    1010; 
     11  compile_opt idl2, strictarrsubs 
    1112; font 
    1213   !p.font = 0 
  • trunk/procs/set_x_devices.pro

    r165 r169  
    99PRO set_x_devices 
    1010; 
     11  compile_opt idl2, strictarrsubs 
     12; 
    1113; font 
    1214   !p.font = -1 
  • trunk/procs/spectra.pro

    r164 r169  
    5858FUNCTION spectra, datin, nyears, tukey, running, full, bootwin 
    5959; 
     60  compile_opt idl2, strictarrsubs 
     61; 
    6062; 0. Initializations 
    6163; ------------------ 
     
    100102; 
    101103   FOR t = 0, 12-1 DO BEGIN 
    102       amean(t) = mean(datin(long(findgen(ntime/12)*12+t))) 
     104      amean[t] = mean(datin(long(findgen(ntime/12)*12+t))) 
    103105   ENDFOR 
    104106; 
     
    126128   temperr = stat_error(anom, bootwin) 
    127129   ; err= +- sqrt(sum(temperr(i)-sdev)**2)/N) 
    128    err_std(0) = sqrt( total((temperr-sdev)^2)/n_elements(temperr) ) 
    129 ;   err_std(0) = sqrt((moment(temperr))[1]) 
    130    err_std(1) = mean(temperr) 
     130   err_std[0] = sqrt( total((temperr-sdev)^2)/n_elements(temperr) ) 
     131;   err_std[0] = sqrt((moment(temperr))[1]) 
     132   err_std[1] = mean(temperr) 
    131133 
    132134; 
     
    134136; 
    135137   FOR t = 0, ntime-(running*12) DO BEGIN  
    136       run_std(t) = sqrt((moment(datad[t:t+(running*12)-1]))[1]) 
     138      run_std[t] = sqrt((moment(datad[t:t+(running*12)-1]))[1]) 
    137139;      dattmp = datin[t:t+(running*12)-1] 
    138140;      ntsc = running*12 
    139141;      FOR tsc = 0, 12-1 DO BEGIN 
    140 ;         ameansc(tsc) = mean(dattmp(long(findgen(ntsc/12)*12+tsc))) 
     142;         ameansc[tsc] = mean(dattmp(long(findgen(ntsc/12)*12+tsc))) 
    141143;      ENDFOR  
    142 ;      sc_run(t) = sqrt((moment(ameansc))[1]) 
    143 ;      sc_run(t) = max(ameansc)-min(ameansc) 
    144 ;      sc_run(t) = mean(dattmp(long(findgen(running/12)*12+ (t MOD 12)))) 
     144;      sc_run[t] = sqrt((moment(ameansc))[1]) 
     145;      sc_run[t] = max(ameansc)-min(ameansc) 
     146;      sc_run[t] = mean(dattmp(long(findgen(running/12)*12+ (t MOD 12)))) 
    145147   ENDFOR  
    146148 
    147149   ; anomaly time serie wrt time varying SC 
    148150 
    149 ;      anom_stdsc = datin - [sc_run(0)#replicate(1, long(running*12/2)), sc_run, sc_run(ntime-(running*12))#replicate(1, long(running*12/2-1))] 
     151;      anom_stdsc = datin - [sc_run[0]#replicate(1, long(running*12/2)), sc_run, sc_run(ntime-(running*12))#replicate(1, long(running*12/2-1))] 
    150152 
    151153;   run_std = smooth(run_std, running*12) 
     
    156158; 
    157159   FOR t = 0, 12-1 DO BEGIN 
    158       stdsc(t) = sqrt((moment(datin(long(findgen(ntime/12)*12+t))))[1]) 
     160      stdsc[t] = sqrt((moment(datin(long(findgen(ntime/12)*12+t))))[1]) 
    159161   ENDFOR 
    160162; 
     
    171173; 
    172174   FOR k = 0, ntim1 DO BEGIN 
    173       cx(k) = (total(datad(0:ntime-k-1)*(shift(datad, -k))(0:ntime-k-1)))/float(ntime) 
     175      cx[k] = (total(datad[0:ntime-k-1]*(shift(datad, -k))[0:ntime-k-1]))/float(ntime) 
    174176   ENDFOR 
    175177;    
    176178; Compute autocorrelations for plotting 
    177179;    
    178    rx = cx/cx(0) 
     180   rx = cx/cx[0] 
    179181; 
    180182;  Compute the spectrum with no windowing 
     
    182184   FOR i=0,lfreq-2 DO BEGIN 
    183185      omega=twopin*float(i+1) 
    184       powerux(i) = (cx(0)+total((2.0*shift(cx, -1)*cos(omega*float(findgen(ntim1)+1)))(0:ntim1-1)))/pi 
     186      powerux[i] = (cx[0]+total((2.0*shift(cx, -1)*cos(omega*float(findgen(ntim1)+1)))[0:ntim1-1]))/pi 
    185187   ENDFOR 
    186188; 
     
    198200   FOR i=0,lfreq-2 DO BEGIN  
    199201      omega=twopin*float(i+1) 
    200       powerwx(i) = (weight(0)*cx(0)+total((2.0*shift(weight, -1)*shift(cx, -1)*cos(omega*float(findgen(mm)+1)))(0:mm-1)))/pi 
     202      powerwx[i] = (weight(0)*cx(0)+total((2.0*shift(weight, -1)*shift(cx, -1)*cos(omega*float(findgen(mm)+1)))[0:mm-1]))/pi 
    201203   ENDFOR 
    202204 
     
    219221   return, spectra 
    220222 
    221 END  
     223END 
  • trunk/procs/spectrum.pro

    r165 r169  
    1010FUNCTION spectrum, ts, tinc 
    1111; 
     12  compile_opt idl2, strictarrsubs 
     13; 
    1214  N=n_elements(ts) 
    1315  N21 = N/2 
    1416  ps=ABS(FFT(ts, -1)) 
    15   ps=ps(0:N21-1) 
     17  ps=ps[0:N21-1] 
    1618 
    1719  period=tinc*N/(findgen(N21)+0.0000000000001) 
    18   period(0)=99999999999. 
     20  period[0]=99999999999. 
    1921 
    2022  ret=findgen(2,N21) 
    21   ret(1,*)=ps 
    22   ret(0,*)=period 
     23  ret[1,*]=ps 
     24  ret[0,*]=period 
    2325 
    2426  return, ret 
  • trunk/procs/stat_error.pro

    r165 r169  
    2727         , BAVARD=bavard $ 
    2828         , MEAN=mean 
     29; 
     30  compile_opt idl2, strictarrsubs 
    2931; 
    3032 
     
    9698; ---------------- 
    9799      IF keyword_set(mean) THEN BEGIN  
    98          errstats(it) = mean(testarr) 
     100         errstats[it] = mean(testarr) 
    99101      ENDIF ELSE BEGIN   
    100 ;         errstats(it) = sqrt((moment(testarr))[1]) 
    101          errstats(it) = sqrt(total(testarr^2)/n_elements(testarr)) 
     102;         errstats[it] = sqrt((moment(testarr))[1]) 
     103         errstats[it] = sqrt(total(testarr^2)/n_elements(testarr)) 
    102104      ENDELSE  
    103105; method 1 keep mean i.e = sqrt(sum(testarr(i)**2)/N) 
    104 ; method 2      errstats(it) = sqrt((moment(testarr))[1]) 
     106; method 2      errstats[it] = sqrt((moment(testarr))[1]) 
    105107 
    106108      it = it + 1 
  • trunk/procs/tools_wavelets/wave_signif.pro

    r165 r169  
    127127        , CDELTA=cdelta  $ 
    128128        , PSI0=psi0 
    129          
     129; 
     130  compile_opt idl2, strictarrsubs 
     131;        
    130132        ON_ERROR,2 
    131133        IF (N_ELEMENTS(y) LT 1) THEN MESSAGE,'Time series Y must be input' 
     
    133135        IF (N_ELEMENTS(scale) LT 1) THEN MESSAGE,'Scales must be input' 
    134136        IF (N_PARAMS() LT 4) THEN sigtest = 0   ; the default 
    135         IF (N_ELEMENTS(y) EQ 1) THEN variance=y ELSE variance=(MOMENT(y))(1) 
     137        IF (N_ELEMENTS(y) EQ 1) THEN variance=y ELSE variance=(MOMENT(y))[1] 
    136138         
    137139;....check keywords & optional inputs 
     
    153155                        fourier_factor = (4*!PI)/(k0 + SQRT(2+k0^2)) ; [Sec.3h] 
    154156                        empir = [2.,-1,-1,-1] 
    155                         IF (k0 EQ 6) THEN empir(1:3)=[0.776,2.32,0.60] 
     157                        IF (k0 EQ 6) THEN empir[1:3]=[0.776,2.32,0.60] 
    156158                END 
    157159        'PAUL': BEGIN ;****************** PAUL 
     
    159161                        fourier_factor = 4*!PI/(2*m+1) 
    160162                        empir = [2.,-1,-1,-1] 
    161                         IF (m EQ 4) THEN empir(1:3)=[1.132,1.17,1.5] 
     163                        IF (m EQ 4) THEN empir[1:3]=[1.132,1.17,1.5] 
    162164                END 
    163165        'DOG': BEGIN ;******************* DOG 
     
    165167                        fourier_factor = 2*!PI*SQRT(2./(2*m+1)) 
    166168                        empir = [1.,-1,-1,-1] 
    167                         IF (m EQ 2) THEN empir(1:3) = [3.541,1.43,1.4] 
    168                         IF (m EQ 6) THEN empir(1:3) = [1.966,1.37,0.97] 
     169                        IF (m EQ 2) THEN empir[1:3] = [3.541,1.43,1.4] 
     170                        IF (m EQ 6) THEN empir[1:3] = [1.966,1.37,0.97] 
    169171                END 
    170172        ENDCASE 
    171173         
    172174        period = scale*fourier_factor 
    173         dofmin = empir(0) ; Degrees of freedom with no smoothing 
    174         Cdelta = empir(1) ; reconstruction factor 
    175         gamma = empir(2)  ; time-decorrelation factor 
    176         dj0 = empir(3)    ; scale-decorrelation factor 
     175        dofmin = empir[0] ; Degrees of freedom with no smoothing 
     176        Cdelta = empir[1] ; reconstruction factor 
     177        gamma = empir[2]  ; time-decorrelation factor 
     178        dj0 = empir[3]    ; scale-decorrelation factor 
    177179 
    178180;....significance levels [Sec.4] 
     
    206208                IF (NOT confidence) THEN BEGIN 
    207209                        FOR a1=0,J DO BEGIN 
    208                                 chisqr = CHISQR_CVF(1. - siglvl,dof(a1))/dof(a1) 
    209                                 signif(a1) = fft_theor(a1)*chisqr 
     210                                chisqr = CHISQR_CVF(1. - siglvl,dof[a1])/dof[a1] 
     211                                signif[a1] = fft_theor[a1]*chisqr 
    210212                        ENDFOR 
    211213                ENDIF ELSE BEGIN 
     
    213215                        sig = (1. - siglvl)/2. 
    214216                        FOR a1=0,J DO BEGIN 
    215                                 chisqr = dof(a1)/ $ 
    216                                         [CHISQR_CVF(sig,dof(a1)),CHISQR_CVF(1.-sig,dof(a1))] 
    217                                 signif(a1,*) = fft_theor(a1)*chisqr 
     217                                chisqr = dof[a1]/ $ 
     218                                        [CHISQR_CVF(sig,dof[a1]),CHISQR_CVF(1.-sig,dof[a1])] 
     219                                signif[a1,*] = fft_theor[a1]*chisqr 
    218220                        ENDFOR 
    219221                ENDELSE 
  • trunk/procs/tools_wavelets/wavelet.pro

    r165 r169  
    7171FUNCTION morlet $ 
    7272         , k0, scale, k, period, coi, dofmin, cdelta, psi0 
    73  
     73; 
     74  compile_opt idl2, strictarrsubs 
     75; 
    7476        IF (k0 EQ -1) THEN k0 = 6d 
    7577        n = N_ELEMENTS(k) 
    7678        expnt = -(scale*k - k0)^2/2d*(k GT 0.) 
    77         dt = 2*!PI/(n*k(1)) 
     79        dt = 2*!PI/(n*k[1]) 
    7880        norm = SQRT(2*!PI*scale/dt)*(!PI^(-0.25))   ; total energy=N   [Eqn(7)] 
    7981        morlet = norm*EXP(expnt > (-100d)) 
     
    8486        coi = fourier_factor/SQRT(2)   ; Cone-of-influence [Sec.3g] 
    8587        dofmin = 2   ; Degrees of freedom with no smoothing 
    86         Cdelta = -1 
    87         IF (k0 EQ 6) THEN Cdelta = 0.776 ; reconstruction factor 
     88        cdelta = -1 
     89        IF (k0 EQ 6) THEN cdelta = 0.776 ; reconstruction factor 
    8890        psi0 = !PI^(-0.25) 
    8991;       PRINT,scale,n,SQRT(TOTAL(ABS(morlet)^2,/DOUBLE)) 
     
    9698FUNCTION paul $ 
    9799        , m, scale, k, period, coi, dofmin, cdelta, psi0 
     100; 
     101  compile_opt idl2, strictarrsubs 
     102; 
    98103 
    99104        IF (m EQ -1) THEN m = 4d 
    100105        n = N_ELEMENTS(k) 
    101106        expnt = -(scale*k)*(k GT 0.) 
    102         dt = 2d*!PI/(n*k(1)) 
     107        dt = 2d*!PI/(n*k[1]) 
    103108        norm = SQRT(2*!PI*scale/dt)*(2^m/SQRT(m*FACTORIAL(2*m-1))) 
    104109        paul = norm*((scale*k)^m)*EXP(expnt > (-100d))*(expnt GT -100) 
     
    108113        coi = fourier_factor*SQRT(2) 
    109114        dofmin = 2   ; Degrees of freedom with no smoothing 
    110         Cdelta = -1 
    111         IF (m EQ 4) THEN Cdelta = 1.132 ; reconstruction factor 
     115        cdelta = -1 
     116        IF (m EQ 4) THEN cdelta = 1.132 ; reconstruction factor 
    112117        psi0 = 2.^m*FACTORIAL(m)/SQRT(!PI*FACTORIAL(2*m)) 
    113118;       PRINT,scale,n,norm,SQRT(TOTAL(paul^2,/DOUBLE))*SQRT(n) 
     
    120125FUNCTION dog $ 
    121126        , m, scale, k, period, coi, dofmin, cdelta, psi0 
     127; 
     128  compile_opt idl2, strictarrsubs 
     129; 
    122130 
    123131        IF (m EQ -1) THEN m = 2 
    124132        n = N_ELEMENTS(k) 
    125133        expnt = -(scale*k)^2/2d 
    126         dt = 2d*!PI/(n*k(1)) 
     134        dt = 2d*!PI/(n*k[1]) 
    127135        norm = SQRT(2*!PI*scale/dt)*SQRT(1d/GAMMA(m+0.5)) 
    128136        I = DCOMPLEX(0,1) 
     
    132140        coi = fourier_factor/SQRT(2) 
    133141        dofmin = 1   ; Degrees of freedom with no smoothing 
    134         Cdelta = -1 
     142        cdelta = -1 
    135143        psi0 = -1 
    136144        IF (m EQ 2) THEN BEGIN 
    137                 Cdelta = 3.541 ; reconstruction factor 
     145                cdelta = 3.541 ; reconstruction factor 
    138146                psi0 = 0.867325 
    139147        ENDIF 
    140148        IF (m EQ 6) THEN BEGIN 
    141                 Cdelta = 1.966 ; reconstruction factor 
     149                cdelta = 1.966 ; reconstruction factor 
    142150                psi0 = 0.88406 
    143151        ENDIF 
     
    257265        , VOICE=voice 
    258266; 
     267  compile_opt idl2, strictarrsubs 
     268; 
    259269        ON_ERROR,2 
    260270        r = CHECK_MATH(0,1) 
     
    298308;....construct wavenumber array used in transform [Eqn(5)] 
    299309        k = (DINDGEN(n/2) + 1)*(2*!PI)/(DOUBLE(n)*dt) 
    300         k = [0d,k,-REVERSE(k(0:(n-1)/2 - 1))] 
     310        k = [0d,k,-REVERSE(k[0:(n-1)/2 - 1])] 
    301311 
    302312;....compute FFT of the (padded) time series 
     
    318328        FOR a1=0,na-1 DO BEGIN  ;scale 
    319329                psi_fft=CALL_FUNCTION(mother, $ 
    320                         param,scale(a1),k,period1,coi,dofmin,Cdelta,psi0) 
     330                        param,scale[a1],k,period1,coi,dofmin,cdelta,psi0) 
    321331                IF (do_wave) THEN $ 
    322                         wave(*,a1) = FFT(yfft*psi_fft,1,/DOUBLE)  ;wavelet transform[Eqn(4)] 
    323                 period(a1) = period1   ; save period 
    324                 fft_theor(a1) = TOTAL((ABS(psi_fft)^2)*fft_theor_k)/n 
     332                        wave[*,a1] = FFT(yfft*psi_fft,1,/DOUBLE)  ;wavelet transform[Eqn(4)] 
     333                period[a1] = period1   ; save period 
     334                fft_theor[a1] = TOTAL((ABS(psi_fft)^2)*fft_theor_k)/n 
    325335                IF (do_daughter) THEN $ 
    326                         daughter(*,a1) = FFT(psi_fft,1,/DOUBLE)   ; save daughter 
    327                 IF (verbose) THEN PRINT,a1,scale(a1),period(a1), $ 
    328                                 TOTAL(ABS(wave(*,a1))^2),CHECK_MATH(0), $ 
     336                        daughter[*,a1] = FFT(psi_fft,1,/DOUBLE)   ; save daughter 
     337                IF (verbose) THEN PRINT,a1,scale[a1],period[a1], $ 
     338                                TOTAL(ABS(wave[*,a1])^2),CHECK_MATH(0), $ 
    329339                                FORMAT='(I3,3F11.3,I6)' 
    330340        ENDFOR  ;scale 
     
    333343         
    334344        IF (do_daughter) THEN $   ; shift so DAUGHTERs are in middle of array 
    335                 daughter = [daughter(n-n1/2:*,*),daughter(0:n1/2-1,*)] 
     345                daughter = [daughter[n-n1/2:*,*],daughter[0:n1/2-1,*]] 
    336346 
    337347;....significance levels [Sec.4] 
    338         sdev = (MOMENT(y1))(1) 
     348        sdev = (MOMENT(y1))[1] 
    339349        fft_theor = sdev*fft_theor  ; include time-series variance 
    340350        dof = dofmin 
     
    342352 
    343353        IF (recon) THEN BEGIN  ; Reconstruction [Eqn(11)] 
    344                 IF (Cdelta EQ -1) THEN BEGIN 
     354                IF (cdelta EQ -1) THEN BEGIN 
    345355                        y1 = -1 
    346356                        MESSAGE,/INFO, $ 
    347                                 'Cdelta undefined, cannot reconstruct with this wavelet' 
     357                                'cdelta undefined, cannot reconstruct with this wavelet' 
    348358                ENDIF ELSE BEGIN 
    349                         y1=dj*SQRT(dt)/(Cdelta*psi0)*(FLOAT(wave) # (1./SQRT(scale))) 
     359                        y1=dj*SQRT(dt)/(cdelta*psi0)*(FLOAT(wave) # (1./SQRT(scale))) 
    350360                        y1 = y1[0:n1-1] 
    351361                ENDELSE 
    352362        ENDIF 
    353363         
    354         RETURN,wave(0:n1-1,*)    ; get rid of padding before returning 
     364        RETURN,wave[0:n1-1,*]    ; get rid of padding before returning 
    355365 
    356366END 
  • trunk/procs/trans_month.pro

    r164 r169  
    66;- 
    77FUNCTION trans_month, month 
    8  
     8; 
     9  compile_opt idl2, strictarrsubs 
     10; 
    911   CASE month OF   
    1012      01: mn = 'JAN' 
  • trunk/procs/trends.pro

    r165 r169  
    77FUNCTION trends, fld, trend_int, type $ 
    88         , SILENT=silent 
     9; 
     10  compile_opt idl2, strictarrsubs 
    911; 
    1012@common 
     
    114116            idx = where(fld EQ valmask) 
    115117            fld = fldrem-fld 
    116             IF idx(0) NE -1 THEN fld(idx) = valmask 
     118            IF idx[0] NE -1 THEN fld[idx] = valmask 
    117119         ENDELSE  
    118120      END  
     
    136138               fldrem = fltarr(running) 
    137139               FOR t = 0, running-1 DO BEGIN 
    138                   fldrem(t) = mean(fld(long(findgen(lenght/running)*running+t))) 
     140                  fldrem[t] = mean(fld(long(findgen(lenght/running)*running+t))) 
    139141               ENDFOR 
    140142               IF fld_flag EQ 1 THEN BEGIN 
     
    179181            mean_sc = fldrem 
    180182 
    181             IF idx(0) NE -1 THEN BEGIN  
    182                fld(idx) = valmask 
     183            IF idx[0] NE -1 THEN BEGIN  
     184               fld[idx] = valmask 
    183185            ENDIF  
    184186 
    185187; compute time lag correlation 
    186188            IF ioverchk EQ 2 AND c_correl EQ 1 THEN BEGIN 
    187                IF (size(fld))(1) EQ (size(fld_prev_t))(1) THEN BEGIN  
     189               IF (size(fld))[1] EQ (size(fld_prev_t))[1] THEN BEGIN  
    188190                  lag_array = findgen(2*lag_correl+1)-lag_correl 
    189191                  lag_correlation = C_CORRELATE(fld, fld_prev_t, lag_array) 
     
    191193                  indx = where (lag_correlation EQ max(lag_correlation)) 
    192194                  IF indx[0] NE -1 THEN BEGIN  
    193                      print, '        Lag of max correlation =', lag_array(indx),lag_correlation(indx)  
     195                     print, '        Lag of max correlation =', lag_array[indx],lag_correlation[indx]  
    194196                     print, '        Lag correlation limit [-N,N] =', lag_correl  
    195197                  ENDIF  
     
    261263             ; keep mean seasonal cycle in common 
    262264             mean_sc = fldrem 
    263              IF idx(0) NE -1 THEN fld(idx) = valmask 
     265             IF idx[0] NE -1 THEN fld[idx] = valmask 
    264266         ENDELSE   
    265267 
     
    304306            IF int_win EQ 0 THEN BEGIN  ; integral from start 
    305307               FOR t = 0, lenght-1 DO BEGIN 
    306                   fldint(t) = total(fld[0:t]) 
     308                  fldint[t] = total(fld[0:t]) 
    307309               ENDFOR  
    308310            ENDIF ELSE BEGIN ; running integral 
    309311               FOR t = 0, int_win-1 DO BEGIN 
    310                   fldint(t) = total(fld[0:t]) 
     312                  fldint[t] = total(fld[0:t]) 
    311313               ENDFOR  
    312314               FOR t = int_win,lenght-1 DO BEGIN 
    313                   fldint(t) = total(fld[t-int_win+1:t]) 
     315                  fldint[t] = total(fld[t-int_win+1:t]) 
    314316               ENDFOR  
    315317            ENDELSE  
     
    323325                  lenght = (size(fld))[2] 
    324326                  FOR i = 0, ny-1 DO BEGIN  
    325                      zwrk = fld(i, *) 
     327                     zwrk = fld[i, *] 
    326328                     zint = zwrk 
    327329                     IF int_win EQ 0 THEN BEGIN ; integral from start 
    328330                        FOR t = 0, lenght-1 DO BEGIN 
    329                            zint(t) = total(zwrk[0:t]) 
     331                           zint[t] = total(zwrk[0:t]) 
    330332                        ENDFOR  
    331333                     ENDIF ELSE BEGIN ; running integral 
    332334                        FOR t = 0, int_win-1 DO BEGIN 
    333                            zint(t) = total(zwrk[0:t]) 
     335                           zint[t] = total(zwrk[0:t]) 
    334336                        ENDFOR  
    335337                        FOR t = int_win,lenght-1 DO BEGIN 
    336                            zint(t) = total(zwrk[t-int_win+1:t]) 
     338                           zint[t] = total(zwrk[t-int_win+1:t]) 
    337339                        ENDFOR  
    338340                     ENDELSE  
    339                      fld(i, *) = zint 
     341                     fld[i, *] = zint 
    340342                  ENDFOR  
    341343               END 
     
    344346                  lenght = (size(fld))[2] 
    345347                  FOR i = 0, nx-1 DO BEGIN  
    346                      zwrk = fld(i, *) 
     348                     zwrk = fld[i, *] 
    347349                     zint = zwrk 
    348350                     IF int_win EQ 0 THEN BEGIN ; integral from start 
    349351                        FOR t = 0, lenght-1 DO BEGIN 
    350                            zint(t) = total(zwrk[0:t]) 
     352                           zint[t] = total(zwrk[0:t]) 
    351353                        ENDFOR  
    352354                     ENDIF ELSE BEGIN ; running integral 
    353355                        FOR t = 0, int_win-1 DO BEGIN 
    354                            zint(t) = total(zwrk[0:t]) 
     356                           zint[t] = total(zwrk[0:t]) 
    355357                        ENDFOR  
    356358                        FOR t = int_win,lenght-1 DO BEGIN 
    357                            zint(t) = total(zwrk[t-int_win+1:t]) 
     359                           zint[t] = total(zwrk[t-int_win+1:t]) 
    358360                        ENDFOR  
    359361                     ENDELSE  
    360                      fld(i, *) = zint 
     362                     fld[i, *] = zint 
    361363                  ENDFOR  
    362364               END 
  • trunk/procs/tvnplot.pro

    r165 r169  
    1818    , PS=ps $ 
    1919    , _EXTRA=extra 
    20  
     20; 
     21  compile_opt idl2, strictarrsubs 
     22; 
    2123   IF keyword_set(min)     EQ 0 THEN min = min(image) 
    2224   IF keyword_set(max)     EQ 0 THEN max = max(image) 
     
    5557   image2 = ((min > image < max) -min)*(!d.n_colors-2)/(max-min)+1 
    5658   IF n_elements(msk) NE 0 THEN BEGIN  
    57       image2(where(msk EQ 0)) = 0 
     59      image2[where(msk EQ 0)] = 0 
    5860   ENDIF  
    5961   image2 = rebin(image2, gamma*ni, gamma*nj, sample = sample) 
     
    98100       xticklen = 1, yticklen = 1, color = 0, _EXTRA=extra ; cadre 
    99101 
    100       x0 = !x.window(0) 
    101       y0 = !y.window(0) 
    102       dx = !x.window(1)-!x.window(0) 
    103       dy = !y.window(1)-!y.window(0) 
     102      x0 = !x.window[0] 
     103      y0 = !y.window[0] 
     104      dx = !x.window[1]-!x.window[0] 
     105      dy = !y.window[1]-!y.window[0] 
    104106 
    105107      deltax = (!x.window[1]-!x.window[0]) 
     
    122124            CASE button OF  
    123125               1: BEGIN  
    124                   print, 'i=', i+ibase, ' / j=', j+jbase, ' / z(i,j)=', image(i, j) 
     126                  print, 'i=', i+ibase, ' / j=', j+jbase, ' / z[i,j]=', image[i, j] 
    125127                  wait, .2 
    126128               END 
     
    133135                  IF i1 LE i0 THEN i1 = (i0+10) < (ni-1) 
    134136                  IF j1 LE j0 THEN j1 = (j0+10) < (nj-1) 
    135                   tvnplot, image(i0:i1, j0:j1), _EXTRA=extra, /erase, $ 
     137                  tvnplot, image[i0:i1, j0:j1], _EXTRA=extra, /erase, $ 
    136138                   ibase = i0+ibase, jbase = j0+jbase, MIN = min, Max = max 
    137139               END  
  • trunk/procs/update_data.pro

    r165 r169  
    1717    , NO_MEAN=no_mean $ 
    1818    , _EXTRA=extra 
     19; 
     20  compile_opt idl2, strictarrsubs 
    1921; 
    2022@common 
     
    4446               'z': BEGIN 
    4547                  IF vert_mean[0] EQ vert_mean[1] THEN BEGIN 
    46                      suffix = ' at '+strtrim(string(long(vert_mean(0))), 2)+zunits+' ' 
    47                   ENDIF ELSE suffix = ' at '+strtrim(string(long(vert_mean(0))), 2)+'-'+strtrim(string(long(vert_mean(1))), 2)+zunits+' ' 
     48                     suffix = ' at '+strtrim(string(long(vert_mean[0])), 2)+zunits+' ' 
     49                  ENDIF ELSE suffix = ' at '+strtrim(string(long(vert_mean[0])), 2)+'-'+strtrim(string(long(vert_mean[1])), 2)+zunits+' ' 
    4850               END 
    4951               'level':BEGIN ; case level (zindex) 
    50                   suffix = ' at '+vert_type+' '+strtrim(string(long(gdept(vert_mean(0))+.1)), 2)+' '            
     52                  suffix = ' at '+vert_type+' '+strtrim(string(long(gdept[vert_mean[0]]+.1)), 2)+' '            
    5153               END 
    5254            ENDCASE 
     
    6668                  'z': BEGIN 
    6769                     zmean = moyenne(temporary(tab), 'z', boite = boxzoom, /NAN) 
    68                      suffix = ' averaged in ['+strtrim(string(long(vert_mean(0))), 2)+zunits+', '+strtrim(string(long(vert_mean(1))), 2)+zunits+']' 
     70                     suffix = ' averaged in ['+strtrim(string(long(vert_mean[0])), 2)+zunits+', '+strtrim(string(long(vert_mean[1])), 2)+zunits+']' 
    6971                  END 
    7072                  'level':BEGIN ; case level (zindex) 
    7173                     zmean = moyenne(temporary(tab), 'z', boite = boxzoom, /zindex, /NAN) 
    72                      suffix = ' averaged in '+vert_type+' ['+strtrim(string(long(vert_mean(0))), 2)+','+strtrim(string(long(vert_mean(1))), 2)+']'                    
     74                     suffix = ' averaged in '+vert_type+' ['+strtrim(string(long(vert_mean[0])), 2)+','+strtrim(string(long(vert_mean[1])), 2)+']'                    
    7375                  END 
    7476               ENDCASE 
     
    9395                  'z': BEGIN    
    9496                     zmean = grossemoyenne(tab, 'z', boite = boxzoom, /NAN) 
    95                      suffix = ' averaged in ['+strtrim(string(long(vert_mean(0))), 2)+zunits+','+strtrim(string(long(vert_mean(1))), 2)+zunits+']' 
     97                     suffix = ' averaged in ['+strtrim(string(long(vert_mean[0])), 2)+zunits+','+strtrim(string(long(vert_mean[1])), 2)+zunits+']' 
    9698                  END  
    9799                  'level': BEGIN ; case level (zindex) 
    98100                     zmean = grossemoyenne(temporary(tab), 'z', boite = boxzoom, /zindex, /NAN) 
    99                      suffix = ' averaged in '+vert_type+' ['+strtrim(string(long(vert_mean(0))), 2)+','+strtrim(string(long(vert_mean(1))), 2)+']' 
     101                     suffix = ' averaged in '+vert_type+' ['+strtrim(string(long(vert_mean[0])), 2)+','+strtrim(string(long(vert_mean[1])), 2)+']' 
    100102                  END  
    101103               ENDCASE 
  • trunk/procs/ybinx.pro

    r165 r169  
    1616               ; fld2 is the field being bined 
    1717 
    18                IF (size(bin_interval))(0) EQ 1 THEN BEGIN  
     18               IF (size(bin_interval))[0] EQ 1 THEN BEGIN  
    1919                   ; build...  
    2020               ENDIF  
    2121 
    22                nbins = (size(bin_interval))(1) 
     22               nbins = (size(bin_interval))[1] 
    2323 
    2424               bin_plt = (bin_interval+shift(bin_interval, -1))/2 
    25                bin_plt = [2*bin_plt(0)-bin_plt(1), bin_plt[0:nbins-2], 2*bin_plt(nbins-2)-bin_plt(nbins-3)] 
     25               bin_plt = [2*bin_plt[0]-bin_plt[1], bin_plt[0:nbins-2], 2*bin_plt[nbins-2]-bin_plt[nbins-3]] 
    2626 
    2727               IF debug_w THEN print, '    bin_plt= ', bin_plt  
     
    3636               IF sw3 THEN BEGIN  
    3737                  idxmsk = where(fld GT valmask/10.) 
    38                   IF idxmsk(0) NE -1 THEN fld(idxmsk) = valmask 
    39                   IF idxmsk(0) NE -1 THEN fld3(idxmsk) = valmask 
     38                  IF idxmsk[0] NE -1 THEN fld[idxmsk] = valmask 
     39                  IF idxmsk[0] NE -1 THEN fld3[idxmsk] = valmask 
    4040               ENDIF  
    4141 
     
    4444               idxmskpn = where(finite(fld, /nan)) 
    4545               idxmskpn2 = where(finite(fld2, /nan)) 
    46                IF idxmskpn(0) NE -1 THEN fld(idxmskpn) = valmask 
    47                IF idxmskpn2(0) NE -1 THEN fld2(idxmskpn2) = valmask 
     46               IF idxmskpn[0] NE -1 THEN fld[idxmskpn] = valmask 
     47               IF idxmskpn2[0] NE -1 THEN fld2[idxmskpn2] = valmask 
    4848 
    4949               idxmskpn = where(fld GT valmask/10.) 
    5050               idxmskpn2 = where(fld2 GT valmask/10.) 
    51                IF idxmskpn(0) NE -1 THEN fld2(idxmskpn) = valmask 
    52                IF idxmskpn2(0) NE -1 THEN fld(idxmskpn2) = valmask 
     51               IF idxmskpn[0] NE -1 THEN fld2[idxmskpn] = valmask 
     52               IF idxmskpn2[0] NE -1 THEN fld[idxmskpn2] = valmask 
    5353 
    5454               ; print min/max of field for debug 
    5555               idxmskp = where(fld LE valmask/10.) 
    56                IF debug_w THEN print, '    Min/max fld= ', min(fld(idxmskp)), max(fld(idxmskp)) 
    57                IF debug_w THEN print, '    Min/max fld2= ', min(fld2(idxmskp)), max(fld2(idxmskp)) 
     56               IF debug_w THEN print, '    Min/max fld= ', min(fld[idxmskp]), max(fld[idxmskp]) 
     57               IF debug_w THEN print, '    Min/max fld2= ', min(fld2[idxmskp]), max(fld2[idxmskp]) 
    5858 
    5959               ; remove mean seasonal cycle if required 
     
    7777                  @mth_decode 
    7878 
    79                   fldn = (fld)[*, *, reform(idxm(0,*), njpt)] 
    80                   fld2n = (fld2)[*, *, reform(idxm(0,*), njpt)] 
    81                   IF sw3 THEN fld3n = (fld3)[*, *, reform(idxm(0,*), njpt)] 
     79                  fldn = (fld)[*, *, reform(idxm[0,*], njpt)] 
     80                  fld2n = (fld2)[*, *, reform(idxm[0,*], njpt)] 
     81                  IF sw3 THEN fld3n = (fld3)[*, *, reform(idxm[0,*], njpt)] 
    8282 
    8383                  FOR imth = 1, nmth-1 DO BEGIN  
    8484                                        
    85                   fldn = [fldn, (fld)[*, *, reform(idxm(imth,*), njpt)]] 
    86                   fld2n = [fld2n, (fld2)[*, *, reform(idxm(imth,*), njpt)]] 
    87                   IF sw3 THEN fld3n = [fld3n, (fld3)[*, *, reform(idxm(imth,*), njpt)]] 
     85                  fldn = [fldn, (fld)[*, *, reform(idxm[imth,*], njpt)]] 
     86                  fld2n = [fld2n, (fld2)[*, *, reform(idxm[imth,*], njpt)]] 
     87                  IF sw3 THEN fld3n = [fld3n, (fld3)[*, *, reform(idxm[imth,*], njpt)]] 
    8888 
    8989                  ENDFOR  
     
    110110               WHILE ib LE nbins-1 DO BEGIN  
    111111 
    112                   indices = where(fld2 GT bin_interval(ib-1) AND fld2 LE bin_interval(ib)) 
    113                   binpop(ib) = n_elements(indices)  
    114                   idxb[ib, 0:binpop(ib)-1] = where(fld2 GT bin_interval(ib-1) AND fld2 LE bin_interval(ib)) 
    115                   IF debug_w THEN print, '    Size of bin(i) ', ib, binpop(ib)  
     112                  indices = where(fld2 GT bin_interval[ib-1] AND fld2 LE bin_interval[ib]) 
     113                  binpop[ib] = n_elements(indices)  
     114                  idxb[ib, 0:binpop[ib]-1] = where(fld2 GT bin_interval[ib-1] AND fld2 LE bin_interval[ib]) 
     115                  IF debug_w THEN print, '    Size of bin[i] ', ib, binpop[ib]  
    116116 
    117117                  ib = ib + 1 
    118118               ENDWHILE  
    119119 
    120                index0 = where(fld2 LE bin_interval(0)) 
    121                binpop(0) = n_elements(index0) 
    122                idxb(0, 0:binpop(0)-1) = index0 
    123  
    124                indexm = n_elements(where(fld2 GT bin_interval(nbins-1)))  
    125                binpop(nbins) = n_elements(indexm) 
    126                idxb(nbins, 0:binpop(nbins)-1) = indexm 
     120               index0 = where(fld2 LE bin_interval[0]) 
     121               binpop[0] = n_elements(index0) 
     122               idxb[0, 0:binpop[0]-1] = index0 
     123 
     124               indexm = n_elements(where(fld2 GT bin_interval[nbins-1]))  
     125               binpop[nbins] = n_elements(indexm) 
     126               idxb[nbins, 0:binpop[nbins]-1] = indexm 
    127127 
    128128               ; compute maximum number of indices for one bin 
     
    148148               ; first build fld*e1te2t for later average 
    149149 
    150                surf = reform(e1t(firstxt:lastxt,firstyt:lastyt)*e2t(firstxt:lastxt,firstyt:lastyt), nxt*nyt) 
     150               surf = reform(e1t[firstxt:lastxt,firstyt:lastyt]*e2t[firstxt:lastxt,firstyt:lastyt], nxt*nyt) 
    151151               surf = reform(surf#replicate(1, jpt), nxt, nyt, jpt) 
    152152 
     
    157157                   
    158158                  IF debug_w THEN print, 'bin = ', ib 
    159                   binsz = binpop(ib) 
     159                  binsz = binpop[ib] 
    160160                  IF binsz GT 1 THEN BEGIN  
    161                      fldy(ib, 0:binsz-1) = fld(idxb(ib, 0:binsz-1)) 
    162                      IF debug_w THEN print, 'fld(idxb(ib, 0:binsz-1)) =',fld(idxb(ib, 0:binsz-1))  
    163                      fldys(ib, 0:binsz-1) = flds(idxb(ib, 0:binsz-1)) 
    164                      surfb(ib, 0:binsz-1) = surf(idxb(ib, 0:binsz-1)) 
    165                      IF sw3 THEN fldy2(ib, 0:binsz-1) = fld3(idxb(ib, 0:binsz-1)) 
     161                     fldy[ib, 0:binsz-1] = fld[idxb[ib, 0:binsz-1]] 
     162                     IF debug_w THEN print, 'fld[idxb[ib, 0:binsz-1]] =',fld[idxb[ib, 0:binsz-1]]  
     163                     fldys[ib, 0:binsz-1] = flds[idxb[ib, 0:binsz-1]] 
     164                     surfb[ib, 0:binsz-1] = surf[idxb[ib, 0:binsz-1]] 
     165                     IF sw3 THEN fldy2[ib, 0:binsz-1] = fld3[idxb[ib, 0:binsz-1]] 
    166166                  ENDIF  
    167167                  ib = ib + 1 
     
    169169 
    170170 
    171                yplt = fltarr(nbins+1) 
    172                yerr = fltarr(nbins+1) 
     171               yplt = fltarr[nbins+1] 
     172               yerr = fltarr[nbins+1] 
    173173 
    174174               IF NOT sw3 THEN BEGIN  
     
    182182                  WHILE ib LE nbins DO BEGIN  
    183183                      
    184                      binsz = binpop(ib) 
     184                     binsz = binpop[ib] 
    185185                      
    186186                     IF binsz GT 1 THEN BEGIN   
    187187 
    188                         sfc_tot = total(surfb(ib, 0:binsz-1)) 
    189                         yplt(ib) = total(fldys(ib, 0:binsz-1))/sfc_tot 
    190                         yerr(ib) = sqrt((moment(fldy(ib, 0:binsz-1)))[1]) 
    191  
    192                         mean_fld = mean_fld + yplt(ib)*float(binpop(ib))  
     188                        sfc_tot = total(surfb[ib, 0:binsz-1]) 
     189                        yplt[ib] = total(fldys[ib, 0:binsz-1])/sfc_tot 
     190                        yerr[ib] = sqrt((moment(fldy[ib, 0:binsz-1]))[1]) 
     191 
     192                        mean_fld = mean_fld + yplt[ib]*float(binpop[ib]) 
    193193 
    194194                        ; print bin info 
    195                         IF ib GT 0 AND ib LT nbins THEN print, '    Bin size, occurence, average: ', bin_interval(ib-1), bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100., yplt(ib) 
    196                         IF ib EQ 0 THEN print, '    Bin size, occurence, average:      min' , bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) 
    197                         IF ib EQ nbins THEN print, '    Bin size, occurence, average: ', bin_interval(ib-1),'     max ', binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) 
    198                      ENDIF ELSE yplt(ib) = !values.f_nan 
     195                        IF ib GT 0 AND ib LT nbins THEN print, '    Bin size, occurence, average: ', bin_interval[ib-1], bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100., yplt[ib] 
     196                        IF ib EQ 0 THEN print, '    Bin size, occurence, average:      min' , bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 
     197                        IF ib EQ nbins THEN print, '    Bin size, occurence, average: ', bin_interval[ib-1],'     max ', binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 
     198                     ENDIF ELSE yplt[ib] = !values.f_nan 
    199199                   
    200200                     ib = ib + 1 
     
    210210 
    211211               ENDIF ELSE BEGIN  
    212                   ; if bining fld1=f(fld3), compute regression in each bin and plot 
     212                  ; if bining fld1=f[fld3], compute regression in each bin and plot 
    213213 
    214214                  ; compute regression for each bin 
     
    219219                  WHILE ib LE nbins DO BEGIN  
    220220 
    221                      binsz = binpop(ib) 
     221                     binsz = binpop[ib] 
    222222 
    223223                     IF binsz GT 1 THEN BEGIN  
    224224 
    225                         idx1 = where(fldy(ib, 0:binsz-1) NE valmask) 
    226                         idx2 = where(fldy2(ib, 0:binsz-1) NE valmask) 
    227                         tab1 = (fldy(ib, 0:binsz-1))(idx1) 
    228                         tab2 = (fldy2(ib, 0:binsz-1))(idx2) 
     225                        idx1 = where(fldy[ib, 0:binsz-1] NE valmask) 
     226                        idx2 = where(fldy2[ib, 0:binsz-1] NE valmask) 
     227                        tab1 = (fldy[ib, 0:binsz-1])[idx1] 
     228                        tab2 = (fldy2[ib, 0:binsz-1])[idx2] 
    229229                        coeff = linfit(tab2, tab1, CHISQ = linerr, PROB = proberr, SIGMA = sigmaerr) 
    230                         yplt(ib) = coeff(1) 
    231                         yerr(ib) = sigmaerr(1) 
    232  
    233                         mean_fld = mean_fld + yplt(ib)*float(binpop(ib))  
     230                        yplt[ib] = coeff[1] 
     231                        yerr[ib] = sigmaerr[1] 
     232 
     233                        mean_fld = mean_fld + yplt[ib]*float(binpop[ib])  
    234234 
    235235                        ; print bin info 
    236                         IF ib GT 0 AND ib LT nbins THEN print, '    Bin size, occurence, regress.: ', bin_interval(ib-1), bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100., yplt(ib) 
    237                         IF ib EQ 0 THEN print, '    Bin size, occurence, regress.:      min' , bin_interval(ib), binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) 
    238                         IF ib EQ nbins THEN print, '    Bin size, occurence, regress.: ', bin_interval(ib-1),'     max ', binpop(ib), (binpop(ib)/total(binpop))*100. , yplt(ib) 
    239  
    240                      ENDIF ELSE yplt(ib) = !values.f_nan 
     236                        IF ib GT 0 AND ib LT nbins THEN print, '    Bin size, occurence, regress.: ', bin_interval[ib-1], bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100., yplt[ib] 
     237                        IF ib EQ 0 THEN print, '    Bin size, occurence, regress.:      min' , bin_interval[ib], binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 
     238                        IF ib EQ nbins THEN print, '    Bin size, occurence, regress.: ', bin_interval[ib-1],'     max ', binpop[ib], (binpop[ib]/total(binpop))*100. , yplt[ib] 
     239 
     240                     ENDIF ELSE yplt[ib] = !values.f_nan 
    241241 
    242242                     ib = ib + 1 
     
    261261               varunit = ' ['+ntxt+' in box '+leg_name+']' 
    262262 
    263                overc = overlay_type(iover, dimplot) 
     263               overc = overlay_type[iover, dimplot] 
    264264 
    265265               pltcmd = 'pltsc,yplt,bin_plt,minc,maxc,minc2,maxc2,varlegend'+com_strplt+overc+',STY1D=-6,subtitle=""' 
  • trunk/procs/yfx.pro

    r165 r169  
    9595               ;  whole serie 
    9696               coeff = linfit(fld2, fld, CHISQ = linerr, PROB = proberr, SIGMA = sigmaerr) 
    97                print, '    Linfit coef (a+bx) = ', coeff(0), coeff(1), ' errbar = ',sigmaerr 
     97               print, '    Linfit coef (a+bx) = ', coeff[0], coeff[1], ' errbar = ',sigmaerr 
    9898               ; text for plot info in legend_overlay 
    99                coeff_txt = 'Linfit = '+strtrim(string(coeff(1), format = fmt_linfit), 2) 
     99               coeff_txt = 'Linfit = '+strtrim(string(coeff[1], format = fmt_linfit), 2) 
    100100               IF proberr NE 1.0 THEN print, '    WARNING: proba = ',proberr 
    101101               ; divide serie in two domains (on x axis) seperated by linfit_sep (plt_def) 
     
    108108                  coefflu_txt = ' [' 
    109109                   
    110                   IF idx_low(0) NE -1 THEN BEGIN  
     110                  IF idx_low[0] NE -1 THEN BEGIN  
    111111                     coeffl = linfit(fld2(idx_low), fld(idx_low), CHISQ = linerrl, PROB = proberrl, SIGMA = sigmaerrl) 
    112                      print, '    Linfit coef below ',strtrim(string(linfit_sep), 2),' = ', coeffl(0), coeffl(1), ' errbar = ',sigmaerrl 
     112                     print, '    Linfit coef below ',strtrim(string(linfit_sep), 2),' = ', coeffl[0], coeffl[1], ' errbar = ',sigmaerrl 
    113113                     IF proberrl NE 1.0 THEN print, '    *** WARNING: proba lower = ',proberrl 
    114                      coefflu_txt = coefflu_txt+strtrim(string(coeffl(1), format = fmt_linfit), 2)+'<'+strtrim(string(linfit_sep, format = '(F4.2)'), 2) 
     114                     coefflu_txt = coefflu_txt+strtrim(string(coeffl[1], format = fmt_linfit), 2)+'<'+strtrim(string(linfit_sep, format = '(F4.2)'), 2) 
    115115                  ENDIF  
    116116                   
    117                   IF idx_up(0) NE -1 THEN BEGIN  
     117                  IF idx_up[0] NE -1 THEN BEGIN  
    118118                     coeffu = linfit(fld2(idx_up), fld(idx_up), CHISQ = linerru, PROB = proberru, SIGMA = sigmaerru) 
    119                      print, '    Linfit coef above ',strtrim(string(linfit_sep), 2),' = ', coeffu(0), coeffu(1), ' errbar = ',sigmaerru 
     119                     print, '    Linfit coef above ',strtrim(string(linfit_sep), 2),' = ', coeffu[0], coeffu[1], ' errbar = ',sigmaerru 
    120120                     IF proberru NE 1.0 THEN print, '    *** WARNING: proba upper = ',proberru 
    121                   coefflu_txt = coefflu_txt+'>'+strtrim(string(coeffu(1), format = fmt_linfit), 2) 
     121                  coefflu_txt = coefflu_txt+'>'+strtrim(string(coeffu[1], format = fmt_linfit), 2) 
    122122                  ENDIF  
    123123                  coefflu_txt = coefflu_txt+']' 
     
    132132               cm3 = linfit(shift(fld2, -3), fld, CHISQ = linerrm3, PROB = proberrm3, SIGMA = sigmaerrm3) 
    133133               print, '   ' 
    134                print, '    -3 Linfit coef (a+bx) = ', cm3(0), cm3(1), ' errbar = ',sigmaerrm3 
    135                print, '    -2 Linfit coef (a+bx) = ', cm2(0), cm2(1), ' errbar = ',sigmaerrm2 
    136                print, '    -1 Linfit coef (a+bx) = ', cm1(0), cm1(1), ' errbar = ',sigmaerrm1 
    137                print, '    +1 Linfit coef (a+bx) = ', cp1(0), cp1(1), ' errbar = ',sigmaerrp1 
    138                print, '    +2 Linfit coef (a+bx) = ', cp2(0), cp2(1), ' errbar = ',sigmaerrp2 
    139                print, '    +3 Linfit coef (a+bx) = ', cp3(0), cp3(1), ' errbar = ',sigmaerrp3 
     134               print, '    -3 Linfit coef (a+bx) = ', cm3[0], cm3[1], ' errbar = ',sigmaerrm3 
     135               print, '    -2 Linfit coef (a+bx) = ', cm2[0], cm2[1], ' errbar = ',sigmaerrm2 
     136               print, '    -1 Linfit coef (a+bx) = ', cm1[0], cm1[1], ' errbar = ',sigmaerrm1 
     137               print, '    +1 Linfit coef (a+bx) = ', cp1[0], cp1[1], ' errbar = ',sigmaerrp1 
     138               print, '    +2 Linfit coef (a+bx) = ', cp2[0], cp2[1], ' errbar = ',sigmaerrp2 
     139               print, '    +3 Linfit coef (a+bx) = ', cp3[0], cp3[1], ' errbar = ',sigmaerrp3 
    140140                
    141141            ; plot domain 
     
    152152                     IF strpos(symbol_families, 'x') NE -1 THEN BEGIN  
    153153                        coding = strsplit(symbol_families, 'x', /EXTRACT) 
    154                         ncolors = long(coding(0)) 
    155                         ntimes = long(coding(1)) 
     154                        ncolors = long(coding[0]) 
     155                        ntimes = long(coding[1]) 
    156156                     ENDIF ELSE BEGIN  
    157157                        ncolors = long(symbol_families) 
     
    175175                              jl = jl+1 
    176176                           ENDWHILE  
    177                            fldp = fld(idx) 
    178                            fldp2 = fld2(idx) 
     177                           fldp = fld[idx] 
     178                           fldp2 = fld2[idx] 
    179179;                           coeff = linfit(fldp2(where (fldp2(*) GT 0.)), fldp(where (fldp2(*) GT 0.)), CHISQ = errlin, PROB = prblin) 
    180180                           coeff = linfit(fldp2, fldp, CHISQ = errlin, PROB = prblin, SIGMA = sigmaerr) 
    181                            linerro(ic) = sigmaerr(1) 
    182                            linprob(ic) = prblin 
    183                            lincoef(ic) = coeff(1) 
    184                            linerr0(ic) = sigmaerr(0) 
    185                            print, '    Period '+strtrim(string(ic+1), 2)+' Linfit coef =', coeff(0),coeff(1), ' errbar = ',sigmaerr 
    186                            coeffm_txt = coeffm_txt+strtrim(string(coeff(1), format = fmt_linfit), 2)+'/' 
     181                           linerro[ic] = sigmaerr[1] 
     182                           linprob[ic] = prblin 
     183                           lincoef[ic] = coeff[1] 
     184                           linerr0[ic] = sigmaerr[0] 
     185                           print, '    Period '+strtrim(string(ic+1), 2)+' Linfit coef =', coeff[0],coeff[1], ' errbar = ',sigmaerr 
     186                           coeffm_txt = coeffm_txt+strtrim(string(coeff[1], format = fmt_linfit), 2)+'/' 
    187187                           valmask = ABS(valmask) 
    188188                           IF mean_sc_only EQ 0 OR mean_sc_only EQ 1 THEN BEGIN  
    189                               pltcmd = 'pltsc,fldp,fldp2,minc,maxc,minc2,maxc2,varlegend2, boite=boxyfx'+com_strplt+',ov1d='+string(ic)+',COLOR='+string(symbol_color(ic))+', STY1D='+string(symbol_style(ic)-1)+', SYMSIZE='+string(symbol_size) 
     189                              pltcmd = 'pltsc,fldp,fldp2,minc,maxc,minc2,maxc2,varlegend2, boite=boxyfx'+com_strplt+',ov1d='+string[ic]+',COLOR='+string(symbol_color[ic])+', STY1D='+string(symbol_style[ic]-1)+', SYMSIZE='+string(symbol_size) 
    190190                              printf, nulhis, strcompress(pltcmd) 
    191191                              IF debug_w THEN print, '   ',pltcmd 
     
    193193                           ENDIF  
    194194                           IF mean_sc_only EQ 4 AND ic EQ ncolors-1 THEN BEGIN 
    195                               print, '    Linfit slope + error (July-Dec)=', mean(lincoef(5:10)), mean(linerro(5:10)) 
    196                               print, '    Linfit slope + error (Jan-June)=', mean([lincoef(0:4), lincoef(11)]), mean([linerro(0:4), linerro(11)]) 
     195                              print, '    Linfit slope + error (July-Dec)=', mean(lincoef[5:10]), mean(linerro[5:10]) 
     196                              print, '    Linfit slope + error (Jan-June)=', mean([lincoef[0:4], lincoef[11]]), mean([linerro[0:4], linerro[11]]) 
    197197                              vardate = 'toto' 
    198198                              jpt = ncolors 
     
    226226                     ENDIF ELSE BEGIN ; one color 
    227227                        IF debug_w THEN print, '   ',pltcmdstd 
    228                         res = execute(pltcmdstd(0)) 
     228                        res = execute(pltcmdstd[0]) 
    229229                     ENDELSE  
    230230                  ENDIF      
    231231               ENDIF ELSE BEGIN ; standard scatter plot 
    232232                  IF debug_w THEN print, '   ',pltcmdstd 
    233                   res = execute(pltcmdstd(0)) 
     233                  res = execute(pltcmdstd[0]) 
    234234               ENDELSE 
    235235               IF cmd.trend EQ 412 THEN coeffm_txt = '' 
     
    250250                     fldrem_t2 = fltarr(running) 
    251251                     FOR t1 = 0, running-1 DO BEGIN 
    252                         fldrem_t1(t1) = mean(fld(long(findgen(lenght/running)*running+t1))) 
    253                         fldrem_t2(t1) = mean(fld2(long(findgen(lenght/running)*running+t1))) 
     252                        fldrem_t1[t1] = mean(fld(long(findgen(lenght/running)*running+t1))) 
     253                        fldrem_t2[t1] = mean(fld2(long(findgen(lenght/running)*running+t1))) 
    254254                     ENDFOR 
    255255                  ENDELSE  
     
    258258                  print, '    Seasonal cycle var/stddev fld2 ', (moment(fldrem_t2))[1], sqrt((moment(fldrem_t2))[1]) 
    259259 
    260                   fldrem_t1 = [fldrem_t1, fldrem_t1(0)] 
    261                   fldrem_t2 = [fldrem_t2, fldrem_t2(0)] 
     260                  fldrem_t1 = [fldrem_t1, fldrem_t1[0]] 
     261                  fldrem_t2 = [fldrem_t2, fldrem_t2[0]] 
    262262                  sw_ov1d = mean_sc_only 
    263263                  IF mean_sc_only EQ 3 AND cmd.trend EQ '412' THEN BEGIN 
     
    267267                     print, '     Stddev of monthly stddevs fld', sqrt((moment(stat.sc_std-(moment(stat.sc_std))[0]))[1]) 
    268268                     print, '     Stddev of monthly stddevs fld2', sqrt((moment(stat2.sc_std-(moment(stat2.sc_std))[0]))[1]) 
    269                      stdsc = [stat.sc_std, stat.sc_std(0)] 
    270                      stdsc2 = [stat2.sc_std, stat2.sc_std(0)] 
     269                     stdsc = [stat.sc_std, stat.sc_std[0]] 
     270                     stdsc2 = [stat2.sc_std, stat2.sc_std[0]] 
    271271                     pltcmd = 'pltsc,stdsc,stdsc2,0. ,maxc,0.,maxc2,varlegend2, boite=boxyfx'+com_strplt+',ov1d=1-min(1,sw_ov1d), STY1D=-1, THICKN=3, SYMSIZE='+string(symbol_size)+', FRACTION=fraction' 
    272272                     printf, nulhis, strcompress(pltcmd) 
    273273                     IF debug_w THEN print, pltcmd 
    274                      res = execute(pltcmd(0)) 
    275                      pltcmd = 'xyouts,stdsc2-(maxc2)/(.3*win(0)*win(1)),stdsc,string(long(findgen(12))+1),charsize=1.3,alignment=0.5' 
     274                     res = execute(pltcmd[0]) 
     275                     pltcmd = 'xyouts,stdsc2-(maxc2)/(.3*win[0]*win[1]),stdsc,string(long(findgen(12))+1),charsize=1.3,alignment=0.5' 
    276276                     printf, nulhis, strcompress(pltcmd) 
    277277                     IF debug_w THEN print, pltcmd 
    278                      res = execute(pltcmd(0)) 
     278                     res = execute(pltcmd[0]) 
    279279                  ENDIF ELSE BEGIN  
    280280                     ov1d_val = 0 
     
    283283                     printf, nulhis, strcompress(pltcmd) 
    284284                     IF debug_w THEN print, pltcmd 
    285                      IF mean_sc_only NE 0 THEN res = execute(pltcmd(0)) 
     285                     IF mean_sc_only NE 0 THEN res = execute(pltcmd[0]) 
    286286                     IF mean_sc_only EQ 2 THEN BEGIN  
    287                                 ; add month info win(0)*win(1) 
    288                         pltcmd = 'xyouts,fldrem_t2-(maxc2-minc2)/(0.5*win(0)*win(1)),fldrem_t1,string(long(findgen(12))+1),charsize=1.3,alignment=0.5' 
     287                                ; add month info win[0]*win[1] 
     288                        pltcmd = 'xyouts,fldrem_t2-(maxc2-minc2)/(0.5*win[0]*win[1]),fldrem_t1,string(long(findgen(12))+1),charsize=1.3,alignment=0.5' 
    289289                        printf, nulhis, strcompress(pltcmd) 
    290290                        IF debug_w THEN print, pltcmd 
    291                         res = execute(pltcmd(0)) 
     291                        res = execute(pltcmd[0]) 
    292292                     ENDIF 
    293293                  ENDELSE  
     
    322322                     levels = findgen((max_sig-min_sig)/delta_sig+1)*delta_sig+min_sig 
    323323                     labels = levels 
    324                      labels(*) = 1 
     324                     labels[*] = 1 
    325325                     contour, rhopn, s, t, /overplot, levels = levels, c_labels = labels, c_linestyle = 0 
    326326                     t = t_ 
  • trunk/tools/bsf/boundperio.pro

    r165 r169  
    1111         , VV=vv $ 
    1212         , FF1=ff1 
     13; 
     14  compile_opt idl2, strictarrsubs 
    1315; 
    1416@common    
     
    2527   CASE (size(z))[0] OF 
    2628      2 : BEGIN  
    27          zz(0, *) = zz(jpi-2, *) 
    28          zz(jpi-1, *) = zz(1, *) 
     29         zz[0, *] = zz[jpi-2, *] 
     30         zz[jpi-1, *] = zz[1, *] 
    2931         CASE type OF  
    3032            0:BEGIN 
    31                zz(*, jpj-1) = shift(reverse( zz(*, jpj-3)), 1) 
    32                zz(milieu:jpi-1, jpj-2) = reverse( zz(1:milieu, jpj-2) ) 
     33               zz[*, jpj-1] = shift(reverse( zz[*, jpj-3]), 1) 
     34               zz[milieu:jpi-1, jpj-2] = reverse( zz[1:milieu, jpj-2] ) 
    3335            END  
    3436; Point u 
    3537            1:BEGIN          
    36                zz(*, jpj-1) = -reverse( zz(*, jpj-3)) 
    37                zz(milieu-1:jpi-1, jpj-2) = -reverse( zz(0:milieu, jpj-2) ) 
     38               zz[*, jpj-1] = -reverse( zz[*, jpj-3]) 
     39               zz[milieu-1:jpi-1, jpj-2] = -reverse( zz[0:milieu, jpj-2] ) 
    3840            END                
    3941; Point v   
    4042            2:BEGIN          
    41                zz(*, jpj-2) = -shift(reverse( zz(*, jpj-3)), 1) 
    42                zz(*, jpj-1) = -shift(reverse( zz(*, jpj-4)), 1) 
     43               zz[*, jpj-2] = -shift(reverse( zz[*, jpj-3]), 1) 
     44               zz[*, jpj-1] = -shift(reverse( zz[*, jpj-4]), 1) 
    4345            END  
    4446; Point f 
    4547            3:BEGIN  
    46                zz(*, jpj-2) = reverse( zz(*, jpj-3)) 
    47                zz(*, jpj-1) = reverse( zz(*, jpj-4)) 
     48               zz[*, jpj-2] = reverse( zz[*, jpj-3]) 
     49               zz[*, jpj-1] = reverse( zz[*, jpj-4]) 
    4850            END  
    4951         ENDCASE  
    5052      END  
    5153      3 : BEGIN  
    52          zz(0, *, *) = zz(jpi-2, *, *) 
    53          zz(jpi-1, *, *) = zz(1, *, *) 
     54         zz[0, *, *] = zz[jpi-2, *, *] 
     55         zz[jpi-1, *, *] = zz[1, *, *] 
    5456         CASE type OF  
    5557            0:BEGIN 
    56                zz(*, jpj-1, *) = shift(reverse( zz(*, jpj-3, *)), 1, 0, 0) 
    57                zz(milieu:jpi-1, jpj-2, *) = reverse( zz(1:milieu, jpj-2, *) ) 
     58               zz[*, jpj-1, *] = shift(reverse( zz[*, jpj-3, *]), 1, 0, 0) 
     59               zz[milieu:jpi-1, jpj-2, *] = reverse( zz[1:milieu, jpj-2, *] ) 
    5860            END  
    5961; Point u 
    6062            1:BEGIN          
    61                zz(*, jpj-1, *) = reverse( zz(*, jpj-3, *)) 
    62                zz(milieu-1:jpi-1, jpj-2, *) = -reverse( zz(0:milieu, jpj-2, *) ) 
     63               zz[*, jpj-1, *] = reverse( zz[*, jpj-3, *]) 
     64               zz[milieu-1:jpi-1, jpj-2, *] = -reverse( zz[0:milieu, jpj-2, *] ) 
    6365            END                
    6466; Point v   
    6567            2:BEGIN          
    66                zz(*, jpj-2, *) = -shift(reverse( zz(*, jpj-3, *)), 1, 0, 0) 
    67                zz(*, jpj-1, *) = -shift(reverse( zz(*, jpj-4, *)), 1, 0, 0) 
     68               zz[*, jpj-2, *] = -shift(reverse( zz[*, jpj-3, *]), 1, 0, 0) 
     69               zz[*, jpj-1, *] = -shift(reverse( zz[*, jpj-4, *]), 1, 0, 0) 
    6870            END  
    6971; Point f 
    7072            3:BEGIN  
    71                zz(*, jpj-2, *) = reverse( zz(*, jpj-3, *)) 
    72                zz(*, jpj-1, *) = reverse( zz(*, jpj-4, *)) 
     73               zz[*, jpj-2, *] = reverse( zz[*, jpj-3, *]) 
     74               zz[*, jpj-1, *] = reverse( zz[*, jpj-4, *]) 
    7375            END  
    7476         ENDCASE  
  • trunk/tools/bsf/build_laplacien_f.pro

    r165 r169  
    2323PRO build_laplacien_f 
    2424; 
     25  compile_opt idl2, strictarrsubs 
     26; 
    2527@common 
    2628@com_eg 
     
    3234 
    3335 
    34    fm = fmaskr(*, *, 0)/(e1f*e2f) 
     36   fm = fmaskr[*, *, 0]/(e1f*e2f) 
    3537 
    3638; 
    3739; On masque le domaine non physique (points en double) 
    3840; 
    39    fm(0, *) = 0 
    40    fm(jpi-1, *) = 0 
     41   fm[0, *] = 0 
     42   fm[jpi-1, *] = 0 
    4143;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 
    4244; specificite ORCA 
    43    fm(*, jpj-1) = 0 
    44    fm(*, jpj-2) = 0 
     45   fm[*, jpj-1] = 0 
     46   fm[*, jpj-2] = 0 
    4547;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
    46    um = umaskr(*, *, 0)*e1u/e2u 
    47    vm = vmaskr(*, *, 0)*e2v/e1v 
     48   um = umaskr[*, *, 0]*e1u/e2u 
     49   vm = vmaskr[*, *, 0]*e2v/e1v 
    4850; 
    4951;  construction des 5 bandes 
     
    5153 
    5254;      Sud 
    53    bande( 0:N2-1 , 1) = fm*shift(um, 0, 0) 
     55   bande[ 0:N2-1 , 1] = fm*shift(um, 0, 0) 
    5456;      Ouest                  
    55    bande( 0:N2-1 , 2) = fm*shift(vm, 0, 0) 
     57   bande[ 0:N2-1 , 2] = fm*shift(vm, 0, 0) 
    5658;      Est                    
    57    bande( 0:N2-1 , 3) = fm*shift(vm,-1, 0) 
     59   bande[ 0:N2-1 , 3] = fm*shift(vm,-1, 0) 
    5860;      Nord                   
    59    bande( 0:N2-1 , 4) = fm*shift(um, 0,-1) 
     61   bande[ 0:N2-1 , 4] = fm*shift(um, 0,-1) 
    6062; 
    6163; 
    6264; 
    63    bande(0:N-1      , 1) = 0. 
     65   bande[0:N-1      , 1] = 0. 
    6466; 
    6567;  elements ci dessous non nuls du fait des CL periodiques E-W 
    6668;  decommenter les 2 lignes si votre domaine est ferme a l''Est et a l''Ouest 
    67 ;   bande(0          , 2) = 0. 
    68 ;   bande(N2-1       , 3) = 0. 
     69;   bande[0          , 2] = 0. 
     70;   bande[N2-1       , 3] = 0. 
    6971 
    70    bande(N2-N:N2-1  , 4) = 0. 
     72   bande[N2-N:N2-1  , 4] = 0. 
    7173    
    7274;      Centre 
    73    bande( * , 0) = - bande(*, 1) -  bande(*, 2) -  bande(*, 3) -  bande(*, 4) 
     75   bande[ * , 0] = - bande[*, 1] -  bande[*, 2] -  bande[*, 3] -  bande[*, 4] 
    7476 
    7577 
     
    7880 
    7981   ;; nb d'elements de la matrice creuse 
    80    Nb = N2+n_elements(where(bande(*, 1:4) NE 0))+1 
     82   Nb = N2+n_elements(where(bande[*, 1:4] NE 0))+1 
    8183 
    8284   ;; definition de la matrice creuse 
     
    8486 
    8587   ;; elements diagonaux 
    86    lapla_f.sa[0:N2-1] = bande(0:N2-1, 0) 
     88   lapla_f.sa[0:N2-1] = bande[0:N2-1, 0] 
    8789   lapla_f.sa[N2] = 0 
    8890   lapla_f.ija[N2] = Nb+1 
     
    105107   ;;    creuse                       ^^^^^^^^ 
    106108 
    107    i = long(0) 
    108    k = long(N2) 
    109    compteur = long(0) 
     109   i = long[0] 
     110   k = long[N2] 
     111   compteur = long[0] 
    110112   REPEAT BEGIN  
    111113      ligne = i/4 
     
    142144      ENDIF  
    143145 
    144       colonne = ligne+decalage(ordre(i MOD 4)-1) 
     146      colonne = ligne+decalage[ordre(i MOD 4)-1] 
    145147; 
    146148      IF (colonne GE 0) AND (colonne LT N2) THEN  BEGIN  
    147          x = bande(ligne, ordre(i MOD 4) ) 
     149         x = bande[ligne, ordre[i MOD 4] ] 
    148150         IF x NE 0. THEN BEGIN  
    149151            k = k+1 
     
    160162 
    161163END 
    162  
  • trunk/tools/bsf/curl2.pro

    r165 r169  
    1212FUNCTION curl2, u, v 
    1313; 
     14  compile_opt idl2, strictarrsubs 
     15; 
    1416@common 
    1517@com_eg 
    1618 
    17    zu = u*e1u*umaskr(*, *, 0) 
    18    zv = v*e2v*vmaskr(*, *, 0) 
     19   zu = u*e1u*umaskr[*, *, 0] 
     20   zv = v*e2v*vmaskr[*, *, 0] 
    1921 
    2022   zcurl = shift(zv, -1, 0)-zv+zu-shift(zu, 0, -1) 
    21    zcurl = zcurl*fmaskr(*, *, 0)/(e1f*e2f) 
     23   zcurl = zcurl*fmaskr[*, *, 0]/(e1f*e2f) 
    2224 
    2325   zcurl = boundperio(zcurl, /ff1) 
  • trunk/tools/bsf/diag_bsf.pro

    r165 r169  
    1313PRO diag_bsf_mu, hu, hv, mu 
    1414; 
     15  compile_opt idl2, strictarrsubs 
     16; 
    1517@common 
    1618@com_eg 
     
    2022   mu = fltarr(14) 
    2123; 0/ Antartic 
    22 ;   mu(0) = total( (hu*e2u*umaskr(*, *, 0))[149, 5:35]) 
    23    mu(0) = total( (hu*e2u*umaskr(*, *, 0))[151, 14:48]) 
     24;   mu[0] = total( (hu*e2u*umaskr[*, *, 0])[149, 5:35]) 
     25   mu[0] = total( (hu*e2u*umaskr[*, *, 0])[151, 14:48]) 
    2426; 1/ America 
    25 ;   mu(1) = -total( (hv*e1v*vmaskr(*, *, 0))[110:150, 60]) 
    26    mu(1) = -total( (hv*e1v*vmaskr(*, *, 0))[110:150, 60]) 
     27;   mu[1] = -total( (hv*e1v*vmaskr[*, *, 0])[110:150, 60]) 
     28   mu[1] = -total( (hv*e1v*vmaskr[*, *, 0])[110:150, 60]) 
    2729; 3/ Australia 
    28 ;   mu(3) = total( (hu*e2u*umaskr(*, *, 0))[17, 40:49]) 
    29    mu(3) = total( (hu*e2u*umaskr(*, *, 0))[20, 50:61]) 
     30;   mu[3] = total( (hu*e2u*umaskr[*, *, 0])[17, 40:49]) 
     31   mu[3] = total( (hu*e2u*umaskr[*, *, 0])[20, 50:61]) 
    3032; 2/ New Zealand 
    31 ;   mu(2) = mu(3)+ total( (hv*e1v*vmaskr(*, *, 0))[30:40, 25]) 
    32    mu(2) = mu(3)+ total( (hv*e1v*vmaskr(*, *, 0))[35:49, 44]) 
     33;   mu[2] = mu[3]+ total( (hv*e1v*vmaskr[*, *, 0])[30:40, 25]) 
     34   mu[2] = mu[3]+ total( (hv*e1v*vmaskr[*, *, 0])[35:49, 44]) 
    3335; 4/ Madagascar 
    34 ;   mu(4) = total( (hv*e1v*vmaskr(*, *, 0))[150:159, 40]) 
    35    mu(4) = total( (hv*e1v*vmaskr(*, *, 0))[160:164, 56]) 
     36;   mu[4] = total( (hv*e1v*vmaskr[*, *, 0])[150:159, 40]) 
     37   mu[4] = total( (hv*e1v*vmaskr[*, *, 0])[160:164, 56]) 
    3638; 5/ New Guinea 
    37 ;   mu(5) = - total( (hu*e2u*umaskr(*, *, 0))[16, 50:55]) 
    38    mu(5) = total( (hv*e2v*vmaskr(*, *, 0))[23:33, 61]) 
     39;   mu[5] = - total( (hu*e2u*umaskr[*, *, 0])[16, 50:55]) 
     40   mu[5] = total( (hv*e2v*vmaskr[*, *, 0])[23:33, 61]) 
    3941; 6/ Celebes 
    40    mu(6) = total( (hv*e1v*vmaskr(*, *, 0))[13:22, 64]) 
     42   mu[6] = total( (hv*e1v*vmaskr[*, *, 0])[13:22, 64]) 
    4143; 7/ Borneo 
    42 ;   mu(6) = total( (hv*e1v*vmaskr(*, *, 0))[7:12, 60]) 
    43    mu(7) = total( (hv*e1v*vmaskr(*, *, 0))[14:17, 67]) 
     44;   mu[6] = total( (hv*e1v*vmaskr[*, *, 0])[7:12, 60]) 
     45   mu[7] = total( (hv*e1v*vmaskr[*, *, 0])[14:17, 67]) 
    4446; 8/ Philippines 
    45 ;   mu(7) = total( (hv*e1v*vmaskr(*, *, 0))[10:16, 90]) 
    46    mu(8) = total( (hv*e1v*vmaskr(*, *, 0))[14:22, 86]) 
     47;   mu[7] = total( (hv*e1v*vmaskr[*, *, 0])[10:16, 90]) 
     48   mu[8] = total( (hv*e1v*vmaskr[*, *, 0])[14:22, 86]) 
    4749; 9/ Tasmania 
    48    mu(9) = mu(3)+ total( (hu*e1u*umaskr(*, *, 0))[34, 41:45]) 
     50   mu[9] = mu[3]+ total( (hu*e1u*umaskr[*, *, 0])[34, 41:45]) 
    4951; 10/ Cuba 
    50 ;   mu(8) = - total( (hv*e1v*vmaskr(*, *, 0))[101:127, 86]) 
    51    mu(10) = - total( (hv*e1v*vmaskr(*, *, 0))[105:134, 90]) 
     52;   mu[8] = - total( (hv*e1v*vmaskr[*, *, 0])[101:127, 86]) 
     53   mu[10] = - total( (hv*e1v*vmaskr[*, *, 0])[105:134, 90]) 
    5254; 11/ Island 
    53 ;   mu(9) = - total( (hv*e1v*vmaskr(*, *, 0))[117:130, 124]) 
    54    mu(11) = - total( (hv*e1v*vmaskr(*, *, 0))[132:143, 120]) 
     55;   mu[9] = - total( (hv*e1v*vmaskr[*, *, 0])[117:130, 124]) 
     56   mu[11] = - total( (hv*e1v*vmaskr[*, *, 0])[132:143, 120]) 
    5557; 12/ Spitzberg 
    56 ;   mu(10) = - total( (hv*e1v*vmaskr(*, *, 0))[110:120, 137]) 
    57    mu(12) = - total( (hv*e1v*vmaskr(*, *, 0))[140:160, 135]) 
     58;   mu[10] = - total( (hv*e1v*vmaskr[*, *, 0])[110:120, 137]) 
     59   mu[12] = - total( (hv*e1v*vmaskr[*, *, 0])[140:160, 135]) 
    5860; 13/ Japan 
    59    mu(13) = total( (hv*e1v*vmaskr(*, *, 0))[25:131, 100]) 
     61   mu[13] = total( (hv*e1v*vmaskr[*, *, 0])[25:131, 100]) 
    6062end 
    6163;+ 
     
    7072;- 
    7173PRO diag_bsf_lec, bsf 
     74; 
    7275@common 
    7376@com_eg 
     
    8083      ile = 'island'+strtrim(string(k), 2) 
    8184      z2d = nc_get(fichier, ile, NCDF_DB =hom_idl+'grids/') 
    82       bsf(*, *, k-1) = shift(z2d, 0, 0) 
     85      bsf[*, *, k-1] = shift(z2d, 0, 0) 
    8386   ENDFOR  
    8487end 
     
    9093         , FLUX = flux $ 
    9194         , _EXTRA=extra 
     95; 
     96  compile_opt idl2, strictarrsubs 
    9297; 
    9398@common 
     
    121126   IF n_elements(bsfislands) EQ 0 THEN diag_bsf_lec, bsfislands 
    122127    
    123    FOR k = 0, jpisl-1 DO bsf = bsf+mu(k)*bsfislands(*, *, k) 
     128   FOR k = 0, jpisl-1 DO bsf = bsf+mu[k]*bsfislands[*, *, k] 
    124129 
    125130   return, bsf 
    126131 
    127 END  
     132END 
  • trunk/tools/bsf/inversion.pro

    r165 r169  
    33; Resolution de l'equation A.X=b ou A est une matrice creuse 
    44; et (x,b) sont des champs horizontaux 
     5; 
     6; @todo 
     7; missing build_laplacien_t module 
    58; 
    69; @history 
     
    1619         , TOL=tol $ 
    1720         , _EXTRA=extra 
     21; 
     22  compile_opt idl2, strictarrsubs 
    1823; 
    1924@common 
     
    4045   zx = double(guess) 
    4146 
    42    zr = linbcg(A, zb(*), zx(*), tol = tol, iter = iter, /double, _EXTRA=extra) 
     47   zr = linbcg(A, zb[*], zx[*], tol = tol, iter = iter, /double, _EXTRA=extra) 
    4348   print, '          Number of iterations :', iter 
    4449 
  • trunk/tools/bsf/moyz.pro

    r165 r169  
    1515         , INT=int 
    1616; 
     17  compile_opt idl2, strictarrsubs 
     18; 
    1719@common 
    1820    
     
    2426      0 : tt = tt 
    2527      1 : tt = tt*(replicate(1, jpi*jpj)#msk) 
    26       2 : tt = tt*(msk(*)#replicate(1, jpk)) 
     28      2 : tt = tt*(msk[*]#replicate(1, jpk)) 
    2729      3 : tt = tt*msk 
    2830   ENDCASE  
    2931    
    3032   height = reform( replicate(1, jpi*jpj)#e3t, jpi, jpj, jpk)*tt 
    31 ;   IF s_exp EQ 'GF1' THEN height(*, *, 0) = height(*, *, 0)+ssh 
     33;   IF s_exp EQ 'GF1' THEN height[*, *, 0] = height[*, *, 0]+ssh 
    3234   totz = total( z*height, 3) 
    3335   totheight = total( height, 3) 
     
    3739   IF n_elements(int) EQ 0 THEN BEGIN  
    3840      ind = where(totheight NE 0) 
    39       moy(ind) = totz(ind) / totheight(ind) 
     41      moy[ind] = totz[ind] / totheight[ind] 
    4042   ENDIF  
    4143 
  • trunk/tools/density_binning/bining.pro

    r165 r169  
    6868    , TMASK=tmask 
    6969; 
     70  compile_opt idl2, strictarrsubs 
     71; 
    7072   size3d = size(density) 
    71    jpi = size3d(1) 
    72    jpj = size3d(2) 
    73    jpk = size3d(3) 
     73   jpi = size3d[1] 
     74   jpj = size3d[2] 
     75   jpk = size3d[3] 
    7476 
    7577   indm = where(tmask eq 0) 
    7678 
    77    x(indm) = 0. 
    78    density(indm) = !VALUES.F_NAN 
     79   x[indm] = 0. 
     80   density[indm] = !VALUES.F_NAN 
    7981 
    8082   N_z = jpk 
     
    117119   cont_s = fltarr(jpi, jpj, N_s+2) 
    118120 
    119    x_bin(*, *, *) = !VALUES.F_NAN  
    120    depth_bin(*, *, *) = !VALUES.F_NAN  
     121   x_bin[*, *, *] = !VALUES.F_NAN  
     122   depth_bin[*, *, *] = !VALUES.F_NAN  
    121123 
    122124; 
     
    124126; 
    125127   x_content = fltarr(jpi, jpj, jpk) 
    126    x_content(*, *, 0) = 0. 
     128   x_content[*, *, 0] = 0. 
    127129;   FOR k = 0, jpk-1 DO BEGIN 
    128 ;      print, k, z_zw(k), e3t(k), x(4, 30, k) 
     130;      print, k, z_zw[k], e3t[k], x[4, 30, k] 
    129131;   ENDFOR  
    130132   FOR k = 1, jpk-1 DO BEGIN 
    131       x_content(*, *, k) = x_content(*, *, k-1) $  
    132 ;                        + e3t(k-1) * x(*, *, k-1) 
    133       + ( z_zw(k)-z_zw(k-1) ) * x(*, *, k) 
    134 ;      print, k, z_zw(k), e3t(k-1), ( z_zw(k)-z_zw(k-1) ), ( z_zw(k)-z_zw(k-1) )-e3t(k-1) 
     133      x_content[*, *, k] = x_content[*, *, k-1] $  
     134;                        + e3t[k-1] * x[*, *, k-1] 
     135      + [ z_zw[k]-z_zw[k-1] ] * x[*, *, k] 
     136;      print, k, z_zw[k], e3t[k-1], [ z_zw[k]-z_zw[k-1] ], [ z_zw[k]-z_zw[k-1] ]-e3t[k-1] 
    135137   ENDFOR  
    136138; 
     
    144146;  Indices des points T dans l ocean 
    145147; 
    146          i_ocean = where(tmask(i, j, *) EQ 1) 
    147  
    148          z_s(*) = !VALUES.F_NAN  
     148         i_ocean = where(tmask[i, j, *] EQ 1) 
     149 
     150         z_s[*] = !VALUES.F_NAN  
    149151         c_s = c_s*0. 
    150          x_s(*) = !VALUES.F_NAN  
     152         x_s[*] = !VALUES.F_NAN  
    151153 
    152154         IF i_ocean[0] NE -1 THEN BEGIN ; on n entre que si il y a des points ocean 
    153155 
    154             i_bottom = i_ocean(n_elements(i_ocean)-1) 
    155  
    156             z_s(0) = 0 
    157             z_s(N_s+1) = z_zw(i_bottom) 
    158  
    159             c_s(0) = 0 
    160             c_s(N_s+1) = x_content(i, j, jpk-1) 
     156            i_bottom = i_ocean[n_elements(i_ocean)-1] 
     157 
     158            z_s[0] = 0 
     159            z_s[N_s+1] = z_zw[i_bottom] 
     160 
     161            c_s[0] = 0 
     162            c_s[N_s+1] = x_content[i, j, jpk-1] 
    161163             
    162             s_z(*) = density(i, j, *) 
    163             c_z(*) = x_content(i, j, *) 
     164            s_z[*] = density[i, j, *] 
     165            c_z[*] = x_content[i, j, *] 
    164166 
    165167; exctraction d'un sous profil strictement croissant 
    166             mini = min(s_z(i_ocean)) 
    167             maxi = max(s_z(i_ocean)) 
    168             i_min = where(s_z(i_ocean) EQ mini) 
    169             i_max = where(s_z(i_ocean) EQ maxi) 
     168            mini = min(s_z[i_ocean]) 
     169            maxi = max(s_z[i_ocean]) 
     170            i_min = where(s_z[i_ocean] EQ mini) 
     171            i_max = where(s_z[i_ocean] EQ maxi) 
    170172;   on prend le plus grand des indices min 
    171173;         et le plus petit des indices max 
    172             i_min = i_min(n_elements(i_min)-1) 
     174            i_min = i_min[n_elements(i_min)-1] 
    173175            i_max = i_max[0] 
    174176 
     
    176178; l isopycne est mise en surface (z_s=0) 
    177179; 
    178             ind = where(s_s LT s_z(i_min)) 
     180            ind = where(s_s LT s_z[i_min]) 
    179181            IF ind[0] NE -1 THEN BEGIN  
    180                z_s(ind+1) = 0 
    181                c_s(ind+1) = 0 
     182               z_s[ind+1] = 0 
     183               c_s[ind+1] = 0 
    182184            ENDIF  
    183185 
    184186; Si la valeur du niveau (s_s) est plus elevee que la densite du fond,  
    185 ; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
    186 ; 
    187             ind = where(s_s GT s_z(i_max)) 
     187; l isopycne est mise au fond (z_s=z_zw[i_bottom]) 
     188; 
     189            ind = where(s_s GT s_z[i_max]) 
    188190            IF ind[0] NE -1 THEN BEGIN  
    189                z_s(ind+1) = z_s(N_s+1) 
    190                c_s(ind+1) = c_s(N_s+1) 
     191               z_s[ind+1] = z_s[N_s+1] 
     192               c_s[ind+1] = c_s[N_s+1] 
    191193            ENDIF  
    192194 
    193             ind = where( (s_s GE s_z(i_min)) AND (s_s LE s_z(i_max)) ) 
     195            ind = where( (s_s GE s_z[i_min]) AND (s_s LE s_z[i_max]) ) 
    194196            IF ind[0] NE -1 THEN BEGIN  
    195197                
    196                i_profil = i_ocean(i_min:i_max) 
     198               i_profil = i_ocean[i_min:i_max] 
    197199 
    198200;               print, i, j, n_elements(i_profil)  
    199201 
    200                z_s(ind+1) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) 
     202               z_s[ind+1] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) 
    201203                
    202204; 
     
    204206; 
    205207               IF n_elements(i_profil) GT 2 THEN BEGIN  
    206                   c_s(ind+1) = spline(z_zw(i_profil), c_z(i_profil), z_s(ind+1), 1) 
     208                  c_s[ind+1] = spline(z_zw[i_profil], c_z[i_profil], z_s[ind+1], 1) 
    207209               ENDIF ELSE BEGIN 
    208                   c_s(ind+1) = interpol(c_z(i_profil), z_zw(i_profil), z_s(ind+1)) 
     210                  c_s[ind+1] = interpol(c_z[i_profil], z_zw[i_profil], z_s[ind+1]) 
    209211               ENDELSE  
    210212; 
     
    212214; me semble moins propre. Je la donne en remarque. 
    213215; 
    214 ;               c_s(ind+1) = interpol(c_z(i_profil), z_zw(i_profil), z_s(ind+1)) 
    215  
    216                x_s(ind+1) = (c_s(ind+2)-c_s(ind+1))/(z_s(ind+2)-z_s(ind+1)) 
     216;               c_s[ind+1] = interpol(c_z[i_profil], z_zw[i_profil], z_s[ind+1]) 
     217 
     218               x_s[ind+1] = (c_s[ind+2]-c_s[ind+1])/(z_s[ind+2]-z_s[ind+1]) 
    217219 
    218220            ENDIF  
    219221             
    220 ;            x_s(0) = c_s(1)/z_s(1) 
     222;            x_s[0] = c_s[1]/z_s[1] 
    221223 
    222224        ENDIF  
    223225 
    224          depth_bin(i, j, *) = z_s 
    225          x_bin    (i, j, *) = x_s 
     226         depth_bin[i, j, *] = z_s 
     227         x_bin    [i, j, *] = x_s 
    226228      ENDFOR  
    227229   ENDFOR  
    228230 
    229231; mask depth_bin with undefined values of x_bin 
    230    depth_bin(where(finite(x_bin, /nan) EQ 1)) = !VALUES.F_NAN 
     232   depth_bin[where(finite(x_bin, /nan) EQ 1)] = !VALUES.F_NAN 
    231233 
    232234;   print, min(x_bin(where (abs(x_bin) LT 1.e19))), max(x_bin(where (abs(x_bin) LT 1.e19))) 
    233235;   print, min(depth_bin(where (abs(depth_bin) LT 1.e19))), max(depth_bin(where (abs(depth_bin) LT 1.e19))) 
    234236    
    235 END  
     237END 
  • trunk/tools/density_binning/bining2_bak.pro

    r165 r169  
    6363; 
    6464;- 
    65 PRO bining2 $ 
     65PRO bining2_bak $ 
    6666    , density $ 
    6767    , x1 $ 
     
    7676    , TMASK=tmask 
    7777; 
     78  compile_opt idl2, strictarrsubs 
     79; 
    7880    size3d = size(density) 
    79     jpi = size3d(1) 
    80     jpj = size3d(2) 
    81     jpk = size3d(3) 
     81    jpi = size3d[1] 
     82    jpj = size3d[2] 
     83    jpk = size3d[3] 
    8284  
    8385   indm = where(tmask eq 0) 
    8486 
    85    x1(indm) = 0. 
    86    density(indm) = !VALUES.F_NAN 
     87   x1[indm] = 0. 
     88   density[indm] = !VALUES.F_NAN 
    8789 
    8890   N_z = jpk 
     
    129131   x1_bin = fltarr(jpi, jpj, N_s+1) 
    130132 
    131    x1_bin(*, *, *) = !VALUES.F_NAN  
    132    depth_bin(*, *, *) = !VALUES.F_NAN  
    133    thick_bin(*, *, *) = !VALUES.F_NAN  
     133   x1_bin[*, *, *] = !VALUES.F_NAN  
     134   depth_bin[*, *, *] = !VALUES.F_NAN  
     135   thick_bin[*, *, *] = !VALUES.F_NAN  
    134136 
    135137; 
     
    137139; 
    138140   x1_content = fltarr(jpi, jpj, jpk) 
    139    x1_content(*, *, 0) = e3t(0) * x1(*, *, 0) * tmask (*, *, 0) 
    140    FOR k = 1, jpk-1 DO x1_content(*, *, k) = x1_content(*, *, k-1) $  
    141                         + e3t(k) * x1(*, *, k)* tmask (*, *, k) 
     141   x1_content[*, *, 0] = e3t[0] * x1[*, *, 0] * tmask [*, *, 0] 
     142   FOR k = 1, jpk-1 DO x1_content[*, *, k] = x1_content[*, *, k-1] $  
     143                        + e3t[k] * x1[*, *, k]* tmask [*, *, k] 
    142144 
    143145 
     
    150152;  Indices des points T dans l ocean 
    151153; 
    152          i_ocean = where(tmask(i, j, *) EQ 1) 
     154         i_ocean = where(tmask[i, j, *] EQ 1) 
    153155 
    154156         z_s = z_s*0. 
     
    159161         IF i_ocean[0] NE -1 THEN BEGIN ; on n entre que si il y a des points ocean 
    160162 
    161             i_bottom = i_ocean(n_elements(i_ocean)-1) 
    162  
    163             z_s(N_s) = z_zw(i_bottom) 
    164             c1_s(N_s) = x1_content(i, j, jpk-1) 
     163            i_bottom = i_ocean[n_elements(i_ocean)-1] 
     164 
     165            z_s[N_s] = z_zw[i_bottom] 
     166            c1_s[N_s] = x1_content[i, j, jpk-1] 
    165167             
    166             s_z(*) = density(i, j, *) 
    167             c1_z(*) = x1_content(i, j, *) 
     168            s_z[*] = density[i, j, *] 
     169            c1_z[*] = x1_content[i, j, *] 
    168170 
    169171; extraction d'un sous profil strictement croissant 
    170             mini = min(s_z(i_ocean)) 
    171             maxi = max(s_z(i_ocean)) 
    172             i_min = where(s_z(i_ocean) EQ mini) 
    173             i_max = where(s_z(i_ocean) EQ maxi) 
     172            mini = min(s_z[i_ocean]) 
     173            maxi = max(s_z[i_ocean]) 
     174            i_min = where(s_z[i_ocean] EQ mini) 
     175            i_max = where(s_z[i_ocean] EQ maxi) 
    174176;   on prend le plus grand des indices min 
    175177;         et le plus petit des indices max 
    176             i_min = i_min(n_elements(i_min)-1) 
     178            i_min = i_min[n_elements(i_min)-1] 
    177179            i_max = i_max[0] 
    178180 
     
    183185; l isopycne est mise en surface (z_s=0) 
    184186; 
    185             ind = where(s_s LT s_z(i_min)) 
     187            ind = where(s_s LT s_z[i_min]) 
    186188            IF ind[0] NE -1 THEN BEGIN  
    187                z_s(ind) = 0 
    188                c1_s(ind) = 0 
     189               z_s[ind] = 0 
     190               c1_s[ind] = 0 
    189191            ENDIF  
    190192 
    191193; Si la valeur du niveau (s_s) est plus elevee que la densite du fond,  
    192 ; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
    193 ; 
    194             ind = where(s_s GT s_z(i_max)) 
     194; l isopycne est mise au fond (z_s=z_zw[i_bottom]) 
     195; 
     196            ind = where(s_s GT s_z[i_max]) 
    195197            IF ind[0] NE -1 THEN BEGIN  
    196                z_s(ind) = z_s(N_s) 
    197                c1_s(ind) = c1_s(N_s) 
     198               z_s[ind] = z_s[N_s] 
     199               c1_s[ind] = c1_s[N_s] 
    198200            ENDIF  
    199201; cas general 
    200             ind = where( (s_s GE s_z(i_min)) AND (s_s LE s_z(i_max)) ) 
     202            ind = where( (s_s GE s_z[i_min]) AND (s_s LE s_z[i_max]) ) 
    201203            IF ind[0] NE -1 THEN BEGIN  
    202204                
    203                i_profil = i_ocean(i_min:i_max) 
    204  
    205                z_s(ind) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) 
     205               i_profil = i_ocean[i_min:i_max] 
     206 
     207               z_s[ind] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) 
    206208                
    207209; 
     
    211213; 
    212214               IF n_elements(i_profil) GT 2 THEN BEGIN  
    213                   c1_s(ind) = spline(z_zw(i_profil), c1_z(i_profil), z_s(ind), 1) 
    214 ;                  c1_s(ind) = interpol(c1_z(i_profil), z_zw(i_profil), z_s(ind)) 
     215                  c1_s[ind] = spline(z_zw[i_profil], c1_z[i_profil], z_s[ind], 1) 
     216;                  c1_s[ind] = interpol(c1_z[i_profil], z_zw[i_profil], z_s[ind]) 
    215217               ENDIF ELSE BEGIN 
    216                   c1_s(ind) = interpol(c1_z(i_profil), z_zw(i_profil), z_s(ind)) 
     218                  c1_s[ind] = interpol(c1_z[i_profil], z_zw[i_profil], z_s[ind]) 
    217219               ENDELSE  
    218220; 
    219221; 
    220                x1_s(ind) = (c1_s(ind+1)-c1_s(ind))/(z_s(ind+1)-z_s(ind)) 
     222               x1_s[ind] = (c1_s[ind+1]-c1_s[ind])/(z_s[ind+1]-z_s[ind]) 
    221223 
    222224            ENDIF  
    223225         ENDIF  
    224226; 
    225          depth_bin (i, j, *) = z_s 
    226          thick_bin (i, j, 0) = z_s(0) 
    227          thick_bin (i, j, 1:N_s) = z_s(1:N_s)-z_s(0:N_s-1) 
    228          x1_bin    (i, j, *) = x1_s 
     227         depth_bin [i, j, *] = z_s 
     228         thick_bin [i, j, 0] = z_s[0] 
     229         thick_bin [i, j, 1:N_s] = z_s[1:N_s]-z_s[0:N_s-1] 
     230         x1_bin    [i, j, *] = x1_s 
    229231; 
    230232      ENDFOR  
    231233   ENDFOR  
    232234; mask depth_bin with undefined values of x_bin 
    233    depth_bin(where(finite(x1_bin, /nan) EQ 1)) = !VALUES.F_NAN 
    234    thick_bin(where(finite(x1_bin, /nan) EQ 1)) = !VALUES.F_NAN 
     235   depth_bin[where(finite(x1_bin, /nan) EQ 1)] = !VALUES.F_NAN 
     236   thick_bin[where(finite(x1_bin, /nan) EQ 1)] = !VALUES.F_NAN 
    235237 
    236238    
    237 END  
     239END 
  • trunk/tools/density_binning/binning_neutral_and_co/bin_velocity_new.pro

    r166 r169  
    99         , VV=vv $ 
    1010         , TT=tt 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
     
    4244                                ; z_zw = gdepw (old)        
    4345      z_zw=shift(gdepw,-1)      ;                     W  (k=0 -> 10m) 
    44       z_zw(jpk-1)=gdepw(jpk-1)   
     46      z_zw[jpk-1]=gdepw[jpk-1] 
    4547       
    4648; s or partial step case: 
     
    4850      fich_msh = 'mesh_mask_NDV1.nc' 
    4951      z3d_zt = read_ncdf('e3v_ps',0,/timestep,iodir=ioMESH,/nostruct,/tout,filename=fich_msh) 
    50       z3d_zt(where(z3d_zt eq 1.e20))=500. 
     52      z3d_zt[where(z3d_zt eq 1.e20)]=500. 
    5153      z3d_zw = total(z3d_zt,3,/cumulative)      ;  W  (k=0 -> 10m) 
    5254      z3d_zt = (shift(z3d_zw,0,0,1)+z3d_zw)*0.5 
    53       z3d_zt(*,*,0) = z3d_zw(*,*,0)*0.5         ; T  (k=0 -> 5m) 
     55      z3d_zt[*,*,0] = z3d_zw[*,*,0]*0.5         ; T  (k=0 -> 5m) 
    5456       
    5557;   Profiles along density level (suffixe _s) 
     
    6264; vertical content of x1 (ensure  the integrale conservation) 
    6365      x1_content = fltarr(jpi, jpj, jpk) 
    64       x1_content(*, *, 0) = e3t(0) * x1(*, *, 0) * xmask(*,*,0) 
    65       FOR k = 1, jpk-1 DO x1_content(*, *, k) = x1_content(*, *, k-1) $  
    66                                               + e3t(k) * x1(*, *, k) * xmask(*,*,k) 
     66      x1_content[*, *, 0] = e3t[0] * x1[*, *, 0] * xmask[*,*,0] 
     67      FOR k = 1, jpk-1 DO x1_content[*, *, k] = x1_content[*, *, k-1] $  
     68                                              + e3t[k] * x1[*, *, k] * xmask[*,*,k] 
    6769; 
    6870;  Loop over the horizontal domain 2D 
     
    7274       
    7375; depth at T and W points 
    74          z_zt(*) = z3d_zt(i,j,*) 
    75          z_zw(*) = z3d_zw(i,j,*) 
     76         z_zt[*] = z3d_zt[i,j,*] 
     77         z_zw[*] = z3d_zw[i,j,*] 
    7678       
    7779; 
    7880;  Indices des points T dans l ocean 
    7981; 
    80          i_ocean = where(xmask(i, j, *) EQ 1) 
     82         i_ocean = where(xmask[i, j, *] EQ 1) 
    8183         z_s = z_s*0. 
    8284         c1_s = c1_s*0. 
     
    8486         IF (i_ocean[0] NE -1) THEN BEGIN ; on n'entre que si il y a des points ocean 
    8587  
    86             s_z(*) = density(i, j, *) 
    87             c1_z(*) = x1_content(i, j, *) 
     88            s_z[*] = density[i, j, *] 
     89            c1_z[*] = x1_content[i, j, *] 
    8890; critere supplementaire a imposer sur le profil pour eviter les cas 
    8991; pathologiques en attendant d'ecrire une vraie commande d'extraction 
    9092; de progils stritement croissant. Il s'agit donc d'un test adhoc. 
    91             IF s_z(0) LT s_z(i_ocean(n_elements(i_ocean)-1)) THEN BEGIN  
     93            IF s_z[0] LT s_z[i_ocean[n_elements(i_ocean)-1]] THEN BEGIN  
    9294;------------------------------------------------------------------------ 
    9395; controle si le profil est bien strictement croissant (pour l'instant 
    94 ; inutilisŽ (avis aux amateurs) 
     96; inutilisé (avis aux amateurs) 
    9597; 
    96 ;            ds = (shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
    97 ;            ds(0) = 0 
     98;            ds = (shift(s_z, -1)-s_z)(i_ocean[0:n_elements(i_ocean)-2]) 
     99;            ds[0] = 0 
    98100;            ind = where(ds LT 0.) 
    99 ;            croissant = ind(0) EQ -1 
     101;            croissant = ind[0] EQ -1 
    100102;------------------------------------------------------------------------ 
    101             i_bottom = i_ocean(n_elements(i_ocean)-1) 
    102             z_s(N_s) = z_zw(i_bottom) 
    103             c1_s(N_s) = x1_content(i, j, jpk-1) 
     103            i_bottom = i_ocean[n_elements(i_ocean)-1] 
     104            z_s[N_s] = z_zw[i_bottom] 
     105            c1_s[N_s] = x1_content[i, j, jpk-1] 
    104106             
    105107; extraction d'un sous profil strictement croissant 
    106             mini = min(s_z(i_ocean)) 
    107             maxi = max(s_z(i_ocean))             
    108             i_min = where(s_z(i_ocean) EQ mini) 
    109             i_max = where(s_z(i_ocean) EQ maxi) 
     108            mini = min(s_z[i_ocean]) 
     109            maxi = max(s_z[i_ocean])             
     110            i_min = where(s_z[i_ocean] EQ mini) 
     111            i_max = where(s_z[i_ocean] EQ maxi) 
    110112;   on prend le plus grand des indices min 
    111113;         et le plus petit des indices max 
    112   ;gr          i_min = i_min(n_elements(i_min)-1) 
     114  ;gr          i_min = i_min[n_elements(i_min)-1] 
    113115  ;gr          i_max = i_max[0] 
    114116             i_min = i_min[0] 
    115              i_max = i_max(n_elements(i_min)-1) 
     117             i_max = i_max[n_elements(i_min)-1] 
    116118;            IF i_max GE jpk-1 THEN print, i, j, i_max 
    117119;            IF i_min LE 1 THEN print, i, j, i_min 
     
    120122; l isopycne est mise en surface (z_s=0) 
    121123; 
    122             ind = where(s_s LT s_z(i_min)) 
     124            ind = where(s_s LT s_z[i_min]) 
    123125            IF ind[0] NE -1 THEN BEGIN          &$ 
    124                z_s(ind) = 0                     &$ 
    125                c1_s(ind) = 0                    &$ 
     126               z_s[ind] = 0                     &$ 
     127               c1_s[ind] = 0                    &$ 
    126128            ENDIF  
    127129; Si la valeur du niveau (s_s) est plus elevee que la densite du fond,  
    128 ; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
     130; l isopycne est mise au fond (z_s=z_zw[i_bottom]) 
    129131; 
    130             ind = where(s_s GT s_z(i_max)) 
     132            ind = where(s_s GT s_z[i_max]) 
    131133            IF ind[0] NE -1 THEN BEGIN          &$ 
    132                z_s(ind) = z_s(N_s)              &$ 
    133                c1_s(ind) = c1_s(N_s)            &$ 
     134               z_s[ind] = z_s[N_s]              &$ 
     135               c1_s[ind] = c1_s[N_s]            &$ 
    134136            ENDIF  
    135137; 
    136      ds =(shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
     138     ds =(shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    137139     ind_c = where(ds LT 0.)      
    138 ;     croissant = ind_c(0) EQ -1 
     140;     croissant = ind_c[0] EQ -1 
    139141;     IF ( i_min GT i_max ) then begin 
    140142;     print, 'bug ',i_min, i_max,'  en i,j=', i,j 
    141143;     endif 
    142      IF ( ind_c(0) NE -1 ) then begin   
     144     IF ( ind_c[0] NE -1 ) then begin   
    143145           print, 'bug   en i,j=', i,j,'  ind_c = ', ind_c 
    144146           stop 
    145147     endif 
    146148;     IF ( i_min LE i_max ) then begin 
    147        IF ( ind_c(0) EQ -1 ) then begin 
    148             ind = where( (s_s GE s_z(i_min)) AND (s_s LT s_z(i_max)) ) 
     149       IF ( ind_c[0] EQ -1 ) then begin 
     150            ind = where( (s_s GE s_z[i_min]) AND (s_s LT s_z[i_max]) ) 
    149151            IF ind[0] NE -1 THEN BEGIN  
    150152               IF ( n_elements(ind) NE 1 ) THEN BEGIN 
    151153                
    152                    i_profil = i_ocean(i_min:i_max) 
    153                    z_s(ind) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) 
     154                   i_profil = i_ocean[i_min:i_max] 
     155                   z_s[ind] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) 
    154156                
    155157; 
    156158; j'utilise la fonction spline pour interpoler le contenu 
    157159; 
    158                    c1_s(ind) = spline(z_zw(i_profil), c1_z(i_profil), z_s(ind), 1) 
     160                   c1_s[ind] = spline(z_zw[i_profil], c1_z[i_profil], z_s[ind], 1) 
    159161; 
    160162; l'interpolation lineaire marche aussi. Elle donne des resultats differents. Elle 
    161163; me semble moins propre. Je la donne en remarque. 
    162164; 
    163 ;                  c_s(ind+1) = interpol(c_z(i_profil), z_zw(i_profil), z_s(ind+1)) 
     165;                  c_s[ind+1] = interpol(c_z[i_profil], z_zw[i_profil], z_s[ind+1]) 
    164166; 
    165167; Remarque : on ne divise pas par l'epaisseur de la couche 
     
    168170               IF ( n_elements(ind) EQ 1 ) THEN BEGIN 
    169171 ;                  print, 'one density bin   en i,j=', i,j,'  ind = ', ind 
    170                    c1_s(ind) = c1_z(jpk-1) 
     172                   c1_s[ind] = c1_z[jpk-1] 
    171173               ENDIF 
    172174; 
    173                    x1_s(ind[0]-1) = (c1_s(ind[0])-c1_s(ind[0]-1));/(z_s(ind+1)-z_s(ind)) 
    174                    x1_s(ind) = (c1_s(ind+1)-c1_s(ind));/(z_s(ind+1)-z_s(ind)) 
    175 ;                   x1_s(ind[0]-1) = (c1_s(ind[0])-c1_s(ind[0]-1))/(z_s(ind+1)-z_s(ind)) 
    176 ;                   x1_s(ind) = (c1_s(ind+1)-c1_s(ind))/(z_s(ind+1)-z_s(ind)) 
     175                   x1_s[ind[0]-1] = (c1_s[ind[0]]-c1_s[ind[0]-1]);/(z_s[ind+1]-z_s[ind]) 
     176                   x1_s[ind] = (c1_s[ind+1]-c1_s[ind]);/(z_s[ind+1)-z_s[ind]) 
    177177            ENDIF  
    178178     endif 
    179179         ENDIF  
    180180         ENDIF 
    181          x1_bin(i, j, *) = x1_s 
     181         x1_bin[i, j, *] = x1_s 
    182182          
    183183      ENDFOR  
  • trunk/tools/density_binning/binning_neutral_and_co/bn2.pro

    r168 r169  
    4646;- 
    4747FUNCTION bn2, tn, sn, neos 
     48; 
     49  compile_opt idl2, strictarrsubs 
    4850; 
    4951@common 
     
    136138; ------------------------ 
    137139; bn^2=0. at first vertical point and jk=jpk  
    138    z(*, *, 0) = 0 
    139    IF (gdep(nz-1) eq gdepw(jpk-1)) THEN z(*, *, nz-1) = 0 
     140   z[*, *, 0] = 0 
     141   IF (gdep[nz-1] eq gdepw[jpk-1]) THEN z[*, *, nz-1] = 0 
    140142sortie: 
    141143   return, z 
  • trunk/tools/density_binning/binning_neutral_and_co/eos.pro

    r168 r169  
    5353;- 
    5454FUNCTION eos, t, s, sigma 
     55; 
     56  compile_opt idl2, strictarrsubs 
    5557; 
    5658@common 
  • trunk/tools/density_binning/binning_neutral_and_co/eos_neutral.pro

    r168 r169  
    3838FUNCTION eos_neutral, t, s 
    3939; 
     40  compile_opt idl2, strictarrsubs 
     41; 
    4042@common 
    4143; 
  • trunk/tools/density_binning/binning_neutral_and_co/fig_msfs_new.pro

    r168 r169  
    88; 
    99;- 
    10 PRO fig_msf_sigma 
    11  
     10PRO fig_msfs_new 
     11; 
     12  compile_opt idl2, strictarrsubs 
     13; 
    1214@common 
    13  
     15; 
    1416;meshmask  
    1517@0_initorca2_NDV1 
     
    4648; 
    4749; define vmask for each sub basin (mask in the ACC: MSF computation) 
    48 vglomsk = shift(tmask(*,*,0), 0, -1) *tmask(*,*,0) 
     50vglomsk = shift(tmask[*,*,0], 0, -1) *tmask[*,*,0] 
    4951atlmsk=glo_atl*glo_noACC 
    5052vatlmsk = shift(atlmsk, 0, -1) * atlmsk 
     
    104106 
    105107s_v=sig_min+findgen(n_sig)*sig_del 
    106 s_v(0) = 0. 
    107 s_v(n_sig-1) = 100. 
     108s_v[0] = 0. 
     109s_v[n_sig-1] = 100. 
    108110 
    109111 
     
    223225;@initorca2_o 
    224226@0_initorca2_NDV1 
     227; 
     228END 
  • trunk/tools/density_binning/binning_neutral_and_co/fsalbt.pro

    r168 r169  
    3131FUNCTION fsalbt, pft, pfs, pfh 
    3232; 
     33  compile_opt idl2, strictarrsubs 
     34; 
    3335; ratio alpha/beta 
    3436; ================ 
  • trunk/tools/density_binning/binning_neutral_and_co/fsbeta.pro

    r168 r169  
    3131FUNCTION fsbeta, pft, pfs, pfh 
    3232; 
     33  compile_opt idl2, strictarrsubs 
     34; 
    3335      z = $  
    3436       ( ( -0.415613e-09 * pft + 0.555579e-07 ) * pft $  
  • trunk/tools/density_binning/binning_neutral_and_co/msfs.pro

    r165 r169  
    2424         , ORCA=orca 
    2525; 
     26  compile_opt idl2, strictarrsubs 
     27; 
    2628@common 
    2729;------------------------- 
     
    3133;      density = vmask()*sig 
    3234      vvmask = vmask() 
    33       density(*,jpj-1,*)=0.e0        ; set to zero the northern j-line 
     35      density[*,jpj-1,*]=0.e0        ; set to zero the northern j-line 
    3436      density=density*vmask() 
    3537;------------------------- 
     
    4648;                level 20       2.5 Sv 
    4749;                level 21       1.0 Sv 
    48       vvf(167,100, 0:13) = vvf(167,100, 0:13)+0.8e+6/14.*vvmask(167,100, 0:13) 
    49       vvf(167,100,14:19) = vvf(167,100,14:19)+0.7e+6/6. *vvmask(167,100,14:19) 
    50       vvf(167,100, 20  ) = vvf(167,100, 20  )+2.5e+6    *vvmask(167,100, 20  ) 
    51       vvf(167,100, 21  ) = vvf(167,100, 21  )+0.8e+6/14.*vvmask(167,100, 21  ) 
     50      vvf[167,100, 0:13] = vvf[167,100, 0:13]+0.8e+6/14.*vvmask[167,100, 0:13] 
     51      vvf[167,100,14:19] = vvf[167,100,14:19]+0.7e+6/6. *vvmask[167,100,14:19] 
     52      vvf[167,100, 20  ] = vvf[167,100, 20  ]+2.5e+6    *vvmask[167,100, 20  ] 
     53      vvf[167,100, 21  ] = vvf[167,100, 21  ]+0.8e+6/14.*vvmask[167,100, 21  ] 
    5254;------------------------- 
    5355if keyword_set(mask) then begin                 &$ 
     
    5860; crude summation 
    5961;------------------------- 
    60       N_s = n_elements(s_s)             ; number of density levels 
    61       x1_bin = fltarr(jpj, N_s) ; output array (transport function of density) 
    62           x1_bin(*,*) = 0.e0 
    63       FOR is = N_s-1,0,-1 DO begin               &$ 
    64          dmsk= density GT s_s(is)                &$ 
    65       x1_bin(*,is) = total( total(vvf*dmsk,1),2)  &$ 
     62      n_s = n_elements(s_s)             ; number of density levels 
     63      x1_bin = fltarr(jpj, n_s) ; output array (transport function of density) 
     64          x1_bin[*,*] = 0.e0 
     65      FOR is = n_s-1,0,-1 DO begin               &$ 
     66         dmsk= density GT s_s[is]                &$ 
     67      x1_bin[*,is] = total( total(vvf*dmsk,1),2)  &$ 
    6668      ENDFOR                                     &$ 
    6769      msfs=x1_bin *1.e-6 
  • trunk/tools/density_binning/binning_neutral_and_co/npc.pro

    r168 r169  
    3030FUNCTION npc, s3d 
    3131; 
     32  compile_opt idl2, strictarrsubs 
     33; 
    3234@common 
    3335;; 
     
    5254      ; 
    5355      ;  Indices des points T dans l ocean 
    54          i_ocean = where(tmask(i,j,*) EQ 1) 
     56         i_ocean = where(tmask[i,j,*] EQ 1) 
    5557      ; 
    5658         IF (i_ocean[0] NE -1) THEN BEGIN         ; on n'entre que si il y a des points ocean 
    5759            ;  
    5860            ; density profil 
    59                        s_z(*)= s3d(i,j,*) 
    60                        ;s_z(*) = rho(i,j,*) 
     61                       s_z[*]= s3d[i,j,*] 
     62                       ;s_z[*] = rho[i,j,*] 
    6163            ;   
    6264            ; 1. Static instability pointer 
    6365            ; ----------------------------- 
    6466            ; 
    65               ds =(shift(s_z,-1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
     67              ds =(shift(s_z,-1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    6668              ind_c = where(ds LT 0.) 
    6769            ; 
    6870            ; 2. Vertical mixing for each instable portion of the density profil 
    6971            ; 
    70               IF ( ind_c(0) NE -1 ) THEN BEGIN 
     72              IF ( ind_c[0] NE -1 ) THEN BEGIN 
    7173                  ncompt=ncompt+1 
    7274            ;      print, 'static instability at i,j=', i,j 
     
    7779            ; vertical iteration 
    7880                  jiter = 0 
    79                   WHILE ( (ind_c(0) NE -1) AND (jiter LT jpk-1) ) DO BEGIN              &$ 
     81                  WHILE ( (ind_c[0] NE -1) AND (jiter LT jpk-1) ) DO BEGIN              &$ 
    8082                    jiter = jiter+1                                                     &$ 
    8183                  ; ikup : the first static instability from the sea surface 
    82                     ikup = ind_c(0)                                                     &$                                                       
     84                    ikup = ind_c[0]                                                     &$                                                       
    8385                  ; the density profil is instable below ikup 
    8486                  ; ikdown : bottom of the instable portion of the density profil 
    8587                  ; search of ikdown and vertical mixing from ikup to ikdown 
    86                     ze3tot= e3t(ikup)                                                   &$ 
    87                     zraua = s_z(ikup)                                                   &$ 
     88                    ze3tot= e3t[ikup]                                                   &$ 
     89                    zraua = s_z[ikup]                                                   &$ 
    8890                    jkdown = ikup+1                                                     &$ 
    8991; 
    90                     WHILE (jkdown LE ikbot AND zraua GT s_z(jkdown) ) DO BEGIN  &$ 
    91                       ze3dwn = e3t(jkdown)                                              &$ 
     92                    WHILE (jkdown LE ikbot AND zraua GT s_z[jkdown] ) DO BEGIN  &$ 
     93                      ze3dwn = e3t[jkdown]                                              &$ 
    9294                      ze3tot = ze3tot+ze3dwn                                            &$ 
    93                       zraua = ( zraua*(ze3tot-ze3dwn) + s_z(jkdown)*ze3dwn )/ze3tot     &$ 
     95                      zraua = ( zraua*(ze3tot-ze3dwn) + s_z[jkdown]*ze3dwn )/ze3tot     &$ 
    9496                      jkdown=jkdown+1                                                   &$ 
    9597;                      print, jkdown, zraua                                             &$ 
     
    9799; 
    98100                    FOR jkp = ikup,jkdown-1 DO BEGIN                                    &$ 
    99                       s_z(jkp) = zraua                                                  &$ 
     101                      s_z[jkp] = zraua                                                  &$ 
    100102                    ENDFOR                                                              &$ 
    101                     ds =(shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2))          &$ 
     103                    ds =(shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]]          &$ 
    102104                    ind_c = where(ds LT 0.)                                             &$ 
    103105                  ENDWHILE 
    104106              ENDIF 
    105107            ; save the modifications 
    106               rhos(i,j,*) = s_z(*) 
     108              rhos[i,j,*] = s_z[*] 
    107109; 
    108110; <<-- no more static instability on slab jj 
  • trunk/tools/density_binning/density_bin_IDL_gm/bin_sigma.pro

    r168 r169  
    2525    , BOXZOOM=boxzoom $ 
    2626    , ALL_DATA=all_data 
     27; 
     28  compile_opt idl2, strictarrsubs 
    2729; 
    2830@common 
     
    8890 
    8991      CASE pfildi.name OF 
    90          '@@vodeptht': nfild = depth_bin(*, *, 0:n_sig-1) 
    91          '@@vosigthi': nfild = thick_bin(*, *, 0:n_sig-1) 
     92         '@@vodeptht': nfild = depth_bin[*, *, 0:n_sig-1] 
     93         '@@vosigthi': nfild = thick_bin[*, *, 0:n_sig-1] 
    9294         '@@vosigvol': BEGIN 
    9395             nfild = vol_bin 
    9496             final_dim = 1 
    9597;            e12t = e1t*e2t 
    96 ;            e12t3 = reform((reform(e12t(premierx:dernierx, premiery:derniery), nx*ny))#replicate(1,n_sig +2), nx, ny, n_sig+2) 
    97 ;            nfild = (thick_bin*e12t3)(*, *, 0:n_sig-1) 
     98;            e12t3 = reform((reform(e12t[premierx:dernierx, premiery:derniery], nx*ny))#replicate(1,n_sig +2), nx, ny, n_sig+2) 
     99;            nfild = (thick_bin*e12t3)[*, *, 0:n_sig-1] 
    98100 
    99101         END 
    100          ELSE: nfild = f_bin(*, *, 0:n_sig-1) 
     102         ELSE: nfild = f_bin[*, *, 0:n_sig-1] 
    101103      ENDCASE 
    102104 
     
    108110 
    109111      CASE pfildi.name OF 
    110          '@@vodeptht': nfild = depth_bin(*, *, index) 
    111          '@@vosigthi': nfild = thick_bin(*, *, index) 
     112         '@@vodeptht': nfild = depth_bin[*, *, index] 
     113         '@@vosigthi': nfild = thick_bin[*, *, index] 
    112114         '@@vosigvol': BEGIN 
    113115            nfild = vol_bin 
    114116            final_dim = 1 
    115117;            e12t = e1t*e2t 
    116 ;            e12t3 = reform((reform(e12t(premierx:dernierx, premiery:derniery), nx*ny))#replicate(1,n_sig +2), nx, ny, n_sig+2) 
    117 ;            nfild = ((thick_bin*e12t3)(*, *, index)) 
     118;            e12t3 = reform((reform(e12t[premierx:dernierx, premiery:derniery], nx*ny))#replicate(1,n_sig +2), nx, ny, n_sig+2) 
     119;            nfild = ((thick_bin*e12t3)[*, *, index]) 
    118120         END 
    119          ELSE: nfild = f_bin(*, *, index) 
     121         ELSE: nfild = f_bin[*, *, index] 
    120122      ENDCASE 
    121123 
     
    124126   IF final_dim eq 3 THEN BEGIN 
    125127      indx = where(finite(nfild, /NAN)) 
    126       nfild(indx) = -1.e20 
    127       nfild(indx) = !VALUES.F_NAN 
    128       indx = where(tmask(*, *, 0) EQ 0) 
    129       nfild(indx) = !VALUES.F_NAN 
     128      nfild[indx] = -1.e20 
     129      nfild[indx] = !VALUES.F_NAN 
     130      indx = where(tmask[*, *, 0] EQ 0) 
     131      nfild[indx] = !VALUES.F_NAN 
    130132   ENDIF ELSE BEGIN 
    131133 
  • trunk/tools/density_binning/density_bin_IDL_gm/bin_velocity.pro

    r165 r169  
    99         , VV=vv $ 
    1010         , TT=tt 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
     
    3335; initializations 
    3436      s_s = sigma_values        ; density range over which we bin 
    35       N_s = n_elements(s_s)     ; number of density levels 
    36       N_z = jpk                 ; number of z levels 
     37      n_s = n_elements(s_s)     ; number of density levels 
     38      n_z = jpk                 ; number of z levels 
    3739;   Profiles along z level ( suffixe _z) 
    38       c1_z = fltarr(N_z)        ; profil du contenu vertical de x 
    39       s_z = fltarr(N_z)         ; profil de la densite 
     40      c1_z = fltarr(n_z)        ; profil du contenu vertical de x 
     41      s_z = fltarr(n_z)         ; profil de la densite 
    4042      z_zt = gdept              ; profondeur au point T  (k=0 -> 5m) 
    4143                                ; z_zw = gdepw (old)        
    4244      z_zw=shift(gdepw,-1)      ;                     W  (k=0 -> 10m) 
    43       z_zw(jpk-1)=gdepw(jpk-1)   
     45      z_zw[jpk-1]=gdepw[jpk-1]   
    4446;   Profiles along density level (suffixe _s) 
    45       z_s = fltarr(N_s+1) 
    46       c1_s = fltarr(N_s+1) 
    47       x1_s = fltarr(N_s+1) 
     47      z_s = fltarr(n_s+1) 
     48      c1_s = fltarr(n_s+1) 
     49      x1_s = fltarr(n_s+1) 
    4850;   x1 binned on density (output array) 
    49       x1_bin = fltarr(jpi, jpj, N_s+1) 
     51      x1_bin = fltarr(jpi, jpj, n_s+1) 
    5052; 
    5153; vertical content of x1 (ensure  the integrale conservation) 
    5254      x1_content = fltarr(jpi, jpj, jpk) 
    53       x1_content(*, *, 0) = e3t(0) * x1(*, *, 0) * xmask(*,*,0) 
    54       FOR k = 1, jpk-1 DO x1_content(*, *, k) = x1_content(*, *, k-1) $  
    55                                               + e3t(k) * x1(*, *, k) * xmask(*,*,k) 
     55      x1_content[*, *, 0] = e3t[0] * x1[*, *, 0] * xmask[*,*,0] 
     56      FOR k = 1, jpk-1 DO x1_content[*, *, k] = x1_content[*, *, k-1] $  
     57                                              + e3t[k] * x1[*, *, k] * xmask[*,*,k] 
    5658; 
    5759;  Loop over the horizontal domain 2D 
     
    6264;  Indices des points T dans l ocean 
    6365; 
    64          i_ocean = where(xmask(i, j, *) EQ 1) 
     66         i_ocean = where(xmask[i, j, *] EQ 1) 
    6567         z_s = z_s*0. 
    6668         c1_s = c1_s*0. 
     
    6870         IF (i_ocean[0] NE -1) THEN BEGIN ; on n'entre que si il y a des points ocean 
    6971  
    70             s_z(*) = density(i, j, *) 
    71             c1_z(*) = x1_content(i, j, *) 
     72            s_z[*] = density[i, j, *] 
     73            c1_z[*] = x1_content[i, j, *] 
    7274; critere supplementaire a imposer sur le profil pour eviter les cas 
    7375; pathologiques en attendant d'ecrire une vraie commande d'extraction 
    7476; de progils stritement croissant. Il s'agit donc d'un test adhoc. 
    75             IF s_z(0) LT s_z(i_ocean(n_elements(i_ocean)-1)) THEN BEGIN  
     77            IF s_z[0] LT s_z[i_ocean[n_elements(i_ocean)-1]] THEN BEGIN  
    7678;------------------------------------------------------------------------ 
    7779; controle si le profil est bien strictement croissant (pour l'instant 
    7880; inutilisŽ (avis aux amateurs) 
    7981; 
    80 ;            ds = (shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
     82;            ds = (shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    8183;            ds(0) = 0 
    8284;            ind = where(ds LT 0.) 
    8385;            croissant = ind(0) EQ -1 
    8486;------------------------------------------------------------------------ 
    85             i_bottom = i_ocean(n_elements(i_ocean)-1) 
    86             z_s(N_s) = z_zw(i_bottom) 
    87             c1_s(N_s) = x1_content(i, j, jpk-1) 
     87            i_bottom = i_ocean[n_elements(i_ocean)-1] 
     88            z_s[n_s] = z_zw[i_bottom] 
     89            c1_s[n_s] = x1_content[i, j, jpk-1] 
    8890             
    8991; extraction d'un sous profil strictement croissant 
    90             mini = min(s_z(i_ocean)) 
    91             maxi = max(s_z(i_ocean))             
    92             i_min = where(s_z(i_ocean) EQ mini) 
    93             i_max = where(s_z(i_ocean) EQ maxi) 
     92            mini = min(s_z[i_ocean]) 
     93            maxi = max(s_z[i_ocean])             
     94            i_min = where(s_z[i_ocean] EQ mini) 
     95            i_max = where(s_z[i_ocean] EQ maxi) 
    9496;   on prend le plus grand des indices min 
    9597;         et le plus petit des indices max 
     
    9799  ;gr          i_max = i_max[0] 
    98100             i_min = i_min[0] 
    99              i_max = i_max(n_elements(i_min)-1) 
     101             i_max = i_max[n_elements(i_min)-1] 
    100102;            IF i_max GE jpk-1 THEN print, i, j, i_max 
    101103;            IF i_min LE 1 THEN print, i, j, i_min 
     
    104106; l isopycne est mise en surface (z_s=0) 
    105107; 
    106             ind = where(s_s LT s_z(i_min)) 
     108            ind = where(s_s LT s_z[i_min]) 
    107109            IF ind[0] NE -1 THEN BEGIN          &$ 
    108                z_s(ind) = 0                     &$ 
    109                c1_s(ind) = 0                    &$ 
     110               z_s[ind] = 0                     &$ 
     111               c1_s[ind] = 0                    &$ 
    110112            ENDIF  
    111113; Si la valeur du niveau (s_s) est plus elevee que la densite du fond,  
    112114; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
    113115; 
    114             ind = where(s_s GT s_z(i_max)) 
     116            ind = where(s_s GT s_z[i_max]) 
    115117            IF ind[0] NE -1 THEN BEGIN          &$ 
    116                z_s(ind) = z_s(N_s)              &$ 
    117                c1_s(ind) = c1_s(N_s)            &$ 
     118               z_s[ind] = z_s[n_s]              &$ 
     119               c1_s[ind] = c1_s[n_s]            &$ 
    118120            ENDIF  
    119121; 
    120      ds =(shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
     122     ds =(shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    121123     ind_c = where(ds LT 0.)      
    122 ;     croissant = ind_c(0) EQ -1 
     124;     croissant = ind_c[0] EQ -1 
    123125;     IF ( i_min GT i_max ) then begin 
    124126;     print, 'bug ',i_min, i_max,'  en i,j=', i,j 
    125127;     endif 
    126      IF ( ind_c(0) NE -1 ) then begin   
     128     IF ( ind_c[0] NE -1 ) then begin   
    127129           print, 'bug   en i,j=', i,j,'  ind_c = ', ind_c 
    128130           stop 
    129131     endif 
    130132;     IF ( i_min LE i_max ) then begin 
    131        IF ( ind_c(0) EQ -1 ) then begin 
    132             ind = where( (s_s GE s_z(i_min)) AND (s_s LT s_z(i_max)) ) 
     133       IF ( ind_c[0] EQ -1 ) then begin 
     134            ind = where( (s_s GE s_z[i_min]) AND (s_s LT s_z[i_max]) ) 
    133135            IF ind[0] NE -1 THEN BEGIN  
    134136               IF ( n_elements(ind) NE 1 ) THEN BEGIN 
    135137                
    136                    i_profil = i_ocean(i_min:i_max) 
    137                    z_s(ind) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) 
     138                   i_profil = i_ocean[i_min:i_max] 
     139                   z_s[ind] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) 
    138140                
    139141; 
    140142; j'utilise la fonction spline pour interpoler le contenu 
    141143; 
    142                    c1_s(ind) = spline(z_zw(i_profil), c1_z(i_profil), z_s(ind), 1) 
     144                   c1_s[ind] = spline(z_zw[i_profil], c1_z[i_profil], z_s[ind], 1) 
    143145; 
    144146; l'interpolation lineaire marche aussi. Elle donne des resultats differents. Elle 
     
    152154               IF ( n_elements(ind) EQ 1 ) THEN BEGIN 
    153155 ;                  print, 'one density bin   en i,j=', i,j,'  ind = ', ind 
    154                    c1_s(ind) = c1_z(jpk-1) 
     156                   c1_s[ind] = c1_z[jpk-1] 
    155157               ENDIF 
    156158; 
    157                    x1_s(ind[0]-1) = (c1_s(ind[0])-c1_s(ind[0]-1));/(z_s(ind+1)-z_s(ind)) 
    158                    x1_s(ind) = (c1_s(ind+1)-c1_s(ind));/(z_s(ind+1)-z_s(ind)) 
    159 ;                   x1_s(ind[0]-1) = (c1_s(ind[0])-c1_s(ind[0]-1))/(z_s(ind+1)-z_s(ind)) 
    160 ;                   x1_s(ind) = (c1_s(ind+1)-c1_s(ind))/(z_s(ind+1)-z_s(ind)) 
     159                   x1_s[ind[0]-1] = (c1_s[ind[0]]-c1_s[ind[0]-1]);/(z_s[ind+1]-z_s[ind]) 
     160                   x1_s[ind] = (c1_s[ind+1]-c1_s[ind]);/(z_s[ind+1]-z_s[ind]) 
     161;                   x1_s[ind[0]-1] = (c1_s[ind[0]]-c1_s[ind[0]-1])/(z_s[ind+1]-z_s[ind]) 
     162;                   x1_s[ind] = (c1_s[ind+1]-c1_s[ind])/(z_s[ind+1]-z_s[ind]) 
    161163            ENDIF  
    162164     endif 
    163165         ENDIF  
    164166         ENDIF 
    165          x1_bin(i, j, *) = x1_s 
     167         x1_bin[i, j, *] = x1_s 
    166168          
    167169      ENDFOR  
  • trunk/tools/density_binning/density_bin_IDL_gm/bining2.pro

    r168 r169  
    11;+ 
     2; 
    23;  PRINCIPE DU BINING 
    34; 
     
    8788    , TMASK=tmask 
    8889; 
     90  compile_opt idl2, strictarrsubs 
     91; 
    8992   size3d = size(density) 
    90    jpi = size3d(1) 
    91    jpj = size3d(2) 
    92    jpk = size3d(3) 
     93   jpi = size3d[1] 
     94   jpj = size3d[2] 
     95   jpk = size3d[3] 
    9396;print, 'size3d=', size3d 
    9497;print, 'size(tmask)=', size(tmask) 
     
    9699   indm = where(tmask eq 0) 
    97100 
    98    x1(indm) = !VALUES.F_NAN 
    99    density(indm) = !VALUES.F_NAN 
    100  
    101    N_z = jpk 
     101   x1[indm] = !VALUES.F_NAN 
     102   density[indm] = !VALUES.F_NAN 
     103 
     104   n_z = jpk 
    102105    
    103106; adjust profiles to avoid static instabilities (there are almost none IF using pac_40) 
    104107IF jpi EQ 180 THEN BEGIN 
    105    density = npc(density) 
     108   density = npc[density] 
    106109ENDIF 
    107110 
    108 N_s, defini ci dessous est le nombre d'interface 
     111n_s, defini ci dessous est le nombre d'interface 
    109112 
    110113   IF keyword_set(sigma) THEN BEGIN 
    111114      s_s = sigma 
    112       N_s = n_elements(s_s) 
     115      n_s = n_elements(s_s) 
    113116   ENDIF ELSE BEGIN  
    114117; 
     
    116119;   les eaux intermediaires) 
    117120; 
    118       N_s = 20 
    119       s_s = 27.6+0.2*findgen(N_s)/(N_s-1) 
    120       N_s = 3 
     121      n_s = 20 
     122      s_s = 27.6+0.2*findgen(n_s)/(n_s-1) 
     123      n_s = 3 
    121124      s_s = [26.8, 27.6, 27.8] 
    122125      s_s = [22.8, 27.6, 27.8] 
     
    129132;   Profils selon les niveaux du modele (suffixe _z) 
    130133; 
    131    c1_z = fltarr(N_z)    ; profil du contenu vertical de x 
    132    s_z = fltarr(N_z)    ; profil de la densite 
     134   c1_z = fltarr(n_z)    ; profil du contenu vertical de x 
     135   s_z = fltarr(n_z)    ; profil de la densite 
    133136   z_zt = depth_t  ; profondeur au point T  (k=0 -> 5m) 
    134137   z_zw = depth_w  ;                     W  (k=0 -> 10m) 
     
    136139;   Profils selon les couches de densite (suffixe _s) 
    137140; 
    138    z_s = fltarr(N_s+1) 
    139    c1_s = fltarr(N_s+1) 
    140    x1_s = fltarr(N_s+1) 
     141   z_s = fltarr(n_s+1) 
     142   c1_s = fltarr(n_s+1) 
     143   x1_s = fltarr(n_s+1) 
    141144   bowl_s = 0. 
    142145 
    143146; Tableaux de sorties 
    144147; 
    145    depth_bin = fltarr(jpi, jpj, N_s+1) 
    146    thick_bin = fltarr(jpi, jpj, N_s+1) 
    147    x1_bin = fltarr(jpi, jpj, N_s+1) 
     148   depth_bin = fltarr(jpi, jpj, n_s+1) 
     149   thick_bin = fltarr(jpi, jpj, n_s+1) 
     150   x1_bin = fltarr(jpi, jpj, n_s+1) 
    148151   bowl_bin = fltarr(jpi, jpj) 
    149152 
    150    x1_bin(*, *, *) = !VALUES.F_NAN  
    151    depth_bin(*, *, *) = !VALUES.F_NAN  
    152    thick_bin(*, *, *) = !VALUES.F_NAN  
    153    bowl_bin(*, *) = !VALUES.F_NAN  
     153   x1_bin[*, *, *] = !VALUES.F_NAN  
     154   depth_bin[*, *, *] = !VALUES.F_NAN  
     155   thick_bin[*, *, *] = !VALUES.F_NAN  
     156   bowl_bin[*, *] = !VALUES.F_NAN  
    154157 
    155158 
     
    159162 
    160163 
    161 ;   x1_content(*, *, 0) = e3t(0) * x1(*, *, 0) * tmask (*, *, 0) 
    162 ;   FOR k = 1, jpk-1 DO x1_content(*, *, k) = x1_content(*, *, k-1) $  
    163 ;                        + e3t(k) * x1(*, *, k)* tmask (*, *, k) 
     164;   x1_content[*, *, 0] = e3t[0] * x1[*, *, 0] * tmask [*, *, 0] 
     165;   FOR k = 1, jpk-1 DO x1_content[*, *, k] = x1_content[*, *, k-1] $  
     166;                        + e3t[k] * x1[*, *, k]* tmask [*, *, k] 
    164167   x1_content = x1 
    165168 
     
    181184; 
    182185;stop 
    183          i_ocean = where(tmask(i, j, *) EQ 1) 
    184 ;print, 'tmask(i, j, *)=', tmask(i, j, *) 
     186         i_ocean = where(tmask[i, j, *] EQ 1) 
     187;print, 'tmask[i, j, *]=', tmask[i, j, *] 
    185188;print, 'i_ocean=', i_ocean  
    186189         z_s = z_s*0. 
    187          c1_s(*) = !VALUES.F_NAN 
     190         c1_s[*] = !VALUES.F_NAN 
    188191         bowl_s = !VALUES.F_NAN 
    189 ;         x1_s(*) = !VALUES.F_NAN 
     192;         x1_s[*] = !VALUES.F_NAN 
    190193 
    191194 
    192195         IF i_ocean[0] NE -1 THEN BEGIN ; on n entre que si il y a des points ocean 
    193196;            print, 'ocean point' 
    194             i_bottom = i_ocean(n_elements(i_ocean)-1) 
     197            i_bottom = i_ocean[n_elements(i_ocean)-1] 
    195198;print, 'i_bottom=', i_bottom 
    196             z_s(N_s) = z_zw(i_bottom) 
    197             c1_s(N_s) = x1_content(i, j, jpk-1) 
     199            z_s[n_s] = z_zw[i_bottom] 
     200            c1_s[n_s] = x1_content[i, j, jpk-1] 
    198201             
    199             s_z(*) = density(i, j, *) 
    200             c1_z(*) = x1_content(i, j, *) 
     202            s_z[*] = density[i, j, *] 
     203            c1_z[*] = x1_content[i, j, *] 
    201204;            print, 'density profile s_z', s_z 
    202205;            print, 'field profile c1_z', c1_z 
     
    205208 
    206209; extraction d'un sous profil strictement croissant 
    207 ;            print, 's_z(i_ocean)=', s_z(i_ocean) 
    208             mini = min(s_z(i_ocean)) 
    209             maxi = max(s_z(i_ocean)) 
    210             i_min = where(s_z(i_ocean) EQ mini) 
    211             i_max = where(s_z(i_ocean) EQ maxi) 
     210;            print, 's_z[i_ocean]=', s_z[i_ocean] 
     211            mini = min(s_z[i_ocean]) 
     212            maxi = max(s_z[i_ocean]) 
     213            i_min = where(s_z[i_ocean] EQ mini) 
     214            i_max = where(s_z[i_ocean] EQ maxi) 
    212215;            print, 'mini, maxi', mini, maxi 
    213216;            print, 'i_min, i_max', i_min, i_max 
    214217;   on prend le plus grand des indices min 
    215218;         et le plus petit des indices max 
    216             i_min = i_min(n_elements(i_min)-1) 
     219            i_min = i_min[n_elements(i_min)-1] 
    217220            i_max = i_max[0] 
    218221;            print, 'i_min, i_max', i_min, i_max 
     
    226229; l isopycne est mise en surface (z_s=0) 
    227230; 
    228 ;            print, 's_z(i_min)', s_z(i_min) 
     231;            print, 's_z[i_min]', s_z[i_min] 
    229232;print, 's_s=', s_s 
    230             ind = where(s_s LT s_z(i_min)) 
     233            ind = where(s_s LT s_z[i_min]) 
    231234            IF ind[0] NE -1 THEN BEGIN  
    232235;               IF i_min GT i_max THEN print, 'min reached at sigma indices', ind 
    233                z_s(ind) = 0 
    234                c1_s(ind) = !VALUES.F_NAN 
     236               z_s[ind] = 0 
     237               c1_s[ind] = !VALUES.F_NAN 
    235238            ENDIF  
    236239 
     
    238241; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
    239242; 
    240 ;            print, 's_z(i_max)', s_z(i_max) 
    241             ind = where(s_s GT s_z(i_max)) 
     243;            print, 's_z[i_max]', s_z[i_max] 
     244            ind = where(s_s GT s_z[i_max]) 
    242245 
    243246            IF ind[0] NE -1 THEN BEGIN  
    244247;               IF i_min GT i_max THEN print, 'max reached at sigma indices', ind 
    245                z_s(ind) = z_s(N_s) 
    246                c1_s(ind) = c1_s(N_s) 
    247                c1_s(ind) = !VALUES.F_NAN 
     248               z_s[ind] = z_s[n_s] 
     249               c1_s[ind] = c1_s[n_s] 
     250               c1_s[ind] = !VALUES.F_NAN 
    248251            ENDIF  
    249252; cas general 
    250             ind = where( (s_s GE s_z(i_min)) AND (s_s LE s_z(i_max)) ) 
     253            ind = where( (s_s GE s_z[i_min]) AND (s_s LE s_z[i_max]) ) 
    251254;            IF i_min GT i_max THEN print, 's_s indices inside min/max', ind 
    252255            IF ind[0] NE -1 THEN BEGIN  
    253                i_profil = i_ocean(i_min:i_max) ; problem line 
    254  
    255                z_s(ind) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) ; original 
    256 ;               z_s(ind) = interpol(z_zw(i_profil), s_z(i_profil), s_s(ind)) ; changed to z_zw 1/7/04 
     256               i_profil = i_ocean[i_min:i_max] ; problem line 
     257 
     258               z_s[ind] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) ; original 
     259;               z_s[ind] = interpol(z_zw[i_profil], s_z[i_profil], s_s[ind]) ; changed to z_zw 1/7/04 
    257260 
    258261; 
     
    262265; 
    263266               IF n_elements(i_profil) GT 2 THEN BEGIN  
    264 ;                  c1_s(ind) = spline(z_zw(i_profil), c1_z(i_profil), z_s(ind), 1)     ; cubic spline 
    265                   c1_s(ind) = interpol(c1_z(i_profil), z_zt(i_profil), z_s(ind))      ; linear interpolation 
    266 ;                   SPLINE_P, z_zw(i_profil), c1_z(i_profil), z_s(ind), c1_s(ind)     ; generalization of spline(*) 
    267 ;print, z_zw(i_profil), c1_z(i_profil), z_s(ind), c1_s(ind) 
     267;                  c1_s[ind] = spline(z_zw[i_profil], c1_z[i_profil], z_s[ind], 1)     ; cubic spline 
     268                  c1_s[ind] = interpol(c1_z[i_profil], z_zt[i_profil], z_s[ind])      ; linear interpolation 
     269;                   SPLINE_P, z_zw[i_profil], c1_z[i_profil], z_s[ind], c1_s[ind]     ; generalization of spline[*] 
     270;print, z_zw[i_profil], c1_z[i_profil], z_s[ind], c1_s[ind] 
    268271               ENDIF ELSE BEGIN 
    269                   c1_s(ind) = interpol(c1_z(i_profil), z_zt(i_profil), z_s(ind)) 
     272                  c1_s[ind] = interpol(c1_z[i_profil], z_zt[i_profil], z_s[ind]) 
    270273               ENDELSE  
    271274; 
     
    273276 
    274277               IF sig_bowl EQ 1 THEN BEGIN 
    275                   bowl_s = interpol(s_z(i_profil), z_zt(i_profil), sobwlmax(i, j)) 
     278                  bowl_s = interpol(s_z[i_profil], z_zt[i_profil], sobwlmax[i, j]) 
    276279               ENDIF ELSE bowl_s = 0 
    277280                   
     
    279282; 
    280283; 
    281 ;               x1_s(ind) = (c1_s(ind+1)-c1_s(ind))/(z_s(ind+1)-z_s(ind)) 
     284;               x1_s[ind] = (c1_s[ind+1]-c1_s[ind])/(z_s[ind+1]-z_s[ind]) 
    282285;                     x1_s = c1_s 
    283286 
     
    285288;ELSE print, 'ind[0] = -1', ind, i_bottom 
    286289         ENDIF   
    287 ;ELSE print, ' land ', tmask(i, j, 1) 
    288          depth_bin (i, j, *) = z_s 
    289          thick_bin (i, j, 0) = z_s(0) 
    290          thick_bin (i, j, 1:N_s) = z_s(1:N_s)-z_s(0:N_s-1) 
    291          IF total(thick_bin (i, j, 1:N_s) LT 0) GT 0 THEN BEGIN 
    292             ;print, 'WARNING: negative thick_bin (i, j, 1:N_s) at i,j= ', i, j 
    293             ;print, 'depth_bin (i, j, 1:N_s)= ', depth_bin (i, j, 1:N_s) 
    294             ;print, 'thick_bin (i, j, 1:N_s)= ', thick_bin (i, j, 1:N_s) 
     290;ELSE print, ' land ', tmask[i, j, 1] 
     291         depth_bin[i, j, *] = z_s 
     292         thick_bin[i, j, 0] = z_s[0] 
     293         thick_bin[i, j, 1:n_s] = z_s[1:n_s]-z_s[0:n_s-1] 
     294         IF total(thick_bin[i, j, 1:n_s] LT 0) GT 0 THEN BEGIN 
     295            ;print, 'WARNING: negative thick_bin[i, j, 1:n_s] at i,j= ', i, j 
     296            ;print, 'depth_bin[i, j, 1:n_s]= ', depth_bin[i, j, 1:n_s] 
     297            ;print, 'thick_bin[i, j, 1:n_s]= ', thick_bin[i, j, 1:n_s] 
    295298            ;print, 's_z= ', s_z 
    296299            ;stop 
    297300         ENDIF 
    298          x1_bin    (i, j, *) = c1_s 
    299          bowl_bin  (i, j) = bowl_s 
     301         x1_bin[i, j, *] = c1_s 
     302         bowl_bin[i, j] = bowl_s 
    300303;         print, 'c1_s', c1_s 
    301304; 
     
    303306   ENDFOR  
    304307; mask depth_bin with undefined values of x_bin 
    305    depth_bin(where(finite(x1_bin, /nan) EQ 1)) = !VALUES.F_NAN 
    306    thick_bin(where(finite(x1_bin, /nan) EQ 1)) = !VALUES.F_NAN 
     308   depth_bin[where(finite(x1_bin, /nan) EQ 1)] = !VALUES.F_NAN 
     309   thick_bin[where(finite(x1_bin, /nan) EQ 1)] = !VALUES.F_NAN 
    307310 
    308311; OPTIONAL: compute spiciness by removing isopycnal mean for each sigma (T or S) 
     
    310313      print, '    Computing spiciness...' 
    311314      FOR i = 0, (size(x1_bin))[3]-1 DO BEGIN  
    312          x1_bin(*,*,i) = x1_bin(*,*,i) - mean(x1_bin(*,*,i),/NAN) 
     315         x1_bin[*,*,i] = x1_bin[*,*,i] - mean(x1_bin[*,*,i],/NAN) 
    313316      ENDFOR 
    314317   ENDIF 
     
    317320   IF 0 THEN BEGIN 
    318321      print, '    Removing domain mean...' 
    319       x1_bin(*,*,*) = x1_bin(*,*,*) - mean(x1_bin(*,*,*),/NAN) 
     322      x1_bin[*,*,*] = x1_bin[*,*,*] - mean(x1_bin[*,*,*],/NAN) 
    320323   ENDIF 
    321324 
     
    323326   IF 1 THEN BEGIN 
    324327      print, '    Removing 34.6psu...' 
    325       x1_bin(*,*,*) = x1_bin(*,*,*) - 34.6 
     328      x1_bin[*,*,*] = x1_bin[*,*,*] - 34.6 
    326329   ENDIF 
    327330 
  • trunk/tools/density_binning/density_bin_IDL_gm/eos.pro

    r168 r169  
    5252;- 
    5353FUNCTION eos, t, s, sigma 
     54; 
     55  compile_opt idl2, strictarrsubs 
    5456; 
    5557@common 
  • trunk/tools/density_binning/density_bin_IDL_gm/msf.pro

    r165 r169  
    1414PRO msf, v, sf $ 
    1515    , MSK=msk 
     16; 
     17  compile_opt idl2, strictarrsubs 
    1618; 
    1719@common 
     
    3436IF n_elements(msk) NE 0 THEN BEGIN  
    3537      zvmask = boundperio( (msk +shift(msk, 0, -1) ) < 1 ) 
    36       zvmask = zvmask(*)#vert 
     38      zvmask = zvmask[*]#vert 
    3739      zv = zv*zvmask 
    3840ENDIF  
     
    4446;  calcul du flux 
    4547; 
    46 FOR i = 0, jpi-1 DO BEGIN for j= 0, jpj-1 do begin ze1v(i,j,*) = replicate(e1v(i,j),jpk) & endfor &endfor 
    47 FOR k = 0, jpk-1 DO BEGIN ze3v(*,*,k)=replicate(e3t(k),jpi*jpj) & endfor 
     48FOR i = 0, jpi-1 DO BEGIN for j= 0, jpj-1 do begin ze1v[i,j,*] = replicate(e1v[i,j],jpk) & endfor &endfor 
     49FOR k = 0, jpk-1 DO BEGIN ze3v[*,*,k]=replicate(e3t[k],jpi*jpj) & endfor 
    4850; 
    4951z= -v*ze1v*ze3v 
     
    5557;  calcul de la msf en integrant depuis le fond 
    5658; 
    57 FOR k = jpk-2, 0, -1 DO begin sf(*, k) = sf(*, k+1)+fm(*, k) & endfor 
     59FOR k = jpk-2, 0, -1 DO begin sf[*, k] = sf[*, k+1]+fm[*, k] & endfor 
    5860; 
    5961;  msfmsk est le masque associe a msf (utilise pour les graphiques) 
  • trunk/tools/density_binning/density_bin_IDL_gm/msfs.pro

    r165 r169  
    88         , MASK=mask $ 
    99         , ORCA=orca 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@common 
  • trunk/tools/density_binning/density_bin_IDL_gm/msfz.pro

    r165 r169  
    99         , ORCA=orca $ 
    1010         , _EXTRA=extra 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
     
    4042     for k=0, jpk-1 do begin 
    4143       for j=0,jpj-1 do begin 
    42             msf(j,k) = msf(j,k) - msf(j,jpk-1) 
     44            msf[j,k] = msf[j,k] - msf[j,jpk-1] 
    4345          endfor 
    4446        endfor 
  • trunk/tools/density_binning/density_bin_IDL_gm/npc.pro

    r168 r169  
    2929;- 
    3030FUNCTION npc, s3d 
     31; 
     32  compile_opt idl2, strictarrsubs 
    3133; 
    3234@common 
     
    6365            ; ----------------------------- 
    6466            ; 
    65               ds =(shift(s_z,-1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
     67              ds =(shift(s_z,-1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
    6668              ind_c = where(ds LT 0.) 
    6769            ; 
    6870            ; 2. Vertical mixing for each instable portion of the density profil 
    6971            ; 
    70               IF ( ind_c(0) NE -1 ) THEN BEGIN 
     72              IF ( ind_c[0] NE -1 ) THEN BEGIN 
    7173                  ncompt=ncompt+1 
    7274            ;      print, 'static instability at i,j=', i,j 
     
    7779            ; vertical iteration 
    7880                  jiter = 0 
    79                   WHILE ( (ind_c(0) NE -1) AND (jiter LT jpk-1) ) DO BEGIN              &$ 
     81                  WHILE ( (ind_c[0] NE -1) AND (jiter LT jpk-1) ) DO BEGIN              &$ 
    8082                    jiter = jiter+1                                                     &$ 
    8183                  ; ikup : the first static instability from the sea surface 
    82                     ikup = ind_c(0)                                                     &$                                                       
     84                    ikup = ind_c[0]                                                     &$                                                       
    8385                  ; the density profil is instable below ikup 
    8486                  ; ikdown : bottom of the instable portion of the density profil 
    8587                  ; search of ikdown and vertical mixing from ikup to ikdown 
    86                     ze3tot= e3t(ikup)                                                   &$ 
    87                     zraua = s_z(ikup)                                                   &$ 
     88                    ze3tot= e3t[ikup]                                                   &$ 
     89                    zraua = s_z[ikup]                                                   &$ 
    8890                    jkdown = ikup+1                                                     &$ 
    8991; 
    90                     WHILE (jkdown LE ikbot AND zraua GT s_z(jkdown) ) DO BEGIN  &$ 
    91                       ze3dwn = e3t(jkdown)                                              &$ 
     92                    WHILE (jkdown LE ikbot AND zraua GT s_z[jkdown] ) DO BEGIN  &$ 
     93                      ze3dwn = e3t[jkdown]                                              &$ 
    9294                      ze3tot = ze3tot+ze3dwn                                            &$ 
    93                       zraua = ( zraua*(ze3tot-ze3dwn) + s_z(jkdown)*ze3dwn )/ze3tot     &$ 
     95                      zraua = ( zraua*(ze3tot-ze3dwn) + s_z[jkdown]*ze3dwn )/ze3tot     &$ 
    9496                      jkdown=jkdown+1                                                   &$ 
    9597;                      print, jkdown, zraua                                             &$ 
     
    99101                      s_z(jkp) = zraua                                                  &$ 
    100102                    ENDFOR                                                              &$ 
    101                     ds =(shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2))          &$ 
     103                    ds =(shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]]          &$ 
    102104                    ind_c = where(ds LT 0.)                                             &$ 
    103105                  ENDWHILE 
    104106              ENDIF 
    105107            ; save the modifications 
    106               rhos(i,j,*) = s_z(*) 
     108              rhos[i,j,*] = s_z[*] 
    107109; 
    108110; <<-- no more static instability on slab jj 
  • trunk/tools/idl_netcdf/ncdf_ajoute.pro

    r165 r169  
    3535;- 
    3636PRO ncdf_ajoute, nomfich, nom, tab, dimension, attribut 
     37; 
     38  compile_opt idl2, strictarrsubs 
    3739; 
    3840;----------------------------------------------------------------------------------------- 
  • trunk/tools/idl_netcdf/ncdf_ajoute2.pro

    r165 r169  
    3434; 
    3535;- 
    36 PRO ncdf_ajoute, nomfich, nom, tab, dimension, attribut 
     36PRO ncdf_ajoute2, nomfich, nom, tab, dimension, attribut 
     37; 
     38  compile_opt idl2, strictarrsubs 
    3739; 
    3840;----------------------------------------------------------------------------------------- 
  • trunk/tools/idl_netcdf/ncdf_colle.pro

    r165 r169  
    7575    , GARDE=garde $ 
    7676    , EXCLU=exclu 
     77; 
     78  compile_opt idl2, strictarrsubs 
    7779; 
    7880    nomdirec = strlowcase(nomdirec) 
  • trunk/tools/idl_netcdf/ncdf_colle2.pro

    r165 r169  
    7272; 
    7373;- 
    74 PRO ncdf_colle, listin, nomfichout, nomdirec $ 
     74PRO ncdf_colle2, listin, nomfichout, nomdirec $ 
    7575    , GARDE=garde $ 
    7676    , EXCLU=exclu 
     77; 
     78  compile_opt idl2, strictarrsubs 
    7779; 
    7880   nomdirec = strlowcase(nomdirec) 
  • trunk/tools/idl_netcdf/ncdf_extrait.pro

    r165 r169  
    5656    , GARDE=garde $ 
    5757    , EXCLU=exclu 
     58; 
     59  compile_opt idl2, strictarrsubs 
    5860; 
    5961;------------------------------------------------------------ 
  • trunk/tools/lma/post_lma_patt_am.pro

    r166 r169  
    66;- 
    77PRO post_lma_patt_am 
     8; 
     9  compile_opt idl2, strictarrsubs 
    810; 
    911; 1.Declaration des variables 
     
    3133  FOR i = 0,xdim-1 DO BEGIN  
    3234  READF, 10, FORMAT = '(2E12.5)',re, im 
    33 patt_sum1r(i, j) = re  
    34 patt_sum1i(i, j) = im 
     35patt_sum1r[i, j] = re  
     36patt_sum1i[i, j] = im 
    3537  ENDFOR  
    3638ENDFOR   
     
    3941  FOR i = 0,xdim-1 DO BEGIN  
    4042  READF, 10, FORMAT = '(2E12.5)',re, im 
    41 patt_sum2r(i, j) = re  
    42 patt_sum2i(i, j) = im 
     43patt_sum2r[i, j] = re  
     44patt_sum2i[i, j] = im 
    4345  ENDFOR  
    4446ENDFOR 
     
    4749  FOR i = 0,xdim-1 DO BEGIN  
    4850  READF, 10, FORMAT = '(2E12.5)',re, im 
    49 patt_win1r(i, j) = re 
    50 patt_win1i(i, j) = im 
     51patt_win1r[i, j] = re 
     52patt_win1i[i, j] = im 
    5153  ENDFOR  
    5254ENDFOR 
     
    5557  FOR i = 0,xdim-1 DO BEGIN  
    5658  READF, 10, FORMAT = '(2E12.5)',re, im 
    57 patt_win2r(i, j) = re 
    58 patt_win2i(i, j) = im 
     59patt_win2r[i, j] = re 
     60patt_win2i[i, j] = im 
    5961  ENDFOR  
    6062ENDFOR 
     
    7072FOR t = 0, NCMAX-1 DO BEGIN 
    7173READF, 20, FORMAT = '(2E12.5,12I5)',res1, res2, res3, res4, res5, res6, res7, res8, res9 
    72 selec(t) = res8 
     74selec[t] = res8 
    7375ENDFOR 
    7476close, 20 
     
    7981    FOR i = 0,xdim-1 DO BEGIN  
    8082      READF, 30, FORMAT = '(3E12.5)', re, im, var 
    81       vari(i, j, ta) = var 
     83      vari[i, j, ta] = var 
    8284    ENDFOR 
    8385  ENDFOR 
     
    348350 return 
    349351end 
    350  
  • trunk/tools/lma/postlma_distpm_am.pro

    r166 r169  
    99PRO postlma_distpm_am $ 
    1010    , POST=post 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
     
    4143   FOR t = 0, NCMAX-1 DO BEGIN 
    4244      READF, 10, FORMAT = '(2E12.5,12I5)',res1, res2, res3, res4, res5, res6, res7, res8, res9 
    43       xver(t) = res1 
    44       dto(t) = res2 
    45       an(t) = res3 
    46       mois(t) = res4 
    47       jour(t) = res5 
    48       selec(t) = res8 
    49       time(t) = julday(res4, res5, res3, 0, 0, 0) 
     45      xver[t] = res1 
     46      dto[t] = res2 
     47      an[t] = res3 
     48      mois[t] = res4 
     49      jour[t] = res5 
     50      selec[t] = res8 
     51      time[t] = julday(res4, res5, res3, 0, 0, 0) 
    5052   ENDFOR 
    5153   close, 10 
     
    5860   FOR t = 0, NCMAX-1 DO BEGIN 
    5961      READF, 20, FORMAT = '(2E12.5)', res 
    60       DPM_sum1(t) = res 
     62      DPM_sum1[t] = res 
    6163   ENDFOR 
    6264   READF, 20, FORMAT = '(A6)', u 
    6365   FOR t = 0, NCMAX-1 DO BEGIN 
    6466      READF, 20, FORMAT = '(2E12.5)', res 
    65       DPM_sum2(t) = res 
     67      DPM_sum2[t] = res 
    6668   ENDFOR 
    6769   READF, 20, FORMAT = '(A6)', u 
    6870   FOR t = 0, NCMAX-1 DO BEGIN 
    6971      READF, 20, FORMAT = '(2E12.5)', res 
    70       DPM_win1(t) = res 
     72      DPM_win1[t] = res 
    7173   ENDFOR 
    7274   READF, 20, FORMAT = '(A6)', u 
    7375   FOR t = 0, NCMAX-1 DO BEGIN 
    7476      READF, 20, FORMAT = '(2E12.5)', res 
    75       DPM_win2(t) = res 
     77      DPM_win2[t] = res 
    7678   ENDFOR 
    7779   READF, 20, u 
     
    9193      print, res13 
    9294      print, res4, res5, res6 
    93       pourvar(t) = res13 
     95      pourvar[t] = res13 
    9496   ENDFOR 
    9597   close, 30 
     
    117119   FOR i = 0, NCMAX-1 DO BEGIN 
    118120      g = 0 
    119       IF (pourvar(i) GT 0.4) and (pourvar(i) LE 0.5) THEN g = 3 
    120       IF (pourvar(i) GT 0.5) and (pourvar(i) LE 0.6) THEN g = 6 
    121       IF (pourvar(i) GT 0.6) and (pourvar(i) LE 0.7) THEN g = 9 
    122       IF (pourvar(i) GT 0.7) and (pourvar(i) LE 0.8) THEN g = 12 
    123       IF (pourvar(i) GT 0.8) and (pourvar(i) LE 0.9) THEN g = 15 
    124       IF selec(i) EQ summer THEN xyouts, time(i),DPM_sum1(i), '.',charthick=5, charsize = g, alignment = align 
     121      IF (pourvar[i] GT 0.4) and (pourvar[i] LE 0.5) THEN g = 3 
     122      IF (pourvar[i] GT 0.5) and (pourvar[i] LE 0.6) THEN g = 6 
     123      IF (pourvar[i] GT 0.6) and (pourvar[i] LE 0.7) THEN g = 9 
     124      IF (pourvar[i] GT 0.7) and (pourvar[i] LE 0.8) THEN g = 12 
     125      IF (pourvar[i] GT 0.8) and (pourvar[i] LE 0.9) THEN g = 15 
     126      IF selec[i] EQ summer THEN xyouts, time[i],DPM_sum1[i], '.',charthick=5, charsize = g, alignment = align 
    125127   ENDFOR 
    126128 
     
    129131   FOR i = 0, NCMAX-1 DO BEGIN 
    130132      g = 0 
    131       IF (pourvar(i) GT 0.4) and (pourvar(i) LE 0.5) THEN g = 3 
    132       IF (pourvar(i) GT 0.5) and (pourvar(i) LE 0.6) THEN g = 6 
    133       IF (pourvar(i) GT 0.6) and (pourvar(i) LE 0.7) THEN g = 9 
    134       IF (pourvar(i) GT 0.7) and (pourvar(i) LE 0.8) THEN g = 12 
    135       IF (pourvar(i) GT 0.8) and (pourvar(i) LE 0.9) THEN g = 15 
    136       IF selec(i) EQ summer THEN xyouts, time(i),DPM_sum2(i), '.',charthick=5, charsize = g, alignment = align, color = 30 
     133      IF (pourvar[i] GT 0.4) and (pourvar[i] LE 0.5) THEN g = 3 
     134      IF (pourvar[i] GT 0.5) and (pourvar[i] LE 0.6) THEN g = 6 
     135      IF (pourvar[i] GT 0.6) and (pourvar[i] LE 0.7) THEN g = 9 
     136      IF (pourvar[i] GT 0.7) and (pourvar[i] LE 0.8) THEN g = 12 
     137      IF (pourvar[i] GT 0.8) and (pourvar[i] LE 0.9) THEN g = 15 
     138      IF selec[i] EQ summer THEN xyouts, time[i],DPM_sum2[i], '.',charthick=5, charsize = g, alignment = align, color = 30 
    137139   ENDFOR   
    138140 
     
    143145   FOR i = 0, NCMAX-1 DO BEGIN 
    144146      g = 0 
    145       IF (pourvar(i) GT 0.4) and (pourvar(i) LE 0.5) THEN g = 3 
    146       IF (pourvar(i) GT 0.5) and (pourvar(i) LE 0.6) THEN g = 6 
    147       IF (pourvar(i) GT 0.6) and (pourvar(i) LE 0.7) THEN g = 9 
    148       IF (pourvar(i) GT 0.7) and (pourvar(i) LE 0.8) THEN g = 12 
    149       IF (pourvar(i) GT 0.8) and (pourvar(i) LE 0.9) THEN g = 15 
    150       IF selec(i) EQ win THEN xyouts, time(i),DPM_win1(i), '.',charthick=5, charsize = g, alignment = align 
     147      IF (pourvar[i] GT 0.4) and (pourvar[i] LE 0.5) THEN g = 3 
     148      IF (pourvar[i] GT 0.5) and (pourvar[i] LE 0.6) THEN g = 6 
     149      IF (pourvar[i] GT 0.6) and (pourvar[i] LE 0.7) THEN g = 9 
     150      IF (pourvar[i] GT 0.7) and (pourvar[i] LE 0.8) THEN g = 12 
     151      IF (pourvar[i] GT 0.8) and (pourvar[i] LE 0.9) THEN g = 15 
     152      IF selec[i] EQ win THEN xyouts, time[i],DPM_win1[i], '.',charthick=5, charsize = g, alignment = align 
    151153   ENDFOR 
    152154    
     
    154156   FOR i = 0, NCMAX-1 DO BEGIN 
    155157      g = 0 
    156       IF (pourvar(i) GT 0.4) and (pourvar(i) LE 0.5) THEN g = 3 
    157       IF (pourvar(i) GT 0.5) and (pourvar(i) LE 0.6) THEN g = 6 
    158       IF (pourvar(i) GT 0.6) and (pourvar(i) LE 0.7) THEN g = 9 
    159       IF (pourvar(i) GT 0.7) and (pourvar(i) LE 0.8) THEN g = 12 
    160       IF (pourvar(i) GT 0.8) and (pourvar(i) LE 0.9) THEN g = 15 
    161       IF selec(i) EQ win THEN xyouts, time(i),DPM_win2(i), '.',charthick=5, charsize = g, alignment = align, color = 30 
     158      IF (pourvar[i] GT 0.4) and (pourvar[i] LE 0.5) THEN g = 3 
     159      IF (pourvar[i] GT 0.5) and (pourvar[i] LE 0.6) THEN g = 6 
     160      IF (pourvar[i] GT 0.6) and (pourvar[i] LE 0.7) THEN g = 9 
     161      IF (pourvar[i] GT 0.7) and (pourvar[i] LE 0.8) THEN g = 12 
     162      IF (pourvar[i] GT 0.8) and (pourvar[i] LE 0.9) THEN g = 15 
     163      IF selec[i] EQ win THEN xyouts, time[i],DPM_win2[i], '.',charthick=5, charsize = g, alignment = align, color = 30 
    162164   ENDFOR   
    163165   if keyword_set(post) THEN BEGIN   
  • trunk/tools/lma/postlma_var.pro

    r166 r169  
    99PRO postlma_var $ 
    1010    , POST=post 
     11; 
     12  compile_opt idl2, strictarrsubs 
    1113; 
    1214@common 
     
    4244   FOR t = 0, NCMAX-1 DO BEGIN 
    4345      READF, 10, FORMAT = '(2E12.5,12I5)',res1, res2, res3, res4, res5, res6, res7, res8, res9 
    44       xver(t) = res1 
    45       dto(t) = res2 
    46       an(t) = res3 
    47       mois(t) = res4 
    48       jour(t) = res5 
    49       selec(t) = res8 
    50       time(t) = julday(res4, res5, res3, 0, 0, 0) 
     46      xver[t] = res1 
     47      dto[t] = res2 
     48      an[t] = res3 
     49      mois[t] = res4 
     50      jour[t] = res5 
     51      selec[t] = res8 
     52      time[t] = julday(res4, res5, res3, 0, 0, 0) 
    5153   ENDFOR 
    5254   close, 10 
    5355 
    54    print, 'Initial date dd/mm/yy = ', jour(0), mois(0), an(0) 
    55    print, 'Final   date dd/mm/yy = ', jour(NCMAX-1), mois(NCMAX-1), an(NCMAX-1) 
     56   print, 'Initial date dd/mm/yy = ', jour[0], mois[0], an[0] 
     57   print, 'Final   date dd/mm/yy = ', jour[NCMAX-1], mois[NCMAX-1], an[NCMAX-1] 
    5658 
    57    inidat = (an(0)-1)*12+mois(0) 
    58    findat = (an(NCMAX-1)-1)*12+mois(NCMAX-1) 
     59   inidat = (an[0]-1)*12+mois[0] 
     60   findat = (an[NCMAX-1]-1)*12+mois[NCMAX-1] 
    5961 
    6062; read % var, variance, period, 
     
    6870   FOR t = 0, NCMAX-1 DO BEGIN 
    6971      READF, 20, res1, res2, res3, res4, res5, res6, res7, res8, res9, res10, res11, res12, res13 
    70       DPM_pouvar(t) = res9 
    71       DPM_varian(t) = sqrt(res12)*res13 
    72       DPM_period(t) = res10 
     72      DPM_pouvar[t] = res9 
     73      DPM_varian[t] = sqrt(res12)*res13 
     74      DPM_period[t] = res10 
    7375   ENDFOR 
    7476       
     
    120122 
    121123      IF res1 GE inidat AND res1 LE findat THEN BEGIN 
    122          nino3_ssta(idx) = res2 
    123          year(idx) = an_t 
    124          month(idx) = mon_t 
    125          time(idx) = julday(month(idx), 15, year(idx), 0, 0, 0) 
     124         nino3_ssta[idx] = res2 
     125         year[idx] = an_t 
     126         month[idx] = mon_t 
     127         time[idx] = julday(month[idx], 15, year[idx], 0, 0, 0) 
    126128         idx = idx + 1 
    127129      ENDIF  
     
    134136; take from inidat to findat 
    135137 
    136    print, 'Initial date dd/mm/yy = ', 15, month(0), year(0) 
    137    print, 'Final   date dd/mm/yy = ', 15, month(idx), year(idx) 
     138   print, 'Initial date dd/mm/yy = ', 15, month[0], year[0] 
     139   print, 'Final   date dd/mm/yy = ', 15, month[idx], year[idx] 
    138140   nino3_ssta = nino3_ssta[0:idx] 
    139141   time = time[0:idx] 
  • trunk/tools/lma/slec.pro

    r168 r169  
    1010         , _EXTRA=extra 
    1111; 
     12  compile_opt idl2, strictarrsubs 
     13; 
    1214@common 
    1315   if strlowcase(name) EQ 'un' then name = 'AM_win1i' 
  • trunk/tools/merid_trans.pro

    r165 r169  
    1616; 
    1717;- 
    18 PRO merid $ 
     18PRO merid_trans $ 
    1919    , SALT=salt $ 
    2020    , PS=ps 
     21; 
     22  compile_opt idl2, strictarrsubs 
    2123; 
    2224@common 
     
    141143 
    142144; 2nd window - Atlantic 
    143  plot,latitude(index),(field7+field8)(index)*ymult,/noerase, linestyle = 0, thick = 2 
    144  plot,latitude(index),field5(index)*ymult,/noerase , linestyle = 1, thick = 2             
    145  plot,latitude(index),field6(index)*ymult,/noerase, linestyle = 2 , thick = 2               
    146  plot,latitude(index),field7(index)*ymult,/noerase, linestyle = 3 , thick = 2               
     145 plot,latitude[index],(field7+field8)[index]*ymult,/noerase, linestyle = 0, thick = 2 
     146 plot,latitude[index],field5[index]*ymult,/noerase , linestyle = 1, thick = 2             
     147 plot,latitude[index],field6[index]*ymult,/noerase, linestyle = 2 , thick = 2               
     148 plot,latitude[index],field7[index]*ymult,/noerase, linestyle = 3 , thick = 2               
    147149 plot,!x.crange, [0., 0.], /noerase , thick = 0.5   
    148150 plot,[0., 0.],!y.crange, /noerase , thick = 0.5 , title = 'atlantic'  
     
    154156 indo3 = (field2-field6) 
    155157 indo4 = (field3-field7) 
    156  plot,latitude(index),indo1(index)*ymult,/noerase, linestyle = 0, thick = 2 
    157  plot,latitude(index),indo2(index)*ymult,/noerase , linestyle = 1, thick = 2             
    158  plot,latitude(index),indo3(index)*ymult,/noerase, linestyle = 2 , thick = 2               
    159  plot,latitude(index),indo4(index)*ymult,/noerase, linestyle = 3 , thick = 2               
     158 plot,latitude[index],indo1[index]*ymult,/noerase, linestyle = 0, thick = 2 
     159 plot,latitude[index],indo2[index]*ymult,/noerase , linestyle = 1, thick = 2             
     160 plot,latitude[index],indo3[index]*ymult,/noerase, linestyle = 2 , thick = 2               
     161 plot,latitude[index],indo4[index]*ymult,/noerase, linestyle = 3 , thick = 2               
    160162 plot,!x.crange, [0., 0.], /noerase , thick = 0.5   
    161163 plot,[0., 0.],!y.crange, /noerase , thick = 0.5 , title = 'indopac'   
  • trunk/tools/msf_bin/boundperio.pro

    r165 r169  
    1111         , VV=vv $ 
    1212         , FF=ff 
     13; 
     14  compile_opt idl2, strictarrsubs 
    1315; 
    1416@common    
  • trunk/tools/msf_bin/iniflx.pro

    r165 r169  
    1818;- 
    1919PRO iniflx 
     20; 
     21  compile_opt idl2, strictarrsubs 
    2022; 
    2123@common 
     
    4547 
    4648   FOR l = 0, jpl-1 DO BEGIN  
    47       lat = gphiv(90, l) 
     49      lat = gphiv[90, l] 
    4850      uvmsk = fltarr(jpi, jpj) 
    4951;      uvmsk = uvmsk*0. 
    50       uvmsk(where(gphit GT lat)) = 1 
    51       zuleng = boundcut( e2u*(shift(uvmsk, -1, 0)-uvmsk)*(umask)(*, *, 0) ) 
     52      uvmsk[where(gphit GT lat)] = 1 
     53      zuleng = boundcut( e2u*(shift(uvmsk, -1, 0)-uvmsk)*(umask)[*, *, 0] ) 
    5254;                                          ^ 
    5355; il manquait le signe moins ci dessous/dessus, corrige le 10/04/99 ... 
    5456;                                             v 
    55       zvleng = boundcut( e1v*(shift(uvmsk, 0, -1)-uvmsk)*(vmask)(*, *, 0) ) 
     57      zvleng = boundcut( e1v*(shift(uvmsk, 0, -1)-uvmsk)*(vmask)[*, *, 0] ) 
    5658      indu = where( (zuleng NE 0) ) 
    5759      IF indu[0] EQ -1 THEN indu = [0] 
     
    6062      Nu = n_elements(indu) 
    6163      Nv = n_elements(indv) 
    62       indxu  (0:Nu-1, l) = indu 
    63       indxv  (0:Nv-1, l) = indv 
    64       zxuleng(0:Nu-1, l) = zuleng(indu) 
    65       zxvleng(0:Nv-1, l) = zvleng(indv) 
     64      indxu  [0:Nu-1, l] = indu 
     65      indxv  [0:Nv-1, l] = indv 
     66      zxuleng[0:Nu-1, l] = zuleng[indu] 
     67      zxvleng[0:Nv-1, l] = zvleng[indv] 
    6668   ENDFOR  
    6769 
     
    7375 
    7476   FOR l = 0, jpi-3 DO BEGIN  
    75       lon = glamu(l, 0) 
     77      lon = glamu[l, 0] 
    7678      uvmsk = fltarr(jpi, jpj) 
    7779      uvmsk = uvmsk*0. 
    78       uvmsk(where(glamt GT lon)) = 1 
    79       zuleng = boundcut( e2u*(shift(uvmsk, 1, 0)-uvmsk)*(umask)(*, *, 0) ) 
    80       zvleng = boundcut( e1v*(shift(uvmsk, 0, 1)-uvmsk)*(vmask)(*, *, 0) ) 
     80      uvmsk[where(glamt GT lon)] = 1 
     81      zuleng = boundcut( e2u*(shift(uvmsk, 1, 0)-uvmsk)*(umask)[*, *, 0] ) 
     82      zvleng = boundcut( e1v*(shift(uvmsk, 0, 1)-uvmsk)*(vmask)[*, *, 0] ) 
    8183      indu = where( (zuleng NE 0) ) 
    8284      IF indu[0] EQ -1 THEN indu = [0] 
     
    8587      Nu = n_elements(indu) 
    8688      Nv = n_elements(indv) 
    87       indyu  (l+1, 0:Nu-1) = indu 
    88       indyv  (l+1, 0:Nv-1) = indv 
    89       zyuleng(l+1, 0:Nu-1) = zuleng(indu) 
    90       zyvleng(l+1, 0:Nv-1) = zvleng(indv) 
     89      indyu  [l+1, 0:Nu-1] = indu 
     90      indyv  [l+1, 0:Nv-1] = indv 
     91      zyuleng[l+1, 0:Nu-1] = zuleng[indu] 
     92      zyvleng[l+1, 0:Nv-1] = zvleng[indv] 
    9193   ENDFOR  
    92 END  
     94END 
  • trunk/tools/msf_bin/msf_sigma.pro

    r165 r169  
    2929         , MSK=msk 
    3030; 
     31  compile_opt idl2, strictarrsubs 
     32; 
    3133      print, 'Bining U ...' 
    3234      u_s = bin_velocity(density, sigma_values, u, /uu) 
     
    4749         , UU = uu $ 
    4850         , VV = vv 
     51; 
     52  compile_opt idl2, strictarrsubs 
    4953; 
    5054@common 
     
    7175   c1_z = fltarr(N_z)    ; profil du contenu vertical de x 
    7276   s_z = fltarr(N_z)     ; profil de la densite 
    73    z_zt = zdept(1:jpk)  ; profondeur au point T  (k=0 -> 5m) 
    74    z_zw = zdepw(1:jpk)  ;                     W  (k=0 -> 10m) 
     77   z_zt = zdept[1:jpk]  ; profondeur au point T  (k=0 -> 5m) 
     78   z_zw = zdepw[1:jpk]  ;                     W  (k=0 -> 10m) 
    7579 
    7680;   Profils selon les couches de densite (suffixe _s) 
     
    8892; 
    8993   x1_content = fltarr(jpi, jpj, jpk) 
    90    x1_content(*, *, 0) = e3t(0) * x1(*, *, 0) 
    91    FOR k = 1, jpk-1 DO x1_content(*, *, k) = x1_content(*, *, k-1) $  
    92                         + e3t(k) * x1(*, *, k) 
     94   x1_content[*, *, 0] = e3t[0] * x1[*, *, 0] 
     95   FOR k = 1, jpk-1 DO x1_content[*, *, k] = x1_content[*, *, k-1] $  
     96                        + e3t[k] * x1[*, *, k] 
    9397 
    9498; 
     
    100104;  Indices des points T dans l ocean 
    101105; 
    102          i_ocean = where(xmask(i, j, *) EQ 1) 
     106         i_ocean = where(xmask[i, j, *] EQ 1) 
    103107 
    104108         z_s = z_s*0. 
     
    108112         IF (i_ocean[0] NE -1) THEN BEGIN ; on n'entre que si il y a des points ocean 
    109113  
    110             s_z(*) = density(i, j, *) 
    111             c1_z(*) = x1_content(i, j, *) 
     114            s_z[*] = density[i, j, *] 
     115            c1_z[*] = x1_content[i, j, *] 
    112116 
    113117; critere supplementaire a imposer sur le profil pour eviter les cas 
    114118; pathologiques en attendant d'ecrire une vraie commande d'extraction 
    115119; de progils stritement croissant. Il s'agit donc d'un test adhoc. 
    116             IF s_z(0) LT s_z(i_ocean(n_elements(i_ocean)-1)) THEN BEGIN  
     120            IF s_z[0] LT s_z[i_ocean[n_elements(i_ocean)-1]] THEN BEGIN  
    117121 
    118122;------------------------------------------------------------------------ 
     
    120124; inutilisé (avis aux amateurs) 
    121125; 
    122 ;            ds = (shift(s_z, -1)-s_z)(i_ocean(0:n_elements(i_ocean)-2)) 
    123 ;            ds(0) = 0 
     126;            ds = (shift(s_z, -1)-s_z)[i_ocean[0:n_elements(i_ocean)-2]] 
     127;            ds[0] = 0 
    124128;            ind = where(ds LT 0.) 
    125 ;            croissant = ind(0) EQ -1 
     129;            croissant = ind[0] EQ -1 
    126130;------------------------------------------------------------------------ 
    127131 
    128             i_bottom = i_ocean(n_elements(i_ocean)-1) 
    129  
    130             z_s(N_s) = z_zw(i_bottom) 
    131             c1_s(N_s) = x1_content(i, j, jpk-1) 
     132            i_bottom = i_ocean[n_elements(i_ocean)-1] 
     133 
     134            z_s[N_s) = z_zw(i_bottom] 
     135            c1_s[N_s] = x1_content[i, j, jpk-1] 
    132136             
    133137; extraction d'un sous profil strictement croissant 
    134             mini = min(s_z(i_ocean)) 
    135             maxi = max(s_z(i_ocean))             
    136  
    137             i_min = where(s_z(i_ocean) EQ mini) 
    138             i_max = where(s_z(i_ocean) EQ maxi) 
     138            mini = min(s_z[i_ocean]) 
     139            maxi = max(s_z[i_ocean])             
     140 
     141            i_min = where(s_z[i_ocean] EQ mini) 
     142            i_max = where(s_z[i_ocean] EQ maxi) 
    139143;   on prend le plus grand des indices min 
    140144;         et le plus petit des indices max 
     
    148152; l isopycne est mise en surface (z_s=0) 
    149153; 
    150             ind = where(s_s LT s_z(i_min)) 
     154            ind = where(s_s LT s_z[i_min]) 
    151155            IF ind[0] NE -1 THEN BEGIN  
    152                z_s(ind) = 0 
    153                c1_s(ind) = 0 
     156               z_s[ind] = 0 
     157               c1_s[ind] = 0 
    154158            ENDIF  
    155159 
     
    157161; l isopycne est mise au fond (z_s=z_zw(i_bottom)) 
    158162; 
    159             ind = where(s_s GT s_z(i_max)) 
     163            ind = where(s_s GT s_z[i_max]) 
    160164            IF ind[0] NE -1 THEN BEGIN  
    161                z_s(ind) = z_s(N_s) 
    162                c1_s(ind) = c1_s(N_s) 
     165               z_s[ind] = z_s[N_s] 
     166               c1_s[ind] = c1_s[N_s] 
    163167            ENDIF  
    164168 
    165             ind = where( (s_s GE s_z(i_min)) AND (s_s LT s_z(i_max)) ) 
     169            ind = where( (s_s GE s_z[i_min]) AND (s_s LT s_z[i_max]) ) 
    166170            IF ind[0] NE -1 THEN BEGIN  
    167171                
    168                i_profil = i_ocean(i_min:i_max) 
    169  
    170                z_s(ind) = interpol(z_zt(i_profil), s_z(i_profil), s_s(ind)) 
     172               i_profil = i_ocean[i_min:i_max] 
     173 
     174               z_s[ind] = interpol(z_zt[i_profil], s_z[i_profil], s_s[ind]) 
    171175                
    172176; 
    173177; j'utilise la fonction spline pour interpoler le contenu 
    174178; 
    175                c1_s(ind) = spline(z_zw(i_profil), c1_z(i_profil), z_s(ind), 1) 
     179               c1_s[ind] = spline(z_zw[i_profil], c1_z[i_profil], z_s[ind], 1) 
    176180; 
    177181; l'interpolation lineaire marche aussi. Elle donne des resultats differents. Elle 
    178182; me semble moins propre. Je la donne en remarque. 
    179183; 
    180 ;               c_s(ind+1) = interpol(c_z(i_profil), z_zw(i_profil), z_s(ind+1)) 
     184;               c_s[ind+1] = interpol(c_z[i_profil], z_zw[i_profil], z_s[ind+1]) 
    181185; 
    182186; Remarque : on ne divise pas par l'epaisseur de la couche 
    183187; 
    184                x1_s(ind) = (c1_s(ind+1)-c1_s(ind));/(z_s(ind+1)-z_s(ind)) 
     188               x1_s[ind] = (c1_s[ind+1]-c1_s[ind]);/(z_s[ind+1]-z_s[ind]) 
    185189 
    186190            ENDIF  
     
    188192         ENDIF 
    189193 
    190          x1_bin(i, j, *) = x1_s 
     194         x1_bin[i, j, *] = x1_s 
    191195          
    192196      ENDFOR  
     
    196200 
    197201END  
    198  
    199  
    200202;+ 
    201203; 
     
    203205PRO compute_msf, u, v, msf $ 
    204206    , MSK = msk 
     207; 
     208  compile_opt idl2, strictarrsubs 
    205209; 
    206210; 
     
    231235      zumask = boundperio( (msk +shift(msk, -1, 0) ) < 1 ) 
    232236      zvmask = boundperio( (msk +shift(msk, 0, -1) ) < 1 ) 
    233       zumask = zumask(*)#vert 
    234       zvmask = zvmask(*)#vert 
     237      zumask = zumask[*]#vert 
     238      zvmask = zvmask[*]#vert 
    235239      zu = zu*zumask 
    236240      zv = zv*zvmask 
     
    248252; 
    249253   offset = (fltarr(180, jpl)+long(jpi)*jpj)(*)#findgen(jpk2) 
    250    indu = indxu(*)#vert+offset 
    251    indv = indxv(*)#vert+offset    
     254   indu = indxu[*]#vert+offset 
     255   indv = indxv[*]#vert+offset    
    252256; 
    253257;  extension sur la verticale 
    254258; 
    255    zuleng = zxuleng(*)#vert 
    256    zvleng = zxvleng(*)#vert 
     259   zuleng = zxuleng[*]#vert 
     260   zvleng = zxvleng[*]#vert 
    257261; 
    258262;  calcul du flux 
    259263; 
    260    z = reform(zu(indu)*zuleng+zv(indv)*zvleng, 180, jpl, jpk2) 
     264   z = reform(zu[indu]*zuleng+zv[indv]*zvleng, 180, jpl, jpk2) 
    261265; 
    262266;  integration zonale du flux ! 
     
    270274;        couche). 
    271275; 
    272    FOR k = jpk2-2, 0, -1 DO msf(*, k) = msf(*, k+1)-fm(*, k); *e3t(k) 
    273  
    274 END  
     276   FOR k = jpk2-2, 0, -1 DO msf[*, k] = msf[*, k+1]-fm[*, k]; *e3t[k] 
     277 
     278END 
  • trunk/tools/nadw.pro

    r165 r169  
    1010PRO nadw, msf, nadw, lat, prof 
    1111; 
     12  compile_opt idl2, strictarrsubs 
     13; 
    1214@common 
    1315; 
     
    2022 
    2123   FOR k = 0, N-1 DO BEGIN  
    22       z = msf(*, *, k) 
    23       nadw(k) = max(z) ; prend le max de msf 
     24      z = msf[*, *, k] 
     25      nadw[k] = max(z) ; prend le max de msf 
    2426; 
    2527; 
    2628; 
    2729      indice = (where(z EQ flow(k)))[0] 
    28       lat(k) = gphit(90, indice MOD jpl) ; recupere la latitude  
    29       prof(k) = zdept(indice/jpl)        ; et la profondeur 
     30; recupere la latitude  
     31      lat[k] = gphit[90, indice MOD jpl]  
     32; et la profondeur 
     33      prof[k] = zdept[indice/jpl] 
    3034   ENDFOR  
    3135 
  • trunk/tools/nino_composite.pro

    r165 r169  
    11;+ 
     2; 
     3; @todo 
     4; missing initorca0 module 
    25; 
    36; @version 
     
    710PRO nino_composite $ 
    811    , FILENAME=filename 
     12; 
     13  compile_opt idl2, strictarrsubs 
    914; 
    1015dbase='/home/dynamite/mkolas/database/' 
     
    3742sstaC_temp = total(sstaC_sc, 2)*12/jpt 
    3843tab_sst_sc = fltarr(jpt) 
    39 FOR i = 0, jpt/12.-1 DO tab_sst_sc(i*12:i*12+11) = sstaC_temp(*) 
     44FOR i = 0, jpt/12.-1 DO tab_sst_sc[i*12:i*12+11] = sstaC_temp[*] 
    4045 
    4146;Moyenne glissante Trenberth 3 ou 5 mois ?? 
    42 sstaC = ts_smooth(sstaC-tab_sst_sc, 5) 
     47sstaC = ts_smooth[sstaC-tab_sst_sc, 5] 
    4348; 
    4449resp=fltarr(jpt) 
     
    5156Deb_Nino = a(where(a-shift(a,1) GT 1)) 
    5257Fin_Nino = a(where(a-shift(a,1) GT 1)-1) 
    53 IF (Fin_Nino(0) LT Deb_Nino(0)) THEN Fin_Nino = Fin_Nino(1:n_elements(Fin_Nino)-1) 
    54 IF(n_elements(Deb_Nino) GT n_elements(Fin_Nino)) THEN Deb_Nino = Deb_Nino(0:n_elements(Fin_Nino)-1) 
     58IF (Fin_Nino[0] LT Deb_Nino[0]) THEN Fin_Nino = Fin_Nino[1:n_elements(Fin_Nino)-1] 
     59IF(n_elements(Deb_Nino) GT n_elements(Fin_Nino)) THEN Deb_Nino = Deb_Nino[0:n_elements(Fin_Nino)-1] 
    5560Length_Nino = Fin_Nino-Deb_Nino+1 
    56 Deb_Nino = Deb_Nino(where(Length_Nino GT 5)) 
    57 Fin_Nino = Fin_Nino(where(Length_Nino GT 5)) 
    58 Length_Nino = Length_Nino(where(Length_Nino GT 5)) 
     61Deb_Nino = Deb_Nino[where(Length_Nino GT 5)] 
     62Fin_Nino = Fin_Nino[where(Length_Nino GT 5)] 
     63Length_Nino = Length_Nino[where(Length_Nino GT 5)] 
    5964 
    6065;;Max_Nino = intarr(n_elements(Deb_Nino)) 
    6166;;FOR i = 0, n_elements(Deb_Nino)-1 DO BEGIN 
    62 ;;a = max(sstaC(Deb_Nino(i):Fin_Nino(i)),ind)  
    63 ;;Max_Nino(i) = ind+Deb_Nino(i) 
     67;;a = max(sstaC(Deb_Nino[i]:Fin_Nino[i]),ind)  
     68;;Max_Nino[i] = ind+Deb_Nino[i] 
    6469;;ENDFOR 
    6570;;Deb_Nino_sel = Deb_Nino(where((Max_Nino mod 12) GE 8 OR (Max_Nino mod 12) LE 1)) 
     
    7378 
    7479FOR i=0,n_elements(Year_Nino)-1 DO BEGIN 
    75 sstaC_Nino(i, *) = sstaC(Year_Nino(i)*12: (Year_Nino(i)+2)*12-1) 
     80sstaC_Nino[i, *] = sstaC[Year_Nino[i]*12: (Year_Nino[i]+2)*12-1] 
    7681ENDFOR 
    7782 
    7883jpt = 24 
    7984time = julday(01, 15, 01)+findgen(jpt)*30 
    80 plt1d,reform(sstaC_Nino(0,*)),'t', min = -stddev(sstaC)*3, max = stddev(sstaC)*3, petit = [2, 2, 1], /rempli,xtitle ='', ytitle = 'SSTA (C)', title = model+' '+exp+' '+strtrim(string(n_elements(Year_Nino_Weak)), 1)+' Weak Nino (PrecMAM<2.): Nino34 SSTA',subtitle = '', /port, win = 2 
     85plt1d,reform(sstaC_Nino[0,*]),'t', min = -stddev(sstaC)*3, max = stddev(sstaC)*3, petit = [2, 2, 1], /rempli,xtitle ='', ytitle = 'SSTA (C)', title = model+' '+exp+' '+strtrim(string(n_elements(Year_Nino_Weak)), 1)+' Weak Nino (PrecMAM<2.): Nino34 SSTA',subtitle = '', /port, win = 2 
    8186FOR i=1,n_elements(Year_Nino)-1 DO BEGIN 
    82 plt1d,reform(sstaC_Nino(i,*)),'t', min = -stddev(sstaC)*3, max = stddev(sstaC)*3, /ov1d, /noerase, petit = [2, 2, 1], /rempli,xtitle ='', ytitle = '', title = '',subtitle = '', /port 
     87plt1d,reform(sstaC_Nino[i,*]),'t', min = -stddev(sstaC)*3, max = stddev(sstaC)*3, /ov1d, /noerase, petit = [2, 2, 1], /rempli,xtitle ='', ytitle = '', title = '',subtitle = '', /port 
    8388ENDFOR 
    8489 
  • trunk/tools/retouche.pro

    r165 r169  
    3939FUNCTION retouche, tab $ 
    4040         , TAILLEPOINT=taillepoint 
     41; 
     42  compile_opt idl2, strictarrsubs 
    4143; 
    4244    nouvmask=-1 
  • trunk/tools/transfo/grads2cdf.pro

    r165 r169  
    1212;- 
    1313PRO grads2cdf 
     14; 
     15  compile_opt idl2, strictarrsubs 
    1416; 
    1517@common 
     
    203205;       print, longname[0] 
    204206;       print, extract_str(line, '[', ']') 
    205          fid(in-1) = NCDF_VARDEF(id,varname[in-1], [xid, yid, tid], /FLOAT) 
    206          NCDF_ATTPUT, id, fid(in-1), 'units', extract_str(line, '[', ']') 
    207          NCDF_ATTPUT, id, fid(in-1), 'long_name', longname[0] 
    208          NCDF_ATTPUT, id, fid(in-1), 'short_name', varname[in-1] 
     207         fid[in-1] = NCDF_VARDEF(id,varname[in-1], [xid, yid, tid], /FLOAT) 
     208         NCDF_ATTPUT, id, fid[in-1], 'units', extract_str(line, '[', ']') 
     209         NCDF_ATTPUT, id, fid[in-1], 'long_name', longname[0] 
     210         NCDF_ATTPUT, id, fid[in-1], 'short_name', varname[in-1] 
    209211      ENDFOR  
    210212 
     
    227229;        print, longname[0] 
    228230;        print, extract_str(line, '[', ']') 
    229             fid(idx+in-1) = NCDF_VARDEF(id,varname[idx+in-1], [xid, yid, tid], /FLOAT) 
     231            fid[idx+in-1] = NCDF_VARDEF(id,varname[idx+in-1], [xid, yid, tid], /FLOAT) 
    230232            NCDF_ATTPUT, id, fid(idx+in-1), 'units', extract_str(line, '[', ']') 
    231233            NCDF_ATTPUT, id, fid(idx+in-1), 'long_name', longname[0] 
     
    252254;         print, longname[0] 
    253255;         print, extract_str(line, '[', ']') 
    254             fid(idx+in-1) = NCDF_VARDEF(id,varname[idx+in-1], [xid, yid, zid, tid], /FLOAT) 
     256            fid[idx+in-1] = NCDF_VARDEF(id,varname[idx+in-1], [xid, yid, zid, tid], /FLOAT) 
    255257            NCDF_ATTPUT, id, fid(idx+in-1), 'units', extract_str(line, '[', ']') 
    256258            NCDF_ATTPUT, id, fid(idx+in-1), 'long_name', longname[0] 
     
    289291               field = grads_read(filename, varname[in-1], time_2 = it, NCDF_DB = iodir, /all_data, /no_key_shift) 
    290292               tidx = ntime*(month-1)+it-1 
    291                fldata(in-1, *, tidx) = field.data 
     293               fldata[in-1, *, tidx] = field.data 
    292294            ENDFOR 
    293295         ENDFOR 
     
    303305                  field = grads_read(filename, varname[in-1], time_2 = it, NCDF_DB = iodir, /all_data, /no_key_shift) 
    304306                  tidx = ntime*(month-1)+it-1 
    305                   fldata(in-1, *, tidx) = field.data 
     307                  fldata[in-1, *, tidx] = field.data 
    306308               ENDFOR 
    307309            ENDFOR 
     
    320322                     field = grads_read(filename, varname[idx+in-1], time_2 = it, NCDF_DB = iodir, /all_data, /no_key_shift, level = il) 
    321323                     tidx = ntime*(month-1)+it-1 
    322                      fldata3(in-1, *, il-1, tidx) = field.data 
     324                     fldata3[in-1, *, il-1, tidx] = field.data 
    323325                  ENDFOR 
    324326               ENDFOR 
     
    333335      FOR in = 1, nfields DO BEGIN 
    334336          
    335          NCDF_ATTPUT, id, fid(in-1), 'valid_min', min(fldata(in-1, *, *)), /float 
    336          NCDF_ATTPUT, id, fid(in-1), 'valid_max', max(fldata(in-1, *, *)), /float 
    337          NCDF_ATTPUT, id, fid(in-1), 'missing_value',1.e20, /float 
     337         NCDF_ATTPUT, id, fid[in-1], 'valid_min', min(fldata[in-1, *, *]), /float 
     338         NCDF_ATTPUT, id, fid[in-1], 'valid_max', max(fldata[in-1, *, *]), /float 
     339         NCDF_ATTPUT, id, fid[in-1], 'missing_value',1.e20, /float 
    338340          
    339341      ENDFOR 
     
    341343      FOR in = 1, nfields3 DO BEGIN 
    342344          
    343          NCDF_ATTPUT, id, fid(idx+in-1), 'valid_min', min(fldata3(in-1, *, *, *)), /float 
    344          NCDF_ATTPUT, id, fid(idx+in-1), 'valid_max', max(fldata3(in-1, *, *, *)), /float 
     345         NCDF_ATTPUT, id, fid(idx+in-1), 'valid_min', min(fldata3[in-1, *, *, *]), /float 
     346         NCDF_ATTPUT, id, fid(idx+in-1), 'valid_max', max(fldata3[in-1, *, *, *]), /float 
    345347         NCDF_ATTPUT, id, fid(idx+in-1), 'missing_value',1.e20, /float 
    346348          
     
    365367      FOR in = 1, nfields DO BEGIN 
    366368 
    367          fieldm = reform(fldata(in-1, *, *), jpi, jpj, ndates) 
     369         fieldm = reform(fldata[in-1, *, *], jpi, jpj, ndates) 
    368370         print, 'write ', varname[in-1] 
    369371          
    370          NCDF_VARPUT, id, fid(in-1), fieldm 
     372         NCDF_VARPUT, id, fid[in-1], fieldm 
    371373          
    372374      ENDFOR 
    373375      FOR in = 1, nfields3 DO BEGIN 
    374376 
    375          fieldm = reform(fldata3(in-1, *, *, *), jpi, jpj, nlevs, ndates) 
     377         fieldm = reform(fldata3[in-1, *, *, *], jpi, jpj, nlevs, ndates) 
    376378         print, 'write ', varname[nfields2d + nfields_sf+in-1] 
    377379          
  • trunk/tools/transfo/grads_read.pro

    r168 r169  
    1717         , NO_KEY_SHIFT=no_key_shift $ 
    1818         , LEVEL=level 
     19; 
     20  compile_opt idl2, strictarrsubs 
    1921; 
    2022@common 
  • trunk/usr/correl.pro

    r165 r169  
    66;- 
    77PRO correl 
     8; 
     9  compile_opt idl2, strictarrsubs 
    810; 
    911@common 
  • trunk/usr/p.pro

    r165 r169  
    77PRO p 
    88; 
     9  compile_opt idl2, strictarrsubs 
     10; 
    911resolve_routine, 'post_it' 
    1012post_it 
  • trunk/usr/plt_def.pro

    r165 r169  
    88;- 
    99PRO plt_def 
     10; 
     11  compile_opt idl2, strictarrsubs 
    1012; 
    1113@com_eg 
  • trunk/usr/post_it.pro

    r165 r169  
    1111;- 
    1212PRO post_it 
     13; 
     14  compile_opt idl2, strictarrsubs 
    1315; 
    1416@common 
  • trunk/usr/post_it2.pro

    r165 r169  
    66;- 
    77PRO post_it2 
     8; 
     9  compile_opt idl2, strictarrsubs 
    810; 
    911@common 
Note: See TracChangeset for help on using the changeset viewer.