def _initializePerturb(self, basin, forcings, vicexe, initdays=90, saveindb=False, saveto="db", saveargs=[], overwrite=True, skipsave=0):
        statefiles = []
        t = date(self.startyear, self.startmonth, self.startday) - \
            relativedelta(days=initdays)
        modelpath = tempfile.mkdtemp()
        model = vic.VIC(modelpath, self.dbname, self.res, t.year, t.month,
                        t.day, self.startyear, self.startmonth, self.startday, self.name)
        prec, tmax, tmin, wind = model.getForcings(forcings)
        eprec, etmax, etmin, ewind = self.perturb(prec, tmax, tmin, wind)
        pmodels = []
        for e in range(self.nens):
            modelpath = tempfile.mkdtemp()
            model = vic.VIC(modelpath, self.dbname, self.res, t.year, t.month,
                            t.day, self.startyear, self.startmonth, self.startday, self.name)
            model.writeParamFile(save_state=modelpath, init_state=False)
            model.writeSoilFile(basin)
            model.writeForcings(eprec[e], etmax[e], etmin[e], ewind[e])
            pmodels.append(model)
        procs = [Process(target=pmodels[e].run, args=(vicexe,))
                 for e in range(self.nens)]
        for p in procs:
            p.start()
        for p in procs:
            p.join()
        if saveindb:
            if skipsave < 0:
                skipdays = (date(self.startyear, self.startmonth,
                                 self.startday) - t).days + 1 + skipsave
            else:
                skipdays = skipsave
            init = overwrite
            for e in range(len(pmodels)):
                model = pmodels[e]
                if getattr(model.writeToDB, 'func_name') is not 'write_wrapper':
                    model.writeToDB = self._ensembleTable(
                        model.writeToDB, e + 1)
                if e > 0:
                    init = False
                model.save(saveto, saveargs, init, skipsave=skipdays)
        for e in range(self.nens):
            statefile = pmodels[e].model_path + "/vic.state_{0:04d}{1:02d}{2:02d}".format(
                self.startyear, self.startmonth, self.startday)
            statefiles.append(statefile)
        return statefiles
Initialize ensemble of VIC models by perturbing the meterological forcings
dataset/ETHPy150Open nasa/RHEAS/src/ensemble.py/Ensemble._initializePerturb