Esempio n. 1
0
File: api.cpp Progetto: fannq/SEIMS
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char* MetadataInformation()
{
	MetadataInfo mdi;

	// set the information properties
	mdi.SetAuthor("Wu Hui");
	mdi.SetClass("Overland flow", "Calculate overland flow routing.");
	mdi.SetDescription("IUH overland method to calculate overland flow routing.");
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetHelpfile("IUH_OL.chm");
	mdi.SetID("IUH_OL");
	mdi.SetName("IUH_OL");
	mdi.SetVersion("0.1");
	mdi.SetWebsite(SEIMS_SITE);


	mdi.AddParameter(Tag_TimeStep, UNIT_TIMESTEP_HOUR, DESC_TIMESTEP, File_Input, DT_Single); 
	mdi.AddParameter(Tag_CellSize, UNIT_NON_DIM, DESC_CellSize, Source_ParameterDB, DT_Single); 
	mdi.AddParameter(Tag_CellWidth, UNIT_LEN_M, DESC_CellWidth, Source_ParameterDB, DT_Single); 
	mdi.AddParameter(VAR_OL_IUH, UNIT_NON_DIM, DESC_OL_IUH, Source_ParameterDB, DT_Array2D);

	mdi.AddParameter(VAR_SUBBSN, UNIT_NON_DIM, DESC_SUBBSN, Source_ParameterDB, DT_Raster1D);
	//mdi.AddParameter("uhminCell","","start time of IUH for each grid cell","ParameterDB_Discharge",DT_Array1D);
	//mdi.AddParameter("uhmaxCell","","end time of IUH for each grid cell","ParameterDB_Discharge",DT_Array1D);

	mdi.AddInput(VAR_SURU, UNIT_DEPTH_MM, DESC_SURU, Source_Module, DT_Raster1D);					//from depression module

	mdi.AddOutput(VAR_SBOF, UNIT_DEPTH_MM, DESC_SBOF, DT_Array1D);

	// set the dependencies
	mdi.AddDependency("DEP_FS","Depression Storage module");  

	// write out the XML file.

	string res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Esempio n. 2
0
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char* MetadataInformation()
{
	MetadataInfo mdi;

	// set the information properties
	mdi.SetAuthor("Wu Hui");
	mdi.SetClass("Overland flow", "Calculate overland flow routing.");
	mdi.SetDescription("IUH overland method to calculate overland flow routing.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetHelpfile("IUH_OL.chm");
	mdi.SetID("IUH_OL");
	mdi.SetName("IUH_OL");
	mdi.SetVersion("0.1");
	mdi.SetWebsite("http://seims.github.io/SEIMS");


	mdi.AddParameter("TimeStep","hr","time step of the simulation","file.in",DT_Single); 
	mdi.AddParameter("CellWidth","m","","file.in",DT_Single); 
	mdi.AddParameter("subbasin","","The subbasion grid","ParameterDB_Snow",DT_Raster); 
	mdi.AddParameter("Ol_iuh","","IUH of each grid cell","ParameterDB_Discharge",DT_Array2D);
	//mdi.AddParameter("uhminCell","","start time of IUH for each grid cell","ParameterDB_Discharge",DT_Array1D);
	//mdi.AddParameter("uhmaxCell","","end time of IUH for each grid cell","ParameterDB_Discharge",DT_Array1D);

	mdi.AddInput("D_SURU","mm","The depression storage","Module",DT_Raster);					//from depression module

	mdi.AddOutput("SBOF", "mm","Overland flow to streams for each subbasin", DT_Array1D);

	// set the dependencies
	mdi.AddDependency("DEP_FS","Depression Storage module");  

	// write out the XML file.

	string res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Esempio n. 3
0
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char *MetadataInformation()
{
    string res = "";
    MetadataInfo mdi;

    // set the information properties
    mdi.SetAuthor("Wang Lin");
    mdi.SetClass("Sediment Bound Nutrient OL", "Sediment Bound Nutrient Overland.");
    mdi.SetDescription("Sediment Bound Nutrient Overland transport method using Knisel functions.");
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetHelpfile("SedBonNutrient_OL.chm");
    mdi.SetID("SedBonNutrient_OL");
    mdi.SetName("SedBonNutrient_OL");
    mdi.SetVersion("0.1");
    mdi.SetWebsite(SEIMS_SITE);

    mdi.AddParameter("STORM_DT", "second", "Time step of the simulation", "file.in", DT_Single);
    mdi.AddParameter(Tag_CellSize, UNIT_NON_DIM, DESC_CellSize, Source_ParameterDB, DT_Single);
    mdi.AddParameter(Tag_CellWidth, UNIT_LEN_M, DESC_CellWidth, Source_ParameterDB, DT_Single);
    mdi.AddParameter("Slope", "%", "Slope", "ParameterDB_WaterBalance", DT_Raster1D);
    //mdi.AddParameter("Theta", "", "theta parameter for 4-point implicit finite difference", "ParameterDB_Discharge", DT_Single);
    /*mdi.AddParameter("InitConc_P", "kg/kg", "Initial average concentration of P in the soil", "ParameterDB_soil", DT_Single);
    mdi.AddParameter("InitConc_NH4", "kg/kg", "Initial average concentration of ammonium in the soil", "ParameterDB_soil", DT_Single);
    mdi.AddParameter("InitConc_NO3", "kg/kg", "Initial average concentration of nitrate in the soil", "ParameterDB_soil", DT_Single);*/
    mdi.AddParameter("Clay", "", "Clay proportion in soil", "ParameterDB_WaterBalance", DT_Raster1D);
    mdi.AddParameter("Porosity", "m/m", "Soil porosity", "ParameterDB_WaterBalance", DT_Raster1D);
    mdi.AddParameter("Density", "kg/m3", "Soil density", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddParameter("CHWIDTH", "m", "Channel width", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddInput("D_FlowWidth", "m", "Flow width of overland plane", "Module", DT_Raster1D);
    //mdi.AddInput("D_FlowLen","m", "Flow length of overland plane","Module",DT_Raster);
    mdi.AddParameter("STREAM_LINK", "", "Stream link", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddParameter("Manning", "", "Manning's roughness", "ParameterDB_Discharge", DT_Raster1D);
    //mdi.AddParameter("FLOW_DIR", "", "Flow direction  by the rule of ArcGIS", "ParameterDB_Discharge", DT_Raster);

    //mdi.AddParameter("FLOWOUT_INDEX", "", "The index of flow in cell in the compressed array", "ParameterDB_Discharge", DT_Array1D);
    mdi.AddParameter("FLOWIN_INDEX_D8", "", "The index of flow in cell in the compressed array,"
                             " and the first element in each sub-array is the number of flow in cells in this sub-array",
                     "ParameterDB_Discharge", DT_Array2D);
    mdi.AddParameter("ROUTING_LAYERS", "", "Routing layers according to the flow direction"
                             "There are not flow relationships within each layer, and the first element in each layer is the number of cells in the layer",
                     "ParameterDB_Discharge", DT_Array2D);

    mdi.AddInput("D_QOverland", "m3/s", "Flux in the downslope boundary of cells", "Module", DT_Raster1D);
    mdi.AddInput("D_SURU", "mm", "Water depth in the downslope boundary of cells", "Module", DT_Raster1D);
    mdi.AddInput("D_INFIL", "mm", "Infiltration map of watershed", "Module", DT_Raster1D);
    mdi.AddInput("D_DPST", "mm", "Distribution of depression storage", "Module", DT_Raster1D);
    mdi.AddInput("D_HTOCH", "mm", "Water depth added to channel water depth", "Module", DT_Raster1D);

    mdi.AddOutput("SedBonP", "kg/s", "distribution of dissovlved P", DT_Raster1D);
    mdi.AddOutput("SedBonAmmonium", "kg/s", "distribution of nutrient, ammonium", DT_Raster1D);

    mdi.AddOutput("SedBonPToCh", "kg", "dissovlved P flow to channel", DT_Raster1D);
    mdi.AddOutput("SedBonAmmoniumToCh", "kg", "ammonium flow to channel", DT_Raster1D);
    //test
    mdi.AddOutput("TESTDPST", "mm", "Distribution of depression storage", DT_Raster1D);
    //mdi.AddOutput("ID_OUTLET", "", "index of outlet in the compressed array", DT_Single);

    // set the dependencies
    mdi.AddDependency("Depression", "Calculate depression storage");
    mdi.AddDependency("Overland routing", "Overland routing module");      //for WH
    //mdi.AddDependency("Soil Detachment","Rain and overland soil detachment erosion module");

    res = mdi.GetXMLDocument();

    char *tmp = new char[res.size() + 1];
    strprintf(tmp, res.size() + 1, "%s", res.c_str());
    return tmp;
}
Esempio n. 4
0
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char* MetadataInformation()
{
	string res = "";
	MetadataInfo mdi;

	// set the information properties
	mdi.SetAuthor("Wu Hui");
	mdi.SetClass("Sediment", "Sediment channel routing using variable channel dimention method.");
	mdi.SetDescription("Sediment channel routing using variable channel dimention method as used in SWAT (in SWAT document, page 379).");
	mdi.SetEmail("*****@*****.**");
	mdi.SetHelpfile("SEDR_VCD.chm");
	mdi.SetID("SEDR_VCD");
	mdi.SetName("SEDR_VCD");
	mdi.SetVersion("0.1");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
#ifdef STORM_MODEL
	mdi.AddParameter("DT_CH","s","time step","file.in",DT_Single);  //for long term model
#else
	mdi.AddParameter("TimeStep","s","time step","file.in",DT_Single); 
#endif
	mdi.AddParameter("p_rf","", "Peak rate adjustment factor","ParameterDB_Sediment", DT_Single);
	mdi.AddParameter("spcon","", "Coefficient in sediment transport equation","ParameterDB_Sediment", DT_Single);
	mdi.AddParameter("spexp","", "Exponent in sediment transport equation","ParameterDB_Sediment", DT_Single);
	mdi.AddParameter("vcrit","m/s", "critical veloctiy for sediment deposition","ParameterDB_Sediment", DT_Single);

	//mdi.AddParameter("CellSize","","the size of the cell (the validate cells of the whole basin)","file.in",DT_Single); 
	//mdi.AddParameter("nPETS","","the number of the PET stations","file.in",DT_Single);
	//mdi.AddParameter("CellWidth","m","cell width of the grid","file.in",DT_Single);
	mdi.AddParameter("Chs0","m3/m","initial channel storage per meter of reach length","ParameterDB_Discharge", DT_Single);
	//mdi.AddParameter("Vseep0","m3/s","the initial volume of transmission loss to the deep aquifer over the time interval","ParameterDB_Discharge", DT_Single);

	mdi.AddParameter("RchParam","","reach parameters", "reachparameters.txt",DT_Array2D);
	//mdi.AddParameter("ReachParameter", "", "Reach parameters such stream order, manning's n and downstream subbasin id", "ParameterDB_Discharge", DT_Array2D);
	//mdi.AddParameter("Vdiv","m3","diversion loss of the river reach", "diversionloss.txt",DT_Array1D);
	//mdi.AddParameter("Vpoint","m3"," point source discharge", "diversionloss.txt",DT_Array1D);

	//mdi.AddParameter("subbasin","","subbasin grid","ParameterDB_Discharge", DT_MapWindowRaster);
	mdi.AddInput("SEDTOCH","ton","sediment to streams from each subbasin","Module", DT_Array1D);  // for longterm model
	mdi.AddInput("SubSEDTOCH","kg","sediment to streams from each subbasin","Module", DT_Array1D);   // for storm model
	//mdi.AddInput("CROSS_AREA", "m2", "the cross-sectional area of flow in the channel","Module", DT_Array1D);
	mdi.AddInput("QRECH","","Discharge in a text format at each reach outlet and at each time step","Module",DT_Array1D);
	mdi.AddInput("QS","","Overland discharge at each reach outlet and at each time step","Module",DT_Array1D);
	mdi.AddInput("QI","","Interflow at each reach outlet and at each time step","Module",DT_Array1D);
	mdi.AddInput("QG","","Groundwater discharge at each reach outlet and at each time step","Module",DT_Array1D);
	mdi.AddInput("CHST", "m3", "channel storage", "Module",DT_Array1D);
	//mdi.AddInput("SEEPAGE", "m3", "seepage", "Module",DT_Array1D);
	mdi.AddInput("CHWTDEPTH", "m", "channel water depth", "Module",DT_Array1D);
	//mdi.AddInput("C_WABA","","Channel water balance in a text format for each reach and at each time step","Module",DT_Array2D);

	mdi.AddOutput("SEDRECH","ton","Sediment in a text format at each reach outlet and at each time step",DT_Array1D);
	mdi.AddOutput("T_CHSB","","Channel sediment balance in a text format for each reach and at each time step",DT_Array2D);
	mdi.AddOutput("SEDOUTLET", "ton", "sediment concentration at the watershed outlet", DT_Single);
	//mdi.AddOutput("DEPOUTLET", "ton", "sediment concentration at the watershed outlet", DT_Single);

	// set the dependencies
	mdi.AddDependency("MUSLE_AS","MUSLE_AS module");   
	mdi.AddDependency("MUSK_CH","MUSK_CH module");   	//for module GWA_RE to update groundwater storage

	res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Esempio n. 5
0
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char* MetadataInformation()
{
	string res;

	MetadataInfo mdi;

	// set the information properties
	mdi.SetAuthor("Hui Wu");
	mdi.SetClass("Overland Erosion", "Calculate the amount overland erosion.");
	mdi.SetDescription("use energy function(Govers) method to calculate sediment yield routing of each hillslope cell");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("KinWavSed_OL");
	mdi.SetName("KinWavSed_OL");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("KinWavSed_OL.chm");

	mdi.AddParameter("CellWidth","m","the width (length) of cell","mask.asc",DT_Single);
	mdi.AddParameter("DT_HS", "second", "Time step of the simulation", "file.in", DT_Single);
	mdi.AddParameter("Slope", "%", "Slope", "ParameterDB_WaterBalance", DT_Raster); 
	mdi.AddParameter("eco1","","calibration coefficient of transport capacity calculation","ParameterDB_Sediment",DT_Single);
	mdi.AddParameter("eco2","","calibration coefficient of transport capacity calculation","ParameterDB_Sediment",DT_Single);
	mdi.AddParameter("ccoe","","calibration coefficient of overland erosion","ParameterDB_Sediment",DT_Single);
	mdi.AddParameter("USLE_K","","the soil erodibility factor","ParameterDB_Sediment",DT_Raster);
	mdi.AddParameter("USLE_C","","the cover management factor","ParameterDB_Sediment",DT_Raster);
	//mdi.AddParameter("StoneFrac","","the fraction of stones on the surface, affects splash","ParameterDB_Sediment",DT_Raster);
	//mdi.AddParameter("GrassFrac","","the fraction of grasstrip in a cell","ParameterDB_Sediment",DT_Raster);
	mdi.AddParameter("STREAM_LINK", "", "Stream link", "ParameterDB_Discharge", DT_Raster); 
	mdi.AddParameter("Manning","","Manning's roughness","ParameterDB_Discharge",DT_Raster);
	mdi.AddParameter("CHWIDTH", "m", "Channel width", "ParameterDB_Discharge", DT_Raster); 
	mdi.AddParameter("FLOWIN_INDEX_D8", "", "The index of flow in cell in the compressed array,"
		" and the first element in each sub-array is the number of flow in cells in this sub-array", "ParameterDB_Discharge", DT_Array2D);
	mdi.AddParameter("ROUTING_LAYERS", "", "Routing layers according to the flow direction"
		"There are not flow relationships within each layer, and the first element in each layer is the number of cells in the layer", "ParameterDB_Discharge", DT_Array2D);

	//input from other module	
	//mdi.AddInput("D_CELLH","mm","Water depth in the downslope boundary of cells","Module",DT_Raster);		//WH, from Overland routing module
	mdi.AddInput("D_SURU","mm","Distribution of surface runoff","Module",DT_Raster);
	mdi.AddInput("D_FlowWidth","m", "Flow width of overland plane","Module",DT_Raster);		//FlowWidth, from Overland routing module
	mdi.AddInput("D_DETSplash","kg","the distribution of splash detachment","Module",DT_Raster);	//Splash eosion, from splash erosion module
	mdi.AddInput("D_QOverland", "m3/s", "Flux in the downslope boundary of cells", "Module",DT_Raster);
	//mdi.AddInput("D_HTOCH", "mm", "Water depth added to channel water depth", "Module",DT_Raster);
	// set the output variables
	mdi.AddOutput("DETOverland","kg", "distribution of overland flow detachment", DT_Raster);
	//mdi.AddOutput("DETFLOW","kg/m^2", "distribution of flow detachment", DT_Raster);
	mdi.AddOutput("SEDDEP","kg", "distribution of sediment deposition", DT_Raster);
	//mdi.AddOutput("SEDCONC","kg/m^3", "distribution of sediment concentration in flow", DT_Raster);
	//mdi.AddOutput("SedKG","kg", "distribution of sediment content in flow", DT_Raster);
	mdi.AddOutput("TestV","m/s", "distribution of sediment content in flow", DT_Raster);
	mdi.AddOutput("TestQV","m/s", "distribution of sediment content in flow", DT_Raster);
	mdi.AddOutput("SEDTOCH","kg", "distribution of sediment flowing to channel", DT_Raster);

	mdi.AddDependency("Depression","Depression storage module"); //for WH
	mdi.AddDependency("Overland routing","Overland routing module");      
	mdi.AddDependency("Soil Detachment","Rain and overland soil detachment erosion module");          // for DETSplash

	// write out the XML file.
	res = mdi.GetXMLDocument();

	//return res;

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Esempio n. 6
0
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char *MetadataInformation()
{
    string res = "";
    MetadataInfo mdi;

    // set the information properties
    mdi.SetAuthor("Wang Lin");
    mdi.SetClass("NutrientTransport_OL", "Nutrient Transport Overland.");
    mdi.SetDescription("Nutrient Transport Overland.");
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetHelpfile("NutrientTransport_OL.chm");
    mdi.SetID("NutrientTransport_OL");
    mdi.SetName("NutrientTransport_OL");
    mdi.SetVersion("0.1");
    mdi.SetWebsite(SEIMS_SITE);

    // Nitrate
    mdi.AddParameter("AniExcF", "", "the fraction of porosity from which anions are excluded", "file.in", DT_Single);
    mdi.AddParameter("NitPC", "", "the nitrate percolation coefficient", "file.in", DT_Single);

    mdi.AddParameter("Porosity_2D", "m3/m3", "soil porosity", "ParameterDB_WaterBalance", DT_Array2D);

    mdi.AddInput("D_Nitrate", "kg N/ha", "amount of nitrate", "Module", DT_Array2D);

    mdi.AddInput("D_SURU", "mm", "Distribution of surface runoff", "Module", DT_Raster1D);   //from DEP_LINSLEY
    mdi.AddInput("D_SSRU_2D", "mm", "Distribution of subsurface runoff(lateral flow / interflow).", "Module",
                 DT_Array2D);  //from SSR_DA
    mdi.AddInput("D_Percolation_2D", "mm", "Distribution of groundwater recharge (percolation)", "Module",
                 DT_Array2D);  // from PER_PI

    // Ammonium
    mdi.AddParameter("Clay_2D", "", "Clay fraction in soil", "ParameterDB_WaterBalance", DT_Raster1D);
    mdi.AddInput("D_Ammon", "kg N/ha", "ammonium pool for soil nitrogen", "Module", DT_Array2D);

    // Organic N
    mdi.AddParameter(Tag_CellSize, UNIT_NON_DIM, DESC_CellSize, Source_ParameterDB, DT_Single);
    mdi.AddParameter(Tag_CellWidth, UNIT_LEN_M, DESC_CellWidth, Source_ParameterDB, DT_Single);
    mdi.AddParameter("Density_2D", "g/cm3", "Soil density", "ParameterDB_WaterBalance", DT_Array2D);
    //mdi.AddParameter("RootDepth", "mm", "depth from the soil surface", "file.in", DT_Raster);

    mdi.AddInput("D_SOER", "metric tons", "distribution of soil erosion", "Module", DT_Raster1D);  // from MUSLE_AS
    mdi.AddInput("D_Depth", "mm", "depth of the layer", "Module", DT_Array2D);
    mdi.AddInput("D_ActOrgN", "kg N/ha", "amount of nitrogen in the active organic pool in layer ly", "Module",
                 DT_Array2D);
    mdi.AddInput("D_StaOrgN", "kg N/ha", "amount of nitrogen in the stable organic pool", "Module", DT_Array2D);
    mdi.AddInput("D_FreOrgN", "kg N/ha", "nitrogen in the fresh organic pool in layer ly", "Module", DT_Array2D);

    // soluble P
    mdi.AddParameter("ParCoeP", "m3/Mg", "phosphorus soil partitioning coefficient", "file.in", DT_Single);

    mdi.AddInput("D_SoluP", "kg P/ha", "amount of phosphorus in solution in layer ly", "Module", DT_Array2D);

    // Attached P
    mdi.AddInput("D_ActMinP", "kg P/ha", "amount of phosphorus in the active mineral pool", "Module", DT_Array2D);
    mdi.AddInput("D_StaMinP", "kg P/ha", "amount of phosphorus in the stable mineral pool", "Module", DT_Array2D);
    mdi.AddInput("D_HumOrgP", "kg P/ha", "amount of humic organic phosphorus in the layer", "Module", DT_Array2D);
    mdi.AddInput("D_FreOrgP", "kg P/ha", "phosphorus in the fresh organic pool in the top 10mm", "Module", DT_Array2D);

    // Nitrate
    mdi.AddOutput("SurNit", "kg N/ha", "the nitrate removed in surface runoff", DT_Raster1D);

    mdi.AddOutput("SatW", "mm H2O", "the saturated water content of the soil layer", DT_Array2D);
    mdi.AddOutput("MobQ", "mm H2O", "the amount of mobile water in the layer", DT_Array2D);
    mdi.AddOutput("ConNit", "kg N/mm H2O", "the concentration of nitrate in the mobile water for a given layer",
                  DT_Array2D);
    mdi.AddOutput("LatNit", "kg N/ha", " the nitrate removed in lateral flow from a layer", DT_Array2D);
    mdi.AddOutput("PerNit", "kg N/ha", "the nitrate moved to the underlying layer by percolation", DT_Array2D);

    // Ammonium
    mdi.AddOutput("SurAmm", "kg N/ha", "the ammonium removed in surface runoff", DT_Raster1D);
    mdi.AddOutput("ConAmm", "kg N/mm H2O", "the concentration of Ammonium in the mobile water for a given layer",
                  DT_Array2D);

    // Organic N
    mdi.AddOutput("ConSed", "Mg sed/m3 H2O", "the concentration of sediment in surface runoff", DT_Raster1D);
    mdi.AddOutput("EnrN", "", "nitrogen enrichment ratio", DT_Raster1D);
    mdi.AddOutput("ConOrgN", "g N/ metric ton soil", "the concentration of organic nitrogen in the top 10 mm",
                  DT_Raster1D);
    mdi.AddOutput("TraOrgN", "kg N/ha", "the amount of organic nitrogen transported to the next cell in surface runoff",
                  DT_Raster1D);

    // soluble P
    mdi.AddOutput("SurSolP", "kg P/ha", "the amount of soluble phosphorus lost in surface runoff", DT_Raster1D);

    // Attached P
    mdi.AddOutput("EnrP", "", "phosphorus enrichment ratio", DT_Raster1D);
    mdi.AddOutput("ConAttP", "g P/ metric ton soil",
                  "the concentration of phosphorus attached to sediment in the top 10 mm", DT_Raster1D);
    mdi.AddOutput("TraAttP", "kg P/ha",
                  "the amount of phosphorus attached to sediment transported to the next cell in surface runoff",
                  DT_Raster1D);

    // to subbasin
    mdi.AddParameter("subbasin", "", "subbasin grid", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddOutput("SNITTOCH", "kg", "surface nitrate to channel", DT_Array1D);
    mdi.AddOutput("SNITTOCH_T", "kg", "Total surface nitrate flowing to channel", DT_Single);
    mdi.AddOutput("SAMMTOCH", "kg", "surface ammonium to channel", DT_Array1D);
    mdi.AddOutput("SAMMTOCH_T", "kg", "Total surface ammonium flowing to channel", DT_Single);
    mdi.AddOutput("SSOLPTOCH", "kg", "surface soluble phosphorus to channel", DT_Array1D);
    mdi.AddOutput("SSOLPTOCH_T", "kg", "Total surface soluble phosphorus flowing to channel", DT_Single);
    mdi.AddOutput("ORGNTOCH", "kg", "the amount of organic nitrogen transported to channel in surface runoff(",
                  DT_Array1D);
    mdi.AddOutput("ORGNTOCH_T", "kg", "Total organic nitrogen transported to channel in surface runoff", DT_Single);
    mdi.AddOutput("ATTPTOCH", "kg",
                  "the amount of phosphorus attached to sediment transported to channel in surface runoff", DT_Array1D);
    mdi.AddOutput("ATTPTOCH_T", "kg", "Total phosphorus attached to sediment transported to channel in surface runoff",
                  DT_Single);
    mdi.AddOutput("LANITTOCH", "kg", "lateral nitrate to channel", DT_Array1D);
    mdi.AddOutput("LANITTOCH_T", "kg", "Total lateral nitrate flowing to channel", DT_Single);

    // cell to cell method
    mdi.AddParameter("CHWIDTH", "m", "Channel width", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddParameter("STREAM_LINK", "", "Stream link", "ParameterDB_Discharge", DT_Raster1D);
    //mdi.AddParameter("FLOWOUT_INDEX_DINF", "", "The index of flow in cell in the compressed array", "ParameterDB_Discharge", DT_Array2D);
    mdi.AddParameter("FLOWIN_INDEX_D8", "", "The index of flow in cell in the compressed array,"
                             " and the first element in each sub-array is the number of flow in cells in this sub-array",
                     "ParameterDB_Discharge", DT_Array2D);
    //mdi.AddParameter("FLOWIN_PERCENTAGE_DINF", "", "Percentage of flow in", "ParameterDB_Discharge", DT_Array2D);
    mdi.AddParameter("ROUTING_LAYERS", "", "Routing layers according to the flow direction"
            "There are not flow relationships within each layer", "ParameterDB_Discharge", DT_Array2D);

    // set the dependencies
    mdi.AddDependency("DEP_FS", "Depression Storage module");
    mdi.AddDependency("SSR_DA", "Subsurface Runoff module");
    mdi.AddDependency("MUSLE_AS", "Calculate the amount of sediment yield.");

    res = mdi.GetXMLDocument();

    char *tmp = new char[res.size() + 1];
    strprintf(tmp, res.size() + 1, "%s", res.c_str());
    return tmp;
}