Comments (17)
Can you show what you tried?
from veros.
from veros.
Please paste your code here instead of uploading an image.
from veros.
from veros.
The first slice here is empty since it goes backwards (from the second-last element to the start of the array):
vs.salt = update(vs.salt, at[-2:0, 6:7, -2,0], 35.0)
This has nothing to do with the update
function and everything to do with how NumPy applies slices. A simpler example:
>>> import numpy as np
>>> arr = np.arange(100)
>>> arr[-2:0]
array([], dtype=int64)
>>> arr[-2:]
array([98, 99])
Notice how arr[-2:0]
is empty, so your updates don't apply to anything. Use arr[-2:]
instead.
from veros.
from veros.
from veros.
Works fine on my end:
# this is my attempt at using the update function
vs.salt = update(vs.salt, at[-2:, 6:7, -2,0], 35.0)
print(vs.salt[-2:, 6:7, -2,0])
Prints
[[35.]
[35.]]
from veros.
from veros.
If you increase the number of grid cells, you will have to reduce the grid spacing to get the same total extent of the grid (to not make the globe twice as large), and reduce the time step to ensure convergence.
For example, if we double the number of grid cells:
@veros_routine
def set_parameter(self, state):
...
settings.nx, settings.ny, settings.nz = 60, 84, 15
You also need to halve the grid spacing:
@veros_routine
def set_grid(self, state):
...
vs.dxt = update(vs.dxt, at[...], 1.0)
vs.dyt = update(vs.dyt, at[...], 1.0)
and change the time step:
@veros_routine
def set_parameter(self, state):
...
settings.dt_tracer = 86400 / 4.0
from veros.
from veros.
You can update ssh in set_forcing
to whatever value you want. This function is called in every timestep.
from veros.
from veros.
from veros.
I see. The following should work:
def set_parameters(state):
...
settings.enable_streamfunction = False # enable SSH
def set_initial_conditions(state):
...
# add an SSH anomaly of 10m somewhere in the domain
vs.psi = update(vs.psi, at[10:20, 10:20, :], 10.0 * settings.grav)
SSH is time varying by default, but you need to disable the streamfunction solver to enable it.
from veros.
from veros.
Please read the docs: https://veros.readthedocs.io/en/latest/reference/diagnostics.html#diagnostics
from veros.
Related Issues (20)
- Non-hydrostatic solver HOT 5
- Linear solver issue when parallelising VEROS HOT 1
- Document overturning variables HOT 2
- Bathymetry in Veros HOT 1
- Changing grid resolution and a closed ITF in global_4deg setup HOT 1
- How to run Veros via MPI on a cluster with slurm? HOT 1
- How to run veros with multi-GPU HOT 5
- Perturbation to basic state variables HOT 20
- The latest model version is not displayed correctly in documentation HOT 2
- How to change the sampling frequency of Veros 1
- How to change the sampling and output frequency of veros 1_deg model ? HOT 6
- No output files generating while using mpirun with JAX HOT 18
- How to add a mask file to veros and how to call in the model setup ? HOT 15
- Output variables HOT 11
- ENH: more metadata in diagnostic outputs? HOT 2
- North Atlantic Missing assets.json HOT 2
- Set beginning and ending time for simulation? HOT 4
- Veros using 10% of CPU HOT 1
- Using the North Atlantic regional setup for other regions HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from veros.