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 2 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 13 entries in the constant variable array. C C C VOI is time in component environment (day). C CONSTS(10) is T in component T (per_ml). C CONSTS(1) is k in component kinetic_parameters (ml_per_day). C CONSTS(2) is p in component kinetic_parameters (first_order_rate_constant). C CONSTS(3) is c in component kinetic_parameters (first_order_rate_constant). C CONSTS(4) is delta in component kinetic_parameters (first_order_rate_constant). C STATES(1) is I in component I (per_ml). C CONSTS(11) is I_0 in component I (per_ml). C CONSTS(12) is k_ in component kinetic_parameters (ml_per_day). C STATES(2) is E4 in component E4 (per_ml). C CONSTS(5) is VI_0 in component VI (per_ml). C STATES(3) is VI in component VI (per_ml). C ALGBRC(1) is h in component Heavyside_function (dimensionless). C STATES(4) is VNI in component VNI (per_ml). C ALGBRC(2) is V in component virus_total (per_ml). C STATES(5) is E1 in component E1 (per_ml). C CONSTS(13) is b_ in component kinetic_parameters (day). C STATES(6) is E2 in component E2 (per_ml). C STATES(7) is E3 in component E3 (per_ml). C CONSTS(6) is tau_p in component Heavyside_function (day). C CONSTS(7) is b in component kinetic_parameters (day). C CONSTS(8) is m in component kinetic_parameters (first_order_rate_constant). C CONSTS(9) is n in component kinetic_parameters (dimensionless). C RATES(1) is d/dt I in component I (per_ml). C RATES(3) is d/dt VI in component VI (per_ml). C RATES(4) is d/dt VNI in component VNI (per_ml). C RATES(5) is d/dt E1 in component E1 (per_ml). C RATES(6) is d/dt E2 in component E2 (per_ml). C RATES(7) is d/dt E3 in component E3 (per_ml). C RATES(2) is d/dt E4 in component E4 (per_ml). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 2.4e-5 CONSTS(2) = 774 CONSTS(3) = 3 CONSTS(4) = 0.5 STATES(1) = 0.1 STATES(2) = 0 CONSTS(5) = 200000 STATES(3) = 200000 STATES(4) = 0 STATES(5) = 0 STATES(6) = 0 STATES(7) = 0 CONSTS(6) = 0 CONSTS(7) = 0.25 CONSTS(8) = 0.01 CONSTS(9) = 4 CONSTS(10) = ( CONSTS(3)*CONSTS(4))/( CONSTS(1)*CONSTS(2)) CONSTS(11) = (CONSTS(3)/CONSTS(2))*CONSTS(5) CONSTS(12) = CONSTS(1)/1.00000+ CONSTS(8)*CONSTS(7) ** CONSTS(9) CONSTS(13) = CONSTS(7)/(1.00000+ CONSTS(8)*CONSTS(7)) RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) RATES(1) = CONSTS(12)*CONSTS(10)*STATES(2) - CONSTS(4)*STATES(1) RATES(5) = (STATES(3) - STATES(5))/CONSTS(13) RATES(6) = (STATES(5) - STATES(6))/CONSTS(13) RATES(7) = (STATES(6) - STATES(7))/CONSTS(13) RATES(2) = (STATES(7) - STATES(2))/CONSTS(13) ALGBRC(1) = TERNRY(VOI.LT.CONSTS(6), 0.00000, 1.00000) RATES(3) = (1.00000 - ALGBRC(1))*CONSTS(2)*STATES(1) - CONSTS(3)*STATES(3) RATES(4) = ALGBRC(1)*CONSTS(2)*STATES(1) - CONSTS(3)*STATES(4) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(VOI.LT.CONSTS(6), 0.00000, 1.00000) ALGBRC(2) = STATES(3)+STATES(4) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END