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 12422 for utils/CI/sette_ticket2304/all_functions.sh – NEMO

Ignore:
Timestamp:
2020-02-20T15:25:47+01:00 (4 years ago)
Author:
mathiot
Message:

merge sync_mysrc and sync_expcfg into sync_config, add a clean_config function and add option in sette.sh to activate synchronisation of MY_SCR/EXPREF with CONFIG_ST/EXP00/MY_SRC (-s option) or to clean a config with makenemo clean (-c option)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • utils/CI/sette_ticket2304/all_functions.sh

    r12290 r12422  
    9191usage=" if value is a string ths is neede syntax : ./set_namelist namelist_name var_name \"new_value\" " 
    9292 
    93 # sync MYSRC files 
    94 sync_mysrc() { 
    95 lREF=cfgs/$1    # reference  
    96 lCFG=cfgs/$2    # target 
    97 if [ -d $lREF/MY_SRC ] ; then 
    98    rsync $lREF/MY_SRC/* $lCFG/MY_SRC/* 
    99 fi 
    100 } 
    101  
    102 # sync namelist files and xios related files 
    103 sync_expcfg() { 
    104 set -x 
    105 lREF=cfgs/$1 
    106 lCFG=cfgs/$2 
    107 if [ -d $lREF/EXPREF ] ; then 
    108    rsync $lREF/EXPREF/*namelist*_cfg  $lCFG/EXP00/. 
    109    rsync $lREF/EXPREF/iodef.xml       $lCFG/EXP00/. 
    110    rsync $lREF/EXPREF/context_*.xml   $lCFG/EXP00/. 
    111    rsync $lREF/EXPREF/file_def_*.xml  $lCFG/EXP00/. 
    112 fi 
    113 set +x 
     93# sync MYSRC files (input CFG and CFG_ST) 
     94sync_config() { 
     95   if [ ${SETTE_SYNC_CONFIGS} == "yes" ]; then 
     96      lREF=$3/$1    # reference  
     97      lCFG=$3/$2    # target 
     98      if [ -d $lREF/MY_SRC ] && [ -d $lCFG/MY_SRC ] ; then 
     99         rsync $lREF/MY_SRC/* $lCFG/MY_SRC/. 
     100      fi 
     101 
     102      if [ -d $lREF/EXPREF ] && [ -d $lCFG/EXP00 ] ; then 
     103         rsync $lREF/EXPREF/*namelist*_cfg  $lCFG/EXP00/. 
     104         rsync $lREF/EXPREF/iodef.xml       $lCFG/EXP00/. 
     105         rsync $lREF/EXPREF/context_*.xml   $lCFG/EXP00/. 
     106         rsync $lREF/EXPREF/file_def_*.xml  $lCFG/EXP00/. 
     107      fi 
     108   fi 
     109} 
     110 
     111# clean _ST config (input CFG CFG_ST TYPE (test or ref)) 
     112clean_config() { 
     113   if [ ${SETTE_CLEAN_CONFIGS} == "yes" ]; then 
     114      lREF=$1 
     115      lCFG=$2 
     116      lTYP=$3 
     117      if [ ${lTYP} == 'tests' ]; then 
     118         ./makenemo -n $lCFG -a $lREF clean 
     119      elif [ ${lTYP} == 'cfgs' ]; then 
     120         ./makenemo -n $lCFG -r $lREF clean 
     121      else 
     122         echo 'ERROR in the cleaning process'; exit 42 
     123      fi 
     124   fi 
    114125} 
    115126 
Note: See TracChangeset for help on using the changeset viewer.