Changeset c5074d2 in flex_extract.git for templates


Ignore:
Timestamp:
Oct 9, 2018, 8:42:16 PM (6 years ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
aa275fc
Parents:
0a06607
Message:

added making of namelist file and jobscript via genshi templates

Location:
templates
Files:
1 added
1 deleted
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • templates/compilejob.template

    r0aaeb04 rc5074d2  
    1717##PBS -q ns
    1818##PBS -S /usr/bin/ksh
    19 ##PBS -o /scratch/ms/$usergroup/$username/flex_ecmwf.$Jobname.$Job_ID.out
     19##PBS -o /scratch/ms/$usergroup/$username/flex_ecmwf.$${Jobname}.$${Job_ID}.out
    2020# job output is in .ecaccess_DO_NOT_REMOVE
    2121##PBS -j oe
     
    2626set -x
    2727export VERSION=$version_number
    28 case $HOST in
     28case $${HOST} in
    2929  *ecg*)
    3030  module load python
     
    4141  module load emos
    4242  module load python
    43   echo ${GROUP}
    44   echo ${HOME}
    45   echo $HOME | awk -F / '{print $1, $2, $3, $4}'
    46   export GROUP=`echo $HOME | awk -F / '{print $4}'`
    47   export SCRATCH=/scratch/ms/${GROUP}/${USER}
     43  echo $${GROUP}
     44  echo $${HOME}
     45  echo $${HOME} | awk -F / '{print $1, $2, $3, $4}'
     46  export GROUP=`echo $${HOME} | awk -F / '{print $4}'`
     47  export SCRATCH=/scratch/ms/$${GROUP}/$${USER}
    4848  export FLEXPART_ROOT_SCRIPTS=$fp_root_scripts
    4949  export MAKEFILE=$makefile
     
    5151esac
    5252
    53 mkdir -p $FLEXPART_ROOT_SCRIPTS/flex_extract_v$VERSION
    54 cd $FLEXPART_ROOT_SCRIPTS/flex_extract_v$VERSION   # if FLEXPART_ROOT is not set this means cd to the home directory
    55 tar -xvf $HOME/flex_extract_v$VERSION.tar
     53mkdir -p $${FLEXPART_ROOT_SCRIPTS}/flex_extract_v$${VERSION}
     54cd $${FLEXPART_ROOT_SCRIPTS}/flex_extract_v$${VERSION}   # if FLEXPART_ROOT is not set this means cd to the home directory
     55tar -xvf $${HOME}/flex_extract_v$${VERSION}.tar
    5656cd src
    5757\rm *.o *.mod $fortran_program
    58 make -f $MAKEFILE >flexcompile 2>flexcompile
     58make -f $${MAKEFILE} >flexcompile 2>flexcompile
    5959
    6060ls -l $fortran_program >>flexcompile
    61 if [ $? -eq 0 ]; then
     61if [ $$? -eq 0 ]; then
    6262  echo 'SUCCESS!' >>flexcompile
    63   mail -s flexcompile.$HOST.$$ $USER <flexcompile
     63  mail -s flexcompile.$${HOST}.$$$$ $${USER} <flexcompile
    6464else
    6565  echo Environment: >>flexcompile
    6666  env >> flexcompile
    67   mail -s "ERROR! flexcompile.$HOST.$$" $USER <flexcompile
     67  mail -s "ERROR! flexcompile.$${HOST}.$$$$" $${USER} <flexcompile
    6868fi
  • templates/job.template

    r82b624a rc5074d2  
    55# start with sbatch NAME_OF_THIS_FILE directly on machine
    66
    7 #SBATCH --workdir=/scratch/ms/spatlh00/lh0
     7#SBATCH --workdir=/scratch/ms/$usergroup/$username
    88#SBATCH --qos=normal
    99#SBATCH --job-name=flex_ecmwf
     
    1717##PBS -q np
    1818##PBS -S /usr/bin/ksh
    19 ## -o /scratch/ms/spatlh00/lh0/flex_ecmwf.$PBS_JOBID.out
     19## -o /scratch/ms/$usergroup/$username/flex_ecmwf.$${PBS_JOBID}.out
    2020## job output is in .ecaccess_DO_NOT_REMOVE
    2121##PBS -j oe
     
    2525
    2626set -x
    27 export VERSION=7.1
    28 case $HOST in
     27export VERSION=$version_number
     28case $${HOST} in
    2929  *ecg*)
    3030  module load python
     
    3333  module load grib_api/1.14.5
    3434  module load emos/437-r64
    35   export PATH=${PATH}:
     35  export PATH=$${PATH}:$fp_root_path
    3636  ;;
    3737  *cca*)
     
    4040  module load emos
    4141  module load python
    42   export SCRATCH=$TMPDIR
    43   export PATH=${PATH}:
     42  export SCRATCH=$${TMPDIR}
     43  export PATH=$${PATH}:$fp_root_path
    4444  ;;
    4545esac
    4646
    47 cd $SCRATCH
    48 mkdir -p python$$
    49 cd python$$
     47cd $${SCRATCH}
     48mkdir -p python$$$$
     49cd python$$$$
    5050
    5151export CONTROL=CONTROL
    5252
    53 cat >$CONTROL<<EOF
     53cat >$${CONTROL}<<EOF
    5454EOF
    5555
    5656
    57 submit.py --controlfile=$CONTROL --inputdir=./work --outputdir=./work 1> prot 2>&1
     57submit.py --controlfile=$${CONTROL} --inputdir=./work --outputdir=./work 1> prot 2>&1
    5858
    5959if [ $? -eq 0 ] ; then
    6060  l=0
    61   for muser in `grep -i MAILOPS $CONTROL`; do
    62       if [ $l -gt 0 ] ; then
    63          mail -s flex.${HOST}.$$ $muser <prot
     61  for muser in `grep -i MAILOPS $${CONTROL}`; do
     62      if [ $${l} -gt 0 ] ; then
     63         mail -s flex.$${HOST}.$$$$ $${muser} <prot
    6464      fi
    65       l=$(($l+1))
     65      l=$(($${l}+1))
    6666  done
    6767else
    6868  l=0
    69   for muser in `grep -i MAILFAIL $CONTROL`; do
    70       if [ $l -gt 0 ] ; then
    71          mail -s "ERROR! flex.${HOST}.$$" $muser <prot
     69  for muser in `grep -i MAILFAIL $${CONTROL}`; do
     70      if [ $${l} -gt 0 ] ; then
     71         mail -s "ERROR! flex.$${HOST}.$$$$" $${muser} <prot
    7272      fi
    73       l=$(($l+1))
     73      l=$(($${l}+1))
    7474  done
    7575fi
     76
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG