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.
sette_list_avail_rev.sh in utils/CI/sette_ticket2304 – NEMO

source: utils/CI/sette_ticket2304/sette_list_avail_rev.sh @ 12237

Last change on this file since 12237 was 12237, checked in by mathiot, 4 years ago

fix issue in sette_list_avail_rev in case multiple compiler sette results #2304

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash -f
2# set -vx
3#
4lst_rev () {
5    # get the list of revision available for a configuration
6    if [ ! -d $1 ] ; then
7       CFGLST=-9999
8    else
9       CFGLST=`ls $1 | sort -u -r ` 
10    fi
11    # config name
12    CONFIG=$2
13    # list of all revision available
14    ALLLST=${@:3}
15    # number of revision total and for CONFIG
16    nrevall=`echo $ALLLST | wc -w`
17    nrevcfg=`echo $CFGLST | wc -w`
18    # display
19    echo ""
20    printf "%-27s : " $CONFIG
21    irev=1
22    irevcfg=1
23    while [[ $irev -le $nrevall ]] ; do
24       rev=`echo $ALLLST | cut -d\  -f ${irev}`
25       cfgrev=`echo $CFGLST | cut -d\  -f ${irevcfg}`
26       if [ -z $cfgrev ] ; then cfgrev=-9999 ; fi
27       if [ $cfgrev == $rev ] ; then
28          printf "%-6s  " $rev
29          irevcfg=$((irevcfg+1))
30       else
31          printf "%-5s  " "***** " 
32       fi
33       irev=$((irev+1))
34    done
35}
36
37  SETTE_DIR=$(cd $(dirname "$0"); pwd)
38  MAIN_DIR=$(dirname $SETTE_DIR)
39  . ./param.cfg
40
41  mach=${COMPILER}
42  NEMO_VALID=${NEMO_VALIDATION_DIR}/
43 
44 # list of all revision available
45 DIRLST=`find ${NEMO_VALID} -maxdepth 3 -mindepth 3 -type d -regex ".*\/W.*\/${COMPILER}\/.*" | sed -e "s/.*\/W.*\/${COMPILER}\///" | sort -u -r`
46
47 # display header
48 echo ""
49 echo " Compiler used is : $COMPILER"
50 echo ""
51 printf " List of all avail. rev. is : "
52 for dir in `echo $DIRLST`; do printf "%5s  " $dir ; done
53 printf "\n"
54
55 # start checking configuration revision
56 echo ""
57 echo "   !---- check revision available for each configuration ----!   "
58 for CONFIG in WGYRE_PISCES_ST WORCA2_ICE_PISCES_ST WORCA2_OFF_PISCES_ST WAMM12_ST WORCA2_SAS_ICE_ST WAGRIF_DEMO_ST WSPITZ12_ST WISOMIP_ST WOVERFLOW_ST WLOCK_EXCHANGE_ST WVORTEX_ST WICE_AGRIF_ST
59 do
60    DIR=${NEMO_VALIDATION_DIR}/${CONFIG}/${COMPILER}
61    lst_rev $DIR $CONFIG $DIRLST
62 done
63 printf "\n"
64 printf "\n"
65#
66exit
Note: See TracBrowser for help on using the repository browser.