I have an issue with nvfortran (21.2) that I think is either a compiler bug or an unimplemented 2008/2018 feature.
Attempting to compiler the following derived type generates the follwoing error messages
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
0 inform, 0 warnings, 4 severes, 0 fatal for nverror
The derived type is a C-interoperable type designed to communicate with C routines. Here is a stripped down version of the original code. Note I tried two different ways to initialize the arrays but I think the issue is with the C_PTR components. Any help would be appreciated
Thanks
RW
Module nverror
USE, Intrinsic :: ISO_FORTRAN_ENV
USE, Intrinsic :: ISO_C_BINDING
Type, BIND(C) :: c_bbox ! C bounding box object
Type(C_PTR) :: emax = C_NULL_PTR
Type(C_PTR) :: emin = C_NULL_PTR
Integer(C_INT) :: imin = 0_C_INT
Integer(C_INT) :: imax = 0_C_INT
Type(C_PTR) :: e2max(3) = C_NULL_PTR
Type(C_PTR) :: e2min(3) = C_NULL_PTR
Real(C_DOUBLE) :: etol(3) = 0.0_C_DOUBLE
! Type(C_PTR) :: e2max(3) = [C_NULL_PTR, C_NULL_PTR, C_NULL_PTR]
! Type(C_PTR) :: e2min(3) = [C_NULL_PTR, C_NULL_PTR, C_NULL_PTR]
! Real(C_DOUBLE) :: etol(3) = [0.0_C_DOUBLE, 0.0_C_DOUBLE, 0.0_C_DOUBLE]
End Type
End Module nverror