      program renamesec
C.............................................................June 2019
C Renamr SEC daily files
C
	CHARACTER*13 STNAME,STATS(80)
		CHARACTER*60 infile,outfile
	CHARACTER*6 YYMMDD
	CHARACTER*7	ADD
	CHARACTER*2 AYR,AMN,ADY
	CHARACTER*92 txt
	CHARACTER*25 STAT
	DATA STATS/										  !
     + 'Ascension.   ','Athens.      ','Boulder.     '  !
     +,'Beijing.     ','Brisbane.    ','Canberra.    '  !
     +,'Chilton.     ','Camden.      ','Chongqing.   '  !
     +,'Cocos_Is.    ','Casey.       ','Christchurch.'  !
     +,'Dourbes.     ','Darwin.      ','Eglin.       '  !
     +,'Roquetes.    ','Gibilmanna.  ','Grahamstown. '  !
     +,'Guangzhou.   ','Hainan.      ','Hermanus.    '  !
     +,'Hobart.      ','Jeju.        ','Jicamarca.   '  !
     +,'Juliusruh.   ','Kokubunji.   ','Learmonth.   '  !
     +,'Manzhouli.   ','Moscow.      ','MacQuarue_Is.'  !
     +,'Mawson.      ','Niue.        ','Norfolk_Is.  '  !
     +,'Okinawa.     ','Perth.       ','Pruhonice.   '  !
     +,'Port_Stanley.','Ramey.       ','Rome.        '  !
     +,'San_Vito.    ','Scott_Base.  ','Townsville.  '  !
     +,'Tromso.      ','Wakkanai.    ','Wallops.     '  !
     +,'Warsaw.      ','Murmansk.    ','Tomsk.       '  !
     +,'Kaliningrad. ','Magadan.     ','Salekhard.   '  !
     +,'Rostov.      ','Tunguska.    ','Novosibirsk. '  !
     +,'Sodankyla.   ','Madimbo.     ','Eielson.     '  !
     +,'Guam.        ','Idaho_NL.    ','Tucuman.     '  !<+tu> nc
     +,'Pt_Arguello. ','Fortaleza.   ','Fairford.    '  !<+fz> yk
     +,'Khabarovsk.  ','Austin.      ','Alpena.      '  !
     +,'Gakona.      ','Dixon.       ','Yamagawa.    '
     +,'I_Cheon.     ','ElArenosillo.','Bahia_Blanca.'  ! May 2018	bb>is
     +,'Belem.       ','Sverdlovsk.  ','Louisvale.   '
     +,'San_Juan.    ','Sopron.      ','Cachoeira.   ' ! Jan.2019
     +,'Eareckson.   ','Lualualei.   '/           !Jan. 2019 


      write(*,*) ' Enter YYMMDD:'
	read(*,*) YYMMDD
	AYR=YYMMDD(1:2)
	AMN=YYMMDD(3:4)
	ADY=YYMMDD(5:6)

	add='_iono.txt'
	infile='d:\web\graf\20YR\MN\Dourbes_iono.txt' 
	infile(15:16)=AYR
	infile(18:19)=AMN
	   outfile='d:\web\graf\20YR\MN\YRMNDYDourbes_iono.txt' 
	outfile(15:16)=AYR
	outfile(18:19)=AMN
	outfile(21:26)=YYMMDD
   30	format(A92)
C
       do 200 ist=1,80
	STNAME=stats(ist)
	STAT=STNAME
		do j=1,30
		if (STNAME(j:j).eq.'.') then
			jp=j
      STAT(jp:)='_iono.txt'
		exit
      	endif
      	enddo
	infile(21:)=STAT
	outfile(27:)=STAT
      OPEN(10,file=INFILE,action='READ')
	OPEN(11,file=OUTFILE)
   1   read(10,30,end=99) txt
      write(11,30) txt
	GOTO 1
   99	close(unit=10)
      close(unit=11)
  200	continue
        write(*,*) infile,outfile
      pause ' '
	STOP
	END