home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / hdf3_2r2.lha / HDF3.2r2 / src / vgff.f < prev    next >
Encoding:
Text File  |  1992-10-28  |  14.9 KB  |  608 lines

  1. C***************************************************************************
  2. C
  3. C
  4. C                         NCSA HDF version 3.2r2
  5. C                            October 30, 1992
  6. C
  7. C NCSA HDF Version 3.2 source code and documentation are in the public
  8. C domain.  Specifically, we give to the public domain all rights for future
  9. C licensing of the source code, all resale rights, and all publishing rights.
  10. C
  11. C We ask, but do not require, that the following message be included in all
  12. C derived works:
  13. C
  14. C Portions developed at the National Center for Supercomputing Applications at
  15. C the University of Illinois at Urbana-Champaign, in collaboration with the
  16. C Information Technology Institute of Singapore.
  17. C
  18. C THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  19. C SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  20. C WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  21. C
  22. C***************************************************************************
  23.  
  24. C
  25. C $Header: /hdf/hdf/v3.2r2/src/RCS/vgff.f,v 1.2 1992/10/23 19:13:12 koziol beta koziol $
  26. C
  27. C $Log: vgff.f,v $
  28. c Revision 1.2  1992/10/23  19:13:12  koziol
  29. c Created fortran stubs dfvopen and dfvclos for DFvsetopen() and DFvsetclose
  30. c
  31. c Revision 1.1  1992/08/25  21:40:44  koziol
  32. c Initial revision
  33. c
  34. C
  35. c    **************************************************************************
  36. c    * Likkai Ng May 1991 NCSA
  37. c    *
  38. c    * vgFf.f
  39. c    * Part of the HDF VSet interface.
  40. c    *
  41. c    * Contains fortran routines callable from fortran programs.
  42. c    *
  43. c    **************************************************************************
  44.  
  45. C------------------------------------------------------------------------------
  46. C Name: dfvopen
  47. C Purpose:  call dfivopn, open file
  48. C Inputs:   path: Name of file to be opened
  49. C           access: DFACC_READ, DFACC_WRITE, DFACC_CREATE,
  50. C                      or any bitwise-or of the above.
  51. C           ndds: Number of dds in header block if file needs to be created.
  52. C Returns: 0 on success, FAIL on failure with error set
  53. C Users:    Fortran stub routine
  54. C Invokes: hiopen
  55. C----------------------------------------------------------------------------*/
  56.  
  57.     integer function dfvopen(filename, access, defdds)
  58.  
  59.     character*(*) filename
  60.     integer       access, defdds, dfivopn
  61.  
  62.     dfvopen = dfivopn(filename, access, defdds, len(filename))
  63.     return
  64.     end
  65.  
  66.  
  67. c    ============================================================
  68. c     VGROUP ROUTINES
  69. c    ============================================================
  70.  
  71. c    attachs to a vgroup     
  72. c    related: Vattach--vatchc--VFATCH
  73.  
  74.     integer    function VFATCH(f, vgid, accesstype)
  75.     integer        f, vgid
  76.     character*1    accesstype
  77.     integer        VATCHC
  78.  
  79.     VFATCH = VATCHC (f, vgid, accesstype)
  80.     end
  81.  
  82. c    ------------------------------------------------------------
  83. c    detaches from a vgroup
  84. c    related: Vdetach--vdtchc--VFDTCH
  85.  
  86.     subroutine    VFDTCH (vg)    
  87.     integer        vg
  88.  
  89.     call VDTCHC (vg)
  90.     end
  91.  
  92. c    ------------------------------------------------------------
  93. c    general inquiry on a vgroup
  94. c    related: Vgetname--vgnamc--VFGNAM
  95.  
  96.     subroutine VFGNAM (vg, vgname)             
  97.     integer            vg
  98.     character*(*)    vgname
  99.  
  100.     call VGNAMC (vg, vgname)
  101.     end
  102. c    ------------------------------------------------------------
  103. c    get the class name of a vgroup
  104. c    related: Vgetclass--vgclsc--VFGCLS
  105.  
  106.     subroutine VFGCLS (vg, vgclass)             
  107.  
  108.     integer            vg
  109.     character*(*)    vgclass
  110.  
  111.     call VGCLSC  (vg, vgclass)
  112.     end
  113. c    ------------------------------------------------------------
  114. c    general inquiry on a vgroup
  115. c    related: Vinquire--vinqc--VFINQ
  116.  
  117.     integer    function    VFINQ (vg, nentries, vgname) 
  118.     integer            vg, nentries
  119.     character*(*)    vgname
  120.     integer            VINQC
  121.  
  122.     VFINQ = VINQC (vg, nentries, vgname)
  123.     end
  124.  
  125. c    ------------------------------------------------------------
  126. c    gets the id of the next vgroup in the file
  127. c    related: Vgetid--vgidc--VFGID
  128.  
  129.     integer    function    VFGID (f, vgid)            
  130.     integer        f, vgid
  131.     integer        VGIDC
  132.  
  133.     VFGID = VGIDC (f, vgid)
  134.     end
  135.  
  136. c    ------------------------------------------------------------
  137. c    gets the id of the next entry in the vgroup
  138. c    related: Vgetnext--vgnxtc--VFGNXT
  139.  
  140.     integer    function    VFGNXT (vg, id)                
  141.     integer        vg, id
  142.     integer        VGNXTC
  143.  
  144.     VFGNXT = VGNXTC (vg, id)
  145.     end
  146.  
  147.  
  148. c    ------------------------------------------------------------
  149. c    sets the name of the vgroup
  150. c    related: Vsetname--vsnamc--VFSNAM
  151.  
  152.     subroutine VFSNAM (vg, vgname)
  153.     integer            vg
  154.     character*(*)    vgname
  155.  
  156.     call VSNAMC (vg, vgname, len(vgname))
  157.     end
  158. c    ------------------------------------------------------------
  159. c    sets the class name of the vgroup
  160. c    related: Vsetclass--vsclsc--VFSCLS
  161.  
  162.     subroutine VFSCLS (vg, vgclass)    
  163.     integer            vg
  164.     character*(*)    vgclass
  165.  
  166.     call VSCLSC  (vg, vgclass, len(vgclass))
  167.     end
  168.  
  169. c    ------------------------------------------------------------
  170. c    inserts a vset entity (ie vgroup or vdata) into the given vgroup
  171. c    related: Vinsert--vinsrtc--VFINSRT
  172.  
  173.  
  174.     integer    function VFINSRT (vg, velt)    
  175.     integer        vg, velt
  176.     integer        VINSRTC
  177.  
  178.     VFINSRT = VINSRTC (vg, velt)
  179.     end
  180.  
  181. c    ------------------------------------------------------------
  182. c    tests if an id in a vgroup is a vgroup
  183. c    related: Visvg--visvgc--VFISVG
  184.  
  185.     integer    function    VFISVG (vg, id)                                     
  186.     integer        vg, id
  187.     integer        VISVGC
  188.  
  189.     VFISVG = VISVGC (vg, id)
  190.     end
  191.  
  192. c    ------------------------------------------------------------
  193. c    tests if an id in a vgroup is a vdata
  194. c    related: Visvs--visvsc--VFISVS
  195.  
  196.     integer    function    VFISVS (vg, id)
  197.     integer        vg, id
  198.     integer        VISVSC
  199.  
  200.     VFISVS = VISVSC (vg, id)
  201.     end
  202.  
  203.  
  204.  
  205. c    ============================================================
  206. c     VDATA ROUTINES
  207. c    ============================================================
  208.  
  209. c    attach to a vdata
  210. c    related: VSattach--vsatchc--VFATCH
  211.  
  212.     integer    function    VSFATCH (f, vsid, accesstype)
  213.     integer        f, vsid
  214.     character*1    accesstype
  215.     integer        VSATCHC
  216.  
  217.     VSFATCH = VSATCHC (f, vsid, accesstype)
  218.     end
  219.  
  220. c    ------------------------------------------------------------
  221. c    detach from a vdata
  222. c    related: VSdetach--vsdtchc--VFDTCH
  223.  
  224.     subroutine    VSFDTCH (vs)
  225.     integer        vs
  226.  
  227.     call VSDTCHC (vs)
  228.     end
  229.  
  230. c    ------------------------------------------------------------
  231. c    seeks to a given element position in a vadata
  232. c    related: VSseek--vsseekc--VSFSEEK
  233.  
  234.     integer    function    VSFSEEK (vs, eltpos )
  235.     integer        vs, eltpos
  236.     integer        VSSEEKC
  237.  
  238.     VSFSEEK = VSSEEKC (vs, eltpos)
  239.     end
  240.  
  241. c    ------------------------------------------------------------
  242. c    gets the name of a vdata
  243. c    related: VSgetname--vsgnamc--VSFGNAM
  244.  
  245.     subroutine  VSFGNAM (vs, vsname)    
  246.     integer            vs
  247.     character*(*)    vsname
  248.  
  249.     call VSGNAMC (vs, vsname)
  250.     end
  251.  
  252. c    ------------------------------------------------------------
  253. c    get the class name of a vdata
  254. c    related: VSgetclass--vsgclsc--VSFGCLS
  255.  
  256.     subroutine VSFGCLS (vs, vsclass)             
  257.     integer            vs
  258.     character*(*)    vsclass
  259.  
  260.     call VSGCLSC  (vs, vsclass)
  261.     end
  262.  
  263. c    ------------------------------------------------------------
  264. c    general inquiry on a vdata
  265. c    related: VSinquire--vsinqc--VSFINQ
  266.  
  267.     integer function VSFINQ (vs,nvs,ilace,fields,vsize,vsname) 
  268.     integer            vs, nvs, ilace, vsize
  269.     character*(*)    fields, vsname
  270.     integer            VSINQC
  271.  
  272.     VSFINQ = VSINQC (vs,nvs,ilace,fields,vsize,vsname) 
  273.     end
  274.  
  275. c    ------------------------------------------------------------
  276. c    tests if given fields exist in the vdata
  277. c    related: VSfexist--vsfexc--VSFEX
  278.  
  279.     integer    function VSFEX (vs, fields)        
  280.     integer            vs
  281.     character*(*)    fields
  282.     integer            VSFEXC
  283.  
  284.     VSFEX = VSFEXC (vs, fields, len(fields))
  285.     end
  286.  
  287. c  ------------------------------------------------------------
  288. c    gets the id of the next vdata from the file
  289. c    related: VSgetid--vsgidc--VSFGID
  290.  
  291.     integer  function VSFGID (f, vsid) 
  292.     integer     f, vsid
  293.     integer     VSGIDC
  294.  
  295.     VSFGID = VSGIDC (f, vsid)
  296.     end
  297.  
  298. c    ------------------------------------------------------------
  299. c    sets the name of a vdata
  300. c    related: VSsetname--vssnamc--VSFSNAM
  301.  
  302.     subroutine VSFSNAM (vs, vsname)    
  303.     integer            vs
  304.     character*(*)    vsname
  305.  
  306.     call VSSNAMC (vs, vsname, len(vsname))
  307.     end
  308.  
  309. c    ------------------------------------------------------------
  310. c    set the class name of a vdata
  311. c    related: VSsetclass--vssclsc--VSFSCLS
  312.  
  313.     subroutine VSFSCLS (vs, vsclass)             
  314.     integer            vs
  315.     character*(*)    vsclass
  316.  
  317.     call VSSCLSC  (vs, vsclass, len(vsclass))
  318.     end
  319.  
  320. c    ------------------------------------------------------------
  321. c    sets the fields in a vdata for reading or writing
  322. c    related: VSsetfields--vssfldc--VSFSFLD
  323.  
  324.     integer    function    VSFSFLD (vs, fields)        
  325.     integer            vs
  326.     character*(*)    fields
  327.     integer        VSSFLDC
  328.  
  329.     VSFSFLD = VSSFLDC (vs, fields, len(fields))
  330.     end
  331.  
  332. c    ------------------------------------------------------------
  333. c    sets the file interlace of a vdata
  334. c    related: VSsetinterlace--vssintc--VSFSINT
  335.  
  336.     integer     function VSFSINT (vs, interface)
  337.     integer         vs, interlace                         
  338.     integer        VSSINTC
  339.  
  340.     VSFSINT = VSSINTC (vs, interlace)
  341.     end
  342.  
  343. c    ------------------------------------------------------------
  344. c    defines a new field to be used in the vdata
  345. c    related: VSfdefine--vsfdefc--VSFFDEF
  346.  
  347.     integer    function    VSFFDEF (vs, field, localtype, order)    
  348.  
  349.     integer            vs, localtype, order
  350.     character*(*)    field
  351.     integer            VSFDEFC
  352.  
  353.     VSFFDEF = VSFDEFC ( vs, field, localtype, order, len(field))
  354.  
  355.     end
  356.  
  357. c    ------------------------------------------------------------
  358. c    reads from a vdata
  359. c    related: VSread--vsreadc--VSFREAD
  360.  
  361.     integer    function    VSFREAD (vs, buf, nelts , interlace)
  362.  
  363.     integer            vs, nelts , interlace
  364.     character*(*)    buf
  365.     integer            VSREADC
  366.  
  367.     VSFREAD = VSREADC (vs, buf, nelts, interlace)
  368.     end
  369.  
  370. c    ------------------------------------------------------------
  371. c    writes to a vdata
  372. c    related: VSwrite--vswritc--VSFWRIT
  373.  
  374.     integer    function    VSFWRIT (vs, buf, nelts, interlace)
  375.  
  376.     integer            vs, nelts, interlace
  377.     integer            buf(*)    
  378.     integer            VSWRITC
  379.  
  380.     VSFWRIT = VSWRITC (vs, buf, nelts, interlace)
  381.     end
  382.  
  383. c    ===========================================
  384. c    MISCELLANEOUS USEFUL VDATA INQUIRY ROUTINES
  385. c    ===========================================
  386. c
  387. c    undocumented
  388.  
  389.  
  390. c    gets the interlace of a vdata
  391. c    related: VSgetinterlace--vsgintc--VSFGINT
  392.  
  393.     integer     function VSFGINT (vs)                    
  394.     integer         vs
  395.     integer        VSGINTC
  396.  
  397.     VSFGINT = VSGINTC (vs)
  398.     end
  399.  
  400. c    ------------------------------------------------------------
  401. c    gets the number of elements in a vdata
  402. c    related: VSelts--vseltsc--VSFELTS
  403.  
  404.     integer     function VSFELTS (vs)            
  405.     integer  vs    
  406.     integer    VSELTSC
  407.  
  408.     VSFELTS = VSELTSC (vs)
  409.     end
  410.  
  411. c    ------------------------------------------------------------
  412. c    gets the fields in the vdata
  413. c    related: VSgetfields--vsgfldc--VSFGFLD
  414.  
  415.     integer    function VSFGFLD (vs, fields)    
  416.     integer            vs
  417.     character*(*)     fields
  418.     integer            VSGFLDC
  419.  
  420.     VSFGFLD = VSGFLDC (vs, fields)
  421.     end
  422.  
  423. c    ------------------------------------------------------------
  424. c     determines the (machine) size of the given fields
  425. c    related: VSsizeof--vssizc--VSFSIZ
  426.  
  427.     integer    function VSFSIZ (vs, fields)        
  428.     integer            vs
  429.     character*(*)     fields
  430.     integer            VSSIZC
  431.  
  432.     VSFSIZ = VSSIZC (vs, fields, len(fields))
  433.     end
  434.  
  435. c    ------------------------------------------------------------
  436. c    determines the no of entries in a vgroup
  437. c    related: Ventries--ventsc--VFENTS
  438.  
  439.     integer     function    VFENTS (f, vgid)        
  440.     integer    f, vgid
  441.     integer    VENTSC 
  442.  
  443.     VFENTS = VENTSC (f, vgid)
  444.     end
  445.  
  446. c    ------------------------------------------------------------
  447. c    DEBUGGING ROUTINES
  448. c    ------------------------------------------------------------
  449.  
  450. c    enable debug
  451. c    related: setjj--setjjc--SETFJJ
  452.  
  453.     integer     function SETFJJ()             
  454.     integer  setjjc 
  455.  
  456.     SETFJJ = setjjc() 
  457.     end
  458.  
  459. c    ------------------------------------------------------------
  460. c    disable debug
  461. c    related: setnojj--setnojjc--SETFNJJ
  462.  
  463.     integer     function SETFNJJ()             
  464.     integer  setnojjc 
  465.  
  466.     SETFNJJ = setnojjc() 
  467.     end
  468. c    ------------------------------------------------------------
  469. c    gets the refs of all lone vgroups in the file
  470. c    related: Vlone--vlonec--VFLONE
  471.  
  472.     integer function VFLONE (f, idarray, asize)
  473.     integer            f
  474.     integer            idarray(*)
  475.     integer            asize
  476.     integer            VLONEC
  477.  
  478.     VFLONE = VLONEC  (f, idarray, asize)
  479.     end
  480.  
  481. c    ------------------------------------------------------------
  482. c    gets the refs of all lone vdatas in the file
  483. c    related: VSlone--vslonec--VSFLONE
  484.  
  485.     integer function VSFLONE (f, idarray, asize)
  486.     integer            f
  487.     integer            idarray(*)
  488.     integer            asize
  489.     integer            VSLONEC
  490.  
  491.     VSFLONE = VSLONEC  (f, idarray, asize)
  492.     end
  493.  
  494. c    ------------------------------------------------------------
  495. c    store a simple dataset in a vdata
  496. c    related: VHstoredata--vhsdc--vhfsd
  497.  
  498.     integer function VHFSD(f,field,buf,n,dtype,vsname,vsclass)
  499.     integer        f
  500.     character*(*)  field
  501.     integer        buf(*)    
  502.     integer        n, dtype
  503.     character*(*)  vsname, vsclass
  504.     integer VHSDC     
  505.  
  506.     VHFSD = VHSDC (f, field, buf, n, dtype, vsname, vsclass,
  507.      1            len(field), len(vsname), len(vsclass))
  508.     end
  509.  
  510. c    ------------------------------------------------------------
  511. c    store an aggregate dataset in a vadata
  512. c    related: VHstoredatam--vhsdmc--vhfsdm
  513.  
  514.     integer function VHFSDM (f,field,buf,n,dtype,vsname,vsclass,order)
  515.     integer            f
  516.     character*(*)  field
  517.     integer            buf(*)    
  518.     integer            n, dtype, order
  519.     character*(*)  vsname, vsclass
  520.     integer VHSDMC         
  521.  
  522.     VHFSDM = VHSDMC (f, field, buf, n, dtype, vsname,vsclass, order,
  523.      1             len(field), len(vsname), len(vsclass))
  524.     end
  525.  
  526. c    ------------------------------------------------------------
  527. c    make a new vgroup given several tag/ref pairs
  528. c    related: VHmakegroup--vhmkgpc--vhfmkgp
  529.  
  530.     integer function VHFMKGP(f,tagarray,refarray,n,vgname,vgclass)
  531.     integer        f, n
  532.     integer        tagarray(*), refarray(*)
  533.     character*(*)  vgname, vgclass
  534.     integer         VHMKGPC     
  535.  
  536.     VHFMKGP = VHMKGPC (f, tagarray, refarray , n, vgname, vgclass,
  537.      1                len(vgname), len(vgclass))
  538.     end
  539.  
  540. c    ============================================================
  541. c    More vgroup routines
  542.  
  543. c    locate a field in a vdata that belongs to this VGROUP    
  544. c    related: Vflocate--vffloc--vflocc
  545.  
  546.     integer function VFFLOC  (vg, field)
  547.     integer            vg
  548.     character*(*)    field
  549.     integer             VFLOCC                                
  550.     VFFLOC = VFLOCC (vg, field, len(field))
  551.     end
  552.  
  553. c    ------------------------------------------------------------
  554. c    tests if a tag/ref pair is in a vgroup.
  555. c    related: Vinqtagref--vinqtrc--vfinqtr
  556.  
  557.     integer function VFINQTR  (vg, tag, ref)
  558.     integer        vg, tag, ref
  559.     integer        VINQTRC                                     
  560.     VFINQTR = VINQTRC (vg, tag, ref)
  561.     end
  562.  
  563. c    ------------------------------------------------------------
  564. c    gets the number of tag/refs stored in a vgroup
  565. c    related: Velts--veltsc--vfelts
  566.  
  567.     integer function VFNTR (vg)
  568.     integer        vg
  569.     integer VNTRC 
  570.     VFNTR = VNTRC (vg)
  571.     end
  572.  
  573. c    ------------------------------------------------------------
  574. c    returns all the tag/ref pairs in a vgroup
  575. c    related: Vgettagrefs--vgttrsc--vfgttrs
  576.  
  577.     integer function VFGTTRS (vg, tagarray, refarray, n)
  578.     integer        vg, n
  579.     integer        tagarray(*), refarray(*)
  580.     integer        VGTTRSC                                    
  581.  
  582.     VFGTTRS = VGTTRSC (vg, tagarray, refarray, n)
  583.     end
  584. c    ------------------------------------------------------------
  585. c    returns a specified tag/ref pair in a vgroup
  586. c    related: Vgettagref--vgttrc--vfgttr
  587.  
  588.     integer function VFGTTR (vg, which, tag, ref)
  589.     integer        vg, which
  590.     integer        tag, ref
  591.     integer        VGTTRC                                    
  592.  
  593.     VFGTTR = VGTTRC (vg, which, tag, ref)
  594.     end
  595.  
  596. c    ------------------------------------------------------------
  597. c    add a tag/ref pair to a vgroup
  598. c    related: Vaddtagref--vadtrc--VFADTR
  599.  
  600.     integer function VFADTR    ( vg, tag, ref)
  601.     integer        vg, tag, ref
  602.     integer VADTRC                
  603.  
  604.     VFADTR = VADTRC  ( vg, tag, ref)
  605.     end
  606. c    ============================================================
  607.  
  608.