Ewe-f 1.0: an Implementation of Ecopath with Ecosim in Fortran 95/2003 for Coupling Printer-friendly Version Interactive Discussion Ewe-f 1.0: an Implementation of Ecopath with Ecosim in Fortran 95/2003 for Coupling Gmdd Ewe-f 1.0: an Implementation of Ecopath with Ecosim in Fortran 95/2003 for Coup

Societal and scientific challenges foster the implementation of the ecosystem approach to marine ecosystem analysis and management, which is a comprehensive means of integrating the direct and indirect effects of multiple stressors on the different components of ecosystems, from physical to chemical and biological and from viruses to 5 fishes and marine mammals. Ecopath with Ecosim (EwE) is a widely used software package, which offers great capability for a dynamic description of the multiple interactions occurring within a food web, and potentially, a crucial component of an integrated platform supporting the ecosystem approach. However, being written for the Microsoft .NET framework, seamless integration of this code with Fortran-based phys-10 ical oceanographic and/or biogeochemical models is technically not straightforward. In this work we release a re-coding of EwE in Fortran (EwE-F). We believe that the availability of a Fortran version of EwE is an important step towards setting-up integrated end-to-end (E2E) modelling schemes utilising this widely adopted software because it (i) increases portability of the EwE models, (ii) provides greater flexibility towards inte-15 grating EwE with Fortran-based modelling schemes. Furthermore, EwE-F might help modellers using Fortran programming language to get close to the EwE approach. In the present work, first the fundamentals of EwE-F are introduced, followed by validation of EwE-F against standard EwE utilising sample models. Afterwards, an E2E ecological representation of the Trieste Gulf (Northern Adriatic Sea) ecosystem is presented 20 as an example of online two-way coupling between an EwE-F food web model and a biogeochemical model. Finally, the possibilities that having EwE-F opens up for are discussed.


Introduction
Oceanographic models, particularly computationally intensive hydrodynamic and biogeochemical models, have mostly been written in Fortran (e.g.hydrodynamic models: NEMO (Madec, 2008), ROMS (Shchepetkin and McWilliams, 2005), POM (Blumberg and Mellor, 1980), MITGCM (Adcroft et al., 2004), MOM (Stock et al., 2014); and biogeochemical models: ERSEM (Blackford et al., 2004), BFM (Vichi et al., 2015), ERGOM (Neumann, 2000)).In fact, Fortran was the first programming language specifically designed for solving engineering and scientific computing problems (Backus et al., 1957) and proved to be one of the most efficient for performing complicated mathematical tasks with its collection of predefined high-level mathematical functions.Over the years, frequent revision of the Fortran standard and the addition of new capabilities to the language to meet changing demands enabled it to remain the de facto standard for writing computationally intensive scientific and engineering applications.
Ecopath with Ecosim (hereinafter EwE) (Christensen and Walters, 2004;Christensen et al., 2005) is the most widely adopted tool for building models of marine and freshwater ecosystems, and possibly the first choice for analysis of food web dynamics.Freely available at www.ecopath.org,EwE has long been used for scientific studies related to fisheries, some aspects of aquaculture, marine ecology, climate and pollution.There are thousands of users of the software worldwide (last record in 2008, 5649 reported users; www.ecopath.org)and more than 400 scientific publications utilising EwE as a modelling tool have been issued only in the last 2 decades (a search on Web of Science on 29 September 2014 E. Akoglu et al.: EwE-F 1.0 for "Ecopath with Ecosim", "Ecospace" or "Ecopath" returned 469 items published between 1997 and 2014).Because many EwE models for a variety of aquatic ecosystems are available, it makes sense to capitalise on such experience when developing coupled/integrated modelling applications.This would require only minimal modifications in these models and remove the burden of starting from scratch.However, being written for the Microsoft .NET framework constrains EwE's ability to integrate with models written in Fortran, and the Fortran recoding of EwE presented in this paper will facilitate this.
EwE is designed for interoperability with other models, which is crucial considering that ecological modelling is facing an important challenge to set a basis for the comprehensive description of marine ecosystems through integrated modelling schemes that incorporate multiple models (e.g.hydrodynamic, biogeochemical, ecological and socioeconomic) interactively with one another (e.g.end-to-end (hereinafter E2E) models; Fulton, 2010).This interoperability leads to insightful linking of these models into EwE (e.g.Christensen et al., 2014), and EwE's flexibility already permits one to link physical/biogeochemical oceanographic models with EwE (e.g.Libralato and Solidoro, 2009).This one-way linking permits exchanges of information between models that are run separately and is valid, robust and usually faster to implement than a two-way coupling.In spite of the interesting results obtained, however, one-way linking lacks a complete representation of feedbacks that propagate two ways between the coupled models.These feedbacks were proven to be important and reveal important ecological mechanisms (Kearney et al., 2012) that need to be accounted explicitly for a full representation of ecosystem effects due to climatic changes, aquaculture, socioeconomic changes and other important drivers (Fulton, 2010).The scientific requirements for such modelling approaches, therefore, mandate two-way coupling with existing oceanographic models which are mostly written in Fortran.Because these models and EwE use different programming languages, the technical differences complicate the coupling task more than anticipated (e.g.Beecham et al., 2010).One possible solution is the offline coupling of EwE and Fortran-coded models via two-way data transfer between the models at predefined time intervals while pausing the other model (i.e. a turn-based run).Another solution could be to utilise inter-process communications such as pipes and/or sockets between EwE and the model to be coupled while simultaneously running the models.However, coupled model construction will benefit from a Fortran version of EwE that will permit direct integration of the EwE modelling approach with mainly, but not limited to, physical and biogeochemical models in Fortran, and will allow a straightforward and two-way propagating feedback between high trophic level (HTL) and low trophic level (LTL) models.Hence, the development of a Fortran version of EwE will be useful for integration of HTL food web models with potentially any other model written in Fortran which simulates, for example, socioeconomic, bioenergetic dynamics.
In this work, we present (Sect.3) the first version of EwE re-coded in the Fortran 95/2003 language standard (EwE-F, version 1.0).In Sect.3.3, we provide evidence of the full reliability of the code by comparing EwE-F with standard EwE (version 6.5) utilising sample food web models.In Sect.4, we present how EwE-F allows for easy coupling with other models, by providing an example of integration with a biogeochemical model of the Gulf of Trieste in the northern Adriatic Sea.Finally, in the same section, we discuss the possibilities opened up by the availability of EwE-F.We believe that EwE-F will appeal also to the scientific community previously sceptical of the EwE approach (usually more confident with Fortran programming) and provide the possibility of both easy modification of the EwE-F structure and parameterisation for specific cases and easy integration with other biogeochemical, population dynamics, individualbased and/or any type of ecological model written in Fortran.

A brief description of the EwE model
EwE modelling software includes a suite of modules that enables the building and analysis of food web models.EwE includes three main modules: (i) Ecopath, the mass-balance representation; (ii) Ecosim, the time-dynamic simulation; and (iii) Ecospace, the 2-D spatial-temporal dynamics, plus other complementary routines: network analysis (Ulanowicz, 1986), Monte Carlo simulation and time series fitting.EwE-F comprises only Ecopath and Ecosim modules; thus, only these two are briefly summarised here.
The Ecopath module comprises a series of linear equations that defines a mass-balance stationary state of the food web.The functional groups are regulated by gains (consumption, production, and immigration) and losses (mortality and emigration), and are linked to each other by predatory relationships.Fisheries extract biomass from the targeted and bycatch groups.In Ecopath, a set of linear equations describes flows of mass into and out of discrete biomass pools of the form where, for each functional group i, B stands for biomass, (P /B) stands for the production rate per unit of biomass, (Q/B) stands for the consumption rate per unit of biomass of predator j , DC j i is the fraction of prey i in the average diet of predator j , Y is the fishery catches, E is the net emigration rate, and BA is the biomass accumulation rate (Christensen et al., 2005).EE is the ecotrophic efficiency representing the proportion of mortality of a group that is not attributable to predators or fishing activities.As can be seen, Eq. ( 1) is quite simple as a result of the fact that it represents the budget of biomass fluxes in a given time window within an ecosystem.
Ecopath is also characterised by a top-down solution of the system of equations; i.e. consumption on a group is a function of predator biomass, which differs from bottom-up approaches used in other inverse modelling methods (Steele, 2009).
In the time-dynamic module of EwE (Ecosim), dynamics of a state variable are defined with a differential equation composed of sources and sink terms.Each state variable represents the biomass of a functional group representing species and/or groups of species or populations split into age-size categories (multi-stanza).The definition of such a differential equation in Ecosim is as follows: where dB i /dt is the rate of change of biomass (B) of group i over time t, γ is the growth efficiency of group i, Q j i is the sum of the consumptions of group i over all of its preys, Q ij is the sum of the predation on group i by all of its predators, I is the immigration, M is the non-predation mortality, F is the fishery mortality and e is the emigration rate of group i (Walters et al., 1997).Q ij is defined on the basis of biomasses of predator and prey in a form that represents a slightly modified version of the Holling type II functional response in order to consider only the part of the biomass of the prey i that is accessible to the predator j (foraging arena theory; Ahrens et al., 2012).For each trophic interaction, the accessible biomass is dynamically defined on the basis of a parameter called "vulnerability" (for details, refer to Walters et al., 1997Walters et al., , 2000;;Ahrens et al., 2012).This system of differential equations is numerically integrated over time under the influence of forcing functions (typically fishing mortalities or efforts, changes in primary productivity) starting from the initial condition settings defined by the Ecopath module.

The EwE-F software
The EwE software was translated to Fortran 95/2003 language in its core architecture and kept limited to (i) the Ecopath mass-balance routine including multi-stanza calculations and (ii) the Ecosim time-dynamic simulation including multi-stanza calculations.Due to modularity considerations, EwE-F was implemented under two separate components: (i) Ecopath-F, the Ecopath mass-balance algorithm, and (ii) Ecosim-F, the Ecosim time-dynamic simulation algorithm.EwE-F v1.0 includes only core routines of Ecopath and Ecosim: complementary routines for calculation of indicators for network analysis, and routines for Monte Carlo simulation, time series fitting and Ecospace are not included.Also, the capability to define mediation functions is not yet implemented in EwE-F v1.0, although we plan to address it in future versions.A schematic view of the EwE-F components and the input/output (I/O) files necessary for information exchange are given in Fig. 1.In the following two sections (3.1 and 3.2), the structure and functioning of the components in Fig. 1 are described in detail.

Ecopath-F
Ecopath-F is the component of EwE-F that carries out massbalance calculations given in Eq. ( 1).Similar to stock Ecopath, it requires the same fundamental input parameters to be entered via four tab-delimited ASCII (American Standard Code for Information Interchange) encoded text input files: (i) a scenario file containing the basic input and multi-stanza parameters and catches, (ii) a file comprising the diet composition matrix of the state variables, (iii) a file comprising the detritus fate of the state variables and, (iv) if applicable, a file including the growth parameters of the multistanza groups.Furthermore, Ecopath-F requires a Fortran "namelist" file that includes the full paths and names of the above-mentioned four input files and, in addition, the path and name of the output HDF5 (Hierarchical Data Format version 5, www.hdfgroup.org/HDF5)file which the massbalance calculation results will be output to and which will be used to initialise and run Ecosim-F (Fig. 1).
An Ecopath-F run produces two output files: (i) an ASCII file which includes the summary of estimated parameters and basic statistical information, and (ii) an HDF5 file specifically formatted to define the initial conditions for the Ecosim-F simulation (Fig. 1).The output HDF5 file includes all the parametric details about the state variables of the Ecopath run and furthermore comprises the diet composition matrix, detritus fate matrix and multi-stanza group parameters.
Ecopath-F is independent of the Ecosim-F implementation; however, Ecosim-F requires output data from Ecopath-F plus additional parameter settings.The data transfer from Ecopath-F to Ecosim-F is carried out via the intermediary HDF5 data file.

Ecosim-F
Ecosim-F is the component of EwE-F that carries out timedynamic simulation calculations given in Eq. ( 2).Ecosim-F requires the HDF5 output file from the Ecopath-F run and, depending on the compile time options, at least three additional tab-delimited ASCII encoded text input files: (i) a scenario file containing group information of state variables, (ii) a file comprising the vulnerability matrix between predator-prey pairs, and (iii) a file comprising the monthly fishing mortality/effort time series forcing functions for all state variables (Fig. 1).Similar to Ecopath-F, Ecosim-F also requires a namelist file that includes the full paths and names of the input files as well as the values of some particular variables; i.e. number of time steps per month, base proportion of free nutrients, relaxation parameter and simulation time The EwE-F data input/output scheme.Curved white rectangular boxes denote tab-delimited ASCII files providing external data input to the EwE-F models (rectangles).Curved grey-shaded rectangles and the cylindrical box denote the model output via tab-delimited ASCII and HDF5 files respectively.For details see Sect.3.1 and 3.2. in years, to prepare the Ecosim simulation (for details, see Christensen et al., 2005, p. 78;Akoglu et al., 2015).
Once completed, Ecosim-F simulation produces five tabdelimited ASCII coded text files comprising the annual and monthly absolute and relative biomass values of the state variables and a file comprising monthly catches of the fished state variables throughout the simulation in the model directory (Fig. 1).

The skill assessment of EwE-F
In order to assess the skill of EwE-F with respect to EwE, two test case simulations, Generic 37 and Tampa Bay, which are distributed with the installation of the EwE software, were used.The test case simulations were run both with EwE version 6.5 and EwE-F version 1.0 and the residuals between simulated absolute biomasses of state variables were used to evaluate the performance of EwE-F.It is worth noting that other EwE versions may produce slightly different results compared to EwE-F v1.0.The residuals for each state variable in the respective simulations were visualised with boxwhisker plots showing the minimum value, 25th percentile, median, 75th percentile and maximum values respectively (Figs. 2 and 3).
The residuals between the simulated biomass values of EwE-F and EwE ranged from 10 −8 to 10 −5 , with the maximum difference found to be of the order of 10 −5 .The residuals calculated from the comparison of the simulations confirmed that EwE-F possessed the necessary skill to reproduce the results of EwE for the Generic 37 and Tampa Bay simulations.The magnitude of the misfits concluded that EwE-F was capable of being used in conjunction with other models without introducing significant sources of error to the resulting modelling scheme.

Exploring EwE-F flexibilities: example from a complex coupling exercise
The Fortran recoding of EwE creates great flexibility for customisation, modification or coupling to different models written in Fortran.An example, which illustrated the potential of such flexibility, came from the integration of EwE-F with a biogeochemical Fortran model.In fact, the direct integration of these two models required one to address and subsequently solve a number of problems.These included defining the links between the two models and modifying them accordingly, exchanging information between the two models, dealing with different model time steps, and accounting for different model currencies.
The HTL model is an updated version of the EwE model of the northern Adriatic Sea originally developed by Coll et al. (2007).The original model which is composed of 40 functional groups (FGs) has been updated by (i) removing discards and by-catch FGs; (ii) splitting phytoplankton and zooplankton into two FGs each to represent small and large taxa; (iii) adding bacteria to explicitly represent the microbial loop; and (iv) adjusting the diet of plankton feeders to split the diet into the new plankton FGs.The updated model has 44 FGs and parameters for the plankton groups were updated considering literature information (see Cossarini and Solidoro, 2008, and references therein).The model currency  The biogeochemical model is a Fasham-like (Fasham et al., 1990) 0-D box model of the northern Adriatic Sea (Cossarini and Solidoro, 2008) and consists of phytoplankton, zooplankton, and heterotrophic bacteria groups, one pool of inorganic phosphorus (PO 3− 4 ), one dissolved organic matter compartment in terms of phosphorus (DOP) and carbon (DOC), and one particulate organic matter compartment in terms of phosphorus (POP) and carbon (POC) (Fig. 4).The model is a multi-currency model calculating the biomasses of its particular state variables (sediment, dissolved organic matter, particulate organic matter) both in terms of carbon and phosphorus.The time step of the model is 1 h.A full description of the biogeochemical model is given in Cossarini and Solidoro (2008).
For the harmonisation of both models in an E2E coupled scheme, first, the state variables that were already present in the LTL model were removed from the HTL model as well as their links (grey-shaded area and links in Fig. 4).Then the linkages between the state variables of the HTL model and the state variables of the LTL model were set up in accordance with the removed state variables as shown in Fig. 4 (links in dashed and continuous black lines).In this way, a coupled model scheme that consisted of 44 functional groups was set up: 9 FGs represented the state variables of the biogeochemical model, i.e. plankton groups plus inorganic and organic nutrient forms (Fig. 4).For simplicity, the HTL and LTL groups are not given in detail in the figure; however, sources and sinks of the whole HTL compartment and the linkages between the HTL and LTL domains and state variables are shown.The second step in the harmonisation of models consisted of accounting for the different currencies used.Considering the multiple currency utilisation of the biogeochemical model for some of its state variables and the fact that the application of a similar principle in the HTL model would require the modification of the various calculations in the state equation of the original EwE software, the state variables of the HTL model, which were in wet weight (tons), were converted to phosphorus (µmol P) weight utilising C : N : P ratios taken from the literature.
The third step in the harmonisation procedure was to reconcile the differences in the integration time step between the two models.Considering that the biogeochemical model consisted of state variables with faster dynamics compared to the HTL model, it was convenient to make the HTL model comply with the integration step of the biogeochemical model.For this purpose, the rates of the HTL model, which were "per year (yr −1 )", were converted to "per hour (h −1 )" by simply dividing the rates by 8760 (365 d −1 × 24 h −1 ) so that the HTL variables could be integrated with the same time step of the biogeochemical model.The final step in the harmonisation process would be to adjust the closure terms of the biogeochemical model (mortality rates of zooplankton and phytoplankton groups) so as to compensate for the additional losses through explicit predation of these groups by the HTL state variables.However, for our specific application, we decided to keep these values identical to the standalone biogeochemical model, as the coupled model produced similar seasonal cycles observed in the standalone biogeochemical model except the missing second cycle in mesozooplankton (Fig. 6) and as our aim was indeed to have plankton dynamics qualitatively comparable to the biogeochemical model.
The technical overview of the coupling scheme is given in Fig. 5.As shown in the figure, the coupled simulation was carried out in four consecutive stages.In the first stage, a static mass-balance model of the whole system, which comprised all the HTL and LTL state variables in the ecosystem, was set up utilising Ecopath-F.In this stage, the LTL state variables were ordered in advance of the HTL state variables so that the LTL state variables were numbered from 1 to 9 and the HTL state variables from 10 to 35 in the resulting scheme.Following this procedure, Ecopath-F was run to calculate the basic parameters and exchange rates between the state variables of the HTL and LTL compartments  which were necessary to perform a dynamic simulation after completing all of the harmonisation steps.In the second stage, utilising the calculations from the previous stage, the HTL and LTL models were initialised by calculating initial conditions for each of their respective state variables utilising their specific internal routines.In the stage, the sources and sinks of HTL and LTL state variables were computed by utilising their respective derivative functions during the whole simulation period.The selection of the derivative function to be used to calculate the differentials of the state variables depended on the rank of the state variables determined during the Ecopath-F set-up in the first stage.This stage continued iteratively until the end of the simulation and, at the end of each time step, the fourth stage was executed so that the results calculated at each time step were, if required, post-processed and then written to the results files.
Post-processing of LTL results might not be necessary in all cases, but only if the LTL model is a multi-currency model and calculates its variables in more than one currency.In our example, because the LTL model represented some of its state variables both in carbon and phosphorus but the coupled HTL model only in phosphorus, a post-processing step was necessary to compute the corresponding phosphorus values of variables that were in carbon units while interchanging information between the HTL and LTL derivative functions as well as before writing the results into the output files.The coupled simulation was run for 10 years, two of which were for spin-off.In the simulations, we used default values for vulnerabilities (v ij = 2) that represent a mixed control (Christensen et al., 2005).
Comparison of uncoupled and coupled model results (Fig. 6) demonstrated that the coupling scheme worked successfully and highlighted the effects of integration of the LTL and HTL models.Because the aim of this exercise was only to demonstrate the capability of EwE-F to be used in integration with other models, the ecological interpretations of these results are not the focus of this work, and thus are only briefly discussed here.Comparing the seasonal dynamics of LTL state variables before and after coupling showed that explicit addition of HTL dynamics influenced the seasonality of the LTL state variables (grey-shaded plots in Fig. 6).It is worth noting that the presence of several detrital and predatory links between the HTL and LTL models (as shown in Fig. 4) resulted in clear top-down impacts on the LTL variables, particularly on non-living and bacteria.Furthermore, the comparison between the simulation results of the HTL model forced with primary productivity changes (green lines in Fig. 6) in stock EwE and the fully coupled HTL/LTL models (black lines) showed that changes in the biogeochemical dynamics, namely nutrient recycling, not only impacted the LTL groups, but also propagated up through the food web (bottom-up) to impact the biomasses of HTL organisms.While most of the bottom-associated state variables decreased by the incorporation of the biogeochemical model into the coupled scheme, pelagic-associated state variables increased due to the explicit representation of resuspension of detritus and remineralisation that favoured plankton.Thus, as shown in Fig. 6, the consequences of two-way coupling were not only one-directional.These proved that the proper exchange of information and the establishment of successful interaction between the two models were realised in the final coupled scheme.

Potential and flexibility of the application
In this work, the reliability of EwE-F was proven by utilising two sample models as test cases and comparing the absolute biomass values simulated by EwE-F against the simulated absolute biomass values by stock EwE version 6.5.Furthermore, the applicability of EwE-F in an E2E modelling frame-work was exemplified with a test case for the Gulf of Trieste ecosystem.This example proved the adaptability of EwE-F for coupled modelling frameworks, facilitating its integration with other hydrodynamic and biogeochemical Fortran models for aquatic ecosystems in ecosystem research.The scheme used in this work successfully conveyed two-way dynamics of HTL and LTL domains along the whole food web.As a step forward, this opened up the opportunity for using EwE, by utilising EwE-F implementation, as an HTL component of holistic ecosystem representations in various ecosystems.
According to Rose et al. (2010), the main difficulty encountered in coupling models of different realms lies in the reconciliation of the differences in time and spatial resolutions.However, difficulties may extend beyond these two areas, e.g.differences in model currencies.The coupling scheme used in this work is able to provide solutions to overcome such constraints highlighted by Rose et al. (2010) and others (Fulton, 2010;Kearney et al., 2012;Salihoglu et al  2013) via its simplistic but ecologically capable approach to form E2E representations of aquatic ecosystems through the incorporation of EwE-F.In addition, the EwE-F enables significant opportunities for integrating it with any kind of Fortran model as depicted in Fig. 7.The figure represents a typical EwE food web model in the middle rectangular box and elaborates the possibilities of modifying EwE-F in different ways by replacing different components with sophisticated model representations for selected state variables or incorporating additional Fortran models to enhance the applicability of the original EwE approach.These solutions and possibilities are explored in detail in the following sections: (i) rec-onciling different integration steps (Sect.5.1.1),(ii) dealing with models that use multiple currencies (Sect.5.1.2),and (iii) other possibilities: incorporation of population demographic structure, physiological processes, and socioeconomic frameworks (Sect.5.1.4).

Reconciling different integration steps
There are two possibilities when combining two models with different integration (time) steps: (i) keeping the integrator function of the two models intact and averaging the outputs of the model with faster dynamics (high turnover rate) over the time frame of the model with slower dynamics (low turnover rate) and vice versa when exchanging information (time-averaged coupling), and (ii) utilising a common integrator for both models and adjusting the rates of the model with slower dynamics to comply with the time window of the model with faster dynamics (real-time coupling).Although Ecosim, by default, works with monthly time steps, it is capable of simulating high-frequency dynamics using shorter time steps.In the present work, we opted for the latter to showcase the possibility of harmonisation in terms of integration step size when using EwE-F in coupled modelling schemes.The difference in the time resolution of both models was remedied by adjusting the HTL model's time step (1 month) to conform to the time step of the biogeochemical model (1 h) in order to render the use of one common ordinary differential equation (ODE) solver (the Runge-Kutta fourth-order) possible.Furthermore, due to this change in the time step of the HTL model, the annual rates of the HTL groups were converted to hourly rates by simple arithmetic calculations.

Dealing with models that use multiple currencies
Some biogeochemical models may carry out their computations in more than one currency for explicit representation of the ratios of fundamental nutrients in the system and their rate limiting conditions on nutrient uptake and primary productivity that can vary in space and time.The multiple currency approach, however, is usually not applied in HTL models, although implicit nutrient-based limitations can be represented in EwE (Araújo et al., 2006;Christensen et al., 2005).Hence, the coupling exercise presented here provided a simple solution for such situations.In order to reconcile the currency differences, one may opt to pick one of the currencies utilised in the biogeochemical model as the one considered to be the limiting nutrient, use it for the final coupled scheme incorporating the EwE-F model, and post-process the derivative function outputs of the two models when exchanging information.In the coupling example given in this work, the difference in the currencies of the models was adjusted by converting the currency of the HTL model from wet weight to phosphorus (P) by utilising the conversion rates and equations available in the literature for HTL groups (stage 1 of the coupling scheme in Fig. 5).In addition, the simulated results of the biogeochemical model (which were in dual currency, phosphorus and carbon) were post-processed prior to output and transferred to EwE-F so as to comply with the currency of the HTL compartment (stage 4 in Fig. 5).The approach used in this work proved to be a practical solution for the issue in cases where there is no particular consideration to have simultaneously tracking multiple currencies in the HTL food web.However, with the availability of EwE-F, HTL models with computations of multiple model currencies can even be set up if desired, although this will require significant modification of various calculations in the EwE state equations.

Spatial simulations
Given the current experience with biogeochemical models coupled to hydrodynamic models (e.g.Lazzari et al., 2012), explicit accounting for spatial variability is important for any assessment of marine ecosystem dynamics.Future efforts are required to add spatial simulation capabilities to EwE-F, either by implementing Ecospace in Fortran or by direct integration of Ecosim-F in a spatially explicit coupled hydrodynamic-biogeochemical model.This planned future work could lead EwE-F to play a substantial role in spatial simulations.

Other possibilities: population demographic structure, physiological processes, socioeconomic frameworks
Similar to the flexibility of EwE provided by its plug-in system, EwE-F gives broad possibilities for interconnecting HTL models with other Fortran models sophisticating and/or incorporating HTL processes.Examples span from fish population to socioeconomic dynamic models.
For instance, EwE-F permits incorporating sophisticated population dynamic models written in Fortran within the EwE-F scheme (Fig. 7c).These population models can be of any kind, including a population's demographic structure (age-size classes) used for stock assessment and to account for differences in fecundity by ages or size (Hilborn and Walters, 1992).
Moreover, EwE-F allows for parameterising various rates for HTL groups (e.g.assimilation efficiency, respiration) under the influence of various environmental factors (e.g.temperature, pH, light) that is not always straightforward otherwise (Fig. 7d).In addition, EwE-F allows for replacing the growth of certain state variables in the food web with sophisticated bioenergetics models coded in Fortran.In this way, various physiological processes of the selected HTL organisms can be related directly and explicitly to the ambient physical factors such as light, temperature and nutrient availability (Fig. 7b).With EwE-F, in fact, as demonstrated in this work, the dynamics of any desired additional state variable in the final coupled scheme could be resolved using derivative functions defined in other models during run-time.This allows for a two-way coupling of, potentially, any number of models (including earth system ones) in one coupling scheme.
Given the calls for ecosystem-based management for marine ecosystems, one can also incorporate socioeconomic dynamics into holistic ecosystem representations that deal with fisheries on top of EwE-F.Considering its modular structure and ease of integration with other models as demonstrated in this work, such holistic representations of ecological and socioeconomic systems have been significantly improved, also including frameworks that involve integration of multiple models written in Fortran (Fig. 7a).

Other practical considerations and future development
In contrast to the EwE, the introduction of namelist and HDF5 files to be used for the operation of EwE-F may create a hindrance to its users.However, it is not necessarily more complicated than the current EwE database files (MS Access).EwE-F requires an HDF5 database file only when transferring information from Ecopath-F to Ecosim-F, and output to and input from this file does not require any user intervention.In addition, the results of both Ecopath-F and Ecosim-F models are output into TAB-delimited ASCII files, which are quite similar to the EwE's output files, i.e. commaseparated value (CSV) ASCII files.These files can easily be opened with spreadsheet programs.The only hindrance for the user could be the preparation of the TAB-delimited ASCII input files for Ecopath-F and Ecosim-F, which however is explained in the User's Manual in detail.On the other hand, through this simple input/output scheme utilising ASCII encoded text files, the availability of EwE-F provides a further opportunity by giving Fortran modellers the possibility to perform detailed sensitivity and uncertainty analyses using hundreds of ensemble scenarios that can easily be prepared also by using modern high-level languages (e.g.Perl, Python, NCL) in addition to Fortran.For their convenience, users of EwE-F are advised to set up, test and fit their models to time series data using EwE, also benefiting from the several routines included in EwE, and, thereafter, to transfer their models to EwE-F.Ecospace (Walters et al., 1999) and other complementary routines aforementioned (see Sect. 3) were not implemented considering that EwE-F was not designed to be an EwE replacement but a bare-bones incarnation that can be used easily for purposes summarised in Sect.5.1.4.Therefore, analyses requiring the aforementioned specific routines (e.g.Monte Carlo analysis, network analysis, etc.) in uncoupled or coupled EwE-F simulations can be done by coding the required specific routines or, alternatively, EwE could be employed for such purposes.The current lack of such use-ful tools that are present in EwE 6.5 is considered to be a drawback for EwE-F v1.0, which may represent an obstacle for some users.However, these technical shortcomings and the lack of these tools including mediation function and time series fitting via vulnerability parameter search are planned to be addressed in the future by incorporating these routines into EwE-F and developing a Visual Basic plug-in for stock EwE which will prepare input files required by EwE-F through EwE's graphical user interface in a straightforward way.Furthermore, considering advancements in coupling on the spatial scale, future efforts in developing EwE-F may also focus on incorporating 2-D spatial dynamics by implementing the Ecospace module of EwE to facilitate the use of EwE-F in schemes that require spatial-temporal dynamics to be resolved.
Another important consideration to be discussed is to keep EwE-F on par with EwE.With every new release of EwE software, many things are prone to change.However, the majority of these changes are related to the ancillary functionalities (graphical user interface, network analysis routines, etc., but not the core state equations and their related calculations) that are not included in EwE-F.Furthermore, the changes to the basic model structure and dynamics have remained almost unchanged since EwE version 5. Hence, it is believed that the core structure of EwE-F (state equations and other related calculations) can be kept on par with the original EwE with little effort, considering that the development of EwE-F is a joint effort of two prominent marine science institutes and is not strictly bound to any individual.

Conclusions
It has been shown that a Fortran version of EwE software could open up various possibilities in terms of coupling and integration with other Fortran-coded biogeochemical and hydrodynamic models where an HTL compartment is required.In order to exemplify the applicability of the approach, a coupled biogeochemical-EwE-F E2E modelling example was demonstrated (Sect.4).However, this was done to demonstrate the feasibility of the approach, and it does not mean that EwE-F can be applied only in E2E modelling frameworks.As discussed in Sect.5.1.4,many other uses of EwE-F are possible.
EwE-F is still in its infancy and future development efforts will focus on maturing the software and implementing missing useful features like times series fitting via vulnerability search, capability to define multiple fishing fleets and explicit spatial simulation.We believe that the development pace of EwE-F will accelerate with the adoption and utilisation of the software in the scientific community.

Figure 2 .
Figure 2. The residuals between absolute biomasses simulated by EwE 6.5 and EwE-F 1.0 for the Generic 37 model.x axis denotes all state variables in the model.

Figure 3 .
Figure 3.The residuals between absolute biomasses simulated by EwE 6.5 and EwE-F 1.0 for the Tampa Bay model.x axis denotes all state variables in the model.

Figure 4 .
Figure 4. Coupled trophodynamic model scheme of the Gulf ofTrieste (northern Adriatic Sea)  showing the linkages between the HTL and LTL models.Phosphorus (denoted with P) was used as the currency for all of the HTL state variables and flows linking the two models.Flows originating from the state variables of the LTL model to the HTL model, which were expressed in carbon (denoted with C), i.e. phytoplankton and zooplankton, were converted to phosphorus (by multiplying variable-specific phosphorus-to-carbon (RPC) ratios) before being transferred.Grey-shaded state variables and flows in the HTL model were replaced by the LTL model's corresponding state variables and the new linked flows are shown in black dashed and continuous lines.Abbreviations: Zoo (small and large zooplankton groups), Phyto (small and large phytoplankton groups), PO 4 (phosphate), POP (particulate organic phosphorus), and DOP (dissolved organic phosphorus).

Figure 5 .
Figure 5.The technical overview of the coupling scheme.ODE stands for "ordinary differential equation", I/O stands for "input/output", and BGC stands for "biogeochemical model" used in the present work.

Figure 6 .
Figure 6.Monthly results of the final year in a 10-year simulation of the coupled (black lines) model versus simulations of uncoupled EwE 6.5 (green lines for HTL variables -unshaded boxes) and uncoupled biogeochemical (red lines for LTL variables -grey shaded boxes) models.

Figure 7 .
Figure 7. Potentialities provided by the EwE-F approach.Coloured arrows denote flows specific to the integrating Fortran models.Black arrows denote linking flows and grey-shaded arrows denote flows replaced/augmented by the linking flows.Boxes denoted by the letters A, B, C and D and bordered by coloured lines replace the respective colour-shaded regions in the EwE-F box (bordered green) under the coupling/integration scheme. .,

Table 1 .
General system and software related requirements of EwE-F v1.0.