Commit 865c7b2b authored by Antoine Berchet's avatar Antoine Berchet
Browse files

Fix LMDZ

parent 1f3bd7f6
......@@ -41,9 +41,6 @@ def make_obs(self, ddi, datastore, runsubdir, mode, tracer):
maindata.loc[:, [col2extract]].values,
metadata.loc[:, ["level"]].values],
axis=1)
print(__file__)
import code
code.interact(local=dict(locals(), **globals()))
# Converts level, tstep, i, j to fortran levels
data[:, [0, 2, 3, 5]] += 1
......
......@@ -30,33 +30,33 @@ def read_sim(self, data2dump, runsubdir, mode, ddi, ddf):
ind_spec = self.chemistry.acspecies.attributes.index(spec) + 1
mask = np.floor(obs[:, -1]) == ind_spec
sim = sim[mask]
dataloc.loc[:, "spec"] = sim[:, 0]
dataloc["pressure"] = sim[:, 2]
dataloc["dp"] = sim[:, 3]
dataloc.loc[:, ("maindata", "spec")] = sim[:, 0]
dataloc[("metadata", "pressure")] = sim[:, 2]
dataloc[("metadata", "dp")] = sim[:, 3]
if mode == "tl":
dataloc.loc[:, "incr"] = sim[:, 1]
dataloc.loc[:, ("maindata", "incr")] = sim[:, 1]
# Put simulated value into correct column
# Different case if concs, or other parameters such as pressure
# Put pressure and other auxiliary data into spec column for later
# interpolation
if trid[0] == "pressure":
dataloc.loc[:, "spec"] = copy.deepcopy(
dataloc.loc[:, "pressure"].values)
dataloc.loc[:, ("maindata", "spec")] = copy.deepcopy(
dataloc.loc[:, ("metadata", "pressure")].values)
elif trid[0] == "dpressure":
dataloc.loc[:, "spec"] = copy.deepcopy(
dataloc.loc[:, "dp"].values)
dataloc.loc[:, ("maindata", "spec")] = copy.deepcopy(
dataloc.loc[:, ("metadata", "dp")].values)
elif trid[0] == "airm":
dataloc.loc[:, "spec"] = copy.deepcopy(
dataloc.loc[:, "airm"].values)
dataloc.loc[:, ("maindata", "spec")] = copy.deepcopy(
dataloc.loc[:, ("metadata", "airm")].values)
elif trid[0] == "hlay":
dataloc.loc[:, "spec"] = copy.deepcopy(
dataloc.loc[:, "hlay"].values)
dataloc.loc[:, ("maindata", "spec")] = copy.deepcopy(
dataloc.loc[:, ("metadata", "hlay")].values)
dataout[trid] = dataloc
del dataout[trid]["pressure"]
del dataout[trid]["dp"]
del dataout[trid][("metadata", "pressure")]
del dataout[trid][("metadata", "dp")]
# del data2dump[trid]["airm"]
# del data2dump[trid]["hlay"]
......
......@@ -48,7 +48,7 @@ def adjoint(
continue
# Otherwise, fetch levels from pre-defined file
inout_datastore["inputs"][trid][ddi]["level"] =\
inout_datastore["inputs"][trid][ddi][("metadata", "level")] =\
vcoordfromfile(
inout_datastore["inputs"][trid][ddi],
file_statlev,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment