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 10 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 8 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 E_R in component membrane (millivolt).
C CONSTS(2) is Cm in component membrane (microF_per_cm2).
C ALGBRC(5) is i_Na in component sodium_channel (microA_per_cm2).
C ALGBRC(9) is i_K in component potassium_channel (microA_per_cm2).
C ALGBRC(10) is i_L in component leakage_current (microA_per_cm2).
C ALGBRC(1) is i_Stim in component membrane (microA_per_cm2).
C CONSTS(3) is g_Na in component sodium_channel (milliS_per_cm2).
C CONSTS(6) is E_Na in component sodium_channel (millivolt).
C STATES(2) is m in component sodium_channel_m_gate (dimensionless).
C STATES(3) is h in component sodium_channel_h_gate (dimensionless).
C ALGBRC(2) is alpha_m in component sodium_channel_m_gate (per_millisecond).
C ALGBRC(6) is beta_m in component sodium_channel_m_gate (per_millisecond).
C ALGBRC(3) is alpha_h in component sodium_channel_h_gate (per_millisecond).
C ALGBRC(7) is beta_h in component sodium_channel_h_gate (per_millisecond).
C CONSTS(4) is g_K in component potassium_channel (milliS_per_cm2).
C CONSTS(7) is E_K in component potassium_channel (millivolt).
C STATES(4) is n in component potassium_channel_n_gate (dimensionless).
C ALGBRC(4) is alpha_n in component potassium_channel_n_gate (per_millisecond).
C ALGBRC(8) is beta_n in component potassium_channel_n_gate (per_millisecond).
C CONSTS(5) is g_L in component leakage_current (milliS_per_cm2).
C CONSTS(8) is E_L in component leakage_current (millivolt).
C RATES(1) is d/dt V in component membrane (millivolt).
C RATES(2) is d/dt m in component sodium_channel_m_gate (dimensionless).
C RATES(3) is d/dt h in component sodium_channel_h_gate (dimensionless).
C RATES(4) is d/dt n in component potassium_channel_n_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 0
      CONSTS(1) = 0
      CONSTS(2) = 1
      CONSTS(3) = 120
      STATES(2) = 0.05
      STATES(3) = 0.6
      CONSTS(4) = 36
      STATES(4) = 0.325
      CONSTS(5) = 0.3
      CONSTS(6) = CONSTS(1) - 115.000
      CONSTS(7) = CONSTS(1)+12.0000
      CONSTS(8) = CONSTS(1) - 10.6130
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( 0.100000*(STATES(1)+25.0000))/(EXP((STATES(1)+25.0000)/10.0000) - 1.00000)
      ALGBRC(6) =  4.00000*EXP(STATES(1)/18.0000)
      RATES(2) =  ALGBRC(2)*(1.00000 - STATES(2)) -  ALGBRC(6)*STATES(2)
      ALGBRC(3) =  0.0700000*EXP(STATES(1)/20.0000)
      ALGBRC(7) = 1.00000/(EXP((STATES(1)+30.0000)/10.0000)+1.00000)
      RATES(3) =  ALGBRC(3)*(1.00000 - STATES(3)) -  ALGBRC(7)*STATES(3)
      ALGBRC(4) = ( 0.0100000*(STATES(1)+10.0000))/(EXP((STATES(1)+10.0000)/10.0000) - 1.00000)
      ALGBRC(8) =  0.125000*EXP(STATES(1)/80.0000)
      RATES(4) =  ALGBRC(4)*(1.00000 - STATES(4)) -  ALGBRC(8)*STATES(4)
      ALGBRC(5) =  CONSTS(3)*STATES(2) ** 3.00000*STATES(3)*(STATES(1) - CONSTS(6))
      ALGBRC(9) =  CONSTS(4)*STATES(4) ** 4.00000*(STATES(1) - CONSTS(7))
      ALGBRC(10) =  CONSTS(5)*(STATES(1) - CONSTS(8))
      ALGBRC(1) = TERNRY(VOI.GE.10.0000.AND.VOI.LE.10.5000, - 20.0000, 0.00000)
      RATES(1) = - (- ALGBRC(1)+ALGBRC(5)+ALGBRC(9)+ALGBRC(10))/CONSTS(2)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = ( 0.100000*(STATES(1)+25.0000))/(EXP((STATES(1)+25.0000)/10.0000) - 1.00000)
      ALGBRC(6) =  4.00000*EXP(STATES(1)/18.0000)
      ALGBRC(3) =  0.0700000*EXP(STATES(1)/20.0000)
      ALGBRC(7) = 1.00000/(EXP((STATES(1)+30.0000)/10.0000)+1.00000)
      ALGBRC(4) = ( 0.0100000*(STATES(1)+10.0000))/(EXP((STATES(1)+10.0000)/10.0000) - 1.00000)
      ALGBRC(8) =  0.125000*EXP(STATES(1)/80.0000)
      ALGBRC(5) =  CONSTS(3)*STATES(2) ** 3.00000*STATES(3)*(STATES(1) - CONSTS(6))
      ALGBRC(9) =  CONSTS(4)*STATES(4) ** 4.00000*(STATES(1) - CONSTS(7))
      ALGBRC(10) =  CONSTS(5)*(STATES(1) - CONSTS(8))
      ALGBRC(1) = TERNRY(VOI.GE.10.0000.AND.VOI.LE.10.5000, - 20.0000, 0.00000)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END