      subroutine subfillgaps(stx,sty,p1,p2)
C.................................................Aug 2024
C fill gaps in f.br files using regr. with other station data
C x=eb; y=at; y=vt
C
       CHARACTER*2 AYR,AMN,ADY, STX,STY,BYR,BMN,BDY,AMN_cur,AMN_pre
	+,DY1,DY2,BYR1,BMN1,BDY1,CYR,CMN,AYR_pre
	CHARACTER*1 C1,CC(0:23),CC1(0:23)
	CHARACTER*64 infile1,infile2
	+,indate											   !19 APR 2024
	 	CHARACTER*4 YEAR, YEAR_pre
	DIMENSION ixx(0:23),iyy(0:23),yx(0:23),ires(0:23),ires1(0:23)
C=	stx='eb'  !norm
C=	sty='at'  !norm
C++
  799	format(A4,2(1X,A2),1X,A4,2(1X,A2),2(1X,I3))				 !FEB2015 NEW COMMAND NUMBER = 799
  798	format(' YEAR, AMN, DD2 = ',A4,2(1X,A2),1X,A4,2(1X,A2),2(1X,I3)
     +,2(1X,A3))
	indate='c:/web/graf/date'                               ! Tamara 
C#	indate='/var/www/izmiran/ionosphere/weather/graf/date' !!! LIUBA !!FEB2015
	open(10,file=indate)							   !FEB2015			
	read(10,799) YEAR,AMN_cur,DY2,YEAR_pre,AMN_pre,DY1,lda2,lda1  !FEB2015 NEW FORMAT NUMBER = 799
	WRITE(*,798) YEAR, AMN_cur, DY2,YEAR_pre,AMN_pre,DY1,lda2,lda1
	+,stx,sty !FEB2015 NEW FORMAT NUMBER = 798
	close(unit=10)
	AYR=YEAR(3:4)
	AYR_pre=YEAR_pre(3:4)
	AMN=AMN_cur
C							 +++++++++++ 19 Apr 2024
   33 format(A2)
	read(dy1,*) rdy1
	idy1=int(rdy1)
	read(dy2,*) rdy2
 	idy2=int(rdy2)
	C1='_'
c=  	p1=0.6448   !at(eb) foF2
C=	p2=29.8974	!at(eb) foF2
101	infile1='c:\web\graf\2026\stYRf.br'
	infile1(18:19)=stx
	infile1(20:21)=AYR
	OPEN(11,file=infile1,action='READ')
	infile2=infile1
	infile2(18:19)=sty
	OPEN(12,file=infile2)      !new
C
   30 FORMAT(3A2,2X,24(I3,2X))
   31 FORMAT(3A2,2X,24(I3,A1,1X))
C
C	DO 40 idy=idy1,idy2
	DO 40 lda=lda1,lda2
C++
       if (lda.eq.lda1) then
	idy=idy1
	CYR=AYR_pre
	CMN=AMN_pre
	                 else
	idy=idy2
	CYR=AYR
	CMN=AMN
	                  endif
	call blet2(idy,ADY)
  1           do k=0,23
      ixx(k)=0
	       enddo
      read(11,30,end=51) BYR,BMN,BDY,(ixx(k),k=0,23)
      if ((BYR.eq.CYR).and.(BMN.eq.CMN).and.(BDY.eq.ADY)) then
	goto 21
	                   else
	goto 1
	endif
   21	        do k=0,23
      iyy(k)=0
	       enddo
C
      read(12,30,end=52) BYR,BMN,BDY,(iyy(k),k=0,23)
      if ((BYR.eq.CYR).and.(BMN.eq.CMN).and.(BDY.eq.ADY)) then
		goto 22
	                   else
	goto 21
	endif
C
   22   do 41 k=0,23
	CC(k)=' '
	ires(k)=iyy(k)
	if (ixx(k).eq.0) GOTO 41
      if(iyy(k).eq.0) then
	yx(k)=p1*ixx(k)+p2
	CC(k)=C1
	ires(k)=nint(yx(k))
	endif
   41 CONTINUE
C
       IF (idy.eq.idy1) then
	BYR1=BYR
	BMN1=BMN
	BDY1=BDY
	do k=0,23
	ires1(k)=ires(k)
	CC1(k)=CC(k)
	enddo
	 ENDIF
   40 CONTINUE
   51 close(11)
  52	backspace(12)        !day_pre1
      backspace(12)		 !day_pre2
      write(*,31) BYR1,BMN1,BDY1,(ires1(k),CC1(k),k=0,23)
	write(12,31) BYR1,BMN1,BDY1,(ires1(k),CC1(k),k=0,23)
      write(*,31) BYR,BMN,BDY,(ires(k),CC(k),k=0,23)
	write(12,31) BYR,BMN,BDY,(ires(k),CC(k),k=0,23)
      close(12)
c=	if (sty.eq.'ns') goto 102
c=	IF (sty.eq.'at') then
c=	sty='vt'
c=	p1=0.802
c=	p2=16.0049
c=	GOTO 101
c=	                 else
c=	       stx='tk' !ns
c= 	sty='ns'  !ns
c=		p1=1.0347  !ns(tk)
c= 	p2=-0.7287 !ns(tk)
c=	GOTO 101
c=	               endif
c=  102	pause ' '
c=	STOP
       RETURN
	END
