48 character(len=*),
intent(in) :: fname
50 suffix_pos = scan(trim(fname),
'.', back=.true.)
55 character(len=*),
intent(in) :: fname
57 tslash_pos = scan(trim(fname),
'/', back=.true.)
62 character(len=*) :: fname
63 character(len=*) :: suffix
69 character(len=*) :: fname
70 character(len=*) :: new_fname
71 character(len=*) :: new_suffix
75 new_fname = trim(fname(1:suffix_pos))//new_suffix
82 character(len=*) :: string
83 character(len=*) :: delimiter
84 character(len=100),
allocatable :: split_str(:)
85 integer :: length, i, i2,offset, j
89 if (len(trim(string)) .eq. 0)
then
90 allocate(split_str(1))
91 split_str(1) = trim(string)
95 i = scan(string(offset:), delimiter, back=.false.)
101 allocate(split_str(length))
106 i2 = scan(trim(string(offset:)), delimiter, back=.false.)
108 split_str(j) = trim(string(offset:))
111 split_str(j) = trim(string(offset:offset+i2-2))
123 integer,
intent(in) :: i, j, k, l, lx, ly, lz
126 index = (i + lx * ((j - 1) + ly * ((k - 1) + lz * ((l - 1)))))
130 integer,
intent(in) :: i, j, k, lx, ly, lz, facet
136 if (i .eq. 1) is_on = .true.
138 if (i .eq. lx) is_on = .true.
140 if (j .eq. 1) is_on = .true.
142 if (j .eq. ly) is_on = .true.
144 if (k .eq. 1) is_on = .true.
146 if (k .eq. lz) is_on = .true.
160 index(4) = lin_idx/(lx*ly*lz)
161 index(3) = (lin_idx-(lx*ly*lz)*index(4))/(lx*ly)
162 index(2) = (lin_idx-(lx*ly*lz)*index(4)-(lx*ly)*index(3))/lx
163 index(1) = (lin_idx-(lx*ly*lz)*index(4)-(lx*ly)*index(3)-lx*index(2))
164 index(1) = index(1) + 1
165 index(2) = index(2) + 1
166 index(3) = index(3) + 1
167 index(4) = index(4) + 1
172 integer,
optional :: error_code
174 if (
present(error_code))
then
175 write(*,*)
'*** ERROR ***', error_code
178 write(*,*)
'*** ERROR ***'
185 character(len=*) :: error_msg
186 write(*,*)
'*** ERROR: ', error_msg,
' ***'
191 character(len=*) :: warning_msg
192 write(*,*)
'*** WARNING: ', warning_msg,
' ***'
__device__ void nonlinear_index(const int idx, const int lx, int *index)
subroutine filename_suffix(fname, suffix)
Extract a filename's suffix.
character(len=100) function, dimension(:), allocatable split_string(string, delimiter)
Split a string based on delimiter (tokenizer) OBS: very hacky, this should really be improved,...
pure integer function filename_tslash_pos(fname)
Find position (in the string) of a filename's trailing slash.
subroutine neko_warning(warning_msg)
subroutine neko_error_msg(error_msg)
pure integer function filename_suffix_pos(fname)
Find position (in the string) of a filename's suffix.
pure logical function index_is_on_facet(i, j, k, lx, ly, lz, facet)
integer, parameter neko_fname_len
subroutine filename_chsuffix(fname, new_fname, new_suffix)
Change a filename's suffix.
subroutine neko_error_plain(error_code)
pure integer function linear_index(i, j, k, l, lx, ly, lz)
Compute the address of a (i,j,k,l) array with sizes (1:lx, 1:ly, 1:lz, :)