psmile_locations_alloc.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PSMILe_Locations_alloc
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_locations_alloc (send_info, ierror)
00012 !
00013 ! !USES:
00014 !
00015       use PRISM_constants
00016 !
00017       use PSMILe, dummy_interface => PSMILe_Locations_alloc
00018 
00019       implicit none
00020 !
00021 ! !INPUT PARAMETERS:
00022  
00023       Type(Send_information), Intent(Inout) :: send_info
00024 
00025 !     Send information
00026 
00027 ! !OUTPUT PARAMETERS:
00028 !
00029       Integer, Intent (Out)           :: ierror
00030 
00031 !     Returns the error code of PSMILe_Locations_alloc;
00032 !             ierror = 0 : No error
00033 !             ierror > 0 : Severe error
00034 !
00035 ! !LOCAL VARIABLES
00036 !
00037 !     ... for simplicity
00038 !
00039       Integer                         :: nvec, nparts
00040 !
00041 !     ... loop indices
00042 !
00043       Integer                         :: i, j
00044 !
00045 !     ... for error handling
00046 !
00047       Integer, parameter              :: nerrp = 2
00048       Integer                         :: ierrp (nerrp)
00049 !
00050 ! !DESCRIPTION:
00051 !
00052 ! Subroutine "PSMILe_Locations_alloc" allocates the vectors for the send
00053 ! information.
00054 !
00055 ! !REVISION HISTORY:
00056 !
00057 !   Date      Programmer   Description
00058 ! ----------  ----------   -----------
00059 ! 03.07.21    H. Ritzdorf  created
00060 !
00061 !EOP
00062 !----------------------------------------------------------------------
00063 !
00064 !  $Id: psmile_locations_alloc.F90 2936 2011-02-03 09:36:47Z hanke $
00065 !  $Author: hanke $
00066 !
00067    Character(len=len_cvs_string), save :: mycvs = 
00068        '$Id: psmile_locations_alloc.F90 2936 2011-02-03 09:36:47Z hanke $'
00069 !
00070 !----------------------------------------------------------------------
00071 !
00072 !  Initialization
00073 !
00074 #ifdef VERBOSE
00075       print 9990, trim(ch_id)
00076 
00077       call psmile_flushstd
00078 #endif /* VERBOSE */
00079 !
00080       ierror = 0
00081 !
00082       nvec   = send_info%nvec
00083       nparts = send_info%nparts
00084 !
00085 #ifdef PRISM_ASSERTION
00086       if ( min (nvec, nparts) <= 0 ) then
00087          print *, trim(ch_id), ', nvec, nparts', nvec, nparts
00088          call psmile_assert (__FILE__, __LINE__, "nvec or nparts <= 0")
00089       endif
00090 #endif
00091 !
00092 !===> Allocate
00093 !
00094      Allocate (send_info%npoints(nvec, nparts), &
00095                send_info%nars   (nvec, nparts), &
00096                send_info%srcars (nvec, nparts), &
00097                send_info%srclocs(nvec, nparts), &
00098                send_info%msklocs(nvec, nparts), STAT = ierror)
00099 
00100      if ( ierror > 0 ) then
00101         ierrp (1) = ierror 
00102         ierrp (2) = nvec * nparts * 5
00103  
00104         ierror = PRISM_Error_Alloc
00105         call psmile_error ( ierror, 'send_info%{npoints,nars,srcars,srclocs,msklocs}', &
00106                             ierrp, 2, __FILE__, __LINE__ )
00107         return
00108      endif
00109 !
00110 !===> Initialize
00111 !
00112      send_info%npoints = 0
00113      send_info%nars    = 0
00114 !
00115         do j = 1, nparts
00116            do i = 1, nvec
00117            Nullify (send_info%msklocs(i, j)%vector)
00118            Nullify (send_info%srclocs(i, j)%vector)
00119            Nullify (send_info%srcars (i, j)%vector)
00120            end do
00121         end do
00122 !
00123      Nullify (send_info%virtual)
00124      Nullify (send_info%dstijk)
00125      Nullify (send_info%list_entries)
00126 !
00127 !===> All done
00128 !
00129 #ifdef VERBOSE
00130       print 9980, trim(ch_id), ierror
00131 
00132       call psmile_flushstd
00133 #endif /* VERBOSE */
00134 !
00135 !  Formats:
00136 !
00137 
00138 #ifdef VERBOSE
00139 
00140 9990 format (1x, a, ': psmile_locations_alloc:')
00141 9980 format (1x, a, ': psmile_locations_alloc: eof ierror =', i3)
00142 
00143 #endif /* VERBOSE */
00144 
00145       end subroutine PSMILe_Locations_alloc

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1