This is best done using specific functionality that has been made for the dummy tracer.
So, first we go back the the main directory, where we start the interactive Python:
cd /home/krol/HG/tm5-code-0
ipython
Now we will manually make some point observations.
%run scripts/PyShell.py rc/nam1x1-dummy_tr.rc from Observations import dummyPoint pt = dummyPoint((1999,12,25),(2000,1,10)) pt(300)
In the first line we include some functionality by running the Pyshell script with the .rc file.
In the second line, we load from the class Observations the class dummyPoint.
In the thirst line we create an instance of the class dummyPoint, asking for observations from 25 december 1999 to 10 january 2000. Finally, we ask for 300 observations.
The output should look like:
Wrote 300 observations to /scratch/shared/krol/var4d/dummy_tr/nam1x1/ml60/tropo25/test_project/input/point_input.nc
How does this work? Now first we locate the definition of class dummypoint. It is located
in the file __proj/tracer/dummy_tr/py/Observations.py. We find here the following lines:
self.output_file = self.rcf.get('output.point.infile') self.sampling_strategy = self.rcf.get('point.dummy_tracer.sampling.strategy', 'int') self.conc_lower = self.rcf.get('point.dummy_tracer.lower.concentration', 'float') self.conc_upper = self.rcf.get('point.dummy_tracer.upper.concentration', 'float') self.max_conc_error = self.rcf.get('point.dummy_tracer.maximum.error', 'float') self.topo_database = self.rcf.get('point.dummy_tracer.topo.database')
which basically extract information from the .rc file. The statement pt(300) calls the following method:
def __call__(self, num_obs, bands=None): self.createObservations(num_obs, bands) self.writePointFile()
Which creates the desired observations. Now we have to tell TM5 to use these observations in the forward and adjoint run. So we set in rc/nam1x1-dummy_tr.rc the following flags:
output.point : T adjoint.input.point : T
Now lets try the gradient test again: