--- MITgcm/eesupp/src/eedie.F 2012/03/28 20:22:39 1.11 +++ MITgcm/eesupp/src/eedie.F 2012/10/11 19:15:18 1.13 @@ -1,4 +1,4 @@ -C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/eedie.F,v 1.11 2012/03/28 20:22:39 jmc Exp $ +C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/eedie.F,v 1.13 2012/10/11 19:15:18 jmc Exp $ C $Name: $ #include "CPP_EEOPTIONS.h" @@ -73,13 +73,20 @@ #ifdef USE_LIBHPM CALL F_HPMTERMINATE(myProcId) #endif + +C-- Flush IO-unit before MPI termination + CALL MDS_FLUSH( errorMessageUnit, 1 ) +c#ifdef ALLOW_USE_MPI + CALL MDS_FLUSH( standardMessageUnit, 1 ) +c#endif /* ALLOW_USE_MPI */ + #ifdef ALLOW_USE_MPI -C-- +C- Note: since MPI_INIT is always called, better to also always terminate MPI +C (even if usingMPI=F) --> comment out test on usingMPI +c IF ( usingMPI ) THEN + C-- MPI style multiple-process termination C-- ====================================== -#ifndef ALWAYS_USE_MPI - IF ( usingMPI ) THEN -#endif #ifdef COMPONENT_MODULE IF ( useCoupler) CALL MPI_BARRIER( MPI_COMM_WORLD, mpiRC ) #endif @@ -95,10 +102,8 @@ & mpiRC CALL PRINT_ERROR( msgBuf, 1 ) ENDIF -C -#ifndef ALWAYS_USE_MPI - ENDIF -#endif + +c ENDIF #endif /* ALLOW_USE_MPI */ RETURN