Index: unk/FIG_bar_transp_write.pro
===================================================================
--- /trunk/FIG_bar_transp_write.pro	(revision 48)
+++ 	(revision )
@@ -1,175 +1,0 @@
-PRO FIG_bar_transp_write,iyear,ian
-@init2
-@initorca2_bab
-
-; draw the vertically integrated transport
-
-
-@common
-
-ian='01'
-iyear='1993'
-
-e_exp='ESS'
-;e_exp0='FRI'
-;e_year0='10'
-key_portrait = 0
-; stockage des fichiers brut
-  ioDATA='/usr/work/sur/fvi/OPA/ORCA2/'+e_exp
-  file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc'
-  print, file_U
-  file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc'
-  print, file_V
-
-; title
-     t_exp= e_exp
-;     t_exp0= e_exp0
-     t_bt  = 'bar_transp'
-ioORLN2 = '/usr/work/sur/fvi/OPA/ORCA2'
-;facteur d'echelle vertical for partial steps
-e3v3d=read_ncdf('e3v_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-e3u3d=read_ncdf('e3u_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-
-
-
-; vertical integration:
-e3t3d=make_array(jpi,jpj,jpk)
-        for k=0, jpk-1 do begin              &$
-          for j=0,jpj-1 do begin              &$
-            for i=0,jpi-1 do begin             &$
-              e3t3d(i,j,k) = e3t(k)    &$
-            endfor                     &$
-          endfor                      &$
-        endfor
-jpt = 73
-
-;vud = make_array(jpi,jpj,jpt)
-;vvd = make_array(jpi, jpj, jpt)
-
-; ouverture des fichiers dans lesquels on va Ã©crire
-id3=NCDF_OPEN('/usr/work/sur/fvi/geomag/U_5d_'+iyear+'_grid_T.nc',/write)
-id4=NCDF_OPEN('/usr/work/sur/fvi/geomag/V_5d_'+iyear+'_grid_T.nc',/write)
-
-FOR jt = 0, jpt-1 DO BEGIN &$
-
-; ouverture des fichiers et stockage en memoire partial steps
-  vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U)  &$
-  vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V)  &$
-
-
-
-; Somme sur la verticale partial steps
-                vum=total( vu*e3u3d*umask(),3 )  &$
-                vvm=total( vv*e3v3d*vmask(),3 )  &$
-
-; Shit sur la grille T partial steps
-             vut= (vum+shift(vum,1,0) )*0.5   &$
-             vvt= (vvm+shift(vvm,0,1) )*0.5   &$
-; Bande de recouvrement
-             vut(0, *) = vut(jpi-2, *)
-             vvt(*, 0) = 0.
-; stockage dans le fichier de sortie
-NCDF_VARPUT, id3,'sossheig',vut, offset = [0, 0, jt]
-NCDF_VARPUT, id4,'sossheig',vvt, offset = [0, 0, jt]
-
-print,  jt
-
-ENDFOR
-; on ferme le NetCDF
-NCDF_CLOSE,id3
-NCDF_CLOSE,id4
-
-
-
-
-;     z_ext=[0.,200.,10]
-;    plt, vut, min=z_ext[0], max=z_ext[1], int=z_ext[2], window = 1.,cell_fill = 2,/landscape, $
-;           title=varname+' - Experiment-',lct=64, boite=[20, 380, -79, 90],  /nocontour
-; ;, $    vecteur = {u:vum0, v:vvm0},vectcolor = 0, vectmin = 0.01, normeref =200, $
-; ;    GRILLE = 'T', unvectsur = [n1, n2]
-
-;    plt, vvt, min=z_ext[0], max=z_ext[1], int=z_ext[2], window = 2.,cell_fill = 2,/landscape, $
-;           title=varname+' - Experiment-',lct=64, boite=[20, 380, -79, 90],  /nocontour
-; ;, $    vecteur = {u:vum, v:vvm},vectcolor = 0, vectmin = 0.01, normeref =200, $
-; ;    GRILLE = 'T', unvectsur = [n1, n2]
-
-
-
-; Nom
-;    iodir1 = '/home/alb/IDL_DATA/INTER/ESS/'
-;    idout = NCDF_CREATE(iodir1+'U_V_5d_1993_grid_T.nc',/clobber)
-;    print, 'Creation du fichier Netcdf'
-;    NCDF_CONTROL, idout, /nofill
-; Dimension
-;    xidout = NCDF_DIMDEF(idout, 'x', jpiglo)
-;    yidout = NCDF_DIMDEF(idout, 'y', jpjglo)
-;    didout = NCDF_DIMDEF(idout, 'deptht', 1)
-;    tidout = NCDF_DIMDEF(idout, 'time_counter', /unlimited)
-
-
-; Attributs globaux
-;    id0  = NCDF_VARDEF(idout, 'nav_lon'     , [xidout, yidout                ], /FLOAT)
-;    id1  = NCDF_VARDEF(idout, 'nav_lat'     , [xidout, yidout                ], /FLOAT)
-;    id2  = NCDF_VARDEF(idout, 'deptht'      , [                didout        ], /FLOAT)
-;    id3  = NCDF_VARDEF(idout, 'time_counter', [                        tidout], /DOUBLE)
-;    id4  = NCDF_VARDEF(idout, 'vozocrtx'    , [xidout, yidout,         tidout], /FLOAT)
-;    id5  = NCDF_VARDEF(idout, 'vomecrty'    , [xidout, yidout,         tidout], /FLOAT)
-; Variable 0
-;    NCDF_ATTPUT, idout, id0, 'units', 'degrees_east'
-;    NCDF_ATTPUT, idout, id0, 'long_name', 'Longitude'
-;    NCDF_ATTPUT, idout, id0, 'nav_model', 'Default grid'
-; Variable 1
-;    NCDF_ATTPUT, idout, id1, 'units', 'degrees_north'
-;    NCDF_ATTPUT, idout, id1, 'long_name', 'Latitude'
-;    NCDF_ATTPUT, idout, id1, 'nav_model', 'Default grid'
-; Variable 2
-;    NCDF_ATTPUT, idout, id2, 'units','meters'
-;    NCDF_ATTPUT, idout, id2, 'long_name','Depth'
-;    NCDF_ATTPUT, idout, id2, 'nav_model','Default grid'
-; Variable3
-;    NCDF_ATTPUT, idout, id3, 'units', 'seconds since 0001-01-01 00:00:00 '
-;    NCDF_ATTPUT, idout, id3, 'calendar','noleap'
-;    NCDF_ATTPUT, idout, id3, 'title', 'Time'
-;    NCDF_ATTPUT, idout, id3, 'long_name', 'Time axis'
-;    NCDF_ATTPUT, idout, id3, 'time_origin','0001-JAN-01 00:00:00'
-; Variable4
-;    NCDF_ATTPUT, idout, id4, 'units', 'm/s'
-;    NCDF_ATTPUT, idout, id4, 'title', 'vozocrtx'
-;    NCDF_ATTPUT, idout, id4, 'long_name', 'zonal current summmed on vertical'
-; Variable5
-;    NCDF_ATTPUT, idout, id5, 'units', 'm/s'
-;    NCDF_ATTPUT, idout, id5, 'title', 'vomecrty'
-;    NCDF_ATTPUT, idout, id5, 'long_name', 'meridian current summmed on vertical'
-
-;    NCDF_CONTROL, idout, /ENDEF
-
-; Creation de la longitude
-;    NCDF_VARPUT, idout, id0, glamt
-; Creation de la latitude
-;    NCDF_VARPUT, idout, id1, gphit
-; Creation de la profondeur
-;    prof=1.
-;    NCDF_VARPUT, idout, id2, prof
-; Creation du calendrier
-;   temps = findgen(jpt)*5.*86400. +julday(1, 1, 1)
-;    jpt = 73
-;    temps = findgen(jpt)
-;    print, temps
-;    NCDF_VARPUT, idout, id3, temps
-
-
-; Ecriture des donnees
-
-; Ecriture de la salinite de surface de Levitus
-
-;    NCDF_VARPUT, idout, id4 , vut, offset = [0, 0, jt]
-;    NCDF_VARPUT, idout, id5 , vvt, offset = [0, 0, jt]
-
-;    NCDF_CLOSE, idout
-
-
-
-
-
-
-END
Index: unk/README
===================================================================
--- /trunk/README	(revision 48)
+++ 	(revision )
@@ -1,112 +1,0 @@
-ETAPE 0 (rien a changer ici)
-=======
-1) lire B (champ magnetique), et les conductances: cond_sed, cond_oc, cond_tot, dans le  fichier condmag.nc- ce fichier a ete genere sous matlab M_lib4/geomag/MOED2D/ORCA_writenetcdf.m
-OK
-
-=======================================================================
-ETAPE 1 (a refaire pour toute nouvelle grille modele)
-========
-Cette etape consiste a interpoler sur la  grille ORCA2 (aux  points T)
-les champs B, SIGMAsed, qui ont ete crees dans un meme fichier netcdf
-lors de l'etape 0  (fichier condmag.nc).
-Pour ce faire, on suit pas a pas la doc de la routine SAXO 
-Voir toute la DOC de cette etape dans:
-http://www.lodyc.jussieu.fr/opa/INTERP/index.html
-
-On lance le programme comme ceci (cf la doc)
-idl
-@init_interp
-interpolation
-
-On va realiser 2 runs successifs de la routine d'interpolation: un
-passage pour le champ magnetique B (un fichier Br_ORCA2.nc est genere)
-et un deuxieme run  pour le champ de conductance (un  fichier
-cond_sed_ORCA2.nc est cree)
-
-Il faut donc faire quelque changements de configuration dans le
-fichiers suivant:
->> editer interp.pro=> changer le nom de la variable du  fichier condmag.nc a interpoler (fich cree sous matlab), L91:
-   zdata=ncdf_lec('/usr/work/sur/fvi/OPA/geomag/condmag.nc',var='Br')
->>editer naminterp.pro
-L67: ;   data_name = 'cond_sed'
-
->>init_path.pro
-L44   outputfile = 'cond_sed_ORCA2.nc'
-
-Le meshmask est different pour chaque grille model, penser a pointer
-vers le bon fichier (idem pour l'etape 3 plus bas)
-
-==========================================================================
-ETAPE 2: (a refaire pour toute nouvelle grille modele)
-========
-C'est l'etape de calcul des forcages geomagnetiques a partir des
-sorties ORCA et des fichiers Br et conductance. Le calcul est fait sur
-la grille modele pour que le calcul de divergence soit aussi precis
-que possible. Ce point est vraiment critique.
-
-Techniquement, tout se passe dans le fichier  forcagequimarche.pro
-On lance  idl puis:
-
-@init2
-.r forcagequimarche.pro
-forcagequimarche,'1993','01'
-
-et idem pour les autres annees: forcagequimarche,'1994','01'
-
-
-Pour info, voila ce que fait le programme:
------------------------------------------
-1-  calcul d'une matrice 3D de conductivite sigma=f(T,S) en fonction
-de T,S de ORCA2, sur la grille T.  Formule assez  empirique, en
-siemens/m que j'ai pondu apres regression: 
-sigma(T,S)=0.02047780622061 + 0.00273147624197*T + 0.00035133182334*T^2 + 0.09139808809909*S + 0.00241425798890*S*T -0.00023998958774*S^2
-
-2- Calcul du champ 2D de conductance de l'ocean par integration verticale 
-        /
-SIGMAoc=| sigma dz
-        /
-
-3- definir SIGMA=SIGMAsed+SIGMAoc
-
-
-4-  calculer 
-           /
-Bustar= B* | sigma * u /SIGMA dz
-           /
-           /
-Bvstar= B* | sigma * v /SIGMA dz
-           /
-
-5- calculer div(Bustar,Bvstar)  ---> utilise les  routines SAXO
-(tres legerement modifiees ici pour certaines d'entre elles (divfred,
-gradfred)
-
-
-
-========================================================================
-ETAPE 3 (a refaire pour chaque nouvelle grille)
-========
-On fait une Reverse  interpolation de la grille modele vers la grille
-geographique des fichiers crees a l'etape precedente (Divergence,
-Sigma, annee par annee)
-Pour cette etape, suivre pas a pas l'aide en ligne  sur:
-http://www.lodyc.jussieu.fr/opa/REVTERP/
-
-Il faut penser a:
-1- editer /usr/work/sur/fvi/OPA/geomag/INTERP2/naminterp2.pro
-et verifier le nom de la variable que l'on veut interpoler: p. ex
-name_input_field='Sigma'
-2- editer  /usr/work/sur/fvi/OPA/geomag/INTERP2/init_path2.pro  
-changer les  datafile (sortie de l'etape 2), outputfile et le cas
-echeant   input_dir, output_dir inputmesh weightfile
-
-Pour lancer, aller dans le repertoire INTERP2:
-cd /usr/work/sur/fvi/OPA/geomag/INTERP2
-
-Puis:
-> idl
-> @init
-> interp2
- 
-
-
Index: unk/angle.pro
===================================================================
--- /trunk/angle.pro	(revision 48)
+++ 	(revision )
@@ -1,92 +1,0 @@
-PRO angle, glamu, gphiu, glamv, gphiv, glamf, gphif, gsinu, gsinv, gcosu, gcosv
-;;;---------------------------------------------------------------------
-;;;
-;;;                       ROUTINE angle
-;;;                     *******************
-;;;
-;;;  Purpose :
-;;;  --------
-;;;     Compute angles between grid lines and direction of the North
-;;;
-;;   Method :
-;;   -------
-;;
-;;   Input :
-;;   ------
-;;      common
-;;            /comcoh/ glamf,   : longitudes and latitudes at F-points
-;;                     gphif
-;;
-;;   Output :
-;;   -------
-;;      common
-;;            /comcoh/ gsinu,gcosu : sinus and cosinus of the angle
-;;                     gsinv,gcosv   between north-south direction
-;;                                   and the j-direction of the mesh
-;;
-;;   Modifications:
-;;   --------------
-;;       Original :  96-07 (O. Marti)
-;;                   98-06 (G. Madec)
-;;                   99-11 (A. Jouzeau) : Adaptation to IDL
-;;----------------------------------------------------------------------
-;;----------------------------------------------------------------------
-;
-;;;---------------------------------------------------------------------
-;;;  OPA8, LODYC (1997)
-;;;---------------------------------------------------------------------
-;
-; I. Compute the cosinus and sinus
-; ================================
-;
-;     ... north pole direction & modulous (at u-point)
-      zxnpu = 0. - fsxspp( glamu, gphiu )
-      zynpu = 0. - fsyspp( glamu, gphiu )
-      znnpu = zxnpu*zxnpu + zynpu*zynpu
-;
-;     ... north pole direction & modulous (at v-point)
-      zxnpv = 0. - fsxspp( glamv, gphiv )
-      zynpv = 0. - fsyspp( glamv, gphiv )
-      znnpv = zxnpv*zxnpv + zynpv*zynpv
-;
-;     ... j-direction: f-point segment direction (u-point)
-      zxffu=  fsxspp( glamf, gphif ) - fsxspp( shift(glamf, 0, 1), shift(gphif, 0, 1) )
-      zyffu=  fsyspp( glamf, gphif ) - fsyspp( shift(glamf, 0, 1), shift(gphif, 0, 1) )
-      zmnpfu= sqrt ( znnpu * ( zxffu*zxffu + zyffu*zyffu )  )
-
-
-;
-;     ... i-direction: f-point segment direction (v-point)
-      zxffv=  fsxspp( glamf, gphif ) - fsxspp( shift(glamf, 1, 0), shift(gphif, 1, 0) )
-      zyffv=  fsyspp( glamf, gphif ) - fsyspp( shift(glamf, 1, 0), shift(gphif, 1, 0) )
-      zmnpfv= sqrt ( znnpv * ( zxffv*zxffv + zyffv*zyffv )  )
-
-;
-;     ... cosinus and sinus using scalar and vectorial products
-      gsinu = ( zxnpu*zyffu - zynpu*zxffu ) / zmnpfu
-      gcosu = ( zxnpu*zxffu + zynpu*zyffu ) / zmnpfu
-
-
-;
-;     ... cosinus and sinus using scalar and vectorial products
-;     (caution, rotation of 90 degres)
-      gsinv = ( zxnpv*zxffv + zynpv*zyffv ) / zmnpfv
-      gcosv =-( zxnpv*zyffv - zynpv*zxffv ) / zmnpfv
-
-
-;
-;
-;     II. Geographic mesh
-;     ===================
-;
-;
-      ind = where(abs(glamf-shift(glamf, 0, 1)) LT 1.e-8)
-      gsinu(ind) = 0.d
-      gcosu(ind) = 1.d
-;
-      ind = where(abs(gphif-shift(gphif, 1, 0)) LT 1.e-8)
-      gsinv(ind) = 0.d
-      gcosv(ind) = 1.d
-;
-return
-END
Index: unk/common_interp.pro
===================================================================
--- /trunk/common_interp.pro	(revision 48)
+++ 	(revision )
@@ -1,32 +1,0 @@
-;+
-;
-; @history
-; 11/99 A. Jouzeau
-; 10/2001 R. Hordoir, Added variables for
-; boundary conditions
-; 02/2002 R. Hordoir, Added North Pole Treatment
-; 03/2003 R. Hordoir, Added variables for
-; irregular input grid
-;
-;-
-;-----------------------------------------------------------------------
-;            COMMON OF THE INTERPOLATION PROGRAM                       *
-;-----------------------------------------------------------------------
-COMMON input_grid, jpiatm, jpjatm, south_lat, west_lon, dx, phi_input, phi_input_u, phi_input_v, $
- pres_x, pres_y, ext_x, ext_y, lonatm, latatm, $
- nstep, nit000, nitend, datadept, $
- units, key_2d, lon_shift, x_axis,y_axis, y_axis_u, y_axis_v
-COMMON mutiple, add_offset, scale_factor, key_vari
-COMMON missing, nmiss, missing_val
-COMMON output_grid, jpioce, jpjoce, lon_u, lat_u, lon_v, lat_v, lon_f, lat_f, lon_t, lat_t, $
- outdept
-COMMON tridim, jpkatm, jpkoce
-COMMON paths, input_dir, output_dir, datafile, data_u_file, data_v_file, maskfile, gridfile, $
- outputfile, outputfile_x, outputfile_y
-COMMON datas, data_name, data_u_name, data_v_name, mask_name, lon_name, lon_u_name, $
- lon_v_name, lon_f_name, lat_name, lat_u_name, lat_v_name, lat_f_name, $
- datadept_name, outdept_name, time_name
-COMMON numid, nummsh, nummsk, numdta, numdta_u, numdta_v, numout
-COMMON param, nfil, ndim, nscal, ninterp, ndraw, modlam, nreverse, ndep, keydraw, nlevel, $
- key_mask, key_ps,north_pole
-COMMON perfs, key_performance
Index: unk/condmag_from_orca.pro
===================================================================
--- /trunk/condmag_from_orca.pro	(revision 48)
+++ 	(revision )
@@ -1,438 +1,0 @@
-;+
-;
-; @file_comments
-; interpolate cond_sed_<emph>orcares<emph>.nc and Br_<emph>orcares<emph>.nc
-; and produce condmag_from_<emph>orcares<emph>.nc file
-;
-; condmag_from_<emph>orcares<emph>.nc might be compare to condmag.nc
-;
-; NB : cond_oc and cond_tot won't be reproduced
-; ++ should I write missing values ?
-;
-; inverse of <progeomag>condmag_on_orca</progeomag>
-;
-; @categories
-; interpolation, orca grid
-;
-; @param orcares {in}{required}{type=string}
-; code of ORCA grid to use for output results
-; must be 'ORCA2' or 'ORCA025'
-;
-; @param method {in}{required}{type=string}
-; code for interpolation method
-; must be 'bilinear'
-; parameter is therefore here to be visible. see restrictions below.
-;
-; @param gridtype {in}{required}{type=string}
-; to specify on which grid we do the interpolation T, U, V
-; must belong to T, U or V
-; ++ je ne sais pas comment ce paramÃštre doit intervenir
-;
-; @keyword DRAKKAR_EXP
-; code for Drakkar experiment
-; only used when orcares = ORCA025
-; must be G42 ++ G70
-; ++ je ne sais pas comment ce paramÃštre doit intervenir a priori
-; la partie mesh est la mÃªme pour toutes les expÃ©riences mais attention
-; pas forcÃ©ment le mask.
-;
-; @keyword PERF
-; if set activate performance with <proidl>profiler</proidl>
-; PERF vs key_performance dans les commons
-;
-; @restrictions
-;  - Requires <a href="http://forge.ipsl.jussieu.fr/saxo/">SAXO</a>
-;  - won't be relevant if 'imoms3' was used as interpolation method in
-; <progeomag>condmag_on_orca</progeomag>
-;
-; @todo
-; add version variable inside code
-; provide tools to plot output files
-; produce a NetCDF GDT or CF compliant
-;
-; @pre
-; see geomag_profile.sh
-;
-; be sure to have cond_sed_*.nc and Br_*.nc in the directory defined
-; in ${GEOMAG_ID}/
-; be sure to have condmag.nc in the directory defined
-; in ${GEOMAG_ID}/
-; be sure to not have condmag_from_*.nc in the directory defined in
-; ${GEOMAG_OD}/
-; be sure to have meshmask of ORCA grid you choose in the directory defined in
-; ${GEOMAG_ID}/
-; for ORCA2 filename is meshmask_bab.nc
-; ++ au pif entre mesh_hgr, mesh_zgr et mask
-; for ORCA025 filename is ORCA025-G42_mesh_hgr.nc
-;
-; @post
-; see geomag_profile.sh
-; condmag_from_orcares.nc is now present in ${GEOMAG_OD}/
-;
-; @examples
-; IDL> .run condmag_from_orca
-; IDL> condmag_from_orca, 'ORCA2', 'bilinear','T'
-;
-; @history
-; reee522 2007-06-06T15:14:24Z rhodes (IRIX64)
-; replace call of initorca2_bab by initocemesh
-; reee522 2007-06-06T14:57:39Z rhodes (IRIX64)
-; correction for DRAKKAR_EXP usage
-; fplod 2007-03-21T13:23:55Z aedon.locean-ipsl.upmc.fr (Darwin)
-; create from condmag_on_orca to validate step1 of GEOMAG
-;
-; @version
-; $Id$
-;
-;-
-PRO condmag_from_orca, orcares, method, gridtype, DRAKKAR_EXP = drakkar_exp, PERF = perf
-;
-    compile_opt idl2, strictarrsubs
-    ;
-    IF keyword_set(perf) EQ 1 THEN BEGIN
-        msg = 'iii : start profiler'
-        ras = report(msg)
-        ;PROFILER, /SYSTEM & PROFILER
-        PROFILER, /SYSTEM & PROFILER
-        ; ++ ne tracera que les modules compilÃ©s au moment de l'appel Ã  cette commande
-        ; donc ++ regarder si on a bien tout et si on doit ajouter des PROFILER,toto dans
-        ; tous les modules
-    ENDIF
-        ;
-        ;----
-        ; check input parameters
-        ;----
-        ;
-        ; check orcares definition
-        ;
-        CASE orcares OF
-           'ORCA2': BEGIN
-                     msg = 'iii : valid orcares parameter = ' + orcares
-                     ras = report(msg)
-                     filename_oce = 'meshmask_bab.nc'
-                     IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                        msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp
-                        ras = report(msg)
-                     END
-                  END
-         'ORCA025': BEGIN
-                     msg = 'iii : valid orcares parameter = ' + orcares
-                     ras = report(msg)
-                     IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                        msg = 'iii : DRAKKAR_EXP keyword set'
-                        ras = report(msg)
-                        msg = 'iii : DRAKKAR_EXP = ' + drakkar_exp
-                        ras = report(msg)
-                        CASE drakkar_exp OF
-                           'G42' : BEGIN
-                                      msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                      ras = report(msg)
-                                   END
-                           'G70' : BEGIN
-                                      msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                      ras = report(msg)
-                                   END
-                           ELSE : BEGIN
-                                      msg = 'eee : invalid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                      ras = report(msg)
-                                      RETURN
-                                  END
-                        ENDCASE
-                        filename_oce = orcares + '-' + drakkar_exp + '_mesh_hgr.nc'
-                     ENDIF ELSE BEGIN
-                        msg = 'eee : unset DRAKKAR_EXP keyword'
-                        ras = report(msg)
-                        msg = 'eee : orcares must be G42 or G70'
-                        ras = report(msg)
-                        RETURN
-                     ENDELSE
-                  END
-          ELSE : BEGIN
-                     msg = 'eee : invalid orcares parameter = ' + orcares
-                     ras = report(msg)
-                     msg = 'eee : orcares must be ORCA2 or ORCA025'
-                     ras = report(msg)
-                     RETURN
-                  END
-      ENDCASE
-        ;
-        ; check method definition
-      CASE method OF
-         'bilinear': BEGIN
-                        msg = 'iii : valid method parameter = ' + method
-                        ras = report(msg)
-                     END
-         ELSE      : BEGIN
-                        msg = 'eee : invalid method parameter = ' + method
-                        ras = report(msg)
-                        msg = 'eee : method must be bilinear'
-                        ras = report(msg)
-                        RETURN
-                     END
-      ENDCASE
-        ;
-        ; check gridtype definition
-      gridtype = strupcase(gridtype)
-      CASE gridtype OF
-         'T' : BEGIN
-                  msg = 'iii : valid gridtype parameter = ' + gridtype
-                  ras = report(msg)
-               END
-         'U' : BEGIN
-                  msg = 'iii : valid gridtype parameter = ' + gridtype
-                  ras = report(msg)
-               END
-         'V' : BEGIN
-                  msg = 'iii : valid gridtype parameter = ' + gridtype
-                  ras = report(msg)
-               END
-         ELSE : BEGIN
-                  msg = 'eee : invalid gridtype parameter = ' + gridtype
-                  ras = report(msg)
-                  msg = 'eee : gridtype must be T, U or V'
-                  ras = report(msg)
-                  RETURN
-         END
-    ENDCASE
-        ;
-        ; check for input files
-        ;
-        ; test if ${GEOMAG_ID} defined
-        geomag_id_env=GETENV('GEOMAG_ID')
-        CASE geomag_id_env OF
-         ''  :  BEGIN
-                  msg = 'eee : ${GEOMAG_ID} is not defined'
-                  ras = report(msg)
-                  RETURN
-                END
-         ELSE: BEGIN
-                 msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env
-                 ras = report(msg)
-               END
-        ENDCASE
-        ;
-        iodirin = isadirectory(geomag_id_env)
-        ;
-        ; existence and protection of ${GEOMAG_ID}
-        IF (FILE_TEST(iodirin, /DIRECTORY,/EXECUTABLE , /READ) EQ 0) THEN BEGIN
-           msg = 'eee : the directory' + iodirin  + ' is not accessible.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; build input filenames
-        filename_cond_sed = 'cond_sed' + '_' + orcares +'.nc'
-        fullfilename_cond_sed = iodirin + filename_cond_sed
-        ;
-        ; check if this file exists
-        fullfilename_cond_sed = isafile(iodirin + filename_cond_sed, NEW=0,/MUST_EXIST)
-        IF fullfilename_cond_sed[0] EQ '' THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_cond_sed + ' was not found.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; protection
-        IF (FILE_TEST(fullfilename_cond_sed[0], /READ) EQ 0) THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_cond_sed[0] + ' is not readable.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        filename_Br = 'Br' + '_' + orcares +'.nc'
-        fullfilename_Br = iodirin + filename_Br
-        ;
-        ; check if this file exists
-        fullfilename_Br = isafile(iodirin + filename_Br, NEW=0,/MUST_EXIST)
-        IF fullfilename_Br[0] EQ '' THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_Br + ' was not found.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; protection
-        IF (FILE_TEST(fullfilename_Br[0], /READ) EQ 0) THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_Br[0] + ' is not readable.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; mesh mask
-        ; check if this file exists
-        fullfilename_oce = isafile(iodirin + filename_oce, NEW=0, /MUST_EXIST, $
-                           RECURSIVE=0)
-        IF fullfilename_oce[0] EQ '' THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_oce + ' was not found.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; protection
-        IF (FILE_TEST(fullfilename_oce[0], /READ) EQ 0) THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_oce[0] + ' is not readable.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        filename_condmag = 'condmag.nc'
-        fullfilename_condmag = iodirin + filename_condmag
-        ;
-        ; check if this file exists
-        fullfilename_condmag = isafile(iodirin + filename_condmag, NEW=0,/MUST_EXIST)
-        IF fullfilename_condmag[0] EQ '' THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_condmag + ' was not found.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; protection
-        IF (FILE_TEST(fullfilename_condmag[0], /READ) EQ 0) THEN BEGIN
-           msg = 'eee : the file ' + fullfilename_condmag[0] + ' is not readable.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; test if ${GEOMAG_OD} defined
-        geomag_od_env=GETENV('GEOMAG_OD')
-        CASE geomag_od_env OF
-           '' : BEGIN
-                   msg = 'eee : ${GEOMAG_OD} is not defined'
-                   ras = report(msg)
-                   RETURN
-                END
-           ELSE: BEGIN
-                   msg = 'iii : ${GEOMAG_OD} is ' + geomag_od_env
-                   ras = report(msg)
-                 END
-        ENDCASE
-        ;
-        ; check if output data will be possible
-        iodirout = isadirectory(geomag_od_env)
-        ;
-        ; existence and protection
-        IF (FILE_TEST(iodirout, /DIRECTORY,/WRITE) EQ 0) THEN BEGIN
-           msg = 'eee : the directory' + iodirout  + ' was not found.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ; build output filename
-        filename = 'condmag_from_' +  orcares +'.nc'
-        fullfilename = iodirout + filename
-        ;
-        ; in order to avoid unexpected overwritten
-        IF (FILE_TEST(fullfilename) EQ 1) THEN BEGIN
-           msg = 'eee : the file ' + fullfilename  + ' already exists.'
-           ras = report(msg)
-           RETURN
-        ENDIF
-        ;
-        ;----
-        ; Oceanic grid parameters ie input grid + mask
-        ;----
-        ;
-        initocemesh, orcares, DRAKKAR_EXP = drakkar_exp
-        ;
-        ;----
-        ; read data to interpolate on regular grid
-        ;----
-        ;
-    a=read_ncdf('cond_sed', 0, /timestep, $
-    file = fullfilename_cond_sed[0], /nostruct)
-    msg = 'iii : ' + fullfilename_cond_sed[0] + ' opened for read'
-    ras = report(msg)
-        ; mask and limite cond_sed on values below 5000 ++
-    cond_sedin = extrapsmooth(a, tmask[*, *, 0]*(a le 5000), /x_periodic)
-        ;
-    b = read_ncdf('Br', 0, /timestep, $
-    file = fullfilename_Br[0], /nostruct)
-    msg = 'iii : ' + fullfilename_Br[0] + ' opened for read'
-    ras = report(msg)
-        ; mask and limit Br on values below/above ++
-    Brin = extrapsmooth(b, tmask[*, *, 0]*(b), /x_periodic)
-        ;
-    glamin = glamt
-    gphiin = gphit
-    maskin = tmask[*, *, 0]
-        ;
-        ;---
-        ; conductivity and magnetic field grid parameters ie output grid
-        ;----
-
-    initncdf, fullfilename_condmag[0], xaxisname = 'lo', yaxisname = 'la'
-    msg = 'iii : ' + fullfilename_condmag[0] + ' opened for read'
-    ras = report(msg)
-        ;
-    glamout = glamt
-    gphiout = gphit
-        ;
-
-    dimidxout = jpi
-    dimidyout = jpj
-    ;
-    ;---------------
-    ; Interpolate
-    ;---------------
-    ;++ cond_sedout = fromirr('bilinear', cond_sedin, glamin, gphiin, maskin,  glamout, gphiout, -1,  WEIG = weights, ADDR = addresses)
-cond_sedout=dindgen(dimidxout,dimidyout)
-    ;Brout=fromirr('bilinear', Brin, weights, addresses) ; ++ pb doc % Variable is undefined: LONOUT
-    ;++Brout = fromirr('bilinear', Brin, glamin, gphiin, maskin,  glamout, gphiout, -1,  WEIG = weights, ADDR = addresses)
-    ;
-Brout=dindgen(dimidxout,dimidyout)
-
-    ;
-    ;---------------
-    ; Produce outputs
-    ;---------------
-    ;
-    netcdf_id = NCDF_CREATE(fullfilename, /clobber)
-    NCDF_CONTROL, netcdf_id, /NOFILL
-    ;
-    ; dimension
-    dimidxout = NCDF_DIMDEF(netcdf_id, 'la' ,  jpi)
-    dimidyout = NCDF_DIMDEF(netcdf_id, 'lo' ,  jpj)
-    ;
-    ; global attributes
-    NCDF_ATTPUT, netcdf_id, 'Conventions', 'GDT 1.2', /GLOBAL ; ++ conformite
-    ;++  NCDF_ATTPUT, netcdf_id, 'file_name'  , filename, /GLOBAL
-    ;++  NCDF_ATTPUT, netcdf_id, 'Title'      , title, /GLOBAL
-    ;
-    ; declaration of variables
-    varid = lonarr(4)
-    ;
-    varid[0] = NCDF_VARDEF(netcdf_id, 'la'  , [dimidxout], /FLOAT)
-    varid[1] = NCDF_VARDEF(netcdf_id, 'lo'  , [dimidyout], /FLOAT)
-    varid[2] = NCDF_VARDEF(netcdf_id, 'cond_sed'  , [dimidxout, dimidyout], /FLOAT)
-    NCDF_ATTPUT, netcdf_id, varid[2], 'units'    , 'siemens'
-    varid[3] = NCDF_VARDEF(netcdf_id, 'Br'  , [dimidxout, dimidyout], /FLOAT)
-    NCDF_ATTPUT, netcdf_id, varid[3], 'units'    , 'siemens'
-    ;
-    NCDF_CONTROL, netcdf_id, /ENDEF
-    ;
-    NCDF_VARPUT, netcdf_id, varid[0], dindgen(dimidxout,dimidyout)
-    NCDF_VARPUT, netcdf_id, varid[1], dindgen(dimidyout,dimidyout)
-    ;
-    ; write the data
-    ;
-    NCDF_VARPUT, netcdf_id, varid[2], cond_sedout
-    ;++  NCDF_VARPUT, netcdf_id, 'Br', Brout
-    ;---------------------------
-    ; close the netcdf files
-    NCDF_CLOSE, netcdf_id
-    ;
-    msg = 'iii : ' + fullfilename + ' created'
-    ras = report(msg)
-    ;
-    IF keyword_set(perf) EQ 1 THEN BEGIN
-        msg = 'iii : report profiler results'
-        ras = report(msg)
-        ; ++ tri par ordre alpha , par ordre de pourcentage croissant ou dÃ©croissant
-        ; +++ d'utilisation
-        profiler,/REPORT
-        ;  shut down all profiling (according to
-        ; http://www.dfanning.com/code_tips/whyslow.html)
-        profiler, /CLEAR, /SYSTEM
-        profiler, /CLEAR, /RESET
-ENDIF
-    ;
-END
Index: unk/condmag_on_orca.pro
===================================================================
--- /trunk/condmag_on_orca.pro	(revision 48)
+++ 	(revision )
@@ -1,357 +1,0 @@
-;+
-;
-; @file_comments
-; interpolate condmag.nc file (sediment and magnetic fields) on ORCA grid
-; and produce cond_sed_<orcares>.nc and Br_<orcares>.nc
-;
-; @categories
-; interpolation, orca grid
-;
-; @param orcares {in}{required}{type=string}
-; code of ORCA grid to use for output results
-; must be 'ORCA2' or 'ORCA025'
-;
-; @param method {in}{required}{type=string}
-; code for interpolation method
-; must be 'bilinear' or 'imoms3'
-; in fact bilinear is used in this geomag project
-; ++ est-ce que ce sera tjs vrai ?
-;
-; @param gridtype {in}{required}{type=string}
-; to specify on which grid we do the interpolation T, U, V
-; must belong to T, U or V
-;
-; @keyword DRAKKAR_EXP {type=string}
-; code for Drakkar experiment
-; only used when orcares = ORCA025
-; must be G42 ++ G70
-;
-; @restrictions
-;  - Requires SAXO tools
-;
-; @todo
-; provide tools to plot output files
-; produce a NetCDF GDT or CF compliant
-; use <pro>fromreg</pro>
-;
-; @pre
-; see geomag_profile.sh
-; be sure to have condmag.nc in the directory defined in
-; ${GEOMAG_ID}/
-; be sure to have meshmask of ORCA grid you choose in the directory defined in
-; ${GEOMAG_ID}/
-; for ORCA2 filename is meshmask_bab.nc
-; ++ au pif entre mesh_hgr, mesh_zgr et mask
-; for ORCA025 filename is ORCA025-G42_mesh_hgr.nc
-;
-; @post
-; see geomag_profile.sh
-; cond_sed_<I>orcasres</I>.nc is now present in ${GEOMAG_OD}/
-; Br_<I>orcasres</I>.nc is now present in ${GEOMAG_OD}/
-;
-; @examples
-; IDL> .run condmag_on_orca
-; IDL> condmag_on_orca, 'ORCA2', 'bilinear','T'
-;
-; @history
-; reee522 2007-06-06T14:57:39Z rhodes (IRIX64)
-; correction for DRAKKAR_EXP usage
-; reee522 2006-12-13T13:50:32Z rhodes (IRIX64)
-; add optional keyword drakkar_exp
-; reee522 2006-12-13T12:09:05Z rhodes (IRIX64)
-; externalisation of netcdf writing
-; reee522 2006-11-23T13:34:31Z rhodes (IRIX64)
-; add ORCA025 (beginning)
-; reee522 2006-11-23T13:28:07Z rhodes (IRIX64)
-; information about the opening of meshmask file was missing ... because
-; the open is hidden in the call of get_gridparam
-; fplod 2006-11-23T08:57:10Z aedon.locean-ipsl.upmc.fr (Darwin)
-; rename to condmag_on_orca.pro
-; fplod 2006-11-22T15:10:31Z aedon.locean-ipsl.upmc.fr (Darwin)
-; add creation of Br_<I>orcasres</I>.nc
-; ++ not very beautifuly implemented
-; fplod 2006-11-22T10:38:51Z aedon.locean-ipsl.upmc.fr (Darwin)
-; always use msg = 'iii : ...' or msg = 'eee : ...'
-; information on open io
-; fplod 2006-11-20T10:32:02Z aedon.locean-ipsl.upmc.fr (Darwin)
-; cleaning before introduction into svn repository
-; fplod 2006-03-23T13:05:39Z aedon.lodyc.jussieu.fr (Darwin)
-; cond_sed_ORCA2 presque ok manque attributes min/max de cond_sed
-; fplod 2006-03-22T09:35:42Z aedon.lodyc.jussieu.fr (Darwin)
-; created from
-; /Users/fplod/incas/seb/DORAEMON/wind/idl/quikscat_to_orca_scalar.pro written
-; by Sebastien Masson
-; to reproduce  /usr/work/sur/fvi/OPA/geomag/cond_sed_ORCA2.nc
-; main differences : no yyyy parameter, no time loop, no mask and no missing
-; values (++ to be checked ) in data input (condmag.nc), no scale factor,
-; no OFFSET, no save of weight and addresses
-;
-; @version
-; $Id$
-;
-;-
-PRO condmag_on_orca, orcares, method, gridtype, DRAKKAR_EXP = drakkar_exp
-    ;
-    compile_opt idl2, strictarrsubs
-    ;
-    ;----
-    ; check input parameters
-    ;----
-    ;
-    ; check orcares definition
-    ;
-    CASE orcares OF
-       'ORCA2': BEGIN
-                 msg = 'iii : valid orcares parameter = ' + orcares
-                 ras = report(msg)
-                 filename_oce = 'meshmask_bab.nc'
-                 IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                    msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp
-                    ras = report(msg)
-                 END
-              END
-       'ORCA025': BEGIN
-                   msg = 'iii : valid orcares parameter = ' + orcares
-                 ras = report(msg)
-                 IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                    msg = 'iii : DRAKKAR_EXP keyword set'
-                    ras = report(msg)
-                    msg = 'iii : DRAKKAR_EXP = ' + drakkar_exp
-                    ras = report(msg)
-                    CASE drakkar_exp OF
-                       'G42' : BEGIN
-                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                  ras = report(msg)
-                               END
-                       'G70' : BEGIN
-                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                  ras = report(msg)
-                               END
-                       ELSE : BEGIN
-                                  msg = 'eee : invalid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                  ras = report(msg)
-                                  RETURN
-                              END
-                    ENDCASE
-                    filename_oce = orcares + '-' + drakkar_exp + '_mesh_hgr.nc'
-                 ENDIF ELSE BEGIN
-                    msg = 'eee : unset DRAKKAR_EXP keyword'
-                    ras = report(msg)
-                    msg = 'eee : orcares must be G42 or G70'
-                    ras = report(msg)
-                    RETURN
-                 ENDELSE
-              END
-        ELSE : BEGIN
-                 msg = 'eee : invalid orcares parameter = ' + orcares
-                 ras = report(msg)
-                 msg = 'eee : orcares must be ORCA2 or ORCA025'
-                 ras = report(msg)
-                 RETURN
-        END
-    ENDCASE
-    ;
-    ; check method definition
-    CASE method OF
-       'bilinear': BEGIN
-                    msg = 'iii : valid method parameter = ' + method
-                    ras = report(msg)
-                 END
-     'imoms3'  : BEGIN
-                    msg = 'iii : valid method parameter = ' + method
-                    ras = report(msg)
-                 END
-       ELSE      : BEGIN
-                    msg = 'eee : invalid method parameter = ' + method
-                    ras = report(msg)
-                    msg = 'eee : method must be bilinear or imoms3'
-                    ras = report(msg)
-                    RETURN
-                 END
-    ENDCASE
-    ;
-    ; check gridtype definition
-    gridtype = strupcase(gridtype)
-    CASE gridtype OF
-       'T' : BEGIN
-              msg = 'iii : valid gridtype parameter = ' + gridtype
-              ras = report(msg)
-           END
-     'U' : BEGIN
-              msg = 'iii : valid gridtype parameter = ' + gridtype
-              ras = report(msg)
-           END
-     'V' : BEGIN
-              msg = 'iii : valid gridtype parameter = ' + gridtype
-              ras = report(msg)
-           END
-     ELSE : BEGIN
-              msg = 'eee : invalid gridtype parameter = ' + gridtype
-              ras = report(msg)
-              msg = 'eee : gridtype must be T, U or V'
-              ras = report(msg)
-              RETURN
-           END
-    ENDCASE
-    ;
-    ; check for input files
-    ;
-    ; test if ${GEOMAG_ID} defined
-    geomag_id_env=GETENV('GEOMAG_ID')
-    CASE geomag_id_env OF
-       ''  :  BEGIN
-              msg = 'eee : ${GEOMAG_ID} is not defined'
-              ras = report(msg)
-              RETURN
-            END
-     ELSE: BEGIN
-             msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env
-             ras = report(msg)
-           END
-    ENDCASE
-    ;
-    iodirin = isadirectory(geomag_id_env)
-    ;
-    ; existence and protection of ${GEOMAG_ID}
-    IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN
-       msg = 'eee : the directory' + iodirin  + ' is not accessible.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; conductivity and magnetic field
-    filename_condmag = 'condmag.nc'
-    ;
-    ; check if this file exists
-    fullfilename_condmag = isafile(iodirin + filename_condmag, NEW=0, /MUST_EXIST)
-    IF fullfilename_condmag[0] EQ '' THEN BEGIN
-       msg = 'eee : the file ' + fullfilename_condmag + ' was not found.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; protection
-    IF (FILE_TEST(fullfilename_condmag[0], /READ) EQ 0) THEN BEGIN
-       msg = 'eee : the file ' + fullfilename_condmag[0] + ' is not readable.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; mesh mask
-    ; check if this file exists
-    fullfilename_oce = isafile(iodirin + filename_oce, NEW=0, /MUST_EXIST, $
-    RECURSIVE=0)
-    IF fullfilename_oce[0] EQ '' THEN BEGIN
-       msg = 'eee : the file ' + fullfilename_oce + ' was not found.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; protection
-    IF (FILE_TEST(fullfilename_oce[0], /READ) EQ 0) THEN BEGIN
-       msg = 'eee : the file ' + fullfilename_oce[0] + ' is not readable.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; test if ${GEOMAG_OD} defined
-    geomag_od_env=GETENV('GEOMAG_OD')
-    CASE geomag_od_env OF
-       '' : BEGIN
-               msg = 'eee : ${GEOMAG_OD} is not defined'
-               ras = report(msg)
-             RETURN
-          END
-       ELSE: BEGIN
-               msg = 'iii : ${GEOMAG_OD} is ' + geomag_od_env
-             ras = report(msg)
-           END
-    ENDCASE
-    ;
-    ; check if output data will be possible
-    iodirout = isadirectory(geomag_od_env)
-    ;
-    ; existence and protection
-    IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN
-       msg = 'eee : the directory' + iodirout  + ' was not found.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; d'aprÃšs ncdump -h /usr/work/sur/fvi/OPA/geomag/condmag.nc
-    condmaglonname = 'lo'
-    condmaglatname = 'la'
-    ;
-    ;----
-    ; conductivity and magnetic field grid parameters
-    ;----
-    ;
-    get_gridparams, fullfilename_condmag[0], $
-    condmaglonname, condmaglatname, $
-    condmaglon, condmaglat, jpia, jpja, 1, /DOUBLE
-    ;
-    ;----
-    ; Oceanic grid parameters
-    ;----
-    ;
-    olonname = 'glam' + STRLOWCASE(gridtype)
-    olatname = 'gphi' + STRLOWCASE(gridtype)
-    get_gridparams, fullfilename_oce[0], $
-    olonname, olatname, $
-    olon, olat, jpio, jpjo, 2, /DOUBLE
-    msg = 'iii : ' + fullfilename_oce[0] + ' opened for read'
-    ras = report(msg)
-    ;
-    ;---------------
-    ; Compute weight and address
-    ;---------------
-    ;
-    CASE method OF
-       'bilinear': compute_fromreg_bilinear_weigaddr, $
-                      condmaglon, condmaglat, olon, olat, weig, addr
-       'imoms3'  : compute_fromreg_imoms3_weigaddr, $
-                    condmaglon, condmaglat, olon, olat, weig, addr
-    ENDCASE
-    ;
-    ; reading condmag file
-    netcdf_id_condmag = NCDF_OPEN(fullfilename_condmag[0], /NOWRITE)
-    msg = 'iii : ' + fullfilename_condmag[0] + ' opened for read'
-    ras = report(msg)
-    ;
-    varname_cond_sed = 'cond_sed'
-    varname_br = 'Br'
-    ;
-    varinq_cond_sed = NCDF_VARINQ(netcdf_id_condmag, varname_cond_sed)
-    NCDF_VARGET, netcdf_id_condmag, varname_cond_sed, varin_cond_sed
-    ;
-    varinq_br = NCDF_VARINQ(netcdf_id_condmag, varname_br)
-    NCDF_VARGET, netcdf_id_condmag, varname_br, varin_br
-    ;
-    NCDF_CLOSE, netcdf_id_condmag
-    ;
-    ;---------------------------
-    ; do the interpolation
-    varin_cond_sed = TOTAL(weig*varin_cond_sed[addr], 1)
-    varin_cond_sed = REFORM(varin_cond_sed, jpio, jpjo, /OVER)
-    varin_br = TOTAL(weig*varin_br[addr], 1)
-    varin_br = REFORM(varin_br, jpio, jpjo, /OVER)
-    ;
-    varout_cond_sed = TEMPORARY(varin_cond_sed)
-    varout_br = TEMPORARY(varin_br)
-    ;
-    ; put back the masked value
-    ;++      IF bad[0] NE -1 THEN varout_cond_sed[TEMPORARY(bad)] = 32767
-    ;++      IF bad[0] NE -1 THEN varout_br[TEMPORARY(bad)] = 32767
-    ;
-    ;
-    ; produce outputs
-    condmag_output, orcares, $
-    varinq_cond_sed, 'Conductance', 'Conductance', 'siemens', $
-    jpio, jpjo, olon, olat, $
-    varout_cond_sed
-    condmag_output, orcares, $
-    varinq_br, 'Magnetic field', 'magnetic field', 'tesla', $
-    jpio, jpjo, olon, olat, $
-    varout_br
-    ;
-END
Index: unk/condmag_output.pro
===================================================================
--- /trunk/condmag_output.pro	(revision 48)
+++ 	(revision )
@@ -1,358 +1,0 @@
-;+
-;
-; @file_comments
-; produce cond_sed_<orcares>.nc or Br_<orcares>.nc
-; dependent on orcares and variable parameters
-;
-; @categories
-; output, netcdf
-;
-; @param orcares {in}{required}{type=string}
-; code of ORCA grid to use for output results
-; must be 'ORCA2' or 'ORCA025'
-;
-; @param variable {in}{required}{type=structure return by NCDF_VARINQ}
-; { NAME:"", DATATYPE:"", NDIMS:0L, NATTS:0L, DIM:LONARR(NDIMS) }
-; variable of condmag.nc to be written
-; variable.NAME must be 'cond_sed' or 'Br'
-;
-; @param title {in}{required}{type=string}
-; title must belong_name 'Conductance' or 'Magnetic_field' ++
-;
-; @param long_name {in}{required}{type=string}
-; long_name must be 'Conductance' or 'magnetic_field' ++
-;
-; @param units {in}{required}{type=string}
-; units must be 'siemens' or 'tesla'
-;
-; @param jpio {in}{required}{type=integer}
-; x dimension of the 3d array to be written
-; must be greater than 1
-;
-; @param jpjo {in}{required}{type=integer}
-; y dimension of the 3d array to be written
-; must be greater than 1
-;
-; @param olon {in}{required}{type=1d array of floats}
-; x++ longitude values
-; must be ++
-;
-; @param olat {in}{required}{type=1d array of floats}
-; x++ latitude values
-; must be ++
-;
-; @param values {in}{required}{type=nd array of variable.DATATYPE}
-; values of the variable to be written
-; ++ must be
-;
-; @restrictions
-;  - Requires SAXO tools
-;
-; @todo
-; produce a NetCDF GDT or CF compliant
-; check if jpio and jpjo are not present in some "common" after getgridparam
-; in order to remove them from parameters
-;
-; @pre
-; reading of condmag.nc
-; see condmag_on_orca.pro
-;
-; @post
-; cond_sed_<I>orcasres</I>.nc is now present in ${GEOMAG_OD}/
-; or
-; Br_<I>orcasres</I>.nc is now present in ${GEOMAG_OD}/
-; see geomag_env.sh
-;
-; @examples
-; IDL> .run condmag_on_orca
-; IDL> condmag_output, 'ORCA2', 'cond_sed', 'Conductance', 'Conductance', 'siemens', jpio, jpjo, olon, olat, values
-;
-; @history
-; reee522 2006-12-13T11:44:19Z rhodes (IRIX64)
-; add attributes in parameters list
-; reee522 2006-11-28T14:07:32Z rhodes (IRIX64)
-; written from current release of condmag_on_orca.pro
-;
-; @version
-; $Id$
-;
-;-
-PRO condmag_output, orcares, variable, title, long_name, units, jpio, jpjo, olon, olat, values
-    ;
-    compile_opt idl2, strictarrsubs
-    ;
-    ;----
-    ; check input parameters
-    ;----
-    ;
-    ; check orcares definition
-    ;
-    CASE orcares OF
-        'ORCA2': BEGIN
-                 msg = 'iii : valid orcares parameter = ' +  orcares
-                 ras = report(msg)
-         END
-        'ORCA025': BEGIN
-                 msg = 'iii : valid orcares parameter = ' +  orcares
-                 ras = report(msg)
-         END
-         ELSE : BEGIN
-                 msg = 'eee : invalid orcares parameter = ' + orcares
-                 ras = report(msg)
-                 msg = 'eee : orcares must be ORCA2 or ORCA025'
-                 ras = report(msg)
-                 RETURN
-         END
-    ENDCASE
-    ;
-    ; check variable definition
-    ; ++ dimension etc.
-    CASE variable.NAME OF
-        'cond_sed': BEGIN
-             msg = 'iii : valid variable.NAME parameter = ' + variable.NAME
-             ras = report(msg)
-             CASE title OF
-                 'Conductance': BEGIN
-                      msg = 'iii : valid title parameter = ' + title
-                      ras = report(msg)
-                 END
-                 ELSE      : BEGIN
-                     msg = 'eee : invalid title parameter = ' + title
-                     ras = report(msg)
-                     msg = 'eee : title must be Conductance'
-                     ras = report(msg)
-                     RETURN
-                 END
-             ENDCASE
-             CASE long_name OF
-                 'Conductance': BEGIN
-                     msg = 'iii : valid long_name parameter = ' + long_name
-                     ras = report(msg)
-                 END
-                 ELSE      : BEGIN
-                     msg = 'eee : invalid long_name parameter = ' + long_name
-                     ras = report(msg)
-                     msg = 'eee : long_name must be Conductance'
-                     ras = report(msg)
-                     RETURN
-                 END
-             ENDCASE
-             CASE units OF
-                 'siemens': BEGIN
-                                     msg = 'iii : valid units parameter = ' + units
-                                     ras = report(msg)
-                 END
-                 ELSE      : BEGIN
-                                      msg = 'eee : invalid units parameter = ' + units
-                                      ras = report(msg)
-                                      msg = 'eee : units must be siemens'
-                                      ras = report(msg)
-                                      RETURN
-                 END
-             ENDCASE
-         END
-         'Br'  : BEGIN
-             msg = 'iii : valid variable.NAME parameter = ' + variable.NAME
-             ras = report(msg)
-             CASE title OF
-                 'Magnetic field': BEGIN
-                     msg = 'iii : valid title parameter = ' + title
-                     ras = report(msg)
-                 END
-                 ELSE      : BEGIN
-                    msg = 'eee : invalid title parameter = ' + title
-                    ras = report(msg)
-                    msg = 'eee : title must be Magnetic field'
-                    ras = report(msg)
-                    RETURN
-                 END
-             ENDCASE
-             CASE long_name OF
-                 'magnetic field': BEGIN
-                     msg = 'iii : valid long_name parameter = ' + long_name
-                     ras = report(msg)
-                 END
-             ELSE      : BEGIN
-                 msg = 'eee : invalid long_name parameter = ' + long_name
-                 ras = report(msg)
-                 msg = 'eee : long_name must be magnetic field'
-                 ras = report(msg)
-                 RETURN
-             END
-         ENDCASE
-         CASE units OF
-             'tesla': BEGIN
-                 msg = 'iii : valid units parameter = ' + units
-                 ras = report(msg)
-             END
-             ELSE      : BEGIN
-                 msg = 'eee : invalid units parameter = ' + units
-                 ras = report(msg)
-                 msg = 'eee : units must be tesla'
-                 ras = report(msg)
-                 RETURN
-             END
-         ENDCASE
-     END
-     ELSE      : BEGIN
-         msg = 'eee : invalid variable.NAME parameter = ' + variable.NAME
-         ras = report(msg)
-         msg = 'eee : variable.NAME must be cond_sed or Br'
-         ras = report(msg)
-         RETURN
-     END
-ENDCASE
-    ;
-    ; check jpio
-    IF (jpio LT 1) THEN BEGIN
-       msg = ' eee : invalid jpio parameter = ' + STRING(jpio)
-       ras = report(msg)
-       msg = ' eee : jpio must be greater or equal to 1'
-       ras = report(msg)
-       RETURN
-    ENDIF ELSE BEGIN
-       msg = 'iii : valid jpio parameter = ' + STRING(jpio)
-       ras = report(msg)
-    ENDELSE
-    ;
-    ; check jpjo
-    IF (jpjo LT 1) THEN BEGIN
-       msg = ' eee : invalid jpjo parameter = ' + STRING(jpjo)
-       ras = report(msg)
-       msg = ' eee : jpjo must be greater or equal to 1'
-       ras = report(msg)
-       RETURN
-    ENDIF ELSE BEGIN
-       msg = 'iii : valid jpjo parameter = ' + STRING(jpjo)
-       ras = report(msg)
-    ENDELSE
-    ;
-    ; check olon ++ what to check
-    ; when decided reproduce with olat ++
-    IF (N_ELEMENTS(olon) NE jpio*jpjo) THEN BEGIN
-       msg = ' eee : invalid nb of elements of olon parameter = ' + STRING(N_ELEMENTS(olon))
-       ras = report(msg)
-       msg = ' eee : nb of elements of olon must be equal to jpio*jpjo = ' + STRING(jpio*jpjo)
-       ras = report(msg)
-       RETURN
-    ENDIF ELSE BEGIN
-       msg = 'iii : valid nb of elements olon parameter'
-       ras = report(msg)
-    ENDELSE
-    ;
-    ; check values ++
-    ; test if ${GEOMAG_OD} defined
-    geomag_od_env=GETENV('GEOMAG_OD')
-    CASE geomag_od_env OF
-        '' : BEGIN
-               msg = 'eee : ${GEOMAG_OD} is not defined'
-               ras = report(msg)
-               RETURN
-        END
-        ELSE : BEGIN
-             msg = 'iii : ${GEOMAG_OD} is ' + geomag_od_env
-             ras = report(msg)
-        END
-    ENDCASE
-    ;
-    ; check if output data will be possible
-    iodirout = isadirectory(geomag_od_env)
-    ;
-    ; existence and protection
-    IF (FILE_TEST(iodirout, /DIRECTORY,/WRITE) EQ 0) THEN BEGIN
-       msg = 'eee : the directory' + iodirout  + ' was not found.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; build output filenames
-    filename = variable.NAME + '_' + orcares +'.nc'
-    fullfilename = iodirout + filename
-    ;
-    ; in order to avoid unexpected overwritten
-    IF (FILE_TEST(fullfilename) EQ 1) THEN BEGIN
-       msg = 'eee : the file ' + fullfilename  + ' already exists.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-    ;
-    ; d'aprÃšs ncdump -h /usr/work/sur/fvi/OPA/geomag/condmag.nc
-    ; ces lignes n'ont rien a faire la ++ ces information devrait etre en parameter
-    condmaglonname = 'lo'
-    condmaglatname = 'la'
-    varname = variable.NAME
-    ;
-    ;---------------------------
-    ; Creation of the NetCdf output file
-    ;---------------------------
-    ;
-    netcdf_id = NCDF_CREATE(fullfilename, /clobber)
-    NCDF_CONTROL, netcdf_id, /NOFILL
-    ;
-    ; dimension
-    dimidx = NCDF_DIMDEF(netcdf_id, 'x' ,  jpio)
-    dimidy = NCDF_DIMDEF(netcdf_id, 'y' ,  jpjo)
-    dimidt = NCDF_DIMDEF(netcdf_id, 'lo', /UNLIMITED)
-    ;
-    ; global attributes
-    NCDF_ATTPUT, netcdf_id, 'Conventions', 'GDT 1.2', /GLOBAL ; ++ conformite
-    NCDF_ATTPUT, netcdf_id, 'file_name'  , filename, /GLOBAL
-    NCDF_ATTPUT, netcdf_id, 'Title'      , title, /GLOBAL
-    ;
-    ; declaration of variables
-    ; 4 common variables for the two files to produce
-    varid = lonarr(4)
-    ;
-    varid[0] = NCDF_VARDEF(netcdf_id, 'nav_lon'  , [dimidx, dimidy], /FLOAT)
-    NCDF_ATTPUT, netcdf_id, varid[0], 'units'    , 'degrees_east'
-    NCDF_ATTPUT, netcdf_id, varid[0], 'valid_min', min(olon, max = omax), /FLOAT
-    NCDF_ATTPUT, netcdf_id, varid[0], 'valid_max', omax, /FLOAT
-    NCDF_ATTPUT, netcdf_id, varid[0], 'long_name', 'Longitude at t-point'
-    ;
-    varid[1] = NCDF_VARDEF(netcdf_id, 'nav_lat'  , [dimidx, dimidy], /FLOAT)
-    NCDF_ATTPUT, netcdf_id, varid[1], 'units'    , 'degrees_north'
-    NCDF_ATTPUT, netcdf_id, varid[1], 'valid_min', min(olat, max = omax), /FLOAT
-    NCDF_ATTPUT, netcdf_id, varid[1], 'valid_max', omax, /FLOAT
-    NCDF_ATTPUT, netcdf_id, varid[1], 'long_name', 'Latitude at t-point'
-    ;
-    varid[2] = NCDF_VARDEF(netcdf_id, 'time'     , [dimidt], /FLOAT)
-    ;
-    varid[3] =  NCDF_VARDEF(netcdf_id, varname, [dimidx, dimidy, dimidt], /FLOAT)
-    NCDF_ATTPUT, netcdf_id, varid[3], 'long_name', long_name
-    NCDF_ATTPUT, netcdf_id, varid[3], 'units', units
-    ; pour min et max, il faut avoir lu la variable ... cf. plus bas ++
-    ; donc pour l'instant on les met Ã  valeur manquante
-    NCDF_ATTPUT, netcdf_id, varid[3], 'valid_min', !VALUES.F_NAN, /FLOAT
-    NCDF_ATTPUT, netcdf_id, varid[3], 'valid_max', !VALUES.F_NAN, /FLOAT
-    ;
-    ;---------------------------
-    ; end of header definition, writing of the NetCdf files
-    ;---------------------------
-    ;
-    NCDF_CONTROL, netcdf_id, /ENDEF
-    ;
-    NCDF_VARPUT, netcdf_id, 'nav_lon', olon
-    NCDF_VARPUT, netcdf_id, 'nav_lat', olat
-    NCDF_VARPUT, netcdf_id, varid[2], FLOAT(0.5) ; ++ c'est quoi cette valeur
-    ;
-    ; compute min max
-    minarr = min(values, max = maxarr)
-    ;
-    ; put back the masked value
-    ;++      IF bad[0] NE -1 THEN values[TEMPORARY(bad)] = 32767
-    ;
-    ; write the data
-    NCDF_VARPUT, netcdf_id, varname, values, COUNT = [jpio, jpjo, 1], OFFSET = [0, 0, 0]
-    ;
-    ; update min max attributes
-    NCDF_CONTROL, netcdf_id, /REDEF
-    NCDF_ATTPUT, netcdf_id, varid[3], 'valid_min', minarr, /FLOAT
-    NCDF_ATTPUT, netcdf_id, varid[3], 'valid_max', maxarr, /FLOAT
-    NCDF_CONTROL, netcdf_id, /ENDEF
-    ;
-    ; close the netcdf files
-    NCDF_CLOSE, netcdf_id
-    ;
-    msg = 'iii : ' + fullfilename + ' created'
-    ras = report(msg)
-END
Index: unk/correc_angle.pro
===================================================================
--- /trunk/correc_angle.pro	(revision 48)
+++ 	(revision )
@@ -1,70 +1,0 @@
-;+
-;
-; NAME: correc_angle.pro
-;
-; PURPOSE: Corrects angles for interpolated vectorial data.
-;          Applies a rotation of field from original geographic
-;          mesh to target curvilinear grid
-;
-; CATEGORY: Subroutine
-;
-; CALLING SEQUENCE: correc_angle, zresul_uu, zresul_uv, $
-;                    zresul_vv, zresul_vu, zresul_u, zresul_v
-;
-; INPUTS:
-;          zresul_uu : x-component of interpolated field at
-;                      u-point
-;          zresul_uv : x-component of interpolated field at
-;                      v-point
-;          zresul_vv : y-component of interpolated field at
-;                      v-point
-;          zresul_vu : y-component of interpolated field at
-;                      u-point
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          zresul_u : corrected x-component of interpolated
-;                     field at u-point
-;          zresul_v : corrected y-component of interpolated
-;                     field at v-point
-;
-; COMMON BLOCKS:
-;    common_interp.pro
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;
-;-
-;------------------------------------------------------------
-;------------------------------------------------------------
-;------------------------------------------------------------
-PRO correc_angle, zresul_uu, zresul_uv, zresul_vv, zresul_vu, zresul_u, zresul_v
-@common_interp
-;
-; 1. Compute angles between grid lines and direction of the North
-; ===============================================================
-;
-printf, 40, ''
-printf, 40, 'calculating angles between geographic mesh and target grid'
-angle, lon_u, lat_u, lon_v, lat_v, lon_f, lat_f, gsinu, gsinv, gcosu, gcosv
-;
-; 2. Correct the two components of the field
-; ==========================================
-;
-printf, 40, ''
-printf, 40, 'rotating fields'
-; gcosu = reform(reform(temporary(gcosu), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
-; gcosv = reform(reform(temporary(gcosv), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
-; gsinu = reform(reform(temporary(gsinu), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
-; gsinv = reform(reform(temporary(gsinv), jpioce*jpjoce)#replicate(1, nstep), jpioce, jpjoce, nstep)
-zresul_u = zresul_uu*gcosu + zresul_vu*gsinu
-zresul_v = zresul_vv*gcosv - zresul_uv*gsinv
-;
-return
-END
Index: unk/detectbarotropicmode.sh
===================================================================
--- /trunk/detectbarotropicmode.sh	(revision 48)
+++ 	(revision )
@@ -1,208 +1,0 @@
-#! /bin/sh
-#
-#+
-#
-# .. _detectbarotropicmode.sh:
-#
-# =======================
-# detectbarotropicmode.sh
-# =======================
-#
-# -------------------------------------------
-# build file for detection of barotropic mode
-# -------------------------------------------
-#
-# SYNOPSIS
-# ========
-#
-# .. code-block:: bash
-#
-#    detectbarotropicmode.sh -l list -r resolution -exp experience -g grid \
-#    -latmin latmin -latmax latmax -longmin longmin -longmax longmax
-#
-# DESCRIPTION
-# ===========
-#
-#
-# EXAMPLES
-# ========
-#
-# For detection on DRAKKAR G42 experiment with ORCA025 resolution on T points
-# in the box [-50,30] [295,335]:
-#
-# .. code-block:: bash
-#
-#    detectbarotropicmode.sh -l ${GEOMAG_OD}/list_G42 -r ORCA025 -exp G42 -g gridT \
-#    -latmin -50 -latmax -30 -longmin 295 -longmax 335
-#
-# EVOLUTIONS
-# ==========
-#
-# $Id$
-#
-# pas fini ++
-#
-# - reee522 2007-11-26T11:33:42Z rhodes (IRIX64)
-#
-#   * externalization of copy of data file in getmodelout.sh
-#
-# - reee522 2007-11-26T10:55:44Z rhodes (IRIX64)
-#
-#   * add ncks, ncrcat and some informations inspired by
-#     http://dods.ipsl.jussieu.fr/projets_ES/misc/myls
-#
-# - fplod 2007-11-23T17:02:56Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * creation
-#
-#-
-#
-command=detectbarotropicmode.sh
-#
-usage="Usage : ${command} -l list -r orcares -exp drakkar_exp -g grid -latmin latmin -latmax latmax -longmin longmin -longmax longmax"
-#
-set -u
-while [ ${#} -gt 0 ]
-do
-    case ${1} in
-        -l)
-            list=${2}
-            shift
-        ;;
-        -r)
-            orcares=${2}
-            shift
-        ;;
-        -exp)
-            drakkar_exp=${2}
-            shift
-        ;;
-        -g)
-            grid=${2}
-            shift
-        ;;
-        -latmin)
-            latmin=${2}
-            shift
-        ;;
-        -latmax)
-            latmax=${2}
-            shift
-        ;;
-        -longmin)
-            longmin=${2}
-            shift
-        ;;
-        -longmax)
-            longmax=${2}
-            shift
-        ;;
-        *)
-            # other choice
-            echo "eee : unknown option ${1}"
-            echo "${usage}"
-        ;;
-    esac
-    # next flag
-    shift
-done
-#
-# check GEOMAG environement
-if [ ! -d ${GEOMAG_LOG} ]
-then
-    echo " eee : \${GEOMAG_LOG} not found"
-    exit 1
-fi
-# ++ blindage en tout genre
-#
-case ${grid} in
-    gridT)
-        echo "iii : grid=${orcares}"
-    ;;
-    *)
-        echo "eee : pb \${grid} = ${grid}"
-        exit 1
-    ;;
-esac
-#
-case ${orcares} in
-    ORCA025)
-        echo "iii : orcares=${orcares}"
-    ;;
-    *)
-        echo "eee : pb \${orcares} = ${orcares}"
-        exit 1
-    ;;
-esac
-#
-case ${drakkar_exp} in
-    G42)
-        echo "iii : drakkar_exp=${drakkar_exp}"
-    ;;
-    *)
-        echo "eee : pb \${drakkar_exp} = ${drakkar_exp}"
-        exit 1
-    ;;
-esac
-#
-# ++ conversion of latitude and longitude in x and y indexes
-case ${orcares} in
-    ORCA025)
-        xmin=529
-        xmax=689
-        ymin=266
-        ymax=372
-        echo "iii : forcage xmin xmax ymin ymax : ${xmin} ${xmax} ${ymin} ${ymax}"
-    ;;
-    *)
-        echo "eee : pb conversion lat,long to x,y"
-        exit 1
-    ;;
-esac
-#
-# extract ssh and create a new set of files
-list_ssh=""
-for file in `cat ${list}`
-do
-    echo "iii : extraction from ${file}" # ++ voir seulement si debug demandÃ©
-    filessh=${GEOMAG_OD}/`basename ${file} .nc`_ssh.nc
-    rm -f ${filessh} 2> /dev/null
-    ncks --dimension x,${xmin},${xmax} --dimension y,${ymin},${ymax}  -v sossheig,nav_lon,nav_lat \
-    ${file} ${filessh}
-    status_ncks=${?}
-    if [ ${status_ncks} -ne 0 ]
-    then
-        echo "eee : pb with ncks ${file}"
-        exit 1
-    else
-        list_ssh="${list_ssh} ${filessh}"
-    fi
-done
-line=`head -n 1 ${list}`
-bfile=`basename ${line}`
-datemin=`echo ${bfile}  | awk -F "_" '{print $2}'`
-line=`tail -n 1 ${list}`
-bfile=`basename ${line}`
-datemax=`echo ${bfile}  | awk -F "_" '{print $2}'`
-#
-# concatenation
-filetot=${GEOMAG_OD}/${orcares}-${drakkar_exp}_${datemin}_${datemax}_${grid}_ssh.nc
-rm -f ${filetot} 2> /dev/null
-ncrcat ${list_ssh} ${filetot}
-status_ncrcat=${?}
-if [ ${status_ncrcat} -ne 0 ]
-then
-    echo "eee : pb with ncrcat"
-    exit 1
-else
-    echo "iii : result in ${filetot}"
-fi
-#
-# ++ global attributes
-# ++ convention
-# ++ nedtcf output or ascii
-# clean
-rm ${list_ssh}
-#
-# end
-exit 0
Index: unk/divfred.pro
===================================================================
--- /trunk/divfred.pro	(revision 48)
+++ 	(revision )
@@ -1,320 +1,0 @@
-;+
-;
-; @file_comments
-; calcule la divergence d'un champ 2D
-;
-; @categories
-; matrix
-;
-; @examples
-; IDL> res=divfred(u,v)
-;
-; @param uu {in}{required}{type=2D array}
-; Matrix representing the zonal coordinates (U point)
-;
-; @param vv {in}{required}{type=2D array}
-; Matrix representing the zonal coordinates (V point)
-;
-; @returns
-; the divergence of the input data (with the same size)
-;
-; @uses
-; <pro>common</pro>
-;
-; @restrictions
-; - Requires SAXO tools
-; - les matrices u et v peuvent de 2 a 4 dimensions.
-; attention pour distinguer les diffÃ©rentes configurations de u et v
-; (xy, xyz, xyt, xyzt), on regarde la variable du common
-;        -time qui contient le calendrier en jour julien d''IDL auquel
-;        se rapportent u et v ansi que la variable
-;        -jpt qui est le nombre de pas de temps Ã  considÃ©rer dans time.
-; les tableaux u et v sont dÃ©coupÃ©s sur le mÃªme domaine
-; gÃ©ographique. A cause du dÃ©calage des grilles T, U, V et F il est
-; possible que ces 2 tableaux n''aient pas la mÃªme taille et se
-; reportent Ã  des indices diffÃ©rents. Si tel est le cas les tableaux
-; sont redÃ©coupÃ©s sur les indices qu'ils ont en commun et le dommaine
-; est redÃ©fini pour qu'il colle Ã  ces indices communs.
-; pour Ã©viter ces redÃ©coupes utiliser le mot clÃ© /memeindice dans
-; <pro>domdef</pro>
-;
-; les points sur le bord du dessin sont mis Ã  !values.f_nan
-;
-; @todo
-; ++ pas fini de comprendre, tester (compatibilitÃ© saxo), adapter, commenter
-; nettoyer
-; ++ a comparer et merger avec SAXO_DIR/ToBeReviewed/CALCULS/div.pro
-;       Written by:   fplod 2006-03-27T13:45:14Z aedon.lodyc.jussieu.fr (Darwin)
-;
-; @history
-; fplod 2007-07-30T10:11:33Z aedon.locean-ipsl.upmc.fr (Darwin)
-; add header for idldoc
-; created from
-; /usr/work/sur/fvi/OPA/geomag/divfred.pro
-; Guillaume Roullet (grlod\@ipsl.jussieu.fr)
-;                      Creation : printemps 1998
-;                      Sebastien Masson (smasson\@lodyc.jussieu.fr)
-;                      adaptation pour marcher avec un domaine reduit
-;                      12/1/2000
-; @version
-; $Id$
-;
-;-
-;
-FUNCTION divfred, uu, vv
-   tempsun = systime(1)         ; pour key_performance
-@common
-   u = uu
-   v = vv
-
-   date1 = time[0]
-   if n_elements(jpt) EQ 0 then date2 = date1 ELSE date2 = time[jpt-1]
-   if (size(u))[0] NE (size(v))[0] then return,  -1
-
-;------------------------------------------------------------
-; on trouve les points que u et v ont en communs
-;------------------------------------------------------------
-   indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1]
-   indicexv = (lindgen(jpi))[firstxv:firstxv+nxv-1]
-   indicex = inter(indicexu, indicexv)
-   indiceyu = (lindgen(jpj))[firstyu:firstyu+nyu-1]
-   indiceyv = (lindgen(jpj))[firstyv:firstyv+nyv-1]
-   indicey = inter(indiceyu, indiceyv)
-   nx = n_elements(indicex)
-   ny = n_elements(indicey)
-   indice2d = lindgen(jpi, jpj)
-   indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1]
-   case 1 of
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-;xyz
-;----------------------------------------------------------------------------
-      (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN
-;------------------------------------------------------------
-; extraction de u et v sur le domaine qui convient
-;------------------------------------------------------------
-         case 1 of
-            (size(u))[0] NE 3 OR (size(v))[0] NE 3: return,  -1
-            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $
-             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN
-               case 1 of
-                  nxu NE nx:if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *]
-                  nxv NE nx:if indicex[0] EQ firstxv then v = v[0:nx-1, *, *] ELSE v = v[1: nx, *, *]
-                  nyu NE ny:if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *]
-                  nyv NE ny:if indicey[0] EQ firstyv then v = v[*, 0:ny-1, *] ELSE v = v[*, 1: ny, *]
-                  ELSE :
-               endcase
-            END
-            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $
-             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN
-               u = u[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *]
-               v = v[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *]
-            END
-            ELSE :BEGIN
-               zdiv = -1
-               GOTO, sortie
-            end
-
-         endcase
-;------------------------------------------------------------
-; calcul de la divergence
-;------------------------------------------------------------
-         zu = (e2u[indice2d])[*]#replicate(1, nzt)
-         zu = reform(zu, nx, ny, nzt, /over)
-         zu = temporary(u)*temporary(zu) $
-          *(umask())[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt:lastzt]
-         terreu = where(zu EQ 0)
-;;;         if terreu[0] NE -1 then zu[temporary(terreu)] = !values.f_nan
-;
-         zv = (e1v[indice2d])[*]#replicate(1, nzt)
-         zv = reform(zv, nx, ny, nzt, /over)
-         zv = temporary(v)*temporary(zv) $
-          *(vmask())[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt:lastzt]
-         terrev = where(zv EQ 0)
-;;;         if terrev[0] NE -1 then zv[temporary(terrev)] = !values.f_nan
-;
-         zdiv = 1e6/(e1t[indice2d]*e2t[indice2d])
-         zdiv = (zdiv)[*]#replicate(1, nzt)
-         zdiv = reform(zdiv, nx, ny, nzt, /over)
-         zdiv = temporary(zdiv)*(zu-shift(zu, 1, 0, 0)+zv-shift(zv, 0, 1, 0)) $
-          *tmask[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt:lastzt]
-;------------------------------------------------------------
-; mise a !values.f_nan de la bordure
-;------------------------------------------------------------
-         if NOT keyword_set(key_periodic) OR nx NE jpi then begin
-            zdiv(0, *, *) = !values.f_nan
-            zdiv(nx-1, *, *) = !values.f_nan
-         endif
-;;         zdiv(*, 0, *) = !values.f_nan
-;;         zdiv(*, ny-1, *) = !values.f_nan
-;
-         zdiv = temporary(zdiv)
-;
-         if n_elements(valmask) EQ 0 THEN valmask = 1e20
-         terre =  where(tmask[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt:lastzt] EQ 0)
-         if terre[0] NE -1 then zdiv[temporary(terre)] = valmask
-;------------------------------------------------------------
-; pour le trace graphique
-;------------------------------------------------------------
-         vargrid = 'T'
-         varname = 'div'
-         varunits = '1e6*s-1'
-         domdef, (glamt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, grille = ['t']
-         if keyword_set(direc) then zdiv = moyenne(zdiv,direc,/nan, boite = boite)
-      END
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-;xyt
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-      date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN
-;------------------------------------------------------------
-; extraction de u et v sur le domaine qui convient
-;------------------------------------------------------------
-         case 1 of
-            (size(u))[0] NE 3 OR (size(v))[0] NE 3: return,  -1
-            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $
-             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN
-               case 1 of
-                  nxu NE nx:if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *]
-                  nxv NE nx:if indicex[0] EQ firstxv then v = v[0:nx-1, *, *] ELSE v = v[1: nx, *, *]
-                  nyu NE ny:if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *]
-                  nyv NE ny:if indicey[0] EQ firstyv then v = v[*, 0:ny-1, *] ELSE v = v[*, 1: ny, *]
-                  ELSE :
-               endcase
-            END
-            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $
-             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN
-               u = u[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *]
-               v = v[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *]
-            END
-            ELSE : return,  -1
-         endcase
-;------------------------------------------------------------
-; calcul de la divergence
-;------------------------------------------------------------
-         zu = e2u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt]
-         terreu = where(zu EQ 0)
-;;;         if terreu[0] NE -1 then zu[temporary(terreu)] = !values.f_nan
-         zu = (zu)[*]#replicate(1, jpt)
-         zu = reform(zu, nx, ny, jpt, /over)
-         zu = temporary(u)*temporary(zu)
-;
-         zv = e1v[indice2d]*(vmask())[indice2d+jpi*jpj*firstzt]
-         terrev = where(zv EQ 0)
-;;;         if terrev[0] NE -1 then zv[temporary(terrev)] = !values.f_nan
-         zv = (zv)[*]#replicate(1, jpt)
-         zv = reform(zv, nx, ny, jpt, /over)
-         zv = temporary(v)*temporary(zv)
-;
-         zdiv = 1e6*tmask[indice2d+jpi*jpj*firstzt]/(e1t[indice2d]*e2t[indice2d])
-         zdiv = (zdiv)[*]#replicate(1, jpt)
-         zdiv = reform(zdiv, nx, ny, jpt, /over)
-         terre =  where(zdiv EQ 0)
-         zdiv = temporary(zdiv)*(zu-shift(zu, 1, 0, 0)+zv-shift(zv, 0, 1, 0))
-;------------------------------------------------------------
-; mise a !values.f_nan de la bordure
-;------------------------------------------------------------
-         if NOT keyword_set(key_periodic) OR nx NE jpi then begin
-            zdiv(0, *, *) = !values.f_nan
-            zdiv(nx-1, *, *) = !values.f_nan
-         endif
-;;         zdiv(*, 0, *) = !values.f_nan
-;;         zdiv(*, ny-1, *) = !values.f_nan
-;
-         if n_elements(valmask) EQ 0 THEN valmask = 1e20
-         if terre[0] NE -1 then zdiv[temporary(terre)] = valmask
-;------------------------------------------------------------
-; pour le trace graphique
-;------------------------------------------------------------
-         vargrid = 'T'
-         varname = 'div'
-         varunits = '1e6*s-1'
-         domdef, (glamt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, grille = ['t']
-         if keyword_set(direc) then zdiv = grossemoyenne(zdiv,direc,/nan, boite = boite)
-      END
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-;xyzt
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-      date1 NE date2 AND (size(u))[0] EQ 4:BEGIN
-         return, report('non code!')
-      END
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-;xy
-;----------------------------------------------------------------------------
-;----------------------------------------------------------------------------
-      ELSE : BEGIN                ;xy
-         indice3d = lindgen(jpi, jpj, jpk)
-         indice3d = indice3d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt]
-;------------------------------------------------------------
-; extraction de u et v sur le domaine qui convient
-;------------------------------------------------------------
-         case 1 of
-            (size(u))[0] NE 2 OR (size(v))[0] NE 2: BEGIN
-               zdiv = -1
-               GOTO, sortie
-            end
-            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $
-             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN
-               case 1 of
-                  nxu NE nx:if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *]
-                  nxv NE nx:if indicex[0] EQ firstxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *]
-                  nyu NE ny:if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny]
-                  nyv NE ny:if indicey[0] EQ firstyv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny]
-                  ELSE :
-               endcase
-            END
-            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $
-             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN
-               u = u[indice2d]
-               v = v[indice2d]
-            END
-            ELSE : return,  -1
-         endcase
-;------------------------------------------------------------
-; calcul de la divergence
-;------------------------------------------------------------
-         zu = temporary(u)*e2u[indice2d]*(umask())[indice3d]
-         terreu = where(zu EQ 0)
-;;;         if terreu[0] NE -1 then zu[temporary(terreu)] = !values.f_nan
-         zv = temporary(v)*e1v[indice2d]*(vmask())[indice3d]
-         terrev = where(zv EQ 0)
-;;;         if terrev[0] NE -1 then zv[temporary(terrev)] = !values.f_nan
-         zdiv = zu-shift(zu, 1, 0)+zv-shift(zv, 0, 1)
-         zdiv = temporary(zdiv)*tmask[indice3d]/(e1t[indice2d]*e2t[indice2d])
-;------------------------------------------------------------
-; mise a !values.f_nan de la bordure
-;------------------------------------------------------------
-         if NOT keyword_set(key_periodic) OR nx NE jpi then begin
-            zdiv(0, *) = !values.f_nan
-            zdiv(nx-1, *) = !values.f_nan
-         endif
-;;         zdiv(*, 0) = !values.f_nan
-;;         zdiv(*, ny-1) = !values.f_nan
-;
-         zdiv = temporary(zdiv)*1e6
-;
-         if n_elements(valmask) EQ 0 THEN valmask = 1e20
-         terre =  where(tmask[indice3d] EQ 0)
-         if terre[0] NE -1 then zdiv[temporary(terre)] = valmask
-;------------------------------------------------------------
-; pour le trace graphique
-;------------------------------------------------------------
-         vargrid = 'T'
-         varname = 'div'
-         varunits = '1e6*s-1'
-         domdef, (glamt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, grille = ['t']
-         if keyword_set(direc) then zdiv = moyenne(zdiv,direc,/nan, boite = boite)
-
-      END
-   endcase
-
-;------------------------------------------------------------
-sortie:
-   if keyword_set(key_performance) THEN print, 'temps div', systime(1)-tempsun
-
-   return, zdiv
-end
Index: unk/draw.pro
===================================================================
--- /trunk/draw.pro	(revision 48)
+++ 	(revision )
@@ -1,39 +1,0 @@
-PRO draw, field, glam, gphi, zpi, zpj, nbcol, dessin, nbdessin, title = title, zmin, zmax, LAND = land
-@common
-jpi = zpi
-jpj = zpj
-glamt = glam
-IF size(glamt, /n_dimensions) EQ 1 THEN glamt = glamt#replicate(1, jpj)
-glamf = glam
-gphit = gphi
-IF size(gphit, /n_dimensions) EQ 1 THEN gphit = replicate(1, jpi)#gphit
-gphif = gphi
-gdept = [0]
-gdepw = [0]
-tmask = replicate(1, jpi, jpj)
-
-e1t = replicate(1, jpi, jpj)
-e2t = replicate(1, jpi, jpj)
-e3t = [1]
-jpk = 1
-;
-varname = title
-domdef, grille = ['T', 'F']
-key_periodique = 1
-;
-ind = where(field GE 1.e20)
-IF n_elements(ind) GT 1 THEN field(ind) = 0.
-;
-IF size(glam, /n_dimensions) EQ 1 THEN triangles = triangule() ELSE triangulate, glamt, gphit, triangles
-;
-IF keyword_set(land) THEN BEGIN
-   if dessin EQ 1 then plt, field, zmin, zmax, nite = 0, /carte, petit = [nbcol, nbdessin, dessin], /remplit, div = 4, /cont_nofill, retain = 2, /nocontour, /land $
-   ELSE plt, field, zmin, zmax, nite = 0, /carte, petit = [nbcol, nbdessin, dessin], $
-    /noerase, /remplit, div = 4, /cont_nofill, /nocontour, /land
-ENDIF ELSE BEGIN
-if dessin EQ 1 then plt, field, zmin, zmax, nite = 0, /carte, petit = [nbcol, nbdessin, dessin], /remplit, div = 4, /cont_nofill, retain = 2, /nocontour, /port $
-ELSE plt, field, zmin, zmax, nite = 0, /carte, petit = [nbcol, nbdessin, dessin], $
- /noerase, /remplit, div = 4, /cont_nofill, /nocontour, /port
-ENDELSE
-return
-end
Index: unk/extrap.pro
===================================================================
--- /trunk/extrap.pro	(revision 48)
+++ 	(revision )
@@ -1,135 +1,0 @@
-;+
-; NAME: extrap.pro (based on remplit.pro)
-;
-; PURPOSE: Extrapolates ocean data values on land points
-;
-; CATEGORY: Subroutine
-;
-; CALLING SEQUENCE: extrap, zdata, zmask, it, val
-;
-; INPUTS:
-;          zdata : field to extrapolate
-;          zmask : field's mask
-;          it    : iteration
-;          val   : field value on masked points
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          zdata : extrapolated field
-;          zmask : mask after extrapolation
-;
-; COMMON BLOCKS:
-;          common_interp.pro
-;
-;
-; MODIFICATION HISTORY: 19/11/99 Arnaud Jouzeau
-;                       25/02/00 Sebastien Masson (remplit.pro)
-;-
-PRO extrap, z, mmmask, it, val
-@common_interp
-;
-; 1. Looking for land points
-; ==========================
-;
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; znbvoisins=shift(zmask,1,0)+shift(zmask,-1,0)+shift(zmask,0,1)+shift(zmask,0,-1) $
-;           +shift(zmask,1,1)+shift(zmask,-1,1)+shift(zmask,1,-1)+shift(zmask,-1,-1)
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-;
-; 2. Extrapolating when needed
-; ============================
-;
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; zdfm = zdata*zmask
-; zremplit =shift(zdfm,1,0)+shift(zdfm,-1,0)+shift(zdfm,0,1)+shift(zdfm, 0,-1) $
-;          +shift(zdfm,1,1)+shift(zdfm,-1,1)+shift(zdfm,1,-1)+shift(zdfm, -1,-1)
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-;
-;  ... coastal points
-;
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; ocean = where(zmask NE 0.)
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; ind = where(znbvoisins NE 0. AND znbvoisins NE 8.)
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; znbvoisins(ind) = 1.d/temporary(znbvoisins(ind))
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; zremplit(ind) = temporary(zremplit(ind))*znbvoisins(ind)
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; zmask(ind) = 1.d
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-;
-;  ... inland points
-;
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; ocean2 = where(zmask NE 0.)
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; IF n_elements(ocean2) NE jpiatm*(jpjatm+4) THEN BEGIN
-; land = where(zmask EQ 0.)
-; zremplit(land) = val
-; ENDIF
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-;
-;  ... filling with ocean values
-;
-; IF keyword_set(key_performance) THEN temp = systime(1)
-; zremplit(ocean)=zdata(ocean)
-; zdata = zremplit
-; IF keyword_set(key_performance) THEN print, systime(1)-temp
-; IF keyword_set(key_performance) THEN print, 'fin iteration', it
-;
-; on trouve les points cote
-   tempdeux = systime(1)        ; pour key_performance =2
-; les points du bord du cadre ne doivent pas etre dans la cote
-   mmmask[0, *] = 1
-   mmmask[jpiatm+1, *] = 1
-   mmmask[*, 0] = 1
-   mmmask[*, jpjatm+1] = 1
-; liste des points terre restant
-   terre = where(mmmask EQ 0)
-   if terre[0] EQ -1 then GOTO, fini
-; les points du bord du cadre doivent maintenant etre dans la terre
-   mmmask[0, *] = 0
-   mmmask[jpiatm+1, *] = 0
-   mmmask[*, 0] = 0
-   mmmask[*, jpjatm+1] = 0
-; liste des voisins mer
-   voisins = shift(mmmask,-1,0)+shift(mmmask,1,0)+shift(mmmask,0,-1)+shift(mmmask,0,1) $
-    +1./sqrt(2)*(shift(mmmask,-1,-1)+shift(mmmask,1,1)+shift(mmmask,1,-1)+shift(mmmask,-1,1))
-; liste des points cote
-   cote = where(voisins[terre] GT 0)
-   cote = terre[cote]
-;
-   IF testvar(var = key_performance) EQ 2 THEN $
-    print, 'temps remplit: trouver la cote ', systime(1)-tempdeux
-;---------------------------------------------------------------
-; remplissage des points cote
-;---------------------------------------------------------------
-   tempdeux = systime(1)        ; pour key_performance =2
-; on masque z
-   z = z*mmmask
-;
-   zcote = z[1+cote]+z[-1+cote]+z[(jpiatm+2)+cote]+z[-(jpiatm+2)+cote] $
-    +1./sqrt(2)*(z[(jpiatm+2)+1+cote]+z[(jpiatm+2)-1+cote]+z[-(jpiatm+2)+1+cote]+z[-(jpiatm+2)-1+cote])
-   poids = voisins[cote]
-
-   z[cote] = zcote/poids
-;---------------------------------------------------------------
-; IV) on reduit le masque
-;---------------------------------------------------------------
-   mmmask[cote] = 1
-   z = z*mmmask + val*(1-mmmask)
-;   print, max(z)
-;
-   IF testvar(var = key_performance) EQ 2 THEN $
-    print, 'temps remplit: une iteration ', systime(1)-tempdeux
-fini:
-
-return
-END
Index: unk/forcage.pro
===================================================================
--- /trunk/forcage.pro	(revision 48)
+++ 	(revision )
@@ -1,231 +1,0 @@
-PRO forcagequimarche,iyear,ian
-@init2
-@initorca2_bab
-
-@common
-
-;ian='01'
-;iyear='1993'
-
-e_exp='ESS'
-rep_fred='/usr/work/sur/fvi/OPA/geomag/'
-key_portrait = 0
-; stockage des fichiers brut
-  ioDATA='/usr/work/sur/fvi/OPA/ORCA2/'
-  file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc'
-  print, file_U
-  file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc'
-  print, file_V
-  file_T=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_T.nc'
-  print, file_T
-  file_Sed= rep_fred+'cond_sed_ORCA2.nc'
-  file_Br= rep_fred+'Br_ORCA2.nc'
-
-
-; title
-     t_exp= e_exp
-;     t_exp0= e_exp0
-     t_bt  = 'bar_transp'
-ioORLN2 = '/usr/work/sur/fvi/OPA/ORCA2'
-;facteur d'echelle vertical for partial steps
-e3v3d=read_ncdf('e3v_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-e3u3d=read_ncdf('e3u_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-SIGMAsed=read_ncdf('cond_sed',0,/timestep,/nostruct,/tout,filename=file_Sed,/cont_nofill)
-;BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br)
-BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br,/cont_nofill)
-
-
-
-
-; vertical integration:
-e3t3d=make_array(jpi,jpj,jpk)
-        for k=0, jpk-1 do begin              &$
-          for j=0,jpj-1 do begin              &$
-            for i=0,jpi-1 do begin             &$
-              e3t3d(i,j,k) = e3t(k)    &$
-            endfor                     &$
-          endfor                      &$
-        endfor
-jpt = 73
-
-;vud = make_array(jpi,jpj,jpt)
-;vvd = make_array(jpi, jpj, jpt)
-divBustar = make_array(jpi, jpj, jpt)
-diver2=fltarr(jpi,jpj,1,73)
-
-; ouverture des fichiers dans lesquels on va Ã©crire
-;id3=NCDF_OPEN('/usr/work/sur/fvi/OPA/geomag/U_5d_'+iyear+'_grid_T.nc',/write)
-;id4=NCDF_OPEN('/usr/work/sur/fvi/OPA/geomag/V_5d_'+iyear+'_grid_T.nc',/write)
-;id4=NCDF_CREATE('/usr/work/sur/fvi/OPA/ORCA2/DivBustar_5d_'+iyear+'_grid_T.nc',/clobber)
-
-;id4=NCDF_OPEN('/usr/work/sur/fvi/OPA/ORCA2/DivBustar_5d_'+iyear+'_grid_T.nc',/write)
-
-FOR jt = 0, jpt-1 DO BEGIN &$
-
-; ouverture des fichiers et stockage en memoire partial steps
-  vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U)  &$
-;stop
-  vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V)  &$
-;stop
-; lecture salinite & temperature
-  temp= read_ncdf('votemper',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T)
-;stop
-  salin=read_ncdf('vosaline',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T)
-;stop
-  conduct=0.02047780622061 + 0.00273147624197*temp + 0.00035133182334*temp*temp + 0.09139808809909*salin + 0.00241425798890*salin*temp -0.00023998958774*salin*salin
-  mask_t=where(conduct GT 1.e+19)
-  conduct(mask_t)=0.
-; Somme conduct au point T
-
-
-; Calcul SIGMA
-
-  SIGMAoc=total(conduct*e3t3d*tmask,3)
-  SIGMA=SIGMAsed+SIGMAoc
-
-
-
-  SIGMA_u=(SIGMA+shift(SIGMA,-1,0))/2.
-
-  SIGMA_v=(SIGMA+shift(SIGMA,0,1))/2.
-
-; Calcul B en points u et v
-
-  BR_u=(BR+shift(BR,-1,0))/2.
-
-  BR_v=(BR+shift(BR,0,1))/2.
-
-
-; Calcul integrale conduct
-
-  conduct_u=(conduct+shift(conduct,-1,0,0))/2.
-
-  conduct_v=(conduct+shift(conduct,0,1,0))/2.
-
-  u_cond_u=total( vu*conduct_u*e3u3d*umask(),3)
-
-  v_cond_v=total( vv*conduct_v*e3v3d*vmask(),3)
-
-
-  Bu_star= BR_u*u_cond_u/SIGMA_u
-
-  Bv_star= BR_v*v_cond_v/SIGMA_v
-
-; Divergence du champ
-
-  Diver=div(Bu_star,Bv_star)
-
-Diver=Diver*1e-6
-
-;Diver=Diver*1e11
-;for jj=0,147 do begin &$
-;  for ji=0,179 do begin &$
-;   if( Diver(ji,jj) GT 1e10 ) then begin &$
-;      Diver(ji,jj) = 0. &$
-;   endif &$
-;  endfor &$
-;endfor
-
-;stop
-
- diver2(*,*,0,jt)=Diver(*,*)
-;stop
-; Somme sur la verticale partial steps
-;                vum=total( vu*e3u3d*umask(),3 )  &$
-;                vvm=total( vv*e3v3d*vmask(),3 )  &$
-
-; Shift sur la grille T partial steps
-;             vut= (vum+shift(vum,1,0) )*0.5   &$
-;             vvt= (vvm+shift(vvm,0,1) )*0.5   &$
-; Bande de recouvrement
-;             vut(0, *) = vut(jpi-2, *)
-;             vvt(*, 0) = 0.
-; stockage dans le fichier de sortie
-;NCDF_VARPUT, id3,'sossheig',vut, offset = [0, 0, jt]
-;NCDF_VARPUT, id4,'sossheig',Diver, offset = [0, 0, jt]
-
-print,  jt
-
-
-ENDFOR
-; on ferme le NetCDF
-;NCDF_CLOSE,id3
-;NCDF_CLOSE,id4
-
-
-
-
-temps=fltarr(73)
-temps(0)=0.
-for jt=0,71 do begin &$
-temps(jt+1)=temps(jt) +5*86400. &$
-endfor
-print,temps
-
-   vargrid = 'T'
-   iodir = '/usr/work/sur/fvi/OPA/ORCA2/'
-; Nom
-   idout = NCDF_CREATE(iodir+'DivBustar_5d_'+iyear+'_grid_T.nc',/clobber)
-   print, 'Creation du fichier Netcdf'
-   NCDF_CONTROL, idout, /nofill
-; Dimension
-   xidout = NCDF_DIMDEF(idout, 'x',jpi)
-   yidout = NCDF_DIMDEF(idout, 'y',jpj)
-   didout = NCDF_DIMDEF(idout, 'deptht',1)
-   tidout = NCDF_DIMDEF(idout, 'time_counter', /unlimited)
-
-   didout1 = NCDF_DIMDEF(idout, 'deptht1',jpk)
-
-
-; Attributs globaux
-   id0  = NCDF_VARDEF(idout, 'nav_lon'     , [xidout, yidout                ], /FLOAT)
-   id1  = NCDF_VARDEF(idout, 'nav_lat'     , [xidout, yidout                ], /FLOAT)
-   id2  = NCDF_VARDEF(idout, 'deptht'      , [                didout1        ], /FLOAT)
-   id3  = NCDF_VARDEF(idout, 'time_counter', [                        tidout], /FLOAT)
-   id4  = NCDF_VARDEF(idout, 'Diver'  , [xidout, yidout, didout, tidout], /DOUBLE)
-
-; Variable 0
-   NCDF_ATTPUT, idout, id0, 'units', 'degrees_east'
-   NCDF_ATTPUT, idout, id0, 'long_name', 'Longitude'
-   NCDF_ATTPUT, idout, id0, 'nav_model', 'Default grid'
-; Variable 1
-   NCDF_ATTPUT, idout, id1, 'units', 'degrees_north'
-   NCDF_ATTPUT, idout, id1, 'long_name', 'Latitude'
-   NCDF_ATTPUT, idout, id1, 'nav_model', 'Default grid'
-; Variable 2
-   NCDF_ATTPUT, idout, id2, 'units','meters'
-   NCDF_ATTPUT, idout, id2, 'long_name','Depth'
-   NCDF_ATTPUT, idout, id2, 'nav_model','Default grid'
-; Variable3
-   NCDF_ATTPUT, idout, id3, 'units', 'seconds since 0001-01-01 00:00:00 '
-   NCDF_ATTPUT, idout, id3, 'calendar','noleap'
-   NCDF_ATTPUT, idout, id3, 'title', 'Time'
-   NCDF_ATTPUT, idout, id3, 'long_name', 'Time axis'
-   NCDF_ATTPUT, idout, id3, 'time_origin','0001-JAN-01 00:00:00'
-; Variables
-   NCDF_ATTPUT, idout, id4, 'long_name', 'Divergence'
-
-
-   NCDF_CONTROL, idout, /ENDEF
-
-; Creation de la longitude
-   NCDF_VARPUT, idout, id0, glamt
-; Creation de la latitude
-   NCDF_VARPUT, idout, id1, gphit
-; Creation de la profondeur
-   NCDF_VARPUT, idout, id2, gdept
-; Creation du calendrier
-
-   NCDF_VARPUT, idout, id3, temps
-
-
-; Ecriture des donnees
-
-; ecriture des glam_8
-   NCDF_VARPUT, idout, id4 , diver2
-
-   NCDF_CLOSE, idout
-
-
-
-END
Index: unk/forcageforMOED.pro
===================================================================
--- /trunk/forcageforMOED.pro	(revision 48)
+++ 	(revision )
@@ -1,221 +1,0 @@
-PRO forcageforMOED
-    @init2
-    @initorca2_bab
-
-    @common
-
-    ian='01'
-    iyear='1993'
-
-    e_exp='ESS'
-    rep_fred='/usr/work/sur/fvi/OPA/geomag/'
-    key_portrait = 0
-    ; stockage des fichiers brut
-    ioDATA='/usr/work/sur/fvi/OPA/ORCA2/'
-    file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc'
-    print, file_U
-    file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc'
-    print, file_V
-    file_T=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_T.nc'
-    print, file_T
-    file_Sed= rep_fred+'cond_sed_ORCA2.nc'
-    file_Br= rep_fred+'Br_ORCA2.nc'
-
-
-    ; title
-    t_exp= e_exp
-
-    t_bt  = 'bar_transp'
-    ioORLN2 = '/usr/work/sur/fvi/OPA/ORCA2'
-    ;facteur d'echelle vertical for partial steps
-    e3v3d=read_ncdf('e3v_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-    e3u3d=read_ncdf('e3u_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-    SIGMAsed=read_ncdf('cond_sed',0,/timestep,/nostruct,/tout,filename=file_Sed,/cont_nofill)
-    BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br,/cont_nofill)
-
-    ; vertical integration:
-    e3t3d=make_array(jpi,jpj,jpk)
-    for k=0, jpk-1 do begin              &$
-        for j=0,jpj-1 do begin              &$
-            for i=0,jpi-1 do begin             &$
-                e3t3d(i,j,k) = e3t(k)    &$
-            endfor                     &$
-        endfor                      &$
-    endfor
-    jpt = 73
-
-    ;vud = make_array(jpi,jpj,jpt)
-    ;vvd = make_array(jpi, jpj, jpt)
-    divBustar = make_array(jpi, jpj, jpt)
-    diver3=replicate(0.,182,149,1,73)
-    sigma3=replicate(0.,182,149,1,73)
-    Jpu=replicate(0.,182,149,1,73)
-    Jpv=replicate(0.,182,149,1,73)
-
-
-    FOR jt = 0, jpt-1 DO BEGIN &$
-
-        ; ouverture des fichiers et stockage en memoire partial steps
-          vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U)  &$
-        ;stop
-          vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V)  &$
-        ;stop
-        ; lecture salinite & temperature
-          temp= read_ncdf('votemper',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T)
-        ;stop
-          salin=read_ncdf('vosaline',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T)
-        ;stop
-          conduct=0.02047780622061 + 0.00273147624197*temp + 0.00035133182334*temp*temp + 0.09139808809909*salin + 0.00241425798890*salin*temp -0.00023998958774*salin*salin
-          mask_t=where(conduct GT 1.e+19)
-          conduct(mask_t)=0.
-        ; Somme conduct au point T
-
-
-        ; Calcul SIGMA
-
-          SIGMAoc=total(conduct*e3t3d*tmask,3)
-          SIGMA=SIGMAsed+SIGMAoc
-
-          SIGMA_u=(SIGMA+shift(SIGMA,-1,0))/2.
-
-          SIGMA_v=(SIGMA+shift(SIGMA,0,1))/2.
-
-        ; Calcul B en points u et v
-
-          BR_u=(BR+shift(BR,-1,0))/2.
-
-          BR_v=(BR+shift(BR,0,1))/2.
-
-
-        ; Calcul integrale conduct
-
-          conduct_u=(conduct+shift(conduct,-1,0,0))/2.
-
-          conduct_v=(conduct+shift(conduct,0,1,0))/2.
-
-          u_cond_u=total( vu*conduct_u*e3u3d*umask(),3)
-
-          v_cond_v=total( vv*conduct_v*e3v3d*vmask(),3)
-
-
-        ;calcul de Jp= u_star x Fz k
-        Jpv_star= -1*BR_u*u_cond_u
-
-        Jpu_star= BR_v*v_cond_v
-
-        ; Divergence du champ
-
-        Diver=divfred(Jpu_star,Jpv_star)
-
-        Diver=Diver*1e-6
-        ;stop
-        lecontinent=where(Diver GT 1.E08)
-        Diver(lecontinent)=0.
-
-
-
-        ;stop
-        ;bande de recouvrement:
-
-        diver3(1:180,0:147,*,jt)=Diver(*,*)
-        diver3(0,*,*,*)=diver3(180,*,*,*)
-        diver3(181,*,*,*)=diver3(1,*,*,*)
-
-        sigma3(1:180,0:147,*,jt)=SIGMA(*,*)
-        sigma3(0,*,*,*)=sigma3(180,*,*,*)
-        sigma3(181,*,*,*)=sigma3(1,*,*,*)
-
-        Jpu(1:180,0:147,*,jt)=Jpu_star(*,*)
-        Jpu(0,*,*,*)=Jpu(180,*,*,*)
-        Jpu(181,*,*,*)=Jpu(1,*,*,*)
-
-        Jpv(1:180,0:147,*,jt)=Jpv_star(*,*)
-        Jpv(0,*,*,*)=Jpv(180,*,*,*)
-        Jpv(181,*,*,*)=Jpv(1,*,*,*)
-
-        print,  jt
-
-    ENDFOR
-
-    temps=fltarr(73)
-    temps(0)=0.
-    for jt=0,71 do begin &$
-        temps(jt+1)=temps(jt) +5*86400. &$
-    endfor
-    print,temps
-
-    vargrid = 'T'
-    iodir = '/usr/work/sur/fvi/OPA/ORCA2/'
-    ; Nom
-    idout = NCDF_CREATE(iodir+'ForcageMOED_5d_'+iyear+'_grid_T.nc',/clobber)
-    print, 'Creation du fichier Netcdf'
-    NCDF_CONTROL, idout, /nofill
-    ; Dimension
-    xidout = NCDF_DIMDEF(idout, 'x',jpiglo)
-    yidout = NCDF_DIMDEF(idout, 'y',jpjglo)
-    didout = NCDF_DIMDEF(idout, 'deptht',1)
-    tidout = NCDF_DIMDEF(idout, 'time_counter', /unlimited)
-
-    didout1 = NCDF_DIMDEF(idout, 'deptht1',jpk)
-
-
-; Attributs globaux
-    id0  = NCDF_VARDEF(idout, 'nav_lon'     , [xidout, yidout                ], /FLOAT)
-    id1  = NCDF_VARDEF(idout, 'nav_lat'     , [xidout, yidout                ], /FLOAT)
-    id2  = NCDF_VARDEF(idout, 'deptht'      , [                didout1        ], /FLOAT)
-    id3  = NCDF_VARDEF(idout, 'time_counter', [                        tidout], /FLOAT)
-    id4  = NCDF_VARDEF(idout, 'DivJp'  , [xidout, yidout, didout, tidout], /DOUBLE)
-    id5  = NCDF_VARDEF(idout, 'Sigma'  , [xidout, yidout, didout, tidout], /DOUBLE)
-    id6  = NCDF_VARDEF(idout, 'Jpu'  , [xidout, yidout, didout, tidout], /DOUBLE)
-    id7  = NCDF_VARDEF(idout, 'Jpv'  , [xidout, yidout, didout, tidout], /DOUBLE)
-
-; Variable 0
-    NCDF_ATTPUT, idout, id0, 'units', 'degrees_east'
-    NCDF_ATTPUT, idout, id0, 'long_name', 'Longitude'
-    NCDF_ATTPUT, idout, id0, 'nav_model', 'Default grid'
-; Variable 1
-    NCDF_ATTPUT, idout, id1, 'units', 'degrees_north'
-    NCDF_ATTPUT, idout, id1, 'long_name', 'Latitude'
-    NCDF_ATTPUT, idout, id1, 'nav_model', 'Default grid'
-; Variable 2
-    NCDF_ATTPUT, idout, id2, 'units','meters'
-    NCDF_ATTPUT, idout, id2, 'long_name','Depth'
-    NCDF_ATTPUT, idout, id2, 'nav_model','Default grid'
-; Variable3
-    NCDF_ATTPUT, idout, id3, 'units', 'seconds since 0001-01-01 00:00:00 '
-    NCDF_ATTPUT, idout, id3, 'calendar','noleap'
-    NCDF_ATTPUT, idout, id3, 'title', 'Time'
-    NCDF_ATTPUT, idout, id3, 'long_name', 'Time axis'
-    NCDF_ATTPUT, idout, id3, 'time_origin','0001-JAN-01 00:00:00'
-; Variables
-    NCDF_ATTPUT, idout, id4, 'long_name', 'Divergence Jp'
-; Variables
-    NCDF_ATTPUT, idout, id5, 'long_name', 'Total Conductance'
-    NCDF_ATTPUT, idout, id6, 'long_name', 'Jpu=u_star x B (x comp)'
-    NCDF_ATTPUT, idout, id7, 'long_name', 'Jpv=u_star x B (y comp)'
-
-
-    NCDF_CONTROL, idout, /ENDEF
-
-; Creation de la longitude
-    NCDF_VARPUT, idout, id0, glamt
-; Creation de la latitude
-    NCDF_VARPUT, idout, id1, gphit
-; Creation de la profondeur
-    NCDF_VARPUT, idout, id2, gdept
-; Creation du calendrier
-
-    NCDF_VARPUT, idout, id3, temps
-
-
-    ; Ecriture des donnees
-
-    ; ecriture des glam_8
-    NCDF_VARPUT, idout, id4 , diver3
-    NCDF_VARPUT, idout, id5 , sigma3
-    NCDF_VARPUT, idout, id6 , Jpu
-    NCDF_VARPUT, idout, id7 , Jpv
-
-    NCDF_CLOSE, idout
-
-END
Index: unk/forcagequimarche.pro
===================================================================
--- /trunk/forcagequimarche.pro	(revision 48)
+++ 	(revision )
@@ -1,413 +1,0 @@
-;+
-;
-; @file_comments
-; calcul d'une matrice 3D de conductivitÃ© sigma=f(T,S) en fonction de T et S
-; de ORCA, sur la grille T
-;
-; @categories
-; orca grid
-;
-; @param orcares {in}{required}{type=string}
-; code of ORCA grid to use for output results
-; must be 'ORCA2'
-;
-; @param iyear {in}{required}{type=integer}
-; real year
-;
-; @param ian {in}{required}{type=integer}
-; simulation year
-;
-; @keyword DRAKKAR_EXP {type=string}
-; code for Drakkar experiment
-; only used when orcares = ORCA025
-; must be G42 ++ G70
-;
-; @restrictions
-;  - Requires SAXO tools
-;
-; @todo
-; validation of ORCA2 processing (now some NaN in output files !)
-; add ORCA025
-; provide tools to plot output files
-; produce a NetCDF GDT or CF compliant
-; add divchoice parameter to choose either div or divfred
-;
-; @pre
-; see geomag_profile.sh
-; be sure to have ++ in the directory defined in ${GEOMAG_ID}/
-;
-; @post
-; see geomag_profile.sh
-; ++ in the directory defined in ${GEOMAG_OD}/
-;
-; @examples
-; for ORCA2
-; IDL> .run forcagequimarche
-; IDL> forcagequimarche, 'ORCA2', '1993', '01'
-;
-; @history
-; fplod 2007-09-19T15:41:28Z aedon.locean-ipsl.upmc.fr (Darwin)
-; externalisation of outputs see <progeomag>forcage_output</progeomag> ++
-; fplod 2007-07-30T10:12:38Z aedon.locean-ipsl.upmc.fr (Darwin)
-; restore divfred call instead of div ("official" saxo divergence module)
-; fplod 2007-07-27T10:29:18Z cerbere.locean-ipsl.upmc.fr (Linux)
-; add orcares in the name of output files
-; fplod 2007-07-27T10:29:18Z cerbere.locean-ipsl.upmc.fr (Linux)
-; add orcares parameter
-; add optional keyword drakkar_exp
-; add header for idldoc
-; add check of io directories
-; replace io directories user dependant to $GEOMAG_ID and $GEOMAG_OD
-; replace call of divfred by call of div
-;
-; @version
-; $Id$
-;
-;-
-;
-PRO forcagequimarche, orcares, iyear, ian, DRAKKAR_EXP = drakkar_exp
-    ;
-    ;----
-    ; check input parameters
-    ;----
-    ;
-    ; check orcares definition
-    ;
-    CASE orcares OF
-       'ORCA2': BEGIN
-                   msg = 'iii : valid orcares parameter = ' + orcares
-                   ras = report(msg)
-                   filename_oce = 'meshmask_bab.nc'
-                   IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                      msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp
-                      ras = report(msg)
-                   END
-        END
-        ELSE : BEGIN
-                   msg = 'eee : invalid orcares parameter = ' + orcares
-                   ras = report(msg)
-                   msg = 'eee : orcares must be ORCA2 or ORCA025++'
-                   ras = report(msg)
-                   RETURN
-        END
-    ENDCASE
-  
-    ; ++ check iyear
-    ; ++ check ian
-    
-    ;++@init2
-    ; init grid
-    initocemeshmask, orcares, DRAKKAR_EXP = drakkar_exp
-  
-    @common
-    ;
-    ; check for input files
-    ;
-    ; test if ${GEOMAG_ID} defined
-    geomag_id_env=GETENV('GEOMAG_ID')
-    CASE geomag_id_env OF
-       ''  :  BEGIN
-                msg = 'eee : ${GEOMAG_ID} is not defined'
-                ras = report(msg)
-                RETURN
-              END
-       ELSE : BEGIN
-               msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env
-               ras = report(msg)
-       END
-    ENDCASE
-    ;
-    iodirin = isadirectory(geomag_id_env)
-    ;
-  ; existence and protection of ${GEOMAG_ID}
-    IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN
-       msg = 'eee : the directory' + iodirin  + ' is not accessible.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-  ;
-  ; test if ${GEOMAG_OD} defined
-    geomag_od_env=GETENV('GEOMAG_OD')
-    CASE geomag_od_env OF
-       '' : BEGIN
-               msg = 'eee : ${GEOMAG_OD} is not defined'
-               ras = report(msg)
-               RETURN
-            END
-       ELSE : BEGIN
-               msg = 'iii : ${GEOMAG_OD} is ' + geomag_od_env
-               ras = report(msg)
-             END
-  ENDCASE
-  ;
-  ; check if output data will be possible
-    iodirout = isadirectory(geomag_od_env)
-  ;
-  ; existence and protection
-    IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN
-       msg = 'eee : the directory' + iodirout  + ' was not found.'
-       ras = report(msg)
-       RETURN
-    ENDIF
-  ;
-  e_exp='ESS'
-  key_portrait = 0
-  ; stockage des fichiers brut
-    ioDATA=geomag_id_env
-  
-    CASE orcares OF
-       'ORCA2': BEGIN
-    file_U=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_U.nc'
-    file_V=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_V.nc'
-    file_T=e_exp+'_5d_'+ian+'0101_'+ian+'1231_grid_T.nc'
-  jpt = 73 ;time counter des fichiers ci-dessus
-       END
-    ENDCASE
-    file_Sed= geomag_id_env+'cond_sed_'+orcares+'.nc'
-    file_Br= geomag_id_env+'Br_'+orcares + '.nc'
-  ;
-  ; title
-       t_exp= e_exp
-       t_bt  = 'bar_transp'
-  ioORLN2 = geomag_id_env
-  ;
-  ;facteur d'echelle vertical for partial steps
-  e3v3d=read_ncdf('e3v_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-  e3u3d=read_ncdf('e3u_ps',0,/timestep,iodir=ioORLN2,/nostruct,/tout,filename='meshmask_bab.nc')
-  SIGMAsed=read_ncdf('cond_sed',0,/timestep,/nostruct,/tout,filename=file_Sed,/cont_nofill)
-  ;BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br)
-  BR=read_ncdf('Br',0,/timestep,/nostruct,/tout,filename=file_Br,/cont_nofill)
-  ;
-  ; vertical integration:
-  e3t3d=make_array(jpi,jpj,jpk)
-          for k=0, jpk-1 do begin              &$
-            for j=0,jpj-1 do begin              &$
-              for i=0,jpi-1 do begin             &$
-                e3t3d(i,j,k) = e3t(k)    &$
-              endfor                     &$
-            endfor                      &$
-          endfor
-  ;
-  ;vud = make_array(jpi,jpj,jpt)
-  ;vvd = make_array(jpi, jpj, jpt)
-  divBustar = make_array(jpi, jpj, jpt)
-  diver3=replicate(0.,182,149,1,jpt)
-  sigma3=replicate(0.,182,149,1,jpt)
-  ;
-  FOR jt = 0, jpt-1 DO BEGIN &$
-  ;
-  ; ouverture des fichiers et stockage en memoire partial steps
-    vu=read_ncdf('vozocrtx',jt,jt, /timestep, iodir=ioDATA,/nostruct,/TOUT,filename=file_U)  &$
-  ;stop
-    vv=read_ncdf('vomecrty',jt,jt, /timestep,iodir=ioDATA,/nostruct,/TOUT,filename=file_V)  &$
-  ;stop
-  ; lecture salinite & temperature
-    temp= read_ncdf('votemper',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T)
-  ;stop
-    salin=read_ncdf('vosaline',jt,jt,/timestep,iodir=ioDATA,/nostruct,/tout,filename=file_T)
-  ;stop
-    conduct=0.02047780622061 + 0.00273147624197*temp + 0.00035133182334*temp*temp + 0.09139808809909*salin + 0.00241425798890*salin*temp -0.00023998958774*salin*salin
-    mask_t=where(conduct GT 1.e+19)
-    conduct(mask_t)=0.
-  ; Somme conduct au point T
-  ;
-  ; Calcul SIGMA
-  ;
-    SIGMAoc=total(conduct*e3t3d*tmask,3)
-    SIGMA=SIGMAsed+SIGMAoc
-  ;
-    SIGMA_u=(SIGMA+shift(SIGMA,-1,0))/2.
-    SIGMA_v=(SIGMA+shift(SIGMA,0,1))/2.
-  ;
-  ; Calcul B en points u et v
-  ;
-    BR_u=(BR+shift(BR,-1,0))/2.
-    BR_v=(BR+shift(BR,0,1))/2.
-  ;
-  ; Calcul integrale conduct
-  ;
-    conduct_u=(conduct+shift(conduct,-1,0,0))/2.
-    conduct_v=(conduct+shift(conduct,0,1,0))/2.
-  ;
-    u_cond_u=total( vu*conduct_u*e3u3d*umask(),3)
-    v_cond_v=total( vv*conduct_v*e3v3d*vmask(),3)
-  ;
-    Bu_star= BR_u*u_cond_u/SIGMA_u
-    Bv_star= BR_v*v_cond_v/SIGMA_v
-  
-  ; Transport horizontal
-    T_u=total( vu*e3u3d*umask(),3)
-    T_v=total( vv*e3v3d*vmask(),3)
-  
-  ;
-  ; Divergence du champ
-    Diver=divfred(Bu_star,Bv_star)
-  
-  Diver=Diver*1e-6
-  ;stop
-  lecontinent=where(Diver GT 1.E08)
-  Diver(lecontinent)=0.
-
-;stop
-;bande de recouvrement:
-
-diver3(1:180,0:147,*,jt)=Diver(*,*)
-diver3(0,*,*,*)=diver3(180,*,*,*)
-diver3(181,*,*,*)=diver3(1,*,*,*)
-
-sigma3(1:180,0:147,*,jt)=SIGMA(*,*)
-sigma3(0,*,*,*)=sigma3(180,*,*,*)
-sigma3(181,*,*,*)=sigma3(1,*,*,*)
-
-print,  jt
-
-ENDFOR
-; on ferme le NetCDF
-;NCDF_CLOSE,id3
-;NCDF_CLOSE,id4
-
-temps=fltarr(73)
-temps(0)=0.
-for jt=0,71 do begin &$
-temps(jt+1)=temps(jt) +5*86400. &$
-endfor
-print,temps
-
-   vargrid = 'T'
-   iodir = geomag_od_env
-; Nom
-   idout = NCDF_CREATE(iodir+'DivBustar_5d_'+iyear+'_grid_T_'+orcares+'.nc',/clobber)
-   print, 'Creation du fichier Netcdf'
-   NCDF_CONTROL, idout, /nofill
-; Dimension
-   xidout = NCDF_DIMDEF(idout, 'x',jpiglo)
-   yidout = NCDF_DIMDEF(idout, 'y',jpjglo)
-   didout = NCDF_DIMDEF(idout, 'deptht',1)
-   tidout = NCDF_DIMDEF(idout, 'time_counter', /unlimited)
-
-   didout1 = NCDF_DIMDEF(idout, 'deptht1',jpk)
-
-
-; Attributs globaux
-   id0  = NCDF_VARDEF(idout, 'nav_lon'     , [xidout, yidout                ], /FLOAT)
-   id1  = NCDF_VARDEF(idout, 'nav_lat'     , [xidout, yidout                ], /FLOAT)
-   id2  = NCDF_VARDEF(idout, 'deptht'      , [                didout1        ], /FLOAT)
-   id3  = NCDF_VARDEF(idout, 'time_counter', [                        tidout], /FLOAT)
-   id4  = NCDF_VARDEF(idout, 'Diver'  , [xidout, yidout, didout, tidout], /DOUBLE)
-
-; Variable 0
-   NCDF_ATTPUT, idout, id0, 'units', 'degrees_east'
-   NCDF_ATTPUT, idout, id0, 'long_name', 'Longitude'
-   NCDF_ATTPUT, idout, id0, 'nav_model', 'Default grid'
-; Variable 1
-   NCDF_ATTPUT, idout, id1, 'units', 'degrees_north'
-   NCDF_ATTPUT, idout, id1, 'long_name', 'Latitude'
-   NCDF_ATTPUT, idout, id1, 'nav_model', 'Default grid'
-; Variable 2
-   NCDF_ATTPUT, idout, id2, 'units','meters'
-   NCDF_ATTPUT, idout, id2, 'long_name','Depth'
-   NCDF_ATTPUT, idout, id2, 'nav_model','Default grid'
-; Variable3
-   NCDF_ATTPUT, idout, id3, 'units', 'seconds since 0001-01-01 00:00:00 '
-   NCDF_ATTPUT, idout, id3, 'calendar','noleap'
-   NCDF_ATTPUT, idout, id3, 'title', 'Time'
-   NCDF_ATTPUT, idout, id3, 'long_name', 'Time axis'
-   NCDF_ATTPUT, idout, id3, 'time_origin','0001-JAN-01 00:00:00'
-; Variables
-   NCDF_ATTPUT, idout, id4, 'long_name', 'Divergence'
-
-
-   NCDF_CONTROL, idout, /ENDEF
-
-; Creation de la longitude
-
-print,glamt[0:20,0]    ; ++ debug pb nav_lon
-print,glamt[30:50,0]
-print,glamt[50:70,0]
-
-   NCDF_VARPUT, idout, id0, glamt
-; Creation de la latitude
-   NCDF_VARPUT, idout, id1, gphit
-; Creation de la profondeur
-   NCDF_VARPUT, idout, id2, gdept
-; Creation du calendrier
-
-   NCDF_VARPUT, idout, id3, temps
-
-
-; Ecriture des donnees
-
-; ecriture des glam_8
-   NCDF_VARPUT, idout, id4 , diver3
-
-   NCDF_CLOSE, idout
-; ++ l'Ã©quivalent avec forcage_output
-forcage_output, orcares, variable, 'Divergence', long_name, jpiglo, jpjglo, gphit, glamt,diver3
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;;;meme topo pour SIGMA
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-  idout = NCDF_CREATE(iodir+'Sigma_5d_'+iyear+'_grid_T_'+orcares+'.nc',/clobber)
-   print, 'Creation du fichier Netcdf'
-   NCDF_CONTROL, idout, /nofill
-; Dimension
-   xidout = NCDF_DIMDEF(idout, 'x',jpiglo)
-   yidout = NCDF_DIMDEF(idout, 'y',jpjglo)
-   didout = NCDF_DIMDEF(idout, 'deptht',1)
-   tidout = NCDF_DIMDEF(idout, 'time_counter', /unlimited)
-
-   didout1 = NCDF_DIMDEF(idout, 'deptht1',jpk)
-
-
-; Attributs globaux
-   id0  = NCDF_VARDEF(idout, 'nav_lon'     , [xidout, yidout                ], /FLOAT)
-   id1  = NCDF_VARDEF(idout, 'nav_lat'     , [xidout, yidout                ], /FLOAT)
-   id2  = NCDF_VARDEF(idout, 'deptht'      , [                didout1        ], /FLOAT)
-   id3  = NCDF_VARDEF(idout, 'time_counter', [                        tidout], /FLOAT)
-   id4  = NCDF_VARDEF(idout, 'Sigma'  , [xidout, yidout, didout, tidout], /DOUBLE)
-
-; Variable 0
-   NCDF_ATTPUT, idout, id0, 'units', 'degrees_east'
-   NCDF_ATTPUT, idout, id0, 'long_name', 'Longitude'
-   NCDF_ATTPUT, idout, id0, 'nav_model', 'Default grid'
-; Variable 1
-   NCDF_ATTPUT, idout, id1, 'units', 'degrees_north'
-   NCDF_ATTPUT, idout, id1, 'long_name', 'Latitude'
-   NCDF_ATTPUT, idout, id1, 'nav_model', 'Default grid'
-; Variable 2
-   NCDF_ATTPUT, idout, id2, 'units','meters'
-   NCDF_ATTPUT, idout, id2, 'long_name','Depth'
-   NCDF_ATTPUT, idout, id2, 'nav_model','Default grid'
-; Variable3
-   NCDF_ATTPUT, idout, id3, 'units', 'seconds since 0001-01-01 00:00:00 '
-   NCDF_ATTPUT, idout, id3, 'calendar','noleap'
-   NCDF_ATTPUT, idout, id3, 'title', 'Time'
-   NCDF_ATTPUT, idout, id3, 'long_name', 'Time axis'
-   NCDF_ATTPUT, idout, id3, 'time_origin','0001-JAN-01 00:00:00'
-; Variables
-   NCDF_ATTPUT, idout, id4, 'long_name', 'Total Conductance'
-
-
-   NCDF_CONTROL, idout, /ENDEF
-
-; Creation de la longitude
-   NCDF_VARPUT, idout, id0, glamt
-; Creation de la latitude
-   NCDF_VARPUT, idout, id1, gphit
-; Creation de la profondeur
-   NCDF_VARPUT, idout, id2, gdept
-; Creation du calendrier
-
-   NCDF_VARPUT, idout, id3, temps
-
-
-; Ecriture des donnees
-
-; ecriture des glam_8
-   NCDF_VARPUT, idout, id4 , sigma3
-
-   NCDF_CLOSE, idout
-
-
-END
Index: unk/fsxspp.pro
===================================================================
--- /trunk/fsxspp.pro	(revision 48)
+++ 	(revision )
@@ -1,12 +1,0 @@
-;
-;  fsnspp: north stereographic polar projection
-;
-FUNCTION fsxspp, plam, pphi
-;
-rpi = double( 2.*asin( 1. ))
-rad = double( rpi/180.)
-;
-z = double( 2. * cos( rad*plam ) * tan( rpi/4. - rad*pphi/2. ))
-;
-return, z
-END
Index: unk/fsyspp.pro
===================================================================
--- /trunk/fsyspp.pro	(revision 48)
+++ 	(revision )
@@ -1,12 +1,0 @@
-;
-;  fsnspp: north stereographic polar projection
-;
-FUNCTION fsyspp, plam, pphi
-;
-rpi = double( 2.*asin( 1. ))
-rad = double( rpi/180.)
-;
-z = double( 2. * sin( rad*plam ) * tan( rpi/4. - rad*pphi/2. ))
-;
-return, z
-END
Index: unk/geomag.kml
===================================================================
--- /trunk/geomag.kml	(revision 48)
+++ 	(revision )
@@ -1,50 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<kml xmlns="http://earth.google.com/kml/2.2">
-<!--
-module :
-definition of GEOMAG zones and lines for Google Earth
-
-update :
-++ l'afrique et l'antarctique (20 ° Est) et entre l'australie et l'antarctique (147 ° Est)
-$Id$
-fplod 2007-11-27T10:59:53Z aedon.locean-ipsl.upmc.fr (Darwin)
-add Drake Passage
-fplod 2007-11-26T16:59:58Z aedon.locean-ipsl.upmc.fr (Darwin)
-first try of KML file 
-creation from 
-http://code.google.com/apis/kml/documentation/KML_Samples.kml
-draft mais on voit bien la zone avec 
- aedon$ open argentin_bassin.kml
--->
-  <Document>
-    <name>GEOMAG zones</name>
-    <open>1</open>
-    <description>GEOMAG zones</description>
-    <Folder>
-      <name>GEOMAG zones</name>
-      <visibility>1</visibility>
-      <description>GEOMAG zones</description>
-      <GroundOverlay>
-        <name>Argentin Bassin</name>
-        <visibility>1</visibility>
-        <description>Argentin Bassin</description>
-        <LatLonBox>
-          <north>-30.</north>
-          <south>-50.</south>
-          <east>295.</east>
-          <west>335.</west>
-          <rotation>0</rotation>
-        </LatLonBox>
-      </GroundOverlay>
-      <Placemark>
-        <name>Drake Passage</name>
-        <visibility>1</visibility>
-        <description>Drake Passage</description>
-        <LineString>
-          <tessellate>1</tessellate>
-          <coordinates> -65.,-50.,0 -65.,-70.0,0 </coordinates>
-        </LineString>
-      </Placemark>
-    </Folder>
-  </Document>
-</kml>
Index: unk/geomag_profile.sh
===================================================================
--- /trunk/geomag_profile.sh	(revision 48)
+++ 	(revision )
@@ -1,321 +1,0 @@
-#! /bin/sh
-#
-#+
-# .. _geomag_profile.sh:
-#
-# =================
-# geomag_profile.sh
-# =================
-#
-# -------------------------
-# define GEOMAG environment
-# -------------------------
-#
-# SYNOPSIS
-# ========
-#
-# Online usage
-#
-# .. code-block:: bash
-#
-#    . geomag_profile.sh -d directory -i indir -o outdir -t tempdir
-#
-# In :file:`${HOME}/.profile`, add the following line:
-#
-# .. code-block:: bash
-#
-#    . geomag_profile.sh -d directory -i indir -o outdir -t tempdir
-#
-# DESCRIPTION
-# ===========
-#
-# .. option:: -d <directory>
-# .. option:: -i <indir>
-# .. option:: -o <outdir>
-# .. option:: -t <tempdir>
-#
-# define GEOMAG environment
-#
-# ${GEOMAG} is the base directory of tools.
-#
-# ${GEOMAG_LOG} is the directory where log files will be written.
-#
-# ${GEOMAG_ID} is the directory where input files must be.
-#
-# ${GEOMAG_OD} is the directory where output files will be written.
-#
-# MANPATH++
-#
-# EXAMPLES
-# ========
-#
-# For fplod, on aedon.locean-ipsl.upmc.fr:
-#
-# .. code-block:: bash
-#
-#    cd /usr/home/fplod/incas/geomag/geomag_ws
-#    . geomag_profile.sh -d /usr/home/fplod/incas/geomag/geomag_ws/ -i ${HOME}/geomag_d/ -o ${HOME}/geomag_d/ -t /usr/temp/${LOGNAME}/log/
-#
-# For reee522 on rhodes.idris.fr:
-#
-# .. code-block:: bash
-#
-#    cd ${HOME}/incas/geomag/geomag_ws/
-#    . geomag_profile.sh -d ${HOME}/incas/geomag/geomag_ws/ -i ${HOMEGAYA}/geomag_d/ -o ${HOMEGAYA}/geomag_d/ -t /tmp/${LOGNAME}/log/
-#
-# TODO
-# ====
-#
-# ++ option bavarde
-#
-# ++ machine dependant
-#
-# ++ besoin de posix
-#
-# ++ pas de MANPATH defini par dÃ©faut sur zeus
-#
-# EVOLUTIONS
-# ==========
-#
-# $Id$
-#
-# - fplod 20100426T094821Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * improve PATH and MANPATH modification
-#
-# - fplod 20100423T143134Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * add error handling on mkdir
-#
-# - fplod 20100318T073619Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * unset
-#
-# - reee522 2007-06-14T14:25:00Z rhodes (IRIX64)
-#
-#   * add -i, -o and -t parameters to be more flexible
-#   * some bug fixes
-#   * more checking
-#
-# - fplod 2007-03-13T16:12:41Z zeus.locean-ipsl.upmc.fr (Linux)
-#
-#   * add creation of ${GEOMAG_ID} and ${GEOMAG_OD} if they don't exist
-#
-# - reee522 2006-11-23T11:41:41Z rhodes (IRIX64)
-#
-#   * pas de set -o posix sur rhodes (IRIX64)
-#
-# - fplod 2006-03-22T10:13:38Z aedon.lodyc.jussieu.fr (Darwin)
-#
-#   * creation
-#
-#-
-#
-command=geomag_profile.sh
-#
-usage=" Usage : ${command} -d directory -i indir -o outdir -t tempdir"
-#
-set -u
-pb=0
-#
-minargcount=8
-maxargcount=8
-narg=${#}
-#
-if [ ${narg} -lt ${minargcount} ]
-then
-    echo "eee : not enought arguments (${narg} vs ${minargcount})"
-    echo "${usage}"
-    # nb : no exit because this file should be launched by login process
-    pb=1
-fi
-unset minargcount
-#
-if [ ${narg} -gt ${maxargcount} ]
-then
-    echo "eee : too many arguments (${narg} vs ${maxargcount})"
-    echo "${usage}"
-    # nb : no exit because this file should be launched by login process
-    pb=1
-fi
-unset maxargcount
-unset narg
-#
-if [ ${pb} -eq 0 ]
-then
-    #
-    while [ ${#} -gt 0 ]
-    do
-       case ${1} in
-          -d)
-             # directory for application choosen by user 
-             # (see svn checkout command used)
-             directory=${2}
-             shift
-          ;;
-          -i)
-             # directory for inputs choosen by user
-             indir=${2}
-             shift
-          ;;
-          -o)
-             # directory for outputs choosen by user
-             outdir=${2}
-             shift
-          ;;
-          -t)
-             # directory for temporary outputs choosen by user
-             tempdir=${2}
-             shift
-          ;;
-          *)
-             # other choice
-             echo "eee : unknown option ${1}"
-             echo "${usage}"
-             # nb : no exit because this file should be launched by login process
-          ;;
-       esac
-       # next flag
-       shift
-    done
-    unset usage
-fi
-if [ ${pb} -eq 0 ]
-then
-    #
-    # check for ${directory}
-    if [ ! -d ${directory} ]
-    then
-       echo " eee : ${directory} not found"
-       # nb : no exit because this file should be launched by login process
-    fi
-    #
-    # check for permission on directory
-    if [ ! -x ${directory} ]
-    then
-       echo " eee : ${directory} not reachable"
-       # nb : no exit because this file should be launched by login process
-    fi
-    #
-    system=$(uname)
-    case "${system}" in
-       IRIX64)
-          echo " www : no specific posix checking"
-       ;;
-       *)
-          set -o posix
-       ;;
-    esac
-    unset system
-    #
-    GEOMAG=${directory}
-    export GEOMAG
-    unset directory
-    #
-    # add GEOMAG tools to PATH
-    # if not already done
-    suppath=$(echo ${GEOMAG} | tr -s "/")
-    echo ${PATH} | grep -q "${suppath}:"
-    test_path=${?}
-    if [ ${test_path} -ne 0 ]
-    then
-       PATH=${suppath}:${PATH}
-       export PATH
-    else
-       # option bavarde oui/non pas encore implantÃ©e ++
-       echo "${command} : iii : ${suppath}/ already in \${PATH}"
-    fi
-    unset test_path
-    unset suppath
-    #
-    # add GEOMAG manuals to MANPATH
-    # if not already done
-    suppath=$(echo ${GEOMAG}/doc/manuals/man/ | tr -s "/")
-    echo ${MANPATH} | grep -q "${suppath}:"
-    test_manpath=${?}
-    if [ ${test_manpath} -ne 0 ]
-    then
-       MANPATH=${suppath}:${MANPATH}
-       export MANPATH
-    else
-       # option bavarde oui/non pas encore implantÃ©e ++
-       echo "${command} : iii : ${suppath} already in \${MANPATH}"
-    fi
-    unset test_manpath
-    unset suppath
-    #
-    GEOMAG_LOG=${tempdir}
-    export GEOMAG_LOG
-    unset tempdir
-    if [ ! -d ${GEOMAG_LOG} ]
-    then
-       mkdir -p ${GEOMAG_LOG}
-       status=${?}
-       if [ ${status} -ne 0 ]
-       then
-          echo "${command} : eee : can not create \${GEOMAG_LOG}"
-          # nb : no exit because this file should be launched by login process
-       else
-          echo "${command} : iii : creation of \${GEOMAG_LOG}"
-       fi
-       unset status
-    fi
-    # check for permission on GEOMAG_LOG
-    if [ ! -x ${GEOMAG_LOG} ]
-    then
-       echo " eee : ${GEOMAG_LOG} not reachable"
-       # nb : no exit because this file should be launched by login process
-    fi
-    #
-    # check for permission on GEOMAG_LOG
-    if [ ! -w ${GEOMAG_LOG} ]
-    then
-       echo " eee : ${GEOMAG_LOG} not writable"
-       # nb : no exit because this file shouldreachable be launched 
-       # by login process
-    fi
-    #
-    EDITOR=vi
-    export EDITOR
-    #
-    # io directories
-    GEOMAG_ID=${indir}
-    export GEOMAG_ID
-    unset indir
-    if [ ! -d ${GEOMAG_ID} ]
-    then
-       mkdir -p ${GEOMAG_ID}
-       echo "${command} : iii : creation of \${GEOMAG_ID}"
-    fi
-    # check for permission on GEOMAG_ID
-    if [ ! -x ${GEOMAG_ID} ]
-    then
-       echo " eee : ${GEOMAG_ID} not reachable"
-       # nb : no exit because this file should be launched by login process
-    fi
-    #
-    GEOMAG_OD=${outdir}
-    export GEOMAG_OD
-    unset outdir
-    if [ ! -d ${GEOMAG_OD} ]
-    then
-       mkdir -p ${GEOMAG_OD}
-       echo "${command} : iii : creation of \${GEOMAG_OD}"
-    fi
-    # check for permission on GEOMAG_OD
-    if [ ! -x ${GEOMAG_OD} ]
-    then
-       echo " eee : ${GEOMAG_OD} not reachable"
-       # nb : no exit because this file should be launched by login process
-    fi
-    if [ ! -w ${GEOMAG_OD} ]
-    then
-       echo " eee : ${GEOMAG_OD} not writable"
-       # nb : no exit because this file should be launched by login process
-    fi
-    #
-fi
-unset pb
-# end
-unset command
-# nb : no exit because this file should be launched by login process
Index: unk/getmodelout.sh
===================================================================
--- /trunk/getmodelout.sh	(revision 48)
+++ 	(revision )
@@ -1,152 +1,0 @@
-#! /bin/sh
-#
-#+
-# .. _getmodelout.sh:
-#
-# ==============
-# getmodelout.sh
-# ==============
-#
-# ------------------------------------------
-# get model data output file in ${GEOMAG_ID}
-# ------------------------------------------
-#
-# SYNOPSIS
-# ========
-#
-# .. code-block:: bash
-#
-#    getmodelout.sh -r orcares -exp drakkar_exp -g grid -yearmin yyyy -yearmax yyyy -o list
-#
-# DESCRIPTION
-# ===========
-#
-# get model data output file in ${GEOMAG_ID}
-#
-# EXAMPLES
-# ========
-#
-# To get DRAKKAR G42 experiment output on grid T points between year 9 and 10:
-#
-# .. code-block:: bash
-#
-#    getmodelout.sh -r ORCA025 -exp G42 -g gridT -yearmin 9 -yearmax 10 -o ${GEOMAG_OD}/list_G42
-#
-# EVOLUTIONS
-# ==========
-#
-# $Id$
-#
-# - fplod 20100318T073947Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * unset
-#
-# - reee522 2007-11-26T11:21:37Z rhodes (IRIX64)
-#
-#   * creation
-#-
-#
-command=getmodelout.sh
-#
-usage=" Usage : ${command} -r orcares -exp drakkar_exp -g grid -o list"
-#
-set -u
-while [ ${#} -gt 0 ]
-do
-   case ${1} in
-      -r)
-         orcares=${2}
-         shift
-      ;;
-      -exp)
-         drakkar_exp=${2}
-         shift
-      ;;
-      -g)
-         grid=${2}
-         shift
-      ;;
-      -yearmin)
-         yearmin=${2}
-         shift
-      ;;
-      -yearmax)
-         yearmax=${2}
-         shift
-      ;;
-      -o)
-         list=${2}
-         shift
-      ;;
-      *)
-         # other choice
-         echo "eee : unknown option ${1}"
-         echo "${usage}"
-      ;;
-   esac
-   # next flag
-   shift
-done
-unset usage
-#
-# check GEOMAG environement
-if [ ! -d ${GEOMAG_LOG} ]
-then
-   echo " eee : \${GEOMAG_LOG} not found"
-   exit 1
-fi
-#
-if [ -f ${list} ]
-then
-   echo "eee : ${list} exist"
-   exit 1
-fi
-# ++ blindage en tout genre
-#
-case ${orcares} in
-   ORCA025)
-      # sur l'idris
-      dirref=/u/rech/cli/rcli002/
-   ;;
-   *)
-      echo "eee : pb \${orcares} = ${orcares}"
-   ;;
-esac
-#
-listfull=${GEOMAG_LOG}/lisfull${$}
-#
-iyear=${yearmin}
-while [ ${iyear} -le ${yearmax} ]
-do
-   cyear=`printf "%4.4d" ${iyear}`
-   ls ${dirref}/${orcares}/${orcares}-${drakkar_exp}-S/${cyear}/${orcares}-${drakkar_exp}_y${cyear}m??d??_${grid}.nc >> ${listfull}
-   unset cyear
-   # ++ calcul taille cf myls dans faq es dods
-   # iyear=$(( ${iyear} + 1 )) ++ pas ok sur rhodes
-   # iyear=$(expr  ${iyear} + 1 )  ++ pas ok sur rhodes
-   iyear=`expr  ${iyear} + 1 `
-done
-unset iyear
-unset dirref
-unset orcares
-unset drakkar_exp
-unset grid
-#
-# print total size of model files
-# ++ pb syntaxe unitsop="1024**2" # Mo
-#ls -l `cat ${listfull}` | \
-#awk 'NF>4 {print $5, $9}' | \
-#awk 'sum=$1/'$unitsop'+sum {printf("%08.3f '$units' -- %s\n",$1/'$unitsop', $2)}
-#
-# put files in ${GEOMAG_ID}
-# ++ ln cp ou scp
-# ++ -f ou test si deja existant
-for file in  `cat ${listfull}`
-do
-   ln -sf ${file} ${GEOMAG_ID}
-   echo ${GEOMAG_ID}/`basename ${file}` >> ${list}
-done
-unset listfull
-#
-# end
-exit 0
Index: unk/grad.pro
===================================================================
--- /trunk/grad.pro	(revision 48)
+++ 	(revision )
@@ -1,228 +1,0 @@
-;+
-;
-; @history
-; Sebastien Masson (smasson\@lodyc.jussieu.fr)
-;
-;-
-FUNCTION grad, field, direc
-;
-@common
-;
-   res = litchamp(field)
-   taille=size(res)
-   grille, mask, glam, gphi, gdep, nx, ny,nz,premierx,premiery,premierz,dernierx, derniery, dernierz
-   if n_elements(valmask) EQ 0 then valmask = 1e20
-   case strupcase(vargrid) of
-      'T':BEGIN
-         case direc of
-            'x':BEGIN
-               divi = e1u[premierx:dernierx, premiery:derniery]
-               newmask = (umask())[premierx:dernierx, premiery:derniery, premierz:dernierz]
-               vargrid = 'U'
-               domdef, glamt[premierx, 0], glamu[dernierx, 0] $
-                , gphit[0, premiery], gphiu[0, derniery], grille = ['T','U']
-            END
-            'y':BEGIN
-               divi = e2v[premierx:dernierx, premiery:derniery]
-               newmask = (vmask())[premierx:dernierx, premiery:derniery, premierz:dernierz]
-               vargrid = 'V'
-               domdef, glamt[premierx, 0], glamv[dernierx, 0] $
-                , gphit[0, premiery], gphiv[0, derniery], grille = ['T','V']
-            END
-            'z':BEGIN
-               divi = e3w[premierz:dernierz]
-               newmask = mask
-               vargrid = 'W'
-            END
-            ELSE : return, report('Bad definition of direction argument')
-         ENDCASE
-      END
-      'W':BEGIN
-         case direc of
-            'x':divi = e1u[premierx:dernierx, premiery:derniery]
-            'y':divi = e2v[premierx:dernierx, premiery:derniery]
-            'z':BEGIN
-               divi = e3t[premierz:dernierz]
-               newmask = mask
-               vargrid = 'T'
-            END
-            ELSE : return, report('Bad definition of direction argument')
-         endcase
-      END
-      'U':BEGIN
-         case direc of
-            'x':BEGIN
-               divi = (shift(e1t, -1, 0))[premierx:dernierx, premiery:derniery]
-               newmask = tmask[premierx:dernierx, premiery:derniery, premierz:dernierz]
-               vargrid = 'T'
-               domdef, glamt[premierx, 0], glamu[dernierx] $
-                , gphit[0, premiery], gphiu[0, derniery], grille = ['T','U']
-            END
-            'y':BEGIN
-               divi = e2f[premierx:dernierx, premiery:derniery]
-               newmask = (fmask())[premierx:dernierx, premiery:derniery, premierz:dernierz]
-               vargrid = 'F'
-               domdef, glamu[premierx, 0], glamf[dernierx, 0] $
-                , gphiu[0, premiery], gphif[0, derniery], grille = ['U','F']
-            END
-            'z':BEGIN
-               divi = e3w[premierz:dernierz]
-               newmask = mask
-               vargrid = 'W'
-            END
-            ELSE : return, report('Bad definition of direction argument')
-         endcase
-      END
-      'V':BEGIN
-         case direc of
-            'x':BEGIN
-               divi = e1f[premierx:dernierx, premiery:derniery]
-               newmask = (fmask())[premierx:dernierx, premiery:derniery, premierz:dernierz]
-               vargrid = 'F'
-               domdef, glamv[premierx, 0], glamf[dernierx, 0] $
-                , gphiv[0, premiery], gphif[0, derniery], grille = ['V','F']
-            END
-            'y':BEGIN
-               divi = (shift(e2t, 0, -1))[premierx:dernierx, premiery:derniery]
-               newmask = tmask[premierx:dernierx, premiery:derniery, premierz:dernierz]
-               vargrid = 'T'
-               domdef, glamt[premierx, 0], glamv[dernierx, 0] $
-                , gphit[0, premiery], gphiv[0, derniery], grille = ['T','V']
-            END
-            'z':BEGIN
-               divi = e3w[premierz:dernierz]
-               newmask = mask
-               vargrid = 'W'
-            END
-            ELSE : return, report('Bad definition of direction argument')
-         endcase
-      END
-;       'F':BEGIN
-;          case direc of
-;             'x':divi = (shift(e1v, -1, 0))[premierx:dernierx, premiery:derniery]
-;             'y':divi = (shift(e2u, 0, -1))[premierx:dernierx, premiery:derniery]
-;             'z':divi = e3w[premierz:dernierz]
-;             ELSE : return, report('Bad definition of direction argument')
-;          endcase
-;       END
-      ELSE : return, report('Bad definition of vargrid')
-   ENDCASE
-   res = fitintobox(res)
-   case 1 of
-;----------------------------------------------------------------------------
-;xy
-;----------------------------------------------------------------------------
-      taille[0] EQ 2:BEGIN
-         earth = where(mask[*, *, premierz] EQ 0)
-         if earth[0] NE -1 then res[earth] = !values.f_nan
-         case direc of
-            'x':BEGIN
-               res = (shift(res, -1, 0)-res)/divi
-               if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *] = !values.f_nan
-               if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0)
-            END
-            'y':BEGIN
-               res = (shift(res, 0, -1)-res)/divi
-               res[*, ny-1] = !values.f_nan
-               if vargrid EQ 'T' OR vargrid EQ 'U' then res =   shift(res, 0, 1)
-            END
-            ELSE : return,  report('Bad definition of direction argument for the type of array')
-         ENDCASE
-         earth = where(newmask[*, *, premierz] EQ 0)
-         if earth[0] NE -1 then res[earth] = valmask
-      END
-;----------------------------------------------------------------------------
-;xyt
-;----------------------------------------------------------------------------
-      taille[0] EQ 3 AND jpt NE 1:BEGIN
-         earth = where(mask[*, *, premierz] EQ 0)
-         if earth[0] NE -1 then BEGIN
-            earth = earth#replicate(1, jpt)+replicate(1, n_elements(earth))#(nx*ny*lindgen(jpt))
-            res[earth[*]] = !values.f_nan
-         ENDIF
-         divi = divi[*]#replicate(1, jpt)
-         case direc of
-            'x':BEGIN
-               res = (shift(res, -1, 0, 0)-res)/divi
-               if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *, *] = !values.f_nan
-               if vargrid EQ 'T' OR vargrid EQ 'V'  then res = shift(res, 1, 0, 0)
-            END
-            'y':BEGIN
-               res = (shift(res, 0, -1, 0)-res)/divi
-               res[*, ny-1, *] = !values.f_nan
-               if vargrid EQ 'T' OR vargrid EQ 'U'  then res = shift(res, 0, 1, 0)
-            END
-            ELSE : return,  report('Bad definition of direction argument for the type of array')
-         ENDCASE
-         earth = where(newmask[*, *, premierz] EQ 0)
-         if earth[0] NE -1 then BEGIN
-            earth = earth#replicate(1, jpt)+replicate(1, n_elements(earth))#(nx*ny*lindgen(jpt))
-            res[earth] = valmask
-         ENDIF
-      END
-;----------------------------------------------------------------------------
-;xyz
-;----------------------------------------------------------------------------
-      taille[0] EQ 3 AND jpt EQ 1:BEGIN
-         earth = where(mask EQ 0)
-         if earth[0] NE -1 then res[earth] = !values.f_nan
-         case direc OF
-            'x':BEGIN
-               divi = divi[*]#replicate(1, nz)
-               res = (shift(res, -1, 0, 0)-res)/divi
-               if key_periodique EQ 0 OR nx NE jpi THEN res[nx-1, *, *] = !values.f_nan
-               if vargrid EQ 'T' OR vargrid EQ 'V' then res = shift(res, 1, 0, 0)
-            END
-            'y':BEGIN
-               divi = divi[*]#replicate(1, nz)
-               res = (shift(res, 0, -1, 0)-res)/divi
-               res[*, ny-1, *] = !values.f_nan
-               if vargrid EQ 'T' OR vargrid EQ 'U'  then res = shift(res, 0, 1, 0)
-            END
-            'z':BEGIN
-               divi = reform(replicate(1, nx*ny)#divi, nx, ny, nz)
-               if nx EQ 1 OR ny EQ 1 then res = reform(res, nx, ny, nz)
-               if vargrid EQ 'W' THEN BEGIN
-                  res = (shift(res, 0, 0, 1)-res)/divi
-                  res[*, *, 0] = !values.f_nan
-               ENDIF ELSE BEGIN
-                  res = (res-shift(res, 0, 0, -1))/divi
-                  res[*, *, nz-1] = !values.f_nan
-               ENDELSE
-               if earth[0] NE -1 then res[earth] = valmask
-            END
-         ENDCASE
-      END
-;------------------------------------------------------------
-;----------------------------------------------------------------------------
-;xyzt
-;----------------------------------------------------------------------------
-      taille[0] EQ 4:BEGIN
-         earth = where((mask[*]#replicate(1, jpt)) EQ 0)
-         if earth[0] NE -1 then res[earth] = !values.f_nan
-         case direc OF
-            'z':BEGIN
-               divi = replicate(1, nx*ny)#divi
-               divi = reform(divi[*]#replicate(1, jpt), nx, ny, nz, jpt, /over)
-               if nx EQ 1 OR ny EQ 1 then res = reform(res, nx, ny, nz, jpt)
-               if vargrid EQ 'W' THEN BEGIN
-                  res = (shift(res, 0, 0, 1, 0)-res)/divi
-                  res[*, *, 0, *] = !values.f_nan
-               ENDIF ELSE BEGIN
-                  res = (res-shift(res, 0, 0, -1, 0))/divi
-                  res[*, *, nz-1, *] = !values.f_nan
-               ENDELSE
-               if earth[0] NE -1 then res[earth] = valmask
-            END
-         ENDCASE
-      END
-;------------------------------------------------------------
-;------------------------------------------------------------
-   endcase
-   varname = 'grad of '+varname
-   varunit = varunit+'/m'
-
-
-;------------------------------------------------------------
-   return, res
-end
Index: unk/init2.pro
===================================================================
--- /trunk/init2.pro	(revision 48)
+++ 	(revision )
@@ -1,133 +1,0 @@
-; on lance l''aide en ligne
-
-;?
-
-;
-; partie a modifier
-;
-
-;----------------------------------------------------------
-; extension du path pour les scripts init, initgrille (ds HOME) et xxx (ds PACKAGE/WIDGET)
-
-;path smasson:
-;!path=expand_path('+/usr1/com/smasson/IDL')+':'+expand_path('+/usr1/com/smasson/IDL_RD')+':'+expand_path('+'+!dir)
-
-
-;!path=expand_path('+/home/rech/eee/reee421/IDL/HOME')+':'+expand_path('+/home/rech/eee/reee217/IDL_RD')+':'+expand_path('+'+!dir)
-;@common
-
-!path=expand_path('+/usr/work/sur/fvi/IDL')+':'+expand_path('+/usr/work/sur/fvi/IDL_RDD')+':'+expand_path('+'+!dir)
-@common
-
-;----------------------------------------------------------
-; pour l''impression si vous utilisez imprime depuis le lodyc,
-; l''ipsl, l''idris.
-
-
-
-loginlodyc='fvi'
-machlodyc = 'leto'
-
-;----------------------------------------------------------
-; definition de differentes directories
-;----------------------------------------------------------
-
-
-
-homedir = '/usr/work/sur/fvi/OPA/geomag/'
-iodir = '/usr/work/sur/fvi/OPA/ORCA2/'
-animdir =iodir
-psdir = '/usr/work/sur/fvi/IDL/IDL_PS/'
-imagedir = iodir
-;
-; fin de la partie a modifier
-;
-
-;----------------------------------------------------------
-; environnement graphique (window et ps)
-;----------------------------------------------------------
-if (((!D.Name EQ 'X') OR (!D.NAME EQ 'MAC')) $
-AND (!D.N_Colors GE 256L)) then $
-DEVICE, True_Color=24, decompose=0 $
-else begin & window, colors=100 & wdelete & $
-device, pseudo_color=8 & endelse
-;
-;window, colors=100 & wdelete
-;if !d.n_colors gt 256 then device, decomposed = 0 $
-;ELSE device, pseudo_color=8
-
-
-loadct,39
-tvlct, rouge,vert,bleu, /get
-coefpalit= 1
-key_portrait = 0
-
-;----------------------------------------------------------
-c_lab=0
-c_cote=0
-c_cont = (!d.n_colors-1) < 255
-;----------------------------------------------------------
- grandfeuille = 29.7
- petitfeuille = 21.
- ccwindowsize = 0.99
-
-
-;----------------------------------------------------------
-!except = 2
-sauveps = 0
-;--------------------------------------------------------
-;   definition par defaut du fichier que l''on traite
-;------------------------------------------------------
-year=1
-month=1
-day=1
-niveau=1
-
-;
-prefix=' '
-;
-vargrid = 'T'
-varname = ' '
-vardate= '0'
-varexp = ' '
-varunit = ' '
-;----------------------------------------------------------
-;----------------------------------------------------------
-jpiglo = 1
-jpjglo = 1
-jpkglo = 1
-jpidta = jpiglo
-jpjdta = jpjglo
-jpkdta = jpjglo
-jpi = 1
-jpj = 1
-jpk = 1
-jpt = 1
-ixminmesh  =-1
-ixmaxmesh  =-1
-iyminmesh  =-1
-iymaxmesh  =-1
-izminmesh  =-1
-izmaxmesh  =-1
-ixmindta = 0
-ixmaxdta = jpidta-1
-iymindta = 0
-iymaxdta = jpjdta-1
-izmindta = 0
-izmaxdta = jpkdta-1
-key_shift = 0
-key_periodique = 0
-ccmeshparameters ={filename:'No File', filetype:'nothing' $
-, jpiglo:jpiglo, jpjglo:jpjglo, jpkglo:jpkglo $
-, jpi:jpi, jpj:jpj, jpk:jpk $
-, ixminmesh:ixminmesh, ixmaxmesh:ixmaxmesh $
-, iyminmesh:iyminmesh, iymaxmesh:iymaxmesh $
-, izminmesh:izminmesh, izmaxmesh:izmaxmesh $
-, key_shift:key_shift, key_periodique:key_periodique $
-, triangulation:0, boundary:[-180, 180]}
-ccreadparameters = {funclec_name:'No File' $
-, jpidta:jpidta, jpjdta:jpjdta, jpkdta:jpkdta $
-, ixmindta:ixmindta, ixmaxdta:ixmaxdta $
-, iymindta:iymindta, iymaxdta:iymaxdta $
-, izmindta:izmindta, izmaxdta:izmaxdta $
-}
Index: unk/init_interp.pro
===================================================================
--- /trunk/init_interp.pro	(revision 48)
+++ 	(revision )
@@ -1,44 +1,0 @@
-;------------------------------------------------------------
-; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr)
-;                       26/5/98
-;------------------------------------------------------------
-
-!path=expand_path('+/usr/home/robin/IDL/FRED/TOOLS/INTERP')+':'+expand_path('+/usr/home/smasson/IDL_RD')+':'+expand_path('+'+!dir)
-;------------------------------------------------------------
-@common
-;--------------------------------------------------------
-;   definition par defaut du fichier que l''on traite
-;------------------------------------------------------
-vargrid = 'T'
-varname = ' '
-vardate= '0'
-varexp = ' '
-varunit = ' '
-;----------------------------------------------------------
-; environnement graphique (window et ps)
-;----------------------------------------------------------
-; travail en batch
-; ****************
-; set_plot, 'z'
-;
-; travail en interactif
-; *********************
-window, colors=100 & wdelete
-if !d.n_colors gt 256 then device,  decomposed = 0 $
-ELSE device, pseudo_color=8
-lct, 37
-c_lab=0
-c_cote=0
-c_cont = (!d.n_colors-1) < 255
-tvlct, rouge,vert,bleu, /get
-coefpalit=.3
-key_portrait = 1
-!except = 2
-;----------------------------------------------------------
-grandfeuille = 29.7
-petitfeuille = 21.
-;----------------------------------------------------------
-;----------------------------------------------------------
-sauveimage = 0
-sauveps = 0
-
Index: unk/init_path.pro
===================================================================
--- /trunk/init_path.pro	(revision 48)
+++ 	(revision )
@@ -1,62 +1,0 @@
-;---------------------------------------------------
-; PATHS INITIALISATIONS                            *
-;---------------------------------------------------
-;
-; 1. Directories
-; ==============
-;
-input_dir = '/usr/work/sur/fvi/OPA/geomag/'
-output_dir = '/usr/work/sur/fvi/OPA/geomag/'
-;
-; 2. Input information
-; ====================
-;
-;  2.1. Data file name
-;  -------------------
-;
-IF keyword_set(nscal) THEN BEGIN
-    data_u_file = 'OMIP_east_west_stress.nc'
-    data_v_file = 'OMIP_north_south_stress.nc'
-ENDIF ELSE BEGIN
-    datafile = 'condmag.nc'
-ENDELSE
-;
-;  2.2. Data mask file name
-;  ------------------------
-;
-IF keyword_set(key_mask) THEN maskfile = 'tmi99_sst_2x0.5grid.nc'
-;
-;  2.3. Target grid
-;  ----------------
-;
-gridfile = 'meshmask_bab.nc'
-;
-; 3. Output information
-; =====================
-;
-;  3.1. Output file name
-;  ---------------------
-;
-IF keyword_set(nscal) THEN BEGIN
-    outputfile_x = 'OMIP_east_west_stress_ORCA_R2_grid_U.nc'
-    outputfile_y = 'OMIP_north_south_stress_ORCA_R2_grid_V.nc'
-ENDIF ELSE BEGIN
-    ; outputfile = 'cond_sed_ORCA2.nc'
-    outputfile = 'Br_ORCA2.nc'
-ENDELSE
-;
-printf, 40, ''
-IF keyword_set(nscal) THEN BEGIN
-    printf, 40, 'Data input file (x-component) : ', string(input_dir, '/', data_u_file)
-    printf, 40, 'Data input file (y-component) : ', string(input_dir, '/', data_v_file)
-ENDIF ELSE BEGIN
-    printf, 40, 'Data input file  : ', string(input_dir, '/', datafile)
-ENDELSE
-IF keyword_set(key_mask) THEN printf, 40, 'Mask input file  : ', string(input_dir, '/', maskfile)
-IF keyword_set(nscal) THEN BEGIN
-    printf, 40, 'Output file (x-component) : ', string(output_dir, '/', outputfile_x)
-    printf, 40, 'Output file (y-component) : ', string(output_dir, '/', outputfile_y)
-ENDIF ELSE BEGIN
-    printf, 40, 'Output file      : ', string(output_dir, '/', outputfile)
-ENDELSE
-printf, 40, 'Target grid file : ', string(input_dir, '/', gridfile)
Index: unk/initocemeshmask.pro
===================================================================
--- /trunk/initocemeshmask.pro	(revision 48)
+++ 	(revision )
@@ -1,248 +1,0 @@
-;+
-;
-; @file_comments
-; initialisation on ORCA grid
-;
-; @param orcares {in}{required}{type=string}
-; code of ORCA grid to use for output results
-; must be 'ORCA2' or 'ORCA025'
-;
-; @keyword DRAKKAR_EXP {type=string}
-; code for Drakkar experiment
-; only used when orcares = ORCA025
-; must be G42 ++ G70
-;
-; @keyword _EXTRA
-; must exist in order to be able to use this procedure as an argument
-;
-; @examples
-; appel classique pour ORCA2
-; IDL> initocemeshmask,'ORCA2'
-;
-; appel classique pour ORCA025
-; IDL> initocemeshmask,'ORCA025',DRAKKAR_EXP='G42'
-;
-; to plot ${GEOMAG_OD}/cond_sed_ORCA2.nc :
-; IDL> myfile=getenv('GEOMAG_OD') + 'cond_sed_ORCA2.nc'
-; IDL> xxx, myfile, 'initocemeshmask', '''ORCA2''',format='(i5)'
-;
-; to plot ${GEOMAG_OD}/cond_sed_ORCA025.nc :
-; IDL> myfile=getenv('GEOMAG_OD') + 'cond_sed_ORCA025.nc'
-; IDL> xxx, myfile, 'initocemeshmask', '''ORCA025''',DRAKKAR_EXP='G42',format='(i5)'
-;
-; @history
-; reee522 2007-06-08T15:35:17Z rhodes (IRIX64)
-; rename from initocemesh to initocemeshmask
-; reee522 2007-06-06T15:27:54Z rhodes (IRIX64)
-; add examples for ORCA025. ++ to be tested
-; reee522 2007-06-06T14:57:39Z rhodes (IRIX64)
-; correction for DRAKKAR_EXP usage
-; F. Vivier 2003
-; F. Pinsard adaptation to new SAXO
-; according to SAXO ./SRC/Tests/tst_initorca2.pro
-; fplod 2007-05-15T13:43:21Z aedon.locean-ipsl.upmc.fr (Darwin)
-; transformation in procedure with parameter orcares
-; fplod 2007-06-05T12:22:38Z aedon.locean-ipsl.upmc.fr (Darwin)
-; (following Sebastien Masson advices)
-; . add _EXTRA keyword in order to be able to use this procedure as an argument
-; of <pro>xxx</pro>.
-; . add _EXTRA to the call of ncdf_meshlec
-; replace initorca2_bab by initocemesh in filename and procedure name
-;
-; @todo
-; add call to smallmeshmask to mix zhg, hgr and byte_mask files for ORCA025
-;
-; zminmesh and izmaxmesh may be set to 0,0 because we only work with
-; surface problem (no z) whatever the resolution of ORCA. this will safe lot
-; of memory
-;
-; use <pro>ncdf_getaxis</pro> to recover meshmask dimension
-; on x, retrieve -1 and -1 (bande de recouvrement haut et bas)
-; on y, for ORCA2, retrieve -2 (bande de recouvrement ++ et ++)
-;
-; reminder : ORCA2 = 182 x 149 and ORCA025 1442 x 1021
-;
-; for ORCA025, use /keepcont in <pro>triangule</pro> call.
-;
-; @version
-; $Id$
-;
-;-
-;
-PRO initocemeshmask, orcares, DRAKKAR_EXP = drakkar_exp, _EXTRA = extra
-;
-  compile_opt idl2, strictarrsubs
-;
-@cm_4mesh
-@cm_4cal
-@cm_4data
-;
-; check input parameters
-CASE orcares OF
-   'ORCA2': BEGIN
-               msg = 'iii : valid orcares parameter = ' + orcares
-               ras = report(msg)
-               filename_oce = 'meshmask_bab.nc'
-               IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                  msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp
-                  ras = report(msg)
-               END
-            END
-     'ORCA025': BEGIN
-                 msg = 'iii : valid orcares parameter = ' + orcares
-                 ras = report(msg)
-                 IF keyword_set(DRAKKAR_EXP) THEN BEGIN
-                    msg = 'iii : DRAKKAR_EXP keyword set'
-                    ras = report(msg)
-                    msg = 'iii : DRAKKAR_EXP = ' + drakkar_exp
-                    ras = report(msg)
-                    CASE drakkar_exp OF
-                       'G42' : BEGIN
-                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                  ras = report(msg)
-                               END
-                       'G70' : BEGIN
-                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                  ras = report(msg)
-                               END
-                       ELSE : BEGIN
-                                  msg = 'eee : invalid DRAKKAR_EXP keyword = ' + drakkar_exp
-                                  ras = report(msg)
-                                  RETURN
-                              END
-                    ENDCASE
-                    filename_oce = orcares + '-' + drakkar_exp + '_mesh_hgr.nc'
-                 ENDIF ELSE BEGIN
-                    msg = 'eee : unset DRAKKAR_EXP keyword'
-                    ras = report(msg)
-                    msg = 'eee : orcares must be G42 or G70'
-                    ras = report(msg)
-                    RETURN
-                 ENDELSE
-              END
-    ELSE : BEGIN
-               msg = 'eee : invalid orcares parameter = ' + orcares
-               ras = report(msg)
-               msg = 'eee : orcares must be ORCA2 or ORCA025'
-               ras = report(msg)
-               RETURN
-    END
-  ENDCASE
-;
-; check for input files
-;
-; test if ${GEOMAG_ID} defined
-  geomag_id_env=GETENV('GEOMAG_ID')
-  CASE geomag_id_env OF
-     ''  :  BEGIN
-              msg = 'eee : ${GEOMAG_ID} is not defined'
-              ras = report(msg)
-              RETURN
-            END
-     ELSE : BEGIN
-             msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env
-             ras = report(msg)
-     END
-  ENDCASE
-iodirin = isadirectory(geomag_id_env)
-;
-; existence and protection of ${GEOMAG_ID}
-  IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN
-     msg = 'eee : the directory' + iodirin  + ' is not accessible.'
-     ras = report(msg)
-     RETURN
-  ENDIF
-;
-; check if this file exists
-fullfilename_oce = isafile(iodirin + filename_oce, NEW=0, /MUST_EXIST, $
-                     RECURSIVE=0)
-  IF fullfilename_oce[0] EQ '' THEN BEGIN
-     msg = 'eee : the file ' + fullfilename_oce + ' was not found.'
-     ras = report(msg)
-     RETURN
-  ENDIF
-;
-; protection
-  IF (FILE_TEST(fullfilename_oce[0], /READ) EQ 0) THEN BEGIN
-     msg = 'eee : the file ' + fullfilename_oce[0] + ' is not readable.'
-     ras = report(msg)
-     RETURN
-  ENDIF
-;
-;--------------------------------------------------------
-; boundaries of the read grid regarding to the original grid
-;----------------------------------------------------------
-;
-CASE orcares OF
-   'ORCA2': BEGIN
-ixminmesh  =1
-ixmaxmesh  =180
-;
-iyminmesh  =0
-iymaxmesh  =147
-;
-izminmesh  =-1
-izmaxmesh  =-1
-;
-              END
-   'ORCA025': BEGIN
-ixminmesh  =1
-ixmaxmesh  =1440
-;
-iyminmesh  =0
-iymaxmesh  =1019
-;
-izminmesh  =-1
-izmaxmesh  =-1
-;
-              END
-      ELSE : BEGIN
-                 msg = 'eee : invalid orcares parameter = ' + orcares
-                 ras = report(msg)
-                 msg = 'eee : orcares must be ORCA2 or ORCA025'
-                 ras = report(msg)
-                 RETURN
-      END
-  ENDCASE
-jpt = 1
-time = 0
-;------------------------------------------------------
-; read the grid
-;------------------------------------------------------
-;
-key_stride = [1, 1, 1]
-;++ncdf_meshlec, fullfilename_oce[0], glamboundary = [20, 380], _EXTRA = extra
-ncdf_meshlec, fullfilename_oce[0], GLAMBOUNDARY = [80, 380], _EXTRa = extra
-;-------------------------------------------------------------
-domdef
-;
-CASE orcares OF
-  'ORCA2'  : BEGIN
-                triangles_list = triangule()
-             END
-  'ORCA025': BEGIN
-                triangles_list = triangule(/keepcont)
-             END
-      ELSE : BEGIN
-                msg = 'eee : invalid orcares parameter = ' + orcares
-                ras = report(msg)
-                msg = 'eee : orcares must be ORCA2 or ORCA025'
-                ras = report(msg)
-                RETURN
-             END
-ENDCASE
-;
-; boundaries of the data regarding to the original grid
-jpidta = jpiglo
-jpjdta = jpjglo
-jpkdta = jpkglo
-ixmindta = 0
-ixmaxdta = jpidta-1
-iymindta = 0
-iymaxdta = jpjdta-1
-izmindta = 0
-izmaxdta = jpkdta-1
-;
-@updateold
-;
-END
Index: unk/initorca.pro
===================================================================
--- /trunk/initorca.pro	(revision 48)
+++ 	(revision )
@@ -1,145 +1,0 @@
-;------------------------------------------------------------
-; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr)
-;                       26/5/98
-; pris le 25 janvier 99 par Maurice Imbard
-;------------------------------------------------------------
-; appelle de l''aide en ligne
-;------------------------------------------------------------
-?
-;------------------------------------------------------------
-;------------------------------------------------------------
-@common
-;------------------------------------------------------------
-;----------------------------------------------------------
-;----------------------------------------------------------
-; bornes de la grille
-;----------------------------------------------------------
-ixminmesh  =2
-ixmaxmesh  =181
-;
-iyminmesh  =0
-iymaxmesh  =147
-;
-izminmesh  =0
-izmaxmesh  =30
-;
-jptmax = 300
-time = lonarr(jptmax)
-;----------------------------------------------------------
-; bornes pour la lecture des donnees
-;----------------------------------------------------------
-;
-;--------------------------------------------------------
-;   definition par defaut du fichier que l''on traite
-;------------------------------------------------------
-year=1
-month=12
-day=31
-niveau=1
-
-;
-iodir = '/workdir/rech/cli/rcli007/'
-prefix='ST0'
-;
-vargrid = 'T'
-varname = ' '
-vardate= '0'
-varexp = ' '
-varunit = ' '
-;
-;-------------------------------------------------------
-; lecture de la grille
-;------------------------------------------------------
-ncdf_meshlec, 'meshmask.nc'
-; longitutes in [20,380]
-isign=where(glamt gt 380.)
-glamt(isign) = glamt(isign)-360.
-isign=where(glamu gt 380.)
-glamu(isign) = glamu(isign)-360.
-isign=where(glamv gt 380.)
-glamv(isign) = glamv(isign)-360.
-isign=where(glamf gt 380.)
-glamf(isign) = glamf(isign)-360.
-delvar, isign
-; correction de la position de certains points
-; t
-glamt[170:176, 94] = glamt[170:176, 93]
-gphit[170:176, 94] = gphit[179, 94]
-glamt[179, 98:102] = glamt[178, 100]+1
-gphit[179, 98:102] = gphit[178, 98:102]
-; u
-glamu[170:176, 94] = glamu[170:176, 93]
-gphiu[170:176, 94] = gphiu[179, 94]
-glamu[179, 98:102] = glamu[178, 100]+1
-gphiu[179, 98:102] = gphiu[178, 98:102]
-; v
-glamv[170:176, 94] = glamv[170:176, 93]
-gphiv[170:176, 94] = gphiv[179, 94]
-glamv[179, 98:102] = glamv[178, 100]+1
-gphiv[179, 98:102] = gphiv[178, 98:102]
-; f
-glamf[170:176, 94] = glamf[170:176, 93]
-gphif[170:176, 94] = gphif[179, 94]
-glamf[179, 98:102] = glamf[178, 100]+1
-gphif[179, 98:102] = gphif[178, 98:102]
-; shift de la grille pour qu''elle soit en grande partie comprise
-; entre 20 et 380.
-key_shift = 31
-glamt = shift(glamt,key_shift , 0)
-gphit = shift(gphit,key_shift , 0)
-e1t = shift(e1t, key_shift, 0)
-e2t = shift(e2t,key_shift , 0)
-glamu = shift(glamu, key_shift, 0)
-gphiu = shift(gphiu, key_shift, 0)
-e1u = shift(e1u,key_shift , 0)
-e2u = shift(e2u, key_shift, 0)
-glamv = shift(glamv, key_shift, 0)
-gphiv = shift(gphiv, key_shift, 0)
-e1v = shift(e1v,key_shift , 0)
-e2v = shift(e2v, key_shift, 0)
-glamf = shift(glamf, key_shift, 0)
-gphif = shift(gphif, key_shift, 0)
-e1f = shift(e1f, key_shift , 0)
-e2f = shift(e2f, key_shift, 0)
-tmask = shift(tmask, key_shift, 0,0)
-
-
-;-------------------------------------------------------------
-;irregularmask
-;-------------------------------------------------------------
-domdef
-
-key_periodique = 1
-triangles = triangule()
-
-;----------------------------------------------------------
-; directories
-;----------------------------------------------------------
-; spawn,'echo $home',homedir
-; homedir = homedir[0]+'/'
-; spawn,'echo $workdir',workdir
-; workdir = workdir[0]+'/'
-; spawn,'echo $tmpdir',tmpdir
-; tmpdir = tmpdir[0]+'/'
-;----------------------------------------------------------
-; environnement graphique (window et ps)
-;----------------------------------------------------------
-window, colors=100 & wdelete
-if !d.n_colors gt 256 then device,  decomposed = 0 $
-ELSE device, pseudo_color=8
-loadct,39
-c_lab=0
-c_cote=0
-c_cont = (!d.n_colors-1) < 255
-tvlct, rouge,vert,bleu, /get
-coefpalit=.3
-key_portrait = 0
-!except = 2
-;----------------------------------------------------------
-grandfeuille = 29.7
-petitfeuille = 21.
-;----------------------------------------------------------
-;----------------------------------------------------------
-sauveps = 0
-
-
Index: unk/interp.pro
===================================================================
--- /trunk/interp.pro	(revision 48)
+++ 	(revision )
@@ -1,438 +1,0 @@
-;+
-; NAME: interp.pro
-;
-; PURPOSE: Performs a bilinear or bicubic interpolation on
-;          data from a regular origin grid to any grid
-
-; CATEGORY: Subroutine
-;
-; CALLING SEQUENCE: interp, znumdta, zdata_name, mask, t, glam, gphi, zresul
-;
-; INPUTS:
-;
-;          znumdta    : ID of input data file
-;          zdata_name : input data name
-;          mask       : data mask
-;          t          : timestep
-;          glam       : longitude of target grid
-;          gphi       : latitude  "     "    "
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          zresul : interpolated field
-;
-; COMMON BLOCKS:
-;        common_interp.pro
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;                       04/00 A. Jouzeau, M. Imbard
-;                       08/00 A. Jouzeau
-;                       10/01 R. Hordoir : Added boundary conditions,
-;                       Bug correction, North Pole Problem
-;                       02/02 R. Hordoir : Added North Pole Treatment
-;                       for non coherent winds.
-;                       03/2003 R.Hordoir & Christian Ethe, Irregular
-;                       grid on meridian axis
-;
-;-
-;------------------------------------------------------------
-;------------------------------------------------------------
-;------------------------------------------------------------
-PRO interp, znumdta, zdata_name,zsign, mask, t, glam, gphi, phi_field, zresul
-@common_interp
-   tempsun = systime(1)         ; pour key_performance
-;
-;-------------------------------------------------
-;  BILINEAR OR BICUBIC INTERPOLATION OF A FIELD  *
-;-------------------------------------------------
-;
-; 0. Extracting data at timestep t
-; ================================
-;
-zzresul = fltarr(jpioce, jpjoce, jpkatm)
-zzresul2 = fltarr(jpioce, jpjoce, jpkoce)
-
-FOR jk = 0, jpkatm-1 DO BEGIN
-
-
-   IF keyword_set(ndim) THEN $
-     ncdf_varget, znumdta, zdata_name, zdata, count = [jpiatm, jpjatm, 1, 1], offset = [0, 0, jk, t] ELSE BEGIN
-      IF keyword_set(key_2d) THEN $
-       ncdf_varget, znumdta, zdata_name, zdata, count = [jpiatm, jpjatm, 1], offset = [0, 0, t] ELSE $
-       ncdf_varget, znumdta, zdata_name, zdata, count = [jpiatm, jpjatm,1, 1], offset = [0, 0, 0, t]
-   ENDELSE
-
-   zmask = fltarr(jpiatm, jpjatm)
-   zmask = mask(*, *, jk)
-   printf, 40, ''
-   printf, 40, 'Data reading OK'
-   IF keyword_set(key_vari) THEN BEGIN
-      varid = ncdf_varid(znumdta, zdata_name)
-      ncdf_attget, znumdta, varid, "scale_factor", scale_factor
-      ncdf_attget, znumdta, varid, "add_offset", add_offset
-
-      printf, 40, ''
-      printf, 40, 'Scale factor and add_offset reading OK'
-   ENDIF
-; Scale Factor + Add_offset
-; Modif Fred
-; zdata=ncdf_lec('/usr/work/sur/fvi/OPA/geomag/condmag.nc',var='cond_sed')
-   zdata=ncdf_lec('/usr/work/sur/fvi/OPA/geomag/condmag.nc',var='Br')
-
-; Fin modif fred
-   zdata = zdata*scale_factor + add_offset
-
-; The data array and its mask are shifted zonally as defined in
-; namelist by lon_shift
-
-   zdata = shift(zdata, lon_shift, 0)
-   zmask = shift(zmask, lon_shift, 0)
-
-;   zdata = double(zdata)
-   IF keyword_set(nreverse) THEN BEGIN
-      zdata = reverse(zdata, 2)
-      printf, 40, 'Re-arranging data in latitudes : North-South --> South-North'
-   ENDIF
-
-
-;
-; 0.5 Checking Coherence of winds on North Pole
-; =============================================
-;
-
-
-
-    IF keyword_set(nscal) AND keyword_set(north_pole) THEN BEGIN
-
-       IF zdata_name EQ data_u_name then BEGIN
-
-
-          zdata_u=zdata
-
-          IF keyword_set(key_2d) THEN $
-          ncdf_varget, numdta_v, data_v_name, zdata_v, count = [jpiatm, jpjatm, 1], offset = [0, 0, t] ELSE $
-          ncdf_varget, numdta_v, data_v_name, zdata_v, count = [jpiatm, jpjatm,1, 1], offset = [0, 0, 0, t]
-
-
-       ENDIF
-
-       IF zdata_name EQ data_v_name then BEGIN
-
-
-          zdata_v=zdata
-
-          IF keyword_set(key_2d) THEN $
-          ncdf_varget, numdta_u, data_u_name, zdata_u, count = [jpiatm, jpjatm, 1], offset = [0, 0, t] ELSE $
-          ncdf_varget, numdta_u, data_u_name, zdata_u, count = [jpiatm, jpjatm,1, 1], offset = [0, 0, 0, t]
-
-
-      ENDIF
-
-          ; Check is made here
-
-          global_vect=replicate(0.,jpiatm,jpjatm,2)
-
-          global_vect(*,*,0)=zdata_u
-          global_vect(*,*,1)=zdata_v
-
-          northwind, global_vect,zdata_name,t
-
-          zdata_u=global_vect(*,*,0)
-          zdata_v=global_vect(*,*,1)
-
-          ; End check and correction
-
-      ; Puts back corrected value into initial variable
-
-
-       IF zdata_name EQ data_u_name then BEGIN
-
-         zdata=zdata_u
-
-       ENDIF
-
-       IF zdata_name EQ data_v_name then BEGIN
-
-         zdata=zdata_v
-
-       ENDIF
-
-    ENDIF
-
-;
-; 1. Applying mask on data and plotting
-; =====================================
-;
-   val = 1.e20
-   IF keyword_set(nmiss) THEN BEGIN
-
-       ind = where(abs(zdata) GE abs(missing_val))
-       IF ind[0] NE -1 then zmask(ind) = 0.
-
-   ENDIF
-
-   ind = where(zmask EQ 0.)
-
-   IF ind[0] NE -1 then zdata(ind) = val
-
-   ind = where(zmask NE 0.)
-   IF ind[0] NE -1 THEN min = min(zdata(ind)) ELSE BEGIN
-      min = missing_val
-   ENDELSE
-   IF ind[0] NE -1 THEN max = max(zdata(ind)) ELSE BEGIN
-      max = missing_val
-      zdata(*, *) = missing_val
-   ENDELSE
-   IF t MOD ndraw EQ 0 AND keyword_set(keydraw) AND jk MOD nlevel EQ 0 THEN BEGIN
-      IF keyword_set(key_ps) THEN openps, string(zdata_name, '_controle_iteration_', strtrim(t+1, 2), '.ps')
-      draw, zdata, lonatm, latatm, jpiatm, jpjatm, 1, 1, 3, $
-       TITLE = zdata_name+', iteration = '+strtrim(t+1,1), min, max
-   ENDIF
-;
-; 2. Extrapolating coastal values on land points
-; ==============================================
-;
-   eps = 0.
-   n = 0
-   tempsun2 = systime(1)        ; pour key_performance
-;
-; ... adding a border to overcome shifting problems
-;
-   zero = fltarr(jpiatm+2, jpjatm+2)
-   zero[1:jpiatm, 1:jpjatm] = zmask
-   zmask = zero
-   zero = fltarr(jpiatm+2, jpjatm+2)
-   zero[1:jpiatm, 1:jpjatm] = zdata
-   zdata = zero
-
-
-;
-; ... filling
-;
-
-   if max(zmask) GT 0 then begin
-
-     WHILE n LE nfil AND eps LE 1.e-5 DO BEGIN
-
-        extrap, zdata, zmask, n, val
-        eps = min(abs(zdata-replicate(val, jpiatm, jpjatm)))
-        n = n+1
-     ENDWHILE
-
-   endif
-;
-; ... recovering values on initial domain
-;
-   zdata = zdata[1:jpiatm, 1:jpjatm]
-   zmask = zmask[1:jpiatm, 1:jpjatm]
-;
-   if keyword_set(key_performance) THEN print, 'temps extrap', systime(1)-tempsun2
-;  .. drawing
-   IF t MOD ndraw EQ 0 AND keyword_set(keydraw) AND jk MOD nlevel EQ 0 THEN BEGIN
-      draw, zdata, lonatm, latatm, jpiatm, jpjatm, 1, 2, 3, $
-       TITLE = 'extrapolated '+zdata_name+', iteration = '+strtrim(t+1,1), min, max
-   ENDIF
-
-   ind = where(zmask NE 0. AND zdata GE val)
-   IF n_elements(ind) GT 1 THEN BEGIN
-      print, 'We stop because of insufficient extrapolation on missing values'
-      print, n_elements(ind), ' points non extrapolated'
-      print, 'Increase nfill in naminterp.pro'
-      stop
-   ENDIF
-
-
-; 3. Treatment of Boundary Conditions
-; ========================================================
-; Treatment of boundary conditions require extra stripes
-; Size of extra stripe is calculated after a given extension
-; along x and y axis on the OUTPUT grid. iplus and jplus will be
-; the number of extra points required for the extra stripes of the
-; INPUT grid.
-
-
-   iplus=fix((ext_x*pres_x)/mean(dx))
-   jplus=fix((ext_y*pres_y)/mean(abs(phi_field(1:jpjatm/2)-shift(phi_field(1:jpjatm/2),1))))
-
-; Initialisation of array for the northern boundary condition
-
-   zdata_north=replicate(0.,jpiatm,jpjatm+jplus)
-   zdata_north(*,0:jpjatm-1)=zdata
-
-; Data of the input grid is duplicated for the northern boundary condition
-
-   zdata_inv=shift(zdata_north(*,jpjatm-1-jplus+1:jpjatm-1),jpiatm/2,0)
-
-   zdata_inv=reverse(zdata_inv,2)
-
-   zdata_north(*,jpjatm:jpjatm+jplus-1)=zdata_inv
-
-; Transition to East/West Boundary Conditions
-
-   zdata=zdata_north
-
-; East/West Boundary Condition, zdata_extend will be the array that
-; contains both northern boundary condition and E/W boundary
-; condition, on the input grid
-
-
-   zdata_extend=replicate(0.,jpiatm+2*iplus,jpjatm+jplus)
-
-   zdata_extend(iplus:jpiatm-1+iplus,*)=zdata
-
-   zdata_extend(0:iplus-1,*)=zdata(jpiatm-1-iplus+1:jpiatm-1,*)
-
-   zdata_extend(jpiatm+iplus:jpiatm+2*iplus-1,*)=zdata(0:iplus-1,*)
-
-;
-; 3.1 Interpolating data on output grid and plotting result
-; =========================================================
-; The interpolation is made bellow. We use the index of the input grid
-; to interpolate which makes we need to convert the latitudes and
-; longitudes of the output grid its dimensions. ext_x*pres_x/dx is added to
-; take into account the extra stripe at the left handside of the input
-; grid
-
-   print, 'Time Step=',t
-   print, 'Input Level=',jk
-
-
-    glam2 = (glam - west_lon+ext_x*pres_x  )/dx
-    gphi2 = replicate(0.,jpioce,jpjoce)
-
-
-
-    for ji = 0, jpioce - 1 do begin
-       for jj = 0, jpjoce - 1 do begin
-
-           diff = - gphi(ji,jj)  $
-                  + phi_field
-
-           diff = where( diff GE 0. )
-
-
-           j_above=min( diff )
-
-           if diff(0) eq -1 then begin
-             ;   print, 'Output grid goes above input grid latitude top value !!!'
-             ;   print, 'Output grid top value has been take as input grid maximum value'
-             ;   print, 'Please check results at the vicinity of North Pole'
-
-               j_fine = jpjatm-1
-               gphi2(ji,jj) = j_fine
-           endif else begin
-
-             j_bellow = j_above -1
-
-              if j_bellow GE 0 then begin
-
-               j_fine  = j_bellow
-
-               if j_above LT jpjatm then begin
-                j_fine = j_bellow+( gphi(ji,jj)-phi_field(j_bellow) )/( phi_field(j_above)-phi_field(j_bellow) )
-               endif
-
-               gphi2(ji,jj) = j_fine
-               if j_fine GT j_above then stop
-
-              endif else begin
-
-               j_fine = j_above
-
-               gphi2(ji,jj) = j_fine
-
-              endelse
-
-
-           endelse
-
-    endfor
-   endfor
-
-
-   IF keyword_set(ninterp) THEN BEGIN
-
-      zresul = interpolate(zdata_extend, glam2, gphi2, cubic = -.5)
-
-   ENDIF ELSE BEGIN
-
-      zresul = bilinear(zdata_extend , glam2, gphi2)
-
-   ENDELSE
-
-   IF t MOD ndraw EQ 0 AND keyword_set(keydraw) AND jk MOD nlevel EQ 0 THEN BEGIN
-      draw, zresul, glam, gphi, jpioce, jpjoce, 1, 3, 3, $
-       TITLE = 'interpolated '+zdata_name+', iteration = '+strtrim(t+1,1), min, max
-      IF keyword_set(key_ps) THEN BEGIN
-         closeps
-      ENDIF ELSE BEGIN
-         print, 'Press return to continue'
-         zxc = strarr(1)
-         read, zxc
-      ENDELSE
-   ENDIF
-   zzresul(*, *, jk) = temporary(zresul)
-ENDFOR
-zresul = zzresul
-
-;
-; 4. Interpolating data on the vertical axis if the outdept not equal datadept
-; ===========================================================================
-
-
-IF keyword_set(ndim) THEN BEGIN
-
-    nlev_flag = WHERE ( datadept(0:jpkatm-1) ne outdept(0:jpkoce-1) )
-    IF nlev_flag(0) NE -1 THEN BEGIN
-        FOR jk = 0, jpkoce-1 DO BEGIN
-
-            jn = where(abs(datadept) GE abs(outdept(jk)) $
-                       AND abs(shift(datadept, 1)) LT abs(outdept(jk)))
-
-
-            IF min(jn) GE 0 THEN BEGIN
-
-                ikt=jn-1
-                ikb=jn
-
-                IF jn NE 0 then begin
-
-                  zt1=abs(outdept(jk))-abs(datadept(ikt))
-                  zt2=abs(datadept(ikb))-abs(outdept(jk))
-                  ztx1=abs(datadept(ikb))-abs(datadept(ikt))
-                  za1=replicate(zt1/ztx1, jpioce, jpjoce)
-                  zb1=replicate(zt2/ztx1, jpioce, jpjoce)
-                  zzresul2(*, *, jk) = temporary(za1*zzresul(*, *, ikb)+zb1*zzresul(*, *, ikt))
-
-                ENDIF ELSE BEGIN
-
-                  zzresul2(*, *, jk) = zzresul(*, *, ikb)
-
-                ENDELSE
-
-            ENDIF ELSE BEGIN
-
-                zzresul2(*, *, jk) = temporary(zzresul2(*, *, jk-1))
-
-            ENDELSE
-        ENDFOR
-        zresul = zzresul2
-    ENDIF ELSE BEGIN
-        print, ' '
-        print, 'No need to perform vertical interpolation'
-        print, ' '
-    ENDELSE
-ENDIF
-
-
-   if keyword_set(key_performance) THEN print, 'temps interp', systime(1)-tempsun
-
-return
-END
Index: unk/interpolation.pro
===================================================================
--- /trunk/interpolation.pro	(revision 48)
+++ 	(revision )
@@ -1,366 +1,0 @@
-;+
-;
-; NAME: interpolation.pro
-;
-; PURPOSE: Interpolates data from a regular origin grid to any grid
-;
-; CATEGORY: Program
-;
-; CALLING SEQUENCE: interpolation
-;
-; INPUTS: Complete the INIT_PATH and NAMINTERP files
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS: NetCDF file(s) containing the interpolated field
-;
-; COMMON BLOCKS:
-;          common_interp.pro
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;                       08/00 A. Jouzeau
-;                       01/02 R. Hordoir
-;                       03/2003 R. Hordoir & C. Ethe
-;
-;-
-;------------------------------------------------------------
-;------------------------------------------------------------
-;------------------------------------------------------------
-PRO interpolation
-@common_interp
-   tempsun = systime(1) ; pour key_performance
-print,'***********************************************'
-print,'********** OPA INTERPOLATION PACKAGE **********'
-print,'***********************************************'
-;
-unit = 40
-openw, unit, 'interp_output'
-;
-printf, 40, '*******************************************'
-printf, 40, '*         INTERPOLATION PROGRAM           *'
-printf, 40, '*******************************************'
-printf, 40, ''
-printf, 40, '******************************************'
-printf, 40, '* USE :                                  *'
-printf, 40, '* --> Input  grid : Regular              *'
-printf, 40, '* --> Output grid : Regular or Irregular *'
-printf, 40, '******************************************'
-;
-;--------------------------------------------------
-; INITIALISATIONS                                 *
-;--------------------------------------------------
-;
-printf, 40, ''
-printf, 40, 'I- Interpolation initialisations'
-printf, 40, '================================'
-;
-@naminterp
-;
-printf, 40, ''
-printf, 40, 'II- Paths initialisations'
-printf, 40, '========================='
-;
-@init_path
-
-;
-;---------------------------------------------------
-; READING INPUT MASK & OUTPUT COORDINATES          *
-;---------------------------------------------------
-;
-printf, 40, ''
-printf, 40, 'III- Opening data files and reading input mask and output coordinates'
-printf, 40, '====================================================================='
-;
-netcdf_input, mask
-;
-; Coordinates of input grid (for plotting purposes)
-;
-lonatm = fltarr(jpiatm)
-latatm = fltarr(jpjatm)
-FOR i = 0, jpiatm-1 DO BEGIN
-   lonatm(i) = west_lon + i*dx
-ENDFOR
-FOR j = 0, jpjatm-1 DO BEGIN
-   latatm(j) = phi_input(j)
-ENDFOR
-;
-;---------------------------------------------------
-; DATA MASK PREPROCESSING                          *
-;---------------------------------------------------
-;
-printf, 40, ''
-printf, 40, 'IV- Data mask preprocessing'
-printf, 40, '==========================='
-;
-IF keyword_set(negmask) THEN BEGIN
-   mask = abs(temporary(mask))
-   printf, 40, 'Taking the abs of mask (-1 --> +1)'
-ENDIF
-IF keyword_set(nreverse) THEN BEGIN
-   mask = reverse(mask, 2)
-   printf, 40, 'Re-arranging mask in latitudes : North-South --> South-North'
-ENDIF
-ind = where(mask NE 0 AND mask NE 1)
-IF n_elements(ind) NE 1 THEN BEGIN
-   printf, 40, ''
-   printf, 40, '************************************************************'
-   printf, 40, '* ERROR: data mask file must contain ONLY 0 and 1 values!! *'
-   printf, 40, '************************************************************'
-   printf, 40, ''
-   printf, 40, 'program stops'
-   stop
-ENDIF
-IF keyword_set(invmask) THEN BEGIN
-   mask = inv_mask(mask)
-   printf, 40, 'Giving value = 1 to mask on ocean points '
-ENDIF
-IF keyword_set(extend)  THEN BEGIN
-   mask = preproc_mask(mask)
-   printf, 40, 'Extending mask over one point on ocean points '
-ENDIF
-
-
-; mask = double(mask)
-
-;
-;---------------------------------------------------
-; INTERPOLATION                                    *
-;---------------------------------------------------
-;
-printf, 40, ''
-printf, 40, 'V- Interpolation'
-printf, 40, '================'
-;
-; 0. Creating output file and storing attributes
-; ==============================================
-;
-IF keyword_set(nscal) THEN BEGIN
-   printf, 40, ''
-   printf, 40, ' V-1- Writing attributes of interpolated field to files'
-   printf, 40, ' ------------------------------------------------------'
-;
-; ... x-component of interpolated field
-   printf, 40, ''
-   printf, 40, 'Writing attributes of x-component of interpolated field'
-   ncdf_varget, nummsh, mask_u_name, umask, count = [jpioce, jpjoce, jpkoce, 1]
-   netcdf_output, mask_u_name, umask, data_u_name, lon_u, lat_u, outputfile_x, $
-    title_x, long_x_name, POINT = "u", $
-    numout_u, varid_u, numdta_u
-; ... y-component of interpolated field
-   printf, 40, ''
-   printf, 40, 'Writing attributes of y-component of interpolated field'
-   ncdf_varget, nummsh, mask_v_name, vmask, count = [jpioce, jpjoce, jpkoce, 1]
-   netcdf_output, mask_v_name, vmask, data_v_name, lon_v, lat_v, outputfile_y, $
-    title_y, long_y_name, POINT = "v", $
-    numout_v, varid_v, numdta_v
-ENDIF ELSE BEGIN
-   printf, 40, ''
-   printf, 40, ' V-1- Writing attributes of interpolated field to file'
-   printf, 40, ' -----------------------------------------------------'
-;
-   ncdf_varget, nummsh, mask_t_name, tmask, count = [jpioce, jpjoce, jpkoce, 1]
-   netcdf_output, mask_t_name, tmask, data_name, lon_t, lat_t, outputfile, $
-    title, long_name, POINT = "t", $
-    numout, varid, numdta
-ENDELSE
-
-
-;
-; 1. Interpolation
-; ================
-;
-printf, 40, ''
-printf, 40, ' V-2- Interpolating, correcting and writing field(s)'
-printf, 40, ' ---------------------------------------------------'
-printf, 40, ''
-printf, 40, ' **** ENTERING TEMPORAL LOOP ****'
-;
-;  BEGINNING OF TIME LOOP
-;
-IF keyword_set(nscal) THEN BEGIN
-   mi_u = 1.e20
-   ma_u = -1.e20
-   mi_v = 1.e20
-   ma_v = -1.e20
-ENDIF ELSE BEGIN
-   mi = 1.e20
-   ma = -1.e20
-ENDELSE
-
-
-FOR t = nit000-1, nitend-1 DO BEGIN
-   tempsun4 = systime(1)        ; pour key_performance
-   printf, 40, ''
-   printf, 40, '  ***>> TIME ITERATION NUMBER :', t+1
-   IF keyword_set(ndim) THEN BEGIN
-      interp, numdta, data_name,1, mask, t, lon_t, lat_t, phi_input, zresul
-   ENDIF ELSE BEGIN
-      IF keyword_set(nscal) THEN BEGIN
-         printf, 40, 'A vectorial field has been chosen for interpolation'
-         IF keyword_set(north_pole) THEN BEGIN
-         printf, 40, 'Vectorial Fied will be Tested for Coherence nearby North Pole'
-         ENDIF
-         printf, 40, ''
-         printf, 40, 'interpolating ', data_u_name, ' at u-point and v-point '
-         interp, numdta_u, data_u_name,1, mask, t, lon_u, lat_u, phi_input_u, zresul_uu
-         interp, numdta_u, data_u_name,1, mask, t, lon_v, lat_v, phi_input_u, zresul_uv
-         printf, 40, 'interpolating ', data_v_name, ' at v-point and u-point '
-         interp, numdta_v, data_v_name,1 ,mask, t, lon_v, lat_v, phi_input_v, zresul_vv
-         interp, numdta_v, data_v_name,1,mask, t, lon_u, lat_u,  phi_input_v, zresul_vu
-      ENDIF ELSE BEGIN
-         printf, 40, ''
-         printf, 40, 'interpolating ', data_name, ' at t-point'
-         interp, numdta, data_name, 1,mask, t, lon_t, lat_t, phi_input, zresul
-      ENDELSE
-   ENDELSE
-
-
-
-;
-; 2. Angles correction for 2D fields
-; ==================================
-;
-   IF keyword_set(nscal) THEN BEGIN
-      printf, 40, ''
-      printf, 40, ' angles correction'
-;
-      tempsun2 = systime(1)      ; pour key_performance
-      correc_angle, zresul_uu, zresul_uv, zresul_vv, zresul_vu, zresul_u, zresul_v
-      if keyword_set(key_performance) THEN print, 'temps angles', systime(1)-tempsun2
-      IF t MOD ndraw EQ 0 AND keyword_set(keydraw) THEN BEGIN
-         ncdf_varget, numdta_u, data_u_name, zdata_u, $
-          count = [jpiatm, jpjatm, 1], offset = [0, 0, t]
-         ncdf_varget, numdta_v, data_v_name, zdata_v, $
-          count = [jpiatm, jpjatm, 1], offset = [0, 0, t]
-         zdata_u = zdata_u*scale_factor + add_offset
-         zdata_v = zdata_v*scale_factor + add_offset
-         IF keyword_set(nreverse) THEN zdata_u = reverse(zdata_u, 2)
-         IF keyword_set(nreverse) THEN zdata_v = reverse(zdata_v, 2)
-         zu = zdata_u
-         zv = zdata_v
-         IF keyword_set(nmiss) THEN BEGIN
-            ind = where(abs(zu) GE missing_val)
-            zu(ind) = 0.
-            ind = where(abs(zv) GE missing_val)
-            zv(ind) = 0.
-         ENDIF
-         ind = where(mask NE 0.)
-         minu = min(zu(ind))
-         maxu = max(zu(ind))
-         minv = min(zv(ind))
-         maxv = max(zv(ind))
-         IF keyword_set(key_ps) THEN $
-          openps, string('control_corrected_winds_iteration_', strtrim(t+1, 2), '.ps')
-         draw, zdata_u, lonatm, latatm, jpiatm, jpjatm, 2, 1, 2, $
-          TITLE = data_u_name+' data, iteration = '+strtrim(t+1,1), minu, maxu, /land
-         draw, zdata_v, lonatm, latatm, jpiatm, jpjatm, 2, 2, 2, $
-          TITLE = data_v_name+' data, iteration = '+strtrim(t+1,1), minv, maxv, /land
-         draw, zresul_u, lon_f, lat_f, jpioce, jpjoce, 2, 3, 2, $
-          TITLE = data_u_name+' interpolated, iteration = '+strtrim(t+1,1), minu, maxu, /land
-         draw, zresul_v, lon_f, lat_f, jpioce, jpjoce, 2, 4, 2, $
-          TITLE = data_v_name+' interpolated, iteration = '+strtrim(t+1,1), minv, maxv, /land
-         IF keyword_set(key_ps) THEN BEGIN
-            closeps
-         ENDIF ELSE BEGIN
-            print, 'Press return to continue'
-            zxc = strarr(1)
-            read, zxc
-         ENDELSE
-      ENDIF
-   ENDIF
-
-;
-; 3. NetCDF output to file of interpolated field
-; ==============================================
-;
-    tempsun3 = systime(1) ; pour key_performance
-  IF keyword_set(nscal) THEN BEGIN
-      printf, 40, ''
-      printf, 40, 'Storing components of interpolated field'
-
-
-      ncdf_varput, numout_u, varid_u, zresul_u, offset = [0, 0, 0, t-nit000+1]
-      ind = where(abs(zresul_u) LT 1.e10)
-      IF ind[0] NE -1 THEN BEGIN
-         IF min(zresul_u) LT mi_u THEN mi_u = min(zresul_u[ind])
-         IF max(zresul_u) GT ma_u THEN ma_u = max(zresul_u[ind])
-      ENDIF ELSE BEGIN
-         mi_u = missing_val
-         ma_u = missing_val
-      ENDELSE
-
-      ncdf_varput, numout_v, varid_v, zresul_v, offset = [0, 0, 0, t-nit000+1]
-      ind = where(abs(zresul_v) LT 1.e10)
-      IF ind[0] NE -1 THEN BEGIN
-         IF min(zresul_v) LT mi_v THEN mi_v = min(zresul_v[ind])
-         IF max(zresul_v) GT ma_v THEN ma_v = max(zresul_v[ind])
-      ENDIF ELSE BEGIN
-         mi_v = missing_val
-         ma_v = missing_val
-      ENDELSE
-   ENDIF ELSE BEGIN
-      printf, 40, ''
-      printf, 40, 'Storing field'
-
-      ncdf_varput, numout, varid, zresul, offset = [0, 0, 0, t-nit000+1]
-      ind = where(abs(zresul) LT 1.e10)
-      IF min(zresul) LT mi THEN mi = min(zresul[ind])
-      IF max(zresul) GT ma THEN ma = max(zresul[ind])
-   ENDELSE
-      if keyword_set(key_performance) THEN print, 'temps ecriture variable', systime(1)-tempsun3
-      if keyword_set(key_performance) THEN printf, 40, 'temps ecriture variable', systime(1)-tempsun3
-      if keyword_set(key_performance) THEN print, 'temps boucle', systime(1)-tempsun4
-      if keyword_set(key_performance) THEN printf, 40, 'temps boucle', systime(1)-tempsun4
-ENDFOR
-;
-;  END OF TIME LOOP
-;
-printf, 40, ''
-printf, 40, '**** END OF TEMPORAL LOOP ****'
-;
-printf, 40, ''
-printf, 40, 'Closing files'
-;
-; storing min and max in attributes
-;
-IF keyword_set(nscal) THEN BEGIN
-   ncdf_control, numout_u, /redef
-   ncdf_control, numout_v, /redef
-   ncdf_attput, numout_u, varid_u, "valid_min", mi_u
-   ncdf_attput, numout_u, varid_u, "valid_max", ma_u
-   ncdf_attput, numout_v, varid_v, "valid_min", mi_v
-   ncdf_attput, numout_v, varid_v, "valid_max", ma_v
-ENDIF ELSE BEGIN
-   ncdf_control, numout, /redef
-   ncdf_attput, numout, varid, "valid_min", mi
-   ncdf_attput, numout, varid, "valid_max", ma
-ENDELSE
-IF keyword_set(key_mask) THEN ncdf_close, nummsk
-IF keyword_set(nscal) THEN BEGIN
-   ncdf_close, numdta_u
-   ncdf_close, numdta_v
-   ncdf_close, numout_u
-   ncdf_close, numout_v
-ENDIF ELSE BEGIN
-   ncdf_close, numout
-   ncdf_close, numdta
-ENDELSE
-ncdf_close, nummsh
-;
-printf, 40, ''
-printf, 40, '*******************************************'
-printf, 40, '*      END OF INTERPOLATION PROGRAM       *'
-printf, 40, '*******************************************'
-;
-close, 40
-   if keyword_set(key_performance) THEN print, 'temps total', systime(1)-tempsun
-   if keyword_set(key_performance) THEN printf,40, 'temps total', systime(1)-tempsun
-;
-return
-END
Index: unk/inv_mask.pro
===================================================================
--- /trunk/inv_mask.pro	(revision 48)
+++ 	(revision )
@@ -1,45 +1,0 @@
-;+
-; NAME: inv_mask.pro
-;
-; PURPOSE: Puts 0 where mask is equal to 1 and vice versa
-;
-; CATEGORY: Function
-;
-; CALLING SEQUENCE: inv_mask, mask
-;
-; INPUTS:
-;          mask : mask field composed of 0 and 1 values
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          mask : mask field composed of 0 and 1 values
-;                 inverted
-;
-; COMMON BLOCKS: None
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;
-;-
-;------------------------------------------------------------
-;------------------------------------------------------------
-;------------------------------------------------------------
-FUNCTION inv_mask, mask
-printf, 40, ''
-printf, 40, 'Entering inv_mask'
-z = mask
-stop
-zero = where(mask EQ 0)
-one = where(mask EQ 1)
-z[zero] = 1
-z[one] = 0
-printf, 40, ''
-printf, 40, 'Inversion done'
-return, z
-END
Index: unk/naminterp.pro
===================================================================
--- /trunk/naminterp.pro	(revision 48)
+++ 	(revision )
@@ -1,227 +1,0 @@
-;---------------------------------------------------
-; INTERPOLATION INITIALISATIONS                    *
-;---------------------------------------------------
-@common_interp
-;
-; 1. General information concerning the interpolation
-; ===================================================
-;
-;  1.1. Dimension of the field being interpolated (2D or 3D)
-;  ---------------------------------------------------------
-;   2D field --> ndim = 0
-;   3D field --> ndim = 1
-ndim = 0
-;   Case ndim = 0
-;   -if the field and mask are really 2D (x,y(,t)) then
-;      key_2d = 1
-;   -else if they are (x,y,z_a(,t)) where z_a=1 then
-;      key_2d = 0
-key_2d = 1
-;
-;  1.2. Nature of the field being interpolated (scalar ou vector)
-;  --------------------------------------------------------------
-;   scalar --> nscal = 0
-;   vector --> nscal = 1
-nscal = 0
-;nscal = 1
-;
-;  1.3. Type of interpolation needed (bilinear ou bicubic)
-;  -------------------------------------------------------
-;   bilinear --> ninterp = 0
-;   bicubic  --> ninterp = 1
-ninterp = 0
-;ninterp = 1
-;
-;  1.4. Mask on points
-;  -------------------
-;   key_mask = 1 if some points are masked
-;            = 0 if no masked points
-;
-key_mask = 0
-;
-;  1.5. Maximum iteration number for extrapolation
-;  -----------------------------------------------
-;
-nfil = 100
-;
-;  1.6. Frequency of drawing : every ndraw time iterations
-;  -------------------------
-;
-keydraw = 0 ; =0 if no drawing =1 else
-key_ps = 0  ; =0 if no Postscript file wanted =1 if PS wanted (implies keydraw=1)
-ndraw = 1
-nlevel = 33 ; every nlevel levels
-;
-; 2. Information about the data file
-; ==================================
-;
-;  2.1. Fields names
-;  -----------------
-; ... data
-IF keyword_set(nscal) THEN BEGIN
-   data_u_name = 'stress_x'
-   data_v_name = 'stress_y'
-ENDIF ELSE BEGIN
-;   data_name = 'cond_sed'
-   data_name = 'Br'
-
-ENDELSE
-; ... units
-units = "siemens"
-; ... input grid mask
-IF keyword_set(key_mask) THEN mask_name = 'tmask'
-; Input Latitude Axis
-IF keyword_set(nscal) THEN BEGIN
-   y_axis_u = 'nav_lat'
-   y_axis_v = 'nav_lat'
-ENDIF ELSE BEGIN
-   y_axis   = 'la'
-ENDELSE
-
-; ... input grid depth (3D field only)
-IF keyword_set(ndim) THEN BEGIN
-   datadept_name = 'deptht'
-;  ... location (ndep =1 if depth in data file, =0 if in mask file)
-   ndep = 1
-ENDIF
-; ... time
-time_name = 'lo'
-; ... output grid mask(s)
-IF keyword_set(nscal) THEN BEGIN
-   mask_u_name = 'umask'
-   mask_v_name = 'vmask'
-ENDIF ELSE BEGIN
-   mask_t_name = 'tmask'
-ENDELSE
-; ... output grid depth
-IF keyword_set(ndim) THEN outdept_name = 'gdept'
-; ... output grid coordinates
-IF keyword_set(nscal) THEN BEGIN
-   lon_u_name = 'glamu'
-   lat_u_name = 'gphiu'
-   lon_v_name = 'glamv'
-   lat_v_name = 'gphiv'
-   lon_f_name = 'glamf'
-   lat_f_name = 'gphif'
-ENDIF ELSE BEGIN
-   lon_name = 'nav_lon'
-   lat_name = 'nav_lat'
-ENDELSE
-; ... missing value
-;
-;     nmiss = 0 --> no missing value
-;     nmiss = 1 --> missing value of value missing_val
-;     CAUTION : missing_val stands for the ABSOLUTE VALUE of your
-;     input file missing value. Please enter missing_val LOWER THAN
-;     THE ABSOLUTE VALUE of the Missing value of your file.
-
-nmiss = 0
-missing_val = 85
-
-;
-;  2.2. Spatial resolution
-;  -----------------------
-;
-
-jpiatm = 360l      ; l for long integer PLEASE LEAVE IT
-jpjatm = 180l      ; l for long integer PLEASE LEAVE IT
-jpkatm = 1l       ; l for long integer PLEASE LEAVE IT
-dx = 1.            ; Grid size along x axis of the input regular grid
-south_lat = -89.5  ; Southernmost latitude of the input grid
-lon_shift= 180     ; Use lon_shift in order to have both input and output grid calculating longitudes the same way (-180 to 180, or, 0 to 360), this will avoid you a lot of problems
-west_lon = -179.5  ; Longitude at the left handside of the input grid, once lon_shift has been used
-north_pole = 1     ; Is the upper line of the domain at a latitude of +90 degrees, 1 = yes, 0 = no
-
-
-;
-;  2.3. Temporal resolution
-;  ------------------------
-;
-nit000 = 1                    ; first time step
-nitend = 1                   ; last time step
-nstep = nitend-nit000+1       ; number of steps
-;
-;  2.4. Pretreatment of input variables
-;  ------------------------------------
-;   data = data*scale_factor + add_offset
-;   when handling multiple files with scale_factor and
-;   add_offset defined, put key_vari=1 in case they change
-;   from one file to another
-;
-key_vari = 0
-scale_factor = 1.
-add_offset = 0.
-;
-;   if mask equal -1 on unmasked point --> negmask = 1
-;   if mask equal +1 on unmasked point --> negmask = 0
-;
-negmask = 0
-;
-;   latitudes from south to north  -->  reverse = 0
-;   latitudes from north to south  -->  reverse = 1
-;
-nreverse = 1
-;
-;   mask = 1 on OCEAN points  -->  invmask = 0
-;   mask = 1 on LAND  points  -->  invmask = 1
-;
-invmask = 0
-;
-;   No change on mask extension                 --> extend = 0
-;   Extend mask over one point on ocean points  --> extend = 1
-;   NB: ONLY 2D FIELDS ALLOWED
-;
-extend = 0
-;
-; 3. Information about the output grid
-; ====================================
-;
-; ... coordinates names
-;
-;   jpioce : number of longitude points
-;   jpjoce : number of latitude points
-;   jpkoce : number of vertical levels
-;
-jpioce = 182l ; l for long integer PLEASE LEAVE IT
-jpjoce = 149l ; l for long integer PLEASE LEAVE IT
-jpkoce = 1l  ; l for long integer PLEASE LEAVE IT
-pres_x=2.     ; Precision of the output grid along x axis
-pres_y=2.     ; Precision of the output grid along y axis
-ext_x=40      ; Number of extension point on the output grid to treat for E/W boundary conditions
-ext_y=40      ; Number of extension point on the output grid to treat for North fold boundary conditions;
-;   modlam --> 0 if all longitudes are lower than 360 degrees
-;          --> 1 if some longitudes are greater than 360 degrees
-;
-modlam = 0
-;
-; 4. Title(s) of output file(s)
-; =============================
-;
-IF keyword_set(nscal) THEN BEGIN
-   long_x_name = 'Zonal wind stress'
-   title_x = "Daily interpolated OMIP stress x wind on ORCA2 grid"
-   long_y_name = 'Meridional wind stress'
-   title_y = "Daily interpolated OMIP stress y wind on ORCA2 grid"
-ENDIF ELSE BEGIN
-   long_name = 'Salinity'
-   title = "Monthly Levitus Sea Salinity corrected"
-ENDELSE
-;
-key_performance = 0
-;
-printf, 40, ''
-printf, 40, 'Field''s dimension :'
-IF keyword_set(ndim)  THEN printf, 40, ' --> 3D' ELSE printf, 40, ' --> 2D'
-;
-IF keyword_set(nscal) THEN BEGIN
-   printf, 40, 'Interpolation of the vector array : '
-   printf, 40, ' --> ', '[', data_u_name, ',', data_v_name, ']'
-ENDIF ELSE BEGIN
-   printf, 40, 'Interpolation of the scalar array : '
-   printf, 40, ' --> ', data_name
-ENDELSE
-;
-printf, 40, 'Type of the interpolation :'
-IF keyword_set(ninterp) THEN printf, 40, ' --> bicubic' $
-                        ELSE printf, 40, ' --> bilinear'
-;
Index: unk/netcdf_input.pro
===================================================================
--- /trunk/netcdf_input.pro	(revision 48)
+++ 	(revision )
@@ -1,174 +1,0 @@
-;+
-; NAME: netcdf_input.pro
-;
-; PURPOSE: Reads coordinates, data and mask
-;
-; CATEGORY: Subroutine
-;
-; CALLING SEQUENCE: netcdf_input, mask
-;
-; INPUTS:
-;
-;          maskfile  : name of mask file
-;          gridfile  : name of grid file
-;          mask_name : mask name
-;  SCALAR FIELD :
-;          datafile  : name of input data file
-;          lon_name  : name of output longitude variable
-;          lat_name  : name of output latitude variable
-;  VECTOR FIELD :
-;          data_u_file  : name of input data x-component file
-;          data_v_file  : name of input data y-component file
-;          lon_u_name   : name of output longitude variable at u-point
-;          lat_u_name     : name of output latitude variable at u-point
-;          lon_v_name     : name of output longitude variable at v-point
-;          lat_v_name     : name of output latitude variable at v-point
-;          lon_f_name     : name of output longitude variable at f-point
-;          lat_f_name     : name of output latitude variable at f-point
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          mask     : mask of the origin grid
-;          nummsk   : ID of input mask file
-;          nummsh   : ID of output coordinates and mask file
-;  SCALAR FIELD :
-;          lon_t  : longitudes of target grid at t-point
-;          lat_t  : latitudes of target grid at t-point
-;          numdta : ID of input data file
-;  VECTOR FIELD :
-;          lon_u    : longitudes of target grid at u-point
-;          lat_u    : latitudes of target grid at u-point
-;          lon_v    : longitudes of target grid at v-point
-;          lat_v    : latitudes of target grid at v-point
-;          lon_f    : longitudes of target grid at f-point
-;          lat_f    : latitudes of target grid at f-point
-;          numdta_u : ID of input data x-component file
-;          numdta_v : ID of input data y-component file
-;
-; COMMON BLOCKS:
-;          common_interp.pro
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;                       08/00 A. Jouzeau
-;                       03/2003 R.Hordoir Added reading of meridian
-;                       axis in input file
-;
-;-
-;------------------------------------------------------------
-;------------------------------------------------------------
-;------------------------------------------------------------
-PRO netcdf_input, mask
-@common_interp
-;
-; 0. Opening files
-; ================
-;
-printf, 40, ''
-IF keyword_set(key_mask) THEN nummsk = ncdf_open(input_dir+ '/'+ maskfile)
-IF keyword_set(key_mask) THEN printf, 40, maskfile, ' opening OK'
-IF keyword_set(nscal) THEN BEGIN
-   numdta_u = ncdf_open(string(input_dir, '/', data_u_file))
-   printf, 40, data_u_file, ' opening OK'
-   numdta_v = ncdf_open(string(input_dir, '/', data_v_file))
-   IF data_u_file NE data_v_file THEN printf, 40, data_v_file, ' opening OK'
-ENDIF ELSE BEGIN
-   numdta = ncdf_open(input_dir+ '/'+ datafile)
-   printf, 40, datafile, ' opening OK'
-ENDELSE
-nummsh = ncdf_open(input_dir+ '/'+ gridfile)
-printf, 40, gridfile, ' opening OK'
-;
-; 1. Reading coordinates of output grid
-; =====================================
-;
-IF keyword_set(nscal) THEN BEGIN
-   ncdf_varget, nummsh, lon_u_name, lon_u
-   ncdf_varget, nummsh, lat_u_name, lat_u
-   ncdf_varget, nummsh, lon_f_name, lon_f
-   ncdf_varget, nummsh, lat_f_name, lat_f
-   ncdf_varget, nummsh, lon_v_name, lon_v
-   ncdf_varget, nummsh, lat_v_name, lat_v
-   IF keyword_set(modlam) THEN BEGIN
-      ii=where(lon_f gt 360)
-      lon_f(ii)=lon_f(ii)-360
-      ii=where(lon_u gt 360)
-      lon_u(ii)=lon_u(ii)-360
-      ii=where(lon_v gt 360)
-      lon_v(ii)=lon_v(ii)-360
-   ENDIF
-ENDIF ELSE BEGIN
-   ncdf_varget, nummsh, lon_name, lon_t
-   ncdf_varget, nummsh, lat_name, lat_t
-   IF keyword_set(modlam) THEN BEGIN
-      ii=where(lon_t gt 360)
-      lon_t(ii)=lon_t(ii)-360
-   ENDIF
-ENDELSE
-printf, 40, ''
-printf, 40, 'Coordinates of output grid reading OK'
-;
-; 2. Reading the Input Axis and data mask
-; =======================================
-;
-; Input Axis Vertical Axis (Horizontal Axis is supposed to be fully regular)
-       phi_input=replicate(0,jpiatm,jpjatm)
-
-IF keyword_set(nscal) THEN BEGIN
-
-       ncdf_varget, numdta_u,y_axis_u,phi_input_u, count = [jpiatm, jpjatm]
-       ncdf_varget, numdta_v,y_axis_v,phi_input_v, count = [jpiatm, jpjatm]
-
-       phi_input_u=phi_input_u(0,*)
-       phi_input_v=phi_input_v(0,*)
-
-ENDIF ELSE BEGIN
-
-
-       ncdf_varget, numdta  ,y_axis  ,phi_input  , count = [ jpjatm]
-;   modif FRED
-       phi_input=reverse(phi_input)
-;   fin modif FRED
-;stop
-;       phi_input=phi_input(0,*)
-
-ENDELSE
-
-; Data Mask
-
-IF keyword_set(key_mask) THEN BEGIN
-   IF keyword_set(ndim) THEN $
-    ncdf_varget, nummsk, mask_name, mask, count = [jpiatm, jpjatm, jpkatm, 1] ELSE BEGIN
-
-    IF keyword_set(key_2d) THEN $
-       ncdf_varget, nummsk, mask_name, mask, count = [jpiatm, jpjatm] ELSE $
-       ncdf_varget, nummsk, mask_name, mask, count = [jpiatm, jpjatm, 1, 1]
-    ENDELSE
-
-   printf, 40, ''
-   printf, 40, 'Data mask reading OK'
-ENDIF ELSE BEGIN
-   IF keyword_set(ndim) THEN mask = replicate(1., jpiatm, jpjatm, jpkatm) ELSE $
-    mask = replicate(1., jpiatm, jpjatm)
-ENDELSE
-;
-; 3. Reading depths of input and output grids (3D field)
-; ======================================================
-;
-IF keyword_set(ndim) THEN BEGIN
-   IF keyword_set(ndep) THEN $
-    ncdf_varget, numdta, datadept_name, datadept ELSE $
-    ncdf_varget, nummsk, datadept_name, datadept
-   ncdf_varget, nummsh, outdept_name, outdept
-   datadept = float(datadept)
-   outdept = float(outdept)
-ENDIF
-;
-return
-END
Index: unk/netcdf_output.pro
===================================================================
--- /trunk/netcdf_output.pro	(revision 48)
+++ 	(revision )
@@ -1,149 +1,0 @@
-;+
-; NAME: netcdf_output.pro
-;
-; PURPOSE: Writes interpolated field in a netCDF format file
-;
-; CATEGORY: Subroutine
-;
-; CALLING SEQUENCE: netcdf_output, zout_mask_name, zout_mask, zdata_name, zlon, zlat, $
-;                                 zoutputfile, ztitle, POINT = point, znumout, zvarid
-;
-; INPUTS:
-;          zout_mask_name : name of interpolated field mask
-;               zout_mask : mask of interpolated field
-;              zdata_name : name of data
-;               zlon,zlat : coordinates of output grid
-;             zoutputfile : name of output file
-;                  ztitle : title of file
-;                   point : grid point of field (u,v,t)
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          NetCDF file containing the attributes of interpolated field
-;          znumout : ID of output file
-;          zvarid  : ID of variable named zdata_name
-;
-; COMMON BLOCKS:
-;        common_interp.pro
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;
-;-
-;------------------------------------------------------------
-;------------------------------------------------------------
-;------------------------------------------------------------
-PRO netcdf_output, zout_mask_name, zout_mask, zdata_name, zlon, zlat, $
-          zoutputfile, ztitle, zlong_name, POINT = point, znumout, zvarid, $
-          znumdta
-@common_interp
-   tempsun = systime(1) ; pour key_performance
-;
-; 1. Creating output file
-; =======================
-;
-
-znumout = ncdf_create(output_dir+ '/'+ zoutputfile)
-;
-; 2. Headers
-; ==========
-;
-;  2.1. Dimensions
-;  ---------------
-;
-xid = ncdf_dimdef(znumout, 'x', jpioce)
-yid = ncdf_dimdef(znumout, 'y', jpjoce)
-IF keyword_set(ndim) THEN zid = ncdf_dimdef(znumout, 'z', jpkoce)
-tid = ncdf_dimdef(znumout, time_name, /unlimited)
-;
-;  2.2. Variables
-;  --------------
-;
-IF size(zlon, /n_dimensions) EQ 1 THEN BEGIN
-   varlon = ncdf_vardef(znumout, 'nav_lon', [xid], /float)
-   varlat = ncdf_vardef(znumout, 'nav_lat', [yid], /float)
-ENDIF ELSE BEGIN
-   varlon = ncdf_vardef(znumout, 'nav_lon', [xid, yid], /float)
-   varlat = ncdf_vardef(znumout, 'nav_lat', [xid, yid], /float)
-ENDELSE
-IF keyword_set(ndim) THEN BEGIN
-   varlev1 = ncdf_varid(nummsh, 'nav_lev')
-   vart1 = ncdf_varid(znumdta, time_name)
-   varlev = ncdf_vardef(znumout, 'nav_lev', [zid], /float)
-   vart = ncdf_vardef(znumout, 'time', [tid], /float)
-;   varmsk = ncdf_vardef(znumout, zout_mask_name, [xid, yid, zid], /float)
-   zvarid = ncdf_vardef(znumout, zdata_name, [xid, yid, zid, tid], /float)
-ENDIF ELSE BEGIN
-   vart1 = ncdf_varid(znumdta, time_name)
-   vart = ncdf_vardef(znumout, 'time', [tid], /float)
-;   varmsk = ncdf_vardef(znumout, zout_mask_name, [xid, yid], /float)
-   zvarid = ncdf_vardef(znumout, zdata_name, [xid, yid, tid], /float)
-ENDELSE
-;
-;  2.3. Attributes
-;  ---------------
-;
-ncdf_attput, znumout, varlon, "units", "degrees_east"
-ncdf_attput, znumout, varlon, "valid_min", min(zlon)
-ncdf_attput, znumout, varlon, "valid_max", max(zlon)
-ncdf_attput, znumout, varlon, "long_name", string("Longitude at ", point, "-point")
-ncdf_attput, znumout, varlat, "units", "degrees_north"
-ncdf_attput, znumout, varlat, "valid_min", min(zlat)
-ncdf_attput, znumout, varlat, "valid_max", max(zlat)
-ncdf_attput, znumout, varlat, "long_name", string("Latitude at ", point, "-point")
-IF keyword_set(ndim) THEN BEGIN
-   rien = ncdf_attcopy(nummsh, varlev1, "units", znumout, varlev)
-   rien = ncdf_attcopy(nummsh, varlev1, "valid_min", znumout, varlev)
-   rien = ncdf_attcopy(nummsh, varlev1, "valid_max", znumout, varlev)
-   rien = ncdf_attcopy(nummsh, varlev1, "long_name", znumout, varlev)
-ENDIF
-zatt = ncdf_varinq(znumdta, vart1)
-znbatt = zatt.natts
-FOR i = 0, znbatt-1 DO BEGIN
-   namatt = ncdf_attname(znumdta, vart1, i)
-   rien = ncdf_attcopy(znumdta, vart1, namatt,znumout, vart)
-ENDFOR
-ncdf_attput, znumout, zvarid, "units", units
-ncdf_attput, znumout, zvarid, "long_name", zlong_name
-;
-; ... Global attributes
-;
-ncdf_attput, znumout,"Conventions", "GDT 1.2", /global
-ncdf_attput, znumout,"file_name", zoutputfile, /global
-ncdf_attput, znumout,"Title", ztitle, /global
-;
-; 3. Writing data
-; ===============
-;
-ncdf_control, znumout, /endef
-;
-;  3.1. Grid
-;  ---------
-;
-printf, 40, ''
-printf, 40, 'Storing coordinates'
-ncdf_varput, znumout, varlon, zlon
-ncdf_varput, znumout, varlat, zlat
-IF keyword_set(ndim) THEN BEGIN
-   ncdf_varget, nummsh, 'nav_lev', z, count = [jpkoce]
-   ncdf_varput, znumout, varlev, z
-ENDIF
-;
-;  3.2. Time and mask
-;  ------------------
-;
-printf, 40, ''
-printf, 40, 'Storing times and mask'
-ncdf_varget, znumdta, vart1, zt, count = [nitend-nit000+1], offset = [nit000-1]
-ncdf_varput, znumout, vart, zt
-;ncdf_varput, znumout, varmsk, zout_mask
-   if keyword_set(key_performance) THEN print, 'temps netcdf_output', systime(1)-tempsun
-;
-return
-END
Index: unk/northwind.pro
===================================================================
--- /trunk/northwind.pro	(revision 48)
+++ 	(revision )
@@ -1,129 +1,0 @@
-;
-; NAME: northwind.pro
-;
-; PURPOSE: Check on in the intput field the level of coherence of winds nearby north pole,
-;          and corrects it. Thi stask is performed before interpolation
-;
-; CATEGORY: Subroutine
-;
-; CALLING SEQUENCE: northwind
-;
-; INPUTS:
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          zresul : the same wind field with its upward stripe
-;          corrected in order to get coherence of winds on north polte
-;
-; COMMON BLOCKS:
-;           common_interp.pro
-;
-PRO northwind, datglo,zdata_name,t
-
-@common_interp
-
-; Treatment of north pole stripe
-
-
-; Get from global array, the last stripe and the last but one stripe
-
-;    Initialising data arrays
-
-     datglo_rect  = replicate(0.,2,jpiatm)
-     datglo_rectb = replicate(0.,2,jpiatm)
-
-; Put data of the last two stripes into arrays
-
-
-     datglo_rect(0,*) = datglo(*,jpjatm-1,0)
-     datglo_rect(1,*) = datglo(*,jpjatm-1,1)
-
-     datglo_rectb(0,*)= datglo(*,jpjatm-2,0)
-     datglo_rectb(1,*)= datglo(*,jpjatm-2,1)
-
-
-
-; Converts data of these two lines into polar coordinates
-
-     add_angle=0.
-
-     if (zdata_name EQ data_u_name) then add_angle=!PI/2
-
-
-     datglo_polar=CV_COORD(FROM_RECT=datglo_rect,/TO_POLAR)
-     datglo_polar(0,*)=datglo_polar(0,*)+2*!PI*indgen(jpiatm)/jpiatm
-
-     datglo_polarb=CV_COORD(FROM_RECT=datglo_rect,/TO_POLAR)
-     datglo_polarb(0,*)=datglo_polar(0,*)+2*!PI*indgen(jpiatm)/jpiatm
-
-
-; Coherence of the last line needs to be corrected
-
-     print, 'CHECKING LAST LINE COHERENCE...'
-
-     mean_mod=replicate(total(datglo_polar(1,*))/jpiatm,jpiatm)
-     mean_arg=replicate((total(datglo_polar(0,*))/jpiatm+2*!PI*west_lon/360.+!PI*(jpiatm-1.)/float(jpiatm)) ,jpiatm)
-     mean_argb=replicate((total(datglo_polarb(0,*))/jpiatm+2*!PI*west_lon/360.+!PI*(jpiatm-1.)/float(jpiatm)) ,jpiatm)
-
-
-
-     ; Checks whether module is about the same on the North Pole line :
-
-     test_mod=abs(mean_mod-datglo_polar(1,*))
-
-     IF ( max(test_mod)/mean_mod(0) ) GT 0.01 THEN BEGIN
-
-          print, 'MODULE IS NOT COHERENT AND WILL BE CORRECTED TO A MEAN VALUE OF :', mean_mod(0)
-
-          datglo_polar(1,*)=mean_mod
-
-     ENDIF
-
-
-     ; Checks whether argument is coherent on the North Pole line :
-
-     test_arg=abs(mean_arg-datglo_polar(0,*))
-
-     IF ( max(test_arg)/mean_arg(0)) GT 0.01 THEN BEGIN
-
-          print, 'ARGUMENT IS NOT COHERENT AND WILL BE CORRECTED TO A MEAN VALUE :', mean_argb(0)
-
-          datglo_polar(0,*)=mean_argb-!PI/2-(2*!PI*indgen(jpiatm)/float(jpiatm)+replicate(2.*!PI*west_lon/360.,jpiatm))
-
-
-
-     ; Cross Corellation Method for wind coherence on North Pole
-
-     all_phases=indgen(jpiatm)
-
-     Ux=mean_mod*cos(all_phases*2.*!PI/jpiatm)
-     Uy=mean_mod*sin(all_phases*2.*!PI/jpiatm)
-
-     phyx=C_CORRELATE(Ux,datglo(*,jpjatm-2,0),all_phases)
-
-     phyy=C_CORRELATE(Uy,datglo(*,jpjatm-2,1),all_phases)
-
-
-     deph_x=where(phyx EQ max(phyx))
-     deph_y=where(phyy EQ max(phyy))
-
-     deph_x=deph_x(0)
-     deph_y=deph_y(0)
-
-
-
-
-     Ux=shift(Ux,deph_x)
-     Uy=shift(Uy,deph_y)
-
-     datglo(*,jpjatm-1,0)=Ux
-     datglo(*,jpjatm-1,1)=Uy
-
-
-     ENDIF
-
-
-
-
-end
Index: unk/preproc_mask.pro
===================================================================
--- /trunk/preproc_mask.pro	(revision 48)
+++ 	(revision )
@@ -1,52 +1,0 @@
-;+
-;
-; NAME: preproc_mask.pro
-;
-; PURPOSE: Extends land-sea mask by one point over ocean
-;
-; CATEGORY: Function
-;
-; CALLING SEQUENCE: preproc_mask, mask
-;
-; INPUTS:
-;          mask : mask field composed of 0 and 1 values
-;                 with 0 over land points
-;
-; KEYWORD PARAMETERS: None
-;
-; OUTPUTS:
-;          mask : mask field extended
-;
-;
-; COMMON BLOCKS:
-;          common_interp
-;
-; SIDE EFFECTS:
-;
-; RESTRICTIONS:
-;
-; EXAMPLE:
-;
-; MODIFICATION HISTORY: 11/99 A. Jouzeau
-;
-;-
-FUNCTION preproc_mask, mask
-@common_interp
-;
-printf, 40, ''
-printf, 40, 'Entering preproc_mask'
-zero = fltarr(jpiatm+2, jpjatm+2)
-zero(*, *) = 1
-zero[1:jpiatm, 1:jpjatm] = mask
-mask = zero
-;
-mask = mask*shift(mask,  1, 0)*shift(mask, 0,  1)*shift(mask,  1,  1) $
-           *shift(mask, -1, 0)*shift(mask, 0, -1)*shift(mask, -1, -1) $
-           *shift(mask, -1, 1)*shift(mask, 1, -1)
-z = fltarr(jpiatm, jpjatm)
-z = mask[1:jpiatm, 1:jpjatm]
-printf, 40, ''
-printf, 40, 'Extension done'
-;
-return, z
-END
Index: unk/rseries_ncdf.pro
===================================================================
--- /trunk/rseries_ncdf.pro	(revision 48)
+++ 	(revision )
@@ -1,296 +1,0 @@
-;+
-;
-; @file_comments
-; reading timeseries writing on many files
-;
-; @categories
-; Reading
-;
-; @param var {in} {type=string}
-; the name of the variable to be read
-;
-; @param date1 {in} {type=scalar}
-; give the first date of the time series.
-; Date format is ymmdd, yymmdd, yyymmdd, yyyymmdd, yyyyymmdd, yyyyyymmdd.
-;
-; @param date2  {in} {type=scalar}
-; give the last date of the time series.
-; Date format is ymmdd, yymmdd, yyymmdd, yyyymmdd, yyyyymmdd, yyyyyymmdd.
-;
-; @param expin {in} {type=string} {default=varexp}
-; the name of the experiment.
-;
-; @param freqin {in} {type=string} {default='5d'}
-; the averaging frequency.
-;
-; @keyword CENTURY {type=integer}
-; give the true century of the calendar.
-; for example if filename is AA5_5d_920101_921231* and the calendar variable
-; in the file is 19920101 to 19921231 then CENTURY=19
-;
-; @keyword NOSTRUCT {default=1}
-; Set this keyword to return an array instead of a structure.
-;
-; @keyword GRIDTYPE
-; name of the grid to be read 'grid_T' ++'gridT'
-;
-; @keyword _EXTRA
-; Used to pass read_ncdf keywords
-;
-; @returns
-; a structure with the following Structure Tags:
-;  arr:the array output
-;  grid: the array grid
-;  units: the array units
-;  experiment: the name of the experiment
-;  name: the name of the variable
-;
-; @uses
-; <pro>common</pro>
-;
-; @restrictions
-; Update the time and jpt common variables.
-; Time is the calendar in IDL julian days.
-; 1) The file must contain an unlimited dimension, and the
-; variable to be read must contain this unlimited dimension.
-; 2) The file must contain a one dimension variable which
-; dimension is the unlimited dimension. This variable is the
-; calendar.
-; 3) This variable calendar must have an attribut called "units"
-; which must have a format similar to
-; "seconds since 0001-01-01 00:00:00"
-; "hours since 0001-01-01 00:00:00"
-; "days since 1979-01-01 00:00:00"
-; "months since 1979-01-01 00:00:00"
-; "years since 1979-01-01 00:00:00"
-; 4) The calendar must be the Gregorian calendar
-; 5) The name of the file must beginning by
-; exp_freq_datefirst_datelast_*
-; 6) The maximum gap between 2 consecutive files must be one day.
-;
-; @examples
-; IDL> res = rseries_ncdf('sozotaux',920501,930410,'AA5','5d')
-;
-; for ORCA2 outputs
-; IDL> iodir='/usr/work/sur/fvi/OPA/ORCA2/'
-; IDL> res= rseries_ncdf('votemper',010101,061231,'ESS','5d')
-; IDL> help,res,/structure
-;
-;** Structure <310ebc0>, 5 tags, length=1800, data length=1800, refs=1:
-;   ARR             FLOAT     Array[1, 1, 1, 438]
-;   GRID            STRING    'T'
-;   UNITS           STRING    'C'
-;   EXPERIMENT      STRING    'ESS_5d_060101_061231_grid_T.nc'
-;   NAME            STRING    'votemper'
-;
-; @history
-; Sebastien Masson (smasson\@lodyc.jussieu.fr) Apr 23 2001
-;
-; @todo
-; adaptation to Drakkar terminologie
-; ORCA2 terminology of output files
-; <i>experience</i>_5d_<i>yymmdd</i>_<i>yymmdd</i>_<i>grid</i>.nc
-; with experience in 'ESS'
-; with grid in 'grid_T'
-;
-; ORCA025 terminology of output files
-; /u/rech/cli/rcli002/ORCA025/ORCA025-<i>experience_drakkar<i>-S/<i>year_drakkar</i>/ORCA025-<i>experience_drakkar</i>-y<i>year_drakkar</i>n<i>mois</i>d<i>jour</i>_<i>grid</i>.nc
-; with experience_drakkar in 'G70',
-; with grid in 'gridT'
-;
-; @version
-; $Id$
-;
-;-
-FUNCTION rseries_ncdf, var, date1, date2, expin, freqin, CENTURY = century, NOSTRUCT = nostruct, GRIDTYPE = gridtype, _EXTRA = ex
-@common
-; name of the file: exp_freq_datefirst_datelast_*
-  date1 = (long(date1))[0]
-  date2 = (long(date2))[0]
-  if date2 LT date1 then return, report('date2 must be larger than date1')
-  if n_elements(expin) EQ 0 then exp = varexp ELSE BEGIN
-    IF (strpos(expin, '_'))[0] NE -1 AND n_elements(freqin) EQ 0 THEN BEGIN
-      exp = strmid(expin, 0, strpos(expin, '_'))
-      freqin = strmid(expin, strpos(expin, '_')+1)
-    ENDIF ELSE exp = expin
-    varexp = exp
-  ENDELSE
-  if n_elements(freqin) EQ 0 then freq = '5d' ELSE freq = freqin
-;------------------------------------------------
-; determination of the filename beginning with exp_freq_*
-;------------------------------------------------
-  IF keyword_set(gridtype) EQ 0 THEN gridtype = ''
-; determination OF datefirst and datelast
-; list of the files beginning by iodir+exp+sep+freq
-  sep = '_'
-  possiblenames = iodir+exp+sep+freq+'*'+gridtype+'.nc'
-  possiblenames = findfile(possiblenames)
-  if possiblenames[0] EQ '' then return, report('nofilename :'+iodir+exp+sep+freq+'*'+gridtype+'.nc'+' found')
-  npos = n_elements(possiblenames)
-; list of the datefirst and datelast of the files beginning by
-; iodir+exp+sep+freq
-  datefirst = lonarr(npos)
-  datelast = lonarr(npos)
-  sepshift = n_elements(str_sep(exp, sep))-1
-  for i = 0, npos-1 do BEGIN
-    separate = str_sep(possiblenames[i], sep)
-    datefirst[i] = separate[2+sepshift]
-    datelast[i] = separate[3+sepshift]
-  ENDFOR
-; selection of the files for which datefirst le date1 and datelast ge
-; date1
-  CASE strmid(freqin, 0, 1, /rever) OF
-    'm' : div = 100
-    'y' : div = 10000
-    ELSE : div = 1
-  ENDCASE
-  goodfile = where(datefirst le date1/div and datelast GE date1/div)
-  if goodfile[0] EQ -1 then return, report('filename :'+iodir+exp+sep+freq+'*'+gridtype+'.nc'+' not found with the dates containing '+strtrim(date1, 1))
-  datefirst = datefirst[goodfile]
-  datelast = datelast[goodfile]
-; how many different pairs of dates are present ?
-; find the unique pairs of dates
-  pairofdate = dcomplex(datefirst, datelast)
-  pairofdate = pairofdate[uniq(pairofdate, sort(pairofdate))]
-  fileok = ''
-  datefirstok = 0L
-  datelastok = 0L
-; loop on the files for which date1 is between datefirst and datelast
-  for p = 0, n_elements(pairofdate)-1 do begin
-; name of the file: exp_freq_datefirst_datelast_*
-    datefirst = long(pairofdate[p])
-    datelast = long(imaginary(pairofdate[p]))
-; determination OF the possible filenames
-; test if the year format is i1, i2, i3, i4, i5 or i6
-    namebegin = iodir+exp+sep+freq+sep+strtrim(datefirst, 1)+sep+strtrim(datelast, 1)+'*'+gridtype+'.nc'
-    namebegin = findfile(namebegin)
-    possiblenames = ''
-    if namebegin[0] NE '' then possiblenames = [possiblenames, namebegin]
-    if datefirst LT 1e9 then begin
-      for i = 1, 5-(datefirst GE 1e5)-(datefirst GE 1e6) $
-        -(datefirst GE 1e7)-(datefirst GE 1e8) do begin
-        zero = string(replicate(byte('0'), i))
-        namebegin = iodir+exp+sep+freq+sep $
-          + zero+strtrim(datefirst, 1) +sep+ zero+strtrim(datelast, 1) +'*'+gridtype+'.nc'
-        namebegin = findfile(namebegin)
-        if namebegin[0] NE '' then possiblenames = [possiblenames, namebegin]
-      endfor
-    ENDIF
-    if n_elements(possiblenames) eq 1 then return, report('filename :'+iodir+exp+sep+freq+sep+'*'+strtrim(datefirst, 1)+sep+'*'+strtrim(datelast, 1)+'*'+gridtype+'.nc'+' not found')
-    possiblenames = possiblenames[1:n_elements(possiblenames)-1]
-; determination OF the filenames
-    ncdf_control, 0, /noverbose
-    i = 0
-    repeat BEGIN
-      cdfid = ncdf_open(possiblenames[i])
-;         print,possiblenames[i],var
-      test = ncdf_varid(Cdfid, var)
-      ncdf_close, cdfid
-      i = i+1
-    endrep until test NE -1 OR i EQ n_elements(possiblenames)
-    ncdf_control, 0, /verbose
-    if test NE -1 then begin
-      fileok = [fileok, possiblenames[i-1]]
-      datefirstok = [datefirstok, datefirst]
-      datelastok = [datelastok, datelast]
-    endif
-  ENDFOR
-  numoffileok = n_elements(fileok)-1
-  if numoffileok EQ 0 then return, report('the variable '+var+' was not fond in the file: '+possiblenames)
-  fileok = fileok[1:numoffileok]
-  datefirstok = datefirstok[1: numoffileok]
-  datelastok = datelastok[1: numoffileok]
-  if numoffileok NE 1 then BEGIN
-; more than one file containts the variable var and has the date1
-; between datefirst and datelast...
-; Is there any file FOR which date2 LE datelast?
-    goodfile = where(date2 LE datelastok)
-    if goodfile[0] NE -1 then begin
-      fileok = fileok[goodfile]
-      datefirstok = datefirstok[goodfile]
-      datelastok = datelastok[goodfile]
-; we choose the file which has the smallest datelast
-      bestfile = sort(datelastok)
-      filename = fileok[bestfile[0]]
-      datefirst = datefirstok[bestfile[0]]
-      datelast = datelastok[bestfile[0]]
-    ENDIF ELSE BEGIN
-; we choose the file which has the bigest datelast
-      bestfile = sort(datelastok)
-      filename = fileok[bestfile[numoffileok-1]]
-      datefirst = datefirstok[bestfile[numoffileok-1]]
-      datelast = datelastok[bestfile[numoffileok-1]]
-    ENDELSE
-  ENDIF ELSE BEGIN
-    filename = fileok[0]
-    datefirst = datefirstok[0]
-    datelast = datelastok[0]
-  ENDELSE
-; now we have find the good file with the good dates and the godd
-; variable inside.
-; we get the number of dimension of the variable
-  cdfid = ncdf_open(filename)
-  varcontient = ncdf_varinq(cdfid, var)
-  ncdf_close, cdfid
-;
-;------------------------------------------------
-; reading of the variables
-;------------------------------------------------
-;
-  if NOT keyword_set(century) then century = 0l
-  IF chkstru(ex, 'filename') THEN ex.filename = filename
-  CASE strmid(freqin, 0, 1, /rever) OF
-    'm':datelast = 100*datelast + daysinmonth(datelast MOD 100, datelast / 100)
-    'y':div = 10000*datelast+360+(5+leapyr(datelast+century))*(key_caltype EQ 'greg')
-    ELSE : div = 1
-  ENDCASE
-  if date2 GT datelast THEN BEGIN
-; if we need to read more than one file,
-; first we read the first file
-;++    print,var,date1+century*1000000L, datelast[0]+century*1000000L
-;++READ, B, PROMPT='Enter Name: '
-    res1 = read_ncdf(var, date1+century*1000000L, datelast[0]+century*1000000L $
-                     , filename = filename, /nostruct, _extra = ex)
-    time1 = time                ; store the first part of the calendar
-    jpt1 = jpt                  ; store the number time steps already read
-
-; and after we call again rseries_ncdf
-; newdatefirst is defined as datelast+1day
-    newdatefirst = jul2date(date2jul(datelast)+1)
-    res2 = rseries_ncdf(var, newdatefirst, date2, exp, freq, /NOSTRUCT, _extra = ex)
-;
-;
-    CASE 1 OF
-      res1[0] EQ -1 AND res2[0] EQ -1: return, -1
-      res1[0] EQ -1:res = temporary(res2)
-      res2[0] EQ -1:BEGIN
-        time = time1
-        jpt = jpt1
-        res = temporary(res1)
-      END
-      ELSE : BEGIN
- ; we glue the result of the first read and the result of the new call
-; to rseries_ncdf
-        time = [time1, time]
-        jpt = jpt1+jpt
-        case varcontient.ndims OF
-          1:res = [temporary(res1), temporary(res2)]
-          2:res = [ [temporary(res1)], [temporary(res2)] ]
-          3:res = [ [ [temporary(res1)] ], [ [temporary(res2)] ] ]
-          4:BEGIN
-            res = [(temporary(res1))[*], (temporary(res2))[*]]
-            grille, mask, glam, gphi, gdep, nx, ny, nz
-            res = reform(res, nx, ny, nz, jpt, /over)
-          END
-        ENDCASE
-      ENDELSE
-    ENDCASE
-  endif ELSE BEGIN
-    res = read_ncdf(var, date1+century*1000000L, date2+century*1000000L $
-                    , filename = filename, /nostruct, _extra = ex)
-  ENDELSE
-;------------------------------------------------
-  if keyword_set(nostruct) then return, res $
-  ELSE return, {arr:res, grid:vargrid, units:varunit, experiment:varexp, name:varname}
-
-end
Index: unk/sclarr.pro
===================================================================
--- /trunk/sclarr.pro	(revision 48)
+++ 	(revision )
@@ -1,53 +1,0 @@
-pro sclarr,map,xscale,xmax,dispimg, OFFSET=offnum,SMIN=minnum
-
-;THIS SCALES AN ARRAY FOR DISPLAY
-;WITH RNBWSSMI COLOR TABLE
-; map=byte array
-; xscale = value to scale geophysical data by
-; xmax = maximum of that geophysical parameter
-; dispimg=scaled byte array to be displayed
-; offset= adjustment value to original data
-; smin= minimum value for scale
-
-
-IF N_elements(offnum) EQ 0 THEN offnum=0
-IF N_elements(minnum) EQ 0 THEN minnum=0
-
-slope=159./(xmax-minnum)
-intercept=(159-slope*(xmax+minnum))/2.
-print, slope, intercept
-
-s=SIZE(map)
-xsize = s(1)
-ysize = s(2)
-TEMP=replicate(0,xsize,ysize)
-
-x= where (map lt 251B,num)
-if(num ne 0) then begin
-TEMP(x)=round((float(map(x))*xscale-offnum)*slope+intercept)
-endif
-
-x= where (TEMP lt 0,num)
-if(num ne 0) then TEMP(x)=0
-x= where (TEMP gt 159,num)
-if (num ne 0) then TEMP(x)=159
-
-dispimg=byte(TEMP)
-
-x=where(map eq 255B,num)
-if(num ne 0) then dispimg(x)=185B
-
-x= where(map eq 254B,num)
-if(num ne 0) then dispimg(x)=160B
-
-x= where(map eq 253B,num)
-if(num ne 0) then dispimg(x)=160B
-
-x= where(map eq 252B,num)
-if(num ne 0) then dispimg(x)=210B
-
-x= where (map eq 251B,num)
-if(num ne 0)then dispimg(x)=160B
-
-
-end
Index: unk/step1_diff.pro
===================================================================
--- /trunk/step1_diff.pro	(revision 48)
+++ 	(revision )
@@ -1,205 +1,0 @@
-;+
-;
-; @file_comments
-; compute delta between cond_sed*.pro Netcdf files with same dimension
-;
-; @param file1 {in}{required} {type=string}
-; name of the first file to be read
-;
-; @param file2 {in}{required} {type=string}
-; name of the second file to be read
-;
-; @param file3 {in}{required} {type=string}
-; file where differences between variables are written
-;
-; @examples
-; test (for header and delta)
-; to compute difference between cond_sed in cond_sed_ORCA2.nc and
-; itself and write it in ginette.nc :
-; $ cd ${GEOMAG}
-; $ idl
-; IDL> file1=getenv('GEOMAG') + '/cond_sed_ORCA2.nc'
-; IDL> file2=getenv('GEOMAG_OD') + '/cond_sed_ORCA2.nc'
-; IDL> step1_diff, file1, file2, 'ginette.nc'
-; values of delta must be 0 everywhere
-; $ rm ginette.nc
-; idem with BR file
-; IDL> file1=getenv('GEOMAG') + '/Br_ORCA2.nc'
-; IDL> file2=getenv('GEOMAG_OD') + '/Br_ORCA2.nc'
-; IDL> step1_diff, file1, file2, 'ginette.nc'
-;
-; real life
-; to compute difference between cond_sed in cond_sed_ORCA2.nc and
-; /home/rech/eee/reee522/geomag_d/cond_sed_ORCA2.nc and write it in
-; cond_sed_ORCA2_diff.nc :
-; $ cd ${GEOMAG}
-; $ idl
-; IDL> file1=getenv('GEOMAG') + '/cond_sed_ORCA2.nc'
-; IDL> file2=getenv('GEOMAG_OD') + '/cond_sed_ORCA2.nc'
-; IDL> step1_diff, file1, file2, 'cond_sed_ORCA2_diff.nc'
-; IDL> file1=getenv('GEOMAG') + '/Br_ORCA2.nc'
-; IDL> file2=getenv('GEOMAG_OD') + '/Br_ORCA2.nc'
-; IDL> step1_diff, file1, file2, 'Br_ORCA2_diff.nc'
-;
-; to see the difference, for example
-; IDL> xxx,'cond_sed_ORCA2_diff.nc'
-; IDL> xxx,'Br_ORCA2_diff.nc'
-; select xy on plt wigdet
-;
-; @history
-; reee522 2006-12-18T10:38:49Z rhodes (IRIX64)
-; thanks to example in SAXO
-; SRC/ReadWrite/idl-NetCDF/ncdf_quickread/README_ncdf_quickread.txt
-;
-; @todo
-; check difference between headers
-;
-; @version
-; $Id$
-;
-PRO step1_diff, file1, file2, file3
-;
-ncverbose=1
-;
-; check if file1 exists
-fullfile1 = isafile(file1, NEW=0,/MUST_EXIST)
-IF fullfile1[0] EQ '' THEN BEGIN
-   msg = 'eee : the file ' + fullfile1 + ' was not found.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; protection
-IF (FILE_TEST(fullfile1[0], /READ) EQ 0) THEN BEGIN
-   msg = 'eee : the file ' + fullfile1[0] + ' is not readable.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; check if file2 exists
-fullfile2 = isafile(file2, NEW=0,/MUST_EXIST)
-IF fullfile2[0] EQ '' THEN BEGIN
-   msg = 'eee : the file ' + fullfile2 + ' was not found.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; protection
-IF (FILE_TEST(fullfile2[0], /READ) EQ 0) THEN BEGIN
-   msg = 'eee : the file ' + fullfile2[0] + ' is not readable.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; read the first file
-ncdf_read,  fullfile1[0], file1info, file1dinfo, file1vinfo, $
-            file1gatts, file1vatts, file1data
-;
-; read the second file
-ncdf_read,  fullfile2[0], file2info, file2dinfo, file2vinfo, $
-            file2gatts, file2vatts, file2data
-;
-; compute delta
-delta = *file1data[3] - *file2data[3]
-minarr = min(delta, max = maxarr)
-;
-; check for number of non zero in delta
-checknonzero=where(delta NE 0.,count)
-IF count EQ 0 THEN BEGIN
-   msg = 'iii : delta is zero everywhere'
-   ras = report(msg)
-ENDIF ELSE BEGIN
-   msg = 'iii : delta is not zero ' + STRING(count)  + ' times'
-   ras = report(msg)
-ENDELSE
-;
-; write output
-; in order to avoid unexpected overwritten
-IF (FILE_TEST(file3) EQ 1) THEN BEGIN
-   msg = 'eee : the file ' + file3  + ' already exists.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-;---------------------------
-; Creation of the NetCdf output file
-;---------------------------
-;
-  netcdf_id = NCDF_CREATE(file3, /clobber)
-  NCDF_CONTROL, netcdf_id, /NOFILL
-;
-; dimension
-  dimidx = NCDF_DIMDEF(netcdf_id, file1dinfo[0].name ,  file1dinfo[0].size)
-  dimidy = NCDF_DIMDEF(netcdf_id, file1dinfo[1].name ,  file1dinfo[1].size)
-  dimidt = NCDF_DIMDEF(netcdf_id, file1dinfo[2].name, /UNLIMITED)
-;
-; global attributes
-  NCDF_ATTPUT, netcdf_id, 'Conventions', 'GDT 1.2', /GLOBAL ; ++ conformite
-  NCDF_ATTPUT, netcdf_id, 'file_name'  , file3, /GLOBAL
-  NCDF_ATTPUT, netcdf_id, 'Title'      , $
-               'delta between '+ file1 + ' and ' + file2, /GLOBAL
-;
-; declaration of variables
-; 4 common variables for the two files to produce
-  varid = lonarr(4)
-;
-  varid[0] = NCDF_VARDEF(netcdf_id, file1vinfo[0].name  , [dimidx, dimidy], /FLOAT)
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[0].name , $
-               STRING(*(*file1vatts[0])[0].values)
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[1].name, $
-               *(*file1vatts[0])[1].values
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[2].name, $
-               *(*file1vatts[0])[2].values
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[3].name, $
-               STRING(*(*file1vatts[0])[3].values)
-;
-  varid[1] = NCDF_VARDEF(netcdf_id, file1vinfo[1].name  , [dimidx, dimidy], /FLOAT)
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[0].name, $
-               STRING(*(*file1vatts[1])[0].values)
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[1].name, $
-               *(*file1vatts[1])[1].values
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[2].name, $
-               *(*file1vatts[1])[2].values
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[3].name, $
-               STRING(*(*file1vatts[1])[3].values)
-;
-  varid[2] = NCDF_VARDEF(netcdf_id, file1vinfo[2].name, [dimidt], /FLOAT)
-;
-  varid[3] =  NCDF_VARDEF(netcdf_id, 'delta', [dimidx, dimidy, dimidt], /FLOAT)
-  NCDF_ATTPUT, netcdf_id, varid[3], 'long_name', 'delta'
-  NCDF_ATTPUT, netcdf_id, varid[3], $
-               (*file1vatts[3])[0].name, $
-               STRING(*(*file1vatts[3])[0].values)
-;
-  NCDF_ATTPUT, netcdf_id, varid[3], 'valid_min', minarr ,/FLOAT
-  NCDF_ATTPUT, netcdf_id, varid[3], 'valid_max', maxarr ,/FLOAT
-;
-;---------------------------
-; end of header definition, writing of the NetCdf files
-;---------------------------
-;
-  NCDF_CONTROL, netcdf_id, /ENDEF
-;
-  NCDF_VARPUT, netcdf_id, file1vinfo[0].name, (*file1data[0])
-  NCDF_VARPUT, netcdf_id, file1vinfo[1].name, (*file1data[1])
-  NCDF_VARPUT, netcdf_id, file1vinfo[2].name, (*file1data[2])
-;
-; write the data
-  NCDF_VARPUT, netcdf_id, 'delta', delta
-;
-;---------------------------
-; close the netcdf files
-  NCDF_CLOSE, netcdf_id
-;
-  msg = 'iii : ' + file3 + ' created'
-  ras = report(msg)
-;
-END
Index: unk/step2_diff.pro
===================================================================
--- /trunk/step2_diff.pro	(revision 48)
+++ 	(revision )
@@ -1,221 +1,0 @@
-;+
-;
-; @file_comments
-; compute delta between *_5d_yyyy_grid_T_orcares.pro Netcdf files with same dimension
-;
-; @param file1 {in}{required} {type=string}
-; name of the first file to be read
-;
-; @param file2 {in}{required} {type=string}
-; name of the second file to be read
-;
-; @param file3 {in}{required} {type=string}
-; file where differences between variables are written
-;
-; @examples
-; test (for header and delta)
-; to compute difference between Sigma in Sigma_5d_1993_grid_T_ORCA2.nc and
-; itself and write it in ginette.nc :
-; $ cd ${GEOMAG}
-; $ idl
-; IDL> file1=getenv('GEOMAG_OD') + '/Sigma_5d_1993_grid_T_ORCA2.nc'
-; IDL> file2=getenv('GEOMAG_OD') + '/Sigma_5d_1993_grid_T_ORCA2.nc'
-; IDL> step2_diff, file1, file2, 'ginette.nc'
-; values of delta must be 0 everywhere
-; $ rm ginette.nc
-;
-; real life
-; to compute difference between Sigma in
-; /usr/work/sur/fvi/OPA/ORCA2/Sigma_5d_1994_grid_T.nc and
-; ${GEOMGA_OD}/Sigma_5d_1994_grid_T_ORCA2.nc and write it in
-; Sigma_5d_1994_grid_T_ORCA2_diff.nc :
-; $ cd ${GEOMAG}
-; $ idl
-; IDL> year=1994
-; IDL> file1= '/usr/work/sur/fvi/OPA/ORCA2/Sigma_5d_1994_grid_T.nc'
-; IDL> file2=getenv('GEOMAG_OD') + '/Sigma_5d_1994_grid_T_ORCA2.nc'
-; IDL> step2_diff, file1, file2, 'Sigma_5d_1994_grid_T_ORCA2_diff.nc'
-;
-; to see the difference, for example
-; IDL> xxx,'Sigma_5d_1994_grid_T_ORCA2_diff.nc'
-; select xy on plt wigdet
-;
-; see also step2_diff.sh for quick start
-;
-; @history
-; fplod 2007-08-22T09:39:45Z aedon.locean-ipsl.upmc.fr (Darwin)
-; correction
-; fplod 2007-07-30T10:58:12Z aedon.locean-ipsl.upmc.fr (Darwin)
-; like <progeomag>step1_diff</progeomag>
-;
-; @todo
-; check difference between headers
-;
-; @version
-; $Id$
-;
-PRO step2_diff, file1, file2, file3
-;
-ncverbose=1
-;
-; check if file1 exists
-fullfile1 = isafile(file1, NEW=0,/MUST_EXIST)
-IF fullfile1[0] EQ '' THEN BEGIN
-   msg = 'eee : the file ' + fullfile1 + ' was not found.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; protection
-IF (FILE_TEST(fullfile1[0], /READ) EQ 0) THEN BEGIN
-   msg = 'eee : the file ' + fullfile1[0] + ' is not readable.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; check if file2 exists
-fullfile2 = isafile(file2, NEW=0,/MUST_EXIST)
-IF fullfile2[0] EQ '' THEN BEGIN
-   msg = 'eee : the file ' + fullfile2 + ' was not found.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; protection
-IF (FILE_TEST(fullfile2[0], /READ) EQ 0) THEN BEGIN
-   msg = 'eee : the file ' + fullfile2[0] + ' is not readable.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-; read the first file
-ncdf_read,  fullfile1[0], file1info, file1dinfo, file1vinfo, $
-            file1gatts, file1vatts, file1data
-;
-; read the second file
-ncdf_read,  fullfile2[0], file2info, file2dinfo, file2vinfo, $
-            file2gatts, file2vatts, file2data
-;
-; compute delta
-delta = *file1data[4] - *file2data[4]
-minarr = min(delta, max = maxarr)
-;
-; check for number of non zero in delta
-checknonzero=where(delta NE 0.,count)
-IF count EQ 0 THEN BEGIN
-   msg = 'iii : delta is zero everywhere'
-   ras = report(msg)
-ENDIF ELSE BEGIN
-   msg = 'iii : delta is not zero ' + STRING(count)  + ' times'
-   ras = report(msg)
-ENDELSE
-;
-; write output
-; in order to avoid unexpected overwritten
-IF (FILE_TEST(file3) EQ 1) THEN BEGIN
-   msg = 'eee : the file ' + file3  + ' already exists.'
-   ras = report(msg)
-   RETURN
-ENDIF
-;
-;---------------------------
-; Creation of the NetCdf output file
-;---------------------------
-;
-  netcdf_id = NCDF_CREATE(file3, /clobber)
-  NCDF_CONTROL, netcdf_id, /NOFILL
-;
-; dimension
-  dimidx = NCDF_DIMDEF(netcdf_id, file1dinfo[0].name ,  file1dinfo[0].size)
-  dimidy = NCDF_DIMDEF(netcdf_id, file1dinfo[1].name ,  file1dinfo[1].size)
-  dimidz = NCDF_DIMDEF(netcdf_id, file1dinfo[2].name ,  file1dinfo[2].size)
-  dimidt = NCDF_DIMDEF(netcdf_id, file1dinfo[3].name, /UNLIMITED)
-  dimidz2 = NCDF_DIMDEF(netcdf_id, file1dinfo[4].name ,  file1dinfo[4].size)
-;
-; global attributes
-  NCDF_ATTPUT, netcdf_id, 'Conventions', 'GDT 1.2', /GLOBAL ; ++ conformite
-  NCDF_ATTPUT, netcdf_id, 'file_name'  , file3, /GLOBAL
-  NCDF_ATTPUT, netcdf_id, 'Title'      , $
-               'delta between '+ file1 + ' and ' + file2, /GLOBAL
-;
-; declaration of variables
-  varid = lonarr(5)
-;
-  varid[0] = NCDF_VARDEF(netcdf_id, file1vinfo[0].name  , [dimidx, dimidy], /FLOAT)
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[0].name , $
-               STRING(*(*file1vatts[0])[0].values)
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[1].name, $
-               STRING(*(*file1vatts[0])[1].values)
-  NCDF_ATTPUT, netcdf_id, varid[0], $
-               (*file1vatts[0])[2].name, $
-               STRING(*(*file1vatts[0])[2].values)
-;
-  varid[1] = NCDF_VARDEF(netcdf_id, file1vinfo[1].name  , [dimidx, dimidy], /FLOAT)
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[0].name, $
-               STRING(*(*file1vatts[1])[0].values)
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[1].name, $
-               STRING(*(*file1vatts[1])[1].values)
-  NCDF_ATTPUT, netcdf_id, varid[1], $
-               (*file1vatts[1])[2].name, $
-               STRING(*(*file1vatts[1])[2].values)
-;
-  varid[2] = NCDF_VARDEF(netcdf_id, file1vinfo[2].name, [dimidz2], /FLOAT);
-  NCDF_ATTPUT, netcdf_id, varid[2], $
-               (*file1vatts[2])[0].name, $
-               STRING(*(*file1vatts[2])[0].values)
-  NCDF_ATTPUT, netcdf_id, varid[2], $
-               (*file1vatts[2])[1].name, $
-               STRING(*(*file1vatts[2])[1].values)
-  NCDF_ATTPUT, netcdf_id, varid[2], $
-               (*file1vatts[2])[2].name, $
-               STRING(*(*file1vatts[2])[2].values)
-;
-  varid[3] = NCDF_VARDEF(netcdf_id, file1vinfo[3].name, [dimidt], /FLOAT);
-  NCDF_ATTPUT, netcdf_id, varid[3], $
-               (*file1vatts[3])[0].name, $
-               STRING(*(*file1vatts[3])[0].values)
-  NCDF_ATTPUT, netcdf_id, varid[3], $
-               (*file1vatts[3])[1].name, $
-               STRING(*(*file1vatts[3])[1].values)
-  NCDF_ATTPUT, netcdf_id, varid[3], $
-               (*file1vatts[3])[2].name, $
-               STRING(*(*file1vatts[3])[2].values)
-  NCDF_ATTPUT, netcdf_id, varid[3], $
-               (*file1vatts[3])[3].name, $
-               STRING(*(*file1vatts[3])[3].values)
-  NCDF_ATTPUT, netcdf_id, varid[3], $
-               (*file1vatts[3])[4].name, $
-               STRING(*(*file1vatts[3])[4].values)
-help,delta
-
-  varid[4] =  NCDF_VARDEF(netcdf_id, 'delta',   [dimidx, dimidy,dimidz, dimidt], /DOUBLE)
-  NCDF_ATTPUT, netcdf_id, varid[4], 'long_name', 'delta'
-  NCDF_ATTPUT, netcdf_id, varid[4], 'valid_min', minarr ,/DOUBLE
-  NCDF_ATTPUT, netcdf_id, varid[4], 'valid_max', maxarr ,/DOUBLE
-;
-;---------------------------
-; end of header definition, writing of the NetCdf files
-;---------------------------
-;
-  NCDF_CONTROL, netcdf_id, /ENDEF
-;
-  NCDF_VARPUT, netcdf_id, file1vinfo[0].name, (*file1data[0])
-  NCDF_VARPUT, netcdf_id, file1vinfo[1].name, (*file1data[1])
-  NCDF_VARPUT, netcdf_id, file1vinfo[2].name, (*file1data[2])
-  NCDF_VARPUT, netcdf_id, file1vinfo[3].name, (*file1data[3])
-;
-; write the data
-  NCDF_VARPUT, netcdf_id, 'delta', delta
-;
-;---------------------------
-; close the netcdf files
-  NCDF_CLOSE, netcdf_id
-;
-  msg = 'iii : ' + file3 + ' created'
-  ras = report(msg)
-;
-END
Index: unk/step2_diff.sh
===================================================================
--- /trunk/step2_diff.sh	(revision 48)
+++ 	(revision )
@@ -1,102 +1,0 @@
-#! /bin/sh
-#
-#+
-#
-# .. _step2_diff.sh:
-#
-# =============
-# step2_diff.sh
-# =============
-#
-# ------------------------------------------
-# launch step2_diff.pro with year argument
-# ------------------------------------------
-#
-# SYNOPSYS
-# ========
-#
-# .. code-block:: bash
-#
-#    step2_diff.sh -y year
-#
-# EXAMPLES
-# ========
-#
-# For test on year 1994:
-#
-# .. code-block:: bash
-#
-#    ./step2_diff.sh -y 1994
-#
-# EVOLUTIONS
-# ==========
-#
-# $Id$
-#
-# - fplod 20100318T074009Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * unset
-#
-# - fplod 2007-08-22T08:50:02Z aedon.locean-ipsl.upmc.fr (Darwin)
-#
-#   * creation to avoid retall and redefinition of file1 and file2
-#
-#-
-#
-system=$(uname)
-case "${system}" in
-   AIX|IRIX64)
-      echo " www : no specific posix checking"
-   ;;
-   *)
-      set -o posix
-   ;;
-esac
-unset system
-#
-command=$(basename ${0})
-#
-usage=" Usage : ${command} -y year"
-#
-while [ ${#} -gt 0 ]
-do
-   case ${1} in
-      -y)
-         year=${2}
-         shift
-      ;;
-      *)
-         # other choice
-         echo "eee : unknown option ${1}"
-         echo "${usage}"
-         exit 1
-      ;;
-   esac
-   # next flag
-   shift
-done
-unset usage
-#
-# ++ check year validity
-#
-# remove previous output file
-rm Sigma_5d_${year}_grid_T_ORCA2_diff.nc
-#
-# build IDL sequence of commands
-cat <<EOF > /tmp/${command}${$}.pro
-year=getenv('year')
-file1= '/usr/work/sur/fvi/OPA/ORCA2/' + '/Sigma_5d_'+year+'_grid_T.nc'
-file2=getenv('GEOMAG_OD') + '/Sigma_5d_'+year+'_grid_T_ORCA2.nc'
-step2_diff, file1, file2, 'Sigma_5d_'+year+'_grid_T_ORCA2_diff.nc'
-EOF
-#
-unset year
-#
-# launch IDL with the sequence
-${IDL_DIR}/bin/idl < /tmp/${command}${$}.pro
-#
-# cleanning
-#++rm /tmp/${command}${$}.pro
-#
-# end
-exit 0
