New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
trusting.sh in branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST – NEMO

source: branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting.sh @ 5545

Last change on this file since 5545 was 5523, checked in by nicolasmartin, 9 years ago

dev_r5092_CNRS_SETTE First release for Curie

  • Property eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Rev URL
File size: 4.4 KB
RevLine 
[5268]1#!/bin/bash
2
3
[5276]4# Set defaults
[5355]5#---------------------------------------------------
6NEMO_TRUS=$( pwd $( dirname $0 ) )
[5455]7DEBUG=0; PUBLISH=0
[5523]8ST='FAILED' # 'FAILED' by default
[5268]9
[5355]10# Get options for replacing some initials settings
11#---------------------------------------------------
[5268]12while [ $# -ne 0 ]; do
13    case $1 in
[5286]14        -b|--branch ) NEMO_BRAN=$2         ; shift 2;; -d|--debug  ) set -vx; DEBUG=1     ; shift  ;;
[5464]15   -e|--email  ) EMAIL=$2             ; shift 2;; -j|--job    ) NPROC=$2             ; shift 2;;
[5355]16   -h|--help   ) cat trusting_help.txt; exit  1;; -m|--machine) CFG_ARCH=$2          ; shift 2;;
17   -n|--newconf) TEST_CONF=$2         ; shift 2;; -r|--refconf) REFE_CONF=$2         ; shift 2;;
[5286]18   -t|--time   ) TIME_LIMI=$2         ; shift 2;; -p|--publish) PUBLISH=1            ; shift  ;;
[5383]19        -u|--user   ) CFG_USER=$2          ; shift 2;; -v|--version) NEMO_VERS=$2         ; shift 2;;
[5355]20                   *) cat trusting_help.txt; exit  1;;
[5268]21    esac
22done
[5276]23
[5355]24# Initialization (super-computer & user environment)
25#---------------------------------------------------
26if [[ ! -z "${CFG_ARCH}" && ! -z "${CFG_USER}" ]]; then
[5268]27
[5453]28    if   [ ! $( find ${NEMO_TRUS}/config -name ${CFG_USER}.cfg ) ]; then
29   echo 'No configuration file in '${NEMO_TRUS}'/config for '${CFG_USER}; exit 1
30    elif [ ! $( find ${NEMO_TRUS}/config -name ${CFG_ARCH}.cfg ) ]; then
31   echo 'No configuration file in '${NEMO_TRUS}'/config for '${CFG_ARCH}; exit 1
[5355]32    else
33   . ${NEMO_TRUS}/trusting.env
34    fi
[5268]35
[5355]36else
37    cat ${NEMO_TRUS}/trusting_help.txt; exit 1
38fi
[5268]39
[5355]40. ./trusting_func.sh
[5268]41
[5424]42#
43#---------------------------------------------------
[5355]44mkdir -p ${TEST_DIR} ${REFE_DIR}
45echo ${TEST_DIR} && cd ${TEST_DIR}
[5464]46date_str=$( date -ud ${DATESTR} +"%F %R %Z" )
47printf "Date\n${date_str}\n" > mesg_01_date_${CFG_USER}_${CFG_ARCH}.txt
[5355]48
[5444]49# SVN action on XIOS & NEMO essentials directories
50#---------------------------------------------------
[5521]51print_step 'SVN actions on NEMO directories'
[5444]52get_nemo_rev
53
[5438]54# Check softwares versions (source arch environment)
[5355]55#---------------------------------------------------
[5452]56print_step 'Get softwares release'
[5472]57[ -e ${ARCH_ENV} ] && . ${ARCH_ENV} > /dev/null
[5424]58get_soft_rel
[5464]59cat model.log
[5268]60
[5444]61# XIOS compiling
[5355]62#---------------------------------------------------
[5452]63print_step 'Compiling XIOS'
[5444]64cd ${DIR_XIOS}
[5521]65./make_xios --full --arch $ARCH -job $NPROC >& /dev/null
66[ ! -e ${DIR_XIOS}/lib/libxios.a ] && get_out 1
[5444]67
[5355]68# NEMO config compiled from scratch
69#---------------------------------------------------
[5465]70print_step "Compiling ${REFE_CONF} configuration"
[5276]71cd ${NEMO_CONF}
[5523]72[ -d ${TEST_CONF} ] && ./makenemo -n ${TEST_CONF} clean       >& /dev/null
[5465]73./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m $ARCH -j $NPROC >& /dev/null
[5521]74[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 2
[5268]75
[5523]76# Get namelists, xml & forcing files for running
[5355]77#---------------------------------------------------
[5465]78print_step "Preparing job by copying ${REFE_CONF} input files"
[5444]79cd ${TEST_DIR}
[5355]80find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(cfg\|opa\|ref\|xml\)' -exec cp {} . \;
[5464]81get_inputs
[5521]82[ $? -ne 0 ] && get_out 3
[5402]83[ $( find . -name '*.gz' -print -quit ) ] && gunzip *.gz
[5286]84
[5438]85# Check input files in all cases
86#---------------------------------------------------
[5464]87print_step 'Difference with standard input files list'
[5438]88diff_inputs
[5452]89
[5355]90# Job submission & computing
91#---------------------------------------------------
[5455]92print_step 'Submitting job'
[5472]93JOB_ID=$( eval ${JOB_SUBM} )
[5521]94[ $? -ne 0 ] && get_out 4
95print_step 'Holding/Running job'
[5464]96job_pending
[5455]97print_step 'Job finished'
98
[5472]99# Job state
[5355]100#---------------------------------------------------
[5472]101print_step 'Test job state'
[5485]102if   [[ ! -e time.step || $( grep -q 'E R R O R' ocean.output ) ]]; then
[5453]103    comments 'E R R O R'
[5521]104    get_out 5
[5472]105else
106    # Get time computation
107    #---------------------------------------------------
108    print_step 'Get real CPU time'
109    get_cpu_time
[5459]110fi
[5286]111
[5509]112ST='OK' # 'OK' by default
[5523]113
[5459]114# Inspect output text files
115#---------------------------------------------------
116print_step 'Test ASCII output files diff'
[5521]117diff_results
118[ "$ST" == 'FAILED' ] && get_out 8
[5286]119
[5459]120# Inspect output NetCDF files
121#---------------------------------------------------
122print_step 'Test last restart NetCDF files diff'
123diff_restart
[5521]124[ "$ST" == 'FAILED' ] && get_out 10
[5268]125
[5464]126# Get comments (ocean.output & diff model.log)
[5459]127#---------------------------------------------------
128comments 'W A R N I N G'
[5268]129
[5355]130# End
131#---------------------------------------------------
[5521]132get_out 'Code is reliable'
Note: See TracBrowser for help on using the repository browser.