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]
Output
- ARRAY
- [double]
- NSIZE
- [integer]
- ISTAT
- [integer]
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
- STR2DBLARY is useful for processing the string output from MODFNC subroutine.
- You are responsible for providing sufficient storage in the output array.