Skip to content
Snippets Groups Projects
Commit 0a7146f6 authored by karolina's avatar karolina
Browse files

minor changes Friday 1st Feb

parent 44c27ad1
No related branches found
No related tags found
No related merge requests found
......@@ -367,7 +367,7 @@ class TM5ObservationOperator(ObservationOperator):
raise IOError
#LU kopiujemy tm5-owe restarty , chociaz w sumie juz je skopiowalismy wczesniej
def get_initial_data(self): #LU tylko dir.restrt.curret jkao miejsce z ktorego zbiore pliki typu "tm5_restart"
def get_initial_data(self, sourcedir): #LU tylko dir.restrt.curret jkao miejsce z ktorego zbiore pliki typu "tm5_restart"
""" This method places all initial data needed by an ObservationOperator in the proper folder for the model.
For TM5, this means copying the save_*.hdf* files to the dir.save directory from which TM5 will read initial
concentrations for all tracers.
......@@ -382,7 +382,7 @@ class TM5ObservationOperator(ObservationOperator):
# First get the restart data for TM5 from the current restart dir of the filter
sourcedir = self.DaCycle['dir.restart.current']
# sourcedir = self.DaCycle['dir.restart.current']
targetdir = self.tm_settings[self.savedirkey]
self.outputdir = self.tm_settings[self.outputdirkey] #IV test
......
......@@ -69,16 +69,15 @@ def prepare_state(DaCycle, StateVector, newrc):
StateVector.Initialize(newrc) #LU w prepare state inicjalizujemy wektor stanu ktoremu dopiero co przypisalismy wartosci.
#LU to jest zalezne od cyklu, i cykl pojedynczy moze miec time.restart lub moze nie miec.
if not DaCycle['time.restart']: #LU jesli jest to pierwszy cykl
if not DaCycle['time.restart']:
# Fill each week from n=1 to n=nlag with a new ensemble
nlag = StateVector.nlag #LU dla kazdego od zera do dlugosc(cykl) wyznaczamy date oraz znajdujemy kowariancje i robimy nowa ensemble.
for n in range(0, nlag):
for n in range(StateVector.nlag):
date = DaCycle['time.start'] + datetime.timedelta(days=(n + 0.5) * int(DaCycle['time.cycle']))
#LU ta data jest tutaj potrzebna tylko do znalezienia odpowiedniego pliku z kowariancja.
svparams = {k: newrc[k] for k in ('ocn.covariance', 'bio.covariance')}
cov = StateVector.get_covariance(date, svparams) #LU to mozna zrobic w srodku, bo przeciez nie potrzebna mu ta kowariancja a z drugiej strony zawsze potrzebuje kowariancji zeby stworzyc nowa ensemble
cov = StateVector.get_covariance(date, svparams) #LU to mozna zrobic w srodku, bo przeciez nie potrzebna tu ta kowariancja a z drugiej strony zawsze potrzebuje kowariancji zeby stworzyc nowa ensemble
StateVector.make_new_ensemble(n + 1, cov)
else:
......@@ -117,7 +116,7 @@ def sample_state(DaCycle, Samples, StateVector, ObservationOperator, newrc):
# If we are going to sample the lag = 0 time step, place the needed files to run the transport model in the right folder first
if lag == 0: #LU w pierwszym tygodniu danego cyklu bierzemy initial data dla tm5, tzn jakies pewnie ustawienia. dokladnie: restart files z poprzednich
ObservationOperator.get_initial_data()
ObservationOperator.get_initial_data(DaCycle['dir.restart.current'])
############# Perform the actual sampling loop #####################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment