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 16 entries in the constant variable array.
C
C
C VOI is time in component environment (second).
C STATES(1) is P in component P (picomolar).
C CONSTS(1) is k1 in component model_parameters (second_order_rate_constant).
C CONSTS(2) is k1_ in component model_parameters (first_order_rate_constant).
C CONSTS(3) is k2 in component model_parameters (second_order_rate_constant).
C CONSTS(4) is k2_ in component model_parameters (first_order_rate_constant).
C CONSTS(5) is kcl in component model_parameters (first_order_rate_constant).
C ALGBRC(4) is D in component model_parameters (flux).
C STATES(2) is Ca in component Ca (picomolar).
C STATES(3) is Ci in component Ci (picomolar).
C STATES(4) is Ra in component Ra (picomolar).
C STATES(5) is Ri in component Ri (picomolar).
C CONSTS(6) is k3 in component model_parameters (first_order_rate_constant).
C CONSTS(7) is k3_ in component model_parameters (first_order_rate_constant).
C CONSTS(8) is k4 in component model_parameters (first_order_rate_constant).
C CONSTS(9) is k4_ in component model_parameters (first_order_rate_constant).
C ALGBRC(2) is rho in component rho (dimensionless).
C CONSTS(10) is De in component model_parameters (flux).
C ALGBRC(3) is Dd in component model_parameters (flux).
C CONSTS(11) is dmax in component model_parameters (flux).
C CONSTS(12) is dmin in component model_parameters (flux).
C CONSTS(13) is tau_on in component model_parameters (hour).
C CONSTS(14) is tau_off in component model_parameters (hour).
C CONSTS(16) is cycle_length in component model_parameters (hour).
C CONSTS(15) is j in component model_parameters (dimensionless).
C ALGBRC(1) is time_hour in component model_parameters (hour).
C RATES(1) is d/dt P in component P (picomolar).
C RATES(4) is d/dt Ra in component Ra (picomolar).
C RATES(5) is d/dt Ri in component Ri (picomolar).
C RATES(2) is d/dt Ca in component Ca (picomolar).
C RATES(3) is d/dt Ci in component Ci (picomolar).
C
SUBROUTINE initConsts(CONSTS, RATES, STATES)
REAL CONSTS(*), RATES(*), STATES(*)
STATES(1) = 3
CONSTS(1) = 1e-6
CONSTS(2) = 1e-3
CONSTS(3) = 1e-7
CONSTS(4) = 1e-3
CONSTS(5) = 5e-3
STATES(2) = 4e-4
STATES(3) = 0.05
STATES(4) = 16.9
STATES(5) = 1.7
CONSTS(6) = 1e-3
CONSTS(7) = 1e-4
CONSTS(8) = 2e-3
CONSTS(9) = 0.4
CONSTS(10) = 0
CONSTS(11) = 7.5
CONSTS(12) = 0
CONSTS(13) = 0.5
CONSTS(14) = 0.5
CONSTS(15) = 9
CONSTS(16) = CONSTS(13)+CONSTS(14)
RETURN
END
SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC)
REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
RATES(4) = ( CONSTS(2)*STATES(2)+ CONSTS(6)*STATES(5)) - ( CONSTS(1)*STATES(4)*STATES(1)+ CONSTS(7)*STATES(4))
RATES(5) = ( CONSTS(4)*STATES(3)+ CONSTS(7)*STATES(4)) - ( CONSTS(3)*STATES(5)*STATES(1)+ CONSTS(6)*STATES(5))
RATES(2) = ( CONSTS(1)*STATES(4)*STATES(1)+ CONSTS(8)*STATES(3)) - ( CONSTS(2)*STATES(2)+ CONSTS(9)*STATES(2))
RATES(3) = ( CONSTS(3)*STATES(5)*STATES(1)+ CONSTS(9)*STATES(2)) - ( CONSTS(4)*STATES(3)+ CONSTS(8)*STATES(3))
ALGBRC(1) = ( VOI*1.00000)/3600.00
ALGBRC(3) = TERNRY(ALGBRC(1)/CONSTS(16).GE.CONSTS(15), CONSTS(12), TERNRY(ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).GE.0.00000.AND.ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).LT.CONSTS(13), CONSTS(11), TERNRY(ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).GE.CONSTS(13).AND.ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).LT.CONSTS(16), CONSTS(12), 0.0/0.0)
ALGBRC(4) = CONSTS(10)+ALGBRC(3)
RATES(1) = ( CONSTS(2)*STATES(2)+ CONSTS(4)*STATES(3)+ALGBRC(4)) - ( CONSTS(1)*STATES(4)*STATES(1)+ CONSTS(3)*STATES(5)*STATES(1)+ CONSTS(5)*STATES(1))
RETURN
END
SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
ALGBRC(1) = ( VOI*1.00000)/3600.00
ALGBRC(3) = TERNRY(ALGBRC(1)/CONSTS(16).GE.CONSTS(15), CONSTS(12), TERNRY(ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).GE.0.00000.AND.ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).LT.CONSTS(13), CONSTS(11), TERNRY(ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).GE.CONSTS(13).AND.ALGBRC(1) - INT(ALGBRC(1)/CONSTS(16))*CONSTS(16).LT.CONSTS(16), CONSTS(12), 0.0/0.0)
ALGBRC(4) = CONSTS(10)+ALGBRC(3)
ALGBRC(2) = (STATES(4)+STATES(2))/(STATES(4)+STATES(2)+STATES(5)+STATES(3))
RETURN
END
REAL FUNCTION TERNRY(TEST, VALA, VALB)
LOGICAL TEST
REAL VALA, VALB
IF (TEST) THEN
TERNRY = VALA
ELSE
TERNRY = VALB
ENDIF
RETURN
END
