source: CONFIG/UNIFORM/v6/diff_configurations.ksh @ 2969

Last change on this file since 2969 was 2954, checked in by acosce, 8 years ago

Homogenization of card between LMDZORINCA_v6 and LDMZOR_v6
+ add new config NMHC in LMDZORINCA_v6
+ compilation with XIOS2
+ add new resolution for LMDZORINCA_v6 (144x142x79 AER)

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#!/bin/ksh
2#
3# Use this script to test if files are the same in all configurations in this directory. All files in the GENERAL, POST and EXPERIMENTS
4# directories with the same name and path should be the identic before commit to svn. The difference between configurations are the
5# scripts for compiling and which files are available.
6#
7# Syntax
8# To test all files in all configurations :
9# ./diff_configuration.ksh
10# To test the files file1 and file2 in all configurations :
11# ./diff_configuration.ksh file1 file2
12#
13# Josefine Ghattas IPSL
14
15BaseDir=`pwd`
16ConfigFamily=v6
17ConfigList=`ls |grep ${ConfigFamily} |grep -v out`
18#ConfigList=$ConfigList" IPSLCM6 IPSLCM6CHT"
19ConfigList="LMDZORINCA_v6 LMDZOR_v6"
20verbose=no
21echo All configurations to tests : $ConfigList
22
23if [ $# == 0 ] ; then
24    TestAll="yes"
25    echo "Test all files."
26else
27    TestAll="no"
28    FileList0=$*
29    echo "Test only following files : $FileList0"
30fi
31
32
33for conf in $ConfigList ; do
34    # Construct list of files to test
35    if [ $TestAll = "yes" ] ; then
36        FileList=`ls -d ${conf}/GENERAL/DRIVER/* ${conf}/GENERAL/PARAM/* ${conf}/GENERAL/POST/* ${conf}/EXPERIMENTS/*/*/* ${conf}/EXPERIMENTS/*/*/*/*`
37    else
38        FileList=""
39        for file in $FileList0 ; do
40            FileList=$( echo $FileList `ls ${conf}/GENERAL/*/$file`)
41        done
42    fi
43
44    for conf2 in $ConfigList ; do
45        if [ $conf2 != $conf ] ; then
46            for file in $FileList ; do
47                # Remove conf from path
48                file=$( echo $file | awk -F"${conf}/" '{print $2}' )
49               
50                # Test if the file exists also in second directory, if yes test difference
51                if [ -f ${conf2}/${file} ] ; then 
52                    # Test if files are different
53                    cmp -s ${conf}/${file}  ${conf2}/${file}
54                    if [ $? -ne 0 ] ; then
55                        diff --brief ${conf}/${file}  ${conf2}/${file}
56                        if [ $verbose == yes ] ; then
57                            diff  ${conf}/${file}  ${conf2}/${file}
58                            echo
59                        fi
60                    fi
61                fi
62            done
63        fi
64    done
65   
66done
Note: See TracBrowser for help on using the repository browser.