77
88#include < opacity.H>
99
10+ #include < format>
1011#include < iostream>
1112
1213#ifdef _OPENMP
1314#include < omp.h>
1415#endif
1516
16- #include < sstream>
17-
1817using namespace amrex ;
1918
2019Radiation::Solver_Type Radiation::SolverType = Radiation::InvalidSolver;
@@ -647,27 +646,23 @@ void Radiation::checkPoint(int level,
647646 //
648647 if (ParallelDescriptor::IOProcessor ()) {
649648 int oldprec = os.precision (20 );
650- sprintf (buf, " delta_e_rat_level[%d]= " , level);
651- std::string DeltaString = buf;
649+ auto DeltaString = std::format (" delta_e_rat_level[{}]= " , level);
652650 os << DeltaString << delta_e_rat_level[level] << ' \n ' ;
653- sprintf (buf, " delta_T_rat_level[%d]= " , level);
654- DeltaString = buf;
651+ DeltaString = std::format (" delta_T_rat_level[{}]= " , level);
655652 os << DeltaString << delta_T_rat_level[level] << ' \n ' ;
656653 os.precision (oldprec);
657654 }
658655
659656 // Path name construction stolen from AmrLevel::checkPoint
660657
661- sprintf (buf, " Level_%d" , level);
662- std::string Level = buf;
658+ std::string Level = std::format (" Level_{}" , level);
663659
664660 //
665661 // Write name of conservation flux register to header.
666662 //
667- sprintf (buf, " /RadFlux" );
668663
669664 std::string PathNameInHeader = Level;
670- PathNameInHeader += buf ;
665+ PathNameInHeader += " /RadFlux " ;
671666 if (ParallelDescriptor::IOProcessor ()) {
672667 os << PathNameInHeader;
673668 }
@@ -691,7 +686,7 @@ void Radiation::checkPoint(int level,
691686 FullPathName += ' /' ;
692687 }
693688 FullPathName += Level;
694- FullPathName += buf ;
689+ FullPathName += " /RadFlux " ;
695690 //
696691 // Output conservation flux register.
697692 //
0 commit comments