psmile_enddef_action_loc.F90

Go to the documentation of this file.
00001 !
00002 !-----------------------------------------------------------------------
00003 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00004 ! All rights reserved. Use is subject to OASIS4 license terms.
00005 !-----------------------------------------------------------------------
00006 !BOP
00007 !
00008 ! !ROUTINE: PSMILe_Enddef_action_loc
00009 !
00010 ! !INTERFACE:
00011 
00012       subroutine psmile_enddef_action_loc (msg_locations, ierror)
00013 !
00014 ! !USES:
00015 !
00016       use PRISM_constants
00017 !
00018       use PSMILe, dummy_interface => PSMILe_Enddef_action_loc
00019 
00020       implicit none
00021 !
00022 ! !INPUT PARAMETERS:
00023 !
00024       Type (enddef_msg_locations), Intent (In) :: msg_locations
00025 
00026 !     Contains basic information required to receive the locations
00027 !
00028 !
00029 ! !OUTPUT PARAMETERS:
00030 !
00031       Integer, Intent (Out)           :: ierror
00032 
00033 !     Returns the error code of PSMILe_Get_locations_3d;
00034 !             ierror = 0 : No error
00035 !             ierror > 0 : Severe error
00036 !
00037 ! !LOCAL VARIABLES
00038 !
00039 !     ... for error handling
00040 !
00041       Integer, parameter              :: nerrp = 1
00042       Integer                         :: ierrp (nerrp)
00043 !
00044 ! !DESCRIPTION:
00045 !
00046 ! Subroutine "PSMILe_Enddef_action_loc" performs the actions in order to
00047 ! receive the data on locations found for the method (grid) and the
00048 ! subgrid coords by process "sender".
00049 ! The data is sent by routine "PSMILe_Return_locations_3d" in the process
00050 ! which has searched the data.
00051 !
00052 ! !REVISION HISTORY:
00053 !
00054 !   Date      Programmer   Description
00055 ! ----------  ----------   -----------
00056 ! 03.07.21    H. Ritzdorf  created
00057 !
00058 !EOP
00059 !----------------------------------------------------------------------
00060 !
00061 !  $Id: psmile_enddef_action_loc.F90 2804 2010-12-07 10:07:10Z hanke $
00062 !  $Author: hanke $
00063 !
00064    Character(len=len_cvs_string), save :: mycvs = 
00065        '$Id: psmile_enddef_action_loc.F90 2804 2010-12-07 10:07:10Z hanke $'
00066 !
00067 !----------------------------------------------------------------------
00068 !
00069 !  Initialization
00070 !
00071 #ifdef VERBOSE
00072       print 9990, trim(ch_id), msg_locations%src_rank
00073 
00074       call psmile_flushstd
00075 #endif /* VERBOSE */
00076 !
00077       call psmile_get_locations_3d (msg_locations, ierror)
00078       if (ierror > 0) return
00079 !
00080 !     ... Have further messages to be received from this process ?
00081 !
00082       if (msg_locations%further_msg_flag == 1) then
00083 !
00084 !===> ... Further messages have to be received;
00085 !         activate requests for grid transfer again if it's
00086 !         already finished.
00087 !
00088          if (paction%n_answer >= paction%n_answer2recv) then
00089 !
00090 !===> ... Set up request for the next grid transfer
00091 !
00092 #ifdef PRISM_ASSERTION
00093             if (paction%lrequest(1) /= MPI_REQUEST_NULL) then
00094                call psmile_assert ( __FILE__, __LINE__, &
00095                                    'paction%lrequest(1) is not finished !')
00096             endif
00097 #endif
00098 !
00099             call MPI_Irecv (paction%msgreq, nd_msgint, MPI_INTEGER,      &
00100                             MPI_ANY_SOURCE, reqtag, comm_psmile, &
00101                             paction%lrequest(1), ierror)
00102             if ( ierror /= MPI_SUCCESS ) then
00103                ierrp (1) = ierror
00104                ierror = PRISM_Error_MPI
00105 
00106                call psmile_error ( ierror, 'MPI_Irecv', &
00107                                    ierrp, 1, __FILE__, __LINE__ )
00108                return
00109              endif
00110 
00111          endif
00112 !
00113          paction%n_answer = paction%n_answer - 1
00114 
00115       else
00116 
00117 !
00118 !===> ... Locations from same sender have to be received
00119 !
00120          paction%nloc_recv = paction%nloc_recv + 1
00121 
00122       endif
00123 !
00124 !===> All done
00125 !
00126 #ifdef VERBOSE
00127       print 9980, trim(ch_id), ierror
00128 
00129       call psmile_flushstd
00130 #endif /* VERBOSE */
00131 !
00132 !  Formats:
00133 !
00134 
00135 #ifdef VERBOSE
00136 
00137 9990 format (1x, a, ': psmile_enddef_action_loc: sender ', i6)
00138 9980 format (1x, a, ': psmile_enddef_action_loc: eof ierror =', i3)
00139 
00140 #endif /* VERBOSE */
00141 
00142       end subroutine PSMILe_Enddef_action_loc

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1