Generated Code

The following is f77 code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

C
C There are a total of 24 entries in the algebraic variable array.
C There are a total of 7 entries in each of the rate and state variable arrays.
C There are a total of 58 entries in the constant variable array.
C
C
C VOI is t in component environment (second).
C ALGBRC(11) is Pi in component TempCDa (UnitP).
C STATES(1) is Pi in component TempRLC (UnitP).
C ALGBRC(19) is Qo in component TempRC (UnitQ).
C ALGBRC(22) is Qvi in component TempIPump (UnitQ).
C ALGBRC(6) is Qo in component TempCDv (UnitQ).
C ALGBRC(7) is Pi in component TJoint (UnitP).
C ALGBRC(20) is Qvo in component TempIPump (UnitQ).
C ALGBRC(15) is Pi in component TJoint (UnitP).
C ALGBRC(4) is Pi in component TempCDv (UnitP).
C ALGBRC(24) is Qo in component TJoint (UnitQ).
C CONSTS(1) is CVao in component ParaHeartP (UnitCV).
C ALGBRC(3) is E in component EVentricle (UnitE).
C STATES(2) is V in component TempCDv (UnitV).
C CONSTS(2) is PlvIni in component ParaHeartP (UnitP).
C CONSTS(3) is VlvIni in component ParaHeartP (UnitV).
C ALGBRC(5) is Tao in component TempCDv (dimensionless).
C CONSTS(4) is Vlv0 in component ParaHeartP (UnitV).
C ALGBRC(13) is Qo in component TempCDa (UnitQ).
C CONSTS(5) is CVmi in component ParaHeartP (UnitCV).
C ALGBRC(10) is E in component EAtrium (UnitE).
C STATES(3) is V in component TempCDa (UnitV).
C CONSTS(6) is PlaIni in component ParaHeartP (UnitP).
C CONSTS(7) is VlaIni in component ParaHeartP (UnitV).
C ALGBRC(12) is Tao in component TempCDa (dimensionless).
C CONSTS(8) is Vla0 in component ParaHeartP (UnitV).
C CONSTS(9) is ElvMax in component ParaHeartP (UnitE).
C CONSTS(10) is ElvMin in component ParaHeartP (UnitE).
C CONSTS(11) is T in component ParaHeartP (second).
C CONSTS(12) is Ts1 in component ParaHeartP (dimensionless).
C CONSTS(13) is Ts2 in component ParaHeartP (dimensionless).
C ALGBRC(1) is mt in component EVentricle (second).
C ALGBRC(2) is et in component EVentricle (dimensionless).
C CONSTS(14) is ElaMax in component ParaHeartP (UnitE).
C CONSTS(15) is ElaMin in component ParaHeartP (UnitE).
C CONSTS(16) is Tpwb in component ParaHeartP (dimensionless).
C CONSTS(17) is Tpww in component ParaHeartP (dimensionless).
C ALGBRC(8) is mt in component EAtrium (second).
C ALGBRC(9) is et in component EAtrium (dimensionless).
C STATES(4) is Qo in component TempRLC (UnitQ).
C CONSTS(18) is Rsas in component ParaSys (UnitR).
C CONSTS(19) is Csas in component ParaSys (UnitC).
C CONSTS(20) is Lsas in component ParaSys (UnitL).
C CONSTS(21) is P0sas in component ParaSys (UnitP).
C CONSTS(22) is Q0sas in component ParaSys (UnitQ).
C STATES(5) is Pi in component TempRLC (UnitP).
C ALGBRC(23) is Qo in component TJoint (UnitQ).
C ALGBRC(21) is Pi in component TempR (UnitP).
C STATES(6) is Qo in component TempRLC (UnitQ).
C CONSTS(23) is Rsat in component ParaSys (UnitR).
C CONSTS(24) is Csat in component ParaSys (UnitC).
C CONSTS(25) is Lsat in component ParaSys (UnitL).
C CONSTS(26) is P0sat in component ParaSys (UnitP).
C CONSTS(27) is Q0sat in component ParaSys (UnitQ).
C ALGBRC(18) is Pi in component TempR (UnitP).
C ALGBRC(14) is Qo in component TempR (UnitQ).
C CONSTS(28) is Rsar in component ParaSys (UnitR).
C STATES(7) is Pi in component TempRC (UnitP).
C ALGBRC(16) is Qo in component TempR (UnitQ).
C CONSTS(29) is Rscp in component ParaSys (UnitR).
C CONSTS(30) is Rsvn in component ParaSys (UnitR).
C CONSTS(31) is Csvn in component ParaSys (UnitC).
C CONSTS(32) is P0svn in component ParaSys (UnitP).
C CONSTS(58) is Wn in component TempIPump (UnitRPM).
C CONSTS(33) is Ts2 in component ParaHeartP (dimensionless).
C CONSTS(34) is T in component ParaHeartP (second).
C CONSTS(35) is Kp0 in component ParaIPump (UnitKp0).
C CONSTS(36) is Kp1 in component ParaIPump (UnitKp1).
C CONSTS(37) is Kp2 in component ParaIPump (UnitKp2).
C CONSTS(38) is Kp3 in component ParaIPump (UnitKp3).
C CONSTS(39) is Kp4 in component ParaIPump (UnitKp4).
C CONSTS(40) is Kp5 in component ParaIPump (UnitKp5).
C CONSTS(41) is Kp6 in component ParaIPump (UnitKp6).
C CONSTS(42) is W in component ParaIPump (UnitRPM).
C ALGBRC(17) is dPv in component TempIPump (UnitP).
C CONSTS(43) is ElaMax in component ParaHeartP (UnitE).
C CONSTS(44) is ElaMin in component ParaHeartP (UnitE).
C CONSTS(45) is PlaIni in component ParaHeartP (UnitP).
C CONSTS(46) is VlaIni in component ParaHeartP (UnitV).
C CONSTS(47) is ElvMax in component ParaHeartP (UnitE).
C CONSTS(48) is ElvMin in component ParaHeartP (UnitE).
C CONSTS(49) is PlvIni in component ParaHeartP (UnitP).
C CONSTS(50) is VlvIni in component ParaHeartP (UnitV).
C CONSTS(51) is Tpwb in component ParaHeartP (dimensionless).
C CONSTS(52) is Tpww in component ParaHeartP (dimensionless).
C CONSTS(53) is Ts1 in component ParaHeartP (dimensionless).
C CONSTS(54) is CVao in component ParaHeartP (UnitCV).
C CONSTS(55) is CVmi in component ParaHeartP (UnitCV).
C CONSTS(56) is Vlv0 in component ParaHeartP (UnitV).
C CONSTS(57) is Vla0 in component ParaHeartP (UnitV).
C RATES(2) is d/dt V in component TempCDv (UnitV).
C RATES(3) is d/dt V in component TempCDa (UnitV).
C RATES(1) is d/dt Pi in component TempRLC (UnitP).
C RATES(4) is d/dt Qo in component TempRLC (UnitQ).
C RATES(5) is d/dt Pi in component TempRLC (UnitP).
C RATES(6) is d/dt Qo in component TempRLC (UnitQ).
C RATES(7) is d/dt Pi in component TempRC (UnitP).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 350.
      CONSTS(2) = 1.0
      CONSTS(3) = 5.0
      CONSTS(4) = 500
      CONSTS(5) = 400.
      CONSTS(6) = 1.0
      CONSTS(7) = 4.0
      CONSTS(8) = 20
      CONSTS(9) = 0.5
      CONSTS(10) = 0.1
      CONSTS(11) = 1.0
      CONSTS(12) = 0.3
      CONSTS(13) = 0.45
      CONSTS(14) = 0.25
      CONSTS(15) = 0.15
      CONSTS(16) = 0.92
      CONSTS(17) = 0.09
      CONSTS(18) = 0.003
      CONSTS(19) = 0.08
      CONSTS(20) = 0.000062
      CONSTS(21) = 100.
      CONSTS(22) = 0.
      CONSTS(23) = 0.05
      CONSTS(24) = 1.6
      CONSTS(25) = 0.0017
      CONSTS(26) = 100.
      CONSTS(27) = 0.
      CONSTS(28) = 0.5
      CONSTS(29) = 0.52
      CONSTS(30) = 0.075
      CONSTS(31) = 20.5
      CONSTS(32) = 0.
      CONSTS(33) = 0.45
      CONSTS(34) = 1.0
      CONSTS(35) = 19.51840
      CONSTS(36) = -3.03610e-3
      CONSTS(37) = -1.23045
      CONSTS(38) = 5.78974e-4
      CONSTS(39) = -5.8777e-8
      CONSTS(40) = -1.27539e-6
      CONSTS(41) = 2.04834e-10
      CONSTS(42) = 3600
      CONSTS(43) = 0.25
      CONSTS(44) = 0.15
      CONSTS(45) = 1.0
      CONSTS(46) = 4.0
      CONSTS(47) = 0.5
      CONSTS(48) = 0.1
      CONSTS(49) = 1.0
      CONSTS(50) = 5.0
      CONSTS(51) = 0.92
      CONSTS(52) = 0.09
      CONSTS(53) = 0.3
      CONSTS(54) = 350.
      CONSTS(55) = 400.
      CONSTS(56) = 500
      CONSTS(57) = 20
      CONSTS(58) =  1.00000*CONSTS(42)
      STATES(1) = CONSTS(21)
      STATES(2) = CONSTS(4)
      STATES(3) = CONSTS(8)
      STATES(4) = CONSTS(22)
      STATES(5) = CONSTS(26)
      STATES(6) = CONSTS(27)
      STATES(7) = CONSTS(32)
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = VOI -  CONSTS(11)*INT(VOI/CONSTS(11))
      ALGBRC(2) = TERNRY(ALGBRC(1).GE.0.00000.AND.ALGBRC(1).LE. CONSTS(12)*CONSTS(11), 1.00000 - cos(( 3.14159*ALGBRC(1))/( CONSTS(12)*CONSTS(11))), TERNRY(ALGBRC(1).GT. CONSTS(12)*CONSTS(11).AND.ALGBRC(1).LE. CONSTS(13)*CONSTS(11), 1.00000+cos(( 3.14159*(ALGBRC(1) -  CONSTS(12)*CONSTS(11)))/( (CONSTS(13) - CONSTS(12))*CONSTS(11))), TERNRY(ALGBRC(1).GT. CONSTS(13)*CONSTS(11).AND.ALGBRC(1).LT.CONSTS(11), 0.00000, 0.0/0.0)
      ALGBRC(3) = CONSTS(10)+( ALGBRC(2)*(CONSTS(9) - CONSTS(10)))/2.00000
      ALGBRC(4) = CONSTS(2)+ ALGBRC(3)*(STATES(2) - CONSTS(3))
      ALGBRC(5) = TERNRY(ALGBRC(4).GE.STATES(1), 1.00000, TERNRY(ALGBRC(4).LT.STATES(1), 0.00000, 0.0/0.0)
      ALGBRC(6) = TERNRY(ALGBRC(4).GE.STATES(1),  CONSTS(1)*ALGBRC(5)*ABS(ALGBRC(4) - STATES(1)) ** 0.500000, TERNRY(ALGBRC(4).LT.STATES(1),  -1.00000*CONSTS(1)*ALGBRC(5)*ABS(STATES(1) - ALGBRC(4)) ** 0.500000, 0.0/0.0)
      RATES(1) = (ALGBRC(6) - STATES(4))/CONSTS(19)
      ALGBRC(15) = STATES(5)
      RATES(4) = ((STATES(1) - ALGBRC(15)) -  CONSTS(18)*STATES(4))/CONSTS(20)
      ALGBRC(8) = VOI -  CONSTS(11)*INT(VOI/CONSTS(11))
      ALGBRC(9) = TERNRY(ALGBRC(8).GE.0.00000.AND.ALGBRC(8).LE. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(8) -  (CONSTS(16) - 1.00000)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), TERNRY(ALGBRC(8).GT. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11).AND.ALGBRC(8).LE. CONSTS(16)*CONSTS(11), 0.00000, TERNRY(ALGBRC(8).GT. CONSTS(16)*CONSTS(11).AND.ALGBRC(8).LE.CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(8) -  CONSTS(16)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), 0.0/0.0)
      ALGBRC(10) = CONSTS(15)+( ALGBRC(9)*(CONSTS(14) - CONSTS(15)))/2.00000
      ALGBRC(11) = CONSTS(6)+ ALGBRC(10)*(STATES(3) - CONSTS(7))
      ALGBRC(19) = (STATES(7) - ALGBRC(11))/CONSTS(30)
      ALGBRC(7) = ALGBRC(4)
      ALGBRC(12) = TERNRY(ALGBRC(11).GE.ALGBRC(7), 1.00000, TERNRY(ALGBRC(11).LT.ALGBRC(7), 0.00000, 0.0/0.0)
      ALGBRC(13) = TERNRY(ALGBRC(11).GE.ALGBRC(7),  CONSTS(5)*ALGBRC(12)*ABS(ALGBRC(11) - ALGBRC(7)) ** 0.500000, TERNRY(ALGBRC(11).LT.ALGBRC(7),  -1.00000*CONSTS(5)*ALGBRC(12)*ABS(ALGBRC(7) - ALGBRC(11)) ** 0.500000, 0.0/0.0)
      RATES(3) = ALGBRC(19) - ALGBRC(13)
      ALGBRC(14) = STATES(6)
      ALGBRC(18) = STATES(7)+ CONSTS(29)*ALGBRC(14)
      ALGBRC(21) = ALGBRC(18)+ CONSTS(28)*STATES(6)
      RATES(6) = ((STATES(5) - ALGBRC(21)) -  CONSTS(23)*STATES(6))/CONSTS(25)
      ALGBRC(16) = ALGBRC(14)
      RATES(7) = (ALGBRC(16) - ALGBRC(19))/CONSTS(31)
      ALGBRC(17) = ALGBRC(15) - ALGBRC(7)
      ALGBRC(20) =  (CONSTS(35)+ CONSTS(36)*CONSTS(58)+ CONSTS(37)*ALGBRC(17)+ CONSTS(38)*CONSTS(58)*ALGBRC(17)+ CONSTS(39)*CONSTS(58) ** 2.00000*ALGBRC(17)+ CONSTS(40)*CONSTS(58)*ALGBRC(17) ** 2.00000+ CONSTS(41)*CONSTS(58) ** 2.00000*ALGBRC(17) ** 2.00000)*16.6667
      ALGBRC(23) = STATES(4)+ALGBRC(20)
      RATES(5) = (ALGBRC(23) - STATES(6))/CONSTS(24)
      ALGBRC(22) =  -1.00000*ALGBRC(20)
      ALGBRC(24) = ALGBRC(13)+ALGBRC(22)
      RATES(2) = ALGBRC(24) - ALGBRC(6)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = VOI -  CONSTS(11)*INT(VOI/CONSTS(11))
      ALGBRC(2) = TERNRY(ALGBRC(1).GE.0.00000.AND.ALGBRC(1).LE. CONSTS(12)*CONSTS(11), 1.00000 - cos(( 3.14159*ALGBRC(1))/( CONSTS(12)*CONSTS(11))), TERNRY(ALGBRC(1).GT. CONSTS(12)*CONSTS(11).AND.ALGBRC(1).LE. CONSTS(13)*CONSTS(11), 1.00000+cos(( 3.14159*(ALGBRC(1) -  CONSTS(12)*CONSTS(11)))/( (CONSTS(13) - CONSTS(12))*CONSTS(11))), TERNRY(ALGBRC(1).GT. CONSTS(13)*CONSTS(11).AND.ALGBRC(1).LT.CONSTS(11), 0.00000, 0.0/0.0)
      ALGBRC(3) = CONSTS(10)+( ALGBRC(2)*(CONSTS(9) - CONSTS(10)))/2.00000
      ALGBRC(4) = CONSTS(2)+ ALGBRC(3)*(STATES(2) - CONSTS(3))
      ALGBRC(5) = TERNRY(ALGBRC(4).GE.STATES(1), 1.00000, TERNRY(ALGBRC(4).LT.STATES(1), 0.00000, 0.0/0.0)
      ALGBRC(6) = TERNRY(ALGBRC(4).GE.STATES(1),  CONSTS(1)*ALGBRC(5)*ABS(ALGBRC(4) - STATES(1)) ** 0.500000, TERNRY(ALGBRC(4).LT.STATES(1),  -1.00000*CONSTS(1)*ALGBRC(5)*ABS(STATES(1) - ALGBRC(4)) ** 0.500000, 0.0/0.0)
      ALGBRC(15) = STATES(5)
      ALGBRC(8) = VOI -  CONSTS(11)*INT(VOI/CONSTS(11))
      ALGBRC(9) = TERNRY(ALGBRC(8).GE.0.00000.AND.ALGBRC(8).LE. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(8) -  (CONSTS(16) - 1.00000)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), TERNRY(ALGBRC(8).GT. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11).AND.ALGBRC(8).LE. CONSTS(16)*CONSTS(11), 0.00000, TERNRY(ALGBRC(8).GT. CONSTS(16)*CONSTS(11).AND.ALGBRC(8).LE.CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(8) -  CONSTS(16)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), 0.0/0.0)
      ALGBRC(10) = CONSTS(15)+( ALGBRC(9)*(CONSTS(14) - CONSTS(15)))/2.00000
      ALGBRC(11) = CONSTS(6)+ ALGBRC(10)*(STATES(3) - CONSTS(7))
      ALGBRC(19) = (STATES(7) - ALGBRC(11))/CONSTS(30)
      ALGBRC(7) = ALGBRC(4)
      ALGBRC(12) = TERNRY(ALGBRC(11).GE.ALGBRC(7), 1.00000, TERNRY(ALGBRC(11).LT.ALGBRC(7), 0.00000, 0.0/0.0)
      ALGBRC(13) = TERNRY(ALGBRC(11).GE.ALGBRC(7),  CONSTS(5)*ALGBRC(12)*ABS(ALGBRC(11) - ALGBRC(7)) ** 0.500000, TERNRY(ALGBRC(11).LT.ALGBRC(7),  -1.00000*CONSTS(5)*ALGBRC(12)*ABS(ALGBRC(7) - ALGBRC(11)) ** 0.500000, 0.0/0.0)
      ALGBRC(14) = STATES(6)
      ALGBRC(18) = STATES(7)+ CONSTS(29)*ALGBRC(14)
      ALGBRC(21) = ALGBRC(18)+ CONSTS(28)*STATES(6)
      ALGBRC(16) = ALGBRC(14)
      ALGBRC(17) = ALGBRC(15) - ALGBRC(7)
      ALGBRC(20) =  (CONSTS(35)+ CONSTS(36)*CONSTS(58)+ CONSTS(37)*ALGBRC(17)+ CONSTS(38)*CONSTS(58)*ALGBRC(17)+ CONSTS(39)*CONSTS(58) ** 2.00000*ALGBRC(17)+ CONSTS(40)*CONSTS(58)*ALGBRC(17) ** 2.00000+ CONSTS(41)*CONSTS(58) ** 2.00000*ALGBRC(17) ** 2.00000)*16.6667
      ALGBRC(23) = STATES(4)+ALGBRC(20)
      ALGBRC(22) =  -1.00000*ALGBRC(20)
      ALGBRC(24) = ALGBRC(13)+ALGBRC(22)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END