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 7 entries in the algebraic variable array.
C There are a total of 2 entries in each of the rate and state variable arrays.
C There are a total of 4 entries in the constant variable array.
C
C
C ALGBRC(1) is V in component environment (millivolt).
C CONSTS(1) is V_hold in component environment (millivolt).
C CONSTS(2) is V_new in component environment (millivolt).
C VOI is t in component environment (millisec).
C STATES(1) is m in component sodium_channel_m_gate (dimensionless).
C STATES(2) is h in component sodium_channel_h_gate (dimensionless).
C CONSTS(3) is g_Na in component sodium_channel (milliS_per_cm2).
C CONSTS(4) is E_Na in component sodium_channel (millivolt).
C ALGBRC(2) is Na_conductance in component sodium_channel (milliS_per_cm2).
C ALGBRC(5) is i_Na in component sodium_channel (microA_per_cm2).
C ALGBRC(3) is alpha_m in component sodium_channel_m_gate (per_millisec).
C ALGBRC(6) is beta_m in component sodium_channel_m_gate (per_millisec).
C ALGBRC(4) is alpha_h in component sodium_channel_h_gate (per_millisec).
C ALGBRC(7) is beta_h in component sodium_channel_h_gate (per_millisec).
C RATES(1) is d/dt m in component sodium_channel_m_gate (dimensionless).
C RATES(2) is d/dt h in component sodium_channel_h_gate (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = -85.0
      CONSTS(2) = -10.0
      STATES(1) = 0.05
      STATES(2) = 0.6
      CONSTS(3) = 120
      CONSTS(4) = 35
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = TERNRY(VOI.GT.5.00000.AND.VOI.LT.30.0000, CONSTS(2), CONSTS(1))
      ALGBRC(3) = ( - 0.100000*(ALGBRC(1)+50.0000))/(EXP(- (ALGBRC(1)+50.0000)/10.0000) - 1.00000)
      ALGBRC(6) =  4.00000*EXP(- (ALGBRC(1)+75.0000)/18.0000)
      RATES(1) =  ALGBRC(3)*(1.00000 - STATES(1)) -  ALGBRC(6)*STATES(1)
      ALGBRC(4) =  0.0700000*EXP(- (ALGBRC(1)+75.0000)/20.0000)
      ALGBRC(7) = 1.00000/(EXP(- (ALGBRC(1)+45.0000)/10.0000)+1.00000)
      RATES(2) =  ALGBRC(4)*(1.00000 - STATES(2)) -  ALGBRC(7)*STATES(2)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = TERNRY(VOI.GT.5.00000.AND.VOI.LT.30.0000, CONSTS(2), CONSTS(1))
      ALGBRC(3) = ( - 0.100000*(ALGBRC(1)+50.0000))/(EXP(- (ALGBRC(1)+50.0000)/10.0000) - 1.00000)
      ALGBRC(6) =  4.00000*EXP(- (ALGBRC(1)+75.0000)/18.0000)
      ALGBRC(4) =  0.0700000*EXP(- (ALGBRC(1)+75.0000)/20.0000)
      ALGBRC(7) = 1.00000/(EXP(- (ALGBRC(1)+45.0000)/10.0000)+1.00000)
      ALGBRC(2) =  CONSTS(3)*STATES(1) ** 3.00000*STATES(2)
      ALGBRC(5) =  ALGBRC(2)*(ALGBRC(1) - 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