Skip to content

[Bug]: Allow slices ends to be equal, Ex: istart=[1, 1], iend=[1, N] #50

@14NGiestas

Description

@14NGiestas

What happened?

Hi,

I'm not sure if that's a requirement for hdf5 or quirks when interfacing with C but when I try the following, I get an error.

  subroutine bug
    real(wp) :: tmp(1,M)

    call file % open('test.h5', 'w')
    call file % create('/A', H5T_NATIVE_REAL, [N, M])

    do i=1,N
      tmp = reshape([(1.0_wp*j, j=1,M)],[1,M])
      call file % write('/A', tmp, istart=[i,1], iend=[i,M])
    end do

    call file % close()
  end subroutine

Relevant log output

Project is up to date
ERROR STOP ERROR:h5fortran:create: iend must be > istart

Error termination. Backtrace:
#0  0x564a93f6a345 in __h5fortran_MOD_hdf_create
	at build/dependencies/h5fortran/src/write.f90:85
#1  0x564a93f2edec in __h5fortran_MOD_h5write_2d
	at /home/ian/hdf5test/writer.inc:34
#2  0x564a93f106b9 in bug
	at app/main.f90:49
#3  0x564a93f1012d in MAIN__
	at app/main.f90:12
#4  0x564a93f1074e in main
	at app/main.f90:3
<ERROR> Execution for object " hdf5test " returned exit code  1
<ERROR> *cmd_run*:stopping due to failed executions
STOP 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions