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 6 entries in each of the rate and state variable arrays.
C There are a total of 19 entries in the constant variable array.
C
C
C VOI is time in component environment (minute).
C STATES(1) is y1 in component y1 (micromolar).
C CONSTS(1) is a1 in component y1 (flux).
C ALGBRC(1) is g1 in component y1 (micromolar).
C CONSTS(2) is b1 in component y1 (micromolar).
C CONSTS(3) is d1 in component y1 (first_order_rate_constant).
C STATES(2) is y2 in component y2 (micromolar).
C CONSTS(4) is a2 in component y2 (flux).
C ALGBRC(2) is g2 in component y2 (micromolar).
C CONSTS(5) is b2 in component y2 (micromolar).
C CONSTS(6) is d2 in component y2 (first_order_rate_constant).
C STATES(3) is y3 in component y3 (micromolar).
C CONSTS(7) is f53 in component y3 (second_order_rate_constant).
C CONSTS(8) is f13 in component y3 (second_order_rate_constant).
C CONSTS(9) is h36 in component y3 (second_order_rate_constant).
C CONSTS(10) is d3 in component y3 (first_order_rate_constant).
C CONSTS(11) is E in component y3 (micromolar).
C STATES(4) is y5 in component y5 (micromolar).
C STATES(5) is y6 in component y6 (micromolar).
C STATES(6) is y4 in component y4 (micromolar).
C CONSTS(12) is f14 in component y4 (first_order_rate_constant).
C CONSTS(13) is f24 in component y4 (first_order_rate_constant).
C CONSTS(14) is d4 in component y4 (first_order_rate_constant).
C CONSTS(15) is f35 in component y5 (first_order_rate_constant).
C CONSTS(16) is f45 in component y5 (first_order_rate_constant).
C CONSTS(17) is d5 in component y5 (first_order_rate_constant).
C CONSTS(18) is h36 in component y6 (second_order_rate_constant).
C CONSTS(19) is d6 in component y6 (first_order_rate_constant).
C RATES(1) is d/dt y1 in component y1 (micromolar).
C RATES(2) is d/dt y2 in component y2 (micromolar).
C RATES(3) is d/dt y3 in component y3 (micromolar).
C RATES(6) is d/dt y4 in component y4 (micromolar).
C RATES(4) is d/dt y5 in component y5 (micromolar).
C RATES(5) is d/dt y6 in component y6 (micromolar).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 0.0
      CONSTS(1) = 10.0
      CONSTS(2) = 10.0
      CONSTS(3) = 0.2
      STATES(2) = 0.0
      CONSTS(4) = 10.0
      CONSTS(5) = 10.0
      CONSTS(6) = 0.1
      STATES(3) = 0.0
      CONSTS(7) = 1.5
      CONSTS(8) = 0.6
      CONSTS(9) = 0.1
      CONSTS(10) = 1.0
      CONSTS(11) = 10.0
      STATES(4) = 0.0
      STATES(5) = 0.0
      STATES(6) = 0.0
      CONSTS(12) = 0.1
      CONSTS(13) = 0.8
      CONSTS(14) = 1.1
      CONSTS(15) = 0.3
      CONSTS(16) = 0.1
      CONSTS(17) = 1.0
      CONSTS(18) = 0.1
      CONSTS(19) = 0.001
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(3) = ( CONSTS(8)*(CONSTS(11) - (STATES(3)+STATES(5)))*STATES(1)+ CONSTS(7)*(CONSTS(11) - (STATES(3)+STATES(5)))*STATES(4)) - ( CONSTS(9)*STATES(2)*STATES(3)+ CONSTS(10)*STATES(3))
      RATES(6) = ( CONSTS(12)*STATES(1)+ CONSTS(13)*STATES(2)) -  CONSTS(14)*STATES(6)
      RATES(4) = ( CONSTS(15)*STATES(3)+ CONSTS(16)*STATES(6)) -  CONSTS(17)*STATES(4)
      RATES(5) =  CONSTS(18)*STATES(2)*STATES(3) -  CONSTS(19)*STATES(5)
      ALGBRC(1) = TERNRY(VOI.GE.0.00000.AND.VOI.LT.5.00000, 0.00000, TERNRY(VOI.GE.5.00000.AND.VOI.LE.10.0000, 1.00000, 0.00000)
      RATES(1) =  CONSTS(1)*(ALGBRC(1)/(CONSTS(2)+ALGBRC(1))) -  CONSTS(3)*STATES(1)
      ALGBRC(2) = TERNRY(VOI.GE.0.00000.AND.VOI.LE.5.00000, 1.00000, 0.00000)
      RATES(2) =  CONSTS(4)*(ALGBRC(2)/(CONSTS(5)+ALGBRC(2))) -  CONSTS(6)*STATES(2)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = TERNRY(VOI.GE.0.00000.AND.VOI.LT.5.00000, 0.00000, TERNRY(VOI.GE.5.00000.AND.VOI.LE.10.0000, 1.00000, 0.00000)
      ALGBRC(2) = TERNRY(VOI.GE.0.00000.AND.VOI.LE.5.00000, 1.00000, 0.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