Index: BOL/Replay/replay_clean.sh
===================================================================
--- BOL/Replay/replay_clean.sh	(revision 4373)
+++ BOL/Replay/replay_clean.sh	(revision 4378)
@@ -4,5 +4,5 @@
 replay_comment="replay automatic include"
 if [ $# = 0 ] ; then
-   \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_replay.F90 dump_ini_module.F90 get_ini_module.F90 input tmp tmp2
+   \rm -f dump_replay*.h dump_param.h dump_ini.h call_param_repla* get_ini_modul* input tmp tmp2 tmp3 tmp2_cpp
    for file in `grep "$replay_comment" *F90 | cut -d: -f1` ; do
       sed -i"" -e "/$replay_comment/d" $file
Index: BOL/Replay/replay_equip.sh
===================================================================
--- BOL/Replay/replay_equip.sh	(revision 4373)
+++ BOL/Replay/replay_equip.sh	(revision 4378)
@@ -52,7 +52,7 @@
 #  * dump_param1.h          : écriture de l'interface "in" de param (dump_param.bin fort.82)
 #  * dump_param2.h          : écriture des sorties de la routines dans phys.nc
-#  * call_param_replay.F90 : sous programme d'appelle en boucle à la param
+#  * call_param_replay : sous programme d'appelle en boucle à la param
 #  * dump_ini_module.F90   : écriture de l'interface "in" de param_ini
-#  * get_ini_module.F90    : lecture de l'interface "in" de param_ini
+#  * get_ini_module    : lecture de l'interface "in" de param_ini
 #                dans ${param_ini}_mod.bin.
 #  Par ailleurs, un programme replay1d a été ajouté dans phylmd/dyn1d
@@ -110,4 +110,5 @@
 
 case $param in
+   vdif_k) paramini=None ; inimod=None ; klon=ngrid ; klev=nlay ;;
    thermcell_main|thermcell_plume_6A|thermcell_env|thermcell_height|thermcell_dry|\
       thermcell_closure|thermcell_height|thermcell_dq|thermcell_flux2|thermcell_down| \
@@ -309,5 +310,5 @@
 if [ $nconly = false ] ; then
 
-cat > call_param_replay.F90 <<eod
+cat > call_param_replay <<eod
 subroutine call_param_replay($klon,$klev)
 USE IOIPSL, ONLY : getin
@@ -315,17 +316,17 @@
 integer :: ifin,irec,it,rec_length_replay=0,replay_irec0=1,replay_nt=1000
 eod
-grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay.F90
+grep 'intent.*::' input | sed -e 's/ //g' -e 's/,intent(.*[nt])//'>> call_param_replay
 # duplicating declaration for inout variables
 
 for var in $varinout0 ; do
-    sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/ //g' -e 's/,intent(.*[nt])//' | sed -e 's/::.*$/, allocatable, save :: '$var'_Replay0/' | sed -e 's/'$klon'/:/' -e 's/'$klev'/:/' >> call_param_replay.F90
+    sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/ //g' -e 's/,intent(.*[nt])//' | sed -e 's/::.*$/, allocatable, save :: '$var'_Replay0/' | sed -e 's/'$klon'/:/' -e 's/'$klev'/:/' >> call_param_replay
 done
 # Initalisation, shared with dump_param1.sh
-dump_param_open "in" $varin0 >> call_param_replay.F90
+dump_param_open "in" $varin0 >> call_param_replay
 for var in $varinout0 ; do
-    sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/intent(.*t)//' -e 's/^.*(/allocate('$var'_Replay0(/' -e 's/).*$/))/' >> call_param_replay.F90
+    sed -e 's/::/ :: /' -e 's/,/ , /g' -e 's/$/ /' input | grep 'intent.*inout.*::.* '$var' ' | sed -e 's/intent(.*t)//' -e 's/^.*(/allocate('$var'_Replay0(/' -e 's/).*$/))/' >> call_param_replay
 done
 
-cat >> call_param_replay.F90 <<eod
+cat >> call_param_replay <<eod
 call getin('replay_nt',replay_nt)
 call getin('replay_irec0',replay_irec0)
@@ -341,9 +342,9 @@
 eod
 
-block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay.F90
-block_Replay0 "replay_irec0 < 0" ""         _Replay0 $varinout0 >> call_param_replay.F90
-get_subroutine_arg $param $paramfile | sed -e 's/subroutine/   call/' >> call_param_replay.F90
-block_Replay0 "replay_irec0 < 0" _Replay0   ""       $varinout0 >> call_param_replay.F90
-cat >> call_param_replay.F90 <<eod
+block_Replay0 "it == 1"          _Replay0   ""       $varinout0 >> call_param_replay
+block_Replay0 "replay_irec0 < 0" ""         _Replay0 $varinout0 >> call_param_replay
+get_subroutine_arg $param $paramfile | sed -e 's/subroutine/   call/' >> call_param_replay
+block_Replay0 "replay_irec0 < 0" _Replay0   ""       $varinout0 >> call_param_replay
+cat >> call_param_replay <<eod
 enddo
 return
@@ -396,43 +397,48 @@
 #-----------------------------------------------------------------------------
 
+if [ $nconly = false -a $paramini != None ] ; then
+   varinmod=`grep -i 'intent.in' $inimod.F90 | sed -e 's/\!.*$//' | cut -d: -f3 | sed -e 's/,/ /g'`
+   varinmodv=`echo $varinmod | sed -e 's/ /,/g'`
+   cat > $iniinc <<...eod...............................................
+   open(90,file='$inimod.bin',form='unformatted')
+   write(90) $varinmodv
+   close(90)
+...eod...............................................
+   include_line "include \"$iniinc\"" $paramini $inimod.F90  -before_return
+fi # nconly = false
+
+
+#-----------------------------------------------------------------------------
+# get_ini_module gere l'initialisation du module en mode replay
+#-----------------------------------------------------------------------------
+if [ $nconly = false -a $paramini != None ] ; then
+    cat > get_ini_module <<....eod............................................
+    subroutine get_ini_module
+    use $inimod
+    IMPLICIT NONE
+....eod............................................
+    grep -i intent.in $inimod.F90  |  tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> get_ini_module
+    cat >> get_ini_module <<....eod...........................................
+    open(90,file='$inimod.bin',form='unformatted')
+    read(90) $varinmodv
+    close(90)
+....eod...........................................
+    #get_subroutine_arg $paramini $inimod.F90 ; exit
+    get_subroutine_arg $paramini $inimod.F90 | sed -e 's/subroutine/call/' >> get_ini_module
+    cat >> get_ini_module <<....eod...........................................
+    return
+    end
+....eod...........................................
+fi # nconly = false
+
+#-----------------------------------------------------------------------------
+# Inclusion de l'ecriture de l'interface de l'initialisation
+#-----------------------------------------------------------------------------
+
 if [ $nconly = false ] ; then
-varinmod=`grep -i 'intent.in' $inimod.F90 | sed -e 's/\!.*$//' | cut -d: -f3 | sed -e 's/,/ /g'`
-varinmodv=`echo $varinmod | sed -e 's/ /,/g'`
-cat > $iniinc <<eod
-open(90,file='$inimod.bin',form='unformatted')
-write(90) $varinmodv
-close(90)
-eod
-include_line "include \"$iniinc\"" $paramini $inimod.F90  -before_return
-fi # nconly = false
-
-
-#-----------------------------------------------------------------------------
-# get_ini_module gere l'initialisation du module en mode replay
-#-----------------------------------------------------------------------------
-if [ $nconly = false ] ; then
-cat > get_ini_module.F90 <<eod
-subroutine get_ini_module
-use $inimod
-IMPLICIT NONE
-eod
-grep -i intent.in $inimod.F90  |  tr '[A-Z]' '[a-z]' | sed -e 's/,.*intent.i.*)//' >> get_ini_module.F90
-cat >> get_ini_module.F90 <<eod
-open(90,file='$inimod.bin',form='unformatted')
-read(90) $varinmodv
-close(90)
-eod
-#get_subroutine_arg $paramini $inimod.F90 ; exit
-get_subroutine_arg $paramini $inimod.F90 | sed -e 's/subroutine/call/' >> get_ini_module.F90
-cat >> get_ini_module.F90 <<eod
-return
-end
-eod
-fi # nconly = false
-
-#-----------------------------------------------------------------------------
-# Inclusion de l'ecriture de l'interface de l'initialisation
-#-----------------------------------------------------------------------------
-
+     for file in get_ini_module call_param_replay ; do sed -i'' -e "s/$/					\!$replay_comment/"  $file ; done
+     cat get_ini_module >> $inimod.F90
+     cat call_param_replay >> $paramfile
+fi
 
 #\rm -f tmp input
