source: tags/LIM1D_v3.20/SCRIPTS/lim1d_n_ice_rl.nqs @ 51

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

N_ICE_RL config modifs

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