Displaying differences for changeset
 
display as  

src/java/m/rusle2/R2Run.java

@@ -57,8 +57,8 @@
    * @return
    * @throws IOException
    */
-  int executePyrome(File r2_rsh, Executable python) throws IOException, ServiceException {
-    python.setArguments("rusle2csip.py");
+  int executePyrome(File r2_rsh, Executable python, String suid) throws IOException, ServiceException {
+    python.setArguments("rusle2csip.py", suid);
     LOG.info("Executing pyrome rusle2");
     int ret = python.exec();
     if (ret != 0) {

src/java/m/rusle2/V2_1.java

@@ -152,7 +152,7 @@
 
     @Override
     protected void doProcess () throws Exception {
-        r2run.executePyrome( workspace().getFile( R2_TMP_FILENAME ), resources().getExe( PYTHON ) );
+        r2run.executePyrome( workspace().getFile( R2_TMP_FILENAME ), resources().getExe( PYTHON ), getSUID());
     }
 
     @Override

src/java/m/rusle2/V3_0.java

@@ -177,16 +177,23 @@
 
   // protect the DLL?
   private static final Object romeLock = new Object();
+  private static boolean lockRusle = Config.getBoolean("r2.3.0.lock", false);
 
 
   @Override
   protected void doProcess() throws Exception {
     try {
-      synchronized (romeLock) {
-        Executable python = resources().getExe(V3_0.PYTHON);
+      Executable python = resources().getExe(V3_0.PYTHON);
+      if (lockRusle) {
+        synchronized (romeLock) {
+          LOG.log(Level.INFO, "EXECUTING PYROME FROM doProcess()...");
+          int result = r2run.executePyrome(new File(workspace().getDir(), R2_TMP_FILENAME + R2_TMP_FILEEXT), python, getSUID());
+        }
+      } else {
         LOG.log(Level.INFO, "EXECUTING PYROME FROM doProcess()...");
-        int result = r2run.executePyrome(new File(workspace().getDir(), R2_TMP_FILENAME + R2_TMP_FILEEXT), python);
+        int result = r2run.executePyrome(new File(workspace().getDir(), R2_TMP_FILENAME + R2_TMP_FILEEXT), python, getSUID());
       }
+
     } catch (Exception e) {
       LOG.log(Level.SEVERE, "ERROR EXECUTING PYTHON-RUSLE2", e);
       throw e;
@@ -264,7 +271,10 @@
   protected void createInputFile(File file, Map<String, JSONObject> param)
       throws Exception {
 
-    steepness = JSONUtils.getDoubleParam(param, KEY_STEEPNESS, 0.0);
+    steepness = JSONUtils.getDoubleParam(param, KEY_STEEPNESS, 0.01);
+    if (steepness < 0.01)
+      steepness = 0.01;
+
     length = JSONUtils.getDoubleParam(param, KEY_LENGTH, 0.0);
     boolean resolveLoc = JSONUtils.getBooleanParam(param, KEY_RESOLVE_LOCATION, false);
     double latitude = JSONUtils.getDoubleParam(param, KEY_LATITUDE, 0.0);
@@ -519,7 +529,10 @@
       for (int i = 0; i < aTopoLength.length(); i++) {
         text = "    RomeFileSetAttrValue(profile, 'TOPO_HORIZ', '" + aTopoLength.getString(i) + "', " + i + ")\n";
         fos.write(text.getBytes());
-        text = "    RomeFileSetAttrValue(profile, 'TOPO_STEEP', '" + aTopoSteepness.getString(i) + "', " + i + ")\n";
+        String tstr = aTopoSteepness.getString(i);
+        if (tstr.isEmpty() || Double.parseDouble(tstr) < 0.01)
+          tstr = "0.01";
+        text = "    RomeFileSetAttrValue(profile, 'TOPO_STEEP', '" + tstr + "', " + i + ")\n";
         fos.write(text.getBytes());
       }
     }

src/java/m/rusle2/V4_0.java

@@ -231,7 +231,7 @@
     try {
       Executable python = resources().getExe(V3_0.PYTHON);
       LOG.log(Level.INFO, "EXECUTING PYROME FROM doProcess()...");
-      int result = r2run.executePyrome(new File(workspace().getDir(), R2_TMP_FILENAME + R2_TMP_FILEEXT), python);
+      int result = r2run.executePyrome(new File(workspace().getDir(), R2_TMP_FILENAME + R2_TMP_FILEEXT), python, getSUID());
       callAnn();
     } catch (Exception e) {
       LOG.log(Level.SEVERE, "ERROR EXECUTING PYTHON-RUSLE2", e);

web/WEB-INF/csip-defaults.json

@@ -1,5 +1,5 @@
 { 
-    "csip-r2.version": "$version: 2.11.8.14 default 84 ff24976ba817 2022-01-27 casesp, built at 2022-02-03 17:08 by od$",
+    "csip-r2.version": "$version: 2.11.8.15 default 85 d7cb89bc788a 2022-02-03 od, built at 2022-02-03 19:46 by od$",
     "lmod.db": "jdbc:sqlserver:\/\/129.82.20.242:1433;databaseName=lmod_temp;user=lmod-rw;password=?",
     "sdmONLINE":"true",
     "csip.session.ttl": "PT1M",