<no title> — CALCEPH - Fortran 2003 language 3.4.1 documentation

       USE, INTRINSIC :: ISO_C_BINDING
       use calceph
       implicit none
       integer res
       integer j
       real(8) valueconstant
       character(len=CALCEPH_MAX_CONSTANTNAME) nameconstant
       TYPE(C_PTR) :: peph

    ! open the ephemeris file
       peph = calceph_open("example1.dat"//C_NULL_CHAR)
       if (C_ASSOCIATED(peph)) then

    ! print the list of constants
         do j=1, calceph_getconstantcount(peph)
           res = calceph_getconstantindex(peph,j,nameconstant, valueconstant)
           write (*,*) nameconstant,"=",valueconstant
         enddo

         call calceph_close(peph)
       endif