File: multiple_open_array.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 (70 lines) | stat: -rw-r--r-- 1,572 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
.. ifconfig:: calcephapi in ('C')

    ::
    
        const char *filear[2]= {"example1.bsp", "example1.tpc"};
        t_calcephbin *peph;
        
        peph = calceph_open_array(2,filear);
        if (peph)
        {
            /* ... computation ...*/
            calceph_close(peph);
        }


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

    ::
    
        TYPE(C_PTR) :: peph
        character(len=256), dimension (2) :: filear
        filear(1) = "example1.bsp"//C_NULL_CHAR
        filear(2) = "example1.tpc"//C_NULL_CHAR
        peph = calceph_open_array(2, filear, 256) 
        if (C_ASSOCIATED(peph)) then
          res = calceph_prefetch(peph)
          ! ...  computation ...
          call calceph_close(peph)
        endif

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

    ::
    
           integer*8 peph
           integer res
           character*80 filear(2)

           filear(1) = "example1.bsp"
           filear(2) = "example1.tpc"
           res = f90calceph_open_array(peph, 2, filear, 80)
           if (res.eq.1) then
              res = f90calceph_prefetch(peph)
              !  ...  computation ...
              call calceph_close(peph)
           endif


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

    ::
    
        from calcephpy import CalcephBin
        peph = CalcephBin.open(['example1.bsp', 'example1.tpc'])

        # ... computation ...

        peph.close()


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

    ::
    
        peph = CalcephBin.open(cellstr({'example1.bsp', 'example1.tpc'}))

        % ... computation ...

        peph.close()