Index: CONFIG/IPSLCM/IPSLCM5A/CpiControl/COMP/lmdz_analyse_pisces_out.awk
===================================================================
--- CONFIG/IPSLCM/IPSLCM5A/CpiControl/COMP/lmdz_analyse_pisces_out.awk	(revision 1234)
+++ CONFIG/IPSLCM/IPSLCM5A/CpiControl/COMP/lmdz_analyse_pisces_out.awk	(revision 1234)
@@ -0,0 +1,104 @@
+#!/usr/bin/awk -f 
+# lmdz_analyse_opa_out - filter NEMO/PISCES output :
+# command :
+# lmdz_analyse_opa_out.awk [-d] ocean.output
+
+#**************************************************************
+# Author: Martial.Mancip
+# Contact: Martial.Mancip__at__ipsl.jussieu.fr
+# $Revision:: 373                                      $ Revision of last commit
+# $Author:: sdipsl                                     $ Author of last commit
+# $Date:: 2010-10-29 12:37:36 +0200 (Fri, 29 Oct 2010) $ Date of last commit
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+#
+#**************************************************************
+
+#==========================
+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: lmdz_analyse_opa_out.awk [-d] file"
+        exit_value=-1
+        exit
+  }
+
+  line=0
+
+  fluxCarbon_found=0
+  counter=0
+
+  CO2file[1]=""
+  errcounter=0
+}
+
+#==========================
+{
+
+#  myprint($0) 
+
+  line=line+1
+  
+  if (match($0, ".*Cumulative total Flux of Carbon out of the ocean.*")) {
+    fluxCarbon_found=1
+    myprint("fluxCarbon_found=1")
+
+    nb=split($0,felts, ":")
+    myprint("nb  :" nb)
+    for (elt in felts) {
+	myprint(elt "- elt  :" felts[elt])
+    }
+    myprint("elts_co2  :" felts[2])
+
+    counter=counter+1
+    CO2file[counter]=felts[2]
+  }
+}
+
+#==========================
+END {
+  if ( exit_value != -1 ) {
+
+    if ( fluxCarbon_found == 1 ) {
+	myprint("CO2 value for " file)
+	myprint("counter  :" counter)
+	for (i=1; i<=counter; i++) {  
+	    print CO2file[i]
+	    myprint("value  :" CO2file[i])
+	}
+	
+	exit_value=0
+	exit 0
+    }
+    else {
+	myprint("ERROR : NO CO2 value for " file)
+	print "0001"
+    }
+    
+  }
+  else {
+      print "0000"
+  }
+}
Index: CONFIG/IPSLCM/IPSLCM5A/CpiControl/COMP/lmdz_analyse_stomate_out.awk
===================================================================
--- CONFIG/IPSLCM/IPSLCM5A/CpiControl/COMP/lmdz_analyse_stomate_out.awk	(revision 1234)
+++ CONFIG/IPSLCM/IPSLCM5A/CpiControl/COMP/lmdz_analyse_stomate_out.awk	(revision 1234)
@@ -0,0 +1,141 @@
+#!/usr/bin/awk -f 
+# lmdz_analyse_stomate_out - filter ORCHIDEE node output :
+# command :
+# lmdz_analyse_stomate_out.awk [-d] out_orchidee[_0000]
+
+#**************************************************************
+# Author: Martial.Mancip
+# Contact: Martial.Mancip__at__ipsl.jussieu.fr
+# $Revision:: 373                                      $ Revision of last commit
+# $Author:: sdipsl                                     $ Author of last commit
+# $Date:: 2010-10-29 12:37:36 +0200 (Fri, 29 Oct 2010) $ Date of last commit
+# IPSL (2006)
+#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
+#
+#**************************************************************
+
+#==========================
+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: lmdz_analyse_stomate_out.awk [-d] file"
+        exit_value=-1
+        exit
+  }
+
+  line=0
+
+  fluxCarbon_found=0
+  counterCO2=0
+
+  fluxLU_found=0
+  counterLU=0
+
+  CO2file[1]=""
+  LUfile[1]=""
+}
+
+#==========================
+{
+
+#  myprint($0) 
+
+  line=line+1
+
+  if (match($0, ".*GLOBAL net_co2_flux_monthly.*")) {
+    myprint("fluxCarbon_found = 1")
+    fluxCarbon_found=1
+    counterCO2=counterCO2+1
+
+    nb=split($0,felts, "=")
+    myprint("nb  :" nb)
+    for (elt in felts) {
+	myprint(elt "- elt  :" felts[elt])
+    }
+    myprint("elts_co2  :" felts[2])
+
+    CO2file[counterCO2]=felts[2]
+  }
+  else if (match($0, ".*GLOBAL net cflux_prod_total_sum.*")) {
+    myprint("fluxLU_found = 1")
+    fluxLU_found=1
+    counterLU=counterLU+1
+
+    nb=split($0,felts, "=")
+    myprint("nb  :" nb)
+    for (elt in felts) {
+	myprint(elt "- elt  :" felts[elt])
+    }
+    myprint("elts_lu  :" felts[2])
+
+    LUfile[counterLU]=felts[2]
+  }
+}
+
+#==========================
+END {
+  if ( exit_value != -1 ) {
+
+    if ( fluxCarbon_found == 1 ) {
+	myprint("CO2 value for " file)
+	myprint("counterCO2  :" counterCO2)
+	for (i=1; i<=counterCO2; i++) {  
+	    print CO2file[i]
+	    myprint("value  :" CO2file[i])
+	}
+	
+	if ( fluxLU_found == 1 ) {
+	    myprint("LU value for " file)
+	    myprint("counterLU  :" counterLU)
+	    for (i=1; i<=counterLU; i++) {  
+		print LUfile[i]
+		myprint("value  :" LUfile[i])
+	    }
+	    
+	    exit_value=0
+	    exit 0
+	}
+	else {
+	    myprint("ERROR : NO LU value for " file)
+	    print "0002"
+	    exit 1
+	}
+
+	exit_value=0
+	exit 0
+    }
+    else {
+	myprint("ERROR : NO CO2 value for " file)
+	print "0001"
+	print "0002"
+	exit 1
+    }
+    
+  }
+  else {
+      print "0000"
+      exit 1
+  }
+}
