pism / pism

Repository for the Parallel Ice Sheet Model (PISM)
https://pism.io/
GNU General Public License v3.0
98 stars 41 forks source link

Fix: thickness calving does not work with constant threshold in dev branch #489

Closed sschoell closed 2 years ago

sschoell commented 2 years ago

With the changes in the dev branch, it's not possible anymore to provide PISM with a constant threshold for thickness calving.

To Reproduce Running PISM with the command line argument pismr -i ../input/pism_equi_input.nc ... -calving eigen_calving,thickness_calving -thickness_calving_threshold 75.0 ... fails with the following error message, instead of taking the provided threshold:

* Initializing the 'calving at a threshold thickness' mechanism...
  - Option calving.thickness_calving.file is not set. Trying the input file '../input/pism_equi_input.nc'...
  Reading thickness calving threshold from file '../input/pism_equi_input.nc'...
PISM ERROR: can't find threshold used by the 'calving at threshold' calving method (thickness_calving_threshold) in ../input/pism_equi_input.nc.

Fix The condition in L73 doesn't work as expected, because opt.filename defaults to the input file if no calving.thickness_calving.file is provided. The proposed fix checks instead, if the variable exists in the file.

Checklist

aaschwanden commented 2 years ago

@sschoell : Thank you very much for reporting and fixing this bug!