[UP]


Manual Reference Pages  - dgets (3)

NAME

dgets(3f) - [ARGUMENTS:M_kracken] given keyword fetch doubleprecision array from command arguments (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Example
See Also
Author
License

SYNOPSIS

function dgets(keyword,ier) result(darray)

    character(len=*),intent(in)   :: keyword
    doubleprecision,allocatable   :: DARRAY
    integer,optional,intent(iout) :: ier

DESCRIPTION

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.

OPTIONS

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).

RETURNS

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

EXAMPLE

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_dgets

Example 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

SEE ALSO

M_kracken(3f),
  kracken(3f)
dget(3f), dgets(3f), iget(3f), igets(3f), lget(3f), lgets(3f), rget(3f), rgets(3f), sget(3f), sgets(3f), retrev(3f)

parse(3f), dissect(3f), store(3f), setprompts(3f), show(3f)

AUTHOR

John S. Urban

LICENSE

Public Domain


dgets (3) October 17, 2020
Generated by manServer 1.08 from 4ea56c29-d99c-4a36-8449-5ba4321e152e using man macros.