Changeset 4037


Ignore:
Timestamp:
Aug 9, 2017, 11:58:51 PM (7 years ago)
Author:
dubos
Message:

Aquaplanet : updated scripts

Location:
dynamico_lmdz/aquaplanet/OLD_PHYSIC/RUN_AQUAPLANET_DYNAMICO_LMDZ5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/OLD_PHYSIC/RUN_AQUAPLANET_DYNAMICO_LMDZ5/example.sh

    r3978 r4037  
    11#!/bin/bash
     2# How to use this script :
     3# 1    Create a directory EXP for your experiment ; ALL commands below must be run from EXP
     4# 2    Create a directory STORE to store the outputs of your experiment ; run "ln -s STORE storedir"
     5# 3    run "BASE/example.sh copy" where BASE is the directory containing this script
     6# 4a   (optional) Edit EXP/run_icosa.def to change nbp, dt, itau_physics
     7# 4b   (optional) Edit EXP/prepare.sh to change NB_MPI_DYNAMICO
     8# 4c   (optional) Edit EXP/example.sh to change ARCH, NB_YEARS
     9# 5    run "./example.sh create"
     10# 6    EXP run "./example.sh submit"
     11
     12function fullpath()
     13{
     14    echo "$(cd -P $1 ; pwd)"
     15}
     16
     17function years()
     18{
     19    for ((i=$1;i<=$2;i++)) ; do
     20        echo $(printf 'year%02d' $i)
     21    done
     22}
    223
    324function cmd_create()
    425{
    5     export ESM_ROOT="$PWD/../../"
    6     export ARCH=X64_CURIE
    7     STORE_ROOT="$STOREDIR/aquaplanet"
    8     STORE0L="$STORE_ROOT/ce0l"
    9     for DIR in ce0l year01 year02 ; do
     26    export ESM_ROOT=$(fullpath ESM_ROOT)
     27    STORE_ROOT=$( fullpath $PWD/storedir )
     28    YEARS=$(years 1 $NB_YEARS)
     29    for DIR in ce0l $YEARS ; do
    1030        rm -rf $DIR $STORE_ROOT/$DIR
    1131    done
    12     ./prepare.sh ce0l                                ce0l   "$STORE0L"
    13     ./prepare.sh first $STORE0L                      year01 "$STORE_ROOT/year01"
    14     ./prepare.sh next  $STORE0L "$STORE_ROOT/year01" year02 "$STORE_ROOT/year02"
     32    STORE0L="$STORE_ROOT/ce0l"
     33    $BASEDIR/prepare.sh ce0l ce0l "$STORE0L"
     34    $BASEDIR/prepare.sh first $STORE0L year01 "$STORE_ROOT/year01"
     35    PREV=year01
     36    for YEAR in $(years 2 $NB_YEARS) ; do
     37        $BASEDIR/prepare.sh next  $STORE0L "$STORE_ROOT/$PREV" $YEAR "$STORE_ROOT/$YEAR"
     38        PREV=$YEAR
     39    done
    1540}
    1641
     
    2954    DEP=""
    3055    submit_$ARCH ce0l
    31     submit_$ARCH year01 $DEP
    32     submit_$ARCH year02 $DEP
     56    for YEAR in $(years 1 $NB_YEARS) ; do
     57        submit_$ARCH $YEAR $DEP
     58    done
     59}
     60
     61function cmd_copy()
     62{
     63    export ESM_ROOT=$( fullpath $BASEDIR/../../ )
     64    ln -sf $ESM_ROOT ESM_ROOT
     65    cp -fp $BASEDIR/*.sh $BASEDIR/*.xml $BASEDIR/*.def .
     66    ls -lrh
    3367}
    3468
     
    3872}
    3973
     74NB_YEARS=10
     75BASEDIR=$(dirname ${BASH_SOURCE[0]})
     76BASEDIR=$( fullpath $BASEDIR )
    4077echo "Your command : $0 $*"
    41 echo "Usage : $0 [create|submit]"
    42 ARCH=X64_CURIE
     78echo "Script base dir : $BASEDIR"
     79echo "Run from : $(fullpath $PWD)"
     80echo "Usage : $0 [copy|create|submit]"
     81export ARCH=X64_CURIE
    4382cmd_$1
  • dynamico_lmdz/aquaplanet/OLD_PHYSIC/RUN_AQUAPLANET_DYNAMICO_LMDZ5/iodef.xml

    r4035 r4037  
    1313                <variable_group id="parameters" >
    1414                   <variable id="info_level" type="int">100</variable>
    15                 </variable_group>
     15                   <variable id="using_server" type="bool">USING_SERVER</variable>
     16                </variable_group>
    1617                </variable_definition>
    1718        </context>
  • dynamico_lmdz/aquaplanet/OLD_PHYSIC/RUN_AQUAPLANET_DYNAMICO_LMDZ5/prepare.sh

    r3978 r4037  
    149149function epilogue_all() {
    150150    cat <<EOF
    151 cp *.def *.xml job.sh store/
    152 mv apbp.nc hist*.nc xios_*.err xios_*.out gcm.log store/
    153 ls -l > store/ls
     151mkdir logs
     152cp *.def *.xml job.sh logs/
     153mv apbp.nc *.err *.out gcm.log logs/
     154tar czf logs.tgz logs
     155mv hist*.nc logs.tgz store/
    154156# cleanup
    155157rm -f *.nc
     
    193195
    194196function batch_X64_CURIE() { # $1 = first or next
     197NB_MPI_TOTAL=$(( $NB_MPI_DYNAMICO + $NB_MPI_XIOS ))
    195198cat <<EOF
    196199#!/bin/bash
     
    201204#MSUB -x
    202205## Number of tasks (=MPI processes) to use
    203 #MSUB -n 176
     206#MSUB -n $NB_MPI_TOTAL
    204207## Elapsed time limit in seconds
    205 #MSUB -T 7200
     208#MSUB -T 10800
    206209## Quality of Service required (long [3 days], normal [1 day], test [30 min])
    207210#MSUB -Q normal
     
    209212$( prologue_all )
    210213$( prologue_$1 )
    211 date > gcm.log
    212214export OMP_NUM_THREADS=1
    213 ccc_mprun -f mpmd.conf >> gcm.log
    214 date >> gcm.log
     215ccc_mprun -f mpmd.conf
    215216$( epilogue_$1 )
    216217$( epilogue_all )
     
    218219
    219220cat <<EOF > $MYDIR/mpmd.conf
    220 160 $ICOSA_LMDZ
    221 16 $XIOS_SERVER
    222 EOF
    223 
     221$NB_MPI_DYNAMICO ./gcm.sh
     222$NB_MPI_XIOS $XIOS_SERVER
     223EOF
     224
     225cat <<EOF > $MYDIR/gcm.sh
     226#!/bin/bash
     227ME=\${BRIDGE_MPRUN_RANKID}
     228GCM=\$(printf 'dynamico.%04d' \$ME)
     229date > \${GCM}.out
     230$ICOSA_LMDZ >> \${GCM}.out 2>\${GCM}.err
     231date >> \${GCM}.out
     232EOF
     233chmod a+x $MYDIR/gcm.sh
    224234}
    225235
     
    235245XIOS_SERVER=$(fullpath "$ESM_ROOT/XIOS/bin/xios_server.exe")
    236246ICOSA_LMDZ=$(fullpath "$ESM_ROOT/ICOSA_LMDZ/bin/icosa_lmdz.exe")
     247
     248NB_MPI_DYNAMICO=160
     249NB_MPI_XIOS=16
    237250
    238251TYPE=$1
Note: See TracChangeset for help on using the changeset viewer.