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 4 entries in each of the rate and state variable arrays.
C There are a total of 12 entries in the constant variable array.
C
C
C VOI is time in component environment (day).
C CONSTS(1) is s in component uninfected (per_day_mm3).
C CONSTS(2) is r in component uninfected (per_day).
C CONSTS(3) is T_max in component uninfected (per_mm3).
C CONSTS(4) is mu_T in component uninfected (per_day).
C CONSTS(5) is theta in component uninfected (per_mm3).
C CONSTS(6) is k_1 in component latently_infected (mm3_per_day).
C STATES(1) is T_1 in component latently_infected (per_mm3).
C STATES(2) is T_2 in component actively_infected (per_mm3).
C STATES(3) is V in component free_virus_particle (per_mm3).
C ALGBRC(1) is s_V in component uninfected (per_day_mm3).
C STATES(4) is T in component uninfected (per_mm3).
C CONSTS(7) is k_2 in component actively_infected (per_day).
C CONSTS(8) is mu_b in component actively_infected (per_day).
C CONSTS(9) is mu_V in component free_virus_particle (per_day).
C ALGBRC(2) is N in component AZT (dimensionless).
C ALGBRC(3) is T_tot in component T_cell_population (per_mm3).
C CONSTS(10) is tau in component AZT (day).
C CONSTS(11) is N_initial in component AZT (dimensionless).
C CONSTS(12) is N_AZT in component AZT (dimensionless).
C RATES(4) is d/dt T in component uninfected (per_mm3).
C RATES(1) is d/dt T_1 in component latently_infected (per_mm3).
C RATES(2) is d/dt T_2 in component actively_infected (per_mm3).
C RATES(3) is d/dt V in component free_virus_particle (per_mm3).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 10
      CONSTS(2) = 0.03
      CONSTS(3) = 1500
      CONSTS(4) = 0.02
      CONSTS(5) = 1
      CONSTS(6) = 2.4E-5
      STATES(1) = 0
      STATES(2) = 0
      STATES(3) = 1.0E-3
      STATES(4) = 1000
      CONSTS(7) = 3E-3
      CONSTS(8) = 0.24
      CONSTS(9) = 2.4
      CONSTS(10) = 1096
      CONSTS(11) = 1400
      CONSTS(12) = 1050
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(1) = ( CONSTS(6)*STATES(3)*STATES(4) -  CONSTS(4)*STATES(1)) -  CONSTS(7)*STATES(1)
      RATES(2) =  CONSTS(7)*STATES(1) -  CONSTS(8)*STATES(2)
      ALGBRC(1) = ( CONSTS(5)*CONSTS(1))/(CONSTS(5)+STATES(3))
      RATES(4) = ((ALGBRC(1) -  CONSTS(4)*STATES(4))+ CONSTS(2)*STATES(4)*(1.00000 - (STATES(4)+STATES(1)+STATES(2))/CONSTS(3))) -  CONSTS(6)*STATES(3)*STATES(4)
      ALGBRC(2) = TERNRY(VOI.LT.CONSTS(10), CONSTS(11), TERNRY(VOI.GE.CONSTS(10), CONSTS(12), 0.0/0.0)
      RATES(3) = ( ALGBRC(2)*CONSTS(8)*STATES(2) -  CONSTS(6)*STATES(3)*STATES(4)) -  CONSTS(9)*STATES(3)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = ( CONSTS(5)*CONSTS(1))/(CONSTS(5)+STATES(3))
      ALGBRC(2) = TERNRY(VOI.LT.CONSTS(10), CONSTS(11), TERNRY(VOI.GE.CONSTS(10), CONSTS(12), 0.0/0.0)
      ALGBRC(3) = STATES(4)+STATES(1)+STATES(2)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END