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 1 entries in the algebraic variable array. C There are a total of 5 entries in each of the rate and state variable arrays. C There are a total of 15 entries in the constant variable array. C C C VOI is time in component environment (day). C CONSTS(1) is lambda in component uninfected (per_ml_day). C CONSTS(2) is d_T in component uninfected (per_day). C CONSTS(3) is efficacy in component drug_efficacy (dimensionless). C CONSTS(4) is k in component uninfected (ml_per_day). C STATES(1) is V in component viral_load (per_ml). C STATES(2) is T in component uninfected (per_ml). C CONSTS(5) is eta in component latently_infected (dimensionless). C CONSTS(6) is d_0 in component latently_infected (per_day). C ALGBRC(1) is f in component activated (dimensionless). C CONSTS(7) is a in component latently_infected (per_day). C CONSTS(8) is rho in component latently_infected (per_day). C STATES(3) is L_a in component activated (per_ml). C STATES(4) is L_0 in component latently_infected (per_ml). C CONSTS(9) is p in component activated (per_day). C CONSTS(10) is a_L in component activated (per_day). C CONSTS(11) is T_off in component activated (day). C CONSTS(12) is T_on in component activated (day). C CONSTS(13) is delta in component productively_infected (per_day). C STATES(5) is T_star in component productively_infected (per_ml). C CONSTS(14) is p_v in component viral_load (per_day). C CONSTS(15) is c in component viral_load (per_day). C RATES(2) is d/dt T in component uninfected (per_ml). C RATES(4) is d/dt L_0 in component latently_infected (per_ml). C RATES(3) is d/dt L_a in component activated (per_ml). C RATES(5) is d/dt T_star in component productively_infected (per_ml). C RATES(1) is d/dt V in component viral_load (per_ml). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 1E4 CONSTS(2) = 0.01 CONSTS(3) = 0.85 CONSTS(4) = 2.4E-8 STATES(1) = 50 STATES(2) = 600000 CONSTS(5) = 0.001 CONSTS(6) = 0.001 CONSTS(7) = 0.03 CONSTS(8) = 0.01 STATES(3) = 0 STATES(4) = 2 CONSTS(9) = 1.4 CONSTS(10) = 0.1 CONSTS(11) = 54 CONSTS(12) = 50 CONSTS(13) = 1 STATES(5) = 0.3 CONSTS(14) = 2000 CONSTS(15) = 23 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) RATES(2) = (CONSTS(1) - CONSTS(2)*STATES(2)) - (1.00000 - CONSTS(3))*CONSTS(4)*STATES(1)*STATES(2) RATES(5) = ( (1.00000 - CONSTS(5))*(1.00000 - CONSTS(3))*CONSTS(4)*STATES(1)*STATES(2) - 1.00000*CONSTS(13)*STATES(5)*STATES(5))+ CONSTS(10)*STATES(3) RATES(1) = CONSTS(14)*STATES(5) - CONSTS(15)*STATES(1) ALGBRC(1) = TERNRY(CONSTS(11).LT.VOI, 0.00000, TERNRY(VOI.LT.CONSTS(12), 0.00000, 1.00000) RATES(4) = (( CONSTS(5)*(1.00000 - CONSTS(3))*CONSTS(4)*STATES(1)*STATES(2) - CONSTS(6)*STATES(4)) - ALGBRC(1)*CONSTS(7)*STATES(4))+ (1.00000 - ALGBRC(1))*CONSTS(8)*STATES(3) RATES(3) = ( ALGBRC(1)*( CONSTS(7)*STATES(4)+ CONSTS(9)*STATES(3)) - (1.00000 - ALGBRC(1))*(CONSTS(7)+CONSTS(8))*STATES(3)) - CONSTS(10)*STATES(3) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = TERNRY(CONSTS(11).LT.VOI, 0.00000, TERNRY(VOI.LT.CONSTS(12), 0.00000, 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