diff --git a/start_ctdas.sh b/start_ctdas.sh new file mode 100755 index 0000000000000000000000000000000000000000..7ed92e210146b3a1065acf0532faad3e01a5073a --- /dev/null +++ b/start_ctdas.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +echo "New project to be started with name $1" +echo "Copying jb file, py file, and rc-file" +sed -e "s/template/$1/g" template.jb > $1.jb +sed -e "s/template/$1/g" template.py > $1.py +sed -e "s/template/$1/g" template.rc > $1.rc + +chmod u+x $1.jb + +echo "************* NOW USE ****************" +ls -lrta $1.* +echo "**************************************" + diff --git a/template.jb b/template.jb new file mode 100755 index 0000000000000000000000000000000000000000..c15b25738099efd38275b92108537ab71f36afbd --- /dev/null +++ b/template.jb @@ -0,0 +1,15 @@ +## @ node_usage = shared +# @ notification = never +# @ input = /dev/null +# @ output = template.out.$(jobid) +# @ error = template.out.$(jobid) +# @ wall_clock_limit = 24:00:00 +# @ job_type = serial +# @ shell = /bin/bash +# @ queue + + +echo ######################## +module load tm5/mpi +module load ctdas +python template.py rc=template.rc $1 diff --git a/template.py b/template.py new file mode 100755 index 0000000000000000000000000000000000000000..c8daae6d0342b2cb94515acc3c6a4345f5291f05 --- /dev/null +++ b/template.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +################################################################################################# +# First order of business is always to make all other python modules accessible through the path +################################################################################################# + +import sys +import os +import logging +dummy = sys.path.append(os.getcwd()) + +################################################################################################# +# Next, import the tools needed to initialize a data assimilation cycle +################################################################################################# + +from da.tools.initexit import StartLogger +from da.tools.initexit import ValidateOptsArgs +from da.tools.initexit import ParseOptions + +################################################################################################# +# Parse and validate the command line options, start logging +################################################################################################# + +dummy = StartLogger() +opts, args = ParseOptions() +opts,args = ValidateOptsArgs(opts,args) + +################################################################################################# +# Create the Cycle Control object for this job +################################################################################################# + +from da.tools.initexit import CycleControl + +DaCycle = CycleControl(opts,args) + +########################################################################################### +### IMPORT THE APPLICATION SPECIFIC MODULES HERE, TO BE PASSED INTO THE MAIN PIPELINE!!! ## +########################################################################################### + +from da.tools.pipeline import EnsembleSmootherPipeline +from da.platform.huygens import HuygensPlatForm +from da.ct.dasystem import CtDaSystem +#from da.ct.statevector import CtStateVector +from da.ctgridded.statevector import CtGriddedStateVector +#from da.ct.obspack import ObsPackObservations +from da.ct.obspack_geocarbon import ObsPackObservations +#from da.ct.obs import CtObservations +from da.tm5.observationoperator import TM5ObservationOperator +from da.ct.optimizer import CtOptimizer + +PlatForm = HuygensPlatForm() +DaSystem = CtDaSystem(DaCycle['da.system.rc']) +ObsOperator = TM5ObservationOperator(DaCycle['da.obsoperator.rc']) +Samples = ObsPackObservations() +#Samples = CtObservations() +StateVector = CtGriddedStateVector() +Optimizer = CtOptimizer() + +########################################################################################## +################### ENTER THE PIPELINE WITH THE OBJECTS PASSED BY THE USER ############### +########################################################################################## + +from da.tools.pipeline import header,footer + +msg = header+"Entering Pipeline "+footer ; logging.info(msg) + +EnsembleSmootherPipeline(DaCycle,PlatForm, DaSystem, Samples,StateVector,ObsOperator,Optimizer) + + +########################################################################################## +################### All done, extra stuff can be added next, such as analysis +########################################################################################## + +msg = header+"Starting analysis"+footer ; logging.info(msg) + + +from da.analysis.expand_fluxes import SaveWeeklyAvg1x1Data +from da.analysis.expand_fluxes import SaveWeeklyAvgStateData +from da.analysis.expand_fluxes import SaveWeeklyAvgTCData +from da.analysis.expand_fluxes import SaveWeeklyAvgExtTCData +from da.analysis.expand_mixingratios import WriteMixingRatios +from da.analysis.summarize_obs import SummarizeObs + +savedas = SaveWeeklyAvg1x1Data(DaCycle, StateVector) +savedas = SaveWeeklyAvgStateData(DaCycle, StateVector) +savedas = SaveWeeklyAvgTCData(DaCycle, StateVector) +savedas = SaveWeeklyAvgExtTCData(DaCycle) +savedas = WriteMixingRatios(DaCycle) +savedas = SummarizeObs(DaCycle) + +sys.exit(0) + + diff --git a/template.rc b/template.rc new file mode 100644 index 0000000000000000000000000000000000000000..0366fa30150c697d36ae5e07783ab6534a4be462 --- /dev/null +++ b/template.rc @@ -0,0 +1,20 @@ +! Info on the data assimilation cycle + +time.restart : False +time.start : 2005-01-01 00:00:00 +time.finish : 2011-01-01 00:00:00 +time.cycle : 10 +time.nlag : 3 +dir.da_run : /archive/peters/template + + +! Info on the DA system used + +da.system : CarbonTracker +da.system.rc : da/rc/carbontracker_geocarbon_gridded.rc + +! Info on the forward model to be used + +da.obsoperator : TM5 +da.obsoperator.rc : ${HOME}/TM5/tm5-ctdas-ei-zoom.rc +da.optimizer.nmembers : 150