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

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1