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 4 entries in each of the rate and state variable arrays.
C There are a total of 7 entries in the constant variable array.
C
C
C VOI is time in component environment (hour).
C STATES(1) is c in component c (dimensionless).
C ALGBRC(1) is f in component c (dimensionless).
C CONSTS(1) is kcd in component reaction_constants (first_order_rate_constant).
C CONSTS(2) is ki1 in component reaction_constants (dimensionless).
C STATES(2) is o in component o (dimensionless).
C STATES(3) is a in component a (dimensionless).
C CONSTS(3) is kad in component reaction_constants (first_order_rate_constant).
C CONSTS(4) is ki2 in component reaction_constants (first_order_rate_constant).
C STATES(4) is r in component r (dimensionless).
C CONSTS(5) is kcr in component reaction_constants (first_order_rate_constant).
C CONSTS(6) is krd in component reaction_constants (first_order_rate_constant).
C CONSTS(7) is k in component reaction_constants (dimensionless).
C RATES(1) is d/dt c in component c (dimensionless).
C RATES(3) is d/dt a in component a (dimensionless).
C RATES(4) is d/dt r in component r (dimensionless).
C RATES(2) is d/dt o in component o (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 0.6
      CONSTS(1) = 1.0
      CONSTS(2) = 0.1
      STATES(2) = 0.055
      STATES(3) = 0.055
      CONSTS(3) = 10.0
      CONSTS(4) = 0.1
      STATES(4) = 0.08
      CONSTS(5) = 0.05
      CONSTS(6) = 0.9
      CONSTS(7) = 0.001
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(3) = STATES(1)/(1.00000+( STATES(2)*STATES(4))/CONSTS(4)) -  CONSTS(3)*STATES(3)
      RATES(4) = ( STATES(2)*STATES(4) ** 2.00000/( 1.00000*(CONSTS(7)+ STATES(2)*STATES(4) ** 2.00000))+CONSTS(5)) -  CONSTS(6)*STATES(4)
      RATES(2) =  1.00000*(STATES(3) - STATES(2))
      ALGBRC(1) = TERNRY(VOI.LT.1.00000, 1.00000, 0.00000)
      RATES(1) =  1.00000*((1.00000+ALGBRC(1))/(1.00000+STATES(2)/CONSTS(2))) -  CONSTS(1)*STATES(1)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = TERNRY(VOI.LT.1.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