|
|
|
SUBROUTINE ADDMAP
|
|
|
|
!
|
|
|
|
! ROUTINE TO ADD TWO MAPS FILES TOGETHER
|
|
|
|
!
|
|
|
|
|
|
|
|
USE WINTERACTER
|
|
|
|
|
|
|
|
USE BLKMAP
|
|
|
|
USE BLK1MOD
|
|
|
|
USE BLK2MOD
|
|
|
|
|
|
|
|
include 'd.inc'
|
|
|
|
|
|
|
|
|
|
|
|
CHARACTER(LEN=255) :: FNAME,FNAMGE,FNAMRM,FNAMEB
|
|
|
|
CHARACTER(LEN=3) :: SUB,SUB1
|
|
|
|
|
|
|
|
! FIRST WRITE EXISTING MAP TO SCRATCH
|
|
|
|
close(99)
|
|
|
|
OPEN(99,FORM='BINARY',STATUS='SCRATCH')
|
|
|
|
|
|
|
|
|
|
|
|
! SAVE THE CONTROL INFORMATION
|
|
|
|
KEEP1=klint
|
|
|
|
JEEP1=jlint
|
|
|
|
|
|
|
|
CALL WRTMAP(99)
|
|
|
|
REWIND 99
|
|
|
|
|
|
|
|
! NEXT READ NEW MAP AND ALSO WRITE TO A SECOND SCRATCH
|
|
|
|
! FIRST OPEN A MAP FILE
|
|
|
|
CALL WSelectFile(ID_STRING1,PromptOn,FNAME,'Load Map File')
|
|
|
|
|
|
|
|
IF (WInfoDialog(ExitButtonCommon).EQ.CommonOpen) THEN
|
|
|
|
|
|
|
|
CALL IlowerCase(FNAME)
|
|
|
|
CALL GETSUB(FNAME,SUB)
|
|
|
|
|
|
|
|
IF(SUB .EQ. 'map') then
|
|
|
|
IMP=9
|
|
|
|
OPEN(9,FILE=FNAME,STATUS='OLD')
|
|
|
|
ELSEIF(SUB .EQ. 'asc' .or. SUB .EQ. 'grd') then
|
|
|
|
IMP=94
|
|
|
|
OPEN(94,FILE=FNAME,STATUS='OLD')
|
|
|
|
ELSEIF(SUB .EQ. 'mpb') then
|
|
|
|
imp=92
|
|
|
|
OPEN(IMP ,FILE=FNAME,STATUS='OLD',form='unformatted',action='read')
|
|
|
|
ELSEIF(SUB .EQ. 'mbb') then
|
|
|
|
imp=92
|
|
|
|
OPEN(IMP ,FILE=FNAME,STATUS='OLD',form='binary',action='read')
|
|
|
|
ELSEIF(SUB .EQ. 'shp') then
|
|
|
|
IMP=113
|
|
|
|
OPEN(113,FILE=FNAME,STATUS='OLD',FORM ='BINARY',action='read')
|
|
|
|
SUB='DBF'
|
|
|
|
CALL ADDSUB(FNAME,SUB)
|
|
|
|
OPEN(114,FILE=FNAME,STATUS='OLD',FORM ='BINARY',action='read')
|
|
|
|
ENDIF
|
|
|
|
ENDIF
|
|
|
|
JZER=0
|
|
|
|
KZER=0
|
|
|
|
CALL RDMAP(2,IMP,JZER,KZER)
|
|
|
|
NEWMAXK=KEEP1+klint
|
|
|
|
NEWMAXPL=JEEP1+jlint
|
|
|
|
IF(NEWMAXPL .GT. MAXPL) THEN
|
|
|
|
!!
|
|
|
|
! NOW OPEN THE FILE FOR SAVING
|
|
|
|
OPEN(98,FORM='BINARY',STATUS='SCRATCH')
|
|
|
|
|
|
|
|
CALL WRTMAP(98)
|
|
|
|
REWIND 98
|
|
|
|
|
|
|
|
|
|
|
|
! WORK OUT SIZES AND ALLOCATE ARRAYS
|
|
|
|
|
|
|
|
|
|
|
|
deallocate (CMAP,XMAP,YMAP,VAL,imap,NCRS)
|
|
|
|
|
|
|
|
allocate (CMAP(MAXPL,2),XMAP(MAXPL),YMAP(MAXPL),VAL(MAXPL))
|
|
|
|
|
|
|
|
ALLOCATE (imap(maxpl),NCRS(MAXPL))
|
|
|
|
|
|
|
|
CALL RDMAP(2,98,0,0) ! XXXXX
|
|
|
|
CLOSE(98)
|
|
|
|
ENDIF
|
|
|
|
! READ IN AND MERGE MAP FILES
|
|
|
|
|
|
|
|
JSTT=JLINT
|
|
|
|
KSTT=KLINT
|
|
|
|
IF(IMP .NE. 113) THEN
|
|
|
|
CALL RDMAP(2,99,JSTT,KSTT)
|
|
|
|
CLOSE(99)
|
|
|
|
ENDIF
|
|
|
|
call PLOTOT(0)
|
|
|
|
CALL HEDR
|
|
|
|
RETURN
|
|
|
|
END
|