Commit 30894788 authored by Woude, Auke van der's avatar Woude, Auke van der
Browse files

Removed DisEqFlux and used 1 category for HDV

parent 3a75fd36
......@@ -59,31 +59,11 @@ categories = {
'CO2.uncertainty': 'n',
'CO': -4.32,
'CO.uncertainty': 'l'},
'heavy duty highway': {'name': 'heavy duty highway',
'heavy duty': {'name': 'heavy duty highway',
'model': 1,
'spatial': 'Road transport',
'temporal': 't_road',
'fraction_of_total': 0.56,
'emission_factors': 36650000,
'CO2' : 1,
'CO2.uncertainty': 'n',
'CO': -6.11,
'CO.uncertainty': 'l'},
'heavy duty middle road': {'name': 'heavy duty middle road',
'model': 1,
'spatial': 'Road transport',
'temporal': 't_road',
'fraction_of_total': 0.24,
'emission_factors': 36650000,
'CO2' : 1,
'CO2.uncertainty': 'n',
'CO': -6.11,
'CO.uncertainty': 'l'},
'heavy duty urban': {'name': 'heavy duty urban',
'model': 1,
'spatial': 'Road transport',
'temporal': 't_road',
'fraction_of_total': 0.2,
'fraction_of_total': 1.,
'emission_factors': 36650000,
'CO2' : 1,
'CO2.uncertainty': 'n',
......
......@@ -392,7 +392,6 @@ class STILTObservationOperator(ObservationOperator):
index_in_state = find_in_state(param_values, 'BIO', str(lutype), return_index=True)
if index_in_state:
param_value = param_values[index_in_state]
print(param_value)
else: param_value = 1
nee_lut_mem = (nee_lut.sum(axis=0) * mask) * param_value
nee_lut_mem_scaled = average2d(nee_lut_mem, domain_shape)
......@@ -408,11 +407,9 @@ class STILTObservationOperator(ObservationOperator):
time_profile_nuc = np.array(worksheet.col_values(19))
self.nuc_time_profile = time_profile_nuc
file = self.model_settings['biosphere_fluxdir']
self.dis_eq_flux = self.get_nc_variable(file, 'TER_dC14', np.float32)[self.indices, :, :]
file = self.model_settings['nuclear_fluxdir']
self.nuc_flux = self.get_nc_variable(file, 'E_14CO2_nuc', np.float32)
with nc.Dataset(file) as ds:
self.nuc_flux = ds['E_14CO2_nuc'][:].astype(np.float32)
def get_foot(self, site, datepoint):
"""Function that gets the footprint for the current time and site.
......@@ -517,27 +514,22 @@ class STILTObservationOperator(ObservationOperator):
# Get the fluxes and multiply them by the footprint and time profile
# Note that the unit is already in Delta notation
nuc_flux = self.nuc_flux
nuc_flux = (nuclear_time_profile[:, None, None] * nuc_flux[None,:] * self.foot).sum()
nuc_flux = self.nuc_flux # time invariant
nuc_flux = (nuclear_time_profile[:, None, None] * nuc_flux[None, :, :] * self.foot).sum()
nuc_flux *= (1./MASS_14CO2) * KMOL2UMOL * PERYR2PERS
# now get the disequilibrium flux
delta_14CO2_ter = (self.dis_eq_flux[indices] * self.foot).sum()
R_14CO2_ter = (delta_14CO2_ter/1000. + 1) * Rstd # [nt,nlat,nlon] 1.639e-12 [1.557e-12 - 1.787e-12]
# Now, calculate to ppm
co2_14_ff = ff_flux * R_14CO2_ff * MASS_C / MASS_C_14
co2_14_bg = background* R_14CO2_bg * MASS_C / MASS_C_14
co2_14_bio= nee * R_14CO2_bg * MASS_C / MASS_C_14
# Calculate the total c14 in the sample (ppm)
co2_14_total = (co2_14_ff + # The C14 due to FF emissions (should be 0)
(alpha_14CO2_gpp * R_14CO2_bg * gpp) + # The C14 taken up due to GPP
# (note that GPP is negative)
(R_14CO2_ter * ter) + # The C14 from the disequilibrium flux
nuc_flux + # The C14 from the nuclera power plants
co2_14_bg) # The C14 that was already in the air
co2_14_bio + # C14 from the biospehre, ignore disequilibruim flux
nuc_flux + # The C14 from the nuclera power plants
co2_14_bg) # The C14 that was already in the air
# Conversion 14CO2 in ppm to DELTA ----
co2_total = ff_flux + gpp + ter + nuc_flux + background
co2_total = ff_flux + nee + nuc_flux + background
Rm = (co2_14_total * MASS_14CO2) / (co2_total * MASS_CO2) # ppm to mass ratio (kg 14CO2 / kgCO2)
A14 = Rm * lambda_14CO2 * 1e3*Nav / MASS_14CO2 # kg14CO2/kgCO2 * 1/s * molecules/kmole / (kg14CO2/kmole14CO2) = molecules 14CO2 / kgCO2 / s
As = A14 * MASS_CO2 / MASS_C # Bq/kgC-CO2
......@@ -666,7 +658,7 @@ class STILTObservationOperator(ObservationOperator):
self.c14_dict[site][datepoint] = {}
nee = self.get_biosphere_concentration(self.foot, self.nee_mem, datepoint)
self.c14_dict[site][datepoint]['bio'] = nee[:]
self.c14_dict[site][datepoint]['nee'] = nee[:]
self.c14_dict[site][datepoint]['ff'] = ff_increase[:]
# If not the species is CO2, the NEE is 0.
......
!!! Info for the CarbonTracker data assimilation system
basepath : /projects/0/ctdas/awoude/develop/
name :
strategy : CO2
strategy : CO2C14
datadir : /projects/0/ctdas/RINGO/inversions/Data
inputdir : ${basepath}/input/
outputdir : ${basepath}/output/
......@@ -14,10 +14,10 @@ obs.spec.nr : 1
obs.dir : obsfiles${strategy}
do.co : 0
do.c14integrated: 0
do.c14targeted: 0
do.c14targeted: 1
obs.spec.name : CO2
! number of emission categories defined in the emission model
obs.cat.nr : 12
obs.cat.nr : 10
! For Rdam obs
obs.sites.rc : ${datadir}/sites_weights2.rc
! number of parameters
......
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