        integer mon(12)
	character*9 f1
        data mon/31,28,31,30,31,30,31,31,30,31,30,31/
	ip=0
	if(iargc().eq.1)then
          ip=1
	  call getarg(1,f1)
	  read(f1(1:),*)k
	  goto 11
	endif
        write(*,*)
        write(*,*)"Usage: jd2date 5000"
        write(*,*)"       date: 1994,1,1 ~ 2021,5,18"
        write(*,*) 
10      write(*,*)' input jd (4 digital)'
        read(*,*,err=100)k
11      if(k.lt.9354)k=k+10000
        do 20 iy=1994,2021
        mon(2)=28
        if(mod(iy,4).eq.0)mon(2)=29
        do 20 im=1,12
        do 20 id=1,mon(im)
        if(k.eq.jd(iy,im,id))then
          write(*,*)'     ----------->  ',iy,im,id,'/',id+1
          if(ip.eq.1)stop
          goto 10
        endif
20      continue
100     stop
        end
 
        function jd(jy,im,id)
        iy=jy-1900
        i=(im+9)*0.09
        i=(i+iy)*1.75+0.01
        j=30.56*im
        j=(iy-50)*367+id+j-i
        jd=j-6661
        end

