      subroutine subinterm(fm,syr,smn,sdy,sut,res)
C.................................................................Sep. 2013
C Input maps /web/graf/dfc/yr/mn/ut/fcYYMMDD.j13
C.................................................................Nov. 2012
C JPL maps
C.................................................................Dec. 2011
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C Use fc,hc,tc interpolated from directories dfc, dhc, dtc maps
C
	DIMENSION fhdat(0:72,71)	  ! maps fcF2,hcF2,TEC
	INTEGER*2 iyr,imn,idy
	CHARACTER*13 txt
	CHARACTER*1 fm
	CHARACTER*2 syr,smn,sdy,sut
	CHARACTER*4 STAT 
      CHARACTER*40 infilef
      COMMON /BLM/ STAT,GLAT,GLON

C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C Use fc,hc predictions from directories dfc, dhs
cold	  call subsimfh(isp,jdy,nut,fres,hres)	! model simulation
c---	fres=0.
c---	hres=0.
C NEW ========================================================
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	read(syr,*) ryr
	iyr=int(ryr)
	read(smn,*) rmn
	imn=int(rmn)
	read(sdy,*) rdy
	 idy=int(rdy)  ! current day
	lda=ndoy(iyr,imn,idy)

C Use fc,hc predictions from directories dfc or dhc
c---	infilef='d:\web\dfs\YR\MN\fcMNDYUT.jYR'
      infilef='d:\web\graf\dfc\YR\MN\ut\fcMNDYUT.jYR' !++
	infilef(17:18)=SYR							 !++
	infilef(20:21)=SMN							 !++
	infilef(36:37)=SYR							 !++
	infilef(28:29)=SMN							 !++
      infilef(14:14)=fm		   ! f or h or t	 !++
	infilef(26:26)=fm	   ! f or h	or t		 !++
	infilef(27:27)='c'							 !++
	infilef(30:31)=sdy							 !++
	infilef(32:33)=sut
C check availability of 'c' file
	OPEN(10,FILE=INFILEF)		! 'c'
	read(10,*,err=301,end=302) txt
	if (txt(1:1).eq.'') then
	goto 302
	else
	close (unit=10)
	goto 310
	endif
  302		infilef(27:27)='a' 						 !++
 	close(unit=10)
	goto 303
  301	write(*,*) 'Error reading file ',infilef
	pause ' '
	goto 302
  303		OPEN(10,FILE=INFILEF)		! 'a'
 	read(10,*,err=304,end=305) txt
	if (txt(1:1).eq.'') then 
	goto 305
	else
	close (unit=10)
	goto 310
	endif
  305		infilef(27:27)='b' 						 !++
 	 close(unit=10)
	goto 310
  304	write(*,*) 'Error reading file ',infilef
 	pause ' '
	goto 305

 204	format(73(1X,F4.0))
 310	OPEN(10,FILE=INFILEF)		!
 	read(10,*,err=307,end=307) txt
	if (txt(1:1).eq.'') then 
	goto 307
	else
	backspace(10)
	goto 311
	endif
  307	write(*,*) 'Error reading file ',infilef
 	pause ' '
	STOP

 311		do ilat=1,71
	read(10,204) (fhdat(k,ilat),k=0,72)	
	enddo
	close(unit=10)
C
C      interpolate for glat,glon
C Linear Interpolation for TEC(amlat,amlon)  
	aglat=-90.
	res=0.
	res11=0.
	res12=0.
	res21=0.
	res22=0.
	do 161 ilat=1,70 ! select pair of lats-lines (k) & (k+1)
c	aglat=-87.5,-85,...,87.5
	aglat=-90.+2.5*ilat
	aglat2=aglat+2.5
C
	if ((glat.gt.aglat).and.(glat.le.aglat2)) then  !   <<<<1
C Select pair of longs embracing glong(MLT)
	 clon=-185.
	along=glon
	if (along.ge.180.) along=along-360.
	do j=0,71 ! select pair of longs (j) & (j+1)
	clon=clon+5.
	clon2=clon+5.
	if ((along.ge.clon).and.(along.lt.clon2)) then  ! +++2
	res11=fhdat(j,ilat)
	res12=fhdat(j+1,ilat)
	res21=fhdat(j,ilat+1)
	res22=fhdat(j+1,ilat+1)
	res1=res11+(res12-res11)/5.*(along-clon)
	res2=res21+(res22-res21)/5.*(along-clon)
	res=res1+(res2-res1)/2.5*(glat-aglat)
	endif											 ! +++2
	enddo	! end select pair of longs (j) & (j+1)
	exit
	endif											 !   <<<<1
  161 continue		   ! interpolation end
	RETURN
	END