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

Last change on this file was 2848, checked in by aslmd, 2 years ago

MESOSCALE Mars workflow: added comments to launch_gcm to allow standalone interactive run if needed (e.g. testing)

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