[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[TRNSYS-users] Iwent your help



I went to add a new component and b/s of your help I make it perfectly and now I will need another help that is I wrote the equation of the new component and I went to calculate the output with initially assumed value in other word I went to use the output of the firest will be the input of the second iteration so any one besides you having a knowdlege of fortrun pleese help me .
 
the equation will be as followes
 by using this equation you can calculate the initial value of
p1,Tg11,Tg21,Tf11 and Tf21 so I went to use this valu as input How can I use it


Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool.
			SUBROUTINE TYPE236 (TIME,XIN,OUT,T,DTDT,PAR,INFO,ICNTRL,*) 
C************************************************************************
C Object: habtish collector
C Simulation Studio Model: Type236
C 
C Author: 
C Editor: 
C Date:	 July 20, 2007 last modified: July 20, 2007
C 
C 
C *** 
C *** Model Parameters 
C *** 

C *** 
C *** Model Inputs 
C *** 
C			Ac	m^2 [-Inf;+Inf]
C			Lc	m [-Inf;+Inf]
C			p1	m [-Inf;+Inf]
C			beta	degrees [-Inf;+Inf]
C			tbe	m [-Inf;+Inf]
C			te	m [-Inf;+Inf]
C			de	m [-Inf;+Inf]
C			Ep	- [-Inf;+Inf]
C			Eg	- [-Inf;+Inf]
C			Ki	W/m.K [-Inf;+Inf]
C			Pabso	- [-Inf;+Inf]
C			Gtrans	- [-Inf;+Inf]
C			S12	m [-Inf;+Inf]
C			Vw	m/s [-Inf;+Inf]
C			rho	- [1;1]
C			sigma	- [1;1]
C			Cpa	J/kg.K [1;1]
C			Ka	W/m.K [1;1]
C			mue	N.s/m^2 [1;1]
C			Adens	kg/m^3 [1;1]
C			pr	- [1;1]
C			Ta	C [-Inf;+Inf]
C			tetai	degrees [-Inf;+Inf]
C			tetaz	degrees [-Inf;+Inf]
C			Gr	- [-Inf;+Inf]
C			Dr	kJ/hr.m^2 [-inf;+inf]
C			a	J/K [1;1]
C			g	J/K [1;1]
C			p	J/K [1;1]
C			Deltt	s [-Inf;+Inf]
C			n	- [1;365]

C *** 
C *** Model Outputs 
C *** 
C			S22	m [-Inf;+Inf]
C			Nue	m^2/s [-Inf;+Inf]
C			A2	m^2 [-Inf;+Inf]
C			A1	m^2 [-Inf;+Inf]
C			Epg	- [-Inf;+Inf]
C			Egg	- [-Inf;+Inf]
C			Upab	W/m^2.K [-Inf;+Inf]
C			Upae	W/m^2.K [-Inf;+Inf]
C			Tao	K [-Inf;+Inf]
C			Taio	K [-Inf;+Inf]
C			Taoo	K [-Inf;+Inf]
C			Tsky	K [-Inf;+Inf]
C			Tg1o	K [-Inf;+Inf]
C			Tg2o	K [-Inf;+Inf]
C			Tpo	K [-Inf;+Inf]
C			Tf1o	K [-Inf;+Inf]
C			Tf2o	K [-Inf;+Inf]
C			Vbeta1	1/K [-Inf;+Inf]
C			Vbeta2	1/K [-Inf;+Inf]
C			Grl1	- [-Inf;+Inf]
C			ma	kg/s [-Inf;+Inf]
C			Ua	W/m^2.K [-Inf;+Inf]
C			Ug1g2	W/m^2.K [-Inf;+Inf]
C			Ug2p	W/m^2.K [-Inf;+Inf]
C			hr	W/m^2.K [-Inf;+Inf]
C			hc	W/m^2.K [-Inf;+Inf]
C			Uga	W/m^2.K [-Inf;+Inf]
C			Rb	- [-Inf;+Inf]
C			I	kJ/hr.m^2 [-Inf;+Inf]
C			Tp	K [-Inf;+Inf]
C			Tf11	K [-Inf;+Inf]
C			Tf21	K [-Inf;+Inf]
C			Tg11	K [-Inf;+Inf]
C			Tg21	K [-Inf;+Inf]
C			Efficiency	% (base 1) [-Inf;+Inf]
C			Tp10	K [-Inf;+Inf]
C			Tg220	K [-Inf;+Inf]
C			Tg110	K [-Inf;+Inf]
C			Tao00	K [-Inf;+Inf]
C			Tf110	K [-Inf;+Inf]
C			Tf220	K [-Inf;+Inf]
C			Vbeta11	1/K [-Inf;+Inf]
C			Vbeta22	1/K [-Inf;+Inf]
C			Grl11	- [-Inf;+Inf]
C			Ua1	W/m^2.K [-Inf;+Inf]
C			Ug1g22	W/m^2.K [-Inf;+Inf]
C			Ug2p2	W/m^2.K [-Inf;+Inf]
C			hr1	W/m^2.K [-Inf;+Inf]
C			hc1	W/m^2.K [-Inf;+Inf]
C			Uga1	W/m^2.K [-Inf;+Inf]
C			Rb1	- [-Inf;+Inf]
C			I1	W/m^2 [-Inf;+Inf]
C			ma	kg/s [-Inf;+Inf]
C			Tp1	K [-Inf;+Inf]
C			Tf211	K [-Inf;+Inf]
C			Tf111	K [-Inf;+Inf]
C			Tg111	K [-Inf;+Inf]
C			Tg222	K [-Inf;+Inf]

C *** 
C *** Model Derivatives 
C *** 

C (Comments and routine interface generated by TRNSYS Studio)
C************************************************************************

C    TRNSYS acess functions (allow to acess TIME etc.) 
      USE TrnsysConstants
      USE TrnsysFunctions

C-----------------------------------------------------------------------------------------------------------------------
C    REQUIRED BY THE MULTI-DLL VERSION OF TRNSYS
      !DEC$ATTRIBUTES DLLEXPORT :: TYPE236				!SET THE CORRECT TYPE NUMBER HERE
C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    TRNSYS DECLARATIONS
      IMPLICIT NONE			!REQUIRES THE USER TO DEFINE ALL VARIABLES BEFORE USING THEM

	DOUBLE PRECISION XIN	!THE ARRAY FROM WHICH THE INPUTS TO THIS TYPE WILL BE RETRIEVED
	DOUBLE PRECISION OUT	!THE ARRAY WHICH WILL BE USED TO STORE THE OUTPUTS FROM THIS TYPE
	DOUBLE PRECISION TIME	!THE CURRENT SIMULATION TIME - YOU MAY USE THIS VARIABLE BUT DO NOT SET IT!
	DOUBLE PRECISION PAR	!THE ARRAY FROM WHICH THE PARAMETERS FOR THIS TYPE WILL BE RETRIEVED
	DOUBLE PRECISION STORED !THE STORAGE ARRAY FOR HOLDING VARIABLES FROM TIMESTEP TO TIMESTEP
	DOUBLE PRECISION T		!AN ARRAY CONTAINING THE RESULTS FROM THE DIFFERENTIAL EQUATION SOLVER
	DOUBLE PRECISION DTDT	!AN ARRAY CONTAINING THE DERIVATIVES TO BE PASSED TO THE DIFF.EQ. SOLVER
	INTEGER*4 INFO(15)		!THE INFO ARRAY STORES AND PASSES VALUABLE INFORMATION TO AND FROM THIS TYPE
	INTEGER*4 NP,NI,NOUT,ND	!VARIABLES FOR THE MAXIMUM NUMBER OF PARAMETERS,INPUTS,OUTPUTS AND DERIVATIVES
	INTEGER*4 NPAR,NIN,NDER	!VARIABLES FOR THE CORRECT NUMBER OF PARAMETERS,INPUTS,OUTPUTS AND DERIVATIVES
	INTEGER*4 IUNIT,ITYPE	!THE UNIT NUMBER AND TYPE NUMBER FOR THIS COMPONENT
	INTEGER*4 ICNTRL		!AN ARRAY FOR HOLDING VALUES OF CONTROL FUNCTIONS WITH THE NEW SOLVER
	INTEGER*4 NSTORED		!THE NUMBER OF VARIABLES THAT WILL BE PASSED INTO AND OUT OF STORAGE
	CHARACTER*3 OCHECK		!AN ARRAY TO BE FILLED WITH THE CORRECT VARIABLE TYPES FOR THE OUTPUTS
	CHARACTER*3 YCHECK		!AN ARRAY TO BE FILLED WITH THE CORRECT VARIABLE TYPES FOR THE INPUTS
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    USER DECLARATIONS - SET THE MAXIMUM NUMBER OF PARAMETERS (NP), INPUTS (NI),
C    OUTPUTS (NOUT), AND DERIVATIVES (ND) THAT MAY BE SUPPLIED FOR THIS TYPE
      PARAMETER (NP=0,NI=31,NOUT=58,ND=0,NSTORED=0)
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    REQUIRED TRNSYS DIMENSIONS
      DIMENSION XIN(NI),OUT(NOUT),PAR(NP),YCHECK(NI),OCHECK(NOUT),
	1   STORED(NSTORED),T(ND),DTDT(ND)
      INTEGER NITEMS
C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    ADD DECLARATIONS AND DEFINITIONS FOR THE USER-VARIABLES HERE


C    PARAMETERS

C    INPUTS
      DOUBLE PRECISION Ac
      DOUBLE PRECISION Lc
      DOUBLE PRECISION p1
      DOUBLE PRECISION beta
      DOUBLE PRECISION tbe
      DOUBLE PRECISION te
      DOUBLE PRECISION de
      DOUBLE PRECISION Ep
      DOUBLE PRECISION Eg
      DOUBLE PRECISION Ki
      DOUBLE PRECISION Pabso
      DOUBLE PRECISION Gtrans
      DOUBLE PRECISION S12
      DOUBLE PRECISION Vw
      DOUBLE PRECISION rho
      DOUBLE PRECISION sigma
      DOUBLE PRECISION Cpa
      DOUBLE PRECISION Ka
      DOUBLE PRECISION mue
      DOUBLE PRECISION Adens
      DOUBLE PRECISION pr
      DOUBLE PRECISION Ta
      DOUBLE PRECISION tetai
      DOUBLE PRECISION tetaz
      DOUBLE PRECISION Gr
      DOUBLE PRECISION Dr
      DOUBLE PRECISION a
      DOUBLE PRECISION g
      DOUBLE PRECISION p
      DOUBLE PRECISION Deltt
      DOUBLE PRECISION n

C-----------------------------------------------------------------------------------------------------------------------
C       READ IN THE VALUES OF THE PARAMETERS IN SEQUENTIAL ORDER

C-----------------------------------------------------------------------------------------------------------------------
C    RETRIEVE THE CURRENT VALUES OF THE INPUTS TO THIS MODEL FROM THE XIN ARRAY IN SEQUENTIAL ORDER

      Ac=XIN(1)
      Lc=XIN(2)
      p1=XIN(3)
      beta=XIN(4)
      tbe=XIN(5)
      te=XIN(6)
      de=XIN(7)
      Ep=XIN(8)
      Eg=XIN(9)
      Ki=XIN(10)
      Pabso=XIN(11)
      Gtrans=XIN(12)
      S12=XIN(13)
      Vw=XIN(14)
      rho=XIN(15)
      sigma=XIN(16)
      Cpa=XIN(17)
      Ka=XIN(18)
      mue=XIN(19)
      Adens=XIN(20)
      pr=XIN(21)
      Ta=XIN(22)
      tetai=XIN(23)
      tetaz=XIN(24)
      Gr=XIN(25)
      Dr=XIN(26)
      a=XIN(27)
      g=XIN(28)
      p=XIN(29)
      Deltt=XIN(30)
      n=XIN(31)
	   IUNIT=INFO(1)
	   ITYPE=INFO(2)

C-----------------------------------------------------------------------------------------------------------------------
C    SET THE VERSION INFORMATION FOR TRNSYS
      IF(INFO(7).EQ.-2) THEN
	   INFO(12)=16
	   RETURN 1
	ENDIF
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    DO ALL THE VERY LAST CALL OF THE SIMULATION MANIPULATIONS HERE
      IF (INFO(8).EQ.-1) THEN
	   RETURN 1
	ENDIF
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    PERFORM ANY 'AFTER-ITERATION' MANIPULATIONS THAT ARE REQUIRED HERE
C    e.g. save variables to storage array for the next timestep
      IF (INFO(13).GT.0) THEN
	   NITEMS=0
C	   STORED(1)=... (if NITEMS > 0)
C        CALL setStorageVars(STORED,NITEMS,INFO)
	   RETURN 1
	ENDIF
C
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    DO ALL THE VERY FIRST CALL OF THE SIMULATION MANIPULATIONS HERE
      IF (INFO(7).EQ.-1) THEN

C       SET SOME INFO ARRAY VARIABLES TO TELL THE TRNSYS ENGINE HOW THIS TYPE IS TO WORK
         INFO(6)=NOUT				
         INFO(9)=1				
	   INFO(10)=0	!STORAGE FOR VERSION 16 HAS BEEN CHANGED				

C       SET THE REQUIRED NUMBER OF INPUTS, PARAMETERS AND DERIVATIVES THAT THE USER SHOULD SUPPLY IN THE INPUT FILE
C       IN SOME CASES, THE NUMBER OF VARIABLES MAY DEPEND ON THE VALUE OF PARAMETERS TO THIS MODEL....
         NIN=NI
	   NPAR=NP
	   NDER=ND
	       
C       CALL THE TYPE CHECK SUBROUTINE TO COMPARE WHAT THIS COMPONENT REQUIRES TO WHAT IS SUPPLIED IN 
C       THE TRNSYS INPUT FILE
	   CALL TYPECK(1,INFO,NIN,NPAR,NDER)

C       SET THE NUMBER OF STORAGE SPOTS NEEDED FOR THIS COMPONENT
         NITEMS=0
C	   CALL setStorageSize(NITEMS,INFO)

C       RETURN TO THE CALLING PROGRAM
         RETURN 1

      ENDIF
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    DO ALL OF THE INITIAL TIMESTEP MANIPULATIONS HERE - THERE ARE NO ITERATIONS AT THE INTIAL TIME
      IF (TIME .LT. (getSimulationStartTime() +
     . getSimulationTimeStep()/2.D0)) THEN

C       SET THE UNIT NUMBER FOR FUTURE CALLS
         IUNIT=INFO(1)
         ITYPE=INFO(2)

C       CHECK THE PARAMETERS FOR PROBLEMS AND RETURN FROM THE SUBROUTINE IF AN ERROR IS FOUND
C         IF(...) CALL TYPECK(-4,INFO,0,"BAD PARAMETER #",0)

C       PERFORM ANY REQUIRED CALCULATIONS TO SET THE INITIAL VALUES OF THE OUTPUTS HERE
C		 S22
			OUT(1)=0
C		 Nue
			OUT(2)=0
C		 A2
			OUT(3)=0
C		 A1
			OUT(4)=0
C		 Epg
			OUT(5)=0
C		 Egg
			OUT(6)=0
C		 Upab
			OUT(7)=0
C		 Upae
			OUT(8)=0
C		 Tao
			OUT(9)=0
C		 Taio
			OUT(10)=0
C		 Taoo
			OUT(11)=0
C		 Tsky
			OUT(12)=0
C		 Tg1o
			OUT(13)=0
C		 Tg2o
			OUT(14)=0
C		 Tpo
			OUT(15)=0
C		 Tf1o
			OUT(16)=0
C		 Tf2o
			OUT(17)=0
C		 Vbeta1
			OUT(18)=0
C		 Vbeta2
			OUT(19)=0
C		 Grl1
			OUT(20)=0
C		 ma
			OUT(21)=0
C		 Ua
			OUT(22)=0
C		 Ug1g2
			OUT(23)=0
C		 Ug2p
			OUT(24)=0
C		 hr
			OUT(25)=0
C		 hc
			OUT(26)=0
C		 Uga
			OUT(27)=0
C		 Rb
			OUT(28)=0
C		 I
			OUT(29)=0
C		 Tp
			OUT(30)=0
C		 Tf11
			OUT(31)=0
C		 Tf21
			OUT(32)=0
C		 Tg11
			OUT(33)=0
C		 Tg21
			OUT(34)=0
C		 Efficiency
			OUT(35)=0
C		 Tp10
			OUT(36)=0
C		 Tg220
			OUT(37)=0
C		 Tg110
			OUT(38)=0
C		 Tao00
			OUT(39)=0
C		 Tf110
			OUT(40)=0
C		 Tf220
			OUT(41)=0
C		 Vbeta11
			OUT(42)=0
C		 Vbeta22
			OUT(43)=0
C		 Grl11
			OUT(44)=0
C		 Ua1
			OUT(45)=0
C		 Ug1g22
			OUT(46)=0
C		 Ug2p2
			OUT(47)=0
C		 hr1
			OUT(48)=0
C		 hc1
			OUT(49)=0
C		 Uga1
			OUT(50)=0
C		 Rb1
			OUT(51)=0
C		 I1
			OUT(52)=0
C		 ma
			OUT(53)=0
C		 Tp1
			OUT(54)=0
C		 Tf211
			OUT(55)=0
C		 Tf111
			OUT(56)=0
C		 Tg111
			OUT(57)=0
C		 Tg222
			OUT(58)=0

C       PERFORM ANY REQUIRED CALCULATIONS TO SET THE INITIAL STORAGE VARIABLES HERE
         NITEMS=0
C	   STORED(1)=...

C       PUT THE STORED ARRAY IN THE GLOBAL STORED ARRAY
C         CALL setStorageVars(STORED,NITEMS,INFO)

C       RETURN TO THE CALLING PROGRAM
         RETURN 1

      ENDIF
C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C    *** ITS AN ITERATIVE CALL TO THIS COMPONENT ***
C-----------------------------------------------------------------------------------------------------------------------

	    
C-----------------------------------------------------------------------------------------------------------------------
C    RETRIEVE THE VALUES IN THE STORAGE ARRAY FOR THIS ITERATION
C      NITEMS=
C	CALL getStorageVars(STORED,NITEMS,INFO)
C      STORED(1)=
C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    CHECK THE INPUTS FOR PROBLEMS
C      IF(...) CALL TYPECK(-3,INFO,'BAD INPUT #',0,0)
C	IF(IERROR.GT.0) RETURN 1
C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    *** PERFORM ALL THE CALCULATION HERE FOR THIS MODEL. ***
C-----------------------------------------------------------------------------------------------------------------------

C		ADD YOUR COMPONENT EQUATIONS HERE; BASICALLY THE EQUATIONS THAT WILL
C		CALCULATE THE OUTPUTS BASED ON THE PARAMETERS AND THE INPUTS.	REFER TO
C		CHAPTER 3 OF THE TRNSYS VOLUME 1 MANUAL FOR DETAILED INFORMATION ON
C		WRITING TRNSYS COMPONENTS.













C-----------------------------------------------------------------------------------------------------------------------

C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    SET THE STORAGE ARRAY AT THE END OF THIS ITERATION IF NECESSARY
C      NITEMS=
C      STORED(1)=
C	CALL setStorageVars(STORED,NITEMS,INFO)
C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    REPORT ANY PROBLEMS THAT HAVE BEEN FOUND USING CALLS LIKE THIS:
C      CALL MESSAGES(-1,'put your message here','MESSAGE',IUNIT,ITYPE)
C      CALL MESSAGES(-1,'put your message here','WARNING',IUNIT,ITYPE)
C      CALL MESSAGES(-1,'put your message here','SEVERE',IUNIT,ITYPE)
C      CALL MESSAGES(-1,'put your message here','FATAL',IUNIT,ITYPE)
C-----------------------------------------------------------------------------------------------------------------------
C-----------------------------------------------------------------------------------------------------------------------
C    SET THE OUTPUTS FROM THIS MODEL IN SEQUENTIAL ORDER AND GET OUT

C		 S22
			OUT(1)=de-S12
C		 Nue
			OUT(2)=mue/Adens
C		 A2
			OUT(3)=P1*(de-S12)
C		 A1
			OUT(4)=P1*S12
C		 Epg
			OUT(5)=1/((1/Ep)+(1/Eg)-1)
C		 Egg
			OUT(6)=1/((1/Eg)+(1/Eg)-1)
C		 Upab
			OUT(7)=(ki/tbe)
C		 Upae
			OUT(8)=OUT(7)
C		 Tao
			OUT(9)=Ta+273
C		 Taio
			OUT(10)=OUT(9)
C		 Taoo
			OUT(11)=OUT(9)
C		 Tsky
			OUT(12)=OUT(9)-6
C		 Tg1o
			OUT(13)=OUT(9)-0.5
C		 Tg2o
			OUT(14)=OUT(9)-0.5
C		 Tpo
			OUT(15)=OUT(9)+0.5
C		 Tf10
			OUT(16)=(OUT(13)+OUT(14))/2
C 	      Tf20
             OUT(17)=(OUT(10)+OUT(9))/2
C		 Vbeta1
			OUT(18)=1/OUT(16)
C		 Vbeta2
			OUT(19)=1/OUT(17)
C		 GrL1
		OUT(20)=(9.81*OUT(19)*(OUT(15)-OUT(14))*(S12**3))
     &		/(OUT(2)**2)
C		 mass flow rate of air
			OUT(21)=1.7*(mue)*Lc*(OUT(20)/(Pr**2+
     &			(Pr+0.9524)))**0.25
C		 Ua
	 OUT(22)=0.664*(Ka/Lc)*((Pr*OUT(20)*COS(beta/57.3))/(Pr+0.9524))
     &			**0.25
C		 Ug1g2
		OUT(23)=((0.06-(0.017*beta/90))*(Ka/S12)*OUT(20)** (1/3))+
     &		(OUT(6)*sigma*((OUT(13))**2+(OUT(14))**2)*(OUT(13)
     &         +OUT(14)))
C		 Ug2p
		OUT(24)=(0.06-(0.017*(beta/90)))*(Ka/OUT(1))*OUT(20)**(1/3)+
     &	(OUT(5)*sigma*((OUT(14))**2+(OUT(15))**2)*(OUT(14)+OUT(15)))
C		 hr
			OUT(25)=Eg*sigma*((OUT(13))**4-(OUT(12))**4)/
     &			(OUT(13)-OUT(9))
C		 hc
			OUT(26)=5.7+3.8*Vw
C		 Uga
			OUT(27)=OUT(25)+OUT(26)
C          Rb
            OUT(28)=tetai/tetaz
C           I
        OUT(29)=(OUT(28)*(Gr-Dr))+(0.5*(1+COS(beta/57.3))*Dr)+(0.5*0.2*
     &		 (1-COS(beta/57.3))*Gr)
C		 Tp
	    OUT(30)=OUT(15)+((Ac*OUT(29)*10*Pabso*Gtrans**2*time)/(p*36))-
     &	 (((OUT(22)*Ac*time)/p)*(OUT(15)- OUT(17)))-(((OUT(24)*
     &	 Ac*time)/p)*(OUT(15)-OUT(14)))-(((OUT(7)*Ac*time)/p)
     &	 *(OUT(15)-OUT(9)))-(((OUT(8)*OUT(4)*time)/p)*
     &	 (((OUT(15)+OUT(9))/2)-OUT(9)))
C        Tf11
          OUT(31)=OUT(16)+(((OUT(22)*Ac*time)/a)*(OUT(13)-OUT(16)))
     &	+(((Ac*OUT(22)*time)/a)*(OUT(14)-OUT(16)))-(((OUT(21)
     &	*Cpa*Ac*time)/a)*(OUT(11)-OUT(10)))
C		 Tf21
		OUT(32)=OUT(17)+(((OUT(22)*Ac*time)/a)*(OUT(15)-OUT(17)))
     &       +(((OUT(22)*Ac*time)/a)*(OUT(14)-OUT(17)))-(((OUT(21)
     &         *Cpa*Ac)/a)*(OUT(11)-OUT(10)))
C		 Tg11
		OUT(33)=OUT(13)+((Ac*OUT(29)*10*(1-Gtrans)*time)/(g*36))-
     &	(((Ac*OUT(23)*time)/g)*(OUT(13)-OUT(14)))-(((Ac*OUT(27)
     &	*time)/g)*(OUT(13)-OUT(9)))-(((OUT(22)*Ac*time)/g)*
     &			(OUT(13)-OUT(16)))
C		 Tg22
	 OUT(34)=OUT(14)+((OUT(29)*10*(1-Gtrans)*Gtrans*Ac*time)/(g*36))
     &		-(((Ac*OUT(22)*time)/g)*(OUT(14)-OUT(16)))-(((Ac*
     &		OUT(22)*time)/g)*(OUT(14)-OUT(17)))-(((Ac*OUT(24)
     &		*time)/g)*(OUT(14)-OUT(15)))-(((Ac*OUT(23)
     &         *time)/g)*(OUT(14)-OUT(13)))
C          Tp1o
             OUT(35)=(OUT(30)+OUT(15))/2
C          Tg220
             OUT(36)=(OUT(34)+OUT(14))/2
C         Tg11o
            OUT(37) =(OUT(33)+OUT(13))/2
C          Tao00
             OUT(38)=(OUT(32)+OUT(9))/2
C		 Tf110
			OUT(39)=(OUT(36)+OUT(37))/2
C 	      Tf220
             OUT(40)=(OUT(38)+OUT(9))/2
C		 Vbeta11
			OUT(41)=1/OUT(39)
C		 Vbeta22
			OUT(42)=1/OUT(40)
C		 GrL11
		OUT(43)=(9.81*OUT(42)*(OUT(35)-OUT(36))*(S12**3))
     &		/(OUT(2)**2)
C		 Ua1
			OUT(44)=0.664*(Ka/Lc)*((Pr*OUT(43)*COS(beta/57.3))
     &			/(Pr+0.9524))**0.25
C		 Ug1g22
		OUT(45)=((0.06-(0.017*beta/90))*(Ka/S12)*OUT(43)** (1/3))+
     &		(OUT(6)*sigma*((OUT(37))**2+(OUT(36))**2)*(OUT(36)
     &         +OUT(37)))
C		 Ug2p2
		OUT(46)=(0.06-(0.017*(beta/90)))*(Ka/OUT(1))*OUT(20)**(1/3)+
     &	(OUT(5)*sigma*((OUT(35))**2+(OUT(36))**2)*(OUT(35)+OUT(36)))
C		 hr1
			OUT(47)=Eg*sigma*((OUT(37))**4-(OUT(12))**4)/
     &			(OUT(37)-OUT(9))
C		 hc1
			OUT(48)=5.7+3.8*Vw
C		 Uga1
			OUT(49)=OUT(47)+OUT(48)
C          Rb1
            OUT(50)=tetai/tetaz
C           I1
        OUT(51)=(OUT(50)*(Gr-Dr))+(0.5*(1+COS(beta/57.3))*Dr)+(0.5*0.2*
     &		 (1-COS(beta/57.3))*Gr)
C		 ma
			OUT(52)=(Ac/Cpa)*(OUT(51)/(OUT(38)-OUT(10)))
C		 Tp1
	    OUT(53)=OUT(35)+((Ac*OUT(51)*10*Pabso*Gtrans**2*time)/(p*36))-
     &	 (((OUT(44)*Ac*time)/p)*(OUT(35)-OUT(40)))-(((OUT(46)*
     &	 Ac*time)/p)*(OUT(35)-OUT(36)))-(((OUT(7)*Ac*time)/p)
     &	 *(OUT(35)-OUT(9)))-(((OUT(8)*OUT(4)*time)/p)*
     &	 (((OUT(35)+OUT(9))/2)-OUT(9)))
C        Tf211
          OUT(54)=OUT(39)+(((OUT(44)*Ac*time)/a)*(OUT(35)-OUT(40)))
     &	+(((Ac*OUT(44)*time)/a)*(OUT(36)-OUT(40)))-(((OUT(52)
     &	*Cpa*Ac*time)/a)*(OUT(38)-OUT(10)))
C		 Tf111
		OUT(55)=OUT(40)+(((OUT(44)*Ac*time)/a)*(OUT(37)-OUT(39)))
     &       +(((OUT(44)*Ac*time)/a)*(OUT(36)-OUT(39)))-(((OUT(52)
     &         *Cpa*Ac)/a)*(OUT(38)-OUT(10)))
C		 Tg111
		OUT(56)=OUT(37)+((Ac*OUT(51)*10*(1-Gtrans)*time)/(g*36))-
     &	(((Ac*OUT(45)*time)/g)*(OUT(37)-OUT(36)))-(((Ac*OUT(44)
     &	*time)/g)*(OUT(37)-OUT(9)))-(((OUT(44)*Ac*time)/g)*
     &			(OUT(37)-OUT(39)))
C		 Tg222
	 OUT(57)=OUT(36)+((OUT(51)*10*(1-Gtrans)*Gtrans*Ac*time)/(g*36))
     &		-(((Ac*OUT(44)*time)/g)*(OUT(36)-OUT(39)))-(((Ac*
     &		OUT(44)*time)/g)*(OUT(36)-OUT(40)))-(((Ac*OUT(46)
     &			*time)/g)*(OUT(35)-OUT(36)))-(((Ac*OUT(45)
     &         *time)/g)*(OUT(36)-OUT(37)))
C        Efficiency
         OUT(58)=(OUT(52)*Cpa*36*(OUT(32)-OUT(9)))/(Ac*OUT(51)*10)

C-----------------------------------------------------------------------------------------------------------------------
C    EVERYTHING IS DONE - RETURN FROM THIS SUBROUTINE AND MOVE ON
      RETURN 1
      END
C-----------------------------------------------------------------------------------------------------------------------