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 5 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 VOI is t in component main (second).
C CONSTS(1) is RT in component main (J_per_mol).
C STATES(1) is q_1 in component main (mole).
C STATES(2) is q_2 in component main (mole).
C ALGBRC(5) is v_r in component main (mol_per_s).
C ALGBRC(1) is u_1 in component main (J_per_mol).
C ALGBRC(3) is u_2 in component main (J_per_mol).
C ALGBRC(2) is u_f in component main (J_per_mol).
C ALGBRC(4) is u_r in component main (J_per_mol).
C CONSTS(2) is K_q_1 in component main (per_mol).
C CONSTS(3) is K_q_2 in component main (per_mol).
C CONSTS(4) is kappa_r in component main (mol_per_s).
C RATES(1) is d/dt q_1 in component main (mole).
C RATES(2) is d/dt q_2 in component main (mole).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      CONSTS(1) = 2578.73058
      STATES(1) = 1
      STATES(2) = 0
      CONSTS(2) = 1
      CONSTS(3) = 1
      CONSTS(4) = 0.1
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(1)*log( CONSTS(2)*STATES(1))
      ALGBRC(2) = ALGBRC(1)
      ALGBRC(3) =  CONSTS(1)*log( CONSTS(3)*STATES(2))
      ALGBRC(4) = ALGBRC(3)
      ALGBRC(5) =  CONSTS(4)*(EXP(ALGBRC(2)/CONSTS(1)) - EXP(ALGBRC(4)/CONSTS(1)))
      RATES(1) = - ALGBRC(5)
      RATES(2) = ALGBRC(5)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(1)*log( CONSTS(2)*STATES(1))
      ALGBRC(2) = ALGBRC(1)
      ALGBRC(3) =  CONSTS(1)*log( CONSTS(3)*STATES(2))
      ALGBRC(4) = ALGBRC(3)
      ALGBRC(5) =  CONSTS(4)*(EXP(ALGBRC(2)/CONSTS(1)) - EXP(ALGBRC(4)/CONSTS(1)))
      RETURN
      END