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 21 entries in the algebraic variable array. C There are a total of 11 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 (ms). C CONSTS(1) is R_gas_const in component parameters (millijoule_per_mole_kelvin). C CONSTS(2) is Temp in component parameters (kelvin). C CONSTS(3) is F in component parameters (coulomb_per_mole). C STATES(1) is V in component membrane (mV). C CONSTS(4) is Cm in component membrane (uF_per_cm2). C ALGBRC(1) is i_app in component stimulus_protocol (uA_per_cm2). C ALGBRC(13) is i_Na in component sodium_current (uA_per_cm2). C ALGBRC(15) is i_K in component potassium_current (uA_per_cm2). C ALGBRC(17) is i_leak in component leak_current (uA_per_cm2). C CONSTS(5) is IstimStart in component stimulus_protocol (ms). C CONSTS(6) is IstimEnd in component stimulus_protocol (ms). C CONSTS(7) is IstimAmplitude in component stimulus_protocol (uA_per_cm2). C CONSTS(8) is IstimPeriod in component stimulus_protocol (ms). C CONSTS(9) is IstimPulseDuration in component stimulus_protocol (ms). C ALGBRC(11) is x_infinity in component sodium_current (dimensionless). C ALGBRC(6) is alpha_x in component sodium_current (dimensionless). C ALGBRC(9) is beta_x in component sodium_current (dimensionless). C STATES(2) is n in component potassium_current_n_gate (dimensionless). C ALGBRC(2) is alpha_n in component potassium_current_n_gate (per_ms). C ALGBRC(7) is beta_n in component potassium_current_n_gate (per_ms). C ALGBRC(3) is T in component transmitter_release (uM). C CONSTS(10) is T_bar in component transmitter_release (uM). C STATES(3) is R in component transmitter_release (dimensionless). C CONSTS(11) is kr_plus in component transmitter_release (per_uM_per_ms). C CONSTS(12) is kr_minus in component transmitter_release (per_ms). C ALGBRC(20) is Ca in component calcium_concentration (uM). C CONSTS(13) is Ca_ex in component calcium_concentration (uM). C ALGBRC(10) is Ca_open in component calcium_concentration (uM). C CONSTS(14) is Dc in component calcium_concentration (um2_per_second). C CONSTS(15) is r in component calcium_concentration (nm). C ALGBRC(8) is sigma in component calcium_concentration (uM_per_ms). C ALGBRC(4) is i_V in component calcium_concentration (uA). C CONSTS(16) is g_Ca in component calcium_concentration (pS). C CONSTS(17) is P in component calcium_concentration (mV_per_uM). C ALGBRC(18) is O in component O (dimensionless). C ALGBRC(12) is alpha in component rate_constants (per_ms). C ALGBRC(14) is alpha_ in component rate_constants (per_ms). C ALGBRC(16) is beta in component rate_constants (per_ms). C ALGBRC(19) is beta_ in component rate_constants (per_ms). C ALGBRC(21) is kG_plus in component rate_constants (per_ms). C CONSTS(18) is kG_minus in component rate_constants (per_ms). C CONSTS(19) is kG2_minus in component rate_constants (per_ms). C CONSTS(20) is kG3_minus in component rate_constants (per_ms). C STATES(4) is a in component rate_constants (dimensionless). C CONSTS(21) is ka_plus in component rate_constants (per_uM_per_ms). C CONSTS(22) is ka_minus in component rate_constants (per_ms). C STATES(5) is C1 in component C1 (dimensionless). C STATES(6) is C2 in component C2 (dimensionless). C STATES(7) is C_G1 in component C_G1 (dimensionless). C STATES(8) is C3 in component C3 (dimensionless). C STATES(9) is C_G2 in component C_G2 (dimensionless). C STATES(10) is C4 in component C4 (dimensionless). C STATES(11) is C_G3 in component C_G3 (dimensionless). C ALGBRC(5) is C_G in component O (dimensionless). C RATES(1) is d/dt V in component membrane (mV). C RATES(2) is d/dt n in component potassium_current_n_gate (dimensionless). C RATES(3) is d/dt R in component transmitter_release (dimensionless). C RATES(4) is d/dt a in component rate_constants (dimensionless). C RATES(5) is d/dt C1 in component C1 (dimensionless). C RATES(6) is d/dt C2 in component C2 (dimensionless). C RATES(8) is d/dt C3 in component C3 (dimensionless). C RATES(10) is d/dt C4 in component C4 (dimensionless). C RATES(7) is d/dt C_G1 in component C_G1 (dimensionless). C RATES(9) is d/dt C_G2 in component C_G2 (dimensionless). C RATES(11) is d/dt C_G3 in component C_G3 (dimensionless). C SUBROUTINE initConsts(CONSTS, RATES, STATES) REAL CONSTS(*), RATES(*), STATES(*) CONSTS(1) = 8314.41 CONSTS(2) = 310 CONSTS(3) = 96485 STATES(1) = -65 CONSTS(4) = 1 CONSTS(5) = 10 CONSTS(6) = 50000 CONSTS(7) = 40.0 CONSTS(8) = 100 CONSTS(9) = 1 STATES(2) = 0 CONSTS(10) = 4000.0 STATES(3) = 0 CONSTS(11) = 0.15 CONSTS(12) = 2.5 CONSTS(13) = 2000.0 CONSTS(14) = 220 CONSTS(15) = 10 CONSTS(16) = 1.2 CONSTS(17) = 0.006 CONSTS(18) = 0.00025 CONSTS(19) = 0.016 CONSTS(20) = 1.024 STATES(4) = 0 CONSTS(21) = 200.0 CONSTS(22) = 0.0015 STATES(5) = 1 STATES(6) = 0 STATES(7) = 0 STATES(8) = 0 STATES(9) = 0 STATES(10) = 0 STATES(11) = 0 RETURN END SUBROUTINE computeRates(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(3) = CONSTS(10)*STATES(3) RATES(4) = CONSTS(21)*ALGBRC(3)*(1.00000 - STATES(4)) - CONSTS(22)*STATES(4) ALGBRC(2) = ( 0.0200000*(STATES(1)+55.0000))/(1.00000 - EXP(- (STATES(1)+55.0000)/10.0000)) ALGBRC(7) = 0.250000*EXP(- (STATES(1)+65.0000)/80.0000) RATES(2) = ALGBRC(2)*(1.00000 - STATES(2)) - ALGBRC(7)*STATES(2) ALGBRC(1) = TERNRY(VOI.GE.CONSTS(5).AND.VOI.LE.CONSTS(6).AND.(VOI - CONSTS(5)) - INT((VOI - CONSTS(5))/CONSTS(8))*CONSTS(8).LE.CONSTS(9), CONSTS(7), 0.00000) ALGBRC(6) = ( 0.200000*(STATES(1)+40.0000))/(1.00000 - 1.00000*EXP(- (STATES(1)+40.0000)/10.0000)) ALGBRC(9) = 8.00000*EXP(1.00000/- (STATES(1)+65.0000/18.0000)) ALGBRC(11) = ALGBRC(6)/(ALGBRC(6)+ALGBRC(9)) ALGBRC(13) = 120.000*ALGBRC(11) ** 3.00000*(1.00000 - STATES(2))*(STATES(1) - 120.000) ALGBRC(15) = ( 36.0000*STATES(2) ** 4.00000*(STATES(1)+77.0000))/1.00000 ALGBRC(17) = 0.300000*(STATES(1)+54.0000) RATES(1) = - ((ALGBRC(13)+ALGBRC(15)+ALGBRC(17)) - ALGBRC(1))/CONSTS(4) ALGBRC(18) = ((((((1.00000 - STATES(5)) - STATES(6)) - STATES(8)) - STATES(10)) - STATES(7)) - STATES(9)) - STATES(11) ALGBRC(12) = 0.450000*EXP(STATES(1)/22.0000) ALGBRC(16) = 0.0150000*EXP(- STATES(1)/14.0000) RATES(10) = ( 2.00000*ALGBRC(12)*STATES(8)+ 4.00000*ALGBRC(16)*ALGBRC(18)) - STATES(10)*( 3.00000*ALGBRC(16)+ALGBRC(12)) ALGBRC(4) = ( (( CONSTS(16)*CONSTS(17)*2.00000*CONSTS(3)*STATES(1))/( CONSTS(1)*CONSTS(2)))*CONSTS(13))/(1.00000 - EXP(( 2.00000*CONSTS(3)*STATES(1))/( CONSTS(1)*CONSTS(2)))) ALGBRC(8) = - 5.18200*ALGBRC(4) ALGBRC(10) = ALGBRC(8)/( 2.00000*CONSTS(14)*CONSTS(15)* 3.14159265358979) ALGBRC(20) = ALGBRC(18)*ALGBRC(10)+0.100000 RATES(3) = CONSTS(11)*ALGBRC(20)*(1.00000 - STATES(3)) - CONSTS(12)*STATES(3) ALGBRC(21) = ( 3.00000*STATES(4))/(680.000+ 320.000*STATES(4)) RATES(5) = ( ALGBRC(16)*STATES(6)+ CONSTS(18)*STATES(7)) - STATES(5)*( 4.00000*ALGBRC(12)+ALGBRC(21)) RATES(6) = ( 4.00000*ALGBRC(12)*STATES(5)+ 2.00000*ALGBRC(16)*STATES(8)+ CONSTS(19)*STATES(9)) - STATES(6)*(ALGBRC(16)+ 3.00000*ALGBRC(12)+ALGBRC(21)) RATES(8) = ( 3.00000*ALGBRC(12)*STATES(6)+ 3.00000*ALGBRC(16)*STATES(10)+ CONSTS(20)*STATES(11)) - STATES(8)*( 2.00000*ALGBRC(16)+ 2.00000*ALGBRC(12)+ALGBRC(21)) ALGBRC(14) = ALGBRC(12)/8.00000 ALGBRC(19) = ALGBRC(16)*8.00000 RATES(7) = ( ALGBRC(19)*STATES(9)+ ALGBRC(21)*STATES(5)) - STATES(7)*( 4.00000*ALGBRC(14)+CONSTS(18)) RATES(9) = ( 4.00000*ALGBRC(14)*STATES(7)+ 2.00000*ALGBRC(19)*STATES(11)+ ALGBRC(21)*STATES(6)) - STATES(9)*(ALGBRC(19)+ 3.00000*ALGBRC(14)+CONSTS(19)) RATES(11) = ( 3.00000*ALGBRC(14)*STATES(9)+ ALGBRC(21)*STATES(8)) - STATES(11)*( 2.00000*ALGBRC(19)+CONSTS(20)) RETURN END SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC) REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*) ALGBRC(3) = CONSTS(10)*STATES(3) ALGBRC(2) = ( 0.0200000*(STATES(1)+55.0000))/(1.00000 - EXP(- (STATES(1)+55.0000)/10.0000)) ALGBRC(7) = 0.250000*EXP(- (STATES(1)+65.0000)/80.0000) ALGBRC(1) = TERNRY(VOI.GE.CONSTS(5).AND.VOI.LE.CONSTS(6).AND.(VOI - CONSTS(5)) - INT((VOI - CONSTS(5))/CONSTS(8))*CONSTS(8).LE.CONSTS(9), CONSTS(7), 0.00000) ALGBRC(6) = ( 0.200000*(STATES(1)+40.0000))/(1.00000 - 1.00000*EXP(- (STATES(1)+40.0000)/10.0000)) ALGBRC(9) = 8.00000*EXP(1.00000/- (STATES(1)+65.0000/18.0000)) ALGBRC(11) = ALGBRC(6)/(ALGBRC(6)+ALGBRC(9)) ALGBRC(13) = 120.000*ALGBRC(11) ** 3.00000*(1.00000 - STATES(2))*(STATES(1) - 120.000) ALGBRC(15) = ( 36.0000*STATES(2) ** 4.00000*(STATES(1)+77.0000))/1.00000 ALGBRC(17) = 0.300000*(STATES(1)+54.0000) ALGBRC(18) = ((((((1.00000 - STATES(5)) - STATES(6)) - STATES(8)) - STATES(10)) - STATES(7)) - STATES(9)) - STATES(11) ALGBRC(12) = 0.450000*EXP(STATES(1)/22.0000) ALGBRC(16) = 0.0150000*EXP(- STATES(1)/14.0000) ALGBRC(4) = ( (( CONSTS(16)*CONSTS(17)*2.00000*CONSTS(3)*STATES(1))/( CONSTS(1)*CONSTS(2)))*CONSTS(13))/(1.00000 - EXP(( 2.00000*CONSTS(3)*STATES(1))/( CONSTS(1)*CONSTS(2)))) ALGBRC(8) = - 5.18200*ALGBRC(4) ALGBRC(10) = ALGBRC(8)/( 2.00000*CONSTS(14)*CONSTS(15)* 3.14159265358979) ALGBRC(20) = ALGBRC(18)*ALGBRC(10)+0.100000 ALGBRC(21) = ( 3.00000*STATES(4))/(680.000+ 320.000*STATES(4)) ALGBRC(14) = ALGBRC(12)/8.00000 ALGBRC(19) = ALGBRC(16)*8.00000 ALGBRC(5) = STATES(7)+STATES(9)+STATES(11) RETURN END REAL FUNCTION TERNRY(TEST, VALA, VALB) LOGICAL TEST REAL VALA, VALB IF (TEST) THEN TERNRY = VALA ELSE TERNRY = VALB ENDIF RETURN END