C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_BDAT         **
C**************************
C
C
      BLOCK DATA LDM_BDAT
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Initialisation of LDM parameters
C
C Author:  John W. Campbell, June 1993
C
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
      INCLUDE 'ldm_derived.finc'
      INCLUDE 'ldm_lrl.finc'
      INCLUDE 'ldm_extended.finc'
C
C====== Parameter statements
C 
      INCLUDE 'ldm_defaults.finc'
      INTEGER NPK, NPL, NPS
      PARAMETER (NPK=LDM_MAXPK)
      PARAMETER (NPL=LDM_MAXPK*LDM_MAXPL)
      PARAMETER (NPS=NPL*LDM_MAXSPD)
      REAL MMRX, MMRY
      PARAMETER (MMRX=1000.0/DF_RAST)
      PARAMETER (MMRY=MMRX*DF_YSCAL)
C
C====== DATA:
C
      DATA CRYST/DF_CRYST/, IS_CRYST/DF_IS_CRYST/, CH_CRYST/0/
      DATA TITLE/DF_TITLE/, IS_TITLE/DF_IS_TITLE/, CH_TITLE/0/
      DATA SYST/DF_SYST/, IS_SYST/DF_IS_SYST/, CH_SYST/0/
      DATA LATT/DF_LATT/, IS_LATT/DF_IS_LATT/, CH_LATT/0/
      DATA SPGNAM/DF_SPGNAM/, PGNAM/DF_PGNAM/
      DATA NSPGRP/DF_NSPGRP/, NSYMP/DF_NSYMP/, NSYM/DF_NSYM/
      DATA ROTSYM/3072*DF_ROTSYM/
      DATA IS_SYMM/DF_IS_SYMM/, CH_SYMM/0/
      DATA BEAM/DF_BEAM/, IS_BEAM/DF_IS_BEAM/, CH_BEAM/0/
      DATA ROT/DF_ROT/, IS_ROT/DF_IS_ROT/, CH_ROT/0/
      DATA IMTYP/DF_IMTYP/, IS_IMTYP/DF_IS_IMTYP/, CH_IMTYP/0/
      DATA IMDAT/DF_IMDAT/, IS_IMDAT/DF_IS_IMDAT/, CH_IMDAT/0/
      DATA IMDAT_STR/DF_IMDAT_STR/
      DATA DGEOM/DF_DGEOM/, IS_DGEOM/DF_IS_DGEOM/, CH_DGEOM/0/
      DATA AXORD/DF_AXORD/, IS_AXORD/DF_IS_AXORD/, CH_AXORD/0/
      DATA FIDT/DF_FIDT/, IS_FIDT/DF_IS_FIDT/, CH_FIDT/0/
      DATA FIDX1/DF_FIDX1/, IS_FIDX1/DF_IS_FIDX1/, CH_FIDX1/0/,
     +     ND_FIDX1/DF_ND_FIDX1/        
      DATA FIDY1/DF_FIDY1/, IS_FIDY1/DF_IS_FIDY1/, CH_FIDY1/0/,
     +     ND_FIDY1/DF_ND_FIDY1/        
      DATA FIDX2/DF_FIDX2/, IS_FIDX2/DF_IS_FIDX2/, CH_FIDX2/0/,
     +     ND_FIDX2/DF_ND_FIDX2/ 
      DATA FIDY2/DF_FIDY2/, IS_FIDY2/DF_IS_FIDY2/, CH_FIDY2/0/, 
     +     ND_FIDY2/DF_ND_FIDY2/
      DATA FIDX3/DF_FIDX3/, IS_FIDX3/DF_IS_FIDX3/, CH_FIDX3/0/,
     +     ND_FIDX3/DF_ND_FIDX3/
      DATA FIDY3/DF_FIDY3/, IS_FIDY3/DF_IS_FIDY3/, CH_FIDY3/0/,
     +     ND_FIDY3/DF_ND_FIDY3/ 
      DATA NXRAS/DF_NXRAS/, IS_NXRAS/DF_IS_NXRAS/, CH_NXRAS/0/
      DATA NYRAS/DF_NYRAS/, IS_NYRAS/DF_IS_NYRAS/, CH_NYRAS/0/
      DATA RAST/DF_RAST/, IS_RAST/DF_IS_RAST/, CH_RAST/0/,
     +     ND_RAST/DF_ND_RAST/
      DATA RMIN/DF_RMIN/, IS_RMIN/DF_IS_RMIN/, CH_RMIN/0/,
     +     ND_RMIN/DF_ND_RMIN/
      DATA RMAX/DF_RMAX/, IS_RMAX/DF_IS_RMAX/, CH_RMAX/0/,
     +     ND_RMAX/DF_ND_RMAX/
      DATA XLOW/DF_XLOW/, IS_XLOW/DF_IS_XLOW/, CH_XLOW/0/,
     +     ND_XLOW/DF_ND_XLOW/
      DATA XHIGH/DF_XHIGH/, IS_XHIGH/DF_IS_XHIGH/, CH_XHIGH/0/,
     +     ND_XHIGH/DF_ND_XHIGH/
      DATA YLOW/DF_YLOW/, IS_YLOW/DF_IS_YLOW/, CH_YLOW/0/,
     +     ND_YLOW/DF_ND_YLOW/
      DATA YHIGH/DF_YHIGH/, IS_YHIGH/DF_IS_YHIGH/, CH_YHIGH/0/,
     +     ND_YHIGH/DF_ND_YHIGH/
      DATA DSTOR/DF_DSTOR/, IS_DSTOR/DF_IS_DSTOR/, CH_DSTOR/0/
      DATA FTHR/DF_FTHR/, IS_FTHR/DF_IS_FTHR/, CH_FTHR/0/,
     +     ND_FTHR/DF_ND_FTHR/
      DATA FBOX/DF_FBOX/, IS_FBOX/DF_IS_FBOX/, CH_FBOX/0/,
     +     ND_FBOX/DF_ND_FBOX/
      DATA STHR/DF_STHR/, IS_STHR/DF_IS_STHR/, CH_STHR/0/,
     +     ND_STHR/DF_ND_STHR/
      DATA OVPIX/DF_OVPIX/, IS_OVPIX/DF_IS_OVPIX/, CH_OVPIX/0/
      DATA NUMP/DF_NUMP/, IS_NUMP/DF_IS_NUMP/, CH_NUMP/0/
      DATA NPLAT/DF_NPLAT/, IS_NPLAT/DF_IS_NPLAT/, CH_NPLAT/0/
      DATA TEMPL/DF_TEMPL/, IS_TEMPL/DF_IS_TEMPL/, CH_TEMPL/0/
      DATA EPS/DF_EPS/, IS_EPS/DF_IS_EPS/, CH_EPS/0/,
     +     ND_EPS/DF_ND_EPS/
      DATA DTILT/DF_DTILT/, IS_DTILT/DF_IS_DTILT/, CH_DTILT/0/,
     +     ND_DTILT/DF_ND_DTILT/
      DATA N1OD/DF_N1OD/, IS_N1OD/DF_IS_N1OD/, CH_N1OD/0/
      DATA G1OD/DF_G1OD/, IS_G1OD/DF_IS_G1OD/, CH_G1OD/0/,
     +     ND_G1OD/DF_ND_G1OD/
      DATA BASE/DF_BASE/, IS_BASE/DF_IS_BASE/, CH_BASE/0/,
     +     ND_BASE/DF_ND_BASE/
      DATA NONL/DF_NONL/, IS_NONL/DF_IS_NONL/, CH_NONL/0/,
     +     ND_NONL/DF_ND_NONL/
      DATA DSPIN/DF_DSPIN/, IS_DSPIN/DF_IS_DSPIN/, CH_DSPIN/0/,
     +     ND_DSPIN/DF_ND_DSPIN/
      DATA SPIN/NPK*DF_SPIN/, IS_SPIN/NPK*DF_IS_SPIN/, CH_SPIN/NPK*0/,
     +     ND_SPIN/NPK*DF_ND_SPIN/, INIT_SPIN/.FALSE./
      DATA PID/NPK*DF_PID/, IS_PID/NPK*DF_IS_PID/, CH_PID/NPK*0/,
     +     INIT_PID/.FALSE./
      DATA KEYP/NPK*DF_KEYP/, IS_KEYP/NPK*DF_IS_KEYP/, CH_KEYP/NPK*0/
      DATA FNAME/NPL*DF_FNAME/, IS_FNAME/NPL*DF_IS_FNAME/, 
     +     CH_FNAME/NPL*0/
      DATA XCENF/NPL*DF_XCENF/, IS_XCENF/NPL*DF_IS_XCENF/, 
     +     CH_XCENF/NPL*0/, ND_XCENF/NPL*DF_ND_XCENF/
      DATA YCENF/NPL*DF_YCENF/, IS_YCENF/NPL*DF_IS_YCENF/, 
     +     CH_YCENF/NPL*0/, ND_YCENF/NPL*DF_ND_YCENF/
      DATA SPAC/NPL*DF_SPAC/, IS_SPAC/NPL*DF_IS_SPAC/, 
     +     CH_SPAC/NPL*0/, ND_SPAC/NPL*DF_ND_SPAC/
      DATA A/DF_A/, IS_A/DF_IS_A/, CH_A/0/, ND_A/DF_ND_A/
      DATA B/DF_B/, IS_B/DF_IS_B/, CH_B/0/, ND_B/DF_ND_B/
      DATA C/DF_C/, IS_C/DF_IS_C/, CH_C/0/, ND_C/DF_ND_C/
      DATA ALPHA/DF_ALPHA/, IS_ALPHA/DF_IS_ALPHA/, CH_ALPHA/0/,
     +     ND_ALPHA/DF_ND_ALPHA/
      DATA BETA/DF_BETA/, IS_BETA/DF_IS_BETA/, CH_BETA/0/,
     +     ND_BETA/DF_ND_BETA/
      DATA GAMMA/DF_GAMMA/, IS_GAMMA/DF_IS_GAMMA/, CH_GAMMA/0/,
     +     ND_GAMMA/DF_ND_GAMMA/
      DATA LMIN/NPK*DF_LMIN/, IS_LMIN/NPK*DF_IS_LMIN/, CH_LMIN/NPK*0/,
     +     ND_LMIN/NPK*DF_ND_LMIN/
      DATA LMAX/NPK*DF_LMAX/, IS_LMAX/NPK*DF_IS_LMAX/, CH_LMAX/NPK*0/,
     +     ND_LMAX/NPK*DF_ND_LMAX/
      DATA DMIN/NPK*DF_DMIN/, IS_DMIN/NPK*DF_IS_DMIN/, CH_DMIN/NPK*0/,
     +     ND_DMIN/NPK*DF_ND_DMIN/
      DATA PHIX/NPK*DF_PHIX/, IS_PHIX/NPK*DF_IS_PHIX/, CH_PHIX/NPK*0/,
     +     ND_PHIX/NPK*DF_ND_PHIX/
      DATA PHIY/NPK*DF_PHIY/, IS_PHIY/NPK*DF_IS_PHIY/, CH_PHIY/NPK*0/,
     +     ND_PHIY/NPK*DF_ND_PHIY/
      DATA PHIZ/NPK*DF_PHIZ/, IS_PHIZ/NPK*DF_IS_PHIZ/, CH_PHIZ/NPK*0/,
     +     ND_PHIZ/NPK*DF_ND_PHIZ/
      DATA CTOF/NPL*DF_CTOF/, IS_CTOF/NPL*DF_IS_CTOF/, CH_CTOF/NPL*0/,
     +     ND_CTOF/NPL*DF_ND_CTOF/
      DATA YSCAL/NPL*DF_YSCAL/, IS_YSCAL/NPL*DF_IS_YSCAL/, 
     +     CH_YSCAL/NPL*0/, ND_YSCAL/NPL*DF_ND_YSCAL/
      DATA SPOTL/NPL*DF_SPOTL/, IS_SPOTL/NPL*DF_IS_SPOTL/, 
     +     CH_SPOTL/NPL*0/, ND_SPOTL/NPL*DF_ND_SPOTL/
      DATA SPOTW/NPL*DF_SPOTW/, IS_SPOTW/NPL*DF_IS_SPOTW/, 
     +     CH_SPOTW/NPL*0/, ND_SPOTW/NPL*DF_ND_SPOTW/
      DATA SPOTF/NPL*DF_SPOTF/, IS_SPOTF/NPL*DF_IS_SPOTF/, 
     +     CH_SPOTF/NPL*0/, ND_SPOTF/NPL*DF_ND_SPOTF/
      DATA SPOTB/NPL*DF_SPOTB/, IS_SPOTB/NPL*DF_IS_SPOTB/, 
     +     CH_SPOTB/NPL*0/, ND_SPOTB/NPL*DF_ND_SPOTB/
      DATA SPOTD/NPL*DF_SPOTD/, IS_SPOTD/NPL*DF_IS_SPOTD/, 
     +     CH_SPOTD/NPL*0/, ND_SPOTD/NPL*DF_ND_SPOTD/
      DATA XC/NPL*DF_XC/, IS_XC/NPL*DF_IS_XC/, CH_XC/NPL*0/,
     +     ND_XC/NPL*DF_ND_XC/
      DATA YC/NPL*DF_YC/, IS_YC/NPL*DF_IS_YC/, CH_YC/NPL*0/,
     +     ND_YC/NPL*DF_ND_YC/
      DATA WC/NPL*DF_WC/, IS_WC/NPL*DF_IS_WC/, CH_WC/NPL*0/,
     +     ND_WC/NPL*DF_ND_WC/
      DATA TWIST/NPL*DF_TWIST/, IS_TWIST/NPL*DF_IS_TWIST/, 
     +     CH_TWIST/NPL*0/, ND_TWIST/NPL*DF_ND_TWIST/
      DATA TILT/NPL*DF_TILT/, IS_TILT/NPL*DF_IS_TILT/, 
     +     CH_TILT/NPL*0/, ND_TILT/NPL*DF_ND_TILT/
      DATA BULGE/NPL*DF_BULGE/, IS_BULGE/NPL*DF_IS_BULGE/, 
     +     CH_BULGE/NPL*0/, ND_BULGE/NPL*DF_ND_BULGE/
      DATA ROFF/NPL*DF_ROFF/, IS_ROFF/NPL*DF_IS_ROFF/, 
     +     CH_ROFF/NPL*0/, ND_ROFF/NPL*DF_ND_ROFF/
      DATA TOFF/NPL*DF_TOFF/, IS_TOFF/NPL*DF_IS_TOFF/, 
     +     CH_TOFF/NPL*0/, ND_TOFF/NPL*DF_ND_TOFF/
      DATA SPDXY/NPL*DF_SPDXY/, IS_SPDXY/NPL*DF_IS_SPDXY/,
     +     CH_SPDXY/NPL*0/, ND_SPDXY/NPL*DF_ND_SPDXY/
      DATA SPDXN/NPL*DF_SPDXN/, IS_SPDXN/NPL*DF_IS_SPDXN/, 
     +     CH_SPDXN/NPL*0/
      DATA SPDXMIN/NPL*DF_SPDXMIN/, IS_SPDXMIN/NPL*DF_IS_SPDXMIN/, 
     +     CH_SPDXMIN/NPL*0/, ND_SPDXMIN/NPL*DF_ND_SPDXMIN/
      DATA SPDXMAX/NPL*DF_SPDXMAX/, IS_SPDXMAX/NPL*DF_IS_SPDXMAX/, 
     +     CH_SPDXMAX/NPL*0/, ND_SPDXMAX/NPL*DF_ND_SPDXMAX/
      DATA SPDX/NPS*DF_SPDX/, IS_SPDX/NPS*DF_IS_SPDX/, 
     +     CH_SPDX/NPS*0/, ND_SPDX/NPS*DF_ND_SPDX/
      DATA SPDYN/NPL*DF_SPDYN/, IS_SPDYN/NPL*DF_IS_SPDYN/,
     +     CH_SPDYN/NPL*0/
      DATA SPDYMIN/NPL*DF_SPDYMIN/, IS_SPDYMIN/NPL*DF_IS_SPDYMIN/, 
     +     CH_SPDYMIN/NPL*0/, ND_SPDYMIN/NPL*DF_ND_SPDYMIN/
      DATA SPDYMAX/NPL*DF_SPDYMAX/, IS_SPDYMAX/NPL*DF_IS_SPDYMAX/, 
     +     CH_SPDYMAX/NPL*0/, ND_SPDYMAX/NPL*DF_ND_SPDYMAX/
      DATA SPDY/NPS*DF_SPDY/, IS_SPDY/NPS*DF_IS_SPDY/, 
     +     CH_SPDY/NPS*0/, ND_SPDY/NPS*DF_ND_SPDY/
      DATA RFL/NPL*DF_RFL/, IS_RFL/NPL*DF_IS_RFL/, CH_RFL/NPL*0/
C
C====== Parameter changes mask & flag
C
      DATA CH_MASK/0/
C
C====== Derived parameters
C
      DATA COS_DTILT/1.0/, SIN_DTILT/0.0/
      DATA ISYS/0/, KSYS/3*0/, IDGEOM/1/
C
C====== LRL flags
C
      DATA PKGEN/-1/, PLGEN/-1/
      DATA PKMTX/-1/, PLMTX/-1/
      DATA PKOVL/-1/, PLOVL/-1/
C
C====== Extended LDM flags
C
      DATA EXTENDED /.FALSE./
      DATA KDX_EXT /-1/
C
C-------------------------------------------------------------------------------
C
      END
