Skip to content

Commit 85cffc4

Browse files
rename ny parameter to np
1 parent 7a200ed commit 85cffc4

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/Grids.jl

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ land_mask(Γ::NamedTuple)=land_mask(Γ.hFacC[:,1])
3131
## GridSpec function with category argument:
3232

3333
"""
34-
GridSpec(category="PeriodicDomain",path=tempname(); ny=nothing, ID=:unknown)
34+
GridSpec(category="PeriodicDomain",path=tempname(); np=nothing, ID=:unknown)
3535
3636
- Select one of the pre-defined grids either by ID (keyword) or by category.
3737
- Return the corresponding `gcmgrid` specification, including the path where grid files can be accessed (`path`).
@@ -75,43 +75,43 @@ isa(g,gcmgrid)
7575
true
7676
```
7777
78-
3. by `category` and `path` with the `ny` argument
79-
- `ny` is the number of grid points in y for the `LatLonCap` and `CubeSphere` tiles.
80-
`ny` defaults to 90 for `LatLonCap` and 32 for `CubeSphere`, and so must be included to access the LLC270 grid.
78+
3. by `category` and `path` with the `np` argument
79+
- `np` is the number of grid points in x or y for the `LatLonCap` and `CubeSphere` tiles.
80+
`np` defaults to 90 for `LatLonCap` and 32 for `CubeSphere`, and so must be included to access the LLC270 grid with the category argument.
8181
8282
Examples:
8383
8484
```jldoctest; output = false
8585
using MeshArrays
86-
g = GridSpec("LatLonCap",MeshArrays.GRID_LLC90,ny=90)
87-
g = GridSpec("LatLonCap",MeshArrays.GRID_LLC270,ny=270)
88-
g = GridSpec("CubeSphere",MeshArrays.GRID_CS32,ny=32)
86+
g = GridSpec("LatLonCap",MeshArrays.GRID_LLC90,np=90)
87+
g = GridSpec("LatLonCap",MeshArrays.GRID_LLC270,np=270)
88+
g = GridSpec("CubeSphere",MeshArrays.GRID_CS32,np=32)
8989
isa(g,gcmgrid)
9090
9191
# output
9292
9393
true
9494
```
9595
"""
96-
function GridSpec(category="PeriodicDomain", path=tempname(); ny=nothing, ID=:unknown)
96+
function GridSpec(category="PeriodicDomain", path=tempname(); np=nothing, ID=:unknown)
9797

9898
if category=="LatLonCap"
9999
nFaces=5
100100
grTopo="LatLonCap"
101-
ny === nothing ? ny=90 : ny
102-
ioSize=[ny ny*13]
103-
facesSize=[(ny, ny*3), (ny, ny*3), (ny, ny), (ny*3, ny), (ny*3, ny)]
104-
if ny==270
101+
np === nothing ? np=90 : np
102+
ioSize=[np np*13]
103+
facesSize=[(np, np*3), (np, np*3), (np, np), (np*3, np), (np*3, np)]
104+
if np==270
105105
ioPrec=Float32
106106
else
107107
ioPrec=Float64
108108
end
109109
elseif category=="CubeSphere"
110110
nFaces=6
111111
grTopo="CubeSphere"
112-
ny === nothing ? ny=32 : ny
113-
ioSize=[ny ny*nFaces]
114-
facesSize=[(ny, ny), (ny, ny), (ny, ny), (ny, ny), (ny, ny), (ny, ny)]
112+
np === nothing ? np=32 : np
113+
ioSize=[np np*nFaces]
114+
facesSize=[(np, np), (np, np), (np, np), (np, np), (np, np), (np, np)]
115115
ioPrec=Float32
116116
elseif category=="PeriodicChannel"
117117
nFaces=1
@@ -132,14 +132,14 @@ end
132132
if ID==:unknown
133133
gcmgrid(path, grTopo, nFaces, facesSize, ioSize, ioPrec, read, write)
134134
elseif ID==:LLC90
135-
ny = 90
136-
GridSpec("LatLonCap", MeshArrays.GRID_LLC90, ny=ny)
135+
np = 90
136+
GridSpec("LatLonCap", MeshArrays.GRID_LLC90, np=np)
137137
elseif ID==:LLC270
138-
ny = 270
139-
GridSpec("LatLonCap", MeshArrays.GRID_LLC270, ny=ny)
138+
np = 270
139+
GridSpec("LatLonCap", MeshArrays.GRID_LLC270, np=np)
140140
elseif ID==:CS32
141-
ny = 32
142-
GridSpec("CubeSphere", MeshArrays.GRID_CS32, ny=ny)
141+
np = 32
142+
GridSpec("CubeSphere", MeshArrays.GRID_CS32, np=np)
143143
elseif ID==:onedegree
144144
GridSpec("PeriodicChannel", MeshArrays.GRID_LL360)
145145
elseif ID==:default

0 commit comments

Comments
 (0)