Skip to content

CRHMcode GUI - Simulation not run correctly when start date and date of first observation don't match. #448

@jhs507

Description

@jhs507

When in GUI mode if the start date of a simulation and the first date of the loaded observation file don't match then the simulation is not run properly this is due to a bug in the CRHMmainDlg::RunClickFunction() on line 577

	int last = 0;
	for (int indx = Global::DTmin; indx < Global::DTmax; indx = last)
	{

		int next = indx + stepSize;
		if (next >= Global::DTmax)
		{
			main->RunClick2Middle(mmsdata, last, Global::DTmax);
			last = Global::DTmax;
		}
		else
		{
			main->RunClick2Middle(mmsdata, last, next);
			last = next;
		}

Because last is set to start a zero when it should be set to start at Global::DTmin

	int last = Global::DTmin;
	for (int indx = Global::DTmin; indx < Global::DTmax; indx = last)
	{

		int next = indx + stepSize;
		if (next >= Global::DTmax)
		{
			main->RunClick2Middle(mmsdata, last, Global::DTmax);
			last = Global::DTmax;
		}
		else
		{
			main->RunClick2Middle(mmsdata, last, next);
			last = next;
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions