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 17 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 32 entries in the constant variable array. C C C VOI is t in component environment (second). C ALGBRC(10) is Pi in component TempCDa (UnitP). C STATES(1) is Pi in component TempRLC (UnitP). C ALGBRC(16) is Qo in component TempRC (UnitQ). C ALGBRC(6) is Qo in component TempCDv (UnitQ). C ALGBRC(4) is Pi in component TempCDv (UnitP). C ALGBRC(12) is Qo in component TempCDa (UnitQ). C CONSTS(1) is CVao in component ParaLeftHeart (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 ParaLeftHeart (UnitP). C CONSTS(3) is VlvIni in component ParaLeftHeart (UnitV). C ALGBRC(5) is Tao in component TempCDv (dimensionless). C CONSTS(4) is Vlv0 in component ParaLeftHeart (UnitV). C CONSTS(5) is CVmi in component ParaLeftHeart (UnitCV). C ALGBRC(9) is E in component EAtrium (UnitE). C STATES(3) is V in component TempCDa (UnitV). C CONSTS(6) is PlaIni in component ParaLeftHeart (UnitP). C CONSTS(7) is VlaIni in component ParaLeftHeart (UnitV). C ALGBRC(11) is Tao in component TempCDa (dimensionless). C CONSTS(8) is Vla0 in component ParaLeftHeart (UnitV). C CONSTS(9) is ElvMax in component ParaLeftHeart (UnitE). C CONSTS(10) is ElvMin in component ParaLeftHeart (UnitE). C CONSTS(11) is T in component ParaLeftHeart (second). C CONSTS(12) is Ts1 in component ParaLeftHeart (dimensionless). C CONSTS(13) is Ts2 in component ParaLeftHeart (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 ParaLeftHeart (UnitE). C CONSTS(15) is ElaMin in component ParaLeftHeart (UnitE). C CONSTS(16) is Tpwb in component ParaLeftHeart (dimensionless). C CONSTS(17) is Tpww in component ParaLeftHeart (dimensionless). C ALGBRC(7) is mt in component EAtrium (second). C ALGBRC(8) is et in component EAtrium (dimensionless). C STATES(4) is Pi in component TempRLC (UnitP). C STATES(5) 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 ALGBRC(17) 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(15) is Pi in component TempR (UnitP). C ALGBRC(13) 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(14) 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 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(5) is d/dt Qo in component TempRLC (UnitQ). C RATES(4) 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) = 2.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. STATES(1) = CONSTS(21) STATES(2) = CONSTS(4) STATES(3) = CONSTS(8) STATES(4) = CONSTS(26) STATES(5) = CONSTS(22) STATES(6) = CONSTS(27) STATES(7) = CONSTS(32) RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) RATES(5) = ((STATES(1) - STATES(4)) - CONSTS(18)*STATES(5))/CONSTS(20) RATES(4) = (STATES(5) - STATES(6))/CONSTS(24) 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(5))/CONSTS(19) ALGBRC(7) = VOI - CONSTS(11)*INT(VOI/CONSTS(11)) ALGBRC(8) = TERNRY(ALGBRC(7).GE.0.00000.AND.ALGBRC(7).LE. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(7) - (CONSTS(16) - 1.00000)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), TERNRY(ALGBRC(7).GT. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11).AND.ALGBRC(7).LE. CONSTS(16)*CONSTS(11), 0.00000, TERNRY(ALGBRC(7).GT. CONSTS(16)*CONSTS(11).AND.ALGBRC(7).LE.CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(7) - CONSTS(16)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), 0.0/0.0) ALGBRC(9) = CONSTS(15)+( ALGBRC(8)*(CONSTS(14) - CONSTS(15)))/2.00000 ALGBRC(10) = CONSTS(6)+ ALGBRC(9)*(STATES(3) - CONSTS(7)) ALGBRC(11) = TERNRY(ALGBRC(10).GE.ALGBRC(4), 1.00000, TERNRY(ALGBRC(10).LT.ALGBRC(4), 0.00000, 0.0/0.0) ALGBRC(12) = TERNRY(ALGBRC(10).GE.ALGBRC(4), CONSTS(5)*ALGBRC(11)*ABS(ALGBRC(10) - ALGBRC(4)) ** 0.500000, TERNRY(ALGBRC(10).LT.ALGBRC(4), -1.00000*CONSTS(5)*ALGBRC(11)*ABS(ALGBRC(4) - ALGBRC(10)) ** 0.500000, 0.0/0.0) RATES(2) = ALGBRC(12) - ALGBRC(6) ALGBRC(16) = (STATES(7) - ALGBRC(10))/CONSTS(30) RATES(3) = ALGBRC(16) - ALGBRC(12) ALGBRC(13) = STATES(6) ALGBRC(15) = STATES(7)+ CONSTS(29)*ALGBRC(13) ALGBRC(17) = ALGBRC(15)+ CONSTS(28)*STATES(6) RATES(6) = ((STATES(4) - ALGBRC(17)) - CONSTS(23)*STATES(6))/CONSTS(25) ALGBRC(14) = ALGBRC(13) RATES(7) = (ALGBRC(14) - ALGBRC(16))/CONSTS(31) 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(7) = VOI - CONSTS(11)*INT(VOI/CONSTS(11)) ALGBRC(8) = TERNRY(ALGBRC(7).GE.0.00000.AND.ALGBRC(7).LE. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(7) - (CONSTS(16) - 1.00000)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), TERNRY(ALGBRC(7).GT. ((CONSTS(16)+CONSTS(17)) - 1.00000)*CONSTS(11).AND.ALGBRC(7).LE. CONSTS(16)*CONSTS(11), 0.00000, TERNRY(ALGBRC(7).GT. CONSTS(16)*CONSTS(11).AND.ALGBRC(7).LE.CONSTS(11), 1.00000 - cos(( 2.00000*3.14159*(ALGBRC(7) - CONSTS(16)*CONSTS(11)))/( CONSTS(17)*CONSTS(11))), 0.0/0.0) ALGBRC(9) = CONSTS(15)+( ALGBRC(8)*(CONSTS(14) - CONSTS(15)))/2.00000 ALGBRC(10) = CONSTS(6)+ ALGBRC(9)*(STATES(3) - CONSTS(7)) ALGBRC(11) = TERNRY(ALGBRC(10).GE.ALGBRC(4), 1.00000, TERNRY(ALGBRC(10).LT.ALGBRC(4), 0.00000, 0.0/0.0) ALGBRC(12) = TERNRY(ALGBRC(10).GE.ALGBRC(4), CONSTS(5)*ALGBRC(11)*ABS(ALGBRC(10) - ALGBRC(4)) ** 0.500000, TERNRY(ALGBRC(10).LT.ALGBRC(4), -1.00000*CONSTS(5)*ALGBRC(11)*ABS(ALGBRC(4) - ALGBRC(10)) ** 0.500000, 0.0/0.0) ALGBRC(16) = (STATES(7) - ALGBRC(10))/CONSTS(30) ALGBRC(13) = STATES(6) ALGBRC(15) = STATES(7)+ CONSTS(29)*ALGBRC(13) ALGBRC(17) = ALGBRC(15)+ CONSTS(28)*STATES(6) ALGBRC(14) = ALGBRC(13) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END