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 1 entries in the algebraic variable array.
C There are a total of 5 entries in each of the rate and state variable arrays.
C There are a total of 6 entries in the constant variable array.
C
C
C VOI is time in component environment (hour).
C ALGBRC(1) is GnRH in component GnRH (nanomolar).
C STATES(1) is F in component F (dimensionless).
C CONSTS(1) is kfb in component model_parameters (second_order_rate_constant).
C CONSTS(2) is kdf in component model_parameters (first_order_rate_constant).
C STATES(2) is D in component D (dimensionless).
C CONSTS(3) is kbd in component model_parameters (first_order_rate_constant).
C STATES(3) is B in component B (dimensionless).
C STATES(4) is R in component R (dimensionless).
C CONSTS(4) is s in component model_parameters (first_order_rate_constant).
C CONSTS(5) is a1 in component model_parameters (first_order_rate_constant).
C CONSTS(6) is a2 in component model_parameters (first_order_rate_constant).
C STATES(5) is C in component C (dimensionless).
C RATES(1) is d/dt F in component F (dimensionless).
C RATES(2) is d/dt D in component D (dimensionless).
C RATES(3) is d/dt B in component B (dimensionless).
C RATES(4) is d/dt R in component R (dimensionless).
C RATES(5) is d/dt C in component C (dimensionless).
C
      SUBROUTINE initConsts(CONSTS, RATES, STATES)
      REAL CONSTS(*), RATES(*), STATES(*)
      STATES(1) = 1.0
      CONSTS(1) = 19.35
      CONSTS(2) = 2.52
      STATES(2) = 0.0
      CONSTS(3) = 9.91
      STATES(3) = 0.0
      STATES(4) = 2115.0
      CONSTS(4) = 6.80
      CONSTS(5) = 0.0328
      CONSTS(6) = 0.0830
      STATES(5) = 0.0
      RETURN
      END
      SUBROUTINE computeRates(VOI, CONSTS,  RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      RATES(2) =  CONSTS(3)*STATES(3) -  CONSTS(2)*STATES(2)
      RATES(4) = CONSTS(4) -  (CONSTS(5)+ CONSTS(6)*STATES(3))*STATES(4)
      RATES(5) =  (CONSTS(5)+ CONSTS(6)*STATES(3))*STATES(4)
      ALGBRC(1) = TERNRY(VOI.GE.0.00000.AND.VOI.LT.0.0666667, 0.500000, TERNRY(VOI.GE.0.0666667.AND.VOI.LT.0.400000, 0.00000, TERNRY(VOI.GE.0.400000.AND.VOI.LT.0.466667, 0.500000, TERNRY(VOI.GE.0.466667.AND.VOI.LT.2.46667, 0.00000, TERNRY(VOI.GE.2.46667.AND.VOI.LT.2.53333, 0.500000, TERNRY(VOI.GE.2.53333.AND.VOI.LT.2.61667, 0.00000, TERNRY(VOI.GE.2.61667.AND.VOI.LT.2.68333, 0.500000, TERNRY(VOI.GE.2.68333.AND.VOI.LT.4.68333, 0.00000, TERNRY(VOI.GE.4.68333.AND.VOI.LT.4.75000, 0.500000, TERNRY(VOI.GE.4.75000.AND.VOI.LT.4.91667, 0.00000, TERNRY(VOI.GE.4.91667.AND.VOI.LT.4.98333, 0.500000, TERNRY(VOI.GE.4.98333.AND.VOI.LT.6.98333, 0.00000, TERNRY(VOI.GE.6.98333.AND.VOI.LT.7.06667, 0.500000, TERNRY(VOI.GE.7.06667.AND.VOI.LT.7.73333, 0.00000, TERNRY(VOI.GE.7.73333.AND.VOI.LT.7.80000, 0.500000, TERNRY(VOI.GE.7.80000.AND.VOI.LT.9.80000, 0.00000, 0.0/0.0)
      RATES(1) =  CONSTS(2)*STATES(2) -  CONSTS(1)*STATES(1)*ALGBRC(1)
      RATES(3) =  CONSTS(1)*STATES(1)*ALGBRC(1) -  CONSTS(3)*STATES(3)
      RETURN
      END
      SUBROUTINE computeVariables(VOI, CONSTS, RATES, STATES, ALGBRC)
      REAL VOI, CONSTS(*), RATES(*), STATES(*), ALGBRC(*)
      ALGBRC(1) = TERNRY(VOI.GE.0.00000.AND.VOI.LT.0.0666667, 0.500000, TERNRY(VOI.GE.0.0666667.AND.VOI.LT.0.400000, 0.00000, TERNRY(VOI.GE.0.400000.AND.VOI.LT.0.466667, 0.500000, TERNRY(VOI.GE.0.466667.AND.VOI.LT.2.46667, 0.00000, TERNRY(VOI.GE.2.46667.AND.VOI.LT.2.53333, 0.500000, TERNRY(VOI.GE.2.53333.AND.VOI.LT.2.61667, 0.00000, TERNRY(VOI.GE.2.61667.AND.VOI.LT.2.68333, 0.500000, TERNRY(VOI.GE.2.68333.AND.VOI.LT.4.68333, 0.00000, TERNRY(VOI.GE.4.68333.AND.VOI.LT.4.75000, 0.500000, TERNRY(VOI.GE.4.75000.AND.VOI.LT.4.91667, 0.00000, TERNRY(VOI.GE.4.91667.AND.VOI.LT.4.98333, 0.500000, TERNRY(VOI.GE.4.98333.AND.VOI.LT.6.98333, 0.00000, TERNRY(VOI.GE.6.98333.AND.VOI.LT.7.06667, 0.500000, TERNRY(VOI.GE.7.06667.AND.VOI.LT.7.73333, 0.00000, TERNRY(VOI.GE.7.73333.AND.VOI.LT.7.80000, 0.500000, TERNRY(VOI.GE.7.80000.AND.VOI.LT.9.80000, 0.00000, 0.0/0.0)
      RETURN
      END
      REAL FUNCTION TERNRY(TEST, VALA, VALB)
      LOGICAL TEST
      REAL VALA, VALB
      IF (TEST) THEN
        TERNRY = VALA
      ELSE
        TERNRY = VALB
      ENDIF
      RETURN
      END