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 2 entries in each of the rate and state variable arrays.
C There are a total of 11 entries in the constant variable array.
C
C
C VOI is time in component environment (minute).
C STATES(1) is H1 in component H1 (picomolar).
C ALGBRC(1) is A in component A (flux).
C CONSTS(8) is beta_I in component model_parameters (first_order_rate_constant).
C STATES(2) is H2 in component H2 (picomolar).
C CONSTS(9) is beta_C in component model_parameters (first_order_rate_constant).
C CONSTS(1) is t_on in component A (minute).
C CONSTS(2) is t_off in component A (minute).
C CONSTS(3) is A_max in component A (flux).
C CONSTS(10) is alpha in component model_parameters (first_order_rate_constant).
C CONSTS(11) is lamda in component model_parameters (first_order_rate_constant).
C CONSTS(4) is tau_I in component model_parameters (minute).
C CONSTS(5) is tau_C in component model_parameters (minute).
C CONSTS(6) is tau_alpha in component model_parameters (minute).
C CONSTS(7) is tau_lamda in component model_parameters (minute).
C RATES(1) is d/dt H1 in component H1 (picomolar).
C RATES(2) is d/dt H2 in component H2 (picomolar).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 0.05
      STATES(2) = 1.0
      CONSTS(1) = 1316.0
      CONSTS(2) = 1792.0
      CONSTS(3) = 6.51
      CONSTS(4) = 2.82
      CONSTS(5) = 23.67
      CONSTS(6) = 25.92
      CONSTS(7) = 24.04
      CONSTS(8) = log(2.00000)/CONSTS(4)
      CONSTS(9) = log(2.00000)/CONSTS(5)
      CONSTS(10) = log(2.00000)/CONSTS(6)
      CONSTS(11) = log(2.00000)/CONSTS(7)
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(2) =  CONSTS(8)*STATES(1) -  CONSTS(9)*STATES(2)
      ALGBRC(1) = TERNRY(VOI.LT.CONSTS(2).AND.VOI.GE.CONSTS(1),  CONSTS(3)*((1.00000 - EXP( - CONSTS(11)*(VOI - CONSTS(1))))/(1.00000 - EXP( - CONSTS(11)*(CONSTS(2) - CONSTS(1))))), TERNRY(VOI.GE.CONSTS(2),  CONSTS(3)*EXP( - CONSTS(10)*(VOI - CONSTS(2))), 0.00000)
      RATES(1) = - ( CONSTS(8)*STATES(1))+ALGBRC(1)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = TERNRY(VOI.LT.CONSTS(2).AND.VOI.GE.CONSTS(1),  CONSTS(3)*((1.00000 - EXP( - CONSTS(11)*(VOI - CONSTS(1))))/(1.00000 - EXP( - CONSTS(11)*(CONSTS(2) - CONSTS(1))))), TERNRY(VOI.GE.CONSTS(2),  CONSTS(3)*EXP( - CONSTS(10)*(VOI - CONSTS(2))), 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