source: tags/LIM1D_v3.20/SCRIPTS/lim1d_yrosiae.nqs @ 6

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

initial import of v3.20 /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_YROSIAE"    # name of the experiment ### CHANGE
12SOURCE="source_3.20"          # version of the sources
13TS="1d"                       # time step (1h or 1d)
14CONF="YROSIAE"                # site at which we run the model
15MESSAGE="first 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
54# rename files
55mv "forcing_"$CONF"_"$TS".nc"      forcing.nc
56mv forcing.param.$TS               forcing.param
57mv run.param.$TS                   run.param
58mv init_$CONF.nc                   init.nc
59
60# get time step and biological model
61DT=`sed -n 9,9p run.param`         # time step in seconds
62CMOD=`sed -n '21,21p' run.param`   # biological model
63
64#list the directory content
65ls -lt
66
67echo " ------------------------------------------------------------------------------------------------"
68echo " 2- Dear $USERNICK, everything is copied on the scratch, I am gonna start "
69echo " the run, bordel, and it may take a while depending on the number of iterations you bastard chose"
70echo " ------------------------------------------------------------------------------------------------"
71
72#runs the code
73nice ./lim1d_$EXP_ID > output.run.$EXP_ID
74ls -lt
75
76echo " ------------------------------------------------------------------------------------------------"
77echo " 3- I'm done and bored, $USERNICK, have to put everything in $OUTDIR "
78echo " ------------------------------------------------------------------------------------------------"
79
80#copies the relevant files in the run directory
81cp $SCRATCHDIR/lim1d_$EXP_ID $OUTDIR
82cp $SCRATCHDIR/*.param $OUTDIR
83cp $SCRATCHDIR/ice.out.nc  $OUTDIR/ice.out.nc.$EXP_ID
84cp $SCRATCHDIR/run.out.txt $OUTDIR/run.out.txt.$EXP_ID
85cp $SCRATCHDIR/cons_bio.out.txt $OUTDIR/cons_bio.out.txt.$EXP_ID
86cp $SCRATCHDIR/forcing.out.txt $OUTDIR/forcing.out.txt.$EXP_ID
87
88cp $SCRATCHDIR/output.run.$EXP_ID $OUTDIR
89cp $SCRATCHDIR/output.run.$EXP_ID $SUBDIR
90cp $SCRATCHDIR/time.step $OUTDIR/time.step.$EXP_ID
91
92echo " ------------------------------------------------------------------------------------------------"
93echo " 4- Everything copied, $USERNICK, is this fine ? "
94ls -lt $OUTDIR
95echo " If problem go to $OUTDIR and check "
96echo " thanks a lot for using LIM1D, (c) martouf 2008 "
97
98#rm -rf $SCRATCHDIR
99
100echo " ------------------------------------------------------------------------------------------------"
101echo " 5- Graphics "
102
103# read the time step and biological model in the namelists
104
105cd $GRAPHDIR
106echo $EXP_ID > exp_id.dat
107echo $OUTDIR/ >> exp_id.dat
108echo $OUTDIR/ >> exp_id.dat
109echo $DT >> exp_id.dat
110echo $CMOD >> exp_id.dat
111echo $CONF  >> exp_id.dat
112echo
113echo AAAAAAAAAAAAAAAAHHHHHHHHHHHHH
114echo
115cat exp_id.dat
116cp exp_id.dat ..
117echo
118echo
119idl < plots_$CONF.exec
120
121cd $OUTDIR
122gv -swap $EXP_ID'_contours.ps' &
123gv -swap $EXP_ID'_stocks.ps' &
124gv -swap $EXP_ID'_profiles.ps' &
Note: See TracBrowser for help on using the repository browser.