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 30 entries in the algebraic variable array.
C There are a total of 7 entries in each of the rate and state variable arrays.
C There are a total of 22 entries in the constant variable array.
C
C
C VOI is t in component environment (second).
C CONSTS(1) is C_m in component environment (fF).
C STATES(1) is q_K_o in component environment (fmol).
C STATES(2) is q_K_i in component environment (fmol).
C STATES(3) is q_Sa in component environment (fmol).
C STATES(4) is q_Sb in component environment (fmol).
C STATES(5) is q_Sc in component environment (fmol).
C STATES(6) is q_Sd in component environment (fmol).
C STATES(7) is q_mem in component environment (fC).
C CONSTS(2) is R in component environment (J_per_K_per_mol).
C CONSTS(3) is T in component environment (kelvin).
C CONSTS(4) is F in component environment (C_per_mol).
C ALGBRC(22) is v_Kr in component Kr (fmol_per_sec).
C ALGBRC(28) is I_mem_Kr in component Kr (fA).
C ALGBRC(2) is I_stim in component environment (fA).
C CONSTS(5) is stimPeriod in component environment (second).
C CONSTS(6) is stimDuration in component environment (second).
C ALGBRC(1) is tPeriod in component environment (second).
C CONSTS(7) is kappa_Kr in component Kr_parameters (fmol_per_sec).
C CONSTS(8) is kappa_xr10 in component Kr_parameters (fmol_per_sec).
C CONSTS(9) is kappa_xr11 in component Kr_parameters (fmol_per_sec).
C CONSTS(10) is kappa_xr20 in component Kr_parameters (fmol_per_sec).
C CONSTS(11) is kappa_xr21 in component Kr_parameters (fmol_per_sec).
C CONSTS(12) is K_K_i in component Kr_parameters (per_fmol).
C CONSTS(13) is K_K_o in component Kr_parameters (per_fmol).
C CONSTS(14) is K_Sa_Kr in component Kr_parameters (per_fmol).
C CONSTS(15) is K_Sb_Kr in component Kr_parameters (per_fmol).
C CONSTS(16) is K_Sc_Kr in component Kr_parameters (per_fmol).
C CONSTS(17) is K_Sd_Kr in component Kr_parameters (per_fmol).
C CONSTS(18) is zK in component Kr_parameters (dimensionless).
C CONSTS(19) is z_xr1_f in component Kr_parameters (dimensionless).
C CONSTS(20) is z_xr1_r in component Kr_parameters (dimensionless).
C CONSTS(21) is z_xr2_f in component Kr_parameters (dimensionless).
C CONSTS(22) is z_xr2_r in component Kr_parameters (dimensionless).
C ALGBRC(3) is u_K_i in component Kr (J_per_mol).
C ALGBRC(4) is u_K_o in component Kr (J_per_mol).
C ALGBRC(5) is V_mem in component Kr (J_per_C).
C ALGBRC(6) is Am_Kr in component Kr (J_per_mol).
C ALGBRC(20) is Af_Kr in component Kr (J_per_mol).
C ALGBRC(21) is Ar_Kr in component Kr (J_per_mol).
C ALGBRC(18) is v_Sa in component Kr (fmol_per_sec).
C ALGBRC(29) is v_Sb in component Kr (fmol_per_sec).
C ALGBRC(27) is v_Sc in component Kr (fmol_per_sec).
C ALGBRC(30) is v_Sd in component Kr (fmol_per_sec).
C ALGBRC(13) is v_x10 in component Kr (fmol_per_sec).
C ALGBRC(25) is v_x11 in component Kr (fmol_per_sec).
C ALGBRC(17) is v_x20 in component Kr (fmol_per_sec).
C ALGBRC(26) is v_x21 in component Kr (fmol_per_sec).
C ALGBRC(7) is mu_Sa in component Kr (J_per_mol).
C ALGBRC(10) is mu_Sb in component Kr (J_per_mol).
C ALGBRC(14) is mu_Sc in component Kr (J_per_mol).
C ALGBRC(19) is mu_Sd in component Kr (J_per_mol).
C ALGBRC(8) is Af_x10 in component Kr (J_per_mol).
C ALGBRC(11) is Ar_x10 in component Kr (J_per_mol).
C ALGBRC(15) is Af_x11 in component Kr (J_per_mol).
C ALGBRC(23) is Ar_x11 in component Kr (J_per_mol).
C ALGBRC(9) is Af_x20 in component Kr (J_per_mol).
C ALGBRC(16) is Ar_x20 in component Kr (J_per_mol).
C ALGBRC(12) is Af_x21 in component Kr (J_per_mol).
C ALGBRC(24) is Ar_x21 in component Kr (J_per_mol).
C RATES(2) is d/dt q_K_i in component environment (fmol).
C RATES(1) is d/dt q_K_o in component environment (fmol).
C RATES(7) is d/dt q_mem in component environment (fC).
C RATES(3) is d/dt q_Sa in component environment (fmol).
C RATES(4) is d/dt q_Sb in component environment (fmol).
C RATES(5) is d/dt q_Sc in component environment (fmol).
C RATES(6) is d/dt q_Sd in component environment (fmol).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 60000
      STATES(1) = 20.0448
      STATES(2) = 388.832
      STATES(3) = 1.598306E-07
      STATES(4) = 1.598306E-07
      STATES(5) = 1.598306E-07
      STATES(6) = 1.598306E-07
      STATES(7) = -13039
      CONSTS(2) = 8.31
      CONSTS(3) = 310
      CONSTS(4) = 96500
      CONSTS(5) = 1
      CONSTS(6) = 0.0001
      CONSTS(7) = 175.029
      CONSTS(8) = 0.0794844
      CONSTS(9) = 0.00212813
      CONSTS(10) = 0.267259
      CONSTS(11) = 2.18134
      CONSTS(12) = 12.9706
      CONSTS(13) = 95.1175
      CONSTS(14) = 0.0465841
      CONSTS(15) = 0.00570751
      CONSTS(16) = 1.73989
      CONSTS(17) = 0.213172
      CONSTS(18) = 1
      CONSTS(19) = 1.6149028778859738
      CONSTS(20) = -1.3218634652232777
      CONSTS(21) = -1.0273976425216251
      CONSTS(22) = -0.18153135376657775
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(5) = STATES(7)/CONSTS(1)
      ALGBRC(7) =  CONSTS(2)*CONSTS(3)*log( CONSTS(14)*STATES(3))
      ALGBRC(8) = ALGBRC(7)+ CONSTS(19)*CONSTS(4)*ALGBRC(5)
      ALGBRC(10) =  CONSTS(2)*CONSTS(3)*log( CONSTS(15)*STATES(4))
      ALGBRC(11) = ALGBRC(10)+ CONSTS(20)*CONSTS(4)*ALGBRC(5)
      ALGBRC(13) =  CONSTS(8)*(EXP(ALGBRC(8)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(11)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(9) = ALGBRC(7)+ CONSTS(21)*CONSTS(4)*ALGBRC(5)
      ALGBRC(14) =  CONSTS(2)*CONSTS(3)*log( CONSTS(16)*STATES(5))
      ALGBRC(16) = ALGBRC(14)+ CONSTS(22)*CONSTS(4)*ALGBRC(5)
      ALGBRC(17) =  CONSTS(10)*(EXP(ALGBRC(9)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(16)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(18) = - ALGBRC(13) - ALGBRC(17)
      RATES(3) = ALGBRC(18)
      ALGBRC(6) =  CONSTS(18)*CONSTS(4)*ALGBRC(5)
      ALGBRC(3) =  CONSTS(2)*CONSTS(3)*log( CONSTS(12)*STATES(2))
      ALGBRC(19) =  CONSTS(2)*CONSTS(3)*log( CONSTS(17)*STATES(6))
      ALGBRC(20) = ALGBRC(19)+ALGBRC(3)+ALGBRC(6)
      ALGBRC(4) =  CONSTS(2)*CONSTS(3)*log( CONSTS(13)*STATES(1))
      ALGBRC(21) = ALGBRC(19)+ALGBRC(4)
      ALGBRC(22) = TERNRY(ALGBRC(6).EQ.0.00000,  1.00000*CONSTS(7)*(EXP(ALGBRC(20)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(21)/( CONSTS(2)*CONSTS(3)))),  ((( 1.00000*CONSTS(7)*ALGBRC(6))/( CONSTS(2)*CONSTS(3)))/(EXP(ALGBRC(6)/( CONSTS(2)*CONSTS(3))) - 1.00000))*(EXP(ALGBRC(20)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(21)/( CONSTS(2)*CONSTS(3)))))
      RATES(2) = - ALGBRC(22)
      RATES(1) = ALGBRC(22)
      ALGBRC(15) = ALGBRC(14)+ CONSTS(19)*CONSTS(4)*ALGBRC(5)
      ALGBRC(23) = ALGBRC(19)+ CONSTS(20)*CONSTS(4)*ALGBRC(5)
      ALGBRC(25) =  CONSTS(9)*(EXP(ALGBRC(15)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(23)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(27) = ALGBRC(17) - ALGBRC(25)
      RATES(5) = ALGBRC(27)
      ALGBRC(12) = ALGBRC(10)+ CONSTS(21)*CONSTS(4)*ALGBRC(5)
      ALGBRC(24) = ALGBRC(19)+ CONSTS(22)*CONSTS(4)*ALGBRC(5)
      ALGBRC(26) =  CONSTS(11)*(EXP(ALGBRC(12)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(24)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(28) =  CONSTS(4)*( - CONSTS(18)*ALGBRC(22)+ ALGBRC(13)*(CONSTS(20) - CONSTS(19))+ ALGBRC(25)*(CONSTS(20) - CONSTS(20))+ ALGBRC(17)*(CONSTS(22) - CONSTS(21))+ ALGBRC(26)*(CONSTS(22) - CONSTS(21)))
      ALGBRC(1) = VOI -  INT(VOI/CONSTS(5))*CONSTS(5)
      ALGBRC(2) = TERNRY(ALGBRC(1).GE.0.300000.AND.ALGBRC(1).LE.0.300000+CONSTS(6), ( 0.0750000*CONSTS(1))/CONSTS(6), 0.00000)
      RATES(7) = ALGBRC(28)+ALGBRC(2)
      ALGBRC(29) = ALGBRC(13) - ALGBRC(26)
      RATES(4) = ALGBRC(29)
      ALGBRC(30) = ALGBRC(25)+ALGBRC(26)
      RATES(6) = ALGBRC(30)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(5) = STATES(7)/CONSTS(1)
      ALGBRC(7) =  CONSTS(2)*CONSTS(3)*log( CONSTS(14)*STATES(3))
      ALGBRC(8) = ALGBRC(7)+ CONSTS(19)*CONSTS(4)*ALGBRC(5)
      ALGBRC(10) =  CONSTS(2)*CONSTS(3)*log( CONSTS(15)*STATES(4))
      ALGBRC(11) = ALGBRC(10)+ CONSTS(20)*CONSTS(4)*ALGBRC(5)
      ALGBRC(13) =  CONSTS(8)*(EXP(ALGBRC(8)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(11)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(9) = ALGBRC(7)+ CONSTS(21)*CONSTS(4)*ALGBRC(5)
      ALGBRC(14) =  CONSTS(2)*CONSTS(3)*log( CONSTS(16)*STATES(5))
      ALGBRC(16) = ALGBRC(14)+ CONSTS(22)*CONSTS(4)*ALGBRC(5)
      ALGBRC(17) =  CONSTS(10)*(EXP(ALGBRC(9)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(16)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(18) = - ALGBRC(13) - ALGBRC(17)
      ALGBRC(6) =  CONSTS(18)*CONSTS(4)*ALGBRC(5)
      ALGBRC(3) =  CONSTS(2)*CONSTS(3)*log( CONSTS(12)*STATES(2))
      ALGBRC(19) =  CONSTS(2)*CONSTS(3)*log( CONSTS(17)*STATES(6))
      ALGBRC(20) = ALGBRC(19)+ALGBRC(3)+ALGBRC(6)
      ALGBRC(4) =  CONSTS(2)*CONSTS(3)*log( CONSTS(13)*STATES(1))
      ALGBRC(21) = ALGBRC(19)+ALGBRC(4)
      ALGBRC(22) = TERNRY(ALGBRC(6).EQ.0.00000,  1.00000*CONSTS(7)*(EXP(ALGBRC(20)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(21)/( CONSTS(2)*CONSTS(3)))),  ((( 1.00000*CONSTS(7)*ALGBRC(6))/( CONSTS(2)*CONSTS(3)))/(EXP(ALGBRC(6)/( CONSTS(2)*CONSTS(3))) - 1.00000))*(EXP(ALGBRC(20)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(21)/( CONSTS(2)*CONSTS(3)))))
      ALGBRC(15) = ALGBRC(14)+ CONSTS(19)*CONSTS(4)*ALGBRC(5)
      ALGBRC(23) = ALGBRC(19)+ CONSTS(20)*CONSTS(4)*ALGBRC(5)
      ALGBRC(25) =  CONSTS(9)*(EXP(ALGBRC(15)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(23)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(27) = ALGBRC(17) - ALGBRC(25)
      ALGBRC(12) = ALGBRC(10)+ CONSTS(21)*CONSTS(4)*ALGBRC(5)
      ALGBRC(24) = ALGBRC(19)+ CONSTS(22)*CONSTS(4)*ALGBRC(5)
      ALGBRC(26) =  CONSTS(11)*(EXP(ALGBRC(12)/( CONSTS(2)*CONSTS(3))) - EXP(ALGBRC(24)/( CONSTS(2)*CONSTS(3))))
      ALGBRC(28) =  CONSTS(4)*( - CONSTS(18)*ALGBRC(22)+ ALGBRC(13)*(CONSTS(20) - CONSTS(19))+ ALGBRC(25)*(CONSTS(20) - CONSTS(20))+ ALGBRC(17)*(CONSTS(22) - CONSTS(21))+ ALGBRC(26)*(CONSTS(22) - CONSTS(21)))
      ALGBRC(1) = VOI -  INT(VOI/CONSTS(5))*CONSTS(5)
      ALGBRC(2) = TERNRY(ALGBRC(1).GE.0.300000.AND.ALGBRC(1).LE.0.300000+CONSTS(6), ( 0.0750000*CONSTS(1))/CONSTS(6), 0.00000)
      ALGBRC(29) = ALGBRC(13) - ALGBRC(26)
      ALGBRC(30) = ALGBRC(25)+ALGBRC(26)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END