Skip to content

Commit 9105671

Browse files
authored
Merge pull request JuliaClimate#148 from gaelforget/v0p3p13_d
V0p3p13(d)
2 parents dc71bde + 0f60b88 commit 9105671

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MeshArrays"
22
uuid = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
33
authors = ["gaelforget <gforget@mit.edu>"]
4-
version = "0.3.12"
4+
version = "0.3.13"
55

66
[deps]
77
CatViews = "81a5f4ea-a946-549a-aa7e-2a7f63a27d31"

src/ReadWrite.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ Reformat Array data into a MeshArray shaped after `γ`.
3030
"""
3131
function read(xx::Array::gcmgrid)
3232
siz=size.(Ref(xx),[1,2,3,4])
33-
if siz[1:2]==[i for i in γ.ioSize]
33+
S=[i for i in γ.ioSize[:]]
34+
if siz[1:2]==S||siz[1:2]==transpose(S)
3435
n3=siz[3]; n4=siz[4]
3536
yy=reshape(xx,(γ.ioSize...,n3,n4))
36-
elseif siz[1]==prod(γ.ioSize[:])
37+
elseif siz[1]==prod(S)
3738
n3=siz[2]; n4=siz[3]
3839
yy=reshape(xx,(γ.ioSize...,n3,n4))
39-
elseif mod(siz[1],prod(γ.ioSize[:]))==0
40+
elseif mod(siz[1],prod(S))==0
4041
n3=Int(siz[1]/prod.ioSize[:]))
4142
n4=1
4243
yy=reshape(xx,(γ.ioSize...,n3,n4))

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ end
101101
GM_PsiY=read(randn(90,1170,50),Γ.hFacS)
102102
bolusU, bolusV, bolusW=MeshArrays.calc_bolus(GM_PsiX,GM_PsiY, Γ)
103103

104+
read(rand(90*1170),γ)
105+
read(rand(90*1170*2),γ)
106+
read(rand(90,1170,2,2),γ)
107+
104108
#See: OceanTransports/helper_functions.jl
105109
#u,v,uC,vC=rotate_uv(uv,Γ);
106110

0 commit comments

Comments
 (0)