Skip to content

Commit

Permalink
Tweak file utility (#52)
Browse files Browse the repository at this point in the history
* Update to file_utility for already set inputs

* Update Minor Version #
  • Loading branch information
porteri authored Sep 26, 2019
1 parent 91125dc commit a3e7886
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project(vtkmofo LANGUAGES Fortran)

# vtkmofo project version
set (VTKMOFO_VERSION_MAJOR 1)
set (VTKMOFO_VERSION_MINOR 001)
set (VTKMOFO_VERSION_MINOR 100)

# Print project logo, version and tag line
file(READ ${CMAKE_CURRENT_LIST_DIR}/cmake/VTKMOFO-logo.txt VTKMOFO_LOGO)
Expand Down
4 changes: 4 additions & 0 deletions src/utilities/file_utility.f90
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,11 @@ MODULE FUNCTION get_unit (me) RESULT (unit)
END FUNCTION get_unit

PURE MODULE FUNCTION is_little_endian() RESULT (is_little)
!! author: Ian Porter
!! date: 09/25/2019
!!
!! Checks the type of bit ordering to determine if the architecture is little endian
!!
LOGICAL :: is_little !! Flag to determine if little endian

END FUNCTION is_little_endian
Expand Down
13 changes: 9 additions & 4 deletions src/utilities/file_utility_procedures.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,31 @@
!! Establishes the file information
!!

IF (ALLOCATED(me%filename)) DEALLOCATE(me%filename)
ALLOCATE(me%filename, source=TRIM(filename))
IF (PRESENT(open_status)) THEN
IF (ALLOCATED(me%open_status)) DEALLOCATE(me%open_status)
ALLOCATE(me%open_status, source=open_status)
ELSE
ALLOCATE(me%open_status, source='UNKNOWN')
IF (.NOT. ALLOCATED(me%open_status)) ALLOCATE(me%open_status, source='UNKNOWN')
END IF
IF (PRESENT(close_status)) THEN
IF (ALLOCATED(me%close_status)) DEALLOCATE(me%close_status)
ALLOCATE(me%close_status, source=close_status)
ELSE
ALLOCATE(me%close_status, source='KEEP')
IF (.NOT. ALLOCATED(me%close_status)) ALLOCATE(me%close_status, source='KEEP')
END IF
IF (PRESENT(form)) THEN
IF (ALLOCATED(me%form)) DEALLOCATE(me%form)
ALLOCATE(me%form, source=form)
ELSE
ALLOCATE(me%form, source='UNKNOWN')
IF (.NOT. ALLOCATED(me%form)) ALLOCATE(me%form, source='UNKNOWN')
END IF
IF (PRESENT(access)) THEN
IF (ALLOCATED(me%access)) DEALLOCATE(me%access)
ALLOCATE(me%access, source=access)
ELSE
ALLOCATE(me%access, source='UNKNOWN')
IF (.NOT. ALLOCATED(me%access)) ALLOCATE(me%access, source='UNKNOWN')
END IF

END PROCEDURE setup_file_information
Expand Down

0 comments on commit a3e7886

Please sign in to comment.