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 4 entries in the algebraic variable array.
C There are a total of 5 entries in each of the rate and state variable arrays.
C There are a total of 22 entries in the constant variable array.
C
C
C VOI is time in component environment (day).
C STATES(1) is R in component R (nanomolar).
C CONSTS(1) is delta_R in component R (first_order_rate_constant).
C ALGBRC(1) is f1 in component f1 (flux).
C STATES(2) is U in component U (nanomolar).
C CONSTS(2) is delta_U in component U (first_order_rate_constant).
C CONSTS(3) is alpha0 in component model_parameters (per_nanomolar_day).
C CONSTS(4) is alpha1 in component model_parameters (per_nanomolar_day).
C CONSTS(5) is d01 in component model_parameters (first_order_rate_constant).
C CONSTS(6) is d12 in component model_parameters (first_order_rate_constant).
C STATES(3) is B1 in component B1 (nanomolar).
C STATES(4) is B2 in component B2 (nanomolar).
C ALGBRC(3) is P in component P (nanomolar).
C ALGBRC(4) is f2 in component f2 (flux).
C CONSTS(7) is delta_b1 in component B1 (first_order_rate_constant).
C CONSTS(8) is delta_b2 in component B2 (first_order_rate_constant).
C CONSTS(9) is PE in component P (nanomolar).
C ALGBRC(2) is q in component P (dimensionless).
C CONSTS(10) is G in component P (first_order_rate_constant).
C CONSTS(11) is ti in component P (day).
C CONSTS(12) is T in component P (day).
C CONSTS(13) is P0 in component model_parameters (nanomolar).
C CONSTS(14) is a in component f1 (flux).
C CONSTS(15) is a0 in component f1 (flux).
C CONSTS(16) is b in component f1 (nanomolar).
C CONSTS(17) is b0 in component f1 (nanomolar).
C STATES(5) is x in component x (flux).
C CONSTS(18) is P1 in component x (nanomolar).
C CONSTS(19) is s in component x (nanomolar_day2).
C CONSTS(20) is delta_x in component x (first_order_rate_constant).
C CONSTS(21) is kappa in component f2 (flux).
C CONSTS(22) is kappa0 in component f2 (nanomolar).
C RATES(1) is d/dt R in component R (nanomolar).
C RATES(2) is d/dt U in component U (nanomolar).
C RATES(3) is d/dt B1 in component B1 (nanomolar).
C RATES(4) is d/dt B2 in component B2 (nanomolar).
C RATES(5) is d/dt x in component x (flux).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 1.0
      CONSTS(1) = 1.905
      STATES(2) = 1.0
      CONSTS(2) = 7.5
      CONSTS(3) = 4.15
      CONSTS(4) = 3.02
      CONSTS(5) = 13.0
      CONSTS(6) = 4.72E3
      STATES(3) = 1.0
      STATES(4) = 1.0
      CONSTS(7) = 7.5
      CONSTS(8) = 50.0
      CONSTS(9) = 20.55
      CONSTS(10) = 35.6
      CONSTS(11) = 1.0
      CONSTS(12) = 9.0
      CONSTS(13) = 0.25
      CONSTS(14) = 3.58E5
      CONSTS(15) = 2.33E4
      CONSTS(16) = 100.0
      CONSTS(17) = 263.0
      STATES(5) = 1.0
      CONSTS(18) = 20.0
      CONSTS(19) = 3.71E5
      CONSTS(20) = 0.207
      CONSTS(21) = 2.4E5
      CONSTS(22) = 6.55E3
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(4) =  CONSTS(4)*STATES(3)*STATES(2) - ( CONSTS(6)*STATES(4)+ CONSTS(8)*STATES(4))
      ALGBRC(1) =  CONSTS(15)*(1.00000 - STATES(4)/(CONSTS(16)+STATES(4)))+( STATES(5)*(1.00000 - EXP(- STATES(5)/CONSTS(14)))*STATES(4))/(CONSTS(17)+STATES(4))
      RATES(1) = ALGBRC(1) -  CONSTS(1)*STATES(1)
      ALGBRC(2) = TERNRY(VOI.LT.CONSTS(11), 0.00000, TERNRY(VOI.LT.CONSTS(12)+CONSTS(11).AND.VOI.GE.CONSTS(11), 1.00000 - EXP( - CONSTS(10)*(VOI - CONSTS(11))),  EXP( CONSTS(10)*CONSTS(12) - 1.00000)*EXP( CONSTS(10)*(VOI - CONSTS(11))))
      ALGBRC(3) = CONSTS(13)+ CONSTS(9)*ALGBRC(2)
      RATES(3) = ( CONSTS(3)*ALGBRC(3)*STATES(2)+ CONSTS(6)*STATES(4)) - ( CONSTS(5)*STATES(3)+ CONSTS(7)*STATES(3)+ CONSTS(4)*STATES(3)*STATES(2))
      RATES(5) = ( CONSTS(19)*(ALGBRC(3) - CONSTS(13)))/(ALGBRC(3)+CONSTS(18)) -  CONSTS(20)*STATES(5)
      ALGBRC(4) = ( CONSTS(21)*STATES(1))/(CONSTS(22)+STATES(1))
      RATES(2) = (ALGBRC(4)+ CONSTS(5)*STATES(3)+ CONSTS(6)*STATES(4)) - ( CONSTS(2)*STATES(2)+ CONSTS(3)*ALGBRC(3)*STATES(2)+ CONSTS(4)*STATES(3)*STATES(2))
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(15)*(1.00000 - STATES(4)/(CONSTS(16)+STATES(4)))+( STATES(5)*(1.00000 - EXP(- STATES(5)/CONSTS(14)))*STATES(4))/(CONSTS(17)+STATES(4))
      ALGBRC(2) = TERNRY(VOI.LT.CONSTS(11), 0.00000, TERNRY(VOI.LT.CONSTS(12)+CONSTS(11).AND.VOI.GE.CONSTS(11), 1.00000 - EXP( - CONSTS(10)*(VOI - CONSTS(11))),  EXP( CONSTS(10)*CONSTS(12) - 1.00000)*EXP( CONSTS(10)*(VOI - CONSTS(11))))
      ALGBRC(3) = CONSTS(13)+ CONSTS(9)*ALGBRC(2)
      ALGBRC(4) = ( CONSTS(21)*STATES(1))/(CONSTS(22)+STATES(1))
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END