psmile_neigh_extra_search_dble.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2008-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_dble
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_neigh_extra_search_dble (search, extra_search, &
00012                                                  nb_extra, ierror)
00013 !
00014 ! !USES:
00015 !
00016       use PRISM_constants
00017 !
00018       use PSMILe, dummy_interface => PSMILe_Neigh_extra_search_dble
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)    :: nb_extra
00029 !
00030 !     Number of extra points to be searched
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_dble;
00046 !             ierror = 0 : No error
00047 !             ierror > 0 : Severe error
00048 !
00049 ! !DEFINED PARAMETERS:
00050 !
00051 !  lat   = Index of Latitudes  in arrays "sin_values" and "cos_values"
00052 !
00053       Integer, Parameter              :: lat = 2
00054 !
00055 ! !LOCAL VARIABLES
00056 !
00057       Integer                         :: n_extra
00058 !
00059 !     ... for error handling
00060 !
00061       Integer, Parameter              :: nerrp = 2
00062       Integer                         :: ierrp (nerrp)
00063 !
00064 ! !DESCRIPTION:
00065 !
00066 ! Subroutine "PSMILe_Neigh_extra_search_dble" allocates the vectors
00067 ! which are required for the global search of the extra points.
00068 !
00069 !
00070 ! !REVISION HISTORY:
00071 !
00072 !   Date      Programmer   Description
00073 ! ----------  ----------   -----------
00074 !  9.10.06    H. Ritzdorf  created
00075 !
00076 !EOP
00077 !----------------------------------------------------------------------
00078 !
00079 !  $Id: psmile_neigh_extra_search_dble.F90 2082 2009-10-21 13:31:19Z hanke $
00080 !  $Author: hanke $
00081 !
00082    Character(len=len_cvs_string), save :: mycvs = 
00083        '$Id: psmile_neigh_extra_search_dble.F90 2082 2009-10-21 13:31:19Z hanke $'
00084 !
00085 !----------------------------------------------------------------------
00086 !
00087 !  Initialization
00088 !
00089 #ifdef VERBOSE
00090       print 9990, trim(ch_id)
00091 
00092       call psmile_flushstd
00093 #endif /* VERBOSE */
00094 !
00095 !===> Initialization
00096 !
00097       ierror  = 0
00098 !
00099       n_extra = extra_search%n_extra
00100 !
00101 #ifdef PRISM_ASSERTION
00102       if ( Associated (extra_search%dist_dble)       .or. &
00103            Associated (extra_search%cos_search_dble) .or. &
00104            Associated (extra_search%sin_search_dble) .or. &
00105            Associated (extra_search%z_search_dble)   ) then
00106 !
00107          call psmile_assert (__FILE__, __LINE__, &
00108                              "arrays should be not allocated")
00109       endif
00110 #endif
00111 !
00112 !===> Allocate array for distances of nearest neighbour points
00113 !     found
00114 !
00115       Allocate (extra_search%dist_dble(n_extra, nb_extra), &
00116                 STAT = ierror)
00117 !
00118       if ( ierror > 0 ) then
00119          ierrp (1) = ierror
00120          ierrp (2) = n_extra * nb_extra
00121 
00122          ierror = PRISM_Error_Alloc
00123          call psmile_error ( ierror, 'extra_search%dist_dble', &
00124                              ierrp, 2, __FILE__, __LINE__ )
00125          return
00126       endif
00127 !
00128 !===> Allocate arrays for transformed coordinates
00129 !
00130       Allocate (extra_search%sin_search_dble(n_extra, lat), &
00131                 extra_search%cos_search_dble(n_extra, lat), &
00132                 extra_search%z_search_dble(n_extra), &
00133                 STAT = ierror)
00134 !
00135       if ( ierror > 0 ) then
00136          ierrp (1) = ierror
00137          ierrp (2) = n_extra*lat*2 + n_extra
00138 
00139          ierror = PRISM_Error_Alloc
00140          call psmile_error ( ierror, 'extra_search%cos_search, ...', &
00141                              ierrp, 2, __FILE__, __LINE__ )
00142          return
00143       endif
00144 
00145 !
00146 !===> All done
00147 !
00148 #ifdef VERBOSE
00149       print 9980, trim(ch_id)
00150 
00151       call psmile_flushstd
00152 #endif /* VERBOSE */
00153 !
00154 !  Formats:
00155 !
00156 9990 format (1x, a, ': psmile_neigh_extra_search_dble:')
00157 9980 format (1x, a, ': psmile_neigh_extra_search_dble: eof')
00158 
00159       end subroutine psmile_neigh_extra_search_dble

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1