@@ -6,33 +6,35 @@ import MeshArrays: gcmgrid, varmeta, MeshArray, Dict_to_NamedTuple
66import MeshArrays: read_tiles, write_tiles, GridSpec_default
77
88"""
9- GridSpec_ones(grTp,nF,nP )
9+ GridSpec_ones(grTp; ioPrec=Float64,nP=10,nF=1 )
1010
11- Define grid where all variables will be set
12- to one via `GridLoad_ones`.
11+ Define grid where all variables will be set to one via `GridLoad_ones`.
12+
13+ - Possible values for `grTp`` : "LatLonCap","CubeSphere","PeriodicChannel","PeriodicDomain".
14+ - `nP` : number of points at each subdomain edge.
15+ - `nF` (only for "PeriodicChannel", "PeriodicDomain" grids) : number of subdomains.
1316
1417```
1518using MeshArrays
16- γ=MeshArrays.GridSpec_ones("CubeSphere",6,20);
19+ γ=MeshArrays.GridSpec_ones("CubeSphere")
1720Γ=MeshArrays.GridLoad_ones(γ;option="full")
1821```
1922"""
20- function GridSpec_ones (grTp,nF,nP ; ioPrec= Float64)
23+ function GridSpec_ones (grTp; ioPrec= Float64,nP = 10 ,nF = 1 )
2124 grDir= " _ones"
2225 grTopo= grTp
23- nFaces= nF
2426 if grTopo== " LatLonCap"
25- ioSize = [nP nP * nF]
27+ nFaces = 5
2628 elseif grTopo== " CubeSphere"
27- ioSize = [nP nP * nF]
29+ nFaces = 6
2830 elseif grTopo== " PeriodicChannel"
29- ioSize = [nP nP]
31+ nFaces = nF
3032 elseif grTopo== " PeriodicDomain"
31- nFsqrt= Int (sqrt (nF))
32- ioSize= [nP* nFsqrt nP* nFsqrt]
33+ nFaces= nF
3334 else
3435 error (" unknown configuration (grTopo)" )
3536 end
37+ ioSize= [nP nP* nFaces]
3638 facesSize= Array {NTuple{2, Int},1} (undef,nFaces)
3739 facesSize[:]. = [(nP,nP)]
3840
@@ -154,12 +156,11 @@ isa(Γ.XC,MeshArray)
154156
155157true
156158```
157-
158159"""
159160function periodic_domain (np:: Integer ,nq= missing )
160161 ismissing (nq) ? nq= np : nothing
161162
162- nFaces= 1 # still needs fixing ...
163+ nFaces= 1
163164 ioSize= [np nq]
164165 facesSize= Array {NTuple{2, Int},1} (undef,nFaces)
165166 facesSize[:]. = [(np,nq)]
0 commit comments