From 817a39952dee81fb0260afdd2967511f80c3abcf Mon Sep 17 00:00:00 2001 From: Adam Moody Date: Fri, 11 Feb 2022 16:25:27 -0800 Subject: [PATCH] keep previous SCR code in getDt --- src/CheckPoint.C | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/CheckPoint.C b/src/CheckPoint.C index aeb78e64..367ec623 100644 --- a/src/CheckPoint.C +++ b/src/CheckPoint.C @@ -650,6 +650,45 @@ float_sw4 CheckPoint::getDt() { } MPI_Bcast(&dt, 1, mEW->m_mpifloat, 0, mEW->m_cartesian_communicator); return dt; + +#if 0 + int have_restart = 0; + char checkpoint_dir[SCR_MAX_FILENAME]; + SCR_Have_restart(&have_restart, checkpoint_dir); + if (! have_restart) { + std::cerr<<"Error :: SCR found no checkpoints ! \n"<getRank()<<".bin"; + char scr_file[SCR_MAX_FILENAME]; + SCR_Route_file(s.str().c_str(), scr_file); + int valid=1; + if (std::FILE *file=std::fopen(scr_file,"rb")){ + float_sw4 dt; + if ( std::fread(&dt,sizeof dt,1,file)==1) { + scr_file_handle=file; + return dt; + } else { + std::cerr<<"ERROR:: Read of SCR checkpoint file failed in getDt \n"<