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 6 entries in the algebraic variable array.
C There are a total of 3 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 (second).
C STATES(1) is q_CO2_i in component environment (fmol).
C STATES(2) is q_HCO3_i in component environment (fmol).
C STATES(3) is q_H_i in component environment (fmol).
C ALGBRC(6) is v_Re_CO2hyd in component CO2_hyd (fmol_per_sec).
C ALGBRC(4) is pH_i in component environment (dimensionless).
C ALGBRC(2) is cH_i in component environment (mM).
C CONSTS(1) is w_i in component environment (pL).
C CONSTS(2) is kappa_Re_CO2hyd in component CO2_hyd_parameters (fmol_per_sec).
C CONSTS(3) is K_CO2_i in component CO2_hyd_parameters (per_fmol).
C CONSTS(4) is K_HCO3_i in component CO2_hyd_parameters (per_fmol).
C CONSTS(5) is K_H_i in component CO2_hyd_parameters (per_fmol).
C CONSTS(6) is R in component constants (J_per_K_per_mol).
C CONSTS(7) is T in component constants (kelvin).
C ALGBRC(1) is mu_CO2_i in component CO2_hyd (J_per_mol).
C ALGBRC(3) is mu_HCO3_i in component CO2_hyd (J_per_mol).
C ALGBRC(5) is mu_H_i in component CO2_hyd (J_per_mol).
C CONSTS(8) is F in component constants (C_per_mol).
C RATES(1) is d/dt q_CO2_i in component environment (fmol).
C RATES(2) is d/dt q_HCO3_i in component environment (fmol).
C RATES(3) is d/dt q_H_i in component environment (fmol).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 46.968
      STATES(2) = 509.2
      STATES(3) = 2.69019E-06
      CONSTS(1) = 38
      CONSTS(2) = 153.093
      CONSTS(3) = 82.5092
      CONSTS(4) = 0.00128495
      CONSTS(5) = 0.00128495
      CONSTS(6) = 8.31
      CONSTS(7) = 310
      CONSTS(8) = 96485
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(6)*CONSTS(7)*log( CONSTS(3)*STATES(1))
      ALGBRC(3) =  CONSTS(6)*CONSTS(7)*log( CONSTS(4)*STATES(2))
      ALGBRC(5) =  CONSTS(6)*CONSTS(7)*log( CONSTS(5)*STATES(3))
      ALGBRC(6) =  CONSTS(2)*(EXP(ALGBRC(1)/( CONSTS(6)*CONSTS(7))) - EXP((ALGBRC(3)+ALGBRC(5))/( CONSTS(6)*CONSTS(7))))
      RATES(1) = - ALGBRC(6)
      RATES(2) = ALGBRC(6)
      RATES(3) = ALGBRC(6)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) =  CONSTS(6)*CONSTS(7)*log( CONSTS(3)*STATES(1))
      ALGBRC(3) =  CONSTS(6)*CONSTS(7)*log( CONSTS(4)*STATES(2))
      ALGBRC(5) =  CONSTS(6)*CONSTS(7)*log( CONSTS(5)*STATES(3))
      ALGBRC(6) =  CONSTS(2)*(EXP(ALGBRC(1)/( CONSTS(6)*CONSTS(7))) - EXP((ALGBRC(3)+ALGBRC(5))/( CONSTS(6)*CONSTS(7))))
      ALGBRC(2) = STATES(3)/CONSTS(1)
      ALGBRC(4) = - arbitrary_log(ALGBRC(2), 10)
      RETURN
      END
Source
Derived from workspace BG_CO2_hydration at changeset 13ec7e6d78f3.
Collaboration
To begin collaborating on this work, please use your git client and issue this command:
License
The terms of use/license for this work is unspecified.