-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MOM6 parameter files? #163
Comments
Generally things have gone awry when we've tried to extend support to namelist-like solutions. There are few examples in the Issues. Usually there is some case that is valid in one format and not the other, and then flags start creeping in to track which file we're talking about, making the horrible hand-parser snake nest even more unreadable, if not impossible to parse. I think that the MOM6 parameter format is very simple compared to namelists, and probably not worth the bother of pulling in all of f90nml. I put one together that more or less lays out how one ought to look. (And probably how f90nml ought to look, if I ever bothered to rewrite the scanner/parser). https://github.com/marshallward/mom6param I think maybe we'd be better served by adding one to MOM6, or maybe as a separate project. Despite the better judgement of people who've walked this path, MOM6 has created yet another data format.... |
Yes, I can see your point about keeping f90nml focused on one format. Thanks for sharing your code, that looks like an elegant approach. I'd actually forgotten that @micaeljtoliveira had already written code for handling MOM6 input files that seems to do exactly what I want: https://github.com/COSIMA/om3-utils/blob/main/om3utils/mom6_input.py This is a 2-way translation layer between the MOM6 format and normal namelists, and uses f90nml under the hood. |
Hi Marshall - just a thought: would there be any appetite (and would it make any sense) to add support for reading/writing MOM6 parameter files?
While they're not actually namelists, they seem pretty similar in logical structure, so I'm guessing the internal representation could remain the same and translation only needs to take place for input/output.
FYI in nmltab I've bodged together a hacky solution to allow f90nml to read MOM6 files, basically by wrapping it all in one big dummy group.
The text was updated successfully, but these errors were encountered: