*# -*- mode: shell-script -*- "This file is the set of commands that have to be included by CNRM-CM in an atmosphere-only or a coupled experiment job in order - to provide atmosphere nudging data for a global run. - or to provide lateral boundary conditions to a limited area run of Aladin. In this case, nudging by the same data is also possible, depending on the Aladin namelist You tell CNRM-CM to use it by adding the name for the current file to variable PLUGINS (in the experiment 'param_' file). If you have moved it away from its first location (which looked like cnrm-cm/Vx.x/plugins), you must quote its full pathname in PLUGINS. CNRM-CM will dispatch these commands at various stages of the run. See CNRM-CM doc for details The parameters to set in the experiment param_ file are (they are mandatory except stated otherwise) : ATM_NUDLBC_DATA_DIR : directory on archive machine holding LBC/nudging data ATM_NUDLBC_GRE : filename pattern for tar files holding one month of LBC/nudging data, in ATM_NUDLBC_DATA_DIR; can include DDDD for year+month (see below) ATM_NUDLBC_GRED : same for data for ~ first day of a month, when applicable (not mandatory, depends on your LBC file time-grouping strategy) ATM_NUDLBC_INDEX : script for computation of tar file name from YEAR, MONTH and ATM_NUDLBC_GRE[D]. If missing, $YEAR$MONTH is substituted for DDDD in ATM_NUDLBC_GRE[D] ATM_NUDLBC_LS : string for selecting files after un-taring; used to list it when renaming it; example : '${GEOM}*LBC*' ATM_NUDLBC_GEN : prefix expected by Aladin/Arpege for LBC/Nudging data. If missing, no renaming occurs (the files should already bear the correct name w.r.t. your namelist). Otherwise, files are numbered using this prefix ATM_NUDLBC_SIZE : if tar files are not tar files but 'cat files', this parameter is mandatory and gives the chunk size. Leave empty for tar files case ATM_NUDLBC_MASK : mask for the nudging file (on GFS), if applicable (not mandatory, even in nudging case - but depends on your namelist) Hereafter, 3 examples of parameters settings : one for global nudging only, one for LBC for Aladin the EAC way, and one as for the regional coupled model. They are derived from real cases, with specific namelists THERE WAS YET NOT ENOUGH TESTING DONE WITH THIS FILE: - the global case underwent shallow testing " ################################################### [ PARAM_EXAMPLE_REGIONAL ] ATM_NUDLBC_EXPE=ERAI # Introducing an auxilliary variable ATM_NUDLBC_DATA_DIR="~mrga589/ibm/ifs/restart/${ATM_NUDLBC_EXPE}" ATM_NUDLBC_GRE=GRE${GEOM}${ATM_NUDLBC_EXPE}DDDD ATM_NUDLBC_GRED=GRED${GEOM}${ATM_NUDLBC_EXPE}DDDD ATM_NUDLBC_GEN=ELSCF0123ALBC ATM_NUDLBC_SIZE=3883008 # ATM_NUDLBC_LS= tar file not used -> use split and decide on temp names # ATM_NUDLBC_INDEX= use DDDD in tar filename pattern # ATM_NUDLBC_MASK= no nudging, for this example ################################################### [ PARAM_EXAMPLE_ALADIN ] ATM_LBC_EXPE=HISTr86hLev # Introducing an auxilliary variable ATM_NUDLBC_DATA_DIR="~mrga589/nec/ifs/restart/CORDEX/${ATM_LBC_EXPE}" ATM_NUDLBC_GRE=RE${GEOM}${ATM_LBC_EXPE}DDDD.tar ATM_NUDLBC_LS="${GEOM}${ATM_LBC_EXPE}LBC*" ATM_NUDLBC_GEN=ELSCF0123ALBC # ATM_NUDLBC_GRED= no need # ATM_NUDLBC_INDEX= no script, DDDD will be replaced by ${YEAR}${MONTH} # ATM_NUDLBC_SIZE= no need, tar files are used # ATM_NUDLBC_MASK= not relevant for pure LBC without nudging ################################################### [ PARAM_EXAMPLE_GLOBAL ] ATM_NUDLBC_DATA_DIR="~mrgu556/ERAI/nudge_${GEOM}/" ATM_NUDLBC_GRE=GRE${GEOM}ERAINNN ATM_NUDLBC_GRED=GRED${GEOM}ERAINNN ATM_NUDLBC_INDEX=~mrgu548/cnrm-cm/V5.4/toolbox/indice_ERAI.sh ATM_NUDLBC_MASK=~mrgu556/param/ATLNUD/masks/masque_nudging_nud_tl127l31r_1NS_ATLO_sp3 # ATM_NUDLBC_LS= no need , because no renaming # ATM_NUDLBC_GEN= no need - files bear names like REX${YYYYMMDDHH} # ATM_NUDLBC_SIZE= no need - they use tar files ################################################### [ PLUGIN_INSTALL ] [ -z $ATM_NUDLBC_DATA_DIR ] && echo "ATM_NUDLBC_DATA_DIR must be set to a nudging files directory" && err=1 [ -z $ATM_NUDLBC_GRE ] && echo "ATM_NUDLBC_GRE variable must be set to a filename pattern " && err=1 [ ! -z $ATM_NUDLBC_INDEX ] && [ ! -x $ATM_NUDLBC_INDEX ] && \ echo "if set, ATM_NUDLBC_INDEX must be an executable script (not the case for $ATM_NUDLBC_INDEX)" && err=1 [ ! -z $ATM_NUDLBC_MASK ] && [ ! -f $ATM_NUDLBC_MASK ] && \ echo "if set, ATM_NUDLBC_MASK must be set to an existing nudging mask file (not the case for $ATM_NUDLBC_MASK)" \ && err=1 [ ! -z $ATM_NUDLBC_GEN ] && [ -z $ATM_NUDLBC_LS ] && \ echo "If ATM_NUDLBC_GEN is set, ATM_NUDLBC_LS muts be set too" && err=1 cat >> $RELEXP/$EXPID.conf <<-EOF # Atmospheric nudging variables set by atm_nudging ATM_NUDLBC_DATA_DIR="$ATM_NUDLBC_DATA_DIR" ATM_NUDLBC_GRE=$ATM_NUDLBC_GRE ATM_NUDLBC_GRED=$ATM_NUDLBC_GRED ATM_NUDLBC_INDEX=$ATM_NUDLBC_INDEX ATM_NUDLBC_LS=$ATM_NUDLBC_LS ATM_NUDLBC_GEN=$ATM_NUDLBC_GEN ATM_NUDLBC_SIZE=$ATM_NUDLBC_SIZE ATM_NUDLBC_MASK=${ATM_NUDLBC_MASK:-no} EOF ################################################### [ PLUGIN_FETCH_LOOP1 ] ( # fetch nudging dataset mkdir -p $FTEXP/nudlbc${YEAR}${MONTH} if [ -z $ATM_NUDLBC_INDEX ] ; then GRE=${ATM_NUDLBC_GRE/DDDD/${YEAR}${MONTH}} else GRE=$( $ATM_NUDLBC_INDEX $YEAR $MONTH $ATM_NUDLBC_GRE ) fi RECUP $GRE nudlbc${YEAR}${MONTH} "${ATM_NUDLBC_DATA_DIR}" ftres GRE if [ ! -z "$ATM_NUDLBC_GRED" ] ; then if [ -z $ATM_NUDLBC_INDEX ] ; then GRED=${ATM_NUDLBC_GRED/DDDD/${YEAR}${MONTH}} else GRED=$( $ATM_NUDLBC_INDEX $YEAR $MONTH $ATM_NUDLBC_GRED ) fi RECUP $GRED nudlbc${YEAR}${MONTH} "${ATM_NUDLBC_DATA_DIR}" ftres GRED fi ) ################################################### [ PLUGIN_FETCH_LOOP2 ] ( cd $FTEXP/nudlbc${YEAR}${MONTH} # de-tar nudging dataset if [ -z $ATM_NUDLBC_SIZE ] ; then tar xvf GRE ; [ -f GRED ] && tar xvf GRED else split -b $ATM_NUDLBC_SIZE GRE RRa [ -f GRED ] && split -b $ATM_NUDLBC_SIZE GRED RRa fi /bin/rm GRE* if [ ! -z $ATM_NUDLBC_GEN ] ; then typeset -Z3 stamp=0 for i in $(ls $ATM_NUDLBC_LS); do mv $i $ATM_NUDLBC_GEN${stamp} ; stamp=$((stamp+1)) done fi ) ################################################### [ PLUGIN_COMPUTE_BEFORE ] [ $ATM_NUDLBC_MASK != 'no' ] && ln -sf $ATM_NUDLBC_MASK masque_nudging mv ${FTEXP}/nudlbc${YEAR}${MONTH}/${ATM_NUDLBC_GEN}* . rm -fR ${FTEXP}/nudlbc${YEAR}${MONTH}