Commit 2fa2d3be authored by Graham, Aaron's avatar Graham, Aaron
Browse files

add support for reading 3D string array into a PL from HDF5

parent 8a75d434
Pipeline #159424 passed with stage
in 2 minutes and 4 seconds
......@@ -3723,6 +3723,7 @@ SUBROUTINE write_pList(thisHDF5File,dsetname,vals,gdims_in,first_dir)
INTEGER(SLK),ALLOCATABLE :: id3(:,:,:)
REAL(SSK),ALLOCATABLE :: rs3(:,:,:)
REAL(SDK),ALLOCATABLE :: rd3(:,:,:)
TYPE(StringType),ALLOCATABLE :: st3(:,:,:)
INTEGER(SNK),ALLOCATABLE :: is4(:,:,:,:)
INTEGER(SLK),ALLOCATABLE :: id4(:,:,:,:)
REAL(SSK),ALLOCATABLE :: rs4(:,:,:,:)
......@@ -3830,6 +3831,9 @@ SUBROUTINE write_pList(thisHDF5File,dsetname,vals,gdims_in,first_dir)
CASE('3-D ARRAY INTEGER(SLK)')
CALL vals%get(CHAR(address),id3)
CALL thisHDF5File%write_l3(CHAR(path),id3)
CASE('3-D ARRAY TYPE(StringType)')
CALL vals%get(CHAR(address),st3)
CALL thisHDF5File%write_st3_helper(CHAR(path),st3)
CASE('4-D ARRAY REAL(SSK)')
CALL vals%get(CHAR(address),rs4)
CALL thisHDF5File%write_s4(CHAR(path),rs4)
......@@ -6462,10 +6466,7 @@ SUBROUTINE read_parameter(thisHDF5File,h5path,vals)
'added to Parameter List.')
!CALL vals%add(CHAR(plpath),l3)
ELSE
CALL thisHDF5File%e%raiseWarning(modName//'::'//myName// &
' - Unsupported Parameter Type 3-D String Array will not be '// &
'added to Parameter List.')
!CALL vals%add(CHAR(plpath),st3)
CALL vals%add(CHAR(plpath),st3)
ENDIF
CASE DEFAULT
CALL thisHDF5File%e%raiseWarning(modName//'::'//myName// &
......
......@@ -2371,6 +2371,18 @@ SUBROUTINE testHDF5FileTypeRead()
ASSERT_EQ(CHAR(testST2(i,j)),CHAR(refST2(i,j)),'ST2 read PL Failure')
ENDDO
ENDDO
CALL tmpPL%get('groupST->memST3',testST3)
testB0=(SIZE(testST3,DIM=1) == SIZE(refST3,DIM=1)) .AND. &
(SIZE(testST3,DIM=2) == SIZE(refST3,DIM=2)) .AND. &
(SIZE(testST3,DIM=3) == SIZE(refST3,DIM=3))
ASSERTFAIL(testB0,'ST3 Sizes')
DO k=1,SIZE(testST3,DIM=3)
DO j=1,SIZE(testST2,DIM=2)
DO i=1,SIZE(testST2,DIM=1)
ASSERT_EQ(CHAR(testST3(i,j,k)),CHAR(refST3(i,j,k)),'ST3 read PL Failure')
ENDDO
ENDDO
ENDDO
!Character array, read in as a 1-D string array
CALL tmpPL%get('groupST->memCA0',testST1)
ASSERTFAIL(SIZE(testST1) == SIZE(refST0CA),'ST1 Sizes')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment