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 3 entries in the algebraic variable array. C There are a total of 3 entries in each of the rate and state variable arrays. C There are a total of 11 entries in the constant variable array. C C C VOI is time in component environment (hour). C STATES(1) is PRL in component PRL (nanog_ml). C CONSTS(1) is kD in component PRL (nanog_ml). C CONSTS(2) is kO in component PRL (picog_ml). C CONSTS(3) is rP in component PRL (nanog_ml_hr). C CONSTS(4) is qP in component PRL (first_order_rate_constant). C STATES(2) is OT in component OT (picog_ml). C STATES(3) is DA in component DA (nanog_ml). C ALGBRC(1) is vD in component DA (nanog_ml_hr). C CONSTS(5) is vDbar in component DA (nanog_ml_hr). C CONSTS(6) is DA_infinity in component DA (nanog_ml). C CONSTS(7) is qD in component DA (first_order_rate_constant). C CONSTS(8) is kx in component OT (picog_ml). C ALGBRC(2) is vO in component OT (picog_ml_hr). C CONSTS(9) is vObar in component OT (picog_ml_hr). C CONSTS(10) is rO in component OT (picog_ml_hr). C CONSTS(11) is qO in component OT (first_order_rate_constant). C ALGBRC(3) is x in component x (picog_ml). C RATES(1) is d/dt PRL in component PRL (nanog_ml). C RATES(3) is d/dt DA in component DA (nanog_ml). C RATES(2) is d/dt OT in component OT (picog_ml). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) STATES(1) = 20.0 CONSTS(1) = 300.0 CONSTS(2) = 9.0 CONSTS(3) = 300000.0 CONSTS(4) = 0.5 STATES(2) = 25.0 STATES(3) = 20000.0 CONSTS(5) = 10000.0 CONSTS(6) = 20000.0 CONSTS(7) = 0.2 CONSTS(8) = 50.0 CONSTS(9) = 500.0 CONSTS(10) = 1100.0 CONSTS(11) = 1.0 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) RATES(1) = CONSTS(3)*(1.00000/(CONSTS(1)+STATES(3)))*STATES(2)/(CONSTS(2)+STATES(2)) ** 2.00000 - CONSTS(4)*STATES(1) ALGBRC(1) = TERNRY(VOI.GE.2.00000.AND.VOI.LE.4.00000, CONSTS(5), 0.00000) RATES(3) = CONSTS(7)*(CONSTS(6) - STATES(3)) - ALGBRC(1) ALGBRC(2) = TERNRY(VOI.GE.2.00000.AND.VOI.LE.4.00000, CONSTS(9), 0.00000) ALGBRC(3) = TERNRY(VOI.GE.2.00000.AND.VOI.LE.4.00000, 51.0000, TERNRY(VOI.GE.16.0000.AND.VOI.LE.18.0000, 51.0000, 1.00000) RATES(2) = CONSTS(10)*(ALGBRC(3)/(CONSTS(8)+ALGBRC(3))) - ( CONSTS(11)*STATES(2)+ALGBRC(2)) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(VOI.GE.2.00000.AND.VOI.LE.4.00000, CONSTS(5), 0.00000) ALGBRC(2) = TERNRY(VOI.GE.2.00000.AND.VOI.LE.4.00000, CONSTS(9), 0.00000) ALGBRC(3) = TERNRY(VOI.GE.2.00000.AND.VOI.LE.4.00000, 51.0000, TERNRY(VOI.GE.16.0000.AND.VOI.LE.18.0000, 51.0000, 1.00000) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END