File: multiple_open.rst

package info (click to toggle)
calceph 4.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,944 kB
  • sloc: ansic: 21,414; fortran: 4,054; python: 1,569; sh: 197; makefile: 5
file content (85 lines) | stat: -rw-r--r-- 1,889 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.. ifconfig:: calcephapi in ('C')

    The following example opens the ephemeris file example1.dat and example2.dat
    
    ::

         t_calcephbin *peph1;
         t_calcephbin *peph2;
         peph1 = calceph_open("example1.dat");
         peph2 = calceph_open("example2.dat");
         if (peph1 && peph2)
         {
           calceph_prefetch(peph1);
           calceph_prefetch(peph2);
           /* 
             ...  computation ... 
           */
         }
         /* close the files */
         if (peph1) calceph_close(peph1);
         if (peph2) calceph_close(peph2);

.. ifconfig:: calcephapi in ('F2003')

    The following example opens the ephemeris file example1.dat

    ::

           USE, INTRINSIC :: ISO_C_BINDING
           use calceph
           TYPE(C_PTR) :: peph
           
           peph = calceph_open("example1.dat"//C_NULL_CHAR)
           if (C_ASSOCIATED(peph)) then
           
                ! ... computation ... 
           
           endif 
           call calceph_close(peph)    

.. ifconfig:: calcephapi in ('F90')

    The following example opens the ephemeris file example1.dat

    ::

           include 'f90calceph.h'
           integer res

           res = f90calceph_open(peph, "example1.dat")
           if (res.eq.1) then
           
                ! ... computation ... 
           
           endif 
           call f90calceph_close(peph)


.. ifconfig:: calcephapi in ('Python')

    The following example opens the ephemeris file example1.dat

    ::
    
        from calcephpy import *

        peph = CalcephBin.open("example1.dat")
 
        # ...  computation ...  

        peph.close()
 

.. ifconfig:: calcephapi in ('Mex')

    The following example opens the ephemeris file example1.dat

    ::
    
        peph = calceph.CalcephBin.open('example1.dat')
 
        % ...  computation ...  

        peph.close()