Skip to content
Snippets Groups Projects
Commit c094f42e authored by Peters, Wouter's avatar Peters, Wouter
Browse files

added new helper routines to make py/rc/jb files

parent 524050fd
No related branches found
No related tags found
No related merge requests found
#! /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 "**************************************"
## @ 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
#!/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)
! 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment