Exemplo n.º 1
0
 def __init__(self, mode=MODE_2D, coordinates="cartesian", **options):
     self.mode = mode
     self.coordinates = coordinates
     CommonCode.__init__(self, AdcircInterface(**options), **options)
     self._nodes = None
     self._elements = None
     self._elev_boundary = None
     self._flow_boundary = None
     self._parameters = None
     self.stopping_conditions = StoppingConditions(self)
Exemplo n.º 2
0
 def __init__(self,
              mode=POPInterface.MODE_NORMAL,
              namelist_file="pop_in",
              **options):
     self._nml_file = namelist_file
     self.nprocs = options.setdefault('number_of_workers', 8)
     CodeWithNamelistParameters.__init__(self,
                                         options.get("parameters", dict()))
     CommonCode.__init__(self, POPInterface(mode=mode, **options),
                         **options)
     self.parameters.namelist_file = self._nml_file
Exemplo n.º 3
0
    def __init__(self, **options):
        #print('__init__')

        self.stopping_conditions = StoppingConditions(self)
        self.itot = 0
        self.ktot = 0
        self.latitudes = None
        self.longitudes = None
        self.exp_name = 'TEST'

        CommonCode.__init__(self, OpenIFSInterface(**options), **options)

        #if workdir is given, assume inputfile, backupfile are relative to workdir
        #TODO should store the changed file names - they are used in cleanup_code
        inputfile = OpenIFS.inputfile
        backupfile = OpenIFS.backupfile
        if 'workdir' in options:
            # print('OpenIFS.__init__() : setting workdir.')
            self.set_workdir(options['workdir'])
            inputfile = os.path.join(options['workdir'], inputfile)
            backupfile = os.path.join(options['workdir'], backupfile)

        if not os.path.exists(inputfile):
            print('inputfile:' + inputfile)
            print('cwd:' + os.getcwd())
            raise Exception(
                "File fort.4 not found. Creating an openIFS model from scratch is not supported yet."
            )
        else:
            os.rename(inputfile, backupfile)
            self.params = f90nml.read(backupfile)
            self.patch = {
                "NAMPAR0": {
                    "NPROC": options.get("number_of_workers", 1)
                }
            }

            restart_steps = options.get("restart_steps", None)
            if restart_steps:
                self.patch["NAMRES"] = {"NFRRES": restart_steps}

            f90nml.patch(backupfile, self.patch, inputfile)
            print('Done patching openIFS input file', inputfile)
Exemplo n.º 4
0
    def __init__(self, unit_converter=None, **options):
        self.unit_converter = unit_converter
        self.stopping_conditions = StoppingConditions(self)

        CommonCode.__init__(self, CapreoleInterface(**options), **options)
Exemplo n.º 5
0
 def __init__(self, unit_converter = None,  **options):
    self.unit_converter = unit_converter
    legacy_interface = BarAndSpiralsInterface(**options)
    self.interface_doc = legacy_interface.__doc__
    CommonCode.__init__(self, legacy_interface, **options)
Exemplo n.º 6
0
 def __init__(self, **options):
     CommonCode.__init__(self,  DistributedAmuseInterface(**options), **options)
Exemplo n.º 7
0
 def __init__(self, unit_converter=None, **options):
     self.unit_converter = unit_converter
     legacy_interface = FastKickInterface(**options)
     self.legacy_doc = legacy_interface.__doc__
     CommonCode.__init__(self, legacy_interface, **options)
Exemplo n.º 8
0
 def __init__(self, unit_converter = None, **options):
     self.unit_converter = unit_converter
     self.stopping_conditions = StoppingConditions(self)
     
     CommonCode.__init__(self,  CapreoleInterface(**options), **options)
Exemplo n.º 9
0
    def __init__(self, unit_converter=None, **options):
        self.unit_converter = unit_converter

        CommonCode.__init__(self, KeplerInterface(**options), **options)
Exemplo n.º 10
0
 def __init__(self, unit_converter = None,  **options):
    self.unit_converter = unit_converter
    legacy_interface = BarAndSpiralsInterface(**options)
    self.interface_doc = legacy_interface.__doc__
    CommonCode.__init__(self, legacy_interface, **options)
Exemplo n.º 11
0
    def __init__(self, unit_converter = None,  **options):
        self.unit_converter = unit_converter

        CommonCode.__init__(self,
                               KeplerInterface(**options),
                               **options)
Exemplo n.º 12
0
 def __init__(self, mode=POPInterface.MODE_NORMAL, **options):
     self.nprocs = options.setdefault('number_of_workers', 8)
     CommonCode.__init__(self, POPInterface(mode=mode, **options),
                         **options)
Exemplo n.º 13
0
 def __init__(self, **options):
     CommonCode.__init__(self, CDOInterface(**options), **options)
Exemplo n.º 14
0
 def __init__(self, unit_converter = None, **options):
     self.unit_converter = unit_converter
     legacy_interface = FastKickInterface(**options)
     self.legacy_doc = legacy_interface.__doc__
     CommonCode.__init__(self, legacy_interface, **options)
Exemplo n.º 15
0
 def __init__(self, **options):
     CommonCode.__init__(self,  DistributedAmuseInterface(**options), **options)