• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ report_writeErrorMsg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中report_writeErrorMsg函数的典型用法代码示例。如果您正苦于以下问题:C++ report_writeErrorMsg函数的具体用法?C++ report_writeErrorMsg怎么用?C++ report_writeErrorMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了report_writeErrorMsg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: divider_validate

void  divider_validate(int j)
//
//  Input:   j = node index
//  Output:  none
//  Purpose: validates a flow divider's properties.
//
{
    int i, k;

    // --- check that diverted link is attached to divider
    k = Node[j].subIndex;
    i = Divider[k].link;
    if ( i < 0 || ( Link[i].node1 != j && Link[i].node2 != j) )
    {
        report_writeErrorMsg(ERR_DIVIDER_LINK, Node[j].ID);
    }

    // --- validate parameters supplied for weir-type divider
    if ( Divider[k].type == WEIR_DIVIDER )
    {
        if ( Divider[k].dhMax <= 0.0 || Divider[k].cWeir <= 0.0 )
            report_writeErrorMsg(ERR_WEIR_DIVIDER, Node[j].ID);
        else
        {
            // --- find flow when weir is full
            Divider[k].qMax = Divider[k].cWeir * pow(Divider[k].dhMax, 1.5)
                              / UCF(FLOW);
            if ( Divider[k].qMin > Divider[k].qMax )
                report_writeErrorMsg(ERR_WEIR_DIVIDER, Node[j].ID);
        }
    }
}
开发者ID:lothar-mar,项目名称:swmm5,代码行数:32,代码来源:node.c


示例2: gwater_validateAquifer

void  gwater_validateAquifer(Project* project, int j)
//
//  Input:   j = aquifer index
//  Output:  none
//  Purpose: validates groundwater aquifer properties .
//
{
	int p;

    if ( project->Aquifer[j].porosity          <= 0.0 
    ||   project->Aquifer[j].fieldCapacity     >= project->Aquifer[j].porosity
    ||   project->Aquifer[j].wiltingPoint      >= project->Aquifer[j].fieldCapacity
    ||   project->Aquifer[j].conductivity      <= 0.0
    ||   project->Aquifer[j].conductSlope      <  0.0
    ||   project->Aquifer[j].tensionSlope      <  0.0
    ||   project->Aquifer[j].upperEvapFrac     <  0.0
    ||   project->Aquifer[j].lowerEvapDepth    <  0.0
    ||   project->Aquifer[j].waterTableElev    <  project->Aquifer[j].bottomElev
    ||   project->Aquifer[j].upperMoisture     >  project->Aquifer[j].porosity 
    ||   project->Aquifer[j].upperMoisture     <  project->Aquifer[j].wiltingPoint )
        report_writeErrorMsg(project,ERR_AQUIFER_PARAMS, project->Aquifer[j].ID);

    p = project->Aquifer[j].upperEvapPat;
    if ( p >= 0 && project->Pattern[p].type != MONTHLY_PATTERN )
    {
        report_writeErrorMsg(project,ERR_AQUIFER_PARAMS, project->Aquifer[j].ID);
    }
}
开发者ID:HydroCouple,项目名称:FVHMComponent,代码行数:28,代码来源:gwater.c


示例3: readTD3200FileLine

void readTD3200FileLine(int* y, int* m)
//
//  Input:   none
//  Output:  y = year
//           m = month
//  Purpose: reads year & month from line of TD-3200 climate file.
//
{
    char recdType[4] = "";
    char year[5] = "";
    char month[3] = "";
    int  len;

    // --- check for minimum number of characters
    len = (int)strlen(FileLine);
    if ( len < 30 )
    {
        report_writeErrorMsg(ERR_CLIMATE_FILE_READ, Fclimate.name);
        return;
    }

    // --- check for proper type of record
    sstrncpy(recdType, FileLine, 3);
    if ( strcmp(recdType, "DLY") != 0 )
    {
        report_writeErrorMsg(ERR_CLIMATE_FILE_READ, Fclimate.name);
        return;
    }

    // --- get record's date 
    sstrncpy(year,  &FileLine[17], 4);
    sstrncpy(month, &FileLine[21], 2);
    *y = atoi(year);
    *m = atoi(month);
}
开发者ID:obergshavefun,项目名称:icap,代码行数:35,代码来源:climate.c


示例4: validateGeneralLayout

void validateGeneralLayout(Project* project)
//
//  Input:   none
//  Output:  nonw
//  Purpose: validates general conveyance system layout.
//
{
    int i, j;
    int outletCount = 0;

    // --- use node inflow attribute to count inflow connections
    for ( i=0; i<project->Nobjects[NODE]; i++ ) project->Node[i].inflow = 0.0;

    // --- examine each link
    for ( j = 0; j < project->Nobjects[LINK]; j++ )
    {
        // --- update inflow link count of downstream node
        i = project->Link[j].node1;
        if ( project->Node[i].type != OUTFALL ) i = project->Link[j].node2;
        project->Node[i].inflow += 1.0;

        // --- if link is dummy link or ideal pump then it must
        //     be the only link exiting the upstream node 
        if ( (project->Link[j].type == CONDUIT && project->Link[j].xsect.type == DUMMY) ||
             (project->Link[j].type == PUMP &&
              project->Pump[project->Link[j].subIndex].type == IDEAL_PUMP) )
        {
            i = project->Link[j].node1;
            if ( project->Link[j].direction < 0 ) i = project->Link[j].node2;
            if ( project->Node[i].degree > 1 )
            {
                report_writeErrorMsg(project,ERR_DUMMY_LINK, project->Node[i].ID);
            }
        }
    }

    // --- check each node to see if it qualifies as an outlet node
    //     (meaning that degree = 0)
    for ( i = 0; i < project->Nobjects[NODE]; i++ )
    {
        // --- if node is of type Outfall, check that it has only 1
        //     connecting link (which can either be an outflow or inflow link)
        if ( project->Node[i].type == OUTFALL )
        {
            if ( project->Node[i].degree + (int)project->Node[i].inflow > 1 )
            {
                report_writeErrorMsg(project,ERR_OUTFALL, project->Node[i].ID);
            }
            else outletCount++;
        }
    }
    if ( outletCount == 0 ) report_writeErrorMsg(project,ERR_NO_OUTLETS, "");

    // --- reset node inflows back to zero
    for ( i = 0; i < project->Nobjects[NODE]; i++ )
    {
        if ( project->Node[i].inflow == 0.0 ) project->Node[i].degree = -project->Node[i].degree;
        project->Node[i].inflow = 0.0;
    }
}
开发者ID:HydroCouple,项目名称:FVHMComponent,代码行数:60,代码来源:flowrout.c


示例5: project_readInput

void project_readInput()
//
//  Input:   none
//  Output:  none
//  Purpose: retrieves project data from input file.
//
{
    // --- create hash tables for fast retrieval of objects by ID names
    createHashTables();

    // --- count number of objects in input file and create them
    input_countObjects();
    createObjects();

    // --- read project data from input file
    input_readData();
    if ( ErrorCode ) return;

    // --- establish starting & ending date/time
    StartDateTime = StartDate + StartTime;
    EndDateTime   = EndDate + EndTime;
    ReportStart   = ReportStartDate + ReportStartTime;
    ReportStart   = MAX(ReportStart, StartDateTime);

    // --- check for valid starting & ending date/times
    if ( EndDateTime <= StartDateTime )
    {
        report_writeErrorMsg(ERR_START_DATE, "");
    }
    else if ( EndDateTime <= ReportStart )
    {
        report_writeErrorMsg(ERR_REPORT_DATE, "");
    }
    else
    {
////  Following code segment was modified for release 5.1.009.  ////           //(5.1.009)
////
        // --- compute total duration of simulation in seconds
        TotalDuration = floor((EndDateTime - StartDateTime) * SECperDAY);

        // --- reporting step must be <= total duration
        if ( (double)ReportStep > TotalDuration )
        {
            ReportStep = (int)(TotalDuration);
        }

        // --- reporting step can't be < routing step
        if ( (double)ReportStep < RouteStep )
        {
            report_writeErrorMsg(ERR_REPORT_STEP, "");
        }

        // --- convert total duration to milliseconds
        TotalDuration *= 1000.0;
    }
////
}
开发者ID:BradenRosenberg-Cadmus,项目名称:Stormwater-Management-Model,代码行数:57,代码来源:project.c


示例6: validateRdii

void validateRdii()
//
//  Input:   none
//  Output:  none
//  Purpose: validates UH and RDII inflow object data.
//
{
    int   i,                           // node index
          j,                           // UH group index
          k,                           // individual UH index
          m;                           // month index
    float rsum;                        // sum of UH r-values

    // --- check each unit hydrograph for consistency
    for (j=0; j<Nobjects[UNITHYD]; j++)
    {
        for (m=0; m<12; m++)
        {
            rsum = 0.0;
            for (k=0; k<3; k++)
            {
                // --- if no base time then UH doesn't exist
                if ( UnitHyd[j].tBase[m][k] == 0 ) continue;

                // --- can't have negative UH parameters
                if ( UnitHyd[j].tPeak[m][k] < 0.0 ) 
                {
                    report_writeErrorMsg(ERR_UNITHYD_TIMES, UnitHyd[j].ID);
                }

                // --- can't have negative UH response ratio
                if ( UnitHyd[j].r[m][k] < 0.0 )
                {
                    report_writeErrorMsg(ERR_UNITHYD_RATIOS, UnitHyd[j].ID);
                }
                else rsum += UnitHyd[j].r[m][k];
            }
            if ( rsum > 1.01 )
            {
                report_writeErrorMsg(ERR_UNITHYD_RATIOS, UnitHyd[j].ID);
            }
        }
    }

    // --- check each node's RDII inflow object
    for (i=0; i<Nobjects[NODE]; i++)
    {
        if ( Node[i].rdiiInflow )
        {
            // --- check that sewer area is non-negative
            if ( Node[i].rdiiInflow->area < 0.0 )
            {
                report_writeErrorMsg(ERR_RDII_AREA, Node[i].ID);
            }
        }
    }
}
开发者ID:Geosyntec,项目名称:SUSTAIN,代码行数:57,代码来源:rdii.cpp


示例7: gage_validate

void  gage_validate(int j)
//
//  Input:   j = rain gage index
//  Output:  none
//  Purpose: checks for valid rain gage parameters
//
//  NOTE: assumes that any time series used by a rain gage has been
//        previously validated.
//
{
    int i, k;
    int gageInterval;

    // --- for gage with time series data:
    if ( Gage[j].dataSource == RAIN_TSERIES )
    {
        // --- check gage's recording interval against that of time series
        k = Gage[j].tSeries;
        if ( Tseries[k].refersTo >= 0 )
        {
            report_writeErrorMsg(ERR_RAIN_GAGE_TSERIES, Gage[j].ID);
        }
        gageInterval = (int)(floor(Tseries[k].dxMin*SECperDAY + 0.5));
        if ( gageInterval > 0 && Gage[j].rainInterval > gageInterval )
        {
            report_writeErrorMsg(ERR_RAIN_GAGE_INTERVAL, Gage[j].ID);
        } 
        if ( Gage[j].rainInterval < gageInterval )
        {
            report_writeWarningMsg(WARN09, Gage[j].ID);
        }
        if ( Gage[j].rainInterval < WetStep )
        {
            report_writeWarningMsg(WARN01, Gage[j].ID);
            WetStep = Gage[j].rainInterval;
        }

        // --- see if gage uses same time series as another gage
        for (i=0; i<j; i++)
        {
            if ( Gage[i].dataSource == RAIN_TSERIES && Gage[i].tSeries == k )
            {
                Gage[j].coGage = i;

                // --- check that both gages record same type of data
                if ( Gage[j].rainType != Gage[i].rainType )
                {
                    report_writeErrorMsg(ERR_RAIN_GAGE_FORMAT, Gage[j].ID);
                }
                return;
            }
        }
    }
}
开发者ID:Giswater,项目名称:giswater_models,代码行数:54,代码来源:gage.c


示例8: runoff_initFile

void runoff_initFile(void)
//
//  Input:   none
//  Output:  none
//  Purpose: initializes a Runoff Interface file for saving results.
//
{
    int   nSubcatch;
    int   nPollut;
    int   flowUnits;
    char  fileStamp[] = "SWMM5-RUNOFF";
    char  fStamp[] = "SWMM5-RUNOFF";

    MaxSteps = 0;
    if ( Frunoff.mode == SAVE_FILE )
    {
        // --- write file stamp, # subcatchments & # pollutants to file
        nSubcatch = Nobjects[SUBCATCH];
        nPollut = Nobjects[POLLUT];
        flowUnits = FlowUnits;
        fwrite(fileStamp, sizeof(char), strlen(fileStamp), Frunoff.file);
        fwrite(&nSubcatch, sizeof(int), 1, Frunoff.file);
        fwrite(&nPollut, sizeof(int), 1, Frunoff.file);
        fwrite(&flowUnits, sizeof(int), 1, Frunoff.file);
        MaxStepsPos = ftell(Frunoff.file); 
        fwrite(&MaxSteps, sizeof(int), 1, Frunoff.file);
    }

    if ( Frunoff.mode == USE_FILE )
    {
        // --- check that interface file contains proper header records
        fread(fStamp, sizeof(char), strlen(fileStamp), Frunoff.file);
        if ( strcmp(fStamp, fileStamp) != 0 )
        {
            report_writeErrorMsg(ERR_RUNOFF_FILE_FORMAT, "");
            return;
        }
        nSubcatch = -1;
        nPollut = -1;
        flowUnits = -1;
        fread(&nSubcatch, sizeof(int), 1, Frunoff.file);
        fread(&nPollut, sizeof(int), 1, Frunoff.file);
        fread(&flowUnits, sizeof(int), 1, Frunoff.file);
        fread(&MaxSteps, sizeof(int), 1, Frunoff.file);
        if ( nSubcatch != Nobjects[SUBCATCH]
        ||   nPollut   != Nobjects[POLLUT]
        ||   flowUnits != FlowUnits
        ||   MaxSteps  <= 0 )
        {
             report_writeErrorMsg(ERR_RUNOFF_FILE_FORMAT, "");
        }
    }
}
开发者ID:Giswater,项目名称:giswater_models,代码行数:53,代码来源:runoff.c


示例9: openHotstartFile1

int openHotstartFile1()
//
//  Input:   none
//  Output:  none
//  Purpose: opens a previously saved hotstart file.
//
{
    int   nNodes;
    int   nLinks;
    int   nPollut;
    int   flowUnits;
    char  fileStamp[] = "SWMM5-HOTSTART";
    char  fStamp[] = "SWMM5-HOTSTART";

    // --- try to open the file
    if ( Fhotstart1.mode != USE_FILE ) return TRUE;
    if ( (Fhotstart1.file = fopen(Fhotstart1.name, "r+b")) == NULL)
    {
        report_writeErrorMsg(ERR_HOTSTART_FILE_OPEN, Fhotstart1.name);
        return FALSE;
    }

    // --- check that file contains proper header records
    fread(fStamp, sizeof(char), strlen(fileStamp), Fhotstart1.file);
    if ( strcmp(fStamp, fileStamp) != 0 )
    {
        report_writeErrorMsg(ERR_HOTSTART_FILE_FORMAT, "");
        return FALSE;
    }
    nNodes = -1;
    nLinks = -1;
    nPollut = -1;
    flowUnits = -1;
    fread(&nNodes, sizeof(int), 1, Fhotstart1.file);
    fread(&nLinks, sizeof(int), 1, Fhotstart1.file);
    fread(&nPollut, sizeof(int), 1, Fhotstart1.file);
    fread(&flowUnits, sizeof(int), 1, Fhotstart1.file);
    if ( nNodes != Nobjects[NODE]
    ||   nLinks != Nobjects[LINK]
    ||   nPollut   != Nobjects[POLLUT]
    ||   flowUnits != FlowUnits )
    {
         report_writeErrorMsg(ERR_HOTSTART_FILE_FORMAT, "");
         return FALSE;
    }

    // --- read contents of the file and close it
    readHotstartFile();
    fclose(Fhotstart1.file);
    if ( ErrorCode ) return FALSE;
    else return TRUE;
}
开发者ID:obergshavefun,项目名称:icap,代码行数:52,代码来源:routing.c


示例10: project_readInput

void project_readInput()
//
//  Input:   none
//  Output:  none
//  Purpose: retrieves project data from input file.
//
{
    // --- create hash tables for fast retrieval of objects by ID names
    createHashTables();

    // --- count number of objects in input file and create them
    input_countObjects();
    createObjects();

    // --- read project data from input file
    input_readData();
    if ( ErrorCode ) return;

    // --- establish starting & ending date/time
    StartDateTime = StartDate + StartTime;
    EndDateTime   = EndDate + EndTime;
    ReportStart   = ReportStartDate + ReportStartTime;
    ReportStart   = MAX(ReportStart, StartDateTime);

    // --- check for valid starting & ending date/times
    if ( EndDateTime <= StartDateTime )
    {
        report_writeErrorMsg(ERR_START_DATE, "");
    }
    else if ( EndDateTime <= ReportStart )
    {
        report_writeErrorMsg(ERR_REPORT_DATE, "");
    }
    else
    {
        // --- compute total duration of simulation in milliseconds
        //     (add on 1 msec to account for any roundoff)
        TotalDuration = (EndDateTime - StartDateTime) * MSECperDAY;
        TotalDuration += 1.0;

        // --- reporting step must be <= total duration
        if ( (double)ReportStep > TotalDuration/1000.0 )
        {
            ReportStep = (int)(TotalDuration/1000.0);
        }
        if ( (float)ReportStep < RouteStep )
        {
            report_writeErrorMsg(ERR_REPORT_STEP, "");
        }
    }
}
开发者ID:Kevin-M-Smith,项目名称:swmm5-python,代码行数:51,代码来源:project.c


示例11: runoff_open

int runoff_open()
//
//  Input:   none
//  Output:  returns the global error code
//  Purpose: opens the runoff analyzer.
//
{
    IsRaining = FALSE;
    HasRunoff = FALSE;
    HasSnow = FALSE;
    Nsteps = 0;

    // --- open the Ordinary Differential Equation solver
    //     to solve up to 3 ode's.
    if ( !odesolve_open(3) ) report_writeErrorMsg(ERR_ODE_SOLVER, "");

    // --- allocate memory for pollutant washoff loads
    WashoffQual = NULL;
    WashoffLoad = NULL;
    if ( Nobjects[POLLUT] > 0 )
    {
        WashoffQual = (double *) calloc(Nobjects[POLLUT], sizeof(double));
        if ( !WashoffQual ) report_writeErrorMsg(ERR_MEMORY, "");
        WashoffLoad = (double *) calloc(Nobjects[POLLUT], sizeof(double));
        if ( !WashoffLoad ) report_writeErrorMsg(ERR_MEMORY, "");
    }

    // --- see if a runoff interface file should be opened
    switch ( Frunoff.mode )
    {
      case USE_FILE:
        if ( (Frunoff.file = fopen(Frunoff.name, "r+b")) == NULL)
            report_writeErrorMsg(ERR_RUNOFF_FILE_OPEN, Frunoff.name);
        else runoff_initFile();
        break;
      case SAVE_FILE:
        if ( (Frunoff.file = fopen(Frunoff.name, "w+b")) == NULL)
            report_writeErrorMsg(ERR_RUNOFF_FILE_OPEN, Frunoff.name);
        else runoff_initFile();
        break;
    }

    // --- see if a climate file should be opened
    if ( Frunoff.mode != USE_FILE && Fclimate.mode == USE_FILE )
    {
        climate_openFile();
    }
    return ErrorCode;
}
开发者ID:christianurich,项目名称:DynaMind-GDALModules,代码行数:49,代码来源:runoff.c


示例12: climate_validate

void climate_validate()
//
//  Input:   none
//  Output:  none
//  Purpose: validates climatological variables
//
{
    int       i;                                                               //(5.1.007)
    double    a, z, pa;

    // --- check if climate data comes from external data file                 //(5.1.007)
    if ( Wind.type == FILE_WIND || Evap.type == FILE_EVAP ||
         Evap.type == TEMPERATURE_EVAP )
    {
        if ( Fclimate.mode == NO_FILE )
        {
            report_writeErrorMsg(ERR_NO_CLIMATE_FILE, "");
        }
    }

    // --- open the climate data file                                          //(5.1.007)
    if ( Fclimate.mode == USE_FILE ) climate_openFile();                       //(5.1.007)

    // --- snow melt parameters tipm & rnm must be fractions
    if ( Snow.tipm < 0.0 ||
         Snow.tipm > 1.0 ||
         Snow.rnm  < 0.0 ||
         Snow.rnm  > 1.0 ) report_writeErrorMsg(ERR_SNOWMELT_PARAMS, "");

    // --- latitude should be between -90 & 90 degrees
    a = Temp.anglat;
    if ( a <= -89.99 ||
         a >= 89.99  ) report_writeErrorMsg(ERR_SNOWMELT_PARAMS, "");
    else Temp.tanAnglat = tan(a * PI / 180.0);

    // --- compute psychrometric constant
    z = Temp.elev / 1000.0;
    if ( z <= 0.0 ) pa = 29.9;
    else  pa = 29.9 - 1.02*z + 0.0032*pow(z, 2.4); // atmos. pressure
    Temp.gamma = 0.000359 * pa;

    // --- convert units of monthly temperature & evap adjustments             //(5.1.007)
    for (i = 0; i < 12; i++)
    {
        if (UnitSystem == SI) Adjust.temp[i] *= 9.0/5.0;
        Adjust.evap[i] /= UCF(EVAPRATE);
    }
}
开发者ID:asselapathirana,项目名称:swmm5-python,代码行数:48,代码来源:climate.c


示例13: node_validate

void  node_validate(int j)
//
//  Input:   j = node index
//  Output:  none
//  Purpose: validates a node's properties.
//
{
    TDwfInflow* inflow;

    // --- see if full depth was increased to accommodate conduit crown
    if ( Node[j].fullDepth > Node[j].oldDepth && Node[j].oldDepth > 0.0 )
    {
        report_writeWarningMsg(WARN02, Node[j].ID);
    }

    // --- check that initial depth does not exceed max. depth
    if ( Node[j].initDepth > Node[j].fullDepth + Node[j].surDepth )
        report_writeErrorMsg(ERR_NODE_DEPTH, Node[j].ID);

    if ( Node[j].type == DIVIDER ) divider_validate(j);

    // --- initialize dry weather inflows
    inflow = Node[j].dwfInflow;
    while (inflow)
    {
        inflow_initDwfInflow(inflow);
        inflow = inflow->next;
    }
}
开发者ID:lothar-mar,项目名称:swmm5,代码行数:29,代码来源:node.c


示例14: routing_open

int routing_open()
//
//  Input:   none
//  Output:  returns an error code
//  Purpose: initializes the routing analyzer.
//
{
    // --- open treatment system
    if ( !treatmnt_open() ) return ErrorCode;

    // --- topologically sort the links
    SortedLinks = NULL;
    if ( Nobjects[LINK] > 0 )
    {
        SortedLinks = (int *) calloc(Nobjects[LINK], sizeof(int));
        if ( !SortedLinks )
        {
            report_writeErrorMsg(ERR_MEMORY, "");
            return ErrorCode;
        }
        toposort_sortLinks(SortedLinks);
        if ( ErrorCode ) return ErrorCode;
    }

    // --- open any routing interface files
    iface_openRoutingFiles();
    return ErrorCode;
}
开发者ID:ezhangle,项目名称:swmm,代码行数:28,代码来源:routing.c


示例15: iface_openRoutingFiles

void iface_openRoutingFiles()
//
//  Input:   none
//  Output:  none
//  Purpose: opens routing interface files.
//
{
    // --- initialize shared variables
    NumIfacePolluts = 0;
    IfacePolluts = NULL;
    NumIfaceNodes = 0;
    IfaceNodes = NULL;
    OldIfaceValues = NULL;
    NewIfaceValues = NULL;

    // --- check that inflows & outflows files are not the same
    if ( Foutflows.mode != NO_FILE && Finflows.mode != NO_FILE )
    {
        if ( strcomp(Foutflows.name, Finflows.name) )
        {
            report_writeErrorMsg(ERR_ROUTING_FILE_NAMES, "");
            return;
        }
    }

    // --- open the file for reading or writing
    if ( Foutflows.mode == SAVE_FILE ) openFileForOutput();
    if ( Finflows.mode == USE_FILE ) openFileForInput();
}
开发者ID:christianurich,项目名称:DynaMind-GDALModules,代码行数:29,代码来源:iface.c


示例16: openHotstartFile2

int openHotstartFile2()
//
//  Input:   none
//  Output:  none
//  Purpose: opens a new hotstart file to save results to.
//
{
    int   nNodes;
    int   nLinks;
    int   nPollut;
    int   flowUnits;
    char  fileStamp[] = "SWMM5-HOTSTART";

    // --- try to open file
    if ( Fhotstart2.mode != SAVE_FILE ) return TRUE;
    if ( (Fhotstart2.file = fopen(Fhotstart2.name, "w+b")) == NULL)
    {
        report_writeErrorMsg(ERR_HOTSTART_FILE_OPEN, Fhotstart2.name);
        return FALSE;
    }

    // --- write file stamp, # nodes, # links, & # pollutants to file
    nNodes = Nobjects[NODE];
    nLinks = Nobjects[LINK];
    nPollut = Nobjects[POLLUT];
    flowUnits = FlowUnits;
    fwrite(fileStamp, sizeof(char), strlen(fileStamp), Fhotstart2.file);
    fwrite(&nNodes, sizeof(int), 1, Fhotstart2.file);
    fwrite(&nLinks, sizeof(int), 1, Fhotstart2.file);
    fwrite(&nPollut, sizeof(int), 1, Fhotstart2.file);
    fwrite(&flowUnits, sizeof(int), 1, Fhotstart2.file);
    return TRUE;
}
开发者ID:obergshavefun,项目名称:icap,代码行数:33,代码来源:routing.c


示例17: snow_validateSnowmelt

void snow_validateSnowmelt(Project* project, int j)
//
//  Input:   j = snowmelt parameter set index
//  Output:  none
//  Purpose: checks for valid values in a snow melt parameter set.
//
{
    int    k;
    char   err = FALSE;
    double sum = 0.0;

    for ( k = SNOW_PLOWABLE; k <= SNOW_PERV; k++ )
    {
        // --- check melt coeffs.
        if ( project->Snowmelt[j].dhmin[k] > project->Snowmelt[j].dhmax[k] ) err = TRUE; 

        // --- check free water fraction
        if ( project->Snowmelt[j].fwfrac[k] < 0.0 ||
             project->Snowmelt[j].fwfrac[k] > 1.0) err = TRUE;
    }

    // --- check fraction of imperv. area plowable
    if ( project->Snowmelt[j].snn < 0.0 || project->Snowmelt[j].snn > 1.0 ) err = TRUE;

    // --- check that removal fractions sum <= 1.0
    for ( k=0; k<5; k++ ) sum += project->Snowmelt[j].sfrac[k];
    if ( sum > 1.01 ) err = TRUE;
	if (err) report_writeErrorMsg(project, ERR_SNOWPACK_PARAMS, project->Snowmelt[j].ID);
}
开发者ID:HydroCouple,项目名称:FVHMComponent,代码行数:29,代码来源:snow.c


示例18: routing_open

int routing_open()
//
//  Input:   none
//  Output:  returns an error code
//  Purpose: initializes the routing analyzer.
//
{
    // --- open treatment system
    if ( !treatmnt_open() ) return ErrorCode;

    // --- topologically sort the links
    SortedLinks = NULL;
    if ( Nobjects[LINK] > 0 )
    {
        SortedLinks = (int *) calloc(Nobjects[LINK], sizeof(int));
        if ( !SortedLinks )
        {
            report_writeErrorMsg(ERR_MEMORY, "");
            return ErrorCode;
        }
        toposort_sortLinks(SortedLinks);
        if ( ErrorCode ) return ErrorCode;
    }

    // --- open any routing interface files
    iface_openRoutingFiles();

    // --- initialize flow and quality routing systems                         //(5.1.008)
    flowrout_init(RouteModel);                                                 //(5.1.008)
    if ( Fhotstart1.mode == NO_FILE ) qualrout_init();                         //(5.1.008)

    return ErrorCode;
}
开发者ID:BradenRosenberg-Cadmus,项目名称:Stormwater-Management-Model,代码行数:33,代码来源:routing.c


示例19: treatmnt_open

int  treatmnt_open(void)
//
//  Input:   none
//  Output:  returns TRUE if successful, FALSE if not
//  Purpose: allocates memory for computing pollutant removals by treatment.
//
{
/////////////////////////////////////////////////////
//  Updated to allocate memory for Cin. (LR - 9/5/05)
/////////////////////////////////////////////////////

    R = NULL;
    Cin = NULL;
    if ( Nobjects[POLLUT] > 0 )
    {
        R = (float *) calloc(Nobjects[POLLUT], sizeof(float));
        Cin = (float *) calloc(Nobjects[POLLUT], sizeof(float));
        if ( R == NULL || Cin == NULL)
        {
            report_writeErrorMsg(ERR_MEMORY, "");
            return FALSE;
        }
    }
    return TRUE;
}
开发者ID:Geosyntec,项目名称:SUSTAIN,代码行数:25,代码来源:treatmnt.cpp


示例20: readDLY0204FileLine

void readDLY0204FileLine(int* y, int* m)
//
//  Input:   none
//  Output:  y = year
//           m = month
//  Purpose: reads year & month from line of DLY02 or DLY04 climate file.
//
{
    char year[5] = "";
    char month[3] = "";
    int  len;

    // --- check for minimum number of characters
    len = (int)strlen(FileLine);
    if ( len < 16 )
    {
        report_writeErrorMsg(ERR_CLIMATE_FILE_READ, Fclimate.name);
        return;
    }

    // --- get record's date 
    sstrncpy(year,  &FileLine[7], 4);
    sstrncpy(month, &FileLine[11], 2);
    *y = atoi(year);
    *m = atoi(month);
}
开发者ID:obergshavefun,项目名称:icap,代码行数:26,代码来源:climate.c



注:本文中的report_writeErrorMsg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ reposition函数代码示例发布时间:2022-05-30
下一篇:
C++ report_status函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap