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 20 entries in the constant variable array.
C
C
C VOI is time in component environment (minute).
C STATES(1) is G in component G (mg_l).
C CONSTS(1) is Vg in component G (litre).
C CONSTS(2) is Gin in component G (mg_l_min).
C ALGBRC(1) is f2_G in component G (mg_min).
C ALGBRC(3) is f3_G in component G (per_l).
C ALGBRC(4) is f4_I in component G (mg_min).
C ALGBRC(5) is f5_I in component G (mg_min).
C CONSTS(3) is C2 in component G (mg_l).
C CONSTS(4) is C3 in component G (mg_l).
C CONSTS(5) is C4 in component G (mU_l).
C CONSTS(6) is C5 in component G (mU_l).
C CONSTS(7) is U0 in component G (mg_min).
C CONSTS(8) is Um in component G (mg_min).
C CONSTS(9) is Ub in component G (mg_min).
C CONSTS(10) is beta in component G (dimensionless).
C CONSTS(11) is Rg in component G (mg_min).
C CONSTS(12) is alpha in component G (l_mU).
C CONSTS(13) is ti in component G (minute).
C CONSTS(14) is E in component G (l_min).
C CONSTS(15) is Vp in component G (litre).
C CONSTS(16) is Vi in component G (litre).
C STATES(2) is I in component I (mU_l).
C ALGBRC(2) is f1_G in component I (mU_min).
C CONSTS(17) is Rm in component I (mU_min).
C CONSTS(18) is C1 in component I (mg_l).
C CONSTS(19) is a1 in component I (mg_l).
C CONSTS(20) is di in component I (first_order_rate_constant).
C RATES(1) is d/dt G in component G (mg_l).
C RATES(2) is d/dt I in component I (mU_l).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 1000.0
      CONSTS(1) = 10.0
      CONSTS(2) = 0.54
      CONSTS(3) = 144.0
      CONSTS(4) = 1000.0
      CONSTS(5) = 80.0
      CONSTS(6) = 26.0
      CONSTS(7) = 40.0
      CONSTS(8) = 940.0
      CONSTS(9) = 72.0
      CONSTS(10) = 1.77
      CONSTS(11) = 180.0
      CONSTS(12) = 0.29
      CONSTS(13) = 100
      CONSTS(14) = 0.2
      CONSTS(15) = 3.0
      CONSTS(16) = 11.0
      STATES(2) = 9000.0
      CONSTS(17) = 210.0
      CONSTS(18) = 2000.0
      CONSTS(19) = 300.0
      CONSTS(20) = 0.06
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = CONSTS(17)/(1.00000+EXP(((CONSTS(18) - STATES(1))/( 1.00000*CONSTS(1)))/CONSTS(19)))
      RATES(2) =  1.00000*ALGBRC(2) -  CONSTS(20)*STATES(2)
      ALGBRC(1) =  CONSTS(9)*(1.00000 - EXP( 1.00000*(- STATES(1)/( CONSTS(3)*CONSTS(1)))))
      ALGBRC(3) = STATES(1)/( CONSTS(4)*CONSTS(1))
      ALGBRC(4) = CONSTS(7)+(CONSTS(8) - CONSTS(7))/(1.00000+EXP( - CONSTS(10)*log( 1.00000*(STATES(2)/( CONSTS(5)*(1.00000/CONSTS(16)+1.00000/( CONSTS(14)*CONSTS(13))))))))
      ALGBRC(5) = CONSTS(11)/(1.00000+EXP( CONSTS(12)*(STATES(2)/( 1.00000*CONSTS(15) -  1.00000*CONSTS(6)))))
      RATES(1) = CONSTS(2)+ 1.00000*ALGBRC(5)+- ( 1.00000*ALGBRC(1)+ ALGBRC(3)*ALGBRC(4))
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(2) = CONSTS(17)/(1.00000+EXP(((CONSTS(18) - STATES(1))/( 1.00000*CONSTS(1)))/CONSTS(19)))
      ALGBRC(1) =  CONSTS(9)*(1.00000 - EXP( 1.00000*(- STATES(1)/( CONSTS(3)*CONSTS(1)))))
      ALGBRC(3) = STATES(1)/( CONSTS(4)*CONSTS(1))
      ALGBRC(4) = CONSTS(7)+(CONSTS(8) - CONSTS(7))/(1.00000+EXP( - CONSTS(10)*log( 1.00000*(STATES(2)/( CONSTS(5)*(1.00000/CONSTS(16)+1.00000/( CONSTS(14)*CONSTS(13))))))))
      ALGBRC(5) = CONSTS(11)/(1.00000+EXP( CONSTS(12)*(STATES(2)/( 1.00000*CONSTS(15) -  1.00000*CONSTS(6)))))
      RETURN
      END