Source code for pycif.plugins.models.lmdz_old.ini_periods

from ....utils.dates import date_range


[docs] def ini_periods(self, **kwargs): datei = self.datei datef = self.datef # List of sub-simulation windows self.subsimu_dates = date_range(datei, datef, period=self.periods) # Dynamical and physical time step for LMDZ dstep = self.domain.dsplit pstep = self.domain.psplit # Initializes offtstep from meteo if not hasattr(self.meteo, "offtstep"): self.meteo.read("", "", self.subsimu_dates, self.meteo.dir, "") offtstep = self.meteo.offtstep # Time steps per day freq = "{:.0f}s".format(offtstep // min([dstep, pstep])) # List of time steps self.tstep_dates = { ddi: date_range(ddi, ddf, period=freq) for ddi, ddf in zip(self.subsimu_dates[:-1], self.subsimu_dates[1:]) } # List of input dates # TODO: make the date inputs flexible (daily so far) self.input_dates = { ddi: date_range(ddi, ddf, period="1D") for ddi, ddf in zip(self.subsimu_dates[:-1], self.subsimu_dates[1:]) } self.flx_input_dates = { ddi: date_range(ddi, ddf, period=self.flx_tresol) for ddi, ddf in zip(self.subsimu_dates[:-1], self.subsimu_dates[1:]) } self.meteo_dates = { ddi: date_range(ddi, ddf, period="3h") for ddi, ddf in zip(self.subsimu_dates[:-1], self.subsimu_dates[1:]) } # Merged list of time steps self.tstep_all = date_range(datei, datef, period=self.periods, subperiod=freq) # Initializes dictionary to keep in memory whether observations were # already dumped for a given period self.iniobs = {ddi: False for ddi in self.subsimu_dates} self.reset_obs = {ddi: True for ddi in self.subsimu_dates} self.nbobs_prior = {ddi: 0 for ddi in self.subsimu_dates} self.nbdatatot_prior = {ddi: 0 for ddi in self.subsimu_dates} # Run model or approximation with fake_end self.runsimu = {ddi: True for ddi in self.subsimu_dates} # Keep in memory whether a given period has a successor period # The info is used by the adjoint to fetch or not the restart file self.chain = {ddi: True for ddi in self.subsimu_dates[:-1]} self.chain[self.subsimu_dates[-2]] = False