Skip to content

Commit 0df1366

Browse files
authored
Merge pull request #141 from milankl/sherlogs
::DataType in Parameters removed
2 parents 48f4a15 + 61e9577 commit 0df1366

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/DefaultParameters.jl

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

3-
T::DataType=Float32 # number format
3+
T=Float32 # number format
44

5-
Tprog::DataType=T # number format for prognostic variables
6-
Tcomm::DataType=Tprog # number format for ghost-point copies
5+
Tprog=T # number format for prognostic variables
6+
Tcomm=Tprog # number format for ghost-point copies
77

88
# DOMAIN RESOLUTION AND RATIO
99
nx::Int=100 # number of grid cells in x-direction

src/Gradients.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ function ∇²!(du::Array{T,2},u::Array{T,2}) where {T<:AbstractFloat}
3232

3333
minus_4 = T(-4.0)
3434

35-
#TODO @simd?
3635
@inbounds for i 1:n
3736
for j 1:m
3837
du[j,i] = minus_4*u[j+1,i+1] + u[j,i+1] + u[j+2,i+1] + u[j+1,i] + u[j+1,i+2]
@@ -77,10 +76,10 @@ end
7776

7877
""" ∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2 with grid spacing Δ (default 1)."""
7978
function ∇²(u::Array{T,2}::Real=1) where {T<:AbstractFloat}
80-
79+
8180
m, n = size(u)
8281
du = Array{T,2}(undef,m-2,n-2)
83-
82+
8483
minus_4 = T(-4.0)
8584
one_over_dx² = T(1/Δ^2)
8685

src/Output.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ function output_nc!(i::Int,
8484
ncs.iout[1] = iout # pack
8585

8686
@unpack halo,haloη,halosstx,halossty = S.grid
87-
@unpack q,dvdx,dudy = Diag.Vorticity
8887
@unpack f_q,ep,dtint = S.grid
8988

9089
# CUT OFF HALOS
@@ -108,6 +107,7 @@ function output_nc!(i::Int,
108107
NetCDF.putvar(ncs.sst,"sst",sst,start=[1,1,iout],count=[-1,-1,1])
109108
end
110109
if ncs.q != nothing
110+
@views q = Float32.(Diag.Vorticity)
111111
NetCDF.putvar(ncs.q,"q",q,start=[1,1,iout],count=[-1,-1,1])
112112
end
113113
if ncs.ζ != nothing

0 commit comments

Comments
 (0)