Пример #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)
Пример #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
Пример #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)
Пример #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)
Пример #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)
Пример #6
0
 def __init__(self, **options):
     CommonCode.__init__(self,  DistributedAmuseInterface(**options), **options)
Пример #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)
Пример #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)
Пример #9
0
    def __init__(self, unit_converter=None, **options):
        self.unit_converter = unit_converter

        CommonCode.__init__(self, KeplerInterface(**options), **options)
Пример #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)
Пример #11
0
    def __init__(self, unit_converter = None,  **options):
        self.unit_converter = unit_converter

        CommonCode.__init__(self,
                               KeplerInterface(**options),
                               **options)
Пример #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)
Пример #13
0
 def __init__(self, **options):
     CommonCode.__init__(self, CDOInterface(**options), **options)
Пример #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)
Пример #15
0
 def __init__(self, **options):
     CommonCode.__init__(self,  DistributedAmuseInterface(**options), **options)