Scaling ShallowWaterModel causes static issue #2672
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
@rbenamran do you mind if I convert this to a discussion? This would fit in the "computational science" category: https://github.com/CliMA/Oceananigans.jl/discussions/categories/computational-science The issue here is the function function rand_smth(x::Float64, y::Float64)
X = x / 1000000
Y = y / 1000000
val = 0
for i in 1:n
for j in 1:m
ar = alea[i,j,1]
br = alea[i,j,2]
cr = alea[i,j,3]
dr = alea[i,j,4]
val += ar * cos(i * x) * cos(j * y)
val += br * cos(i * x) * sin(j * y)
val += cr * sin(i * x) * cos(j * y)
val += dr * sin(i * x) * sin(j * y)
end
end
return val
end These represent long wavelengths on domains of size 2pi by 2pi, but very short wavelengths on a domain that's 1000 kilometers square. A quick change is to define function rand_smth(x::Float64, y::Float64)
X = x / 1000000
Y = y / 1000000
val = 0
for i in 1:n
for j in 1:m
# Dimensional wavenumbers
k = 2π / Lx
l = 2π / Lx
ar = alea[i,j,1]
br = alea[i,j,2]
cr = alea[i,j,3]
dr = alea[i,j,4]
val += ar * cos(k * x) * cos(l * y)
val += br * cos(k * x) * sin(l * y)
val += cr * sin(k * x) * cos(l * y)
val += dr * sin(k * x) * sin(l * y)
end
end
return val
end |
Beta Was this translation helpful? Give feedback.
-
Also, I noticed that you have |
Beta Was this translation helpful? Give feedback.
@rbenamran do you mind if I convert this to a discussion? This would fit in the "computational science" category: https://github.com/CliMA/Oceananigans.jl/discussions/categories/computational-science
The issue here is the function
random_smth
which uses wavenumbersi, j
that range from 1 to 16: