      program nedvkar
      real t, tw, p, e, es, esw, f, td, r, q, rki,qki
      
      write(*,71)
71    format('be: t, tw, p')
      read(*,72)t,tw,p
72    format(2f6.2,f7.2)

      write(*,76)t,tw,p
76    format('*****',/,'adatok:',/,'t=',f6.2,' tw=',f6.2,' p=',f7.2)


      call magnus(t,es)
      call magnus(tw,esw)
      write(*,73)es, esw
73    format('tel¡t‚si g‹zp: es=', f7.2,'  tel. nedv. g‹zp esw=',f7.2)
      e=esw-0.667*(t-tw)
      f=e/es
      write(*,74)e,f
74    format('e=',f7.2,' f=',f7.2)
      call imagnus(e,t,td)
      r=(0.622*e/p)
      q=r/(r+1)
      rki=r*1000
      qki=q*1000
      write(*,75)td,rki,qki
75    format('td =',f6.2,' Celsius r =',f6.2,' g/kg q =',f6.3,' g/kg')
      end
      
      subroutine magnus(t,es)
      real es, t, a, b
      if(t.gt.0) goto 10
      a=9.5
      b=265.5
      goto 11
10    continue
      a=7.5
      b=237.3
11    continue
      es=6.11*10**(a*t/(b+t))
      return
      end
      
      subroutine imagnus(e,t,td)
            real e, t, a, b
      if(t.gt.0) goto 10
      a=9.5
      b=265.5
      goto 11
10    continue
      a=7.5
      b=237.3
11    continue
      td=(b*(alog(e/6.11)/alog(10.00)))/(a-(alog(e/6.11)/alog(10.00)))
      return
      end
