# Path: polyadcirc/pyADCIRC/basic.py
# class comm_for_no_mpi4py(object):
# class MPI_for_no_mpi4py(object):
# class pickleable(object):
# class location(pickleable):
# class node(location):
# class time(pickleable):
#     def __init__(self):
#     def Get_size(self):
#     def Get_rank(self):
#     def allgather(self, val):
#     def allreduce(self, val1, op=None):
#     def bcast(self, val, root=0):
#     def __init__(self):
#     def __init__(self):
#     def __getstate__(self):
#     def __setstate__(self, dict):
#     def __init__(self, x, y):
#     def __init__(self, x, y, bathymetry):
#     def __init__(self, dt, statim, rnday, dramp):
#     MPI = MPI_for_no_mpi4py()


import glob, os, sys, subprocess, re, math 
import numpy as np
import scipy.io as sio
import py.gensub as gensub 
import polyadcirc.run_framework.domain as dom
import polyadcirc.pyADCIRC.fort15_management as f15
import polyadcirc.pyADCIRC.fort13_management as f13
import polyadcirc.pyADCIRC.output as output
import polyadcirc.run_framework.random_manningsn as rmn
import polyadcirc.pyADCIRC.post_management as post
import polyadcirc.pyGriddata.file_management as fm
from polyadcirc.pyADCIRC.basic import comm
        :type file_name: string
        :param file_name: the name of the ``fort.13`` formatted file

        """
        data = self.set_bv_fort13(data)
        f13.update_mann(data, path, default, file_name)


def trim_fort13(old_fort13, new_fort13, pynode_map):
    """
    Trim ``old_fort13`` to match the nodes in this subdomain and save as
    ``new_fort13``. This only assumes that a ``py.140`` file exists.

    :param string old_fort13: path to the old ``fort.13`` file to be
        trimmed
    :param string new_fort13: path to save the new ``fort.13`` file
    """
    print pynode_map
    gensub.main13(None, old_fort13, new_fort13, pynode_map)

def trim_multiple_fort13(old_fort13, new_fort13, pynode_map):
    """
    Trim ``old_fort13`` to match the nodes in this subdomain and save as
    ``new_fort13``. This only assumes that a ``py.140`` file exists.

    :param string old_fort13: path to the old ``fort.13`` file to be
        trimmed
    :param string new_fort13: path to save the new ``fort.13`` file
    """
    size = comm.Get_size()

# Path: polyadcirc/pyADCIRC/basic.py
# class comm_for_no_mpi4py(object):
# class MPI_for_no_mpi4py(object):
# class pickleable(object):
# class location(pickleable):
# class node(location):
# class time(pickleable):
#     def __init__(self):
#     def Get_size(self):
#     def Get_rank(self):
#     def allgather(self, val):
#     def allreduce(self, val1, op=None):
#     def bcast(self, val, root=0):
#     def __init__(self):
#     def __init__(self):
#     def __getstate__(self):
#     def __setstate__(self, dict):
#     def __init__(self, x, y):
#     def __init__(self, x, y, bathymetry):
#     def __init__(self, dt, statim, rnday, dramp):
#     MPI = MPI_for_no_mpi4py()


# Path: polyadcirc/run_framework/subdomain.py
import glob, os, sys, subprocess, re, math 
import numpy as np
import scipy.io as sio
import py.gensub as gensub 
import polyadcirc.run_framework.domain as dom
import polyadcirc.pyADCIRC.fort15_management as f15
import polyadcirc.pyADCIRC.fort13_management as f13
import polyadcirc.pyADCIRC.output as output
import polyadcirc.run_framework.random_manningsn as rmn
import polyadcirc.pyADCIRC.post_management as post
import polyadcirc.pyGriddata.file_management as fm
from polyadcirc.pyADCIRC.basic import comm

        :type file_name: string
        :param file_name: the name of the ``fort.13`` formatted file

        """
        data = self.set_bv_fort13(data)
        f13.update_mann(data, path, default, file_name)


def trim_fort13(old_fort13, new_fort13, pynode_map):
    """
    Trim ``old_fort13`` to match the nodes in this subdomain and save as
    ``new_fort13``. This only assumes that a ``py.140`` file exists.

    :param string old_fort13: path to the old ``fort.13`` file to be
        trimmed
    :param string new_fort13: path to save the new ``fort.13`` file
    """
    print pynode_map
    gensub.main13(None, old_fort13, new_fort13, pynode_map)

def trim_multiple_fort13(old_fort13, new_fort13, pynode_map):
    """
    Trim ``old_fort13`` to match the nodes in this subdomain and save as
    ``new_fort13``. This only assumes that a ``py.140`` file exists.

    :param string old_fort13: path to the old ``fort.13`` file to be
        trimmed
    :param string new_fort13: path to save the new ``fort.13`` file
    """
    size = comm.Get_size()

    rank = comm.Get_rank()