C   30/01/79 C9101501   MEMBER NAME  LGDCPF   (SOURCE)      FORTRAN
      SUBROUTINE LGDCPF( NP, LGER1)
C
C     S.YAMADA     26-01-79  17:30
C     LAST MODIFICATION  30-01-78  21:35
C
C---- VERSION FOR BOS DATA.  COMPATIBLE WITH THE FINAL NORD-DATA-FORMAT
C
C---- COPIES RAW DATA FROM 'ALGN' TO /CWORK/.
C     BOTH FORMAT CONVERSION AND CALIBRATION ARE SUPPOSED TO BE DONE.
C
C---- OUTPUT:   NP=THE POINTER TO THE 'ALGN'-BANK.
C               LGER1=ERROR CODE,(=0 IF NO ERROR)
C
      IMPLICIT INTEGER *2 (H)
      COMMON /CDATA/ ID(6000)
      INTEGER *2 HD(12000)
      EQUIVALENCE (HD(1),ID(1))
C
#include "clgwork1.for"
      DATA JMAX/4000/
C
      COMMON /CMSGCT/ MSGDUM(10),LGMMAX,LGMSG1,LGMSG2,LGMSG3,LGMSG4
      COMMON/ CLGVRN/ NVRSN(20)
      DATA NVCODE/179012617/
      NVRSN(1) = NVCODE
C
C---- LOOK FOR THE POINTER OF THE LG-DATA
      LNG = 0
      LGER1 = 0
      NP = ID(75)
      IF(NP.LT.100) GO TO 90
C
C---- FOR THE INPUT DATA ID(NP)=# OF DATA IN HBD INCLUDING SUB-POINTERS
C     AND THE NORD-STATUS WORD.
      LNG = ID(NP)
      NNP = NP+NP
C
C---- EXAMINE IF FORMAT CHANGE IS ALREADY DONE.
C---- ONE CAN ALSO CHECK HBD(HNP+1)
C
      IF(HD(NNP+1)-100) 91,200,200
C
C---- FORMAT IS ALREADY CHANGED.
C     DATA IS SIMPLY COPIED  AFTER THE LENGTH CHECK.
  200 LNGC = 4*LNG
      IF(LNGC.LE.8012) GO TO 201
      LNGC = 8012
  201 CALL MVCL(HNORD,0,HD,4*NP,LNGC)
      IF(2003-LNG) 92,100,100
C
C---- ERROR
   90 LGER1 = 1
      MESERR = NP
      GO TO 900
C
   91 LGER1 = 2
      MESERR = HPOINT(1)
      GO TO 900
C
   92 LGER1 = 3
      MESERR = LNG
C
  900 IF(LGMSG1) 100,901,901
  901 LGMSG1 = LGMSG1+1
      IF(LGMSG1.LE.LGMMAX) WRITE(6,690) LGER1,MESERR
  690 FORMAT('0 **** ERROR IN LGDCPY ****,LGER1=',I3,'   PARM=',I5)
C
  100 RETURN
      END
