STR2DBLARY

Utility/Data Access SubroutineConverts string data into double or double array.

Use

The function can be called by any user-defined subroutine.

Format

Fortran Calling Syntax
CALL STR2DBLARY(STRG, ARRAY, NSIZE, ISTAT)
C/C++ Calling Syntax
c_str2dblary(strg, array, nsize, istat)
Python Calling Syntax
[array, istat] = py_str2dblary(strg)
MATLAB Calling Syntax
[array, istat] = m_str2dblary(strg)

Attributes

STRG
[string]
A string variable containing the data to be converted into double precision numbers.

Output

ARRAY
[double]
The string data, converted into a double precision array.
NSIZE
[integer]
Returns the number of double precision numbers found in the string, separated by spaces.
ISTAT
[integer]
0
If the call to STR2DBLARY was successful.
n
Any nonzero integer returned if the call to STR2DBLARY was unsuccessful.

Example

If the input string contains a double, e.g., "1.234", then the call to STR2DBLARY yields an output ARRAY(1)= 1.234, NSIZE=1, and ISTAT=0 (normal return).

If the input string contains "1.234 5.678", then the call to STR2DBLARY yields an output ARRAY(1)= 1.234, ARRAY(2)= 5.678, NSIZE=2 and ISTAT=0 (normal return).

The prototype for STR2DBLARY can be found in the C include header msolvsub_c_include.h in the folder [install-path]\hwsolvers\usersub\c_src\include.

Comments

  1. STR2DBLARY is useful for processing the string output from MODFNC subroutine.
  2. You are responsible for providing sufficient storage in the output array.