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 3 entries in each of the rate and state variable arrays.
C There are a total of 28 entries in the constant variable array.
C
C
C VOI is time in component environment (day).
C STATES(1) is R in component R (picomolar).
C CONSTS(1) is DR in component model_parameters (flux).
C ALGBRC(3) is pi_C in component model_parameters (dimensionless).
C CONSTS(24) is DB in component model_parameters (first_order_rate_constant).
C STATES(2) is B in component B (picomolar).
C ALGBRC(1) is f in component B (flux).
C CONSTS(2) is kB in component model_parameters (first_order_rate_constant).
C STATES(3) is C in component C (picomolar).
C CONSTS(3) is DC in component model_parameters (flux).
C ALGBRC(2) is pi_L in component pi_L (dimensionless).
C CONSTS(4) is DA in component model_parameters (first_order_rate_constant).
C CONSTS(5) is k1 in component pi_L (second_order_rate_constant).
C CONSTS(6) is k2 in component pi_L (first_order_rate_constant).
C CONSTS(7) is k3 in component pi_L (second_order_rate_constant).
C CONSTS(8) is k4 in component pi_L (first_order_rate_constant).
C CONSTS(9) is K in component pi_L (picomolar).
C CONSTS(10) is ko in component pi_L (first_order_rate_constant).
C CONSTS(11) is Io in component pi_L (flux).
C CONSTS(12) is IL in component pi_L (flux).
C CONSTS(13) is rL in component pi_L (flux).
C CONSTS(14) is KOP in component pi_L (picomole_day_picomole_cells).
C CONSTS(15) is KLP in component pi_L (picomole_picomole_cells).
C CONSTS(28) is pi_P in component model_parameters (dimensionless).
C CONSTS(16) is f0 in component model_parameters (dimensionless).
C CONSTS(17) is dB in component model_parameters (first_order_rate_constant).
C CONSTS(18) is IP in component model_parameters (flux).
C CONSTS(19) is kP in component model_parameters (first_order_rate_constant).
C CONSTS(25) is P in component model_parameters (picomolar).
C CONSTS(26) is P_0 in component model_parameters (picomolar).
C CONSTS(27) is P_s in component model_parameters (picomolar).
C CONSTS(20) is C_s in component model_parameters (picomolar).
C CONSTS(21) is SP in component model_parameters (flux).
C CONSTS(22) is k5 in component model_parameters (second_order_rate_constant).
C CONSTS(23) is k6 in component model_parameters (first_order_rate_constant).
C RATES(1) is d/dt R in component R (picomolar).
C RATES(2) is d/dt B in component B (picomolar).
C RATES(3) is d/dt C in component C (picomolar).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 0.00077
      CONSTS(1) = 7e-4
      STATES(2) = 0.00073
      CONSTS(2) = 0.189
      STATES(3) = 0.00091
      CONSTS(3) = 2.1e-3
      CONSTS(4) = 0.7
      CONSTS(5) = 1e-2
      CONSTS(6) = 10
      CONSTS(7) = 5.8e-4
      CONSTS(8) = 1.7e-2
      CONSTS(9) = 10
      CONSTS(10) = 0.35
      CONSTS(11) = 0
      CONSTS(12) = 0
      CONSTS(13) = 1e3
      CONSTS(14) = 2e5
      CONSTS(15) = 3e6
      CONSTS(16) = 0.05
      CONSTS(17) = 0.7
      CONSTS(18) = 0
      CONSTS(19) = 86
      CONSTS(20) = 5e-3
      CONSTS(21) = 250
      CONSTS(22) = 0.02
      CONSTS(23) = 3
      CONSTS(24) =  CONSTS(16)*CONSTS(17)
      CONSTS(25) = CONSTS(18)/CONSTS(19)
      CONSTS(26) = CONSTS(21)/CONSTS(19)
      CONSTS(27) = CONSTS(23)/CONSTS(22)
      CONSTS(28) = (CONSTS(25)+CONSTS(26))/(CONSTS(25)+CONSTS(27))
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(3) = (STATES(3)+ CONSTS(16)*CONSTS(20))/(STATES(3)+CONSTS(20))
      RATES(1) =  CONSTS(1)*ALGBRC(3) -  (CONSTS(24)/ALGBRC(3))*STATES(1)
      ALGBRC(1) = TERNRY(VOI.GT.20.0000.AND.VOI.LE.80.0000, - 8.30000e-05, 0.00000)
      RATES(2) = ( (CONSTS(24)/ALGBRC(3))*STATES(1) -  CONSTS(2)*STATES(2))+ALGBRC(1)
      ALGBRC(2) =  (( (( (CONSTS(7)/CONSTS(8))*CONSTS(15))/1.00000)*CONSTS(28)*STATES(2))/(1.00000+( CONSTS(7)*CONSTS(9))/CONSTS(8)+ (CONSTS(5)/( CONSTS(6)*CONSTS(10)))*( ((CONSTS(14)/1.00000)/CONSTS(28))*STATES(1)+CONSTS(11))))*(1.00000+CONSTS(12)/CONSTS(13))
      RATES(3) =  CONSTS(3)*ALGBRC(2) -  CONSTS(4)*ALGBRC(3)*STATES(3)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(3) = (STATES(3)+ CONSTS(16)*CONSTS(20))/(STATES(3)+CONSTS(20))
      ALGBRC(1) = TERNRY(VOI.GT.20.0000.AND.VOI.LE.80.0000, - 8.30000e-05, 0.00000)
      ALGBRC(2) =  (( (( (CONSTS(7)/CONSTS(8))*CONSTS(15))/1.00000)*CONSTS(28)*STATES(2))/(1.00000+( CONSTS(7)*CONSTS(9))/CONSTS(8)+ (CONSTS(5)/( CONSTS(6)*CONSTS(10)))*( ((CONSTS(14)/1.00000)/CONSTS(28))*STATES(1)+CONSTS(11))))*(1.00000+CONSTS(12)/CONSTS(13))
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END