CH-Earth / summa

Structure for Unifying Multiple Modeling Alternatives:
http://www.ral.ucar.edu/projects/summa
GNU General Public License v3.0
80 stars 104 forks source link

Feature/gru hru id in error #439

Closed wknoben closed 3 years ago

wknoben commented 3 years ago

Updated the error reporting in routines run_oneGRU and run_oneHRU to include the index of the GRU in the netcdf file and the hruId. This is helpful when isolating problematic GRUs/HRUs in large domain runs.

Example error before changes:

1980  5  1  0  0
 solution method           =            3
data_step                 =       3600.0000000000
totalSoilCompress         =          0.0000000000
scalarTotalSoilLiq        =        909.4334985312
scalarTotalSoilIce        =        313.4928317471
balanceSoilWater0         =       1221.1696585988
balanceSoilWater1         =       1222.9263302783
balanceSoilInflux         =          1.7670322140
balanceSoilBaseflow       =          0.0000000000
balanceSoilDrainage       =          0.0103174598
balanceSoilET             =         -0.1526087002
scalarSoilWatBalError     =          0.1525656256
scalarSoilWatBalError     =          0.0001525656
absConvTol_liquid         =          0.0000100000

FATAL ERROR: run_oneGRU/run_oneHRU/coupled_em/soil hydrology does not balance

Example after changes:

1980  5  1  0  0
 solution method           =            3
data_step                 =       3600.0000000000
totalSoilCompress         =          0.0000000000
scalarTotalSoilLiq        =        909.4334985312
scalarTotalSoilIce        =        313.4928317471
balanceSoilWater0         =       1221.1696585988
balanceSoilWater1         =       1222.9263302783
balanceSoilInflux         =          1.7670322140
balanceSoilBaseflow       =          0.0000000000
balanceSoilDrainage       =          0.0103174598
balanceSoilET             =         -0.1526087002
scalarSoilWatBalError     =          0.1525656256
scalarSoilWatBalError     =          0.0001525656
absConvTol_liquid         =          0.0000100000

FATAL ERROR: run_oneGRU (gru index = 42915)/run_oneHRU (hruId = 71028528)/coupled_em/soil hydrology does not balance

Is this a desirable change? Are further checks of the code needed?

andywood commented 3 years ago

this is a good change ... there are a number of places where certain halts occur and wherever we can we should add the hruId/gruId to the error messaging. Often we're running grus in blocks and it's time consuming to identify the exact location of the halt.

wknoben commented 3 years ago

this is a good change ... there are a number of places where certain halts occur and wherever we can we should add the hruId/gruId to the error messaging. Often we're running grus in blocks and it's time consuming to identify the exact location of the halt.

To give credit where it's due, this is the exact scenario I had when Martyn suggested making this change. Did you have any specific places in the code in mind where this addition could be helpful?