-
Notifications
You must be signed in to change notification settings - Fork 20
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
Single structure #175
Single structure #175
Conversation
Changed the id and path of the output to match the way SpeedyWeather does it
Adding new runid
Matching the upstream repo
Just correcting the error with path versus outpath, restoring the name initpath in Parameters, all else the same
Matches the results from before changing the code
fixed that here
…/ShallowWaters.jl into add-new-integration
Removed redundant functions, fixed .gitignore
Making everything use a single structure
src/default_parameters.jl
Outdated
L_ratio::Real=2 # Domain aspect ratio of Lx/Ly | ||
nx::Int=128 # number of grid cells in x-direction | ||
Lx::Int=3840e3 # length of the domain in x-direction [m] | ||
L_ratio::Int=1 # Domain aspect ratio of Lx/Ly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this have to be an Int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just didn't want a Real
because of type-instabilities. Is there a different option to Int
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Float64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that because you change the defaults this is a breaking change, because you said "works as before" at some point 😉
Are there any tests you want to add for the changes you made? Cause "everything still works on my computer" isn't quite sufficient ;) |
That's fair lol, I don't think anything specific should be needed/added, the same tests as before should work since theoretically nothing changed |
I think this should resolve the problems between the main branch and mine
Does the CI test mean something, or can I go ahead and merge this today? |
Haha, no, please don't merge PR with failing tests (just changed this so that you cannot do this accidentally 😉), you can click on it to see what's going on, the first error is Expression: all(Prog.u .== 0.0f0)
type Tuple has no field u
Stacktrace:
[1] getproperty(x::Tuple{ShallowWaters.ModelSetup{Float32, Float32}, ShallowWaters.PrognosticVars{Float32}}, f::Symbol)
@ Base ./Base.jl:37
[2] macro expansion
@ /opt/hostedtoolcache/julia/1.9.4/x64/share/julia/stdlib/v1.9/Test/src/Test.jl:478 [inlined]
[3] macro expansion
@ ~/work/ShallowWaters.jl/ShallowWaters.jl/test/runtests.jl:6 [inlined] so you'd need to check what's going on here, maybe change the PR maybe change the tests. |
Ah okay, I missed that line in the error (all I noticed before was something about Julia actions and wasn't sure what that was). I'll look at what's going on |
Awesome, thanks Sarah! I can look at this either tomorrow afternoon or maybe next week. But maybe you'll be succesful making all the tests pass in the meantime anyway 😉 |
Thanks for the faith in my debugging skills lol, but I'm rather confused at the moment. If you have one second I have a quick question! Do you have guesses on why in this test
My code passes the first where |
Something blows up, (you can see the CI output no?) Got exception outside of a @test
InexactError: Int64(NaN) This could be related to you changing the model setup too (gravity is actual gravity again, not reduced gravity that Float16 maybe cannot handle as well). I'd suggests going back to the original physical setup here, and maybe to keep in mind that you use Float32 and the barotropic setup? |
…some adjoint/checkpointing stuff. I can maybe delete this later if needed
I can indeed see that something blew up, I was more confused on why only one of the two did 🙃
You were correct that it happened because of something that I did to the default parameters, I didn't think about the fact that Float16 is a little more sensitive... |
Yes, because this model is branded as "works with 16-bit arithmetic" I'd really like to have a default model setup that works in Float16 out of the box. It's not surprising that things may need some more careful investigation when you change the model setup (which changes time step etc. too) whether this requries a compensated time integration etc etc, but the default setup should ideally just work with Float16... |
I think this is also why #161 is hanging in there for years now because maybe that would give a bit more stability with Float16 but whether I'll ever get to this, I doubt it. All eyes are on SpeedyWeather now!! |
Totally fair and I completely understand! I should have considered what being compatible with |
It's really just about the defaults, you can obviously change this as you like! |
Congratulations all tests pass 🎉 I also leave this up to you whether you'd want to merge or squash merge |
Okay, I think this is the final pull request. It just makes everything use
S
, etc. etc. No Enzyme or Checkpointing yet, I'll make separate pull requests for those when I check everything still works on my computer. If you could ensure you can still run the integration with my changes that would be fabulous! I have double and triple checked on my end but I'm always afraid I'll miss something