Skip to content

Commit c375a0b

Browse files
committed
add example 3D example setup
1 parent 2f2647d commit c375a0b

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

docs/Project.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
3+
MeshArrays = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
4+
NetCDF = "30363a11-5582-574a-97bb-aa9a979735b9"
5+
OceanStateEstimation = "891f6deb-a4f5-4bc5-a2e3-1e8f649cdd2c"
46
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
7+
PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"

examples/global_ocean_3D_example.jl

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
import MeshArrays, OceanStateEstimation, NetCDF
3+
4+
MeshArrays.GRID_LL360_download()
5+
γ = MeshArrays.GridSpec("PeriodicChannel",MeshArrays.GRID_LL360)
6+
Γ = MeshArrays.GridLoad(γ;option="full")
7+
8+
grid_info=( XC=Γ.XC[1], YC=Γ.YC[1], RC=Γ.RC,
9+
XW=Γ.XW[1], YS=Γ.YS[1], RF=Γ.RF,
10+
DXC=Γ.DXC[1], DYC=Γ.DYC[1], DRC=Γ.DRC,
11+
DXG=Γ.DXG[1], DYG=Γ.DYG[1], DRF=Γ.DRF,
12+
RAW=Γ.RAW[1], RAS=Γ.RAS[1], RAC=Γ.RAC[1],
13+
hFacC=write.hFacC), hFacW=write.hFacW), hFacS=write.hFacS));
14+
15+
OceanStateEstimation.get_occa_variable_if_needed("DDtheta")
16+
OceanStateEstimation.get_occa_variable_if_needed("DDuvel")
17+
OceanStateEstimation.get_occa_variable_if_needed("DDvvel")
18+
OceanStateEstimation.get_occa_variable_if_needed("DDwvel")
19+
20+
function rd(filename, varname, month)
21+
fil = NetCDF.open(filename, varname)
22+
tmp = fil[:,:,:,month]
23+
tmp[findall(tmp.<-1e22)] .= 0.0
24+
return tmp
25+
end
26+
27+
month=1
28+
pth=OceanStateEstimation.OCCAclim_path
29+
U=rd(joinpath(pth,"DDuvel.0406clim.nc"),"u",month);
30+
V=rd(joinpath(pth,"DDvvel.0406clim.nc"),"v",month);
31+
W=rd(joinpath(pth,"DDwvel.0406clim.nc"),"w",month);
32+
T=rd(joinpath(pth,"DDtheta.0406clim.nc"),"theta",month);

0 commit comments

Comments
 (0)