[cig-commits] r4957 - in mc/3D/CitcomS/trunk: . CitcomS CitcomS/Components CitcomS/Components/Advection_diffusion CitcomS/Components/Sphere CitcomS/Components/Stokes_solver CitcomS/Solver bin doc/manual etc lib module

leif at geodynamics.org leif at geodynamics.org
Thu Oct 12 07:48:45 PDT 2006


Author: leif
Date: 2006-10-12 07:48:43 -0700 (Thu, 12 Oct 2006)
New Revision: 4957

Added:
   mc/3D/CitcomS/trunk/bin/pycitcoms.c
   mc/3D/CitcomS/trunk/bin/pycppcitcoms.cc
   mc/3D/CitcomS/trunk/module/CitcomSmodule.c
   mc/3D/CitcomS/trunk/module/Regionalmodule.c
   mc/3D/CitcomS/trunk/module/advdiffu.c
   mc/3D/CitcomS/trunk/module/bindings.c
   mc/3D/CitcomS/trunk/module/exceptions.c
   mc/3D/CitcomS/trunk/module/getProperty.h
   mc/3D/CitcomS/trunk/module/initial_conditions.c
   mc/3D/CitcomS/trunk/module/mesher.c
   mc/3D/CitcomS/trunk/module/misc.c
   mc/3D/CitcomS/trunk/module/outputs.c
   mc/3D/CitcomS/trunk/module/setProperties.c
   mc/3D/CitcomS/trunk/module/stokes_solver.c
Removed:
   mc/3D/CitcomS/trunk/CitcomS/Components/CodecConfig.py
   mc/3D/CitcomS/trunk/CitcomS/Components/HackedConfigParser.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Launchers.py
   mc/3D/CitcomS/trunk/bin/pycitcoms.cc
   mc/3D/CitcomS/trunk/etc/CitcomS.pml.in
   mc/3D/CitcomS/trunk/etc/globus.odb
   mc/3D/CitcomS/trunk/etc/lam-mpi.odb
   mc/3D/CitcomS/trunk/etc/lsf.odb
   mc/3D/CitcomS/trunk/etc/mpich.odb
   mc/3D/CitcomS/trunk/etc/pbs.odb
   mc/3D/CitcomS/trunk/module/CitcomSmodule.cc
   mc/3D/CitcomS/trunk/module/PyxMPI/
   mc/3D/CitcomS/trunk/module/Regionalmodule.cc
   mc/3D/CitcomS/trunk/module/advdiffu.cc
   mc/3D/CitcomS/trunk/module/bindings.cc
   mc/3D/CitcomS/trunk/module/exceptions.cc
   mc/3D/CitcomS/trunk/module/initial_conditions.cc
   mc/3D/CitcomS/trunk/module/mesher.cc
   mc/3D/CitcomS/trunk/module/misc.cc
   mc/3D/CitcomS/trunk/module/outputs.cc
   mc/3D/CitcomS/trunk/module/setProperties.cc
   mc/3D/CitcomS/trunk/module/stokes_solver.cc
Modified:
   mc/3D/CitcomS/trunk/CitcomS/BaseApplication.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Advection_diffusion/Advection_diffusion.py
   mc/3D/CitcomS/trunk/CitcomS/Components/BC.py
   mc/3D/CitcomS/trunk/CitcomS/Components/CitcomComponent.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Const.py
   mc/3D/CitcomS/trunk/CitcomS/Components/IC.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Output.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Param.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Phase.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Sphere/Sphere.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py
   mc/3D/CitcomS/trunk/CitcomS/Components/Visc.py
   mc/3D/CitcomS/trunk/CitcomS/CoupledApp.py
   mc/3D/CitcomS/trunk/CitcomS/SimpleApp.py
   mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py
   mc/3D/CitcomS/trunk/bin/Citcom.c
   mc/3D/CitcomS/trunk/bin/Makefile.am
   mc/3D/CitcomS/trunk/bin/citcoms.in
   mc/3D/CitcomS/trunk/bin/coupledcitcoms.in
   mc/3D/CitcomS/trunk/configure.ac
   mc/3D/CitcomS/trunk/doc/manual/citcoms.lyx
   mc/3D/CitcomS/trunk/etc/Makefile.am
   mc/3D/CitcomS/trunk/lib/Advection_diffusion.c
   mc/3D/CitcomS/trunk/lib/Citcom_init.c
   mc/3D/CitcomS/trunk/lib/Drive_solvers.c
   mc/3D/CitcomS/trunk/lib/Full_parallel_related.c
   mc/3D/CitcomS/trunk/lib/Full_version_dependent.c
   mc/3D/CitcomS/trunk/lib/Global_operations.c
   mc/3D/CitcomS/trunk/lib/Instructions.c
   mc/3D/CitcomS/trunk/lib/Lith_age.c
   mc/3D/CitcomS/trunk/lib/Output.c
   mc/3D/CitcomS/trunk/lib/Output_h5.c
   mc/3D/CitcomS/trunk/lib/Parsing.c
   mc/3D/CitcomS/trunk/lib/Process_buoyancy.c
   mc/3D/CitcomS/trunk/lib/Regional_parallel_related.c
   mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c
   mc/3D/CitcomS/trunk/lib/Topo_gravity.c
   mc/3D/CitcomS/trunk/lib/Tracer_advection.c
   mc/3D/CitcomS/trunk/lib/global_defs.h
   mc/3D/CitcomS/trunk/lib/sphere_communication.h
   mc/3D/CitcomS/trunk/module/CitcomSmodule.h
   mc/3D/CitcomS/trunk/module/Makefile.am
   mc/3D/CitcomS/trunk/module/advdiffu.h
   mc/3D/CitcomS/trunk/module/bindings.h
   mc/3D/CitcomS/trunk/module/exceptions.h
   mc/3D/CitcomS/trunk/module/initial_conditions.h
   mc/3D/CitcomS/trunk/module/mesher.h
   mc/3D/CitcomS/trunk/module/misc.h
   mc/3D/CitcomS/trunk/module/outputs.h
   mc/3D/CitcomS/trunk/module/setProperties.h
   mc/3D/CitcomS/trunk/module/stokes_solver.h
   mc/3D/CitcomS/trunk/setup.py
Log:
Moved 'launcher' and '.cfg' support out of CitcomS
and into the framework.

As I was revising the "Installation" chapter of the
manual (still in progress), I got frustrated with
how complicated everything was -- and how difficult
it was to document that complexity -- so I did something
slightly violent:

Converted the CitcomS extension module, 'CitcomSLib',
from C++ to C.  This is made possible by Pythia 0.8.1.0b2,
which replaces _mpimodule with _mpi.pyx, which has a
C interface.

It is now possible to build CitcomS -- and all its
prerequisites (e.g. Python) -- entirely from source,
starting with nothing but a C compiler.  Exchanger still
requires C++, of course.  I have yet to test these changes
with Exchanger enabled, but I don't anticipate any
serious problems.

This may have been overkill, but I also cleaned the
source of C++-style comments (even though most modern C
compilers probably accept them... it became standard
in C99 or something).

I'll bet you can install CitcomS with GCC 2.x now :-)


Modified: mc/3D/CitcomS/trunk/CitcomS/BaseApplication.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/BaseApplication.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/BaseApplication.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -42,6 +42,13 @@
 
 
 
+    def _init(self):
+        Application._init(self)
+        self.nodes = self.getNodes()
+        return
+
+
+
     def main(self, *args, **kwds):
         self.initialize()
         self.reportConfiguration()
@@ -90,52 +97,11 @@
 
 
 
-    def initializeCurator(self, curator, registry):
-        from Components.CodecConfig import CodecConfig
-        cfg = CodecConfig()
-        curator.registerCodecs(cfg)
-        return super(BaseApplication, self).initializeCurator(curator, registry)
 
-
-
-    def collectUserInput(self, registry):
-        # read INI-style .cfg files
-        import journal
-        error = journal.error(self.name)
-        from Components.CodecConfig import CodecConfig
-        curator = self.getCurator()
-        configRegistry = curator.getTraits(self.name, extraDepositories=[], encoding='cfg')
-        self.updateConfiguration(configRegistry)
-        # read parameter files given on the command line
-        from os.path import isfile, splitext
-        for arg in self.argv:
-            if isfile(arg):
-                base, ext = splitext(arg)
-                encoding = ext[1:] # NYI: not quite
-                codec = self.getCurator().codecs.get(encoding)
-                if codec:
-                    shelf = codec.open(base)
-                    paramRegistry = shelf['inventory'].getFacility(self.name)
-                    if paramRegistry:
-                        self.updateConfiguration(paramRegistry)
-                else:
-                    error.log("unknown encoding: %s" % ext)
-            else:
-                error.log("cannot open '%s'" % arg)
-        return
-
-
-
-
     class Inventory(Application.Inventory):
 
         import pyre.inventory
 
-        import Controller
-        import Solver
-
-        launcher = pyre.inventory.facility("launcher", default="mpich")
-
         steps = pyre.inventory.int("steps", default=1)
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Advection_diffusion/Advection_diffusion.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Advection_diffusion/Advection_diffusion.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Advection_diffusion/Advection_diffusion.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -38,9 +38,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Advection_diffusion_set_properties
-        Advection_diffusion_set_properties(self.all_variables, self.inventory)
+        Advection_diffusion_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/BC.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/BC.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/BC.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,9 +37,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import BC_set_properties
-        BC_set_properties(self.all_variables, self.inventory)
+        BC_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/CitcomComponent.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/CitcomComponent.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/CitcomComponent.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,7 +37,7 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         return
 
 

Deleted: mc/3D/CitcomS/trunk/CitcomS/Components/CodecConfig.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/CodecConfig.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/CodecConfig.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-
-from pyre.inventory.odb.Registry import Registry
-from pyre.odb.fs.CodecODB import CodecODB
-from HackedConfigParser import HackedConfigParser
-
-
-class CodecConfig(CodecODB):
-
-    def __init__(self):
-        CodecODB.__init__(self, encoding='cfg')
-        return
-
-    def _decode(self, shelf):
-        root = Registry("root")
-        parser = HackedConfigParser(root)
-        parser.read(shelf.name)
-        shelf['inventory'] = root
-        shelf._frozen = True
-        return
-
-
-# end of file

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Const.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Const.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Const.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -38,9 +38,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Const_set_properties
-        Const_set_properties(self.all_variables, self.inventory)
+        Const_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Deleted: mc/3D/CitcomS/trunk/CitcomS/Components/HackedConfigParser.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/HackedConfigParser.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/HackedConfigParser.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,89 +0,0 @@
-#!/usr/bin/env python
-
-
-from ConfigParser import SafeConfigParser
-import pyre.parsing.locators as locators
-
-
-class HackedConfigParser(SafeConfigParser):
-
-    """Python's SafeConfigParser, hacked to provide file & line info,
-    and extended to populate a Pyre Registry."""
-
-    # This class goes to extreme lengths to extract file and line info
-    # from Python's ConfigParser module.  It injects proxy 'file' and
-    # 'dict' objects into ConfigParser's code.  As the file is parsed,
-    # the proxy objects gain control, spying upon the parsing process.
-    
-    # We should probably write our own parser... *sigh*
-
-    class FileProxy(object):
-
-        def __init__(self):
-            self.fp = None
-            self.name = "unknown"
-            self.lineno = 0
-
-        def readline(self, size=-1):
-            line = self.fp.readline()
-            if line:
-                self.lineno = self.lineno + 1
-            return line
-
-        def __getattr__(self, name):
-            return getattr(self.fp, name)
-
-    class Section(dict):
-
-        def __init__(self, sectname, node, fp):
-            dict.__init__(self)
-            self.node = node
-            self.fp = fp
-        
-        def __setitem__(self, key, value):
-            locator = locators.file(self.fp.name, self.fp.lineno)
-            self.node.setProperty(key, value, locator)
-            dict.__setitem__(self, key, value)
-
-    class SectionDict(dict):
-
-        def __init__(self, root):
-            dict.__init__(self)
-            self.root = root
-            self.fp = HackedConfigParser.FileProxy()
-        
-        def __contains__(self, sectname):
-            # Prevent 'ConfigParser' from creating section
-            # dictionaries; instead, create our own.
-            if not dict.__contains__(self, sectname):
-                node = self._getNode(self.root, sectname.split('.'))
-                cursect = HackedConfigParser.Section(sectname, node, self.fp)
-                self[sectname] = cursect
-            return True
-        
-        def __setitem__(self, key, value):
-            dict.__setitem__(self, key, value)
-
-        def _getNode(self, node, path):
-            if len(path) == 0:
-                return node
-            key = path[0].strip()
-            return self._getNode(node.getNode(key), path[1:])
-    
-    def __init__(self, root, defaults=None):
-        SafeConfigParser.__init__(self, defaults)
-        self._sections = HackedConfigParser.SectionDict(root)
-
-    def _read(self, fp, fpname):
-        self._sections.fp.fp = fp
-        self._sections.fp.name = fpname
-        self._sections.fp.lineno = 0
-        SafeConfigParser._read(self, self._sections.fp, fpname)
-        self._sections.fp.__init__()
-
-    def optionxform(self, optionstr):
-        # Don't lower() option names.
-        return optionstr
-
-
-# end of file

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/IC.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/IC.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/IC.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,18 +37,12 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
 
         from CitcomSLib import IC_set_properties
 
-        inv = self.inventory
-        inv.perturbmag = map(float, inv.perturbmag)
-        inv.perturbl = map(float, inv.perturbl)
-        inv.perturbm = map(float, inv.perturbm)
-        inv.blob_center = map(float, inv.blob_center)
+        IC_set_properties(self.all_variables, self.inventory, stream)
 
-        IC_set_properties(self.all_variables, inv)
-
         return
 
 

Deleted: mc/3D/CitcomS/trunk/CitcomS/Components/Launchers.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Launchers.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Launchers.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,488 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-
-import sys
-from mpi.Launcher import Launcher
-from pyre.util import expandMacros
-
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# utility functions
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-def hms(t):
-    return (int(t / 3600), int((t % 3600) / 60), int(t % 60))
-
-
-defaultEnvironment = "[EXPORT_ROOT,LD_LIBRARY_PATH,PYTHONPATH]"
-
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# MPI Launchers:
-#     (Replacement) Launcher for MPICH
-#     Launcher for LAM/MPI
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-class LauncherMPI(Launcher):
-
-
-    class Inventory(Launcher.Inventory):
-
-        import pyre.inventory
-
-        dry = pyre.inventory.bool("dry", default=False)
-        dry.meta['tip'] = "prints the command line and exits"
-        
-        debug = pyre.inventory.bool("debug", default=False)
-
-        Launcher.Inventory.nodes.meta['tip'] = """number of machine nodes"""
-        Launcher.Inventory.nodelist.meta['tip'] = """a comma-separated list of machine names in square brackets (e.g., [101-103,105,107])"""
-        nodegen = pyre.inventory.str("nodegen")
-        nodegen.meta['tip'] = """a printf-style format string, used in conjunction with 'nodelist' to generate the list of machine names (e.g., "n%03d")"""
-        
-        extra = pyre.inventory.str("extra")
-        extra.meta['tip'] = "extra arguments to pass to mpirun"
-        
-        command = pyre.inventory.str("command", default="mpirun")
-        interpreter = pyre.inventory.str("interpreter", default=sys.executable)
-
-
-    def launch(self):
-        args = self._buildArgumentList()
-        if not args:
-            return self.inventory.dry
-        
-        command = " ".join(args)
-        self._info.log("executing: {%s}" % command)
-
-        if self.inventory.dry:
-            print command
-            return True
-        
-        import os
-        os.system(command)
-        return True
-
-            
-    def _buildArgumentList(self):
-        import sys
-
-        interpreter = self.inventory.interpreter
-
-        if not self.nodes:
-            self.nodes = len(self.nodelist)
-
-        # build the command
-        args = []
-        args.append(self.inventory.command)
-        self._appendMpiRunArgs(args)
-
-        # add the parallel version of the interpreter on the command line
-        args.append(interpreter)
-
-        args += sys.argv
-        args.append("--mode=worker")
-
-        return args
-
-    
-    def _appendMpiRunArgs(self, args):
-        args.append(self.inventory.extra)
-        args.append("-np %d" % self.nodes)
-        
-        # use only the specific nodes specified explicitly
-        if self.nodelist:
-            self._appendNodeListArgs(args)
-
-
-class LauncherMPICH(LauncherMPI):
-
-
-    class Inventory(LauncherMPI.Inventory):
-
-        import pyre.inventory
-
-        machinefile = pyre.inventory.str("machinefile", default="mpirun.nodes")
-        machinefile.meta['tip'] = """filename of machine file"""
-
-
-    def __init__(self):
-        LauncherMPI.__init__(self, "mpich")
-
-
-    def _appendNodeListArgs(self, args):
-        machinefile = self.inventory.machinefile
-        nodegen = self.inventory.nodegen
-        file = open(machinefile, "w")
-        for node in self.nodelist:
-            file.write((nodegen + '\n') % node)
-        file.close()
-        args.append("-machinefile %s" % machinefile)
-
-
-class LauncherLAMMPI(LauncherMPI):
-
-
-    class Inventory(LauncherMPI.Inventory):
-
-        import pyre.inventory
-
-        environment = pyre.inventory.list("environment", default=defaultEnvironment)
-        environment.meta['tip'] = """a comma-separated list of environment variables to export to the batch job"""
-
-
-    def __init__(self):
-        LauncherMPI.__init__(self, "lam-mpi")
-
-
-    def _appendMpiRunArgs(self, args):
-        args.append("-x %s" % ','.join(self.inventory.environment))
-        super(LauncherLAMMPI, self)._appendMpiRunArgs(args)
-
-
-    def _appendNodeListArgs(self, args):
-        nodegen = self.inventory.nodegen
-        args.append("n" + ",".join([(nodegen) % node for node in self.nodelist]))
-
-
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# These are Launchers for batch schedulers found on the TeraGrid.
-# These should be incorporated into Pythia eventually.
-
-# With something like StringTemplate by Terence Parr and Marq Kole,
-# the batch scripts could be generated entirely from an
-# inventory-data-driven template.
-
-#     http://www.stringtemplate.org/doc/python-doc.html
-
-# This code uses a hybrid approach, mixing Python logic with primitive
-# templates powered by pyre.util.expandMacros().
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-class LauncherBatch(Launcher):
-
-
-    class Inventory(Launcher.Inventory):
-
-        import os, sys
-        import pyre.inventory
-        from pyre.units.time import minute
-
-        dry = pyre.inventory.bool("dry", default=False)
-        debug = pyre.inventory.bool("debug", default=False)
-
-        interpreter = pyre.inventory.str("interpreter", default=sys.executable)
-        task = pyre.inventory.str("task")
-
-        # Ignore 'nodegen' so that the examples will work without modification.
-        nodegen = pyre.inventory.str("nodegen")
-        nodegen.meta['tip'] = """(ignored)"""
-
-        walltime = pyre.inventory.dimensional("walltime", default=0*minute)
-        mail = pyre.inventory.bool("mail", default=False)
-        queue = pyre.inventory.str("queue")
-
-        directory = pyre.inventory.str("directory", default="${cwd}")
-        script = pyre.inventory.str("script", default="${directory}/script")
-        stdout = pyre.inventory.str("stdout", default="${directory}/stdout")
-        stderr = pyre.inventory.str("stderr", default="${directory}/stderr")
-        environment = pyre.inventory.list("environment", default=defaultEnvironment)
-
-        cwd = pyre.inventory.str("cwd", default=os.getcwd())
-        argv = pyre.inventory.str("argv", default=(' '.join(sys.argv)))
-
-
-    def launch(self):
-        if self.inventory.dry:
-            print self._buildScript()
-            print "# submit with:"
-            print "#", self._buildBatchCommand()
-            return True
-        
-        # write the script
-        scriptFile = open(expandMacros("${script}", self.inv), "w")
-        scriptFile.write(self._buildScript())
-        scriptFile.close()
-
-        # build the batch command
-        command = self._buildBatchCommand()
-        self._info.log("executing: {%s}" % command)
-
-        import os
-        os.system(command)
-        return True
-
-
-    def __init__(self, name):
-        Launcher.__init__(self, name)
-        
-        # Used to recursively expand ${macro) in format strings using my inventory.
-        class InventoryAdapter(object):
-            def __init__(self, launcher):
-                self.launcher = launcher
-            def __getitem__(self, key):
-                return expandMacros(str(self.launcher.inventory.getTraitValue(key)), self)
-        self.inv = InventoryAdapter(self)
-        
-        return
-
-
-    def _buildBatchCommand(self):
-        return expandMacros("${batch-command} ${script}", self.inv)
-
-
-    def _buildScript(self):
-        script = [
-            "#!/bin/sh",
-            ]
-        self._buildScriptDirectives(script)
-        script += [
-            expandMacros('''\
-
-cd ${directory}
-${command} ${interpreter} ${argv} --mode=worker
-''', self.inv)
-            ]
-        script = "\n".join(script) + "\n"
-        return script
-
-
-# Note: mpi.LauncherPBS in Pythia-0.8 does not work!
-
-class LauncherPBS(LauncherBatch):
-
-
-    class Inventory(LauncherBatch.Inventory):
-        
-        import pyre.inventory
-        
-        command = pyre.inventory.str("command", default="mpirun -np ${nodes} -machinefile $PBS_NODEFILE") # Sub-launcher?
-        batch_command = pyre.inventory.str("batch-command", default="qsub")
-        qsub_options = pyre.inventory.list("qsub-options")
-
-
-    def __init__(self):
-        LauncherBatch.__init__(self, "pbs")
-
-
-    def _buildScriptDirectives(self, script):
-        
-        queue = self.inventory.queue
-        if queue:
-            script.append("#PBS -q %s" % queue)
-
-        task = self.inventory.task
-        if task:
-            script.append("#PBS -N %s" % task)
-
-        if self.inventory.stdout:
-            script.append(expandMacros("#PBS -o ${stdout}", self.inv))
-        if self.inventory.stderr:
-            script.append(expandMacros("#PBS -e ${stderr}", self.inv))
-
-        resourceList = self._buildResourceList()
-
-        script += [
-            "#PBS -V", # export qsub command environment to the batch job
-            "#PBS -l %s" % resourceList,
-            ]
-
-        script += ["#PBS " + option for option in self.inventory.qsub_options]
-
-        return script
-
-
-
-    def _buildResourceList(self):
-
-        resourceList = [
-            "nodes=%d" % self.nodes,
-            ]
-
-        walltime = self.inventory.walltime.value
-        if walltime:
-            resourceList.append("walltime=%d:%02d:%02d" % hms(walltime))
-
-        resourceList = ",".join(resourceList)
-
-        return resourceList
-
-
-class LauncherLSF(LauncherBatch):
-
-
-    class Inventory(LauncherBatch.Inventory):
-        
-        import pyre.inventory
-        
-        command = pyre.inventory.str("command", default="mpijob mpirun")
-        batch_command = pyre.inventory.str("batch-command", default="bsub")
-        bsub_options = pyre.inventory.list("bsub-options")
-
-
-    def __init__(self):
-        LauncherBatch.__init__(self, "lsf")
-
-
-    def _buildBatchCommand(self):
-        return expandMacros("${batch-command} < ${script}", self.inv)
-
-
-    def _buildScriptDirectives(self, script):
-
-        # LSF scripts must have a job name; otherwise strange "/bin/sh: Event not found"
-        # errors occur (tested on TACC's Lonestar system).
-        task = self.inventory.task
-        if not task:
-            task = "jobname"
-        script.append("#BSUB -J %s" % task)
-        
-        queue = self.inventory.queue
-        if queue:
-            script.append("#BSUB -q %s" % queue)
-
-        walltime = self.inventory.walltime.value
-        if walltime:
-            script.append("#BSUB -W %d:%02d" % hms(walltime)[0:2])
-        
-        if self.inventory.stdout:
-            script.append(expandMacros("#BSUB -o ${stdout}", self.inv))
-        if self.inventory.stderr:
-            script.append(expandMacros("#BSUB -e ${stderr}", self.inv))
-            
-        script += [
-            "#BSUB -n %d" % self.nodes,
-            ]
-
-        script += ["#BSUB " + option for option in self.inventory.bsub_options]
-
-        return script
-
-
-class LauncherGlobus(LauncherBatch):
-
-
-    class Inventory(LauncherBatch.Inventory):
-
-        import pyre.inventory
-
-        batch_command = pyre.inventory.str("batch-command", default="globusrun")
-        resource = pyre.inventory.str("resource", default="localhost")
-
-
-    def _buildBatchCommand(self):
-        return expandMacros("${batch-command} -b -r ${resource} -f ${script}", self.inv)
-
-
-    def __init__(self):
-        LauncherBatch.__init__(self, "globus")
-
-
-    def _buildScript(self):
-        import sys
-
-        script = [
-            expandMacros('''\
-&   (jobType=mpi)
-    (executable="${interpreter}")
-    (count=${nodes})
-    (directory="${directory}")
-    (stdout="${stdout}")
-    (stderr="${stderr}")''', self.inv),
-            ]
-        
-        script.append('    (environment = %s)' % self._buildEnvironment())
-
-        # add the arguments
-        args = sys.argv
-        args.append("--mode=worker")
-        command = '    (arguments= ' + ' '.join([('"%s"' % arg) for arg in args]) + ')'
-        script.append(command)
-
-        script = '\n'.join(script) + '\n'
-
-        return script
-
-
-    def _buildEnvironment(self):
-        from os import environ
-        #vars = environ.keys()
-        vars = self.inventory.environment
-        env = [('(%s "%s")' % (var, environ.get(var,""))) for var in vars]
-        env = ' '.join(env)
-        return env
-
-
-# main
-if __name__ == "__main__":
-
-    
-    from pyre.applications.Script import Script
-
-    
-    class TestApp(Script):
-
-        
-        class Inventory(Script.Inventory):
-            
-            import pyre.inventory
-            from mpi.Launcher import Launcher
-
-            launcher = pyre.inventory.facility("launcher", default="mpich")
-
-
-        def main(self, *args, **kwds):
-            launcher = self.inventory.launcher
-            if launcher:
-                try:
-                    # batch launcher
-                    print launcher._buildScript()
-                    print
-                    print "# submit with", launcher._buildBatchCommand()
-                except AttributeError:
-                    # direct launcher
-                    print ' '.join(launcher._buildArgumentList())
-            return
-
-        
-        def __init__(self):
-            Script.__init__(self, "CitcomS")
-
-    
-    app = TestApp()
-    app.run()
-
-
-# version
-__id__ = "$Id$"
-
-# End of file 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Output.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Output.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Output.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,9 +37,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Output_set_properties
-        Output_set_properties(self.all_variables, self.inventory)
+        Output_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Param.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Param.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Param.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,9 +37,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Param_set_properties
-        Param_set_properties(self.all_variables, self.inventory)
+        Param_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Phase.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Phase.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Phase.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,9 +37,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Phase_set_properties
-        Phase_set_properties(self.all_variables, self.inventory)
+        Phase_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Sphere/Sphere.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Sphere/Sphere.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Sphere/Sphere.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -58,9 +58,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Sphere_set_properties
-        Sphere_set_properties(self.all_variables, self.inventory)
+        Sphere_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Stokes_solver/Incompressible.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -70,9 +70,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Incompressible_set_properties
-        Incompressible_set_properties(self.all_variables, self.inventory)
+        Incompressible_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Tracer.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -45,9 +45,9 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
         from CitcomSLib import Tracer_set_properties
-        Tracer_set_properties(self.all_variables, self.inventory)
+        Tracer_set_properties(self.all_variables, self.inventory, stream)
         return
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Components/Visc.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Components/Visc.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Components/Visc.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -37,7 +37,7 @@
 
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
 
         from CitcomSLib import Visc_set_properties
 
@@ -48,7 +48,7 @@
         inv.viscZ = map(float, inv.viscZ)
         inv.sdepv_expt = map(float, inv.sdepv_expt)
 
-        Visc_set_properties(self.all_variables, inv)
+        Visc_set_properties(self.all_variables, inv, stream)
 
         return
 

Modified: mc/3D/CitcomS/trunk/CitcomS/CoupledApp.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/CoupledApp.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/CoupledApp.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -48,14 +48,12 @@
 
 
 
-    def _configure(self):
-        BaseApplication._configure(self)
+    def getNodes(self):
         s1 = self.inventory.solver1.inventory.mesher.inventory
         nproc1 = s1.nproc_surf * s1.nprocx * s1.nprocy * s1.nprocz
         s2 = self.inventory.solver2.inventory.mesher.inventory
         nproc2 = s2.nproc_surf * s2.nprocx * s2.nprocy * s2.nprocz
-        self.inventory.launcher.nodes = nproc1 + nproc2
-        return
+        return nproc1 + nproc2
 
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/SimpleApp.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/SimpleApp.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/SimpleApp.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -43,12 +43,10 @@
 
 
 
-    def _configure(self):
-        BaseApplication._configure(self)
+    def getNodes(self):
         s = self.inventory.solver.inventory.mesher.inventory
         nproc = s.nproc_surf * s.nprocx * s.nprocy * s.nprocz
-        self.inventory.launcher.nodes = nproc
-        return
+        return nproc
 
 
 

Modified: mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py
===================================================================
--- mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/CitcomS/Solver/Solver.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -97,7 +97,12 @@
         global_default_values(self.all_variables)
         set_signal()
 
-        self.setProperties()
+        #pid = self.all_variables.control.PID
+        from os import getpid
+        pid = getpid()
+        stream = open("pid%d.cfg" % pid, "w")
+        self.setProperties(stream)
+        stream.close()
 
         self.restart = self.inventory.ic.inventory.restart
 
@@ -209,25 +214,25 @@
         return
 
 
-    def setProperties(self):
+    def setProperties(self, stream):
 
         from CitcomSLib import Solver_set_properties
 
-        Solver_set_properties(self.all_variables, self.inventory)
+        Solver_set_properties(self.all_variables, self.inventory, stream)
 
 	inv = self.inventory
-        inv.mesher.setProperties()
-        inv.tsolver.setProperties()
-        inv.vsolver.setProperties()
+        inv.mesher.setProperties(stream)
+        inv.tsolver.setProperties(stream)
+        inv.vsolver.setProperties(stream)
 
-        inv.bc.setProperties()
-        inv.const.setProperties()
-        inv.ic.setProperties()
-        inv.output.setProperties()
-        inv.param.setProperties()
-        inv.phase.setProperties()
-        inv.tracer.setProperties()
-        inv.visc.setProperties()
+        inv.bc.setProperties(stream)
+        inv.const.setProperties(stream)
+        inv.ic.setProperties(stream)
+        inv.output.setProperties(stream)
+        inv.param.setProperties(stream)
+        inv.phase.setProperties(stream)
+        inv.tracer.setProperties(stream)
+        inv.visc.setProperties(stream)
 
         return
 

Modified: mc/3D/CitcomS/trunk/bin/Citcom.c
===================================================================
--- mc/3D/CitcomS/trunk/bin/Citcom.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/bin/Citcom.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -38,6 +38,9 @@
 
 extern int Emergency_stop;
 
+void full_solver_init(struct All_variables *E);
+void regional_solver_init(struct All_variables *E);
+
 int main(argc,argv)
      int argc;
      char **argv;

Modified: mc/3D/CitcomS/trunk/bin/Makefile.am
===================================================================
--- mc/3D/CitcomS/trunk/bin/Makefile.am	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/bin/Makefile.am	2006-10-12 14:48:43 UTC (rev 4957)
@@ -36,9 +36,8 @@
 bin_SCRIPTS += citcoms coupledcitcoms
 
 if COND_EMBEDDING
-    bin_PROGRAMS += pycitcoms
-    INTERPRETER = $(bindir)/pycitcoms
-    noinstINTERPRETER = $(abs_builddir)/pycitcoms
+    INTERPRETER = $(bindir)/$(PYCITCOMS)
+    noinstINTERPRETER = $(abs_builddir)/$(PYCITCOMS)
     noinstPYTHONPATH = $(abs_top_srcdir)
     libCitcomS = $(top_builddir)/lib/libCitcomS.a
 else
@@ -49,13 +48,13 @@
 endif
 
 if COND_EXCHANGER
-    MAYBE_EXCHANGER_CPPFLAGS = -DWITH_EXCHANGER
+    bin_PROGRAMS += pycppcitcoms
+    PYCITCOMS = pycppcitcoms
     MAYBE_EXCHANGER_INCLUDES = -I$(top_srcdir)/module/Exchanger
-    MAYBE_EXCHANGER_LDADD = $(top_builddir)/module/Exchanger/libExchangerLibmodule.a
 else
-    MAYBE_EXCHANGER_CPPFLAGS =
+    bin_PROGRAMS += pycitcoms
+    PYCITCOMS = pycitcoms
     MAYBE_EXCHANGER_INCLUDES =
-    MAYBE_EXCHANGER_LDADD =
 endif
 
 endif
@@ -110,21 +109,18 @@
 	  else :; fi; \
 	done
 EXTRA_DIST = citcoms.in coupledcitcoms.in
+CLEANFILES = $(bin_SCRIPTS)
 
-# pycitcoms (libCitcomS + CitcomSLibmodule + libExchanger +
-# ExchangerLibmodule + embedded Python interpreter)
-pycitcoms_CPPFLAGS = $(MAYBE_EXCHANGER_CPPFLAGS)
-pycitcoms_SOURCES = pycitcoms.cc
+# pycitcoms (libCitcomS + CitcomSLibmodule + embedded Python interpreter)
+pycitcoms_SOURCES = pycitcoms.c
 pycitcoms_LDADD = \
-	$(top_builddir)/module/libPyxMPImodule.a \
-	$(MAYBE_EXCHANGER_LDADD) \
 	$(top_builddir)/module/libCitcomSLibmodule.a \
 	$(libCitcomS) \
 	$(LIBHDF5) \
 	$(LIBM)
 pycitcoms$(EXEEXT): $(pycitcoms_OBJECTS) $(pycitcoms_DEPENDENCIES) 
 	@rm -f pycitcoms$(EXEEXT)
-	$(CXXLINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
+	$(LINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
 		$(pycitcoms_LDFLAGS) $(pycitcoms_OBJECTS) $(pycitcoms_LDADD) \
 		$(PYTHON_EGG_LDFLAGS) \
 		$(PYTHON_BLDLIBRARY) \
@@ -134,4 +130,22 @@
 		$(LIBS) \
 		$(PYTHON_LDLAST)
 
+# pycppcitcoms (libCitcomS + CitcomSLibmodule + libExchanger +
+# ExchangerLibmodule + embedded Python interpreter)
+pycppcitcoms_SOURCES = pycppcitcoms.cc
+pycppcitcoms_LDADD = \
+	$(top_builddir)/module/Exchanger/libExchangerLibmodule.a \
+	$(pycitcoms_LDADD)
+pycppcitcoms$(EXEEXT): $(pycppcitcoms_OBJECTS) $(pycppcitcoms_DEPENDENCIES) 
+	@rm -f pycitcoms$(EXEEXT)
+	$(CXXLINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
+		$(pycppcitcoms_LDFLAGS) $(pycppcitcoms_OBJECTS) $(pycppcitcoms_LDADD) \
+		$(PYTHON_EGG_LDFLAGS) \
+		$(PYTHON_BLDLIBRARY) \
+		$(MPILIBS) \
+		$(FCLIBS) \
+		$(PYTHON_LIBS) $(PYTHON_MODLIBS) $(PYTHON_SYSLIBS) \
+		$(LIBS) \
+		$(PYTHON_LDLAST)
+
 ## end of Makefile.am

Modified: mc/3D/CitcomS/trunk/bin/citcoms.in
===================================================================
--- mc/3D/CitcomS/trunk/bin/citcoms.in	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/bin/citcoms.in	2006-10-12 14:48:43 UTC (rev 4957)
@@ -36,21 +36,10 @@
     if directory:
         directory = os.path.abspath(directory)
         sys.path.insert(1, directory)
+import pythia
 
-from PyxMPI import MPI_Init, MPI_Finalize
-
-inParallel = False
-for arg in sys.argv:
-    if arg == "--mode=worker":
-        inParallel = True
-        MPI_Init(sys.argv)
-        break
-
 from CitcomS.SimpleApp import SimpleApp
 app = SimpleApp()
 app.run()
 
-if inParallel:
-    MPI_Finalize()
-
 #  end of file 

Modified: mc/3D/CitcomS/trunk/bin/coupledcitcoms.in
===================================================================
--- mc/3D/CitcomS/trunk/bin/coupledcitcoms.in	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/bin/coupledcitcoms.in	2006-10-12 14:48:43 UTC (rev 4957)
@@ -36,21 +36,10 @@
     if directory:
         directory = os.path.abspath(directory)
         sys.path.insert(1, directory)
+import pythia
 
-from PyxMPI import MPI_Init, MPI_Finalize
-
-inParallel = False
-for arg in sys.argv:
-    if arg == "--mode=worker":
-        inParallel = True
-        MPI_Init(sys.argv)
-        break
-
 from CitcomS.CoupledApp import CoupledApp
 app = CoupledApp()
 app.run()
 
-if inParallel:
-    MPI_Finalize()
-
 #  end of file 

Copied: mc/3D/CitcomS/trunk/bin/pycitcoms.c (from rev 4749, mc/3D/CitcomS/trunk/bin/pycitcoms.cc)
===================================================================
--- mc/3D/CitcomS/trunk/bin/pycitcoms.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/bin/pycitcoms.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,58 @@
+/* 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+// 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/ 
+
+#include <Python.h>
+#include <stdio.h>
+#include <mpi.h>
+#include "CitcomSmodule.h"
+#ifdef WITH_EXCHANGER
+#include "Exchangermodule.h"
+#endif
+
+/* include the implementation of _mpi */
+#include "mpi/_mpi.c"
+
+struct _inittab inittab[] = {
+    { "_mpi", init_mpi },
+#ifdef WITH_EXCHANGER
+    { "ExchangerLib", initExchangerLib },
+#endif
+    { "CitcomSLib", initCitcomSLib },
+    { 0, 0 }
+};
+
+int main(int argc, char **argv)
+{
+    /* add our extension module */
+    if (PyImport_ExtendInittab(inittab) == -1) {
+        fprintf(stderr, "%s: PyImport_ExtendInittab failed! Exiting...\n", argv[0]);
+        return 1;
+    }
+    return Py_Main(argc, argv);
+}
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/bin/pycitcoms.cc
===================================================================
--- mc/3D/CitcomS/trunk/bin/pycitcoms.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/bin/pycitcoms.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,64 +0,0 @@
-// -*- C++ -*-
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-
-#include <Python.h>
-#include <stdio.h>
-#include <mpi.h>
-#include "CitcomSmodule.h"
-#ifdef WITH_EXCHANGER
-#include "Exchangermodule.h"
-#endif
-
-PyMODINIT_FUNC initPyxMPI(void);
-
-struct _inittab inittab[] = {
-    { "PyxMPI", initPyxMPI },
-#ifdef WITH_EXCHANGER
-    { "ExchangerLib", initExchangerLib },
-#endif
-    { "CitcomSLib", initCitcomSLib },
-    { 0, 0 }
-};
-
-void dummy()
-{
-    int flag;
-    MPI_Initialized(&flag);
-}
-
-int main(int argc, char **argv)
-{
-    /* add our extension module */
-    if (PyImport_ExtendInittab(inittab) == -1) {
-        fprintf(stderr, "%s: PyImport_ExtendInittab failed! Exiting...\n", argv[0]);
-        return 1;
-    }
-    return Py_Main(argc, argv);
-}
-
-// End of file

Copied: mc/3D/CitcomS/trunk/bin/pycppcitcoms.cc (from rev 4749, mc/3D/CitcomS/trunk/bin/pycitcoms.cc)
===================================================================
--- mc/3D/CitcomS/trunk/bin/pycitcoms.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/bin/pycppcitcoms.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,35 @@
+// -*- C++ -*-
+// 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+// 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+
+#include "Exchangermodule.h"
+
+#define WITH_EXCHANGER
+
+#include "pycitcoms.c"
+
+// End of file

Modified: mc/3D/CitcomS/trunk/configure.ac
===================================================================
--- mc/3D/CitcomS/trunk/configure.ac	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/configure.ac	2006-10-12 14:48:43 UTC (rev 4957)
@@ -65,7 +65,7 @@
     CIT_PYTHON_SYSCONFIG
 
     # Checks for Python modules and packages.
-    CIT_CHECK_PYTHON_EGG([pythia >= 0.8-1.0b1, < 0.8-2.0a])
+    CIT_CHECK_PYTHON_EGG([pythia >= 0.8.1.0b2, < 0.8-2.0a])
     if test "$want_exchanger" != no; then
         CIT_CHECK_PYTHON_EGG([Exchanger >= 1.0, < 2.0a],
                              [ # found
@@ -96,10 +96,13 @@
     CIT_PROG_PYCONFIG
     AC_SUBST([pkgsysconfdir], [\${sysconfdir}/$PACKAGE])
 fi
+# We don't need Fortran.
+AC_PROVIDE([AC_PROG_F77])
 AC_PROG_LIBTOOL
+AC_LANG(C)
 
 # Checks for libraries.
-if test "$want_pyre" = yes; then
+if test "$want_exchanger" = yes; then
     AC_LANG_PUSH(C++)
     CIT_CHECK_LIB_MPI
     AC_LANG_POP(C++)
@@ -108,7 +111,7 @@
 fi
 
 # Checks for header files.
-if test "$want_pyre" = yes; then
+if test "$want_exchanger" = yes; then
     AC_LANG_PUSH(C++)
     CIT_HEADER_MPI
     AC_LANG_POP(C++)
@@ -200,14 +203,16 @@
 echo "================ Configuration Summary ================"
 echo -e "\t PYTHON: " $PYTHON
 echo -e "\t PYTHONPATH: " $PYTHONPATH
-echo -e "\t LAUNCHER: " $LAUNCHER
-echo -e "\t MPIRUN: " $MPIRUN
 echo -e "\t MPICC: " $MPICC
-echo -e "\t MPICXX: " $MPICXX
+if test "$want_exchanger" = yes; then
+   echo -e "\t MPICXX: " $MPICXX
+fi
 echo -e "\t CFLAGS: " $CFLAGS
 echo -e "\t CPPFLAGS: " $CPPFLAGS
 echo -e "\t LDFLAGS: " $LDFLAGS
-echo -e "\t CXXFLAGS: " $CXXFLAGS
+if test "$want_exchanger" = yes; then
+    echo -e "\t CXXFLAGS: " $CXXFLAGS
+fi
 echo -e "\t with-pyre: " $want_pyre
 echo -e "\t with-exchanger: " $want_exchanger
 echo -e "\t with-hdf5: " $want_hdf5

Modified: mc/3D/CitcomS/trunk/doc/manual/citcoms.lyx
===================================================================
--- mc/3D/CitcomS/trunk/doc/manual/citcoms.lyx	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/doc/manual/citcoms.lyx	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1160,12 +1160,11 @@
 .
  After unpacking the source, you will run a prepackaged shell script to
  configure CitComS for your system.
- Then you will use the 
+ Finally, you will use the 
 \family typewriter
 make
 \family default
- utility to build CitComS from source, and finally install the CitComS programs
- and Python modules.
+ utility to build and install CitComS from source.
  
 \end_layout
 
@@ -1179,8 +1178,10 @@
 \end_inset
 
  section later in this chapter.
- CitComS.py has been tested on Linux, Mac OS X, and several NSF TeraGrid
- platforms.
+\end_layout
+
+\begin_layout Standard
+CitComS.py has been tested on Linux, Mac OS X, and several NSF TeraGrid platforms.
  
 \end_layout
 
@@ -1204,11 +1205,15 @@
 \end_layout
 
 \begin_layout Section
-System Requirements
+Before You Begin
 \end_layout
 
+\begin_layout Subsection
+Tools
+\end_layout
+
 \begin_layout Standard
-CitComS.py requires the following:
+Installation of CitComS.py requires the following system tools:
 \end_layout
 
 \begin_layout Itemize
@@ -1216,35 +1221,34 @@
 \end_layout
 
 \begin_layout Itemize
-An MPI library which implements version 1 of the MPI standard (If you are
- using MPICH, MPICH version 1.2.3 or later is required.)
+A C compiler
 \end_layout
 
-\begin_layout Itemize
-A modern C++ compiler
+\begin_layout Standard
+Users familiar with older versions of CitComS may prefer to install only
+ the legacy CitComS tools, CitcomSFull and CitcomSRegional, and forgo use
+ of the Pyre framework.
+ This process requires only a C compiler.
 \end_layout
 
-\begin_layout Itemize
-A C compiler
+\begin_layout Section
+Dependencies
 \end_layout
 
 \begin_layout Standard
+CitcomS.py requires the following packages:
+\end_layout
 
-\series bold
-Note:
-\series default
- Users familiar with older versions of CitComS may prefer to install only
- the legacy CitComS tools, CitcomSFull and CitcomSRegional, and forgo use
- of the Pyre framework.
- Installing the legacy tools requires simply:
+\begin_layout Itemize
+Pythia 0.8.1.x.
 \end_layout
 
 \begin_layout Itemize
-An MPI library
+(Optional) the Parallel HDF5 library
 \end_layout
 
 \begin_layout Itemize
-A C compiler
+An MPI library
 \end_layout
 
 \begin_layout Standard
@@ -1261,7 +1265,34 @@
 .
 \end_layout
 
+\begin_layout Subsection
+Compilers
+\end_layout
+
 \begin_layout Standard
+On all supported systems, C and C++ compilers are readily available.
+ If you using GCC, you will need version 3 or later.
+\end_layout
+
+\begin_layout Subsection
+MPI
+\end_layout
+
+\begin_layout Standard
+MPICH is a freely available, portable implementation of MPI.
+ For more information, visit the 
+\begin_inset LatexCommand \htmlurl[MPICH home page]{http://www-unix.mcs.anl.gov/mpi/mpich/}
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection
+Python
+\end_layout
+
+\begin_layout Standard
 You can download Python from the 
 \begin_inset LatexCommand \htmlurl[Python website]{http://www.python.org/}
 
@@ -1281,17 +1312,6 @@
 Python 2.3.4
 \end_layout
 
-\begin_layout Standard
-MPICH is a freely available, portable implementation of MPI.
- For more information, visit the 
-\begin_inset LatexCommand \htmlurl[MPICH home page]{http://www-unix.mcs.anl.gov/mpi/mpich/}
-
-\end_inset
-
-.
- 
-\end_layout
-
 \begin_layout Quote
 
 \series bold

Deleted: mc/3D/CitcomS/trunk/etc/CitcomS.pml.in
===================================================================
--- mc/3D/CitcomS/trunk/etc/CitcomS.pml.in	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/CitcomS.pml.in	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<!-- @INPUT@ -->
-<!-- $Id$ -->
-
-<!--
-
-Edit these defaults as appropriate for your system.
-
-You may override these defaults from ~/.pyre/CitcomS/CitcomS.pml,
-./CitcomS.pml, or the command line.
-
--->
-
-<!DOCTYPE inventory>
-
-<inventory>
-
-    <component name="CitcomS">
-        <property name="help">no</property>
-        <property name="help-properties">no</property>
-        <property name="help-components">no</property>
-
-        <!-- launcher configuration; see @LAUNCHERS_PY@ -->
-
-        <property name="launcher">@LAUNCHER@</property>
-
-        <component name="mpich">
-            <property name="command">@MPIRUN@</property>
-        </component>
-
-        <component name="lam-mpi">
-            <property name="command">@MPIRUN@</property>
-        </component>
-
-        <component name="pbs">
-            <property name="command">@MPIRUN@ -np ${nodes} -machinefile $PBS_NODEFILE</property>
-            <property name="batch-command">@QSUB@</property>
-        </component>
-
-        <component name="lsf">
-            <property name="command">mpijob @MPIRUN@</property>
-            <property name="batch-command">@BSUB@</property>
-        </component>
-
-        <component name="globus">
-            <property name="batch-command">@GLOBUSRUN@</property>
-            <!-- passed as "-r <resource>" to globusrun -->
-            <property name="resource">localhost</property>
-        </component>
-    </component>
-
-</inventory>
-
-<!-- End of file -->

Modified: mc/3D/CitcomS/trunk/etc/Makefile.am
===================================================================
--- mc/3D/CitcomS/trunk/etc/Makefile.am	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/Makefile.am	2006-10-12 14:48:43 UTC (rev 4957)
@@ -26,30 +26,11 @@
 dist_pkgsysconf_DATA = \
 	full.odb \
 	full-sphere.odb \
-	globus.odb \
 	incomp-newtonian.odb \
 	incomp-non-newtonian.odb \
-	lam-mpi.odb \
-	lsf.odb \
-	mpich.odb \
-	pbs.odb \
 	regional.odb \
 	regional-sphere.odb \
 	temp.odb \
 	__vault__.odb
 
-nodist_pkgsysconf_DATA = CitcomS.pml
-do_subst = sed \
-	-e 's|[@]BSUB[@]|$(BSUB)|g' \
-	-e 's|[@]GLOBUSRUN[@]|$(GLOBUSRUN)|g' \
-	-e 's|[@]INPUT[@]|$(pkgsysconfdir)/CitcomS.pml: generated from CitcomS.pml.in|g' \
-	-e 's|[@]LAUNCHER[@]|$(LAUNCHER)|g' \
-	-e 's|[@]LAUNCHERS_PY[@]|$(pkgpyexecdir)/Components/Launchers.py|g' \
-	-e 's|[@]MPIRUN[@]|$(MPIRUN)|g' \
-	-e 's|[@]QSUB[@]|$(QSUB)|g'
-CitcomS.pml: $(srcdir)/CitcomS.pml.in
-	$(do_subst) < $(srcdir)/CitcomS.pml.in > $@ || (rm -f $@ && exit 1)
-CLEANFILES = $(nodist_pkgsysconf_DATA)
-EXTRA_DIST = CitcomS.pml.in
-
 ## end of Makefile.am

Deleted: mc/3D/CitcomS/trunk/etc/globus.odb
===================================================================
--- mc/3D/CitcomS/trunk/etc/globus.odb	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/globus.odb	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-def launcher():
-
-    from CitcomS.Components.Launchers import LauncherGlobus
-    return LauncherGlobus()
-
-# version
-__id__ = "$Id$"
-
-# End of file

Deleted: mc/3D/CitcomS/trunk/etc/lam-mpi.odb
===================================================================
--- mc/3D/CitcomS/trunk/etc/lam-mpi.odb	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/lam-mpi.odb	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-def launcher():
-
-    from CitcomS.Components.Launchers import LauncherLAMMPI
-    return LauncherLAMMPI()
-
-# version
-__id__ = "$Id$"
-
-# End of file

Deleted: mc/3D/CitcomS/trunk/etc/lsf.odb
===================================================================
--- mc/3D/CitcomS/trunk/etc/lsf.odb	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/lsf.odb	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-def launcher():
-
-    from CitcomS.Components.Launchers import LauncherLSF
-    return LauncherLSF()
-
-# version
-__id__ = "$Id$"
-
-# End of file

Deleted: mc/3D/CitcomS/trunk/etc/mpich.odb
===================================================================
--- mc/3D/CitcomS/trunk/etc/mpich.odb	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/mpich.odb	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-def launcher():
-
-    from CitcomS.Components.Launchers import LauncherMPICH
-    return LauncherMPICH()
-
-# version
-__id__ = "$Id$"
-
-# End of file

Deleted: mc/3D/CitcomS/trunk/etc/pbs.odb
===================================================================
--- mc/3D/CitcomS/trunk/etc/pbs.odb	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/etc/pbs.odb	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-def launcher():
-
-    from CitcomS.Components.Launchers import LauncherPBS
-    return LauncherPBS()
-
-# version
-__id__ = "$Id$"
-
-# End of file

Modified: mc/3D/CitcomS/trunk/lib/Advection_diffusion.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Advection_diffusion.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Advection_diffusion.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -39,7 +39,7 @@
 
 extern int Emergency_stop;
 
-//struct el { double gpt[9]; };
+/*struct el { double gpt[9]; }; */
 void set_diffusion_timestep(struct All_variables *E);
 
 /* ============================================

Modified: mc/3D/CitcomS/trunk/lib/Citcom_init.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Citcom_init.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Citcom_init.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -46,7 +46,7 @@
   E->parallel.nproc = nproc;
   E->parallel.me = rank;
 
-  //fprintf(stderr,"%d in %d processpors\n", rank, nproc);
+  /*fprintf(stderr,"%d in %d processpors\n", rank, nproc); */
 
   E->monitor.solution_cycles=0;
   E->control.keep_going=1;

Modified: mc/3D/CitcomS/trunk/lib/Drive_solvers.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Drive_solvers.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Drive_solvers.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -35,7 +35,7 @@
 float vnorm_nonnewt();
 
 
-//***********************************************************
+/************************************************************/
 
 void general_stokes_solver_setup(struct All_variables *E)
 {
@@ -133,14 +133,14 @@
 
       count++;
 
-    } //end while
+    } /*end while*/
 
     for (m=1;m<=E->sphere.caps_per_proc;m++)  {
       free((void *) oldU[m]);
       free((void *) delta_U[m]);
     }
 
-  } //end if SDEPV
+  } /*end if SDEPV*/
 
   return;
 }
@@ -226,13 +226,13 @@
 
 			  count++;
 
-		  } //end while
+		  } /*end while */
 		  for (m=1;m<=E->sphere.caps_per_proc;m++)  {
 			  free((void *) oldU[m]);
 			  free((void *) delta_U[m]);
 		  }
 
-	  } //end if SDEPV
+	  } /*end if SDEPV */
 	  E->monitor.topo_loop++;
   }
   get_STD_freesurf(E,E->slice.freesurf);

Modified: mc/3D/CitcomS/trunk/lib/Full_parallel_related.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_parallel_related.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Full_parallel_related.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -215,7 +215,7 @@
 
   processors = (int *)malloc((E->parallel.nprocz+2)*sizeof(int));
 
-  m = E->sphere.capid[1] - 1;  // assume 1 cap per proc.
+  m = E->sphere.capid[1] - 1;  /* assume 1 cap per proc. */
   i = E->parallel.me_loc[1];
   j = E->parallel.me_loc[2];
 

Modified: mc/3D/CitcomS/trunk/lib/Full_version_dependent.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Full_version_dependent.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Full_version_dependent.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -30,8 +30,7 @@
 #include "global_defs.h"
 #include "parallel_related.h"
 
-// Setup global mesh parameters
-//
+/* Setup global mesh parameters */
 void full_global_derived_values(E)
   struct All_variables *E;
 {
@@ -116,9 +115,9 @@
   E->sphere.snel = E->sphere.ely*E->sphere.elx;
   E->sphere.nsf = E->sphere.noy*E->sphere.nox;
 
-  // Myr
+  /* Myr */
   E->data.scalet = (E->data.layer_km*1e3*E->data.layer_km*1e3/E->data.therm_diff)/(1.e6*365.25*24*3600);
-  // cm/yr
+  /* cm/yr */
   E->data.scalev = (E->data.layer_km*1e3/E->data.therm_diff)/(100*365.25*24*3600);
   E->data.timedir = E->control.Atemp / fabs(E->control.Atemp);
 
@@ -296,7 +295,7 @@
       if ( (kk < 1) || (kk >= gnoz) ) continue;
 
       k = kk - E->lmesh.nzs + 1;
-      if ( (k < 1) || (k >= noz) ) continue; // if layer k is not inside this proc.
+      if ( (k < 1) || (k >= noz) ) continue; /* if layer k is not inside this proc. */
       if (E->parallel.me_loc[1] == 0 && E->parallel.me_loc[2] == 0
 	  && E->sphere.capid[1] == 1 )
 	fprintf(stderr,"Initial temperature perturbation:  layer=%d  mag=%g  l=%d  m=%d\n", kk, con, ll, mm);

Modified: mc/3D/CitcomS/trunk/lib/Global_operations.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Global_operations.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Global_operations.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -596,7 +596,7 @@
  temp=0.0;
 for (m=1;m<=E->sphere.caps_per_proc;m++)
   for (e=1;e<=nel;e++)
-    //if (E->mat[m][e]==1)
+   /*if (E->mat[m][e]==1)*/
      for (i=1;i<=dims;i++)
        for (a=1;a<=ends;a++) {
 	 node = E->IEN[lev][m][e].node[a];

Modified: mc/3D/CitcomS/trunk/lib/Instructions.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Instructions.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Instructions.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/errno.h>
+#include <ctype.h>
 #include "element_definitions.h"
 #include "global_defs.h"
 
@@ -441,7 +442,7 @@
   E->slice.vort[j]     = (float *)malloc((nsf+2)*sizeof(float));
   E->slice.shflux[j]    = (float *)malloc((nsf+2)*sizeof(float));
   E->slice.bhflux[j]    = (float *)malloc((nsf+2)*sizeof(float));
-  //  if(E->mesh.topvbc==2 && E->control.pseudo_free_surf)
+  /*  if(E->mesh.topvbc==2 && E->control.pseudo_free_surf) */
   E->slice.freesurf[j]    = (float *)malloc((nsf+2)*sizeof(float));
 
   E->mat[j] = (int *) malloc((nel+2)*sizeof(int));
@@ -875,7 +876,7 @@
 {
     void initial_pressure();
     void initial_velocity();
-    //void read_viscosity_option();
+    /*void read_viscosity_option();*/
     void initial_viscosity();
 
     report(E,"Initialize pressure field");
@@ -883,7 +884,7 @@
     report(E,"Initialize velocity field");
     initial_velocity(E);
     report(E,"Initialize viscosity field");
-    //get_viscosity_option(E);
+    /*get_viscosity_option(E);*/
     initial_viscosity(E);
 
     return;
@@ -1076,9 +1077,9 @@
 
 void output_init(struct  All_variables *E)
 {
-    //DEBUG
+    /*DEBUG
     //strcpy(E->output.format, "hdf5");
-    //fprintf(stderr, "output format is %s\n", E->output.format);
+    //fprintf(stderr, "output format is %s\n", E->output.format);*/
     if (strcmp(E->output.format, "ascii-local") == 0)
         E->problem_output = output;
     else if (strcmp(E->output.format, "ascii") == 0) {
@@ -1089,7 +1090,7 @@
     else if (strcmp(E->output.format, "hdf5") == 0)
         E->problem_output = h5output;
     else {
-        // indicate error here
+        /* indicate error here */
         if (E->parallel.me == 0) {
             fprintf(stderr, "wrong output_format, must be either 'ascii-local', 'ascii' or 'hdf5'\n");
             fprintf(E->fp, "wrong output_format, must be either 'ascii-local', 'ascii' or 'hdf5'\n");
@@ -1120,7 +1121,7 @@
   if (E->fp_out)
     fclose(E->fp_out);
 
-  // close HDF5 output
+  /* close HDF5 output */
   if (strcmp(E->output.format, "hdf5") == 0)
     h5output_close(E);
 
@@ -1140,7 +1141,7 @@
 
     str[++end] = 0;
 
-    // trim leading whitespace
+    /* trim leading whitespace */
     while(isspace(*str))
         str++;
 

Modified: mc/3D/CitcomS/trunk/lib/Lith_age.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Lith_age.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Lith_age.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -30,7 +30,7 @@
 
 #include "global_defs.h"
 
-//#include "age_related.h"
+/*#include "age_related.h"*/
 #include "parallel_related.h"
 #include "parsing.h"
 #include "lith_age.h"

Modified: mc/3D/CitcomS/trunk/lib/Output.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Output.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Output.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -70,7 +70,7 @@
 
   if (cycles == 0) {
     output_coord(E);
-    //output_mat(E);
+    /*output_mat(E);*/
   }
 
   output_velo(E, cycles);
@@ -100,7 +100,7 @@
 {
   FILE *fp1;
 
-  // if filename is empty, output to stderr.
+  /* if filename is empty, output to stderr. */
   if (*filename) {
     fp1 = fopen(filename,"w");
     if (!fp1) {
@@ -272,10 +272,10 @@
   char output_file[255];
   FILE *fp1;
 
-  // compute horizontal average here....
+  /* compute horizontal average here.... */
   compute_horiz_avg(E);
 
-  // only the first nprocz processors need to output
+  /* only the first nprocz processors need to output */
 
   if (E->parallel.me<E->parallel.nprocz)  {
     sprintf(output_file,"%s.average.%d.%d", E->control.data_file,

Modified: mc/3D/CitcomS/trunk/lib/Output_h5.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Output_h5.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Output_h5.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -116,7 +116,7 @@
         h5output_coord(E);
         h5output_surf_botm_coord(E);
         h5output_have_coord(E);
-        //h5output_material(E);
+        /*h5output_material(E);*/
         h5output_connectivity(E);
     }
 
@@ -565,7 +565,7 @@
     dataspace = H5Screate_simple(rank, dims, maxdims);
     if (dataspace < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         return -1;
     }
 
@@ -575,14 +575,14 @@
         /* modify dataset creation properties to enable chunking */
         dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
         status = H5Pset_chunk(dcpl_id, rank, chunkdims);
-        //status = H5Pset_fill_value(dcpl_id, H5T_NATIVE_FLOAT, &fillvalue);
+        /*status = H5Pset_fill_value(dcpl_id, H5T_NATIVE_FLOAT, &fillvalue);*/
     }
 
     /* create the dataset */
     dataset = H5Dcreate(loc_id, name, type_id, dataspace, dcpl_id);
     if (dataset < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         return -1;
     }
 
@@ -735,7 +735,7 @@
             (*field)->chunkdims[t] = 1;
 
             /* hyperslab selection parameters */
-            (*field)->offset[t] = -1;   // increment before using!
+            (*field)->offset[t] = -1;   /* increment before using! */
             (*field)->stride[t] = 1;
             (*field)->count[t]  = 1;
             (*field)->block[t]  = 1;
@@ -823,7 +823,7 @@
                 (*field)->n *= (*field)->block[dim];
 
         /* finally, allocate buffer */
-        //(*field)->data = (float *)malloc((*field)->n * sizeof(float));
+        /*(*field)->data = (float *)malloc((*field)->n * sizeof(float));*/
 
         return 0;
     }
@@ -866,7 +866,7 @@
     memspace = H5Screate_simple(rank, memdims, NULL);
     if (memspace < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         return -1;
     }
 
@@ -874,7 +874,7 @@
     filespace = H5Dget_space(dset_id);
     if (filespace < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         H5Sclose(memspace);
         return -1;
     }
@@ -884,7 +884,7 @@
                                  offset, stride, count, block);
     if (status < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         status = H5Sclose(filespace);
         status = H5Sclose(memspace);
         return -1;
@@ -894,7 +894,7 @@
     dxpl_id = H5Pcreate(H5P_DATASET_XFER);
     if (dxpl_id < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         status = H5Sclose(filespace);
         status = H5Sclose(memspace);
         return -1;
@@ -907,7 +907,7 @@
 
     if (status < 0)
     {
-        //TODO: print error
+        /*TODO: print error*/
         status = H5Pclose(dxpl_id);
         status = H5Sclose(filespace);
         status = H5Sclose(memspace);
@@ -920,7 +920,7 @@
         status = H5Dwrite(dset_id, mem_type_id, memspace, filespace, dxpl_id, data);
         if (status < 0)
         {
-            //TODO: print error
+            /*TODO: print error*/
             H5Pclose(dxpl_id);
             H5Sclose(filespace);
             H5Sclose(memspace);
@@ -961,7 +961,7 @@
             free((*field)->stride);
             free((*field)->count);
             free((*field)->block);
-            //free((*field)->data);
+            /*free((*field)->data);*/
             free(*field);
         }
 }

Modified: mc/3D/CitcomS/trunk/lib/Parsing.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Parsing.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Parsing.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -102,7 +102,7 @@
     /* for now, read one filename from the command line, we'll parse that ! */
 
 
-	// this section moved to main()
+    /* this section moved to main() */
 /*     if (ac < 2)   { */
 /* 	fprintf(stderr,"Usage: citcom PARAMETERFILE\n"); */
 /* 	exit(10); */

Modified: mc/3D/CitcomS/trunk/lib/Process_buoyancy.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Process_buoyancy.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Process_buoyancy.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -165,7 +165,7 @@
     } */
     if (E->parallel.me==E->parallel.nprocz-1) {
       fprintf(stderr,"surface heat flux= %f\n",sum_h[0]);
-      //fprintf(E->fp,"surface heat flux= %f\n",sum_h[0]);
+      /*fprintf(E->fp,"surface heat flux= %f\n",sum_h[0]);*/
     }
   }
 

Modified: mc/3D/CitcomS/trunk/lib/Regional_parallel_related.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_parallel_related.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Regional_parallel_related.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -179,7 +179,7 @@
   if (!processors)
     fprintf(stderr,"no memory!!\n");
 
-  m = E->sphere.capid[1] - 1;  // assume 1 cap per proc.
+  m = E->sphere.capid[1] - 1;  /* assume 1 cap per proc. */
   i = E->parallel.me_loc[1];
   j = E->parallel.me_loc[2];
 
@@ -522,7 +522,7 @@
           kkk ++;
               /* determine the pass ID for ii-th boundary and p-th pass */
 
-          //E->parallel.PROCESSOR[lev][m].pass[kkk]=me-((i==1)?1:-1)*nproczl;
+          /*E->parallel.PROCESSOR[lev][m].pass[kkk]=me-((i==1)?1:-1)*nproczl; */
 	  dir = ( (i==1)? 1 : -1);
           E->parallel.PROCESSOR[lev][m].pass[kkk]=E->parallel.loc2proc_map[cap][lx-dir][ly][lz];
 
@@ -557,7 +557,7 @@
           kkk ++;
               /* determine the pass ID for ii-th boundary and p-th pass */
 
-          //E->parallel.PROCESSOR[lev][m].pass[kkk]=me-((k==1)?1:-1)*nprocxl*nproczl;
+          /*E->parallel.PROCESSOR[lev][m].pass[kkk]=me-((k==1)?1:-1)*nprocxl*nproczl; */
 	  dir = ( (k==1)? 1 : -1);
           E->parallel.PROCESSOR[lev][m].pass[kkk]=E->parallel.loc2proc_map[cap][lx][ly-dir][lz];
 
@@ -592,7 +592,7 @@
           kkk ++;
               /* determine the pass ID for ii-th boundary and p-th pass */
 
-          //E->parallel.PROCESSOR[lev][m].pass[kkk]=me-((j==1)?1:-1);
+          /*E->parallel.PROCESSOR[lev][m].pass[kkk]=me-((j==1)?1:-1);*/
 	  dir = ( (j==1)? 1 : -1);
           E->parallel.PROCESSOR[lev][m].pass[kkk]=E->parallel.loc2proc_map[cap][lx][ly][lz-dir];
 

Modified: mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Regional_version_dependent.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -30,8 +30,7 @@
 #include "global_defs.h"
 #include "parallel_related.h"
 
-// Setup global mesh parameters
-//
+/* Setup global mesh parameters */
 void regional_global_derived_values(E)
      struct All_variables *E;
 
@@ -123,9 +122,9 @@
 /* Scaling from dimensionless units to Millions of years for input velocity
    and time, timdir is the direction of time for advection. CPC 6/25/00 */
 
-    // Myr
+    /* Myr */
     E->data.scalet = (E->data.layer_km*1e3*E->data.layer_km*1e3/E->data.therm_diff)/(1.e6*365.25*24*3600);
-    // cm/yr
+    /* cm/yr */
     E->data.scalev = (E->data.layer_km*1e3/E->data.therm_diff)/(100*365.25*24*3600);
     E->data.timedir = E->control.Atemp / fabs(E->control.Atemp);
 
@@ -371,7 +370,7 @@
       if ( (kk < 1) || (kk >= gnoz) ) continue;
 
       k = kk - E->lmesh.nzs + 1;
-      if ( (k < 1) || (k >= noz) ) continue; // if layer k is not inside this proc.
+      if ( (k < 1) || (k >= noz) ) continue; /* if layer k is not inside this proc. */
       if (E->parallel.me_loc[1] == 0 && E->parallel.me_loc[2] == 0)
 
       for(m=1;m<=E->sphere.caps_per_proc;m++)
@@ -421,7 +420,7 @@
     y_center = r_center * sin(fi_center) * sin(theta_center);
     z_center = r_center * cos(fi_center);
 
-    // compute temperature field according to nodal coordinate
+    /* compute temperature field according to nodal coordinate */
     for(m=1;m<=E->sphere.caps_per_proc;m++)
         for(k=1;k<=E->lmesh.noy;k++)
             for(j=1;j<=E->lmesh.nox;j++)

Modified: mc/3D/CitcomS/trunk/lib/Topo_gravity.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Topo_gravity.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Topo_gravity.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -83,7 +83,7 @@
 		for(m=1;m<=E->sphere.caps_per_proc;m++)
 			for(snode=1;snode<=E->lmesh.nsf;snode++) {
 				node = E->surf_node[m][snode];
-				//freesurf[m][snode] += 0.5*(E->sphere.cap[m].V[3][node]+E->sphere.cap[m].Vprev[3][node])*E->advection.timestep;
+				/*freesurf[m][snode] += 0.5*(E->sphere.cap[m].V[3][node]+E->sphere.cap[m].Vprev[3][node])*E->advection.timestep;*/
 				freesurf[m][snode] += E->sphere.cap[m].V[3][node]*E->advection.timestep;
 			}
 	return;

Modified: mc/3D/CitcomS/trunk/lib/Tracer_advection.c
===================================================================
--- mc/3D/CitcomS/trunk/lib/Tracer_advection.c	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/Tracer_advection.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -249,7 +249,7 @@
       zmin=E->Tracer.z_space[1];
       zmax=E->Tracer.z_space[noz];
       
-      //fprintf(stderr,"%d %d\n", E->parallel.nprocx, E->parallel.loc2proc_map[0][0][1][0]);
+      /*fprintf(stderr,"%d %d\n", E->parallel.nprocx, E->parallel.loc2proc_map[0][0][1][0]);*/
       
       /*** comment by Tan2 1/25/2005
            Copy the velocity array. 
@@ -274,10 +274,11 @@
 	n_y=0;
 	n_z=0;
 
-	//printf("%s %d %s %d %s %f\n","La pasul",E->monitor.solution_cycles, "Procesorul", E->parallel.me, "advecteaza tracerul",E->Tracer.tracer_y[n]);
+	/*printf("%s %d %s %d %s %f\n","La pasul",E->monitor.solution_cycles, "Procesorul", E->parallel.me, "advecteaza tracerul",E->Tracer.tracer_y[n]);
 	
 	//printf("%d %d %d %f %f %f %f\n", E->monitor.solution_cycles, E->parallel.me,E->Tracer.LOCAL_NUM_TRACERS,E->Tracer.itcolor[n],E->Tracer.tracer_x[n],E->Tracer.tracer_y[n],E->Tracer.tracer_z[n]);
 	//printf("%d %d %d %f %f %f %f\n", E->monitor.solution_cycles, E->parallel.me,E->Tracer.LOCAL_NUM_TRACERS,tr_color[n],tr_x[n],tr_y[n],tr_z[n]);
+        */
 
 	/*  mid point method uses 2 iterations */
 	
@@ -362,8 +363,9 @@
 	    node8 = n_z+1 + n_x*noz + n_y*noz*nox;
 
 	    
-	    //	printf("%d %d %d %d %d %d %d %d %d\n",E->parallel.me, node1,node2,node3,node4,node5,node6,node7,node8);
+	    /*	printf("%d %d %d %d %d %d %d %d %d\n",E->parallel.me, node1,node2,node3,node4,node5,node6,node7,node8);
 	    //printf("%d %f %f %f %f %f %f %f %f\n", E->parallel.me, E->GV[1][2][node1], E->GV[1][2][node2], E->GV[1][2][node3], E->GV[1][2][node4], E->GV[1][2][node5], E->GV[1][2][node6], E->GV[1][2][node7], E->GV[1][2][node8]);
+            */
 
 	    /*** comment by Tan2 1/25/2005
 		 Interpolate the velocity on the tracer position

Modified: mc/3D/CitcomS/trunk/lib/global_defs.h
===================================================================
--- mc/3D/CitcomS/trunk/lib/global_defs.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/global_defs.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -827,7 +827,7 @@
 #include "solver.h"
 #include "convection_variables.h"
 #include "viscosity_descriptions.h"
-//#include "temperature_descriptions.h"
+    /*#include "temperature_descriptions.h"*/
 #include "advection.h"
 #include "tracer_defs.h"
 

Modified: mc/3D/CitcomS/trunk/lib/sphere_communication.h
===================================================================
--- mc/3D/CitcomS/trunk/lib/sphere_communication.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/lib/sphere_communication.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -26,7 +26,7 @@
  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  */
 
-// static const int cap_connections11[14][7] =
+/*static const int cap_connections11[14][7] =*/
 static const int cap_connections[14][7] =
     {   {0, 0, 0, 0, 0, 0, 0},
         {0, 4,11,10, 2, 7,12},
@@ -43,7 +43,7 @@
         {0, 2, 9,11, 3, 1, 6},
         {0, 0, 0, 0, 0, 0, 0}   };
 
-// static const int cap_connections22[50][9] =
+/* static const int cap_connections22[50][9] =
 //     {   {0, 0, 0, 0, 0, 0, 0, 0, 0},
 // 	{0,13, 2,37, 3,25, 4,14,39},
 // 	{0, 1,41,39, 4,37,43, 3, 0},
@@ -94,6 +94,7 @@
 // 	{0, 8,48,45,10, 6,12, 0,46},
 // 	{0,47,36,46,12,45,24,10,35},
 // 	{0, 0, 0, 0, 0, 0, 0, 0, 0}   };
+*/
 
       /* give case # (1-6) for given # of caps per proc */ 
 static const int cases[14] = 

Copied: mc/3D/CitcomS/trunk/module/CitcomSmodule.c (from rev 4749, mc/3D/CitcomS/trunk/module/CitcomSmodule.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/CitcomSmodule.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/CitcomSmodule.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,65 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+// 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/ 
+
+#include <portinfo>
+#include <Python.h>
+
+#include "CitcomSmodule.h"
+#include "exceptions.h"
+#include "bindings.h"
+
+
+char pyCitcomS_module__doc__[] = "";
+
+/* Initialization function for the module (*must* be called initCitcomSLib) */
+void
+initCitcomSLib()
+{
+    PyObject *m, *d;
+    /* create the module and add the functions */
+    m = Py_InitModule4(
+        "CitcomSLib", pyCitcom_methods,
+        pyCitcomS_module__doc__, 0, PYTHON_API_VERSION);
+
+    /* get its dictionary */
+    d = PyModule_GetDict(m);
+
+    /* check for errors */
+    if (PyErr_Occurred()) {
+        Py_FatalError("can't initialize module CitcomSLib");
+    }
+
+    /* install the module exceptions */
+    pyCitcom_runtimeError = PyErr_NewException("CitcomSLib.runtime", 0, 0);
+    PyDict_SetItemString(d, "RuntimeException", pyCitcom_runtimeError);
+
+    return;
+}
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/CitcomSmodule.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/CitcomSmodule.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/CitcomSmodule.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,67 +0,0 @@
-// -*- C++ -*-
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-
-#include <portinfo>
-#include <Python.h>
-
-#include "CitcomSmodule.h"
-#include "exceptions.h"
-#include "bindings.h"
-
-
-char pyCitcomS_module__doc__[] = "";
-
-// Initialization function for the module (*must* be called initCitcomSLib)
-extern "C"
-void
-initCitcomSLib()
-{
-    // create the module and add the functions
-    PyObject * m = Py_InitModule4(
-        "CitcomSLib", pyCitcom_methods,
-        pyCitcomS_module__doc__, 0, PYTHON_API_VERSION);
-
-    // get its dictionary
-    PyObject * d = PyModule_GetDict(m);
-
-    // check for errors
-    if (PyErr_Occurred()) {
-        Py_FatalError("can't initialize module CitcomSLib");
-    }
-
-    // install the module exceptions
-    pyCitcom_runtimeError = PyErr_NewException("CitcomSLib.runtime", 0, 0);
-    PyDict_SetItemString(d, "RuntimeException", pyCitcom_runtimeError);
-
-    return;
-}
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/CitcomSmodule.h
===================================================================
--- mc/3D/CitcomS/trunk/module/CitcomSmodule.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/CitcomSmodule.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-// 
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // 
 //<LicenseText>
@@ -24,15 +23,19 @@
 //</LicenseText>
 // 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
+*/ 
 
 #ifndef pyCitcom_CitcomSmodule_h
 #define pyCitcom_CitcomSmodule_h
 
+#ifdef __cplusplus
 extern "C"
+#endif
 void
 initCitcomSLib();
 
-#endif // pyCitcom_CitcomSmodule_h
+/* $Id: advdiffu.h 3983 2006-07-07 22:35:14Z leif $ */
 
-// End of file
+#endif /* pyCitcom_CitcomSmodule_h */
+
+/* End of file */

Modified: mc/3D/CitcomS/trunk/module/Makefile.am
===================================================================
--- mc/3D/CitcomS/trunk/module/Makefile.am	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/Makefile.am	2006-10-12 14:48:43 UTC (rev 4957)
@@ -33,22 +33,19 @@
 
 if COND_EMBEDDING
     # static library
-    noinst_LIBRARIES += libCitcomSLibmodule.a libPyxMPImodule.a
+    noinst_LIBRARIES += libCitcomSLibmodule.a
 else
     # extension module (libtool)
-    pyexec_LTLIBRARIES += CitcomSLibmodule.la PyxMPImodule.la
+    pyexec_LTLIBRARIES += CitcomSLibmodule.la
 endif
 
 # static libraries
 
-libCitcomSLibmodule_a_CXXFLAGS = $(AM_CXXFLAGS) # hack for automake
+libCitcomSLibmodule_a_CFLAGS = $(AM_CFLAGS) # hack for automake
 libCitcomSLibmodule_a_SOURCES = $(sources)
 
-libPyxMPImodule_a_CFLAGS = $(AM_CXXFLAGS) # hack for automake
-libPyxMPImodule_a_SOURCES = PyxMPI/PyxMPI.c
-
 if COND_HDF5
-    libCitcomSLibmodule_a_CXXFLAGS += -DUSE_HDF5
+    libCitcomSLibmodule_a_CFLAGS += -DUSE_HDF5
 endif
 
 # extension modules (libtool)
@@ -60,14 +57,9 @@
 	$(MPILIBS)
 CitcomSLibmodule_la_SOURCES = $(sources)
 
-PyxMPImodule_la_LDFLAGS = -module -release $(VERSION)
-PyxMPImodule_la_LIBADD =
-PyxMPImodule_la_SOURCES = PyxMPI/PyxMPI.c
-
 # compiler settings
 
 CC = $(MPICC)
-CXX = $(MPICXX)
 INCLUDES = \
 	-I$(top_srcdir)/module/Regional \
 	-I$(top_srcdir)/lib \
@@ -78,25 +70,26 @@
 # sources
 
 sources = \
-	CitcomSmodule.cc \
+	CitcomSmodule.c \
 	CitcomSmodule.h \
-	advdiffu.cc \
+	advdiffu.c \
 	advdiffu.h \
-	bindings.cc \
+	bindings.c \
 	bindings.h \
-	exceptions.cc \
+	exceptions.c \
 	exceptions.h \
-	initial_conditions.cc \
+	getProperty.h \
+	initial_conditions.c \
 	initial_conditions.h \
-	mesher.cc \
+	mesher.c \
 	mesher.h \
-	misc.cc \
+	misc.c \
 	misc.h \
-	outputs.cc \
+	outputs.c \
 	outputs.h \
-	setProperties.cc \
+	setProperties.c \
 	setProperties.h \
-	stokes_solver.cc \
+	stokes_solver.c \
 	stokes_solver.h
 
 ## end of Makefile.am

Copied: mc/3D/CitcomS/trunk/module/Regionalmodule.c (from rev 4749, mc/3D/CitcomS/trunk/module/Regionalmodule.cc)

Deleted: mc/3D/CitcomS/trunk/module/Regionalmodule.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/Regionalmodule.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/Regionalmodule.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-
-#include <portinfo>
-#include <Python.h>
-
-#include "exceptions.h"
-#include "bindings.h"
-
-
-char pyRegional_module__doc__[] = "";
-
-// Initialization function for the module (*must* be called initRegional)
-extern "C"
-void
-initRegional()
-{
-    // create the module and add the functions
-    PyObject * m = Py_InitModule4(
-        "Regional", pyCitcom_methods,
-        pyRegional_module__doc__, 0, PYTHON_API_VERSION);
-
-    // get its dictionary
-    PyObject * d = PyModule_GetDict(m);
-
-    // check for errors
-    if (PyErr_Occurred()) {
-        Py_FatalError("can't initialize module Regional");
-    }
-
-    // install the module exceptions
-    pyCitcom_runtimeError = PyErr_NewException("Regional.runtime", 0, 0);
-    PyDict_SetItemString(d, "RuntimeException", pyCitcom_runtimeError);
-
-    return;
-}
-
-// version
-// $Id$
-
-// End of file

Copied: mc/3D/CitcomS/trunk/module/advdiffu.c (from rev 4749, mc/3D/CitcomS/trunk/module/advdiffu.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/advdiffu.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/advdiffu.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,135 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+#include <stdio.h>
+
+#include "advdiffu.h"
+
+#include "global_defs.h"
+#include "advection_diffusion.h"
+
+
+extern void set_convection_defaults(struct All_variables *);
+
+
+char pyCitcom_PG_timestep_init__doc__[] = "";
+char pyCitcom_PG_timestep_init__name__[] = "PG_timestep_init";
+PyObject * pyCitcom_PG_timestep_init(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:PG_timestep_init", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    PG_timestep_init(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_PG_timestep_solve__doc__[] = "";
+char pyCitcom_PG_timestep_solve__name__[] = "PG_timestep_solve";
+PyObject * pyCitcom_PG_timestep_solve(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    double dt;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "Od:PG_timestep_solve", &obj, &dt))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    E->monitor.solution_cycles++;
+    if(E->monitor.solution_cycles>E->control.print_convergence)
+	E->control.print_convergence=1;
+
+    E->advection.timestep = dt;
+    PG_timestep_solve(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_set_convection_defaults__doc__[] = "";
+char pyCitcom_set_convection_defaults__name__[] = "set_convection_defaults";
+PyObject * pyCitcom_set_convection_defaults(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:set_convection_defaults", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    E->control.CONVECTION = 1;
+    set_convection_defaults(E);
+
+    /* copied from advection_diffusion_parameters() */
+    E->advection.total_timesteps = 1;
+    E->advection.sub_iterations = 1;
+    E->advection.last_sub_iterations = 1;
+    E->advection.gamma = 0.5;
+    E->monitor.T_maxvaried = 1.05;
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_stable_timestep__doc__[] = "";
+char pyCitcom_stable_timestep__name__[] = "stable_timestep";
+PyObject * pyCitcom_stable_timestep(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:stable_timestep", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+
+    std_timestep(E);
+
+    return Py_BuildValue("d", E->advection.timestep);
+}
+
+
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/advdiffu.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/advdiffu.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/advdiffu.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,134 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-#include <cstdio>
-
-#include "advdiffu.h"
-
-#include "global_defs.h"
-#include "advection_diffusion.h"
-
-extern "C" {
-    void set_convection_defaults(struct All_variables *);
-}
-
-
-char pyCitcom_PG_timestep_init__doc__[] = "";
-char pyCitcom_PG_timestep_init__name__[] = "PG_timestep_init";
-PyObject * pyCitcom_PG_timestep_init(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:PG_timestep_init", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    PG_timestep_init(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_PG_timestep_solve__doc__[] = "";
-char pyCitcom_PG_timestep_solve__name__[] = "PG_timestep_solve";
-PyObject * pyCitcom_PG_timestep_solve(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-    double dt;
-
-    if (!PyArg_ParseTuple(args, "Od:PG_timestep_solve", &obj, &dt))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    E->monitor.solution_cycles++;
-    if(E->monitor.solution_cycles>E->control.print_convergence)
-	E->control.print_convergence=1;
-
-    E->advection.timestep = dt;
-    PG_timestep_solve(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_set_convection_defaults__doc__[] = "";
-char pyCitcom_set_convection_defaults__name__[] = "set_convection_defaults";
-PyObject * pyCitcom_set_convection_defaults(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:set_convection_defaults", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    E->control.CONVECTION = 1;
-    set_convection_defaults(E);
-
-    // copied from advection_diffusion_parameters()
-    E->advection.total_timesteps = 1;
-    E->advection.sub_iterations = 1;
-    E->advection.last_sub_iterations = 1;
-    E->advection.gamma = 0.5;
-    E->monitor.T_maxvaried = 1.05;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_stable_timestep__doc__[] = "";
-char pyCitcom_stable_timestep__name__[] = "stable_timestep";
-PyObject * pyCitcom_stable_timestep(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:stable_timestep", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-
-    std_timestep(E);
-
-    return Py_BuildValue("d", E->advection.timestep);
-}
-
-
-
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/advdiffu.h
===================================================================
--- mc/3D/CitcomS/trunk/module/advdiffu.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/advdiffu.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,35 +23,30 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 #if !defined(pyCitcom_advection_diffusion_h)
 #define pyCitcom_advection_diffusion_h
 
-// advection_diffustion routines
+/* advection_diffustion routines */
 extern char pyCitcom_PG_timestep_init__doc__[];
 extern char pyCitcom_PG_timestep_init__name__[];
-extern "C"
 PyObject * pyCitcom_PG_timestep_init(PyObject *, PyObject *);
 
 extern char pyCitcom_PG_timestep_solve__doc__[];
 extern char pyCitcom_PG_timestep_solve__name__[];
-extern "C"
 PyObject * pyCitcom_PG_timestep_solve(PyObject *, PyObject *);
 
 extern char pyCitcom_set_convection_defaults__doc__[];
 extern char pyCitcom_set_convection_defaults__name__[];
-extern "C"
 PyObject * pyCitcom_set_convection_defaults(PyObject *, PyObject *);
 
 extern char pyCitcom_stable_timestep__doc__[];
 extern char pyCitcom_stable_timestep__name__[];
-extern "C"
 PyObject * pyCitcom_stable_timestep(PyObject *, PyObject *);
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/bindings.c (from rev 4749, mc/3D/CitcomS/trunk/module/bindings.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/bindings.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/bindings.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,342 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+
+#include "bindings.h"
+
+#include "advdiffu.h"
+#include "initial_conditions.h"
+#include "mesher.h"
+#include "misc.h"
+#include "outputs.h"
+#include "setProperties.h"
+#include "stokes_solver.h"
+
+
+/* the method table */
+
+struct PyMethodDef pyCitcom_methods[] = {
+
+    /* dummy entry for testing */
+    {pyCitcom_copyright__name__,
+     pyCitcom_copyright,
+     METH_VARARGS,
+     pyCitcom_copyright__doc__},
+
+
+    /*////////////////////////////////////////////////////////////////////////
+    // This section is for testing or temporatory implementation
+    ////////////////////////////////////////////////////////////////////////*/
+
+    {pyCitcom_return1_test__name__,
+     pyCitcom_return1_test,
+     METH_VARARGS,
+     pyCitcom_return1_test__doc__},
+
+    {pyCitcom_CPU_time__name__,
+     pyCitcom_CPU_time,
+     METH_VARARGS,
+     pyCitcom_CPU_time__doc__},
+
+    {pyCitcom_read_instructions__name__,
+     pyCitcom_read_instructions,
+     METH_VARARGS,
+     pyCitcom_read_instructions__doc__},
+
+
+    /*////////////////////////////////////////////////////////////////////////
+    // This section is for finished implementation
+    ////////////////////////////////////////////////////////////////////////*/
+
+    /* from misc.h */
+
+    {pyCitcom_citcom_init__name__,
+     pyCitcom_citcom_init,
+     METH_VARARGS,
+     pyCitcom_citcom_init__doc__},
+
+    {pyCitcom_full_solver_init__name__,
+     pyCitcom_full_solver_init,
+     METH_VARARGS,
+     pyCitcom_full_solver_init__doc__},
+
+    {pyCitcom_regional_solver_init__name__,
+     pyCitcom_regional_solver_init,
+     METH_VARARGS,
+     pyCitcom_regional_solver_init__doc__},
+
+    {pyCitcom_global_default_values__name__,
+     pyCitcom_global_default_values,
+     METH_VARARGS,
+     pyCitcom_global_default_values__doc__},
+
+    {pyCitcom_set_signal__name__,
+     pyCitcom_set_signal,
+     METH_VARARGS,
+     pyCitcom_set_signal__doc__},
+
+    {pyCitcom_velocities_conform_bcs__name__,
+     pyCitcom_velocities_conform_bcs,
+     METH_VARARGS,
+     pyCitcom_velocities_conform_bcs__doc__},
+
+    {pyCitcom_BC_update_plate_velocity__name__,
+     pyCitcom_BC_update_plate_velocity,
+     METH_VARARGS,
+     pyCitcom_BC_update_plate_velocity__doc__},
+
+    {pyCitcom_Tracer_tracer_advection__name__,
+     pyCitcom_Tracer_tracer_advection,
+     METH_VARARGS,
+     pyCitcom_Tracer_tracer_advection__doc__},
+
+    {pyCitcom_Visc_update_material__name__,
+     pyCitcom_Visc_update_material,
+     METH_VARARGS,
+     pyCitcom_Visc_update_material__doc__},
+
+    {pyCitcom_return_dt__name__,
+     pyCitcom_return_dt,
+     METH_VARARGS,
+     pyCitcom_return_dt__doc__},
+
+    {pyCitcom_return_step__name__,
+     pyCitcom_return_step,
+     METH_VARARGS,
+     pyCitcom_return_step__doc__},
+
+    {pyCitcom_return_t__name__,
+     pyCitcom_return_t,
+     METH_VARARGS,
+     pyCitcom_return_t__doc__},
+
+    /* from advdiffu.h */
+
+    {pyCitcom_PG_timestep_init__name__,
+     pyCitcom_PG_timestep_init,
+     METH_VARARGS,
+     pyCitcom_PG_timestep_init__doc__},
+
+    {pyCitcom_PG_timestep_solve__name__,
+     pyCitcom_PG_timestep_solve,
+     METH_VARARGS,
+     pyCitcom_PG_timestep_solve__doc__},
+
+    {pyCitcom_set_convection_defaults__name__,
+     pyCitcom_set_convection_defaults,
+     METH_VARARGS,
+     pyCitcom_set_convection_defaults__doc__},
+
+    {pyCitcom_stable_timestep__name__,
+     pyCitcom_stable_timestep,
+     METH_VARARGS,
+     pyCitcom_stable_timestep__doc__},
+
+    /* from initial_conditions.h */
+
+    {pyCitcom_ic_constructTemperature__name__,
+     pyCitcom_ic_constructTemperature,
+     METH_VARARGS,
+     pyCitcom_ic_constructTemperature__doc__},
+
+    {pyCitcom_ic_restartTemperature__name__,
+     pyCitcom_ic_restartTemperature,
+     METH_VARARGS,
+     pyCitcom_ic_restartTemperature__doc__},
+
+    {pyCitcom_ic_initPressure__name__,
+     pyCitcom_ic_initPressure,
+     METH_VARARGS,
+     pyCitcom_ic_initPressure__doc__},
+
+    {pyCitcom_ic_initVelocity__name__,
+     pyCitcom_ic_initVelocity,
+     METH_VARARGS,
+     pyCitcom_ic_initVelocity__doc__},
+
+    {pyCitcom_ic_initViscosity__name__,
+     pyCitcom_ic_initViscosity,
+     METH_VARARGS,
+     pyCitcom_ic_initViscosity__doc__},
+
+    /* from mesher.h */
+
+    {pyCitcom_full_sphere_launch__name__,
+     pyCitcom_full_sphere_launch,
+     METH_VARARGS,
+     pyCitcom_full_sphere_launch__doc__},
+
+    {pyCitcom_regional_sphere_launch__name__,
+     pyCitcom_regional_sphere_launch,
+     METH_VARARGS,
+     pyCitcom_regional_sphere_launch__doc__},
+
+    /* from outputs.h */
+
+    {pyCitcom_output__name__,
+     pyCitcom_output,
+     METH_VARARGS,
+     pyCitcom_output__doc__},
+
+    {pyCitcom_output_finalize__name__,
+     pyCitcom_output_finalize,
+     METH_VARARGS,
+     pyCitcom_output_finalize__doc__},
+
+    {pyCitcom_output_time__name__,
+     pyCitcom_output_time,
+     METH_VARARGS,
+     pyCitcom_output_time__doc__},
+
+    /* from setProperties.h */
+
+    {pyCitcom_Advection_diffusion_set_properties__name__,
+     pyCitcom_Advection_diffusion_set_properties,
+     METH_VARARGS,
+     pyCitcom_Advection_diffusion_set_properties__doc__},
+
+    {pyCitcom_BC_set_properties__name__,
+     pyCitcom_BC_set_properties,
+     METH_VARARGS,
+     pyCitcom_BC_set_properties__doc__},
+
+    {pyCitcom_Const_set_properties__name__,
+     pyCitcom_Const_set_properties,
+     METH_VARARGS,
+     pyCitcom_Const_set_properties__doc__},
+
+    {pyCitcom_IC_set_properties__name__,
+     pyCitcom_IC_set_properties,
+     METH_VARARGS,
+     pyCitcom_IC_set_properties__doc__},
+
+    {pyCitcom_Output_set_properties__name__,
+     pyCitcom_Output_set_properties,
+     METH_VARARGS,
+     pyCitcom_Output_set_properties__doc__},
+
+    {pyCitcom_Param_set_properties__name__,
+     pyCitcom_Param_set_properties,
+     METH_VARARGS,
+     pyCitcom_Param_set_properties__doc__},
+
+    {pyCitcom_Phase_set_properties__name__,
+     pyCitcom_Phase_set_properties,
+     METH_VARARGS,
+     pyCitcom_Phase_set_properties__doc__},
+
+    {pyCitcom_Solver_set_properties__name__,
+     pyCitcom_Solver_set_properties,
+     METH_VARARGS,
+     pyCitcom_Solver_set_properties__doc__},
+
+    {pyCitcom_Sphere_set_properties__name__,
+     pyCitcom_Sphere_set_properties,
+     METH_VARARGS,
+     pyCitcom_Sphere_set_properties__doc__},
+
+    {pyCitcom_Tracer_set_properties__name__,
+     pyCitcom_Tracer_set_properties,
+     METH_VARARGS,
+     pyCitcom_Tracer_set_properties__doc__},
+
+    {pyCitcom_Visc_set_properties__name__,
+     pyCitcom_Visc_set_properties,
+     METH_VARARGS,
+     pyCitcom_Visc_set_properties__doc__},
+
+    {pyCitcom_Incompressible_set_properties__name__,
+     pyCitcom_Incompressible_set_properties,
+     METH_VARARGS,
+     pyCitcom_Incompressible_set_properties__doc__},
+
+    /* from stokes_solver.h */
+
+    {pyCitcom_assemble_forces__name__,
+     pyCitcom_assemble_forces,
+     METH_VARARGS,
+     pyCitcom_assemble_forces__doc__},
+
+    {pyCitcom_assemble_forces_pseudo_surf__name__,
+     pyCitcom_assemble_forces_pseudo_surf,
+     METH_VARARGS,
+     pyCitcom_assemble_forces_pseudo_surf__doc__},
+
+    {pyCitcom_construct_stiffness_B_matrix__name__,
+     pyCitcom_construct_stiffness_B_matrix,
+     METH_VARARGS,
+     pyCitcom_construct_stiffness_B_matrix__doc__},
+
+    {pyCitcom_general_stokes_solver__name__,
+     pyCitcom_general_stokes_solver,
+     METH_VARARGS,
+     pyCitcom_general_stokes_solver__doc__},
+
+    {pyCitcom_general_stokes_solver_setup__name__,
+     pyCitcom_general_stokes_solver_setup,
+     METH_VARARGS,
+     pyCitcom_general_stokes_solver_setup__doc__},
+
+    {pyCitcom_get_system_viscosity__name__,
+     pyCitcom_get_system_viscosity,
+     METH_VARARGS,
+     pyCitcom_get_system_viscosity__doc__},
+
+    {pyCitcom_set_cg_defaults__name__,
+     pyCitcom_set_cg_defaults,
+     METH_VARARGS,
+     pyCitcom_set_cg_defaults__doc__},
+
+    {pyCitcom_set_mg_defaults__name__,
+     pyCitcom_set_mg_defaults,
+     METH_VARARGS,
+     pyCitcom_set_mg_defaults__doc__},
+
+    {pyCitcom_set_mg_el_defaults__name__,
+     pyCitcom_set_mg_el_defaults,
+     METH_VARARGS,
+     pyCitcom_set_mg_el_defaults__doc__},
+
+    {pyCitcom_solve_constrained_flow_iterative__name__,
+     pyCitcom_solve_constrained_flow_iterative,
+     METH_VARARGS,
+     pyCitcom_solve_constrained_flow_iterative__doc__},
+
+    {pyCitcom_solve_constrained_flow_iterative_pseudo_surf__name__,
+     pyCitcom_solve_constrained_flow_iterative_pseudo_surf,
+     METH_VARARGS,
+     pyCitcom_solve_constrained_flow_iterative_pseudo_surf__doc__},
+
+    /* Sentinel */
+    {0, 0, 0, 0}
+};
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/bindings.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/bindings.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/bindings.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,344 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-
-#include "bindings.h"
-
-#include "advdiffu.h"
-#include "initial_conditions.h"
-#include "mesher.h"
-#include "misc.h"          // miscellaneous methods
-#include "outputs.h"
-#include "setProperties.h"
-#include "stokes_solver.h"
-
-
-// the method table
-
-struct PyMethodDef pyCitcom_methods[] = {
-
-    // dummy entry for testing
-    {pyCitcom_copyright__name__,
-     pyCitcom_copyright,
-     METH_VARARGS,
-     pyCitcom_copyright__doc__},
-
-
-    //////////////////////////////////////////////////////////////////////////
-    // This section is for testing or temporatory implementation
-    //////////////////////////////////////////////////////////////////////////
-
-    {pyCitcom_return1_test__name__,
-     pyCitcom_return1_test,
-     METH_VARARGS,
-     pyCitcom_return1_test__doc__},
-
-    {pyCitcom_CPU_time__name__,
-     pyCitcom_CPU_time,
-     METH_VARARGS,
-     pyCitcom_CPU_time__doc__},
-
-    {pyCitcom_read_instructions__name__,
-     pyCitcom_read_instructions,
-     METH_VARARGS,
-     pyCitcom_read_instructions__doc__},
-
-
-    //////////////////////////////////////////////////////////////////////////
-    // This section is for finished implementation
-    //////////////////////////////////////////////////////////////////////////
-
-    // from misc.h
-
-    {pyCitcom_citcom_init__name__,
-     pyCitcom_citcom_init,
-     METH_VARARGS,
-     pyCitcom_citcom_init__doc__},
-
-    {pyCitcom_full_solver_init__name__,
-     pyCitcom_full_solver_init,
-     METH_VARARGS,
-     pyCitcom_full_solver_init__doc__},
-
-    {pyCitcom_regional_solver_init__name__,
-     pyCitcom_regional_solver_init,
-     METH_VARARGS,
-     pyCitcom_regional_solver_init__doc__},
-
-    {pyCitcom_global_default_values__name__,
-     pyCitcom_global_default_values,
-     METH_VARARGS,
-     pyCitcom_global_default_values__doc__},
-
-    {pyCitcom_set_signal__name__,
-     pyCitcom_set_signal,
-     METH_VARARGS,
-     pyCitcom_set_signal__doc__},
-
-    {pyCitcom_velocities_conform_bcs__name__,
-     pyCitcom_velocities_conform_bcs,
-     METH_VARARGS,
-     pyCitcom_velocities_conform_bcs__doc__},
-
-    {pyCitcom_BC_update_plate_velocity__name__,
-     pyCitcom_BC_update_plate_velocity,
-     METH_VARARGS,
-     pyCitcom_BC_update_plate_velocity__doc__},
-
-    {pyCitcom_Tracer_tracer_advection__name__,
-     pyCitcom_Tracer_tracer_advection,
-     METH_VARARGS,
-     pyCitcom_Tracer_tracer_advection__doc__},
-
-    {pyCitcom_Visc_update_material__name__,
-     pyCitcom_Visc_update_material,
-     METH_VARARGS,
-     pyCitcom_Visc_update_material__doc__},
-
-    {pyCitcom_return_dt__name__,
-     pyCitcom_return_dt,
-     METH_VARARGS,
-     pyCitcom_return_dt__doc__},
-
-    {pyCitcom_return_step__name__,
-     pyCitcom_return_step,
-     METH_VARARGS,
-     pyCitcom_return_step__doc__},
-
-    {pyCitcom_return_t__name__,
-     pyCitcom_return_t,
-     METH_VARARGS,
-     pyCitcom_return_t__doc__},
-
-    // from advdiffu.h
-
-    {pyCitcom_PG_timestep_init__name__,
-     pyCitcom_PG_timestep_init,
-     METH_VARARGS,
-     pyCitcom_PG_timestep_init__doc__},
-
-    {pyCitcom_PG_timestep_solve__name__,
-     pyCitcom_PG_timestep_solve,
-     METH_VARARGS,
-     pyCitcom_PG_timestep_solve__doc__},
-
-    {pyCitcom_set_convection_defaults__name__,
-     pyCitcom_set_convection_defaults,
-     METH_VARARGS,
-     pyCitcom_set_convection_defaults__doc__},
-
-    {pyCitcom_stable_timestep__name__,
-     pyCitcom_stable_timestep,
-     METH_VARARGS,
-     pyCitcom_stable_timestep__doc__},
-
-    // from initial_conditions.h
-
-    {pyCitcom_ic_constructTemperature__name__,
-     pyCitcom_ic_constructTemperature,
-     METH_VARARGS,
-     pyCitcom_ic_constructTemperature__doc__},
-
-    {pyCitcom_ic_restartTemperature__name__,
-     pyCitcom_ic_restartTemperature,
-     METH_VARARGS,
-     pyCitcom_ic_restartTemperature__doc__},
-
-    {pyCitcom_ic_initPressure__name__,
-     pyCitcom_ic_initPressure,
-     METH_VARARGS,
-     pyCitcom_ic_initPressure__doc__},
-
-    {pyCitcom_ic_initVelocity__name__,
-     pyCitcom_ic_initVelocity,
-     METH_VARARGS,
-     pyCitcom_ic_initVelocity__doc__},
-
-    {pyCitcom_ic_initViscosity__name__,
-     pyCitcom_ic_initViscosity,
-     METH_VARARGS,
-     pyCitcom_ic_initViscosity__doc__},
-
-    // from mesher.h
-
-    {pyCitcom_full_sphere_launch__name__,
-     pyCitcom_full_sphere_launch,
-     METH_VARARGS,
-     pyCitcom_full_sphere_launch__doc__},
-
-    {pyCitcom_regional_sphere_launch__name__,
-     pyCitcom_regional_sphere_launch,
-     METH_VARARGS,
-     pyCitcom_regional_sphere_launch__doc__},
-
-    // from outputs.h
-
-    {pyCitcom_output__name__,
-     pyCitcom_output,
-     METH_VARARGS,
-     pyCitcom_output__doc__},
-
-    {pyCitcom_output_finalize__name__,
-     pyCitcom_output_finalize,
-     METH_VARARGS,
-     pyCitcom_output_finalize__doc__},
-
-    {pyCitcom_output_time__name__,
-     pyCitcom_output_time,
-     METH_VARARGS,
-     pyCitcom_output_time__doc__},
-
-    // from setProperties.h
-
-    {pyCitcom_Advection_diffusion_set_properties__name__,
-     pyCitcom_Advection_diffusion_set_properties,
-     METH_VARARGS,
-     pyCitcom_Advection_diffusion_set_properties__doc__},
-
-    {pyCitcom_BC_set_properties__name__,
-     pyCitcom_BC_set_properties,
-     METH_VARARGS,
-     pyCitcom_BC_set_properties__doc__},
-
-    {pyCitcom_Const_set_properties__name__,
-     pyCitcom_Const_set_properties,
-     METH_VARARGS,
-     pyCitcom_Const_set_properties__doc__},
-
-    {pyCitcom_IC_set_properties__name__,
-     pyCitcom_IC_set_properties,
-     METH_VARARGS,
-     pyCitcom_IC_set_properties__doc__},
-
-    {pyCitcom_Output_set_properties__name__,
-     pyCitcom_Output_set_properties,
-     METH_VARARGS,
-     pyCitcom_Output_set_properties__doc__},
-
-    {pyCitcom_Param_set_properties__name__,
-     pyCitcom_Param_set_properties,
-     METH_VARARGS,
-     pyCitcom_Param_set_properties__doc__},
-
-    {pyCitcom_Phase_set_properties__name__,
-     pyCitcom_Phase_set_properties,
-     METH_VARARGS,
-     pyCitcom_Phase_set_properties__doc__},
-
-    {pyCitcom_Solver_set_properties__name__,
-     pyCitcom_Solver_set_properties,
-     METH_VARARGS,
-     pyCitcom_Solver_set_properties__doc__},
-
-    {pyCitcom_Sphere_set_properties__name__,
-     pyCitcom_Sphere_set_properties,
-     METH_VARARGS,
-     pyCitcom_Sphere_set_properties__doc__},
-
-    {pyCitcom_Tracer_set_properties__name__,
-     pyCitcom_Tracer_set_properties,
-     METH_VARARGS,
-     pyCitcom_Tracer_set_properties__doc__},
-
-    {pyCitcom_Visc_set_properties__name__,
-     pyCitcom_Visc_set_properties,
-     METH_VARARGS,
-     pyCitcom_Visc_set_properties__doc__},
-
-    {pyCitcom_Incompressible_set_properties__name__,
-     pyCitcom_Incompressible_set_properties,
-     METH_VARARGS,
-     pyCitcom_Incompressible_set_properties__doc__},
-
-    // from stokes_solver.h
-
-    {pyCitcom_assemble_forces__name__,
-     pyCitcom_assemble_forces,
-     METH_VARARGS,
-     pyCitcom_assemble_forces__doc__},
-
-    {pyCitcom_assemble_forces_pseudo_surf__name__,
-     pyCitcom_assemble_forces_pseudo_surf,
-     METH_VARARGS,
-     pyCitcom_assemble_forces_pseudo_surf__doc__},
-
-    {pyCitcom_construct_stiffness_B_matrix__name__,
-     pyCitcom_construct_stiffness_B_matrix,
-     METH_VARARGS,
-     pyCitcom_construct_stiffness_B_matrix__doc__},
-
-    {pyCitcom_general_stokes_solver__name__,
-     pyCitcom_general_stokes_solver,
-     METH_VARARGS,
-     pyCitcom_general_stokes_solver__doc__},
-
-    {pyCitcom_general_stokes_solver_setup__name__,
-     pyCitcom_general_stokes_solver_setup,
-     METH_VARARGS,
-     pyCitcom_general_stokes_solver_setup__doc__},
-
-    {pyCitcom_get_system_viscosity__name__,
-     pyCitcom_get_system_viscosity,
-     METH_VARARGS,
-     pyCitcom_get_system_viscosity__doc__},
-
-    {pyCitcom_set_cg_defaults__name__,
-     pyCitcom_set_cg_defaults,
-     METH_VARARGS,
-     pyCitcom_set_cg_defaults__doc__},
-
-    {pyCitcom_set_mg_defaults__name__,
-     pyCitcom_set_mg_defaults,
-     METH_VARARGS,
-     pyCitcom_set_mg_defaults__doc__},
-
-    {pyCitcom_set_mg_el_defaults__name__,
-     pyCitcom_set_mg_el_defaults,
-     METH_VARARGS,
-     pyCitcom_set_mg_el_defaults__doc__},
-
-    {pyCitcom_solve_constrained_flow_iterative__name__,
-     pyCitcom_solve_constrained_flow_iterative,
-     METH_VARARGS,
-     pyCitcom_solve_constrained_flow_iterative__doc__},
-
-    {pyCitcom_solve_constrained_flow_iterative_pseudo_surf__name__,
-     pyCitcom_solve_constrained_flow_iterative_pseudo_surf,
-     METH_VARARGS,
-     pyCitcom_solve_constrained_flow_iterative_pseudo_surf__doc__},
-
-// Sentinel
-    {0, 0, 0, 0}
-};
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/bindings.h
===================================================================
--- mc/3D/CitcomS/trunk/module/bindings.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/bindings.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-// 
+/* 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // 
 //<LicenseText>
@@ -24,18 +23,17 @@
 //</LicenseText>
 // 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
+*/ 
 
 #if !defined(pyCitcom_bindings_h)
 #define pyCitcom_bindings_h
 
-// the method table
+/* the method table */
 
 extern struct PyMethodDef pyCitcom_methods[];
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/exceptions.c (from rev 4749, mc/3D/CitcomS/trunk/module/exceptions.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/exceptions.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/exceptions.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,35 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// 
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+// 
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/ 
+
+#include <portinfo>
+#include <Python.h>
+
+PyObject *pyCitcom_runtimeError = 0;
+ 
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/exceptions.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/exceptions.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/exceptions.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-// 
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
-
-#include <portinfo>
-#include <Python.h>
-
-PyObject *pyCitcom_runtimeError = 0;
-    
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/exceptions.h
===================================================================
--- mc/3D/CitcomS/trunk/module/exceptions.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/exceptions.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-// 
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // 
 //<LicenseText>
@@ -24,18 +23,17 @@
 //</LicenseText>
 // 
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// 
+*/ 
 
 #if !defined(pyCitcom_exceptions_h)
 #define pyCitcom_exceptions_h
 
-// exceptions
+/* exceptions */
 
 extern PyObject *pyCitcom_runtimeError;
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Added: mc/3D/CitcomS/trunk/module/getProperty.h
===================================================================
--- mc/3D/CitcomS/trunk/module/getProperty.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/getProperty.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,113 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+
+/* template */
+
+
+int getTYPEProperty(PyObject* properties, char* attribute, CTYPE *value, FILE* fp)
+{
+    PyObject *prop;
+
+    if (!(prop = PyObject_GetAttrString(properties, attribute)))
+        return -1;
+
+    if (!(PyTYPE_Check(prop))) {
+        PyErr_Format(PyExc_ValueError, "'%s': " MESSAGE, attribute);
+        return -1;
+    }
+
+    if ((CTYPE)-1 == (*value = PyTYPE_AsCTYPE(prop)) &&
+        PyErr_Occurred()) {
+        return -1;
+    }
+
+    if (fp)
+        fprintf(fp, "%s=" FORMAT "\n", attribute, *value);
+
+    return 0;
+}
+
+
+int getTYPEVectorProperty(PyObject* properties, char* attribute,
+                          CTYPE* vector, int len, FILE* fp)
+{
+    PyObject *prop, *item;
+    Py_ssize_t n;
+    int i;
+    
+    if (!(prop = PyObject_GetAttrString(properties, attribute)))
+        return -1;
+
+    if (-1 == (n = PySequence_Size(prop)))
+        return -1;
+    
+    /* is it of length len? */
+    if (n < (Py_ssize_t)len) {
+        PyErr_Format(PyExc_ValueError,
+                     "'%s': too few elements (expected %d, found %d)",
+                     attribute, len, n);
+	return -1;
+    } else if (n > len) {
+	if (fp)
+            fprintf(fp, "# WARNING: length of '%s' > %d\n", attribute, len);
+    }
+    
+    if (fp)
+        fprintf(fp, "%s=", attribute);
+
+    for (i = 0; i < len; i++) {
+	item = PySequence_GetItem(prop, i);
+	if (!item) {
+            PyErr_Format(PyExc_IndexError, "can't get %s[%d]", attribute, i);
+	    return -1;
+	}
+
+        if (!(PyTYPE_Check(item))) {
+            PyErr_Format(PyExc_ValueError, "'%s': " MESSAGE, attribute);
+            return -1;
+        }
+
+        if ((CTYPE)-1 == (vector[i] = PyTYPE_AsCTYPE(item)) &&
+            PyErr_Occurred()) {
+            return -1;
+        }
+        
+	if (fp)
+            fprintf(fp, FORMAT "%s", vector[i], (i == len ? "" : ","));
+    }
+
+    if (fp)
+        fprintf(fp, "\n");
+
+    return 0;
+}
+
+
+/* $Id: setProperties.cc 4642 2006-09-28 14:30:32Z luis $ */
+
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/initial_conditions.c (from rev 4749, mc/3D/CitcomS/trunk/module/initial_conditions.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/initial_conditions.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/initial_conditions.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,156 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+#include "exceptions.h"
+#include "initial_conditions.h"
+
+#include "global_defs.h"
+
+
+void construct_tic(struct All_variables*);
+void initial_pressure(struct All_variables*);
+void initial_velocity(struct All_variables*);
+void initial_viscosity(struct All_variables*);
+void report(struct All_variables*, char* str);
+void restart_tic(struct All_variables*);
+
+
+char pyCitcom_ic_constructTemperature__doc__[] = "";
+char pyCitcom_ic_constructTemperature__name__[] = "constructTemperature";
+
+PyObject * pyCitcom_ic_constructTemperature(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:constructTemperature", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    report(E,"Initialize temperature field");
+    construct_tic(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_ic_restartTemperature__doc__[] = "";
+char pyCitcom_ic_restartTemperature__name__[] = "restartTemperature";
+
+PyObject * pyCitcom_ic_restartTemperature(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:restartTemperature", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    report(E,"Initialize temperature field");
+    restart_tic(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_ic_initPressure__doc__[] = "";
+char pyCitcom_ic_initPressure__name__[] = "initPressure";
+
+PyObject * pyCitcom_ic_initPressure(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:initPressure", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    report(E,"Initialize pressure field");
+    initial_pressure(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_ic_initVelocity__doc__[] = "";
+char pyCitcom_ic_initVelocity__name__[] = "initVelocity";
+
+PyObject * pyCitcom_ic_initVelocity(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:initVelocity", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    report(E,"Initialize velocity field");
+    initial_velocity(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_ic_initViscosity__doc__[] = "";
+char pyCitcom_ic_initViscosity__name__[] = "initViscosity";
+
+PyObject * pyCitcom_ic_initViscosity(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:initViscosity", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    report(E,"Initialize viscosity field");
+    initial_viscosity(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/initial_conditions.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/initial_conditions.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/initial_conditions.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,156 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-#include "exceptions.h"
-#include "initial_conditions.h"
-
-#include "global_defs.h"
-
-extern "C" {
-
-    void construct_tic(struct All_variables*);
-    void initial_pressure(struct All_variables*);
-    void initial_velocity(struct All_variables*);
-    void initial_viscosity(struct All_variables*);
-    void report(struct All_variables*, char* str);
-    void restart_tic(struct All_variables*);
-
-}
-
-
-char pyCitcom_ic_constructTemperature__doc__[] = "";
-char pyCitcom_ic_constructTemperature__name__[] = "constructTemperature";
-
-PyObject * pyCitcom_ic_constructTemperature(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:constructTemperature", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    report(E,"Initialize temperature field");
-    construct_tic(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_ic_restartTemperature__doc__[] = "";
-char pyCitcom_ic_restartTemperature__name__[] = "restartTemperature";
-
-PyObject * pyCitcom_ic_restartTemperature(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:restartTemperature", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    report(E,"Initialize temperature field");
-    restart_tic(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_ic_initPressure__doc__[] = "";
-char pyCitcom_ic_initPressure__name__[] = "initPressure";
-
-PyObject * pyCitcom_ic_initPressure(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:initPressure", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    report(E,"Initialize pressure field");
-    initial_pressure(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_ic_initVelocity__doc__[] = "";
-char pyCitcom_ic_initVelocity__name__[] = "initVelocity";
-
-PyObject * pyCitcom_ic_initVelocity(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:initVelocity", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    report(E,"Initialize velocity field");
-    initial_velocity(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_ic_initViscosity__doc__[] = "";
-char pyCitcom_ic_initViscosity__name__[] = "initViscosity";
-
-PyObject * pyCitcom_ic_initViscosity(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:initViscosity", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    report(E,"Initialize viscosity field");
-    initial_viscosity(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/initial_conditions.h
===================================================================
--- mc/3D/CitcomS/trunk/module/initial_conditions.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/initial_conditions.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,7 +23,7 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 #if !defined(pyCitcom_initial_conditions_h)
 #define pyCitcom_initial_conditions_h
@@ -32,36 +31,30 @@
 
 extern char pyCitcom_ic_constructTemperature__name__[];
 extern char pyCitcom_ic_constructTemperature__doc__[];
-extern "C"
 PyObject * pyCitcom_ic_constructTemperature(PyObject *, PyObject *);
 
 
 extern char pyCitcom_ic_restartTemperature__name__[];
 extern char pyCitcom_ic_restartTemperature__doc__[];
-extern "C"
 PyObject * pyCitcom_ic_restartTemperature(PyObject *, PyObject *);
 
 
 extern char pyCitcom_ic_initPressure__name__[];
 extern char pyCitcom_ic_initPressure__doc__[];
-extern "C"
 PyObject * pyCitcom_ic_initPressure(PyObject *, PyObject *);
 
 
 extern char pyCitcom_ic_initVelocity__name__[];
 extern char pyCitcom_ic_initVelocity__doc__[];
-extern "C"
 PyObject * pyCitcom_ic_initVelocity(PyObject *, PyObject *);
 
 
 extern char pyCitcom_ic_initViscosity__name__[];
 extern char pyCitcom_ic_initViscosity__doc__[];
-extern "C"
 PyObject * pyCitcom_ic_initViscosity(PyObject *, PyObject *);
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/mesher.c (from rev 4749, mc/3D/CitcomS/trunk/module/mesher.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/mesher.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/mesher.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,181 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+
+#include "exceptions.h"
+#include "mesher.h"
+
+#include "global_defs.h"
+#include "parallel_related.h"
+
+
+void allocate_common_vars(struct All_variables*);
+void allocate_velocity_vars(struct All_variables*);
+void check_bc_consistency(struct All_variables*);
+void construct_id(struct All_variables*);
+void construct_ien(struct All_variables*);
+void construct_lm(struct All_variables*);
+void construct_masks(struct All_variables*);
+void construct_mat_group(struct All_variables*);
+void construct_shape_functions(struct All_variables*);
+void construct_sub_element(struct All_variables*);
+void construct_surf_det (struct All_variables*);
+void construct_bdry_det (struct All_variables*);
+void construct_surface (struct All_variables*);
+void get_initial_elapsed_time(struct All_variables*);
+void lith_age_init(struct All_variables *E);
+void mass_matrix(struct All_variables*);
+void output_init(struct All_variables*);
+void read_mat_from_file(struct All_variables*);
+void set_elapsed_time(struct All_variables*);
+void set_sphere_harmonics (struct All_variables*);
+void set_starting_age(struct All_variables*);
+void tracer_initial_settings(struct All_variables*);
+double CPU_time0();
+
+
+
+
+void sphere_launch(struct All_variables *E)
+    /* copied from read_instructions() */
+{
+
+    E->monitor.cpu_time_at_last_cycle =
+        E->monitor.cpu_time_at_start = CPU_time0();
+
+    output_init(E);
+    (E->problem_derived_values)(E);   /* call this before global_derived_  */
+    (E->solver.global_derived_values)(E);
+
+    (E->solver.parallel_processor_setup)(E);   /* get # of proc in x,y,z */
+    (E->solver.parallel_domain_decomp0)(E);  /* get local nel, nno, elx, nox et al */
+
+    allocate_common_vars(E);
+    (E->problem_allocate_vars)(E);
+    (E->solver_allocate_vars)(E);
+
+           /* logical domain */
+    construct_ien(E);
+    construct_surface(E);
+    (E->solver.construct_boundary)(E);
+    (E->solver.parallel_domain_boundary_nodes)(E);
+
+           /* physical domain */
+    (E->solver.node_locations)(E);
+
+    if(E->control.tracer==1) {
+	tracer_initial_settings(E);
+	(E->problem_tracer_setup)(E);
+    }
+
+    allocate_velocity_vars(E);
+
+    get_initial_elapsed_time(E);  /* Get elapsed time from restart run*/
+    set_starting_age(E);  /* set the starting age to elapsed time, if desired */
+    set_elapsed_time(E);         /* reset to elapsed time to zero, if desired */
+
+    if(E->control.lith_age)
+        lith_age_init(E);
+
+    (E->problem_boundary_conds)(E);
+
+    check_bc_consistency(E);
+
+    construct_masks(E);		/* order is important here */
+    construct_id(E);
+    construct_lm(E);
+
+    (E->solver.parallel_communication_routs_v)(E);
+    (E->solver.parallel_communication_routs_s)(E);
+
+    construct_sub_element(E);
+    construct_shape_functions(E);
+
+    mass_matrix(E);
+
+    construct_surf_det (E);
+    construct_bdry_det (E);
+
+    set_sphere_harmonics (E);
+
+    if(E->control.mat_control)
+      read_mat_from_file(E);
+    else
+      construct_mat_group(E);
+
+    return;
+}
+
+
+
+char pyCitcom_full_sphere_launch__doc__[] = "";
+char pyCitcom_full_sphere_launch__name__[] = "full_sphere_launch";
+
+PyObject * pyCitcom_full_sphere_launch(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:full_sphere_launch", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    sphere_launch(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_regional_sphere_launch__doc__[] = "";
+char pyCitcom_regional_sphere_launch__name__[] = "regional_sphere_launch";
+
+PyObject * pyCitcom_regional_sphere_launch(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:regional_sphere_launch", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    sphere_launch(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/mesher.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/mesher.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/mesher.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,184 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-
-#include "exceptions.h"
-#include "mesher.h"
-
-#include "global_defs.h"
-#include "parallel_related.h"
-
-extern "C" {
-
-    void allocate_common_vars(struct All_variables*);
-    void allocate_velocity_vars(struct All_variables*);
-    void check_bc_consistency(struct All_variables*);
-    void construct_id(struct All_variables*);
-    void construct_ien(struct All_variables*);
-    void construct_lm(struct All_variables*);
-    void construct_masks(struct All_variables*);
-    void construct_mat_group(struct All_variables*);
-    void construct_shape_functions(struct All_variables*);
-    void construct_sub_element(struct All_variables*);
-    void construct_surf_det (struct All_variables*);
-    void construct_bdry_det (struct All_variables*);
-    void construct_surface (struct All_variables*);
-    void get_initial_elapsed_time(struct All_variables*);
-    void lith_age_init(struct All_variables *E);
-    void mass_matrix(struct All_variables*);
-    void output_init(struct All_variables*);
-    void read_mat_from_file(struct All_variables*);
-    void set_elapsed_time(struct All_variables*);
-    void set_sphere_harmonics (struct All_variables*);
-    void set_starting_age(struct All_variables*);
-    void tracer_initial_settings(struct All_variables*);
-    double CPU_time0();
-
-}
-
-
-
-
-void sphere_launch(struct All_variables *E)
-    // copied from read_instructions()
-{
-
-    E->monitor.cpu_time_at_last_cycle =
-        E->monitor.cpu_time_at_start = CPU_time0();
-
-    output_init(E);
-    (E->problem_derived_values)(E);   /* call this before global_derived_  */
-    (E->solver.global_derived_values)(E);
-
-    (E->solver.parallel_processor_setup)(E);   /* get # of proc in x,y,z */
-    (E->solver.parallel_domain_decomp0)(E);  /* get local nel, nno, elx, nox et al */
-
-    allocate_common_vars(E);
-    (E->problem_allocate_vars)(E);
-    (E->solver_allocate_vars)(E);
-
-           /* logical domain */
-    construct_ien(E);
-    construct_surface(E);
-    (E->solver.construct_boundary)(E);
-    (E->solver.parallel_domain_boundary_nodes)(E);
-
-           /* physical domain */
-    (E->solver.node_locations)(E);
-
-    if(E->control.tracer==1) {
-	tracer_initial_settings(E);
-	(E->problem_tracer_setup)(E);
-    }
-
-    allocate_velocity_vars(E);
-
-    get_initial_elapsed_time(E);  /* Get elapsed time from restart run*/
-    set_starting_age(E);  /* set the starting age to elapsed time, if desired */
-    set_elapsed_time(E);         /* reset to elapsed time to zero, if desired */
-
-    if(E->control.lith_age)
-        lith_age_init(E);
-
-    (E->problem_boundary_conds)(E);
-
-    check_bc_consistency(E);
-
-    construct_masks(E);		/* order is important here */
-    construct_id(E);
-    construct_lm(E);
-
-    (E->solver.parallel_communication_routs_v)(E);
-    (E->solver.parallel_communication_routs_s)(E);
-
-    construct_sub_element(E);
-    construct_shape_functions(E);
-
-    mass_matrix(E);
-
-    construct_surf_det (E);
-    construct_bdry_det (E);
-
-    set_sphere_harmonics (E);
-
-    if(E->control.mat_control)
-      read_mat_from_file(E);
-    else
-      construct_mat_group(E);
-
-    return;
-}
-
-
-
-char pyCitcom_full_sphere_launch__doc__[] = "";
-char pyCitcom_full_sphere_launch__name__[] = "full_sphere_launch";
-
-PyObject * pyCitcom_full_sphere_launch(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:full_sphere_launch", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    sphere_launch(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_regional_sphere_launch__doc__[] = "";
-char pyCitcom_regional_sphere_launch__name__[] = "regional_sphere_launch";
-
-PyObject * pyCitcom_regional_sphere_launch(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:regional_sphere_launch", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    sphere_launch(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/mesher.h
===================================================================
--- mc/3D/CitcomS/trunk/module/mesher.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/mesher.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,7 +23,7 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 #if !defined(pyCitcom_mesher_h)
 #define pyCitcom_mesher_h
@@ -32,19 +31,16 @@
 
 extern char pyCitcom_full_sphere_launch__name__[];
 extern char pyCitcom_full_sphere_launch__doc__[];
-extern "C"
 PyObject * pyCitcom_full_sphere_launch(PyObject *, PyObject *);
 
 
 extern char pyCitcom_regional_sphere_launch__name__[];
 extern char pyCitcom_regional_sphere_launch__doc__[];
-extern "C"
 PyObject * pyCitcom_regional_sphere_launch(PyObject *, PyObject *);
 
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/misc.c (from rev 4749, mc/3D/CitcomS/trunk/module/misc.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/misc.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/misc.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,371 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+
+
+#include "exceptions.h"
+#include "misc.h"
+
+#include "mpi.h"
+#include "global_defs.h"
+#include "citcom_init.h"
+#include "advection_diffusion.h"
+
+
+void full_solver_init(struct All_variables*);
+void regional_solver_init(struct All_variables*);
+
+double return1_test();
+void read_instructions(struct All_variables*, char*);
+double CPU_time0();
+
+void global_default_values(struct All_variables*);
+void parallel_process_termination();
+void read_mat_from_file(struct All_variables*);
+void read_velocity_boundary_from_file(struct All_variables*);
+void set_signal();
+void tracer_advection(struct All_variables*);
+void velocities_conform_bcs(struct All_variables*, double **);
+
+
+#include "mpi/pympi.h"
+
+/* copyright */
+
+char pyCitcom_copyright__doc__[] = "";
+char pyCitcom_copyright__name__[] = "copyright";
+
+static char pyCitcom_copyright_note[] =
+"CitcomS python module: Copyright (c) 1998-2003 California Institute of Technology";
+
+
+PyObject * pyCitcom_copyright(PyObject *self, PyObject *args)
+{
+  return Py_BuildValue("s", pyCitcom_copyright_note);
+}
+
+/*////////////////////////////////////////////////////////////////////////
+// This section is for testing or temporatory implementation
+////////////////////////////////////////////////////////////////////////*/
+
+
+
+char pyCitcom_return1_test__doc__[] = "";
+char pyCitcom_return1_test__name__[] = "return1_test";
+
+PyObject * pyCitcom_return1_test(PyObject *self, PyObject *args)
+{
+    double a;
+    a = return1_test();
+    return Py_BuildValue("d", a);
+}
+
+
+char pyCitcom_read_instructions__doc__[] = "";
+char pyCitcom_read_instructions__name__[] = "read_instructions";
+
+PyObject * pyCitcom_read_instructions(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+    char *filename;
+
+    if (!PyArg_ParseTuple(args, "Os:read_instructions", &obj, &filename))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    read_instructions(E, filename);
+
+    /* test */
+    fprintf(stderr,"output file prefix: %s\n", E->control.data_file);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_CPU_time__doc__[] = "";
+char pyCitcom_CPU_time__name__[] = "CPU_time";
+
+PyObject * pyCitcom_CPU_time(PyObject *self, PyObject *args)
+{
+    return Py_BuildValue("d", CPU_time0());
+}
+
+
+/*////////////////////////////////////////////////////////////////////////
+// This section is for finished implementation
+////////////////////////////////////////////////////////////////////////*/
+
+char pyCitcom_citcom_init__doc__[] = "";
+char pyCitcom_citcom_init__name__[] = "citcom_init";
+
+PyObject * pyCitcom_citcom_init(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *cobj;
+    struct All_variables* E;
+    PyMPICommObject *pycomm;
+    MPI_Comm world;
+
+    if (!PyArg_ParseTuple(args, "O:citcom_init", &obj))
+        return NULL;
+
+    pycomm = (PyMPICommObject *)obj;
+    world = pycomm->comm;
+
+    /* Allocate global pointer E */
+    E = citcom_init(&world);
+
+    /* if E is NULL, raise an exception here. */
+    if (E == NULL)
+        return PyErr_Format(pyCitcom_runtimeError,
+                            "%s: 'libCitcomSCommon.citcom_init' failed",
+                            pyCitcom_citcom_init__name__);
+
+    cobj = PyCObject_FromVoidPtr(E, NULL);
+
+    return Py_BuildValue("O", cobj);
+}
+
+
+char pyCitcom_full_solver_init__doc__[] = "";
+char pyCitcom_full_solver_init__name__[] = "full_solver_init";
+
+PyObject * pyCitcom_full_solver_init(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:full_solver_init", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    full_solver_init(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_regional_solver_init__doc__[] = "";
+char pyCitcom_regional_solver_init__name__[] = "regional_solver_init";
+
+PyObject * pyCitcom_regional_solver_init(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:regional_solver_init", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    regional_solver_init(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_global_default_values__doc__[] = "";
+char pyCitcom_global_default_values__name__[] = "global_default_values";
+
+PyObject * pyCitcom_global_default_values(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:global_default_values", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    global_default_values(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_set_signal__doc__[] = "";
+char pyCitcom_set_signal__name__[] = "set_signal";
+
+PyObject * pyCitcom_set_signal(PyObject *self, PyObject *args)
+{
+    set_signal();
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_velocities_conform_bcs__doc__[] = "";
+char pyCitcom_velocities_conform_bcs__name__[] = "velocities_conform_bcs";
+
+PyObject * pyCitcom_velocities_conform_bcs(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:velocities_conform_bcs", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    velocities_conform_bcs(E, E->U);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_BC_update_plate_velocity__doc__[] = "";
+char pyCitcom_BC_update_plate_velocity__name__[] = "BC_update_plate_velocity";
+
+PyObject * pyCitcom_BC_update_plate_velocity(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:BC_update_plate_velocity", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    if(E->control.vbcs_file==1)
+      read_velocity_boundary_from_file(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_Tracer_tracer_advection__doc__[] = "";
+char pyCitcom_Tracer_tracer_advection__name__[] = "Tracer_tracer_advection";
+
+PyObject * pyCitcom_Tracer_tracer_advection(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:Tracer_tracer_advection", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    if(E->control.tracer==1)
+      tracer_advection(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_Visc_update_material__doc__[] = "";
+char pyCitcom_Visc_update_material__name__[] = "Visc_update_material";
+
+PyObject * pyCitcom_Visc_update_material(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:Visc_update_material", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    if(E->control.mat_control==1)
+      read_mat_from_file(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_return_dt__doc__[] = "";
+char pyCitcom_return_dt__name__[] = "return_dt";
+
+PyObject * pyCitcom_return_dt(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:return_dt", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    return Py_BuildValue("f", E->advection.timestep);
+}
+
+
+char pyCitcom_return_step__doc__[] = "";
+char pyCitcom_return_step__name__[] = "return_step";
+
+PyObject * pyCitcom_return_step(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:return_step", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    return Py_BuildValue("i", E->advection.timesteps);
+}
+
+
+char pyCitcom_return_t__doc__[] = "";
+char pyCitcom_return_t__name__[] = "return_t";
+
+PyObject * pyCitcom_return_t(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:return_t", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    return Py_BuildValue("f", E->monitor.elapsed_time);
+}
+
+
+/*////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////*/
+
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/misc.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/misc.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/misc.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,367 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-
-
-#include "exceptions.h"
-#include "misc.h"
-
-#include "mpi.h"
-#include "global_defs.h"
-#include "citcom_init.h"
-#include "advection_diffusion.h"
-
-extern "C" {
-
-    void full_solver_init(struct All_variables*);
-    void regional_solver_init(struct All_variables*);
-
-    double return1_test();
-    void read_instructions(struct All_variables*, char*);
-    double CPU_time0();
-
-    void global_default_values(struct All_variables*);
-    void parallel_process_termination();
-    void read_mat_from_file(struct All_variables*);
-    void read_velocity_boundary_from_file(struct All_variables*);
-    void set_signal();
-    void tracer_advection(struct All_variables*);
-    void velocities_conform_bcs(struct All_variables*, double **);
-
-}
-
-#include "mpi/Communicator.h"
-#include "mpi/Group.h"
-
-// copyright
-
-char pyCitcom_copyright__doc__[] = "";
-char pyCitcom_copyright__name__[] = "copyright";
-
-static char pyCitcom_copyright_note[] =
-"CitcomS python module: Copyright (c) 1998-2003 California Institute of Technology";
-
-
-PyObject * pyCitcom_copyright(PyObject *, PyObject *)
-{
-  return Py_BuildValue("s", pyCitcom_copyright_note);
-}
-
-//////////////////////////////////////////////////////////////////////////
-// This section is for testing or temporatory implementation
-//////////////////////////////////////////////////////////////////////////
-
-
-
-char pyCitcom_return1_test__doc__[] = "";
-char pyCitcom_return1_test__name__[] = "return1_test";
-
-PyObject * pyCitcom_return1_test(PyObject *, PyObject *)
-{
-    double a;
-    a = return1_test();
-    return Py_BuildValue("d", a);
-}
-
-
-char pyCitcom_read_instructions__doc__[] = "";
-char pyCitcom_read_instructions__name__[] = "read_instructions";
-
-PyObject * pyCitcom_read_instructions(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-    char *filename;
-
-    if (!PyArg_ParseTuple(args, "Os:read_instructions", &obj, &filename))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    read_instructions(E, filename);
-
-    // test
-    fprintf(stderr,"output file prefix: %s\n", E->control.data_file);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_CPU_time__doc__[] = "";
-char pyCitcom_CPU_time__name__[] = "CPU_time";
-
-PyObject * pyCitcom_CPU_time(PyObject *, PyObject *)
-{
-    return Py_BuildValue("d", CPU_time0());
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-// This section is for finished implementation
-//////////////////////////////////////////////////////////////////////////
-
-char pyCitcom_citcom_init__doc__[] = "";
-char pyCitcom_citcom_init__name__[] = "citcom_init";
-
-PyObject * pyCitcom_citcom_init(PyObject *self, PyObject *args)
-{
-    PyObject *Obj;
-
-    if (!PyArg_ParseTuple(args, "O:citcom_init", &Obj))
-        return NULL;
-
-    mpi::Communicator * comm = (mpi::Communicator *) PyCObject_AsVoidPtr(Obj);
-    if (comm == NULL)
-        return PyErr_Format(pyCitcom_runtimeError,
-                            "%s: 'mpi::Communicator *' argument is null",
-                            pyCitcom_citcom_init__name__);
-
-    MPI_Comm world = comm->handle();
-
-    // Allocate global pointer E
-    struct All_variables* E = citcom_init(&world);
-
-    // if E is NULL, raise an exception here.
-    if (E == NULL)
-        return PyErr_Format(pyCitcom_runtimeError,
-                            "%s: 'libCitcomSCommon.citcom_init' failed",
-                            pyCitcom_citcom_init__name__);
-
-    PyObject *cobj = PyCObject_FromVoidPtr(E, NULL);
-
-    return Py_BuildValue("O", cobj);
-}
-
-
-char pyCitcom_full_solver_init__doc__[] = "";
-char pyCitcom_full_solver_init__name__[] = "full_solver_init";
-
-PyObject * pyCitcom_full_solver_init(PyObject *, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:full_solver_init", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    full_solver_init(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_regional_solver_init__doc__[] = "";
-char pyCitcom_regional_solver_init__name__[] = "regional_solver_init";
-
-PyObject * pyCitcom_regional_solver_init(PyObject *, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:regional_solver_init", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    regional_solver_init(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_global_default_values__doc__[] = "";
-char pyCitcom_global_default_values__name__[] = "global_default_values";
-
-PyObject * pyCitcom_global_default_values(PyObject *, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:global_default_values", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    global_default_values(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_set_signal__doc__[] = "";
-char pyCitcom_set_signal__name__[] = "set_signal";
-
-PyObject * pyCitcom_set_signal(PyObject *, PyObject *)
-{
-    set_signal();
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_velocities_conform_bcs__doc__[] = "";
-char pyCitcom_velocities_conform_bcs__name__[] = "velocities_conform_bcs";
-
-PyObject * pyCitcom_velocities_conform_bcs(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:velocities_conform_bcs", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    velocities_conform_bcs(E, E->U);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_BC_update_plate_velocity__doc__[] = "";
-char pyCitcom_BC_update_plate_velocity__name__[] = "BC_update_plate_velocity";
-
-PyObject * pyCitcom_BC_update_plate_velocity(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:BC_update_plate_velocity", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    if(E->control.vbcs_file==1)
-      read_velocity_boundary_from_file(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_Tracer_tracer_advection__doc__[] = "";
-char pyCitcom_Tracer_tracer_advection__name__[] = "Tracer_tracer_advection";
-
-PyObject * pyCitcom_Tracer_tracer_advection(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:Tracer_tracer_advection", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    if(E->control.tracer==1)
-      tracer_advection(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_Visc_update_material__doc__[] = "";
-char pyCitcom_Visc_update_material__name__[] = "Visc_update_material";
-
-PyObject * pyCitcom_Visc_update_material(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:Visc_update_material", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    if(E->control.mat_control==1)
-      read_mat_from_file(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_return_dt__doc__[] = "";
-char pyCitcom_return_dt__name__[] = "return_dt";
-
-PyObject * pyCitcom_return_dt(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:return_dt", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    return Py_BuildValue("f", E->advection.timestep);
-}
-
-
-char pyCitcom_return_step__doc__[] = "";
-char pyCitcom_return_step__name__[] = "return_step";
-
-PyObject * pyCitcom_return_step(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:return_step", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    return Py_BuildValue("i", E->advection.timesteps);
-}
-
-
-char pyCitcom_return_t__doc__[] = "";
-char pyCitcom_return_t__name__[] = "return_t";
-
-PyObject * pyCitcom_return_t(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:return_t", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    return Py_BuildValue("f", E->monitor.elapsed_time);
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-
-
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/misc.h
===================================================================
--- mc/3D/CitcomS/trunk/module/misc.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/misc.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,114 +23,93 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 #if !defined(pyCitcom_misc_h)
 #define pyCitcom_misc_h
 
-// copyright
 extern char pyCitcom_copyright__name__[];
 extern char pyCitcom_copyright__doc__[];
-extern "C"
 PyObject * pyCitcom_copyright(PyObject *, PyObject *);
 
 
 extern char pyCitcom_return1_test__name__[];
 extern char pyCitcom_return1_test__doc__[];
-extern "C"
 PyObject * pyCitcom_return1_test(PyObject *, PyObject *);
 
 
 extern char pyCitcom_read_instructions__name__[];
 extern char pyCitcom_read_instructions__doc__[];
-extern "C"
 PyObject * pyCitcom_read_instructions(PyObject *, PyObject *);
 
 
 extern char pyCitcom_CPU_time__name__[];
 extern char pyCitcom_CPU_time__doc__[];
-extern "C"
 PyObject * pyCitcom_CPU_time(PyObject *, PyObject *);
 
 
-//
-//
-
 extern char pyCitcom_citcom_init__doc__[];
 extern char pyCitcom_citcom_init__name__[];
-extern "C"
 PyObject * pyCitcom_citcom_init(PyObject *, PyObject *);
 
 
 extern char pyCitcom_full_solver_init__doc__[];
 extern char pyCitcom_full_solver_init__name__[];
-extern "C"
 PyObject * pyCitcom_full_solver_init(PyObject *, PyObject *);
 
 
 extern char pyCitcom_regional_solver_init__doc__[];
 extern char pyCitcom_regional_solver_init__name__[];
-extern "C"
 PyObject * pyCitcom_regional_solver_init(PyObject *, PyObject *);
 
 
 extern char pyCitcom_global_default_values__name__[];
 extern char pyCitcom_global_default_values__doc__[];
-extern "C"
 PyObject * pyCitcom_global_default_values(PyObject *, PyObject *);
 
 
 extern char pyCitcom_set_signal__name__[];
 extern char pyCitcom_set_signal__doc__[];
-extern "C"
 PyObject * pyCitcom_set_signal(PyObject *, PyObject *);
 
 
 extern char pyCitcom_velocities_conform_bcs__name__[];
 extern char pyCitcom_velocities_conform_bcs__doc__[];
-extern "C"
 PyObject * pyCitcom_velocities_conform_bcs(PyObject *, PyObject *);
 
 
 extern char pyCitcom_BC_update_plate_velocity__name__[];
 extern char pyCitcom_BC_update_plate_velocity__doc__[];
-extern "C"
 PyObject * pyCitcom_BC_update_plate_velocity(PyObject *, PyObject *);
 
 
 extern char pyCitcom_Tracer_tracer_advection__name__[];
 extern char pyCitcom_Tracer_tracer_advection__doc__[];
-extern "C"
 PyObject * pyCitcom_Tracer_tracer_advection(PyObject *, PyObject *);
 
 
 extern char pyCitcom_Visc_update_material__name__[];
 extern char pyCitcom_Visc_update_material__doc__[];
-extern "C"
 PyObject * pyCitcom_Visc_update_material(PyObject *, PyObject *);
 
 
 extern char pyCitcom_return_dt__name__[];
 extern char pyCitcom_return_dt__doc__[];
-extern "C"
 PyObject * pyCitcom_return_dt(PyObject *, PyObject *);
 
 
 extern char pyCitcom_return_step__name__[];
 extern char pyCitcom_return_step__doc__[];
-extern "C"
 PyObject * pyCitcom_return_step(PyObject *, PyObject *);
 
 
 extern char pyCitcom_return_t__name__[];
 extern char pyCitcom_return_t__doc__[];
-extern "C"
 PyObject * pyCitcom_return_t(PyObject *, PyObject *);
 
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/outputs.c (from rev 4749, mc/3D/CitcomS/trunk/module/outputs.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/outputs.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/outputs.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,108 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+#include <stdio.h>
+
+#include "outputs.h"
+
+#include "global_defs.h"
+#include "output.h"
+
+
+void output_finalize(struct  All_variables *E);
+
+
+char pyCitcom_output__doc__[] = "";
+char pyCitcom_output__name__[] = "output";
+
+PyObject * pyCitcom_output(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+    int cycles;
+
+    if (!PyArg_ParseTuple(args, "Oi:output", &obj, &cycles))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    (E->problem_output)(E, cycles);
+
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_output_finalize__doc__[] = "";
+char pyCitcom_output_finalize__name__[] = "output_finalize";
+
+PyObject * pyCitcom_output_finalize(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+    int cycles;
+
+    if (!PyArg_ParseTuple(args, "O:output_finalize", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    output_finalize(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_output_time__doc__[] = "";
+char pyCitcom_output_time__name__[] = "output_time";
+
+PyObject * pyCitcom_output_time(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+    int cycles;
+
+    if (!PyArg_ParseTuple(args, "Oi:output_time", &obj, &cycles))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    output_time(E, cycles);
+
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/outputs.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/outputs.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/outputs.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,112 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-#include <cstdio>
-#include <iostream>
-
-#include "outputs.h"
-
-#include "global_defs.h"
-#include "output.h"
-
-
-extern "C" {
-
-    void output_finalize(struct  All_variables *E);
-
-}
-
-
-char pyCitcom_output__doc__[] = "";
-char pyCitcom_output__name__[] = "output";
-
-PyObject * pyCitcom_output(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-    int cycles;
-
-    if (!PyArg_ParseTuple(args, "Oi:output", &obj, &cycles))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    (E->problem_output)(E, cycles);
-
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_output_finalize__doc__[] = "";
-char pyCitcom_output_finalize__name__[] = "output_finalize";
-
-PyObject * pyCitcom_output_finalize(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-    int cycles;
-
-    if (!PyArg_ParseTuple(args, "O:output_finalize", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    output_finalize(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_output_time__doc__[] = "";
-char pyCitcom_output_time__name__[] = "output_time";
-
-PyObject * pyCitcom_output_time(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-    int cycles;
-
-    if (!PyArg_ParseTuple(args, "Oi:output_time", &obj, &cycles))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    output_time(E, cycles);
-
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/outputs.h
===================================================================
--- mc/3D/CitcomS/trunk/module/outputs.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/outputs.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,29 +23,25 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 #if !defined(pyCitcom_outputs_h)
 #define pyCitcom_outputs_h
 
 extern char pyCitcom_output__name__[];
 extern char pyCitcom_output__doc__[];
-extern "C"
 PyObject * pyCitcom_output(PyObject *, PyObject *);
 
 extern char pyCitcom_output_finalize__name__[];
 extern char pyCitcom_output_finalize__doc__[];
-extern "C"
 PyObject * pyCitcom_output_finalize(PyObject *, PyObject *);
 
 extern char pyCitcom_output_time__name__[];
 extern char pyCitcom_output_time__doc__[];
-extern "C"
 PyObject * pyCitcom_output_time(PyObject *, PyObject *);
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/setProperties.c (from rev 4749, mc/3D/CitcomS/trunk/module/setProperties.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/setProperties.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/setProperties.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,842 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include "global_defs.h"
+
+#include "setProperties.h"
+
+
+/* See PEP 353. */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
+
+/*==============================================================*/
+/* functions and macros which fetch properties from 'inventory' */
+
+
+FILE *get_output_stream(PyObject *out, struct All_variables*E);
+#define PUTS(s) if (fp) fprintf(fp, s)
+
+int _getStringProperty(PyObject* properties, char* attribute,
+                       char* value, size_t valueSize, FILE* fp);
+#define getStringProperty(p, a, v, o) if (-1 == _getStringProperty(p, a, v, sizeof(v), o)) return NULL
+
+int _getIntProperty(PyObject* properties, char* attribute, int *value, FILE* fp);
+#define getIntProperty(p, a, v, o) if (-1 == _getIntProperty(p, a, &(v), o)) return NULL
+
+int _getFloatProperty(PyObject* properties, char* attribute, float *value, FILE* fp);
+#define getFloatProperty(p, a, v, o) if (-1 == _getFloatProperty(p, a, &(v), o)) return NULL
+
+int _getDoubleProperty(PyObject* properties, char* attribute, double *value, FILE* fp);
+#define getDoubleProperty(p, a, v, o) if (-1 == _getDoubleProperty(p, a, &(v), o)) return NULL
+
+int _getIntVectorProperty(PyObject* properties, char* attribute,
+                          int* vector, int len, FILE* fp);
+#define getIntVectorProperty(p, a, v, l, o) if (-1 == _getIntVectorProperty(p, a, v, l, o)) return NULL
+
+int _getFloatVectorProperty(PyObject* properties, char* attribute,
+                            float* vector, int len, FILE* fp);
+#define getFloatVectorProperty(p, a, v, l, o) if (-1 == _getFloatVectorProperty(p, a, v, l, o)) return NULL
+
+
+/*==============================================================*/
+
+
+char pyCitcom_Advection_diffusion_set_properties__doc__[] = "";
+char pyCitcom_Advection_diffusion_set_properties__name__[] = "Advection_diffusion_set_properties";
+
+PyObject * pyCitcom_Advection_diffusion_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Advection_diffusion_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.tsolver]\n"));
+
+    getIntProperty(properties, "ADV", E->advection.ADVECTION, fp);
+    getIntProperty(properties, "filter_temp", E->control.filter_temperature, fp);
+
+    getFloatProperty(properties, "finetunedt", E->advection.fine_tune_dt, fp);
+    getFloatProperty(properties, "fixed_timestep", E->advection.fixed_timestep, fp);
+    getFloatProperty(properties, "inputdiffusivity", E->control.inputdiff, fp);
+
+    getIntProperty(properties, "adv_sub_iterations", E->advection.temp_iterations, fp);
+
+    getIntProperty(properties, "aug_lagr", E->control.augmented_Lagr, fp);
+    getDoubleProperty(properties, "aug_number", E->control.augmented, fp);
+
+
+    E->advection.total_timesteps = 1;
+    E->advection.sub_iterations = 1;
+    E->advection.last_sub_iterations = 1;
+    E->advection.gamma = 0.5;
+    E->advection.dt_reduced = 1.0;
+
+    E->monitor.T_maxvaried = 1.05;
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+
+}
+
+
+
+char pyCitcom_BC_set_properties__doc__[] = "";
+char pyCitcom_BC_set_properties__name__[] = "BC_set_properties";
+
+PyObject * pyCitcom_BC_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:BC_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.bc]\n"));
+
+    getIntProperty(properties, "side_sbcs", E->control.side_sbcs, fp);
+    getIntProperty(properties, "pseudo_free_surf", E->control.pseudo_free_surf, fp);
+
+    getIntProperty(properties, "topvbc", E->mesh.topvbc, fp);
+    getFloatProperty(properties, "topvbxval", E->control.VBXtopval, fp);
+    getFloatProperty(properties, "topvbyval", E->control.VBYtopval, fp);
+
+    getIntProperty(properties, "botvbc", E->mesh.botvbc, fp);
+    getFloatProperty(properties, "botvbxval", E->control.VBXbotval, fp);
+    getFloatProperty(properties, "botvbyval", E->control.VBYbotval, fp);
+
+    getIntProperty(properties, "toptbc", E->mesh.toptbc, fp);
+    getFloatProperty(properties, "toptbcval", E->control.TBCtopval, fp);
+
+    getIntProperty(properties, "bottbc", E->mesh.bottbc, fp);
+    getFloatProperty(properties, "bottbcval", E->control.TBCbotval, fp);
+
+    getIntProperty(properties, "temperature_bound_adj", E->control.temperature_bound_adj, fp);
+    getFloatProperty(properties, "depth_bound_adj", E->control.depth_bound_adj, fp);
+    getFloatProperty(properties, "width_bound_adj", E->control.width_bound_adj, fp);
+
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_Const_set_properties__doc__[] = "";
+char pyCitcom_Const_set_properties__name__[] = "Const_set_properties";
+
+PyObject * pyCitcom_Const_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+    float radius;
+
+    if (!PyArg_ParseTuple(args, "OOO:Const_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.const]\n"));
+
+    getFloatProperty(properties, "layerd", radius, fp);
+    getFloatProperty(properties, "density", E->data.density, fp);
+    getFloatProperty(properties, "thermdiff", E->data.therm_diff, fp);
+    getFloatProperty(properties, "gravacc", E->data.grav_acc, fp);
+    getFloatProperty(properties, "thermexp", E->data.therm_exp, fp);
+    getFloatProperty(properties, "refvisc", E->data.ref_viscosity, fp);
+    getFloatProperty(properties, "cp", E->data.Cp, fp);
+    getFloatProperty(properties, "wdensity", E->data.density_above, fp);
+    getFloatProperty(properties, "surftemp", E->data.surf_temp, fp);
+
+    E->data.therm_cond = E->data.therm_diff * E->data.density * E->data.Cp;
+    E->data.ref_temperature = E->control.Atemp * E->data.therm_diff
+	* E->data.ref_viscosity / (radius * radius * radius)
+	/ (E->data.density * E->data.grav_acc * E->data.therm_exp);
+
+    getFloatProperty(properties, "z_lith", E->viscosity.zlith, fp);
+    getFloatProperty(properties, "z_410", E->viscosity.z410, fp);
+    getFloatProperty(properties, "z_lmantle", E->viscosity.zlm, fp);
+    getFloatProperty(properties, "z_cmb", E->viscosity.zcmb, fp); /* this is used as the D" phase change depth */
+
+    /* convert meter to kilometer */
+    E->data.layer_km = radius / 1e3;
+    E->data.radius_km = E->data.layer_km;
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+
+}
+
+
+
+char pyCitcom_IC_set_properties__doc__[] = "";
+char pyCitcom_IC_set_properties__name__[] = "IC_set_properties";
+
+PyObject * pyCitcom_IC_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:IC_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.ic]\n"));
+
+    getIntProperty(properties, "restart", E->control.restart, fp);
+    getIntProperty(properties, "post_p", E->control.post_p, fp);
+    getIntProperty(properties, "solution_cycles_init", E->monitor.solution_cycles_init, fp);
+    getIntProperty(properties, "zero_elapsed_time", E->control.zero_elapsed_time, fp);
+
+    getIntProperty(properties, "tic_method", E->convection.tic_method, fp);
+
+    if (E->convection.tic_method == 0) {
+	int num_perturb;
+
+	getIntProperty(properties, "num_perturbations", num_perturb, fp);
+	if(num_perturb > PERTURB_MAX_LAYERS) {
+	    fprintf(stderr, "'num_perturb' greater than allowed value, set to %d\n", PERTURB_MAX_LAYERS);
+	    num_perturb = PERTURB_MAX_LAYERS;
+	}
+	E->convection.number_of_perturbations = num_perturb;
+
+	getIntVectorProperty(properties, "perturbl", E->convection.perturb_ll,
+                             num_perturb, fp);
+	getIntVectorProperty(properties, "perturbm", E->convection.perturb_mm,
+                             num_perturb, fp);
+	getIntVectorProperty(properties, "perturblayer", E->convection.load_depth,
+                             num_perturb, fp);
+	getFloatVectorProperty(properties, "perturbmag", E->convection.perturb_mag,
+                               num_perturb, fp);
+    }
+    else if (E->convection.tic_method == 1) {
+	getFloatProperty(properties, "half_space_age", E->convection.half_space_age, fp);
+    }
+    else if (E->convection.tic_method == 2) {
+        getFloatProperty(properties, "half_space_age", E->convection.half_space_age, fp);
+        getFloatVectorProperty(properties, "blob_center", E->convection.blob_center, 3, fp);
+        if( E->convection.blob_center[0] == -999.0 && E->convection.blob_center[1] == -999.0 && E->convection.blob_center[2] == -999.0 ) {
+            E->convection.blob_center[0] = 0.5*(E->control.theta_min+E->control.theta_max);
+            E->convection.blob_center[1] = 0.5*(E->control.fi_min+E->control.fi_max);
+            E->convection.blob_center[2] = 0.5*(E->sphere.ri+E->sphere.ro);
+        }
+        getFloatProperty(properties, "blob_radius", E->convection.blob_radius, fp);
+        getFloatProperty(properties, "blob_dT", E->convection.blob_dT, fp);
+    }
+
+    PUTS(("\n"));
+
+    if (PyErr_Occurred())
+      return NULL;
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_Output_set_properties__doc__[] = "";
+char pyCitcom_Output_set_properties__name__[] = "Output_set_properties";
+
+PyObject * pyCitcom_Output_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Output_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.output]\n"));
+
+    getStringProperty(properties, "output_format", E->output.format, fp);
+    getStringProperty(properties, "output_optional", E->output.optional, fp);
+
+    getIntProperty(properties, "cb_block_size", E->output.cb_block_size, fp);
+    getIntProperty(properties, "cb_buffer_size", E->output.cb_buffer_size, fp);
+
+    getIntProperty(properties, "sieve_buf_size", E->output.sieve_buf_size, fp);
+
+    getIntProperty(properties, "output_alignment", E->output.alignment, fp);
+    getIntProperty(properties, "output_alignment_threshold", E->output.alignment_threshold, fp);
+
+    getIntProperty(properties, "cache_mdc_nelmts", E->output.cache_mdc_nelmts, fp);
+    getIntProperty(properties, "cache_rdcc_nelmts", E->output.cache_rdcc_nelmts, fp);
+    getIntProperty(properties, "cache_rdcc_nbytes", E->output.cache_rdcc_nbytes, fp);
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+
+}
+
+
+
+char pyCitcom_Param_set_properties__doc__[] = "";
+char pyCitcom_Param_set_properties__name__[] = "Param_set_properties";
+
+PyObject * pyCitcom_Param_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Param_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.param]\n"));
+
+    getIntProperty(properties, "file_vbcs", E->control.vbcs_file, fp);
+    getStringProperty(properties, "vel_bound_file", E->control.velocity_boundary_file, fp);
+
+    getIntProperty(properties, "mat_control", E->control.mat_control, fp);
+    getStringProperty(properties, "mat_file", E->control.mat_file, fp);
+
+    getIntProperty(properties, "lith_age", E->control.lith_age, fp);
+    getStringProperty(properties, "lith_age_file", E->control.lith_age_file, fp);
+    getIntProperty(properties, "lith_age_time", E->control.lith_age_time, fp);
+    getFloatProperty(properties, "lith_age_depth", E->control.lith_age_depth, fp);
+    getFloatProperty(properties, "mantle_temp", E->control.lith_age_mantle_temp, fp);
+
+    getFloatProperty(properties, "start_age", E->control.start_age, fp);
+    getIntProperty(properties, "reset_startage", E->control.reset_startage, fp);
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+
+}
+
+
+
+char pyCitcom_Phase_set_properties__doc__[] = "";
+char pyCitcom_Phase_set_properties__name__[] = "Phase_set_properties";
+
+PyObject * pyCitcom_Phase_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Phase_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.phase]\n"));
+
+    getFloatProperty(properties, "Ra_410", E->control.Ra_410, fp);
+    getFloatProperty(properties, "clapeyron410", E->control.clapeyron410, fp);
+    getFloatProperty(properties, "transT410", E->control.transT410, fp);
+    getFloatProperty(properties, "width410", E->control.width410, fp);
+
+    if (E->control.width410!=0.0)
+	E->control.width410 = 1.0/E->control.width410;
+
+    getFloatProperty(properties, "Ra_670", E->control.Ra_670 , fp);
+    getFloatProperty(properties, "clapeyron670", E->control.clapeyron670, fp);
+    getFloatProperty(properties, "transT670", E->control.transT670, fp);
+    getFloatProperty(properties, "width670", E->control.width670, fp);
+
+    if (E->control.width670!=0.0)
+	E->control.width670 = 1.0/E->control.width670;
+
+    getFloatProperty(properties, "Ra_cmb", E->control.Ra_cmb, fp);
+    getFloatProperty(properties, "clapeyroncmb", E->control.clapeyroncmb, fp);
+    getFloatProperty(properties, "transTcmb", E->control.transTcmb, fp);
+    getFloatProperty(properties, "widthcmb", E->control.widthcmb, fp);
+
+    if (E->control.widthcmb!=0.0)
+	E->control.widthcmb = 1.0/E->control.widthcmb;
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+
+}
+
+
+
+char pyCitcom_Solver_set_properties__doc__[] = "";
+char pyCitcom_Solver_set_properties__name__[] = "Solver_set_properties";
+
+PyObject * pyCitcom_Solver_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Solver_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver]\n"));
+
+    getStringProperty(properties, "datadir", E->control.data_dir, fp);
+    getStringProperty(properties, "datafile", E->control.data_file, fp);
+    getStringProperty(properties, "datadir_old", E->control.data_dir_old, fp);
+    getStringProperty(properties, "datafile_old", E->control.old_P_file, fp);
+
+    getFloatProperty(properties, "rayleigh", E->control.Atemp, fp);
+    getFloatProperty(properties, "Q0", E->control.Q0, fp);
+
+    getIntProperty(properties, "stokes_flow_only", E->control.stokes, fp);
+
+    getIntProperty(properties, "verbose", E->control.verbose, fp);
+    getIntProperty(properties, "see_convergence", E->control.print_convergence, fp);
+
+    /* parameters not used in pyre version,
+       assigned value here to prevent uninitialized access */
+    E->advection.min_timesteps = 1;
+    E->advection.max_timesteps = 1;
+    E->advection.max_total_timesteps = 1;
+    E->control.record_every = 1;
+    E->control.record_all_until = 1;
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_Sphere_set_properties__doc__[] = "";
+char pyCitcom_Sphere_set_properties__name__[] = "Sphere_set_properties";
+
+PyObject * pyCitcom_Sphere_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Sphere_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.mesher]\n"));
+
+    getIntProperty(properties, "nproc_surf", E->parallel.nprocxy, fp);
+
+    getIntProperty(properties, "nprocx", E->parallel.nprocx, fp);
+    getIntProperty(properties, "nprocy", E->parallel.nprocy, fp);
+    getIntProperty(properties, "nprocz", E->parallel.nprocz, fp);
+
+    if (E->parallel.nprocxy == 12)
+	if (E->parallel.nprocx != E->parallel.nprocy) {
+	    char errmsg[] = "!!!! nprocx must equal to nprocy";
+	    PyErr_SetString(PyExc_SyntaxError, errmsg);
+	    return NULL;
+    }
+
+    getIntProperty(properties, "coor", E->control.coor, fp);
+    getStringProperty(properties, "coor_file", E->control.coor_file, fp);
+
+    getIntProperty(properties, "nodex", E->mesh.nox, fp);
+    getIntProperty(properties, "nodey", E->mesh.noy, fp);
+    getIntProperty(properties, "nodez", E->mesh.noz, fp);
+    getIntProperty(properties, "levels", E->mesh.levels, fp);
+
+    E->mesh.mgunitx = (E->mesh.nox - 1) / E->parallel.nprocx /
+	(int) pow(2.0, E->mesh.levels - 1);
+    E->mesh.mgunity = (E->mesh.noy - 1) / E->parallel.nprocy /
+	(int) pow(2.0, E->mesh.levels - 1);
+    E->mesh.mgunitz = (E->mesh.noz - 1) / E->parallel.nprocz /
+	(int) pow(2.0, E->mesh.levels - 1);
+
+    if (E->parallel.nprocxy == 12) {
+	if (E->mesh.nox != E->mesh.noy) {
+	    char errmsg[] = "!!!! nodex must equal to nodey";
+	    PyErr_SetString(PyExc_SyntaxError, errmsg);
+	    return NULL;
+	}
+    }
+
+    getDoubleProperty(properties, "radius_outer", E->sphere.ro, fp);
+    getDoubleProperty(properties, "radius_inner", E->sphere.ri, fp);
+
+    E->mesh.nsd = 3;
+    E->mesh.dof = 3;
+    E->sphere.max_connections = 6;
+
+    if (E->parallel.nprocxy == 12) {
+	int i, j;
+	double offset = 10.0/180.0*M_PI;
+	/* full spherical version */
+	E->sphere.caps = 12;
+
+	for (i=1;i<=4;i++)  {
+	    E->sphere.cap[(i-1)*3+1].theta[1] = 0.0;
+	    E->sphere.cap[(i-1)*3+1].theta[2] = M_PI/4.0+offset;
+	    E->sphere.cap[(i-1)*3+1].theta[3] = M_PI/2.0;
+	    E->sphere.cap[(i-1)*3+1].theta[4] = M_PI/4.0+offset;
+	    E->sphere.cap[(i-1)*3+1].fi[1] = 0.0;
+	    E->sphere.cap[(i-1)*3+1].fi[2] = (i-1)*M_PI/2.0;
+	    E->sphere.cap[(i-1)*3+1].fi[3] = (i-1)*M_PI/2.0 + M_PI/4.0;
+	    E->sphere.cap[(i-1)*3+1].fi[4] = i*M_PI/2.0;
+
+	    E->sphere.cap[(i-1)*3+2].theta[1] = M_PI/4.0+offset;
+	    E->sphere.cap[(i-1)*3+2].theta[2] = M_PI/2.0;
+	    E->sphere.cap[(i-1)*3+2].theta[3] = 3*M_PI/4.0-offset;
+	    E->sphere.cap[(i-1)*3+2].theta[4] = M_PI/2.0;
+	    E->sphere.cap[(i-1)*3+2].fi[1] = i*M_PI/2.0;
+	    E->sphere.cap[(i-1)*3+2].fi[2] = i*M_PI/2.0 - M_PI/4.0;
+	    E->sphere.cap[(i-1)*3+2].fi[3] = i*M_PI/2.0;
+	    E->sphere.cap[(i-1)*3+2].fi[4] = i*M_PI/2.0 + M_PI/4.0;
+	}
+
+	for (i=1;i<=4;i++)  {
+	    j = (i-1)*3;
+	    if (i==1) j=12;
+	    E->sphere.cap[j].theta[1] = M_PI/2.0;
+	    E->sphere.cap[j].theta[2] = 3*M_PI/4.0-offset;
+	    E->sphere.cap[j].theta[3] = M_PI;
+	    E->sphere.cap[j].theta[4] = 3*M_PI/4.0-offset;
+	    E->sphere.cap[j].fi[1] = (i-1)*M_PI/2.0 + M_PI/4.0;
+	    E->sphere.cap[j].fi[2] = (i-1)*M_PI/2.0;
+	    E->sphere.cap[j].fi[3] = 0.0;
+	    E->sphere.cap[j].fi[4] = i*M_PI/2.0;
+	}
+
+    } else {
+	/* regional version */
+	E->sphere.caps = 1;
+
+	getDoubleProperty(properties, "theta_min", E->control.theta_min, fp);
+	getDoubleProperty(properties, "theta_max", E->control.theta_max, fp);
+	getDoubleProperty(properties, "fi_min", E->control.fi_min, fp);
+	getDoubleProperty(properties, "fi_max", E->control.fi_max, fp);
+
+	E->sphere.cap[1].theta[1] = E->control.theta_min;
+	E->sphere.cap[1].theta[2] = E->control.theta_max;
+	E->sphere.cap[1].theta[3] = E->control.theta_max;
+	E->sphere.cap[1].theta[4] = E->control.theta_min;
+	E->sphere.cap[1].fi[1] = E->control.fi_min;
+	E->sphere.cap[1].fi[2] = E->control.fi_min;
+	E->sphere.cap[1].fi[3] = E->control.fi_max;
+	E->sphere.cap[1].fi[4] = E->control.fi_max;
+    }
+
+    getIntProperty(properties, "ll_max", E->sphere.llmax, fp);
+    getIntProperty(properties, "nlong", E->sphere.noy, fp);
+    getIntProperty(properties, "nlati", E->sphere.nox, fp);
+    getIntProperty(properties, "output_ll_max", E->sphere.output_llmax, fp);
+
+    E->mesh.layer[1] = 1;
+    E->mesh.layer[2] = 1;
+    E->mesh.layer[3] = 1;
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_Tracer_set_properties__doc__[] = "";
+char pyCitcom_Tracer_set_properties__name__[] = "Tracer_set_properties";
+
+PyObject * pyCitcom_Tracer_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Tracer_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.tracer]\n"));
+
+    getIntProperty(properties, "tracer", E->control.tracer, fp);
+    getStringProperty(properties, "tracer_file", E->control.tracer_file, fp);
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_Visc_set_properties__doc__[] = "";
+char pyCitcom_Visc_set_properties__name__[] = "Visc_set_properties";
+
+PyObject * pyCitcom_Visc_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+    int num_mat;
+
+    if (!PyArg_ParseTuple(args, "OOO:Visc_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.visc]\n"));
+
+    getStringProperty(properties, "Viscosity", E->viscosity.STRUCTURE, fp);
+    if (strcmp(E->viscosity.STRUCTURE,"system") == 0)
+	E->viscosity.FROM_SYSTEM = 1;
+    else
+	E->viscosity.FROM_SYSTEM = 0;
+
+    getIntProperty(properties, "visc_smooth_method", E->viscosity.smooth_cycles, fp);
+    getIntProperty(properties, "VISC_UPDATE", E->viscosity.update_allowed, fp);
+
+#define MAX_MAT 40
+
+    getIntProperty(properties, "num_mat", num_mat, fp);
+    if(num_mat > MAX_MAT) {
+	/* max. allowed material types = 40 */
+	fprintf(stderr, "'num_mat' greater than allowed value, set to %d\n", MAX_MAT);
+	num_mat = MAX_MAT;
+    }
+    E->viscosity.num_mat = num_mat;
+
+    getFloatVectorProperty(properties, "visc0",
+                           E->viscosity.N0, num_mat, fp);
+
+    getIntProperty(properties, "TDEPV", E->viscosity.TDEPV, fp);
+    getIntProperty(properties, "rheol", E->viscosity.RHEOL, fp);
+    getFloatVectorProperty(properties, "viscE",
+                           E->viscosity.E, num_mat, fp);
+    getFloatVectorProperty(properties, "viscT",
+                           E->viscosity.T, num_mat, fp);
+    getFloatVectorProperty(properties, "viscZ",
+                           E->viscosity.Z, num_mat, fp);
+
+    getIntProperty(properties, "SDEPV", E->viscosity.SDEPV, fp);
+    getFloatProperty(properties, "sdepv_misfit", E->viscosity.sdepv_misfit, fp);
+    getFloatVectorProperty(properties, "sdepv_expt",
+                           E->viscosity.sdepv_expt, num_mat, fp);
+
+    getIntProperty(properties, "VMIN", E->viscosity.MIN, fp);
+    getFloatProperty(properties, "visc_min", E->viscosity.min_value, fp);
+
+    getIntProperty(properties, "VMAX", E->viscosity.MAX, fp);
+    getFloatProperty(properties, "visc_max", E->viscosity.max_value, fp);
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_Incompressible_set_properties__doc__[] = "";
+char pyCitcom_Incompressible_set_properties__name__[] = "Incompressible_set_properties";
+
+PyObject * pyCitcom_Incompressible_set_properties(PyObject *self, PyObject *args)
+{
+    PyObject *obj, *properties, *out;
+    struct All_variables *E;
+    FILE *fp;
+
+    if (!PyArg_ParseTuple(args, "OOO:Incompressible_set_properties",
+			  &obj, &properties, &out))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+    fp = get_output_stream(out, E);
+
+    PUTS(("[CitcomS.solver.vsolver]\n"));
+
+    getStringProperty(properties, "Solver", E->control.SOLVER_TYPE, fp);
+    getIntProperty(properties, "node_assemble", E->control.NASSEMBLE, fp);
+    getIntProperty(properties, "precond", E->control.precondition, fp);
+
+    getDoubleProperty(properties, "accuracy", E->control.accuracy, fp);
+    getFloatProperty(properties, "tole_compressibility", E->control.tole_comp, fp);
+
+    getIntProperty(properties, "mg_cycle", E->control.mg_cycle, fp);
+    getIntProperty(properties, "down_heavy", E->control.down_heavy, fp);
+    getIntProperty(properties, "up_heavy", E->control.up_heavy, fp);
+
+    getIntProperty(properties, "vlowstep", E->control.v_steps_low, fp);
+    getIntProperty(properties, "vhighstep", E->control.v_steps_high, fp);
+    getIntProperty(properties, "piterations", E->control.p_iterations, fp);
+
+    PUTS(("\n"));
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+
+/*==========================================================*/
+/* helper functions */
+
+FILE *get_output_stream(PyObject *out, struct All_variables*E)
+{
+    int mute;
+
+    mute = E->parallel.me;
+    if (mute)
+	return NULL;
+    return PyFile_AsFile(out);
+}
+
+
+int _getStringProperty(PyObject* properties, char* attribute,
+                       char* value, size_t valueSize, FILE* fp)
+{
+    PyObject *prop;
+    char *buffer;
+    Py_ssize_t length;
+
+    if (!(prop = PyObject_GetAttrString(properties, attribute)))
+        return -1;
+    if (-1 == PyString_AsStringAndSize(prop, &buffer, &length))
+        return -1;
+        
+    if (length >= (Py_ssize_t)valueSize) {
+        PyErr_Format(PyExc_ValueError,
+                     "value of '%s' cannot exceed %zu characters in length",
+                     attribute, valueSize);
+        return -1;
+    }
+    strcpy(value, buffer);
+
+    if (fp)
+        fprintf(fp, "%s=%s\n", attribute, value);
+
+    return 0;
+}
+
+
+#define getTYPEProperty _getIntProperty
+#define getTYPEVectorProperty _getIntVectorProperty
+#define PyTYPE_Check PyInt_Check
+#define CTYPE int
+#define PyTYPE_AsCTYPE PyInt_AsLong
+#define MESSAGE "an integer is required"
+#define FORMAT "%d"
+#include "getProperty.h"
+
+#undef getTYPEProperty
+#undef getTYPEVectorProperty
+#undef PyTYPE_Check
+#undef CTYPE
+#undef PyTYPE_AsCTYPE
+#undef MESSAGE
+#undef FORMAT
+
+#define getTYPEProperty _getFloatProperty
+#define getTYPEVectorProperty _getFloatVectorProperty
+#define PyTYPE_Check PyFloat_Check
+#define CTYPE float
+#define PyTYPE_AsCTYPE PyFloat_AsDouble
+#define MESSAGE "a float is required"
+#define FORMAT "%f"
+#include "getProperty.h"
+
+
+#undef getTYPEProperty
+#undef getTYPEVectorProperty
+#undef PyTYPE_Check
+#undef CTYPE
+#undef PyTYPE_AsCTYPE
+#undef MESSAGE
+#undef FORMAT
+
+#define getTYPEProperty _getDoubleProperty
+#define getTYPEVectorProperty _getDoubleVectorProperty
+#define PyTYPE_Check PyFloat_Check
+#define CTYPE double
+#define PyTYPE_AsCTYPE PyFloat_AsDouble
+#define MESSAGE "a float is required"
+#define FORMAT "%f"
+#include "getProperty.h"
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/setProperties.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/setProperties.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/setProperties.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,917 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-#include <cstdio>
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <cmath>
-#include "global_defs.h"
-
-#include "setProperties.h"
-
-
-std::ofstream* get_output_stream(int mute, int pid);
-
-void getStringProperty(PyObject* properties, char* attribute,
-		       char* value, std::ostream* out);
-
-template <class T>
-void getScalarProperty(PyObject* properties, char* attribute,
-		       T& value, std::ostream* out);
-
-template <class T>
-void getVectorProperty(PyObject* properties, char* attribute,
-		       T* vector, int len, std::ostream* out);
-
-//
-//
-
-char pyCitcom_Advection_diffusion_set_properties__doc__[] = "";
-char pyCitcom_Advection_diffusion_set_properties__name__[] = "Advection_diffusion_set_properties";
-
-PyObject * pyCitcom_Advection_diffusion_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Advection_diffusion_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.tsolver]" << std::endl;
-
-    getScalarProperty(properties, "ADV", E->advection.ADVECTION, out);
-    getScalarProperty(properties, "filter_temp", E->control.filter_temperature, out);
-
-    getScalarProperty(properties, "finetunedt", E->advection.fine_tune_dt, out);
-    getScalarProperty(properties, "fixed_timestep", E->advection.fixed_timestep, out);
-    getScalarProperty(properties, "inputdiffusivity", E->control.inputdiff, out);
-
-    getScalarProperty(properties, "adv_sub_iterations", E->advection.temp_iterations, out);
-
-    getScalarProperty(properties, "aug_lagr", E->control.augmented_Lagr, out);
-    getScalarProperty(properties, "aug_number", E->control.augmented, out);
-
-
-    E->advection.total_timesteps = 1;
-    E->advection.sub_iterations = 1;
-    E->advection.last_sub_iterations = 1;
-    E->advection.gamma = 0.5;
-    E->advection.dt_reduced = 1.0;
-
-    E->monitor.T_maxvaried = 1.05;
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-
-}
-
-
-
-char pyCitcom_BC_set_properties__doc__[] = "";
-char pyCitcom_BC_set_properties__name__[] = "BC_set_properties";
-
-PyObject * pyCitcom_BC_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:BC_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.bc]" << std::endl;
-
-    getScalarProperty(properties, "side_sbcs", E->control.side_sbcs, out);
-    getScalarProperty(properties, "pseudo_free_surf", E->control.pseudo_free_surf, out);
-
-    getScalarProperty(properties, "topvbc", E->mesh.topvbc, out);
-    getScalarProperty(properties, "topvbxval", E->control.VBXtopval, out);
-    getScalarProperty(properties, "topvbyval", E->control.VBYtopval, out);
-
-    getScalarProperty(properties, "botvbc", E->mesh.botvbc, out);
-    getScalarProperty(properties, "botvbxval", E->control.VBXbotval, out);
-    getScalarProperty(properties, "botvbyval", E->control.VBYbotval, out);
-
-    getScalarProperty(properties, "toptbc", E->mesh.toptbc, out);
-    getScalarProperty(properties, "toptbcval", E->control.TBCtopval, out);
-
-    getScalarProperty(properties, "bottbc", E->mesh.bottbc, out);
-    getScalarProperty(properties, "bottbcval", E->control.TBCbotval, out);
-
-    getScalarProperty(properties, "temperature_bound_adj", E->control.temperature_bound_adj, out);
-    getScalarProperty(properties, "depth_bound_adj", E->control.depth_bound_adj, out);
-    getScalarProperty(properties, "width_bound_adj", E->control.width_bound_adj, out);
-
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_Const_set_properties__doc__[] = "";
-char pyCitcom_Const_set_properties__name__[] = "Const_set_properties";
-
-PyObject * pyCitcom_Const_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Const_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.const]" << std::endl;
-
-    float radius;
-    getScalarProperty(properties, "layerd", radius, out);
-    getScalarProperty(properties, "density", E->data.density, out);
-    getScalarProperty(properties, "thermdiff", E->data.therm_diff, out);
-    getScalarProperty(properties, "gravacc", E->data.grav_acc, out);
-    getScalarProperty(properties, "thermexp", E->data.therm_exp, out);
-    getScalarProperty(properties, "refvisc", E->data.ref_viscosity, out);
-    getScalarProperty(properties, "cp", E->data.Cp, out);
-    getScalarProperty(properties, "wdensity", E->data.density_above, out);
-    getScalarProperty(properties, "surftemp", E->data.surf_temp, out);
-
-    E->data.therm_cond = E->data.therm_diff * E->data.density * E->data.Cp;
-    E->data.ref_temperature = E->control.Atemp * E->data.therm_diff
-	* E->data.ref_viscosity / (radius * radius * radius)
-	/ (E->data.density * E->data.grav_acc * E->data.therm_exp);
-
-    getScalarProperty(properties, "z_lith", E->viscosity.zlith, out);
-    getScalarProperty(properties, "z_410", E->viscosity.z410, out);
-    getScalarProperty(properties, "z_lmantle", E->viscosity.zlm, out);
-    getScalarProperty(properties, "z_cmb", E->viscosity.zcmb, out); //this is used as the D" phase change depth
-
-    // convert meter to kilometer
-    E->data.layer_km = radius / 1e3;
-    E->data.radius_km = E->data.layer_km;
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-
-}
-
-
-
-char pyCitcom_IC_set_properties__doc__[] = "";
-char pyCitcom_IC_set_properties__name__[] = "IC_set_properties";
-
-PyObject * pyCitcom_IC_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:IC_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.ic]" << std::endl;
-
-    getScalarProperty(properties, "restart", E->control.restart, out);
-    getScalarProperty(properties, "post_p", E->control.post_p, out);
-    getScalarProperty(properties, "solution_cycles_init", E->monitor.solution_cycles_init, out);
-    getScalarProperty(properties, "zero_elapsed_time", E->control.zero_elapsed_time, out);
-
-    getScalarProperty(properties, "tic_method", E->convection.tic_method, out);
-
-    if (E->convection.tic_method == 0) {
-	int num_perturb;
-
-	getScalarProperty(properties, "num_perturbations", num_perturb, out);
-	if(num_perturb > PERTURB_MAX_LAYERS) {
-	    std::cerr << "'num_perturb' greater than allowed value, set to "
-		      << PERTURB_MAX_LAYERS << std::endl;
-	    num_perturb = PERTURB_MAX_LAYERS;
-	}
-	E->convection.number_of_perturbations = num_perturb;
-
-	getVectorProperty(properties, "perturbl", E->convection.perturb_ll,
-			  num_perturb, out);
-	getVectorProperty(properties, "perturbm", E->convection.perturb_mm,
-			  num_perturb, out);
-	getVectorProperty(properties, "perturblayer", E->convection.load_depth,
-			  num_perturb, out);
-	getVectorProperty(properties, "perturbmag", E->convection.perturb_mag,
-			  num_perturb, out);
-    }
-    else if (E->convection.tic_method == 1) {
-	getScalarProperty(properties, "half_space_age", E->convection.half_space_age, out);
-    }
-    else if (E->convection.tic_method == 2) {
-        getScalarProperty(properties, "half_space_age", E->convection.half_space_age, out);
-        getVectorProperty(properties, "blob_center", E->convection.blob_center, 3, out);
-        if( E->convection.blob_center[0] == -999.0 && E->convection.blob_center[1] == -999.0 && E->convection.blob_center[2] == -999.0 ) {
-            E->convection.blob_center[0] = 0.5*(E->control.theta_min+E->control.theta_max);
-            E->convection.blob_center[1] = 0.5*(E->control.fi_min+E->control.fi_max);
-            E->convection.blob_center[2] = 0.5*(E->sphere.ri+E->sphere.ro);
-        }
-        getScalarProperty(properties, "blob_radius", E->convection.blob_radius, out);
-        getScalarProperty(properties, "blob_dT", E->convection.blob_dT, out);
-    }
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-      return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_Output_set_properties__doc__[] = "";
-char pyCitcom_Output_set_properties__name__[] = "Output_set_properties";
-
-PyObject * pyCitcom_Output_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Output_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.output]" << std::endl;
-
-    getStringProperty(properties, "output_format", E->output.format, out);
-    getStringProperty(properties, "output_optional", E->output.optional, out);
-
-    getScalarProperty(properties, "cb_block_size", E->output.cb_block_size, out);
-    getScalarProperty(properties, "cb_buffer_size", E->output.cb_buffer_size, out);
-
-    getScalarProperty(properties, "sieve_buf_size", E->output.sieve_buf_size, out);
-
-    getScalarProperty(properties, "output_alignment", E->output.alignment, out);
-    getScalarProperty(properties, "output_alignment_threshold", E->output.alignment_threshold, out);
-
-    getScalarProperty(properties, "cache_mdc_nelmts", E->output.cache_mdc_nelmts, out);
-    getScalarProperty(properties, "cache_rdcc_nelmts", E->output.cache_rdcc_nelmts, out);
-    getScalarProperty(properties, "cache_rdcc_nbytes", E->output.cache_rdcc_nbytes, out);
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-
-}
-
-
-
-char pyCitcom_Param_set_properties__doc__[] = "";
-char pyCitcom_Param_set_properties__name__[] = "Param_set_properties";
-
-PyObject * pyCitcom_Param_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Param_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.param]" << std::endl;
-
-    getScalarProperty(properties, "file_vbcs", E->control.vbcs_file, out);
-    getStringProperty(properties, "vel_bound_file", E->control.velocity_boundary_file, out);
-
-    getScalarProperty(properties, "mat_control", E->control.mat_control, out);
-    getStringProperty(properties, "mat_file", E->control.mat_file, out);
-
-    getScalarProperty(properties, "lith_age", E->control.lith_age, out);
-    getStringProperty(properties, "lith_age_file", E->control.lith_age_file, out);
-    getScalarProperty(properties, "lith_age_time", E->control.lith_age_time, out);
-    getScalarProperty(properties, "lith_age_depth", E->control.lith_age_depth, out);
-    getScalarProperty(properties, "mantle_temp", E->control.lith_age_mantle_temp, out);
-
-    getScalarProperty(properties, "start_age", E->control.start_age, out);
-    getScalarProperty(properties, "reset_startage", E->control.reset_startage, out);
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-
-}
-
-
-
-char pyCitcom_Phase_set_properties__doc__[] = "";
-char pyCitcom_Phase_set_properties__name__[] = "Phase_set_properties";
-
-PyObject * pyCitcom_Phase_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Phase_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.phase]" << std::endl;
-
-    getScalarProperty(properties, "Ra_410", E->control.Ra_410, out);
-    getScalarProperty(properties, "clapeyron410", E->control.clapeyron410, out);
-    getScalarProperty(properties, "transT410", E->control.transT410, out);
-    getScalarProperty(properties, "width410", E->control.width410, out);
-
-    if (E->control.width410!=0.0)
-	E->control.width410 = 1.0/E->control.width410;
-
-    getScalarProperty(properties, "Ra_670", E->control.Ra_670 , out);
-    getScalarProperty(properties, "clapeyron670", E->control.clapeyron670, out);
-    getScalarProperty(properties, "transT670", E->control.transT670, out);
-    getScalarProperty(properties, "width670", E->control.width670, out);
-
-    if (E->control.width670!=0.0)
-	E->control.width670 = 1.0/E->control.width670;
-
-    getScalarProperty(properties, "Ra_cmb", E->control.Ra_cmb, out);
-    getScalarProperty(properties, "clapeyroncmb", E->control.clapeyroncmb, out);
-    getScalarProperty(properties, "transTcmb", E->control.transTcmb, out);
-    getScalarProperty(properties, "widthcmb", E->control.widthcmb, out);
-
-    if (E->control.widthcmb!=0.0)
-	E->control.widthcmb = 1.0/E->control.widthcmb;
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-
-}
-
-
-
-char pyCitcom_Solver_set_properties__doc__[] = "";
-char pyCitcom_Solver_set_properties__name__[] = "Solver_set_properties";
-
-PyObject * pyCitcom_Solver_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Solver_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver]" << std::endl;
-
-    getStringProperty(properties, "datadir", E->control.data_dir, out);
-    getStringProperty(properties, "datafile", E->control.data_file, out);
-    getStringProperty(properties, "datadir_old", E->control.data_dir_old, out);
-    getStringProperty(properties, "datafile_old", E->control.old_P_file, out);
-
-    getScalarProperty(properties, "rayleigh", E->control.Atemp, out);
-    getScalarProperty(properties, "Q0", E->control.Q0, out);
-
-    getScalarProperty(properties, "stokes_flow_only", E->control.stokes, out);
-
-    getScalarProperty(properties, "verbose", E->control.verbose, out);
-    getScalarProperty(properties, "see_convergence", E->control.print_convergence, out);
-
-    // parameters not used in pyre version,
-    // assigned value here to prevent uninitialized access
-    E->advection.min_timesteps = 1;
-    E->advection.max_timesteps = 1;
-    E->advection.max_total_timesteps = 1;
-    E->control.record_every = 1;
-    E->control.record_all_until = 1;
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_Sphere_set_properties__doc__[] = "";
-char pyCitcom_Sphere_set_properties__name__[] = "Sphere_set_properties";
-
-PyObject * pyCitcom_Sphere_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Sphere_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.mesher]" << std::endl;
-
-    getScalarProperty(properties, "nproc_surf", E->parallel.nprocxy, out);
-
-    getScalarProperty(properties, "nprocx", E->parallel.nprocx, out);
-    getScalarProperty(properties, "nprocy", E->parallel.nprocy, out);
-    getScalarProperty(properties, "nprocz", E->parallel.nprocz, out);
-
-    if (E->parallel.nprocxy == 12)
-	if (E->parallel.nprocx != E->parallel.nprocy) {
-	    char errmsg[] = "!!!! nprocx must equal to nprocy";
-	    PyErr_SetString(PyExc_SyntaxError, errmsg);
-	    return NULL;
-    }
-
-    getScalarProperty(properties, "coor", E->control.coor, out);
-    getStringProperty(properties, "coor_file", E->control.coor_file, out);
-
-    getScalarProperty(properties, "nodex", E->mesh.nox, out);
-    getScalarProperty(properties, "nodey", E->mesh.noy, out);
-    getScalarProperty(properties, "nodez", E->mesh.noz, out);
-    getScalarProperty(properties, "levels", E->mesh.levels, out);
-
-    E->mesh.mgunitx = (E->mesh.nox - 1) / E->parallel.nprocx /
-	(int) std::pow(2.0, E->mesh.levels - 1);
-    E->mesh.mgunity = (E->mesh.noy - 1) / E->parallel.nprocy /
-	(int) std::pow(2.0, E->mesh.levels - 1);
-    E->mesh.mgunitz = (E->mesh.noz - 1) / E->parallel.nprocz /
-	(int) std::pow(2.0, E->mesh.levels - 1);
-
-    if (E->parallel.nprocxy == 12) {
-	if (E->mesh.nox != E->mesh.noy) {
-	    char errmsg[] = "!!!! nodex must equal to nodey";
-	    PyErr_SetString(PyExc_SyntaxError, errmsg);
-	    return NULL;
-	}
-    }
-
-    getScalarProperty(properties, "radius_outer", E->sphere.ro, out);
-    getScalarProperty(properties, "radius_inner", E->sphere.ri, out);
-
-    E->mesh.nsd = 3;
-    E->mesh.dof = 3;
-    E->sphere.max_connections = 6;
-
-    if (E->parallel.nprocxy == 12) {
-	// full spherical version
-	E->sphere.caps = 12;
-
-	int i, j;
-	double offset = 10.0/180.0*M_PI;
-	for (i=1;i<=4;i++)  {
-	    E->sphere.cap[(i-1)*3+1].theta[1] = 0.0;
-	    E->sphere.cap[(i-1)*3+1].theta[2] = M_PI/4.0+offset;
-	    E->sphere.cap[(i-1)*3+1].theta[3] = M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+1].theta[4] = M_PI/4.0+offset;
-	    E->sphere.cap[(i-1)*3+1].fi[1] = 0.0;
-	    E->sphere.cap[(i-1)*3+1].fi[2] = (i-1)*M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+1].fi[3] = (i-1)*M_PI/2.0 + M_PI/4.0;
-	    E->sphere.cap[(i-1)*3+1].fi[4] = i*M_PI/2.0;
-
-	    E->sphere.cap[(i-1)*3+2].theta[1] = M_PI/4.0+offset;
-	    E->sphere.cap[(i-1)*3+2].theta[2] = M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].theta[3] = 3*M_PI/4.0-offset;
-	    E->sphere.cap[(i-1)*3+2].theta[4] = M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].fi[1] = i*M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].fi[2] = i*M_PI/2.0 - M_PI/4.0;
-	    E->sphere.cap[(i-1)*3+2].fi[3] = i*M_PI/2.0;
-	    E->sphere.cap[(i-1)*3+2].fi[4] = i*M_PI/2.0 + M_PI/4.0;
-	}
-
-	for (i=1;i<=4;i++)  {
-	    j = (i-1)*3;
-	    if (i==1) j=12;
-	    E->sphere.cap[j].theta[1] = M_PI/2.0;
-	    E->sphere.cap[j].theta[2] = 3*M_PI/4.0-offset;
-	    E->sphere.cap[j].theta[3] = M_PI;
-	    E->sphere.cap[j].theta[4] = 3*M_PI/4.0-offset;
-	    E->sphere.cap[j].fi[1] = (i-1)*M_PI/2.0 + M_PI/4.0;
-	    E->sphere.cap[j].fi[2] = (i-1)*M_PI/2.0;
-	    E->sphere.cap[j].fi[3] = 0.0;
-	    E->sphere.cap[j].fi[4] = i*M_PI/2.0;
-	}
-
-    } else {
-	// regional version
-	E->sphere.caps = 1;
-
-	getScalarProperty(properties, "theta_min", E->control.theta_min, out);
-	getScalarProperty(properties, "theta_max", E->control.theta_max, out);
-	getScalarProperty(properties, "fi_min", E->control.fi_min, out);
-	getScalarProperty(properties, "fi_max", E->control.fi_max, out);
-
-	E->sphere.cap[1].theta[1] = E->control.theta_min;
-	E->sphere.cap[1].theta[2] = E->control.theta_max;
-	E->sphere.cap[1].theta[3] = E->control.theta_max;
-	E->sphere.cap[1].theta[4] = E->control.theta_min;
-	E->sphere.cap[1].fi[1] = E->control.fi_min;
-	E->sphere.cap[1].fi[2] = E->control.fi_min;
-	E->sphere.cap[1].fi[3] = E->control.fi_max;
-	E->sphere.cap[1].fi[4] = E->control.fi_max;
-    }
-
-    getScalarProperty(properties, "ll_max", E->sphere.llmax, out);
-    getScalarProperty(properties, "nlong", E->sphere.noy, out);
-    getScalarProperty(properties, "nlati", E->sphere.nox, out);
-    getScalarProperty(properties, "output_ll_max", E->sphere.output_llmax, out);
-
-    E->mesh.layer[1] = 1;
-    E->mesh.layer[2] = 1;
-    E->mesh.layer[3] = 1;
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_Tracer_set_properties__doc__[] = "";
-char pyCitcom_Tracer_set_properties__name__[] = "Tracer_set_properties";
-
-PyObject * pyCitcom_Tracer_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Tracer_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.tracer]" << std::endl;
-
-    getScalarProperty(properties, "tracer", E->control.tracer, out);
-    getStringProperty(properties, "tracer_file", E->control.tracer_file, out);
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_Visc_set_properties__doc__[] = "";
-char pyCitcom_Visc_set_properties__name__[] = "Visc_set_properties";
-
-PyObject * pyCitcom_Visc_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Visc_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.visc]" << std::endl;
-
-    getStringProperty(properties, "Viscosity", E->viscosity.STRUCTURE, out);
-    if (strcmp(E->viscosity.STRUCTURE,"system") == 0)
-	E->viscosity.FROM_SYSTEM = 1;
-    else
-	E->viscosity.FROM_SYSTEM = 0;
-
-    getScalarProperty(properties, "visc_smooth_method", E->viscosity.smooth_cycles, out);
-    getScalarProperty(properties, "VISC_UPDATE", E->viscosity.update_allowed, out);
-
-    int num_mat;
-    const int max_mat = 40;
-
-    getScalarProperty(properties, "num_mat", num_mat, out);
-    if(num_mat > max_mat) {
-	// max. allowed material types = 40
-	std::cerr << "'num_mat' greater than allowed value, set to "
-		  << max_mat << std::endl;
-	num_mat = max_mat;
-    }
-    E->viscosity.num_mat = num_mat;
-
-    getVectorProperty(properties, "visc0",
-			E->viscosity.N0, num_mat, out);
-
-    getScalarProperty(properties, "TDEPV", E->viscosity.TDEPV, out);
-    getScalarProperty(properties, "rheol", E->viscosity.RHEOL, out);
-    getVectorProperty(properties, "viscE",
-			E->viscosity.E, num_mat, out);
-    getVectorProperty(properties, "viscT",
-			E->viscosity.T, num_mat, out);
-    getVectorProperty(properties, "viscZ",
-			E->viscosity.Z, num_mat, out);
-
-    getScalarProperty(properties, "SDEPV", E->viscosity.SDEPV, out);
-    getScalarProperty(properties, "sdepv_misfit", E->viscosity.sdepv_misfit, out);
-    getVectorProperty(properties, "sdepv_expt",
-			E->viscosity.sdepv_expt, num_mat, out);
-
-    getScalarProperty(properties, "VMIN", E->viscosity.MIN, out);
-    getScalarProperty(properties, "visc_min", E->viscosity.min_value, out);
-
-    getScalarProperty(properties, "VMAX", E->viscosity.MAX, out);
-    getScalarProperty(properties, "visc_max", E->viscosity.max_value, out);
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_Incompressible_set_properties__doc__[] = "";
-char pyCitcom_Incompressible_set_properties__name__[] = "Incompressible_set_properties";
-
-PyObject * pyCitcom_Incompressible_set_properties(PyObject *self, PyObject *args)
-{
-    PyObject *obj, *properties;
-
-    if (!PyArg_ParseTuple(args, "OO:Incompressible_set_properties",
-			  &obj, &properties))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    int m = E->parallel.me;
-    std::ofstream *out = get_output_stream(E->parallel.me, E->control.PID);
-    *out << "[CitcomS.solver.vsolver]" << std::endl;
-
-    getStringProperty(properties, "Solver", E->control.SOLVER_TYPE, out);
-    getScalarProperty(properties, "node_assemble", E->control.NASSEMBLE, out);
-    getScalarProperty(properties, "precond", E->control.precondition, out);
-
-    getScalarProperty(properties, "accuracy", E->control.accuracy, out);
-    getScalarProperty(properties, "tole_compressibility", E->control.tole_comp, out);
-
-    getScalarProperty(properties, "mg_cycle", E->control.mg_cycle, out);
-    getScalarProperty(properties, "down_heavy", E->control.down_heavy, out);
-    getScalarProperty(properties, "up_heavy", E->control.up_heavy, out);
-
-    getScalarProperty(properties, "vlowstep", E->control.v_steps_low, out);
-    getScalarProperty(properties, "vhighstep", E->control.v_steps_high, out);
-    getScalarProperty(properties, "piterations", E->control.p_iterations, out);
-
-    *out << std::endl;
-    out->close();
-    delete out;
-
-    if (PyErr_Occurred())
-	return NULL;
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-
-//==========================================================
-// helper functions
-
-std::ofstream* get_output_stream(int mute, int pid)
-{
-    std::ofstream *out = new std::ofstream;
-
-    if (mute)
-	out->open("/dev/null");
-    else {
-	char filename[255];
-	sprintf(filename, "pid%d.cfg", pid);
-	out->open(filename, std::ios::app);
-    }
-
-    return out;
-}
-
-
-void getStringProperty(PyObject* properties, char* attribute,
-		       char* value, std::ostream* out)
-{
-    *out << attribute << "=";
-
-    if(!PyObject_HasAttrString(properties, attribute)) {
-	char errmsg[255];
-	sprintf(errmsg, "no such attribute: %s", attribute);
-	PyErr_SetString(PyExc_AttributeError, errmsg);
-	return;
-    }
-
-    PyObject* prop = PyObject_GetAttrString(properties, attribute);
-    if(!PyString_Check(prop)) {
-	char errmsg[255];
-	sprintf(errmsg, "'%s' is not a string", attribute);
-	PyErr_SetString(PyExc_TypeError, errmsg);
-	return;
-    }
-
-    strcpy(value, PyString_AsString(prop));
-    *out << value << std::endl;
-
-    return;
-}
-
-
-
-template <class T>
-void getScalarProperty(PyObject* properties, char* attribute,
-		       T& value, std::ostream* out)
-{
-    *out << attribute << "=";
-
-    if(!PyObject_HasAttrString(properties, attribute)) {
-	char errmsg[255];
-	sprintf(errmsg, "no such attribute: %s", attribute);
-	PyErr_SetString(PyExc_AttributeError, errmsg);
-	return;
-    }
-
-    PyObject* prop = PyObject_GetAttrString(properties, attribute);
-    if(!PyNumber_Check(prop)) {
-	char errmsg[255];
-	sprintf(errmsg, "'%s' is not a number", attribute);
-	PyErr_SetString(PyExc_TypeError, errmsg);
-	return;
-    }
-
-    value = static_cast<T>(PyFloat_AsDouble(prop));
-    *out << value << std::endl;
-
-    return;
-}
-
-
-
-template <class T>
-void getVectorProperty(PyObject* properties, char* attribute,
-		       T* vector, const int len, std::ostream* out)
-{
-    *out << attribute << "=";
-
-    if(!PyObject_HasAttrString(properties, attribute)) {
-	char errmsg[255];
-	sprintf(errmsg, "no such attribute: %s", attribute);
-	PyErr_SetString(PyExc_AttributeError, errmsg);
-	return;
-    }
-
-    // is it a sequence?
-    PyObject* prop = PyObject_GetAttrString(properties, attribute);
-    if(!PySequence_Check(prop)) {
-	char errmsg[255];
-	sprintf(errmsg, "'%s' is not a sequence", attribute);
-	PyErr_SetString(PyExc_TypeError, errmsg);
-	return;
-    }
-
-    // is it of length len?
-    int n = PySequence_Size(prop);
-    if(n < len) {
-	char errmsg[255];
-	sprintf(errmsg, "length of '%s' < %d", attribute, len);
-	PyErr_SetString(PyExc_IndexError, errmsg);
-	return;
-    } else if (n > len) {
-	char warnmsg[255];
-	sprintf(warnmsg, "WARNING: length of '%s' > %d", attribute, len);
-	*out << warnmsg << std::endl;
-    }
-
-    for (int i=0; i<len; i++) {
-	PyObject* item = PySequence_GetItem(prop, i);
-	if(!item) {
-	    char errmsg[255];
-	    sprintf(errmsg, "can't get %s[%d]", attribute, i);
-	    PyErr_SetString(PyExc_IndexError, errmsg);
-	    return;
-	}
-
-	if(PyNumber_Check(item)) {
-	    vector[i] = static_cast<T>(PyFloat_AsDouble(item));
-	} else {
-	    char errmsg[255];
-	    sprintf(errmsg, "'%s[%d]' is not a number ", attribute, i);
-	    PyErr_SetString(PyExc_TypeError, errmsg);
-	    return;
-	}
-	*out << vector[i] << ",";
-    }
-    *out << std::endl;
-
-    return;
-}
-
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/setProperties.h
===================================================================
--- mc/3D/CitcomS/trunk/module/setProperties.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/setProperties.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,7 +23,7 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 
 #if !defined(pyCitcom_setProperties_h)
@@ -81,7 +80,6 @@
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Copied: mc/3D/CitcomS/trunk/module/stokes_solver.c (from rev 4749, mc/3D/CitcomS/trunk/module/stokes_solver.cc)
===================================================================
--- mc/3D/CitcomS/trunk/module/stokes_solver.cc	2006-10-09 12:12:10 UTC (rev 4749)
+++ mc/3D/CitcomS/trunk/module/stokes_solver.c	2006-10-12 14:48:43 UTC (rev 4957)
@@ -0,0 +1,291 @@
+/*
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+//<LicenseText>
+//
+// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+// Copyright (C) 2002-2005, California Institute of Technology.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+//
+//</LicenseText>
+//
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*/
+
+#include <portinfo>
+#include <Python.h>
+
+
+#include "exceptions.h"
+#include "stokes_solver.h"
+
+#include "global_defs.h"
+#include "drive_solvers.h"
+
+
+void assemble_forces(struct All_variables*, int);
+void construct_stiffness_B_matrix(struct All_variables*);
+void general_stokes_solver(struct All_variables *);
+void general_stokes_solver_setup(struct All_variables*);
+void get_system_viscosity(struct All_variables*, int, float**, float**);
+void set_cg_defaults(struct All_variables*);
+void set_mg_defaults(struct All_variables*);
+void solve_constrained_flow_iterative(struct All_variables*);
+
+void assemble_forces_pseudo_surf(struct All_variables*, int);
+void general_stokes_solver_pseudo_surf(struct All_variables *);
+void solve_constrained_flow_iterative_pseudo_surf(struct All_variables*);
+
+
+
+char pyCitcom_assemble_forces__doc__[] = "";
+char pyCitcom_assemble_forces__name__[] = "assemble_forces";
+
+PyObject * pyCitcom_assemble_forces(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:assemble_forces", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    assemble_forces(E,0);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_assemble_forces_pseudo_surf__doc__[] = "";
+char pyCitcom_assemble_forces_pseudo_surf__name__[] = "assemble_forces_pseudo_surf";
+
+PyObject * pyCitcom_assemble_forces_pseudo_surf(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:assemble_forces_pseudo_surf", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    assemble_forces_pseudo_surf(E,0);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_construct_stiffness_B_matrix__doc__[] = "";
+char pyCitcom_construct_stiffness_B_matrix__name__[] = "construct_stiffness_B_matrix";
+
+PyObject * pyCitcom_construct_stiffness_B_matrix(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:construct_stiffness_B_matrix", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    construct_stiffness_B_matrix(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_general_stokes_solver__doc__[] = "";
+char pyCitcom_general_stokes_solver__name__[] = "general_stokes_solver";
+
+PyObject * pyCitcom_general_stokes_solver(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:general_stokes_solver", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    if(E->control.pseudo_free_surf)
+	    if(E->mesh.topvbc==2)
+		    general_stokes_solver_pseudo_surf(E);
+	    else
+		    assert(0);
+    else
+	    general_stokes_solver(E);
+
+
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+char pyCitcom_general_stokes_solver_setup__doc__[] = "";
+char pyCitcom_general_stokes_solver_setup__name__[] = "general_stokes_solver_setup";
+
+PyObject * pyCitcom_general_stokes_solver_setup(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:general_stokes_solver_setup", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    general_stokes_solver_setup(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_get_system_viscosity__doc__[] = "";
+char pyCitcom_get_system_viscosity__name__[] = "get_system_viscosity";
+
+PyObject * pyCitcom_get_system_viscosity(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:get_system_viscosity", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    get_system_viscosity(E,1,E->EVI[E->mesh.levmax],E->VI[E->mesh.levmax]);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_set_cg_defaults__doc__[] = "";
+char pyCitcom_set_cg_defaults__name__[] = "set_cg_defaults";
+
+PyObject * pyCitcom_set_cg_defaults(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:set_cg_defaults", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    E->control.CONJ_GRAD = 1;
+    set_cg_defaults(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_set_mg_defaults__doc__[] = "";
+char pyCitcom_set_mg_defaults__name__[] = "set_mg_defaults";
+
+PyObject * pyCitcom_set_mg_defaults(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:set_mg_defaults", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    E->control.NMULTIGRID = 1;
+    set_mg_defaults(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_set_mg_el_defaults__doc__[] = "";
+char pyCitcom_set_mg_el_defaults__name__[] = "set_mg_el_defaults";
+
+PyObject * pyCitcom_set_mg_el_defaults(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:set_mg_el_defaults", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    E->control.EMULTIGRID = 1;
+    set_mg_defaults(E);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+
+
+char pyCitcom_solve_constrained_flow_iterative__doc__[] = "";
+char pyCitcom_solve_constrained_flow_iterative__name__[] = "solve_constrained_flow_iterative";
+
+PyObject * pyCitcom_solve_constrained_flow_iterative(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:solve_constrained_flow_iterative", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    solve_constrained_flow_iterative(E);
+
+    return Py_BuildValue("d", E->viscosity.sdepv_misfit);
+}
+
+
+char pyCitcom_solve_constrained_flow_iterative_pseudo_surf__doc__[] = "";
+char pyCitcom_solve_constrained_flow_iterative_pseudo_surf__name__[] = "solve_constrained_flow_iterative_pseudo_surf";
+
+PyObject * pyCitcom_solve_constrained_flow_iterative_pseudo_surf(PyObject *self, PyObject *args)
+{
+    PyObject *obj;
+    struct All_variables* E;
+
+    if (!PyArg_ParseTuple(args, "O:solve_constrained_flow_iterative_pseudo_surf", &obj))
+        return NULL;
+
+    E = (struct All_variables*)(PyCObject_AsVoidPtr(obj));
+
+    solve_constrained_flow_iterative_pseudo_surf(E);
+
+    return Py_BuildValue("d", E->viscosity.sdepv_misfit);
+}
+
+
+/* $Id$ */
+
+/* End of file */

Deleted: mc/3D/CitcomS/trunk/module/stokes_solver.cc
===================================================================
--- mc/3D/CitcomS/trunk/module/stokes_solver.cc	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/stokes_solver.cc	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,283 +0,0 @@
-// -*- C++ -*-
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-
-#include <portinfo>
-#include <Python.h>
-
-
-#include "exceptions.h"
-#include "stokes_solver.h"
-
-#include "global_defs.h"
-#include "drive_solvers.h"
-
-extern "C" {
-
-    void assemble_forces(struct All_variables*, int);
-    void construct_stiffness_B_matrix(struct All_variables*);
-    void general_stokes_solver(struct All_variables *);
-    void general_stokes_solver_setup(struct All_variables*);
-    void get_system_viscosity(struct All_variables*, int, float**, float**);
-    void set_cg_defaults(struct All_variables*);
-    void set_mg_defaults(struct All_variables*);
-    void solve_constrained_flow_iterative(struct All_variables*);
-
-    void assemble_forces_pseudo_surf(struct All_variables*, int);
-    void general_stokes_solver_pseudo_surf(struct All_variables *);
-    void solve_constrained_flow_iterative_pseudo_surf(struct All_variables*);
-}
-
-
-
-char pyCitcom_assemble_forces__doc__[] = "";
-char pyCitcom_assemble_forces__name__[] = "assemble_forces";
-
-PyObject * pyCitcom_assemble_forces(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:assemble_forces", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    assemble_forces(E,0);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_assemble_forces_pseudo_surf__doc__[] = "";
-char pyCitcom_assemble_forces_pseudo_surf__name__[] = "assemble_forces_pseudo_surf";
-
-PyObject * pyCitcom_assemble_forces_pseudo_surf(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:assemble_forces_pseudo_surf", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    assemble_forces_pseudo_surf(E,0);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_construct_stiffness_B_matrix__doc__[] = "";
-char pyCitcom_construct_stiffness_B_matrix__name__[] = "construct_stiffness_B_matrix";
-
-PyObject * pyCitcom_construct_stiffness_B_matrix(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:construct_stiffness_B_matrix", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    construct_stiffness_B_matrix(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_general_stokes_solver__doc__[] = "";
-char pyCitcom_general_stokes_solver__name__[] = "general_stokes_solver";
-
-PyObject * pyCitcom_general_stokes_solver(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:general_stokes_solver", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    if(E->control.pseudo_free_surf)
-	    if(E->mesh.topvbc==2)
-		    general_stokes_solver_pseudo_surf(E);
-	    else
-		    assert(0);
-    else
-	    general_stokes_solver(E);
-
-
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-char pyCitcom_general_stokes_solver_setup__doc__[] = "";
-char pyCitcom_general_stokes_solver_setup__name__[] = "general_stokes_solver_setup";
-
-PyObject * pyCitcom_general_stokes_solver_setup(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:general_stokes_solver_setup", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    general_stokes_solver_setup(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_get_system_viscosity__doc__[] = "";
-char pyCitcom_get_system_viscosity__name__[] = "get_system_viscosity";
-
-PyObject * pyCitcom_get_system_viscosity(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:get_system_viscosity", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    get_system_viscosity(E,1,E->EVI[E->mesh.levmax],E->VI[E->mesh.levmax]);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_set_cg_defaults__doc__[] = "";
-char pyCitcom_set_cg_defaults__name__[] = "set_cg_defaults";
-
-PyObject * pyCitcom_set_cg_defaults(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:set_cg_defaults", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    E->control.CONJ_GRAD = 1;
-    set_cg_defaults(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_set_mg_defaults__doc__[] = "";
-char pyCitcom_set_mg_defaults__name__[] = "set_mg_defaults";
-
-PyObject * pyCitcom_set_mg_defaults(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:set_mg_defaults", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    E->control.NMULTIGRID = 1;
-    set_mg_defaults(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_set_mg_el_defaults__doc__[] = "";
-char pyCitcom_set_mg_el_defaults__name__[] = "set_mg_el_defaults";
-
-PyObject * pyCitcom_set_mg_el_defaults(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:set_mg_el_defaults", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    E->control.EMULTIGRID = 1;
-    set_mg_defaults(E);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-
-
-char pyCitcom_solve_constrained_flow_iterative__doc__[] = "";
-char pyCitcom_solve_constrained_flow_iterative__name__[] = "solve_constrained_flow_iterative";
-
-PyObject * pyCitcom_solve_constrained_flow_iterative(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:solve_constrained_flow_iterative", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    solve_constrained_flow_iterative(E);
-
-    return Py_BuildValue("d", E->viscosity.sdepv_misfit);
-}
-
-
-char pyCitcom_solve_constrained_flow_iterative_pseudo_surf__doc__[] = "";
-char pyCitcom_solve_constrained_flow_iterative_pseudo_surf__name__[] = "solve_constrained_flow_iterative_pseudo_surf";
-
-PyObject * pyCitcom_solve_constrained_flow_iterative_pseudo_surf(PyObject *self, PyObject *args)
-{
-    PyObject *obj;
-
-    if (!PyArg_ParseTuple(args, "O:solve_constrained_flow_iterative_pseudo_surf", &obj))
-        return NULL;
-
-    struct All_variables* E = static_cast<struct All_variables*>(PyCObject_AsVoidPtr(obj));
-
-    solve_constrained_flow_iterative_pseudo_surf(E);
-
-    return Py_BuildValue("d", E->viscosity.sdepv_misfit);
-}
-
-// version
-// $Id$
-
-// End of file

Modified: mc/3D/CitcomS/trunk/module/stokes_solver.h
===================================================================
--- mc/3D/CitcomS/trunk/module/stokes_solver.h	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/module/stokes_solver.h	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,5 +1,4 @@
-// -*- C++ -*-
-//
+/*
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
 //<LicenseText>
@@ -24,79 +23,67 @@
 //</LicenseText>
 //
 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
+*/
 
 #if !defined(pyCitcom_stokes_solver_h)
 #define pyCitcom_stokes_solver_h
 
 extern char pyCitcom_assemble_forces__name__[];
 extern char pyCitcom_assemble_forces__doc__[];
-extern "C"
 PyObject * pyCitcom_assemble_forces(PyObject *, PyObject *);
 
 
 extern char pyCitcom_assemble_forces_pseudo_surf__name__[];
 extern char pyCitcom_assemble_forces_pseudo_surf__doc__[];
-extern "C"
 PyObject * pyCitcom_assemble_forces_pseudo_surf(PyObject *, PyObject *);
 
 
 extern char pyCitcom_construct_stiffness_B_matrix__name__[];
 extern char pyCitcom_construct_stiffness_B_matrix__doc__[];
-extern "C"
 PyObject * pyCitcom_construct_stiffness_B_matrix(PyObject *, PyObject *);
 
 
 extern char pyCitcom_general_stokes_solver__name__[];
 extern char pyCitcom_general_stokes_solver__doc__[];
-extern "C"
 PyObject * pyCitcom_general_stokes_solver(PyObject *, PyObject *);
 
 
 extern char pyCitcom_general_stokes_solver_setup__name__[];
 extern char pyCitcom_general_stokes_solver_setup__doc__[];
-extern "C"
 PyObject * pyCitcom_general_stokes_solver_setup(PyObject *, PyObject *);
 
 
 extern char pyCitcom_get_system_viscosity__name__[];
 extern char pyCitcom_get_system_viscosity__doc__[];
-extern "C"
 PyObject * pyCitcom_get_system_viscosity(PyObject *, PyObject *);
 
 
 extern char pyCitcom_set_cg_defaults__name__[];
 extern char pyCitcom_set_cg_defaults__doc__[];
-extern "C"
 PyObject * pyCitcom_set_cg_defaults(PyObject *, PyObject *);
 
 
 extern char pyCitcom_set_mg_defaults__name__[];
 extern char pyCitcom_set_mg_defaults__doc__[];
-extern "C"
 PyObject * pyCitcom_set_mg_defaults(PyObject *, PyObject *);
 
 
 extern char pyCitcom_set_mg_el_defaults__name__[];
 extern char pyCitcom_set_mg_el_defaults__doc__[];
-extern "C"
 PyObject * pyCitcom_set_mg_el_defaults(PyObject *, PyObject *);
 
 
 extern char pyCitcom_solve_constrained_flow_iterative__name__[];
 extern char pyCitcom_solve_constrained_flow_iterative__doc__[];
-extern "C"
 PyObject * pyCitcom_solve_constrained_flow_iterative(PyObject *, PyObject *);
 
 
 extern char pyCitcom_solve_constrained_flow_iterative_pseudo_surf__name__[];
 extern char pyCitcom_solve_constrained_flow_iterative_pseudo_surf__doc__[];
-extern "C"
 PyObject * pyCitcom_solve_constrained_flow_iterative_pseudo_surf(PyObject *, PyObject *);
 
 #endif
 
-// version
-// $Id$
+/* $Id$ */
 
-// End of file
+/* End of file */

Modified: mc/3D/CitcomS/trunk/setup.py
===================================================================
--- mc/3D/CitcomS/trunk/setup.py	2006-10-12 13:20:00 UTC (rev 4956)
+++ mc/3D/CitcomS/trunk/setup.py	2006-10-12 14:48:43 UTC (rev 4957)
@@ -1,32 +1,33 @@
 
-# This is not a normal 'setup.py' script; it is provided as a
-# convenience to install Python packages required by CitcomS.  For
-# instructions on installing CitcomS itself, see the file INSTALL.
+from ez_setup import use_setuptools
+use_setuptools()
 
-try:
-    # If setuptools 0.6b1 or later is installed, run with it.
-    from pkg_resources import require
-    require("setuptools>=0.6b1")
-except:
-    from ez_setup import use_setuptools
-    use_setuptools()
+from setuptools import setup, find_packages
 
-import setuptools
-import sys
+setup(
+    
+    name = 'CitcomS', 
+    version = '2.1',
 
-requirements = []
+    zip_safe = False,
+    packages = find_packages(),
+    
+    #setup_requires = [
+    #'merlin',
+    #],
+    install_requires = [
+    'pythia[pyre,mpi] >= 0.8.1.0b2, < 0.8-2.0a, == dev',
+    ],
+    extras_require = {
+    'Exchanger': ['Exchanger >= 1.0, < 2.0a'],
+    },
 
-if setuptools.bootstrap_install_from:
-    requirements.append(setuptools.bootstrap_install_from)
-    setuptools.bootstrap_install_from = None
+    author = 'Louis Moresi, et al.',
+    author_email = 'cig-mc at geodynamics.org',
+    description = """A finite element mantle convection code.""",
+    long_description = """CitcomS is a finite element code designed to solve thermal convection problems relevant to Earth's mantle. Written in C, the code runs on a variety of parallel processing computers, including shared and distributed memory platforms.""",
+    license = 'GPL',
+    url = 'http://www.geodynamics.org/cig/software/packages/citcoms/',
+    download_url = 'http://crust.geodynamics.org/~leif/shipping/', # temporary
 
-requirements.append('pythia >= 0.8-1.0b1, < 0.8-2.0a')
-
-setuptools.setup(
-    script_args = (
-    ['easy_install',
-     '--find-links=http://www.geodynamics.org/cig/software/packages/Eggs/'] +
-    sys.argv[1:] +
-    requirements
-    )
 )



More information about the cig-commits mailing list