HD Para Files lead to Model Crash
For internal documentation only!
@gknorr has uncovered a model crash related to the hdpara.nc
file. Currently, the hdpara.nc
file which corresponds to each time-slice is generated for us by external support (Web link: Dr. Tobias Stacke, Email: tobias.stacke@hzg.de)
When appropriately applied, the model leads to a crash with:
FATAL ERROR in hydrology_slm_invariants: hd slm and riverflow reservoir numbers do not match
0: FINISH called from PE: 0
This stems from here in the ECHAM6/JSBACH source code.
IF (ANY((hd_lsm > 0.5_dp .AND. arf_n < 0.5_dp .AND. fdir /= 5) &
.OR. (hd_lsm < 0.5_dp .AND. arf_n > 0.5_dp))) THEN
CALL finish('hydrology_slm_invariants', &
'hd slm and riverflow reservoir numbers do not match')
END IF
All mentioned variables, hd_lsm
, arf_n
, fdir
appear to stem from the hdpara.nc
file.
-
arf_n
is read directly fromhdpara.nc
-
fdir
is read directly fromhdpara.nc
-
hd_lsm
is read fromflag
, and undergoes some type conversions
The first logical check confirms that if the HD model assumes land is present at the grid cell, and the parameter N is 0 (it is only defined above 1) AND there is not inland-sea, then stop. The second logical check confirms the HD Land Sea Mask is always consistent with a defined N value for hydrological discharge. The simple version: the model does not want to simulate reservoirs over the ocean.
A test branch has been created to try to this bug in the LGM and 15ka setups. This may be found here:
$ git checkout hdpara_bug
You can then use the runscript under test_run_configs/LGM_broken_hdpara.yaml
to recreate the LGM case, and test_run_configs/Glac15ka_broken_hdpara.yaml
for 15 ka. For LGM, this works. For 15ka, the bug appears.
After further investigation together with @stepanek, it seems that the land-sea mask, derived from the flag
field in hdpara.nc
and the arf_n
fields do not match: arf_n
is missing definitions over the glaciated areas.
To summarize: if you run into the above problem, check your hdpara.nc
file. In doubt, get in contact with Tobias to re-create the file for your.
I will update this thread with an appropriately working example for Gregor's buggy case once we have new hdpara files! There will also be an update to the main master branch of this project once all the hdpara files are in place. At that time, please do git pull
in the main folder to get working files.