source: trunk/MESOSCALE/LMD_MM_MARS/SIMU/MESORUN/gcm/launch_gcm @ 1704

Last change on this file since 1704 was 1435, checked in by aslmd, 10 years ago

MESOSCALE: put an actual script in gcm in exec folder

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#! /bin/bash
2
3###############################
4# use: - launch_gcm           #
5#      - echo 22 | launch_gcm #
6###############################
7
8# Author : A. Spiga - Spring/Winter 2008
9# added link trick in 2011
10
11        if [[ ! -d startbase ]]
12        then
13          echo "please create in $PWD a symbolic link: startbase"
14          echo "for instance: ln -sf /san/home/spiga/DATAFILE/STARTBASE_64_48_32_t2 $PWD/startbase"
15          echo "(and compile the GCM with the correct dimensions)"
16          exit
17        fi
18##################
19#startbase='../../STARTS/'
20#startbase='/d2/emlmd/run_LMDZ.MARS.BETA.TASI/tau1/'
21#startbase='/tmp7/aslmd/flush/'
22#startbase='/tmp7/aslmd/flush2/'
23#startbase='/d6/vblmd/MERIDIANI_EXOMARS/starts_en_cours/tau05/'
24#startbase='/d5/aslmd/LMD_MM_MARS_DATA/STARTBASE_64_48_25_t2dust_JBM/'
25##################
26
27startbase=./startbase/
28
29#
30# get simulation start day and compute start/startfi required date (simulation day - 1)
31#
32echo '>>>' choose start sol ? ; read daygcm
33  #if [[ "$daygcm" == 0 ]]
34  #then
35  #daygcm=669
36  #fi
37daygcm=$(expr ${daygcm} - 1)
38
39#
40# find the correct start/startfi files among 3-day startbase
41#
42ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null
43if [[ "$?" == 0 ]]
44then
45    echo found ! ${daygcm}
46else
47    #echo not found ! ${daygcm}
48    daygcm=$(expr ${daygcm} - 1)
49    ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null
50    if [[ "$?" == 0 ]]     # probably a 'while' loop would be better if more than 3
51    then
52        echo found ! ${daygcm}
53    else
54        #echo not found ! ${daygcm}   
55        daygcm=$(expr ${daygcm} - 1)
56        ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null     
57        echo found ! ${daygcm}
58    fi 
59fi     
60
61#
62# link start/startfi files
63#
64ln -sf ${startbase}/start${daygcm}.nc start.nc
65ln -sf ${startbase}/startfi${daygcm}.nc startfi.nc
66
67#
68# clean the place
69#
70rm -rf restart.nc 2> /dev/null
71rm -rf restartfi.nc 2> /dev/null
72rm -rf log_gcm 2> /dev/null
73
74#
75# run !
76#
77echo running the GCM - check in ${PWD}/log_gcm
78#nohup gcm.e > log_gcm
79
80exit
Note: See TracBrowser for help on using the repository browser.