utils_filenames

Module

Description

This module contains useful utilities related to

file names and numbering

References:

None

Owner:

Daniel Price

Runtime parameters:

None

Dependencies:

None

Quick access

Variables:

append_number, count_char, count_sensible_labels, get_idot, is_sensible_label, isdigit, max_line_length, ncolumnsline

Routines:

basename(), files_are_sequential(), get_column_labels(), get_ncolumns(), get_nlines(), getnextfilename(), is_digit(), lcase(), make_tags_unique(), nospaces(), numfromfile(), read_column_labels(), skip_header(), split(), string_delete(), string_replace(), strip_extension(), ucase()

Variables

  • fileutils/append_number [private]
  • fileutils/count_char [private]
  • fileutils/count_sensible_labels [private]
  • fileutils/get_idot [private]
  • fileutils/is_sensible_label [private]
  • fileutils/isdigit [private]
  • fileutils/max_line_length [integer,private/parameter/optional/default=10000]

    for finding number of columns

  • fileutils/ncolumnsline [private]

Subroutines and functions

function  fileutils/getnextfilename(filename[, ifilename])
Parameters:
  • filename [character,in]

  • ifilename [integer,out,]

Return:

getnextfilename [character]

Called from:

getnextfilename(), files_are_sequential(), relax_star()

Call to:

is_digit(), getnextfilename()

function  fileutils/numfromfile(filename)
Parameters:

filename [character,in]

Return:

numfromfile [integer]

Call to:

basename(), is_digit()

function  fileutils/files_are_sequential(filenames)
Parameters:

filenames (*) [character]

Return:

files_are_sequential [logical] :: return false for just one file

Call to:

getnextfilename()

function  fileutils/is_digit(ch)
Parameters:

ch [character,in]

Return:

is_digit [logical,pure]

Called from:

get_unit_multiplier(), getnextfilename(), numfromfile()

function  fileutils/basename(string_bn)
Parameters:

string_bn [character,in]

Return:

basename [character]

Called from:

numfromfile()

function  fileutils/get_nlines(string_bn[, skip_comments[, n_columns[, n_headerlines]]])
Parameters:
  • string_bn [character,in]

  • skip_comments [logical,in,]

  • n_columns [integer,out,]

  • n_headerlines [integer,out,]

Return:

n [integer]

Call to:

get_ncolumns(), skip_header()

subroutine  fileutils/strip_extension(string_bn, ext)
Parameters:
  • string_bn [character,inout]

  • ext [character,in]

subroutine  fileutils/get_ncolumns(lunit, ncolumns, nheaderlines)
Parameters:
  • lunit [integer,in]

  • ncolumns [integer,out]

  • nheaderlines [integer,out]

Called from:

get_nlines()

subroutine  fileutils/skip_header(iunit, nheader[, ierror])
Parameters:
  • iunit [integer,in]

  • nheader [integer,in]

  • ierror [integer,out,]

Called from:

get_nlines()

function  fileutils/ucase(string_bn)
Parameters:

string_bn [character,in]

Return:

ucase [character]

Called from:

ucase()

Call to:

ucase()

function  fileutils/lcase(string_bn)
Parameters:

string_bn [character,in]

Return:

lcase [character]

Called from:

lcase()

Call to:

lcase()

subroutine  fileutils/make_tags_unique(ntags, tags)
Parameters:
  • ntags [integer,in,]

  • tags (ntags) [character,inout]

Called from:

read_dust_setup_options(), write_dust_setup_options()

subroutine  fileutils/string_delete(string_bn, skey)
Parameters:
  • string_bn [character,inout]

  • skey [character,in]

Called from:

get_column_labels(), nospaces()

subroutine  fileutils/string_replace(string_bn, skey, sreplacewith)
Parameters:
  • string_bn [character,inout]

  • skey [character,in]

  • sreplacewith [character,in]

subroutine  fileutils/split(string_bn, delim, stringarr, nsplit)
Parameters:
  • string_bn [character,in]

  • delim [character,in]

  • stringarr (*) [character,out]

  • nsplit [integer,out]

Called from:

get_column_labels()

subroutine  fileutils/get_column_labels(line, nlabels, labels[, method[, ndesired[, csv]]])
Parameters:
  • line [character,in]

  • nlabels [integer,out] :: allow blank/arbitrary labels in csv format

  • labels (*) [character,out]

  • method [integer,out,]

  • ndesired [integer,in,]

  • csv [logical,in,]

Called from:

read_column_labels()

Call to:

nospaces(), split(), string_delete()

subroutine  fileutils/read_column_labels(iunit, nheaderlines, ncols, nlabels, labels[, csv[, debug]])
Parameters:
  • iunit [integer,in]

  • nheaderlines [integer,in]

  • ncols [integer,in]

  • nlabels [integer,out] :: only allow single-spaced labels if == ncols

  • labels (*) [character,out]

  • csv [logical,in,]

  • debug [logical,in,]

Call to:

get_column_labels()

function  fileutils/nospaces(string_bn)
Parameters:

string_bn [character,in]

Return:

nospaces [character]

Called from:

get_column_labels()

Call to:

string_delete()