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

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

MESOSCALE: a commit to allow one to easily work on several clusters with a minimum amount of changes to the script files or includes. basically one has just to edit MESOSCALE/LMD_MM_MARS/SRC/WRFV2/meso_datafile.h for runs with old physics, and add a link to the GCM start database (if not done, there is now a warning in launch_gcm anyway

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