Skip to content

Commit

Permalink
removing 'sum' function
Browse files Browse the repository at this point in the history
  • Loading branch information
anthony-meza committed Jul 6, 2024
1 parent 1ce9e6c commit a26559f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 632,396 deletions.
1 change: 1 addition & 0 deletions CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[deps]
cartopy = ""
matplotlib = ""
seaborn = ""
632,414 changes: 46 additions & 632,368 deletions diagnostic_examples/Interpolations.ipynb

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions src/ECCOtour.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2252,26 +2252,6 @@ function rotate_uv(uvel::MeshArrays.gcmarray{T,N,Matrix{T}},vvel::MeshArrays.gcm
return evel,nvel
end

"""
function calc_UV_conv3D!(uFLD::MeshArrays.gcmarray{T, 2, Matrix{T}},
vFLD::MeshArrays.gcmarray{T, 2, Matrix{T}}, CONV::MeshArrays.gcmarray{T, 2, Matrix{T}}) where T<:Real
tmpU, tmpV = exch_UV_cs3D(uFLD,vFLD)
By Anthony Meza
"""
function calc_UV_conv3D!(uFLD::MeshArrays.gcmarray{T, 2, Matrix{T}},
vFLD::MeshArrays.gcmarray{T, 2, Matrix{T}}, CONV::MeshArrays.gcmarray{T, 2, Matrix{T}}) where T<:Real
tmpU, tmpV = exch_UV_cs3D(uFLD,vFLD)
for a in eachindex(uFLD.f)
(s1,s2)=size(uFLD.f[a])
@inbounds tmpU1=view(tmpU.f[a],1:s1,1:s2)
@inbounds tmpU2=view(tmpU.f[a],2:s1+1,1:s2)
@inbounds tmpV1=view(tmpV.f[a],1:s1,1:s2)
@inbounds tmpV2=view(tmpV.f[a],1:s1,2:s2+1)
@inbounds CONV.f[a] = tmpU1-tmpU2+tmpV1-tmpV2
end
end

"""
function exch_UV_cs3D(fldU::MeshArrays.gcmarray{T, 2, Matrix{T}},
fldV::MeshArrays.gcmarray{T, 2, Matrix{T}}) where T<:Real
Expand Down
16 changes: 8 additions & 8 deletions src/Grid_Operations.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
function sum(ma::MeshArrays.gcmarray{T, N, Matrix{T}}) where T<:AbstractFloat where N
tmp = zeros(T, 1)
for a in eachindex(ma)
tmp .+= sum(T, ma.f[a])
end

return tmp[1]
end
# function sum(ma::MeshArrays.gcmarray{T, N, Matrix{T}}) where T<:AbstractFloat where N
# tmp = zeros(T, 1)
# for a in eachindex(ma)
# tmp .+= sum(T, ma.f[a])
# end

# return tmp[1]
# end

function vertical_sum(ma::MeshArrays.gcmarray{T, 2, Matrix{T}}) where T<:AbstractFloat
γ = ma.grid #grid info
Expand Down

0 comments on commit a26559f

Please sign in to comment.