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 25 entries in the algebraic variable array.
C There are a total of 8 entries in each of the rate and state variable arrays.
C There are a total of 24 entries in the constant variable array.
C
C
C VOI is time in component environment (millisecond).
C STATES(1) is V in component membrane (millivolt).
C CONSTS(1) is R in component membrane (joule_per_kilomole_kelvin).
C CONSTS(2) is T in component membrane (kelvin).
C CONSTS(3) is F in component membrane (coulomb_per_mole).
C CONSTS(4) is C in component membrane (microF_per_cm2).
C ALGBRC(1) is I_stim in component membrane (microA_per_cm2).
C ALGBRC(8) is i_Na in component fast_sodium_current (microA_per_cm2).
C ALGBRC(16) is i_si in component slow_inward_current (microA_per_cm2).
C ALGBRC(18) is i_K in component time_dependent_potassium_current (microA_per_cm2).
C ALGBRC(22) is i_K1 in component time_independent_potassium_current (microA_per_cm2).
C ALGBRC(24) is i_Kp in component plateau_potassium_current (microA_per_cm2).
C ALGBRC(25) is i_b in component background_current (microA_per_cm2).
C CONSTS(5) is stim_start in component membrane (millisecond).
C CONSTS(6) is stim_end in component membrane (millisecond).
C CONSTS(7) is stim_period in component membrane (millisecond).
C CONSTS(8) is stim_duration in component membrane (millisecond).
C CONSTS(9) is stim_amplitude in component membrane (microA_per_cm2).
C CONSTS(10) is g_Na in component fast_sodium_current (milliS_per_cm2).
C CONSTS(19) is E_Na in component fast_sodium_current (millivolt).
C CONSTS(11) is Nao in component ionic_concentrations (millimolar).
C CONSTS(12) is Nai in component ionic_concentrations (millimolar).
C STATES(2) is m in component fast_sodium_current_m_gate (dimensionless).
C STATES(3) is h in component fast_sodium_current_h_gate (dimensionless).
C STATES(4) is j in component fast_sodium_current_j_gate (dimensionless).
C ALGBRC(2) is alpha_m in component fast_sodium_current_m_gate (per_millisecond).
C ALGBRC(9) is beta_m in component fast_sodium_current_m_gate (per_millisecond).
C ALGBRC(3) is alpha_h in component fast_sodium_current_h_gate (per_millisecond).
C ALGBRC(10) is beta_h in component fast_sodium_current_h_gate (per_millisecond).
C ALGBRC(4) is alpha_j in component fast_sodium_current_j_gate (per_millisecond).
C ALGBRC(11) is beta_j in component fast_sodium_current_j_gate (per_millisecond).
C ALGBRC(15) is E_si in component slow_inward_current (millivolt).
C STATES(5) is Cai in component intracellular_calcium_concentration (millimolar).
C STATES(6) is d in component slow_inward_current_d_gate (dimensionless).
C STATES(7) is f in component slow_inward_current_f_gate (dimensionless).
C ALGBRC(5) is alpha_d in component slow_inward_current_d_gate (per_millisecond).
C ALGBRC(12) is beta_d in component slow_inward_current_d_gate (per_millisecond).
C ALGBRC(6) is alpha_f in component slow_inward_current_f_gate (per_millisecond).
C ALGBRC(13) is beta_f in component slow_inward_current_f_gate (per_millisecond).
C CONSTS(20) is g_K in component time_dependent_potassium_current (milliS_per_cm2).
C CONSTS(21) is E_K in component time_dependent_potassium_current (millivolt).
C CONSTS(13) is PR_NaK in component time_dependent_potassium_current (dimensionless).
C CONSTS(14) is Ko in component ionic_concentrations (millimolar).
C CONSTS(15) is Ki in component ionic_concentrations (millimolar).
C STATES(8) is X in component time_dependent_potassium_current_X_gate (dimensionless).
C ALGBRC(17) is Xi in component time_dependent_potassium_current_Xi_gate (dimensionless).
C ALGBRC(7) is alpha_X in component time_dependent_potassium_current_X_gate (per_millisecond).
C ALGBRC(14) is beta_X in component time_dependent_potassium_current_X_gate (per_millisecond).
C CONSTS(22) is E_K1 in component time_independent_potassium_current (millivolt).
C CONSTS(23) is g_K1 in component time_independent_potassium_current (milliS_per_cm2).
C ALGBRC(21) is K1_infinity in component time_independent_potassium_current_K1_gate (dimensionless).
C ALGBRC(19) is alpha_K1 in component time_independent_potassium_current_K1_gate (per_millisecond).
C ALGBRC(20) is beta_K1 in component time_independent_potassium_current_K1_gate (per_millisecond).
C CONSTS(24) is E_Kp in component plateau_potassium_current (millivolt).
C CONSTS(16) is g_Kp in component plateau_potassium_current (milliS_per_cm2).
C ALGBRC(23) is Kp in component plateau_potassium_current (dimensionless).
C CONSTS(17) is E_b in component background_current (millivolt).
C CONSTS(18) is g_b in component background_current (milliS_per_cm2).
C RATES(1) is d/dt V in component membrane (millivolt).
C RATES(2) is d/dt m in component fast_sodium_current_m_gate (dimensionless).
C RATES(3) is d/dt h in component fast_sodium_current_h_gate (dimensionless).
C RATES(4) is d/dt j in component fast_sodium_current_j_gate (dimensionless).
C RATES(6) is d/dt d in component slow_inward_current_d_gate (dimensionless).
C RATES(7) is d/dt f in component slow_inward_current_f_gate (dimensionless).
C RATES(8) is d/dt X in component time_dependent_potassium_current_X_gate (dimensionless).
C RATES(5) is d/dt Cai in component intracellular_calcium_concentration (millimolar).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = -84.3801107371
      CONSTS(1) = 8314
      CONSTS(2) = 310
      CONSTS(3) = 96484.6
      CONSTS(4) = 1
      CONSTS(5) = 100
      CONSTS(6) = 9000
      CONSTS(7) = 1000
      CONSTS(8) = 2
      CONSTS(9) = -25.5
      CONSTS(10) = 23
      CONSTS(11) = 140
      CONSTS(12) = 18
      STATES(2) = 0.00171338077730188
      STATES(3) = 0.982660523699656
      STATES(4) = 0.989108212766685
      STATES(5) = 0.00017948816388306
      STATES(6) = 0.00302126301779861
      STATES(7) = 0.999967936476325
      CONSTS(13) = 0.01833
      CONSTS(14) = 5.4
      CONSTS(15) = 145
      STATES(8) = 0.0417603108167287
      CONSTS(16) = 0.0183
      CONSTS(17) = -59.87
      CONSTS(18) = 0.03921
      CONSTS(19) =  (( CONSTS(1)*CONSTS(2))/CONSTS(3))*log(CONSTS(11)/CONSTS(12))
      CONSTS(20) =  0.282000* (CONSTS(14)/5.40000) ** (1.0 / 2)
      CONSTS(21) =  (( CONSTS(1)*CONSTS(2))/CONSTS(3))*log((CONSTS(14)+ CONSTS(13)*CONSTS(11))/(CONSTS(15)+ CONSTS(13)*CONSTS(12)))
      CONSTS(22) =  (( CONSTS(1)*CONSTS(2))/CONSTS(3))*log(CONSTS(14)/CONSTS(15))
      CONSTS(23) =  0.604700* (CONSTS(14)/5.40000) ** (1.0 / 2)
      CONSTS(24) = CONSTS(22)
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( 0.320000*(STATES(1)+47.1300))/(1.00000 - EXP( - 0.100000*(STATES(1)+47.1300)))
      ALGBRC(9) =  0.0800000*EXP(- STATES(1)/11.0000)
      RATES(2) =  ALGBRC(2)*(1.00000 - STATES(2)) -  ALGBRC(9)*STATES(2)
      ALGBRC(3) = TERNRY(STATES(1).LT.- 40.0000,  0.135000*EXP((80.0000+STATES(1))/- 6.80000), 0.00000)
      ALGBRC(10) = TERNRY(STATES(1).LT.- 40.0000,  3.56000*EXP( 0.0790000*STATES(1))+ 310000.*EXP( 0.350000*STATES(1)), 1.00000/( 0.130000*(1.00000+EXP((STATES(1)+10.6600)/- 11.1000))))
      RATES(3) =  ALGBRC(3)*(1.00000 - STATES(3)) -  ALGBRC(10)*STATES(3)
      ALGBRC(4) = TERNRY(STATES(1).LT.- 40.0000, ( ( - 127140.*EXP( 0.244400*STATES(1)) -  3.47400e-05*EXP( - 0.0439100*STATES(1)))*(STATES(1)+37.7800))/(1.00000+EXP( 0.311000*(STATES(1)+79.2300))), 0.00000)
      ALGBRC(11) = TERNRY(STATES(1).LT.- 40.0000, ( 0.121200*EXP( - 0.0105200*STATES(1)))/(1.00000+EXP( - 0.137800*(STATES(1)+40.1400))), ( 0.300000*EXP( - 2.53500e-07*STATES(1)))/(1.00000+EXP( - 0.100000*(STATES(1)+32.0000))))
      RATES(4) =  ALGBRC(4)*(1.00000 - STATES(4)) -  ALGBRC(11)*STATES(4)
      ALGBRC(5) = ( 0.0950000*EXP( - 0.0100000*(STATES(1) - 5.00000)))/(1.00000+EXP( - 0.0720000*(STATES(1) - 5.00000)))
      ALGBRC(12) = ( 0.0700000*EXP( - 0.0170000*(STATES(1)+44.0000)))/(1.00000+EXP( 0.0500000*(STATES(1)+44.0000)))
      RATES(6) =  ALGBRC(5)*(1.00000 - STATES(6)) -  ALGBRC(12)*STATES(6)
      ALGBRC(6) = ( 0.0120000*EXP( - 0.00800000*(STATES(1)+28.0000)))/(1.00000+EXP( 0.150000*(STATES(1)+28.0000)))
      ALGBRC(13) = ( 0.00650000*EXP( - 0.0200000*(STATES(1)+30.0000)))/(1.00000+EXP( - 0.200000*(STATES(1)+30.0000)))
      RATES(7) =  ALGBRC(6)*(1.00000 - STATES(7)) -  ALGBRC(13)*STATES(7)
      ALGBRC(7) = ( 0.000500000*EXP( 0.0830000*(STATES(1)+50.0000)))/(1.00000+EXP( 0.0570000*(STATES(1)+50.0000)))
      ALGBRC(14) = ( 0.00130000*EXP( - 0.0600000*(STATES(1)+20.0000)))/(1.00000+EXP( - 0.0400000*(STATES(1)+20.0000)))
      RATES(8) =  ALGBRC(7)*(1.00000 - STATES(8)) -  ALGBRC(14)*STATES(8)
      ALGBRC(15) = 7.70000 -  13.0287*log(STATES(5)/1.00000)
      ALGBRC(16) =  0.0900000*STATES(6)*STATES(7)*(STATES(1) - ALGBRC(15))
      RATES(5) =  (- 0.000100000/1.00000)*ALGBRC(16)+ 0.0700000*(0.000100000 - STATES(5))
      ALGBRC(1) = TERNRY(VOI.GE.CONSTS(5).AND.VOI.LE.CONSTS(6).AND.(VOI - CONSTS(5)) -  INT((VOI - CONSTS(5))/CONSTS(7))*CONSTS(7).LE.CONSTS(8), CONSTS(9), 0.00000)
      ALGBRC(8) =  CONSTS(10)*STATES(2) ** 3.00000*STATES(3)*STATES(4)*(STATES(1) - CONSTS(19))
      ALGBRC(17) = TERNRY(STATES(1).GT.- 100.000, ( 2.83700*(EXP( 0.0400000*(STATES(1)+77.0000)) - 1.00000))/( (STATES(1)+77.0000)*EXP( 0.0400000*(STATES(1)+35.0000))), 1.00000)
      ALGBRC(18) =  CONSTS(20)*STATES(8)*ALGBRC(17)*(STATES(1) - CONSTS(21))
      ALGBRC(19) = 1.02000/(1.00000+EXP( 0.238500*((STATES(1) - CONSTS(22)) - 59.2150)))
      ALGBRC(20) = ( 0.491240*EXP( 0.0803200*((STATES(1)+5.47600) - CONSTS(22)))+ 1.00000*EXP( 0.0617500*(STATES(1) - (CONSTS(22)+594.310))))/(1.00000+EXP( - 0.514300*((STATES(1) - CONSTS(22))+4.75300)))
      ALGBRC(21) = ALGBRC(19)/(ALGBRC(19)+ALGBRC(20))
      ALGBRC(22) =  CONSTS(23)*ALGBRC(21)*(STATES(1) - CONSTS(22))
      ALGBRC(23) = 1.00000/(1.00000+EXP((7.48800 - STATES(1))/5.98000))
      ALGBRC(24) =  CONSTS(16)*ALGBRC(23)*(STATES(1) - CONSTS(24))
      ALGBRC(25) =  CONSTS(18)*(STATES(1) - CONSTS(17))
      RATES(1) =  (- 1.00000/CONSTS(4))*(ALGBRC(1)+ALGBRC(8)+ALGBRC(16)+ALGBRC(18)+ALGBRC(22)+ALGBRC(24)+ALGBRC(25))
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( 0.320000*(STATES(1)+47.1300))/(1.00000 - EXP( - 0.100000*(STATES(1)+47.1300)))
      ALGBRC(9) =  0.0800000*EXP(- STATES(1)/11.0000)
      ALGBRC(3) = TERNRY(STATES(1).LT.- 40.0000,  0.135000*EXP((80.0000+STATES(1))/- 6.80000), 0.00000)
      ALGBRC(10) = TERNRY(STATES(1).LT.- 40.0000,  3.56000*EXP( 0.0790000*STATES(1))+ 310000.*EXP( 0.350000*STATES(1)), 1.00000/( 0.130000*(1.00000+EXP((STATES(1)+10.6600)/- 11.1000))))
      ALGBRC(4) = TERNRY(STATES(1).LT.- 40.0000, ( ( - 127140.*EXP( 0.244400*STATES(1)) -  3.47400e-05*EXP( - 0.0439100*STATES(1)))*(STATES(1)+37.7800))/(1.00000+EXP( 0.311000*(STATES(1)+79.2300))), 0.00000)
      ALGBRC(11) = TERNRY(STATES(1).LT.- 40.0000, ( 0.121200*EXP( - 0.0105200*STATES(1)))/(1.00000+EXP( - 0.137800*(STATES(1)+40.1400))), ( 0.300000*EXP( - 2.53500e-07*STATES(1)))/(1.00000+EXP( - 0.100000*(STATES(1)+32.0000))))
      ALGBRC(5) = ( 0.0950000*EXP( - 0.0100000*(STATES(1) - 5.00000)))/(1.00000+EXP( - 0.0720000*(STATES(1) - 5.00000)))
      ALGBRC(12) = ( 0.0700000*EXP( - 0.0170000*(STATES(1)+44.0000)))/(1.00000+EXP( 0.0500000*(STATES(1)+44.0000)))
      ALGBRC(6) = ( 0.0120000*EXP( - 0.00800000*(STATES(1)+28.0000)))/(1.00000+EXP( 0.150000*(STATES(1)+28.0000)))
      ALGBRC(13) = ( 0.00650000*EXP( - 0.0200000*(STATES(1)+30.0000)))/(1.00000+EXP( - 0.200000*(STATES(1)+30.0000)))
      ALGBRC(7) = ( 0.000500000*EXP( 0.0830000*(STATES(1)+50.0000)))/(1.00000+EXP( 0.0570000*(STATES(1)+50.0000)))
      ALGBRC(14) = ( 0.00130000*EXP( - 0.0600000*(STATES(1)+20.0000)))/(1.00000+EXP( - 0.0400000*(STATES(1)+20.0000)))
      ALGBRC(15) = 7.70000 -  13.0287*log(STATES(5)/1.00000)
      ALGBRC(16) =  0.0900000*STATES(6)*STATES(7)*(STATES(1) - ALGBRC(15))
      ALGBRC(1) = TERNRY(VOI.GE.CONSTS(5).AND.VOI.LE.CONSTS(6).AND.(VOI - CONSTS(5)) -  INT((VOI - CONSTS(5))/CONSTS(7))*CONSTS(7).LE.CONSTS(8), CONSTS(9), 0.00000)
      ALGBRC(8) =  CONSTS(10)*STATES(2) ** 3.00000*STATES(3)*STATES(4)*(STATES(1) - CONSTS(19))
      ALGBRC(17) = TERNRY(STATES(1).GT.- 100.000, ( 2.83700*(EXP( 0.0400000*(STATES(1)+77.0000)) - 1.00000))/( (STATES(1)+77.0000)*EXP( 0.0400000*(STATES(1)+35.0000))), 1.00000)
      ALGBRC(18) =  CONSTS(20)*STATES(8)*ALGBRC(17)*(STATES(1) - CONSTS(21))
      ALGBRC(19) = 1.02000/(1.00000+EXP( 0.238500*((STATES(1) - CONSTS(22)) - 59.2150)))
      ALGBRC(20) = ( 0.491240*EXP( 0.0803200*((STATES(1)+5.47600) - CONSTS(22)))+ 1.00000*EXP( 0.0617500*(STATES(1) - (CONSTS(22)+594.310))))/(1.00000+EXP( - 0.514300*((STATES(1) - CONSTS(22))+4.75300)))
      ALGBRC(21) = ALGBRC(19)/(ALGBRC(19)+ALGBRC(20))
      ALGBRC(22) =  CONSTS(23)*ALGBRC(21)*(STATES(1) - CONSTS(22))
      ALGBRC(23) = 1.00000/(1.00000+EXP((7.48800 - STATES(1))/5.98000))
      ALGBRC(24) =  CONSTS(16)*ALGBRC(23)*(STATES(1) - CONSTS(24))
      ALGBRC(25) =  CONSTS(18)*(STATES(1) - CONSTS(17))
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END