@@ -321,7 +321,7 @@ function IJFH{S, Nij, Nh}(array::AbstractArray{T, 4}) where {S, Nij, Nh, T}
321
321
@assert size (array, 1 ) == Nij
322
322
@assert size (array, 2 ) == Nij
323
323
@assert size (array, 3 ) == typesize (T, S)
324
- @assert size (array, 4 ) == Nh
324
+ @assert size (array, 4 ) == Nh " Nh is $Nh and array size is $( size (array)) "
325
325
IJFH {S, Nij, Nh, typeof(array)} (array)
326
326
end
327
327
@@ -340,10 +340,6 @@ function IJFH{S, Nij, Nh}(::Type{ArrayType}) where {S, Nij, Nh, ArrayType}
340
340
IJFH {S, Nij, Nh} (ArrayType (undef, Nij, Nij, typesize (T, S), Nh))
341
341
end
342
342
343
- # # TODO : deprecate
344
- # IJFH{S, Nij}(::Type{ArrayType}, Nh) where {S, Nij, ArrayType} =
345
- # IJFH{S, Nij, Nh}(ArrayType)
346
-
347
343
function replace_basetype (
348
344
data:: IJFH{S, Nij, Nh} ,
349
345
:: Type{T} ,
@@ -439,10 +435,11 @@ end
439
435
440
436
function gather (
441
437
ctx:: ClimaComms.AbstractCommsContext ,
442
- data:: IJFH{S, Nij, Nh } ,
443
- ) where {S, Nij, Nh }
438
+ data:: IJFH{S, Nij} ,
439
+ ) where {S, Nij}
444
440
gatherdata = ClimaComms. gather (ctx, parent (data))
445
441
if ClimaComms. iamroot (ctx)
442
+ Nh = size (gatherdata, 4 )
446
443
IJFH {S, Nij, Nh} (gatherdata)
447
444
else
448
445
nothing
456
453
Base. length (data:: Data1D ) = size (parent (data), 3 )
457
454
458
455
"""
459
- IFH{S, Ni, A} <: Data1D{S, Ni}
460
- IFH{S,Ni}(ArrayType, nelements )
456
+ IFH{S,Ni,Nh, A} <: Data1D{S, Ni}
457
+ IFH{S,Ni,Nh }(ArrayType)
461
458
462
459
Backing `DataLayout` for 1D spectral element slabs.
463
460
@@ -468,7 +465,7 @@ datatype `S` struct field (F), for each 1D mesh element (H).
468
465
The `ArrayType`-constructor makes a IFH 1D Spectral
469
466
DataLayout given the backing `ArrayType`, quadrature
470
467
degrees of freedom `Ni`, and the number of mesh elements
471
- `nelements `.
468
+ `Nh `.
472
469
"""
473
470
struct IFH{S, Ni, Nh, A} <: Data1D{S, Ni}
474
471
array:: A
@@ -495,10 +492,6 @@ function IFH{S, Ni, Nh}(::Type{ArrayType}) where {S, Ni, Nh, ArrayType}
495
492
IFH {S, Ni, Nh} (ArrayType (undef, Ni, typesize (T, S), Nh))
496
493
end
497
494
498
- # # TODO : deprecate
499
- # IFH{S, Ni}(::Type{ArrayType}, Nh) where {S, Ni, ArrayType} =
500
- # IFH{S, Ni, Nh}(ArrayType)
501
-
502
495
rebuild (data:: IFH{S, Ni, Nh} , array:: AbstractArray{T, 3} ) where {S, Ni, Nh, T} =
503
496
IFH {S, Ni, Nh} (array)
504
497
@@ -1076,7 +1069,7 @@ function VIJFH{S, Nv, Nij, Nh}(
1076
1069
check_basetype (T, S)
1077
1070
@assert size (array, 2 ) == size (array, 3 ) == Nij
1078
1071
@assert size (array, 4 ) == typesize (T, S)
1079
- @assert size (array, 5 ) == Nh
1072
+ @assert size (array, 5 ) == Nh " Nh is $Nh and array size is $( size (array)) "
1080
1073
VIJFH {S, Nv, Nij, Nh, typeof(array)} (array)
1081
1074
end
1082
1075
@@ -1198,10 +1191,11 @@ end
1198
1191
1199
1192
function gather (
1200
1193
ctx:: ClimaComms.AbstractCommsContext ,
1201
- data:: VIJFH{S, Nv, Nij, Nh } ,
1202
- ) where {S, Nv, Nij, Nh }
1194
+ data:: VIJFH{S, Nv, Nij} ,
1195
+ ) where {S, Nv, Nij}
1203
1196
gatherdata = ClimaComms. gather (ctx, parent (data))
1204
1197
if ClimaComms. iamroot (ctx)
1198
+ Nh = size (gatherdata, 5 )
1205
1199
VIJFH {S, Nv, Nij, Nh} (gatherdata)
1206
1200
else
1207
1201
nothing
0 commit comments