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 12 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 31 entries in the constant variable array.
C
C
C VOI is t in component interface (ms).
C CONSTS(1) is Cm in component interface (uFpmmsq).
C CONSTS(2) is Am in component interface (pmm).
C ALGBRC(1) is Istim in component interface (uApmmcu).
C STATES(1) is Vm in component membrane (mV).
C STATES(2) is Vt in component Ttubular_current_Vt_var (mV).
C STATES(3) is m in component sodium_current_m_gate (dimensionless).
C STATES(4) is h in component sodium_current_h_gate (dimensionless).
C STATES(5) is n in component potassium_current_n_gate (dimensionless).
C ALGBRC(5) is INa in component sodium_current (uApmmsq).
C ALGBRC(10) is IK in component potassium_current (uApmmsq).
C ALGBRC(11) is IL in component leak_current (uApmmsq).
C ALGBRC(12) is IT in component Ttubular_current (uApmmsq).
C ALGBRC(6) is IStimC in component interface (uApmmcu).
C CONSTS(31) is AmC in component interface (pmm).
C CONSTS(3) is IstimStart in component interface (ms).
C CONSTS(4) is IstimEnd in component interface (ms).
C CONSTS(5) is IstimAmplitude in component interface (uApmmcu).
C CONSTS(6) is IstimPeriod in component interface (ms).
C CONSTS(7) is IstimPulseDuration in component interface (ms).
C CONSTS(8) is gNa_max in component sodium_current (mSpmmsq).
C CONSTS(9) is ENa in component sodium_current (mV).
C ALGBRC(2) is alpha_m in component sodium_current_m_gate (pms).
C ALGBRC(7) is beta_m in component sodium_current_m_gate (pms).
C CONSTS(10) is alpha_m_max in component sodium_current_m_gate (pms).
C CONSTS(11) is beta_m_max in component sodium_current_m_gate (pms).
C CONSTS(12) is Em in component sodium_current_m_gate (mV).
C CONSTS(13) is v_alpha_m in component sodium_current_m_gate (dimensionless).
C CONSTS(14) is v_beta_m in component sodium_current_m_gate (mV).
C ALGBRC(3) is alpha_h in component sodium_current_h_gate (pms).
C ALGBRC(8) is beta_h in component sodium_current_h_gate (pms).
C CONSTS(15) is alpha_h_max in component sodium_current_h_gate (pms).
C CONSTS(16) is beta_h_max in component sodium_current_h_gate (pms).
C CONSTS(17) is Eh in component sodium_current_h_gate (mV).
C CONSTS(18) is v_alpha_h in component sodium_current_h_gate (mV).
C CONSTS(19) is v_beta_h in component sodium_current_h_gate (mV).
C CONSTS(20) is gK_max in component potassium_current (mSpmmsq).
C CONSTS(21) is EK in component potassium_current (mV).
C ALGBRC(4) is alpha_n in component potassium_current_n_gate (pms).
C ALGBRC(9) is beta_n in component potassium_current_n_gate (pms).
C CONSTS(22) is alpha_n_max in component potassium_current_n_gate (pms).
C CONSTS(23) is beta_n_max in component potassium_current_n_gate (pms).
C CONSTS(24) is En in component potassium_current_n_gate (mV).
C CONSTS(25) is v_alpha_n in component potassium_current_n_gate (dimensionless).
C CONSTS(26) is v_beta_n in component potassium_current_n_gate (mV).
C CONSTS(27) is EL in component leak_current (mV).
C CONSTS(28) is gL_max in component leak_current (mSpmmsq).
C CONSTS(29) is Rs in component Ttubular_current (mmsqpmS).
C CONSTS(30) is Ct in component Ttubular_current_Vt_var (uFpmmsq).
C RATES(1) is d/dt Vm in component membrane (mV).
C RATES(3) is d/dt m in component sodium_current_m_gate (dimensionless).
C RATES(4) is d/dt h in component sodium_current_h_gate (dimensionless).
C RATES(5) is d/dt n in component potassium_current_n_gate (dimensionless).
C RATES(2) is d/dt Vt in component Ttubular_current_Vt_var (mV).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 0.009
      CONSTS(2) = 200.0
      STATES(1) = -95.0
      STATES(2) = -95.0
      STATES(3) = 0.0
      STATES(4) = 1.0
      STATES(5) = 0.0
      CONSTS(3) = 10
      CONSTS(4) = 50000
      CONSTS(5) = 0.5
      CONSTS(6) = 1000
      CONSTS(7) = 1
      CONSTS(8) = 1.8
      CONSTS(9) = 50.0
      CONSTS(10) = 0.208
      CONSTS(11) = 2.081
      CONSTS(12) = -42.0
      CONSTS(13) = 10.0
      CONSTS(14) = 18.0
      CONSTS(15) = 0.0156
      CONSTS(16) = 3.382
      CONSTS(17) = -41.0
      CONSTS(18) = 14.7
      CONSTS(19) = 7.6
      CONSTS(20) = 0.415
      CONSTS(21) = -70.0
      CONSTS(22) = 0.0229
      CONSTS(23) = 0.09616
      CONSTS(24) = -40.0
      CONSTS(25) = 7.0
      CONSTS(26) = 40.0
      CONSTS(27) = -95.0
      CONSTS(28) = 0.0024
      CONSTS(29) = 15.0
      CONSTS(30) = 0.04
      CONSTS(31) = CONSTS(2)
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(2) = (STATES(1) - STATES(2))/( CONSTS(29)*CONSTS(30))
      ALGBRC(2) = ( CONSTS(10)*(STATES(1) - CONSTS(12)))/(1.00000 - EXP((CONSTS(12) - STATES(1))/CONSTS(13)))
      ALGBRC(7) =  CONSTS(11)*EXP((CONSTS(12) - STATES(1))/CONSTS(14))
      RATES(3) =  ALGBRC(2)*(1.00000 - STATES(3)) -  ALGBRC(7)*STATES(3)
      ALGBRC(3) =  CONSTS(15)*EXP((CONSTS(17) - STATES(1))/CONSTS(18))
      ALGBRC(8) = CONSTS(16)/(1.00000+EXP((CONSTS(17) - STATES(1))/CONSTS(19)))
      RATES(4) =  ALGBRC(3)*(1.00000 - STATES(4)) -  ALGBRC(8)*STATES(4)
      ALGBRC(4) = ( CONSTS(22)*(STATES(1) - CONSTS(24)))/(1.00000 - EXP((CONSTS(24) - STATES(1))/CONSTS(25)))
      ALGBRC(9) =  CONSTS(23)*EXP((CONSTS(24) - STATES(1))/CONSTS(26))
      RATES(5) =  ALGBRC(4)*(1.00000 - STATES(5)) -  ALGBRC(9)*STATES(5)
      ALGBRC(1) = TERNRY(VOI.GE.CONSTS(3).AND.VOI.LE.CONSTS(4).AND.(VOI - CONSTS(3)) -  INT((VOI - CONSTS(3))/CONSTS(6))*CONSTS(6).LE.CONSTS(7), CONSTS(5), 0.00000)
      ALGBRC(5) =  CONSTS(8)*STATES(3)*STATES(3)*STATES(3)*STATES(4)*(STATES(1) - CONSTS(9))
      ALGBRC(10) =  CONSTS(20)*STATES(5)*STATES(5)*STATES(5)*STATES(5)*(STATES(1) - CONSTS(21))
      ALGBRC(11) =  CONSTS(28)*(STATES(1) - CONSTS(27))
      ALGBRC(12) = (STATES(1) - STATES(2))/CONSTS(29)
      RATES(1) = (ALGBRC(1) - (ALGBRC(5)+ALGBRC(10)+ALGBRC(11)+ALGBRC(12)))/CONSTS(1)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( CONSTS(10)*(STATES(1) - CONSTS(12)))/(1.00000 - EXP((CONSTS(12) - STATES(1))/CONSTS(13)))
      ALGBRC(7) =  CONSTS(11)*EXP((CONSTS(12) - STATES(1))/CONSTS(14))
      ALGBRC(3) =  CONSTS(15)*EXP((CONSTS(17) - STATES(1))/CONSTS(18))
      ALGBRC(8) = CONSTS(16)/(1.00000+EXP((CONSTS(17) - STATES(1))/CONSTS(19)))
      ALGBRC(4) = ( CONSTS(22)*(STATES(1) - CONSTS(24)))/(1.00000 - EXP((CONSTS(24) - STATES(1))/CONSTS(25)))
      ALGBRC(9) =  CONSTS(23)*EXP((CONSTS(24) - STATES(1))/CONSTS(26))
      ALGBRC(1) = TERNRY(VOI.GE.CONSTS(3).AND.VOI.LE.CONSTS(4).AND.(VOI - CONSTS(3)) -  INT((VOI - CONSTS(3))/CONSTS(6))*CONSTS(6).LE.CONSTS(7), CONSTS(5), 0.00000)
      ALGBRC(5) =  CONSTS(8)*STATES(3)*STATES(3)*STATES(3)*STATES(4)*(STATES(1) - CONSTS(9))
      ALGBRC(10) =  CONSTS(20)*STATES(5)*STATES(5)*STATES(5)*STATES(5)*(STATES(1) - CONSTS(21))
      ALGBRC(11) =  CONSTS(28)*(STATES(1) - CONSTS(27))
      ALGBRC(12) = (STATES(1) - STATES(2))/CONSTS(29)
      ALGBRC(6) = ALGBRC(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