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

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