An illustrative code example in F90 using the input parsing API is shown below (and is also available in the examples directory from a top-level install). This C example is configured to parse the example pecos-input.txt file shown here and uses many of the available parsing routines including a demonstration of default value registration.
program main
use grvy
implicit none
integer :: flag
integer :: error
real :: reyn
real*8 :: magicval
integer :: iter_max
integer :: switches(4)
integer, allocatable :: switches2(:)
character :: filename*100
character :: key1*100
character :: key2*100
logical :: restart
print*,' ------ Full Dump ------'
print*,' ---- End Full Dump ----'
print*,' ------ Full Dump (delimited) ------'
call grvy_input_fread_real ("reyn",reyn,flag)
print*,'reyn = ',reyn
print*,'iter_max = ',iter_max
print*,'gridfile = ',trim(filename)
print*,'aa:switches = ',switches(1),switches(2),switches(3),switches(4)
allocate(switches2(4))
print*,'bb:switches2 = ',switches2(1),switches2(2),switches2(3),switches2(4)
print*,'solver/keyword 1 = ',trim(key1)
print*,'solver/keyword 2 = ',trim(key2)
call grvy_input_fread_logical ("restart",restart,.false.,flag)
print*,'restart = ',restart
error = error*flag
print*,'solver/magicval = ',magicval
stop
end program main