source: trunk/SCRIPTS/lim1d_barrow.nqs @ 50

Last change on this file since 50 was 4, checked in by vancop, 8 years ago

initial import /Users/ioulianikolskaia/Boulot/CODES/LIM1D/ARCHIVE/TMP/LIM1D_v3.20/

File size: 4.4 KB
Line 
1#/bin/bash
2#######################################################################################
3# Launching scripts for LIM1D
4#######################################################################################
5# v2.1, Sep 2009, Martin Vancoppenolle
6
7echo " ------------------------------------------------------------------------------------------------"
8# Adjust this section
9USERNICK="Martouf"       # user nickname
10
11EXP_ID="test_3.20_BARROW"  # name of the experiment ### CHANGE
12SOURCE="source_3.20"       # version of the sources
13TS="1d"                    # time step (1h or 1d)
14CONF="BARROW"              # site at which we run the model
15MESSAGE="Test run"         # Little message to know what is the run about
16
17SUBDIR=`pwd`
18
19MAINDIR="$HOME/Boulot/CODES/LIM1D/2015_v3.20" ### CHANGE
20
21SCRATCHDIR="$MAINDIR/SCRATCH/$EXP_ID"        # SCRATCH - temporary directory on which code is run
22OUTDIR="$MAINDIR/RUN/$EXP_ID"                # STORE - repository where we put the output files in the end
23SOURCEDIR="$MAINDIR/MAKE"                    # EXECUTABLE - exectuable & sources
24INFILEDIR="$MAINDIR/INPUT/$CONF/$SOURCE"     # INPUT - initialization, forcing & param files
25
26GRAPHDIR="$HOME/Boulot/SCIENCE/PLOT_SCRIPTS/LIM1D_BIO/IDL/$CONF" # IDL plots
27
28#######################################################################################
29
30#prints commands on output
31#set -x
32
33echo " ------------------------------------------------------------------------------------------------"
34echo " 1- Dear $USERNICK, the run is being prepared, please do something else"
35echo " ------------------------------------------------------------------------------------------------"
36#creates the experiment directory in run and scratch
37rm -rf $OUTDIR
38rm -rf $SCRATCHDIR
39
40mkdir $OUTDIR
41mkdir $SCRATCHDIR
42
43#goes to the scratch
44cd $SCRATCHDIR
45echo $MESSAGE > README
46mv README $OUTDIR
47
48#copies the executable
49cp $SOURCEDIR/lim1d.x $SCRATCHDIR/lim1d_$EXP_ID
50
51#copies the forcing and initialization files
52cp $INFILEDIR/* $SCRATCHDIR
53
54ls forcing_$CONF.nc.$TS
55ls forcing.param.$TS
56ls run.param.$TS
57
58mv forcing_$CONF.nc.$TS forcing.nc
59mv forcing.param.$TS    forcing.param
60mv run.param.$TS        run.param
61mv init_$CONF.nc init.nc
62
63# get time step and biological model
64DT=`sed -n 9,9p run.param`         # time step in seconds
65CMOD=`sed -n '21,21p' run.param`   # biological model
66
67#list the directory content
68ls -lt
69
70echo " ------------------------------------------------------------------------------------------------"
71echo " 2- Dear $USERNICK, everything is copied on the scratch, I am gonna start "
72echo " the run, bordel, and it may take a while depending on the number of iterations you bastard chose"
73echo " ------------------------------------------------------------------------------------------------"
74
75#runs the code
76nice ./lim1d_$EXP_ID > output.run.$EXP_ID
77ls -lt
78
79echo " ------------------------------------------------------------------------------------------------"
80echo " 3- I'm done and bored, $USERNICK, have to put everything in $OUTDIR "
81echo " ------------------------------------------------------------------------------------------------"
82
83#copies the relevant files in the run directory
84cp $SCRATCHDIR/lim1d_$EXP_ID $OUTDIR
85cp $SCRATCHDIR/*.param $OUTDIR
86cp $SCRATCHDIR/ice.out.nc  $OUTDIR/ice.out.nc.$EXP_ID
87cp $SCRATCHDIR/run.out.txt $OUTDIR/run.out.txt.$EXP_ID
88cp $SCRATCHDIR/cons_bio.out.txt $OUTDIR/cons_bio.out.txt.$EXP_ID
89cp $SCRATCHDIR/forcing.out.txt $OUTDIR/forcing.out.txt.$EXP_ID
90
91cp $SCRATCHDIR/output.run.$EXP_ID $OUTDIR
92cp $SCRATCHDIR/output.run.$EXP_ID $SUBDIR
93cp $SCRATCHDIR/time.step $OUTDIR/time.step.$EXP_ID
94
95echo " ------------------------------------------------------------------------------------------------"
96echo " 4- Everything copied, $USERNICK, is this fine ? "
97ls -lt $OUTDIR
98echo " If problem go to $OUTDIR and check "
99echo " thanks a lot for using LIM1D, (c) martouf 2008 "
100
101#rm -rf $SCRATCHDIR
102
103echo " ------------------------------------------------------------------------------------------------"
104echo " 5- Graphics "
105
106# read the time step and biological model in the namelists
107
108cd $GRAPHDIR
109echo $EXP_ID > exp_id.dat
110echo $OUTDIR/ >> exp_id.dat
111echo $OUTDIR/ >> exp_id.dat
112echo $DT >> exp_id.dat
113echo $CMOD >> exp_id.dat
114echo $CONF  >> exp_id.dat
115echo
116echo AAAAAAAAAAAAAAAAHHHHHHHHHHHHH
117echo
118cat exp_id.dat
119cp exp_id.dat ..
120echo
121echo
122idl < plots_$CONF.exec
123
124cd $OUTDIR
125gv -swap $EXP_ID'_contours.ps' &
126gv -swap $EXP_ID'_stocks.ps' &
127gv -swap $EXP_ID'_profiles.ps' &
Note: See TracBrowser for help on using the repository browser.