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 5 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 (ng_ml).
C CONSTS(4) is a1 in component model_parameters (first_order_rate_constant).
C CONSTS(5) is a2 in component model_parameters (first_order_rate_constant).
C STATES(5) is C in component C (ng_ml).
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 (ng_ml).
C RATES(5) is d/dt C in component C (ng_ml).
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) = 0.0328
      CONSTS(5) = 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)*STATES(3))*STATES(4)
      RATES(5) =  (CONSTS(4)+ CONSTS(5)*STATES(3))*STATES(4)
      ALGBRC(1) = TERNRY(VOI*0.0166667.GE.0.00000.AND.VOI*0.0166667.LT.4.00000, 0.500000, TERNRY(VOI*0.0166667.GE.4.00000.AND.VOI*0.0166667.LT.24.0000, 0.00000, TERNRY(VOI*0.0166667.GE.24.0000.AND.VOI*0.0166667.LT.28.0000, 0.500000, TERNRY(VOI*0.0166667.GE.28.0000.AND.VOI*0.0166667.LT.148.000, 0.00000, TERNRY(VOI*0.0166667.GE.148.000.AND.VOI*0.0166667.LT.152.000, 0.500000, TERNRY(VOI*0.0166667.GE.152.000.AND.VOI*0.0166667.LT.157.000, 0.00000, TERNRY(VOI*0.0166667.GE.157.000.AND.VOI*0.0166667.LT.161.000, 0.500000, TERNRY(VOI*0.0166667.GE.161.000.AND.VOI*0.0166667.LT.281.000, 0.00000, TERNRY(VOI*0.0166667.GE.281.000.AND.VOI*0.0166667.LT.285.000, 0.500000, TERNRY(VOI*0.0166667.GE.285.000.AND.VOI*0.0166667.LT.295.000, 0.00000, TERNRY(VOI*0.0166667.GE.295.000.AND.VOI*0.0166667.LT.299.000, 0.500000, TERNRY(VOI*0.0166667.GE.299.000.AND.VOI*0.0166667.LT.419.000, 0.00000, TERNRY(VOI*0.0166667.GE.419.000.AND.VOI*0.0166667.LT.424.000, 0.500000, TERNRY(VOI*0.0166667.GE.424.000.AND.VOI*0.0166667.LT.464.000, 0.00000, TERNRY(VOI*0.0166667.GE.464.000.AND.VOI*0.0166667.LT.468.000, 0.500000, TERNRY(VOI*0.0166667.GE.468.000.AND.VOI*0.0166667.LT.588.000, 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*0.0166667.GE.0.00000.AND.VOI*0.0166667.LT.4.00000, 0.500000, TERNRY(VOI*0.0166667.GE.4.00000.AND.VOI*0.0166667.LT.24.0000, 0.00000, TERNRY(VOI*0.0166667.GE.24.0000.AND.VOI*0.0166667.LT.28.0000, 0.500000, TERNRY(VOI*0.0166667.GE.28.0000.AND.VOI*0.0166667.LT.148.000, 0.00000, TERNRY(VOI*0.0166667.GE.148.000.AND.VOI*0.0166667.LT.152.000, 0.500000, TERNRY(VOI*0.0166667.GE.152.000.AND.VOI*0.0166667.LT.157.000, 0.00000, TERNRY(VOI*0.0166667.GE.157.000.AND.VOI*0.0166667.LT.161.000, 0.500000, TERNRY(VOI*0.0166667.GE.161.000.AND.VOI*0.0166667.LT.281.000, 0.00000, TERNRY(VOI*0.0166667.GE.281.000.AND.VOI*0.0166667.LT.285.000, 0.500000, TERNRY(VOI*0.0166667.GE.285.000.AND.VOI*0.0166667.LT.295.000, 0.00000, TERNRY(VOI*0.0166667.GE.295.000.AND.VOI*0.0166667.LT.299.000, 0.500000, TERNRY(VOI*0.0166667.GE.299.000.AND.VOI*0.0166667.LT.419.000, 0.00000, TERNRY(VOI*0.0166667.GE.419.000.AND.VOI*0.0166667.LT.424.000, 0.500000, TERNRY(VOI*0.0166667.GE.424.000.AND.VOI*0.0166667.LT.464.000, 0.00000, TERNRY(VOI*0.0166667.GE.464.000.AND.VOI*0.0166667.LT.468.000, 0.500000, TERNRY(VOI*0.0166667.GE.468.000.AND.VOI*0.0166667.LT.588.000, 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