      SUBROUTINE OILBR(ADIL,IBGO,IDIL,ZRELFI)
C 
C  OIL BURNER MODEL 
      PARAMETER (GC=32.174)
CMDK FTR
CMDK BLKCM2
CMDK BLKGS2
CMDK BLKOIL
CMDK OILB
CMDK OWETHR
CMDK TIMEB
      DATA PI/3.141596/ 
      IF(IBGO.EQ.3)GO TO 2000 
      IF(IBGO.EQ.2)GO TO 1000 
      IOILR=0 
      SLOPTT=0.6
      SLOPW=0.5 
      TC=0. 
      TMO=0.
      RHOA= .075*530./(TAIN+FTR)
      GCTRM=2.*GC*5.2*3600.*3600.
      CONST4=ADIL*SQRT(GCTRM*RHOA/ZRELFI)
      IF(IDIL .EQ. 1) CONST4= 1./CONST4**2
      CONSV4=CONST4
      SIGEC= .171D-8*(1.+EMISC)*.5
      SIGF= .171D-8*.5*AC/(1./EMISC+AC/AM*(1./EMISM-1.))
      CVT= DTIME/(CC*RHOC*AC) 
      AMO= CONST1/AM
      HCO= .26*(350./DC)**.25*SOOT
      HCOAC=HCO*AC
      HM= (.73*.29+.27*.12)*(350./(1.2*DC))**.25*SOOT 
      HAHA= HCO*AC/(HM*AM)
      HAHA1=1./(1.+HAHA)
      HACON(1)= ZA1*ZKA*AM/XM*.5*(XM*WAIRF(1)/(UA*DCELLA(1)))**.8 
      HACON(2)= ZA1*ZKA*AM/XM*.5*(XM*WAIRF(2)/(UA*DCELLA(1)))**.8 
      HACOFF=ZA2*AM/DCELLA(1)*.5
      HIJON(1)=HIJON(1)+HACON(1)
      HIJON(2)= HIJON(2)+HACON(2) 
      HIJOF=HIJOF+HACOFF
      AJHX=AJHX+AM
      HACON(1)= HACON(1)/(.24*WAIRF(1)) 
      HACON(2)=HACON(2)/(.24*WAIRF(2))
      HACOFF= HACOFF/(.24*WAIRN)
      HIP=HI*SOOT 
      ACH= AC*HIP+CPG(1)*WGO(1) 
      ACHIP= AC*HIP/ACH 
      ACSEG=AC*SIGEC*EMISSG/ACH 
      ACSAG=AC*SIGEC*ALPHG/ACH
      CPWGP=CPG(1)*WGO(1)/ACH 
      TMO=860.
      TC=1600.
      THETA=THETA*PI/180. 
      THET1=THET1*PI/180. 
      RETURN
 1000 CONTINUE
      QC=0. 
C     OIL FURNACE CAL COMBUSTION CHAMBER
      GO TO (270),IBURN1
C     BURNER ON 
      TG2= ACHIP*(TC-460.)-ACSEG*(TG1+160.)**4+ACSAG*TC**4+CPWGP*TG1
      QC= CPWG*(TG1-TG2)
      TG1=TG2 
270   QCO= SIGF*(TC+TMO)**3*(TC-TMO)+HCOAC*(TC-(TC*HAHA+TMO)*HAHA1) 
      TC= (QC-QCO)*CVT+TC 
      TA2= (TA1+HACWO*(2.*TMO-TA1-920.))/(1.+HACWO) 
      QAO= CPWAIR*(TA2-TA1) 
      TMO= (QCO-QAO)*AMO+TMO
      TA1= TA2
      RETURN
 2000 CONTINUE
      IPOIL=0 
      LWD=0 
      IWD=0 
411   PT= -PODPMB-DPT*WFLUE**2-DPB-WD**2*CONSV4 
      IF (PT .LT. .00001) PT=-PODPMB-DPT*WGT**2-DPB 
      GO TO (416),IOILR 
      IOILR=1 
      FOIL= SIN(THETA+THET1)/(PT*COS(THETA)**2) 
      FOILC= PT*(1.-COS(THETA))**2/(WD**2*CONSV4*3.)
416   LOIL=1
      NOIL=0
417   TESTT=SQRT(SIN(THETA+THET1)/(FOIL*PT))
      IF ( TESTT .LT. 1.) GO TO 412 
      TESTT=1.
      THETA=ASIN(FOIL*PT)-THET1 
      NOIL=0
412   THETAP= ACOS(TESTT) 
      DTHETA= THETAP-THETA
      IF (IPOIL .EQ. 1) WRITE(60,3009) THETA,THETAP,DTHETA,TESTT,PT,
     +    WD,WFLUE
      IF (ABS(DTHETA) .LT. .0008) GO TO 418 
      GO TO (415),NOIL
      DTHET1=DTHETA 
      PERT=DTHETA*SLOPTT
      THETA=THETA+PERT
      NOIL=1
      GO TO 417 
415   SLOPTT=-PERT/(DTHETA-DTHET1)
      THETA=THETA+SLOPTT*DTHETA 
      NOIL=0
      LOIL=LOIL+1 
      IF (LOIL .LT. 12) GO TO 417 
      IPOIL=1 
      IF (LOIL .LT. 20) GO TO 417 
      WRITE(60,3007)
      STOP 9
418   THETA=THETAP
      IF(TESTT .EQ. 1.0) TESTT = 1.001
      FOILS= 1.+FOILC/(1.-TESTT)**2 
      CON23P= CON23P*SQRT(FOILS)
      CONST4=CONSV4*FOILS 
      CON21P= 1.+CON23P 
      CON22P= CON21P**2 
      DPTA= DPT*CON22P+CONST4 
      DPTB= WGT*DPT*CON21P/DPTA 
      DPTC= (DPT*WGT**2+DPB+PODPMB)/DPTA
      WDP= -DPTB+SQRT(DPTB**2-DPTC) 
      DWD= WDP-WD 
      IF (IPOIL .EQ. 1) WRITE(60,3010) WD,WDP,DWD,WGT,FOILS,TCYCLE
      IF (( ABS(DWD/WD).LT. .01).OR.(ABS(DWD).LT. .05)) GO TO 424 
C *** USE PARABOLIC NEWTON RAPHSON ON WD
429   GO TO (421,422),IWD 
C *** PERTURBATION
      IWD=1 
      YWD1=DWD
      XWD1=WD 
      CWD=SLOPW*DWD 
      WD=WD+CWD 
431   WFLUE=WGT+WD*CON21P 
      GO TO 411 
C *** FIRST CORRECTION (LINEAR) 
421   SLOPW=-CWD/(DWD-YWD1) 
      WRITE(60,*) 'LINE 7300  SLOPW= ',SLOPW,'  WD= ',WD 
      IWD=2 
      YWD2=DWD
      XWD2=WD 
      WD=WD+SLOPW*DWD 
      WRITE(60,*) 'LINE 7350  WD= ',WD,'  LWD= ',LWD 
      LWD= LWD+1
      IF ( LWD .LT. 12) GO TO 431 
      IPOIL=1 
      IF ( LWD .LT. 20) GO TO 431 
      WRITE(60,3008)
      STOP 9
C *** SECOND CORRECTION (PARABOLIC) 
422   IWD=0 
      AA= ((DWD-YWD1)/(WD-XWD1)-(YWD2-YWD1)/(XWD2-XWD1))/(WD-XWD2)
      BB=(YWD2-YWD1)/(XWD2-XWD1)-AA*(XWD2+XWD1) 
      CC= YWD1-AA*XWD1**2-BB*XWD1 
      CHECK= BB*BB-4.*AA*CC 
      IF (CHECK) 426,427,428
C *** IMAGINARY ROOTS; DON'T USE PARABOLIC CORRECTION 
426   GO TO 429 
C *** ROOTS REAL  AND EQUAL 
427   WD= -BB*.5/AA 
      GO TO 431 
C *** ROOTS REAL AND UNEQUAL
428   WD1= (-BB+SQRT(CHECK))*.5/AA
      WD2= (-BB-SQRT(CHECK))*.5/AA
      DIFF1= ABS(WD-WD1)
      DIFF2= ABS(WD-WD2)
      WD=WD1
      IF (DIFF2 .LT. DIFF1) WD=WD2
      GO TO 431 
  424 CONTINUE
      RETURN
3007  FORMAT (/' NO CONV IN OIL DAMPER OPENING ANGLE- STOP ') 
3008  FORMAT (/' NO CONV IN OIL DAMPER FLOW WD- STOP')
3009  FORMAT ('  THETA,THETAP,DTHETA,TESTT,PT,WD,WF',3F10.4,F10.5,
     *  F10.5,2F10.3) 
3010  FORMAT ('  WD,WDP,DWD,WGT,FOILS,TCYCLE',6F10.3/)
      END 
