Displaying differences for changeset
 
display as  

src/java/m/oms/ages/V1_0.java

@@ -24,6 +24,7 @@
 import ngmf.util.cosu.luca.of.RMSE;
 import ngmf.util.cosu.luca.of.TRMSE;
 import oms.utils.Utils;
+import oms.utils.Utils.PBIAS;
 import oms3.ObjectiveFunction;
 
 /**
@@ -34,7 +35,7 @@
 @Name("AGES model execution")
 @Description("OMS based AGES model service")
 @VersionInfo("1.0")
-@Path("m/ages/1.0")
+@Path("m/ages/0.3.0")
 @Resource(file = "/bin/ages/ages.jar", type = JAR, id = Utils.ID_AGES_JAR)
 @Resource(file = "/bin/ages/ages-lib.zip", type = ARCHIVE)
 @Resource(file = "/bin/ages/ages-static.zip", type = ARCHIVE)
@@ -48,35 +49,7 @@
   public static final String PAR_STARTTIME = "startTime";
   public static final String PAR_ENDTIME = "endTime";
 
-  static Map<String, ObjectiveFunction> OF = new HashMap<>();
-
-  /**
-   *
-   */
-  static class PBIAS implements ObjectiveFunction {
-
-    @Override
-    public double calculate(double[] obs, double[] sim, double missing) {
-      if (sim.length != obs.length) {
-        throw new IllegalArgumentException("obs/sim length differ: " + obs.length + "!=" + sim.length);
-      }
-      double diffsum = 0;
-      double obssum = 0;
-      for (int i = 0; i < sim.length; i++) {
-        if (obs[i] > missing) {
-          diffsum += sim[i] - obs[i];
-          obssum += obs[i];
-        }
-      }
-      return (diffsum / obssum) * 100.0;
-    }
-
-
-    @Override
-    public boolean positiveDirection() {
-      return false;
-    }
-  }
+  static final Map<String, ObjectiveFunction> OF = new HashMap<>();
 
 
   static {
@@ -110,15 +83,13 @@
     "angstrom_a",
     "angstrom_b",
     "baseTemp",
-    "delayNitrification",
-    "denitrificationRateCoefficient",
-    "denitrificationSoilSaturationThreshold",
-    "nitrificationSoilTemperatureThreshold",
-    "nitrificationSurfaceTemperatureThreshold",
     "calib_clat_fact",
     "ccf_factor",
     "defaultCO2",
     "denitfac",
+    "delayNitrification",
+    "denitrificationRateCoefficient",
+    "denitrificationSoilSaturationThreshold",
     "depdr",
     "deposition_factor",
     "drrad",
@@ -164,6 +135,8 @@
     "locGrw",
     "longTZ",
     "nitri_delay",
+    "nitrificationSoilTemperatureThreshold",
+    "nitrificationSurfaceTemperatureThreshold",
     "opti",
     "piadin",
     "r_factor",
@@ -192,7 +165,7 @@
     "soilPolRed",
     "t_factor",
     "tempRes",
-    "temp_lag",
+    "temp_lag"
   };
 
   // simulation flags

src/java/oms/utils/Utils.java

@@ -19,6 +19,7 @@
 import java.util.HashMap;
 import java.util.Map;
 import oms3.Conversions;
+import oms3.ObjectiveFunction;
 import oms3.io.CSTable;
 import oms3.io.DataIO;
 import org.apache.commons.io.FileUtils;
@@ -38,6 +39,34 @@
 
   public static final String ID_AGES_JAR = "ages.jar";
 
+  /**
+   *
+   */
+  public static class PBIAS implements ObjectiveFunction {
+
+    @Override
+    public double calculate(double[] obs, double[] sim, double missing) {
+      if (sim.length != obs.length) {
+        throw new IllegalArgumentException("obs/sim length differ: " + obs.length + "!=" + sim.length);
+      }
+      double diffsum = 0;
+      double obssum = 0;
+      for (int i = 0; i < sim.length; i++) {
+        if (obs[i] > missing) {
+          diffsum += sim[i] - obs[i];
+          obssum += obs[i];
+        }
+      }
+      return (diffsum / obssum) * 100.0;
+    }
+
+
+    @Override
+    public boolean positiveDirection() {
+      return false;
+    }
+  }
+
 
   /**
    * create a 'sim' include file for the run part.

web/WEB-INF/csip-defaults.json

@@ -1,5 +1,5 @@
 {
-  "csip.context.version": "$version: 0.1.27 7f572734ec2c 2020-03-05 od, built at 2020-03-19 14:49 by od$",
+  "csip.context.version": "$version: 0.1.32 950e80ac258d 2020-03-21 holm, built at 2020-03-22 15:59 by od$",
   "oms.java.home": "/opt/jdk1.8.0_51",
   "csip.keepworkspace": false,
   "csip.session.ttl": "PT10S",