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

source: utils/CI/sette_ticket2673/sette_list_avail_rev.sh @ 14870

Last change on this file since 14870 was 14870, checked in by acc, 3 years ago

Branch: sette_ticket2673. More tweaks. Added a few more features and aligned the utility scripts with the new directory structure. Each experiment directory in the NEMO_VALIDATION_DIR now gets a sette_config file recording the settings used to run the test. They now also get copies of the *namelist*_cfg files which can be useful for cross-checking. sette_list_avail_rev.sh now accepts the -v subdir option.

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash -f
2# set -vx
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:v:h option; do
11     case $option in
12        c) COMPILER=$OPTARG;;
13        v) SETTE_SUB_VAL=$OPTARG;;
14        h | *) echo ''
15               echo 'sette_list_avail_rev.sh : ' 
16               echo '     list all sette directory and available revisions created with the compiler specified in param.cfg or in the startup file)'
17               echo '-c COMPILER_name :'
18               echo '     list all sette directory and available revisions created with the compiler specified'
19               echo ' -v sub_dir :'
20               echo '     validation sub-directory below NEMO_VALIDATION_DIR'
21               echo ''
22               exit 42;;
23     esac
24  done
25  shift $((OPTIND - 1))
26fi
27if [ ! -z $SETTE_SUB_VAL ] ; then
28 NEMO_VALIDATION_DIR=$NEMO_VALIDATION_DIR/$SETTE_SUB_VAL
29fi
30
31#
32lst_rev () {
33    # get the list of revision available for a configuration
34    # base directory
35    VALSUB=$1
36    # config name
37    CONFIG=$2
38    # list of all revision available
39    ALLLST=${@:3}
40    # display
41    echo ""
42    printf "%-27s : " $CONFIG
43    for rev in $ALLLST
44    do
45       if [ -d ${VALSUB}/$rev/${CONFIG} ]  ; then
46          printf "%-6s  " $rev
47       else
48          printf "%-5s  " "----- " 
49       fi
50    done
51}
52
53
54  NEMO_VALID=${NEMO_VALIDATION_DIR}/
55 
56 # list of all revision available
57 DIRLIST=`find ${NEMO_VALID}/${COMPILER} -maxdepth 1 -mindepth 1 -type d | sort -u -r`
58 DIRLIST=`basename -a $DIRLIST`
59
60 # display header
61 echo ""
62 echo " Compiler used is : $COMPILER"
63 echo ""
64 printf " List of all avail. rev. is : "
65 for dir in `echo $DIRLIST`; do printf "%-6s  " $dir ; done
66 printf "\n"
67
68 # start checking configuration revision
69 echo ""
70 echo "   !---- check revision available for each configuration ----!   "
71 for CONFIG in GYRE_PISCES ORCA2_ICE_PISCES ORCA2_OFF_PISCES AMM12 ORCA2_SAS_ICE AGRIF_DEMO SWG ISOMIP+ OVERFLOW LOCK_EXCHANGE VORTEX ICE_AGRIF
72 do
73    DIR=${NEMO_VALIDATION_DIR}/${COMPILER}/
74    lst_rev $DIR $CONFIG $DIRLIST
75 done
76 printf "\n"
77 printf "\n"
78#
79exit
Note: See TracBrowser for help on using the repository browser.