How about setting up a vertical temperature penetration effect in the ocean and solve the NaN problem? #3382
-
Hi all! I have the following question for you all, thanks a lot for reading! I've read discussion #3218 and #2832, but it seems that my problem is still not solved.
But in reality, the vertical change of temperature in the ocean conforms to the following equation 1: I_0*(A * exp(-z / g1) + (1.0 - A) * exp(-z / g2)). It has to do with the propagation of light. Then I use the forcing term to reflect this role. The code is:
And the
the simulation cannot converge. What should I do? Thanks a lot! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The depth dependence should probably be implemented with One way to check this is to plot your forcing function |
Beta Was this translation helpful? Give feedback.
The depth dependence should probably be implemented with
exp(z)
, notexp(-z)
. I can't see the code you use to create your grid, but generallyz
increases upward (think of "z" as "height", z=0 at the surface and z is negative within the ocean).One way to check this is to plot your forcing function
temperature_forcing
as a function ofz
to inspect that it behaves as expected.