Commit e8ae52e3 authored by Miguel Tremblay's avatar Miguel Tremblay
Browse files

Added a check if the model had failed. If so an error message is sent to the...

Added a check if the model had failed.  If so an error message is sent to the log and the application abort.
parent 0d264d14
...@@ -307,19 +307,26 @@ class Metro_model(Metro_module): ...@@ -307,19 +307,26 @@ class Metro_model(Metro_module):
metro_logger.print_message(metro_logger.LOGGER_MSG_EXECPRIMARY, metro_logger.print_message(metro_logger.LOGGER_MSG_EXECPRIMARY,
_("Start sending data to METRo core")) _("Start sending data to METRo core"))
# print "Le vent", lWS
bEchec = []
macadam.Do_Metro(bFlat,\ macadam.Do_Metro(bFlat,\
fLat, fLon, fLCorr,\ fLat, fLon, fLCorr,\
lLayerThick, nNbrOfLayer, lLayerType, \ lLayerThick, nNbrOfLayer, lLayerType, \
lAT, lQP, lWS, lAP, lSF, lIR, lFT, lPI, lSC,\ lAT, lQP, lWS, lAP, lSF, lIR, lFT, lPI, lSC,\
lAT_obs,lST_obs, lSST_obs, \ lAT_obs,lST_obs, lSST_obs, \
lAH, lTime_obs,\ lAH, lTime_obs, lSWO, bNoObs,\
lSWO, bNoObs,\
fDeltaTMetroObservation, nLenObservation, \ fDeltaTMetroObservation, nLenObservation, \
nNbrTimeSteps, bSilent) nNbrTimeSteps, bSilent)
metro_logger.print_message(metro_logger.LOGGER_MSG_EXECPRIMARY, bEchec = (macadam.get_echec())[0]
_("End of METRo core")) # Check if the execution of the model was a succes:
if bEchec != 0:
sError_message = _("Fatal error in METRo physical model.")
metro_logger.print_message(metro_logger.LOGGER_MSG_STOP,
sError_message)
else:
metro_logger.print_message(metro_logger.LOGGER_MSG_EXECPRIMARY,
_("End of METRo core"))
def __create_roadcast_collection( self, forecast, observation, station ): def __create_roadcast_collection( self, forecast, observation, station ):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment