C C There are a total of 9 entries in the algebraic variable array. C There are a total of 8 entries in each of the rate and state variable arrays. C There are a total of 20 entries in the constant variable array. C C C VOI is time in component environment (day). C CONSTS(1) is mu_T in component uninfected_CD4 (per_day). C CONSTS(2) is r in component uninfected_CD4 (per_day). C STATES(1) is T_1 in component latently_infected_CD4 (per_micro_L). C CONSTS(3) is T_max in component uninfected_CD4 (per_micro_L). C CONSTS(4) is k_1 in component HIV1 (micro_L_per_day). C STATES(2) is V in component HIV1 (per_micro_L). C CONSTS(5) is k_1_ in component hybrid_HIV1 (micro_L_per_day). C STATES(3) is V_ in component hybrid_HIV1 (per_micro_L). C CONSTS(6) is s_0 in component uninfected_CD4 (per_micro_L_day). C CONSTS(7) is theta in component uninfected_CD4 (per_micro_L). C ALGBRC(1) is s_V in component uninfected_CD4 (per_micro_L_day). C STATES(4) is T in component uninfected_CD4 (per_micro_L). C CONSTS(8) is k_2 in component latently_infected_CD4 (per_day). C CONSTS(9) is k_1D in component actively_infected_CD4 (micro_L_per_day). C ALGBRC(2) is D in component DIV (per_micro_L). C CONSTS(10) is mu_b in component actively_infected_CD4 (per_day). C STATES(5) is T_2 in component actively_infected_CD4 (per_micro_L). C CONSTS(11) is k_s in component actively_coinfected_CD4 (per_day). C CONSTS(12) is mu_bD in component actively_coinfected_CD4 (per_day). C STATES(6) is T_D2 in component actively_coinfected_CD4 (per_micro_L). C CONSTS(13) is mu_TD in component stably_coinfected_CD4 (per_day). C STATES(7) is T_D1 in component stably_coinfected_CD4 (per_micro_L). C ALGBRC(5) is N_D_t in component DIV (dimensionless). C ALGBRC(8) is pi_D_t in component DIV (per_day). C CONSTS(14) is mu_D in component DIV (per_day). C ALGBRC(3) is N_t in component production_function (dimensionless). C CONSTS(15) is t_DIV in component DIV (day). C STATES(8) is D_ode in component DIV (per_micro_L). C CONSTS(16) is D_0 in component DIV (per_micro_L). C ALGBRC(6) is N_2_t in component HIV1 (dimensionless). C CONSTS(17) is mu_V in component HIV1 (per_day). C ALGBRC(7) is N_t_ in component hybrid_HIV1 (dimensionless). C ALGBRC(9) is pi_t_ in component hybrid_HIV1 (per_day). C CONSTS(18) is N_0 in component production_function (dimensionless). C CONSTS(19) is gamma in component production_function (dimensionless). C CONSTS(20) is t_c in component production_function (day). C ALGBRC(4) is T_tot in component cell_population (per_micro_L). C RATES(4) is d/dt T in component uninfected_CD4 (per_micro_L). C RATES(1) is d/dt T_1 in component latently_infected_CD4 (per_micro_L). C RATES(5) is d/dt T_2 in component actively_infected_CD4 (per_micro_L). C RATES(6) is d/dt T_D2 in component actively_coinfected_CD4 (per_micro_L). C RATES(7) is d/dt T_D1 in component stably_coinfected_CD4 (per_micro_L). C RATES(8) is d/dt D_ode in component DIV (per_micro_L). C RATES(2) is d/dt V in component HIV1 (per_micro_L). C RATES(3) is d/dt V_ in component hybrid_HIV1 (per_micro_L). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 0.02 CONSTS(2) = 0.03 STATES(1) = 0 CONSTS(3) = 1500 CONSTS(4) = 2.4E-5 STATES(2) = 1E-3 CONSTS(5) = 2.4E-7 STATES(3) = 0 CONSTS(6) = 10 CONSTS(7) = 1 STATES(4) = 1000 CONSTS(8) = 0.017 CONSTS(9) = 2.4E-5 CONSTS(10) = 0.24 STATES(5) = 0 CONSTS(11) = 0.48 CONSTS(12) = 0.12 STATES(6) = 0 CONSTS(13) = 0.02 STATES(7) = 0 CONSTS(14) = 0.76 CONSTS(15) = 2557 STATES(8) = 0 CONSTS(16) = 0.1 CONSTS(17) = 2.4 CONSTS(18) = 300 CONSTS(19) = 25 CONSTS(20) = 7305 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) RATES(1) = (( CONSTS(4)*STATES(2)*STATES(4)+ CONSTS(5)*STATES(3)*STATES(4)) - CONSTS(1)*STATES(1)) - CONSTS(8)*STATES(1) RATES(7) = CONSTS(11)*STATES(6) - CONSTS(13)*STATES(7) ALGBRC(1) = ( CONSTS(6)*CONSTS(7))/(CONSTS(7)+STATES(2)) RATES(4) = (((ALGBRC(1) - CONSTS(1)*STATES(4))+ CONSTS(2)*STATES(4)*(1.00000 - (STATES(4)+STATES(1))/CONSTS(3))) - CONSTS(4)*STATES(2)*STATES(4)) - CONSTS(5)*STATES(3)*STATES(4) ALGBRC(2) = TERNRY(VOI.LT.CONSTS(15), 0.00000, STATES(8)) RATES(5) = ( CONSTS(8)*STATES(1) - CONSTS(9)*ALGBRC(2)*STATES(5)) - CONSTS(10)*STATES(5) RATES(6) = ( CONSTS(9)*ALGBRC(2)*STATES(5) - CONSTS(11)*STATES(6)) - CONSTS(12)*STATES(6) ALGBRC(3) = CONSTS(18)*(1.00000+ CONSTS(19)*(VOI ** 2.00000/(VOI ** 2.00000+CONSTS(20) ** 2.00000))) ALGBRC(6) = 0.100000*ALGBRC(3) RATES(2) = (( ALGBRC(3)*CONSTS(10)*STATES(5)+ ALGBRC(6)*CONSTS(12)*STATES(6)) - CONSTS(4)*STATES(2)*STATES(4)) - CONSTS(17)*STATES(2) ALGBRC(5) = 0.200000*ALGBRC(3) ALGBRC(8) = 0.500000*CONSTS(10)*ALGBRC(3) RATES(8) = TERNRY(VOI.LT.CONSTS(15), CONSTS(16)/CONSTS(15), ( ALGBRC(5)*CONSTS(12)*STATES(6)+ ALGBRC(8)*STATES(7)) - CONSTS(14)*STATES(8)) ALGBRC(7) = 0.100000*ALGBRC(3) ALGBRC(9) = 0.0100000*CONSTS(10)*ALGBRC(3) RATES(3) = (( ALGBRC(7)*CONSTS(12)*STATES(6)+ ALGBRC(9)*STATES(7)) - CONSTS(17)*STATES(3)) - CONSTS(5)*STATES(4)*STATES(3) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(1) = ( CONSTS(6)*CONSTS(7))/(CONSTS(7)+STATES(2)) ALGBRC(2) = TERNRY(VOI.LT.CONSTS(15), 0.00000, STATES(8)) ALGBRC(3) = CONSTS(18)*(1.00000+ CONSTS(19)*(VOI ** 2.00000/(VOI ** 2.00000+CONSTS(20) ** 2.00000))) ALGBRC(6) = 0.100000*ALGBRC(3) ALGBRC(5) = 0.200000*ALGBRC(3) ALGBRC(8) = 0.500000*CONSTS(10)*ALGBRC(3) ALGBRC(7) = 0.100000*ALGBRC(3) ALGBRC(9) = 0.0100000*CONSTS(10)*ALGBRC(3) ALGBRC(4) = STATES(4)+STATES(1)+STATES(5)+STATES(6)+STATES(7) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END