Index: utils/CI/sette_ticket2673/all_functions.sh
===================================================================
--- utils/CI/sette_ticket2673/all_functions.sh	(revision 14867)
+++ utils/CI/sette_ticket2673/all_functions.sh	(revision 14869)
@@ -184,6 +184,5 @@
     fi
     [ `${SVN_CMD} status -q ${SETTE_DIR}/../{cfgs,tests,src} | wc -l` -ge 1 ] && REVISION_NB=${REVISION_NB}+
-    #NEMO_VALID=${NEMO_VALIDATION_DIR}/W${NEW_CONF}/${CMP_NAM}/${REVISION_NB}/${TEST_NAME}
-    NEMO_VALID=${NEMO_VALIDATION_DIR}/${CMP_NAM}/${REVISION_NB}/${NEW_CONF/%_ST//}/${TEST_NAME}
+    export NEMO_VALID=${NEMO_VALIDATION_DIR}/${CMP_NAM}/${REVISION_NB}/${NEW_CONF/%_ST/}/${TEST_NAME}
 }
 
@@ -199,5 +198,33 @@
 }
 
-# function to set namelists parameters
+# set_namelist_opt: function to set namelists parameters based on a yes/no selection
+# Mandatory arguments are, in order:
+# 1. namelist to be edited
+# 2. variable to be set
+# 3. yes or no switch setting
+# 4. value to set variable to if switch is yes
+# 5. value to set variable to if switch is no
+set_namelist_opt () {
+	minargcount=5
+	if [ ${#} -lt ${minargcount} ]
+	then
+		echo "not enough arguments for set_namelist_opt" >> ${SETTE_DIR}/output.sette
+		echo "Usage: set_namelist_opt namelist varname yes_or_no value_if_yes value_if_no" >> ${SETTE_DIR}/output.sette
+		exit 1
+	fi
+	unset minargcount
+        if [ $3 != 'yes' ] && [ $3 != 'no' ] ; then
+                echo 'option switch must be "yes" or "no"' >> ${SETTE_DIR}/output.sette
+                echo "${usage}" >> ${SETTE_DIR}/output.sette
+                exit 1
+        fi
+        if [ $3 == 'yes' ] ; then
+                set_namelist $1 $2 $4
+        else
+                set_namelist $1 $2 $5
+        fi
+}
+        
+# set_namelist: function to set namelists parameters
 set_namelist () {
 	minargcount=3
@@ -449,9 +476,12 @@
                 exit 1
         fi
-        if [ $2 != "true" ] && [ $2 != "false" ]
+        inarg=$2
+        if [ ${inarg} == "yes" ] ; then inarg="true" ; fi
+        if [ ${inarg} == "no" ]  ; then inarg="false" ; fi
+        if [ ${inarg} != "true" ] && [ ${inarg} != "false" ]
         then
                 echo "unrecognised argument for set_xio_using_server"
                 echo "${usage2}"
-                echo $2
+                echo ${inarg}
                 exit 1
         fi
@@ -475,5 +505,5 @@
                 exit 1
         fi
-        if [ $2 == "false" ]
+        if [ ${inarg} == "false" ]
         then
            sed -e "/using_server/s:true:false:" ${EXE_DIR}/$1 > ${EXE_DIR}/$1.tmp
Index: utils/CI/sette_ticket2673/sette_reference-configurations.sh
===================================================================
--- utils/CI/sette_ticket2673/sette_reference-configurations.sh	(revision 14867)
+++ utils/CI/sette_ticket2673/sette_reference-configurations.sh	(revision 14869)
@@ -170,10 +170,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
     set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -200,10 +196,6 @@
     set_namelist namelist_cfg cn_ocerst_in \"GYREPIS_LONG_${ITRST}_restart\"
     set_namelist namelist_top_cfg cn_trcrst_in \"GYREPIS_LONG_${ITRST}_restart_trc\"
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     for (( i=1; i<=$NPROC; i++)) ; do
         L_NPROC=$(( $i - 1 ))
@@ -240,10 +232,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
     set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -268,10 +256,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
     set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -325,12 +309,8 @@
     set_namelist namelist_cfg ln_stcor .true.
     #
-    if [ ${USING_ICEBERGS} == "no" ]  ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    if [ ${USING_ICEBERGS} == "yes" ] ; then set_namelist namelist_cfg ln_icebergs .true. ; fi
-    if [ ${USING_EXTRA_HALO} == "no" ]  ; then set_namelist namelist_cfg nn_hls 1 ; fi
-    if [ ${USING_EXTRA_HALO} == "yes" ] ; then set_namelist namelist_cfg nn_hls 2 ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_TILING} == "no" ]  ; then set_namelist namelist_cfg ln_tile .false. ; fi
-    if [ ${USING_TILING} == "yes" ] ; then set_namelist namelist_cfg ln_tile .true. ; fi
+    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
+    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
     # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
     #
@@ -346,10 +326,6 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -377,12 +353,8 @@
     set_namelist namelist_cfg ln_stcor .true.
     #
-    if [ ${USING_ICEBERGS} == "no" ]  ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    if [ ${USING_ICEBERGS} == "yes" ] ; then set_namelist namelist_cfg ln_icebergs .true. ; fi
-    if [ ${USING_EXTRA_HALO} == "no" ]  ; then set_namelist namelist_cfg nn_hls 1 ; fi
-    if [ ${USING_EXTRA_HALO} == "yes" ] ; then set_namelist namelist_cfg nn_hls 2 ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_TILING} == "no" ]  ; then set_namelist namelist_cfg ln_tile .false. ; fi
-    if [ ${USING_TILING} == "yes" ] ; then set_namelist namelist_cfg ln_tile .true. ; fi
+    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
+    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
     # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
     #
@@ -414,10 +386,6 @@
         fi
     done
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -452,12 +420,8 @@
     set_namelist namelist_cfg ln_stcor .true.
 
-    if [ ${USING_ICEBERGS} == "no" ]  ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    if [ ${USING_ICEBERGS} == "yes" ] ; then set_namelist namelist_cfg ln_icebergs .true. ; fi
-    if [ ${USING_EXTRA_HALO} == "no" ]  ; then set_namelist namelist_cfg nn_hls 1 ; fi
-    if [ ${USING_EXTRA_HALO} == "yes" ] ; then set_namelist namelist_cfg nn_hls 2 ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_TILING} == "no" ]  ; then set_namelist namelist_cfg ln_tile .false. ; fi
-    if [ ${USING_TILING} == "yes" ] ; then set_namelist namelist_cfg ln_tile .true. ; fi
+    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
+    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
     # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
 
@@ -472,10 +436,6 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -504,12 +464,8 @@
     set_namelist namelist_cfg ln_stcor .true.
 
-    if [ ${USING_ICEBERGS} == "no" ]  ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
-    if [ ${USING_ICEBERGS} == "yes" ] ; then set_namelist namelist_cfg ln_icebergs .true. ; fi
-    if [ ${USING_EXTRA_HALO} == "no" ]  ; then set_namelist namelist_cfg nn_hls 1 ; fi
-    if [ ${USING_EXTRA_HALO} == "yes" ] ; then set_namelist namelist_cfg nn_hls 2 ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_TILING} == "no" ]  ; then set_namelist namelist_cfg ln_tile .false. ; fi
-    if [ ${USING_TILING} == "yes" ] ; then set_namelist namelist_cfg ln_tile .true. ; fi
+    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
+    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
     # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
 
@@ -524,10 +480,6 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -586,12 +538,7 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -629,12 +576,7 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME}  ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -675,12 +617,7 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -715,12 +652,8 @@
     # put ln_pisdmp to false : no restoring to global mean value
     set_namelist namelist_pisces_cfg ln_pisdmp .false. 
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_COLLECTIVES} == "no" ]  ; then set_namelist namelist_cfg nn_comm 1 ; fi
-    if [ ${USING_COLLECTIVES} == "yes" ] ; then set_namelist namelist_cfg nn_comm 2 ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
+    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -766,10 +699,6 @@
     set_namelist namelist_cfg jpnj 8
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -797,10 +726,6 @@
         ln -sf ../LONG/AMM12_LONG_${ITRST}_restart_${L_NPROC}.nc .
     done
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -829,10 +754,6 @@
     set_namelist namelist_cfg jpnj 4
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -854,10 +775,6 @@
     set_namelist namelist_cfg jpnj 8
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -906,10 +823,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
     set_namelist namelist_ice_cfg ln_icediachk .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -933,10 +846,6 @@
     set_namelist namelist_cfg cn_ocerst_in \"SAS_${ITRST}_restart\"
     set_namelist namelist_ice_cfg cn_icerst_in \"SAS_${ITRST}_restart_ice\"
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     for (( i=1; i<=$NPROC; i++)) ; do
         L_NPROC=$(( $i - 1 ))
@@ -977,10 +886,6 @@
     set_namelist namelist_cfg jpnj 8
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1003,10 +908,6 @@
     set_namelist namelist_cfg jpnj 4
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1077,10 +978,6 @@
     set_namelist namelist_pisces_cfg ln_ironice .false.
     set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1126,10 +1023,6 @@
     set_namelist namelist_pisces_cfg ln_ironice .false.
     set_namelist namelist_pisces_cfg ln_hydrofe .false.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1192,10 +1085,6 @@
     set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1256,10 +1145,6 @@
         ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_ice_${L_NPROC}.nc .
     done
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1307,10 +1192,6 @@
     set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1352,10 +1233,6 @@
     set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1392,10 +1269,6 @@
     sed -i "1s/.*/0/" ${EXE_DIR}/AGRIF_FixedGrids.in
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1431,10 +1304,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
 #
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1484,10 +1353,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
     #set_namelist namelist_ice_cfg ln_icediachk .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1516,10 +1381,6 @@
         ln -sf ../LONG/WED025_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
     done
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1549,10 +1410,6 @@
     set_namelist namelist_cfg jpnj 7
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1576,10 +1433,6 @@
     set_namelist namelist_cfg jpnj 4
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
Index: utils/CI/sette_ticket2673/sette_test-cases.sh
===================================================================
--- utils/CI/sette_ticket2673/sette_test-cases.sh	(revision 14867)
+++ utils/CI/sette_ticket2673/sette_test-cases.sh	(revision 14869)
@@ -166,10 +166,6 @@
     set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -189,10 +185,6 @@
     set_namelist namelist_cfg nn_rstctl 2
     set_namelist namelist_cfg cn_ocerst_in \"OVF_LONG_${ITRST}_restart\"
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     ln -sf ../LONG/OVF_LONG_${ITRST}_restart.nc .
 
@@ -235,10 +227,6 @@
 	set_namelist namelist_cfg nn_it000 1
 	set_namelist namelist_cfg nn_itend ${ITEND}
-        if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-        if [ ${USING_MPMD} == "yes" ] ; then
-           set_xio_using_server iodef.xml true
-        else
-           set_xio_using_server iodef.xml false
-        fi
+        set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+        set_xio_using_server iodef.xml ${USING_MPMD}
         cd ${SETTE_DIR}
         . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -286,10 +274,6 @@
     set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -309,10 +293,6 @@
     set_namelist namelist_cfg nn_rstctl 2
     set_namelist namelist_cfg cn_ocerst_in \"LOCK_LONG_${ITRST}_restart\"
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     ln -sf ../LONG/LOCK_LONG_${ITRST}_restart.nc .
 
@@ -353,12 +333,8 @@
         rm namelist_*_*_*_*
         cp -pL ${CONFIG_DIR}/${NEW_CONF}/EXP00/$file namelist_cfg
-        if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
 	set_namelist namelist_cfg nn_it000 1
         set_namelist namelist_cfg nn_itend ${ITEND}
-        if [ ${USING_MPMD} == "yes" ] ; then
-           set_xio_using_server iodef.xml true
-        else
-           set_xio_using_server iodef.xml false
-        fi
+        set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+        set_xio_using_server iodef.xml ${USING_MPMD}
         cd ${SETTE_DIR}
         . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -415,10 +391,6 @@
     set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
 	
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-        set_xio_using_server iodef.xml true
-    else
-        set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -448,10 +420,6 @@
     set_namelist 1_namelist_cfg cn_ocerst_in \"VORTEX_LONG_${ITRST_1}_restart\"
       
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-        set_xio_using_server iodef.xml true
-    else
-        set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     if [ $NPROC -eq 1 ] ;  then
         ln -sf ../LONG/VORTEX_LONG_${ITRST}_restart.nc .
@@ -538,10 +506,6 @@
     set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -598,10 +562,6 @@
     set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
     
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-        set_xio_using_server iodef.xml true
-    else
-        set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -634,10 +594,6 @@
     
     
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-        set_xio_using_server iodef.xml true
-    else
-        set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     if [ $NPROC -eq 1 ] ;  then
         ln -sf ../LONG/ICE_AGRIF_LONG_${ITRST}_restart.nc .
@@ -693,10 +649,6 @@
     set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -730,10 +682,6 @@
     set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
     
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ICE_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -783,10 +731,6 @@
     set_namelist namelist_cfg jpnj 3
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ISOMIP+.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -808,10 +752,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
     set_namelist namelist_cfg cn_ocerst_in \"ISOMIP+_LONG_${ITRST}_restart\"
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     for (( i=1; i<=$NPROC; i++)) ; do
         L_NPROC=$(( $i - 1 ))
@@ -852,10 +792,6 @@
     set_namelist namelist_cfg jpnj 3
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ISOMIP+.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -878,10 +814,6 @@
     set_namelist namelist_cfg jpnj 4
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.
-    if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_ISOMIP+.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -930,10 +862,6 @@
     set_namelist namelist_cfg sn_cfctl%l_runstat .true.	
 	
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-        set_xio_using_server iodef.xml true
-    else
-        set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -954,10 +882,6 @@
     set_namelist namelist_cfg cn_ocerst_in \"SWG_LONG_${ITRST}_restart\"
       
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-        set_xio_using_server iodef.xml true
-    else
-        set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     if [ $NPROC -eq 1 ] ;  then
         ln -sf ../LONG/SWG_LONG_${ITRST}_restart.nc .
@@ -999,10 +923,6 @@
    
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
@@ -1029,10 +949,6 @@
     set_namelist namelist_cfg sn_cfctl%l_prtctl .true.
 
-    #if [ ${USING_TIMING} == "yes" ]  ; then set_namelist namelist_cfg ln_timing .true. ; fi
-    if [ ${USING_MPMD} == "yes" ] ; then
-       set_xio_using_server iodef.xml true
-    else
-       set_xio_using_server iodef.xml false
-    fi
+    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
+    set_xio_using_server iodef.xml ${USING_MPMD}
     cd ${SETTE_DIR}
     . ./prepare_job.sh input_EMPTY.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
