Index: codes/icosagcm/devel/Python/dynamico/getargs.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/getargs.py	(revision 801)
+++ codes/icosagcm/devel/Python/dynamico/getargs.py	(revision 802)
@@ -22,15 +22,27 @@
     return f
 
-class Logger:
-    debug, info, error = [ ignore_first(fun) for fun in 
-                           logging.info, logging.warning, logging.error ]
-    def __init__(self, modulename):
-        arglist = parser.parse_args()
-        if modulename not in arglist.debug :
-            self.debug = noop
-        else:
-            print('Debug ON for module %s'%modulename)
-        config_log()
+def getLogger(modulename='dynamico.main'):
+    # two logger are created
+    # the 'master' logger will be muted if current MPI process is not master
+    # log your messages through master two avoid massive logs with 1000+ MPI processes
+    master, world = logging.getLogger(modulename), logging.getLogger('%s.world'%modulename) 
+    arglist = parser.parse_args()
+    debug=False
+    if modulename in ['dynamico.%s'%name for name in arglist.debug] : debug=True
+    if 'all' in arglist.debug : debug=True
+    if debug:
+#        print('Debug ON for module %s'%modulename)
+        master.setLevel(logging.DEBUG)
+        world.setLevel(logging.DEBUG)
+    else:
+        master.setLevel(logging.INFO)
+        world.setLevel(logging.INFO)
+    masters[modulename]=master
+    return master, world
 
-def config_log(*args, **kwargs):
-    logging.basicConfig(level='INFO', *args, **kwargs)
+def not_master():
+    for logger in masters.values():
+        logger.setLevel(logging.CRITICAL)
+
+masters = {}
+logging.basicConfig()
Index: codes/icosagcm/devel/Python/dynamico/meshes.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/meshes.py	(revision 801)
+++ codes/icosagcm/devel/Python/dynamico/meshes.py	(revision 802)
@@ -12,4 +12,9 @@
 from util import list_stencil, Base_class, inverse_list
 from precision import zeros
+
+import getargs
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
 
 radian=180/math.pi
@@ -57,5 +62,5 @@
     # mass_db = db
     n, llm, ptop = ap_il.shape[0], ap_il.shape[1]-1, ap_il[0,-1]
-    print 'hybrid ptop : ', ptop 
+    DEBUG('hybrid ptop : %f' % ptop) 
     mass_al = (ap_il+ptop*bp_il)/g
     mass_dak, mass_dbk = np.zeros((n,llm)), np.zeros((n,llm))
@@ -63,7 +68,7 @@
         mass_dak[:,k] = mass_al[:,k]-mass_al[:,k+1]
         mass_dbk[:,k] = bp_il[:,k]-bp_il[:,k+1]
-    print mass_al[0,:]
-    print mass_dak[0,:]
-    print mass_dbk[0,:]
+    DEBUG('%s'%mass_al[0,:])
+    DEBUG('%s'%mass_dak[0,:])
+    DEBUG('%s'%mass_dbk[0,:])
     return [ np.asarray(x) for x in bp_il, mass_dak, mass_dbk ]
 
@@ -196,5 +201,5 @@
             f = cdf.Dataset(name, 'w', format='NETCDF4')
         except:
-            print("Cartesian_mesh.ncwrite : Error occurred while opening new netCDF mesh file")
+            ERROR("Cartesian_mesh.ncwrite : Error occurred while opening new netCDF mesh file")
             raise
 
@@ -292,8 +297,8 @@
     def get_pvars(self,pdim,*names): return [self.get_pvar(pdim,name) for name in names]
     def getvars(self,*names): 
-            for name in names : print "getvar %s ..."%name
+            for name in names : DEBUG("getvar %s ..."%name)
             time1=time.time()
             ret=[self.getvar(name) for name in names]
-            print "... Done in %f seconds"%(time.time()-time1)
+            DEBUG("... Done in %f seconds"%(time.time()-time1))
             return ret
     
@@ -306,5 +311,4 @@
         if self.meshtype == 'curvilinear':
             self.nx, self.ny = nc.nx, nc.ny
-        print('#NC4: Opening file:',gridfilename)
     def get_pdim(self,comm,name): return parallel.PDim(self.nc.dimensions[name], comm)
     def getvar(self,name): return self.nc.variables[name][:]
@@ -338,8 +342,8 @@
             self.nc = cdf.Dataset(gridfilename, "r")
         except RuntimeError:
-            print """
+            ERROR("""
 Unable to open grid file %s, maybe you forgot to download it ?
 To do so, go to the 'Python/' dir and execute './get_MPAS_grids.sh'.
-            """ % gridfile
+            """ % gridfile)
             raise
     def get_pdim(self,comm,name): 
@@ -379,5 +383,5 @@
             r=Riv2[ivertex,:]
             r=sum(r)
-            if abs(r-1.)>1e-6 : print 'error with Riv2 at vertex ', ivertex
+            if abs(r-1.)>1e-6 : WARNING('error with Riv2 at vertex %d'%ivertex)
         # scale lengths and areas
         # this is now done by apply_map
@@ -508,5 +512,5 @@
                          'le', 'de', 'lon_e', 'lat_e', 'angle_e')
     def partition_metis(self):
-        print 'Partitioning with ParMetis...'
+        INFO('Partitioning with ParMetis...')
         edge_owner = unst.partition_mesh(self.trisk_deg, self.trisk, self.comm.Get_size())
         self.edge_owner = parallel.LocPArray1D(self.dim_edge, edge_owner)
@@ -521,5 +525,5 @@
             return parallel.LocPArray1D(dim, owner_i + ni*owner_j)
         nx, ny = self.gridfile.nx, self.gridfile.ny
-        print 'Partitioning %d x %d cells in %d x %d blocks ...'%(nx,ny,ni,nj)
+        INFO('Partitioning %d x %d cells in %d x %d blocks ...'%(nx,ny,ni,nj))
         n = self.comm.Get_size()
         assert n == ni*nj, 'Mismatch between ni x nj = %d and MPI_SIZE = %d.'%(ni*nj, n)
@@ -527,5 +531,5 @@
         self.primal_owner = owner(self.dim_primal, self.primal_i, self.primal_j)
         self.dual_owner = self.primal_owner
-        print 'partition_curvilinear %d :'%(self.comm.Get_rank()), self.primal_owner.data
+        DEBUG('partition_curvilinear %d : %s'%(self.comm.Get_rank(), self.primal_owner.data) )
 
     def get(self, getter, *names): return [ getter(self.__dict__[x]) for x in names ]
@@ -557,5 +561,5 @@
         comm, dim_primal, primal_owner, dim_edge, edge_owner, dim_dual, dual_owner = pmesh.members(
             'comm', 'dim_primal', 'primal_owner', 'dim_edge', 'edge_owner', 'dim_dual', 'dual_owner' )
-        print 'Constructing halos ...'
+        INFO('Constructing halos ...')
         edges_E0 = find_my_cells(edge_owner)
         cells_C0, edges_E1, vertices_V1, edges_E2, cells_C1 = chain(
@@ -563,5 +567,5 @@
         edges_E0, edges_E1, edges_E2 = progressive_list(edges_E0, edges_E1, edges_E2)
         cells_C0, cells_C1 = progressive_list(cells_C0, cells_C1)
-        print 'E2,E1,E0 ; C1,C0 : ', map(len, (edges_E2, edges_E1, edges_E0, cells_C1, cells_C0))
+        DEBUG('E2,E1,E0 ; C1,C0 : %s' % map(len, (edges_E2, edges_E1, edges_E0, cells_C1, cells_C0)) )
         get_own_cells, get_all_cells = dim_primal.getter(cells_C0), dim_primal.getter(cells_C1)
         get_all_duals, get_all_edges = dim_dual.getter(vertices_V1), dim_edge.getter(edges_E2)
@@ -583,10 +587,10 @@
         trisk         = pmesh.edge2edge(   edges_E2,    dict_E2)
         Riv2          = pmesh.vertex2cell( vertices_V1, dict_C1)
-        print 'Edge-vertex degree min/max %d %d'%(down_up.degree.min(), down_up.degree.max() )
-        print 'Edge-cell degree min/max %d %d'%(left_right.degree.min(), left_right.degree.max() )
-        print 'Primal degree min/max : %d %d'%(primal_edge.degree.min(), primal_edge.degree.max() )
-        print 'Dual degree min/max : %d %d'%(dual_edge.degree.min(), dual_edge.degree.max() )
-        print 'TRiSK degree min/max : %d %d'%(trisk.degree.min(), trisk.degree.max() )
-        print 'Riv2 degree min/max : %d %d'%(Riv2.degree.min(), Riv2.degree.max() )
+        DEBUG('Edge-vertex degree min/max %d %d'%(down_up.degree.min(), down_up.degree.max()) )
+        DEBUG('Edge-cell degree min/max %d %d'%(left_right.degree.min(), left_right.degree.max()) )
+        DEBUG('Primal degree min/max : %d %d'%(primal_edge.degree.min(), primal_edge.degree.max()) )
+        DEBUG('Dual degree min/max : %d %d'%(dual_edge.degree.min(), dual_edge.degree.max()) )
+        DEBUG('TRiSK degree min/max : %d %d'%(trisk.degree.min(), trisk.degree.max()) )
+        DEBUG('Riv2 degree min/max : %d %d'%(Riv2.degree.min(), Riv2.degree.max()) )
         primal_deg, primal_edge, primal_ne = primal_edge.degree,   primal_edge.neigh_loc, primal_edge.weight
         dual_deg,   dual_edge, dual_ne  = dual_edge.degree, dual_edge.neigh_loc, dual_edge.weight
@@ -608,5 +612,5 @@
         primal_own_all = comm.allgather(primal_own_num)
         displ = sum(primal_own_all[0:comm.Get_rank()]) # required by XIOS
-        print 'local primal mesh :', primal_vertex.min(), primal_vertex.max(), primal_own_all, displ
+#        print 'local primal mesh :', primal_vertex.min(), primal_vertex.max(), primal_own_all, displ
 
         # construct own dual mesh for XIOS output
Index: codes/icosagcm/devel/Python/dynamico/parallel.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/parallel.py	(revision 801)
+++ codes/icosagcm/devel/Python/dynamico/parallel.py	(revision 802)
@@ -11,4 +11,9 @@
 
 from unstructured import ker
+
+import getargs
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
 
 #----------------------- Parallel access to distributed array ------------------------------#
@@ -142,5 +147,5 @@
         send_len = [len(lst) for lst in send]
         send_rank = [rank for rank in range(mpi_size) if (send_len[rank]>0)] # CPUs asking for data
-        print 'send_rank %d'%mpi_rank, send_rank
+        DEBUG('send_rank %d %s'%(mpi_rank, send_rank))
         # asssociate local index to global index
         own_dict = { glob:loc for glob,loc in zip(own_global, own_local) }
Index: codes/icosagcm/devel/Python/dynamico/time_step.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/time_step.py	(revision 801)
+++ codes/icosagcm/devel/Python/dynamico/time_step.py	(revision 802)
@@ -2,4 +2,9 @@
 from scipy import sparse as sparse
 import math as math
+
+import getargs
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
 
 class Struct: pass
@@ -87,8 +92,8 @@
     def __init__(self,precision,bwd_fast_slow, dt,nstage, bsjl,bfjl):
         if bwd_fast_slow is None:
-            print 'SIRK with Fortran-side time stepping'
+            DEBUG('SIRK with Fortran-side time stepping')
             precision=np.float64
         else:
-            print 'SIRK with Python-side time stepping at precision ', precision
+            DEBUG('SIRK with Python-side time stepping at precision %s' % precision)
 
         self.bwd_fast_slow = bwd_fast_slow
@@ -98,5 +103,5 @@
         self.csjl, self.cfjl = [x.astype(precision) for x in csjl, cfjl]
         self.tauj = np.array([dt*bfjl[j,j] for j in range(self.nstage)], dtype=precision)
-        print 'Types of csjl, cfjl, tauj :', self.csjl.dtype, self.cfjl.dtype, self.tauj.dtype
+        DEBUG('Types of csjl, cfjl, tauj : %s %s %s' % (self.csjl.dtype, self.cfjl.dtype, self.tauj.dtype) )
     def next(self,zj):
         csjl, cfjl, tauj = self.csjl, self.cfjl, self.tauj
Index: codes/icosagcm/devel/Python/dynamico/wrap.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/wrap.py	(revision 801)
+++ codes/icosagcm/devel/Python/dynamico/wrap.py	(revision 802)
@@ -1,4 +1,9 @@
 #------------------- wrap C/Fortran routines -------------------#                                                                                           
 import getargs
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
+
+
 import numpy as np 
 from ctypes import *
@@ -55,5 +60,5 @@
                 name = prefix+name
                 soname = self.prefix_so+name
-                if verbose : print 'wrap.Sharedlib : importing', soname
+                DEBUG('wrap.Sharedlib : importing %s' % soname)
                 self.vardict[self.prefix_py+name] = Wrap(self.lib[soname], self.check_args, proto)
     def addvars(self,*types_and_names):
@@ -72,5 +77,2 @@
         for name,val in zip(names,vals):
             self.vars[name].value=val
-
-args = getargs.parse()
-verbose = 'wrap' in args.debug
Index: codes/icosagcm/devel/Python/dynamico/xios.py
===================================================================
--- codes/icosagcm/devel/Python/dynamico/xios.py	(revision 801)
+++ codes/icosagcm/devel/Python/dynamico/xios.py	(revision 802)
@@ -8,5 +8,7 @@
 import getargs
 args=getargs.parse()
-verbose = 'xios' in args.debug
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
 
 #-----------------------------------------------------------------------------
@@ -18,5 +20,6 @@
         return self
     def __exit__(self, type, value, traceback):
-        print('xios_finalize()')
+        INFO('xios_finalize()')
+        DEBUG_ALL('xios_finalize')
         cxios.finalize()
     def min(self,data): return self.comm.allreduce(data, op=MPI.MIN)
@@ -25,9 +28,9 @@
 class Context:
     def __enter__(self):
-        print('cxios.context_close_definition()')
+        INFO('cxios.context_close_definition()')
         cxios.context_close_definition()
         return self
     def __exit__(self, type, value, traceback):
-        print('xios_context_finalize()')
+        INFO('xios_context_finalize()')
         cxios.context_finalize()
     def init_llm(self, mesh, nqtot):
@@ -68,5 +71,5 @@
     mesh = cxios.Handle(cat,id)
     def log(name,data) : 
-        if verbose : print('setup_curvilinear : %s shape min max'%name, data.shape, data.min(), data.max() )
+        DEBUG('setup_curvilinear : %s shape min max %s %s %s'%(name, data.shape, data.min(), data.max()) )
     i_index, j_index, lon, lat = [ x[own] for x in i_index, j_index, lon, lat ]
     log('i_index',i_index)
Index: codes/icosagcm/devel/Python/src/cxios.pyx
===================================================================
--- codes/icosagcm/devel/Python/src/cxios.pyx	(revision 801)
+++ codes/icosagcm/devel/Python/src/cxios.pyx	(revision 802)
@@ -6,4 +6,9 @@
 c_void_pp=POINTER(c_void_p) # used in prototype
 c_void_p_byref=type(byref(c_void_p())) # used in py2c because byref creates an object of this type, not c_void_pp
+
+import getargs
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
 
 # ------------- Direct cython interfaces ----------------- #
@@ -44,6 +49,4 @@
     _fields_ = [(name, c_int) for name in ('year', 'month', 'day', 'hour', 'minute', 'second') ]
 
-print Duration.from_param
-
 for x in c_void_p_byref, Duration, Date : wrap.py2c[x]=wrap.noop # accept arguments of type (void*)&, Duration, ...
 
@@ -78,5 +81,5 @@
             else:
                 raise(TypeError)
-            print self.id+'.'+prefix+key, type(value), extra
+            DEBUG('%s.%s %s %s' % (self.id, prefix+key, type(value), extra) )
     def update_timestep(self):
         lib.update_calendar_timestep(self.handle)
Index: codes/icosagcm/devel/Python/src/unstructured.pyx
===================================================================
--- codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 801)
+++ codes/icosagcm/devel/Python/src/unstructured.pyx	(revision 802)
@@ -9,4 +9,9 @@
 cimport numpy as np
 import numpy as np
+
+import getargs
+log_master, log_world = getargs.getLogger(__name__)
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
 
 #--------------   choose precision of kernel computations  ------------#
@@ -58,11 +63,9 @@
 
 try:    
-    kernels = wrap.SharedLib(vars(ker), libicosa, check_args=check_args) 
-    setvar, setvars, getvar, getvars = kernels.setvar, kernels.setvars, kernels.getvar, kernels.getvars
+   kernels = wrap.SharedLib(vars(ker), libicosa, check_args=check_args) 
+   setvar, setvars, getvar, getvars = kernels.setvar, kernels.setvars, kernels.getvar, kernels.getvars
 except OSError:
-    print """
-Unable to load shared library 'libicosa.so' !
-    """
-    raise
+   ERROR("Unable to load shared library 'libicosa.so' !")
+   raise
 
 # providing a full prototype enables type-checking when calling
@@ -90,8 +93,8 @@
 
 kernels.addvars(
-    c_bool,'hydrostatic','debug_hevi_solver',
+    c_bool,'hydrostatic','debug_hevi_solver', 'is_mpi_master',
     c_int,'llm','nqdyn','primal_num','max_primal_deg',
     'dual_num','max_dual_deg','edge_num','max_trisk_deg',
-    'caldyn_thermo','caldyn_eta','nb_threads','dynamico_mpi_rank',
+    'caldyn_thermo','caldyn_eta','nb_threads',
     c_double,'elapsed',
     c_num, 'g', 'ptop', 'cpp', 'cppv',
@@ -119,7 +122,4 @@
     return data
 
-cdef check_ptr(name, num_ptr p, ndarray data):
-    if p != ptr(data) : print name, 'p <> ptr(data) !!'
-        
 cdef class Caldyn_step:
     # number of time steps to do at each invocation of advance()
@@ -300,5 +300,6 @@
               Ai, Av, fv, le_de, Riv2, wee):
 
-    print 'Types of Ai, Av, fv, le_de, Riv2, wee : ', Ai.dtype,Av.dtype,fv.dtype,le_de.dtype,Riv2.dtype,wee.dtype
+    DEBUG('Types of Ai, Av, fv, le_de, Riv2, wee : %s' % 
+          ((Ai.dtype,Av.dtype,fv.dtype,le_de.dtype,Riv2.dtype,wee.dtype),) )
     for var,varname in zip((Ai,Av,fv,le_de,Riv2,wee), ('Ai','Av','fv','le_de','Riv2','wee')):
         assert var.dtype == np.float64, '%s must be double precision'%varname
@@ -308,12 +309,12 @@
              (llm, nqdyn, edge_num, primal_num, dual_num, 
               max_trisk_deg, max_primal_deg, max_dual_deg) )        
-    print('init_mesh ...')
+    INFO('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')
-    print('init_metric ...')
+    INFO('...done')
+    INFO('init_metric ...')
     ker.dynamico_init_metric(Ai,Av,fv,le_de,Riv2,wee)
-    print ('...done')
+    INFO('...done')
 
 #------------------------ Mesh partitioning ------------------------
Index: codes/icosagcm/devel/Python/test/py/Baroclinic_3D_ullrich.py
===================================================================
--- codes/icosagcm/devel/Python/test/py/Baroclinic_3D_ullrich.py	(revision 801)
+++ codes/icosagcm/devel/Python/test/py/Baroclinic_3D_ullrich.py	(revision 802)
@@ -22,10 +22,11 @@
 getargs.defaults(dt=360., llm=50)
 
-getargs.config_log(filename='out.log',filemode='w') # must be done before calling Logger()
+#getargs.config_log(filename='out.log',filemode='w') # must be done before calling Logger()
 #    getargs.config_log(filename='out.log',filemode='w',
 #                    format='%(processName)s:%(name)s:%(filename)s:%(module)s:%(funcName)s:%(lineno)d:%(levelname)s:%(message)s' )
 
-logging = getargs.Logger('main')
 args = getargs.parse()
+log_master, log_world = getargs.getLogger()
+INFO, DEBUG, DEBUG_ALL, ERROR = log_master.info, log_master.debug, log_world.debug, log_world.error
 
 from dynamico import unstructured as unst
@@ -50,5 +51,5 @@
 def create_pmesh(nx,ny):
     filename = 'cart_%03d_%03d.nc'%(nx,ny)
-    logging.info('Reading Cartesian mesh ...')
+    INFO('Reading Cartesian mesh ...')
     meshfile = meshes.DYNAMICO_Format(filename)
     pmesh = meshes.Unstructured_PMesh(comm,meshfile)
@@ -105,5 +106,5 @@
     y_ek, alpha_ek = np.meshgrid(mesh.lat_e, alpha_k, indexing='ij')
 
-    print(np.shape(alpha_k),np.shape(alpha_l))
+#    print(np.shape(alpha_k),np.shape(alpha_l))
     thermo = dyn.Ideal_perfect(Cpd, Rd, p0, T0)
 
@@ -127,8 +128,8 @@
     u_ek = mesh.ucov3D(ulon(x_ek, y_ek, eta_ek), 0.*eta_ek)
 
-    print('ztop (m) = ', Phi_il[0,-1]/g, ztop)
+    INFO('ztop (m) = %f %f' % (Phi_il[0,-1]/g, ztop) )
     ptop = p(eta(1.))
-    print( 'ptop (Pa) = ', gas.p[0,-1], ptop)
-    print('ztop(ptop) according to Eq. 7:', T0/lap*(1.-(ptop/p0)**(Rd*lap/g))) 
+    INFO( 'ptop (Pa) = %f %f' % (gas.p[0,-1], ptop) )
+    INFO('ztop(ptop) according to Eq. 7: %f' % (T0/lap*(1.-(ptop/p0)**(Rd*lap/g))) ) 
 
     params=dyn.Struct()
@@ -140,5 +141,5 @@
     # define parameters for lower BC
     pbot = p(eta_il[:,0])
-    print( 'min p, T :', pbot.min(), tmean(pbot/p0))
+    INFO( 'min p, T : %f %s' % (pbot.min(), tmean(pbot/p0)) )
     gas_bot = thermo.set_pT(pbot, tmean(pbot/p0))
     params.pbot = gas_bot.p
@@ -167,5 +168,5 @@
 class myDavies(Davies):
     def mask(self,x,y):
-        logging.debug('davies dy = %f'% dx)
+        DEBUG('davies dy = %f'% dx)
         return self.mask0(y,Ly,dx)*self.mask0(-y,0.,dx)
         
@@ -174,6 +175,9 @@
     mpi_rank, mpi_size = comm.Get_rank(), comm.Get_size()
 
-    logging.info('%d/%d starting'%(mpi_rank,mpi_size))
-
+    INFO('%d/%d starting'%(mpi_rank,mpi_size))
+    if mpi_rank>0 : 
+        getargs.not_master()
+        unst.setvar('is_mpi_master', False)
+            
     g, Lx, Ly = 9.80616, 4e7, 6e6
     nx, ny, llm = args.nx, args.ny, args.llm
@@ -181,5 +185,6 @@
     
     unst.setvar('g',g)
-    
+    unst.setvar('debug_hevi_solver', False)
+
     pmesh = create_pmesh(nx,ny)
     thermo, mesh, params, flow0, gas0 = baroclinic_3D(pmesh, dx,Lx,Ly,llm, args.ztop)
@@ -193,5 +198,5 @@
     nt = int(math.ceil(T/dt))
     dt = T/nt
-    logging.info( 'Time step : %d x %g = %g s' % (nt,dt,nt*dt))
+    INFO( 'Time step : %d x %g = %g s' % (nt,dt,nt*dt))
 
     
@@ -215,7 +220,7 @@
                           mesh.lon_i, mesh.lat_i, mesh.lon_e,mesh.lat_e)
 #        print('mask min/max :', davies.beta_i.min(), davies.beta_i.max() )
-        logging.debug('mask min/max :')
-        logging.debug('%f'% davies.beta_i.min())
-        logging.debug('%f'% davies.beta_i.max())
+        DEBUG('mask min/max :')
+        DEBUG('%f'% davies.beta_i.min())
+        DEBUG('%f'% davies.beta_i.max())
 
         def next_flow(m,S,u,Phi,W):
@@ -285,5 +290,5 @@
             context.send_field_dual('curl_abs', zeta_abs_vk)
 
-            print( 'ptop, model top (m) :', unst.getvar('ptop'), Phi.max()/unst.getvar('g'))
+            INFO( 'ptop, model top (m) : %f %f' % (unst.getvar('ptop'), Phi.max()/unst.getvar('g')) )
 
             time1, elapsed1 =time.time(), unst.getvar('elapsed')
@@ -291,7 +296,8 @@
             time2, elapsed2 =time.time(), unst.getvar('elapsed')
             factor = 1000./nt
-            print( 'ms per full time step : ', factor*(time2-time1), factor*(elapsed2-elapsed1))
+            INFO( 'ms per full time step : %f %f' %(factor*(time2-time1), factor*(elapsed2-elapsed1)) )
             factor = 1e9/(4*nt*nx*ny*llm)
-            print( 'nanosec per gridpoint per full time step : ', factor*(time2-time1), factor*(elapsed2-elapsed1))
-
-logging.info('************DONE************')
+            INFO( 'nanosec per gridpoint per full time step : %f %f' %
+                  (factor*(time2-time1), factor*(elapsed2-elapsed1)) )
+
+INFO('************DONE************')
Index: codes/icosagcm/devel/Python/test/py/RSW2_MPAS_W02.py
===================================================================
--- codes/icosagcm/devel/Python/test/py/RSW2_MPAS_W02.py	(revision 801)
+++ codes/icosagcm/devel/Python/test/py/RSW2_MPAS_W02.py	(revision 802)
@@ -1,11 +1,15 @@
-print 'Starting'
+from dynamico import getargs
+log_master, log_world = getargs.getLogger()
+INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
+
+INFO('Starting')
 
 from mpi4py import MPI
 comm = MPI.COMM_WORLD
 mpi_rank, mpi_size = comm.Get_rank(), comm.Get_size()
-print '%d/%d starting'%(mpi_rank,mpi_size)
+INFO('%d/%d starting'%(mpi_rank,mpi_size))
 prefix='fig_RSW2_MPAS_W02/%02d'%mpi_rank
 
-print 'Loading DYNAMICO modules ...'
+INFO('Loading DYNAMICO modules ...')
 from dynamico import unstructured as unst
 from dynamico.meshes import MPAS_Format, Unstructured_PMesh as PMesh, Local_Mesh as Mesh
