psmile_locations_dealloc.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_dealloc
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_locations_dealloc (send_info, ierror)
00012 !
00013 ! !USES:
00014 !
00015       use PRISM_constants
00016 !
00017       use PSMILe, dummy_interface => PSMILe_Locations_dealloc
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_dealloc;
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_dealloc" frees the vectors for the send
00053 ! information for the coupler which were used to generate the lists for
00054 ! the transformer.
00055 !
00056 ! !REVISION HISTORY:
00057 !
00058 !   Date      Programmer   Description
00059 ! ----------  ----------   -----------
00060 ! 03.07.21    H. Ritzdorf  created
00061 !
00062 !EOP
00063 !----------------------------------------------------------------------
00064 !
00065 !  $Id: psmile_locations_dealloc.F90 2938 2011-02-03 10:23:22Z hanke $
00066 !  $Author: hanke $
00067 !
00068    Character(len=len_cvs_string), save :: mycvs = 
00069        '$Id: psmile_locations_dealloc.F90 2938 2011-02-03 10:23:22Z hanke $'
00070 !
00071 !----------------------------------------------------------------------
00072 !
00073 !  Initialization
00074 !
00075 #ifdef VERBOSE
00076       print 9990, trim(ch_id)
00077 
00078       call psmile_flushstd
00079 #endif /* VERBOSE */
00080 !
00081       ierror = 0
00082 !
00083       nvec   = send_info%nvec
00084       nparts = send_info%nparts
00085 !
00086 #ifdef PRISM_ASSERTION
00087       if ( min (nvec, nparts) <= 0 ) then
00088          print *, trim(ch_id), ', nvec, nparts', nvec, nparts
00089          call psmile_assert (__FILE__, __LINE__, "nvec or nparts <= 0")
00090       endif
00091 !
00092       if ( .not. Associated (send_info%srclocs) ) then
00093          call psmile_assert (__FILE__, __LINE__, &
00094                              "send_info%srclocs is not allocated")
00095         
00096       endif
00097 !
00098       if ( .not. Associated (send_info%msklocs) ) then
00099          call psmile_assert (__FILE__, __LINE__, &
00100                              "send_info%msklocs is not allocated")
00101         
00102       endif
00103 !
00104 !rr      if ( .not. Associated (send_info%virtual) ) then
00105 !rr         call PSMILe_Assert (__FILE__, __LINE__, &
00106 !rr                             "send_info%virtual is not allocated")
00107 !rr        
00108 !rr      endif
00109 !
00110       if ( .not. Associated (send_info%srcars) ) then
00111          call psmile_assert (__FILE__, __LINE__, &
00112                              "send_info%srcars is not allocated")
00113         
00114       endif
00115 !
00116       if ( .not. Associated (send_info%nars) ) then
00117          call psmile_assert (__FILE__, __LINE__, &
00118                              "send_info%nars is not allocated")
00119         
00120       endif
00121 !
00122       if ( .not. Associated (send_info%npoints) ) then
00123          call psmile_assert (__FILE__, __LINE__, &
00124                              "send_info%npoints is not allocated")
00125         
00126       endif
00127 #endif
00128 !
00129 !----------------------------------------------------------------------------
00130 !    Free
00131 !----------------------------------------------------------------------------
00132 !
00133       do j = 1, nparts
00134 
00135          if (Associated(send_info%virtual)) then
00136             if (Associated(send_info%virtual(1, j)%vector) ) &
00137                Deallocate (send_info%virtual(1, j)%vector)
00138          endif
00139 
00140          do i = 1, nvec
00141 
00142             if (Associated(send_info%msklocs(i, j)%vector) ) &
00143                Deallocate (send_info%msklocs(i, j)%vector)
00144 
00145             if (Associated(send_info%srclocs(i, j)%vector) ) &
00146                Deallocate (send_info%srclocs(i, j)%vector)
00147 !
00148             if (Associated(send_info%srcars(i, j)%vector) ) &
00149                Deallocate (send_info%srcars(i, j)%vector)
00150          end do
00151       end do
00152 !
00153       Deallocate (send_info%virtual, STAT = ierror)
00154 
00155       Deallocate (send_info%msklocs, STAT = ierror)
00156 !
00157       Deallocate (send_info%srclocs, STAT = ierror)
00158 !
00159       Deallocate (send_info%srcars, STAT = ierror)
00160 !
00161       Deallocate (send_info%nars, STAT = ierror)
00162 !
00163       Deallocate (send_info%npoints, STAT = ierror)
00164 !
00165 !===> Set count numbers to 0
00166 !
00167       send_info%nvec   = 0
00168       send_info%nparts = 0
00169 !
00170 !===> All done
00171 !
00172 #ifdef VERBOSE
00173       print 9980, trim(ch_id), ierror
00174 
00175       call psmile_flushstd
00176 #endif /* VERBOSE */
00177 !
00178 !  Formats:
00179 !
00180 
00181 #ifdef VERBOSE
00182 
00183 9990 format (1x, a, ': psmile_locations_dealloc:')
00184 9980 format (1x, a, ': psmile_locations_dealloc: eof ierror =', i3)
00185 
00186 #endif /* VERBOSE */
00187 
00188       end subroutine PSMILe_Locations_dealloc

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1