Skip to content

Commit

Permalink
Update: remove full M_Strings dependency from source.
Browse files Browse the repository at this point in the history
Copy only those routines needed to Focal_Utils (under PD license.)
  • Loading branch information
LKedward committed Jul 14, 2023
1 parent e985875 commit d3d7f4c
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 7,762 deletions.
24 changes: 0 additions & 24 deletions external/M_strings/LICENSE

This file was deleted.

7,628 changes: 0 additions & 7,628 deletions external/M_strings/M_strings.f90

This file was deleted.

102 changes: 0 additions & 102 deletions external/M_strings/README.md

This file was deleted.

3 changes: 1 addition & 2 deletions make.include
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ FOCAL_MODDIR = $(FOCAL_DIR)/mod/
vpath %.f90 $(FOCAL_DIR)/src
vpath %.f90 $(FOCAL_DIR)/external
vpath %.f90 $(FOCAL_DIR)/external/clfortran
vpath %.f90 $(FOCAL_DIR)/external/M_strings
vpath %.f90 $(FOCAL_DIR)/external/fortran-utils

# Source files
FOCAL_BASE = Focal clfortran M_strings futils_sorting
FOCAL_BASE = Focal clfortran futils_sorting
FOCAL_SRCS = Focal_Error Focal_Memory Focal_HostMemory \
Focal_Query Focal_Setup Focal_Utils Focal_Profile \
Focal_Debug Focal_NoDebug
Expand Down
24 changes: 24 additions & 0 deletions src/Focal.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1847,6 +1847,30 @@ module function strStripNum(linei)
!! Converted string output
end function strStripNum

elemental pure module function upperStr(str) result (string)
!! Convert string to uppercase (for case-insensitive comparison)
character(*), intent(in) :: str
character(len(str)) :: string
end function upperStr

module subroutine splitStr(input_line,array,delimiters,order,nulls)
!! parse string into an array using specified delimiters
!! AUTHOR: John S. Urban LICENSE: Public Domain
character(len=*),intent(in) :: input_line ! input string to tokenize
character(len=*),optional,intent(in) :: delimiters ! list of delimiter characters
character(len=*),optional,intent(in) :: order ! order of output array sequential|[reverse|right]
character(len=*),optional,intent(in) :: nulls ! return strings composed of delimiters or not ignore|return|ignoreend
character(len=:),allocatable,intent(out) :: array(:) ! output array of tokens
end subroutine splitStr

elemental module function str_noesc(INSTR)
!! convert non-printable characters to a space.
!! AUTHOR: John S. Urban LICENSE: Public Domain
character(len=*),intent(in) :: INSTR
!! string that might contain nonprintable characters
character(len=len(instr)) :: str_noesc
end function str_noesc

end interface

end module Focal
2 changes: 0 additions & 2 deletions src/Focal_Memory.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@

module procedure fclInitBufferUntyped_1 !(cmdq,buffer,nBytes,profileName,access)
!! Initialise untyped buffer object on specified command queue
use M_strings, only: upperStr=>upper
integer(c_int32_t) :: errcode
integer(c_int64_t) :: MEM_FLAGS

Expand Down Expand Up @@ -194,7 +193,6 @@

module procedure fclInitSubBufferUntyped_1 !(cmdq,subbuffer,sourceBuffer,offset,size,profileName,access)
!! Initialise an untyped sub-buffer from an existing buffer
use M_strings, only: upperStr=>upper
integer(c_int32_t) :: errcode
integer(c_int64_t) :: MEM_FLAGS

Expand Down
1 change: 0 additions & 1 deletion src/Focal_Query.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
!! corresponding header module file. See header module file (Focal.f90) for interface definitions. @endnote

use clfortran
use M_Strings, only: str_noesc=>noesc
implicit none

contains
Expand Down
1 change: 0 additions & 1 deletion src/Focal_Setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
!! corresponding header module file. See header module file (Focal.f90) for interface definitions. @endnote

use clfortran
use M_strings, only: upperStr=>upper, splitStr=>split
implicit none

contains
Expand Down
Loading

0 comments on commit d3d7f4c

Please sign in to comment.