Index: CONFIG/UNIFORM/v6/NEMO_v6/GENERAL/DRIVER/pisces.driver
===================================================================
--- CONFIG/UNIFORM/v6/NEMO_v6/GENERAL/DRIVER/pisces.driver	(revision 3210)
+++ CONFIG/UNIFORM/v6/NEMO_v6/GENERAL/DRIVER/pisces.driver	(revision 3408)
@@ -43,31 +43,20 @@
     IGCM_debug_PushStack "MBG_Update"
 
+    V1D_ENABLE=".FALSE."
+    V5D_ENABLE=".FALSE."
+    V1M_ENABLE=".FALSE."
+    V1Y_ENABLE=".FALSE."
 
-    ##--Write Frequency Purpose
-    Nbfreq=$( echo ${config_MBG_WriteFrequency} | wc -w )
-    typeset -Z1 i=1
-    while [ $i -le ${Nbfreq} ]; do
-       topfrequency=$( echo ${config_MBG_WriteFrequency} | awk -v var="$i" "-F " '{print $var}' )
-       topfactor=$( echo ${topfrequency} | sed -e "s/[yYmMdD]//" )
-       case ${topfrequency} in
-         *Y|*y)
-            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}y_${DatesPeriod} ;
-            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_Y} ;
-            eval WFT${i}=${topfactor}Y ;;
-         *M|*m)
-            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}m_${DatesPeriod} ;
-            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_M} ;
-            eval WFT${i}=${topfactor}M ;;
-         *D|*d)
-            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}d_${DatesPeriod} ;
-            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_D} ;
-            eval WFT${i}=${topfactor}D ;;
-         *)
-      esac
-       let i=$i+1
+    for frequency in ${config_OCE_WriteFrequency} ; do
+        case ${frequency} in
+            ( 1D|1d ) V1D_ENABLE=".TRUE." ;;
+            ( 5D|5d ) V5D_ENABLE=".TRUE." ;;
+            ( 1M|1m ) V1M_ENABLE=".TRUE." ;;
+            ( *[yY] ) V1Y_ENABLE=".TRUE." ;;
+        esac
     done
 
+
     if [ X"${pisces_UserChoices_Offline_Mode}" = X"y" ] ; then
-
 
        # Period Length In Days between DateBegin and first day of calendar 0001 01 01
@@ -95,4 +84,46 @@
        typeset -r PRECIS=8
        NEMO_END=$( echo $( awk "BEGIN { printf \"%0${PRECIS}d\",${OPA_NITEND} }" ) )
+
+
+       DYN_SSH_INI=.TRUE.
+       if [ "${EXPTYPE}" = "ia"   ] ; then
+          NbDynFile=${#pisces_UserChoices_DynFiles[*]}
+          (( LengthForcing=${pisces_UserChoices_DynYearEnd} - ${pisces_UserChoices_DynYearStart} + 1 ))
+          (( DiffForcing=abs( ${pisces_UserChoices_DynYearEnd} - ${year} ) ))
+          (( ModuloForcing=${DiffForcing} % ${LengthForcing} ))
+          if [ ${ModuloForcing} -eq 0 ] ; then
+             (( year_forcing=${pisces_UserChoices_DynYearEnd} ))
+          else
+             if [ ${year} -ge ${pisces_UserChoices_DynYearStart} ] && [ ${year} -le ${pisces_UserChoices_DynYearEnd} ] ; then
+                year_forcing=${year}
+             elif [ ${year} -lt ${pisces_UserChoices_DynYearStart} ] ; then
+                (( year_forcing=${pisces_UserChoices_DynYearEnd} - ${ModuloForcing} ))
+             else
+                (( year_forcing=${pisces_UserChoices_DynYearStart} + ${ModuloForcing} - 1 ))
+             fi
+          fi
+          (( year_forcing_m1 = ${year_forcing} - 1))
+          (( year_forcing_p1 = ${year_forcing} + 1))
+          eval CurrDateFor=${year_forcing}0101_${year_forcing}1231
+          eval PrevDateFor=${year_forcing_m1}0101_${year_forcing_m1}1231
+          eval NextDateFor=${year_forcing_p1}0101_${year_forcing_p1}1231
+          (( i = 0 ))
+           while [ $i -lt ${NbDynFile} ] ; do
+             eval Suffix=${pisces_UserChoices_DynFiles[$i]}
+             eval RunFileName=${pisces_UserChoices_DynRunName}_${Suffix}
+             eval PrevDynFileName=${pisces_UserChoices_DynName}_${PrevDateFor}_${pisces_UserChoices_DynFreq}_${Suffix}
+             eval CurrDynFileName=${pisces_UserChoices_DynName}_${CurrDateFor}_${pisces_UserChoices_DynFreq}_${Suffix}
+             eval NextDynFileName=${pisces_UserChoices_DynName}_${NextDateFor}_${pisces_UserChoices_DynFreq}_${Suffix}
+##             IGCM_sys_Get ${pisces_UserChoices_R_DYN}/${PrevDynFileName}.nc  ${RunFileName}_y${year_m1}.nc
+             IGCM_sys_Get ${pisces_UserChoices_R_DYN}/${CurrDynFileName}.nc  ${RunFileName}_y${year}.nc
+##             IGCM_sys_Get ${pisces_UserChoices_R_DYN}/${NextDynFileName}.nc  ${RunFileName}_y${year_p1}.nc
+             (( i = i + 1 ))
+          done
+          if [ ${year_forcing} = ${pisces_UserChoices_DynYearStart} ] ; then
+             DYN_SSH_INI=.TRUE.
+          else
+             DYN_SSH_INI=.FALSE
+          fi
+       fi
     fi
 
@@ -137,6 +168,13 @@
    IGCM_comp_modifyNamelist blocker    namelist_top_cfg ln_rsttr  ${TOP_LRSTTR}
    IGCM_comp_modifyNamelist blocker    namelist_top_cfg nn_rsttr  ${TOP_NRSTTR}
+   IGCM_comp_modifyNamelist blocker    namelist_pisces_cfg  atcco2    ${pisces_UserChoices_AtmCo2}
    IGCM_comp_modifyNamelist blocker    namelist_pisces_cfg  nn_pisdmp  ${OPA_NPDT_YEAR}
    IGCM_comp_modifyNamelist blocker    namelist_pisces_cfg  nrdttrc    ${pisces_UserChoices_PisFreq}
+
+
+   IGCM_comp_modifyXmlFile nonblocker file_def_nemo-pisces.xml 1d enabled ${V1D_ENABLE}
+   IGCM_comp_modifyXmlFile nonblocker file_def_nemo-pisces.xml 1m enabled ${V1M_ENABLE}
+   IGCM_comp_modifyXmlFile nonblocker file_def_nemo-pisces.xml 1y enabled ${V1Y_ENABLE}
+
 
    IGCM_debug_PopStack "MBG_Update"
