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 – NEMO

source: utils/CI/sette/sette_list_avail_rev.sh @ 13622

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

ticket #2304: merge branch sette_ticket2304 into sette (thank you Simon for the review and all the suggestions you made). It include synchronisation and cleaning option between the REF config and the _ST config to ease the work when the reference configurations are changed and display bug in sette_check_avail_rev

  • Property svn:executable set to *
File size: 2.3 KB
RevLine 
[10713]1#!/bin/bash -f
2# set -vx
[12569]3
4SETTE_DIR=$(cd $(dirname "$0"); pwd)
5MAIN_DIR=$(dirname $SETTE_DIR)
6
7. ./param.cfg
8
9if [ $# -gt 0 ]; then
10  while getopts c:h option; do
11     case $option in
12        c) COMPILER=$OPTARG;;
13        h | *) echo ''
14               echo 'sette_list_avail_rev.sh : ' 
15               echo '     list all sette directory and available revisions created with the compiler specified in param.cfg or in the startup file)'
16               echo '-c COMPILER_name :'
17               echo '     list all sette directory and available revisions created with the compiler specified'
18               echo ''
19               exit 42;;
20     esac
21  done
22  shift $((OPTIND - 1))
23fi
24
[10713]25#
26lst_rev () {
[11153]27    # get the list of revision available for a configuration
28    if [ ! -d $1 ] ; then
29       CFGLST=-9999
30    else
31       CFGLST=`ls $1 | sort -u -r ` 
32    fi
33    # config name
[10713]34    CONFIG=$2
[11153]35    # list of all revision available
[10713]36    ALLLST=${@:3}
[11153]37    # number of revision total and for CONFIG
[10713]38    nrevall=`echo $ALLLST | wc -w`
39    nrevcfg=`echo $CFGLST | wc -w`
[11153]40    # display
[10713]41    echo ""
42    printf "%-27s : " $CONFIG
43    irev=1
44    irevcfg=1
45    while [[ $irev -le $nrevall ]] ; do
46       rev=`echo $ALLLST | cut -d\  -f ${irev}`
[11153]47       cfgrev=`echo $CFGLST | cut -d\  -f ${irevcfg}`
[12569]48       if [ -z $cfgrev ] ; then cfgrev=-9999 ; fi
[11153]49       if [ $cfgrev == $rev ] ; then
50          printf "%-6s  " $rev
51          irevcfg=$((irevcfg+1))
52       else
53          printf "%-5s  " "***** " 
54       fi
[10713]55       irev=$((irev+1))
56    done
57}
58
59
[12569]60  NEMO_VALID=${NEMO_VALIDATION_DIR}/
[10713]61 
62 # list of all revision available
[12569]63 DIRLST=`find ${NEMO_VALID} -maxdepth 3 -mindepth 3 -type d -regex ".*\/W.*\/${COMPILER}\/.*" | sed -e "s/.*\/W.*\/${COMPILER}\///" | sort -u -r`
[10713]64
[11153]65 # display header
[10713]66 echo ""
[10769]67 echo " Compiler used is : $COMPILER"
68 echo ""
[10713]69 printf " List of all avail. rev. is : "
[12569]70 for dir in `echo $DIRLST`; do printf "%-6s  " $dir ; done
[10713]71 printf "\n"
[11153]72
73 # start checking configuration revision
[10713]74 echo ""
75 echo "   !---- check revision available for each configuration ----!   "
76 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
77 do
78    DIR=${NEMO_VALIDATION_DIR}/${CONFIG}/${COMPILER}
79    lst_rev $DIR $CONFIG $DIRLST
80 done
81 printf "\n"
82 printf "\n"
83#
84exit
Note: See TracBrowser for help on using the repository browser.