USE, INTRINSIC :: ISO_C_BINDING
use calceph
implicit none
integer res
integer j, itarget, icenter, iframe, iseg
real(C_DOUBLE) firsttime, lasttime
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 positionrecords
do j=1, calceph_getpositionrecordcount(peph)
res = calceph_getpositionrecordindex2(peph,j,itarget, icenter, firsttime, lasttime, iframe, iseg)
write (*,*) itarget, icenter, firsttime, lasttime, iframe, iseg
enddo
call calceph_close(peph)
endif