Index: codes/icosagcm/devel/Python/dynamico/__init__.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/__init__.py	(revision 617)
+++ codes/icosagcm/devel/Python/dynamico/__init__.py	(revision 618)
@@ -0,0 +1,2 @@
+# import NetCDF before other modules
+import netCDF4
Index: codes/icosagcm/devel/Python/env/X64_CURIE.env
===================================================================
--- codes/icosagcm/devel/Python/env/X64_CURIE.env	(revision 617)
+++ codes/icosagcm/devel/Python/env/X64_CURIE.env	(revision 618)
@@ -3,3 +3,3 @@
 
 # Needed for Intel OpenMP
-KERNELS_LDFLAGS="-liomp5"
+KERNELS_LDFLAGS="$NETCDF_LIBDIR $NETCDF_LIB -liomp5 $MKL_LIBS"
Index: codes/icosagcm/devel/Python/env/linux.env
===================================================================
--- codes/icosagcm/devel/Python/env/linux.env	(revision 617)
+++ codes/icosagcm/devel/Python/env/linux.env	(revision 618)
@@ -25,9 +25,9 @@
 #---------------- To execute ----------------
 
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DYNAMICO_ROOT/lib
-#export PYTHONPATH="$BASEDIR"
+# Python will look for modules (*.py) and extensions (*.so) in PYTHONPATH
+# Shared libs they depend on should be in a standard place or a path included in LD_LIBRARY_PATH
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DYNAMICO_ROOT/lib"
+export PYTHONPATH="$DYNAMICO_ROOT/lib"
 export PYTHON=$(which python)
-#export PYTHON_ROOT=$(basename $(basename $PYTHON))
-
 
 #--------------- Link --------------
@@ -37,6 +37,10 @@
 
 #-------------- Execute --------------
+
 # disable Intel OpenMP in MKL (loaded by numpy) to avoid conflict with our openMP
 export MKL_THREADING_LAYER=SEQUENTIAL
 
+# select a Matplotlib backend that works without an X11 connection
+export MPLBACKEND="agg"
+
 export CODEGEN_ENV_SET=yes
Index: codes/icosagcm/devel/Python/src/functions.h
===================================================================
--- codes/icosagcm/devel/Python/src/functions.h	(revision 617)
+++ codes/icosagcm/devel/Python/src/functions.h	(revision 618)
@@ -1,9 +1,10 @@
 /* KERNELS */
-void init_params(void);
+
+void dynamico_init_params(void);
 
 /* KERNELS -> XIOS */
-void setup_xios(void);
-void call_xios_set_timestep(double);
-void call_xios_update_calendar(int);
+void dynamico_setup_xios(void);
+void dynamico_xios_set_timestep(double);
+void dynamico_xios_update_calendar(int);
 
 /* CXIOS */
Index: codes/icosagcm/devel/Python/src/unstructured.pyx
===================================================================
--- codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 617)
+++ codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 618)
@@ -13,8 +13,8 @@
 
 cdef extern from "functions.h":
-     cpdef void init_params()
-     cpdef void setup_xios()
-     cpdef void call_xios_set_timestep(double)
-     cpdef void call_xios_update_calendar(int)
+     cdef void dynamico_init_params()
+     cpdef void dynamico_setup_xios()
+     cpdef void dynamico_xios_set_timestep(double)
+     cpdef void dynamico_xios_update_calendar(int)
 
 #------------- import and wrap DYNAMICO routines -------------#
@@ -25,5 +25,5 @@
 
 try:    
-    kernels = wrap.SharedLib(vars(ker), 'libkernels.so', check_args=check_args) 
+    kernels = wrap.SharedLib(vars(ker), 'libicosa.so', check_args=check_args) 
     setvar, setvars, getvar, getvars = kernels.setvar, kernels.setvars, kernels.getvar, kernels.getvars
 except OSError:
@@ -40,9 +40,9 @@
 #                     ['call_xios_update_calendar',c_int]
 #                     ['init_params',c_double],
-                     ['init_mesh',c_void_p,13],
-                     ['init_metric', c_void_p,6],
-                     ['init_hybrid', c_void_p,3],
-                     ['caldyn_hevi', c_double, c_void_p,20],
-                     ['partition_graph', c_int,2, c_void_p,3, c_int, c_void_p],
+                     ['dynamico_init_mesh',c_void_p,13],
+                     ['dynamico_init_metric', c_void_p,6],
+                     ['dynamico_init_hybrid', c_void_p,3],
+                     ['dynamico_caldyn_unstructured', c_double, c_void_p,20],
+#                     ['dynamico_partition_graph', c_int,2, c_void_p,3, c_int, c_void_p],
                      ])
 
@@ -81,5 +81,5 @@
         return flow,fast,slow
 
-# when calling caldyn_hevi, arrays for tendencies must be re-created each time
+# when calling caldyn_unstructured, arrays for tendencies must be re-created each time
 # to avoid overwriting in the same memory space when time scheme is multi-stage
 
@@ -92,10 +92,10 @@
                 (True,thermo_boussinesq,eta_lag))
         self.dhs = self.fmass()
-        ker.init_params()
+        dynamico_init_params()
     def _bwd_fast_slow_(self, flow, tau):
         h,u = flow
         # h*s = h => uniform buoyancy s=1 => shallow-water
         dh, du_slow, du_fast, hs, buf = self.fmass(), self.fu(), self.fu(), h.copy(), self.geopot
-        ker.caldyn_hevi(tau, self.ms, h, hs, u, self.geopot, buf,
+        ker.dynamico_caldyn_unstructured(tau, self.ms, h, hs, u, self.geopot, buf,
                   self.s, self.ps, self.pk, self.hflux, self.qv,
                   self.dms, dh, self.dhs, du_fast, du_slow,
@@ -112,9 +112,9 @@
                 (True,caldyn_thermo,caldyn_eta,
                  g,BC.ptop,thermo.Rd,thermo.Cpd,thermo.p0,thermo.T0))
-        ker.init_params()
+        dynamico_init_params()
     def _bwd_fast_slow_(self, flow, tau):
         dm, dS, du_slow, du_fast, buf = self.fmass(), self.ftheta(), self.fu(), self.fu(), self.geopot
         m,S,u = flow
-        ker.caldyn_hevi(tau, self.ms, m, S, u, self.geopot, buf,
+        ker.dynamico_caldyn_unstructured(tau, self.ms, m, S, u, self.geopot, buf,
                   self.s, self.ps, self.pk, self.hflux, self.qv,
                   self.dms, dm, dS, du_fast, du_slow,
@@ -133,5 +133,5 @@
                  g,BC.ptop,thermo.Rd,thermo.Cpd,thermo.p0,thermo.T0,
                  BC.pbot.max(), BC.rho_bot.max()))
-        ker.init_params()
+        dynamico_init_params()
     def bwd_fast_slow(self, flow, tau):
         ftheta, fmass, fu, fw = self.ftheta, self.fmass, self.fu, self.fw 
@@ -139,5 +139,5 @@
         dPhi_slow, dPhi_fast, dW_slow, dW_fast = fw(), fw(), fw(), fw()
         m,S,u,Phi,W = flow
-        ker.caldyn_hevi(tau, self.ms, m, S, u, Phi, W,
+        ker.dynamico_caldyn_unstructured(tau, self.ms, m, S, u, Phi, W,
                   self.s, self.ps, self.pk, self.hflux, self.qv,
                   self.dms, dm, dS, du_fast, du_slow,
@@ -269,10 +269,15 @@
                  'max_trisk_deg','max_primal_deg','max_dual_deg'),
                 (llm,nqdyn,2*nx*ny,nx*ny,nx*ny,4,4,4) )        
-        ker.init_mesh(primal_nb,primal_edge,primal_ne,
+        print('init_mesh ...')
+        ker.dynamico_init_mesh(primal_nb,primal_edge,primal_ne,
                   dual_nb,dual_edge,dual_ne,dual_vertex,
                   left,right,down,up,trisk_deg,trisk)
-
+        print ('...done')
+	
         Aiv=np.zeros(nx*ny)+dx*dy # Ai=Av=dx*dy
-        ker.init_metric(Aiv,Aiv,f+0.*Aiv,le_de,Riv2,-wee)
+       
+        print('init_metric ...')
+        ker.dynamico_init_metric(Aiv,Aiv,f+0.*Aiv,le_de,Riv2,-wee)
+        print ('...done')
     def field_theta(self): return squeeze((self.nqdyn,self.ny,self.nx,self.llm))
     def field_mass(self): return squeeze((self.ny,self.nx,self.llm))
@@ -384,8 +389,8 @@
                       max_trisk_deg, max_primal_deg, max_dual_deg) )
 
-        ker.init_mesh(primal_deg,primal_edge,primal_ne,
+        ker.dynamico_init_mesh(primal_deg,primal_edge,primal_ne,
                        dual_deg,dual_edge,dual_ne,dual_vertex,
                        left,right,down,up,trisk_deg,trisk)
-        ker.init_metric(self.Ai,self.Av,self.fv,le/de,Riv2,wee)
+        ker.dynamico_init_metric(self.Ai,self.Av,self.fv,le/de,Riv2,wee)
         
         for edge in range(edge_num):
@@ -457,5 +462,5 @@
     adjncy_loc, xadj_loc = [np.asarray(list(x), dtype=np.int32) for x in (adjncy_loc, xadj_loc)]
     owner = np.zeros(idx_end-idx_start, dtype=np.int32);
-    ker.partition_graph(mpi_rank, mpi_size, vtxdist, xadj_loc, adjncy_loc, nparts, owner)
+    ker.dynamico_partition_graph(mpi_rank, mpi_size, vtxdist, xadj_loc, adjncy_loc, nparts, owner)
     return owner
 
