[2656] | 1 | #!/bin/bash |
---|
| 2 | ############################################################# |
---|
| 3 | # Author : Simona Flavoni for NEMO |
---|
| 4 | # Contact : sflod@locean-ipsl.upmc.fr |
---|
| 5 | # |
---|
| 6 | # sette.sh : principal script of SET TEsts for NEMO (SETTE) |
---|
| 7 | # ---------------------------------------------------------------------- |
---|
| 8 | # NEMO/SETTE , NEMO Consortium (2010) |
---|
| 9 | # Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 10 | # ---------------------------------------------------------------------- |
---|
| 11 | # |
---|
| 12 | ############################################################# |
---|
[3608] | 13 | #set -vx |
---|
[2656] | 14 | set -o posix |
---|
| 15 | #set -u |
---|
| 16 | #set -e |
---|
| 17 | #+ |
---|
| 18 | # |
---|
[2665] | 19 | # =================== |
---|
| 20 | # sette_beginner.sh |
---|
| 21 | # =================== |
---|
[2656] | 22 | # |
---|
| 23 | # ---------------------------------------------- |
---|
[2665] | 24 | # Set of tests for NEMO for beginners |
---|
[2656] | 25 | # ---------------------------------------------- |
---|
| 26 | # |
---|
| 27 | # SYNOPSIS |
---|
| 28 | # ======== |
---|
| 29 | # |
---|
| 30 | # :: |
---|
| 31 | # |
---|
[2665] | 32 | # $ ./sette_beginner.sh |
---|
[2656] | 33 | # |
---|
| 34 | # DESCRIPTION |
---|
| 35 | # =========== |
---|
[2665] | 36 | # First simple example of how to use SETTE: create GYRE_SHORT configuration, compile it with 1 proc, and test it for a SHORT test: 5days |
---|
| 37 | #- |
---|
| 38 | # |
---|
[2754] | 39 | # Compiler among those in NEMOGCM/ARCH |
---|
[4147] | 40 | COMPILER=macport_osx |
---|
[3608] | 41 | export BATCH_COMMAND_PAR="llsubmit" |
---|
| 42 | export BATCH_COMMAND_SEQ=$BATCH_COMMAND_PAR |
---|
[4147] | 43 | export INTERACT_FLAG="yes" |
---|
[3635] | 44 | export MPIRUN_FLAG="yes" |
---|
[2754] | 45 | |
---|
| 46 | # Directory to run the tests |
---|
[2716] | 47 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
[2754] | 48 | MAIN_DIR=${SETTE_DIR%/SETTE} |
---|
| 49 | CONFIG_DIR=${MAIN_DIR}/CONFIG |
---|
| 50 | TOOLS_DIR=${MAIN_DIR}/TOOLS |
---|
| 51 | COMPIL_DIR=${TOOLS_DIR}/COMPILE |
---|
| 52 | |
---|
| 53 | CMP_NAM=${1:-$COMPILER} |
---|
[3294] | 54 | # Copy job_batch_COMPILER file for specific compiler into job_batch_template |
---|
| 55 | cd ${SETTE_DIR} |
---|
[4147] | 56 | ##if [ ${INTERACT_FLAG} == no ] ; then |
---|
| 57 | cp BATCH_TEMPLATE/batch-${COMPILER} job_batch_template || exit |
---|
| 58 | ##fi |
---|
[2754] | 59 | |
---|
[2656] | 60 | # Run for GYRE CONFIG |
---|
[2657] | 61 | # small test to start |
---|
[3680] | 62 | # compile GYRE configuration with gfortran_osx compiler run with 4 proc : |
---|
| 63 | export TEST_NAME="SHORT_TEST" |
---|
[4147] | 64 | cd ${CONFIG_DIR} |
---|
| 65 | . ./makenemo -m ${CMP_NAM} -n GYRE_SHORT -r GYRE -j 10 add_key "key_mpp_mpi key_nosignedzero" |
---|
[2656] | 66 | cd ${SETTE_DIR} |
---|
| 67 | . param.cfg |
---|
| 68 | . all_functions.sh |
---|
[3294] | 69 | # creation of execution directory |
---|
| 70 | . prepare_exe_dir.sh |
---|
[3608] | 71 | JOB_FILE=${EXE_DIR}/run_job.sh |
---|
[3635] | 72 | NPROC=4 |
---|
| 73 | \rm $JOB_FILE |
---|
[3294] | 74 | cd ${EXE_DIR} |
---|
[2657] | 75 | # setting namelist parameters |
---|
| 76 | # experience name |
---|
[4147] | 77 | set_namelist namelist_cfg cn_exp \"GYRE_SHORT\" |
---|
[2657] | 78 | # first time step |
---|
[4147] | 79 | set_namelist namelist_cfg nn_it000 1 |
---|
[2657] | 80 | # last time step |
---|
[4147] | 81 | set_namelist namelist_cfg nn_itend 120 |
---|
[2657] | 82 | # frequency of creation of a restart file |
---|
[4147] | 83 | set_namelist namelist_cfg nn_stock 60 |
---|
[3608] | 84 | |
---|
[2656] | 85 | cd ${SETTE_DIR} |
---|
[3635] | 86 | . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} |
---|
[3680] | 87 | # run job, with 4 processors, test named SHORT (= 60 time steps) |
---|
[3635] | 88 | cd ${SETTE_DIR} |
---|
[4147] | 89 | . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG} |
---|