Eawag-AppliedSystemAnalysis / Simstrat

Simstrat - 1D lake model
http://www.eawag.ch/en/department/surf/projects/simstrat/
GNU General Public License v3.0
17 stars 8 forks source link

support for floating point numbers without leading zero in front of the decimal point #29

Closed zimmermm closed 5 years ago

zimmermm commented 5 years ago

at the moment json files are invalid whe floating point numbers < 1.0 are writte as .xxx it would be nice if the json library supports this format

maybe we can try to update to the newest version (https://github.com/jacobwilliams/json-fortran) and if it still doesen't work we could contact jacob williams who wrote the library.

zimmermm commented 5 years ago

The current version of the json_fortan library still doesen't support

The thing is, that these notations do not comply with the official JSON standard: http://json.org/ Which actually means that we either have to stick to the standard or use another file format.

I contacted Jacob Williams and will see whether he is in favour to adjust his library to support more than the official standard

d-vanzo commented 5 years ago

I would suggest to stick to the standard... so it's easier to maintain the code in the future. And it's much saver (in general speaking) to have X.X rather then .X (you might always have unwanted behaviour because of the unknown tab/space).

zimmermm commented 5 years ago

the problem is that PEST which we use for calibration does not stick to this rule and there is no way to force it to do so. So the only workaround would be to put a script between PEST and Simstrat that rewrites the input files that are produced by PEST.

d-vanzo commented 5 years ago

I see. I am not familiar with PEST and this sounds just... annoying. But... how the Simtrat input file (.par) is generated after PEST generate the parameters? there must be an ad-hoc implementation for that, or a script. Or is different?

zimmermm commented 5 years ago

you have to provide a template of the inputfile and PEST just fills the corresponding tags in the template with the new parameter values that it wants to test. So it is PEST that creates the new inputfile. The only workaround is to wrap the execution of simstrat into a script that takes this inputfile and corrects all the mistakes before simstrat is executed.

f-baerenbold commented 5 years ago

Floating point numbers without leading zero are now supported by the json library (and also comments).