Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long elapsed times are not recorded correctly #10399

Open
3 tasks
keigo-nomura opened this issue Feb 15, 2024 · 1 comment
Open
3 tasks

Long elapsed times are not recorded correctly #10399

keigo-nomura opened this issue Feb 15, 2024 · 1 comment
Assignees
Labels
Defect Includes code to repair a defect in EnergyPlus LowComplexityApproved Used for subcontractor defect complexity requests

Comments

@keigo-nomura
Copy link

Issue overview

EnergyPlus shows the Elapsed Time at the end of the err file after the simulation. However, the display upper limit appears to be 24 hours. For example, if the actual elapsed time is 50 hr 00 min 00.00 sec, the elapsed time is displayed as 02 hr 00min 00.00sec (i.e., 50hr - 24hr - 24hr = 2hr) in the err file.

Details

Some additional details for this issue (if relevant):

Checklist

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Defect file added (list location of defect file here)
  • Ticket added to Pivotal for defect (development team task)
  • Pull request created (the pull request will have additional tasks related to reviewing changes that fix this defect)
@jmarrec
Copy link
Contributor

jmarrec commented Mar 5, 2024

Interesting, I guess no one expected sim times to exceed 24 hours.

Anyways, this line is guilty:

if (state.dataSysVars->Time_Finish < state.dataSysVars->Time_Start) state.dataSysVars->Time_Finish += 24.0 * 3600.0;

Along with this routine which discards the day completely:

Real64 epElapsedTime()
{
// FUNCTION INFORMATION:
// AUTHOR Linda Lawrie
// DATE WRITTEN February 2012
// MODIFIED na
// RE-ENGINEERED na
// PURPOSE OF THIS FUNCTION:
// An alternative method for timing elapsed times is to call the standard
// Date_And_Time routine and set the "time".
// Return value
Real64 calctime; // calculated time based on hrs, minutes, seconds, milliseconds
// FUNCTION LOCAL VARIABLE DECLARATIONS:
Array1D<Int32> clockvalues(8);
// value(1) Current year
// value(2) Current month
// value(3) Current day
// value(4) Time difference with respect to UTC in minutes (0-59)
// value(5) Hour of the day (0-23)
// value(6) Minutes (0-59)
// value(7) Seconds (0-59)
// value(8) Milliseconds (0-999)
date_and_time(_, _, _, clockvalues);
calctime = clockvalues(5) * 3600.0 + clockvalues(6) * 60.0 + clockvalues(7) + clockvalues(8) / 1000.0;
return calctime;
}

@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label Mar 5, 2024
@jmarrec jmarrec self-assigned this Mar 5, 2024
@Myoldmopar Myoldmopar added the LowComplexityApproved Used for subcontractor defect complexity requests label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus LowComplexityApproved Used for subcontractor defect complexity requests
Projects
None yet
Development

No branches or pull requests

3 participants