diff --git a/src/geometry.F90 b/src/geometry.F90 index 0d03601a0d..c9865cb114 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -1569,7 +1569,7 @@ contains ! Top and bottom sides. if (lat % is_3d) then - z0 = sign(lat % pitch(3) * 0.5_8, w) + z0 = sign(lat % pitch(2) * 0.5_8, w) if (abs(z - z0) < FP_PRECISION) then d = INFINITY diff --git a/src/input_xml.F90 b/src/input_xml.F90 index b85ed8c242..0a5b4e23ee 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -1301,8 +1301,8 @@ contains end do RECT_LATTICES HEX_LATTICES: do i = 1, n_hlats - allocate(HexLattice::lattices(i) % obj) - lat => lattices(i) % obj + allocate(HexLattice::lattices(n_rlats + i) % obj) + lat => lattices(n_rlats + i) % obj select type (lat) type is (HexLattice) @@ -1477,7 +1477,7 @@ contains end if ! Add lattice to dictionary - call lattice_dict % add_key(lat % id, i) + call lattice_dict % add_key(lat % id, n_rlats + i) end select end do HEX_LATTICES