Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/README
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/README	(revision 7668)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/README	(revision 7668)
@@ -0,0 +1,25 @@
+# ISOMIP is a simple TEST_CASE to test the iceshelves in NEMO.
+# no input files are needed (all is prescribed in MY_SRC/usr_def routines
+# for a reference documentation on the ISOMIP test case, see experiement 1 on http://efdl.cims.nyu.edu/project_oisi/isomip/experiments/phase_I/idealized_numerical_models_5.pdf
+
+# default namelist is setup for a 30y run on 32 processors with the minimum output using XIOS in attached mode with single file output
+
+# How to build moc.nc and psi.nc
+   - Download or clone the CDFTOOLS (see https://github.com/meom-group/CDFTOOLS)
+   - Compile all the tools (or at least cdfpsi and cdfmoc) on your cluster (see https://github.com/meom-group/CDFTOOLS#using-cdftools)
+   - if mesh_mask.nc is splitted, you need to rebuild them using the rebuild NEMO tools (see in NEMOGCM/TOOLS) or run 1 (or more) time step on a single processor (nn_itend variable in the namelist). 
+   - set the correct link: ln -s mesh_mask.nc mask.nc ; ln -s mesh_mask.nc mesh_hgr.nc ; ln -s mesh_mask.nc mesh_zgr.nc
+   - run the cdftools : 
+        - cdfmoc ISOMIP_1m_00010101_00301231_grid_V.nc                                       => moc.nc
+        - cdfpsi ISOMIP_1m_00010101_00301231_grid_U.nc ISOMIP_1m_00010101_00301231_grid_V.nc => psi.nc
+
+# How to plt moc/psi and melt (python with netcdf and matplotlib library requiried):
+   - psi.png => python2.7 plot_psi.py -f psi.nc -v sobarstf
+   - moc.png => python2.7 plot_moc.py -f moc.nc -v zomsfglo
+   - mlt.png => python2.7 plot_mlt.py -f ISOMIP_1m_00010101_00301231_grid_T.nc -v sowflisf
+by default the last time frame is plotted.
+
+# location the expected circulation and melt plot after 30y of run:
+   - ISOMIP/EXP00/ISOMIP_psi.png
+   - ISOMIP/EXP00/ISOMIP_moc.png
+   - ISOMIP/EXP00/ISOMIP_mlt.png
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/domain_def_nemo.xml
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/ISOMIP/EXP00/domain_def_nemo.xml	(revision 7664)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/domain_def_nemo.xml	(revision 7668)
@@ -1,1 +1,1 @@
-link ../../SHARED/domain_def_nemo.xml
+link ../../../SHARED/domain_def_nemo.xml
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/field_def_nemo-opa.xml
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/ISOMIP/EXP00/field_def_nemo-opa.xml	(revision 7664)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/field_def_nemo-opa.xml	(revision 7668)
@@ -1,1 +1,1 @@
-link ../../SHARED/field_def_nemo-opa.xml
+link ../../../SHARED/field_def_nemo-opa.xml
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/file_def_nemo-opa.xml
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/ISOMIP/EXP00/file_def_nemo-opa.xml	(revision 7664)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/file_def_nemo-opa.xml	(revision 7668)
@@ -20,13 +20,12 @@
       <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->    
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->  
+
       <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
 	<file id="file1" output_freq="1mo" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="votemper"  />
 	  <field field_ref="soce"         name="vosaline"  />
-	  <field field_ref="sst"          name="sosstsst"  />
-	  <field field_ref="sss"          name="sosaline"  />
 	  <field field_ref="ssh"          name="sossheig"  />
           <!-- variable for ice shelf -->
-          <field field_ref="qlatisf"         name="sohflisf"  />
+          <field field_ref="qlatisf"      name="sohflisf"  />
           <field field_ref="fwfisf"       name="sowflisf"  />
           <field field_ref="isfgammat"    name="sogammat"  />
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/iodef.xml
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/ISOMIP/EXP00/iodef.xml	(revision 7664)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/iodef.xml	(revision 7668)
@@ -11,5 +11,5 @@
 
           <variable id="info_level"                type="int">10</variable>
-          <variable id="using_server"              type="bool">true</variable>
+          <variable id="using_server"              type="bool">false</variable>
           <variable id="using_oasis"               type="bool">false</variable>
           <variable id="oasis_codes_id"            type="string" >oceanx</variable>
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/ISOMIP/EXP00/namelist_cfg	(revision 7664)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg	(revision 7668)
@@ -5,29 +5,40 @@
 &namusr_def    !   ISOMIP user defined namelist  
 !-----------------------------------------------------------------------
+   ln_zco      = .false.      ! z-coordinate
+   ln_zps      = .true.       ! z-partial-step coordinate
+   ln_sco      = .false.      ! s-coordinate
+   rn_lam0     =   0.0        !  longitude of first raw and column T-point (jphgr_msh = 1)
+   rn_phi0     = -80.0        ! latitude  of first raw and column T-point (jphgr_msh = 1)
+   rn_e1deg    =   0.3        !  zonal      grid-spacing (degrees)
+   rn_e2deg    =   0.1        !  meridional grid-spacing (degrees)
+   rn_e3       =   30.        !  vertical resolution
 /
 !-----------------------------------------------------------------------
 &namrun        !   parameters of the run
 !-----------------------------------------------------------------------
-   cn_exp      =  "ISOMIP"   !  experience name
+   cn_exp      =  "ISOMIP" !  experience name
    nn_it000    =       1   !  first time step
-   nn_itend    =  490560   !  last  time step
+   nn_itend    =  525600   !  last  time step
    nn_leapy    =       0   !  Leap year calendar (1) or not (0)
    ln_clobber  = .true.    !  clobber (overwrite) an existing file
-   nn_stock    =      48   !  frequency of creation of a restart file (modulo referenced to 1)
+   nn_stock    =  99999999 !  frequency of creation of a restart file (modulo referenced to 1)
    nn_write    =      48   !  frequency of write in the output file   (modulo referenced to nn_it000)
+   nn_istate   =       0   !  output the initial state (1) or not (0)
 /
 !-----------------------------------------------------------------------
 &namcfg     !   parameters of the configuration   
 !-----------------------------------------------------------------------
-   ln_read_cfg = .true.    !  (=T) read the domain configuration file
+   ln_read_cfg = .false.   !  (=T) read the domain configuration file
       !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules
-      cn_domcfg = "ISOMIP_zps_domcfg"      ! domain configuration filename
+      !
+   ln_write_cfg= .true.    !  (=T) create the domain configuration file
+   cn_domcfg_out = "ISOMIP_cfg_out" ! newly created domain configuration filename
 /
 !-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
-   ln_linssh   = .true.    !  =T  linear free surface  ==>>  model level are fixed in time
+   ln_linssh   = .false.    !  =T  linear free surface  ==>>  model level are fixed in time
    !
-   nn_msh      =    0      !  create (>0) a mesh file or not (=0)
+   nn_msh      =    1      !  create (>0) a mesh file or not (=0)
    !
    rn_rdt      = 1800.     !  time step for the dynamics (and tracer if nn_acc=0)
@@ -209,11 +220,4 @@
    ln_eos80    = .true.          !  = Use EOS80 equation of state
    !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS
-   rn_a0       =  0.2         !  thermal expension coefficient (nn_eos= 1)
-   rn_b0       =  0.          !  saline  expension coefficient (nn_eos= 1)
-   rn_lambda1  =  0.          !  cabbeling coeff in T^2  (=0 for linear eos)
-   rn_lambda2  =  0.          !  cabbeling coeff in S^2  (=0 for linear eos)
-   rn_mu1      =  0.          !  thermobaric coeff. in T (=0 for linear eos)
-   rn_mu2      =  0.          !  thermobaric coeff. in S (=0 for linear eos)
-   rn_nu       =  0.          !  cabbeling coeff in T*S  (=0 for linear eos)
 /
 !-----------------------------------------------------------------------
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_ref
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/ISOMIP/EXP00/namelist_ref	(revision 7664)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_ref	(revision 7668)
@@ -1,1 +1,1 @@
-link ../../SHARED/namelist_ref
+link ../../../SHARED/namelist_ref
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_mlt.py
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_mlt.py	(revision 7668)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_mlt.py	(revision 7668)
@@ -0,0 +1,47 @@
+from netCDF4 import Dataset
+import numpy as np
+from numpy import ma
+import argparse
+import matplotlib.pyplot as plt
+import matplotlib
+
+parser = argparse.ArgumentParser()
+parser.add_argument("-f" , metavar='file_name'   , help="names of input files" , type=str  , nargs="+", required=True )
+parser.add_argument("-v" , metavar='var_name'    , help="variable list"        , type=str  , nargs=1  , required=True )
+args = parser.parse_args()
+
+# read mesh_mask
+ncid   = Dataset('mesh_mask.nc')
+lat2d  = ncid.variables['gphit'    ][  :,:].squeeze()
+lon2d  = ncid.variables['glamt'    ][  :,:].squeeze()
+msk    = ncid.variables['tmaskutil'][0,:,:].squeeze()
+ncid.close()
+
+plt.figure(figsize=np.array([210,210]) / 25.4)
+
+# read psi.nc
+ncid   = Dataset(args.f[0])
+var2d  = ncid.variables[args.v[0]][-1,:,:].squeeze() 
+var2dm = ma.masked_where(msk==0.0,var2d)
+# convert in m/y
+var2dm = var2dm * 86400 * 365 / 1e3
+ncid.close()
+ 
+# define colorbar 
+vlevel=np.arange(-1.6,1.8,0.2)
+pcol = plt.contourf(lon2d,lat2d,var2dm,levels=vlevel,extend='both')
+vlevel=np.arange(-1.6,1.8,0.4)
+matplotlib.rcParams['contour.negative_linestyle'] = 'solid'
+plt.contour(lon2d,lat2d,var2dm,levels=vlevel,colors='k')
+plt.grid()
+plt.title('melt rate ISOMIP (m/y)')
+plt.ylabel('Latitude',fontsize=14)
+plt.xlabel('Longitude',fontsize=14)
+cbar = plt.colorbar(pcol, ticks=vlevel)
+cbar.ax.tick_params(labelsize=14)
+
+# save figure
+plt.savefig('mlt.png', format='png', dpi=300)
+
+plt.show()
+
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_moc.py
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_moc.py	(revision 7668)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_moc.py	(revision 7668)
@@ -0,0 +1,60 @@
+from netCDF4 import Dataset
+import numpy as np
+import argparse
+import matplotlib.pyplot as plt
+
+# read argument
+parser = argparse.ArgumentParser()
+parser.add_argument("-f" , metavar='file_name'   , help="names of input files" , type=str  , nargs=1  , required=True )
+parser.add_argument("-v" , metavar='var_name'    , help="variable list"        , type=str  , nargs=1  , required=True )
+args = parser.parse_args()
+
+# read mesh mask
+ncid  = Dataset('mesh_mask.nc')
+vx2d  = ncid.variables['gphit'  ][0,:,0].squeeze()
+vx2dv = ncid.variables['gphiv'  ][0,:,0].squeeze()
+y2d   = ncid.variables['gdepw_0'][0,:,:,1].squeeze()*-1
+y2dt  = ncid.variables['gdept_0'][0,:,:,1].squeeze()*-1
+msk   = ncid.variables['tmask'  ][0,:,:,1].squeeze()
+ncid.close()
+
+# build x 2d array
+x2d=y2d*0.0
+x2dv=y2d*0.0
+for jk in range(0,y2d.shape[0]):
+   x2d[jk,:]=vx2d[:]
+   x2dv[jk,:]=vx2d[:]
+
+plt.figure(figsize=np.array([210,210]) / 25.4)
+
+# read data and mask it
+ncid   = Dataset(args.f[0])
+var2d  = ncid.variables[args.v[0]][-1,:,:,:].squeeze() 
+var2dm = var2d[:,:]
+var2dm[msk==0] = -1
+ncid.close()
+
+# define colorbar
+vlevel=np.arange(0,0.13,0.01)  
+pcol = plt.contourf(x2d,y2d,var2dm,levels=vlevel)
+plt.clf()
+
+# plot contour
+ax = plt.subplot(1, 1, 1)
+ax.contour(x2dv,y2dt,var2dm,levels=vlevel)
+ax.grid()
+ax.set_title('MOC ISOMIP (Sv)')
+ax.set_ylabel('Depth (m)',fontsize=14)
+ax.set_xlabel('Latitude',fontsize=14)
+
+# plot colorbar
+plt.subplots_adjust(left=0.1,right=0.89, bottom=0.1, top=0.89, wspace=0.1, hspace=0.1)
+cax = plt.axes([0.91, 0.1, 0.02, 0.79])
+cbar= plt.colorbar(pcol, ticks=vlevel, cax=cax)
+cbar.ax.tick_params(labelsize=14)
+
+# save figure
+plt.savefig('moc.png', format='png', dpi=300)
+
+plt.show()
+
Index: branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_psi.py
===================================================================
--- branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_psi.py	(revision 7668)
+++ branches/2017/dev_r7663_ISOMIP_TEST_CASE/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/plot_psi.py	(revision 7668)
@@ -0,0 +1,52 @@
+from netCDF4 import Dataset
+import numpy as np
+from numpy import ma
+import argparse
+import matplotlib.pyplot as plt
+
+parser = argparse.ArgumentParser()
+parser.add_argument("-f" , metavar='file_name'   , help="names of input files" , type=str  , nargs="+", required=True )
+parser.add_argument("-v" , metavar='var_name'    , help="variable list"        , type=str  , nargs=1  , required=True )
+args = parser.parse_args()
+
+# read mesh_mask
+ncid   = Dataset('mesh_mask.nc')
+lat2d  = ncid.variables['gphit'    ][  :,:].squeeze()
+lon2d  = ncid.variables['glamt'    ][  :,:].squeeze()
+msk    = ncid.variables['tmaskutil'][0,:,:].squeeze()
+ncid.close()
+
+plt.figure(figsize=np.array([210,210]) / 25.4)
+
+# read psi.nc
+ncid   = Dataset(args.f[0])
+var2d  = ncid.variables[args.v[0]][-1,:,:].squeeze() 
+var2dm = ma.masked_where(msk==0.0,var2d)
+# convert in Sv
+var2dm = var2dm / 1e6
+ncid.close()
+ 
+# define colorbar 
+vlevel=np.arange(0.00,0.36,0.02)
+pcol = plt.contourf(lon2d,lat2d,var2dm,levels=vlevel)
+plt.clf()
+
+# plot contour
+ax = plt.subplot(1, 1, 1)
+ax.contour(lon2d,lat2d,var2dm,levels=vlevel)
+ax.grid()
+ax.set_title('PSI ISOMIP (Sv)')
+ax.set_ylabel('Latitude',fontsize=14)
+ax.set_xlabel('Longitude',fontsize=14)
+
+# plot colorbar
+plt.subplots_adjust(left=0.1,right=0.89, bottom=0.1, top=0.89, wspace=0.1, hspace=0.1)
+cax = plt.axes([0.91, 0.1, 0.02, 0.79])
+cbar= plt.colorbar(pcol, ticks=vlevel, cax=cax)
+cbar.ax.tick_params(labelsize=14)
+
+# save figure
+plt.savefig('psi.png', format='png', dpi=300)
+
+plt.show()
+
