.. _doc.MUSTANG.organization: Organization of MUSTANG routines --------------------------------- * The module MUSTANG is organized in such a way that it can be portable on other hydrodynamic platforms, ie its coupling with other hydrodynamic models is simplified. * A coupler has been created, dedicated to MUSTANG to facilitate exchanges between MUSTANG and *host* code (:ref:`coupler.MUSTANG`) * MUSTANG is called in host model at the beginning of the simulation for initialization, and 2 times at each time step for erosion and conoslidation first, then for deposition. (:ref:`call.MUSTANG`) * MUSTANG is composed of eight files, classified into three groups : * the **MUSTANG_independent files** that should not vary from one model to another and therefore can be updated directly if there are changes. Only a few calls are to be programmed or adapted (reported by **To Program** in the code) (:ref:`list_routines_intern.MUSTANG`) * **comMUSTANG.F90** : declaration and allocation of all sediment variables shared by MUSTANG subroutines * **initMUSTANG.F90** : initialization subroutines * **sed_MUSTANG.F90** : MUSTANG's own routines * the **COUPLER_MUSTANG** files which are used to define the vocabulary that is to say the names of the variables common to the two models (host and MUSTANG), and to calculate and/or to convert certain tables for exchanges (:ref:`coupler.MUSTANG`) : * **coupleur_define_MUSTANG.h** : definition of the vocabulary which can change from one model to another, dimensions of arrays, computation loops and certain spatial expressions which can depend on the grid of computation. * **coupleur_dimhydro_MUSTANG.h** : USE or integration of declarations thuch as dimensions and basic parameters of the hydro-host model (called "hydro fixed data"). * **coupleur_MUSTANG.F90** : routines for definition of variables and parameters which MUSTANG needs (characterization and arrangement of the variables) and routine of tables conversion for exchange between MUSTANG and hydro-host model (called "variable data exchanged between hydro and MUSTANG") * the group **MUSTANG_dependent files** (:ref:`list_routines_depend.MUSTANG`): * **sed_outMUSTANG_ModelHost.F90** that prepares the output file and writes the results regularly to a netcdf file or several (by date). This file depends on the host model * **sed_MUSTANG_ModelHost.F90** which gathers different routines to be rewritten for each host model in order to: * calculate settling rates in water, shear bottom stress, shear rates * write save file and read init file issued from a previous run * treat MPI exchanges (notably for sand fluxes corrections, deposit slipping and lateral erosion,flux corrections for sand, bedload flux and masks), * the **namelist file** (:ref:`doc.paraMUSTANG`) .. image:: FIG/SEDIM/routines_MUSTANG.jpg .. toctree:: :maxdepth: 2 doc.MUSTANG.listroutines doc.MUSTANG.coupleur