Commit 127e0333 authored by Woude, Auke van der's avatar Woude, Auke van der

Undo the changes only for RINGO, there is now a new ringo branch

parent 2a9b31c9
......@@ -54,12 +54,13 @@ class EmisModel(object):
self.startdate = self.dacycle['time.fxstart']
self.enddate = self.dacycle['time.finish']
self.emisdir = dacycle.dasystem['datadir']
self.inputdir = dacycle['dir.input']
self.inputdir = dacycle.dasystem['inputdir']
self.proxyfile = dacycle.dasystem['emis.input.spatial']
self.nrspc = int(dacycle.dasystem['obs.spec.nr'])
self.species = dacycle.dasystem['obs.spec.name'].split(',')
self.nrcat = int(dacycle.dasystem['obs.cat.nr'])
self.nmembers = int(dacycle['da.optimizer.nmembers'])
self.paramfile = dacycle.dasystem['emis.paramfiles']
self.countries = [country.strip() for country in dacycle.dasystem['countries'].split(';')]
areafile = dacycle.dasystem['area.file']
self.area = nc.Dataset(areafile)['Area'][:]
......@@ -101,7 +102,7 @@ class EmisModel(object):
elif return_index: return False
else: return 1
def multiprocess_emissions(self, dacycle, indices):
def get_emis(self, dacycle, indices):
"""set up emission information for pseudo-obs (do_pseudo=1) and ensemble runs (do_pseudo=0)"""
self.timestartkey = self.dacycle['time.sample.start']
......@@ -119,7 +120,7 @@ class EmisModel(object):
pool.join()
logging.debug('Succesfully wrote prior emission files')
def get_yearly_country_emissions(self, params):
def get_yearly_emissions(self, params):
yremis = np.zeros((len(self.categories), len(self.countries), len(self.species)), dtype=np.float32)
for i_country, country in enumerate(self.countries):
for i_cat, (cat, values) in enumerate(self.categories.items()):
......@@ -160,7 +161,7 @@ class EmisModel(object):
f.close()
elif member == 'true':
params = np.ones(100)
yremis = self.get_yearly_country_emissions(params)
yremis = self.get_yearly_emissions(params)
# Create a recalculation factor from kg/km2/yr to umol/m2/sec
M_mass = np.array([44e-9, 28e-9][:self.nrspc])
sec_year = 24*3600.*self.ndays #seconds in a year (leapyear)
......@@ -203,7 +204,7 @@ class EmisModel(object):
emissions = emissions / kgperkmperyr2umolperm2pers[None, :, None, :, :]
## create output file
if not isinstance(member, str):
prior_file = self.inputdir + '/prior_spatial_{0:03d}.nc'.format(member)
prior_file = os.path.join(self.inputdir, 'prior_spatial_{0:03d}.nc'.format(member))
f = io.CT_CDF(prior_file, method='create')
if self.dacycle.dasystem['cat.sum_emissions']:
emissions = emissions.sum(axis=2) # [time, species, lat, lon]
......
This diff is collapsed.
Markdown is supported
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