Ejemplo n.º 1
0
void Regola::updateMetadata(QTreeWidget *tree)
{
    int index = 0 ;
    foreach(Element * topLevel, childItems) {
        if((topLevel->getType() == Element::ET_PROCESSING_INSTRUCTION)
                && (topLevel->getPITarget() == MetadataInfo::QXMLEDIT_TARGET_PI)) {
            MetadataInfo info;
            if(info.parseUpdatable(topLevel->getPIData(), index)) {
                updateMetadataRecord(tree, topLevel, &info, false);
                break;
            }
        }
        index ++ ;
    }
}
Ejemplo n.º 2
0
/**
 * @brief Regola::updateMetadata update the updatable metadata if existing or insert them
 * @return
 */
void Regola::insertMetadata(QTreeWidget *tree)
{
    //---
    /* breakpoint trap
    extern bool stopMeta;
    if( stopMeta ) {
        stopMeta = true ;
    }*/
    //---
    bool found = false;
    Element *firstElement = NULL ;
    int row = 0 ;
    foreach(Element * topLevel, childItems) {
        if(topLevel->getType() == Element::ET_PROCESSING_INSTRUCTION) {
            if(NULL == firstElement) {
                firstElement = topLevel ;
            }
            if(topLevel->getPITarget() == MetadataInfo::QXMLEDIT_TARGET_PI) {
                MetadataInfo info;
                if(info.parseUpdatable(topLevel->getPIData(), row)) {
                    found = true ;
                    updateMetadataRecord(tree, topLevel, &info, true);
                    break;
                }
            }
            row ++ ;
        }
    }
    if(!found) {
        // insert new metadata
        MetadataInfo newInfo;
        newInfo.markNewRecord();
        QString newData = newInfo.updatable()->toProcessingInstruction();
        newInfo.updatable()->update(false);
        Element *newPI = new Element(this, Element::ET_PROCESSING_INSTRUCTION, NULL);
        newPI->setPITarget(MetadataInfo::QXMLEDIT_TARGET_PI);
        newPI->setPIData(newData);
        newPI->markEdited();
        // at the second place, if possible
        int insertIndex = 0 ;
        if((NULL != firstElement)
                && (firstElement->getType() == Element::ET_PROCESSING_INSTRUCTION)
                && (firstElement->getPITarget().toLower() == "xml")) {
            insertIndex = 1;

        }
        childItems.insert(insertIndex, newPI);
        newPI->caricaFigli(tree, NULL, paintInfo, true, insertIndex);
        afterInsertHousekeeping(newPI, tree, true);
    }
}
Ejemplo 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("Alex Storey, Junzhi Liu");
    mdi.SetClass(MCLS_INTERC, MCLSDESC_INTERC);
    mdi.SetDescription(MDESC_PI_STORM);
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetID(MID_PI_STORM);
    mdi.SetName(MID_PI_STORM);
    mdi.SetVersion("0.4");
    mdi.SetWebsite(SEIMS_SITE);
    mdi.SetHelpfile("");

    // set the input variables (time series)
    mdi.AddInput(VAR_PCP, UNIT_DEPTH_MM, DESC_PCP, Source_Module, DT_Raster1D);
    mdi.AddParameter(VAR_SLOPE, UNIT_PERCENT, DESC_SLOPE, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(Tag_HillSlopeTimeStep, UNIT_SECOND, DESC_TIMESTEP, File_Input, DT_Single);
    // set the parameters (non-time series)
    mdi.AddParameter(VAR_INTERC_MAX, UNIT_DEPTH_MM, DESC_INTERC_MAX, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_INTERC_MIN, UNIT_DEPTH_MM, DESC_INTERC_MIN, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_PI_B, UNIT_NON_DIM, DESC_PI_B, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_INIT_IS, UNIT_NON_DIM, DESC_INIT_IS, Source_ParameterDB, DT_Single);

    // set the output variables
    mdi.AddOutput(VAR_INLO, UNIT_DEPTH_MM, DESC_INLO, DT_Raster1D);
    mdi.AddOutput(VAR_NEPR, UNIT_DEPTH_MM, DESC_NEPR, DT_Raster1D);
    // set the dependencies
    mdi.AddDependency(MCLS_CLIMATE, MCLSDESC_CLIMATE);

    // 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;
}
Ejemplo n.º 4
0
Archivo: api.cpp Proyecto: fannq/SEIMS
// 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("Junzhi Liu");
	mdi.SetClass(MCLS_CH_ROUTING, MCLSDESC_CH_ROUTING);
	mdi.SetDescription(MDESC_CH_MSK);
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetHelpfile("CH_MSK.chm");
	mdi.SetID(MID_CH_MSK);
	mdi.SetName(MID_CH_MSK);
	mdi.SetVersion("0.1");
	mdi.SetWebsite(SEIMS_SITE);

	mdi.AddParameter(Tag_HillSlopeTimeStep,UNIT_SECOND,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_MSK_X, UNIT_NON_DIM,DESC_MSK_X,Source_ParameterDB, DT_Single); 

	mdi.AddParameter(VAR_SLOPE,UNIT_PERCENT,DESC_SLOPE,Source_ParameterDB, DT_Raster1D); 
	mdi.AddParameter(VAR_FLOWDIR,UNIT_NON_DIM,DESC_FLOWDIR,Source_ParameterDB, DT_Raster1D);
	mdi.AddParameter(VAR_CHWIDTH,UNIT_LEN_M,DESC_CHWIDTH,Source_ParameterDB, DT_Raster1D); 
	// reach information
	mdi.AddParameter(Tag_FLOWOUT_INDEX_D8, UNIT_NON_DIM, DESC_FLOWOUT_INDEX_D8, Source_ParameterDB, DT_Array1D);
	mdi.AddParameter(Tag_FLOWIN_INDEX_D8,UNIT_NON_DIM,DESC_FLOWIN_INDEX_D8,Source_ParameterDB, DT_Array2D);
	mdi.AddParameter(VAR_STREAM_LINK, UNIT_NON_DIM,DESC_STREAM_LINK, Source_ParameterDB, DT_Raster1D);
	mdi.AddParameter(Tag_ReachParameter, UNIT_NON_DIM, DESC_REACH_PARAMETER, Source_ParameterDB, DT_Array2D);
	mdi.AddParameter(VAR_CHS0,UNIT_STRG_M3M,DESC_CHS0,Source_ParameterDB, DT_Single);
	
	// from other module
	mdi.AddInput(VAR_SBQG,UNIT_FLOW_CMS,DESC_SBQG,Source_Module, DT_Array1D);
	mdi.AddInput(VAR_QSOIL,UNIT_FLOW_CMS,DESC_QSOIL,Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_QOVERLAND,UNIT_FLOW_CMS,DESC_QOVERLAND,Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_D_P,UNIT_DEPTH_MM,DESC_D_P,Source_Module, DT_Raster1D);

	// output
	mdi.AddOutput(VAR_QCH,UNIT_FLOW_CMS,DESC_QCH, DT_Array2D);
	mdi.AddOutput(VAR_QOUTLET,UNIT_FLOW_CMS,DESC_QOUTLET, DT_Single);
	mdi.AddOutput(VAR_QSUBBASIN,UNIT_FLOW_CMS, DESC_QSUBBASIN, DT_Array1D);
	mdi.AddOutput(VAR_HCH,UNIT_DEPTH_MM, DESC_HCH, DT_Array2D);

	res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 5
0
Archivo: api.cpp Proyecto: gaohr/SEIMS
/// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char *MetadataInformation()
{
    MetadataInfo mdi;
    string res;

    mdi.SetAuthor("LiangJun Zhu");
    mdi.SetClass(MCLS_AET, MCLSDESC_AET);
    mdi.SetDescription(MDESC_AET_PTH);
    mdi.SetID(MID_AET_PTH);
    mdi.SetName(MID_AET_PTH);
    mdi.SetVersion("1.1");
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetWebsite(SEIMS_SITE);
    mdi.SetHelpfile("");
    /// set parameters from database
    mdi.AddParameter(VAR_ESCO, UNIT_NON_DIM, DESC_ESCO, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_SOILLAYERS, UNIT_NON_DIM, DESC_SOILLAYERS, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_SOILDEPTH, UNIT_DEPTH_MM, DESC_SOILDEPTH, Source_ParameterDB, DT_Raster2D);
    mdi.AddParameter(VAR_SOILTHICK, UNIT_DEPTH_MM, DESC_SOILTHICK, Source_ParameterDB, DT_Raster2D);
    mdi.AddParameter(VAR_SOL_AWC, UNIT_DEPTH_MM, DESC_SOL_AWC, Source_ParameterDB, DT_Raster2D);

    mdi.AddParameter(VAR_SOL_NO3, UNIT_CONT_KGHA, DESC_SOL_NO3, Source_Module, DT_Raster2D);
    /// set input from other modules
    mdi.AddInput(DataType_MeanTemperature, UNIT_TEMP_DEG, DESC_TMEAN, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_LAIDAY, UNIT_AREA_RATIO, DESC_LAIDAY, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_PET, UNIT_WTRDLT_MMD, DESC_PET, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_INET, UNIT_DEPTH_MM, DESC_INET, Source_Module_Optional, DT_Raster1D);
    mdi.AddInput(VAR_SNAC, UNIT_DEPTH_MM, DESC_SNAC, Source_Module, DT_Raster1D); /// in swat, sno_hru
    mdi.AddInput(VAR_SNSB, UNIT_DEPTH_MM, DESC_SNSB, Source_Module_Optional, DT_Raster1D);
    mdi.AddInput(VAR_SOL_COV, UNIT_CONT_KGHA, DESC_SOL_COV, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_SOL_ST, UNIT_DEPTH_MM, DESC_SOL_ST, Source_Module, DT_Raster2D);/// sol_st in SWAT
    mdi.AddInput(VAR_SOL_SW, UNIT_DEPTH_MM, DESC_SOL_SW, Source_Module, DT_Raster1D); /// sol_sw in SWAT
    /// set the output variables
    mdi.AddOutput(VAR_SNSB, UNIT_DEPTH_MM, DESC_SNSB, DT_Raster1D); /// in swat, snoev
    mdi.AddOutput(VAR_PPT, UNIT_DEPTH_MM, DESC_PPT, DT_Raster1D);
    mdi.AddOutput(VAR_SOET, UNIT_DEPTH_MM, DESC_SOET, DT_Raster1D);
    mdi.AddOutput(VAR_SNAC, UNIT_DEPTH_MM, DESC_SNAC, DT_Raster1D);
    mdi.AddOutput(VAR_SNO3UP, UNIT_CONT_KGHA, DESC_SNO3UP, DT_Single);
    //mdi.AddOutput(VAR_SOL_SW, UNIT_DEPTH_MM, DESC_SOL_SW, DT_Raster1D); /// mm, different from VAR_SOMO
    //mdi.AddOutput(VAR_SOMO, UNIT_DEPTH_MM, DESC_SOL_ST, DT_Raster2D);
    /// write out the XML file.
    res = mdi.GetXMLDocument();

    char *tmp = new char[res.size() + 1];
    strprintf(tmp, res.size() + 1, "%s", res.c_str());
    return tmp;
}
Ejemplo n.º 6
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("Junzhi Liu");
	mdi.SetClass("Soil Temperature", "Calculate the soil temperature.");
	mdi.SetDescription("Finn Plauborg Method to compute soil temperature.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("STP_FP");
	mdi.SetName("STP_FP");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("STP_FP.html");

	/// from parameter database
	mdi.AddParameter("soil_ta0","","Coefficient a0 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_ta1","","Coefficient a1 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_ta2","","Coefficient a2 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_ta3","","Coefficient a3 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_tb1","","Coefficient b1 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_tb2","","Coefficient b2 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_td1","","Coefficient d1 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("soil_td2","","Coefficient d2 for Finn Plauborg Method",
		"ParameterDB_WaterBalance", DT_Single);

	mdi.AddParameter("k_soil10","","Ratio between soil temperature at 10 cm and the mean",
		"ParameterDB_WaterBalance", DT_Single);

	mdi.AddParameter("soil_t10","","Factor of soil temperature relative to short grass (degree)",
		"ParameterDB_WaterBalance", DT_Raster);
	//mdi.AddParameter("Mask", "", "Array containing the row and column numbers for valid cells",
	//	"ParameterDB_WaterBalance", DT_Raster);

	/// from interpolation module
	/// air temperature
	mdi.AddInput("D_Tmin","oC","Minimum air temperature","Module", DT_Raster);
	mdi.AddInput("D_Tmax","oC","Maximum air temperature","Module", DT_Raster);
	//mdi.AddInput("Tmin1","oC","Minimum air temperature of the (d-1)th day","Module", DT_Raster);
	//mdi.AddInput("Tmax1","oC","Maximum air temperature of the (d-1)th day","Module", DT_Raster);
	//mdi.AddInput("Tmin2","oC","Minimum air temperature of the (d-2)th day","Module", DT_Raster);
	//mdi.AddInput("Tmax2","oC","Maximum air temperature of the (d-2)th day","Module", DT_Raster);

	/// output soil temperature
	mdi.AddOutput("SOTE","oC", "Soil Temperature", DT_Raster);

	string res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 7
0
extern "C" SEIMS_MODULE_API const char* MetadataInformation() {
    MetadataInfo mdi;
    // set the information properties
    mdi.SetAuthor("Junzhi Liu, Liangjun Zhu");
    mdi.SetClass(MCLS_OL_ROUTING, MCLSDESC_OL_ROUTING);
    mdi.SetDescription(MDESC_IUH_SED_OL);
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetHelpfile("");
    mdi.SetID(MID_IUH_SED_OL);
    mdi.SetName(MID_IUH_SED_OL);
    mdi.SetVersion("1.2");
    mdi.SetWebsite(SEIMS_SITE);

    mdi.AddParameter(Tag_TimeStep, UNIT_HOUR, DESC_TIMESTEP, File_Input, DT_Single);
    mdi.AddParameter(Tag_CellWidth, UNIT_LEN_M, DESC_CellWidth, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_SUBBSNID_NUM, UNIT_NON_DIM, DESC_SUBBSNID_NUM, Source_ParameterDB, DT_Single);
    mdi.AddParameter(Tag_SubbasinId, UNIT_NON_DIM, Tag_SubbasinId, 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.AddInput(VAR_SOER, UNIT_KG, DESC_SOER, Source_Module, DT_Raster1D);

    mdi.AddOutput(VAR_SED_TO_CH, UNIT_KG, DESC_SED_TO_CH, DT_Array1D, TF_SingleValue);
    mdi.AddOutput(VAR_SEDYLD, UNIT_KG, DESC_SEDYLD, DT_Raster1D);

    // 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;
}
Ejemplo n.º 8
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("Cheng Wei");
	mdi.SetClass("Yield", "Calculate the amount of yield.");
	mdi.SetDescription("For simplicity purpose for the time being, the algorithm used in the original WetSpa is incorporated in the SEIMS.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("Yield");
	mdi.SetName("Yield");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("Yield.chm");

	mdi.AddParameter("IDC","","land cover/plant classification","ParameterDB_Crop",DT_Raster);
	mdi.AddParameter("CNYLD","","fraction of nitrogen in the yield","ParameterDB_Crop",DT_Raster);
	mdi.AddParameter("CPYLD","kg/ha"," fraction of phosphorus in the yield","ParameterDB_Crop",DT_Raster);
	mdi.AddParameter("HVSTI","kg/ha"," potential harvest index for the plant at maturity given ideal growing conditions","ParameterDB_Crop",DT_Raster);
	mdi.AddParameter("WSYF","","harvest index for the plant in drought conditions and represents the minimum harvest index allowed for the plant","ParameterDB_Crop",DT_Raster);
	mdi.AddParameter("DLAI","","Decline LAI Fraction","ParameterDB_Crop",DT_Raster);
	mdi.AddParameter("harvestDate","","the simulation end of date","ParameterDB",DT_Raster);

	mdi.AddInput("LAI","","leaf area index for a given day","Module", DT_Raster);
	
	mdi.AddInput("D_PET","mm/d", "Potential evapotranspiration", "Module",DT_Raster);///////????zhiqinag: "D_PETC"
	mdi.AddInput("D_SOET","mm","soil evapotranpiration","Module",DT_Raster);					//actual evapotranspiration
	mdi.AddInput("Fr_PHU","","fraction of phu accumulated on a given day ","Module",DT_Raster);
	mdi.AddInput("BIOMASS_N","kg/ha","actual biomass N","Module",DT_Raster);
	mdi.AddInput("BIOMASS_P","kg/ha","actual biomass P","Module",DT_Raster);
	mdi.AddInput("BIOMASS_AG","kg/ha"," aboveground biomass on the day of harvest","Module",DT_Raster);
	mdi.AddInput("BIOMASS_ROOT","kg/ha","biomass root","Module",DT_Raster);
	mdi.AddInput("BIOMASS","kg/ha","total biomass","Module",DT_Raster);
	mdi.AddInput("Total_WaterUptake","mm","total water uptake","Module",DT_Raster); 
	// set the output variables
	mdi.AddOutput("Yield_N","kg/ha","amount of nitrogen removed in the yield",DT_Raster);
	mdi.AddOutput("Yield_P","kg/ha","amount of phosphorus removed in the yield",DT_Raster);
	mdi.AddOutput("Yield","kg/ha","crop yield",DT_Raster);

	// 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;
}
Ejemplo n.º 9
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("Zhiqiang Yu, LiangJun Zhu");
    mdi.SetClass(MCLS_SNOW, MCLSDESC_SNOW);
    mdi.SetDescription(MDESC_SNO_SP);
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetID(MID_SNO_SP);
    mdi.SetName(MID_SNO_SP);
    mdi.SetVersion("1.1");
    mdi.SetWebsite(SEIMS_SITE);
    mdi.SetHelpfile("SNO_SP.chm");

    mdi.AddParameter(VAR_T0, UNIT_TEMP_DEG, DESC_T0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_K_BLOW, UNIT_NON_DIM, DESC_K_BLOW, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_T_SNOW, UNIT_TEMP_DEG, DESC_T_SNOW, Source_ParameterDB, DT_Single);
	// I don't think VAR_SWE0 is useful. By LJ
    // mdi.AddParameter(VAR_SWE0, UNIT_DEPTH_MM, DESC_SWE0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_LAG_SNOW, UNIT_NON_DIM, DESC_LAG_SNOW, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_C_SNOW6, UNIT_MELT_FACTOR, DESC_C_SNOW6, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_C_SNOW12, UNIT_MELT_FACTOR, DESC_C_SNOW12, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_SNOCOVMX, UNIT_DEPTH_MM, DESC_SNOCOVMX, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_SNO50COV, UNIT_NON_DIM, DESC_SNO50COV, Source_ParameterDB, DT_Single);
	// Net precipitation is updated after snow accumulation.
    mdi.AddInput(VAR_NEPR, UNIT_DEPTH_MM, DESC_NEPR, Source_Module, DT_Raster1D); // from interception module
    //TODO: SNAC is used as unknown variable in the execute() funtion, so why it here as Input, otherwise in Output? By LJ
    //mdi.AddInput(VAR_SNAC, UNIT_DEPTH_MM, DESC_SNAC, Source_Module,DT_Raster1D);	 // from snow water balance module
    // I think VAR_SWE is useless either. By LJ
	// mdi.AddInput(VAR_SWE, UNIT_DEPTH_MM, DESC_SWE, Source_Module, DT_Single);  // from snow water balance module
    // TODO: SNRD currently have not been implemented, therefore initialized as zero. By LJ
    // mdi.AddInput(VAR_SNRD, UNIT_DEPTH_MM, DESC_SNRD, Source_Module, DT_Raster1D); // from snow redistribution module
    // Snow sublimation will be considered in actual evpotranspiration module (AET_PTH), so no need to set as Input. By LJ
    // mdi.AddInput(VAR_SNSB, UNIT_DEPTH_MM, DESC_SNSB, Source_Module, DT_Raster1D); //from snow sublimation module
    mdi.AddInput(VAR_TMAX, UNIT_TEMP_DEG, DESC_TMAX, Source_Module, DT_Raster1D); // from interpolation module
    mdi.AddInput(VAR_TMEAN, UNIT_TEMP_DEG, DESC_TMEAN, Source_Module, DT_Raster1D);

    // set the output variables
    mdi.AddOutput(VAR_SNME, UNIT_DEPTH_MM, DESC_SNME, DT_Raster1D);
    mdi.AddOutput(VAR_SNAC, UNIT_DEPTH_MM, DESC_SNAC, DT_Raster1D);
	
    // 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;
}
Ejemplo n.º 10
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("Surface runoff", "Calculate infiltration and excess precipitation.");
	mdi.SetDescription("Green and Ampt method to calculate infiltration and excess precipitation.");
	mdi.SetEmail("");
	mdi.SetHelpfile("SUR_GA.chm");
	mdi.SetID("SUR_GA");
	mdi.SetName("SUR_GA");
	mdi.SetVersion("0.1");
	mdi.SetWebsite("http://www.website.com");

	mdi.AddParameter("TimeStep","hour","time step of the simulation","file.in",DT_Single);
	mdi.AddParameter("T_snow","degree Celsius","snowfall temperature","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("t_soil","degree Celsius","threshold soil freezing temperature","ParameterDB_WaterBalance",DT_Single);
	mdi.AddParameter("T0","degree Celsius","snowmelt threshold temperature","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("Conductivity","mm/h","Soil hydraulic conductivity","ParameterDB_WaterBalance", DT_Raster);  //soil_k
	mdi.AddParameter("Clay","%","Percent of clay content","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("Sand","%","Percent of sand content","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("porosity","-","Soil porosity","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("Rootdepth","m","Root depth","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("CN2","-","CN under moisture condition II","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("Fieldcap","m3/m3","Soil field capacity","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("Wiltingpoint","m3/m3","Plant wilting point moisture","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("s_frozen","m3/m3","frozen soil moisture","ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("Mask", "", "Array containing the row and column numbers for valid cells","ParameterDB_Snow", DT_Array2D);

	mdi.AddInput("D_NEPR","mm","The net precipitation","Module",DT_Raster);
	mdi.AddInput("D_TMin","degree Celsius","The minimum air temperature","Module",DT_Raster);
	mdi.AddInput("D_TMax","degree Celsius","The maximum air temperature","Module",DT_Raster);
	mdi.AddInput("D_SOMO","m3/m3","The soil moisture","Module",DT_Raster);
	mdi.AddInput("D_DPST","mm","The depression storage","Module",DT_Raster);
	mdi.AddInput("D_SOTE","degree Celsius","The soil temperature","Module",DT_Raster);
	mdi.AddInput("D_SNAC","mm","The snow accumulation","Module",DT_Raster);
	mdi.AddInput("D_SNME","mm","The snowmelt","Module",DT_Raster);

	mdi.AddOutput("EXCP", "mm","The excess precipitation", DT_Raster);
	mdi.AddOutput("INFIL","mm","Infiltration map of watershed", DT_Raster);

	// set the dependencies
	mdi.AddDependency("Interpolation","Interpolation module");      //for pNet,T,
	mdi.AddDependency("Soil water","Soil Water Balance module");    // soilMoisture at given day
	mdi.AddDependency("Depression","Depression Storage module");     // SD
	mdi.AddDependency("soil temperature","Soil temperature module");  // TS
	mdi.AddDependency("Snow balance","Snow balance module");          // SA
	mdi.AddDependency("Snowmelt","Snowmelt module");                  // SM

	// 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;
}
Ejemplo n.º 11
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("Junzhi Liu");
	mdi.SetClass("interflow routing", "interflow routing.");
	mdi.SetDescription("interflow routing using the method of WetSpa model.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetHelpfile("INTERFLOW_IKW.chm");
	mdi.SetID("INTERFLOW_IKW");
	mdi.SetName("INTERFLOW_IKW");
	mdi.SetVersion("0.1");
	mdi.SetWebsite("http://seims.github.io/SEIMS");

	mdi.AddParameter("DT_HS", "second", "Time step of the simulation", "file.in", DT_Single); 
	mdi.AddParameter("CellWidth", "m", "Cell size", "file.in", DT_Single); 

	mdi.AddParameter("Slope", "%", "Slope", "ParameterDB_WaterBalance", DT_Raster); 
	mdi.AddParameter("CHWIDTH", "m", "Channel width", "ParameterDB_Discharge", DT_Raster); 

	mdi.AddParameter("STREAM_LINK", "", "Stream link", "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);
	
	mdi.AddParameter("Conductivity","mm/h","Soil hydraulic conductivity","ParameterDB_WaterBalance", DT_Raster); 
	mdi.AddParameter("Porosity", "%", "Soil porosity","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("FieldCap", "%", "Field capacity","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("RootDepth", "mm", "Root depth","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("Poreindex","-","pore size distribution index","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("Ki","-","Interflow scale factor","ParameterDB_WaterBalance",DT_Single);

	mdi.AddInput("D_SOMO","%","Soil Moisture","Module", DT_Raster);
	mdi.AddInput("D_SURU", "mm", "surface runoff (considering return flow)", "Module", DT_Raster);
	
	mdi.AddOutput("QSoil", "m3/s", "Flux in the downslope boundary of cells", DT_Raster);
	mdi.AddOutput("ReturnFlow", "mm", "water depth of return flow", DT_Raster);

	res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 12
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("Chunping Ou");
	mdi.SetClass("Evapotranspiration from soil", "Calculate the amount of the evapotranspiration from soil water reservoir within the time step.");
	mdi.SetDescription("The method relating ET linearly with actual soil moisture used in the original WetSpa will be the default method to estimate actual ET from the soil water reservoir.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("SET_LM");
	mdi.SetName("SET_LM");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("SET_LM.chm");

	mdi.AddParameter("Rootdepth","m","Root depth","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("T_Soil","oC","threshold soil freezing temperature","ParameterDB_WaterBalance", DT_Single);					//

	mdi.AddParameter("FieldCap_2D","m3/m3","Soil field capacity","ParameterDB_WaterBalance",DT_Array2D);
	mdi.AddParameter("Wiltingpoint_2D","m3/m3","Plant wilting point moisture","ParameterDB_WaterBalance", DT_Array2D);					//0w				
	
	// set the parameters (non-time series)
	mdi.AddInput("D_PET","mm","pet","Module",DT_Raster);
	mdi.AddInput("D_INET","mm","Evaporation From Interception Storage","Module",DT_Raster);
	mdi.AddInput("D_DEET","mm","Distribution of depression ET","Module",DT_Raster);
	mdi.AddInput("D_SOTE","oC", "Soil Temperature","Module", DT_Raster);

	mdi.AddInput("D_SOMO_2D", "mm", "Distribution of soil moisture", "Module", DT_Array2D);

	// set the output variables
	mdi.AddOutput("SOET","mm", "Distribution of soil evapotranspiration for a user defined period.", DT_Raster);

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

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 13
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;
}
Ejemplo n.º 14
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("Liu Junzhi");
	mdi.SetClass("Channelflow", "channel flow routing using kinermatic wave method.");
	mdi.SetDescription("channel flow routing using variable storage method.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetHelpfile("IKW_REACH.chm");
	mdi.SetID("IKW_REACH");
	mdi.SetName("MUSK_CH");
	mdi.SetVersion("0.1");
	mdi.SetWebsite("http://seims.github.io/SEIMS");

	mdi.AddParameter("DT_CH","s","time step","file.in",DT_Single); 
	mdi.AddParameter("K_chb","mm/h","hydraulic conductivity of the channel bed","ParameterDB_Discharge", DT_Single);
	mdi.AddParameter("K_bank","mm/h","hydraulic conductivity of the channel bank","ParameterDB_Discharge", DT_Single);
	mdi.AddParameter("Ep_ch","mm/h","reach evaporation adjustment factor","ParameterDB_Discharge", DT_Single);
	mdi.AddParameter("Bnk0","m3/m","initial bank storage per meter of reach length","ParameterDB_Discharge", 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("a_bnk","","bank flow recession constant","ParameterDB_Discharge", DT_Single);
	mdi.AddParameter("b_bnk","","bank storage loss coefficient","ParameterDB_Discharge", DT_Single);
	mdi.AddParameter("MSK_X","","muskingum weighing factor","ParameterDB_Discharge", DT_Single);
	mdi.AddParameter("MSK_co1","","Weighting factor of bankful flow","ParameterDB_Discharge", DT_Single);
	//mdi.AddParameter("ManningScaleFactor","","flow velocity scaling factor for calibration","ParameterDB_Discharge", DT_Single);

	mdi.AddParameter("RchParam","","reach parameters", "reachparameters.txt",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_Raster);
	mdi.AddInput("D_SBOF","m3/s","overland flow to streams from each subbasin","Module", DT_Array1D);
	mdi.AddInput("D_SBIF","m3/s","interflow to streams from each subbasin","Module", DT_Array1D);
	mdi.AddInput("D_SBQG","m3/s","groundwater flow out of the subbasin","Module", DT_Array1D);
	mdi.AddInput("D_SBPET","mm","the potential evapotranspiration rate of the subbasin","Module", DT_Array1D);
	mdi.AddInput("D_SBGS","mm","Groundwater storage of the subbasin","Module", DT_Array1D);

	mdi.AddOutput("QRECH","","Discharge in a text format at each reach outlet and at each time step",DT_Array1D);
	mdi.AddOutput("QOUTLET", "m3/s", "discharge at the watershed outlet", DT_Single);
	mdi.AddOutput("QSOUTLET", "m3/s", "discharge at the watershed outlet", DT_Single);
	mdi.AddOutput("QS","","Overland discharge at each reach outlet and at each time step",DT_Array1D);
	mdi.AddOutput("QI","","Interflow at each reach outlet and at each time step",DT_Array1D);
	mdi.AddOutput("QG","","Groundwater discharge at each reach outlet and at each time step",DT_Array1D);
	mdi.AddOutput("CHST", "m3", "channel storage", DT_Array1D);
	mdi.AddOutput("BKST", "m3", "bank storage", DT_Array1D);
	mdi.AddOutput("SEEPAGE", "m3", "seepage", DT_Array1D);
	mdi.AddOutput("CHWTDEPTH", "m", "channel water depth", DT_Array1D);
	//mdi.AddOutput("C_WABA","","Channel water balance in a text format for each reach and at each time step",DT_Array2D);

	res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 15
0
Archivo: api.cpp Proyecto: fannq/SEIMS
// 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(MCLS_SED_ROUTING, MCLSDESC_SED_ROUTING);
	mdi.SetDescription(MDESC_SEDR_VCD);
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetHelpfile("SEDR_VCD.chm");
	mdi.SetID(MID_SEDR_VCD);
	mdi.SetName(MID_SEDR_VCD);
	mdi.SetVersion("0.1");
	mdi.SetWebsite(SEIMS_SITE);
#ifdef STORM_MODEL
	mdi.AddParameter(Tag_ChannelTimeStep,UNIT_SECOND,DESC_TIMESTEP,File_Input,DT_Single);  //for long term model // this method is daily time interval based.
#else
	mdi.AddParameter(Tag_TimeStep,UNIT_SECOND,DESC_TIMESTEP,File_Input,DT_Single); /// in Module Settings: time_t SettingsInput::getDtDaily() const{return 86400;}
#endif
	mdi.AddParameter(VAR_P_RF,UNIT_NON_DIM, DESC_P_RF,Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_SPCON,UNIT_NON_DIM, DESC_SPCON,Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_SPEXP,UNIT_NON_DIM,DESC_SPEXP ,Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_VCRIT,UNIT_SPEED_MS, DESC_VCRIT,Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_CHS0, UNIT_STRG_M3M, DESC_CHS0, Source_ParameterDB, DT_Single);
	mdi.AddParameter(Tag_RchParam,UNIT_NON_DIM,DESC_REACH_PARAMETER, Source_ParameterDB,DT_Array2D);

	mdi.AddInput(VAR_SED_TO_CH,UNIT_TONS,DESC_SED_TO_CH,Source_Module, DT_Array1D);  // for longterm model
	mdi.AddInput(VAR_SUB_SEDTOCH,UNIT_KG,DESC_SUB_SEDTOCH,Source_Module, DT_Array1D);   // for storm model
	mdi.AddInput(VAR_QRECH,UNIT_FLOW_CMS,DESC_QRECH,Source_Module,DT_Array1D);
	mdi.AddInput(VAR_QS,UNIT_FLOW_CMS,DESC_QS,Source_Module,DT_Array1D);
	mdi.AddInput(VAR_QI,UNIT_FLOW_CMS,DESC_QI,Source_Module,DT_Array1D);
	mdi.AddInput(VAR_QG,UNIT_FLOW_CMS,DESC_QG,Source_Module,DT_Array1D);
	mdi.AddInput(VAR_CHST, UNIT_VOL_M3, DESC_CHST,Source_Module,DT_Array1D);
	mdi.AddInput(VAR_CHWTDEPTH, UNIT_LEN_M, DESC_CHWTDEPTH, Source_Module,DT_Array1D);

	mdi.AddOutput(VAR_SED_RECH,UNIT_TONS,DESC_SED_RECH,DT_Array1D);
	mdi.AddOutput(VAR_CHSB,UNIT_NON_DIM,DESC_CHSB,DT_Array2D);
	mdi.AddOutput(VAR_SED_OUTLET,UNIT_TONS,DESC_SED_OUTLET, DT_Single);
	// set the dependencies
	mdi.AddDependency(MCLS_OL_EROSION,MCLSDESC_OL_EROSION);   
	mdi.AddDependency(MCLS_CH_ROUTING, MCLSDESC_CH_ROUTING);   	//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;
}
Ejemplo n.º 16
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("Zhiqiang Yu");
    mdi.SetClass(MCLS_OL_EROSION, MCLSDESC_OL_EROSION);
    mdi.SetDescription(MDESC_MUSLE_AS);
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetID(MID_MUSLE_AS);
    mdi.SetName(MID_MUSLE_AS);
    mdi.SetVersion("0.5");
    mdi.SetWebsite(SEIMS_SITE);
    mdi.SetHelpfile("MUSLE_AS.chm");

    mdi.AddParameter(Tag_CellWidth, UNIT_LEN_M, DESC_CellWidth, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_DEPRATIO, UNIT_NON_DIM, DESC_DEPRATIO, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_USLE_K, UNIT_NON_DIM, DESC_USLE_K, Source_ParameterDB, DT_Raster2D);
    mdi.AddParameter(VAR_USLE_C, UNIT_NON_DIM, DESC_USLE_C, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_USLE_P, UNIT_NON_DIM, DESC_USLE_P, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_ACC, UNIT_NON_DIM, DESC_ACC, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_SLOPE, UNIT_PERCENT, DESC_SLOPE, Source_ParameterDB, DT_Raster1D);
	mdi.AddParameter(VAR_SUBBASIN_PARAM, UNIT_NON_DIM, DESC_SUBBASIN_PARAM, Source_ParameterDB, DT_Subbasin);
    mdi.AddParameter(VAR_STREAM_LINK, UNIT_NON_DIM, DESC_STREAM_LINK, Source_ParameterDB, DT_Raster1D);

    //input from other module
    mdi.AddInput(VAR_FLOW_OL, UNIT_DEPTH_MM, DESC_OLFLOW, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_SNAC, UNIT_DEPTH_MM, DESC_SNAC, Source_Module, DT_Raster1D);

    // set the output variables
    mdi.AddOutput(VAR_SOER, UNIT_KG, DESC_SOER, DT_Raster1D);
    mdi.AddOutput(VAR_USLE_LS, UNIT_NON_DIM, DESC_USLE_LS, DT_Raster1D);

    // 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;
}
Ejemplo n.º 17
0
Archivo: api.cpp Proyecto: 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(MCLS_SUR_RUNOFF, MCLSDESC_SUR_RUNOFF);
	mdi.SetDescription(MDESC_SUR_CN);
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetHelpfile("SUR_CN.chm");
	mdi.SetID(MID_SUR_CN);
	mdi.SetName(MID_SUR_CN);
	mdi.SetVersion("0.1");
	mdi.SetWebsite(SEIMS_SITE);

	mdi.AddParameter(VAR_T_SNOW, UNIT_TEMP_DEG, DESC_T_SNOW, Source_ParameterDB,DT_Single);
	mdi.AddParameter(VAR_T_SOIL, UNIT_TEMP_DEG, DESC_T_SOIL, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_T0, UNIT_TEMP_DEG, DESC_T0, Source_ParameterDB,DT_Single);
	mdi.AddParameter(VAR_S_FROZEN, UNIT_NON_DIM, DESC_S_FROZEN, Source_ParameterDB, DT_Single);  

	mdi.AddParameter(VAR_CN2, UNIT_NON_DIM, DESC_CN2, Source_ParameterDB, DT_Raster1D);
	mdi.AddParameter(VAR_MOIST_IN, UNIT_VOL_FRA_M3M3, DESC_MOIST_IN, Source_ParameterDB, DT_Raster1D);
	mdi.AddParameter(VAR_ROOTDEPTH, UNIT_LEN_M,DESC_ROOTDEPTH,Source_ParameterDB,DT_Raster1D);

	mdi.AddParameter(VAR_SOILDEPTH, UNIT_LEN_M, DESC_SOILDEPTH, Source_ParameterDB, DT_Raster2D);
	mdi.AddParameter(VAR_FIELDCAP, UNIT_VOL_FRA_M3M3, DESC_FIELDCAP, Source_ParameterDB, DT_Raster2D);
	mdi.AddParameter(VAR_POROST,  UNIT_NON_DIM, DESC_POROST, Source_ParameterDB, DT_Raster2D);
	mdi.AddParameter(VAR_WILTPOINT, UNIT_VOL_FRA_M3M3, DESC_WILTPOINT, Source_ParameterDB, DT_Raster2D);
	
	mdi.AddInput(VAR_NEPR, UNIT_DEPTH_MM, DESC_NEPR, Source_Module,DT_Raster1D);					//from interception module
	mdi.AddInput(VAR_TMEAN, UNIT_TEMP_DEG, DESC_TMEAN, Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_DPST, UNIT_DEPTH_MM, DESC_DPST, Source_Module,DT_Raster1D);					//from depression module
	mdi.AddInput(VAR_SOTE, UNIT_TEMP_DEG, DESC_SOTE, Source_Module,DT_Raster1D);			//from soil temperature module
	mdi.AddInput(VAR_SNAC, UNIT_DEPTH_MM, DESC_SNAC, Source_Module,DT_Raster1D);					//from snow accumulation module
	mdi.AddInput(VAR_SNME, UNIT_DEPTH_MM, DESC_SNME, Source_Module,DT_Raster1D);								//from snowmelt module

	mdi.AddOutput(VAR_EXCP,  UNIT_DEPTH_MM, DESC_EXCP, DT_Raster1D);// just for depression module.
	mdi.AddOutput(VAR_INFIL, UNIT_DEPTH_MM, DESC_INFIL, DT_Raster1D);
	mdi.AddOutput(VAR_SOMO, UNIT_VOL_FRA_M3M3, DESC_SOMO, DT_Raster2D);

	// 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;
}
Ejemplo n.º 18
0
Archivo: api.cpp Proyecto: 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("Chunping Ou");
	mdi.SetClass(MCLS_SNO_RD, MCLSDESC_SNO_RD);
	mdi.SetDescription(MDESC_SRD_MB);
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetID(MID_SRD_MB);
	mdi.SetName(MID_SRD_MB);
	mdi.SetVersion("0.5");
	mdi.SetWebsite(SEIMS_SITE);
	mdi.SetHelpfile("SRD_MB.chm");

	//3 grid parameter
	mdi.AddParameter("slope_wind","%","Slope along wind direction","ParameterDB_Snow",DT_Raster1D);
	mdi.AddParameter("curva_wind","%","curvature along wind direction","ParameterDB_Snow",DT_Raster1D);
	mdi.AddParameter("shc","m","snow holding capacity","ParameterDB_Snow",DT_Raster1D);
	mdi.AddParameter("T_snow","oC","snowfall temperature","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("swe0","mm","Initial snow water equivalent","ParameterDB_Snow",DT_Single);

	//8 single parameter
	mdi.AddParameter("shc_crop ","m","snow holding capacity of cropland with conventional tillage used to calculate land cover weighting factor","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("k_slope","-","Slope coefficient in wind direction","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("k_curvature","-","Curvature coefficient in wind direction","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("ut0","m/s","Threshold wind speed at -27 degree for starting the redistribution of sno","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("u0","m/s","a wind speed over threshold at which the decay coefficient is one","ParameterDB_Snow",DT_Single);
	//mdi.AddParameter("t_snow","oC","snowfall temperature","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("t_wind","oC","temperature at which wind transport of snow is most favorable","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("K_blow","-"," a fraction coefficient of snow blowing into or out of the watershed","ParameterDB_Snow",DT_Single);
	mdi.AddParameter("T0","oC","the snowmelt threshold temperature ","ParameterDB_Snow",DT_Single);	

	//input from other module	
	mdi.AddInput("T_WS","m/s","wind speed measured at 10 m height","Module",DT_Array1D);			// from time series data module
	mdi.AddInput("D_NEPR","mm","net precipitation","Module",DT_Raster1D);					// from interception module
	mdi.AddInput("D_SNAC","mm", "distribution of snow accumulation", "Module",DT_Raster1D);	// from snow water balance module
	mdi.AddInput("SWE","mm","average SA of the watershed","Module",DT_Single);						// from snow water balance module
	mdi.AddInput("D_TMIN","oC","min temperature","Module",DT_Raster1D);
	mdi.AddInput("D_TMAX","oC","max temperature","Module",DT_Raster1D);

	// set the output variables
	mdi.AddOutput(VAR_SNRD,UNIT_DEPTH_MM, DESC_SNRD, DT_Raster1D);

	// 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;
}
Ejemplo n.º 19
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;
}
Ejemplo n.º 20
0
// function to return the XML Metadata document string
extern "C" SEIMS_MODULE_API const char* MetadataInformation()
{
	MetadataInfo mdi;

	mdi.SetAuthor("Zhiqiang Yu; Junzhi Liu");
	mdi.SetClass("Subsurface Runoff", "");
	mdi.SetDescription("Darcy's law and the kinematic approximation; Water is routed cell-to-cell according to D8 or Dinf flow direction");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("SSR_DA");
	mdi.SetName("SSR_DA");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("SSR_DA.chm");

	mdi.AddParameter("CellWidth","m","","file.in",DT_Single);
	mdi.AddParameter("TimeStep","h","","file.in",DT_Single);
	//mdi.AddParameter("UpperSoilDepth", "mm", "depth of the upper soil layer", "ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("Ki","-","Interflow scale factor","ParameterDB_WaterBalance",DT_Single);
	mdi.AddParameter("T_Soil","oC","threshold soil freezing temperature","ParameterDB_WaterBalance", DT_Single);				

	mdi.AddParameter("Conductivity_2D","mm/h","saturation hydraulic conductivity","ParameterDB_WaterBalance",DT_Array2D);
	mdi.AddParameter("Porosity_2D","m3/m3","soil porosity","ParameterDB_WaterBalance",DT_Array2D);
	mdi.AddParameter("Poreindex_2D","-","pore size distribution index","ParameterDB_WaterBalance",DT_Array2D);
	mdi.AddParameter("FieldCap_2D","m3/m3","Soil field capacity","ParameterDB_WaterBalance",DT_Array2D);

	mdi.AddParameter("Rootdepth","mm","Root depth","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("Slope","%","Soil field capacity","ParameterDB_WaterBalance", DT_Raster);		

	mdi.AddParameter("CHWIDTH", "m", "Channel width", "ParameterDB_Discharge", DT_Raster); 
	mdi.AddParameter("STREAM_LINK", "", "Stream link", "ParameterDB_Discharge", DT_Raster); 
	//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);

	mdi.AddParameter("subbasin","","The subbasion grid","ParameterDB_Snow",DT_Raster);

	// set the parameters (non-time series)
	mdi.AddInput("D_GRRE","mm","perculation","Module",DT_Raster);
	mdi.AddInput("D_SOTE","oC", "Soil Temperature","Module", DT_Raster);
	mdi.AddInput("D_SOMO_2D","mm","Distribution of soil moisture","Module",DT_Array2D);

	// set the output variables
	mdi.AddOutput("SSRU_2D","mm", "Distribution of subsurface runoff (mm).", DT_Array2D);
	mdi.AddOutput("SSRUVOL_2D","mm", "Distribution of subsurface runoff (m3).", DT_Array2D);
	mdi.AddOutput("SBIF", "mm","Interflow to streams for each subbasin", DT_Array1D);

	string res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 21
0
extern "C" SEIMS_MODULE_API const char *MetadataInformation()
{
    string res = "";
    MetadataInfo mdi;

    // set the information properties
    mdi.SetAuthor("Liu Junzhi");
    mdi.SetClass(MCLS_CH_ROUTING, MCLSDESC_CH_ROUTING);
    mdi.SetDescription(MDESC_MUSK_CH);
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetHelpfile("MUSK_CH.chm");
    mdi.SetID(MID_MUSK_CH);
    mdi.SetName(MID_MUSK_CH);
    mdi.SetVersion("0.2");
    mdi.SetWebsite(SEIMS_SITE);

    mdi.AddParameter(Tag_ChannelTimeStep, UNIT_SECOND, DESC_TIMESTEP, File_Input, DT_Single);
    mdi.AddParameter(VAR_K_CHB, UNIT_WTRDLT_MMH, DESC_K_CHB, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_K_BANK, UNIT_WTRDLT_MMH, DESC_K_BANK, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_EP_CH, UNIT_WTRDLT_MMH, DESC_EP_CH, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_BNK0, UNIT_STRG_M3M, DESC_BNK0, Source_ParameterDB, DT_Single);
    //mdi.AddParameter(VAR_CHS0, UNIT_STRG_M3M, DESC_CHS0, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_CHS0_PERC, UNIT_NON_DIM, DESC_CHS0_PERC, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_VSEEP0, UNIT_FLOW_CMS, DESC_VSEEP0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_A_BNK, UNIT_NON_DIM, DESC_A_BNK, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_B_BNK, UNIT_NON_DIM, DESC_B_BNK, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_MSK_X, UNIT_NON_DIM, DESC_MSK_X, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_MSK_CO1, UNIT_NON_DIM, DESC_MSK_CO1, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_VSF, UNIT_NON_DIM, DESC_VSF, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_GWRQ, UNIT_FLOW_CMS, DESC_GWRQ, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_SUBBSN, UNIT_NON_DIM, DESC_SUBBSN, Source_ParameterDB, DT_Raster1D);
	// add reach information
	mdi.AddParameter(VAR_REACH_PARAM, UNIT_NON_DIM, DESC_REACH_PARAM, Source_ParameterDB, DT_Reach);
	// add BMPs management operations, such as point source discharge
	mdi.AddParameter(VAR_SCENARIO, UNIT_NON_DIM, DESC_SCENARIO, Source_ParameterDB, DT_Scenario);

    mdi.AddInput(VAR_SBOF, UNIT_FLOW_CMS, DESC_SBOF, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBIF, UNIT_FLOW_CMS, DESC_SBIF, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBQG, UNIT_FLOW_CMS, DESC_SBQG, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBPET, UNIT_DEPTH_MM, DESC_SBPET, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBGS, UNIT_DEPTH_MM, DESC_SBGS, Source_Module, DT_Array1D);

    mdi.AddOutput(VAR_QRECH, UNIT_FLOW_CMS, DESC_QRECH, DT_Array1D);
    mdi.AddOutput(VAR_QOUTLET, UNIT_FLOW_CMS, DESC_QOUTLET, DT_Single);
    mdi.AddOutput(VAR_QSOUTLET, UNIT_FLOW_CMS, DESC_QSOUTLET, DT_Single);
    mdi.AddOutput(VAR_QS, UNIT_NON_DIM, DESC_QS, DT_Array1D);
    mdi.AddOutput(VAR_QI, UNIT_NON_DIM, DESC_QI, DT_Array1D);
    mdi.AddOutput(VAR_QG, UNIT_NON_DIM, DESC_QG, DT_Array1D);
    mdi.AddOutput(VAR_CHST, UNIT_VOL_M3, DESC_CHST, DT_Array1D);
	mdi.AddOutput(VAR_PRECHST, UNIT_VOL_M3, DESC_PRECHST, DT_Array1D);
    mdi.AddOutput(VAR_BKST, UNIT_VOL_M3, DESC_BKST, DT_Array1D);
    mdi.AddOutput(VAR_SEEPAGE, UNIT_VOL_M3, DESC_SEEPAGE, DT_Array1D);
    mdi.AddOutput(VAR_CHWTDEPTH, UNIT_LEN_M, DESC_CHWTDEPTH, DT_Array1D);
	mdi.AddOutput(VAR_CHWTWIDTH, UNIT_LEN_M, DESC_CHWTWIDTH, DT_Array1D);
	mdi.AddOutput(VAR_CHBTMWIDTH, UNIT_LEN_M, DESC_CHBTMWIDTH, DT_Array1D);
	mdi.AddOutput(VAR_PRECHWTDEPTH, UNIT_LEN_M, DESC_PRECHWTDEPTH, DT_Array1D);

    res = mdi.GetXMLDocument();
    char *tmp = new char[res.size() + 1];
    strprintf(tmp, res.size() + 1, "%s", res.c_str());
    return tmp;
}
Ejemplo n.º 22
0
Archivo: api.cpp Proyecto: gaohr/SEIMS
// 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("Dissolved Nutrient CH", "Channel Dissolved Nutrient.");
    mdi.SetDescription("Dissolved Nutrient Channel transport method using KinematicWave Method.");
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetHelpfile("DissolvedNutrient_CH.chm");
    mdi.SetID("DissolvedNutrient_CH");
    mdi.SetName("DissolvedNutrient_CH");
    mdi.SetVersion("0.1");
    mdi.SetWebsite(SEIMS_SITE);

    mdi.AddParameter("DT_HS", "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("CHWIDTH", "m", "Channel width", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddParameter("FLOWOUT_INDEX_D8", "", "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("STREAM_LINK", "", "Stream link (id of reaches)", "ParameterDB_Discharge", DT_Raster1D);
    mdi.AddParameter(Tag_ReachParameter, UNIT_NON_DIM, DESC_REACH_PARAMETER, Source_ParameterDB, DT_Array2D);
    mdi.AddInput("D_DissovPToCh", "m3/s", "Flux in the downslope boundary of cells", "Module", DT_Raster1D);
    mdi.AddInput("D_AmmoniumToCh", "mm", "Water depth in the downslope boundary of cells", "Module", DT_Raster1D);
    mdi.AddInput("D_NitrateToCh", "mm", "Infiltration map of watershed", "Module", DT_Raster1D);
    mdi.AddInput("HCH", "mm", "Water depth in the downslope boundary of cells", "Module", DT_Array2D);
    mdi.AddInput("QCH", "m3/s", "Flux in the downslope boundary of cells", "Module", DT_Array2D);

    mdi.AddOutput("DissovP", "kg/s", "distribution of dissovlved P in reaches", DT_Array2D);
    mdi.AddOutput("Ammonium", "kg/s", "distribution of nutrient, ammonium in reaches", DT_Array2D);
    mdi.AddOutput("Nitrate", "kg/s", "distribution of nutrient, nitrate in reaches", DT_Array2D);

    mdi.AddOutput("DissovPOutlet", "mg/s", "dissovlved P flows to outlet", DT_Single);
    mdi.AddOutput("AmmoniumOutlet", "mg/s", "ammonium flows to outlet", DT_Single);
    mdi.AddOutput("NitrateOutlet", "mg/s", "nitrate flows to outlet", DT_Single);

    // set the dependencies
    mdi.AddDependency("Dissolved Nutrient OL", "Dissolved Nutrient Overland module");      //for WH
    mdi.AddDependency("Channel routing", "Channel routing module");

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

    char *tmp = new char[res.size() + 1];
    strprintf(tmp, res.size() + 1, "%s", res.c_str());
    return tmp;
}
Ejemplo n.º 23
0
Archivo: api.cpp Proyecto: 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(MCLS_INTERFLOW, MCLSDESC_INTERFLOW);
	mdi.SetDescription(MDESC_IUH_IF);
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetHelpfile("IUH_IF.chm");
	mdi.SetID(MID_IUH_IF);
	mdi.SetName(MID_IUH_IF);
	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_SSRU, UNIT_DEPTH_MM, DESC_SSRU, Source_Module, DT_Raster1D);					

	mdi.AddOutput(VAR_SBIF, UNIT_DEPTH_MM, DESC_SBIF, DT_Array1D);

	// set the dependencies
	mdi.AddDependency("SSR_DA","Subsurface Runoff 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;
}
Ejemplo n.º 24
0
Archivo: api.cpp Proyecto: fannq/SEIMS
// 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(MCLS_GW, MCLSDESC_GW);
	mdi.SetDescription("Reservoir Method to calculate groundwater balance and baseflow.");
	mdi.SetEmail(SEIMS_EMAIL);
	mdi.SetHelpfile("GWA_RE.chm");
	mdi.SetID("GWA_RE");
	mdi.SetName("GWA_RE");
	mdi.SetVersion("0.1");
	mdi.SetWebsite(SEIMS_SITE);

	mdi.AddParameter(Tag_TimeStep, UNIT_TIMESTEP_HOUR, DESC_TIMESTEP ,File_Config, 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_GW0, UNIT_DEPTH_MM, DESC_GW0, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_GWMAX, UNIT_DEPTH_MM, DESC_GWMAX, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_DF_COEF, UNIT_NON_DIM, DESC_DF_COEF, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_KG, UNIT_NON_DIM, DESC_KG, Source_ParameterDB, DT_Single);
	mdi.AddParameter(VAR_Base_ex, UNIT_NON_DIM, DESC_BASE_EX, Source_ParameterDB, DT_Single);

	mdi.AddParameter(VAR_SOILDEPTH, UNIT_DEPTH_MM, DESC_SOILDEPTH, Source_ParameterDB,DT_Raster1D);
	//mdi.AddParameter(Tag_SubbasinSelected, UNIT_NON_DIM, "The subbasion ids listed in file.out", File_Output, DT_Array1D);
	mdi.AddParameter(VAR_SUBBSN, UNIT_NON_DIM, DESC_SUBBSN, Source_ParameterDB,DT_Raster1D);
	mdi.AddParameter(VAR_SLOPE, UNIT_PERCENT, DESC_SLOPE, Source_ParameterDB, DT_Raster1D);
	mdi.AddInput(VAR_INET, UNIT_DEPTH_MM, DESC_INET, Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_DEET, UNIT_DEPTH_MM, DESC_DEET, Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_SOET, UNIT_DEPTH_MM, DESC_SOET, Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_PET, UNIT_DEPTH_MM, DESC_PET, Source_Module, DT_Raster1D);
	mdi.AddInput(VAR_GWNEW, UNIT_DEPTH_MM, DESC_GWNEW, Source_Module, DT_Array1D);//from IUH_CH or other channel routing module

	mdi.AddInput(VAR_PERCO,UNIT_DEPTH_MM, DESC_PERCO, Source_Module,DT_Raster2D);
	mdi.AddInput(VAR_SOMO, UNIT_DEPTH_MM, DESC_SOMO, Source_Module, DT_Raster2D);

	mdi.AddOutput(VAR_GWWB, UNIT_NON_DIM, DESC_NONE, DT_Array2D);					//used for output file
	mdi.AddOutput(VAR_REVAP, UNIT_NON_DIM, DESC_NONE, DT_Raster1D);		//used by soil water balance module
	mdi.AddOutput(VAR_RG, UNIT_NON_DIM, DESC_NONE, DT_Array1D);					//used by soil water balance module
	mdi.AddOutput(VAR_SBQG, UNIT_NON_DIM, DESC_NONE, DT_Array1D);					//used by channel flow routing module
	mdi.AddOutput(VAR_SBPET, UNIT_NON_DIM, DESC_NONE, DT_Array1D);	
	mdi.AddOutput(VAR_SBGS, UNIT_NON_DIM, DESC_NONE, DT_Array1D);	

	res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 25
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("Liu Junzhi");
    mdi.SetClass("Channelflow", "channel flow routing using kinermatic wave method.");
    mdi.SetDescription("channel flow routing using variable storage method.");
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetHelpfile("IKW_REACH.chm");
    mdi.SetID("IKW_REACH");
    mdi.SetName("MUSK_CH");
    mdi.SetVersion("0.1");
    mdi.SetWebsite(SEIMS_SITE);

    mdi.AddParameter(Tag_ChannelTimeStep, UNIT_SECOND, DESC_TIMESTEP, File_Input, DT_Single);
    mdi.AddParameter(VAR_K_CHB, UNIT_WTRDLT_MMH, DESC_K_CHB, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_K_BANK, UNIT_WTRDLT_MMH, DESC_K_BANK, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_EP_CH, UNIT_WTRDLT_MMH, DESC_EP_CH, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_BNK0, UNIT_STRG_M3M, DESC_BNK0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_CHS0, UNIT_STRG_M3M, DESC_CHS0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_VSEEP0, UNIT_FLOW_CMS, DESC_VSEEP0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_A_BNK, UNIT_NON_DIM, DESC_A_BNK, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_B_BNK, UNIT_NON_DIM, DESC_B_BNK, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_MSK_X, UNIT_NON_DIM, DESC_MSK_X, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_MSK_CO1, UNIT_NON_DIM, DESC_MSK_CO1, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_QUPREACH, UNIT_NON_DIM, DESC_QUPREACH, Source_ParameterDB, DT_Single);
    //mdi.AddParameter(VAR_MSF, UNIT_NON_DIM, DESC_MSF, Source_ParameterDB, DT_Single);

    mdi.AddParameter(Tag_RchParam, UNIT_NON_DIM, DESC_REACH_PARAM, Source_ParameterDB, DT_Array2D);
    //mdi.AddParameter(VAR_VDIV, UNIT_VOL_M3, DESC_VDIV, DT_Array1D);
    //mdi.AddParameter(VAR_VPOINT, UNIT_VOL_M3, DESC_VPOINT, "diversionloss.txt", DT_Array1D);
    mdi.AddParameter(VAR_SUBBSN, UNIT_NON_DIM, DESC_SUBBSN, Source_ParameterDB, DT_Raster1D);

    mdi.AddInput(VAR_SBOF, UNIT_FLOW_CMS, DESC_SBOF, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBIF, UNIT_FLOW_CMS, DESC_SBIF, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBQG, UNIT_FLOW_CMS, DESC_SBQG, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBPET, UNIT_DEPTH_MM, DESC_SBPET, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SBGS, UNIT_DEPTH_MM, DESC_SBGS, Source_Module, DT_Array1D);

    mdi.AddOutput(VAR_QRECH, UNIT_FLOW_CMS, DESC_QRECH, DT_Array1D);
	mdi.AddOutput(VAR_QOUTLET, UNIT_FLOW_CMS, DESC_QOUTLET, DT_Single);
	mdi.AddOutput(VAR_QS, UNIT_FLOW_CMS, DESC_QS, DT_Array1D);
    mdi.AddOutput(VAR_QSOUTLET, UNIT_FLOW_CMS, DESC_QSOUTLET, DT_Single);
    mdi.AddOutput(VAR_QI, UNIT_FLOW_CMS, DESC_QI, DT_Array1D);
    mdi.AddOutput(VAR_QG, UNIT_FLOW_CMS, DESC_QG, DT_Array1D);
    mdi.AddOutput(VAR_CHST, UNIT_VOL_M3, DESC_CHST, DT_Array1D);
    mdi.AddOutput(VAR_BKST, UNIT_VOL_M3, DESC_BKST, DT_Array1D);
    mdi.AddOutput(VAR_SEEPAGE, UNIT_VOL_M3, DESC_SEEPAGE, DT_Array1D);
    mdi.AddOutput(VAR_CHWTDEPTH, UNIT_LEN_M, DESC_CHWTDEPTH, DT_Array1D);
    //mdi.AddOutput(VAR_C_WABA, UNIT_NON_DIM, DESC_C_WABA, DT_Array2D);

    res = mdi.GetXMLDocument();

    char *tmp = new char[res.size() + 1];
    strprintf(tmp, res.size() + 1, "%s", res.c_str());
    return tmp;
}
Ejemplo n.º 26
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("Zhiqiang Yu");
	mdi.SetClass("erosion", "Calculate the amount of sediment yield.");
	mdi.SetDescription("use MUSLE method to calcualte sediment yield of each cell");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("MUSLE_AS");
	mdi.SetName("MUSLE_AS");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("MUSLE_AS.chm");

	//3 grid parameter
	mdi.AddParameter("CellWidth","m","the width (length) of cell","mask.asc",DT_Single);
	mdi.AddParameter("USLE_C","","the cover management factor","ParameterDB_Sediment",DT_Raster);
	mdi.AddParameter("USLE_P","","the erosion control practice factor ","ParameterDB_Sediment",DT_Raster);
	mdi.AddParameter("USLE_K","","the soil erodibility factor","ParameterDB_Sediment",DT_Raster);
	mdi.AddParameter("acc","","the number of flow accumulation cells of each cell","ParameterDB_Sediment",DT_Raster);
	mdi.AddParameter("slope","%","slope of the cell","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("subbasin","","subbasin grid","ParameterDB_Snow", DT_Raster);
	mdi.AddParameter("STREAM_LINK", "", "Stream link (id of reaches)", "ParameterDB_Discharge", DT_Raster);
	
	//input from other module	
	mdi.AddInput("D_SURU","mm","surface runoff","Module",DT_Raster);		//from depression module
	mdi.AddInput("D_SNAC","mm","snow accumulation","Module",DT_Raster);	//from snow water balance module

	// set the output variables
	mdi.AddOutput("SOER","metric tons", "distribution of soil erosion", DT_Raster);
	mdi.AddOutput("USLE_LS","USLE LS factor", "USLE LS factor", DT_Raster);

	mdi.AddOutput("SEDTOCH","metric tons", "sediment to channel", DT_Array1D);  // added by wu hui
	mdi.AddOutput("SEDTOCH_T","kg", "Total sediment flowing to channel", DT_Single); // added by wu hui
	// 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;
}
Ejemplo n.º 27
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("Chunping Ou");
	mdi.SetClass("Percolation", "Calculate the amount of water percolated out of the root zone within the time step.");
	mdi.SetDescription("The method relating percolation with soil moisture and pore size distribution index used in the original WetSpa will be the default method to estimate percolation out of the root zone.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetID("Percolation");
	mdi.SetName("Percolation");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("http://seims.github.io/SEIMS");
	mdi.SetHelpfile("Percolation.chm");

	//mdi.AddParameter("t_soil","oC","threshold soil freezing temperature","ParameterDB_WaterBalance", DT_Single);							//
	mdi.AddParameter("DT_HS", "second", "time step for storm simulation","ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("CellWidth", "m", "Cell size", "file.in", DT_Single); 

	mdi.AddParameter("Conductivity","mm/h","saturation hydraulic conductivity","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("Porosity","m3/m3","soil porosity","ParameterDB_WaterBalance",DT_Raster);
	//mdi.AddParameter("Residual","m3/m3","residual moisture content","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("Poreindex","-","pore size distribution index","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("FieldCap","m3/m3","Soil field capacity","ParameterDB_WaterBalance",DT_Raster);
	mdi.AddParameter("RootDepth", "mm", "Root depth","ParameterDB_WaterBalance", DT_Raster);

	//mdi.AddInput("D_SOTE","oC", "Soil Temperature","Module", DT_Raster);						//soil temperature
	mdi.AddInput("D_SOMO","mm","Distribution of soil moisture","Module",DT_Raster);			//from soil water balance module	0
	//mdi.AddInput("D_ES","mm","ES","Module",DT_Raster);											//from actual evapotranspiration module, the output id may not be correct.

	// set the output variables
	mdi.AddOutput("PERCOLATION","mm", "Distribution of groundwater recharge (percolation)", DT_Raster);

	// 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;
}
Ejemplo n.º 28
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("Junzhi Liu");
	mdi.SetClass("Surface runoff", "Calculate infiltration and excess precipitation using saturation excess mechanism.");
	mdi.SetDescription("saturation excess method to calculate infiltration and excess precipitation.");
	mdi.SetEmail("*****@*****.**");
	mdi.SetHelpfile("SUR_EXCESS.chm");
	mdi.SetID("SUR_EXCESS");
	mdi.SetName("SUR_EXCESS");
	mdi.SetVersion("0.1");
	mdi.SetWebsite("http://www.website.com");

	mdi.AddParameter("DT_HS", "second", "time step for storm simulation","ParameterDB_WaterBalance", DT_Single);
	mdi.AddParameter("Conductivity","mm/h","Soil hydraulic conductivity","ParameterDB_WaterBalance", DT_Raster); 
	mdi.AddParameter("Moist_in","%","Initial soil moisture","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("Porosity", "%", "Soil porosity","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("FieldCap", "%", "Field capacity","ParameterDB_WaterBalance", DT_Raster);
	mdi.AddParameter("RootDepth", "mm", "Root depth","ParameterDB_WaterBalance", DT_Raster);

	mdi.AddInput("D_NEPR","mm","The net precipitation","Module", DT_Raster);
	mdi.AddInput("D_DPST","mm","The depression storage","Module",DT_Raster);
	//mdi.AddInput("D_SOMO","%","Soil Moisture","Module", DT_Raster);

	mdi.AddOutput("SOMO", "%", "soil moisture", DT_Raster);
	mdi.AddOutput("EXCP", "mm","The excess precipitation", DT_Raster);
	mdi.AddOutput("INFIL","mm","Infiltration map of watershed", DT_Raster);
	mdi.AddOutput("INFILCAPSURPLUS","mm","surplus of infiltration capacity", DT_Raster);
	mdi.AddOutput("AccumuInfil","mm","accumulative infiltration", DT_Raster);

	res = mdi.GetXMLDocument();

	char* tmp = new char[res.size()+1];
	strprintf(tmp, res.size()+1, "%s", res.c_str());
	return tmp;
}
Ejemplo n.º 29
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("Zhiqiang Yu");
	mdi.SetClass("erosion", "Calculate the amount of sediment yield.");
	mdi.SetDescription("use MUSLE method to calcualte sediment yield of each cell");
	mdi.SetEmail("");
	mdi.SetID("MUSLE_I30");
	mdi.SetName("MUSLE_I30");
	mdi.SetVersion("0.5");
	mdi.SetWebsite("");
	mdi.SetHelpfile("MUSLE_I30.chm");

	mdi.AddParameter("cellwidth","m","the width (length) of cell","mask.asc",DT_Single);
	mdi.AddParameter("USLE_C","","the cover management factor","ParameterDB_Sediment",DT_MapWindowRaster);
	mdi.AddParameter("USLE_P","","the erosion control practice factor ","ParameterDB_Sediment",DT_MapWindowRaster);
	mdi.AddParameter("USLE_K","","the soil erodibility factor","ParameterDB_Sediment",DT_MapWindowRaster);
	mdi.AddParameter("flow_acc","","the number of flow accumulation cells of each cell","ParameterDB_Sediment",DT_MapWindowRaster);
	mdi.AddParameter("slope","%","slope of the cell","ParameterDB_WaterBalance",DT_MapWindowRaster);

	mdi.AddParameter("T0_s","hr","time of concentration","ParameterDB_Sediment",DT_MapWindowRaster);
	mdi.AddParameter("adj_pkr","","peak rate adjustment factor","ParameterDB_Sediment",DT_Single);
	mdi.AddParameter("rain_yrs","","number of yeares of data used to obtain values for RAINHHMX","ParameterDB_Sediment",DT_Single);

	mdi.AddParameter("p_stat","","static information of precipitation","HydroclimateDB",DT_Array2D);

	//input from other module	
	mdi.AddInput("D_SURU","mm","surface runoff","Module",DT_MapWindowRaster);		//from depression module
	mdi.AddInput("D_SNAC","mm","snow accumulation","Module",DT_MapWindowRaster);	//from snow water balance module
	mdi.AddInput("D_P","mm","precipitation","Module",DT_MapWindowRaster);			//from interpolation module
	mdi.AddInput("D_SNME","mm","snow melt","Module",DT_MapWindowRaster);			//from snow melt module

	// set the output variables
	mdi.AddOutput("SOER","metric tons", "distribution of soil erosion", DT_MapWindowRaster);

	// 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;
}
Ejemplo n.º 30
0
extern "C" SEIMS_MODULE_API const char* MetadataInformation() {
    MetadataInfo mdi;
    mdi.SetAuthor("Huiran Gao, Liangjun Zhu");
    mdi.SetClass(MCLS_NutCHRout, MCLSDESC_NutCHRout);
    mdi.SetDescription(MDESC_NUTRCH_QUAL2E);
    mdi.SetEmail(SEIMS_EMAIL);
    mdi.SetID(MDESC_NUTRCH_QUAL2E);
    mdi.SetName(MDESC_NUTRCH_QUAL2E);
    mdi.SetVersion("1.2");
    mdi.SetWebsite(SEIMS_SITE);
    mdi.SetHelpfile("");

    // set the parameters
    mdi.AddParameter(Tag_SubbasinId, UNIT_NON_DIM, Tag_SubbasinId, Source_ParameterDB, DT_Single);
    mdi.AddParameter(Tag_ChannelTimeStep, UNIT_SECOND, DESC_TIMESTEP, File_Input, DT_Single);
    mdi.AddParameter(VAR_RNUM1, UNIT_NON_DIM, DESC_RNUM1, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_IGROPT, UNIT_NON_DIM, DESC_IGROPT, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI0, UNIT_NUTR_RATIO, DESC_AI0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI1, UNIT_NUTR_RATIO, DESC_AI1, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI2, UNIT_NUTR_RATIO, DESC_AI2, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI3, UNIT_NUTR_RATIO, DESC_AI3, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI4, UNIT_NUTR_RATIO, DESC_AI4, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI5, UNIT_NUTR_RATIO, DESC_AI5, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_AI6, UNIT_NUTR_RATIO, DESC_AI6, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_LAMBDA0, UNIT_NON_DIM, DESC_LAMBDA0, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_LAMBDA1, UNIT_NON_DIM, DESC_LAMBDA1, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_LAMBDA2, UNIT_NON_DIM, DESC_LAMBDA2, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_K_L, UNIT_SR, DESC_K_L, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_K_N, UNIT_CONCENTRATION, DESC_K_N, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_K_P, UNIT_CONCENTRATION, DESC_K_P, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_P_N, UNIT_CONCENTRATION, DESC_P_N, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_TFACT, UNIT_NON_DIM, DESC_TFACT, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_MUMAX, UNIT_PER_DAY, DESC_MUMAX, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_RHOQ, UNIT_PER_DAY, DESC_RHOQ, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_COD_N, UNIT_NON_DIM, DESC_COD_N, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_COD_K, UNIT_NON_DIM, DESC_COD_K, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_STREAM_LINK, UNIT_NON_DIM, DESC_STREAM_LINK, Source_ParameterDB, DT_Raster1D);
    mdi.AddParameter(VAR_CH_ONCO, UNIT_CONCENTRATION, DESC_CH_ONCO, Source_ParameterDB, DT_Single);
    mdi.AddParameter(VAR_CH_OPCO, UNIT_CONCENTRATION, DESC_CH_OPCO, Source_ParameterDB, DT_Single);
    // add reach information
    mdi.AddParameter(VAR_REACH_PARAM, UNIT_NON_DIM, DESC_REACH_PARAM, Source_ParameterDB, DT_Reach);
    // add BMPs management operations, such as point source discharge
    mdi.AddParameter(VAR_SCENARIO, UNIT_NON_DIM, DESC_SCENARIO, Source_ParameterDB, DT_Scenario);

    // set the input variables
    mdi.AddInput(DataType_SolarRadiation, UNIT_SR, DESC_SR, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_DAYLEN, UNIT_HOUR, DESC_DAYLEN, Source_Module, DT_Raster1D);
    mdi.AddInput(VAR_SOTE, UNIT_TEMP_DEG, DESC_SOTE, Source_Module, DT_Raster1D);

    mdi.AddInput(VAR_QRECH, UNIT_FLOW_CMS, DESC_QRECH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_CHST, UNIT_VOL_M3, DESC_CHST, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_RTE_WTRIN, UNIT_VOL_M3, DESC_RTE_WTRIN, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_RTE_WTROUT, UNIT_VOL_M3, DESC_RTE_WTROUT, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_CHWTRDEPTH, UNIT_LEN_M, DESC_CHWTDEPTH, Source_Module, DT_Array1D);
    /// input from hillslope
    //nutrient from surface water
    mdi.AddInput(VAR_SUR_NO3_TOCH, UNIT_KG, DESC_SUR_NO3_ToCH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SUR_NH4_TOCH, UNIT_KG, DESC_SUR_NH4_ToCH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SUR_SOLP_TOCH, UNIT_KG, DESC_SUR_SOLP_ToCH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SUR_COD_TOCH, UNIT_KG, DESC_SUR_COD_ToCH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SEDORGN_TOCH, UNIT_KG, DESC_SEDORGN_CH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SEDORGP_TOCH, UNIT_KG, DESC_SEDORGP_CH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SEDMINPA_TOCH, UNIT_KG, DESC_SEDMINPA_CH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_SEDMINPS_TOCH, UNIT_KG, DESC_SEDMINPS_CH, Source_Module, DT_Array1D);
    //nutrient from interflow
    mdi.AddInput(VAR_LATNO3_TOCH, UNIT_KG, DESC_LATNO3_CH, Source_Module, DT_Array1D);
    //nutrient from ground water
    mdi.AddInput(VAR_NO3GW_TOCH, UNIT_KG, DESC_NO3GW_CH, Source_Module, DT_Array1D);
    mdi.AddInput(VAR_MINPGW_TOCH, UNIT_KG, DESC_MINPGW_CH, Source_Module, DT_Array1D);
    // channel erosion
    mdi.AddInput(VAR_RCH_DEG, UNIT_KG, DESC_RCH_DEG, Source_Module_Optional, DT_Array1D);
    // set the output variables
    /// 1. Amount (kg) outputs
    mdi.AddInOutput(VAR_CH_ALGAE, UNIT_KG, DESC_CH_ALGAE, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_ORGN, UNIT_KG, DESC_CH_ORGN, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_ORGP, UNIT_KG, DESC_CH_ORGP, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_NH4, UNIT_KG, DESC_CH_NH4, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_NO2, UNIT_KG, DESC_CH_NO2, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_NO3, UNIT_KG, DESC_CH_NO3, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_SOLP, UNIT_KG, DESC_CH_SOLP, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_COD, UNIT_KG, DESC_CH_COD, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_CHLORA, UNIT_KG, DESC_CH_CHLORA, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_DOX, UNIT_KG, DESC_CH_DOX, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_TN, UNIT_KG, DESC_CH_TN, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_TP, UNIT_KG, DESC_CH_TP, DT_Array1D, TF_SingleValue);
    /// 2. Concentration (mg/L) outputs
    mdi.AddInOutput(VAR_CH_ALGAEConc, UNIT_CONCENTRATION, DESC_CH_ALGAE, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_ORGNConc, UNIT_CONCENTRATION, DESC_CH_ORGN, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_ORGPConc, UNIT_CONCENTRATION, DESC_CH_ORGP, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_NH4Conc, UNIT_CONCENTRATION, DESC_CH_NH4, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_NO2Conc, UNIT_CONCENTRATION, DESC_CH_NO2, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_NO3Conc, UNIT_CONCENTRATION, DESC_CH_NO3, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_SOLPConc, UNIT_CONCENTRATION, DESC_CH_SOLP, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_CODConc, UNIT_CONCENTRATION, DESC_CH_COD, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_CHLORAConc, UNIT_CONCENTRATION, DESC_CH_CHLORA, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_DOXConc, UNIT_CONCENTRATION, DESC_CH_DOX, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_TNConc, UNIT_CONCENTRATION, DESC_CH_TNConc, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CH_TPConc, UNIT_CONCENTRATION, DESC_CH_TPConc, DT_Array1D, TF_SingleValue);
    // 3. point source loadings
    mdi.AddOutput(VAR_PTTN2CH, UNIT_KG, DESC_PTTN2CH, DT_Array1D);
    mdi.AddOutput(VAR_PTTP2CH, UNIT_KG, DESC_PTTP2CH, DT_Array1D);
    mdi.AddOutput(VAR_PTCOD2CH, UNIT_KG, DESC_PTCOD2CH, DT_Array1D);
    // 4. nutrient stored in reaches
    mdi.AddInOutput(VAR_CHSTR_NH4, UNIT_KG, DESC_CHSTR_NH4, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CHSTR_NO3, UNIT_KG, DESC_CHSTR_NO3, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CHSTR_TN, UNIT_KG, DESC_CHSTR_TN, DT_Array1D, TF_SingleValue);
    mdi.AddInOutput(VAR_CHSTR_TP, UNIT_KG, DESC_CHSTR_TP, DT_Array1D, TF_SingleValue);

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