#/bin/bash ####################################################################################### # Launching scripts for LIM1D ####################################################################################### # v2.1, Sep 2009, Martin Vancoppenolle echo " ------------------------------------------------------------------------------------------------" # Adjust this section USERNICK="Martouf" # user nickname EXP_ID="test_3.20_YROSIAE" # name of the experiment ### CHANGE SOURCE="source_3.20" # version of the sources TS="1d" # time step (1h or 1d) CONF="YROSIAE" # site at which we run the model MESSAGE="first test run" # Little message to know what is the run about SUBDIR=`pwd` MAINDIR="$HOME/Boulot/CODES/LIM1D/2015_v3.20" ### CHANGE SCRATCHDIR="$MAINDIR/SCRATCH/$EXP_ID" # SCRATCH - temporary directory on which code is run OUTDIR="$MAINDIR/RUN/$EXP_ID" # STORE - repository where we put the output files in the end SOURCEDIR="$MAINDIR/MAKE" # EXECUTABLE - exectuable & sources INFILEDIR="$MAINDIR/INPUT/$CONF/$SOURCE" # INPUT - initialization, forcing & param files GRAPHDIR="$HOME/Boulot/SCIENCE/PLOT_SCRIPTS/LIM1D_BIO/IDL/$CONF" # IDL plots ####################################################################################### #prints commands on output #set -x echo " ------------------------------------------------------------------------------------------------" echo " 1- Dear $USERNICK, the run is being prepared, please do something else" echo " ------------------------------------------------------------------------------------------------" #creates the experiment directory in run and scratch rm -rf $OUTDIR rm -rf $SCRATCHDIR mkdir $OUTDIR mkdir $SCRATCHDIR #goes to the scratch cd $SCRATCHDIR echo $MESSAGE > README mv README $OUTDIR #copies the executable cp $SOURCEDIR/lim1d.x $SCRATCHDIR/lim1d_$EXP_ID #copies the forcing and initialization files cp $INFILEDIR/* $SCRATCHDIR # rename files mv "forcing_"$CONF"_"$TS".nc" forcing.nc mv forcing.param.$TS forcing.param mv run.param.$TS run.param mv init_$CONF.nc init.nc # get time step and biological model DT=`sed -n 9,9p run.param` # time step in seconds CMOD=`sed -n '21,21p' run.param` # biological model #list the directory content ls -lt echo " ------------------------------------------------------------------------------------------------" echo " 2- Dear $USERNICK, everything is copied on the scratch, I am gonna start " echo " the run, bordel, and it may take a while depending on the number of iterations you bastard chose" echo " ------------------------------------------------------------------------------------------------" #runs the code nice ./lim1d_$EXP_ID > output.run.$EXP_ID ls -lt echo " ------------------------------------------------------------------------------------------------" echo " 3- I'm done and bored, $USERNICK, have to put everything in $OUTDIR " echo " ------------------------------------------------------------------------------------------------" #copies the relevant files in the run directory cp $SCRATCHDIR/lim1d_$EXP_ID $OUTDIR cp $SCRATCHDIR/*.param $OUTDIR cp $SCRATCHDIR/ice.out.nc $OUTDIR/ice.out.nc.$EXP_ID cp $SCRATCHDIR/run.out.txt $OUTDIR/run.out.txt.$EXP_ID cp $SCRATCHDIR/cons_bio.out.txt $OUTDIR/cons_bio.out.txt.$EXP_ID cp $SCRATCHDIR/forcing.out.txt $OUTDIR/forcing.out.txt.$EXP_ID cp $SCRATCHDIR/output.run.$EXP_ID $OUTDIR cp $SCRATCHDIR/output.run.$EXP_ID $SUBDIR cp $SCRATCHDIR/time.step $OUTDIR/time.step.$EXP_ID echo " ------------------------------------------------------------------------------------------------" echo " 4- Everything copied, $USERNICK, is this fine ? " ls -lt $OUTDIR echo " If problem go to $OUTDIR and check " echo " thanks a lot for using LIM1D, (c) martouf 2008 " #rm -rf $SCRATCHDIR echo " ------------------------------------------------------------------------------------------------" echo " 5- Graphics " # read the time step and biological model in the namelists cd $GRAPHDIR echo $EXP_ID > exp_id.dat echo $OUTDIR/ >> exp_id.dat echo $OUTDIR/ >> exp_id.dat echo $DT >> exp_id.dat echo $CMOD >> exp_id.dat echo $CONF >> exp_id.dat echo echo AAAAAAAAAAAAAAAAHHHHHHHHHHHHH echo cat exp_id.dat cp exp_id.dat .. echo echo idl < plots_$CONF.exec cd $OUTDIR gv -swap $EXP_ID'_contours.ps' & gv -swap $EXP_ID'_stocks.ps' & gv -swap $EXP_ID'_profiles.ps' &