      subroutine subratmapfhn_15(qs,AYR,AMN,ADY,AYRm,AMNm,ADYm)
C........................................................Dec 2024
C Corrected Shub med foF2n, hmF2n
C
C..------------------------------------------------------Nov 2024
C using -15d TECm median obtained from UQRG yesterday
C...................................................May 2024
C ratio Ri = TECobs/TECref
C TECobs 	graf/dta/YR/MN/ut/tcMNDDUTMM.uYR
C infileti: graf/dtu/YR/MN/ti00DDUTMM.mYR !CCIR monthle median TECref 
C infilefi: graf/dfu/YR/MN/fi00DDUTMM.mYR !CCIR monthly median
C infilehi: graf/dhu/YR/MN/hi00DDUTMM.mYR !CCIR monthly median
C outfilef: graf/dfa/YR/MN/ut/fcMNDDUTMM.uYR
C outfileh: graf/dha/YR/MN/ut/hcMNDDUTMM.uYR
C           instant GIM: graf/dta/YR/MN/ut/tcMNDDUT00.uYR  /
C                                          to reference median: graf/dtc/YR/MN/ut/taMNDDUT.jYR  
C + Corrected fa(uYR) = fa(jYR)*sqrt(Ri)
C
C instant TEC (uadg or uqrg) <= preprocessed with /Projects/Maps/calratmap.for 
C outfile: /graf/dtu/YR/MN/rt/riMNDDUT.uYR : instant input files for Iriplas9mapr.for
C
      CHARACTER*64 infilobs,infileti,infilefi,infilehi,outfilef,outfileh
	CHARACTER*2 AYR,AMN,ADY,AUT,AMM,AYRm,AMNm,ADYm
	CHARACTER*1 qa,qs
	DIMENSION ti(0:72),hi(0:72),tc(0:72),fi(0:72),ires(0:72),ihm(0:72)
      COMMON /SSN/RZS,daynr,yds
C+       ju='u'
         if (qs.eq.'c') then
	qa='a'
	     else
	qa='u'
	   endif
C
  33	format(5(1X,A2))
   1  continue
c-	if (ADY.eq.'00') STOP
        read(AYR,*) ryr
	iyr=int(ryr)
	if (iyr.lt.50) then
	IYEAR=2000+iyr
	        else
	IYEAR=1900+iyr
	        endif
      outfilef='c:\web\graf\dfu\YR\MN\ut\fcMNDDUTMM.uYR'	 ! ratio*100 for solar proxy map UPC
C	infilefi='c:\web\graf\dfu\YR\MN\fiMN00UTMM.mYR'	 !ref. median from IRI-Plas CCIR-predicted
	infilefi='c:\web\graf\dfu\YR\MN\fnMN00UTMM.mYR'	 !ref. median from IRI-Plas(foF2s,hmF2s) => fir GTEC
      infilobs='c:\web\graf\dta\YR\MN\ut\tcMNDDUT00.uYR'	 ! \dta\~uadg
C      infileti='c:\web\graf\dtu\YR\MN\tiMN00UTMM.mYR' ! ref. median from IRI-Plas CCIR-predicted
      infileti='c:\web\graf\dtu\YR\MN\ti\tmMNDDUTMM.uYR' ! ref.TECm -15d median 
c	infilehi='c:\web\graf\dhu\YR\MN\hiMN00UTMM.mYR' ! ref. median from IRI-Plas CCIR-predicted
	infilehi='c:\web\graf\dhu\YR\MN\hnMN00UTMM.mYR' ! ref. median from IRI-Plas(foF2s,hmF2s) => fir GTEC
	outfileh='c:\web\graf\dhu\YR\MN\ut\hcMNDDUTMM.uYR'
C	if (qa.eq.'c') then
       infilobs(15:15)=qa
	outfilef(15:15)=qa
	outfileh(15:15)=qa
c-	outfilef(27:27)=qa
c-	outfileh(27:27)=qa
C	else
C	infilobs(15:15)='u'
C	outfilef(15:15)='u'
C	outfileh(15:15)='u'
C	endif
C
      infileti(17:18)=AYRm		!-15d TECm
	infileti(20:21)=AMNm		!-15d TECm
C	infileti(25:26)=AMN 
	infileti(28:29)=AMNm 		!-15d TECm
	infileti(30:31)=ADYm 		!-15d TECm
c	infileti(35:36)=AYR
	infileti(38:39)=AYRm		!-15d TECm
C
      infilobs(17:18)=AYR
      infilobs(20:21)=AMN
      infilobs(28:29)=AMN
	infilobs(30:31)=ADY
      infilobs(38:39)=AYR	  !upc
C
      outfilef(17:18)=AYR
	outfilef(20:21)=AMN
	outfilef(28:29)=AMN
	outfilef(30:31)=ADY
	outfilef(38:39)=AYR
C
      outfileh=outfilef
      outfileh(14:14)='h'
      outfileh(26:26)='h'
C
c__	infilefi=infileti
      infilefi(17:18)=AYR
	infilefi(20:21)=AMN
	infilefi(25:26)=AMN 
	infilefi(35:36)=AYR
C
	infilehi=infilefi
      infilehi(14:14)='h'
      infilehi(23:23)='h'
C
   30 format(73(1X,F4.1))
   31 format(73(1X,I4))
   34 format(73(1X,F4.0))
C
C
       DO 23 iut=0,23
	call blet2(iut,AUT)
c	infileti(29:30)=AUT
      infileti(32:33)=AUT !-15d TECm
	infilefi(29:30)=AUT
	infilehi(29:30)=AUT
	infilobs(32:33)=AUT
	outfilef(32:33)=AUT
	outfileh(32:33)=AUT
C
       DO 24 imm=0,45,15
	call blet2(imm,AMM)
	outfilef(34:35)=AMM
	outfileh(34:35)=AMM
c	infileti(31:32)=AMM	 
	infileti(34:35)=AMM	 !-15d TECm
	infilefi(31:32)=AMM
	infilehi(31:32)=AMM
	infilobs(34:35)=AMM
C-	write(*,33) AYR,AMN,ADY,AUT,AMM  
c
	      OPEN(11,file=infileti,action='READ')
	OPEN(12,file=infilefi,action='READ')
	OPEN(13,file=infilehi,action='READ')
      OPEN(14,file=infilobs,action='READ')
		      OPEN(15,file=outfilef)
		      OPEN(16,file=outfileh)
	jmag=0      ! geogr => geomag !!!!!!!!!!!!!!!!!!!!!!!!
C
       glat=-90.0
	DO ilat=1,71
	glat=glat+2.5
CC++++++++++++++++
C+ TLG Day-of-year reduced to 360.=> sday=season_day
      sday=daynr/yds*360.         ! north hemisphere
      IF(glat.GT.0.0) GOTO 5592
C TLG : sday for the sothern hemisphere:
      sday=sday+180.                ! south hemisphere
      if (sday.gt.360.) sday=sday-360. ! south hemisphere
CC++++++++++++++++
 5592	read(11,30,end=51) (ti(k),k=0,72) !med
      read(12,30,end=52) (fi(k),k=0,72) !med
	read(13,34,end=53) (hi(k),k=0,72) !med
	read(14,30,end=54) (tc(k),k=0,72) !obs
	glon=-185.0
	  do k=0,72
	glon=glon+5.0
	if (glon.lt.0.) glon=glon+360
	      CALL GEODIP(IYEAR,GLAT,GLON,AMLAT,AMLONG,JMAG)
	rat=tc(k)/ti(k)				   !obs/med
	ratfc=sqrt(rat)
	ires(k)=nint(fi(k)*ratfc*10.)	 !foF2 proxy
C+++++++++++++++++++++++++++++
      IF (ratfc.ne.1.0) THEN					 !++
C Use model dh(dne/dnm):
C
      dlogne=2.0*alog10(ratfc)  !new
	HMF2=hi(k)
      call subdlogh(dlogne,amlat,sday,dlgh) !new
      rathhm=10.**dlgh !new
      if (rathhm.lt.0.8) rathhm=0.8
      HMF2=HMF2*rathhm !new
       ENDIF                                     !++
	ihm(k)=nint(hmf2)
C++++++++++++++++++++++++++++++++++++++++++++++++++
	  enddo
C-	write(*,31) (ires(k),k=0,72)
	write(15,31) (ires(k),k=0,72)
C-	write(*,31) (ihm(k),k=0,72) 
	write(16,31) (ihm(k),k=0,72) 
	ENDDO
  51  close(11)
  52	close(12)
  53  close(13)
  54	close(14)
	close(15)
	close(16)
   24	CONTINUE
   23	CONTINUE
C      pause ' '
	RETURN
	END