Open manfredo89 opened 6 years ago
Could you be more specific about what you mean by 'ASCII dataset'? More generally, I feel like it would be much easier to evaluate these suggesetions if you provided links to the relevant code (Github makes it easy to reference not just the code, but specific lines or blocks).
Hi Mike, I am more or less familiar with every issue on the table except for the 3rd and 4th line. I still added them because they are signaled as deprecated in the ED2IN. I have linked with the file / line number where relevant
@mdietze on the ASCII dataset, I think @manfredo89 is referring to variable NL%IMETTYPE in ED2IN. I think a really long time ago we had meteorological drivers in ascii format, but this has been phased out about 10 years ago. I think IMETTYPE could definitely go away, I just checked the code and it is not used anywhere.
A few comments on the other chunks of the code.
@mpaiao yep, I was around for the pain of the ASCII to HDF5 migration. I agree that the old ASCII met can be dropped. I mostly asked because I recall that there were parsers for other input databases (e.g. soil texture maps) that were never fully translated during the C to Fortran transition and those bits of code might be more valuable to retain (since, for example, there may still be value in being able to load from those).
I agree with all of Marcos' other suggestions
Since starting to work with ED I always felt like a priority to try simplifying it (especially to make it more accessible to colleagues that are not willing to dedicate their entire PhD to modelling). Some time ago @DanielNScott wrote a wiki page about a possible avenue to modernize the code https://github.com/EDmodel/ED2/wiki/Updating-to-F03-F08,-Iterators-for-Data-Structures. My feeling is that if we want to port the code to a more modular (perhaps even object oriented) design, the first step is to clean what we know is redundant. This could be useful even without doing such a refactoring.
So I made a little list of things that we could potentially get rid of. This is just a tentative trial to start a discussion. Also I am appending an analysis of code coverage for the most common runs (a NBG INITIAL and a HISTORY restart). To open it download the archive and open the CODE_COVERAGE.HTML file. For the ones unfamiliar with the concept of code coverage it's an analysis of the portions of code that where used or not (Yellow color indicates uncovered code block and red color indicates uncovered function). Master is the current master branch while Redux is my development branch where most of the following proposed removals have been implemented.
The master branch has an overall code coverage of 37% for my simulation subset. My feeling is that even including all special cases (like the eq0 run, the different integrators, the bigleaf ecc. the code coverage would still be quite low, indicating a lot of redundancies).
Master_coverage.zip
Redux_coverage.zip