psmile_neigh_extra_search_clean.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_Neigh_extra_search_clean
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_neigh_extra_search_clean (search, extra_search, ierror)
00012 !
00013 ! !USES:
00014 !
00015       use PRISM_constants
00016 !
00017       use PSMILe, dummy_interface => PSMILe_Neigh_extra_search_clean
00018 
00019       Implicit none
00020 !
00021 ! !INPUT PARAMETERS:
00022 !
00023       Type (Enddef_search),     Intent (In)    :: search
00024 
00025 !     Info's on coordinates to be searched
00026 !
00027 ! !INPUT/OUTPUT PARAMETERS:
00028 !
00029       Type (Extra_search_info), Intent (InOut) :: extra_search
00030 !
00031 !     Structure containing the data for
00032 !     (*) global search and
00033 !     (*) extra search of location
00034 !         (for example: where required mask values were not "true")
00035 !
00036 ! !OUTPUT PARAMETERS:
00037 
00038       Integer,                  Intent (Out)   :: ierror
00039 
00040 !     Returns the error code of PSMILE_Neigh_extra_search_clean;
00041 !             ierror = 0 : No error
00042 !             ierror > 0 : Severe error
00043 !
00044 ! !LOCAL VARIABLES
00045 !
00046       Integer                         :: ipart
00047 !
00048 !     ... for error handling
00049 !
00050 !     Integer, Parameter              :: nerrp = 2
00051 !     Integer                         :: ierrp (nerrp)
00052 !
00053 !
00054 ! !DESCRIPTION:
00055 !
00056 ! Subroutine "PSMILe_Neigh_extra_search_clean" clean the vectors
00057 ! and variables use for the extra search; i.e for
00058 !
00059 !   (*) global search or
00060 !   (*) extra search (nearest neighbour search).
00061 !
00062 ! !REVISION HISTORY:
00063 !
00064 !   Date      Programmer   Description
00065 ! ----------  ----------   -----------
00066 ! 15.03.06    H. Ritzdorf  created
00067 !
00068 !EOP
00069 !----------------------------------------------------------------------
00070 !
00071 !  $Id: psmile_neigh_extra_search_clean.F90 2082 2009-10-21 13:31:19Z hanke $
00072 !  $Author: hanke $
00073 !
00074    Character(len=len_cvs_string), save :: mycvs = 
00075        '$Id: psmile_neigh_extra_search_clean.F90 2082 2009-10-21 13:31:19Z hanke $'
00076 !
00077 !----------------------------------------------------------------------
00078 !
00079 !  Initialization
00080 !
00081 #ifdef VERBOSE
00082       print 9990, trim(ch_id)
00083 
00084       call psmile_flushstd
00085 #endif /* VERBOSE */
00086 !
00087 !===> Initialization
00088 !
00089       ierror  = 0
00090 !
00091          do ipart = 1, search%npart
00092          if (extra_search%len_req(ipart) > 0) then
00093             Deallocate (extra_search%indices_req (ipart)%vector)
00094             Deallocate (extra_search%required    (ipart)%vector)
00095          endif
00096          end do
00097 !
00098       if ( Associated (extra_search%indices) ) then
00099            Deallocate (extra_search%indices)
00100       endif
00101 !
00102 !===> Remove distance arrays for global nearest neighbour search
00103 !
00104       if ( Associated (extra_search%dist_dble) ) then
00105            Deallocate (extra_search%dist_dble)
00106       endif
00107 !
00108       if ( Associated (extra_search%cos_search_dble) ) then
00109            Deallocate (extra_search%cos_search_dble)
00110       endif
00111 !
00112       if ( Associated (extra_search%sin_search_dble) ) then
00113            Deallocate (extra_search%sin_search_dble)
00114       endif
00115 !
00116       if ( Associated (extra_search%z_search_dble) ) then
00117            Deallocate (extra_search%z_search_dble)
00118       endif
00119 !
00120 !===> ... real arrays
00121 !
00122       if ( Associated (extra_search%dist_real) ) then
00123            Deallocate (extra_search%dist_real)
00124       endif
00125 !
00126       if ( Associated (extra_search%cos_search_real) ) then
00127            Deallocate (extra_search%cos_search_real)
00128       endif
00129 !
00130       if ( Associated (extra_search%sin_search_real) ) then
00131            Deallocate (extra_search%sin_search_real)
00132       endif
00133 !
00134       if ( Associated (extra_search%z_search_real) ) then
00135            Deallocate (extra_search%z_search_real)
00136       endif
00137 !
00138 !===> 
00139 !
00140       Deallocate (extra_search%len_extra,   &
00141                   extra_search%len_req,     &
00142                   extra_search%indices_req, &
00143                   extra_search%required)
00144 !
00145 !===> Reset number of extra points and
00146 !           number of points which require global search
00147 
00148 !
00149       extra_search%n_extra = 0
00150       extra_search%n_req = 0
00151 !
00152 !===> All done
00153 !
00154 #ifdef VERBOSE
00155       print 9980, trim(ch_id)
00156 
00157       call psmile_flushstd
00158 #endif /* VERBOSE */
00159 !
00160 !  Formats:
00161 !
00162 9990 format (1x, a, ': psmile_neigh_extra_search_clean: ')
00163 9980 format (1x, a, ': psmile_neigh_extra_search_clean: eof')
00164 
00165       end subroutine psmile_neigh_extra_search_clean

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1