Commit 2077b844 authored by Florentie, Liesbeth's avatar Florentie, Liesbeth
Browse files

updated pipeline ctsf to write additional outputfiles at end of run

parent 4f25a9b2
......@@ -112,10 +112,10 @@ def analysis_pipeline(dacycle, platform, dasystem, samples, statevector):
shutil.move(os.path.join(dacycle['dir.analysis'],'copied_regions_extended.nc'),os.path.join(dacycle['dir.exec'],'da','analysis','copied_regions_extended.nc'))
# ----------
from da.analysis.expand_fluxes import save_weekly_avg_1x1_data, save_weekly_avg_state_data, save_weekly_avg_tc_data, save_weekly_avg_ext_tc_data, save_weekly_avg_agg_data
# from da.analysis.expand_fluxes import save_weekly_avg_1x1_data, save_weekly_avg_state_data, save_weekly_avg_tc_data, save_weekly_avg_ext_tc_data, save_weekly_avg_agg_data
from da.analysis.expand_molefractions import write_mole_fractions
from da.analysis.summarize_obs import summarize_obs
from da.analysis.time_avg_fluxes import time_avg
# from da.analysis.time_avg_fluxes import time_avg
logging.info(header + "Starting analysis" + footer)
......@@ -130,26 +130,26 @@ def analysis_pipeline(dacycle, platform, dasystem, samples, statevector):
write_mole_fractions(dacycle)
summarize_obs(dacycle['dir.analysis'])
logging.info(header + "Starting weekly averages" + footer)
save_weekly_avg_1x1_data(dacycle, statevector)
save_weekly_avg_state_data(dacycle, statevector)
save_weekly_avg_tc_data(dacycle, statevector)
save_weekly_avg_ext_tc_data(dacycle)
save_weekly_avg_agg_data(dacycle,region_aggregate='transcom')
save_weekly_avg_agg_data(dacycle,region_aggregate='transcom_extended')
save_weekly_avg_agg_data(dacycle,region_aggregate='olson')
save_weekly_avg_agg_data(dacycle,region_aggregate='olson_extended')
save_weekly_avg_agg_data(dacycle,region_aggregate='country')
logging.info(header + "Starting monthly and yearly averages" + footer)
time_avg(dacycle,'flux1x1')
time_avg(dacycle,'transcom')
time_avg(dacycle,'transcom_extended')
time_avg(dacycle,'olson')
time_avg(dacycle,'olson_extended')
time_avg(dacycle,'country')
# logging.info(header + "Starting weekly averages" + footer)
#
# save_weekly_avg_1x1_data(dacycle, statevector)
# save_weekly_avg_state_data(dacycle, statevector)
# save_weekly_avg_tc_data(dacycle, statevector)
# save_weekly_avg_ext_tc_data(dacycle)
# save_weekly_avg_agg_data(dacycle,region_aggregate='transcom')
# save_weekly_avg_agg_data(dacycle,region_aggregate='transcom_extended')
# save_weekly_avg_agg_data(dacycle,region_aggregate='olson')
# save_weekly_avg_agg_data(dacycle,region_aggregate='olson_extended')
# save_weekly_avg_agg_data(dacycle,region_aggregate='country')
#
# logging.info(header + "Starting monthly and yearly averages" + footer)
#
# time_avg(dacycle,'flux1x1')
# time_avg(dacycle,'transcom')
# time_avg(dacycle,'transcom_extended')
# time_avg(dacycle,'olson')
# time_avg(dacycle,'olson_extended')
# time_avg(dacycle,'country')
logging.info(header + "Finished analysis" + footer)
......@@ -315,6 +315,11 @@ def write_optimized_state_and_fluxes(dacycle, samples, statevector, fluxmodel, o
# Run the observation operator (TM5 to get atmospheric CO2 concentrations)
obsoperator.run_forecast_model(fluxmodel,postprocessing=True)
#fluxmodel.calc_flux(obsoperator.timevec, member=0, updateano=True, postprocessing=True, write=True)
sampling_coords_file = os.path.join(dacycle['dir.input'], 'sample_coordinates_%s.nc' % dacycle['time.sample.stamp'])
if os.path.exists(sampling_coords_file):
outfile = os.path.join(dacycle['dir.output'], 'sample_auxiliary_%s.nc' % dacycle['time.sample.stamp'])
samples.write_sample_auxiliary(outfile)
else: logging.warning("Sample auxiliary output not written, because input file does not exist (no samples found in obspack)")
dacycle.output_filelist.extend(obsoperator.output_filelist)
dacycle.finalize()
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