@@ -404,40 +404,38 @@ subroutine hdf_initialize(self,filename,ierr, status,action,comp_lvl,chunk_size,
404404laction = ' rw'
405405if (present (action)) laction = toLower(action)
406406
407-
408407select case (lstatus)
409- case (' old' , ' unknown' )
410- select case (laction)
411- case (' read' ,' r' ) ! < Open an existing file.
412- inquire (file= filename, exist= exists)
413- if (.not. exists) then
414- write (stderr,* ) ' ERROR: ' // filename // ' does not exist.'
415- ierr = - 1
416- return
417- endif
418- call h5fopen_f(filename,H5F_ACC_RDONLY_F,self% lid,ierr)
419- case (' write' ,' readwrite' ,' w' ,' rw' , ' r+' , ' append' , ' a' )
420- inquire (file= filename, exist= exists)
421- if (lstatus == ' unknown' .and. .not. exists) then
422- call h5fcreate_f(filename, H5F_ACC_TRUNC_F, self% lid, ierr)
423- if (check(ierr, ' ERROR: ' // filename // ' could not be created' )) return
424- else
425- call h5fopen_f(filename, H5F_ACC_RDWR_F, self% lid, ierr)
426- if (check(ierr, ' ERROR: ' // filename // ' could not be opened in read/write' )) return
427- endif
428- case default
429- write (stderr,* ) ' Unsupported action -> ' // laction
430- ierr = 128
431- endselect
432- case (' new' ,' replace' )
433- call h5fcreate_f(filename, H5F_ACC_TRUNC_F, self% lid, ierr)
434- if (check(ierr, ' ERROR: ' // filename // ' could not be created' )) return
435- case default
436- write (stderr,* ) ' Unsupported status -> ' // lstatus
437- ierr = 128
408+ case (' old' , ' unknown' )
409+ select case (laction)
410+ case (' read' ,' r' ) ! < Open an existing file.
411+ inquire (file= filename, exist= exists)
412+ if (.not. exists) then
413+ write (stderr,* ) ' ERROR: ' // filename // ' does not exist.'
414+ ierr = - 1
415+ return
416+ endif
417+ call h5fopen_f(filename,H5F_ACC_RDONLY_F,self% lid,ierr)
418+ case (' write' ,' readwrite' ,' w' ,' rw' , ' r+' , ' append' , ' a' )
419+ inquire (file= filename, exist= exists)
420+ if (lstatus == ' unknown' .and. .not. exists) then
421+ call h5fcreate_f(filename, H5F_ACC_TRUNC_F, self% lid, ierr)
422+ if (check(ierr, ' ERROR: ' // filename // ' could not be created' )) return
423+ else
424+ call h5fopen_f(filename, H5F_ACC_RDWR_F, self% lid, ierr)
425+ if (check(ierr, ' ERROR: ' // filename // ' could not be opened in read/write' )) return
426+ endif
427+ case default
428+ write (stderr,* ) ' Unsupported action -> ' // laction
429+ ierr = 128
430+ endselect
431+ case (' new' ,' replace' )
432+ call h5fcreate_f(filename, H5F_ACC_TRUNC_F, self% lid, ierr)
433+ if (check(ierr, ' ERROR: ' // filename // ' could not be created' )) return
434+ case default
435+ write (stderr,* ) ' Unsupported status -> ' // lstatus
436+ ierr = 128
438437endselect
439438
440-
441439end subroutine hdf_initialize
442440
443441
0 commit comments