2
2
GRID_LLC90_hash = artifact_hash (" GRID_LLC90" , artifact_toml)
3
3
GRID_LLC90 = joinpath (artifact_path (GRID_LLC90_hash)* " /" ," GRID_LLC90-1.1/" )
4
4
GRID_LLC90_download () = artifact " GRID_LLC90"
5
+ GRID_LLC270_hash = artifact_hash (" GRID_LLC270" , artifact_toml)
6
+ GRID_LLC270 = joinpath (artifact_path (GRID_LLC270_hash)* " /" ," GRID_LLC270-1.0.0/" )
7
+ GRID_LLC270_download () = artifact " GRID_LLC270"
5
8
GRID_LL360_hash = artifact_hash (" GRID_LL360" , artifact_toml)
6
9
GRID_LL360 = joinpath (artifact_path (GRID_LL360_hash)* " /" ," GRID_LL360-1.0/" )
7
10
GRID_LL360_download () = artifact " GRID_LL360"
@@ -28,7 +31,7 @@ land_mask(Γ::NamedTuple)=land_mask(Γ.hFacC[:,1])
28
31
# # GridSpec function with category argument:
29
32
30
33
"""
31
- GridSpec(category="PeriodicDomain",path=tempname(); ID=:unknown)
34
+ GridSpec(category="PeriodicDomain",path=tempname(); np=nothing, ID=:unknown)
32
35
33
36
- Select one of the pre-defined grids either by ID (keyword) or by category.
34
37
- Return the corresponding `gcmgrid` specification, including the path where grid files can be accessed (`path`).
@@ -37,6 +40,7 @@ land_mask(Γ::NamedTuple)=land_mask(Γ.hFacC[:,1])
37
40
38
41
- `:LLC90`
39
42
- `:CS32`
43
+ - `:LLC270`
40
44
- `:onedegree`
41
45
- `:default`
42
46
@@ -68,22 +72,46 @@ isa(g,gcmgrid)
68
72
69
73
# output
70
74
75
+ true
76
+ ```
77
+
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.
81
+
82
+ Examples:
83
+
84
+ ```jldoctest; output = false
85
+ using MeshArrays
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)
89
+ isa(g,gcmgrid)
90
+
91
+ # output
92
+
71
93
true
72
94
```
73
95
"""
74
- function GridSpec (category= " PeriodicDomain" ,path= tempname (); ID= :unknown )
96
+ function GridSpec (category= " PeriodicDomain" , path= tempname (); np = nothing , ID= :unknown )
75
97
76
98
if category== " LatLonCap"
77
99
nFaces= 5
78
100
grTopo= " LatLonCap"
79
- ioSize= [90 1170 ]
80
- facesSize= [(90 , 270 ), (90 , 270 ), (90 , 90 ), (270 , 90 ), (270 , 90 )]
81
- ioPrec= Float64
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
105
+ ioPrec= Float32
106
+ else
107
+ ioPrec= Float64
108
+ end
82
109
elseif category== " CubeSphere"
83
110
nFaces= 6
84
111
grTopo= " CubeSphere"
85
- ioSize= [32 192 ]
86
- facesSize= [(32 , 32 ), (32 , 32 ), (32 , 32 ), (32 , 32 ), (32 , 32 ), (32 , 32 )]
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)]
87
115
ioPrec= Float32
88
116
elseif category== " PeriodicChannel"
89
117
nFaces= 1
@@ -102,13 +130,18 @@ else
102
130
end
103
131
104
132
if ID== :unknown
105
- gcmgrid (path,grTopo,nFaces,facesSize, ioSize, ioPrec, read, write)
133
+ gcmgrid (path, grTopo, nFaces, facesSize, ioSize, ioPrec, read, write)
106
134
elseif ID== :LLC90
107
- GridSpec (" LatLonCap" ,MeshArrays. GRID_LLC90)
135
+ np = 90
136
+ GridSpec (" LatLonCap" , MeshArrays. GRID_LLC90, np= np)
137
+ elseif ID== :LLC270
138
+ np = 270
139
+ GridSpec (" LatLonCap" , MeshArrays. GRID_LLC270, np= np)
108
140
elseif ID== :CS32
109
- GridSpec (" CubeSphere" ,MeshArrays. GRID_CS32)
141
+ np = 32
142
+ GridSpec (" CubeSphere" , MeshArrays. GRID_CS32, np= np)
110
143
elseif ID== :onedegree
111
- GridSpec (" PeriodicChannel" ,MeshArrays. GRID_LL360)
144
+ GridSpec (" PeriodicChannel" , MeshArrays. GRID_LL360)
112
145
elseif ID== :default
113
146
GridSpec ()
114
147
else
@@ -156,6 +189,7 @@ function GridLoad(γ=GridSpec(); ID=:default, option=:minimal)
156
189
157
190
gr. path== GRID_CS32 ? GRID_CS32_download () : nothing
158
191
gr. path== GRID_LL360 ? GRID_LL360_download () : nothing
192
+ gr. path== GRID_LLC270 ? GRID_LLC270_download () : nothing
159
193
gr. path== GRID_LLC90 ? GRID_LLC90_download () : nothing
160
194
161
195
Γ= Dict ()
0 commit comments