module trdatbuf_obj
  !
  ! **generated by gensis_f90.py -- do not edit!
  !
  ! module to define the trdatbuf data type -- container variable
  !    for trdat data (transp physics input data -- diagnostic, measured data)
  !
  ! only a data type is defined here...
 
  integer, parameter, private :: MIMPS = 8
  integer, parameter, private :: MIMPT = 300
 
  type trdatbuf
 
    real*8, dimension(:), pointer :: DATBUF
    integer :: LADR_ZA
    integer :: LADR_ZAF
    integer :: LAEPDE
    integer :: LAEPDP
    integer :: LAEPE
    integer :: LAEPMAP
    integer :: LAEPMU
    integer :: LAEPP
    integer :: LAEPSP
    integer :: LAEPTS
    integer :: LAIMPS
    integer :: LAIMPX
    integer :: LBX(8)
    integer :: LDATALP
    integer :: LDATBDI
    integer :: LDATCUR
    integer :: LDATDFL
    integer :: LDATDTG
    integer :: LDATDTS
    integer :: LDATDTX
    integer :: LDATEDI
    integer :: LDATEHP
    integer :: LDATELI
    integer :: LDATFGW
    integer :: LDATFIE
    integer :: LDATFMN
    integer :: LDATFMX
    integer :: LDATGAS
    integer :: LDATGF3
    integer :: LDATGF4
    integer :: LDATGF6
    integer :: LDATGFD
    integer :: LDATGFH
    integer :: LDATGFT
    integer :: LDATGIE
    integer :: LDATHAL
    integer :: LDATIBM
    integer :: LDATIEC
    integer :: LDATIIC
    integer :: LDATILH
    integer :: LDATL2B
    integer :: LDATLAD
    integer :: LDATLID
    integer :: LDATNTX
    integer :: LDATOGF
    integer :: LDATORC
    integer :: LDATPBE
    integer :: LDATPBI
    integer :: LDATPEB
    integer :: LDATPEC
    integer :: LDATPF0
    integer :: LDATPFH
    integer :: LDATPFL
    integer :: LDATPIB
    integer :: LDATPIC
    integer :: LDATPLF
    integer :: LDATPLH
    integer :: LDATPOS
    integer :: LDATRBZ
    integer :: LDATRC3
    integer :: LDATRC4
    integer :: LDATRC6
    integer :: LDATRCD
    integer :: LDATRCH
    integer :: LDATRCT
    integer :: LDATRCY
    integer :: LDATRMN
    integer :: LDATRTP
    integer :: LDATSBT
    integer :: LDATSF3
    integer :: LDATSFA
    integer :: LDATSFL
    integer :: LDATSFP
    integer :: LDATSFT
    integer :: LDATSP3
    integer :: LDATTET
    integer :: LDATTGF
    integer :: LDATTIT
    integer :: LDATTPI
    integer :: LDATTQT
    integer :: LDATTRC
    integer :: LDATTRF
    integer :: LDATTXI
    integer :: LDATVPH
    integer :: LDATVSB
    integer :: LDATVSF
    integer :: LDATXKF
    integer :: LDATZEF
    integer :: LDATZFA
    integer :: LDATZIM
    integer :: LDATZPL
    integer :: LDMDF
    integer :: LDMFR
    integer :: LDMMX
    integer :: LDMSE
    integer :: LDPFC
    integer :: LDPFC_PRE
    integer :: LEFD0
    integer :: LEFDB
    integer :: LEFDP
    integer :: LEFDQ
    integer :: LEFDR
    integer :: LEFDS
    integer :: LFAEPA
    integer :: LFAEPP
    integer :: LFAXR
    integer :: LFBOL
    integer :: LFBPA
    integer :: LFBPB
    integer :: LFD2F
    integer :: LFDE2
    integer :: LFDF3
    integer :: LFDF4
    integer :: LFDF6
    integer :: LFDFD
    integer :: LFDFH
    integer :: LFDFT
    integer :: LFECA
    integer :: LFECB
    integer :: LFECF
    integer :: LFFD0
    integer :: LFFDB
    integer :: LFFDP
    integer :: LFFDQ
    integer :: LFFDR
    integer :: LFFDS
    integer :: LFFEH
    integer :: LFFEL
    integer :: LFGRB
    integer :: LFIBE
    integer :: LFIBI
    integer :: LFJBM
    integer :: LFJEC
    integer :: LFJIC
    integer :: LFLF3
    integer :: LFLF4
    integer :: LFLF6
    integer :: LFLFD
    integer :: LFLFH
    integer :: LFLFT
    integer :: LFLHE
    integer :: LFLHJ
    integer :: LFMSE
    integer :: LFNER
    integer :: LFNI3
    integer :: LFNI4
    integer :: LFNI6
    integer :: LFNID
    integer :: LFNIH
    integer :: LFNIM
    integer :: LFNIT
    integer :: LFNMR
    integer :: LFOMG
    integer :: LFPRS
    integer :: LFPSI
    integer :: LFQBE
    integer :: LFQBI
    integer :: LFQEC
    integer :: LFQIC
    integer :: LFQPR
    integer :: LFREE
    integer :: LFREE_W
    integer :: LFRES
    integer :: LFRQRFF
    integer :: LFSBI
    integer :: LFSIM(MIMPT)
    integer :: LFSYAXR
    integer :: LFSYBOL
    integer :: LFSYBPA
    integer :: LFSYBPB
    integer :: LFSYD2F
    integer :: LFSYDE2
    integer :: LFSYDF3
    integer :: LFSYDF4
    integer :: LFSYDF6
    integer :: LFSYDFD
    integer :: LFSYDFH
    integer :: LFSYDFT
    integer :: LFSYECF
    integer :: LFSYFEH
    integer :: LFSYFEL
    integer :: LFSYGRB
    integer :: LFSYIBE
    integer :: LFSYIBI
    integer :: LFSYJBM
    integer :: LFSYJEC
    integer :: LFSYJIC
    integer :: LFSYLF3
    integer :: LFSYLF4
    integer :: LFSYLF6
    integer :: LFSYLFD
    integer :: LFSYLFH
    integer :: LFSYLFT
    integer :: LFSYLHE
    integer :: LFSYLHJ
    integer :: LFSYMSE
    integer :: LFSYNER
    integer :: LFSYNI3
    integer :: LFSYNI4
    integer :: LFSYNI6
    integer :: LFSYNID
    integer :: LFSYNIH
    integer :: LFSYNIM
    integer :: LFSYNIT
    integer :: LFSYNMR
    integer :: LFSYOMG
    integer :: LFSYPRS
    integer :: LFSYQBE
    integer :: LFSYQBI
    integer :: LFSYQEC
    integer :: LFSYQIC
    integer :: LFSYQPR
    integer :: LFSYRES
    integer :: LFSYSBI
    integer :: LFSYSIM(MIMPT)
    integer :: LFSYTER
    integer :: LFSYTI2
    integer :: LFSYTQI
    integer :: LFSYV2F
    integer :: LFSYVB2
    integer :: LFSYVC3
    integer :: LFSYVC4
    integer :: LFSYVC6
    integer :: LFSYVCD
    integer :: LFSYVCH
    integer :: LFSYVCT
    integer :: LFSYVEE
    integer :: LFSYVIE
    integer :: LFSYVMO
    integer :: LFSYVP2
    integer :: LFSYVPO
    integer :: LFSYVPR
    integer :: LFSYVTR
    integer :: LFSYZF2
    integer :: LFSYZXR
    integer :: LFTER
    integer :: LFTI2
    integer :: LFTQI
    integer :: LFULNB
    integer :: LFV2F
    integer :: LFVB2
    integer :: LFVC3
    integer :: LFVC4
    integer :: LFVC6
    integer :: LFVCD
    integer :: LFVCH
    integer :: LFVCT
    integer :: LFVEE
    integer :: LFVIE
    integer :: LFVMO
    integer :: LFVP2
    integer :: LFVPO
    integer :: LFVPR
    integer :: LFVTR
    integer :: LFZF2
    integer :: LFZXR
    integer :: LHLFNB
    integer :: LLIM
    integer :: LMOMD
    integer :: LPELDA
    integer :: LPHSLH
    integer :: LPMDF
    integer :: LPMSE
    integer :: LPWREC
    integer :: LPWRLH
    integer :: LPWRNB
    integer :: LPWRRF
    integer :: LRFS
    integer :: LRMFR
    integer :: LRMP_BDY1
    integer :: LRMP_BDY2
    integer :: LRMSE
    integer :: LRP2
    integer :: LRPL
    integer :: LRPSI
    integer :: LSEVENT
    integer :: LSSYAXR
    integer :: LSSYBOL
    integer :: LSSYBPA
    integer :: LSSYBPB
    integer :: LSSYD2F
    integer :: LSSYDE2
    integer :: LSSYDF3
    integer :: LSSYDF4
    integer :: LSSYDF6
    integer :: LSSYDFD
    integer :: LSSYDFH
    integer :: LSSYDFT
    integer :: LSSYECF
    integer :: LSSYFEH
    integer :: LSSYFEL
    integer :: LSSYGRB
    integer :: LSSYIBE
    integer :: LSSYIBI
    integer :: LSSYJBM
    integer :: LSSYJEC
    integer :: LSSYJIC
    integer :: LSSYLF3
    integer :: LSSYLF4
    integer :: LSSYLF6
    integer :: LSSYLFD
    integer :: LSSYLFH
    integer :: LSSYLFT
    integer :: LSSYLHE
    integer :: LSSYLHJ
    integer :: LSSYMSE
    integer :: LSSYNER
    integer :: LSSYNI3
    integer :: LSSYNI4
    integer :: LSSYNI6
    integer :: LSSYNID
    integer :: LSSYNIH
    integer :: LSSYNIM
    integer :: LSSYNIT
    integer :: LSSYNMR
    integer :: LSSYOMG
    integer :: LSSYPRS
    integer :: LSSYQBE
    integer :: LSSYQBI
    integer :: LSSYQEC
    integer :: LSSYQIC
    integer :: LSSYQPR
    integer :: LSSYRES
    integer :: LSSYSBI
    integer :: LSSYSIM(MIMPT)
    integer :: LSSYTER
    integer :: LSSYTI2
    integer :: LSSYTQI
    integer :: LSSYV2F
    integer :: LSSYVB2
    integer :: LSSYVC3
    integer :: LSSYVC4
    integer :: LSSYVC6
    integer :: LSSYVCD
    integer :: LSSYVCH
    integer :: LSSYVCT
    integer :: LSSYVEE
    integer :: LSSYVIE
    integer :: LSSYVMO
    integer :: LSSYVP2
    integer :: LSSYVPO
    integer :: LSSYVPR
    integer :: LSSYVTR
    integer :: LSSYZF2
    integer :: LSSYZXR
    integer :: LTABORT
    integer :: LTAEP
    integer :: LTFD0
    integer :: LTFDB
    integer :: LTFDP
    integer :: LTFDQ
    integer :: LTFDR
    integer :: LTFDS
    integer :: LTHFS
    integer :: LTIME1
    integer :: LTIME2
    integer :: LTIMEC
    integer :: LTIMECA
    integer :: LTIMECB
    integer :: LTIMLH
    integer :: LTIMNB
    integer :: LTIMRF
    integer :: LTIMRFF
    integer :: LTPSI
    integer :: LTSAW
    integer :: LVLTNB
    integer :: LXAXR
    integer :: LXBOL
    integer :: LXBPA
    integer :: LXBPB
    integer :: LXD2F
    integer :: LXDE2
    integer :: LXDF3
    integer :: LXDF4
    integer :: LXDF6
    integer :: LXDFD
    integer :: LXDFH
    integer :: LXDFT
    integer :: LXECF
    integer :: LXFD0
    integer :: LXFDB
    integer :: LXFDP
    integer :: LXFDQ
    integer :: LXFDR
    integer :: LXFDS
    integer :: LXFEH
    integer :: LXFEL
    integer :: LXFS
    integer :: LXGRB
    integer :: LXIBE
    integer :: LXIBI
    integer :: LXJBM
    integer :: LXJEC
    integer :: LXJIC
    integer :: LXLF3
    integer :: LXLF4
    integer :: LXLF6
    integer :: LXLFD
    integer :: LXLFH
    integer :: LXLFT
    integer :: LXLHE
    integer :: LXLHJ
    integer :: LXMMX
    integer :: LXMSE
    integer :: LXNER
    integer :: LXNI3
    integer :: LXNI4
    integer :: LXNI6
    integer :: LXNID
    integer :: LXNIH
    integer :: LXNIM
    integer :: LXNIT
    integer :: LXNMR
    integer :: LXOMG
    integer :: LXPFC
    integer :: LXPRS
    integer :: LXQBE
    integer :: LXQBI
    integer :: LXQEC
    integer :: LXQIC
    integer :: LXQPR
    integer :: LXRES
    integer :: LXRP2
    integer :: LXRPL
    integer :: LXSBI
    integer :: LXSIM(MIMPS)
    integer :: LXSYAXR
    integer :: LXSYBOL
    integer :: LXSYBPA
    integer :: LXSYBPB
    integer :: LXSYD2F
    integer :: LXSYDE2
    integer :: LXSYDF3
    integer :: LXSYDF4
    integer :: LXSYDF6
    integer :: LXSYDFD
    integer :: LXSYDFH
    integer :: LXSYDFT
    integer :: LXSYECF
    integer :: LXSYFEH
    integer :: LXSYFEL
    integer :: LXSYGRB
    integer :: LXSYIBE
    integer :: LXSYIBI
    integer :: LXSYJBM
    integer :: LXSYJEC
    integer :: LXSYJIC
    integer :: LXSYLF3
    integer :: LXSYLF4
    integer :: LXSYLF6
    integer :: LXSYLFD
    integer :: LXSYLFH
    integer :: LXSYLFT
    integer :: LXSYLHE
    integer :: LXSYLHJ
    integer :: LXSYMSE
    integer :: LXSYNER
    integer :: LXSYNI3
    integer :: LXSYNI4
    integer :: LXSYNI6
    integer :: LXSYNID
    integer :: LXSYNIH
    integer :: LXSYNIM
    integer :: LXSYNIT
    integer :: LXSYNMR
    integer :: LXSYOMG
    integer :: LXSYPRS
    integer :: LXSYQBE
    integer :: LXSYQBI
    integer :: LXSYQEC
    integer :: LXSYQIC
    integer :: LXSYQPR
    integer :: LXSYRES
    integer :: LXSYSBI
    integer :: LXSYSIM(MIMPS)
    integer :: LXSYTER
    integer :: LXSYTI2
    integer :: LXSYTQI
    integer :: LXSYV2F
    integer :: LXSYVB2
    integer :: LXSYVC3
    integer :: LXSYVC4
    integer :: LXSYVC6
    integer :: LXSYVCD
    integer :: LXSYVCH
    integer :: LXSYVCT
    integer :: LXSYVEE
    integer :: LXSYVIE
    integer :: LXSYVMO
    integer :: LXSYVP2
    integer :: LXSYVPO
    integer :: LXSYVPR
    integer :: LXSYVTR
    integer :: LXSYZF2
    integer :: LXSYZXR
    integer :: LXTER
    integer :: LXTI2
    integer :: LXTQI
    integer :: LXV2F
    integer :: LXVB2
    integer :: LXVC3
    integer :: LXVC4
    integer :: LXVC6
    integer :: LXVCD
    integer :: LXVCH
    integer :: LXVCT
    integer :: LXVEE
    integer :: LXVIE
    integer :: LXVMO
    integer :: LXVP2
    integer :: LXVPO
    integer :: LXVPR
    integer :: LXVTR
    integer :: LXZF2
    integer :: LXZIMPS
    integer :: LXZIMPX
    integer :: LXZIMPXS
    integer :: LXZXR
    integer :: LYRP2
    integer :: LYRPL
    integer :: LYSIM
    integer :: LZFS
    integer :: LZPSI
    integer :: MMAX
    integer :: MMX_MAXE
    integer :: MTRP2
    integer :: MTRPL
    integer :: NANTECH_D
    integer :: NANTICH_D
    integer :: NANTLH_D
    integer :: NBDATA
    integer :: NBX(8)
    integer :: NDEAEP
    integer :: NDFS
    integer :: NDMDF
    integer :: NDMFR
    integer :: NDMMX
    integer :: NDMSE
    integer :: NDPAEP
    integer :: NDPFC
    integer :: NDPFC_PRE
    integer :: NEAEP
    integer :: NEFD0
    integer :: NEFDB
    integer :: NEFDP
    integer :: NEFDQ
    integer :: NEFDR
    integer :: NEFDS
    integer :: NFRBCODE
    integer :: NFRBMODE
    integer :: NGMAX_D
    integer :: NHECFT
    integer :: NHFMX
    integer :: NIMDF
    integer :: NISSIM(MIMPT)
    integer :: NISX(MIMPT)
    integer :: NITSIM(MIMPS)
    integer :: NITX(MIMPS)
    integer :: NKAEP
    integer :: NLIM
    integer :: NMAPSIM(MIMPT)
    integer :: NMDXKF
    integer :: NMIMP
    integer :: NMOMD
    integer :: NMUAEP
    integer :: NMZEFF
    integer :: NNSIM
    integer :: NPACK
    integer :: NPAEP
    integer :: NPELDA
    integer :: NPMDF
    integer :: NPMSE
    integer :: NRHIS
    integer :: NRHIX
    integer :: NRIAXR
    integer :: NRIBOL
    integer :: NRIBPA
    integer :: NRIBPB
    integer :: NRID2F
    integer :: NRIDE2
    integer :: NRIDF3
    integer :: NRIDF4
    integer :: NRIDF6
    integer :: NRIDFD
    integer :: NRIDFH
    integer :: NRIDFT
    integer :: NRIECF
    integer :: NRIFD0
    integer :: NRIFDB
    integer :: NRIFDP
    integer :: NRIFDQ
    integer :: NRIFDR
    integer :: NRIFDS
    integer :: NRIFEH
    integer :: NRIFEL
    integer :: NRIGRB
    integer :: NRIIBE
    integer :: NRIIBI
    integer :: NRIJBM
    integer :: NRIJEC
    integer :: NRIJIC
    integer :: NRILF3
    integer :: NRILF4
    integer :: NRILF6
    integer :: NRILFD
    integer :: NRILFH
    integer :: NRILFT
    integer :: NRILHE
    integer :: NRILHJ
    integer :: NRIMSE
    integer :: NRINER
    integer :: NRINI3
    integer :: NRINI4
    integer :: NRINI6
    integer :: NRINID
    integer :: NRINIH
    integer :: NRINIM
    integer :: NRINIT
    integer :: NRINMR
    integer :: NRIOMG
    integer :: NRIPRS
    integer :: NRIQBE
    integer :: NRIQBI
    integer :: NRIQEC
    integer :: NRIQIC
    integer :: NRIQPR
    integer :: NRIRES
    integer :: NRISBI
    integer :: NRISIM(MIMPS)
    integer :: NRITER
    integer :: NRITI2
    integer :: NRITQI
    integer :: NRIV2F
    integer :: NRIVB2
    integer :: NRIVC3
    integer :: NRIVC4
    integer :: NRIVC6
    integer :: NRIVCD
    integer :: NRIVCH
    integer :: NRIVCT
    integer :: NRIVEE
    integer :: NRIVIE
    integer :: NRIVMO
    integer :: NRIVP2
    integer :: NRIVPO
    integer :: NRIVPR
    integer :: NRIVTR
    integer :: NRIZF2
    integer :: NRIZXR
    integer :: NRMFR
    integer :: NRMSE
    integer :: NRP2
    integer :: NRPL
    integer :: NRPSI
    integer :: NSAWFLAG
    integer :: NSC
    integer :: NSC_FMT
    integer :: NSEVENT
    integer :: NSEVPER
    integer :: NSEVTBL
    integer :: NSEVWDS
    integer :: NSFAST_D
    integer :: NSYAXR
    integer :: NSYBOL
    integer :: NSYBPA
    integer :: NSYBPB
    integer :: NSYD2F
    integer :: NSYDE2
    integer :: NSYDF3
    integer :: NSYDF4
    integer :: NSYDF6
    integer :: NSYDFD
    integer :: NSYDFH
    integer :: NSYDFT
    integer :: NSYECF
    integer :: NSYFEH
    integer :: NSYFEL
    integer :: NSYGRB
    integer :: NSYIBE
    integer :: NSYIBI
    integer :: NSYJBM
    integer :: NSYJEC
    integer :: NSYJIC
    integer :: NSYLF3
    integer :: NSYLF4
    integer :: NSYLF6
    integer :: NSYLFD
    integer :: NSYLFH
    integer :: NSYLFT
    integer :: NSYLHE
    integer :: NSYLHJ
    integer :: NSYMSE
    integer :: NSYNER
    integer :: NSYNI3
    integer :: NSYNI4
    integer :: NSYNI6
    integer :: NSYNID
    integer :: NSYNIH
    integer :: NSYNIM
    integer :: NSYNIT
    integer :: NSYNMR
    integer :: NSYOMG
    integer :: NSYPRS
    integer :: NSYQBE
    integer :: NSYQBI
    integer :: NSYQEC
    integer :: NSYQIC
    integer :: NSYQPR
    integer :: NSYRES
    integer :: NSYSBI
    integer :: NSYSIM(MIMPS)
    integer :: NSYTER
    integer :: NSYTI2
    integer :: NSYTQI
    integer :: NSYV2F
    integer :: NSYVB2
    integer :: NSYVC3
    integer :: NSYVC4
    integer :: NSYVC6
    integer :: NSYVCD
    integer :: NSYVCH
    integer :: NSYVCT
    integer :: NSYVEE
    integer :: NSYVIE
    integer :: NSYVMO
    integer :: NSYVP2
    integer :: NSYVPO
    integer :: NSYVPR
    integer :: NSYVTR
    integer :: NSYZF2
    integer :: NSYZXR
    integer :: NTABORT
    integer :: NTAEP
    integer :: NTFD0
    integer :: NTFDB
    integer :: NTFDP
    integer :: NTFDQ
    integer :: NTFDR
    integer :: NTFDS
    integer :: NTHFS
    integer :: NTIME1
    integer :: NTIME2
    integer :: NTIMEC
    integer :: NTIMECA
    integer :: NTIMECB
    integer :: NTIMLH
    integer :: NTIMNB
    integer :: NTIMRF
    integer :: NTIMRFF
    integer :: NTPSI
    integer :: NTSAW
    integer :: NXAXR
    integer :: NXBOL
    integer :: NXBPA
    integer :: NXBPB
    integer :: NXD2F
    integer :: NXDE2
    integer :: NXDF3
    integer :: NXDF4
    integer :: NXDF6
    integer :: NXDFD
    integer :: NXDFH
    integer :: NXDFT
    integer :: NXECF
    integer :: NXFD0
    integer :: NXFDB
    integer :: NXFDP
    integer :: NXFDQ
    integer :: NXFDR
    integer :: NXFDS
    integer :: NXFEH
    integer :: NXFEL
    integer :: NXFS
    integer :: NXGRB
    integer :: NXIBE
    integer :: NXIBI
    integer :: NXJBM
    integer :: NXJEC
    integer :: NXJIC
    integer :: NXLF3
    integer :: NXLF4
    integer :: NXLF6
    integer :: NXLFD
    integer :: NXLFH
    integer :: NXLFT
    integer :: NXLHE
    integer :: NXLHJ
    integer :: NXMMX
    integer :: NXMSE
    integer :: NXNE0
    integer :: NXNER
    integer :: NXNI3
    integer :: NXNI4
    integer :: NXNI6
    integer :: NXNID
    integer :: NXNIH
    integer :: NXNIM
    integer :: NXNIT
    integer :: NXNM0
    integer :: NXNMR
    integer :: NXOMG
    integer :: NXPFC
    integer :: NXPRS
    integer :: NXQBE
    integer :: NXQBI
    integer :: NXQEC
    integer :: NXQIC
    integer :: NXQPR
    integer :: NXRES
    integer :: NXRP2
    integer :: NXRPL
    integer :: NXSBI
    integer :: NXSIM(MIMPS)
    integer :: NXSYAXR
    integer :: NXSYBOL
    integer :: NXSYBPA
    integer :: NXSYBPB
    integer :: NXSYD2F
    integer :: NXSYDE2
    integer :: NXSYDF3
    integer :: NXSYDF4
    integer :: NXSYDF6
    integer :: NXSYDFD
    integer :: NXSYDFH
    integer :: NXSYDFT
    integer :: NXSYECF
    integer :: NXSYFEH
    integer :: NXSYFEL
    integer :: NXSYGRB
    integer :: NXSYIBE
    integer :: NXSYIBI
    integer :: NXSYJBM
    integer :: NXSYJEC
    integer :: NXSYJIC
    integer :: NXSYLF3
    integer :: NXSYLF4
    integer :: NXSYLF6
    integer :: NXSYLFD
    integer :: NXSYLFH
    integer :: NXSYLFT
    integer :: NXSYLHE
    integer :: NXSYLHJ
    integer :: NXSYMSE
    integer :: NXSYNER
    integer :: NXSYNI3
    integer :: NXSYNI4
    integer :: NXSYNI6
    integer :: NXSYNID
    integer :: NXSYNIH
    integer :: NXSYNIM
    integer :: NXSYNIT
    integer :: NXSYNMR
    integer :: NXSYOMG
    integer :: NXSYPRS
    integer :: NXSYQBE
    integer :: NXSYQBI
    integer :: NXSYQEC
    integer :: NXSYQIC
    integer :: NXSYQPR
    integer :: NXSYRES
    integer :: NXSYSBI
    integer :: NXSYSIM(MIMPS)
    integer :: NXSYTER
    integer :: NXSYTI2
    integer :: NXSYTQI
    integer :: NXSYV2F
    integer :: NXSYVB2
    integer :: NXSYVC3
    integer :: NXSYVC4
    integer :: NXSYVC6
    integer :: NXSYVCD
    integer :: NXSYVCH
    integer :: NXSYVCT
    integer :: NXSYVEE
    integer :: NXSYVIE
    integer :: NXSYVMO
    integer :: NXSYVP2
    integer :: NXSYVPO
    integer :: NXSYVPR
    integer :: NXSYVTR
    integer :: NXSYZF2
    integer :: NXSYZXR
    integer :: NXTE0
    integer :: NXTER
    integer :: NXTI2
    integer :: NXTQI
    integer :: NXV2F
    integer :: NXVB2
    integer :: NXVC3
    integer :: NXVC4
    integer :: NXVC6
    integer :: NXVCD
    integer :: NXVCH
    integer :: NXVCT
    integer :: NXVEE
    integer :: NXVIE
    integer :: NXVMO
    integer :: NXVP2
    integer :: NXVPO
    integer :: NXVPR
    integer :: NXVTR
    integer :: NXZEF2
    integer :: NXZF2
    integer :: NXZXR
    integer :: NYRP2
    integer :: NYRPL
    integer :: NZPSI
    real*8, dimension(:), pointer :: WORKBUF
 
  end type trdatbuf
 
  contains
    integer function tdb_get_MIMPS(idum)
      integer, intent(in) :: idum
 
      tdb_get_MIMPS = MIMPS
 
    end function tdb_get_MIMPS
    integer function tdb_get_MIMPT(idum)
      integer, intent(in) :: idum
 
      tdb_get_MIMPT = MIMPT
 
    end function tdb_get_MIMPT
 
    subroutine trdatbuf_reInit(s)
      type (trdatbuf) :: s
 
      deallocate(s%DATBUF)
      deallocate(s%WORKBUF)
 
      call trdatbuf_init(s)
    end subroutine trdatbuf_reInit
 
    subroutine trdatbuf_init(s)
      type (trdatbuf) :: s
 
      allocate(s%DATBUF(100000)); s%DATBUF = 0
      allocate(s%WORKBUF(100000)); s%WORKBUF = 0
      s%LADR_ZA = 0
      s%LADR_ZAF = 0
      s%LAEPDE = 0
      s%LAEPDP = 0
      s%LAEPE = 0
      s%LAEPMAP = 0
      s%LAEPMU = 0
      s%LAEPP = 0
      s%LAEPSP = 0
      s%LAEPTS = 0
      s%LAIMPS = 0
      s%LAIMPX = 0
      s%LBX = 0
      s%LDATALP = 0
      s%LDATBDI = 0
      s%LDATCUR = 0
      s%LDATDFL = 0
      s%LDATDTG = 0
      s%LDATDTS = 0
      s%LDATDTX = 0
      s%LDATEDI = 0
      s%LDATEHP = 0
      s%LDATELI = 0
      s%LDATFGW = 0
      s%LDATFIE = 0
      s%LDATFMN = 0
      s%LDATFMX = 0
      s%LDATGAS = 0
      s%LDATGF3 = 0
      s%LDATGF4 = 0
      s%LDATGF6 = 0
      s%LDATGFD = 0
      s%LDATGFH = 0
      s%LDATGFT = 0
      s%LDATGIE = 0
      s%LDATHAL = 0
      s%LDATIBM = 0
      s%LDATIEC = 0
      s%LDATIIC = 0
      s%LDATILH = 0
      s%LDATL2B = 0
      s%LDATLAD = 0
      s%LDATLID = 0
      s%LDATNTX = 0
      s%LDATOGF = 0
      s%LDATORC = 0
      s%LDATPBE = 0
      s%LDATPBI = 0
      s%LDATPEB = 0
      s%LDATPEC = 0
      s%LDATPF0 = 0
      s%LDATPFH = 0
      s%LDATPFL = 0
      s%LDATPIB = 0
      s%LDATPIC = 0
      s%LDATPLF = 0
      s%LDATPLH = 0
      s%LDATPOS = 0
      s%LDATRBZ = 0
      s%LDATRC3 = 0
      s%LDATRC4 = 0
      s%LDATRC6 = 0
      s%LDATRCD = 0
      s%LDATRCH = 0
      s%LDATRCT = 0
      s%LDATRCY = 0
      s%LDATRMN = 0
      s%LDATRTP = 0
      s%LDATSBT = 0
      s%LDATSF3 = 0
      s%LDATSFA = 0
      s%LDATSFL = 0
      s%LDATSFP = 0
      s%LDATSFT = 0
      s%LDATSP3 = 0
      s%LDATTET = 0
      s%LDATTGF = 0
      s%LDATTIT = 0
      s%LDATTPI = 0
      s%LDATTQT = 0
      s%LDATTRC = 0
      s%LDATTRF = 0
      s%LDATTXI = 0
      s%LDATVPH = 0
      s%LDATVSB = 0
      s%LDATVSF = 0
      s%LDATXKF = 0
      s%LDATZEF = 0
      s%LDATZFA = 0
      s%LDATZIM = 0
      s%LDATZPL = 0
      s%LDMDF = 0
      s%LDMFR = 0
      s%LDMMX = 0
      s%LDMSE = 0
      s%LDPFC = 0
      s%LDPFC_PRE = 0
      s%LEFD0 = 0
      s%LEFDB = 0
      s%LEFDP = 0
      s%LEFDQ = 0
      s%LEFDR = 0
      s%LEFDS = 0
      s%LFAEPA = 0
      s%LFAEPP = 0
      s%LFAXR = 0
      s%LFBOL = 0
      s%LFBPA = 0
      s%LFBPB = 0
      s%LFD2F = 0
      s%LFDE2 = 0
      s%LFDF3 = 0
      s%LFDF4 = 0
      s%LFDF6 = 0
      s%LFDFD = 0
      s%LFDFH = 0
      s%LFDFT = 0
      s%LFECA = 0
      s%LFECB = 0
      s%LFECF = 0
      s%LFFD0 = 0
      s%LFFDB = 0
      s%LFFDP = 0
      s%LFFDQ = 0
      s%LFFDR = 0
      s%LFFDS = 0
      s%LFFEH = 0
      s%LFFEL = 0
      s%LFGRB = 0
      s%LFIBE = 0
      s%LFIBI = 0
      s%LFJBM = 0
      s%LFJEC = 0
      s%LFJIC = 0
      s%LFLF3 = 0
      s%LFLF4 = 0
      s%LFLF6 = 0
      s%LFLFD = 0
      s%LFLFH = 0
      s%LFLFT = 0
      s%LFLHE = 0
      s%LFLHJ = 0
      s%LFMSE = 0
      s%LFNER = 0
      s%LFNI3 = 0
      s%LFNI4 = 0
      s%LFNI6 = 0
      s%LFNID = 0
      s%LFNIH = 0
      s%LFNIM = 0
      s%LFNIT = 0
      s%LFNMR = 0
      s%LFOMG = 0
      s%LFPRS = 0
      s%LFPSI = 0
      s%LFQBE = 0
      s%LFQBI = 0
      s%LFQEC = 0
      s%LFQIC = 0
      s%LFQPR = 0
      s%LFREE = 1
      s%LFREE_W = 1
      s%LFRES = 0
      s%LFRQRFF = 0
      s%LFSBI = 0
      s%LFSIM = 0
      s%LFSYAXR = 0
      s%LFSYBOL = 0
      s%LFSYBPA = 0
      s%LFSYBPB = 0
      s%LFSYD2F = 0
      s%LFSYDE2 = 0
      s%LFSYDF3 = 0
      s%LFSYDF4 = 0
      s%LFSYDF6 = 0
      s%LFSYDFD = 0
      s%LFSYDFH = 0
      s%LFSYDFT = 0
      s%LFSYECF = 0
      s%LFSYFEH = 0
      s%LFSYFEL = 0
      s%LFSYGRB = 0
      s%LFSYIBE = 0
      s%LFSYIBI = 0
      s%LFSYJBM = 0
      s%LFSYJEC = 0
      s%LFSYJIC = 0
      s%LFSYLF3 = 0
      s%LFSYLF4 = 0
      s%LFSYLF6 = 0
      s%LFSYLFD = 0
      s%LFSYLFH = 0
      s%LFSYLFT = 0
      s%LFSYLHE = 0
      s%LFSYLHJ = 0
      s%LFSYMSE = 0
      s%LFSYNER = 0
      s%LFSYNI3 = 0
      s%LFSYNI4 = 0
      s%LFSYNI6 = 0
      s%LFSYNID = 0
      s%LFSYNIH = 0
      s%LFSYNIM = 0
      s%LFSYNIT = 0
      s%LFSYNMR = 0
      s%LFSYOMG = 0
      s%LFSYPRS = 0
      s%LFSYQBE = 0
      s%LFSYQBI = 0
      s%LFSYQEC = 0
      s%LFSYQIC = 0
      s%LFSYQPR = 0
      s%LFSYRES = 0
      s%LFSYSBI = 0
      s%LFSYSIM = 0
      s%LFSYTER = 0
      s%LFSYTI2 = 0
      s%LFSYTQI = 0
      s%LFSYV2F = 0
      s%LFSYVB2 = 0
      s%LFSYVC3 = 0
      s%LFSYVC4 = 0
      s%LFSYVC6 = 0
      s%LFSYVCD = 0
      s%LFSYVCH = 0
      s%LFSYVCT = 0
      s%LFSYVEE = 0
      s%LFSYVIE = 0
      s%LFSYVMO = 0
      s%LFSYVP2 = 0
      s%LFSYVPO = 0
      s%LFSYVPR = 0
      s%LFSYVTR = 0
      s%LFSYZF2 = 0
      s%LFSYZXR = 0
      s%LFTER = 0
      s%LFTI2 = 0
      s%LFTQI = 0
      s%LFULNB = 0
      s%LFV2F = 0
      s%LFVB2 = 0
      s%LFVC3 = 0
      s%LFVC4 = 0
      s%LFVC6 = 0
      s%LFVCD = 0
      s%LFVCH = 0
      s%LFVCT = 0
      s%LFVEE = 0
      s%LFVIE = 0
      s%LFVMO = 0
      s%LFVP2 = 0
      s%LFVPO = 0
      s%LFVPR = 0
      s%LFVTR = 0
      s%LFZF2 = 0
      s%LFZXR = 0
      s%LHLFNB = 0
      s%LLIM = 0
      s%LMOMD = 0
      s%LPELDA = 0
      s%LPHSLH = 0
      s%LPMDF = 0
      s%LPMSE = 0
      s%LPWREC = 0
      s%LPWRLH = 0
      s%LPWRNB = 0
      s%LPWRRF = 0
      s%LRFS = 0
      s%LRMFR = 0
      s%LRMP_BDY1 = 0
      s%LRMP_BDY2 = 0
      s%LRMSE = 0
      s%LRP2 = 0
      s%LRPL = 0
      s%LRPSI = 0
      s%LSEVENT = 0
      s%LSSYAXR = 0
      s%LSSYBOL = 0
      s%LSSYBPA = 0
      s%LSSYBPB = 0
      s%LSSYD2F = 0
      s%LSSYDE2 = 0
      s%LSSYDF3 = 0
      s%LSSYDF4 = 0
      s%LSSYDF6 = 0
      s%LSSYDFD = 0
      s%LSSYDFH = 0
      s%LSSYDFT = 0
      s%LSSYECF = 0
      s%LSSYFEH = 0
      s%LSSYFEL = 0
      s%LSSYGRB = 0
      s%LSSYIBE = 0
      s%LSSYIBI = 0
      s%LSSYJBM = 0
      s%LSSYJEC = 0
      s%LSSYJIC = 0
      s%LSSYLF3 = 0
      s%LSSYLF4 = 0
      s%LSSYLF6 = 0
      s%LSSYLFD = 0
      s%LSSYLFH = 0
      s%LSSYLFT = 0
      s%LSSYLHE = 0
      s%LSSYLHJ = 0
      s%LSSYMSE = 0
      s%LSSYNER = 0
      s%LSSYNI3 = 0
      s%LSSYNI4 = 0
      s%LSSYNI6 = 0
      s%LSSYNID = 0
      s%LSSYNIH = 0
      s%LSSYNIM = 0
      s%LSSYNIT = 0
      s%LSSYNMR = 0
      s%LSSYOMG = 0
      s%LSSYPRS = 0
      s%LSSYQBE = 0
      s%LSSYQBI = 0
      s%LSSYQEC = 0
      s%LSSYQIC = 0
      s%LSSYQPR = 0
      s%LSSYRES = 0
      s%LSSYSBI = 0
      s%LSSYSIM = 0
      s%LSSYTER = 0
      s%LSSYTI2 = 0
      s%LSSYTQI = 0
      s%LSSYV2F = 0
      s%LSSYVB2 = 0
      s%LSSYVC3 = 0
      s%LSSYVC4 = 0
      s%LSSYVC6 = 0
      s%LSSYVCD = 0
      s%LSSYVCH = 0
      s%LSSYVCT = 0
      s%LSSYVEE = 0
      s%LSSYVIE = 0
      s%LSSYVMO = 0
      s%LSSYVP2 = 0
      s%LSSYVPO = 0
      s%LSSYVPR = 0
      s%LSSYVTR = 0
      s%LSSYZF2 = 0
      s%LSSYZXR = 0
      s%LTABORT = 0
      s%LTAEP = 0
      s%LTFD0 = 0
      s%LTFDB = 0
      s%LTFDP = 0
      s%LTFDQ = 0
      s%LTFDR = 0
      s%LTFDS = 0
      s%LTHFS = 0
      s%LTIME1 = 0
      s%LTIME2 = 0
      s%LTIMEC = 0
      s%LTIMECA = 0
      s%LTIMECB = 0
      s%LTIMLH = 0
      s%LTIMNB = 0
      s%LTIMRF = 0
      s%LTIMRFF = 0
      s%LTPSI = 0
      s%LTSAW = 0
      s%LVLTNB = 0
      s%LXAXR = 0
      s%LXBOL = 0
      s%LXBPA = 0
      s%LXBPB = 0
      s%LXD2F = 0
      s%LXDE2 = 0
      s%LXDF3 = 0
      s%LXDF4 = 0
      s%LXDF6 = 0
      s%LXDFD = 0
      s%LXDFH = 0
      s%LXDFT = 0
      s%LXECF = 0
      s%LXFD0 = 0
      s%LXFDB = 0
      s%LXFDP = 0
      s%LXFDQ = 0
      s%LXFDR = 0
      s%LXFDS = 0
      s%LXFEH = 0
      s%LXFEL = 0
      s%LXFS = 0
      s%LXGRB = 0
      s%LXIBE = 0
      s%LXIBI = 0
      s%LXJBM = 0
      s%LXJEC = 0
      s%LXJIC = 0
      s%LXLF3 = 0
      s%LXLF4 = 0
      s%LXLF6 = 0
      s%LXLFD = 0
      s%LXLFH = 0
      s%LXLFT = 0
      s%LXLHE = 0
      s%LXLHJ = 0
      s%LXMMX = 0
      s%LXMSE = 0
      s%LXNER = 0
      s%LXNI3 = 0
      s%LXNI4 = 0
      s%LXNI6 = 0
      s%LXNID = 0
      s%LXNIH = 0
      s%LXNIM = 0
      s%LXNIT = 0
      s%LXNMR = 0
      s%LXOMG = 0
      s%LXPFC = 0
      s%LXPRS = 0
      s%LXQBE = 0
      s%LXQBI = 0
      s%LXQEC = 0
      s%LXQIC = 0
      s%LXQPR = 0
      s%LXRES = 0
      s%LXRP2 = 0
      s%LXRPL = 0
      s%LXSBI = 0
      s%LXSIM = 0
      s%LXSYAXR = 0
      s%LXSYBOL = 0
      s%LXSYBPA = 0
      s%LXSYBPB = 0
      s%LXSYD2F = 0
      s%LXSYDE2 = 0
      s%LXSYDF3 = 0
      s%LXSYDF4 = 0
      s%LXSYDF6 = 0
      s%LXSYDFD = 0
      s%LXSYDFH = 0
      s%LXSYDFT = 0
      s%LXSYECF = 0
      s%LXSYFEH = 0
      s%LXSYFEL = 0
      s%LXSYGRB = 0
      s%LXSYIBE = 0
      s%LXSYIBI = 0
      s%LXSYJBM = 0
      s%LXSYJEC = 0
      s%LXSYJIC = 0
      s%LXSYLF3 = 0
      s%LXSYLF4 = 0
      s%LXSYLF6 = 0
      s%LXSYLFD = 0
      s%LXSYLFH = 0
      s%LXSYLFT = 0
      s%LXSYLHE = 0
      s%LXSYLHJ = 0
      s%LXSYMSE = 0
      s%LXSYNER = 0
      s%LXSYNI3 = 0
      s%LXSYNI4 = 0
      s%LXSYNI6 = 0
      s%LXSYNID = 0
      s%LXSYNIH = 0
      s%LXSYNIM = 0
      s%LXSYNIT = 0
      s%LXSYNMR = 0
      s%LXSYOMG = 0
      s%LXSYPRS = 0
      s%LXSYQBE = 0
      s%LXSYQBI = 0
      s%LXSYQEC = 0
      s%LXSYQIC = 0
      s%LXSYQPR = 0
      s%LXSYRES = 0
      s%LXSYSBI = 0
      s%LXSYSIM = 0
      s%LXSYTER = 0
      s%LXSYTI2 = 0
      s%LXSYTQI = 0
      s%LXSYV2F = 0
      s%LXSYVB2 = 0
      s%LXSYVC3 = 0
      s%LXSYVC4 = 0
      s%LXSYVC6 = 0
      s%LXSYVCD = 0
      s%LXSYVCH = 0
      s%LXSYVCT = 0
      s%LXSYVEE = 0
      s%LXSYVIE = 0
      s%LXSYVMO = 0
      s%LXSYVP2 = 0
      s%LXSYVPO = 0
      s%LXSYVPR = 0
      s%LXSYVTR = 0
      s%LXSYZF2 = 0
      s%LXSYZXR = 0
      s%LXTER = 0
      s%LXTI2 = 0
      s%LXTQI = 0
      s%LXV2F = 0
      s%LXVB2 = 0
      s%LXVC3 = 0
      s%LXVC4 = 0
      s%LXVC6 = 0
      s%LXVCD = 0
      s%LXVCH = 0
      s%LXVCT = 0
      s%LXVEE = 0
      s%LXVIE = 0
      s%LXVMO = 0
      s%LXVP2 = 0
      s%LXVPO = 0
      s%LXVPR = 0
      s%LXVTR = 0
      s%LXZF2 = 0
      s%LXZIMPS = 0
      s%LXZIMPX = 0
      s%LXZIMPXS = 0
      s%LXZXR = 0
      s%LYRP2 = 0
      s%LYRPL = 0
      s%LYSIM = 0
      s%LZFS = 0
      s%LZPSI = 0
      s%MMAX = 0
      s%MMX_MAXE = 0
      s%MTRP2 = 0
      s%MTRPL = 0
      s%NANTECH_D = 0
      s%NANTICH_D = 0
      s%NANTLH_D = 0
      s%NBDATA = 0
      s%NBX = 0
      s%NDEAEP = 0
      s%NDFS = 0
      s%NDMDF = 0
      s%NDMFR = 0
      s%NDMMX = 0
      s%NDMSE = 0
      s%NDPAEP = 0
      s%NDPFC = 0
      s%NDPFC_PRE = 0
      s%NEAEP = 0
      s%NEFD0 = 0
      s%NEFDB = 0
      s%NEFDP = 0
      s%NEFDQ = 0
      s%NEFDR = 0
      s%NEFDS = 0
      s%NFRBCODE = 0
      s%NFRBMODE = 0
      s%NGMAX_D = 0
      s%NHECFT = 0
      s%NHFMX = 0
      s%NIMDF = 0
      s%NISSIM = 0
      s%NISX = 0
      s%NITSIM = 0
      s%NITX = 0
      s%NKAEP = 0
      s%NLIM = 0
      s%NMAPSIM = 0
      s%NMDXKF = 0
      s%NMIMP = 0
      s%NMOMD = 0
      s%NMUAEP = 0
      s%NMZEFF = 0
      s%NNSIM = 0
      s%NPACK = 0
      s%NPAEP = 0
      s%NPELDA = 0
      s%NPMDF = 0
      s%NPMSE = 0
      s%NRHIS = 0
      s%NRHIX = 0
      s%NRIAXR = -9999
      s%NRIBOL = -9999
      s%NRIBPA = -9999
      s%NRIBPB = -9999
      s%NRID2F = -9999
      s%NRIDE2 = -9999
      s%NRIDF3 = -9999
      s%NRIDF4 = -9999
      s%NRIDF6 = -9999
      s%NRIDFD = -9999
      s%NRIDFH = -9999
      s%NRIDFT = -9999
      s%NRIECF = -9999
      s%NRIFD0 = -9999
      s%NRIFDB = -9999
      s%NRIFDP = -9999
      s%NRIFDQ = -9999
      s%NRIFDR = -9999
      s%NRIFDS = -9999
      s%NRIFEH = -9999
      s%NRIFEL = -9999
      s%NRIGRB = -9999
      s%NRIIBE = -9999
      s%NRIIBI = -9999
      s%NRIJBM = -9999
      s%NRIJEC = -9999
      s%NRIJIC = -9999
      s%NRILF3 = -9999
      s%NRILF4 = -9999
      s%NRILF6 = -9999
      s%NRILFD = -9999
      s%NRILFH = -9999
      s%NRILFT = -9999
      s%NRILHE = -9999
      s%NRILHJ = -9999
      s%NRIMSE = -9999
      s%NRINER = -9999
      s%NRINI3 = -9999
      s%NRINI4 = -9999
      s%NRINI6 = -9999
      s%NRINID = -9999
      s%NRINIH = -9999
      s%NRINIM = -9999
      s%NRINIT = -9999
      s%NRINMR = -9999
      s%NRIOMG = -9999
      s%NRIPRS = -9999
      s%NRIQBE = -9999
      s%NRIQBI = -9999
      s%NRIQEC = -9999
      s%NRIQIC = -9999
      s%NRIQPR = -9999
      s%NRIRES = -9999
      s%NRISBI = -9999
      s%NRISIM = -9999
      s%NRITER = -9999
      s%NRITI2 = -9999
      s%NRITQI = -9999
      s%NRIV2F = -9999
      s%NRIVB2 = -9999
      s%NRIVC3 = -9999
      s%NRIVC4 = -9999
      s%NRIVC6 = -9999
      s%NRIVCD = -9999
      s%NRIVCH = -9999
      s%NRIVCT = -9999
      s%NRIVEE = -9999
      s%NRIVIE = -9999
      s%NRIVMO = -9999
      s%NRIVP2 = -9999
      s%NRIVPO = -9999
      s%NRIVPR = -9999
      s%NRIVTR = -9999
      s%NRIZF2 = -9999
      s%NRIZXR = -9999
      s%NRMFR = 0
      s%NRMSE = 0
      s%NRP2 = 0
      s%NRPL = 0
      s%NRPSI = 0
      s%NSAWFLAG = 0
      s%NSC = 0
      s%NSC_FMT = 0
      s%NSEVENT = 0
      s%NSEVPER = 0
      s%NSEVTBL = 0
      s%NSEVWDS = 0
      s%NSFAST_D = 0
      s%NSYAXR = -9999
      s%NSYBOL = -9999
      s%NSYBPA = -9999
      s%NSYBPB = -9999
      s%NSYD2F = -9999
      s%NSYDE2 = -9999
      s%NSYDF3 = -9999
      s%NSYDF4 = -9999
      s%NSYDF6 = -9999
      s%NSYDFD = -9999
      s%NSYDFH = -9999
      s%NSYDFT = -9999
      s%NSYECF = -9999
      s%NSYFEH = -9999
      s%NSYFEL = -9999
      s%NSYGRB = -9999
      s%NSYIBE = -9999
      s%NSYIBI = -9999
      s%NSYJBM = -9999
      s%NSYJEC = -9999
      s%NSYJIC = -9999
      s%NSYLF3 = -9999
      s%NSYLF4 = -9999
      s%NSYLF6 = -9999
      s%NSYLFD = -9999
      s%NSYLFH = -9999
      s%NSYLFT = -9999
      s%NSYLHE = -9999
      s%NSYLHJ = -9999
      s%NSYMSE = -9999
      s%NSYNER = -9999
      s%NSYNI3 = -9999
      s%NSYNI4 = -9999
      s%NSYNI6 = -9999
      s%NSYNID = -9999
      s%NSYNIH = -9999
      s%NSYNIM = -9999
      s%NSYNIT = -9999
      s%NSYNMR = -9999
      s%NSYOMG = -9999
      s%NSYPRS = -9999
      s%NSYQBE = -9999
      s%NSYQBI = -9999
      s%NSYQEC = -9999
      s%NSYQIC = -9999
      s%NSYQPR = -9999
      s%NSYRES = -9999
      s%NSYSBI = -9999
      s%NSYSIM = -9999
      s%NSYTER = -9999
      s%NSYTI2 = -9999
      s%NSYTQI = -9999
      s%NSYV2F = -9999
      s%NSYVB2 = -9999
      s%NSYVC3 = -9999
      s%NSYVC4 = -9999
      s%NSYVC6 = -9999
      s%NSYVCD = -9999
      s%NSYVCH = -9999
      s%NSYVCT = -9999
      s%NSYVEE = -9999
      s%NSYVIE = -9999
      s%NSYVMO = -9999
      s%NSYVP2 = -9999
      s%NSYVPO = -9999
      s%NSYVPR = -9999
      s%NSYVTR = -9999
      s%NSYZF2 = -9999
      s%NSYZXR = -9999
      s%NTABORT = 0
      s%NTAEP = 0
      s%NTFD0 = 0
      s%NTFDB = 0
      s%NTFDP = 0
      s%NTFDQ = 0
      s%NTFDR = 0
      s%NTFDS = 0
      s%NTHFS = 0
      s%NTIME1 = 0
      s%NTIME2 = 0
      s%NTIMEC = 0
      s%NTIMECA = 0
      s%NTIMECB = 0
      s%NTIMLH = 0
      s%NTIMNB = 0
      s%NTIMRF = 0
      s%NTIMRFF = 0
      s%NTPSI = 0
      s%NTSAW = 0
      s%NXAXR = -9999
      s%NXBOL = -9999
      s%NXBPA = -9999
      s%NXBPB = -9999
      s%NXD2F = -9999
      s%NXDE2 = -9999
      s%NXDF3 = -9999
      s%NXDF4 = -9999
      s%NXDF6 = -9999
      s%NXDFD = -9999
      s%NXDFH = -9999
      s%NXDFT = -9999
      s%NXECF = -9999
      s%NXFD0 = 0
      s%NXFDB = 0
      s%NXFDP = 0
      s%NXFDQ = 0
      s%NXFDR = 0
      s%NXFDS = 0
      s%NXFEH = -9999
      s%NXFEL = -9999
      s%NXFS = 0
      s%NXGRB = -9999
      s%NXIBE = -9999
      s%NXIBI = -9999
      s%NXJBM = -9999
      s%NXJEC = -9999
      s%NXJIC = -9999
      s%NXLF3 = -9999
      s%NXLF4 = -9999
      s%NXLF6 = -9999
      s%NXLFD = -9999
      s%NXLFH = -9999
      s%NXLFT = -9999
      s%NXLHE = -9999
      s%NXLHJ = -9999
      s%NXMMX = 0
      s%NXMSE = -9999
      s%NXNE0 = -9999
      s%NXNER = -9999
      s%NXNI3 = -9999
      s%NXNI4 = -9999
      s%NXNI6 = -9999
      s%NXNID = -9999
      s%NXNIH = -9999
      s%NXNIM = -9999
      s%NXNIT = -9999
      s%NXNM0 = -9999
      s%NXNMR = -9999
      s%NXOMG = -9999
      s%NXPFC = 0
      s%NXPRS = -9999
      s%NXQBE = -9999
      s%NXQBI = -9999
      s%NXQEC = -9999
      s%NXQIC = -9999
      s%NXQPR = -9999
      s%NXRES = -9999
      s%NXRP2 = 0
      s%NXRPL = 0
      s%NXSBI = -9999
      s%NXSIM = -9999
      s%NXSYAXR = 0
      s%NXSYBOL = 0
      s%NXSYBPA = 0
      s%NXSYBPB = 0
      s%NXSYD2F = 0
      s%NXSYDE2 = 0
      s%NXSYDF3 = 0
      s%NXSYDF4 = 0
      s%NXSYDF6 = 0
      s%NXSYDFD = 0
      s%NXSYDFH = 0
      s%NXSYDFT = 0
      s%NXSYECF = 0
      s%NXSYFEH = 0
      s%NXSYFEL = 0
      s%NXSYGRB = 0
      s%NXSYIBE = 0
      s%NXSYIBI = 0
      s%NXSYJBM = 0
      s%NXSYJEC = 0
      s%NXSYJIC = 0
      s%NXSYLF3 = 0
      s%NXSYLF4 = 0
      s%NXSYLF6 = 0
      s%NXSYLFD = 0
      s%NXSYLFH = 0
      s%NXSYLFT = 0
      s%NXSYLHE = 0
      s%NXSYLHJ = 0
      s%NXSYMSE = 0
      s%NXSYNER = 0
      s%NXSYNI3 = 0
      s%NXSYNI4 = 0
      s%NXSYNI6 = 0
      s%NXSYNID = 0
      s%NXSYNIH = 0
      s%NXSYNIM = 0
      s%NXSYNIT = 0
      s%NXSYNMR = 0
      s%NXSYOMG = 0
      s%NXSYPRS = 0
      s%NXSYQBE = 0
      s%NXSYQBI = 0
      s%NXSYQEC = 0
      s%NXSYQIC = 0
      s%NXSYQPR = 0
      s%NXSYRES = 0
      s%NXSYSBI = 0
      s%NXSYSIM = 0
      s%NXSYTER = 0
      s%NXSYTI2 = 0
      s%NXSYTQI = 0
      s%NXSYV2F = 0
      s%NXSYVB2 = 0
      s%NXSYVC3 = 0
      s%NXSYVC4 = 0
      s%NXSYVC6 = 0
      s%NXSYVCD = 0
      s%NXSYVCH = 0
      s%NXSYVCT = 0
      s%NXSYVEE = 0
      s%NXSYVIE = 0
      s%NXSYVMO = 0
      s%NXSYVP2 = 0
      s%NXSYVPO = 0
      s%NXSYVPR = 0
      s%NXSYVTR = 0
      s%NXSYZF2 = 0
      s%NXSYZXR = 0
      s%NXTE0 = -9999
      s%NXTER = -9999
      s%NXTI2 = -9999
      s%NXTQI = -9999
      s%NXV2F = -9999
      s%NXVB2 = -9999
      s%NXVC3 = -9999
      s%NXVC4 = -9999
      s%NXVC6 = -9999
      s%NXVCD = -9999
      s%NXVCH = -9999
      s%NXVCT = -9999
      s%NXVEE = -9999
      s%NXVIE = -9999
      s%NXVMO = -9999
      s%NXVP2 = -9999
      s%NXVPO = -9999
      s%NXVPR = -9999
      s%NXVTR = -9999
      s%NXZEF2 = -9999
      s%NXZF2 = -9999
      s%NXZXR = -9999
      s%NYRP2 = 0
      s%NYRPL = 0
      s%NZPSI = 0
 
    end subroutine trdatbuf_init
    subroutine trdatbuf_copy(a,b,ierr)
 
      type (trdatbuf) :: a   ! copy from a...
      type (trdatbuf) :: b   ! copy to b...
      integer, intent(out) :: ierr  ! error flag
 
      integer :: lunmsg_tdb  ! function to get LUN for messages...
      integer :: isize
 
      !-----------------
 
      ierr=0
      if((a%lfree.le.1).or.(a%ladr_za.le.0)) then
         write(lunmsg_tdb(0),*) &
            ' ?trdatbuf_copy: "from" object appears to be empty.'
         ierr=1
      endif
 
      if((b%lfree.ne.1).or.(b%ladr_za.ne.0)) then
         write(lunmsg_tdb(0),*) &
            ' ?trdatbuf_copy: "to" object appears in use or not initialized.'
         ierr=1
      endif
 
      if(ierr.ne.0) return
 
      call datbuf_expand(b,size(a%datbuf),isize); b%datbuf = 0
      isize=a%lfree - 1
      if(isize.gt.0) b%datbuf(1:isize)=a%datbuf(1:isize)
 
      call workbuf_expand(b,size(a%workbuf),isize); b%workbuf = 0
      isize=a%lfree_w - 1
      if(isize.gt.0) b%workbuf(1:isize)=a%workbuf(1:isize)
 
      b%LADR_ZA = a%LADR_ZA
      b%LADR_ZAF = a%LADR_ZAF
      b%LAEPDE = a%LAEPDE
      b%LAEPDP = a%LAEPDP
      b%LAEPE = a%LAEPE
      b%LAEPMAP = a%LAEPMAP
      b%LAEPMU = a%LAEPMU
      b%LAEPP = a%LAEPP
      b%LAEPSP = a%LAEPSP
      b%LAEPTS = a%LAEPTS
      b%LAIMPS = a%LAIMPS
      b%LAIMPX = a%LAIMPX
      b%LBX = a%LBX
      b%LDATALP = a%LDATALP
      b%LDATBDI = a%LDATBDI
      b%LDATCUR = a%LDATCUR
      b%LDATDFL = a%LDATDFL
      b%LDATDTG = a%LDATDTG
      b%LDATDTS = a%LDATDTS
      b%LDATDTX = a%LDATDTX
      b%LDATEDI = a%LDATEDI
      b%LDATEHP = a%LDATEHP
      b%LDATELI = a%LDATELI
      b%LDATFGW = a%LDATFGW
      b%LDATFIE = a%LDATFIE
      b%LDATFMN = a%LDATFMN
      b%LDATFMX = a%LDATFMX
      b%LDATGAS = a%LDATGAS
      b%LDATGF3 = a%LDATGF3
      b%LDATGF4 = a%LDATGF4
      b%LDATGF6 = a%LDATGF6
      b%LDATGFD = a%LDATGFD
      b%LDATGFH = a%LDATGFH
      b%LDATGFT = a%LDATGFT
      b%LDATGIE = a%LDATGIE
      b%LDATHAL = a%LDATHAL
      b%LDATIBM = a%LDATIBM
      b%LDATIEC = a%LDATIEC
      b%LDATIIC = a%LDATIIC
      b%LDATILH = a%LDATILH
      b%LDATL2B = a%LDATL2B
      b%LDATLAD = a%LDATLAD
      b%LDATLID = a%LDATLID
      b%LDATNTX = a%LDATNTX
      b%LDATOGF = a%LDATOGF
      b%LDATORC = a%LDATORC
      b%LDATPBE = a%LDATPBE
      b%LDATPBI = a%LDATPBI
      b%LDATPEB = a%LDATPEB
      b%LDATPEC = a%LDATPEC
      b%LDATPF0 = a%LDATPF0
      b%LDATPFH = a%LDATPFH
      b%LDATPFL = a%LDATPFL
      b%LDATPIB = a%LDATPIB
      b%LDATPIC = a%LDATPIC
      b%LDATPLF = a%LDATPLF
      b%LDATPLH = a%LDATPLH
      b%LDATPOS = a%LDATPOS
      b%LDATRBZ = a%LDATRBZ
      b%LDATRC3 = a%LDATRC3
      b%LDATRC4 = a%LDATRC4
      b%LDATRC6 = a%LDATRC6
      b%LDATRCD = a%LDATRCD
      b%LDATRCH = a%LDATRCH
      b%LDATRCT = a%LDATRCT
      b%LDATRCY = a%LDATRCY
      b%LDATRMN = a%LDATRMN
      b%LDATRTP = a%LDATRTP
      b%LDATSBT = a%LDATSBT
      b%LDATSF3 = a%LDATSF3
      b%LDATSFA = a%LDATSFA
      b%LDATSFL = a%LDATSFL
      b%LDATSFP = a%LDATSFP
      b%LDATSFT = a%LDATSFT
      b%LDATSP3 = a%LDATSP3
      b%LDATTET = a%LDATTET
      b%LDATTGF = a%LDATTGF
      b%LDATTIT = a%LDATTIT
      b%LDATTPI = a%LDATTPI
      b%LDATTQT = a%LDATTQT
      b%LDATTRC = a%LDATTRC
      b%LDATTRF = a%LDATTRF
      b%LDATTXI = a%LDATTXI
      b%LDATVPH = a%LDATVPH
      b%LDATVSB = a%LDATVSB
      b%LDATVSF = a%LDATVSF
      b%LDATXKF = a%LDATXKF
      b%LDATZEF = a%LDATZEF
      b%LDATZFA = a%LDATZFA
      b%LDATZIM = a%LDATZIM
      b%LDATZPL = a%LDATZPL
      b%LDMDF = a%LDMDF
      b%LDMFR = a%LDMFR
      b%LDMMX = a%LDMMX
      b%LDMSE = a%LDMSE
      b%LDPFC = a%LDPFC
      b%LDPFC_PRE = a%LDPFC_PRE
      b%LEFD0 = a%LEFD0
      b%LEFDB = a%LEFDB
      b%LEFDP = a%LEFDP
      b%LEFDQ = a%LEFDQ
      b%LEFDR = a%LEFDR
      b%LEFDS = a%LEFDS
      b%LFAEPA = a%LFAEPA
      b%LFAEPP = a%LFAEPP
      b%LFAXR = a%LFAXR
      b%LFBOL = a%LFBOL
      b%LFBPA = a%LFBPA
      b%LFBPB = a%LFBPB
      b%LFD2F = a%LFD2F
      b%LFDE2 = a%LFDE2
      b%LFDF3 = a%LFDF3
      b%LFDF4 = a%LFDF4
      b%LFDF6 = a%LFDF6
      b%LFDFD = a%LFDFD
      b%LFDFH = a%LFDFH
      b%LFDFT = a%LFDFT
      b%LFECA = a%LFECA
      b%LFECB = a%LFECB
      b%LFECF = a%LFECF
      b%LFFD0 = a%LFFD0
      b%LFFDB = a%LFFDB
      b%LFFDP = a%LFFDP
      b%LFFDQ = a%LFFDQ
      b%LFFDR = a%LFFDR
      b%LFFDS = a%LFFDS
      b%LFFEH = a%LFFEH
      b%LFFEL = a%LFFEL
      b%LFGRB = a%LFGRB
      b%LFIBE = a%LFIBE
      b%LFIBI = a%LFIBI
      b%LFJBM = a%LFJBM
      b%LFJEC = a%LFJEC
      b%LFJIC = a%LFJIC
      b%LFLF3 = a%LFLF3
      b%LFLF4 = a%LFLF4
      b%LFLF6 = a%LFLF6
      b%LFLFD = a%LFLFD
      b%LFLFH = a%LFLFH
      b%LFLFT = a%LFLFT
      b%LFLHE = a%LFLHE
      b%LFLHJ = a%LFLHJ
      b%LFMSE = a%LFMSE
      b%LFNER = a%LFNER
      b%LFNI3 = a%LFNI3
      b%LFNI4 = a%LFNI4
      b%LFNI6 = a%LFNI6
      b%LFNID = a%LFNID
      b%LFNIH = a%LFNIH
      b%LFNIM = a%LFNIM
      b%LFNIT = a%LFNIT
      b%LFNMR = a%LFNMR
      b%LFOMG = a%LFOMG
      b%LFPRS = a%LFPRS
      b%LFPSI = a%LFPSI
      b%LFQBE = a%LFQBE
      b%LFQBI = a%LFQBI
      b%LFQEC = a%LFQEC
      b%LFQIC = a%LFQIC
      b%LFQPR = a%LFQPR
      b%LFREE = a%LFREE
      b%LFREE_W = a%LFREE_W
      b%LFRES = a%LFRES
      b%LFRQRFF = a%LFRQRFF
      b%LFSBI = a%LFSBI
      b%LFSIM = a%LFSIM
      b%LFSYAXR = a%LFSYAXR
      b%LFSYBOL = a%LFSYBOL
      b%LFSYBPA = a%LFSYBPA
      b%LFSYBPB = a%LFSYBPB
      b%LFSYD2F = a%LFSYD2F
      b%LFSYDE2 = a%LFSYDE2
      b%LFSYDF3 = a%LFSYDF3
      b%LFSYDF4 = a%LFSYDF4
      b%LFSYDF6 = a%LFSYDF6
      b%LFSYDFD = a%LFSYDFD
      b%LFSYDFH = a%LFSYDFH
      b%LFSYDFT = a%LFSYDFT
      b%LFSYECF = a%LFSYECF
      b%LFSYFEH = a%LFSYFEH
      b%LFSYFEL = a%LFSYFEL
      b%LFSYGRB = a%LFSYGRB
      b%LFSYIBE = a%LFSYIBE
      b%LFSYIBI = a%LFSYIBI
      b%LFSYJBM = a%LFSYJBM
      b%LFSYJEC = a%LFSYJEC
      b%LFSYJIC = a%LFSYJIC
      b%LFSYLF3 = a%LFSYLF3
      b%LFSYLF4 = a%LFSYLF4
      b%LFSYLF6 = a%LFSYLF6
      b%LFSYLFD = a%LFSYLFD
      b%LFSYLFH = a%LFSYLFH
      b%LFSYLFT = a%LFSYLFT
      b%LFSYLHE = a%LFSYLHE
      b%LFSYLHJ = a%LFSYLHJ
      b%LFSYMSE = a%LFSYMSE
      b%LFSYNER = a%LFSYNER
      b%LFSYNI3 = a%LFSYNI3
      b%LFSYNI4 = a%LFSYNI4
      b%LFSYNI6 = a%LFSYNI6
      b%LFSYNID = a%LFSYNID
      b%LFSYNIH = a%LFSYNIH
      b%LFSYNIM = a%LFSYNIM
      b%LFSYNIT = a%LFSYNIT
      b%LFSYNMR = a%LFSYNMR
      b%LFSYOMG = a%LFSYOMG
      b%LFSYPRS = a%LFSYPRS
      b%LFSYQBE = a%LFSYQBE
      b%LFSYQBI = a%LFSYQBI
      b%LFSYQEC = a%LFSYQEC
      b%LFSYQIC = a%LFSYQIC
      b%LFSYQPR = a%LFSYQPR
      b%LFSYRES = a%LFSYRES
      b%LFSYSBI = a%LFSYSBI
      b%LFSYSIM = a%LFSYSIM
      b%LFSYTER = a%LFSYTER
      b%LFSYTI2 = a%LFSYTI2
      b%LFSYTQI = a%LFSYTQI
      b%LFSYV2F = a%LFSYV2F
      b%LFSYVB2 = a%LFSYVB2
      b%LFSYVC3 = a%LFSYVC3
      b%LFSYVC4 = a%LFSYVC4
      b%LFSYVC6 = a%LFSYVC6
      b%LFSYVCD = a%LFSYVCD
      b%LFSYVCH = a%LFSYVCH
      b%LFSYVCT = a%LFSYVCT
      b%LFSYVEE = a%LFSYVEE
      b%LFSYVIE = a%LFSYVIE
      b%LFSYVMO = a%LFSYVMO
      b%LFSYVP2 = a%LFSYVP2
      b%LFSYVPO = a%LFSYVPO
      b%LFSYVPR = a%LFSYVPR
      b%LFSYVTR = a%LFSYVTR
      b%LFSYZF2 = a%LFSYZF2
      b%LFSYZXR = a%LFSYZXR
      b%LFTER = a%LFTER
      b%LFTI2 = a%LFTI2
      b%LFTQI = a%LFTQI
      b%LFULNB = a%LFULNB
      b%LFV2F = a%LFV2F
      b%LFVB2 = a%LFVB2
      b%LFVC3 = a%LFVC3
      b%LFVC4 = a%LFVC4
      b%LFVC6 = a%LFVC6
      b%LFVCD = a%LFVCD
      b%LFVCH = a%LFVCH
      b%LFVCT = a%LFVCT
      b%LFVEE = a%LFVEE
      b%LFVIE = a%LFVIE
      b%LFVMO = a%LFVMO
      b%LFVP2 = a%LFVP2
      b%LFVPO = a%LFVPO
      b%LFVPR = a%LFVPR
      b%LFVTR = a%LFVTR
      b%LFZF2 = a%LFZF2
      b%LFZXR = a%LFZXR
      b%LHLFNB = a%LHLFNB
      b%LLIM = a%LLIM
      b%LMOMD = a%LMOMD
      b%LPELDA = a%LPELDA
      b%LPHSLH = a%LPHSLH
      b%LPMDF = a%LPMDF
      b%LPMSE = a%LPMSE
      b%LPWREC = a%LPWREC
      b%LPWRLH = a%LPWRLH
      b%LPWRNB = a%LPWRNB
      b%LPWRRF = a%LPWRRF
      b%LRFS = a%LRFS
      b%LRMFR = a%LRMFR
      b%LRMP_BDY1 = a%LRMP_BDY1
      b%LRMP_BDY2 = a%LRMP_BDY2
      b%LRMSE = a%LRMSE
      b%LRP2 = a%LRP2
      b%LRPL = a%LRPL
      b%LRPSI = a%LRPSI
      b%LSEVENT = a%LSEVENT
      b%LSSYAXR = a%LSSYAXR
      b%LSSYBOL = a%LSSYBOL
      b%LSSYBPA = a%LSSYBPA
      b%LSSYBPB = a%LSSYBPB
      b%LSSYD2F = a%LSSYD2F
      b%LSSYDE2 = a%LSSYDE2
      b%LSSYDF3 = a%LSSYDF3
      b%LSSYDF4 = a%LSSYDF4
      b%LSSYDF6 = a%LSSYDF6
      b%LSSYDFD = a%LSSYDFD
      b%LSSYDFH = a%LSSYDFH
      b%LSSYDFT = a%LSSYDFT
      b%LSSYECF = a%LSSYECF
      b%LSSYFEH = a%LSSYFEH
      b%LSSYFEL = a%LSSYFEL
      b%LSSYGRB = a%LSSYGRB
      b%LSSYIBE = a%LSSYIBE
      b%LSSYIBI = a%LSSYIBI
      b%LSSYJBM = a%LSSYJBM
      b%LSSYJEC = a%LSSYJEC
      b%LSSYJIC = a%LSSYJIC
      b%LSSYLF3 = a%LSSYLF3
      b%LSSYLF4 = a%LSSYLF4
      b%LSSYLF6 = a%LSSYLF6
      b%LSSYLFD = a%LSSYLFD
      b%LSSYLFH = a%LSSYLFH
      b%LSSYLFT = a%LSSYLFT
      b%LSSYLHE = a%LSSYLHE
      b%LSSYLHJ = a%LSSYLHJ
      b%LSSYMSE = a%LSSYMSE
      b%LSSYNER = a%LSSYNER
      b%LSSYNI3 = a%LSSYNI3
      b%LSSYNI4 = a%LSSYNI4
      b%LSSYNI6 = a%LSSYNI6
      b%LSSYNID = a%LSSYNID
      b%LSSYNIH = a%LSSYNIH
      b%LSSYNIM = a%LSSYNIM
      b%LSSYNIT = a%LSSYNIT
      b%LSSYNMR = a%LSSYNMR
      b%LSSYOMG = a%LSSYOMG
      b%LSSYPRS = a%LSSYPRS
      b%LSSYQBE = a%LSSYQBE
      b%LSSYQBI = a%LSSYQBI
      b%LSSYQEC = a%LSSYQEC
      b%LSSYQIC = a%LSSYQIC
      b%LSSYQPR = a%LSSYQPR
      b%LSSYRES = a%LSSYRES
      b%LSSYSBI = a%LSSYSBI
      b%LSSYSIM = a%LSSYSIM
      b%LSSYTER = a%LSSYTER
      b%LSSYTI2 = a%LSSYTI2
      b%LSSYTQI = a%LSSYTQI
      b%LSSYV2F = a%LSSYV2F
      b%LSSYVB2 = a%LSSYVB2
      b%LSSYVC3 = a%LSSYVC3
      b%LSSYVC4 = a%LSSYVC4
      b%LSSYVC6 = a%LSSYVC6
      b%LSSYVCD = a%LSSYVCD
      b%LSSYVCH = a%LSSYVCH
      b%LSSYVCT = a%LSSYVCT
      b%LSSYVEE = a%LSSYVEE
      b%LSSYVIE = a%LSSYVIE
      b%LSSYVMO = a%LSSYVMO
      b%LSSYVP2 = a%LSSYVP2
      b%LSSYVPO = a%LSSYVPO
      b%LSSYVPR = a%LSSYVPR
      b%LSSYVTR = a%LSSYVTR
      b%LSSYZF2 = a%LSSYZF2
      b%LSSYZXR = a%LSSYZXR
      b%LTABORT = a%LTABORT
      b%LTAEP = a%LTAEP
      b%LTFD0 = a%LTFD0
      b%LTFDB = a%LTFDB
      b%LTFDP = a%LTFDP
      b%LTFDQ = a%LTFDQ
      b%LTFDR = a%LTFDR
      b%LTFDS = a%LTFDS
      b%LTHFS = a%LTHFS
      b%LTIME1 = a%LTIME1
      b%LTIME2 = a%LTIME2
      b%LTIMEC = a%LTIMEC
      b%LTIMECA = a%LTIMECA
      b%LTIMECB = a%LTIMECB
      b%LTIMLH = a%LTIMLH
      b%LTIMNB = a%LTIMNB
      b%LTIMRF = a%LTIMRF
      b%LTIMRFF = a%LTIMRFF
      b%LTPSI = a%LTPSI
      b%LTSAW = a%LTSAW
      b%LVLTNB = a%LVLTNB
      b%LXAXR = a%LXAXR
      b%LXBOL = a%LXBOL
      b%LXBPA = a%LXBPA
      b%LXBPB = a%LXBPB
      b%LXD2F = a%LXD2F
      b%LXDE2 = a%LXDE2
      b%LXDF3 = a%LXDF3
      b%LXDF4 = a%LXDF4
      b%LXDF6 = a%LXDF6
      b%LXDFD = a%LXDFD
      b%LXDFH = a%LXDFH
      b%LXDFT = a%LXDFT
      b%LXECF = a%LXECF
      b%LXFD0 = a%LXFD0
      b%LXFDB = a%LXFDB
      b%LXFDP = a%LXFDP
      b%LXFDQ = a%LXFDQ
      b%LXFDR = a%LXFDR
      b%LXFDS = a%LXFDS
      b%LXFEH = a%LXFEH
      b%LXFEL = a%LXFEL
      b%LXFS = a%LXFS
      b%LXGRB = a%LXGRB
      b%LXIBE = a%LXIBE
      b%LXIBI = a%LXIBI
      b%LXJBM = a%LXJBM
      b%LXJEC = a%LXJEC
      b%LXJIC = a%LXJIC
      b%LXLF3 = a%LXLF3
      b%LXLF4 = a%LXLF4
      b%LXLF6 = a%LXLF6
      b%LXLFD = a%LXLFD
      b%LXLFH = a%LXLFH
      b%LXLFT = a%LXLFT
      b%LXLHE = a%LXLHE
      b%LXLHJ = a%LXLHJ
      b%LXMMX = a%LXMMX
      b%LXMSE = a%LXMSE
      b%LXNER = a%LXNER
      b%LXNI3 = a%LXNI3
      b%LXNI4 = a%LXNI4
      b%LXNI6 = a%LXNI6
      b%LXNID = a%LXNID
      b%LXNIH = a%LXNIH
      b%LXNIM = a%LXNIM
      b%LXNIT = a%LXNIT
      b%LXNMR = a%LXNMR
      b%LXOMG = a%LXOMG
      b%LXPFC = a%LXPFC
      b%LXPRS = a%LXPRS
      b%LXQBE = a%LXQBE
      b%LXQBI = a%LXQBI
      b%LXQEC = a%LXQEC
      b%LXQIC = a%LXQIC
      b%LXQPR = a%LXQPR
      b%LXRES = a%LXRES
      b%LXRP2 = a%LXRP2
      b%LXRPL = a%LXRPL
      b%LXSBI = a%LXSBI
      b%LXSIM = a%LXSIM
      b%LXSYAXR = a%LXSYAXR
      b%LXSYBOL = a%LXSYBOL
      b%LXSYBPA = a%LXSYBPA
      b%LXSYBPB = a%LXSYBPB
      b%LXSYD2F = a%LXSYD2F
      b%LXSYDE2 = a%LXSYDE2
      b%LXSYDF3 = a%LXSYDF3
      b%LXSYDF4 = a%LXSYDF4
      b%LXSYDF6 = a%LXSYDF6
      b%LXSYDFD = a%LXSYDFD
      b%LXSYDFH = a%LXSYDFH
      b%LXSYDFT = a%LXSYDFT
      b%LXSYECF = a%LXSYECF
      b%LXSYFEH = a%LXSYFEH
      b%LXSYFEL = a%LXSYFEL
      b%LXSYGRB = a%LXSYGRB
      b%LXSYIBE = a%LXSYIBE
      b%LXSYIBI = a%LXSYIBI
      b%LXSYJBM = a%LXSYJBM
      b%LXSYJEC = a%LXSYJEC
      b%LXSYJIC = a%LXSYJIC
      b%LXSYLF3 = a%LXSYLF3
      b%LXSYLF4 = a%LXSYLF4
      b%LXSYLF6 = a%LXSYLF6
      b%LXSYLFD = a%LXSYLFD
      b%LXSYLFH = a%LXSYLFH
      b%LXSYLFT = a%LXSYLFT
      b%LXSYLHE = a%LXSYLHE
      b%LXSYLHJ = a%LXSYLHJ
      b%LXSYMSE = a%LXSYMSE
      b%LXSYNER = a%LXSYNER
      b%LXSYNI3 = a%LXSYNI3
      b%LXSYNI4 = a%LXSYNI4
      b%LXSYNI6 = a%LXSYNI6
      b%LXSYNID = a%LXSYNID
      b%LXSYNIH = a%LXSYNIH
      b%LXSYNIM = a%LXSYNIM
      b%LXSYNIT = a%LXSYNIT
      b%LXSYNMR = a%LXSYNMR
      b%LXSYOMG = a%LXSYOMG
      b%LXSYPRS = a%LXSYPRS
      b%LXSYQBE = a%LXSYQBE
      b%LXSYQBI = a%LXSYQBI
      b%LXSYQEC = a%LXSYQEC
      b%LXSYQIC = a%LXSYQIC
      b%LXSYQPR = a%LXSYQPR
      b%LXSYRES = a%LXSYRES
      b%LXSYSBI = a%LXSYSBI
      b%LXSYSIM = a%LXSYSIM
      b%LXSYTER = a%LXSYTER
      b%LXSYTI2 = a%LXSYTI2
      b%LXSYTQI = a%LXSYTQI
      b%LXSYV2F = a%LXSYV2F
      b%LXSYVB2 = a%LXSYVB2
      b%LXSYVC3 = a%LXSYVC3
      b%LXSYVC4 = a%LXSYVC4
      b%LXSYVC6 = a%LXSYVC6
      b%LXSYVCD = a%LXSYVCD
      b%LXSYVCH = a%LXSYVCH
      b%LXSYVCT = a%LXSYVCT
      b%LXSYVEE = a%LXSYVEE
      b%LXSYVIE = a%LXSYVIE
      b%LXSYVMO = a%LXSYVMO
      b%LXSYVP2 = a%LXSYVP2
      b%LXSYVPO = a%LXSYVPO
      b%LXSYVPR = a%LXSYVPR
      b%LXSYVTR = a%LXSYVTR
      b%LXSYZF2 = a%LXSYZF2
      b%LXSYZXR = a%LXSYZXR
      b%LXTER = a%LXTER
      b%LXTI2 = a%LXTI2
      b%LXTQI = a%LXTQI
      b%LXV2F = a%LXV2F
      b%LXVB2 = a%LXVB2
      b%LXVC3 = a%LXVC3
      b%LXVC4 = a%LXVC4
      b%LXVC6 = a%LXVC6
      b%LXVCD = a%LXVCD
      b%LXVCH = a%LXVCH
      b%LXVCT = a%LXVCT
      b%LXVEE = a%LXVEE
      b%LXVIE = a%LXVIE
      b%LXVMO = a%LXVMO
      b%LXVP2 = a%LXVP2
      b%LXVPO = a%LXVPO
      b%LXVPR = a%LXVPR
      b%LXVTR = a%LXVTR
      b%LXZF2 = a%LXZF2
      b%LXZIMPS = a%LXZIMPS
      b%LXZIMPX = a%LXZIMPX
      b%LXZIMPXS = a%LXZIMPXS
      b%LXZXR = a%LXZXR
      b%LYRP2 = a%LYRP2
      b%LYRPL = a%LYRPL
      b%LYSIM = a%LYSIM
      b%LZFS = a%LZFS
      b%LZPSI = a%LZPSI
      b%MMAX = a%MMAX
      b%MMX_MAXE = a%MMX_MAXE
      b%MTRP2 = a%MTRP2
      b%MTRPL = a%MTRPL
      b%NANTECH_D = a%NANTECH_D
      b%NANTICH_D = a%NANTICH_D
      b%NANTLH_D = a%NANTLH_D
      b%NBDATA = a%NBDATA
      b%NBX = a%NBX
      b%NDEAEP = a%NDEAEP
      b%NDFS = a%NDFS
      b%NDMDF = a%NDMDF
      b%NDMFR = a%NDMFR
      b%NDMMX = a%NDMMX
      b%NDMSE = a%NDMSE
      b%NDPAEP = a%NDPAEP
      b%NDPFC = a%NDPFC
      b%NDPFC_PRE = a%NDPFC_PRE
      b%NEAEP = a%NEAEP
      b%NEFD0 = a%NEFD0
      b%NEFDB = a%NEFDB
      b%NEFDP = a%NEFDP
      b%NEFDQ = a%NEFDQ
      b%NEFDR = a%NEFDR
      b%NEFDS = a%NEFDS
      b%NFRBCODE = a%NFRBCODE
      b%NFRBMODE = a%NFRBMODE
      b%NGMAX_D = a%NGMAX_D
      b%NHECFT = a%NHECFT
      b%NHFMX = a%NHFMX
      b%NIMDF = a%NIMDF
      b%NISSIM = a%NISSIM
      b%NISX = a%NISX
      b%NITSIM = a%NITSIM
      b%NITX = a%NITX
      b%NKAEP = a%NKAEP
      b%NLIM = a%NLIM
      b%NMAPSIM = a%NMAPSIM
      b%NMDXKF = a%NMDXKF
      b%NMIMP = a%NMIMP
      b%NMOMD = a%NMOMD
      b%NMUAEP = a%NMUAEP
      b%NMZEFF = a%NMZEFF
      b%NNSIM = a%NNSIM
      b%NPACK = a%NPACK
      b%NPAEP = a%NPAEP
      b%NPELDA = a%NPELDA
      b%NPMDF = a%NPMDF
      b%NPMSE = a%NPMSE
      b%NRHIS = a%NRHIS
      b%NRHIX = a%NRHIX
      b%NRIAXR = a%NRIAXR
      b%NRIBOL = a%NRIBOL
      b%NRIBPA = a%NRIBPA
      b%NRIBPB = a%NRIBPB
      b%NRID2F = a%NRID2F
      b%NRIDE2 = a%NRIDE2
      b%NRIDF3 = a%NRIDF3
      b%NRIDF4 = a%NRIDF4
      b%NRIDF6 = a%NRIDF6
      b%NRIDFD = a%NRIDFD
      b%NRIDFH = a%NRIDFH
      b%NRIDFT = a%NRIDFT
      b%NRIECF = a%NRIECF
      b%NRIFD0 = a%NRIFD0
      b%NRIFDB = a%NRIFDB
      b%NRIFDP = a%NRIFDP
      b%NRIFDQ = a%NRIFDQ
      b%NRIFDR = a%NRIFDR
      b%NRIFDS = a%NRIFDS
      b%NRIFEH = a%NRIFEH
      b%NRIFEL = a%NRIFEL
      b%NRIGRB = a%NRIGRB
      b%NRIIBE = a%NRIIBE
      b%NRIIBI = a%NRIIBI
      b%NRIJBM = a%NRIJBM
      b%NRIJEC = a%NRIJEC
      b%NRIJIC = a%NRIJIC
      b%NRILF3 = a%NRILF3
      b%NRILF4 = a%NRILF4
      b%NRILF6 = a%NRILF6
      b%NRILFD = a%NRILFD
      b%NRILFH = a%NRILFH
      b%NRILFT = a%NRILFT
      b%NRILHE = a%NRILHE
      b%NRILHJ = a%NRILHJ
      b%NRIMSE = a%NRIMSE
      b%NRINER = a%NRINER
      b%NRINI3 = a%NRINI3
      b%NRINI4 = a%NRINI4
      b%NRINI6 = a%NRINI6
      b%NRINID = a%NRINID
      b%NRINIH = a%NRINIH
      b%NRINIM = a%NRINIM
      b%NRINIT = a%NRINIT
      b%NRINMR = a%NRINMR
      b%NRIOMG = a%NRIOMG
      b%NRIPRS = a%NRIPRS
      b%NRIQBE = a%NRIQBE
      b%NRIQBI = a%NRIQBI
      b%NRIQEC = a%NRIQEC
      b%NRIQIC = a%NRIQIC
      b%NRIQPR = a%NRIQPR
      b%NRIRES = a%NRIRES
      b%NRISBI = a%NRISBI
      b%NRISIM = a%NRISIM
      b%NRITER = a%NRITER
      b%NRITI2 = a%NRITI2
      b%NRITQI = a%NRITQI
      b%NRIV2F = a%NRIV2F
      b%NRIVB2 = a%NRIVB2
      b%NRIVC3 = a%NRIVC3
      b%NRIVC4 = a%NRIVC4
      b%NRIVC6 = a%NRIVC6
      b%NRIVCD = a%NRIVCD
      b%NRIVCH = a%NRIVCH
      b%NRIVCT = a%NRIVCT
      b%NRIVEE = a%NRIVEE
      b%NRIVIE = a%NRIVIE
      b%NRIVMO = a%NRIVMO
      b%NRIVP2 = a%NRIVP2
      b%NRIVPO = a%NRIVPO
      b%NRIVPR = a%NRIVPR
      b%NRIVTR = a%NRIVTR
      b%NRIZF2 = a%NRIZF2
      b%NRIZXR = a%NRIZXR
      b%NRMFR = a%NRMFR
      b%NRMSE = a%NRMSE
      b%NRP2 = a%NRP2
      b%NRPL = a%NRPL
      b%NRPSI = a%NRPSI
      b%NSAWFLAG = a%NSAWFLAG
      b%NSC = a%NSC
      b%NSC_FMT = a%NSC_FMT
      b%NSEVENT = a%NSEVENT
      b%NSEVPER = a%NSEVPER
      b%NSEVTBL = a%NSEVTBL
      b%NSEVWDS = a%NSEVWDS
      b%NSFAST_D = a%NSFAST_D
      b%NSYAXR = a%NSYAXR
      b%NSYBOL = a%NSYBOL
      b%NSYBPA = a%NSYBPA
      b%NSYBPB = a%NSYBPB
      b%NSYD2F = a%NSYD2F
      b%NSYDE2 = a%NSYDE2
      b%NSYDF3 = a%NSYDF3
      b%NSYDF4 = a%NSYDF4
      b%NSYDF6 = a%NSYDF6
      b%NSYDFD = a%NSYDFD
      b%NSYDFH = a%NSYDFH
      b%NSYDFT = a%NSYDFT
      b%NSYECF = a%NSYECF
      b%NSYFEH = a%NSYFEH
      b%NSYFEL = a%NSYFEL
      b%NSYGRB = a%NSYGRB
      b%NSYIBE = a%NSYIBE
      b%NSYIBI = a%NSYIBI
      b%NSYJBM = a%NSYJBM
      b%NSYJEC = a%NSYJEC
      b%NSYJIC = a%NSYJIC
      b%NSYLF3 = a%NSYLF3
      b%NSYLF4 = a%NSYLF4
      b%NSYLF6 = a%NSYLF6
      b%NSYLFD = a%NSYLFD
      b%NSYLFH = a%NSYLFH
      b%NSYLFT = a%NSYLFT
      b%NSYLHE = a%NSYLHE
      b%NSYLHJ = a%NSYLHJ
      b%NSYMSE = a%NSYMSE
      b%NSYNER = a%NSYNER
      b%NSYNI3 = a%NSYNI3
      b%NSYNI4 = a%NSYNI4
      b%NSYNI6 = a%NSYNI6
      b%NSYNID = a%NSYNID
      b%NSYNIH = a%NSYNIH
      b%NSYNIM = a%NSYNIM
      b%NSYNIT = a%NSYNIT
      b%NSYNMR = a%NSYNMR
      b%NSYOMG = a%NSYOMG
      b%NSYPRS = a%NSYPRS
      b%NSYQBE = a%NSYQBE
      b%NSYQBI = a%NSYQBI
      b%NSYQEC = a%NSYQEC
      b%NSYQIC = a%NSYQIC
      b%NSYQPR = a%NSYQPR
      b%NSYRES = a%NSYRES
      b%NSYSBI = a%NSYSBI
      b%NSYSIM = a%NSYSIM
      b%NSYTER = a%NSYTER
      b%NSYTI2 = a%NSYTI2
      b%NSYTQI = a%NSYTQI
      b%NSYV2F = a%NSYV2F
      b%NSYVB2 = a%NSYVB2
      b%NSYVC3 = a%NSYVC3
      b%NSYVC4 = a%NSYVC4
      b%NSYVC6 = a%NSYVC6
      b%NSYVCD = a%NSYVCD
      b%NSYVCH = a%NSYVCH
      b%NSYVCT = a%NSYVCT
      b%NSYVEE = a%NSYVEE
      b%NSYVIE = a%NSYVIE
      b%NSYVMO = a%NSYVMO
      b%NSYVP2 = a%NSYVP2
      b%NSYVPO = a%NSYVPO
      b%NSYVPR = a%NSYVPR
      b%NSYVTR = a%NSYVTR
      b%NSYZF2 = a%NSYZF2
      b%NSYZXR = a%NSYZXR
      b%NTABORT = a%NTABORT
      b%NTAEP = a%NTAEP
      b%NTFD0 = a%NTFD0
      b%NTFDB = a%NTFDB
      b%NTFDP = a%NTFDP
      b%NTFDQ = a%NTFDQ
      b%NTFDR = a%NTFDR
      b%NTFDS = a%NTFDS
      b%NTHFS = a%NTHFS
      b%NTIME1 = a%NTIME1
      b%NTIME2 = a%NTIME2
      b%NTIMEC = a%NTIMEC
      b%NTIMECA = a%NTIMECA
      b%NTIMECB = a%NTIMECB
      b%NTIMLH = a%NTIMLH
      b%NTIMNB = a%NTIMNB
      b%NTIMRF = a%NTIMRF
      b%NTIMRFF = a%NTIMRFF
      b%NTPSI = a%NTPSI
      b%NTSAW = a%NTSAW
      b%NXAXR = a%NXAXR
      b%NXBOL = a%NXBOL
      b%NXBPA = a%NXBPA
      b%NXBPB = a%NXBPB
      b%NXD2F = a%NXD2F
      b%NXDE2 = a%NXDE2
      b%NXDF3 = a%NXDF3
      b%NXDF4 = a%NXDF4
      b%NXDF6 = a%NXDF6
      b%NXDFD = a%NXDFD
      b%NXDFH = a%NXDFH
      b%NXDFT = a%NXDFT
      b%NXECF = a%NXECF
      b%NXFD0 = a%NXFD0
      b%NXFDB = a%NXFDB
      b%NXFDP = a%NXFDP
      b%NXFDQ = a%NXFDQ
      b%NXFDR = a%NXFDR
      b%NXFDS = a%NXFDS
      b%NXFEH = a%NXFEH
      b%NXFEL = a%NXFEL
      b%NXFS = a%NXFS
      b%NXGRB = a%NXGRB
      b%NXIBE = a%NXIBE
      b%NXIBI = a%NXIBI
      b%NXJBM = a%NXJBM
      b%NXJEC = a%NXJEC
      b%NXJIC = a%NXJIC
      b%NXLF3 = a%NXLF3
      b%NXLF4 = a%NXLF4
      b%NXLF6 = a%NXLF6
      b%NXLFD = a%NXLFD
      b%NXLFH = a%NXLFH
      b%NXLFT = a%NXLFT
      b%NXLHE = a%NXLHE
      b%NXLHJ = a%NXLHJ
      b%NXMMX = a%NXMMX
      b%NXMSE = a%NXMSE
      b%NXNE0 = a%NXNE0
      b%NXNER = a%NXNER
      b%NXNI3 = a%NXNI3
      b%NXNI4 = a%NXNI4
      b%NXNI6 = a%NXNI6
      b%NXNID = a%NXNID
      b%NXNIH = a%NXNIH
      b%NXNIM = a%NXNIM
      b%NXNIT = a%NXNIT
      b%NXNM0 = a%NXNM0
      b%NXNMR = a%NXNMR
      b%NXOMG = a%NXOMG
      b%NXPFC = a%NXPFC
      b%NXPRS = a%NXPRS
      b%NXQBE = a%NXQBE
      b%NXQBI = a%NXQBI
      b%NXQEC = a%NXQEC
      b%NXQIC = a%NXQIC
      b%NXQPR = a%NXQPR
      b%NXRES = a%NXRES
      b%NXRP2 = a%NXRP2
      b%NXRPL = a%NXRPL
      b%NXSBI = a%NXSBI
      b%NXSIM = a%NXSIM
      b%NXSYAXR = a%NXSYAXR
      b%NXSYBOL = a%NXSYBOL
      b%NXSYBPA = a%NXSYBPA
      b%NXSYBPB = a%NXSYBPB
      b%NXSYD2F = a%NXSYD2F
      b%NXSYDE2 = a%NXSYDE2
      b%NXSYDF3 = a%NXSYDF3
      b%NXSYDF4 = a%NXSYDF4
      b%NXSYDF6 = a%NXSYDF6
      b%NXSYDFD = a%NXSYDFD
      b%NXSYDFH = a%NXSYDFH
      b%NXSYDFT = a%NXSYDFT
      b%NXSYECF = a%NXSYECF
      b%NXSYFEH = a%NXSYFEH
      b%NXSYFEL = a%NXSYFEL
      b%NXSYGRB = a%NXSYGRB
      b%NXSYIBE = a%NXSYIBE
      b%NXSYIBI = a%NXSYIBI
      b%NXSYJBM = a%NXSYJBM
      b%NXSYJEC = a%NXSYJEC
      b%NXSYJIC = a%NXSYJIC
      b%NXSYLF3 = a%NXSYLF3
      b%NXSYLF4 = a%NXSYLF4
      b%NXSYLF6 = a%NXSYLF6
      b%NXSYLFD = a%NXSYLFD
      b%NXSYLFH = a%NXSYLFH
      b%NXSYLFT = a%NXSYLFT
      b%NXSYLHE = a%NXSYLHE
      b%NXSYLHJ = a%NXSYLHJ
      b%NXSYMSE = a%NXSYMSE
      b%NXSYNER = a%NXSYNER
      b%NXSYNI3 = a%NXSYNI3
      b%NXSYNI4 = a%NXSYNI4
      b%NXSYNI6 = a%NXSYNI6
      b%NXSYNID = a%NXSYNID
      b%NXSYNIH = a%NXSYNIH
      b%NXSYNIM = a%NXSYNIM
      b%NXSYNIT = a%NXSYNIT
      b%NXSYNMR = a%NXSYNMR
      b%NXSYOMG = a%NXSYOMG
      b%NXSYPRS = a%NXSYPRS
      b%NXSYQBE = a%NXSYQBE
      b%NXSYQBI = a%NXSYQBI
      b%NXSYQEC = a%NXSYQEC
      b%NXSYQIC = a%NXSYQIC
      b%NXSYQPR = a%NXSYQPR
      b%NXSYRES = a%NXSYRES
      b%NXSYSBI = a%NXSYSBI
      b%NXSYSIM = a%NXSYSIM
      b%NXSYTER = a%NXSYTER
      b%NXSYTI2 = a%NXSYTI2
      b%NXSYTQI = a%NXSYTQI
      b%NXSYV2F = a%NXSYV2F
      b%NXSYVB2 = a%NXSYVB2
      b%NXSYVC3 = a%NXSYVC3
      b%NXSYVC4 = a%NXSYVC4
      b%NXSYVC6 = a%NXSYVC6
      b%NXSYVCD = a%NXSYVCD
      b%NXSYVCH = a%NXSYVCH
      b%NXSYVCT = a%NXSYVCT
      b%NXSYVEE = a%NXSYVEE
      b%NXSYVIE = a%NXSYVIE
      b%NXSYVMO = a%NXSYVMO
      b%NXSYVP2 = a%NXSYVP2
      b%NXSYVPO = a%NXSYVPO
      b%NXSYVPR = a%NXSYVPR
      b%NXSYVTR = a%NXSYVTR
      b%NXSYZF2 = a%NXSYZF2
      b%NXSYZXR = a%NXSYZXR
      b%NXTE0 = a%NXTE0
      b%NXTER = a%NXTER
      b%NXTI2 = a%NXTI2
      b%NXTQI = a%NXTQI
      b%NXV2F = a%NXV2F
      b%NXVB2 = a%NXVB2
      b%NXVC3 = a%NXVC3
      b%NXVC4 = a%NXVC4
      b%NXVC6 = a%NXVC6
      b%NXVCD = a%NXVCD
      b%NXVCH = a%NXVCH
      b%NXVCT = a%NXVCT
      b%NXVEE = a%NXVEE
      b%NXVIE = a%NXVIE
      b%NXVMO = a%NXVMO
      b%NXVP2 = a%NXVP2
      b%NXVPO = a%NXVPO
      b%NXVPR = a%NXVPR
      b%NXVTR = a%NXVTR
      b%NXZEF2 = a%NXZEF2
      b%NXZF2 = a%NXZF2
      b%NXZXR = a%NXZXR
      b%NYRP2 = a%NYRP2
      b%NYRPL = a%NYRPL
      b%NZPSI = a%NZPSI
 
    end subroutine trdatbuf_copy
    logical function tdb_defined1(d,ztrigraph)
      type (trdatbuf) :: d
      character*(*), intent(in) :: ztrigraph
 
      character*3 ztri
 
      ztri = ztrigraph(1:min(3,len(ztrigraph)))
      call uupper(ztri)  ! convert to upper case (portlib routine)
 
      tdb_defined1 = .FALSE.
 
      if(ztri.eq.'ALP') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'BDI') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'CUR') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'DFL') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'DTG') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'DTS') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'DTX') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'EDI') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'EHP') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ELI') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'FGW') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'FIE') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'FMN') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'FMX') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GAS') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GF3') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GF4') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GF6') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GFD') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GFH') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GFT') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'GIE') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'HAL') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'IBM') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'IEC') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'IIC') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ILH') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'L2B') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'LAD') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'LID') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'NTX') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'OGF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ORC') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PBE') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PBI') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PEB') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PEC') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PF0') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PFH') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PFL') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PIB') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PIC') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PLF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'PLH') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'POS') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RBZ') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RC3') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RC4') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RC6') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RCD') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RCH') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RCT') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RCY') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RMN') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'RTP') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SBT') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SF3') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SFA') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SFL') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SFP') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SFT') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'SP3') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TET') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TGF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TIT') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TPI') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TQT') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TRC') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TRF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'TXI') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'VPH') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'VSB') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'VSF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'XKF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ZEF') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ZFA') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ZIM') then
         tdb_defined1 = .TRUE.
      endif
      if(ztri.eq.'ZPL') then
         tdb_defined1 = .TRUE.
      endif
 
    end function tdb_defined1
    logical function tdb_defined2(d,ztrigraph)
      type (trdatbuf) :: d
      character*(*), intent(in) :: ztrigraph
 
      character*3 ztri
 
      ztri = ztrigraph(1:min(3,len(ztrigraph)))
      call uupper(ztri)  ! convert to upper case (portlib routine)
 
      tdb_defined2 = .FALSE.
 
      if(ztri.eq.'AXR') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'BOL') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'BPA') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'BPB') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'D2F') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DE2') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DF3') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DF4') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DF6') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DFD') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DFH') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'DFT') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'ECF') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FD0') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FDB') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FDP') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FDQ') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FDR') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FDS') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FEH') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'FEL') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'GRB') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'IBE') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'IBI') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'JBM') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'JEC') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'JIC') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LF3') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LF4') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LF6') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LFD') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LFH') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LFT') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LHE') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'LHJ') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'MSE') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NER') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NI3') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NI4') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NI6') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NID') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NIH') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NIM') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NIT') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'NMR') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'OMG') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'PRS') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'QBE') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'QBI') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'QEC') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'QIC') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'QPR') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'RES') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'SBI') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'SIM') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'TER') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'TI2') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'TQI') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'V2F') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VB2') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VC3') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VC4') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VC6') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VCD') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VCH') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VCT') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VEE') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VIE') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VMO') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VP2') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VPO') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VPR') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'VTR') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'ZF2') then
         tdb_defined2 = .TRUE.
      endif
      if(ztri.eq.'ZXR') then
         tdb_defined2 = .TRUE.
      endif
 
    end function tdb_defined2
    logical function tdb_present1(d,ztrigraph,iaddr)
      type (trdatbuf) :: d
      character*(*), intent(in) :: ztrigraph
      integer, intent(out), optional :: iaddr
 
      integer :: iadr
      character*3 ztri
      integer :: lunmsg_tdb ! integer function lunmsg_tdb(idum)
 
      iadr = -1
      ztri = ztrigraph(1:min(3,len(ztrigraph)))
      call uupper(ztri)  ! convert to upper case (portlib routine)
 
      if(ztri.eq.'ALP') then
         iadr = d%LDATALP
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'BDI') then
         iadr = d%LDATBDI
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'CUR') then
         iadr = d%LDATCUR
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'DFL') then
         iadr = d%LDATDFL
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'DTG') then
         iadr = d%LDATDTG
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'DTS') then
         iadr = d%LDATDTS
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'DTX') then
         iadr = d%LDATDTX
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'EDI') then
         iadr = d%LDATEDI
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'EHP') then
         iadr = d%LDATEHP
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ELI') then
         iadr = d%LDATELI
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'FGW') then
         iadr = d%LDATFGW
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'FIE') then
         iadr = d%LDATFIE
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'FMN') then
         iadr = d%LDATFMN
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'FMX') then
         iadr = d%LDATFMX
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GAS') then
         iadr = d%LDATGAS
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GF3') then
         iadr = d%LDATGF3
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GF4') then
         iadr = d%LDATGF4
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GF6') then
         iadr = d%LDATGF6
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GFD') then
         iadr = d%LDATGFD
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GFH') then
         iadr = d%LDATGFH
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GFT') then
         iadr = d%LDATGFT
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'GIE') then
         iadr = d%LDATGIE
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'HAL') then
         iadr = d%LDATHAL
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'IBM') then
         iadr = d%LDATIBM
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'IEC') then
         iadr = d%LDATIEC
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'IIC') then
         iadr = d%LDATIIC
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ILH') then
         iadr = d%LDATILH
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'L2B') then
         iadr = d%LDATL2B
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'LAD') then
         iadr = d%LDATLAD
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'LID') then
         iadr = d%LDATLID
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'NTX') then
         iadr = d%LDATNTX
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'OGF') then
         iadr = d%LDATOGF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ORC') then
         iadr = d%LDATORC
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PBE') then
         iadr = d%LDATPBE
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PBI') then
         iadr = d%LDATPBI
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PEB') then
         iadr = d%LDATPEB
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PEC') then
         iadr = d%LDATPEC
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PF0') then
         iadr = d%LDATPF0
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PFH') then
         iadr = d%LDATPFH
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PFL') then
         iadr = d%LDATPFL
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PIB') then
         iadr = d%LDATPIB
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PIC') then
         iadr = d%LDATPIC
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PLF') then
         iadr = d%LDATPLF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'PLH') then
         iadr = d%LDATPLH
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'POS') then
         iadr = d%LDATPOS
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RBZ') then
         iadr = d%LDATRBZ
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RC3') then
         iadr = d%LDATRC3
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RC4') then
         iadr = d%LDATRC4
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RC6') then
         iadr = d%LDATRC6
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RCD') then
         iadr = d%LDATRCD
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RCH') then
         iadr = d%LDATRCH
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RCT') then
         iadr = d%LDATRCT
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RCY') then
         iadr = d%LDATRCY
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RMN') then
         iadr = d%LDATRMN
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'RTP') then
         iadr = d%LDATRTP
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SBT') then
         iadr = d%LDATSBT
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SF3') then
         iadr = d%LDATSF3
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SFA') then
         iadr = d%LDATSFA
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SFL') then
         iadr = d%LDATSFL
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SFP') then
         iadr = d%LDATSFP
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SFT') then
         iadr = d%LDATSFT
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'SP3') then
         iadr = d%LDATSP3
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TET') then
         iadr = d%LDATTET
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TGF') then
         iadr = d%LDATTGF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TIT') then
         iadr = d%LDATTIT
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TPI') then
         iadr = d%LDATTPI
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TQT') then
         iadr = d%LDATTQT
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TRC') then
         iadr = d%LDATTRC
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TRF') then
         iadr = d%LDATTRF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'TXI') then
         iadr = d%LDATTXI
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'VPH') then
         iadr = d%LDATVPH
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'VSB') then
         iadr = d%LDATVSB
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'VSF') then
         iadr = d%LDATVSF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'XKF') then
         iadr = d%LDATXKF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ZEF') then
         iadr = d%LDATZEF
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ZFA') then
         iadr = d%LDATZFA
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ZIM') then
         iadr = d%LDATZIM
         tdb_present1 = (iadr.gt.0)
      endif
      if(ztri.eq.'ZPL') then
         iadr = d%LDATZPL
         tdb_present1 = (iadr.gt.0)
      endif
 
      if(iadr.eq.-1) then
         write(lunmsg_tdb(0),*) ' ?tdb_present1: unknown scalar data type: ', &
               ztri
         tdb_present1 = .FALSE.
      endif
      if(present(iaddr)) iaddr=iadr
    end function tdb_present1
    logical function tdb_present2(d,ztrigraph,iaddr,iaddx,inumx)
      type (trdatbuf) :: d
      character*(*), intent(in) :: ztrigraph
      integer, intent(out),optional :: iaddr,iaddx,inumx
 
      integer :: iadr,iadx,inx
      character*3 ztri
      integer :: lunmsg_tdb ! integer function lunmsg_tdb(idum)
 
      iadr = -1
      ztri = ztrigraph(1:min(3,len(ztrigraph)))
      call uupper(ztri)  ! convert to upper case (portlib routine)
 
      if(ztri.eq.'AXR') then
         iadr = d%LFAXR
         iadx = d%LXAXR
         inx = d%NXAXR
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'BOL') then
         iadr = d%LFBOL
         iadx = d%LXBOL
         inx = d%NXBOL
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'BPA') then
         iadr = d%LFBPA
         iadx = d%LXBPA
         inx = d%NXBPA
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'BPB') then
         iadr = d%LFBPB
         iadx = d%LXBPB
         inx = d%NXBPB
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'D2F') then
         iadr = d%LFD2F
         iadx = d%LXD2F
         inx = d%NXD2F
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DE2') then
         iadr = d%LFDE2
         iadx = d%LXDE2
         inx = d%NXDE2
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DF3') then
         iadr = d%LFDF3
         iadx = d%LXDF3
         inx = d%NXDF3
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DF4') then
         iadr = d%LFDF4
         iadx = d%LXDF4
         inx = d%NXDF4
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DF6') then
         iadr = d%LFDF6
         iadx = d%LXDF6
         inx = d%NXDF6
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DFD') then
         iadr = d%LFDFD
         iadx = d%LXDFD
         inx = d%NXDFD
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DFH') then
         iadr = d%LFDFH
         iadx = d%LXDFH
         inx = d%NXDFH
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'DFT') then
         iadr = d%LFDFT
         iadx = d%LXDFT
         inx = d%NXDFT
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'ECF') then
         iadr = d%LFECF
         iadx = d%LXECF
         inx = d%NXECF
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FD0') then
         iadr = d%LFFD0
         iadx = d%LXFD0
         inx = d%NXFD0
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FDB') then
         iadr = d%LFFDB
         iadx = d%LXFDB
         inx = d%NXFDB
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FDP') then
         iadr = d%LFFDP
         iadx = d%LXFDP
         inx = d%NXFDP
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FDQ') then
         iadr = d%LFFDQ
         iadx = d%LXFDQ
         inx = d%NXFDQ
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FDR') then
         iadr = d%LFFDR
         iadx = d%LXFDR
         inx = d%NXFDR
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FDS') then
         iadr = d%LFFDS
         iadx = d%LXFDS
         inx = d%NXFDS
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FEH') then
         iadr = d%LFFEH
         iadx = d%LXFEH
         inx = d%NXFEH
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'FEL') then
         iadr = d%LFFEL
         iadx = d%LXFEL
         inx = d%NXFEL
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'GRB') then
         iadr = d%LFGRB
         iadx = d%LXGRB
         inx = d%NXGRB
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'IBE') then
         iadr = d%LFIBE
         iadx = d%LXIBE
         inx = d%NXIBE
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'IBI') then
         iadr = d%LFIBI
         iadx = d%LXIBI
         inx = d%NXIBI
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'JBM') then
         iadr = d%LFJBM
         iadx = d%LXJBM
         inx = d%NXJBM
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'JEC') then
         iadr = d%LFJEC
         iadx = d%LXJEC
         inx = d%NXJEC
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'JIC') then
         iadr = d%LFJIC
         iadx = d%LXJIC
         inx = d%NXJIC
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LF3') then
         iadr = d%LFLF3
         iadx = d%LXLF3
         inx = d%NXLF3
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LF4') then
         iadr = d%LFLF4
         iadx = d%LXLF4
         inx = d%NXLF4
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LF6') then
         iadr = d%LFLF6
         iadx = d%LXLF6
         inx = d%NXLF6
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LFD') then
         iadr = d%LFLFD
         iadx = d%LXLFD
         inx = d%NXLFD
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LFH') then
         iadr = d%LFLFH
         iadx = d%LXLFH
         inx = d%NXLFH
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LFT') then
         iadr = d%LFLFT
         iadx = d%LXLFT
         inx = d%NXLFT
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LHE') then
         iadr = d%LFLHE
         iadx = d%LXLHE
         inx = d%NXLHE
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'LHJ') then
         iadr = d%LFLHJ
         iadx = d%LXLHJ
         inx = d%NXLHJ
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'MSE') then
         iadr = d%LFMSE
         iadx = d%LXMSE
         inx = d%NXMSE
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NER') then
         iadr = d%LFNER
         iadx = d%LXNER
         inx = d%NXNER
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NI3') then
         iadr = d%LFNI3
         iadx = d%LXNI3
         inx = d%NXNI3
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NI4') then
         iadr = d%LFNI4
         iadx = d%LXNI4
         inx = d%NXNI4
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NI6') then
         iadr = d%LFNI6
         iadx = d%LXNI6
         inx = d%NXNI6
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NID') then
         iadr = d%LFNID
         iadx = d%LXNID
         inx = d%NXNID
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NIH') then
         iadr = d%LFNIH
         iadx = d%LXNIH
         inx = d%NXNIH
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NIM') then
         iadr = d%LFNIM
         iadx = d%LXNIM
         inx = d%NXNIM
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NIT') then
         iadr = d%LFNIT
         iadx = d%LXNIT
         inx = d%NXNIT
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'NMR') then
         iadr = d%LFNMR
         iadx = d%LXNMR
         inx = d%NXNMR
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'OMG') then
         iadr = d%LFOMG
         iadx = d%LXOMG
         inx = d%NXOMG
         if(iadr.eq.0) then
            iadr = d%LFVP2
            iadx = d%LXVP2
            inx = d%NXVP2
         endif
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'PRS') then
         iadr = d%LFPRS
         iadx = d%LXPRS
         inx = d%NXPRS
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'QBE') then
         iadr = d%LFQBE
         iadx = d%LXQBE
         inx = d%NXQBE
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'QBI') then
         iadr = d%LFQBI
         iadx = d%LXQBI
         inx = d%NXQBI
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'QEC') then
         iadr = d%LFQEC
         iadx = d%LXQEC
         inx = d%NXQEC
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'QIC') then
         iadr = d%LFQIC
         iadx = d%LXQIC
         inx = d%NXQIC
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'QPR') then
         iadr = d%LFQPR
         iadx = d%LXQPR
         inx = d%NXQPR
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'RES') then
         iadr = d%LFRES
         iadx = d%LXRES
         inx = d%NXRES
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'SBI') then
         iadr = d%LFSBI
         iadx = d%LXSBI
         inx = d%NXSBI
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'SIM') then
         iadr = maxval(d%LFSIM)
         iadx = 0
         inx = 0
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'TER') then
         iadr = d%LFTER
         iadx = d%LXTER
         inx = d%NXTER
         if(iadr.eq.0) then
            iadr = d%LFECF
            iadx = d%LXECF
            inx = d%NXECF
         endif
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'TI2') then
         iadr = d%LFTI2
         iadx = d%LXTI2
         inx = d%NXTI2
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'TQI') then
         iadr = d%LFTQI
         iadx = d%LXTQI
         inx = d%NXTQI
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'V2F') then
         iadr = d%LFV2F
         iadx = d%LXV2F
         inx = d%NXV2F
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VB2') then
         iadr = d%LFVB2
         iadx = d%LXVB2
         inx = d%NXVB2
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VC3') then
         iadr = d%LFVC3
         iadx = d%LXVC3
         inx = d%NXVC3
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VC4') then
         iadr = d%LFVC4
         iadx = d%LXVC4
         inx = d%NXVC4
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VC6') then
         iadr = d%LFVC6
         iadx = d%LXVC6
         inx = d%NXVC6
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VCD') then
         iadr = d%LFVCD
         iadx = d%LXVCD
         inx = d%NXVCD
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VCH') then
         iadr = d%LFVCH
         iadx = d%LXVCH
         inx = d%NXVCH
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VCT') then
         iadr = d%LFVCT
         iadx = d%LXVCT
         inx = d%NXVCT
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VEE') then
         iadr = d%LFVEE
         iadx = d%LXVEE
         inx = d%NXVEE
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VIE') then
         iadr = d%LFVIE
         iadx = d%LXVIE
         inx = d%NXVIE
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VMO') then
         iadr = d%LFVMO
         iadx = d%LXVMO
         inx = d%NXVMO
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VP2') then
         iadr = d%LFVP2
         iadx = d%LXVP2
         inx = d%NXVP2
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VPO') then
         iadr = d%LFVPO
         iadx = d%LXVPO
         inx = d%NXVPO
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VPR') then
         iadr = d%LFVPR
         iadx = d%LXVPR
         inx = d%NXVPR
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'VTR') then
         iadr = d%LFVTR
         iadx = d%LXVTR
         inx = d%NXVTR
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'ZF2') then
         iadr = d%LFZF2
         iadx = d%LXZF2
         inx = d%NXZF2
         tdb_present2 = (iadr.gt.0)
      endif
      if(ztri.eq.'ZXR') then
         iadr = d%LFZXR
         iadx = d%LXZXR
         inx = d%NXZXR
         tdb_present2 = (iadr.gt.0)
      endif
 
      if(iadr.eq.-1) then
         write(lunmsg_tdb(0),*) ' ?tdb_present2: unknown profile data type: ', &
               ztri
         tdb_present2 = .FALSE.
      endif
      if(present(iaddr)) iaddr = iadr
      if(present(iaddx)) iaddx = iadx
      if(present(inumx)) inumx = inx
    end function tdb_present2
    subroutine trdatbuf_expand(arr,ineed,isize_new)
 
      ! check size of 1d pointer array; expand & copy if necessary
 
      real*8, dimension(:), pointer :: arr
      integer, intent(in) :: ineed      ! min. size datbuf needed
      integer, intent(out) :: isize_new ! actual datbuf size
 
      integer :: isize_old,istat
      real*8, dimension(:), pointer :: ztmp
      real*8, parameter :: ZERO = 0.0d0
 
      !-----------------------------------------
 
      isize_new = size(arr)
      if(ineed.le.isize_new) return
 
      !  bigger buffer needed
 
      isize_old = isize_new
 
      do
        isize_new = 2*isize_new
        if(isize_new.gt.ineed) exit
      enddo
 
      allocate(ztmp(isize_new),stat=istat)
      if(istat.ne.0) then
        call errmsg_exit(' ?? trdatbuf_expand: memory alloc failed.')
      endif
 
      ztmp(1:isize_old) = arr
      ztmp(isize_old+1:isize_new) = ZERO
      deallocate(arr)
 
      arr => ztmp
    end subroutine trdatbuf_expand
 
    subroutine DATBUF_expand(s,ineed,isize_new)
 
      type (trdatbuf) :: s
      integer, intent(in) :: ineed       ! min. size datbuf needed
      integer, intent(out) :: isize_new  ! actual datbuf size
 
      call trdatbuf_expand(s%DATBUF,ineed,isize_new)
    end subroutine DATBUF_expand
    subroutine WORKBUF_expand(s,ineed,isize_new)
 
      type (trdatbuf) :: s
      integer, intent(in) :: ineed       ! min. size datbuf needed
      integer, intent(out) :: isize_new  ! actual datbuf size
 
      call trdatbuf_expand(s%WORKBUF,ineed,isize_new)
    end subroutine WORKBUF_expand
 
end module trdatbuf_obj
