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.
Changeset 14870 for utils/CI/sette_ticket2673/sette_list_avail_rev.sh – NEMO

Ignore:
Timestamp:
2021-05-16T16:54:58+02:00 (3 years ago)
Author:
acc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/CI/sette_ticket2673/sette_list_avail_rev.sh

    r12569 r14870  
    88 
    99if [ $# -gt 0 ]; then 
    10   while getopts c:h option; do  
     10  while getopts c:v:h option; do  
    1111     case $option in 
    1212        c) COMPILER=$OPTARG;; 
     13        v) SETTE_SUB_VAL=$OPTARG;; 
    1314        h | *) echo '' 
    1415               echo 'sette_list_avail_rev.sh : '  
     
    1617               echo '-c COMPILER_name :' 
    1718               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' 
    1821               echo '' 
    1922               exit 42;; 
     
    2225  shift $((OPTIND - 1)) 
    2326fi 
     27if [ ! -z $SETTE_SUB_VAL ] ; then 
     28 NEMO_VALIDATION_DIR=$NEMO_VALIDATION_DIR/$SETTE_SUB_VAL 
     29fi 
    2430 
    2531# 
    2632lst_rev () { 
    2733    # 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 
     34    # base directory 
     35    VALSUB=$1 
    3336    # config name 
    3437    CONFIG=$2 
    3538    # list of all revision available 
    3639    ALLLST=${@:3} 
    37     # number of revision total and for CONFIG 
    38     nrevall=`echo $ALLLST | wc -w` 
    39     nrevcfg=`echo $CFGLST | wc -w` 
    4040    # display 
    4141    echo "" 
    4242    printf "%-27s : " $CONFIG 
    43     irev=1 
    44     irevcfg=1 
    45     while [[ $irev -le $nrevall ]] ; do 
    46        rev=`echo $ALLLST | cut -d\  -f ${irev}` 
    47        cfgrev=`echo $CFGLST | cut -d\  -f ${irevcfg}` 
    48        if [ -z $cfgrev ] ; then cfgrev=-9999 ; fi 
    49        if [ $cfgrev == $rev ] ; then 
     43    for rev in $ALLLST 
     44    do 
     45       if [ -d ${VALSUB}/$rev/${CONFIG} ]  ; then 
    5046          printf "%-6s  " $rev 
    51           irevcfg=$((irevcfg+1)) 
    5247       else 
    53           printf "%-5s  " "***** "  
     48          printf "%-5s  " "----- "  
    5449       fi 
    55        irev=$((irev+1)) 
    5650    done 
    5751} 
     
    6155  
    6256 # list of all revision available 
    63  DIRLST=`find ${NEMO_VALID} -maxdepth 3 -mindepth 3 -type d -regex ".*\/W.*\/${COMPILER}\/.*" | sed -e "s/.*\/W.*\/${COMPILER}\///" | sort -u -r` 
     57 DIRLIST=`find ${NEMO_VALID}/${COMPILER} -maxdepth 1 -mindepth 1 -type d | sort -u -r` 
     58 DIRLIST=`basename -a $DIRLIST` 
    6459 
    6560 # display header 
     
    6863 echo "" 
    6964 printf " List of all avail. rev. is : " 
    70  for dir in `echo $DIRLST`; do printf "%-6s  " $dir ; done 
     65 for dir in `echo $DIRLIST`; do printf "%-6s  " $dir ; done 
    7166 printf "\n" 
    7267 
     
    7469 echo "" 
    7570 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  
     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  
    7772 do 
    78     DIR=${NEMO_VALIDATION_DIR}/${CONFIG}/${COMPILER} 
    79     lst_rev $DIR $CONFIG $DIRLST 
     73    DIR=${NEMO_VALIDATION_DIR}/${COMPILER}/ 
     74    lst_rev $DIR $CONFIG $DIRLIST 
    8075 done 
    8176 printf "\n" 
Note: See TracChangeset for help on using the changeset viewer.