Index: trunk/NVTK/INSTALL/JOBS/job_GYRE.ksh
===================================================================
--- trunk/NVTK/INSTALL/JOBS/job_GYRE.ksh	(revision 1143)
+++ trunk/NVTK/INSTALL/JOBS/job_GYRE.ksh	(revision 1144)
@@ -56,25 +56,29 @@
 cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist .
 
+# Local function to find namelists parameters
+supergrep () {
+    grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
+}
+
 # namelist modifications
-PAT_NIT000=$( grep 'nit000      =' namelist )
-PAT_NITEND=$( grep 'nitend      =' namelist )
-PAT_NSTOCK=$( grep 'nstock      =' namelist )
-PAT_NWRITE=$( grep 'nwrite      =' namelist )
-PAT_NRSTDT=$( grep 'nrstdt      =' namelist )
-PAT_NBITCM=$( grep 'nbit_cmp   ='   namelist )
-PAT_NSOLVV=$( grep 'nsolv       =' namelist )
-PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
-PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
-
-sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
--e "s%$PAT_NIT000%   nit000     =     1%" \
--e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS}%" \
--e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS}%" \
--e "s%$PAT_NWRITE%   nwrite     =     75%" \
--e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
--e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
--e "s%$PAT_NSOLVV%   nsolv     =      2%" \
--e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
-namelist > nam.tmp
+PAT_NIT000=$( supergrep nit000             namelist )
+PAT_NITEND=$( supergrep nitend             namelist )
+PAT_NSTOCK=$( supergrep nstock             namelist )
+PAT_NWRITE=$( supergrep nwrite             namelist )
+PAT_NRSTDT=$( supergrep nrstdt             namelist )
+PAT_NBITCM=$( supergrep nbit_cmp           namelist )
+PAT_NSOLVV=$( supergrep nsolv              namelist )
+PAT_RESTAR=$( supergrep ln_rstart          namelist )
+PAT_RESMLD=$( supergrep ln_trdmld_restart  namelist )
+
+sed -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%"          \
+    -e "s%$PAT_NIT000%   nit000     =     1   %"           \
+    -e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS} %" \
+    -e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS} %" \
+    -e "s%$PAT_NWRITE%   nwrite     =     75  %"           \
+    -e "s%$PAT_NRSTDT%   nrstdt     =     0   %"           \
+    -e "s%$PAT_NBITCM%   nbit_cmp   =     1%"              \
+    -e "s%$PAT_NSOLVV%   nsolv     =      2%"              \
+    -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" namelist > nam.tmp
 
 mv nam.tmp namelist
@@ -100,19 +104,18 @@
     fi
 
-    # namelist modifications
-    PAT_NIT000=$( grep 'nit000     =' namelist )
-    PAT_NITEND=$( grep 'nitend     =' namelist )
-    PAT_NRSTDT=$( grep 'nrstdt     =' namelist )
-    PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
-    PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+    # Ocean namelist modifications
+    PAT_NIT000=$( supergrep nit000             namelist )
+    PAT_NITEND=$( supergrep nitend             namelist )
+    PAT_NRSTDT=$( supergrep nrstdt             namelist )
+    PAT_RESTAR=$( supergrep ln_rstart          namelist )
+    PAT_RESMLD=$( supergrep ln_trdmld_restart  namelist )
     ORCA_NIT000=$(( $ITERATIONS + 1 ))
     ORCA_NITEND=$(( $ITERATIONS*2 ))
     
-    sed    -e "s/$PAT_RESTAR/   ln_rstart   =  .true./" \
-    -e "s/$PAT_NIT000/   nit000     =     $ORCA_NIT000/" \
-    -e "s/$PAT_NITEND/   nitend     =     $ORCA_NITEND/" \
-    -e "s/$PAT_NRSTDT/   nrstdt     =     2/" \
-    -e "s/$PAT_RESMLD/   ln_trdmld_restart =  .true./" \
-    namelist > nam.tmp
+    sed  -e "s%$PAT_RESTAR%   ln_rstart   =  .true.%"          \
+         -e "s%$PAT_NIT000%   nit000     =     $ORCA_NIT000 %" \
+         -e "s%$PAT_NITEND%   nitend     =     $ORCA_NITEND %" \
+         -e "s%$PAT_NRSTDT%   nrstdt     =     2%"             \
+         -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .true.%" namelist > nam.tmp
     
     mv nam.tmp namelist
Index: trunk/NVTK/INSTALL/JOBS/job_GYRE_LOBSTER.ksh
===================================================================
--- trunk/NVTK/INSTALL/JOBS/job_GYRE_LOBSTER.ksh	(revision 1143)
+++ trunk/NVTK/INSTALL/JOBS/job_GYRE_LOBSTER.ksh	(revision 1144)
@@ -56,25 +56,29 @@
 cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist .
 
+# Local function to find namelists parameters
+supergrep () {
+    grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
+}
+
 # namelist modifications
-PAT_NIT000=$( grep 'nit000      =' namelist )
-PAT_NITEND=$( grep 'nitend      =' namelist )
-PAT_NSTOCK=$( grep 'nstock      =' namelist )
-PAT_NWRITE=$( grep 'nwrite      =' namelist )
-PAT_NRSTDT=$( grep 'nrstdt      =' namelist )
-PAT_NBITCM=$( grep 'nbit_cmp   ='   namelist )
-PAT_NSOLVV=$( grep 'nsolv       =' namelist )
-PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
-PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
-
-sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
--e "s%$PAT_NIT000%   nit000     =     1%" \
--e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS}%" \
--e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS}%" \
--e "s%$PAT_NWRITE%   nwrite     =     75%" \
--e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
--e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
--e "s%$PAT_NSOLVV%   nsolv     =      2%" \
--e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
-namelist > nam.tmp
+PAT_NIT000=$( supergrep nit000             namelist )
+PAT_NITEND=$( supergrep nitend             namelist )
+PAT_NSTOCK=$( supergrep nstock             namelist )
+PAT_NWRITE=$( supergrep nwrite             namelist )
+PAT_NRSTDT=$( supergrep nrstdt             namelist )
+PAT_NBITCM=$( supergrep nbit_cmp           namelist )
+PAT_NSOLVV=$( supergrep nsolv              namelist )
+PAT_RESTAR=$( supergrep ln_rstart          namelist )
+PAT_RESMLD=$( supergrep ln_trdmld_restart  namelist )
+
+sed -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%"          \
+    -e "s%$PAT_NIT000%   nit000     =     1   %"           \
+    -e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS} %" \
+    -e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS} %" \
+    -e "s%$PAT_NWRITE%   nwrite     =     75  %"           \
+    -e "s%$PAT_NRSTDT%   nrstdt     =     0   %"           \
+    -e "s%$PAT_NBITCM%   nbit_cmp   =     1%"              \
+    -e "s%$PAT_NSOLVV%   nsolv     =      2%"              \
+    -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" namelist > nam.tmp
 
 mv nam.tmp namelist
@@ -85,15 +89,14 @@
 
 # namelist modifications
-PAT_TRC=$( grep 'nwritetrc   =' namelist_top_f90 )
-PAT_TRD=$( grep 'nwritetrd  ='  namelist_top_f90 )
-
-sed    -e "s/$PAT_TRC/   nwritetrc   = ${ITERATIONS},/" \
--e "s/$PAT_TRD/   nwritetrd  = ${ITERATIONS},/" \
-namelist_top_f90 > nam.tmp
+PAT_TRC=$( supergrep nwritetrc  namelist_top_f90 )
+PAT_TRD=$( supergrep nwritetrd  namelist_top_f90 )
+
+sed -e "s%$PAT_TRC%   nwritetrc   = ${ITERATIONS}%" \
+    -e "s%$PAT_TRD%   nwritetrd  = ${ITERATIONS}%"  namelist_top_f90 > nam.tmp
 
 mv nam.tmp namelist_top
 
-PAT_ADD=$( grep 'nwritedia    =' namelist_lobster_f90 )
-sed    -e "s/$PAT_ADD/   nwritedia    = ${ITERATIONS},/" namelist_lobster_f90 > nam.tmp
+PAT_ADD=$( supergrep nwritedia namelist_lobster_f90 )
+sed -e "s%$PAT_ADD%   nwritedia    = ${ITERATIONS}%" namelist_lobster_f90 > nam.tmp
 mv nam.tmp namelist_lobster
 
@@ -121,26 +124,23 @@
 
     # Ocean namelist modifications
-    PAT_NIT000=$( grep 'nit000     =' namelist )
-    PAT_NITEND=$( grep 'nitend     =' namelist )
-    PAT_NRSTDT=$( grep 'nrstdt     =' namelist )
-    PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
-    PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+    PAT_NIT000=$( supergrep nit000             namelist )
+    PAT_NITEND=$( supergrep nitend             namelist )
+    PAT_NRSTDT=$( supergrep nrstdt             namelist )
+    PAT_RESTAR=$( supergrep ln_rstart          namelist )
+    PAT_RESMLD=$( supergrep ln_trdmld_restart  namelist )
     ORCA_NIT000=$(( $ITERATIONS + 1 ))
     ORCA_NITEND=$(( $ITERATIONS*2 ))
     
-    sed    -e "s/$PAT_RESTAR/   ln_rstart   =  .true./" \
-    -e "s/$PAT_NIT000/   nit000     =     $ORCA_NIT000/" \
-    -e "s/$PAT_NITEND/   nitend     =     $ORCA_NITEND/" \
-    -e "s/$PAT_NRSTDT/   nrstdt     =     2/" \
-    -e "s/$PAT_RESMLD/   ln_trdmld_restart =  .true./" \
-    namelist > nam.tmp
+    sed  -e "s%$PAT_RESTAR%   ln_rstart   =  .true.%"          \
+         -e "s%$PAT_NIT000%   nit000     =     $ORCA_NIT000 %" \
+         -e "s%$PAT_NITEND%   nitend     =     $ORCA_NITEND %" \
+         -e "s%$PAT_NRSTDT%   nrstdt     =     2%"             \
+         -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .true.%" namelist > nam.tmp
     
     mv nam.tmp namelist
 
     # Biogeochemistry namelist modifications
-    PAT_RESTAR=$( grep '   lrsttr      = ' namelist_top )
-    
-    sed    -e "s/$PAT_RESTAR/   lrsttr      = .true.,/" namelist_top > nam.tmp
-    
+    PAT_RESTAR=$( supergrep lrsttr  namelist_top )
+    sed -e "s%$PAT_RESTAR%   lrsttr      = .true. %" namelist_top > nam.tmp
     mv nam.tmp namelist_top
 
Index: trunk/NVTK/INSTALL/JOBS/job_ORCA2_LIM.ksh
===================================================================
--- trunk/NVTK/INSTALL/JOBS/job_ORCA2_LIM.ksh	(revision 1143)
+++ trunk/NVTK/INSTALL/JOBS/job_ORCA2_LIM.ksh	(revision 1144)
@@ -59,31 +59,35 @@
 cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/namelist_ice_lim2 namelist_ice
 
+# Local function to find namelists parameters
+supergrep () {
+    grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
+}
+
 # namelist modifications
-PAT_NIT000=$( grep 'nit000      =' namelist )
-PAT_NITEND=$( grep 'nitend      =' namelist )
-PAT_NSTOCK=$( grep 'nstock      =' namelist )
-PAT_NWRITE=$( grep 'nwrite      =' namelist )
-PAT_NRSTDT=$( grep 'nrstdt      =' namelist )
-PAT_NBITCM=$( grep 'nbit_cmp   ='   namelist )
-PAT_TRACEN=$( grep 'ln_traadv_cen2   =' namelist )
-PAT_TRATVD=$( grep 'ln_traadv_tvd    =' namelist )
-PAT_N_CLAA=$( grep 'n_cla       =' namelist )
-PAT_NSOLVV=$( grep 'nsolv       =' namelist )
-PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
-PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
-
-sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
--e "s%$PAT_NIT000%   nit000     =     1%" \
--e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS}%" \
--e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS}%" \
--e "s%$PAT_NWRITE%   nwrite     =     75%" \
--e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
--e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
--e "s%$PAT_TRACEN%   ln_traadv_cen2   =  .false.%" \
--e "s%$PAT_TRATVD%   ln_traadv_tvd    =  .true.%" \
--e "s%$PAT_N_CLAA%   n_cla   = 0%" \
--e "s%$PAT_NSOLVV%   nsolv     =      2%" \
--e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
-namelist > nam.tmp
+PAT_NIT000=$( supergrep nit000             namelist )
+PAT_NITEND=$( supergrep nitend             namelist )
+PAT_NSTOCK=$( supergrep nstock             namelist )
+PAT_NWRITE=$( supergrep nwrite             namelist )
+PAT_NRSTDT=$( supergrep nrstdt             namelist )
+PAT_NBITCM=$( supergrep nbit_cmp           namelist )
+PAT_TRACEN=$( supergrep ln_traadv_cen2     namelist )
+PAT_TRATVD=$( supergrep ln_traadv_tvd      namelist )
+PAT_N_CLAA=$( supergrep n_cla              namelist )
+PAT_NSOLVV=$( supergrep nsolv              namelist )
+PAT_RESTAR=$( supergrep ln_rstart          namelist )
+PAT_RESMLD=$( supergrep ln_trdmld_restart  namelist )
+
+sed -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%"          \
+    -e "s%$PAT_NIT000%   nit000     =     1   %"           \
+    -e "s%$PAT_NITEND%   nitend     =     ${ITERATIONS} %" \
+    -e "s%$PAT_NSTOCK%   nstock     =     ${ITERATIONS} %" \
+    -e "s%$PAT_NWRITE%   nwrite     =     75  %"           \
+    -e "s%$PAT_NRSTDT%   nrstdt     =     0   %"           \
+    -e "s%$PAT_NBITCM%   nbit_cmp   =     1%"              \
+    -e "s%$PAT_TRACEN%   ln_traadv_cen2   =  .false.%"     \
+    -e "s%$PAT_TRATVD%   ln_traadv_tvd    =  .true.%"      \
+    -e "s%$PAT_N_CLAA%   n_cla   = 0%"                     \
+    -e "s%$PAT_NSOLVV%   nsolv     =      2%"              \
+    -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" namelist > nam.tmp
 
 mv nam.tmp namelist
@@ -114,19 +118,18 @@
     fi
 
-    # namelist modifications
-    PAT_NIT000=$( grep 'nit000     =' namelist )
-    PAT_NITEND=$( grep 'nitend     =' namelist )
-    PAT_NRSTDT=$( grep 'nrstdt     =' namelist )
-    PAT_RESTAR=$( grep 'ln_rstart   =' namelist )
-    PAT_RESMLD=$( grep 'ln_trdmld_restart =' namelist )
+    # Ocean namelist modifications
+    PAT_NIT000=$( supergrep nit000             namelist )
+    PAT_NITEND=$( supergrep nitend             namelist )
+    PAT_NRSTDT=$( supergrep nrstdt             namelist )
+    PAT_RESTAR=$( supergrep ln_rstart          namelist )
+    PAT_RESMLD=$( supergrep ln_trdmld_restart  namelist )
     ORCA_NIT000=$(( $ITERATIONS + 1 ))
     ORCA_NITEND=$(( $ITERATIONS*2 ))
     
-    sed    -e "s/$PAT_RESTAR/   ln_rstart   =  .true./" \
-    -e "s/$PAT_NIT000/   nit000     =     $ORCA_NIT000/" \
-    -e "s/$PAT_NITEND/   nitend     =     $ORCA_NITEND/" \
-    -e "s/$PAT_NRSTDT/   nrstdt     =     2/" \
-    -e "s/$PAT_RESMLD/   ln_trdmld_restart =  .true./" \
-    namelist > nam.tmp
+    sed  -e "s%$PAT_RESTAR%   ln_rstart   =  .true.%"          \
+         -e "s%$PAT_NIT000%   nit000     =     $ORCA_NIT000 %" \
+         -e "s%$PAT_NITEND%   nitend     =     $ORCA_NITEND %" \
+         -e "s%$PAT_NRSTDT%   nrstdt     =     2%"             \
+         -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .true.%" namelist > nam.tmp
     
     mv nam.tmp namelist
Index: trunk/NVTK/INSTALL/JOBS/job_ZAGRIF.ksh
===================================================================
--- trunk/NVTK/INSTALL/JOBS/job_ZAGRIF.ksh	(revision 1143)
+++ trunk/NVTK/INSTALL/JOBS/job_ZAGRIF.ksh	(revision 1144)
@@ -67,19 +67,24 @@
 cp ${MAINDIR}/modipsl/config/${CONF}/EXP00/AGRIF_FixedGrids.in AGRIF_FixedGrids.in
 
+# Local function to find namelists parameters
+supergrep () {
+    grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
+}
+
 for CHGFILE in `ls *namelist`
 do
      # namelist modifications
-     PAT_NIT000=$( grep 'nit000      =' ${CHGFILE} )
-     PAT_NITEND=$( grep 'nitend      =' ${CHGFILE} )
-     PAT_NSTOCK=$( grep 'nstock      =' ${CHGFILE} )
-     PAT_NWRITE=$( grep 'nwrite      =' ${CHGFILE} )
-     PAT_NRSTDT=$( grep 'nrstdt      =' ${CHGFILE} )
-     PAT_NBITCM=$( grep 'nbit_cmp   ='   ${CHGFILE} )
-     PAT_TRACEN=$( grep 'ln_traadv_cen2   =' ${CHGFILE} )
-     PAT_TRATVD=$( grep 'ln_traadv_tvd    =' ${CHGFILE} )
-     PAT_N_CLAA=$( grep 'n_cla       =' ${CHGFILE} )
-     PAT_NSOLVV=$( grep 'nsolv       =' ${CHGFILE} )
-     PAT_RESTAR=$( grep 'ln_rstart   =' ${CHGFILE} )
-     PAT_RESMLD=$( grep 'ln_trdmld_restart =' ${CHGFILE} )
+     PAT_NIT000=$( supergrep nit000             ${CHGFILE} )
+     PAT_NITEND=$( supergrep nitend             ${CHGFILE} )
+     PAT_NSTOCK=$( supergrep nstock             ${CHGFILE} )
+     PAT_NWRITE=$( supergrep nwrite             ${CHGFILE} )
+     PAT_NRSTDT=$( supergrep nrstdt             ${CHGFILE} )
+     PAT_NBITCM=$( supergrep nbit_cmp           ${CHGFILE} )
+     PAT_TRACEN=$( supergrep ln_traadv_cen2     ${CHGFILE} )
+     PAT_TRATVD=$( supergrep ln_traadv_tvd      ${CHGFILE} )
+     PAT_N_CLAA=$( supergrep n_cla              ${CHGFILE} )
+     PAT_NSOLVV=$( supergrep nsolv              ${CHGFILE} )
+     PAT_RESTAR=$( supergrep ln_rstart          ${CHGFILE} )
+     PAT_RESMLD=$( supergrep ln_trdmld_restart  ${CHGFILE} )
 
     if [ ${CHGFILE} = 'namelist' ] ; then
@@ -93,18 +98,17 @@
     fi
 
-     sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%" \
-     -e "s%$PAT_NAMECF%$PAT_NAMECF_tmp%" \
-     -e "s%$PAT_NIT000%   nit000     =     1%" \
-     -e "s%$PAT_NITEND%   nitend     =     ${ORCA_NITEND}%" \
-     -e "s%$PAT_NSTOCK%   nstock     =     ${ORCA_NITEND}%" \
-     -e "s%$PAT_NWRITE%   nwrite     =     ${ORCA_NSTOCK}%" \
-     -e "s%$PAT_NRSTDT%   nrstdt     =     0%" \
-     -e "s%$PAT_NBITCM%   nbit_cmp =     1%" \
-     -e "s%$PAT_TRACEN%   ln_traadv_cen2   =  .false.%" \
-     -e "s%$PAT_TRATVD%   ln_traadv_tvd    =  .true.%" \
-     -e "s%$PAT_N_CLAA%   n_cla   = 0%" \
-     -e "s%$PAT_NSOLVV%   nsolv     =      2%" \
-     -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" \
-     ${CHGFILE} > nam.$$
+     sed -e "s%$PAT_RESTAR%   ln_rstart   =  .false.%"           \
+         -e "s%$PAT_NAMECF%$PAT_NAMECF_tmp%"                     \
+         -e "s%$PAT_NIT000%   nit000     =     1   %"            \
+         -e "s%$PAT_NITEND%   nitend     =     ${ORCA_NITEND} %" \
+         -e "s%$PAT_NSTOCK%   nstock     =     ${ORCA_NITEND} %" \
+         -e "s%$PAT_NWRITE%   nwrite     =     ${ORCA_NSTOCK} %" \
+         -e "s%$PAT_NRSTDT%   nrstdt     =     0   %"            \
+         -e "s%$PAT_NBITCM%   nbit_cmp =     1%"                 \
+         -e "s%$PAT_TRACEN%   ln_traadv_cen2   =  .false.%"      \
+         -e "s%$PAT_TRATVD%   ln_traadv_tvd    =  .true.%"       \
+         -e "s%$PAT_N_CLAA%   n_cla   = 0%"                      \
+         -e "s%$PAT_NSOLVV%   nsolv     =      2%"               \
+         -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .false.%" ${CHGFILE} > nam.$$
      
      mv nam.$$ ${CHGFILE} && rm -f nam.$$
@@ -143,9 +147,9 @@
     do
         # namelist modifications
-        PAT_NIT000=$( grep 'nit000     =' ${CHGFILE} )
-        PAT_NITEND=$( grep 'nitend     =' ${CHGFILE} )
-        PAT_NRSTDT=$( grep 'nrstdt     =' ${CHGFILE} )
-        PAT_RESTAR=$( grep 'ln_rstart   =' ${CHGFILE} )
-        PAT_RESMLD=$( grep 'ln_trdmld_restart =' ${CHGFILE} )
+        PAT_NIT000=$( supergrep nit000             ${CHGFILE} )
+        PAT_NITEND=$( supergrep nitend             ${CHGFILE} )
+        PAT_NRSTDT=$( supergrep nrstdt             ${CHGFILE} )
+        PAT_RESTAR=$( supergrep ln_rstart          ${CHGFILE} )
+        PAT_RESMLD=$( supergrep ln_trdmld_restart  ${CHGFILE} )
 
         if [ ${CHGFILE} = 'namelist' ] ; then
@@ -157,10 +161,9 @@
         fi
         
-        sed    -e "s%$PAT_RESTAR%   ln_rstart   =  .true.%" \
-        -e "s%$PAT_NIT000%   nit000     =     $ORCA_NIT000%" \
-        -e "s%$PAT_NITEND%   nitend     =     $ORCA_NITEND%" \
-        -e "s%$PAT_NRSTDT%   nrstdt     =     2%" \
-        -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .true.%" \
-        ${CHGFILE} > nam.$$
+        sed -e "s%$PAT_RESTAR%   ln_rstart   =  .true.%"          \
+            -e "s%$PAT_NIT000%   nit000     =     $ORCA_NIT000 %" \
+            -e "s%$PAT_NITEND%   nitend     =     $ORCA_NITEND %" \
+            -e "s%$PAT_NRSTDT%   nrstdt     =     2%"             \
+            -e "s%$PAT_RESMLD%   ln_trdmld_restart =  .true.%" ${CHGFILE} > nam.$$
         
         mv nam.$$ ${CHGFILE} && rm -f nam.$$
