Closed denizural closed 3 years ago
This is very specific to models where scenario
plays role and _sources
are a dictionary. It could be that in the future we add more functionalities to the _sources
making it sometimes a dict
, or that other models use a different name than scenario
for their case variable. Then the error message will be still confusing. I'm not sure, it looks that it needs to be a bit more general. What about not mentioning the scenario but just that the error looks like something like this:
ERROR: Sources not properly resolved
---------------------------------------
The input file variable LU_HIST of forcing_sources can not be fully resolved:
/work/bb0519/foci_input2/JSBACH/input/r0010/T63/New_Hampshire_LCC/hist_harvest/LUH_harvest_T63_1850.nc:
to: 1850
/work/bb0519/foci_input2/JSBACH/input/r0010/T63/New_Hampshire_LCC/hist_harvest/LUH_harvest_T63_@YEAR@.nc:
from: 1851
However, if _sources
being a dictionary always depends on scenario
and there is a specific handling of the scenario
variable inside esm_runscripts
then the fix is already good, as it would only happen when scenario
is in use.
Although I like the very precise error message, I think it's too specific. I would add the model version to the error message and leave out the scenario specific stuff. I vaguely think to remember that I had this error message in other cases, too, when @YEAR@ things could not be resolved. But apart from that. Thanks for the quick and solid fix to get rid of the confusing error message.
This PR solves the issue https://github.com/esm-tools/esm_runscripts/issues/172
I tested different solutions and finally decided that this one gives the most useful error message to the user. This error message provides the user
eg. if you try to run ECHAM with the scenario
scenario: 1percCO2
, now these lines will be printed:Instead of
I tried the same hack in other parts of the
esm_runscripts
but did not find anything yet. Maybe someone else will in the future and then we can use the same solution there too.After the merge and bump, I will merge the
HIST
case stuff.