prismdrv_finalize.F90

Go to the documentation of this file.
00001 !------------------------------------------------------------------------
00002 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PRISMDrv_Finalize
00008 !
00009 ! !INTERFACE
00010 subroutine prismdrv_finalize(il_err)
00011 
00012 !
00013 ! !USES:
00014 !
00015   USE PRISMDrv, dummy_interface => PRISMDrv_Finalize
00016   use psmile_timer, only : psmile_timer_stop, psmile_timer_print
00017 
00018   IMPLICIT NONE
00019 
00020 !
00021 ! !PARAMETERS:
00022 !
00023 
00024 !
00025 ! ! RETURN VALUE
00026 !
00027   INTEGER, INTENT (Out)               :: il_err   ! error value
00028 
00029 ! !DESCRIPTION
00030 ! Subroutine "PRISMDrv_Finalize" finalizes the MPI context of the driver 
00031 ! application after having received a message of finalization from the 
00032 ! different applications.
00033 !
00034 ! !REVISED HISTORY
00035 !   Date      Programmer   Description
00036 ! ----------  ----------   -----------
00037 ! 18/11/2002  D. Declat    Creation
00038 !
00039 ! EOP
00040 !----------------------------------------------------------------------
00041 ! $Id: prismdrv_finalize.F90 2849 2011-01-05 08:14:13Z hanke $
00042 ! $Author: hanke $
00043 !----------------------------------------------------------------------
00044 !
00045 ! 0. Local declarations
00046 !
00047   CHARACTER(LEN=len_cvs_string), SAVE  :: mycvs = 
00048      '$Id: prismdrv_finalize.F90 2849 2011-01-05 08:14:13Z hanke $'
00049 
00050   INTEGER, PARAMETER                  :: nerrp=2
00051   INTEGER                             :: ierrp(nerrp)
00052 
00053 ! ---------------------------------------------------------------------
00054 !
00055 #ifdef VERBOSE
00056   PRINT *, '| Enter PRISMDrv_Finalize'
00057   call psmile_flushstd
00058 #endif
00059 !
00060 ! 0. Print Driver's internal timers
00061 !
00062 #ifdef PROFILE
00063   call psmile_timer_stop(1)
00064   call psmile_timer_print
00065 #endif
00066 !
00067 ! 1. Finalize MPI
00068 !
00069   CALL MPI_Finalize(il_err)
00070   IF ( il_err /= MPI_SUCCESS ) THEN
00071       ierrp (1) = il_err
00072       call psmile_error_common ( PRISM_Error_MPI, 'MPI_Finalize', &
00073          ierrp, 1, __FILE__, __LINE__ )
00074       RETURN
00075   ENDIF
00076 
00077 !
00078 #ifdef VERBOSE
00079   PRINT *, '| Quit PRISMDrv_Finalize'
00080   PRINT *, '|'
00081   call psmile_flushstd
00082 #endif
00083 END SUBROUTINE PRISMDrv_Finalize
00084 
00085 

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1