FEMME, a flexible environment for mathematically modelling the environment. A new, fortran-based, simulation environment called FEMME (Flexible Environment for Mathematically Modelling the Environment), designed for implementing, solving and analysing mathematical models in ecology is presented. Three separate phases in ecological modelling are distinguished: (1) the model formulation i.e. the choice and implementation of the constitutive relations of the mathematical model, (2) the choice of a numerical solution scheme and (3) the model application i.e. a particular run or set of runs of the model. The basic characteristic of FEMME is to keep these three phases independent. The software is structured in a highly modular fashion, allowing unlimited combination of each. The modeller can restrict attention mostly to the model formulation, while the numerical solution and model application can be specified at run time without programming effort. The object-oriented design strongly reduces redundancy in the code: the same set of solution procedures is linked to all models, and one model implementation can be used without extra coding in a variety of applications. FEMME contains many functional units, such as a diversity of integration routines, steady-state solvers, fitting routines, input and output facilities and allows running Monte Carlo or sensitivity analyses or performing food web analyses. The ease of interfacing model applications with external data facilitates running different scenarios or fitting the model to observations.