Skip to content

Commit cdea13d

Browse files
committed
Adding minor changes that are needed for Enzyme to run, working on understanding why they're needed but for now I just know they are
1 parent 033239f commit cdea13d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/constants.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function SSPRK3coeff{T}(P::Parameter,Δt_Δ::T) where T
2626
return SSPRK3coeff{T}(n,s,kn,mn,Δt_Δn,kna,knb,Δt_Δnc)
2727
end
2828

29-
struct Constants{T<:AbstractFloat,Tprog<:AbstractFloat}
29+
mutable struct Constants{T<:AbstractFloat,Tprog<:AbstractFloat}
3030

3131
# RUNGE-KUTTA COEFFICIENTS 2nd/3rd/4th order including timestep Δt
3232
RKaΔt::Array{Tprog,1}

src/default_parameters.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@with_kw struct Parameter
1+
@with_kw mutable struct Parameter
22

33
T=Float32 # number format
44

@@ -8,8 +8,8 @@
88

99
# DOMAIN RESOLUTION AND RATIO
1010
nx::Int=100 # number of grid cells in x-direction
11-
Lx::Real=4000e3 # length of the domain in x-direction [m]
12-
L_ratio::Real=2 # Domain aspect ratio of Lx/Ly
11+
Lx::Int=4000e3 # length of the domain in x-direction [m]
12+
L_ratio::Int=2 # Domain aspect ratio of Lx/Ly
1313

1414
# PHYSICAL CONSTANTS
1515
g::Real=0.1 # gravitational acceleration [m/s]
@@ -20,7 +20,7 @@
2020
R::Real=6.371e6 # Earth's radius [m]
2121

2222
# SCALE
23-
scale::Real=2^6 # multiplicative scale for the momentum equations u,v
23+
scale::Int=2^6 # multiplicative scale for the momentum equations u,v
2424
scale_sst::Real=2^15 # multiplicative scale for sst
2525

2626
# WIND FORCING OPTIONS

src/grid.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Parameters taken from Parameter struct
44
nx::Int # number of grid cells in x-direction
5-
Lx::Real # length of the domain in x-direction [m]
5+
Lx::Int # length of the domain in x-direction [m]
66
L_ratio::Real # Domain aspect ratio of Lx/Ly
77
bc::String # boundary condition, "periodic" or "nonperiodic"
88
g::Real # gravitational acceleration [m/s]
@@ -16,10 +16,10 @@
1616
ω::Real # Earth's angular frequency [s^-1]
1717
ϕ::Real # central latitue of the domain (for coriolis) [°]
1818
R::Real # Earth's radius [m]
19-
scale::Real # multiplicative scale for momentum equations [1]
19+
scale::Int # multiplicative scale for momentum equations [1]
2020

2121
# DOMAIN SIZES
22-
Δ::Real=Lx / nx # grid spacing
22+
Δ::T=Lx / nx # grid spacing
2323
ny::Int=Int(round(Lx / L_ratio / Δ)) # number of grid cells in y-direction
2424
Ly::Real=ny * Δ # length of domain in y-direction
2525

0 commit comments

Comments
 (0)