c 等飽和根号比線を引くためのデータを作るプログラム
c 2000/10/12
c 2000/11/02 等値線上数値出力追加
c 2000/12/27 上の改良
c by A.Tsubota

c Variable

      real*8 p,minp,maxp,jj,e,stepp,rv,l,pp,f,tex
      integer sadata,pdata
      parameter(po=1000.,r=287.,cp=1004.)
      parameter(minp=10.,maxp=1050.,tex=250.)
      parameter(stepp=10.,rv=461.,l=2.5*10**6)
      parameter(sadata=17,pdata=(maxp-minp)/stepp+1)
      dimension satmr(pdata,sadata),w(sadata)

c w Data

      data w/0.1, 0.2, 0.4, 0.6, 0.8, 1.,  2.,  3.,  4.,  5.,
     +       10., 15., 20., 25., 30.,40., 50./

c Saturation Mixing Ratio Calculation & Output

      open(10,file='satmixra.dat')
      open(20,file='satmixratext.dat')

      pp=tex

      do j=1,sadata

         f=0

         write(10,50)
 50      format('>')

         do i=1,pdata
            ii=i
            p=(ii-1)*stepp+minp
            e=0.001*w(j)*p/(0.622+w(j)*0.001)
            satmr(i,j)=273.15/(1-273.15*rv/l*log(e/6.112))-273.15
            write(10,100)satmr(i,j),p
 100        format(f8.2,f8.2)

            if(f.eq.1) go to 20
            if(p.eq.pp) then
               write(20,110)satmr(i,j),p,8,0,0,'CM',w(j)
 110           format(f8.2,f8.2,i8,i8,i8,A8,f8.1)
               if(pp.eq.tex) then 
                  pp=pp-20
                  else
                    pp=pp+20
               endif
               f=1
             endif

 20          continue
         enddo
      enddo

      close(10)
      close(20)

      end






