OpenFAST
Wind turbine multiphysics simulator
Data Types | Functions/Subroutines | Variables
nwtc_io Module Reference

This module contains I/O-related variables and routines with non-system-specific logic. More...

Data Types

interface  allocary
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
interface  allocpary
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
interface  checkrealvar
 This routine checks that real values are finite and not NaNs. More...
 
interface  dispnvd
 This routine displays the name of the program, its version, and its release date. More...
 
type  fnlist_type
 This type stores a linked list of file names, used in MLB-style input file parsing (currently used in AirfoilInfo) More...
 
interface  initfileinfo
 
interface  num2lstr
 This function returns a left-adjusted string representing the passed numeric value. More...
 
interface  parseary
 
interface  parsevar
 This subroutine parses the specified line of text for two words. More...
 
interface  parsevarwdefault
 This subroutine parses the specified line of text for two words. More...
 
type  progdesc
 
interface  readary
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
interface  readarylines
 This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line). More...
 
interface  readvar
 This routine reads a variable from the next line of the input file. More...
 
interface  readvarwdefault
 This routine reads a scalar variable from the next line of the input file. More...
 
interface  wrmatrix
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
interface  wrnumaryfilenr
 This routine writes out a real array to the file connected to Unit without following it with a new line. More...
 
interface  wrpartialmatrix
 Based on nwtc_io::wrmatrix, this routine writes a matrix to an already-open text file. More...
 

Functions/Subroutines

character(200) function getnvd (ProgInfo)
 This function extracts the Name field from the ProgDesc data type. More...
 
subroutine dispnvd0 ()
 This routine displays the name of the program, its version, and its release date. More...
 
subroutine dispnvd1 (ProgInfo, DispNWTCVer)
 This routine displays the name of the program, its version, and its release date. More...
 
subroutine dispnvd2 (Name, Ver)
 This routine displays the name of the program, its version, and its release date passed in as strings This routine is depricated and for legacy purposes only. More...
 
character(11) function int2lstr (Num)
 This function returns a left-adjusted string representing the passed numeric value. More...
 
character(15) function r2lstr4 (FltNum)
 
character(15) function r2lstr8 (FltNum)
 
character(15) function r2lstr16 (FltNum)
 
subroutine adjrealstr (NumStr)
 This routine adjusts strings created from real numbers (4, 8, or 16-byte) More...
 
recursive subroutine wrscr (InStr)
 This routine writes out a string to the screen. More...
 
subroutine wrscr1 (Str)
 This routine writes out a string to the screen after a blank line. More...
 
subroutine getnewunit (UnIn, ErrStat, ErrMsg)
 This routine returns the next unit number greater than 9 that is not currently in use. More...
 
subroutine conv2uc (Str)
 This routine converts all the text in a string to upper case. More...
 
subroutine openfinpfile (Un, InFile, ErrStat, ErrMsg)
 
subroutine openfoutfile (Un, OutFile, ErrStat, ErrMsg)
 
subroutine waittime (WaitSecs)
 This routine pauses program executaion for a specified number of seconds. More...
 
subroutine progpause ()
 This routine pauses the program. More...
 
subroutine progwarn (Message)
 This routine outputs non-fatal warning messages and returns to the calling routine. More...
 
subroutine progabort (Message, TrapErrors, TimeWait, ErrLevel)
 This routine outputs fatal error messages and stops the program. More...
 
character(11) function curdate ()
 This function returns a character string encoded with today's date in the form dd-mmm-ccyy. More...
 
character(8) function curtime ()
 This function returns a character string encoded with the time in the form "hh:mm:ss". More...
 
subroutine findline (Str, MaxLen, StrEnd)
 This routine finds one line of text with a maximum length of MaxLen from the Str. More...
 
subroutine nameofile (InArg, OutExten, OutFile, ErrStat)
 
subroutine getroot (GivenFil, RootName)
 Let's parse the root file name from the name of the given file. More...
 
subroutine allcary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allcary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allcary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alli1bary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alli2bary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alli4bary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alliary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alliary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allipary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allipary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allfpary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allrpary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr4pary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr8pary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr16pary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alllary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alllary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine alllary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr4ary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr8ary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr16ary1 (Ary, AryDim1, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr4ary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr8ary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr16ary2 (Ary, AryDim1, AryDim2, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr4ary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr8ary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr16ary3 (Ary, AryDim1, AryDim2, AryDim3, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr4ary4 (Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr8ary4 (Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr16ary4 (Ary, AryDim1, AryDim2, AryDim3, AryDim4, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr4ary5 (Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr8ary5 (Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine allr16ary5 (Ary, AryDim1, AryDim2, AryDim3, AryDim4, AryDim5, Descr, ErrStat, ErrMsg)
 This routine allocates an array to the size specified in the AryDim input arguement(s). More...
 
subroutine chkparsedata (Words, ExpVarName, FileName, FileLineNum, NameIndx, ErrStat, ErrMsg)
 This subroutine checks the data to be parsed to make sure it finds the expected variable name and an associated value. More...
 
subroutine chkrealfmtstr (RealFmt, RealFmtVar, FmtWidth, ErrStat, ErrMsg)
 This routine tests to make sure we have a valid format string for real numbers (i.e., it doesn't produce "****"). More...
 
subroutine checkios (IOS, Fil, Variable, VarType, ErrStat, ErrMsg, TrapErrors)
 This routine checks the I/O status and prints either an end-of-file or an invalid-input message, and then aborts the program or returns an appropriate error level and message. More...
 
subroutine checkr4var (RealVar, RealDesc, ErrStat, ErrMsg)
 This routine checks that real values are finite and not NaNs. More...
 
subroutine checkr8var (RealVar, RealDesc, ErrStat, ErrMsg)
 This routine checks that real values are finite and not NaNs. More...
 
subroutine checkr16var (RealVar, RealDesc, ErrStat, ErrMsg)
 This routine checks that real values are finite and not NaNs. More...
 
integer function countwords (Line)
 This subroutine is used to count the number of "words" in a line of text. More...
 
subroutine dispcopyrightlicense (ProgramName, AdditionalComment)
 This routine displays some text about copyright and license. More...
 
subroutine dlltypepack (InData, ReKiBuf, DbKiBuf, IntKiBuf, ErrStat, ErrMsg, SizeOnly)
 This routine packs the DLL_Type (nwtc_base::dll_type) data into an integer buffer. More...
 
subroutine dlltypeunpack (OutData, ReKiBuf, DbKiBuf, IntKiBuf, ErrStat, ErrMsg)
 This routine unpacks the DLL_Type data from an integer buffer. More...
 
character(13) function geterrstr (ErrID)
 This function returns a text description of the ErrID (ErrStat) code. More...
 
subroutine getpath (GivenFil, PathName, FileName)
 Let's parse the path name from the name of the given file. More...
 
subroutine gettokens (Line, NumTok, Tokens, Error)
 This routine will parse Line for NumTok "tokens" and return them in the Tokens array. More...
 
subroutine getwords (Line, Words, NumWords)
 This subroutine is used to get the NumWords "words" from a line of text. More...
 
subroutine intary2str (IntAry, Str, ErrStat, ErrMsg)
 This routine converts an ASCII array of integers into an equivalent string (character array). More...
 
logical function iscomment (StringToCheck)
 This function returns true if and only if the first character of the input StringToCheck matches on the of comment characters nwtc_io::commchars. More...
 
subroutine nameofile (InArg, OutExten, OutFile, ErrStat, ErrMsg)
 This routine gets the name of the input file from the InArgth command-line argument, removes the extension if there is one, and appends OutExten to the end. More...
 
subroutine normstop ()
 This routine performs a normal termination of the program. More...
 
subroutine nwtc_displaysyntax (DefaultInputFile, ThisProgName)
 This routine displays the expected command-line syntax for most software developed at the NWTC. More...
 
subroutine openbinpfile (Un, InFile, ErrStat, ErrMsg)
 This routine opens a binary input file. More...
 
subroutine openboutfile (Un, OutFile, ErrStat, ErrMsg)
 This routine opens a binary output file with stream access, implemented in standrad Fortran 2003. More...
 
subroutine openecho (Un, OutFile, ErrStat, ErrMsg, ProgVer)
 This routine opens a formatted output file for the echo file. More...
 
subroutine openfinpfile (Un, InFile, ErrStat, ErrMsg)
 This routine opens a formatted input file. More...
 
subroutine openfoutfile (Un, OutFile, ErrStat, ErrMsg)
 This routine opens a formatted output file. More...
 
subroutine openfunkfile (Un, OutFile, FailAbt, Failed, Exists, ErrStat, ErrMsg)
 This routine opens a formatted output file and returns a flag telling if it already existed. More...
 
subroutine openfunkfileappend (Un, OutFile, ErrStat, ErrMsg)
 This routine opens a formatted output file in append mode if it exists, otherwise opens a new file.
 
subroutine openuinbefile (Un, InFile, RecLen, ErrStat, ErrMsg)
 This routine opens an unformatted input file of RecLen-byte data records stored in Big Endian format. More...
 
subroutine openuinfile (Un, InFile, ErrStat, ErrMsg)
 This routine opens an unformatted input file. More...
 
subroutine openuoutfile (Un, OutFile, ErrStat, ErrMsg)
 This routine opens an unformatted output file. More...
 
subroutine print_fileinfo_struct (U, FileInfo)
 This subroutine prints the contents of the FileInfo data structure to the screen This may be useful for diagnostic purposes. More...
 
subroutine parsechary (FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for AryLen CHARACTER values. More...
 
subroutine parsecom (FileInfo, LineNum, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses a comment line. More...
 
subroutine parsechvar (FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parsechvarwdefault (FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parser8ary (FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for AryLen REAL values. More...
 
subroutine parser8var (FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parser8varwdefault (FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parsequary (FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for AryLen REAL values. More...
 
subroutine parsequvar (FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parsequvarwdefault (FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parseinary (FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc)
 
subroutine parseinclinfo (InclInfo, RelativePathFileName, FileName, RangeBeg, RangeEnd, ErrStat, ErrMsg)
 This subroutine parses the include information that occurs after a "@" when processing an input file. More...
 
subroutine parseinvar (FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parseinvarwdefault (FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parseloary (FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc)
 
subroutine parselovar (FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parselovarwdefault (FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parsesiary (FileInfo, LineNum, AryName, Ary, AryLen, ErrStat, ErrMsg, UnEc)
 
subroutine parsesivar (FileInfo, LineNum, ExpVarName, Var, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
subroutine parsesivarwdefault (FileInfo, LineNum, ExpVarName, Var, VarDefault, ErrStat, ErrMsg, UnEc)
 This subroutine parses the specified line of text for two words. More...
 
logical function pathisrelative (GivenFil)
 This routine determines if the given file name is absolute or relative. More...
 
subroutine premeof (Fil, Variable, TrapErrors, ErrMsg)
 This routine prints out an end-of-file message and aborts the program. More...
 
subroutine initfileinfo_fromnullcstring (FileString, FileInfo, ErrStat, ErrMsg)
 The following takes an input file as a C_Char string with C_NULL_CHAR deliniating line endings. More...
 
subroutine initfileinfo_fromstringarray (StringArray, FileInfo, ErrStat, ErrMsg)
 
subroutine processcomfile (TopFileName, FileInfo, ErrStat, ErrMsg)
 This routine calls ScanComFile (nwtc_io::scancomfile) and ReadComFile (nwtc_io::readcomfile) to move non-comments in a set of nested files starting with TopFile into the FileInfo (nwtc_io::fileinfo) structure. More...
 
character(15) function r2lstr4 (Num, Fmt_in)
 This function returns a left-adjusted string representing the passed numeric value. More...
 
character(15) function r2lstr8 (Num, Fmt_in)
 This function returns a left-adjusted string representing the passed numeric value. More...
 
character(15) function r2lstr16 (Num, Fmt_in)
 This function returns a left-adjusted string representing the passed numeric value. More...
 
subroutine readcary (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
subroutine readcaryfromstr (Str, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface. More...
 
subroutine readcarylines (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line). More...
 
subroutine readcom (UnIn, Fil, ComName, ErrStat, ErrMsg, UnEc, Comment)
 This routine reads a comment from the next line of the input file. More...
 
recursive subroutine readcomfile (FileInfo, FileIndx, AryInd, StartLine, LastLine, ErrStat, ErrMsg)
 This routine opens and reads the contents of a file with comments and stores the good stuff in the FileInfo structure. More...
 
subroutine readcvar (UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a variable from the next line of the input file. More...
 
subroutine readfastbin (UnIn, Init, FASTdata, ErrStat, ErrMsg)
 This routine reads the contents of a FAST binary output file (FASTbinFile) and stores it in FASTdata. More...
 
subroutine readiary (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
subroutine readivar (UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a variable from the next line of the input file. More...
 
subroutine readivarwdefault (UnIn, Fil, Var, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc)
 This routine reads a scalar variable from the next line of the input file. More...
 
subroutine readlvarwdefault (UnIn, Fil, Var, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc)
 This routine reads a logical variable from the next line of the input file. More...
 
subroutine readlary (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
subroutine readline (UnIn, CommentChars, Line, LineLen, IOStat)
 This routine reads a line from the specified input file and returns the non-comment portion of the line. More...
 
subroutine readlvar (UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a variable from the next line of the input file. More...
 
subroutine readnum (UnIn, Fil, Word, VarName, ErrStat, ErrMsg)
 This routine reads a single word from a file and tests to see if it's a pure number (no true or false). More...
 
subroutine readoutputlist (UnIn, Fil, CharAry, AryLenRead, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads up to MaxAryLen values from an input file and store them in CharAry(:). More...
 
subroutine readoutputlistfromfileinfo (FileInfo, LineNum, CharAry, AryLenRead, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads up to MaxAryLen values from an input file and store them in CharAry(:). More...
 
subroutine readr4ary (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
subroutine readr4aryfromstr (Str, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface. More...
 
subroutine readr8ary (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
subroutine readr8aryfromstr (Str, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface. More...
 
subroutine readr16ary (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines). More...
 
subroutine readr16aryfromstr (Str, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface. More...
 
subroutine readr4arylines (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line). More...
 
subroutine readr8arylines (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line). More...
 
subroutine readr16arylines (UnIn, Fil, Ary, AryLen, AryName, AryDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line). More...
 
subroutine readr4var (UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a variable from the next line of the input file. More...
 
subroutine readr4varwdefault (UnIn, Fil, Var, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc)
 This routine reads a scalar variable from the next line of the input file. More...
 
subroutine readr8var (UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a variable from the next line of the input file. More...
 
subroutine readr8varwdefault (UnIn, Fil, Var, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc)
 This routine reads a scalar variable from the next line of the input file. More...
 
subroutine readr16var (UnIn, Fil, Var, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a variable from the next line of the input file. More...
 
subroutine readr16varwdefault (UnIn, Fil, Var, VarName, VarDescr, VarDefault, ErrStat, ErrMsg, UnEc)
 This routine reads a scalar variable from the next line of the input file. More...
 
subroutine readstr (UnIn, Fil, CharVar, VarName, VarDescr, ErrStat, ErrMsg, UnEc)
 This routine reads a string from the next line of the input file. More...
 
subroutine removenullchar (Str)
 This routine removes trailing C_NULL characters, which can be present when passing strings between C and Fortran. More...
 
recursive subroutine scancomfile (FirstFile, ThisFile, LastFile, StartLine, LastLine, NumLines, ErrStat, ErrMsg)
 This routine opens and scans the contents of a file with comments counting non-comment lines. More...
 
subroutine str2intary (Str, IntAry, ErrStat, ErrMsg)
 This routine converts a string (character array) into an equivalent ASCII array of integers. More...
 
subroutine wrbinfast (FileName, FileID, DescStr, ChanName, ChanUnit, TimeData, AllOutData, ErrStat, ErrMsg)
 This subroutine opens a binary file named FileName, and writes a the AllOutData Matrix to a 16-bit packed binary file. More...
 
subroutine wrfilenr (Unit, Str)
 This routine writes out a string to the file connected to Unit without following it with a new line. More...
 
subroutine wrmatrix1r4 (A, Un, ReFmt, MatName)
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
subroutine wrmatrix1r8 (A, Un, ReFmt, MatName)
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
subroutine wrmatrix1r16 (A, Un, ReFmt, MatName)
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
subroutine wrmatrix2r4 (A, Un, ReFmt, MatName)
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
subroutine wrmatrix2r8 (A, Un, ReFmt, MatName)
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
subroutine wrmatrix2r16 (A, Un, ReFmt, MatName)
 This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array. More...
 
subroutine wrpartialmatrix1r8 (A, Un, ReFmt, MatName, UseCol, UseAllCols, ExtCol)
 Based on nwtc_io::wrmatrix, this routine writes a matrix to an already-open text file. More...
 
subroutine wrpartialmatrix2r8 (A, Un, ReFmt, MatName, UseRow, UseCol, UseAllRows, UseAllCols, ExtCol)
 Based on nwtc_io::wrmatrix, this routine writes a matrix to an already-open text file. More...
 
subroutine wrpr (Str)
 This routine writes out a prompt to the screen without following it with a new line, though a new line precedes it. More...
 
subroutine wrr4aryfilenr (Unit, Ary, Fmt, ErrStat, ErrMsg)
 This routine writes out a real array to the file connected to Unit without following it with a new line. More...
 
subroutine wriaryfilenr (Unit, Ary, Fmt, ErrStat, ErrMsg)
 This routine writes out an integer array to the file connected to Unit without following it with a new line. More...
 
subroutine wrr8aryfilenr (Unit, Ary, Fmt, ErrStat, ErrMsg)
 This routine writes out a real array to the file connected to Unit without following it with a new line. More...
 
subroutine wrr16aryfilenr (Unit, Ary, Fmt, ErrStat, ErrMsg)
 This routine writes out a real array to the file connected to Unit without following it with a new line. More...
 
subroutine wrvtk_header (FileName, NumberOfPoints, NumberOfLines, NumberOfPolys, Un, ErrStat, ErrMsg)
 This routine writes out the heading for an vtk xml file (associated footer generated in nwtc_io::wrvtk_footer). More...
 
subroutine wrvtk_footer (Un)
 This routine writes out the footer for an vtk xml file (associated header generated in nwtc_io::wrvtk_header). More...
 
subroutine readvtk_sp_info (FileName, descr, dims, origin, gridSpacing, vecLabel, Un, ErrStat, ErrMsg)
 This routine reads the header for a vtk, ascii, structured_points dataset file, including all the information about the structured points. More...
 
subroutine readvtk_sp_vectors (FileName, Un, dims, gridVals, ErrStat, ErrMsg)
 This routine reads the vector data for a vtk, ascii, structured_points dataset file, The Unit number of the file is already assumed to be valid via a previous call to ReadVTK_SP_info. More...
 
subroutine wrvtk_sp_header (FileName, descr, Un, ErrStat, ErrMsg)
 This routine writes out the heading for an vtk, ascii, structured_points dataset file . More...
 
subroutine wrvtk_sp_vectors3d (Un, dataDescr, dims, origin, gridSpacing, gridVals, ErrStat, ErrMsg)
 

Variables

character(20) progname = ' '
 The name of the calling program. More...
 
character(99) progver = ' '
 The version (including date) of the calling program. More...
 
character(1), parameter tab = CHAR( 9 )
 The tab character. More...
 
type(progdesc), parameter nwtc_ver = ProgDesc( 'NWTC Subroutine Library', 'reduced_by_TMcCoy', '3-Dec-2013')
 The name, version, and date of the NWTC Subroutine Library.
 
integer(intki), parameter explicitloose = 1
 parameter for global coupling scheme explicit-loose type
 
integer(intki), parameter flgtype = 1
 Switch for telling if a variable is a flag (logical). More...
 
integer(intki), parameter numtype = 2
 Switch for telling if a variable is a number. More...
 
integer(intki), parameter strtype = 3
 Switch for telling if a variable is a string. More...
 
integer(b2ki), parameter filefmtid_withtime = 1
 ID for FAST Output File Format, specifies that the time channel is included in the output file (use if the output can occur at variable times)
 
integer(b2ki), parameter filefmtid_withouttime = 2
 ID for FAST Output File Format, specifies that the time channel is not included in the output file (used only with constant time-step output)
 
integer(b2ki), parameter filefmtid_nocompresswithouttime = 3
 ID for FAST Output File Format, specifies that the time channel is not included in the output file (used only with constant time-step output), and data is not compressed, but written as double-precision floats.
 
integer(b2ki), parameter filefmtid_chanlen_in = 4
 ID for FAST Output File Format, specifies that the time channel is not included in the output file, and channel length is included in the file.
 
logical beep = .TRUE.
 Flag that specifies whether or not to beep for error messages and program terminations. More...
 
character(*), parameter commchars = '!#%'
 Comment characters that mark the end of useful input.
 
integer(intki), parameter nwtc_sizeofnumword = 200
 maximum length of the words containing numeric input (for ParseVar routines)
 
integer(intki), parameter nwtc_maxarylen = 100
 the maximum length of arrays that can be printed with the array formats below (used to make sure we don't crash when trying to write too many):
 
character(*), parameter ec_straryfrmt = "(15X,A,T30,' - ',A,/,2X,100('""',A,'""',:,1X))"
 Output format for array of string parameters. More...
 
character(*), parameter ec_strfrmt = "(15X,A,T30,' - ',A,/,2X, A )"
 Output format for string parameters.
 
character(*), parameter ec_rearyfrmt = "(15X,A,T30,' - ',A,/,100(2X,ES11.4e2,:))"
 Output format for array of real parameters. More...
 
character(*), parameter ec_refrmt = "( 2X, ES11.4e2,2X,A,T30,' - ',A )"
 Output format for real parameters.
 
character(*), parameter ec_lgaryfrmt = "(15X,A,T30,' - ',A,/,100(2X,L11,:))"
 Output format for array of logical parameters. More...
 
character(*), parameter ec_lgfrmt = "( 2X, L11,2X,A,T30,' - ',A )"
 Output format for logical parameters.
 
character(*), parameter ec_intaryfrmt = "(15X,A,T30,' - ',A,/,100(2X,I11,:))"
 Output format for array of integer parameters. More...
 
character(*), parameter ec_intfrmt = "( 2X, I11,2X,A,T30,' - ',A )"
 Output format for integer parameters.
 
character(*), parameter ec_ch11frmt = "( 2X, A11,2X,A,T30,' - ',A )"
 Output format for 11-character string parameters.
 

Detailed Description

This module contains I/O-related variables and routines with non-system-specific logic.

Function/Subroutine Documentation

◆ adjrealstr()

subroutine nwtc_io::adjrealstr ( NumStr  )

This routine adjusts strings created from real numbers (4, 8, or 16-byte)

Parameters
[in,out]numstrString representing a real number (e.g., from R2LStr4)

◆ allcary1()

subroutine nwtc_io::allcary1 ( character(*), dimension (:), allocatable  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ allcary2()

subroutine nwtc_io::allcary2 ( character(*), dimension (:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.

◆ allcary3()

subroutine nwtc_io::allcary3 ( character(*), dimension (:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allfpary1()

subroutine nwtc_io::allfpary1 ( real(c_float), dimension (:), pointer  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.
[out]errstatError status

◆ alli1bary1()

subroutine nwtc_io::alli1bary1 ( integer(b1ki), dimension (:), allocatable  Ary,
integer(intki), intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ alli2bary1()

subroutine nwtc_io::alli2bary1 ( integer(b2ki), dimension (:), allocatable  Ary,
integer(intki), intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ alli4bary1()

subroutine nwtc_io::alli4bary1 ( integer(b4ki), dimension (:), allocatable  Ary,
integer(intki), intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ alliary2()

subroutine nwtc_io::alliary2 ( integer(intki), dimension (:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.

◆ alliary3()

subroutine nwtc_io::alliary3 ( integer(intki), dimension (:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allipary1()

subroutine nwtc_io::allipary1 ( integer, dimension (:), pointer  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.

◆ allipary2()

subroutine nwtc_io::allipary2 ( integer, dimension (:,:), pointer  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.
[in]arydim2The size of the second dimension of the array.

◆ alllary1()

subroutine nwtc_io::alllary1 ( logical, dimension (:), allocatable  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ alllary2()

subroutine nwtc_io::alllary2 ( logical, dimension (:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.

◆ alllary3()

subroutine nwtc_io::alllary3 ( logical, dimension (:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allr16ary1()

subroutine nwtc_io::allr16ary1 ( real(quki), dimension (:), allocatable  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ allr16ary2()

subroutine nwtc_io::allr16ary2 ( real(quki), dimension (:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.

◆ allr16ary3()

subroutine nwtc_io::allr16ary3 ( real(quki), dimension (:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allr16ary4()

subroutine nwtc_io::allr16ary4 ( real(quki), dimension (:,:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
integer, intent(in)  AryDim4,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.
[in]arydim4The size of the fourth dimension of the array.

◆ allr16ary5()

subroutine nwtc_io::allr16ary5 ( real(quki), dimension (:,:,:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
integer, intent(in)  AryDim4,
integer, intent(in)  AryDim5,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.
[in]arydim4The size of the fourth dimension of the array.
[in]arydim5The size of the fourth dimension of the array.

◆ allr16pary3()

subroutine nwtc_io::allr16pary3 ( real(quki), dimension (:,:,:), pointer  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allr4ary1()

subroutine nwtc_io::allr4ary1 ( real(siki), dimension (:), allocatable  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ allr4ary2()

subroutine nwtc_io::allr4ary2 ( real(siki), dimension (:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.

◆ allr4ary3()

subroutine nwtc_io::allr4ary3 ( real(siki), dimension (:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allr4ary4()

subroutine nwtc_io::allr4ary4 ( real(siki), dimension (:,:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
integer, intent(in)  AryDim4,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.
[in]arydim4The size of the fourth dimension of the array.

◆ allr4ary5()

subroutine nwtc_io::allr4ary5 ( real(siki), dimension (:,:,:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
integer, intent(in)  AryDim4,
integer, intent(in)  AryDim5,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.
[in]arydim4The size of the fourth dimension of the array.
[in]arydim5The size of the fourth dimension of the array.

◆ allr4pary3()

subroutine nwtc_io::allr4pary3 ( real(siki), dimension (:,:,:), pointer  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allr8ary1()

subroutine nwtc_io::allr8ary1 ( real(r8ki), dimension (:), allocatable  Ary,
integer, intent(in)  AryDim1,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat

◆ allr8ary2()

subroutine nwtc_io::allr8ary2 ( real(r8ki), dimension (:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.

◆ allr8ary3()

subroutine nwtc_io::allr8ary3 ( real(r8ki), dimension (:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allr8ary4()

subroutine nwtc_io::allr8ary4 ( real(r8ki), dimension (:,:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
integer, intent(in)  AryDim4,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.
[in]arydim4The size of the fourth dimension of the array.

◆ allr8ary5()

subroutine nwtc_io::allr8ary5 ( real(r8ki), dimension (:,:,:,:,:), allocatable  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
integer, intent(in)  AryDim4,
integer, intent(in)  AryDim5,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type ALLOCATABLE. If the array is already allocated on entry to this routine, an error will be generated.
Use AllocAry (nwtc_io::allocary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[in]descrBrief array description (for error message).
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.
[in]arydim4The size of the fourth dimension of the array.
[in]arydim5The size of the fourth dimension of the array.

◆ allr8pary3()

subroutine nwtc_io::allr8pary3 ( real(r8ki), dimension (:,:,:), pointer  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
integer, intent(in)  AryDim3,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.
[in]arydim2The size of the second dimension of the array.
[in]arydim3The size of the third dimension of the array.

◆ allrpary2()

subroutine nwtc_io::allrpary2 ( real(reki), dimension (:,:), pointer  Ary,
integer, intent(in)  AryDim1,
integer, intent(in)  AryDim2,
character(*), intent(in)  Descr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine allocates an array to the size specified in the AryDim input arguement(s).

Arrays are of type POINTER. If the array pointer is already associated on entry to this routine, the array it points to will be deallocated first.
Use AllocPAry (nwtc_io::allocpary) instead of directly calling a specific routine in the generic interface.

Parameters
aryArray to be allocated
[in]arydim1The size of the first dimension of the array.
[out]errstatError status
[out]errmsgError message corresponding to ErrStat
[in]descrBrief array description.
[in]arydim2The size of the second dimension of the array.

◆ checkios()

subroutine nwtc_io::checkios ( integer, intent(in)  IOS,
character(*), intent(in)  Fil,
character(*), intent(in)  Variable,
integer, intent(in)  VarType,
integer, intent(out), optional  ErrStat,
character(*), intent(out), optional  ErrMsg,
logical, intent(in), optional  TrapErrors 
)

This routine checks the I/O status and prints either an end-of-file or an invalid-input message, and then aborts the program or returns an appropriate error level and message.

Parameters
[in]iosI/O status
[in]filName of input file
[in]variableVariable name
[in]vartypeType of variable
[in]traperrorsDetermines if the program should abort or return to calling function
[out]errstatError status
[out]errmsgError message (if present, no message is written to the screen)

◆ checkr16var()

subroutine nwtc_io::checkr16var ( real(quki), intent(in)  RealVar,
character(*), intent(in)  RealDesc,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine checks that real values are finite and not NaNs.

Parameters
[in]realvarReal value to check
[in]realdescdescription of RealVar
[out]errstatError status
[out]errmsgError message
[in]realvarReal value to check
[in]realdescdescription of RealVar
[out]errstatError status
[out]errmsgError message

◆ checkr4var()

subroutine nwtc_io::checkr4var ( real(siki), intent(in)  RealVar,
character(*), intent(in)  RealDesc,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine checks that real values are finite and not NaNs.

Parameters
[in]realvarReal value to check
[in]realdescdescription of RealVar
[out]errstatError status
[out]errmsgError message

◆ checkr8var()

subroutine nwtc_io::checkr8var ( real(r8ki), intent(in)  RealVar,
character(*), intent(in)  RealDesc,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine checks that real values are finite and not NaNs.

Parameters
[in]realvarReal value to check
[in]realdescdescription of RealVar
[out]errstatError status
[out]errmsgError message
[in]realvarReal value to check
[in]realdescdescription of RealVar
[out]errstatError status
[out]errmsgError message

◆ chkparsedata()

subroutine nwtc_io::chkparsedata ( character(*), dimension (2), intent(in)  Words,
character(*), intent(in)  ExpVarName,
character(*), intent(in)  FileName,
integer(intki), intent(in)  FileLineNum,
integer(intki), intent(out)  NameIndx,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This subroutine checks the data to be parsed to make sure it finds the expected variable name and an associated value.

Parameters
[out]errstatThe error status.
[in]filelinenumThe number of the line in the file being parsed.
[out]nameindxThe index into the Words array that points to the variable name.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]filenameThe name of the file being parsed.
[in]wordsThe two words to be parsed from the line.

◆ chkrealfmtstr()

subroutine nwtc_io::chkrealfmtstr ( character(*), intent(in)  RealFmt,
character(*), intent(in)  RealFmtVar,
integer(intki), intent(out)  FmtWidth,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine tests to make sure we have a valid format string for real numbers (i.e., it doesn't produce "****").

Parameters
[out]errstatAn error level to be returned to the calling routine.
[out]fmtwidthThe number of characters that will result from writes.
[out]errmsgAn error message to be returned to the calling routine.
[in]realfmtThe proposed format string.
[in]realfmtvarThe name of the variable storing the format string.

◆ conv2uc()

subroutine nwtc_io::conv2uc ( Str  )

This routine converts all the text in a string to upper case.

Parameters
[in,out]strThe string to be converted to UC (upper case).

◆ countwords()

integer function nwtc_io::countwords ( character(*), intent(in)  Line)

This subroutine is used to count the number of "words" in a line of text.

It uses spaces, tabs, commas, semicolons, single quotes, and double quotes ("whitespace") as word separators. Use GetWords (nwtc_io::getwords) to return the words from the line.

Returns
Number of "words" in Line
Parameters
[in]lineCount the words in this text string.

◆ curdate()

character(11) function nwtc_io::curdate ( )

This function returns a character string encoded with today's date in the form dd-mmm-ccyy.

Returns
'dd-mmm-yyyy' string with the current date

◆ curtime()

character(8) function nwtc_io::curtime ( )

This function returns a character string encoded with the time in the form "hh:mm:ss".

Returns
The current time in the form "hh:mm:ss".

◆ dispcopyrightlicense()

subroutine nwtc_io::dispcopyrightlicense ( character(*), intent(in)  ProgramName,
character(*), intent(in), optional  AdditionalComment 
)

This routine displays some text about copyright and license.

Parameters
[in]programnameThe name of the program being run
[in]additionalcommentAn additional comment displayed in the copyright notice. Typically used to describe alpha versions or one-off versions.

◆ dispnvd0()

subroutine nwtc_io::dispnvd0 ( )

This routine displays the name of the program, its version, and its release date.

Use DispNVD (nwtc_io::dispnvd) instead of directly calling a specific routine in the generic interface.

◆ dispnvd1()

subroutine nwtc_io::dispnvd1 ( ProgInfo  ,
DispNWTCVer   
)

This routine displays the name of the program, its version, and its release date.

Use DispNVD (nwtc_io::dispnvd) instead of directly calling a specific routine in the generic interface.

Parameters
[in]proginfoContains the name and version info
[in]dispnwtcverOption to display what version of the library is linked with the code

◆ dispnvd2()

subroutine nwtc_io::dispnvd2 ( Name  ,
Ver   
)

This routine displays the name of the program, its version, and its release date passed in as strings This routine is depricated and for legacy purposes only.

Please don't use for any new code (Dec-2012).

Parameters
[in]nameString containing the name of the program using the library
[in]verString containing the version and date info

◆ dlltypepack()

subroutine nwtc_io::dlltypepack ( type(dll_type), intent(in)  InData,
real(reki), dimension(:), intent(out), allocatable  ReKiBuf,
real(dbki), dimension(:), intent(out), allocatable  DbKiBuf,
integer(intki), dimension(:), intent(out), allocatable  IntKiBuf,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
logical, intent(in), optional  SizeOnly 
)

This routine packs the DLL_Type (nwtc_base::dll_type) data into an integer buffer.

It is required for the FAST Registry. It is the inverse of DLLTypeUnPack (nwtc_io::dlltypeunpack).

Parameters
[in]indataDLL data to pack (store in arrays of type ReKi, DbKi, and/or IntKi)
[out]rekibufbuffer with real (ReKi) data from InData structure
[out]dbkibufbuffer with double (DbKi) data from InData structure
[out]intkibufbuffer with integer (IntKi) data from InData structure
[out]errstaterror status
[out]errmsgerror message
[in]sizeonlyflag to determine if we're just looking for the size of the buffers instead of the packed data

◆ dlltypeunpack()

subroutine nwtc_io::dlltypeunpack ( type(dll_type), intent(out)  OutData,
real(reki), dimension(:), intent(in), allocatable  ReKiBuf,
real(dbki), dimension(:), intent(in), allocatable  DbKiBuf,
integer(intki), dimension(:), intent(in), allocatable  IntKiBuf,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine unpacks the DLL_Type data from an integer buffer.

It is required for the FAST Registry. It is the inverse of DLLTypePack (nwtc_io::dlltypepack).

Parameters
[in]rekibufbuffer with real (ReKi) data to place in the OutData structure
[in]dbkibufbuffer with real (DbKi) data to place in the OutData structure
[in]intkibufbuffer with integer (IntKi) data to place in the OutData structure
[out]outdatathe reconstituted OutData structure, created from 3 buffers
[out]errstaterror status/level
[out]errmsgmessage corresponding to ErrStat

◆ findline()

subroutine nwtc_io::findline ( Str  ,
MaxLen  ,
StrEnd   
)

This routine finds one line of text with a maximum length of MaxLen from the Str.

It tries to break the line at a blank.

Parameters
[in]maxlenThe maximum length of the string.
[out]strendThe location of the end of the string.
[in]strThe string to search.

◆ geterrstr()

character(13) function nwtc_io::geterrstr ( integer(intki), intent(in)  ErrID)

This function returns a text description of the ErrID (ErrStat) code.

Parameters
[in]erriderror status/level
Returns
description of the ErrID level

◆ getnewunit()

subroutine nwtc_io::getnewunit ( UnIn  ,
ErrStat  ,
ErrMsg   
)

This routine returns the next unit number greater than 9 that is not currently in use.

If it cannot find any unit between 10 and 99 that is available, it either aborts or returns an appropriate error status/message.

Parameters
[out]uninLogical unit for the file.
[out]errstatThe error status code; If not present code aborts
[out]errmsgThe error message, if an error occurred

◆ getnvd()

character(200) function nwtc_io::getnvd ( ProgInfo  )

This function extracts the Name field from the ProgDesc data type.

Parameters
[in]proginfoContains the name, date, and version info
Returns
A single string containing the name, date, and version info

◆ getpath()

subroutine nwtc_io::getpath ( character(*), intent(in)  GivenFil,
character(*), intent(out)  PathName,
character(*), intent(out), optional  FileName 
)

Let's parse the path name from the name of the given file.

We'll count everything before (and including) the last "\" or "/".

Parameters
[in]givenfilThe name of the given file.
[out]pathnameThe path name of the given file (based solely on the GivenFil text string).
[out]filenameThe name of the given file without the PathName (based solely on the GivenFil text string).

◆ getroot()

subroutine nwtc_io::getroot ( GivenFil  ,
RootName   
)

Let's parse the root file name from the name of the given file.

We'll count everything after the last period as the extension.

Parameters
[in]givenfilThe name of the given file.
[out]rootnameThe parsed root name of the given file.

◆ gettokens()

subroutine nwtc_io::gettokens ( character(*), intent(inout)  Line,
integer, intent(in)  NumTok,
character(*), dimension (:), intent(out)  Tokens,
logical, intent(out)  Error 
)

This routine will parse Line for NumTok "tokens" and return them in the Tokens array.

This routine differs from GetWords() (nwtc_io::getwords) in that it uses only spaces as token separators.

Parameters
[in]numtokThe number of "words" to look for.
[out]errorError flag to indicate an insuffient number of tokens were found.
[in,out]lineThe string to search.
[out]tokensThe tokens that were found.

◆ getwords()

subroutine nwtc_io::getwords ( character(*), intent(in)  Line,
character(*), dimension(numwords), intent(out)  Words,
integer, intent(in)  NumWords 
)

This subroutine is used to get the NumWords "words" from a line of text.

It uses spaces, tabs, commas, semicolons, single quotes, and double quotes ("whitespace") as word separators. If there aren't NumWords in the line, the remaining array elements will remain empty. Use CountWords (nwtc_io::countwords) to count the number of words in a line.

Parameters
[in]numwordsThe number of words to look for.
[in]lineThe string to search.
[out]wordsThe array of found words.

◆ initfileinfo_fromnullcstring()

subroutine nwtc_io::initfileinfo_fromnullcstring ( character(kind=c_char,len=*), intent(in)  FileString,
type(fileinfotype), intent(out)  FileInfo,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

The following takes an input file as a C_Char string with C_NULL_CHAR deliniating line endings.

Parameters
[in]filestringinput file as single C string with C_NULL_CHAR separated lines

◆ int2lstr()

character(11) function nwtc_io::int2lstr ( Num  )

This function returns a left-adjusted string representing the passed numeric value.

It eliminates trailing zeroes and even the decimal point if it is not a fraction.
Use Num2LStr (nwtc_io::num2lstr) instead of directly calling a specific routine in the generic interface.

Returns
string representing input number.
Parameters
[in]numThe number to convert to a left-justified string.

◆ intary2str()

subroutine nwtc_io::intary2str ( integer(intki), dimension(:), intent(in)  IntAry,
character(*), intent(out)  Str,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine converts an ASCII array of integers into an equivalent string (character array).

This routine is the inverse of the Str2IntAry() (nwtc_io::str2intary) routine.

Parameters
[in]intaryASCII array to convert to a string
[out]strThe string representation of IntAry
[out]errstatError status
[out]errmsgError message associated with ErrStat

◆ iscomment()

logical function nwtc_io::iscomment ( character(*), intent(in)  StringToCheck)

This function returns true if and only if the first character of the input StringToCheck matches on the of comment characters nwtc_io::commchars.

◆ nameofile()

subroutine nwtc_io::nameofile ( integer, intent(in)  InArg,
character(*), intent(in)  OutExten,
character(*), intent(out)  OutFile,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine gets the name of the input file from the InArgth command-line argument, removes the extension if there is one, and appends OutExten to the end.

Parameters
[out]errstatError status; if present, program does not abort on error
[in]inargThe number of the command-line argument that should hold the input file name.
[in]outextenThe requested extension for the output file.
[out]outfileThe name of the output file.
[out]errmsgDescription of error

◆ normstop()

subroutine nwtc_io::normstop ( )

This routine performs a normal termination of the program.

◆ nwtc_displaysyntax()

subroutine nwtc_io::nwtc_displaysyntax ( character(*), intent(in)  DefaultInputFile,
character(*), intent(in)  ThisProgName 
)

This routine displays the expected command-line syntax for most software developed at the NWTC.

Parameters
[in]defaultinputfilethe default name of the input file, if any
[in]thisprognamethe name of the executable to be displayed in the calling syntax

◆ openbinpfile()

subroutine nwtc_io::openbinpfile ( integer(intki), intent(in)  Un,
character(*), intent(in)  InFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens a binary input file.

Parameters
[in]unLogical unit for the input file.
[out]errstatError status: returns "fatal" if the file doesn't exist or can't be opened
[out]errmsgError message
[in]infileName of the input file.

◆ openboutfile()

subroutine nwtc_io::openboutfile ( integer(intki), intent(in)  Un,
character(*), intent(in)  OutFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens a binary output file with stream access, implemented in standrad Fortran 2003.

Valid in gfortran 4.6.1 and IVF 10.1 and later

Parameters
[in]unLogical unit for the output file
[out]errstatError status
[out]errmsgError message
[in]outfileName of the output file

◆ openecho()

subroutine nwtc_io::openecho ( integer, intent(inout)  Un,
character(*), intent(in)  OutFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
type(progdesc), intent(in), optional  ProgVer 
)

This routine opens a formatted output file for the echo file.

Parameters
[in,out]unLogical unit for the input file.
[in]outfileName of the input file.
[out]errstatError status
[out]errmsgError message
[in]progverProgram version info to display in echo file

◆ openfinpfile()

subroutine nwtc_io::openfinpfile ( integer, intent(in)  Un,
character(*), intent(in)  InFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens a formatted input file.

Parameters
[in]unLogical unit for the input file.
[in]infileName of the input file.
[out]errstatError status
[out]errmsgError message

◆ openfoutfile()

subroutine nwtc_io::openfoutfile ( integer, intent(in)  Un,
character(*), intent(in)  OutFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens a formatted output file.

Parameters
[in]unLogical unit for the output file.
[in]outfileName of the output file.
[out]errstatError status
[out]errmsgError message

◆ openfunkfile()

subroutine nwtc_io::openfunkfile ( integer, intent(in)  Un,
character(*), intent(in)  OutFile,
logical, intent(in)  FailAbt,
logical, intent(out)  Failed,
logical, intent(out)  Exists,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens a formatted output file and returns a flag telling if it already existed.

Parameters
[in]unLogical unit for the output file.
[out]errstatError status: returns "fatal" if the file doesn't exist or can't be opened
[out]errmsgError message
[out]existsFlag that indicates if the file already existedo.
[in]failabtFlag that tells this routine to abort if the open fails.
[out]failedFlag that indicates if the open failed.
[in]outfileName of the output file.

◆ openuinbefile()

subroutine nwtc_io::openuinbefile ( integer, intent(in)  Un,
character(*), intent(in)  InFile,
integer, intent(in)  RecLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens an unformatted input file of RecLen-byte data records stored in Big Endian format.

Parameters
[in]unLogical unit for the input file
[in]infileName of the input file
[in]reclenThe input file's record length in bytes
[out]errstatError status: returns "fatal" if the file doesn't exist or can't be opened
[out]errmsgError message

◆ openuinfile()

subroutine nwtc_io::openuinfile ( integer, intent(in)  Un,
character(*), intent(in)  InFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens an unformatted input file.

Parameters
[in]unLogical unit for the input file
[out]errstatError status: returns "fatal" if the file doesn't exist or can't be opened
[out]errmsgError message
[in]infileName of the input file

◆ openuoutfile()

subroutine nwtc_io::openuoutfile ( integer, intent(in)  Un,
character(*), intent(in)  OutFile,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens an unformatted output file.

Parameters
[in]unLogical unit for the output file
[out]errstatError status: returns "fatal" if the file doesn't exist or can't be opened
[out]errmsgError message
[in]outfileName of the output file

◆ parsechary()

subroutine nwtc_io::parsechary ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  AryName,
character(*), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for AryLen CHARACTER values.

Generate an error message if the value is the wrong type. Use ParseAry (nwtc_io::parseary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenThe length of the array to parse.
[in]fileinfoThe derived type for holding the file information.
[in,out]linenumThe number of the line to parse.
[in]arynameThe array name we are trying to fill.
[out]aryThe array to receive the input values.
[out]errstatThe error status.
[out]errmsgThe error message, if ErrStat /= 0.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.

◆ parsechvar()

subroutine nwtc_io::parsechvar ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
character(*), intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other the value of the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters.
Use ParseVar (nwtc_io::parsevar) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parsechvarwdefault()

subroutine nwtc_io::parsechvarwdefault ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
character(*), intent(out)  Var,
character(*), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other a value for the variable. If the variable is the character string "DEFAULT", a default value will be used to set the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters. Use ParseVarWDefault (nwtc_io::parsevarwdefault) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[in]vardefaultThe default value for the variable.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parsecom()

subroutine nwtc_io::parsecom ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses a comment line.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the comment
[out]errmsgThe error message, if ErrStat /= 0.
[in]fileinfoThe derived type for holding the file information.

◆ parseinary()

subroutine nwtc_io::parseinary ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  AryName,
integer, dimension (arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

◆ parseinclinfo()

subroutine nwtc_io::parseinclinfo ( character(*), intent(inout)  InclInfo,
character(*), intent(in)  RelativePathFileName,
character(*), intent(out)  FileName,
integer, intent(out)  RangeBeg,
integer, intent(out)  RangeEnd,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This subroutine parses the include information that occurs after a "@" when processing an input file.

Parameters
[out]errstatThe error status.
[out]rangebegThe beginning of a range of lines to be processed in an included file.
[out]rangeendThe end of a range of lines to be processed in an included file.
[out]errmsgThe error message, if ErrStat /= 0.
[out]filenameThe file name that was parsed from InclInfo.
[in,out]inclinfoThe text following the "@" on an input line being processed.
[in]relativepathfilenameThe name of the file that any new file is relative to.

◆ parseinvar()

subroutine nwtc_io::parseinvar ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
integer, intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other the value of the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters.
Use ParseVar (nwtc_io::parsevar) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parseinvarwdefault()

subroutine nwtc_io::parseinvarwdefault ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
integer(intki), intent(out)  Var,
integer(intki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other a value for the variable. If the variable is the character string "DEFAULT", a default value will be used to set the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters. Use ParseVarWDefault (nwtc_io::parsevarwdefault) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[in]vardefaultThe default value for the variable.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parseloary()

subroutine nwtc_io::parseloary ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  AryName,
logical, dimension (arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

◆ parselovar()

subroutine nwtc_io::parselovar ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
logical, intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other the value of the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters.
Use ParseVar (nwtc_io::parsevar) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parselovarwdefault()

subroutine nwtc_io::parselovarwdefault ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
logical, intent(out)  Var,
logical, intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other a value for the variable. If the variable is the character string "DEFAULT", a default value will be used to set the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters. Use ParseVarWDefault (nwtc_io::parsevarwdefault) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[in]vardefaultThe default value for the variable.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parsequary()

subroutine nwtc_io::parsequary ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  AryName,
real(quki), dimension (arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for AryLen REAL values.

Generate an error message if the value is the wrong type. Use ParseAry (nwtc_io::parseary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenThe length of the array to parse.
[out]aryThe array to receive the input values.
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[in]arynameThe array name we are trying to fill.
[out]errmsgThe error message, if ErrStat /= 0.
[in]fileinfoThe derived type for holding the file information.

◆ parsequvar()

subroutine nwtc_io::parsequvar ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
real(quki), intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other the value of the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters.
Use ParseVar (nwtc_io::parsevar) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parsequvarwdefault()

subroutine nwtc_io::parsequvarwdefault ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
real(quki), intent(out)  Var,
real(quki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other a value for the variable. If the variable is the character string "DEFAULT", a default value will be used to set the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters. Use ParseVarWDefault (nwtc_io::parsevarwdefault) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[in]vardefaultThe default value for the variable.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parser8ary()

subroutine nwtc_io::parser8ary ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  AryName,
real(r8ki), dimension (arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for AryLen REAL values.

Generate an error message if the value is the wrong type. Use ParseAry (nwtc_io::parseary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenThe length of the array to parse.
[out]aryThe array to receive the input values.
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[in]arynameThe array name we are trying to fill.
[out]errmsgThe error message, if ErrStat /= 0.
[in]fileinfoThe derived type for holding the file information.

◆ parser8var()

subroutine nwtc_io::parser8var ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
real(r8ki), intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other the value of the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters.
Use ParseVar (nwtc_io::parsevar) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parser8varwdefault()

subroutine nwtc_io::parser8varwdefault ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
real(r8ki), intent(out)  Var,
real(r8ki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other a value for the variable. If the variable is the character string "DEFAULT", a default value will be used to set the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters. Use ParseVarWDefault (nwtc_io::parsevarwdefault) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[in]vardefaultThe default value for the variable.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parsesiary()

subroutine nwtc_io::parsesiary ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  AryName,
real(siki), dimension (arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

◆ parsesivar()

subroutine nwtc_io::parsesivar ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
real(siki), intent(out)  Var,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other the value of the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters.
Use ParseVar (nwtc_io::parsevar) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ parsesivarwdefault()

subroutine nwtc_io::parsesivarwdefault ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), intent(in)  ExpVarName,
real(siki), intent(out)  Var,
real(siki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This subroutine parses the specified line of text for two words.

One should be a the name of a variable and the other a value for the variable. If the variable is the character string "DEFAULT", a default value will be used to set the variable. Generate an error message if the value is the wrong type or if only one "word" is found.

WARNING: This routine assumes the "words" containing the variable name and value are <= 20 characters. Use ParseVarWDefault (nwtc_io::parsevarwdefault) instead of directly calling a specific routine in the generic interface.

Parameters
[out]errstatThe error status.
[in,out]linenumThe number of the line to parse.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc.
[out]varThe variable to receive the input value.
[in]vardefaultThe default value for the variable.
[out]errmsgThe error message, if ErrStat /= 0.
[in]expvarnameThe expected variable name.
[in]fileinfoThe derived type for holding the file information.

◆ pathisrelative()

logical function nwtc_io::pathisrelative ( character(*), intent(in)  GivenFil)

This routine determines if the given file name is absolute or relative.

We will consider an absolute path one that satisfies one of the following four criteria:

  1. It contains ":/"
  2. It contains ":\"
  3. It starts with "/"
  4. It starts with "\"

All others are considered relative.

Parameters
[in]givenfilThe name of the given file.
Returns
The function return value

◆ premeof()

subroutine nwtc_io::premeof ( character(*), intent(in)  Fil,
character(*), intent(in)  Variable,
logical, intent(in), optional  TrapErrors,
character(*), intent(out), optional  ErrMsg 
)

This routine prints out an end-of-file message and aborts the program.

Parameters
[in]filThe name of the file that ran out of data.
[in]variableThe name of the variable we were trying to read at the time.
[in]traperrorsDetermines if the program should abort or return to calling function
[out]errmsgThe name of the file that ran out of data.

◆ print_fileinfo_struct()

subroutine nwtc_io::print_fileinfo_struct ( integer(intki), intent(in)  U,
type(fileinfotype), intent(in)  FileInfo 
)

This subroutine prints the contents of the FileInfo data structure to the screen This may be useful for diagnostic purposes.

this is written to unit U

Parameters
[in]uUnit number to print to
[in]fileinfoderived type containing everything read from file

◆ processcomfile()

subroutine nwtc_io::processcomfile ( character(*), intent(in)  TopFileName,
type (fileinfotype), intent(out)  FileInfo,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine calls ScanComFile (nwtc_io::scancomfile) and ReadComFile (nwtc_io::readcomfile) to move non-comments in a set of nested files starting with TopFile into the FileInfo (nwtc_io::fileinfo) structure.

Parameters
[out]errstatError status.
[out]errmsgError message.
[in]topfilenameThe name of the top file in the nested structure.
[out]fileinfoThe derived type for holding the file information.

◆ progabort()

subroutine nwtc_io::progabort ( Message  ,
TrapErrors  ,
TimeWait  ,
ErrLevel   
)

This routine outputs fatal error messages and stops the program.

Parameters
[in]timewaitTells whether to wait for TimeWait s, or pause if < 0.
[in]errlevelThe error level to report to the OS.
[in]traperrorsDetermines if the program should abort or return to calling function
[in]messageError message.

◆ progpause()

subroutine nwtc_io::progpause ( )

This routine pauses the program.

◆ progwarn()

subroutine nwtc_io::progwarn ( Message  )

This routine outputs non-fatal warning messages and returns to the calling routine.

It beeps if ntwc_io::beep is true.

Parameters
[in]messageWarning message to print

◆ r2lstr16()

character(15) function nwtc_io::r2lstr16 ( real(quki), intent(in)  Num,
character(*), optional  Fmt_in 
)

This function returns a left-adjusted string representing the passed numeric value.

It eliminates trailing zeroes and even the decimal point if it is not a fraction.
Use Num2LStr (nwtc_io::num2lstr) instead of directly calling a specific routine in the generic interface.

Returns
string representing input number.
Parameters
[in]numThe number to convert to a left-justified string.

◆ r2lstr4()

character(15) function nwtc_io::r2lstr4 ( real(siki), intent(in)  Num,
character(*), optional  Fmt_in 
)

This function returns a left-adjusted string representing the passed numeric value.

It eliminates trailing zeroes and even the decimal point if it is not a fraction.
Use Num2LStr (nwtc_io::num2lstr) instead of directly calling a specific routine in the generic interface.

Returns
string representing input number.
Parameters
[in]numThe number to convert to a left-justified string.

◆ r2lstr8()

character(15) function nwtc_io::r2lstr8 ( real(r8ki), intent(in)  Num,
character(*), optional  Fmt_in 
)

This function returns a left-adjusted string representing the passed numeric value.

It eliminates trailing zeroes and even the decimal point if it is not a fraction.
Use Num2LStr (nwtc_io::num2lstr) instead of directly calling a specific routine in the generic interface.

Returns
string representing input number.
Parameters
[in]numThe number to convert to a left-justified string.

◆ readcary()

subroutine nwtc_io::readcary ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines).

Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.
[in]filName of the input file.

◆ readcaryfromstr()

subroutine nwtc_io::readcaryfromstr ( character(*), intent(in)  Str,
character(*), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]strString to read from
[in]arylenLength of the array.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readcarylines()

subroutine nwtc_io::readcarylines ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line).

Use ReadAryLines (nwtc_io::readarylines) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray variable being read.
[in]filName of the input file.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readcom()

subroutine nwtc_io::readcom ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), intent(in)  ComName,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc,
character(*), intent(out), optional  Comment 
)

This routine reads a comment from the next line of the input file.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[in]filName of the input file.
[in]comnameText string containing the comment name.
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]commentText string containing the comment.

◆ readcomfile()

recursive subroutine nwtc_io::readcomfile ( type (fileinfotype), intent(inout)  FileInfo,
integer(intki), intent(in)  FileIndx,
integer(intki), intent(inout)  AryInd,
integer(intki), intent(in)  StartLine,
integer(intki), intent(in)  LastLine,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens and reads the contents of a file with comments and stores the good stuff in the FileInfo structure.

You need to call ScanComFile() first to count the number of lines and get the list of files in the recursive tree. This information needs to be stored in the FileInfo structure before calling this routine.

Parameters
[in,out]aryindThe current index into the FileInfo arrays.
[out]errstatError status.
[in]fileindxThe pointer to file name in the list of files.
[in]lastlineThe last line to read from this file. Includes blank and comment lines. Zero means read to the end of file.
[in]startlineThe line at which to start processing this file. Includes blank and comment lines.
[out]errmsgError message.
[in,out]fileinfoThe derived type for holding the file information.

◆ readcvar()

subroutine nwtc_io::readcvar ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), intent(out)  Var,
character(*), intent(in)  VarName,
character(*), intent(in)  VarDescr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a variable from the next line of the input file.

Use ReadVar (nwtc_io::readvar) instead of directly calling a specific routine in the generic interface.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]varVariable being read
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readfastbin()

subroutine nwtc_io::readfastbin ( integer(intki), intent(inout)  UnIn,
logical, intent(in)  Init,
type (fastdatatype), intent(inout)  FASTdata,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine reads the contents of a FAST binary output file (FASTbinFile) and stores it in FASTdata.

It is assumed that the name of the binary file is preloaded into FASTdataFile by the calling procedure.

Parameters
[out]errstatAn optional error level to be returned to the calling routine.
[in,out]uninThe IO unit for the FAST binary file.
[in]initA flag to tell the routine to read only the file header for initialization purposes.
[out]errmsgAn optional error message to be returned to the calling routine.
[in,out]fastdataThe derived type for holding FAST output data.

◆ readiary()

subroutine nwtc_io::readiary ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
integer, dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines).

Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.
[in]filName of the input file.

◆ readivar()

subroutine nwtc_io::readivar ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
integer, intent(out)  Var,
character(*), intent(in)  VarName,
character(*), intent(in)  VarDescr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a variable from the next line of the input file.

Use ReadVar (nwtc_io::readvar) instead of directly calling a specific routine in the generic interface.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]varVariable being read
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name. WARNING: this routine limits the size of the number being read to 30 characters

◆ readivarwdefault()

subroutine nwtc_io::readivarwdefault ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
integer, intent(out)  Var,
character(*), intent(in)  VarName,
character(*), intent(in)  VarDescr,
integer, intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a scalar variable from the next line of the input file.

Use ReadVarWDefault (nwtc_io::readvarwdefault) instead of directly calling a specific routine in the generic interface. WARNING: this routine limits the size of the number being read to 30 characters

Parameters
[out]varvariable being read
[in]vardefaultdefault value of variable being read
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readlary()

subroutine nwtc_io::readlary ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
logical, dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines).

Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.
[in]filName of the input file.

◆ readline()

subroutine nwtc_io::readline ( integer, intent(in)  UnIn,
character(*), intent(in)  CommentChars,
character(*), intent(out)  Line,
integer, intent(out)  LineLen,
integer(intki), intent(out)  IOStat 
)

This routine reads a line from the specified input file and returns the non-comment portion of the line.

Parameters
[out]iostatIOS error status from file read.
[in]uninThe unit number for the file being read.
[out]linelenThe length of the line returned from ReadLine().
[in]commentcharsThe list of possible comment characters.
[out]lineThe decommented line being returned to the calling routine.

◆ readlvar()

subroutine nwtc_io::readlvar ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
logical, intent(out)  Var,
character(*), intent(in)  VarName,
character(*), intent(in)  VarDescr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a variable from the next line of the input file.

Use ReadVar (nwtc_io::readvar) instead of directly calling a specific routine in the generic interface.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]varVariable being read
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readlvarwdefault()

subroutine nwtc_io::readlvarwdefault ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
logical, intent(out)  Var,
character(*), intent(in)  VarName,
character(*), intent(in)  VarDescr,
logical, intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a logical variable from the next line of the input file.

Use ReadVarWDefault (nwtc_io::readvarwdefault) instead of directly calling a specific routine in the generic interface. WARNING: this routine limits the size of the number being read to 30 characters

Parameters
[out]varvariable being read
[in]vardefaultdefault value of variable being read
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readnum()

subroutine nwtc_io::readnum ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), intent(out)  Word,
character(*), intent(in)  VarName,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine reads a single word from a file and tests to see if it's a pure number (no true or false).

Parameters
[in]uninI/O unit for input file.
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]filName of the input file.
[in]varnameText string containing the variable name.
[out]wordText string containing the first word from the input line.

◆ readoutputlist()

subroutine nwtc_io::readoutputlist ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), dimension(:), intent(out)  CharAry,
integer, intent(out)  AryLenRead,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in)  UnEc 
)

This routine reads up to MaxAryLen values from an input file and store them in CharAry(:).

These values represent the names of output channels, and they are specified in the format required for OutList(:) in FAST input files. The end of this list is specified with the line beginning with the 3 characters "END".

Parameters
[out]arylenreadLength of the array that was actually read.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file (if > 0).
[out]errstatError status
[out]errmsgError message
[out]chararyCharacter array being read (calling routine dimensions it to max allowable size).
[in]filName of the input file.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readoutputlistfromfileinfo()

subroutine nwtc_io::readoutputlistfromfileinfo ( type (fileinfotype), intent(in)  FileInfo,
integer(intki), intent(inout)  LineNum,
character(*), dimension(:), intent(out)  CharAry,
integer, intent(out)  AryLenRead,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads up to MaxAryLen values from an input file and store them in CharAry(:).

These values represent the names of output channels, and they are specified in the format required for OutList(:) in FAST input files. The end of this list is specified with the line beginning with the 3 characters "END".

Parameters
[in]fileinfoThe derived type for holding the file information.
[in,out]linenumThe number of the line to parse.
[out]arylenreadLength of the array that was actually read.
[in]unecI/O unit for echo file (if > 0).
[out]errstatError status
[out]errmsgError message
[out]chararyCharacter array being read (calling routine dimensions it to max allowable size).
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr16ary()

subroutine nwtc_io::readr16ary ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
real(quki), dimension(arylen), intent(inout)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines).

Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.
[in]filName of the input file.

◆ readr16aryfromstr()

subroutine nwtc_io::readr16aryfromstr ( character(*), intent(in)  Str,
real(quki), dimension(arylen), intent(inout)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]strString to read from
[in]arylenLength of the array.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr16arylines()

subroutine nwtc_io::readr16arylines ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
real(quki), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line).

Use ReadAryLines (nwtc_io::readarylines) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray variable being read.
[in]filName of the input file.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr16var()

subroutine nwtc_io::readr16var ( integer, intent(in)  UnIn,
character( *), intent(in)  Fil,
real(quki), intent(out)  Var,
character( *), intent(in)  VarName,
character( *), intent(in)  VarDescr,
integer(intki), intent(out), optional  ErrStat,
character(*), intent(out), optional  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a variable from the next line of the input file.

Use ReadVar (nwtc_io::readvar) instead of directly calling a specific routine in the generic interface.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]varVariable being read
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name. WARNING: this routine limits the size of the number being read to 30 characters

◆ readr16varwdefault()

subroutine nwtc_io::readr16varwdefault ( integer, intent(in)  UnIn,
character( *), intent(in)  Fil,
real(quki), intent(out)  Var,
character( *), intent(in)  VarName,
character( *), intent(in)  VarDescr,
real(quki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a scalar variable from the next line of the input file.

Use ReadVarWDefault (nwtc_io::readvarwdefault) instead of directly calling a specific routine in the generic interface. WARNING: this routine limits the size of the number being read to 30 characters

Parameters
[out]varvariable being read
[in]vardefaultdefault value of variable being read
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.
[out]varVariable being read
[in]vardefaultDefault value for variable being read
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readr4ary()

subroutine nwtc_io::readr4ary ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
real(siki), dimension(arylen), intent(inout)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines).

Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.
[in]filName of the input file.

◆ readr4aryfromstr()

subroutine nwtc_io::readr4aryfromstr ( character(*), intent(in)  Str,
real(siki), dimension(arylen), intent(inout)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]strString to read from
[in]arylenLength of the array.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr4arylines()

subroutine nwtc_io::readr4arylines ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
real(siki), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line).

Use ReadAryLines (nwtc_io::readarylines) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray variable being read.
[in]filName of the input file.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr4var()

subroutine nwtc_io::readr4var ( integer, intent(in)  UnIn,
character( *), intent(in)  Fil,
real(siki), intent(out)  Var,
character( *), intent(in)  VarName,
character( *), intent(in)  VarDescr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a variable from the next line of the input file.

Use ReadVar (nwtc_io::readvar) instead of directly calling a specific routine in the generic interface.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]varVariable being read
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name. WARNING: this routine limits the size of the number being read to 30 characters

◆ readr4varwdefault()

subroutine nwtc_io::readr4varwdefault ( integer, intent(in)  UnIn,
character( *), intent(in)  Fil,
real(siki), intent(out)  Var,
character( *), intent(in)  VarName,
character( *), intent(in)  VarDescr,
real(siki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a scalar variable from the next line of the input file.

Use ReadVarWDefault (nwtc_io::readvarwdefault) instead of directly calling a specific routine in the generic interface. WARNING: this routine limits the size of the number being read to 30 characters

Parameters
[out]varvariable being read
[in]vardefaultdefault value of variable being read
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readr8ary()

subroutine nwtc_io::readr8ary ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
real(r8ki), dimension(arylen), intent(inout)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines).

Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray being read.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.
[in]filName of the input file.

◆ readr8aryfromstr()

subroutine nwtc_io::readr8aryfromstr ( character(*), intent(in)  Str,
real(r8ki), dimension(arylen), intent(inout)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values separated by whitespace (or other Fortran record delimiters such as commas) into an array (either on same line or multiple lines) from an input string Use ReadAry (nwtc_io::readary) instead of directly calling a specific routine in the generic interface.

Parameters
[in]strString to read from
[in]arylenLength of the array.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr8arylines()

subroutine nwtc_io::readr8arylines ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
real(r8ki), dimension(arylen), intent(out)  Ary,
integer, intent(in)  AryLen,
character(*), intent(in)  AryName,
character(*), intent(in)  AryDescr,
integer, intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a AryLen values into a real array from the next AryLen lines of the input file (one value per line).

Use ReadAryLines (nwtc_io::readarylines) instead of directly calling a specific routine in the generic interface.

Parameters
[in]arylenLength of the array.
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status
[out]errmsgError message describing ErrStat
[out]aryArray variable being read.
[in]filName of the input file.
[in]arydescrText string describing the variable.
[in]arynameText string containing the variable name.

◆ readr8var()

subroutine nwtc_io::readr8var ( integer, intent(in)  UnIn,
character( *), intent(in)  Fil,
real(r8ki), intent(out)  Var,
character( *), intent(in)  VarName,
character( *), intent(in)  VarDescr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a variable from the next line of the input file.

Use ReadVar (nwtc_io::readvar) instead of directly calling a specific routine in the generic interface.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]varVariable being read
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name. WARNING: this routine limits the size of the number being read to 30 characters

◆ readr8varwdefault()

subroutine nwtc_io::readr8varwdefault ( integer, intent(in)  UnIn,
character( *), intent(in)  Fil,
real(r8ki), intent(out)  Var,
character( *), intent(in)  VarName,
character( *), intent(in)  VarDescr,
real(r8ki), intent(in)  VarDefault,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a scalar variable from the next line of the input file.

Use ReadVarWDefault (nwtc_io::readvarwdefault) instead of directly calling a specific routine in the generic interface. WARNING: this routine limits the size of the number being read to 30 characters

Parameters
[out]varvariable being read
[in]vardefaultdefault value of variable being read
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.
[out]varVariable being read
[in]vardefaultDefault value for variable being read
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readstr()

subroutine nwtc_io::readstr ( integer, intent(in)  UnIn,
character(*), intent(in)  Fil,
character(*), intent(out)  CharVar,
character(*), intent(in)  VarName,
character(*), intent(in)  VarDescr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
integer, intent(in), optional  UnEc 
)

This routine reads a string from the next line of the input file.

Parameters
[in]uninI/O unit for input file.
[in]unecI/O unit for echo file. If present and > 0, write to UnEc
[out]errstatError status; if present, program does not abort on error
[out]errmsgError message
[out]charvarInteger variable being read.
[in]filName of the input file.
[in]vardescrText string describing the variable.
[in]varnameText string containing the variable name.

◆ readvtk_sp_info()

subroutine nwtc_io::readvtk_sp_info ( character(*), intent(in)  FileName,
character(1024), intent(out)  descr,
integer(intki), dimension(3), intent(out)  dims,
real(reki), dimension(3), intent(out)  origin,
real(reki), dimension(3), intent(out)  gridSpacing,
character(1024), intent(out)  vecLabel,
integer(intki), intent(inout)  Un,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine reads the header for a vtk, ascii, structured_points dataset file, including all the information about the structured points.

It tries to open a text file for reading and returns the Unit number of the opened file. The caller is responsible for closing the file unit unless caller set Un = -1!

Parameters
[in]filenameName of output file
[out]descrLine describing the contents of the file
[out]dimsdimension of the 3D grid (nX,nY,nZ)
[out]originthe lower-left corner of the 3D grid (X0,Y0,Z0)
[out]gridspacingspacing between grid points in each of the 3 directions (dX,dY,dZ)
[in,out]ununit number of opened file
[out]errstaterror level/status of OpenFOutFile operation
[out]errmsgmessage when error occurs

◆ readvtk_sp_vectors()

subroutine nwtc_io::readvtk_sp_vectors ( character(*), intent(in)  FileName,
integer(intki), intent(in)  Un,
integer(intki), dimension(3), intent(in)  dims,
real(siki), dimension(:,:,:,:), intent(out)  gridVals,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine reads the vector data for a vtk, ascii, structured_points dataset file, The Unit number of the file is already assumed to be valid via a previous call to ReadVTK_SP_info.

Parameters
[in]filenameName of output file
[in]ununit number of opened file
[in]dimsdimension of the 3D grid (nX,nY,nZ)
[out]gridvals4D array of data, size (3,nX,nY,nZ), must be pre-allocated
[out]errstaterror level/status of OpenFOutFile operation
[out]errmsgmessage when error occurs

◆ removenullchar()

subroutine nwtc_io::removenullchar ( character(*), intent(inout)  Str)

This routine removes trailing C_NULL characters, which can be present when passing strings between C and Fortran.

Parameters
[in,out]strstring that will be truncated before the null character

◆ scancomfile()

recursive subroutine nwtc_io::scancomfile ( type (fnlist_type), intent(in), pointer  FirstFile,
type (fnlist_type), intent(in), pointer  ThisFile,
type (fnlist_type), intent(inout), pointer  LastFile,
integer(intki), intent(in)  StartLine,
integer(intki), intent(in)  LastLine,
integer(intki), intent(inout)  NumLines,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine opens and scans the contents of a file with comments counting non-comment lines.

If a line has "@Filename" on a line, it recursively scans that file to add the non-comment lines to the total. This routine is typically called before ReadComFile() (nwtc_io::readcomfile) to count the number on non-comment lines that will need to be stored. It also adds to a linked list of unique file names that are in the call chain.

Parameters
[out]errstatError status.
[in]lastlineThe last line to read from this file. Includes blank and comment lines. Zero means read to the end of file.
[in,out]numlinesThe total number of non-comment lines scanned so far.
[in]startlineThe line at which to start processing this file. Includes blank and comment lines.
[out]errmsgError message.
[in]firstfileThe first file in the linked list.
[in,out]lastfileThe last file in the linked list.
[in]thisfileThe last file in the linked list.

◆ str2intary()

subroutine nwtc_io::str2intary ( character(*), intent(in)  Str,
integer(intki), dimension(:), intent(out)  IntAry,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine converts a string (character array) into an equivalent ASCII array of integers.

This routine is the inverse of the IntAry2Str() routine.

Parameters
[in]strThe string to convert
[out]intaryASCII representation of Str
[out]errstatError status
[out]errmsgError message associated with ErrStat

◆ waittime()

subroutine nwtc_io::waittime ( WaitSecs  )

This routine pauses program executaion for a specified number of seconds.

Parameters
[in]waitsecsThe number of seconds to wait.

◆ wrbinfast()

subroutine nwtc_io::wrbinfast ( character(*), intent(in)  FileName,
integer(b2ki), intent(in)  FileID,
character(*), intent(in)  DescStr,
character(chanlen), dimension(:), intent(in)  ChanName,
character(chanlen), dimension(:), intent(in)  ChanUnit,
real(dbki), dimension(:), intent(in)  TimeData,
real(reki), dimension(:,:), intent(in)  AllOutData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This subroutine opens a binary file named FileName, and writes a the AllOutData Matrix to a 16-bit packed binary file.

A text DescStr is written to the file as well as the text in the ChanName and ChanUnit arrays. The file is closed at the end of this subroutine call (and on error).
NOTE: Developers may wish to inquire if the file can be opened at the start of a simulation to ensure that it's available before running the simulation (i.e., don't run a code for a long time only to find out that the file cannot be opened for writing).

Parameters
[in]timedataThe time being output to the file (if using FileFmtID_WithoutTime: element 1 is the first output time, element 2 is the delta t)
[in]alloutdataAll of the data being written to the file (except time; note that the channels are the rows and time is the column–this is done for speed of saving the array)
[out]errstatIndicates whether an error occurred (see NWTC_Library)
[in]fileidFile ID, used to determine format of output file (use FileFmtID_WithTime or FileFmtID_WithoutTime)
[in]channameThe output channel names (including Time)
[in]chanunitThe output channel units (including Time)
[in]descstrDescription to write to the binary file (e.g., program version, date, & time)
[out]errmsgError message associated with the ErrStat
[in]filenameName of the file to write the output in

◆ wrfilenr()

subroutine nwtc_io::wrfilenr ( integer, intent(in)  Unit,
character(*), intent(in)  Str 
)

This routine writes out a string to the file connected to Unit without following it with a new line.

◆ wriaryfilenr()

subroutine nwtc_io::wriaryfilenr ( integer, intent(in)  Unit,
integer(intki), dimension (:), intent(in)  Ary,
character(*), intent(in)  Fmt,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine writes out an integer array to the file connected to Unit without following it with a new line.

Use WrNumAryFileNR (nwtc_io::wrnumaryfilenr) instead of directly calling a specific routine in the generic interface.

Parameters
[in]unitI/O unit for input file.
[in]aryArray to be written without a newline at the end.
[in]fmtFmt of one element to be written.
[out]errstatError status
[out]errmsgError message associated with ErrStat

◆ wrmatrix1r16()

subroutine nwtc_io::wrmatrix1r16 ( real(quki), dimension(:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in), optional  MatName 
)

This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array.

If MatName is present, it also preceeds the matrix with "MatName" and the number of rows (dimension 1 of A) and columns (dimension 2 of A). It is useful for debugging and/or writing summary files. Use WrMatrix (nwtc_io::wrmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]avector/matrix to be written
[in]unFortran unit number where matrix will be written
[in]refmtFormat for printing numbers
[in]matnamename of matrix

◆ wrmatrix1r4()

subroutine nwtc_io::wrmatrix1r4 ( real(siki), dimension(:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in), optional  MatName 
)

This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array.

If MatName is present, it also preceeds the matrix with "MatName" and the number of rows (dimension 1 of A) and columns (dimension 2 of A). It is useful for debugging and/or writing summary files. Use WrMatrix (nwtc_io::wrmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]avector/matrix to be written
[in]unFortran unit number where matrix will be written
[in]refmtFormat for printing numbers
[in]matnamename of matrix

◆ wrmatrix1r8()

subroutine nwtc_io::wrmatrix1r8 ( real(r8ki), dimension(:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in), optional  MatName 
)

This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array.

If MatName is present, it also preceeds the matrix with "MatName" and the number of rows (dimension 1 of A) and columns (dimension 2 of A). It is useful for debugging and/or writing summary files. Use WrMatrix (nwtc_io::wrmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]avector/matrix to be written
[in]unFortran unit number where matrix will be written
[in]refmtFormat for printing numbers
[in]matnamename of matrix

◆ wrmatrix2r16()

subroutine nwtc_io::wrmatrix2r16 ( real(quki), dimension(:,:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in), optional  MatName 
)

This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array.

If MatName is present, it also preceeds the matrix with "MatName" and the number of rows (dimension 1 of A) and columns (dimension 2 of A). It is useful for debugging and/or writing summary files. Use WrMatrix (nwtc_io::wrmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]avector/matrix to be written
[in]unFortran unit number where matrix will be written
[in]refmtFormat for printing numbers
[in]matnamename of matrix

◆ wrmatrix2r4()

subroutine nwtc_io::wrmatrix2r4 ( real(siki), dimension(:,:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in), optional  MatName 
)

This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array.

If MatName is present, it also preceeds the matrix with "MatName" and the number of rows (dimension 1 of A) and columns (dimension 2 of A). It is useful for debugging and/or writing summary files. Use WrMatrix (nwtc_io::wrmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]avector/matrix to be written
[in]unFortran unit number where matrix will be written
[in]refmtFormat for printing numbers
[in]matnamename of matrix

◆ wrmatrix2r8()

subroutine nwtc_io::wrmatrix2r8 ( real(r8ki), dimension(:,:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in), optional  MatName 
)

This routine writes all the values of a 1- or 2-dimensional array, A, of real numbers to unit Un, using ReFmt for each individual value in the array.

If MatName is present, it also preceeds the matrix with "MatName" and the number of rows (dimension 1 of A) and columns (dimension 2 of A). It is useful for debugging and/or writing summary files. Use WrMatrix (nwtc_io::wrmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]avector/matrix to be written
[in]unFortran unit number where matrix will be written
[in]refmtFormat for printing numbers
[in]matnamename of matrix

◆ wrpartialmatrix1r8()

subroutine nwtc_io::wrpartialmatrix1r8 ( real(r8ki), dimension(:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in)  MatName,
logical, dimension(:), intent(in), optional  UseCol,
logical, intent(in), optional  UseAllCols,
real(r8ki), dimension(:), intent(in), optional  ExtCol 
)

Based on nwtc_io::wrmatrix, this routine writes a matrix to an already-open text file.

It allows the user to omit rows and columns of A in the the file. Use WrPartialMatrix (nwtc_io::wrpartialmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]amatrix to write
[in]ununit where matrix will be written
[in]refmtFormat for printing ReKi numbers
[in]matnamename of the matrix to write
[in]usecolmust be size(A,2); this routine will print only the columns where UseCol is true
[in]useallcolsa scalar that, if set to true, overrides UseCol and will print all columns
[in]extcolcolumns to add to the end of matrix A

◆ wrpartialmatrix2r8()

subroutine nwtc_io::wrpartialmatrix2r8 ( real(r8ki), dimension(:,:), intent(in)  A,
integer, intent(in)  Un,
character(*), intent(in)  ReFmt,
character(*), intent(in)  MatName,
logical, dimension(:), intent(in), optional  UseRow,
logical, dimension(:), intent(in), optional  UseCol,
logical, intent(in), optional  UseAllRows,
logical, intent(in), optional  UseAllCols,
real(r8ki), dimension(:,:), intent(in), optional  ExtCol 
)

Based on nwtc_io::wrmatrix, this routine writes a matrix to an already-open text file.

It allows the user to omit rows and columns of A in the the file. Use WrPartialMatrix (nwtc_io::wrpartialmatrix) instead of directly calling a specific routine in the generic interface.

Parameters
[in]amatrix to write
[in]ununit where matrix will be written
[in]refmtFormat for printing ReKi numbers
[in]matnamename of the matrix to write
[in]usecolmust be size(A,2); this routine will print only the columns where UseCol is true
[in]useallcolsa scalar that, if set to true, overrides UseCol and will print all columns
[in]extcolcolumns to add to the end of matrix A
[in]userowmust be size(A,1); this routine will print only the rows where UseRow is true
[in]useallrowsa scalar that, if set to true, overrides UseRow and will print all rows

◆ wrpr()

subroutine nwtc_io::wrpr ( character(*), intent(in)  Str)

This routine writes out a prompt to the screen without following it with a new line, though a new line precedes it.

Parameters
[in]strThe prompt string to print.

◆ wrr16aryfilenr()

subroutine nwtc_io::wrr16aryfilenr ( integer, intent(in)  Unit,
real(quki), dimension (:), intent(in)  Ary,
character(*), intent(in)  Fmt,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine writes out a real array to the file connected to Unit without following it with a new line.

Use WrNumAryFileNR (nwtc_io::wrnumaryfilenr) instead of directly calling a specific routine in the generic interface.

Parameters
[in]unitI/O unit for input file.
[in]aryArray to be written without a newline at the end.
[in]fmtFmt of one element to be written.
[out]errstatError status
[out]errmsgError message associated with ErrStat

◆ wrr4aryfilenr()

subroutine nwtc_io::wrr4aryfilenr ( integer, intent(in)  Unit,
real(siki), dimension (:), intent(in)  Ary,
character(*), intent(in)  Fmt,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine writes out a real array to the file connected to Unit without following it with a new line.

Use WrNumAryFileNR (nwtc_io::wrnumaryfilenr) instead of directly calling a specific routine in the generic interface.

Parameters
[in]unitI/O unit for input file.
[in]aryArray to be written without a newline at the end.
[in]fmtFmt of one element to be written.
[out]errstatError status
[out]errmsgError message associated with ErrStat

◆ wrr8aryfilenr()

subroutine nwtc_io::wrr8aryfilenr ( integer, intent(in)  Unit,
real(r8ki), dimension (:), intent(in)  Ary,
character(*), intent(in)  Fmt,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine writes out a real array to the file connected to Unit without following it with a new line.

Use WrNumAryFileNR (nwtc_io::wrnumaryfilenr) instead of directly calling a specific routine in the generic interface.

Parameters
[in]unitI/O unit for input file.
[in]aryArray to be written without a newline at the end.
[in]fmtFmt of one element to be written.
[out]errstatError status
[out]errmsgError message associated with ErrStat

◆ wrscr()

recursive subroutine nwtc_io::wrscr ( InStr  )

This routine writes out a string to the screen.

Parameters
[in]instrThe input string to write to the screen.

◆ wrscr1()

subroutine nwtc_io::wrscr1 ( Str  )

This routine writes out a string to the screen after a blank line.

Parameters
strThe string to print.

◆ wrvtk_footer()

subroutine nwtc_io::wrvtk_footer ( integer(intki), intent(in)  Un)

This routine writes out the footer for an vtk xml file (associated header generated in nwtc_io::wrvtk_header).

It closes the file Un.

Parameters
[in]ununit number of opened file

◆ wrvtk_header()

subroutine nwtc_io::wrvtk_header ( character(*), intent(in)  FileName,
integer(intki), intent(in)  NumberOfPoints,
integer(intki), intent(in)  NumberOfLines,
integer(intki), intent(in)  NumberOfPolys,
integer(intki), intent(out)  Un,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine writes out the heading for an vtk xml file (associated footer generated in nwtc_io::wrvtk_footer).

It tries to open a text file for writing and returns the Unit number of the opened file.

Parameters
[in]filenameName of output file
[in]numberofpointsNumber of points in this VTK file
[in]numberoflinesNumber of lines in this VTK file
[in]numberofpolysNumber of polygons in this VTK file
[out]ununit number of opened file
[out]errstaterror level/status of OpenFOutFile operation
[out]errmsgmessage when error occurs

◆ wrvtk_sp_header()

subroutine nwtc_io::wrvtk_sp_header ( character(*), intent(in)  FileName,
character(*), intent(in)  descr,
integer(intki), intent(out)  Un,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine writes out the heading for an vtk, ascii, structured_points dataset file .

It tries to open a text file for writing and returns the Unit number of the opened file.

Parameters
[in]filenameName of output file
[in]descrLine describing the contents of the file
[out]ununit number of opened file
[out]errstaterror level/status of OpenFOutFile operation
[out]errmsgmessage when error occurs

◆ wrvtk_sp_vectors3d()

subroutine nwtc_io::wrvtk_sp_vectors3d ( integer(intki), intent(in)  Un,
character(*), intent(in)  dataDescr,
integer(intki), dimension(3), intent(in)  dims,
real(reki), dimension(3), intent(in)  origin,
real(reki), dimension(3), intent(in)  gridSpacing,
real(siki), dimension(:,:,:,:), intent(in)  gridVals,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
Parameters
[in]ununit number of previously opened file (via call to WrVTK_SP_header)
[in]datadescrShort label describing the vector data
[in]dimsdimension of the 3D grid (nX,nY,nZ)
[in]originthe lower-left corner of the 3D grid (X0,Y0,Z0)
[in]gridspacingspacing between grid points in each of the 3 directions (dX,dY,dZ)
[in]gridvals3D array of data, size (nX,nY,nZ)
[out]errstaterror level/status of OpenFOutFile operation
[out]errmsgmessage when error occurs

Variable Documentation

◆ beep

logical nwtc_io::beep = .TRUE.

Flag that specifies whether or not to beep for error messages and program terminations.

◆ ec_intaryfrmt

character(*), parameter nwtc_io::ec_intaryfrmt = "(15X,A,T30,' - ',A,/,100(2X,I11,:))"

Output format for array of integer parameters.

◆ ec_lgaryfrmt

character(*), parameter nwtc_io::ec_lgaryfrmt = "(15X,A,T30,' - ',A,/,100(2X,L11,:))"

Output format for array of logical parameters.

◆ ec_rearyfrmt

character(*), parameter nwtc_io::ec_rearyfrmt = "(15X,A,T30,' - ',A,/,100(2X,ES11.4e2,:))"

Output format for array of real parameters.

◆ ec_straryfrmt

character(*), parameter nwtc_io::ec_straryfrmt = "(15X,A,T30,' - ',A,/,2X,100('""',A,'""',:,1X))"

Output format for array of string parameters.

◆ flgtype

integer(intki), parameter nwtc_io::flgtype = 1

Switch for telling if a variable is a flag (logical).

◆ numtype

integer(intki), parameter nwtc_io::numtype = 2

Switch for telling if a variable is a number.

◆ progname

character(20) nwtc_io::progname = ' '

The name of the calling program.

DO NOT USE THIS IN NEW PROGRAMS (Modules)

◆ progver

character(99) nwtc_io::progver = ' '

The version (including date) of the calling program.

DO NOT USE THIS IN NEW PROGRAMS

◆ strtype

integer(intki), parameter nwtc_io::strtype = 3

Switch for telling if a variable is a string.

◆ tab

character(1), parameter nwtc_io::tab = CHAR( 9 )

The tab character.