source: trunk/MESOSCALE/LMDZ.MARS/in_lmdz_mars/myGCM/launch_gcm @ 789

Last change on this file since 789 was 239, checked in by aslmd, 13 years ago

MESOSCALE: corrected a link bug in launch_gcm. added a test in makemeso to check if xy grid is compliant with number of processors.

  • Property svn:executable set to *
File size: 1.7 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
19startbase=./startbase/
20
21#
22# get simulation start day and compute start/startfi required date (simulation day - 1)
23#
24echo '>>>' choose start sol ? ; read daygcm
25  #if [[ "$daygcm" == 0 ]]
26  #then
27  #daygcm=669
28  #fi
29daygcm=$(expr ${daygcm} - 1)
30
31#
32# find the correct start/startfi files among 3-day startbase
33#
34ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null
35if [[ "$?" == 0 ]]
36then
37    echo found ! ${daygcm}
38else
39    #echo not found ! ${daygcm}
40    daygcm=$(expr ${daygcm} - 1)
41    ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null
42    if [[ "$?" == 0 ]]     # probably a 'while' loop would be better if more than 3
43    then
44        echo found ! ${daygcm}
45    else
46        #echo not found ! ${daygcm}   
47        daygcm=$(expr ${daygcm} - 1)
48        ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null     
49        echo found ! ${daygcm}
50    fi 
51fi     
52
53#
54# link start/startfi files
55#
56ln -sf ${startbase}/start${daygcm}.nc start.nc
57ln -sf ${startbase}/startfi${daygcm}.nc startfi.nc
58
59#
60# clean the place
61#
62rm -rf restart.nc 2> /dev/null
63rm -rf restartfi.nc 2> /dev/null
64rm -rf log_gcm 2> /dev/null
65
66#
67# run !
68#
69echo running the GCM - check in ${PWD}/log_gcm
70nohup gcm.e > log_gcm
71
72exit
Note: See TracBrowser for help on using the repository browser.