/*@@ @routine WriteInfo @date June 31 1999 @author Gabrielle Allen, Paul Walker @desc Dumps the Info data. @enddesc @calls @calledby @history @hauthor Thomas Radke @hdate 17 Mar 1999 @hdesc included "cctk_Comm.h" to overload CCTK_MyProc() properly @hendhistory @@*/ #include #include #include "cctk.h" static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusBase_IOBasic_WriteInfo_c) int IOBasic_WriteInfo (cGH *GH, CCTK_REAL *val, int index, const char *operator, const char *alias) { int ierr; int reduce_handle; int retval = 0; /* first, check if variable has storage assigned */ if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index))) { char *fullname; fullname = CCTK_FullName (index); CCTK_VWarn (2, __LINE__, __FILE__, CCTK_THORNSTRING, "IOBasic_WriteInfo: No info output for '%s' (no storage)", fullname); free (fullname); return -3; } reduce_handle = CCTK_ReductionHandle(operator); if (reduce_handle > -1) { ierr = CCTK_Reduce(GH, 0, reduce_handle, 1, CCTK_VARIABLE_REAL, val, 1, index); if (ierr < 0) { CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOBasic_WriteInfo: Internal error in reduction '%s'", operator); retval = -2; } } else { CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOBasic_WriteInfo: Reduction operator '%s' not found", operator); retval = -1; } return retval; }