@@ -744,8 +744,8 @@ |
StationResult windgenst = new StationResult(); |
windgenst.state = r.getString(1); |
windgenst.stationId = r.getString(2); |
- windgenst.distance = r.getDouble(3); |
- //s.close(); |
+ windgenst.distance = r.getDouble(3); |
+ //s.close(); |
logger.info("state=" + windgenst.state); |
logger.info("station id=" + windgenst.stationId); |
logger.info("distance in deg=" + windgenst.distance); |
@@ -807,8 +807,8 @@ |
return null; |
} |
StationResult windgenst = new StationResult(); |
- windgenst.stationX = r.getString(1); |
- windgenst.stationY = r.getString(2); |
+ windgenst.stationX = r.getString(2); |
+ windgenst.stationY = r.getString(1); |
windgenst.stationId = r.getString(3); |
windgenst.country = r.getString(4); |
windgenst.state = r.getString(5); |
@@ -333,40 +333,51 @@ |
LOG.log(Level.INFO, "rotation years =" + translator.getRotationYears()); |
LOG.log(Level.INFO, "JSON to translate=" + translator.getInputJSONObject()); |
} |
- try { |
+ try |
+ { |
error = translator.Translate(); |
LOG.log(Level.INFO, "OUTPUT FROM THE TRANSLATOR ='" + error + "'"); |
if(error != null) |
{ |
- try{ |
- if (Integer.parseInt(error) != 1) |
+ try |
{ |
- LOG.log(Level.SEVERE, "THERE IS AN ERROR CODE RETURNED FROM THE MAN2WEPS TRANSLATOR. Code=" + error); |
+ if (Integer.parseInt(error) != 1) |
+ { |
+ LOG.log(Level.SEVERE, "THERE IS AN ERROR CODE RETURNED FROM THE MAN2WEPS TRANSLATOR. Code=" + error); |
+ } |
} |
- }catch(NumberFormatException ex){ // I want to transition the numeric errors to string errors like this |
+ catch(NumberFormatException ex) |
+ { // I want to transition the numeric errors to string errors like this |
LOG.log(Level.SEVERE, "THERE IS AN ERROR: " + error); |
} |
} |
- } catch (Exception e) { |
+ } |
+ catch (Exception e) |
+ { |
LOG.log(Level.SEVERE, "FLAT UP EXPLOSION FROM THE WEPS TRANSLATOR:" + e.toString()); |
- if (translator != null) { |
+ if (translator != null) |
+ { |
//LOG.log(Level.INFO, translator.) |
- } else { |
+ } |
+ else |
+ { |
LOG.log(Level.INFO, "TRANSLATOR IS NULL!"); |
} |
- for (StackTraceElement ste : e.getStackTrace()) { |
+ for (StackTraceElement ste : e.getStackTrace()) |
+ { |
LOG.log(Level.SEVERE, "class=" + ste.getClassName() + " method=" + ste.getMethodName() + " |" + ste.toString()); |
} |
- |
throw new ServiceException("LMOD management translation error executing WEPS"); |
//return WEPS_ERROR_LMOD_TRANSLATION_ERROR; |
} |
- if (error != null) |
- { |
+// if (error != null) |
+// { |
+ // Set these values no matter what |
wmr.setRunCycle(Integer.toString(translator.getRotationYears())); |
+ LOG.log(Level.INFO, "*****************************************************set run cycle=" + wmr.getRunCycle()); |
simulationYears = Integer.parseInt(wmr.getRunCycle()) * NRCS_CYCLE_COUNT; |
wmr.setNumYears(Integer.toString(simulationYears)); |
- } |
+// } |
} |
} catch (Exception e) { |
LOG.log(Level.SEVERE, "STACK TRACE FROM LMOD TRANSLATOR ERROR:"); |
@@ -375,6 +386,9 @@ |
} |
throw new ServiceException("WEPS error: error translating WEPS mgmt from LMOD."); |
} |
+ LOG.log(Level.INFO, "*****************************************************LEAVING loadWepsMgmt"); |
+ LOG.log(Level.INFO, "*****************************************************set run cycle=" + wmr.getRunCycle()); |
+ LOG.log(Level.INFO, "*****************************************************set num years=" + wmr.getNumYears()); |
return error; |
} |
|
@@ -707,6 +721,12 @@ |
// for wind interpolation, report the nearest wind gen station in the weps.run file for now |
// check with Fred to verify if this is correct behavior for the weps gui |
windStationForWepsRunFile = db.findWindgenStation(Double.parseDouble(wmr.getLat()), Double.parseDouble(wmr.getLongitude())); |
+ // to do |
+ // in this case, we are getting the wind gen station from the "wingen_stations" table which does not provide |
+ // lat long values, so we are using the model run's coordinates. We will need to include wind gen station coordinate data |
+ // in the database in order to provide it. |
+ windStationForWepsRunFile.stationX = wmr.getLongitude(); |
+ windStationForWepsRunFile.stationY = wmr.getLat(); |
} |
|
|
@@ -724,6 +744,12 @@ |
LOG.info("windgen station is=" + windgenStation.stationId); |
sWindgenStation = windgenStation.stationId.trim(); |
windStationForWepsRunFile = windgenStation; |
+ // to do |
+ // in this case, we are getting the wind gen station from the "wingen_stations" table which does not provide |
+ // lat long values, so we are using the model run's coordinates. We will need to include wind gen station coordinate data |
+ // in the database in order to provide it. |
+ windStationForWepsRunFile.stationX = wmr.getLongitude(); |
+ windStationForWepsRunFile.stationY = wmr.getLat(); |
|
windDbPath = Binaries.unpackResource("/bin/" + Binaries.getArch() + "/" + DEFAULT_WIND_STATION_DB, new File(binDir)).toString(); |
} |
@@ -47,11 +47,11 @@ |
private String winWindState = "00"; |
private String winWindDescriptionString = "wind station description"; |
private String winWindStationName = "WIN_STA_NAME"; |
- private String runCycle = "3"; |
+ private String runCycle = "0"; // default to zero to cause problems if not set properly |
private String lat = "+66.56272"; |
private String longitude = "-105.00000"; |
private String elevation = UNSET_ELEVATION; // meters |
- private String numYears = "150"; |
+ private String numYears = "0"; // default to zero to cause problems if not set properly |
private String soilFile = "soil.ifc"; |
private String simRegionAngle = "0.00000"; |
private String simXLen = "1.00"; // meters |