dgets(3f) - [ARGUMENTS:M_kracken] given keyword fetch doubleprecision array from command arguments (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
See Also
Author
License
function dgets(keyword,ier) result(darray)
character(len=*),intent(in) :: keyword doubleprecision,allocatable :: DARRAY integer,optional,intent(iout) :: ier
The dgets(3f) function returns a dynamically allocated array of doubleprecision values from a string that is the value for a command line option. It is part of the M_kracken(3fm) module.Values that cannot be read as a numeric value are returned as a NaN.
keyword dictionary name to retrieve, of form VERB_NAME where VERB is taken from the first parameter of the call to KRACKEN(3f) or DISSECT(3f).
darray double precision numeric array returned by function. The array will have zero size if the parsed dictionary entry is blank. IER If present and non-zero an error occurred in converting strings to a value
Sample program
program demo_dgets use M_kracken, only: kracken, dgets implicit none doubleprecision,allocatable :: vals(:) integer :: i ! define command arguments and parse user command call kracken(demo,-nums 1 2 3 1000 100,000 11.11111 77.77777 -77.7777 ) vals=dgets(demo_nums) ! get any values specified for -nums write(*,(*(g0:,",")))( vals(i),i=1,size(vals)) ! print the values end program demo_dgetsExample program runs:
$ demo_dgets 1.0000000000000000,2.0000000000000000,3.0000000000000000, 1000.0000000000000,100000.00000000000,11.111110000000000, 77.777770000000004,-77.777699999999996$ demo_dgets -nums 89,123,456.789 10.9999999 89123456.789000005,10.999999900000001
dget(3f), dgets(3f), iget(3f), igets(3f), lget(3f), lgets(3f), rget(3f), rgets(3f), sget(3f), sgets(3f), retrev(3f)
M_kracken(3f), kracken(3f) parse(3f), dissect(3f), store(3f), setprompts(3f), show(3f)
John S. Urban
Public Domain
Nemo Release 3.1 | dgets (3) | February 23, 2025 |