Index: /modipsl/trunk/util/README
===================================================================
--- /modipsl/trunk/util/README	(revision 6270)
+++ /modipsl/trunk/util/README	(revision 6270)
@@ -0,0 +1,36 @@
+This folder modipsl/util contains scripts for extraction of configurations and scripts for creation of makefiles.
+
+Scripts for extraction
+**********************
+* model
+Main script to extract pre-defined configurations
+Use "./model -h" for more information.
+Use "./model ConfName" by changing ConfName to the configurationi of
+your choice in the list given by ./model -h
+
+* mod.def
+This script contains all pre-defined configurations.
+The file is read by the script model.
+
+
+Scripts related to creation of makefiles
+****************************************
+Note that these scripts are not needed for newer configurations which uses
+a main compilation script instead of makefiles.
+
+* ins_make
+This script will create makefiles for folders containing AA_make and AA_make.ldef files.
+This is an old method to compile models. It is not used by newer configurations.i
+ins_make is launched by default in the end of the script model for all configurations.
+
+* AA_make.gdef
+This is an input file used by ins_make. It contains compilations options and paths for
+predefined machines at IPSL.
+
+* w_i_h
+This file is used by ins_make. It specifies for predefined machines at IPSL which target
+to use in AA_make.gdef.
+
+* ins_m_prec
+This is a script used by ins_make to configure IOIPSL compilation.
+
Index: dipsl/trunk/util/correct-cvs-diff.awk
===================================================================
--- /modipsl/trunk/util/correct-cvs-diff.awk	(revision 6269)
+++ 	(revision )
@@ -1,125 +1,0 @@
-#!/usr/bin/awk -f 
-
-# correct-cvs-diff.awk try to correct files PATH in diff lines inside wrong 
-# CVS diff files for use with patch.
-# CVS diff give header like :
-#
-# Index: src/myfile.f90
-# ===================================================================
-# RCS file: ...DIR/src/myfile.f90,v
-# retrieving revision 1.8
-# diff -U 2 -r1.8 myfile.f90
-# --- src/myfile.f90	28 Jan 2009 08:32:45 -0000	1.8
-# +++ src/myfile.f90	7 Oct 2010 16:04:00 -0000
-# 
-# But the diff line is wrong because the path for myfile is incomplete.
-# The patch will ask for the true path :
-# 
-# can't find file to patch at input line 23
-# Perhaps you should have used the -p or --strip option?
-# The text leading up to this was:
-# --------------------------
-# |Index: src/myfile.f90
-# |===================================================================
-# |RCS file: ...DIR/src/myfile.f90,v
-# |retrieving revision 1.8
-# |diff -r1.8 myfile.f90
-# --------------------------
-# File to patch:
-#
-# This script will correct the diff file by adding the minimal true PATH : 
-# diff -U 2 -r1.8 src/myfile.f90
-# 
-# command :
-# correct-cvs-diff.awk [-d] cvs-diff-file
-
-#**************************************************************
-# Author: Martial.Mancip
-# Contact: Martial.Mancip_ipsl.jussieu.fr
-# $Date: 
-# $Author: $
-# $Revision: $
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-# History:
-# Modification:
-#
-#**************************************************************
-
-#==========================
-function myprint(str) {
-  if (debug) {
-     print str
-  }
-}
-
-
-#==========================
-BEGIN {
-#  print "traitement de " ARGV[1]
-
-  nbarg=ARGC
-
-  if (ARGV[1] == "-d") {
-    debug=1
-    file=ARGV[2]
-    delete ARGV[1] 
-    nbarg--
-  } else {
-    debug=0
-    file=ARGV[1]
-  }
-
-  exit_value=0
-  if (nbarg != 2) {
-        print "Usage: correct-cvs-diff.awk [-d] cvs-diff-file"
-        exit_value=-1
-        exit
-  }
-    
-  index_found=0
-  counter=0
-  errcounter=0
-  errorfile[1]=""
-}
-
-#==========================
-{
-
-  myprint($0) 
-
-  if (index_found == 0 && match($0, "Index:.*")) {
-    index_found=1
-    counter=counter+1
-
-    nb=split($0,index_line, " ")
-    myprint("Index " counter " found with nb : " nb)
-    for (elt in index_line) {
-	myprint("index " elt "- elt  :" index_line[elt])
-    }
-    myprint("Index_path : " index_line[2])
-    print $0
-  }
-  else if (index_found == 1 && match($0, "diff .*")) {
-    myprint("diff found")
-    index_found=0
-
-    nb=split($0,diff_line, " ")
-    myprint("nb  :" nb)
-    for (elt in diff_line) {
-	myprint("diff " elt "- elt  :" diff_line[elt])
-    }
-    myprint("diff_path : " diff_line[nb])
-
-    diff_line[nb]=index_line[2]
-    i=1
-    while (i <= nb) {
-	printf("%s ",diff_line[i])
-	i=i+1
-    }
-    printf("\n")
-  }
-  else {
-    print $0
-  }
-}
Index: dipsl/trunk/util/script_diff_model
===================================================================
--- /modipsl/trunk/util/script_diff_model	(revision 6269)
+++ 	(revision )
@@ -1,390 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Martial Mancip
-# Contact: Martial.Mancip__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-# Documentation :
-# This script may be used to create a tree of last configuration downloaded by modipsl/util/model command.
-#
-# It checks the control version used for each components of the configuration and saves the diff
-# between the revision downloaded (or updated) and the modifications of the developper.
-# It saves those diff in the component directory in the copy tree. 
-# It saves also new source files. See SUFFIXES definition below for the list of extension to detect source files. 
-# 
-# It also gives a Last_log file in the root of the save tree with all informations needed to download the same
-# configuration precisely. It has the list of new and modified files and give the date (in an non human format)
-# of each modifications.
-#
-# It may be used in modipsl directory :
-# modipsl_path> util/script_diff_model
-#
-# After this use, you will have a modipsl_path/modipsl_save_diff_$( date +%F_%H%M%S ) tree that 
-# you can tar and save with the executable you have build with this modified configuration.
-#
-# Note :
-#  Be aware to modify AA_make files in your model source code tree (and not only Makefiles) if you use modipsl
-#  ins_make script and portable Makefile build. In this case, Makefiles won't be versionning and modifications
-#  won't be saves.
-#
-# You can use ___ script_recup_model ___ script to download the same configuration and make change 
-# with new files and modified source files.
-
-
-case $( hostname -s ) in
-    vargas*)
-# 	alias ls=/opt/freeware/bin/ls
-# 	alias wc=/opt/freeware/bin/wc
-# 	alias tail=/opt/freeware/bin/tail
-# 	alias tee=/opt/freeware/bin/tee
-# 	module load svn
-	return 1
-	;;
-esac
-
-# env must know MODIPSL path variable !
-MODIPSL=${MODIPSL:=$(pwd)}
-tmpMODIPSL=${MODIPSL}/tmp
-
-SUBMIT_DIR=$1
-
-DEBUG_mode=false
-
-function printDebugArray {
-    if ( ${DEBUG_mode} ); then
-	typeset nb_line i
-	eval nb_line=\${#$1[@]}
-	eval echo "$1 : " ${nb_line}
-	(( i = 0 ))
-	while [ $i -lt $nb_line ] ; do
-	    eval echo \${$1[$i]}
-	    (( i = i + 1 ))
-	done
-    fi
-}
-
-typeset tag thedate save_diff_file pathComp pathexist i filecomp filedate file SpathComp SUFFIXES NbNewFiles NbModifFiles Maxfiledate
-
-# Analyse log file: get last model command
-. ${MODIPSL}/util/script_log_analyse
-
-# Code source suffixe for new file detection 
-SUFFIXES='\(f90\|F90\|f\|F\|h\|h90\|hh\|c\|cc\|inc\|fcm\|path\|cfg\|card\|driver\|def\|def_.*\|txt\|xml\|ksh\|tex\)'
-
-MODIPSL_SAVE_NAME=modipsl_save_diff_$( date +%F_%H%M%S )
-echo "SAVE directory in " ${MODIPSL_SAVE_NAME}
-MODIPSL_SAVE=${tmpMODIPSL}/${MODIPSL_SAVE_NAME}
-printDebugArray MODIPSL_SAVE
-
-set +A ListRep -- $( find ${MODIPSL} -mindepth 1 -type d \
-    \( -not -path '*.svn*' -a -not -path '*CVS*' -a -not -path "${MODIPSL}" \
-    -a -not -path "${MODIPSL}/bin" -a -not -path "${MODIPSL}/lib" -a -not -path "${MODIPSL}/util" \
-    -a -not -path "${tmpMODIPSL}*" \) \
-    -exec bash -c " echo "'{}'" | sed -e 's&"${MODIPSL}"/&&' | tee -a >( sed -e 's&\(.*\)&"${MODIPSL_SAVE}"/\1&' | xargs mkdir -p >> out_mkdir 2>&1 ) " \; )
-rm out_mkdir
-#echo ${ListRep[0]} | tee $(ls > toto) $(ls -la > tata)
-#mkdir -Rp ${MODIPSL_SAVE}/
-printDebugArray ListRep
-
-
-echo "Last Model in log : " ${ListModelCommands[$ModelNul]} | sed -e 's&::& &g' > ${MODIPSL_SAVE}/Last_log
-echo "${NbComponents} components : " >> ${MODIPSL_SAVE}/Last_log
-echo ${ModelComponents[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ModelTags[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ModelSystems[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ModelServers[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ModelDirectories[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ModelLocalDirs[@]} >> ${MODIPSL_SAVE}/Last_log
-
-thedate=$( echo ${ListModelDates[${ModelNum}]} | sed -e "s&_& &g" | sed -e "s&-&/&g")
-
-
-(( NbNewFiles = 0 ))
-(( NbModifFiles = 0 ))
-(( Maxfiledate = 0 ))
-(( i = 0 ))
-for comp in ${ModelComponents[@]}; do
-    tag=${ModelTags[$i]}
-    echo $i $comp " : " $tag
-
-    case ${ModelLocalDirs[$i]} in
-	[a-z]*)
-	    if [ X${ModelDirectories[$i]} = X. ] ; then
-		pathComp=${ModelLocalDirs[i]}/${ModelComponents[$i]}
-		if [ -f ${pathComp} ] ; then
-		    filecomp=$( basename ${pathComp} )
-		    ListPathFile[$i]=${filecomp}
-		    pathComp=$( dirname ${pathComp} )
-		    pathexist=true
-		elif [ -d ${pathComp} ] ; then
-		    filecomp=""
-		    ListPathFile[$i]=_empty_
-		    pathexist=true
-		elif [ -d ${ModelLocalDirs[i]}/$( basename ${ModelComponents[$i]} ) ] ; then
-		    pathComp=${ModelLocalDirs[i]}/$( basename ${ModelComponents[$i]} )
-		    filecomp=""
-		    ListPathFile[$i]=_empty_
-		    pathexist=true
-		else
-		    echo "error for component : ${comp} !!"
-		    echo "  ${pathComp} does not exist."
-		    pathexist=false	
-		fi
-	    else
-		pathComp=${ModelLocalDirs[i]}/${ModelDirectories[$i]}
-		if [ -f ${pathComp} ] ; then
-		    filecomp=$( basename ${pathComp} )
-		    ListPathFile[$i]=${filecomp}
-		    pathComp=$( dirname ${pathComp} )
-		    pathexist=true
-		elif [ -d ${pathComp} ] ; then
-		    filecomp=""
-		    ListPathFile[$i]=_empty_
-		    pathexist=true
-		else
-		    echo "error for component : ${comp} !!"
-		    echo "  ${pathComp} does not exist."
-		    pathexist=false	
-		fi
-	    fi
-	    ;;
-	\.)
-	    pathComp=${ModelDirectories[$i]}
-	    if [ -f ${pathComp} ] ; then
-		filecomp=$( basename ${pathComp} )
-		ListPathFile[$i]=${filecomp}
-		pathComp=$( dirname ${pathComp} )
-		pathexist=true
-	    elif [ -d ${pathComp} ] ; then
-		filecomp=""
-		ListPathFile[$i]=_empty_
-		pathexist=true
-	    else
-		echo "error for component : ${comp} !!"
-		echo "  ${pathComp} does not exist."
-		pathexist=false	
-	    fi
-	    ;;
-	*)
-	    echo "error ${ModelLocalDirs[$i]} is not recognized as a valid path in modipsl."
-	    exit 1
-	    ;;
-    esac
-
-    if ( ${pathexist} ) ; then
-	echo "real local path = " ${pathComp}
-	ListPathComp[$i]=${pathComp}
-
-
-	cd ${pathComp}
-	SpathComp=${MODIPSL_SAVE}/${pathComp}
-
-	save_diff_file=$( echo ${comp} | sed -e 's&/&:&g' )
-	    
-	case ${ModelSystems[$i]} in
-	    svn)
-		ListPathRev[$i]=$( svn info ${filecomp} | grep "R.vision_*:" | gawk -F  ' ' '{print $2}' )
-		ListPathBranch[$i]=${comp}
-		
-		svn diff -r ${ListPathRev[$i]} ${filecomp} > ${tmpMODIPSL}/svn_diff_${save_diff_file}
-		RET=$?
-		if [ $RET -gt 0 ] ; then
-		    ListPathComp[$i]="error"
-		    ListPathFile[$i]="error"
-		    ListPathRev[$i]="error"
-		    ListPathBranch[$i]="error"
-		else
-		    svn status ${filecomp} > ${tmpMODIPSL}/svn_status_${save_diff_file}
-		    set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" )
-		    printDebugArray NewFiles
-		    for file in ${NewFiles[@]} ; do
-			echo "New file : " $file
-			cp -p $file ${SpathComp}/$( dirname $file )
-			ListNewFiles[$NbNewFiles]=${pathComp}/${file}
-			(( NbNewFiles = NbNewFiles + 1 ))
-		    done
-
-		    set -A ModifiedFiles -- $( grep "^M *" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" )
-		    printDebugArray ModifiedFiles
-		    for file in ${ModifiedFiles[@]} ; do
-			echo "Modified file : " $file
-			filedate=$( ls -l --full-time --time-style='+%Y%m%d%H%M%S' $file | gawk -F  ' ' '{print $6}' )
-			Maxfiledate=$(( ( $Maxfiledate > $filedate ) ? $Maxfiledate : $filedate ))
-			ListModifFiles[$NbModifFiles]=${pathComp}/${file}
-			ListModifFilesDate[$NbModifFiles]=${filedate}
-			(( NbModifFiles = NbModifFiles + 1 ))
-		    done
-
-		    if ( ${DEBUG_mode} ); then 
-			cp ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff
-		    else
-			rm ${tmpMODIPSL}/svn_status_${save_diff_file}
- 			mv ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff
-		    fi
-		    RET=$?
-		    if [ $RET -gt 0 ] ; then
-			ListPathComp[$i]="error"
-			ListPathFile[$i]="error"
-			ListPathRev[$i]="error"
-			ListPathBranch[$i]="error"
-		    fi
-		fi
-
-		;;
-	    cvs)
-		ListPathRev[$i]=${tag}:\"${thedate}\"
-		ListPathBranch[$i]=${tag}
-
-		cvs diff -U 2 ${filecomp} > ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00
-		#eval cvs diff -U 2 -r "${ListPathRev[$i]}" ${filecomp} > ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00
-		RET=$?
-		if [ $RET -gt 1 ] ; then
-		    ListPathComp[$i]="error"
-		    ListPathFile[$i]="error"
-		    ListPathRev[$i]="error"
-		    ListPathBranch[$i]="error"
-		else
-		    set -A NewFiles -- $( grep "^? .*\.${SUFFIXES}$" ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 | sed -e "s&? *&&" )
-		    printDebugArray NewFiles
-		    for file in ${NewFiles[@]} ; do
-			echo "New file : " $file
-			cp -p $file ${SpathComp}/$( dirname $file )
-			ListNewFiles[$NbNewFiles]=${pathComp}/${file}
-			(( NbNewFiles = NbNewFiles + 1 ))
-		    done
-
-		    set -A ModifiedFiles -- $( grep "^M .*\.${SUFFIXES}$" ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 | sed -e "s&M *&&" )
-		    printDebugArray ModifiedFiles
-		    for file in ${ModifiedFiles[@]} ; do
-			echo "Modified file : " $file
-			filedate=$( ls -l --full-time --time-style='+%Y%m%d%H%M%S' $file | gawk -F  ' ' '{print $6}' )
-			Maxfiledate=$(( ( $Maxfiledate > $filedate ) ? $Maxfiledate : $filedate ))
-			ListModifFiles[$NbModifFiles]=${pathComp}/${file}
-			ListModifFilesDate[$NbModifFiles]=${filedate}
-			(( NbModifFiles = NbModifFiles + 1 ))
-		    done
-
-		    ${MODIPSL}/util/correct-cvs-diff.awk ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00 > ${tmpMODIPSL}/cvs_diff_${save_diff_file}_01
-		    RET=$?
-		    if ( ${DEBUG_mode} ); then 
-			cp ${tmpMODIPSL}/cvs_diff_${save_diff_file}_01 ${SpathComp}/cvs_diff
-		    else
-			mv ${tmpMODIPSL}/cvs_diff_${save_diff_file}_01 ${SpathComp}/cvs_diff
-			rm ${tmpMODIPSL}/cvs_diff_${save_diff_file}_00
-		    fi
-		    RET1=$?
-		    (( RET = RET + RET1 ))
-		    if [ $RET -gt 0 ] ; then
-			ListPathComp[$i]="error"
-			ListPathFile[$i]="error"
-			ListPathRev[$i]="error"
-			ListPathBranch[$i]="error"
-		    fi
-		fi
-		;;
-	    *)
-		echo "error ${ModelSystems[$i]} is not recognized as a valid control version system for $0."
-		exit 1
-		;;
-	esac
-    else
-	ListPathComp[$i]="error"
-	ListPathFile[$i]="error"
-	ListPathRev[$i]="error"
-	ListPathBranch[$i]="error"
-    fi
-    (( i = i + 1 ))
-    echo 
-    cd ${MODIPSL}
-
-done
-
-if [ -d ${SUBMIT_DIR} ] ; then
-    echo "Save SUBMIT_DIR : " ${SUBMIT_DIR}
-    echo
-    pathComp=$( basename ${SUBMIT_DIR} )
-    LocalDirectories[$i]=$( find . -mindepth 1 -type d \
-	\( -not -path "*${MODIPSL_SAVE_NAME}*" -a -name "${pathComp}" \) | head -1 )
-    ModelDirectories[$i]=.
-
-    ListPathComp[$i]=${pathComp}
-
-    cd ${SUBMIT_DIR}
-    SpathComp=${MODIPSL_SAVE}/${LocalDirectories[$i]}
-
-    save_diff_file=${pathComp}
-	    
-    ListPathRev[$i]=$( svn info | grep "R.vision_*:" | gawk -F  ' ' '{print $2}' )
-    
-    svn diff -r ${ListPathRev[$i]} > ${tmpMODIPSL}/svn_diff_${save_diff_file}
-    RET=$?
-    if [ $RET -gt 0 ] ; then
-	ListPathComp[$i]="error"
-	ListPathFile[$i]="error"
-	ListPathRev[$i]="error"
-	ListPathBranch[$i]="error"
-    else
-	svn status > ${tmpMODIPSL}/svn_status_${save_diff_file}
-	set -A NewFiles -- $( grep "^? *\(.*\.${SUFFIXES}\|AA_.*\|BB_.*\)$" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&? *&&" )
-	printDebugArray NewFiles
-	for file in ${NewFiles[@]} ; do
-	    echo "New file : " $file
-	    cp -p $file ${SpathComp}/$( dirname $file )
-	    ListNewFiles[$NbNewFiles]=${LocalDirectories[$i]}/${file}
-	    (( NbNewFiles = NbNewFiles + 1 ))
-	done
-
-	set -A ModifiedFiles -- $( grep "^M *" ${tmpMODIPSL}/svn_status_${save_diff_file} | sed -e "s&M *&&" )
-	printDebugArray ModifiedFiles
-	for file in ${ModifiedFiles[@]} ; do
-	    echo "Modified file : " $file
-# 	    filedate=$( ls -l --full-time --time-style='+%Y%m%d%H%M%S' $file | gawk -F  ' ' '{print $6}' )
-# 	    Maxfiledate=$(( ( $Maxfiledate > $filedate ) ? $Maxfiledate : $filedate ))
-	    ListModifFiles[$NbModifFiles]=${LocalDirectories[$i]}/${file}
-	    ListModifFilesDate[$NbModifFiles]=${filedate}
-	    (( NbModifFiles = NbModifFiles + 1 ))
-	done
-
-	if ( ${DEBUG_mode} ); then 
-	    cp ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff
-	else
-	    rm ${tmpMODIPSL}/svn_status_${save_diff_file}
- 	    mv ${tmpMODIPSL}/svn_diff_${save_diff_file} ${SpathComp}/svn_diff
-	fi
-	RET=$?
-	if [ $RET -gt 0 ] ; then
-	    ListPathComp[$i]="error"
-	    ListPathFile[$i]="error"
-	    ListPathRev[$i]="error"
-	    ListPathBranch[$i]="error"
-	fi
-    fi
-    
-    echo 
-    cd ${MODIPSL}
-fi
-
-printDebugArray ListPathComp
-printDebugArray ListPathFile
-printDebugArray ListPathRev
-printDebugArray ListPathBranch
-printDebugArray ListNewFiles
-
-echo ${ListPathComp[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ListPathFile[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ListPathRev[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ListPathBranch[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ListNewFiles[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ListModifFiles[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${ListModifFilesDate[@]} >> ${MODIPSL_SAVE}/Last_log
-echo ${Maxfiledate} >> ${MODIPSL_SAVE}/Last_log
-
-
-echo "out directory in " ${MODIPSL_SAVE}
Index: dipsl/trunk/util/script_log_analyse
===================================================================
--- /modipsl/trunk/util/script_log_analyse	(revision 6269)
+++ 	(revision )
@@ -1,92 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Martial Mancip
-# Contact: Martial.Mancip__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-# Documentation :
-# This script gives an analyse of LAST configuration from mod.def downloaded by model command.
-#
-# It will create shell variables :
-# The list of components of the configuration : ModelComponents / NbComponents
-# And for each components :
-# - The tags or branch name : ModelTags
-# - The version control system name : ModelSystems
-# - The version control server address and login : ModelServers
-# - The version control server directory for this version : ModelDirectories
-# - The modipsl local directory : ModelLocalDirs
-
-
-typeset sizelog thedate logfile mymodel i  NbModelCommands NbModelNames
-
-logfile=${MODIPSL}/util/log
-
-set -A ListModelCommands -- $( cat ${logfile} | grep '\./model' | sed -e 's& &::&g')
-printDebugArray ListModelCommands
-
-NbModelCommands=${#ListModelCommands[@]}
-
-set -A ListModelNames -- $( cat ${logfile} | grep '\-\-\-\ Model' | sed -e 's&.*: *&&' )
-printDebugArray ListModelNames
-
-NbModelNames=${#ListModelNames[@]}
-
-if [ ${NbModelCommands} -ne ${NbModelNames} ] ; then
-    echo "Error with $0 script. number of model calls ${NbModelCommands} is not equal to model name ${NbModelNames} in util/log file."
-    exit 1
-fi
-
-set -A ListModelDates -- $( cat ${logfile} | grep '\./model' | sed -e 's&\ \./model .*&&' | sed -e 's&/&-&g' | sed -e 's& &_&g' )
-printDebugArray ListModelDates
-#set -A ListModelDates -- $( cat ${logfile} | grep '\./model' | sed -e 's&\ \./model .*&&' | sed -e 's&^\(.*\)&"\1"&g' | xargs date +%g-%m-%d_%R:%S -d )
-
-
-
-# We only use the last call to model here !
-(( ModelNum = NbModelCommands - 1 ))
-
-
-
-
-(( i = 0 ))
-for mymodel in ${ListModelNames[@]}; do
-    thedate=$( echo ${ListModelDates[$i]} | sed -e "s&_& &g" | sed -e "s&-&/&g")
-#    echo $model $i ${ListModelDates[$i]} $thedate
-    ListLineModels[$i]=$( grep -ni "${thedate}" ${logfile} | sed -e "s&^\([0-9]*\):.*&\1&" )
-    (( i = i + 1 ))
-done
-printDebugArray ListLineModels
-
-sizelog=$( wc -l ${logfile} | sed -e 's&^\([0-9]*\).*&\1&' )
-
-LastModelFile=log_${ModelNum}
-tail --lines=$(( sizelog - ListLineModels[${ModelNum}] + 1 )) ${logfile} > ${LastModelFile}
-
-set -A ModelComponents -- $( cat ${LastModelFile} | grep '\-\-\-\ Component *: ' | sed -e 's&--- Component *: \(.*\)&\1&' )
-printDebugArray ModelComponents
-
-NbComponents=${#ModelComponents[@]}
-
-set -A ModelTags -- $( cat ${LastModelFile} | grep '\-\-\-\ Tag *: ' | sed -e 's&--- Tag *: \(.*\)&\1&' )
-printDebugArray ModelTags
-
-set -A ModelSystems -- $( cat ${LastModelFile} | grep '\-\-\-\ System *: ' | sed -e 's&--- System *: \(.*\)&\1&' )
-printDebugArray ModelSystems
-
-set -A ModelServers -- $( cat ${LastModelFile} | grep '\-\-\-\ Server *: ' | sed -e 's&--- Server *: \(.*\)&\1&' | sed -e 's& &:_:&g' )
-printDebugArray ModelServers
-
-set -A ModelDirectories -- $( cat ${LastModelFile} | grep '\-\-\-\ Directory *: ' | sed -e 's&--- Directory *: \(.*\)&\1&' )
-printDebugArray ModelDirectories
-
-set -A ModelLocalDirs -- $( cat ${LastModelFile} | grep '\-\-\-\ Local Dir *: ' | sed -e 's&--- Local Dir *: \(.*\)&\1&' )
-printDebugArray ModelLocalDirs
-
-rm ${LastModelFile}
Index: dipsl/trunk/util/script_recup_model
===================================================================
--- /modipsl/trunk/util/script_recup_model	(revision 6269)
+++ 	(revision )
@@ -1,220 +1,0 @@
-#!/bin/ksh
-
-#**************************************************************
-# Author: Martial Mancip
-# Contact: Martial.Mancip__at__ipsl.jussieu.fr
-# $Revision::                                          $ Revision of last commit
-# $Author::                                            $ Author of last commit
-# $Date::                                              $ Date of last commit
-# IPSL (2006)
-#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
-#
-#**************************************************************
-
-# Documentation :
-# This script creates a tree of last configuration modipsl from a tar file previously produced by script_diff_model.
-#
-# After you have downloaded modipsl, you can copy a modipsl_name_of_the_save directory tree (from a saved tar file) in modipsl.
-# (Please, see script_diff_model documentation for information of how to get this file.)
-# You may use this script to download the same configuration with new files and modifications linked with this tarball.
-#
-# usage (in modipsl path) :
-# modipsl_path> util/script_recup_model modipsl_name_of_the_save
-#
-# After this whole configuration is backuped, you must use as usual ins_make and ins_job script 
-# to installed all files depended on this new modipsl and the computer.
-#
-# Note :
-# It may not compile because of special post-installation (not versionning) for some component in model.
-# See "Actions related to the WORK directory for the OPA models" in model script to reproduce this post-installation.
-#-
-
-
-MODIPSL_SAVE_NAME=$1
-
-MODIPSL=${MODIPSL:=$(pwd)}
-
-DEBUG_mode=false
-
-function printDebugArray {
-    if ( ${DEBUG_mode} ); then
-	typeset nb_line i
-	eval nb_line=\${#$1[@]}
-	eval echo "$1 : " ${nb_line}
-	(( i = 0 ))
-	while [ $i -lt $nb_line ] ; do
-	    eval echo \${$1[$i]}
-	    (( i = i + 1 ))
-	done
-    fi
-}
-
-MODIPSL_SAVE=${MODIPSL}/${MODIPSL_SAVE_NAME}
-
-#typeset NbComponents ModelComponents ModelTags ModelSystems ModelServers ModelDirectories ModelLocalDirs ListPathComp ListPathFile ListPathRev ListPathBranch ListNewFiles ListModifFiles ListModifFilesDate Maxfiledate
-
-if [ ! -f ${MODIPSL_SAVE}/Last_log ] ; then
-    echo "You need to give a valid tree in argument of this script."
-    echo "usage (in modipsl path) :"
-    echo "modipsl_path> util/script_recup_model modipsl_name_of_the_save"
-    exit 1
-fi
-
-((i=1))
-while read line ; do
-    case $i in
-	1)
-	    echo $line | sed -e 's&Last Model in log : *&&g'
-	    ;;
-	2)
-	    NbComponents=$( echo $line | sed -e"s/ *components ://" )
-	    echo $NbComponents
-	    ;;
-	3)
-	    set +A ModelComponents -- $line
-	    printDebugArray ModelComponents
-	    ;;
-	4)
-	    set +A ModelTags -- $line
-	    printDebugArray ModelTags
-	    ;;
-	5)
-	    set +A ModelSystems -- $line
-	    printDebugArray ModelSystems
-	    ;;
-	6)
-	    (( j = 0 ))
-	    set +A ModelServersProtect -- $line
-	    for comp in ${ModelComponents[@]}; do
-		ModelServers[$j]=$( echo ${ModelServersProtect[$j]} | sed -e 's&:_:& &g' ) 
-		(( j = j + 1 ))
-	    done
-	    printDebugArray ModelServers
-	    ;;
-	7)
-	    set +A ModelDirectories -- $line
-	    printDebugArray ModelDirectories
-	    ;;
-	8)
-	    set +A ModelLocalDirs -- $line
-	    printDebugArray ModelLocalDirs
-	    ;;
-	9)
-	    set +A ListPathComp -- $line
-	    printDebugArray ListPathComp
-	    ;;
-	10)
-	    set +A ListPathFile -- $line
-	    printDebugArray ListPathFile
-	    ;;
-	11)
-	    set +A ListPathRev -- $( echo $line | sed -e 's%\([0-9][0-9]/[0-9][0-9]/[0-9][0-9]\) \([0-9][0-9]:[0-9][0-9]:[0-9][0-9]\)%\1_\2%g' )
-	    printDebugArray ListPathRev
-	    ;;
-	12)
-	    set +A ListPathBranch -- $line
-	    printDebugArray ListPathBranch
-	    ;;
-	13)
-	    set +A ListNewFiles -- $line
-	    printDebugArray ListNewFiles
-	    ;;
-	14)
-	    set +A ListModifFiles -- $line
-	    printDebugArray ListModifFiles
-	    ;;
-	15)
-	    set +A ListModifFilesDate -- $line
-	    printDebugArray ListModifFilesDate
-	    ;;
-	16)
-	    Maxfiledate=$line
-	    printDebugArray Maxfiledate
-	    ;;
-	*)
-	    break
-	    ;;
-    esac
-    ((i=i+1))
-done < ${MODIPSL_SAVE}/Last_log
-
-echo
-echo "read Last_log OK !"
-echo
-
-(( i = 0 ))
-for comp in ${ModelComponents[@]}; do
-    tag=${ModelTags[$i]}
-    echo $i $comp " : " $tag
-
-    if [ X${ListPathComp[$i]} != Xerror ] ; then
-	pathComp=${ListPathComp[$i]}
-	filecomp=$( echo ${ListPathFile[$i]} | sed -e "s/_empty_//" )
-	SpathComp=${MODIPSL_SAVE}/${pathComp}
-	echo "Path/file :" ${pathComp}/${filecomp}
-
-	case ${ModelSystems[$i]} in
-	    svn)
-		svn co -r ${ListPathRev[$i]} ${ModelServers[$i]}/${ListPathBranch[$i]}/${filecomp} ${pathComp}/${filecomp}
-		;;
-	    cvs)
-		
-		cd ${ModelLocalDirs[i]}
-		if [ X${ModelDirectories[$i]} = X. ] ; then
-#		rev=$( echo ${ListPathRev[$i]} | sed -e 's%\([0-9][0-9]\)/\([0-9][0-9]\)/\([0-9][0-9]\)_\([0-9][0-9]:[0-9][0-9]:[0-9][0-9]\)%\3/\1/\2 \4%g' )
-		    rev=$( echo ${ListPathRev[$i]} | sed -e 's%:"[0-9][0-9]/[0-9][0-9]/[0-9][0-9]_[0-9][0-9]:[0-9][0-9]:[0-9][0-9]"%%g' )
-		    eval cvs -d :pserver:${ModelServers[$i]} co -r "${rev}" ${comp}
-		else
-		    rev=$( echo ${ListPathRev[$i]} | sed -e 's%:"[0-9][0-9]/[0-9][0-9]/[0-9][0-9]_[0-9][0-9]:[0-9][0-9]:[0-9][0-9]"%%g' )
-		    echo cvs -d :pserver:${ModelServers[$i]} co -r ${rev} -d ${ModelDirectories[$i]} ${comp}
-		    cvs -d :pserver:${ModelServers[$i]} co -r ${rev} -d ${ModelDirectories[$i]} ${comp}
-		fi
-		cd ${MODIPSL}
-		
-		;;
-	    *)
-		echo "error ${ModelSystems[$i]} is not recognized as a valid control version system for ${MODIPSL_SAVE}/Last_log."
-		exit 1
-		;;
-	esac
-    fi
-    ((i=i+1))
-done
-
-set +A ListRep -- $( find ${MODIPSL_SAVE} -mindepth 1 -type d \
-    -exec bash -c " echo "'{}'" | sed -e 's&"${MODIPSL_SAVE}"/&&' | tee -a >( sed -e 's&\(.*\)&"${MODIPSL}"/\1&' | xargs mkdir -p >> out_mkdir 2>&1 ) " \; )
-printDebugArray ListRep
-rm out_mkdir
-
-(( i = 0 ))
-for comp in ${ModelComponents[@]}; do
-
-    if [ X${ListPathComp[$i]} != Xerror ] ; then
-	tag=${ModelTags[$i]}
-	echo $i $comp " : " $tag
-
-	pathComp=${ListPathComp[$i]}
-	filecomp=$( echo ${ListPathFile[$i]} | sed -e "s/_empty_//" )
-	SpathComp=${MODIPSL_SAVE}/${pathComp}
-	echo "Patch :" $( ls ${SpathComp} )
-
-        # Patch this model
-	cd ${pathComp}
-	case ${ModelSystems[$i]} in
-	    svn)
-		patch -p0 -i ${SpathComp}/svn_diff	    
-		;;
-	    cvs)
-		patch -p0 -i ${SpathComp}/cvs_diff
-		;;
-	esac
-	cd ${MODIPSL}
-    fi
-    ((i=i+1))
-done
-
-# copy new files
-for file in ${ListNewFiles[@]} ; do
-    echo "copy New file : " ${MODIPSL_SAVE}/$file $file
-    cp -p ${MODIPSL_SAVE}/$file $file
-done 
