TreeMig Code
Loading...
Searching...
No Matches
filehandlingmodule Module Reference

Data Types

type  file
 

Functions/Subroutines

subroutine openfiler (thefile, err)
 openFileR

 
subroutine openfilew (thefile, err)
 openFileW
 
subroutine closefile (thefile)
 closeFile

 
subroutine deletefile (thefile)
 deleteFile

 
subroutine extractword (thefile, n, word, rest, err)
 extractWord

 
subroutine extractandcountwords (thefile, nwords, words, rest, err)
 ExtractAndCountWords

 

Variables

character(2) relativepathletter = ".\"
 
character(1) pathletter = "\"
 
character(len=3), parameter format_integer = "I15"
 
character(len=5), parameter format_real = "F18.6"
 
character(len=2), parameter format_logical = "L1"
 
character(len=1), parameter format_character = "A"
 

Function/Subroutine Documentation

◆ closefile()

subroutine filehandlingmodule::closefile ( type(file), intent(in) thefile)

closeFile


closes a file

Definition at line 97 of file FileHandlingModule.f90.

◆ deletefile()

subroutine filehandlingmodule::deletefile ( type(file), intent(in) thefile)

deleteFile


deletes a file

  • IN:
    • Parameters
      theFile: file to be deleted
  • CALLED from:

Definition at line 112 of file FileHandlingModule.f90.

◆ extractandcountwords()

subroutine filehandlingmodule::extractandcountwords ( type(file), intent(in) thefile,
integer, intent(out) nwords,
character(len=30), dimension (1:50), intent(out) words,
character(len=:), intent(out), allocatable rest,
integer, intent(out) err )

ExtractAndCountWords


Parsing: Reads in one line in the control file and splits it into the information bit (word) and the rest.

  1. First reads in a whole line into a character string (buffer).
  2. then finds the non-blank parts (words) until a "!>" is found and counts how many there are.
  3. For reading e.g. the header of a file.
  4. gives back some feedback err=-2 when we reach end of line.
  5. then we can loop through i until we reach err/= 0
  6. saves the number and the words (max. 50, max length of each word 30) in an array

IN:

  • Parameters
    theFile: input file

OUT:

  • Parameters
    nwords: number of the nonblank string parts up to the first "!>"
    word: relevant read in information as a character word
    rest: less relevant rest of read in information as character
    err: read error code

CALLED from:

Definition at line 190 of file FileHandlingModule.f90.

◆ extractword()

subroutine filehandlingmodule::extractword ( type(file), intent(in) thefile,
integer, intent(in) n,
character(len=:), intent(out), allocatable word,
character(len=:), intent(out), allocatable rest,
integer, intent(out) err )

extractWord


Parsing: Reads in one line in the control file and splits it into the information bit (word) and the rest.

  1. First reads in a whole line into a character string (buffer)
  2. then finds the nth non-blank part.
  3. For the control pars when reading the years and the interval
  4. gives back some feedback err=-2 when we reach end of line.
  5. loops through i until we reach err/= 0
  6. saves the result in a character array

IN:

  • Parameters
    theFile: input file
    n: number of the nonblank section to be extracted from the buffer

OUT:

  • Parameters
    word: relevant read in information as a character word
    rest: less relevant rest of read in information as character
    err: read error code

CALLED from:

Definition at line 141 of file FileHandlingModule.f90.

◆ openfiler()

subroutine filehandlingmodule::openfiler ( type(file), intent(in) thefile,
integer, intent(out) err )

openFileR


Opens a file for reading

  • IN:
    • Parameters
      theFile: input file
      err: read error code
  • CALLED from:

PrepareBioclimInput in PrepareBioclimInput.f90

Definition at line 49 of file FileHandlingModule.f90.

◆ openfilew()

subroutine filehandlingmodule::openfilew ( type(file), intent(in) thefile,
integer, intent(out) err )

openFileW


Opens a file for writing

Definition at line 72 of file FileHandlingModule.f90.

Variable Documentation

◆ format_character

character(len=1), parameter filehandlingmodule::format_character = "A"

Definition at line 31 of file FileHandlingModule.f90.

◆ format_integer

character(len=3), parameter filehandlingmodule::format_integer = "I15"

Definition at line 28 of file FileHandlingModule.f90.

◆ format_logical

character(len=2), parameter filehandlingmodule::format_logical = "L1"

Definition at line 30 of file FileHandlingModule.f90.

◆ format_real

character(len=5), parameter filehandlingmodule::format_real = "F18.6"

Definition at line 29 of file FileHandlingModule.f90.

◆ pathletter

character(1) filehandlingmodule::pathletter = "\"

Definition at line 23 of file FileHandlingModule.f90.

◆ relativepathletter

character(2) filehandlingmodule::relativepathletter = ".\"

Definition at line 22 of file FileHandlingModule.f90.