Index: /branches/2017/dev_merge_2017/NEMOGCM/CONFIG/cfg.txt
===================================================================
--- /branches/2017/dev_merge_2017/NEMOGCM/CONFIG/cfg.txt	(revision 9576)
+++ /branches/2017/dev_merge_2017/NEMOGCM/CONFIG/cfg.txt	(revision 9577)
@@ -9,11 +9,2 @@
 ORCA2_SI3_PISCES OCE_SRC TOP_SRC ICE_SRC NST_SRC
 SPITZ12 OCE_SRC ICE_SRC
-GYRE_PISCES_ST OCE_SRC TOP_SRC
-ORCA2_SI3_PISCES_ST OCE_SRC TOP_SRC ICE_SRC NST_SRC
-ORCA2_OFF_PISCES_ST OCE_SRC TOP_SRC OFF_SRC
-AMM12_ST OCE_SRC
-ORCA2_SAS_SI3_ST OCE_SRC ICE_SRC NST_SRC SAS_SRC
-ORCA2_SI3_OBS_ST OCE_SRC ICE_SRC
-AGRIF_NORDIC_ST OCE_SRC ICE_SRC NST_SRC
-AGRIF_NORDIC_NOAGRIF_ST OCE_SRC ICE_SRC NST_SRC
-SPITZ12_ST OCE_SRC ICE_SRC
Index: /branches/2017/dev_merge_2017/NEMOGCM/SETTE/sette.sh
===================================================================
--- /branches/2017/dev_merge_2017/NEMOGCM/SETTE/sette.sh	(revision 9576)
+++ /branches/2017/dev_merge_2017/NEMOGCM/SETTE/sette.sh	(revision 9577)
@@ -143,6 +143,5 @@
 # SPITZ12           :  9      regional configuration including sea-ice and tides (Spitzbergen)
 
-#for config in 1 2 3 4 5 6 7 8 9
-for config in 9
+for config in 1 2 3 4 5 6 7 8 9
 do
 
Index: anches/2017/dev_merge_2017/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh
===================================================================
--- /branches/2017/dev_merge_2017/NEMOGCM/TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh	(revision 9576)
+++ 	(revision )
@@ -1,78 +1,0 @@
-#!/bin/bash
-#
-# purpose:
-#   small script to check in all *90 files of the current directory and subdirectories 
-#   if all lines with wrk_alloc have their corresponding lines with wrk_dealloc
-#
-# use:
-#   call chk_wrk_alloc.sh from the directory you want to check
-#
-# example:
-#   cd ~/dev_NEMO_MERGE_2011/NEMOGCM/NEMO
-#   ../TOOLS/MISCELLANEOUS/chk_wrk_alloc.sh
-#
-set -u
-#
-echo "check for all *90 files contained in "$( pwd )" and its subdirectories"
-#
-for ff in $( grep -il "^ *use  *wrk_nemo" $( find . -name "*90" )  $( find . -name "*h90" ) )
-do
-    ierr=0
-    
-    # number of lines with wrk_alloc
-    n1=$( grep -ic "call *wrk_alloc *(" $ff )
-    # number of lines with wrk_dealloc
-    nn1=$( grep -ic "call *wrk_dealloc *(" $ff )  
-    
-    if [ $(( $n1 + $nn1 )) -ne 0 ]
-    then
-	# replace wrk_alloc with wrk_dealloc and count the lines
-	n2=$( sed -e "s/wrk_alloc/wrk_dealloc/" $ff | grep -ic "call *wrk_dealloc *(" )
-	# we should get n2 = 2 * n1...
-	if [ $(( 2 * $n1 )) -ne $n2 ]
-	then
-	    ierr=1
-	    echo "problem with wrk_alloc in $ff" 
-	fi
-	# same story but for wrk_dealloc
-	nn2=$( sed -e "s/wrk_dealloc/wrk_alloc/" $ff | grep -ic "call *wrk_alloc *(" )
-	if [ $(( 2 * $nn1 )) -ne $nn2 ]
-	then
-	    ierr=1
-	    echo "problem with wrk_dealloc in $ff" 
-	fi
-
-	if [ $ierr -eq 0 ] # check that wrk_alloc block is the same as wrk_dealloc block
-	then
-	    grep -i "call *wrk_alloc *("   $ff | sed -e "s/ //g" | sed -e "s/!.*//g" > txt1$$
-	    grep -i "call *wrk_dealloc *(" $ff | sed -e "s/wrk_dealloc/wrk_alloc/"  | sed -e "s/ //g" | sed -e "s/!.*//g" > txt2$$
-	    cmp txt1$$ txt2$$
-	    if [ $? -ne 0 ]
-	    then
-		echo "different syntax in wrk_alloc and wrk_dealloc in $ff"
-		echo
-		for ll in $( seq 1 $n1 )  # compare each line
-		do
-		    sed -n ${ll}p txt1$$ > ll1$$
-		    sed -n ${ll}p txt2$$ > ll2$$
-		    cmp ll1$$ ll2$$ > /dev/null
-		    if [ $? -ne 0 ]
-		    then
-			grep -i "call *wrk_alloc *("   $ff | sed -n ${ll}p
-			grep -i "call *wrk_dealloc *(" $ff | sed -n ${ll}p
-			echo
-		    fi
-		    rm -f ll1$$ ll2$$
-		done
-	    fi
-	    rm -f txt1$$ txt2$$
-	else
-	    grep -i "call *wrk_alloc *(" $ff
-	    echo
-	    grep -i "call *wrk_dealloc *(" $ff	
-	    echo
-	fi
-	
-    fi
-    
-done
Index: anches/2017/dev_merge_2017/NEMOGCM/TOOLS/MISCELLANEOUS/rewrite_nemo.sh
===================================================================
--- /branches/2017/dev_merge_2017/NEMOGCM/TOOLS/MISCELLANEOUS/rewrite_nemo.sh	(revision 9576)
+++ 	(revision )
@@ -1,207 +1,0 @@
-#!/bin/bash
-#
-# rsync -av NEMO/ NEMO_no_wrkarrays/
-# cd NEMO_no_wrkarrays/
-# ../TOOLS/MISCELLANEOUS/rewrite_nemo.sh
-# cd ../CONFIG
-# ./makenemo -n ORCA2_LIM3 -s NEMO_no_wrkarrays
-#
-set -u
-#set -xv
-#
-# for on each file containing a call to work alloc
-for i in $( grep -iRl "^[^\!]*call *wrk_alloc *(" * | grep "90$" )
-do
-# create a temporary file that will be easier to process...
-    sed -e "s/dimension/DIMENSION/" -e "s/pointer/POINTER/" $i > tmp$$
-# replace "dimension(...), pointer" to "pointer, dimension(...)"
-    sed -e "s/, *DIMENSION *(\([^)]*\)) *, *POINTER/, POINTER, DIMENSION(\1)/" tmp$$ > tmp2$$
-    mv tmp2$$ tmp$$ 
-# remove all comments in $i
-    sed -e "s/\!.*//" tmp$$ > tmp2$$
-    mv tmp2$$ tmp$$
-# numbers of the lines defining the beginning and the end of each subroutine or functions
-    n1=$( egrep -ic "(^ *subroutine *[0-9a-zA-Z_]|function *[0-9a-zA-Z_][0-9a-zA-Z_]* *\(.*\))" tmp$$ )
-    n2=$( egrep -ic "(^ *end *subroutine|^ *end *function)" tmp$$ )
-    if [ $n1 -ne $n2 ]
-    then
-	echo "error with the definition of subroutine/function blocks in $i" 
-	exit
-    fi
-    linesbegin=$( egrep -in "(^ *subroutine *[0-9a-zA-Z_]|function *[0-9a-zA-Z_][0-9a-zA-Z_]* *\(.*\))" tmp$$ | sed -e "s/:.*//" )
-    linesend=$( egrep -in "(^ *end *subroutine|^ *end *function)" tmp$$ | sed -e "s/:.*//" | sort -rn )
-#
-# number of the lines containing wrk_alloc
-    cnt=$( grep -ci "^[^\!]*call *wrk_alloc *(" tmp$$ )
-# for each of these lines
-    ll=1
-    while [ $ll -le $cnt ]
-    do
-# get the line with its number
-	line=$( grep -in "^[^\!]*call *wrk_alloc *(" tmp$$ | sed -n ${ll}p | sed -e "s/\!.*//" )
-# get its number
-	lline=$( echo $line | sed -e "s/:.*//" )
-# keep only the arument of wrk_alloc between ()
-	line=$( echo $line | sed -e "s/^.*[cC][aA][lL][lL] *[wW][rR][kK]_[aA][lL][lL][oO][cC]//" | sed -e "s/[^(]*\((.*)\).*/\1/" | sed -e "s/, *k[ijkl]start *=[^,]*,/,/" | sed -e "s/, *k[ijkl]start *=.*)/ )/" )
-# find in which subroutine or function is located this call to wrk_alloc: l1 beginning l2: end
-	for lll in $linesbegin
-	do
-	    [ $lline -gt $lll ] && l1=$lll
-	done
-	for lll in $linesend
-	do
-	    [ $lline -lt $lll ] && l2=$lll
-	done
-	if [ $l2 -le $l1 ]
-	then
-	    echo "error in $i in the indentification subroutine/function block containing line $lline"
-	    exit
-	fi
-# get the last argument of the call to wrk_alloc (between the last "," and ")"
-	lw=$( echo $line | sed -e "s/.*,\(.*\)).*/\1/" | sed -e "s/ *//g" )
-# get the line containing the definition of this argument and from it get the number of dimension of the argument
-	tst=$( sed -n ${l1},${l2}p tmp$$  | grep -i "POINTER *, *DIMENSION *(.*) *::.*"${lw} | egrep -ic "[^0-9a-zA-Z_]("${lw}" *$|"${lw}" *,)" )
-	if [ $tst -ne 1 ]
-	then
-	    echo "error with ${lw} definition in $i" 
-	    exit
-	fi
-	dimsz=$( sed -n ${l1},${l2}p tmp$$  | grep -i "POINTER *, *DIMENSION *(.*) *::.*"${lw} | egrep -i "[^0-9a-zA-Z_]("${lw}" *$|"${lw}" *,)" | sed -e "s/.*POINTER *, *DIMENSION *(\(.*\)) *::.*/\1/" | sed -e "s/ //g" | wc -c )
-	dimsz=$(( $dimsz / 2 ))
-# get the number of variables concerned by the call to wrk_alloc (keep anly the , and count them)
-	nvar=$( echo $line | sed -e "s/[^,]//g" | wc -c )
-	nvar=$(( $nvar - $dimsz ))
-# get the définition of the size of the dimensions from the call to wrk_alloc 
-	case $dimsz in
-	    1) dim=$( echo $line | sed -e "s/( *\([^,]*\),.*)/\1/" | sed -e "s/ //g" ) ;; # keep between ( and the 1st ,
-	    2) dim=$( echo $line | sed -e "s/( *\([^,]*,[^,]*\),.*)/\1/" | sed -e "s/ //g" ) ;; # keep between ( and the 2nd ,
-	    3) dim=$( echo $line | sed -e "s/( *\([^,]*,[^,]*,[^,]*\),.*)/\1/" | sed -e "s/ //g" ) ;; # keep between ( and the 3rd ,
-	    4) dim=$( echo $line | sed -e "s/( *\([^,]*,[^,]*,[^,]*,[^,]*\),.*)/\1/" | sed -e "s/ //g" ) ;; # keep between ( and the 4th ,
-	    *) echo "error with the number of dimensions of $lw in $i"; exit ;;
-	esac
-# for each variable, change its definition...
-	nn=1 
-	var=$lw # start from the last argument
-	while [ $nn -le $nvar ]
-	do
-# get the line where this variable is defined.	
-	    tst=$( sed -n ${l1},${l2}p tmp$$  | grep -ni "POINTER *, *DIMENSION *(.*) *::.*"${var} | egrep -ic "[^0-9a-zA-Z_]("${var}" *$|"${var}" *,)" )
-	    if [ $tst -ne 1 ]
-	    then
-		echo "error with ${lw} definition in $i" 
-		exit
-	    fi
-# get the line number where the variable is defined
-	    lvar=$( sed -n ${l1},${l2}p tmp$$  | grep -ni "POINTER *, *DIMENSION *(.*) *::.*"${var} | egrep -i "[^0-9a-zA-Z_]("${var}" *$|"${var}" *,)" | sed -e "s/:.*//" )
-	    lvar=$(( $lvar + $l1 - 1 ))
-# get the dimension definition and compare it to ${dim}
-	    dim2=$( sed -n -e "${lvar}p" $i | sed -e "s/dimension/DIMENSION/" -e "s/\!.*//" | sed -e "s/.*, *DIMENSION *(\(.*\)).*/\1/" | sed -e "s/ //g" )
-	    if [ $( echo $dim2 | wc -c ) -ne $(( $dimsz * 2 )) ] 
-	    then 
-		if [ "$dim2" != "$dim" ] 
-		then 
-		    echo "problem in $i in the defininition of variable $var: its size is $dim but we have $dim2"
-		    sed -n -e "${lvar}p" $i
-		    exit
-		fi
-	    fi
-# remove pointer
-	    sed -e "${lvar}s/pointer/POINTER/" $i | sed -e "${lvar}s/, *POINTER *,/,/" | sed -e "${lvar}s/, *POINTER */ /" > tmp2$$
-	    mv tmp2$$ $i
-# redefine the dimensions 
-	    case $dimsz in
-		1) sed -e "${lvar}s/\(DIMENSION *(\) *: *)/\1${dim})/" $i > tmp2$$ ;;
-		2) sed -e "${lvar}s/\(DIMENSION *(\) *: *, *: *)/\1${dim})/" $i > tmp2$$ ;;
-		3) sed -e "${lvar}s/\(DIMENSION *(\) *: *, *: *, *: *)/\1${dim})/" $i > tmp2$$ ;;
-		4) sed -e "${lvar}s/\(DIMENSION *(\) *: *, *: *, *: *, *: *)/\1${dim})/" $i > tmp2$$ ;;
-	    esac
-	    mv tmp2$$ $i
-	    
-# define the next variable (previous argument)
-	    var=$( echo $line | sed -e "s/.*,\(.*\), *[^0-9a-zA-Z_]*${var}[^0-9a-zA-Z_]*[,)].*/\1/" | sed -e "s/ *//g" )
-	    nn=$(( $nn + 1 ))
-	done
-	
-	ll=$(( $ll + 1 ))
-    done
-#delete wrk_alloc line
-    sed -e "/call *wrk_alloc *(/d" -e "/CALL *wrk_alloc *(/d" \
-	-e "/call *wrk_dealloc *(/d" -e "/CALL *wrk_dealloc *(/d" \
-	-e "/USE wrk_nemo/d"  -e "/use wrk_nemo/d" $i > tmp$$
-    mv tmp$$ $i
-    
-    echo $i done
-done
-#
-# some specific changes...
-#
-# OCE_SRC/SBC/albedo.F90
-sed -e "s/DIMENSION(jpi,jpj,ijpl/DIMENSION(jpi,jpj,SIZE(pt_ice,3)/" OCE_SRC/SBC/albedo.F90 > tmp$$
-mv tmp$$ OCE_SRC/SBC/albedo.F90
-# see result of
-#    grep -i "wrk_alloc" $( find . -name "*90" ) | grep "="
-#
-# ICE_SRC/limrhg_2.F90
-#./ICE_SRC/limrhg_2.F90:      CALL wrk_alloc( jpi,jpj+2, zu0, zv0, zu_n, zv_n, zu_a, zv_a, zviszeta, zviseta, kjstart = 0 )
-#./ICE_SRC/limrhg_2.F90:      CALL wrk_alloc( jpi,jpj+2, zzfrld, zztms, zi1, zi2, zmasst, zpresh, kjstart = 0 )
-sed -e "s/DIMENSION(jpi,jpj+2/DIMENSION(jpi,0:jpj+1/" ICE_SRC/limrhg_2.F90 > tmp$$
-mv tmp$$ ICE_SRC/limrhg_2.F90
-
-# ICE_SRC/limitd_me.F90
-#./ICE_SRC/limitd_me.F90:      CALL wrk_alloc( jpi,jpj,jpl+2, Gsum, kkstart = -1 )
-sed -e "s/DIMENSION(jpi,jpj,jpl+2)/DIMENSION(jpi,jpj,-1:jpl)/" ICE_SRC/limitd_me.F90 > tmp$$
-mv tmp$$ ICE_SRC/limitd_me.F90
-
-# ICE_SRC/limitd_th.F90
-#./ICE_SRC/limitd_th.F90:      CALL wrk_alloc( jpi,jpj,jpl+1, zhbnew, kkstart = 0 )   
-sed -e "s/DIMENSION(jpi,jpj,jpl+1)/DIMENSION(jpi,jpj,0:jpl)/" ICE_SRC/limitd_th.F90 > tmp$$
-mv tmp$$ ICE_SRC/limitd_th.F90
-
-# ICE_SRC/limthd_dif.F90
-#./ICE_SRC/limthd_dif.F90:      CALL wrk_alloc( jpij,nlay_i+1, ztcond_i, zradtr_i, zradab_i, zkappa_i, ztib, zeta_i, ztitemp, z_i, zspeche_i, kjstart=0 )
-#./ICE_SRC/limthd_dif.F90:      CALL wrk_alloc( jpij,nlay_s+1,           zradtr_s, zradab_s, zkappa_s, ztsb, zeta_s, ztstemp, z_s, kjstart=0 )
-sed -e "s/DIMENSION(kiut,nlay_i+1)/DIMENSION(kiut,0:nlay_i)/" \
-    -e "s/DIMENSION(kiut,nlay_s+1)/DIMENSION(kiut,0:nlay_s)/" ICE_SRC/limthd_dif.F90 > tmp$$
-mv tmp$$ ICE_SRC/limthd_dif.F90
-
-# ICE_SRC/limthd_ent.F90
-#./ICE_SRC/limthd_ent.F90:      CALL wrk_alloc( jpij, nlay_i+3, zqh_cum0, zh_cum0, kjstart = 0 )
-#./ICE_SRC/limthd_ent.F90:      CALL wrk_alloc( jpij, nlay_i+1, zqh_cum1, zh_cum1, kjstart = 0 )
-sed -e "s/DIMENSION(jpij,nlay_i+3)/DIMENSION(jpij,0:nlay_i+2)/" \
-    -e "s/DIMENSION(jpij,nlay_i+1)/DIMENSION(jpij,0:nlay_i)/" ICE_SRC/limthd_ent.F90 > tmp$$
-mv tmp$$ ICE_SRC/limthd_ent.F90
-
-# OCE_SRC/DYN/divcur.F90
-#./OCE_SRC/DYN/divcur.F90:      CALL wrk_alloc( jpi+4, jpj  , zwv, kjstart = -1 )
-sed -e "s/DIMENSION(jpi+4,jpj)/DIMENSION(-1:jpi+2,jpj)/" OCE_SRC/DYN/divcur.F90 > tmp$$
-mv tmp$$ OCE_SRC/DYN/divcur.F90
-
-# OCE_SRC/LDF/ldfslp.F90
-#./OCE_SRC/LDF/ldfslp.F90:      CALL wrk_alloc( jpi,jpj,jpk,2, zdxrho , zdyrho, zdzrho,              klstart = 0  )
-#./OCE_SRC/LDF/ldfslp.F90:      CALL wrk_alloc( jpi,jpj,  2,2, zti_mlb, ztj_mlb,        kkstart = 0, klstart = 0  )
-sed -e "s/DIMENSION(jpi,jpj,jpk,2)/DIMENSION(jpi,jpj,jpk,0:1)/" \
-    -e "s/DIMENSION(jpi,jpj,2,2)/DIMENSION(jpi,jpj,0:1,0:1)/" OCE_SRC/LDF/ldfslp.F90 > tmp$$
-mv tmp$$ OCE_SRC/LDF/ldfslp.F90
-# OCE_SRC/ZDF/zdfkpp.F90
-#./OCE_SRC/ZDF/zdfkpp.F90:      CALL wrk_alloc( jpi,3, zmoek, kjstart = 0 )
-sed -e "s/DIMENSION(jpi,3) *::* zmoek/DIMENSION(jpi,0:2) ::   zmoek/" OCE_SRC/ZDF/zdfkpp.F90 > tmp$$
-mv tmp$$ OCE_SRC/ZDF/zdfkpp.F90
-
-# links 
-# see result of
-# find . -type l
-#
-# ./ICE_SRC/limrhg.F90
-cd ICE_SRC
-ln -sf ../ICE_SRC/limrhg.F90 .
-cd ..
-
-# ./OOO_SRC/dtadyn.F90
-cd OOO_SRC
-ln -sf ../OFF_SRC/dtadyn.F90 .
-cd ..
-
-# ./OOO_SRC/obs_fbm.F90
-cd OOO_SRC
-ln -sf ../OCE_SRC/OBS/obs_fbm.F90 .
-cd ..
