-
Notifications
You must be signed in to change notification settings - Fork 55
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
Perturbation to basic state variables #430
Comments
There's no general recipe for this. You will have to find the index of the desired location (by looking it up in the coordinate arrays |
Sorry but I'm kinda new to this model, so can you just elaborate a little on the procedure to perturb the variable. For example, If I want to decrease salinity gradually (with a fixed amount per year) then what do I have to do ? |
The simplest way would probably be to add / subtract a constant term here: https://github.com/team-ocean/veros/blob/master/veros/setups/global_1deg/global_1deg.py#L328 A negative term would indicate a constant freshwater influx at the surface which gradually reduces salinity. |
For understanding the model code ,what can be a good start ? |
Besides what's in the docs, we unfortunately don't have any beginner's resources yet. If you have a specific question and share what you tried I am happy to help. |
How to change the runtime of the global_1deg setup ? |
That sounds correct. Which commands did you use to create and run the setup? And can you share the output of the run? |
I just changed the |
Sorry, I meant the output to the terminal. Did it actually run for 3 years (which should take several days of real-time)? |
I am actually using a HPC system. I have another question as you mentioned that the real run would take several days in real time; how much would it take if I want to do a 80-100 year simulation on a HPC system ? |
So the solution became unstable and diverged. It seems to me like you also increased the time step? Like, the CFL diagnostic runs every model day, which should be at 48 time steps with the default step of 0.5 hours. But in the log I see its output after 24 time steps. That would explain why the setup diverged; the default values are close to the largest possible stable time steps.
That depends how much hardware you want to throw at it :) On a single CPU node you will probably get something like 1 yr/day with JAX. By using multiple nodes or GPUs you can probably push that to something like 10 yr/day. But it all depends on your hardware and cluster architecture. |
Thanks...changing the CFL diagnostic time step from 24 to 48 worked; also checked the default global_1deg code and the CFL diagnostic time step is 24 there. |
I meant the main model time step ( |
Okay!! |
If I'm doing 100 years of simulation, what would be the approx spin up time for global_1deg.py ? |
Depends on what part of the ocean you need spun up. 100 years sounds about right for equilibration of the MOC, but it's always safer to check (plot some mean variable over time and make sure it's converged). Or ask your advisor :) |
I have been trying to decrease the salinity in the North Atlantic using the 4 degree model. But the method seems to be not working. Did I miss something ? I made a mask of 1s and 0s stored in the custom variable vs.freshwater
Then used the following code to decrease salinity in the mased region -
|
Define not working? Code looks fine to me for the most part, but please format it with triple backticks next time ``` The part that stands out to me is this: cond = jnp.less_equal(t_sim-t_start, t_duration)
decrease_years = jnp.where(cond, jnp.minimum(t_sim - t_start, t_duration), 0.0)
forc_val = jnp.where(cond, ampl * decrease_years, 0.0)
vs.forc_salt_surface = jnp.where(cond, vs.forc_salt_surface - (vs.freshwater * forc_val), vs.forc_salt_surface) That seems complicated for a simple ramp. I would implement this like so: forc_val = ampl * jnp.clip((t_sim - t_start) / t_duration, 0, 1)
vs.forc_salt_surface = vs.forc_salt_surface - (vs.freshwater * forc_val) If this still doesn't work I'd recommend you run your setup with NumPy on your local machine and plot some of the variables here ( |
So the code didn't work. |
You can use any Python code when running with NumPy: def set_forcing(self, ...):
...
import matplotlib.pyplot as plt
plt.imshow(vs.force_salt_surface)
plt.show() |
Hi! I want know how to perturb the basic state variables such as temperature, salinity etc. for a specific location in the global 1_deg model.
Thank you!
The text was updated successfully, but these errors were encountered: