C===========================================================================
C Copyright (C) 1995 European Southern Observatory (ESO)
C
C This program is free software; you can redistribute it and/or 
C modify it under the terms of the GNU General Public License as 
C published by the Free Software Foundation; either version 2 of 
C the License, or (at your option) any later version.
C
C This program is distributed in the hope that it will be useful,
C but WITHOUT ANY WARRANTY; without even the implied warranty of
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
C GNU General Public License for more details.
C
C You should have received a copy of the GNU General Public 
C License along with this program; if not, write to the Free 
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge, 
C MA 02139, USA.
C
C Correspondence concerning ESO-MIDAS should be addressed as follows:
C	Internet e-mail: midas@eso.org
C	Postal address: European Southern Observatory
C			Data Management Division 
C			Karl-Schwarzschild-Strasse 2
C			D 85748 Garching bei Muenchen 
C			GERMANY
C===========================================================================

C ++++++++++++++++++++++++  STD.FOR +++++++++++++++++++++++++++++++++++++++
C .LANGUAGE Fortran 77
C .IDENTIFICATION Module STD.FOR
C .COMMENTS
C Module contains layer between the keyword related FORTRAN STxxxx interfaces
C and the SC_interfaces written in (hopefully independent) C
C .AUTHOR         K. Banse        ESO - Garching
C .KEYWORDS       standard interfaces.
C .ENVIRONMENT    FORTRAN and C standards
C .VERSION  [1.00] 871207:  created from SXFTOC.C
C -----------------------------------------------------------------------------
C
      SUBROUTINE STDRDI(NO,DESCR,FELEM,MAXVALS,ACTVALS,VALUES,DUNIT,
     +                  DNULL,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR        
      INTEGER     FELEM, MAXVALS, ACTVALS
      INTEGER     VALUES(*)
      INTEGER     DUNIT, DNULL
      INTEGER    STATUS
C 
      DUNIT = 0
      DNULL = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDR2I(MAXVALS,ACTVALS,VALUES,STATUS)
C
      RETURN
      END
C
      SUBROUTINE STDRDL(NO,DESCR,FELEM,MAXVALS,ACTVALS,VALUES,DUNIT,
     +                  DNULL,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR        
      INTEGER     FELEM, MAXVALS, ACTVALS
      INTEGER     VALUES(*)
      INTEGER     DUNIT, DNULL
      INTEGER    STATUS
C 
      DUNIT = 0
      DNULL = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDR2L(MAXVALS,ACTVALS,VALUES,STATUS)
C
      RETURN
      END
C
      SUBROUTINE STDRDR(NO,DESCR,FELEM,MAXVALS,ACTVALS,VALUES,DUNIT,
     +                  DNULL,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR        
      INTEGER     FELEM, MAXVALS, ACTVALS
      REAL     VALUES(*)
      INTEGER     DUNIT, DNULL
      INTEGER    STATUS
C 
      DUNIT = 0
      DNULL = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDR2R(MAXVALS,ACTVALS,VALUES,STATUS)
C
      RETURN
      END
C
      SUBROUTINE STDRDD(NO,DESCR,FELEM,MAXVALS,ACTVALS,VALUES,DUNIT,
     +                  DNULL,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR        
      INTEGER     FELEM, MAXVALS, ACTVALS
      DOUBLE PRECISION     VALUES(*)
      INTEGER     DUNIT, DNULL
      INTEGER    STATUS
C 
      DUNIT = 0
      DNULL = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDR2D(MAXVALS,ACTVALS,VALUES,STATUS)
C
      RETURN
      END
C 
C
      SUBROUTINE STDRDC(NO,DESCR,NOELM,FELEM,MAXVALS,ACTVALS,VALUES,
     +                  DUNIT,DNULL,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR        
      INTEGER     NOELM, FELEM, MAXVALS, ACTVALS
      CHARACTER   VALUES(*)
      INTEGER     DUNIT, DNULL
      INTEGER    STATUS
C 
      DUNIT = 0
      DNULL = 0
      CALL STD1(NO,DESCR,NOELM,FELEM)
      CALL STDR2C(MAXVALS,ACTVALS,VALUES,STATUS)
C
      RETURN
      END
C 
C
      SUBROUTINE STDRDH(NO,DESCR,FELEM,MAXVALS,ACTVALS,VALUES,
     +                  TOTAL,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR        
      INTEGER     TOTAL, FELEM, MAXVALS, ACTVALS
      CHARACTER   VALUES(*)
      INTEGER    STATUS
C 
      CALL STD1(NO,DESCR,NOELM,FELEM)
      CALL STDR2H(MAXVALS,ACTVALS,VALUES,TOTAL,STATUS)
C
      RETURN
      END
C 

      SUBROUTINE STDFND(NO,DESCR,TYPE,NOELEM,BYTELEM,STATUS)
C 
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      CHARACTER   TYPE(*)
      INTEGER     NOELEM, BYTELEM
      INTEGER     STATUS
C
      CALL STD1(NO,DESCR,0,0)
      CALL STDFN2(TYPE,NOELEM,BYTELEM,STATUS)
C
      RETURN
      END
C
C 
      SUBROUTINE STDINF(NO,NPOS,FIELD,BUF,NUMBUF,STATUS)
C 
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER   BUF(*)
      INTEGER     NPOS, FIELD, NUMBUF
      INTEGER     STATUS
C
      CALL STD1(NO,'dummy',0,NPOS)
      CALL STDIF2(FIELD,BUF,NUMBUF,STATUS)
C
      RETURN
      END
C
C
      SUBROUTINE STDRDX(NO,FLAG,DESCR,TYPE,BYTEL,NOEL,HNC,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      CHARACTER   TYPE(*)
      INTEGER     FLAG, BYTEL, NOEL, HNC
      INTEGER     STATUS
C
      CALL STD1(NO,'dummy',0,FLAG)
      CALL STD2(BYTEL,NOEL,HNC)
      CALL STDRX2(DESCR,TYPE,STATUS)
C
      RETURN
      END


      SUBROUTINE STDWRC(NO,DESCR,NOELM,VALUES,FELEM,MAXVALS,
     +                  DUNIT,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      INTEGER     NOELM, FELEM, MAXVALS
      CHARACTER   VALUES(*)
      INTEGER     DUNIT
      INTEGER     STATUS
C
      DUNIT = 0
      CALL STD1(NO,DESCR,NOELM,FELEM)
      CALL STDW2C(MAXVALS,VALUES,STATUS)
C
      RETURN
      END


      SUBROUTINE STDWRD(NO,DESCR,VALUES,FELEM,MAXVALS,DUNIT,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      INTEGER     FELEM, MAXVALS
      DOUBLE PRECISION     VALUES(*)
      INTEGER     DUNIT
      INTEGER     STATUS
C
      DUNIT = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDW2D(MAXVALS,VALUES,STATUS)
C
      RETURN
      END


      SUBROUTINE STDWRH(NO,DESCR,VALUES,FELEM,MAXVALS,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      INTEGER     FELEM, MAXVALS
      CHARACTER     VALUES(*)
      INTEGER     DUNIT
      INTEGER     STATUS
C
      DUNIT = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDW2H(MAXVALS,VALUES,STATUS)
C
      RETURN
      END


      SUBROUTINE STDWRI(NO,DESCR,VALUES,FELEM,MAXVALS,DUNIT,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      INTEGER     FELEM, MAXVALS
      INTEGER     VALUES(*)
      INTEGER     DUNIT
      INTEGER     STATUS
C
      DUNIT = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDW2I(MAXVALS,VALUES,STATUS)
C
      RETURN
      END


      SUBROUTINE STDWRL(NO,DESCR,VALUES,FELEM,MAXVALS,DUNIT,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      INTEGER     FELEM, MAXVALS
      INTEGER     VALUES(*)
      INTEGER     DUNIT
      INTEGER     STATUS
C
      DUNIT = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDW2L(MAXVALS,VALUES,STATUS)
C
      RETURN
      END


      SUBROUTINE STDWRR(NO,DESCR,VALUES,FELEM,MAXVALS,DUNIT,STATUS)
C
      IMPLICIT NONE
C
      INTEGER     NO
      CHARACTER*(*)   DESCR
      INTEGER     FELEM, MAXVALS
      REAL     VALUES(*)
      INTEGER     DUNIT
      INTEGER     STATUS
C
      DUNIT = 0
      CALL STD1(NO,DESCR,0,FELEM)
      CALL STDW2R(MAXVALS,VALUES,STATUS)
C
      RETURN
      END


