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 16 entries in the algebraic variable array.
C There are a total of 4 entries in each of the rate and state variable arrays.
C There are a total of 32 entries in the constant variable array.
C
C
C VOI is time in component environment (ms).
C CONSTS(1) is epi in component environment (dimensionless).
C CONSTS(2) is endo in component environment (dimensionless).
C CONSTS(3) is mcell in component environment (dimensionless).
C STATES(1) is u in component membrane (dimensionless).
C ALGBRC(1) is Vm in component membrane (mV).
C CONSTS(4) is V_0 in component membrane (mV).
C CONSTS(5) is V_fi in component membrane (mV).
C ALGBRC(9) is J_fi in component fast_inward_current (per_ms).
C ALGBRC(15) is J_so in component slow_outward_current (per_ms).
C ALGBRC(16) is J_si in component slow_inward_current (per_ms).
C ALGBRC(2) is J_stim in component membrane (per_ms).
C ALGBRC(3) is m in component m (dimensionless).
C CONSTS(6) is u_m in component m (dimensionless).
C ALGBRC(5) is p in component p (dimensionless).
C CONSTS(7) is u_p in component p (dimensionless).
C ALGBRC(4) is q in component q (dimensionless).
C CONSTS(14) is u_q in component q (dimensionless).
C ALGBRC(6) is r in component r (dimensionless).
C CONSTS(16) is u_r in component r (dimensionless).
C CONSTS(17) is tau_fi in component fast_inward_current (ms).
C CONSTS(18) is u_u in component fast_inward_current (dimensionless).
C STATES(2) is v in component fast_inward_current_v_gate (dimensionless).
C ALGBRC(7) is v_inf in component fast_inward_current_v_gate (dimensionless).
C ALGBRC(10) is tau_v_minus in component fast_inward_current_v_gate (ms).
C CONSTS(31) is tau_v1_minus in component fast_inward_current_v_gate (ms).
C CONSTS(13) is tau_v2_minus in component fast_inward_current_v_gate (ms).
C CONSTS(8) is tau_v_plus in component fast_inward_current_v_gate (ms).
C ALGBRC(12) is tau_o in component slow_outward_current (ms).
C CONSTS(15) is tau_o1 in component slow_outward_current (ms).
C CONSTS(32) is tau_o2 in component slow_outward_current (ms).
C ALGBRC(14) is tau_so in component slow_outward_current (ms).
C CONSTS(19) is tau_so1 in component slow_outward_current (ms).
C CONSTS(20) is tau_so2 in component slow_outward_current (ms).
C CONSTS(21) is k_so in component slow_outward_current (dimensionless).
C CONSTS(22) is u_so in component slow_outward_current (dimensionless).
C CONSTS(23) is tau_si in component slow_inward_current (ms).
C STATES(3) is w in component slow_inward_current_w_gate (dimensionless).
C STATES(4) is s in component slow_inward_current_s_gate (dimensionless).
C ALGBRC(11) is w_inf in component slow_inward_current_w_gate (dimensionless).
C CONSTS(24) is tau_winf in component slow_inward_current_w_gate (ms).
C CONSTS(25) is wstar_inf in component slow_inward_current_w_gate (dimensionless).
C ALGBRC(13) is tau_w_minus in component slow_inward_current_w_gate (ms).
C CONSTS(26) is tau_w1_minus in component slow_inward_current_w_gate (ms).
C CONSTS(27) is tau_w2_minus in component slow_inward_current_w_gate (ms).
C CONSTS(28) is k_w_minus in component slow_inward_current_w_gate (dimensionless).
C CONSTS(29) is u_w_minus in component slow_inward_current_w_gate (dimensionless).
C CONSTS(30) is tau_w_plus in component slow_inward_current_w_gate (ms).
C ALGBRC(8) is tau_s in component slow_inward_current_s_gate (ms).
C CONSTS(9) is tau_s1 in component slow_inward_current_s_gate (ms).
C CONSTS(12) is tau_s2 in component slow_inward_current_s_gate (ms).
C CONSTS(10) is k_s in component slow_inward_current_s_gate (dimensionless).
C CONSTS(11) is u_s in component slow_inward_current_s_gate (dimensionless).
C RATES(1) is d/dt u in component membrane (dimensionless).
C RATES(2) is d/dt v in component fast_inward_current_v_gate (dimensionless).
C RATES(3) is d/dt w in component slow_inward_current_w_gate (dimensionless).
C RATES(4) is d/dt s in component slow_inward_current_s_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 1
      CONSTS(2) = 0
      CONSTS(3) = 0
      STATES(1) = 0
      CONSTS(4) = -83
      CONSTS(5) = 2.7
      CONSTS(6) = 0.3
      CONSTS(7) = 0.13
      STATES(2) = 1
      CONSTS(8) = 1.45
      STATES(3) = 1
      STATES(4) = 0
      CONSTS(9) = 2.7342
      CONSTS(10) = 2.0994
      CONSTS(11) = 0.9087
      CONSTS(12) = TERNRY(CONSTS(1).EQ.1.00000, 16.0000, TERNRY(CONSTS(2).EQ.1.00000, 2.00000, 4.00000)
      CONSTS(13) = TERNRY(CONSTS(1).EQ.1.00000, 1150.00, TERNRY(CONSTS(2).EQ.1.00000, 10.0000, 1.45000)
      CONSTS(14) = TERNRY(CONSTS(1).EQ.1.00000, 0.00600000, TERNRY(CONSTS(2).EQ.1.00000, 0.0240000, 0.100000)
      CONSTS(15) = TERNRY(CONSTS(1).EQ.1.00000, 400.000, TERNRY(CONSTS(2).EQ.1.00000, 470.000, 410.000)
      CONSTS(16) = TERNRY(CONSTS(1).EQ.1.00000, 0.00600000, TERNRY(CONSTS(2).EQ.1.00000, 0.00600000, 0.00500000)
      CONSTS(17) = TERNRY(CONSTS(1).EQ.1.00000, 0.110000, TERNRY(CONSTS(2).EQ.1.00000, 0.104000, 0.0780000)
      CONSTS(18) = TERNRY(CONSTS(1).EQ.1.00000, 1.55000, TERNRY(CONSTS(2).EQ.1.00000, 1.56000, 1.61000)
      CONSTS(19) = TERNRY(CONSTS(1).EQ.1.00000, 30.0200, TERNRY(CONSTS(2).EQ.1.00000, 40.0000, 91.0000)
      CONSTS(20) = TERNRY(CONSTS(1).EQ.1.00000, 0.996000, TERNRY(CONSTS(2).EQ.1.00000, 1.20000, 0.800000)
      CONSTS(21) = TERNRY(CONSTS(1).EQ.1.00000, 2.04600, TERNRY(CONSTS(2).EQ.1.00000, 2.00000, 2.10000)
      CONSTS(22) = TERNRY(CONSTS(1).EQ.1.00000, 0.650000, TERNRY(CONSTS(2).EQ.1.00000, 0.650000, 0.600000)
      CONSTS(23) = TERNRY(CONSTS(1).EQ.1.00000, 1.88750, TERNRY(CONSTS(2).EQ.1.00000, 2.90130, 3.38490)
      CONSTS(24) = TERNRY(CONSTS(1).EQ.1.00000, 0.0700000, TERNRY(CONSTS(2).EQ.1.00000, 0.0273000, 0.0100000)
      CONSTS(25) = TERNRY(CONSTS(1).EQ.1.00000, 0.940000, TERNRY(CONSTS(2).EQ.1.00000, 0.780000, 0.500000)
      CONSTS(26) = TERNRY(CONSTS(1).EQ.1.00000, 60.0000, TERNRY(CONSTS(2).EQ.1.00000, 6.00000, 70.0000)
      CONSTS(27) = TERNRY(CONSTS(1).EQ.1.00000, 15.0000, TERNRY(CONSTS(2).EQ.1.00000, 140.000, 8.00000)
      CONSTS(28) = TERNRY(CONSTS(1).EQ.1.00000, 65.0000, TERNRY(CONSTS(2).EQ.1.00000, 200.000, 200.000)
      CONSTS(29) = TERNRY(CONSTS(1).EQ.1.00000, 0.0300000, TERNRY(CONSTS(2).EQ.1.00000, 0.0160000, 0.0160000)
      CONSTS(30) = TERNRY(CONSTS(1).EQ.1.00000, 200.000, TERNRY(CONSTS(2).EQ.1.00000, 280.000, 280.000)
      CONSTS(31) = TERNRY(CONSTS(1).EQ.1.00000, 60.0000, TERNRY(CONSTS(2).EQ.1.00000, 75.0000, 80.0000)
      CONSTS(32) = TERNRY(CONSTS(1).EQ.1.00000, 6.00000, TERNRY(CONSTS(2).EQ.1.00000, 6.00000, 7.00000)
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(5) = TERNRY(STATES(1).LT.CONSTS(7), 0.00000, 1.00000)
      ALGBRC(8) =  (1.00000 - ALGBRC(5))*CONSTS(9)+ ALGBRC(5)*CONSTS(12)
      RATES(4) = ((1.00000+ tanh( CONSTS(10)*(STATES(1) - CONSTS(11))))/2.00000 - STATES(4))/ALGBRC(8)
      ALGBRC(3) = TERNRY(STATES(1).LT.CONSTS(6), 0.00000, 1.00000)
      ALGBRC(7) = TERNRY(STATES(1).LT.CONSTS(14), 1.00000, 0.00000)
      ALGBRC(4) = TERNRY(STATES(1).LT.CONSTS(14), 0.00000, 1.00000)
      ALGBRC(10) =  ALGBRC(4)*CONSTS(13)+ (1.00000 - ALGBRC(4))*CONSTS(31)
      RATES(2) = ( (1.00000 - ALGBRC(3))*(ALGBRC(7) - STATES(2)))/ALGBRC(10) - ( ALGBRC(3)*STATES(2))/CONSTS(8)
      ALGBRC(6) = TERNRY(STATES(1).LT.CONSTS(16), 0.00000, 1.00000)
      ALGBRC(11) =  (1.00000 - ALGBRC(6))*(1.00000 - ( STATES(1)*1.00000)/CONSTS(24))+ ALGBRC(6)*CONSTS(25)
      ALGBRC(13) = CONSTS(26)+( (CONSTS(27) - CONSTS(26))*(1.00000+ tanh( CONSTS(28)*(STATES(1) - CONSTS(29)))))/2.00000
      RATES(3) = ( (1.00000 - ALGBRC(6))*(ALGBRC(11) - STATES(3)))/ALGBRC(13) - ( ALGBRC(6)*STATES(3))/CONSTS(30)
      ALGBRC(9) = ( - ALGBRC(3)*STATES(2)*(STATES(1) - CONSTS(6))*(CONSTS(18) - STATES(1)))/CONSTS(17)
      ALGBRC(12) =  (1.00000 - ALGBRC(6))*CONSTS(15)+ ALGBRC(6)*CONSTS(32)
      ALGBRC(14) = CONSTS(19)+( (CONSTS(20) - CONSTS(19))*(1.00000+ tanh( CONSTS(21)*(STATES(1) - CONSTS(22)))))/2.00000
      ALGBRC(15) = ( STATES(1)*(1.00000 - ALGBRC(5)))/ALGBRC(12)+ALGBRC(5)/ALGBRC(14)
      ALGBRC(16) = ( - ALGBRC(5)*STATES(3)*STATES(4))/CONSTS(23)
      ALGBRC(2) = TERNRY(VOI.GE.100.000.AND.VOI.LE.101.000, - 1.00000, 0.00000)
      RATES(1) = - (ALGBRC(9)+ALGBRC(15)+ALGBRC(16)+ALGBRC(2))
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(5) = TERNRY(STATES(1).LT.CONSTS(7), 0.00000, 1.00000)
      ALGBRC(8) =  (1.00000 - ALGBRC(5))*CONSTS(9)+ ALGBRC(5)*CONSTS(12)
      ALGBRC(3) = TERNRY(STATES(1).LT.CONSTS(6), 0.00000, 1.00000)
      ALGBRC(7) = TERNRY(STATES(1).LT.CONSTS(14), 1.00000, 0.00000)
      ALGBRC(4) = TERNRY(STATES(1).LT.CONSTS(14), 0.00000, 1.00000)
      ALGBRC(10) =  ALGBRC(4)*CONSTS(13)+ (1.00000 - ALGBRC(4))*CONSTS(31)
      ALGBRC(6) = TERNRY(STATES(1).LT.CONSTS(16), 0.00000, 1.00000)
      ALGBRC(11) =  (1.00000 - ALGBRC(6))*(1.00000 - ( STATES(1)*1.00000)/CONSTS(24))+ ALGBRC(6)*CONSTS(25)
      ALGBRC(13) = CONSTS(26)+( (CONSTS(27) - CONSTS(26))*(1.00000+ tanh( CONSTS(28)*(STATES(1) - CONSTS(29)))))/2.00000
      ALGBRC(9) = ( - ALGBRC(3)*STATES(2)*(STATES(1) - CONSTS(6))*(CONSTS(18) - STATES(1)))/CONSTS(17)
      ALGBRC(12) =  (1.00000 - ALGBRC(6))*CONSTS(15)+ ALGBRC(6)*CONSTS(32)
      ALGBRC(14) = CONSTS(19)+( (CONSTS(20) - CONSTS(19))*(1.00000+ tanh( CONSTS(21)*(STATES(1) - CONSTS(22)))))/2.00000
      ALGBRC(15) = ( STATES(1)*(1.00000 - ALGBRC(5)))/ALGBRC(12)+ALGBRC(5)/ALGBRC(14)
      ALGBRC(16) = ( - ALGBRC(5)*STATES(3)*STATES(4))/CONSTS(23)
      ALGBRC(2) = TERNRY(VOI.GE.100.000.AND.VOI.LE.101.000, - 1.00000, 0.00000)
      ALGBRC(1) = CONSTS(4)+ STATES(1)*(CONSTS(5) - CONSTS(4))
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END