5555 grid = AtmosphericModels. create_grid()
5656 @test typeof(grid) == Tuple{Array{Float64, 3 }, Array{Float64, 3 }, Array{Float64, 3 }}
5757
58- x = range(0 , 50 , length= 25 )
59- y = range(0 , 800 , length= 400 )
60- z = range(0 , 200 , length= 100 )
58+ y, x, z = AtmosphericModels. create_grid(10 , 20 , 10 , 5 )
6159
6260 u, v, w = AtmosphericModels. create_windfield(x, y, z; sigma1= 1.2 )
6361 am = AtmosphericModel(set)
6664
6765 set_data_path(olddir)
6866 cd(olddir)
67+ end
68+
69+ y, x, z = AtmosphericModels. create_grid(10 , 20 , 10 , 5 )
70+ u, v, w = AtmosphericModels. create_windfield(x, y, z, sigma1= 1.0 )
71+
72+ @testset " create_windfield" begin
73+ nx, ny, nz = size(x)
74+ @test nx == 11
75+ @test ny == 6
76+ @test nz == 6
77+ # Domain lengths
78+ Lx = x[end ,1 ,1 ] - x[1 ,1 ,1 ]
79+ Ly = y[1 ,end ,1 ] - y[1 ,1 ,1 ]
80+ Lz = z[1 ,1 ,end ] - z[1 ,1 ,1 ]
81+ @test Lx == 20.0
82+ @test Ly == 10.0
83+ @test Lz == 10.0
84+ @test AtmosphericModels. pfq(0.5 ) ≈ 1.7936563627777333
85+ @test sum(x) == 3960.0
86+ @test sum(y) == 0.0
87+ @test sum(z) == 3960.0
88+ @test all(x[1 ,:,:] .== 0 )
89+ @test all(x[2 ,:,:] .== 2 )
90+ @test all(x[11 ,:,:] .== 20 )
91+ @test size(u) == (11 ,6 ,6 )
92+ @test size(v) == (11 ,6 ,6 )
93+ @test size(w) == (11 ,6 ,6 )
94+ @test std(u) ≈ 1.0
95+ @test std(v) ≈ 0.7
96+ @test std(w) ≈ 0.5
6997end
0 commit comments