      subroutine subgindexnp(ldar,AYEAR,iaa1,iap1,iae1,idst1,apt1
	+,idmp,idmn)
C...................................................................May 2016
C read geom. and Dm+, Dm- indices indices for given day of year:
	dimension iap1(0:7),iaa1(0:7),iae1(0:23),idst1(0:23),apt1(0:7)
	+,idmp(0:23),idmn(0:23)
      CHARACTER*4 AYEAR
	CHARACTER*65 infaa,infdst,infapt,infae,infdmp,infdmn,txt
	CHARACTER*6 YYMMDD
C
		infaa='d:/apkp/AA/aaYEAR' !aa, ap
	infdst='d:/apkp/dst/dstYEAR'	 ! Dst
	infapt='d:/apkp/APT/aptYEAR' ! ap(tau)
	infae='d:/apkp/AE/aeYEAR'	 ! AE
	infdmp='c:/msdev\projects\Vsigma\potocYR.txt' !Dm+
	infdmn='c:/msdev\projects\Vsigma\notocYR.txt' !Dm-
C
   37 format(20X,24(I4))	 ! Dst
  137 format(13X,2(1X,I3)) ! ap,aa
  237 format(6X,8(1X,F5.1))  ! ap(tau)
   31 format(A65)
   32 format(A6,24(1X,I4))  ! Dm+, Dm-
C
		infdst(16:19)=AYEAR
	OPEN(10,FILE=infdst)
	do idd=1,ldar
	read(10,37,end=38) (idst1(k),k=0,23)
	enddo
   38	close(unit=10)
C
	infaa(14:17)=AYEAR
	OPEN(10,FILE=infaa)
	do idd=1,ldar
	do ii=0,7
	read(10,137,end=139) iap1(ii),iaa1(ii)
	enddo
	enddo
  139	close(unit=10)
C
C Reading apt file
	infapt(16:19)=AYEAR
	OPEN(10,FILE=infapt)
	do idd=1,ldar
	read(10,237,end=238) (apt1(k),k=0,7)
	enddo
  238	close(unit=10)
C
	infae(14:17)=AYEAR
	OPEN(10,FILE=infae)
	do idd=1,ldar
	read(10,37,end=339) (iae1(ii),ii=0,23)
	enddo
  339	close(unit=10)

C
	infdmp(31:32)=AYEAR(3:4)
	OPEN(10,FILE=infdmp)
	read(10,31) txt ! extra line
	do idd=1,ldar
	read(10,32,end=439) YYMMDD,(idmp(ii),ii=0,23)
	enddo
  439	close(unit=10)
C
	infdmn(31:32)=AYEAR(3:4)
	OPEN(10,FILE=infdmn)
	read(10,31) txt ! extra line
	do idd=1,ldar
	read(10,32,end=539) YYMMDD,(idmn(ii),ii=0,23)
	enddo
  539	close(unit=10)
      
	RETURN
	END