Commit 9753f219 authored by brunner's avatar brunner
Browse files

No commit message

No commit message
parent dc911168
......@@ -15,6 +15,8 @@ from cdo import *
identifier = 'ObservationOperator'
version = '10'
cdo = Cdo()
################### Begin Class ObservationOperator ###################
class ObservationOperator(object):
def __init__(self, dacycle=None):
......@@ -52,7 +54,7 @@ class ObservationOperator(object):
self.simulated_file = os.path.join(self.outputdir, 'samples_simulated.%s.nc' % self.dacycle['time.sample.stamp'])
self.forecast_nmembers = int(self.dacycle['da.optimizer.nmembers'])
def run(self):
def run(self,dacycle):
f = io.CT_CDF(self.simulated_file, method='create')
......@@ -117,19 +119,12 @@ class ObservationOperator(object):
# for ncfile in ncfilelist:
# infile = os.path.join(ncfile + '.nc')
# here comes int2lm
# cosmo = os.path.join(dacycle.dasystem['cosmo_path'],"run_chain.py")
# os.system('python '+cosmo+'ctdas'+dacycle['time.start'].strftime('%Y-%m-%d')+'0 672 -j meteo icbc emissions biofluxes int2lm post_int2lm')
# HERE MULTIPLY COSMO FLUXES INT2LM WITH CTDAS PARAMS
for ens in range(1,self.forecast_nmembers+1):
ens = str(ens).zfill(3)
os.system('ln *nc /scratch/snx3000/parsenov/ctdas/2013040100_0_168/int2lm/output /scratch/snx3000/parsenov/ctdas/cosmo_ensemble/'+ens)
os.system('rm /scratch/snx3000/parsenov/ctdas/cosmo_ensemble/*f.nc')
for dt in rrule.rrule(rrule.HOURLY, dtstart=self['time.start'], until=self['time.start']+timedelta(hours=168)):
print(dt)
cdo.mul("parameters."+ens+".nc", input = "/scratch/snx3000/parsenov/ctdas/2013040100_0_168/int2lm/output/laf"+dt.strftime('%Y%m%d%H')+"f.nc", output = "/scratch/snx3000/parsenov/ctdas/cosmo_ensemble/"+ens+"laf"+dt.strftime('%Y%m%d%H')+"f.nc")
for dt in rrule.rrule(rrule.HOURLY, dtstart=dacycle['time.start'], until=dacycle['time.start']+timedelta(hours=672)):
cdo.mul("parameters."+ens+".nc", input = os.path.join(dacycle['da.bio.input'], 'gpp_%s.nc' % dt.strftime('%Y%m%d%H')), output = os.path.join(dacycle['da.bio.input'], 'ensemble', "gpp_%s.nc" % dt.strftime('%Y%m%d%H')))
# os.system('python '+dacycle['da.obsoperator.home']+' ctdas '+dacycle['time.start'].strftime('%Y-%m-%d')+' 0 672 -j meteo icbc emissions biofluxes int2lm post_int2lm')
# here comes COSMO
sys.exit()
os.system('python '+cosmo+' ctdas '+self['time.start'].strftime('%Y-%m-%d')+' 0 672 -j cosmo')
......@@ -166,13 +161,12 @@ class ObservationOperator(object):
logging.info('ObservationOperator finished successfully, output file written (%s)' % self.simulated_file)
def run_forecast_model(self):
def run_forecast_model(self,dacycle):
self.prepare_run()
self.run()
self.run(dacycle)
def extract_model_data(ens):
cdo = Cdo()
files2cat=[]
time_stamp = self['time.sample.stamp']
......
......@@ -26,7 +26,7 @@ sys.path.append(os.getcwd())
#################################################################################################
from da.tools.initexit import start_logger, validate_opts_args, parse_options, CycleControl
from da.tools.pipeline import ensemble_smoother_pipeline, header, footer
from da.cosmo.pipeline import ensemble_smoother_pipeline, header, footer
from da.platform.maunaloa import MaunaloaPlatform
from da.baseclasses.dasystem import DaSystem
from da.baseclasses.statevector import StateVector
......
......@@ -92,14 +92,15 @@ da.obsoperator : TM5
! be used as observation operator in this experiment.
!
da.obsoperator.home : ${HOME}/TM5
da.obsoperator.home : /store/empa/em05/parsenov/cosmo_processing_chain/run_chain.py
da.bio.input : /store/empa/em05/parsenov/cosmo_input/vprm/processed
da.obsoperator.rc : ${da.obsoperator.home}/tm5-ctdas-ei-zoom.rc
!
! The number of ensemble members used in the experiment. Valid entries are integers > 2
!
da.optimizer.nmembers : 10
da.optimizer.nmembers : 20
! Finally, info on the archive task, if any. Archive tasks are run after each cycle to ensure that the results of each cycle are
! preserved, even if you run on scratch space or a temporary disk. Since an experiment can take multiple weeks to complete, moving
......
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