psmile.F90

Go to the documentation of this file.
00001 ! -----------------  PRISM module file psmile.F90 ---------------
00002 !
00003 ! $Id: psmile.F90 3248 2011-06-23 13:03:19Z coquart $
00004 ! $Author: coquart $
00005 !
00006 !-----------------------------------------------------------------------
00007 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00008 ! Copyright 2006-2010, SGI Germany, Munich, Germany.
00009 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00010 ! All rights reserved. Use is subject to OASIS4 license terms.
00011 !-----------------------------------------------------------------------
00012 !BOP
00013 !
00014 ! !MODULE: PSMILe
00015 !
00016       Module PSMILe
00017 !
00018 ! !USES:
00019 !
00020 !!    use MPI
00021       Use PSMILe_Common
00022       Use PSMILe_SMIOC, only : PSMILe_file_struct
00023       Use psmile_grid_reduced_gauss, only : reduced_gauss_grid_data
00024       Use PRISM_Constants, only : PRISM_Time_Struct
00025 #ifdef __PSMILE_WITH_IO
00026       Use mpp_mod_oa
00027       Use mpp_domains_mod_oa
00028       Use mpp_io_mod_oa
00029 #endif
00030 
00031 !
00032 ! !DESCRIPTION:
00033 !
00034 ! Derived types, global variables and interface used only by PSMILe routines
00035 !
00036 ! !REVISION HISTORY:
00037 !
00038 !   Date      Programmer   Description
00039 ! ----------  ----------   -----------
00040 ! 01.12.03    H. Ritzdorf  created
00041 ! 06.02.09    J. Ghattas   extracted from previous psmile.F90
00042 !
00043 !EOP
00044 ! -----------------------------------------------------------------------
00045 
00046       Implicit None
00047 !
00048 ! -----------------------------------------------------------------------
00049 ! Type definitions
00050 ! -----------------------------------------------------------------------
00051 
00052 ! =======================================================================
00053 !
00054 !
00055 ! Component definition
00056 !
00057 ! status         : Status of the component information
00058 !                  (see PSMILe statuses above)
00059 !
00060 ! comp_name      : Component name
00061 ! global_comp_id : Global Id of the component
00062 !                  Used to communicate with the coupler and
00063 !                  used in PRISM_Enddef.
00064 ! n_grids        : Number of grids stored for the component
00065 ! comm_user      : Communicator returned for components in user applications
00066 ! comm             PSMILe internal communicator over the processes of
00067 !                  the component.
00068 ! act_comm         PSMILe internal communicator over the processes of
00069 !                  the active components.
00070 ! rank           : Rank of current process in communicator "comm"
00071 ! size           : Size of communicator "comm"
00072 !
00073       Type Component
00074 
00075          Integer                 :: global_comp_id
00076          Integer                 :: status
00077          Integer                 :: n_grids
00078          Integer                 :: comm_user
00079          Integer                 :: comm
00080          Integer                 :: act_comm
00081          Integer                 :: comm_halo
00082          Integer                 :: rank
00083          Integer                 :: size
00084 
00085          Character(len=max_name) :: comp_name
00086       End Type Component
00087 
00088 ! =======================================================================
00089 !
00090 ! Definition of Corners:
00091 !
00092 ! nbr_corners : Number of corners needed to define a control volume
00093 !
00094 ! shape       : Describing the shape of data arrays
00095 !
00096 ! corners     : Coordinates of corners of control volumes
00097 !
00098       Type Corner_Block
00099 
00100          Integer                   :: nbr_corners
00101 
00102          Integer                   :: corner_datatype
00103 
00104          Integer                   :: corner_shape (2, ndim_3d)
00105 
00106          Integer,          Pointer :: pole_array (:)
00107 
00108          Type (real_vector)        :: corners_real (ndim_3d)
00109          Type (dble_vector)        :: corners_dble (ndim_3d)
00110 #if defined ( PRISM_QUAD_TYPE )
00111          Type (quad_vector)        :: corners_quad (ndim_3d)
00112 #endif
00113 
00114       End Type Corner_Block
00115 
00116 ! =======================================================================
00117 !
00118 ! Definition of Coordinate Points:
00119 !
00120       Type Coords_Block
00121 
00122          Integer                   :: coords_datatype
00123 
00124          Integer                   :: actual_shape (2, ndim_3d)
00125          Integer                   :: coords_shape (2, ndim_3d)
00126 
00127          Type (real_vector)        :: coords_real (ndim_3d)
00128          Type (dble_vector)        :: coords_dble (ndim_3d)
00129 #if defined ( PRISM_QUAD_TYPE )
00130          Type (quad_vector)        :: coords_quad (ndim_3d)
00131 #endif
00132       End Type Coords_Block
00133 
00134 ! =======================================================================
00135 !
00136 !
00137 ! Derived type for Subgrids:
00138 !
00139       Type Subgrid_Block
00140 
00141          Character (len=max_name)  :: short_name  ! from subgrid name
00142          Character (len=max_name)  :: long_name
00143 !        Character (len=max_name)  :: units       ! probably not needed
00144 
00145          Integer                   :: nbr_subgrids
00146 
00147          Integer                   :: subgrid_datatype
00148 
00149          Integer                   :: subgrid_shape (2, max_dim)
00150 
00151          Real,             Pointer :: subgrid_real (:)
00152 
00153          Double Precision, Pointer :: subgrid_double (:)
00154 
00155 #if defined ( PRISM_QUAD_TYPE )
00156          Real (kind=PRISM_QUAD_TYPE), Pointer :: subgrid_quad (:)
00157 #endif
00158       End Type Subgrid_Block
00159 
00160 ! =======================================================================
00161 !
00162 !
00163 ! Derived type for vector grid points:
00164 !
00165       Type Vector_Block
00166 
00167          Character (len=max_name)  :: short_name
00168          Character (len=max_name)  :: long_name
00169 
00170          Integer                   :: array_of_point_ids (3)
00171       End Type Vector_Block
00172 
00173 ! =======================================================================
00174 !
00175 !
00176 ! Derived types for halo grid points:
00177 !
00178       Type Halo_Block
00179 
00180          Logical                   :: halo_local
00181 
00182          Integer                   :: halo_shape(2,ndim_3d)
00183 
00184          Type (real_vector)        :: halo_real (ndim_3d)
00185          Type (dble_vector)        :: halo_dble (ndim_3d)
00186 #if defined ( PRISM_QUAD_TYPE )
00187          Type (quad_vector)        :: halo_quad (ndim_3d)
00188 #endif
00189       End Type Halo_Block
00190 
00191       Type Halo_info
00192 
00193          Integer                   :: local_rank
00194          Integer                   :: local_block
00195          Integer                   :: remote_rank
00196          Integer                   :: remote_grid_id
00197          Integer                   :: remote_block
00198          Integer                   :: halo_size
00199          Integer                   :: send_range(2,ndim_3d)
00200          Integer                   :: global_range(2,ndim_3d)
00201 
00202       End Type Halo_info
00203 
00204 ! =======================================================================
00205 !
00206 !
00207 ! Derived type Grid:
00208 !
00209 ! global_grid_id  : Global grid id (passed by Driver)
00210 ! status          : Status of the grid information
00211 !                   (see PSMILe statuses above)
00212 !
00213 ! comp_id         : Component Id
00214 !
00215 ! grid_type       : PRISM integer named parameter describing the type of grid
00216 ! grid_name       : Grid name
00217 !
00218 ! grid_shape      : valid range of the grid
00219 !
00220 ! size            : Number of local points in the grid
00221 !                   (i.e. the shape for blocks)
00222 ! global_size     : global size in each dimension
00223 ! partition       : offset of shape relative to the global index space
00224 !                   (if it exists)
00225 !
00226 ! corner_pointer  : Pointer to the specific data of the corners
00227 ! gcorner_pointer : Pointer to the auxillary gauss grid corners
00228 ! used_for_coupling : Flag indicating whether the grid is used for coupling
00229 !
00230 ! pole_covered    : indicated through SMIOC, either true (psmile_true = 1)
00231 !                                               or false (psmile_false = 0)
00232 !
00233 ! smioc_index     : Link to the data structure comming form SMIOC
00234 !
00235 ! mg_infos        : Info's to grids generated for search of
00236 !                          neighbouring cells/points.
00237 ! nlev            : Number of MG levels generated.
00238 ! ijk0            : Index of the logical grid cell (0,0,0) of midp, ...
00239 !
00240 ! cyclic          : Does the block have cyclic coordinates
00241 !                        in the corresponding direction ?
00242 ! periodic        : Does the (partitioned) grid have periodic coordinates
00243 !                        in the corresponding direction ?
00244 ! len_periodic    : (Global index) Length of periodic direction
00245 !                   len_periodic (i) = 0 if not periodic in this direction
00246 ! nbr_halo_segments : number of differnt halo sections, size of derived type halo
00247 !
00248 ! halo            : Derived type containing the halo info for the Grid
00249 !
00250 ! assoc_grid_id   : grid_id of associated grid used in User-defined interpolations
00251 !                   For geographical field, assoc_grid_id is the id of gridless grid
00252 !                   In associated Gridless grid, assoc_grid_id is PRISM_Undefined
00253 !
00254       Type Grid
00255 
00256          Integer                       :: global_grid_id
00257          Integer                       :: status
00258          Integer                       :: comp_id
00259          Integer                       :: grid_type
00260          Integer                       :: grid_shape (2, ndim_3d)
00261          Integer                       :: grid_structure
00262          Integer                       :: n_dim
00263          Integer (kind=int64)          :: size
00264          Integer (kind=int64)          :: global_size(ndim_3d)
00265          Logical                       :: used_for_coupling
00266          Logical                       :: used_for_io
00267          Logical                       :: pole_covered
00268          Integer                       :: smioc_index
00269          Character(len=max_name)       :: grid_name
00270          Type (Corner_Block), Pointer  :: corner_pointer
00271 
00272          Type (Enddef_mg), Pointer     :: mg_infos (:)
00273          Integer                       :: nlev
00274          Integer                       :: ijk0 (ndim_3d)
00275 
00276          Integer                       :: periodic(ndim_3d)
00277          Logical                       :: cyclic(ndim_3d)
00278          Integer                       :: len_periodic (ndim_3d)
00279 
00280          Integer                       :: nbr_halo_segments
00281          Type (Halo_info), Pointer     :: halo (:)
00282          !
00283          ! Specific for Gauss-reduced grids
00284          !
00285          Type (reduced_gauss_grid_data):: reduced_gauss_data
00286          Type (Corner_Block), Pointer  :: gcorner_pointer
00287          !
00288          ! Partition information
00289          !
00290          Integer, Pointer              :: partition(:,:)
00291          Integer, Pointer              :: extent(:,:)
00292          !
00293          ! Userdef interpolation : associated grid_id
00294          !
00295          Integer                       :: assoc_grid_id
00296 
00297       End Type Grid
00298 
00299 ! =======================================================================
00300 !
00301 !
00302 ! Derived type Method:
00303 !
00304 ! status                  : Status of the method information
00305 !                           (see PSMILe statuses above)
00306 !
00307 ! grid_id                 : Grid Id
00308 !
00309 ! used_for_coupling : Flag indicating whether the method is used for coupling
00310 !
00311 !
00312 ! previous_method_in_grid : points to the number of the previously
00313 !                           defined method in this grid
00314 !
00315 ! next_method_in_grid     : points to the number of the next
00316 !                           defined method in this grid
00317 !
00318 ! method_type             : PSMILe named integer to identify the method
00319 !                           points, subgrid or vector.
00320 !
00321 ! coords_pointer  : Pointer to the specific data of the coordinates
00322 !
00323 ! subgrid_pointer : Pointer to the specific data of the subgrids
00324 !
00325 ! vector_pointer  : Pointer to the specific data of the vector coordinate Ids
00326 !
00327 ! n_send_info_direct  : Number of pieces of send information for direct
00328 !                       sends to another component of an application process.
00329 ! n_send_info_coupler : Number of pieces of send information for transfers to
00330 !                       a coupler process.
00331 ! n_recv_info_direct  : Number of pieces of receive information for direct
00332 !                       receives from another component of an
00333 !                       application process.
00334 ! n_recv_info_coupler : Number of pieces of receive information for transfers
00335 !                       from a coupler process.
00336 ! n_send_info_appl    : Number of pieces of send information for transfers
00337 !                       to an application process (global search)
00338 !
00339 ! send_infos_direct  : Send    information for direct transfer to an
00340 !                      application process
00341 ! recv_infos_direct  : Receive information for direct transfer from an
00342 !                      application process
00343 ! send_infos_coupler : Send    information for  transfer to   a coupler process.
00344 ! recv_infos_coupler : Receive information for  transfer from a coupler process.
00345 !
00346 ! gauss2_dble/real   : Container for remote coordinates
00347 !
00348       Type Method
00349 
00350          Character (len=max_name)      :: point_name
00351 
00352          Integer                       :: status
00353          Integer                       :: grid_id
00354          Integer                       :: previous_method_in_grid
00355          Integer                       :: next_method_in_grid
00356          Integer                       :: method_type
00357 
00358          Integer                       :: size
00359          Logical                       :: used_for_coupling
00360 
00361          Integer                       :: n_send_info_direct
00362          Integer                       :: n_send_info_coupler
00363          Integer                       :: n_recv_info_direct
00364          Integer                       :: n_recv_info_coupler
00365          Integer                       :: n_send_info_appl
00366 
00367          Integer                       :: n_alloc_send_direct
00368          Integer                       :: n_alloc_send_coupler
00369          Integer                       :: n_alloc_recv_direct
00370          Integer                       :: n_alloc_recv_coupler
00371          Integer                       :: n_alloc_send_appl
00372 
00373          Type (Coords_Block),  Pointer :: coords_pointer
00374          Type (Subgrid_Block), Pointer :: subgrid_pointer
00375          Type (Vector_Block), Pointer  :: vector_pointer
00376          Type (Halo_Block), Pointer    :: halo_pointer (:)
00377 
00378          Type (Send_information), Pointer :: send_infos_direct  (:)
00379          Type (Send_information), Pointer :: send_infos_coupler (:)
00380          Type (Recv_information), Pointer :: recv_infos_direct  (:)
00381          Type (Recv_information), Pointer :: recv_infos_coupler (:)
00382          Type (Send_appl_information), Pointer :: send_infos_appl (:)
00383 
00384          Type (real_vector)            :: gauss2_real(2)
00385          Type (dble_vector)            :: gauss2_dble(2)
00386 #if defined ( PRISM_QUAD_TYPE )
00387          Type (quad_vector)            :: gauss2_quad(2)
00388 #endif
00389 
00390       End Type Method
00391 ! =======================================================================
00392 !
00393 ! Derived type Mask:
00394 !
00395 ! status                  : Status of the method information
00396 !                           (see PSMILe statuses above)
00397 !
00398 ! mask_shape              : actual range of the mask array
00399 !
00400       Type Mask
00401 
00402          Integer          :: status
00403          Integer          :: grid_id
00404          Integer          :: mask_type
00405          Integer          :: mask_shape (2, ndim_3d)
00406          Logical, Pointer :: mask_array (:)
00407 
00408       End Type Mask
00409 
00410 ! =======================================================================
00411 #ifdef __PSMILE_WITH_IO
00412 !
00413 ! Max. no. entries of the CF name table
00414 !
00415       Integer,Parameter :: PSMILE_IO_MAX_NO_NAMES=100
00416 !
00417 ! Max. IO unit allowed by the OS.
00418 ! (We should have a psmile_os.h!)
00419 !
00420       Integer,Parameter :: PSMILE_IO_MAX_UNIT=299
00421 !
00422 ! Max. file size threshold in kB
00423 !
00424       Integer,Parameter :: PSMILE_IO_MAX_FILE_SIZE=1024*1024
00425 !
00426 ! The total number of reserved units.
00427 !
00428       Integer,Parameter :: PSMILE_IO_MAX_RESERVED_UNITS=5
00429 !
00430 ! Reserved IO units. Keeps the IO units used for read(*),write(*) or
00431 ! vital I/O units used during the course of a simulation.
00432 !
00433       Integer :: 
00434       IO_res_units(PSMILE_IO_MAX_RESERVED_UNITS)=(/100,101,102,103,104/)
00435 !
00436 !  Internal stack for the MPP domains module
00437 !
00438       Integer,Parameter :: PSMILE_IO_stackmaxd=512*512*64
00439 !
00440 !  Internal stack for MPP io module
00441 !
00442       Integer,Parameter :: PSMILE_IO_stackmax=512*512*64
00443 !
00444 ! Some named integers to trigger certain inquire or get actions on SCC/SMIOC
00445 ! informations
00446 !
00447       Integer, Parameter :: PSMILe_IO_GET_FILENAME    = 1000
00448       Integer, Parameter :: PSMILe_IO_GET_FILEUNIT    = 1001
00449       Integer, Parameter :: PSMILe_IO_GET_ACTION      = 1002
00450       Integer, Parameter :: PSMILe_IO_GET_FORMAT      = 1003
00451       Integer, Parameter :: PSMILe_IO_GET_FILESET     = 1004
00452       Integer, Parameter :: PSMILe_IO_GET_THREADING   = 1005
00453       Integer, Parameter :: PSMILe_IO_GET_CFLNGNAME   = 1006
00454       Integer, Parameter :: PSMILe_IO_GET_CFSHRTNAME  = 1007
00455       Integer, Parameter :: PSMILe_IO_GET_CFUNITS     = 1008
00456       Integer, Parameter :: PSMILe_IO_GET_CFPOSITIVE  = 1009
00457       Integer, Parameter :: PSMILe_IO_GET_SENSE       = 1010
00458       Integer, Parameter :: PSMILe_IO_GET_PACK        = 1011
00459       Integer, Parameter :: PSMILe_IO_GET_TYPE_SPEC   = 1012
00460       Integer, Parameter :: PSMILe_IO_GET_SCALE       = 1013
00461       Integer, Parameter :: PSMILe_IO_GET_ADD         = 1014
00462       Integer, Parameter :: PSMILe_IO_GET_VALID_MIN   = 1015
00463       Integer, Parameter :: PSMILe_IO_GET_VALID_MAX   = 1016
00464       Integer, Parameter :: PSMILe_IO_GET_FILL        = 1017
00465       Integer, Parameter :: PSMILe_IO_GET_MISSING     = 1018
00466       Integer, Parameter :: PSMILe_IO_GET_NENTRIES    = 1019
00467       Integer, Parameter :: PSMILe_IO_GET_MENTRIES    = 1020
00468       Integer, Parameter :: PSMILe_IO_GET_LAGMODE     = 1021
00469       Integer, Parameter :: PSMILe_IO_GET_LAGWEIGHT   = 1022
00470       Integer, Parameter :: PSMILe_IO_GET_HEIGHTUNITS = 1023
00471       Integer, Parameter :: PSMILe_IO_GET_HEIGHTFORML = 1024
00472       Integer, Parameter :: PSMILe_IO_GET_HEIGHTSTDN  = 1025
00473       Integer, Parameter :: PSMILe_IO_GET_SUFFIX      = 1026
00474       Integer, Parameter :: PSMILe_IO_GET_CFIONAME    = 1027
00475       Integer, Parameter :: PSMILe_IO_GET_VCMPNAMES   = 1028
00476       Integer, Parameter :: PSMILe_IO_GET_BNDLNAMES   = 1029
00477       Integer, Parameter :: PSMILe_IO_GET_LONUNITS    = 1030
00478       Integer, Parameter :: PSMILe_IO_GET_LATUNITS    = 1031
00479 !
00480 ! Derived Type IO_App_info
00481 !
00482       Type IO_App_info
00483          Integer::comm
00484       End Type IO_App_info
00485 
00486       Type(IO_App_info)::IO_Apps_infos
00487 !
00488 ! Derived Type IO_Comp_info
00489 !
00490       Type IO_Comp_info
00491          Integer:: comm
00492          Integer,Pointer::pelist(:)
00493       End Type IO_Comp_info
00494 
00495       Type(IO_Comp_info),Allocatable::IO_Comps_infos(:)
00496 
00497 !
00498 ! Derived Type IO_CF_maps
00499 !
00500       Type IO_CF_maps
00501          Character(len=max_name) ::maps(PSMILE_IO_MAX_NO_NAMES)
00502          Integer  cf_tlb(PSMILE_IO_MAX_NO_NAMES)
00503       End Type IO_CF_maps
00504 !
00505       Type(IO_CF_maps),Target :: cf_maps
00506 !
00507 ! Derived Type IO_CF_names
00508 !
00509       Type IO_CF_names
00510          Character(len=max_name) :: names(PSMILE_IO_MAX_NO_NAMES)
00511          Integer  cf_tlb(PSMILE_IO_MAX_NO_NAMES)
00512       End Type IO_CF_names
00513 !
00514       Type(IO_CF_names),Target :: cf_names
00515 !
00516 ! Derived Type IO_cache
00517 !
00518       Type IO_Cache
00519          Double Precision,Dimension(:),Pointer::time_stamps
00520          Double Precision         :: ju_sec_last,ju_day_last 
00521                                    , time_last
00522          Double Precision,Dimension(:),Pointer::data_dble
00523          Real            ,Dimension(:),Pointer::data_real
00524          Integer         ,Dimension(:),Pointer::data_int
00525          Integer :: ilast  ! Last lower index of a matching time intervall
00526          Logical :: llast  ! Flag to trigger end of file processing
00527       End Type IO_Cache
00528 
00529       Type(IO_Cache), Allocatable,Target::iocache(:)
00530 !
00531 ! Derived Type IO_mpp_io
00532 !
00533       Type IO_mpp_io
00534 !
00535 ! Global data objects to keep axis and field definitions.
00536 ! Used by MPP_IO routines.
00537 !
00538          Type(domain2D),Pointer,Dimension(:)::domain
00539          Type(domain1D),Pointer,Dimension(:)::xdom,ydom,zdom
00540 !
00541 ! Global data objects to keep axis and field definitions.
00542 ! Used by MPP_IO routines.
00543 !
00544          Type(fieldtype),Pointer,Dimension(:) :: ig_vars,field,latij,lonij 
00545                                                 ,vertij,maskij,crnij,subaij
00546          Type(axistype),Pointer,Dimension(:)::x_axis,y_axis,z_axis,t_axis 
00547                                              ,b_axis,blk_axis,anaxis,crnaxis
00548          Type(atttype),Pointer,Dimension(:)::atts
00549          Integer :: findex(3)
00550 
00551       End Type IO_mpp_io
00552 #endif
00553 
00554 ! =======================================================================
00555 !
00556 ! Derived type IO_Data
00557 !
00558       Type IO_Data
00559          Character (len=max_name) :: filename
00560          Integer                  :: taskid
00561          Integer                  :: file_unit
00562          Integer                  :: isuffix
00563          Integer                  :: action
00564          Integer                  :: Format
00565          Integer                  :: threading
00566          Integer                  :: fileset
00567          Integer                  :: status
00568          Logical                  :: done,opened
00569          Integer                  :: block_id
00570          Integer,Pointer          :: related_ids(:)
00571          Integer                  :: old_filesize
00572          Integer                  :: current_filesize
00573          Double Precision         :: ju_start_day,ju_start_sec
00574          Double Precision,Pointer :: fp_dble(:)
00575          Real,Pointer             :: fp_real(:)
00576          Integer,Pointer          :: fp_int(:)
00577 !
00578          Character (len=max_name) :: cfioname
00579          Character (len=max_name) :: standard_name
00580          Character (len=max_name) :: long_name
00581          Character (len=max_name), Pointer :: labels(:)      ! For bundles !
00582          Character (len=max_name), Pointer :: vcmp_names(:)  ! For vectors !
00583          Character (len=max_name) :: units
00584          Character (len=max_name) :: lon_unit
00585          Character (len=max_name) :: lat_unit
00586          Character (len=max_name) :: positive
00587          Character (len=max_name) :: height_unit ! Where is the unit for height?
00588          Character (len=max_name) :: height_formular
00589          Character (len=max_name) :: height_stdname
00590          Integer                  :: sense
00591          Integer                  :: pack_mode
00592          Integer                  :: type_spec
00593          Integer                  :: ilag_mode
00594          Double Precision         :: scale,add
00595          Double Precision         :: valid_range(2),valid_min,valid_max
00596          Double Precision         :: fill_value,missing_value
00597          Double Precision         :: time_stamp
00598          Double Precision         :: weight
00599 !
00600          Integer                  :: cf_name_tlb_entry(8)
00601          Integer                  :: cf_map_tlb_entry(8)
00602 
00603 #ifdef __PSMILE_WITH_IO
00604          Type(IO_CF_names),Pointer      :: p_cf_names
00605          Type(IO_CF_maps),Pointer       :: p_cf_maps
00606          Type(IO_cache),Pointer         :: p_cache
00607          Type(IO_mpp_io),Pointer        :: p_mpp_io
00608 #endif
00609       End Type IO_Data
00610 
00611 ! =======================================================================
00612 !
00613 ! Derived Type PSMILe_Time_Struct
00614 !
00615 !   Time struct used internally by PSMILe. All PRISM time structs
00616 !    are converted to PSMILe time struct where appropriate for further
00617 !    processing
00618 
00619       Type PSMILe_Time_Struct
00620          Double Precision          :: days
00621          Double Precision          :: secs
00622       End Type PSMILe_Time_struct
00623 
00624 ! =======================================================================
00625 !
00626 ! Derived Types for GridFunction
00627 !
00628 ! origin_type         Input comes from component (PSMILe_comp)
00629 !                     or file (PSMILe_file)
00630 ! remote_transi_id    Field id at the source/destination
00631 !                     ? Was soll das sein ?
00632 ! global_transi_id    Global field id for transient_in/transient_out
00633 ! start_day           day lower bound for summation period
00634 ! end_day             day upper bound for summation period
00635 ! start_sec           second lower bound for summation period
00636 ! end_sec             second upper bound for summation period
00637 ! nsum                number of summations done
00638 ! requested           switch to distinguish between calls to prism_check_action
00639 !                     invoked from prism_put and prism_put_inquire
00640 ! Time_length         Length of time axis (number of coupling steps)
00641 !                     for a job
00642 ! buffer_*            buffers for summation and other operation
00643 !                     on input data
00644 ! delta_time          coupling frequency from SMIOC XML
00645 ! Judate_Axis         Array of length Time_length containing the
00646 !                     coupling time steps
00647 ! Judate_Event        Time of next event for a particular field and channel
00648 !
00649 ! Judate_Lbnd         Storage of lower date bound to chenck consistency
00650 !                     between prism_put and prism_get
00651 ! Judate_Ubnd         Auxillary to check for time gaps in bounds
00652 !                     between two consecutive call to put/get
00653 !                     Storage of lower date bound to chenck consistency
00654 !                     between prism_put and prism_get
00655 !
00656       Type Interp_type
00657          Integer                     :: interp_type
00658          Integer, Dimension(3)       :: interp_meth
00659          Integer, Dimension(3)       :: arg1
00660          Integer, Dimension(3)       :: arg2
00661          Integer, Dimension(3)       :: arg3
00662          Integer, Dimension(3)       :: arg4
00663          Integer, Dimension(3)       :: arg5 ! use_masked for nnghbr3D/2D/1D
00664          Integer, Dimension(3)       :: arg6
00665          Integer, Dimension(3)       :: arg7
00666          Double Precision            :: arg8
00667          Character(len=max_name)     :: arg9
00668          Type (PSMILe_file_struct)   :: arg10
00669       End Type Interp_type
00670 
00671       Type Combi_type
00672          Character(len=max_name)      :: combi_name
00673          Character(len=max_name)      :: ext_mask_name
00674 !RV         Type (PSMILe_file_struct)    :: ext_mask_file do we need this?
00675          Double Precision             :: combi_param
00676          Double Precision             :: scalar
00677          Integer                      :: location
00678          Integer                      :: operand
00679          Integer                      :: mask_type
00680          Integer                      :: combi_meth
00681       End Type Combi_type
00682 
00683       Type ch_ptr
00684          Integer                   :: origin_type
00685          Integer                   :: remote_transi_id
00686          Integer                   :: global_transi_id
00687          Integer                   :: remote_comp_id
00688 !     if User defined interpolation
00689          Integer                   :: assoc_var_id
00690          Integer                   :: userdef_id
00691 !
00692          Type (Interp_type)        :: interp
00693          Type (Combi_type)         :: combi
00694       End Type ch_ptr
00695 
00696       Type Taskin_type
00697          Double Precision          :: start_day
00698          Double Precision          :: end_day
00699          Double Precision          :: start_sec
00700          Double Precision          :: end_sec
00701 
00702          Integer                   :: nbr_inchannels
00703          Integer                   :: nsum
00704          Integer, Pointer          :: buffer_int(:)
00705          Real, Pointer             :: buffer_real(:)
00706          Double Precision, Pointer :: buffer_dble(:)
00707 #if defined ( PRISM_QUAD_TYPE )
00708          Real (kind=PRISM_QUAD_TYPE), Pointer :: buffer_quad(:)
00709 #endif
00710          Type (PRISM_Time_Struct)  :: delta_time
00711          Type (PSMILe_Time_Struct) :: Judate_Start
00712          Type (PSMILe_Time_Struct) :: Judate_Stop
00713          Type (PSMILe_Time_Struct) :: Judate_Event
00714          Type (PSMILe_Time_Struct) :: Judate_Lbnd
00715          Type (PSMILe_Time_Struct) :: Judate_Ubnd
00716          Type (ch_ptr), Pointer    :: In_channel(:)
00717 
00718          Integer                   :: n_recv_direct
00719          Integer                   :: n_recv_coupler
00720 
00721          Integer                   :: n_alloc_recv_direct
00722          Integer                   :: n_alloc_recv_coupler
00723 
00724          Type (Recv_field_information), Pointer :: recv_direct  (:)
00725          Type (Recv_field_information), Pointer :: recv_coupler (:)
00726 
00727       End Type Taskin_type
00728 
00729 !........................................................................
00730 
00731       Type Taskout_type
00732          Integer                   :: origin_type
00733          Integer                   :: remote_transi_id
00734          Integer                   :: global_transi_id
00735          Integer                   :: remote_comp_id
00736 !
00737 !    Userdef ids (if interpolation is "user3D")
00738          Integer                   :: assoc_var_id
00739          Integer                   :: userdef_id
00740 
00741          Double Precision          :: start_day
00742          Double Precision          :: end_day
00743          Double Precision          :: start_sec
00744          Double Precision          :: end_sec
00745          Integer                   :: nsum
00746          Integer, Pointer          :: buffer_int(:)
00747          Real, Pointer             :: buffer_real(:)
00748          Double Precision, Pointer :: buffer_dble(:)
00749 #if defined ( PRISM_QUAD_TYPE )
00750          Real (kind=PRISM_QUAD_TYPE), Pointer :: buffer_quad(:)
00751 #endif
00752          Logical                   :: requested
00753 
00754          Type (PRISM_Time_Struct)  :: delta_time
00755          Type (PSMILe_Time_Struct) :: Judate_Start
00756          Type (PSMILe_Time_Struct) :: Judate_Stop
00757          Type (PSMILe_Time_Struct) :: Judate_Event
00758          Type (PSMILe_Time_Struct) :: Judate_Lbnd
00759          Type (PSMILe_Time_Struct) :: Judate_Ubnd
00760          Type (Interp_type)        :: interp
00761          Type (Combi_type)         :: combi
00762 
00763          Integer                   :: n_send_direct
00764          Integer                   :: n_send_coupler
00765          Integer                   :: n_send_appl
00766 
00767          Integer                   :: n_alloc_send_direct
00768          Integer                   :: n_alloc_send_coupler
00769          Integer                   :: n_alloc_send_appl
00770 
00771          Type (Send_field_information), Pointer :: send_direct  (:)
00772          Type (Send_field_information), Pointer :: send_coupler (:)
00773          Type (Send_field_information), Pointer :: send_appl (:)
00774 
00775       End Type Taskout_type
00776 
00777 !........................................................................
00778 !
00779 ! Types for cell-based search
00780 !
00781       Type memo
00782          Integer :: i
00783          Integer :: j
00784          Integer :: dir
00785          Logical :: overlap
00786       End Type memo
00787 
00788       Type point_real
00789          Real :: x
00790          Real :: y
00791       End Type point_real
00792 
00793       Type point_dble
00794          Double Precision :: x
00795          Double Precision :: y
00796       End Type point_dble
00797 
00798       Type line_dble
00799          Type(point_dble) :: p1
00800          Type(point_dble) :: p2
00801       End Type line_dble
00802 
00803       Type line_real
00804          Type(point_real) :: p1
00805          Type(point_real) :: p2
00806       End Type line_real
00807 
00808 ! =======================================================================
00809 !
00810 ! Derived Type GridFunction
00811 !
00812 ! global_var_id     : Global id of transient variable.
00813 ! local_name        : for matching with SMIO
00814 !
00815 ! comp_id           : Handle to the component information.
00816 ! smioc_loc         : Element number in the SMIOC list
00817 ! grid_id           : Handle to the grid information.
00818 !                     ?? Wieso steht die drin ? Ergibt die sich nicht aus der
00819 !                        method_id ? Das gleiche fuer comp_id ?
00820 ! method_id         : Handle to the location where the grid function is defined.
00821 ! mask_id           : Handle to the mask information of variable.
00822 !                     May be PRISM_UNDEFINED if a mask is not defined.
00823 !
00824 ! transi_type       : Transient type (single/bundle/vector/vectorbundle)
00825 !
00826 ! used_for_coupling : Flag indicating whether the field is used for coupling
00827 ! used_for_io       : Flag indicating whether the field is used for file IO
00828 !
00829 ! Exchange data with fields of another component:
00830 !
00831 ! n_send_direct     : Number of messages to be directly sent to an
00832 !                     application process.
00833 ! n_send_coupler    : Number of messages to be sent to a coupler process.
00834 !
00835 ! n_recv_direct     : Number of messages to be directly received by an
00836 !                     application process.
00837 ! n_recv_coupler    : Number of messages to be received by an coupler process.
00838 !
00839       Type GridFunction
00840 
00841          Integer                   :: global_var_id
00842          Integer                   :: smioc_loc
00843          Integer                   :: status
00844          Integer                   :: comp_id
00845          Integer                   :: method_id
00846          Integer                   :: mask_id
00847          Integer                   :: var_shape (2, max_dim)
00848          Integer                   :: transi_type
00849          Integer                   :: size
00850          Integer                   :: dataType
00851 
00852          Logical                   :: used_for_coupling
00853          Logical                   :: used_for_io
00854 
00855          Character (len=max_name)  :: local_name
00856 
00857          Type (Taskout_type), Pointer :: Taskout(:)
00858          Type (Taskin_type)           :: Taskin
00859 
00860          Type (IO_Data), Pointer          :: io_infos
00861          Type (IO_Data), Pointer          :: io_chan_infos(:)
00862          Integer, Pointer                 :: io_task_lookup(:)
00863 
00864       End Type GridFunction
00865 
00866 ! =======================================================================
00867 !
00868 ! Derived type TimeStep
00869 !
00870       Type TimeStep
00871 
00872           Integer           n_send
00873           Integer           n_recv
00874           Integer           n_write
00875           Integer           n_read
00876 
00877           Integer, Dimension (:), Pointer :: ids_send
00878           Integer, Dimension (:), Pointer :: ids_recv
00879           Integer, Dimension (:), Pointer :: ids_write
00880           Integer, Dimension (:), Pointer :: ids_read
00881 
00882       End  Type TimeStep
00883 
00884 ! =======================================================================
00885 !
00886 ! Derived type GridConnection to store info about source and target grid relations
00887 !
00888       Type GridConnection
00889 
00890          Integer :: status
00891 
00892          Integer :: tgt_comp_id
00893          Integer :: tgt_grid_id
00894          Integer :: tgt_method_id
00895          Integer :: tgt_mask_id
00896 
00897          Integer :: src_comp_id
00898          Integer :: src_grid_id
00899          Integer :: src_method_id
00900          Integer :: src_mask_id
00901 
00902          Integer :: trans_out
00903          Integer :: trans_in
00904 
00905          Integer :: interpolation(ndim_3d)
00906 
00907          Integer :: epio_id
00908          Integer :: trs_rank
00909 
00910          Integer :: tgt_epio_pe
00911 
00912       End Type GridConnection
00913 
00914 
00915 ! =======================================================================
00916 !
00917 ! Derived type Userdef to store info on user-defined links for interpolation
00918 !
00919 ! var_id            : global index in the Fields array of the geographic variable
00920 !
00921 ! igl_grid_id       : grid id of the gridless grid built from the user defined links
00922 !
00923 ! status            : status of this entry
00924 !
00925 ! ig_transi_side    : 0 for the source side (Tranient Out)
00926 !                     1 for the target side (Transient In)
00927 !
00928 ! ig_nb_links       : number of links defined in the weight and addresses file
00929 !
00930 ! ig_celldim        : number of dimensions of geographical cells
00931 !                     (can be 1, 2 or 3, and depend on side)
00932 !
00933 ! ig_nb_ppp         : number of links relevant to the partition of this PE
00934 !
00935 ! ig_nbr_fields     : number of "bundles" of geographic function (>= 1)
00936 !
00937 ! lg_nolink         : .true. for a PE having no geographic point in its partition
00938 ! (obsolete...)              to match with any user-defined link
00939 !
00940 ! iga_igl(:,:)      : list of indexes of geographical grid (local to partition)
00941 !                     the list of indexes stored in iga_igl concerns only one side
00942 !                     either the source side (for the prism_put)
00943 !                     or the target side (for the prism_get)
00944 !
00945 ! iga_links(:)      : list of links defined by the user (local to partition)
00946 !                     the list stored in iga_links concern only one side :
00947 !                     either the source side, or the target side
00948 !
00949 ! trans_grless(:,:,:,:) : Local non continuous gridless function based on
00950 !                         the geographic function and the links in w&a file
00951 !
00952       Type Userdef
00953 
00954         Integer :: var_id
00955         Integer :: igl_grid_id
00956         Integer :: status
00957         Integer :: ig_transi_side
00958         Integer :: ig_nb_links
00959         Integer :: ig_celldim
00960         Integer :: ig_nb_ppp
00961         Integer :: ig_nbr_fields
00962 
00963 !       Logical :: lg_nolink
00964 
00965         Integer, pointer                  :: iga_igl(:,:)
00966         Real (PSMILe_float_kind), pointer :: dga_wght(:)
00967 !
00968         REAL, pointer   :: real_gridless(:,:,:,:)
00969         DOUBLE PRECISION, pointer   :: dble_gridless(:,:,:,:)
00970 
00971       End Type Userdef
00972 
00973 ! =======================================================================
00974 !
00975 ! Derived type PSMILe_Link  to store info about each link defined by user
00976 !
00977 ! cell_id(3)        : indexes of the geographical cell in the 3 dimensions
00978 !
00979 ! weight            : weight attached to the geographical field value
00980 
00981       Type PSMILe_Link
00982 
00983         Integer :: cell_id(3)
00984         Real (PSMILe_float_kind) :: weight
00985 
00986       End Type PSMILe_Link
00987 
00988 ! ----------------------------------------------------------------------------
00989 ! Global attributes
00990 ! ----------------------------------------------------------------------------
00991 
00992       Save
00993 !
00994 ! Allocatable arrays:
00995 !
00996 ! PRISM_applProc       : Number of processes per application with
00997 !                        PRISM_applProc (0) = Number of Coupler processes
00998 ! PRISM_applName       : Names of the applications with
00999 !                        PRISM_applName (0) = Name of the coupler
01000 ! PRISM_compName       : Names of the components
01001 ! PRISM_noCompsPerAppl : Nuber of components per application
01002 !
01003 ! Appl                 : Pointer to application type vector
01004 ! Comps                : Pointer to component type vector
01005 ! Grids                : Pointer to grid type type vector
01006 ! Methods              : Pointer to method type vector
01007 ! Masks                : Pointer to mask type vector
01008 ! Fields               : Pointer to grid function type vector
01009 ! Cpl_list             : Pointer to coupling grid relations
01010 !
01011 ! all_comp_infos       : Collected info's to all components within PRISM_Enddef.
01012 ! comp_infos           : Infos on the components (located on the actual process).
01013 !                        The entries of "comp_info" are sorted by the
01014 !                        global comp id.
01015 ! field2grid           : Mapping of global var id into global grid id
01016 ! paction              :
01017 !
01018       Integer,                 Allocatable :: PRISM_applProc(:)
01019       Integer,                 Allocatable :: PRISM_noCompsPerAppl(:)
01020 
01021       Integer,                 Allocatable :: PRISM_compRankSets(:)
01022       Integer,                 Allocatable :: PRISM_rankSets(:,:)
01023 
01024       Character(len=max_name), Allocatable :: PRISM_applName(:)
01025       Character(len=max_name), Allocatable :: PRISM_compName(:)
01026 !
01027       Type (Enddef_comp),      Allocatable, Target :: all_comp_infos(:)
01028       Type (Enddef_comp),      Allocatable, Target :: comp_infos(:)
01029       Type (Enddef_action)                 :: paction
01030       Integer,                 Allocatable :: field2grid (:)
01031 !
01032 ! Pointers to dynamically allocated arrays
01033 !
01034       Type (Component),        Pointer     :: Comps(:)
01035       Type (Grid),             Pointer     :: Grids(:)
01036       Type (Method),           Pointer     :: Methods(:)
01037       Type (Mask),             Pointer     :: Masks(:)
01038       Type (GridFunction),     Pointer     :: Fields(:)
01039       Type (Userdef),          Pointer     :: Userdefs(:)
01040 
01041       Type (TimeStep),         Pointer     :: Timesteps_info(:)
01042       Double Precision,        Pointer     :: Timesteps(:)
01043 
01044       Integer,                 Pointer     :: neighcells_3d(:,:,:)
01045       Type (GridConnection),   Pointer     :: cpl_list(:)
01046 !
01047 !-----------------------------------------------------------------------
01048 ! Interfaces of internal PSMILe routines
01049 ! ----------------------------------------------------------------------------
01050 
01051     Interface
01052 
01053       subroutine psmile_def_grid(grid_id, grid_name, comp_id, &
01054                                  grid_valid_shape, grid_type, ierror )
01055 
01056          character(len=*), intent(in) :: grid_name
01057          integer, intent (in)         :: comp_id
01058          integer, intent (in)         :: grid_valid_shape (1:2,*)
01059          integer, intent (in)         :: grid_type
01060          integer, intent (out)        :: grid_id
01061          integer, intent (out)        :: ierror
01062       end subroutine psmile_def_grid
01063 
01064       subroutine psmile_def_partition (grid_id, nbr_blocks, &
01065                                        partition_array, extent_array, ierror )
01066          integer, intent (in)  :: grid_id
01067          integer, intent (in)  :: nbr_blocks
01068          integer, intent (in)  :: partition_array(1:nbr_blocks,*)
01069          integer, intent (in)  :: extent_array(1:nbr_blocks,*)
01070          integer, intent (out) :: ierror
01071       end subroutine psmile_def_partition
01072 
01073       subroutine psmile_reducedgrid_map (grid_id, nbr_latitudes, &
01074                                          nbr_points_per_lat, ierror)
01075          integer, intent (in)  :: grid_id
01076          integer, intent (in)  :: nbr_latitudes
01077          integer, intent (in)  :: nbr_points_per_lat(nbr_latitudes)
01078          integer, intent (out) :: ierror
01079       end subroutine psmile_reducedgrid_map
01080 
01081       subroutine psmile_set_corners_3d_double(grid_id, nbr_corners, corners_actual_shape, &
01082                corners_1st_array, corners_2nd_array, corners_3rd_array, ierror)
01083 
01084          integer, intent (in)          :: grid_id
01085          integer, intent (in)          :: nbr_corners
01086          double precision, intent (in) :: corners_1st_array (*)
01087          double precision, intent (in) :: corners_2nd_array (*)
01088          double precision, intent (in) :: corners_3rd_array (*)
01089          integer, intent (in)          :: corners_actual_shape (1:2, *)
01090          integer, intent(out)          :: ierror
01091       end subroutine psmile_set_corners_3d_double
01092 
01093       subroutine psmile_set_corners_3d_real(grid_id, nbr_corners, corners_actual_shape, &
01094                corners_1st_array, corners_2nd_array, corners_3rd_array, ierror)
01095 
01096          integer, intent (in) :: grid_id
01097          integer, intent (in) :: nbr_corners
01098          real, intent (in)    :: corners_1st_array (*)
01099          real, intent (in)    :: corners_2nd_array (*)
01100          real, intent (in)    :: corners_3rd_array (*)
01101          integer, intent (in) :: corners_actual_shape (1:2, *)
01102          integer, intent(out) :: ierror
01103       end subroutine psmile_set_corners_3d_real
01104 
01105       subroutine psmile_set_mask (mask_id, grid_id, mask_actual_shape, &
01106                                   mask_array, new_mask, ierror)
01107          integer, intent(inout) :: mask_id
01108          integer, intent(in)    :: grid_id
01109          integer, intent(in)    :: mask_actual_shape(2, *)
01110          logical, intent(in)    :: mask_array (*)
01111          logical, intent(in)    :: new_mask
01112          integer, intent(out)   :: ierror
01113       end subroutine psmile_set_mask
01114 
01115       subroutine psmile_set_points_gridless (point_id, point_name, grid_id, &
01116                                              new_points, ierror)
01117          character (len=*), intent(in)    :: point_name
01118          integer,           intent(in)    :: grid_id
01119          integer,           intent(inout) :: point_id
01120          logical,           intent(in)    :: new_points
01121          integer,           intent(out)   :: ierror
01122       end subroutine psmile_set_points_gridless
01123 
01124       subroutine psmile_set_points_3d_double (method_id, point_name, grid_id, points_actual_shape, &
01125                            points_1st_array, points_2nd_array, points_3rd_array, new_points, ierror)
01126          character (len=*), intent(in):: point_name
01127          integer, intent(in)          :: grid_id
01128          integer, intent(inout)       :: method_id
01129          double precision, intent(in) :: points_1st_array(*)
01130          double precision, intent(in) :: points_2nd_array(*)
01131          double precision, intent(in) :: points_3rd_array(*)
01132          integer, intent(in)          :: points_actual_shape (2, *)
01133          logical, intent(in)          :: new_points
01134          integer, intent(out)         :: ierror
01135       end subroutine psmile_set_points_3d_double
01136 
01137       subroutine psmile_set_points_3d_real (method_id, point_name, grid_id, points_actual_shape, &
01138                            points_1st_array, points_2nd_array, points_3rd_array, new_points, ierror)
01139          character (len=*), intent(in) :: point_name
01140          integer, intent(in)           :: grid_id
01141          integer, intent(inout)        :: method_id
01142          real, intent(in)              :: points_1st_array(*)
01143          real, intent(in)              :: points_2nd_array(*)
01144          real, intent(in)              :: points_3rd_array(*)
01145          integer, intent(in)           :: points_actual_shape (2, *)
01146          logical, intent(in)           :: new_points
01147          integer, intent(out)          :: ierror
01148       end subroutine psmile_set_points_3d_real
01149 
01150       subroutine psmile_def_var (var_id, var_name, grid_id, point_id, mask_id, &
01151                                  var_nodims, var_actual_shape, var_type, ierror)
01152          character (len=*), intent (in) :: var_name
01153          integer, intent (in)           :: mask_id
01154          integer, intent (in)           :: point_id
01155          integer, intent (in)           :: grid_id
01156          integer, intent (in)           :: var_nodims(2)
01157          integer, intent (in)           :: var_actual_shape(1:2,1:var_nodims(1))
01158          integer, intent (in)           :: var_type
01159          integer, intent (out)          :: var_id
01160          integer, intent (out)          :: ierror
01161       end subroutine psmile_def_var
01162 
01163 ! Flush stdout/stderr
01164 
01165     subroutine psmile_flushstd ()
01166     End Subroutine
01167 
01168     subroutine psmile_redirstdout (charbuf, lenstr, parallel, my_pe, npes, ierror)
01169 #ifdef NAG_COMPILER
01170        Character(len=*), Intent(In)   :: charbuf
01171 #else
01172        Integer, Intent (In)           :: charbuf (*)
01173 #endif
01174        Integer, Intent (In)           :: lenstr, parallel, my_pe, npes
01175        Integer, Intent (Out)          :: ierror
01176     End Subroutine
01177 
01178 ! Internal control
01179 
01180     subroutine psmile_assert (file, line, msg)
01181        Character (len=*), Intent (In) :: file, msg
01182        Integer, Intent (In)           :: line
01183     End Subroutine
01184 
01185    function psmile_transform_index_1d_to_3d (index_1d, array_shape)
01186       use psmile_common, only : ndim_3d
01187       integer, intent(in) :: index_1d
01188       integer, intent(in) :: array_shape (2, ndim_3d)
01189       integer :: psmile_transform_index_1d_to_3d (ndim_3d)
01190    end function psmile_transform_index_1d_to_3d
01191 
01192    function psmile_transform_index_3d_to_1d (index_3d, array_shape)
01193       use psmile_common, only : ndim_3d
01194       integer, intent(in) :: index_3d(ndim_3d)
01195       integer, intent(in) :: array_shape (2, ndim_3d)
01196       integer :: psmile_transform_index_3d_to_1d
01197    end function psmile_transform_index_3d_to_1d
01198 
01199     subroutine psmile_check_action ( var_id, task_id, precise, &
01200                                      julian_day, julian_dayb,  &
01201                                      julian_sec, julian_secb,  &
01202                                      action )
01203        Integer, Intent (In)  :: var_id
01204        Integer, Intent (In)  :: task_id
01205        Double Precision, Intent (In) :: julian_day, julian_dayb(2)
01206        Double Precision, Intent (In) :: julian_sec, julian_secb(2)
01207        Logical, Intent (In)  :: precise
01208        Logical, Intent (Out) :: action(3)
01209     End Subroutine
01210 
01211 ! Internal error handling
01212 
01213     subroutine psmile_error (ierror, string, ierrp, nerrp, file, line)
01214        Character (len=*), Intent (In) :: file, string
01215        Integer, Intent (In)           :: line, ierror, nerrp
01216        Integer, Intent (In)           :: ierrp (nerrp)
01217     End Subroutine
01218 
01219     subroutine psmile_warning (ierror, string, ierrp, nerrp, file, line)
01220        Character (len=*), Intent (In) :: file, string
01221        Integer, Intent (In)           :: line, ierror, nerrp
01222        Integer, Intent (In)           :: ierrp (nerrp)
01223     End Subroutine
01224 
01225 ! Get handle
01226 !
01227     subroutine psmile_deallocate (ierror)
01228        Integer, Intent (Out)            :: ierror
01229     End Subroutine
01230 
01231     subroutine psmile_deallocate_methods (ierror)
01232        Integer, Intent (Out)            :: ierror
01233     end subroutine
01234 
01235     subroutine psmile_deallocate_fields (ierror)
01236        Integer, Intent (Out)            :: ierror
01237     end subroutine
01238 
01239     subroutine psmile_deallocate_masks (ierror)
01240        Integer, Intent (Out)            :: ierror
01241     end subroutine
01242 !
01243     subroutine psmile_find_corr_field (comp_info, search, &
01244                                        var_id, ierror)
01245        Use PSMILe_common
01246 !
01247        Type (Enddef_comp), Intent (In)   :: comp_info
01248        Type (Enddef_search), Intent (In) :: search
01249        Integer, Intent (Out)             :: var_id
01250        Integer, Intent (Out)             :: ierror
01251     End Subroutine
01252 
01253     subroutine psmile_free_comp_handle (comp_id, ierror)
01254        Integer, Intent (In)            :: comp_id
01255        Integer, Intent (Out)           :: ierror
01256     End Subroutine
01257 
01258     subroutine psmile_free_field_handle (field_id, ierror)
01259        Integer, Intent (In)            :: field_id
01260        Integer, Intent (Out)           :: ierror
01261     End Subroutine
01262 
01263     subroutine psmile_free_grid_handle (grid_id, ierror)
01264        Integer, Intent (In)            :: grid_id
01265        Integer, Intent (Out)           :: ierror
01266     End Subroutine
01267 
01268     subroutine psmile_free_mask_handle (mask_id, grid_id, ierror)
01269        Integer, Intent (In)            :: mask_id
01270        Integer, Intent (Out)           :: grid_id
01271        Integer, Intent (Out)           :: ierror
01272     End Subroutine
01273 
01274     subroutine psmile_free_method_handle (method_id, ierror)
01275        Integer, Intent (In)            :: method_id
01276        Integer, Intent (Out)           :: ierror
01277     End Subroutine
01278 !
01279     subroutine psmile_get_comp_handle (comp_id, comp_name, ierror)
01280        Character (len=*), Intent (In)  :: comp_name
01281        Integer, Intent (Out)           :: comp_id, ierror
01282     End Subroutine
01283 !
01284     subroutine psmile_get_exch_index (var_id, task_id, request, index, ierror)
01285        Integer, Intent (In)            :: var_id, task_id, request
01286        Integer, Intent (Out)           :: ierror, index
01287     End Subroutine
01288 !
01289     subroutine psmile_get_info_index (method_id, request, index, ierror)
01290        Integer, Intent (In)            :: method_id, request
01291        Integer, Intent (Out)           :: ierror, index
01292     End Subroutine
01293 !
01294     subroutine psmile_get_epio_handle ( comp_id, grid_id, method_id,   &
01295                                         mask_id, interpolation,        &
01296                                         msg_intersections, trans_out,  &
01297                                         trans_in, tgt_epio_pe, cpl_id, &
01298                                         epio_id, trs_rank, ierror)
01299        Use PSMILe_common
01300        Integer, Intent (In)                         :: comp_id
01301        Integer, Intent (In)                         :: grid_id
01302        Integer, Intent (In)                         :: method_id
01303        Integer, Intent (In)                         :: mask_id
01304        Integer, Intent (In)                         :: interpolation(ndim_3d)
01305        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
01306        Integer, Intent (In)                         :: trans_out
01307        Integer, Intent (In)                         :: trans_in
01308        Integer, Intent (In)                         :: tgt_epio_pe
01309        Integer, Intent (Out)                        :: cpl_id
01310        Integer, Intent (Out)                        :: epio_id
01311        Integer, Intent (Out)                        :: trs_rank
01312        Integer, Intent (Out)                        :: ierror
01313     End Subroutine
01314 !
01315     subroutine psmile_get_field_handle (field_id, ierror)
01316        Integer, Intent (Out)           :: field_id, ierror
01317     End Subroutine
01318 !
01319     subroutine psmile_get_grid_handle (grid_id, ierror)
01320        Integer, Intent (Out)           :: grid_id, ierror
01321     End Subroutine
01322 !
01323     Subroutine PSMILe_Get_userdef_handle (userdef_id, ierror)
01324        Integer, Intent (Out)           :: userdef_id, ierror
01325     End Subroutine
01326 
01327     subroutine psmile_get_halo_indices ( comp_id, grid_id_list, ierror)
01328       Use PSMILe_common
01329       Integer, Intent (In)         :: comp_id
01330       Integer, Intent (In)         :: grid_id_list(Number_of_Grids_allocated)
01331       Integer, Intent (Out)        :: ierror
01332     End Subroutine
01333 !
01334     subroutine psmile_get_halo_points (comp_id, ierror)
01335       Integer, Intent (In)         :: comp_id
01336       Integer, Intent (Out)        :: ierror
01337     End Subroutine
01338 !
01339     subroutine psmile_get_mask_handle (mask_id, ierror)
01340        Integer, Intent (Out)           :: mask_id, ierror
01341     End Subroutine
01342 !
01343     subroutine psmile_get_method_handle (grid_id, method_id, ierror)
01344        Integer, Intent (In)            :: grid_id
01345        Integer, Intent (Out)           :: method_id, ierror
01346     End Subroutine
01347 !
01348     subroutine psmile_get_next_field (comp_info, search, field_list, n_vars, &
01349                                       n_vars_ret, var_id, ierror)
01350        Use PSMILe_common
01351 !
01352        Type (Enddef_comp),   Intent (In)     :: comp_info
01353        Type (Enddef_search), Intent (InOut)  :: search
01354        Integer, Intent (In)                  :: n_vars
01355        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
01356        Integer, Intent (InOut)               :: n_vars_ret
01357        Integer, Intent (Out)                 :: ierror, var_id
01358     End Subroutine
01359 !
01360     subroutine psmile_print_comp_info (cinfos, n_comps, string)
01361        Use PSMILe_common
01362 !
01363        Integer,            Intent (In) :: n_comps
01364        Type (enddef_comp), Intent (In) :: cinfos (n_comps)
01365        Character(len=*),   Intent (In) :: string
01366     End Subroutine
01367 !
01368     subroutine psmile_print_field_info (field_id)
01369        Integer, Intent (In)            :: field_id
01370     End Subroutine
01371 
01372     subroutine psmile_print_grid_info (grid_id)
01373        Integer, Intent (In)            :: grid_id
01374     End Subroutine
01375 !
01376     subroutine psmile_print_method_info (method_id)
01377        Integer, Intent (In)            :: method_id
01378     End Subroutine
01379 !
01380     subroutine psmile_print_send_info (method_id, incloc, message)
01381        Integer, Intent (In)            :: method_id, incloc
01382        Character (len=*), Intent (In)  :: message
01383     End Subroutine
01384 !
01385     subroutine psmile_store_send_info (var_id, id_trans_out, dir_index, cpl_index, &
01386                                        appl_index, ierror)
01387        Integer, Intent (In)            :: var_id, id_trans_out
01388        Integer, Intent (In)            :: dir_index, cpl_index, appl_index
01389        Integer, Intent (Out)           :: ierror
01390     End Subroutine
01391 
01392 ! Initialization
01393 
01394     subroutine psmile_init_datatypes (ierror)
01395        Integer, Intent (Out)           :: ierror
01396     End Subroutine
01397 
01398     subroutine psmile_init_mpi2 (intercomm, ierror)
01399        Integer, Intent (InOut)         :: intercomm
01400        Integer, Intent (Out)           :: ierror
01401     End Subroutine
01402 
01403     subroutine psmile_init_mpi1 (ierror)
01404        Integer, Intent (Out)           :: ierror
01405     End Subroutine
01406 
01407     subroutine psmile_def_datatypes (ierror)
01408        Integer, Intent (Out)           :: ierror
01409     End Subroutine
01410 
01411     subroutine psmile_def_mpi_comm (ierror)
01412        Integer, Intent (Out)           :: ierror
01413     End Subroutine
01414 
01415     subroutine psmile_def_mpi_compcomm (ierror)
01416        Integer, Intent (Out)           :: ierror
01417     End Subroutine
01418 
01419     subroutine psmile_spawn_child_appl (intracomm, intercomm, ierror)
01420        Integer, Intent (In)            :: intracomm
01421        Integer, Intent (Out)           :: intercomm
01422        Integer, Intent (Out)           :: ierror
01423     End Subroutine
01424 
01425 ! Control data structures
01426 
01427     subroutine psmile_control_grids (ierror)
01428        Integer, Intent (Out)           :: ierror
01429     End Subroutine
01430 
01431 ! Utilities for mask arrays
01432 
01433     subroutine psmile_get_true_mask_entries (mask_array, mask_shape,       &
01434                                              inter, n_true, ierror)
01435        Use PSMILe_common
01436        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
01437        Logical, Intent (In)            :: mask_array (                     
01438                                           mask_shape(1,1):mask_shape(2,1), 
01439                                           mask_shape(1,2):mask_shape(2,2), 
01440                                           mask_shape(1,3):mask_shape(2,3))
01441        Integer, Intent (In)            :: inter (2, ndim_3d)
01442        Integer, Intent (Out)           :: n_true, ierror
01443     End Subroutine
01444 
01445     subroutine psmile_is_mask_defined (mask_array, mask_shape,       &
01446                                        inter, nparts, defined, ierror)
01447        Use PSMILe_common
01448        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
01449        Logical, Intent (In)            :: mask_array (                     
01450                                           mask_shape(1,1):mask_shape(2,1), 
01451                                           mask_shape(1,2):mask_shape(2,2), 
01452                                           mask_shape(1,3):mask_shape(2,3))
01453        Integer, Intent (In)            :: nparts
01454        Integer, Intent (In)            :: inter (2, ndim_3d, nparts)
01455        Integer, Intent (Out)           :: defined, ierror
01456     End Subroutine
01457 
01458     subroutine psmile_do_masks_match (mask1_array, mask1_shape,       &
01459                                       mask2_array, mask2_shape,       &
01460                                       inter, nparts, match, ierror)
01461        Use PSMILe_common
01462        Integer, Intent (In)            :: mask1_shape (2, ndim_3d)
01463        Logical, Intent (In)            :: mask1_array (                     
01464                                           mask1_shape(1,1):mask1_shape(2,1), 
01465                                           mask1_shape(1,2):mask1_shape(2,2), 
01466                                           mask1_shape(1,3):mask1_shape(2,3))
01467        Integer, Intent (In)            :: mask2_shape (2, ndim_3d)
01468        Logical, Intent (In)            :: mask2_array (                     
01469                                           mask2_shape(1,1):mask2_shape(2,1), 
01470                                           mask2_shape(1,2):mask2_shape(2,2), 
01471                                           mask2_shape(1,3):mask2_shape(2,3))
01472        Integer, Intent (In)            :: nparts
01473        Integer, Intent (In)            :: inter (2, ndim_3d, nparts)
01474        Logical, Intent (Out)           :: match
01475        Integer, Intent (Out)           :: ierror
01476     End Subroutine
01477 
01478 ! End of definition of a component
01479 
01480     subroutine psmile_add_points_found (grid_id, search, &
01481                       extra_search, indices_returned,    &
01482                       found, n_send, len_nsend,          &
01483                       index_found, n_found,              &
01484                       neighbors_3d, nloc, num_neigh,     &
01485                       grid_valid_shape, use_how, ierror)
01486        Use PSMILe_common
01487 
01488        Integer,                  Intent (In)    :: grid_id
01489        Type (Enddef_search),     Intent (InOut) :: search
01490        Type (Extra_search_info), Intent (InOut) :: extra_search
01491        Integer,                  Intent (In)    :: n_found, n_send
01492        Integer,                  Intent (In)    :: indices_returned (n_send)
01493        Integer,                  Intent (In)    :: index_found (n_found)
01494        Integer,                  Intent (In)    :: grid_valid_shape (2, ndim_3d)
01495        Integer,                  Intent (In)    :: len_nsend (search%search_data%npart)
01496        Integer,                  Intent (In)    :: nloc, num_neigh
01497        Integer,                  Intent (In)    :: use_how
01498        Integer,                  Intent (InOut) :: found    (n_send)
01499        Integer,                  Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
01500                                                                  num_neigh)
01501        Integer,                  Intent (Out)   :: ierror
01502     End Subroutine
01503 
01504     subroutine psmile_enddef_action (search, index, status, ierror)
01505        Use PSMILe_common
01506        Type (Enddef_search), Intent (InOut) :: search
01507        Integer,              Intent (In)    :: index
01508        Integer,              Intent (In)    :: status (MPI_STATUS_SIZE)
01509        Integer,              Intent (Out)   :: ierror
01510     End Subroutine
01511 !
01512     subroutine psmile_enddef_action_cell (msg_locations, ierror)
01513        Use PSMILe_common, only : enddef_msg_locations
01514 
01515        Type (enddef_msg_locations), Intent (In)  :: msg_locations
01516        Integer,                     Intent (Out) :: ierror
01517     End Subroutine
01518 !
01519     subroutine psmile_enddef_action_extra (msg_extra, sender, ierror)
01520        Use PSMILe_common, only : enddef_msg_extra
01521 
01522        Integer,                 Intent (In)  :: sender
01523        Type (enddef_msg_extra), Intent (In)  :: msg_extra
01524        Integer,                 Intent (Out) :: ierror
01525     End Subroutine
01526 !
01527     subroutine psmile_enddef_action_loc (msg_locations, ierror)
01528        Use PSMILe_common, only : enddef_msg_locations
01529 
01530        Type (enddef_msg_locations), Intent (In)  :: msg_locations
01531        Integer,                     Intent (Out) :: ierror
01532     End Subroutine
01533 !
01534     subroutine psmile_enddef_action_sel ( sender, ierror)
01535        Integer,              Intent (In)    :: sender
01536        Integer,              Intent (Out)   :: ierror
01537     End Subroutine
01538 
01539     subroutine psmile_enddef_appl (tag,   &
01540                                    my_icomp0_coll_comps, n_active, ierror)
01541        Use PSMILe_common
01542        Integer,            Intent (In)  :: tag
01543        Integer,            Intent (Out) :: my_icomp0_coll_comps, n_active
01544        Integer,            Intent (Out) :: ierror
01545     End Subroutine
01546 
01547     subroutine psmile_enddef_appl_miss (global_ids, comp_min, comp_max, &
01548                                         b_comps, n_active, tag, ierror)
01549        Use PSMILe_common
01550        Integer,            Intent (In)  :: n_active, tag
01551        Integer,            Intent (In)  :: comp_min, comp_max
01552        Integer,            Intent (In)  :: global_ids (comp_min:comp_max)
01553        Type (Enddef_comp), Intent (Out) :: b_comps (n_active)
01554        Integer,            Intent (Out) :: ierror
01555     End Subroutine
01556 
01557     subroutine psmile_enddef_comp (comp_id, global_comp_id, Number_of_Grids, &
01558                                    comp_info, ierror)
01559        Use PSMILe_common
01560        Integer, Intent (In)             :: comp_id, Number_of_Grids
01561        Integer, Intent (In)             :: global_comp_id
01562        Type (Enddef_comp), Intent (Out) :: comp_info
01563        Integer, Intent (Out)            :: ierror
01564     End Subroutine
01565     subroutine psmile_enddef_comp_grid (comp_id, n_grids, ierror)
01566        Integer, Intent (In)            :: comp_id
01567        Integer, Intent (Out)           :: ierror, n_grids
01568     End Subroutine
01569 
01570     subroutine psmile_enddef_comp_periodic (comp_id, grid_ids, n_total, &
01571                                             ierror)
01572        Integer, Intent (In)            :: comp_id, n_total
01573        Integer, Intent (In)            :: grid_ids (n_total)
01574        Integer, Intent (Out)           :: ierror
01575     End Subroutine
01576 
01577     subroutine psmile_field2grid (ierror)
01578        Integer,            Intent (Out) :: ierror
01579     End Subroutine
01580 
01581     subroutine psmile_find_intersect (comp_info, global_index, num_intersect_per_grid, &
01582                                       num_dummy_intersect_per_grid, ninter, &
01583                                       nmyint, nnull, tag, ierror)
01584        Use PSMILe_common
01585        Type (Enddef_comp), Intent (InOut) :: comp_info
01586        Integer, Intent (InOut)            :: num_intersect_per_grid(:), 
01587                                              num_dummy_intersect_per_grid(:)
01588        Integer, Intent (InOut)            :: ninter, nmyint, nnull
01589        Integer, Intent (In)               :: global_index, tag
01590        Integer, Intent (Out)              :: ierror
01591     End Subroutine
01592 !
01593     subroutine psmile_gauss_setup (grid_id, ierror)
01594       Integer, Intent (In)                :: grid_id
01595       Integer, Intent (Out)               :: ierror
01596     End Subroutine PSMILe_gauss_setup
01597 !
01598     subroutine psmile_gauss_get_neighbours (grid_id, ierror)
01599       Integer, Intent (In)                :: grid_id
01600       Integer, Intent (Out)               :: ierror
01601     End Subroutine PSMILe_gauss_get_neighbours
01602 !
01603     subroutine psmile_get_face_ind_21d (search, extra_search, &
01604                     send_info, len_cpl,                       &
01605                     send_mask, nreq, srcloc_ind, n_send,      &
01606                     ierror)
01607        Use PSMILe_common
01608 
01609        Type (Enddef_search),     Intent (In)  :: search
01610        Type (Extra_search_info), Intent (In)  :: extra_search
01611        Type (Send_information),  Intent (In)  :: send_info
01612        Integer,                  Intent (In)  :: nreq, n_send
01613        Integer,                  Intent (In)  :: len_cpl (search%search_data%npart)
01614        Logical,                  Intent (In)  :: send_mask (nreq)
01615        Integer,                  Intent (Out) :: srcloc_ind (ndim_3d, n_send)
01616        Integer,                  Intent (Out) :: ierror
01617     End Subroutine
01618 !
01619     subroutine psmile_get_face_ind_3d (search, extra_search,  &
01620                     send_info, len_cpl,                       &
01621                     send_mask, nreq, srcloc_ind, n_send,      &
01622                     ierror)
01623        Use PSMILe_common
01624 
01625        Type (Enddef_search),     Intent (In)  :: search
01626        Type (Extra_search_info), Intent (In)  :: extra_search
01627        Type (Send_information),  Intent (In)  :: send_info
01628        Integer,                  Intent (In)  :: nreq, n_send
01629        Integer,                  Intent (In)  :: len_cpl (search%search_data%npart)
01630        Logical,                  Intent (In)  :: send_mask (nreq)
01631        Integer,                  Intent (Out) :: srcloc_ind (ndim_3d, n_send)
01632        Integer,                  Intent (Out) :: ierror
01633     End Subroutine
01634 !
01635     subroutine psmile_get_face_ind_reg (search, extra_search, &
01636                     send_info, len_cpl,                       &
01637                     send_mask, nreq, srcloc_ind, n_send,      &
01638                     ierror)
01639        Use PSMILe_common
01640 
01641        Type (Enddef_search),     Intent (In)  :: search
01642        Type (Extra_search_info), Intent (In)  :: extra_search
01643        Type (Send_information),  Intent (In)  :: send_info
01644        Integer,                  Intent (In)  :: nreq, n_send
01645        Integer,                  Intent (In)  :: len_cpl (search%search_data%npart)
01646        Logical,                  Intent (In)  :: send_mask (nreq)
01647 !
01648        Integer,                  Intent (Out) :: srcloc_ind (ndim_3d, n_send)
01649        Integer,                  Intent (Out) :: ierror
01650     End Subroutine
01651 !
01652     subroutine psmile_get_faces_virtual_ind (search, extra_search, &
01653                     send_info, len_cpl,                            &
01654                     send_mask, nreq, virtual_ind, n_send,          &
01655                     ierror)
01656        Use PSMILe_common
01657 
01658        Type (Enddef_search),     Intent (In)  :: search
01659        Type (Extra_search_info), Intent (In)  :: extra_search
01660        Type (Send_information),  Intent (In)  :: send_info
01661        Integer,                  Intent (In)  :: nreq, n_send
01662        Integer,                  Intent (In)  :: len_cpl (search%search_data%npart)
01663        Logical,                  Intent (In)  :: send_mask (nreq)
01664 !
01665        Integer,                  Intent (Out) :: virtual_ind (n_send)
01666        Integer,                  Intent (Out) :: ierror
01667     End Subroutine
01668 
01669 !
01670     subroutine psmile_get_intersect (ninter, nmyint, nnull, &
01671                                      num_intersect_per_grid, &
01672                                      num_dummy_intersect_per_grid, &
01673                                      tag, ierror)
01674        Use PSMILe_common
01675        Integer,            Intent (In)  :: ninter, nmyint, nnull
01676        Integer,            Intent (In)  :: num_intersect_per_grid(:), 
01677                                            num_dummy_intersect_per_grid(:)
01678        Integer,            Intent (In)  :: tag
01679        Integer,            Intent (Out) :: ierror
01680     End Subroutine
01681 !
01682     subroutine psmile_get_locations_3d (msg_locations, ierror)
01683        Use PSMILe_common, only : enddef_msg_locations
01684 
01685        Type (enddef_msg_locations), Intent (In)  :: msg_locations
01686        Integer,                     Intent (Out) :: ierror
01687     End Subroutine
01688 !
01689     subroutine psmile_hash_extra (search, locs, hash, nlocs, &
01690                   mask_array, mask_shape, mask_available,    &
01691                   grid_valid_shape, ierror)
01692        Use PSMILe_common
01693 
01694        Type (Enddef_global_search), Intent (InOut) :: search
01695        Integer,                     Intent (In)    :: nlocs
01696        Logical,                     Intent (In)    :: mask_available
01697        Integer,                     Intent (In)    :: locs (ndim_3d, nlocs)
01698        Integer,                     Intent (In)    :: grid_valid_shape (2, 
01699                                                              ndim_3d)
01700        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
01701        Logical,                     Intent (In)    ::    
01702           mask_array (mask_shape (1,1):mask_shape (2,1), 
01703                       mask_shape (1,2):mask_shape (2,2), 
01704                       mask_shape (1,3):mask_shape (2,3))
01705        Integer,                     Intent (Out)   :: hash (nlocs)
01706        Integer,                     Intent (Out)   :: ierror
01707     End Subroutine
01708 !
01709     subroutine psmile_locations_alloc (send_info, ierror)
01710        Use PSMILe_common
01711 
01712        Type(Send_information), Intent(Inout) :: send_info
01713        Integer, Intent (Out)                 :: ierror
01714     End Subroutine
01715 !
01716     subroutine psmile_locations_dealloc (send_info, ierror)
01717        Use PSMILe_common
01718 
01719        Type(Send_information), Intent(Inout) :: send_info
01720        Integer, Intent (Out)                 :: ierror
01721     End Subroutine
01722 !
01723     subroutine psmile_locations_direct (control, global, search, method_id, &
01724                                         dir_index, ierror)
01725        Use PSMILe_common
01726 
01727        Type (Enddef_search), Intent (InOut) :: search
01728        Integer,              Intent (In)    :: control (2, ndim_3d, *)
01729        Integer,              Intent (In)    :: global  (2, ndim_3d, *)
01730        Integer,              Intent (In)    :: method_id
01731        Integer,              Intent (Out)   :: ierror, dir_index
01732     End Subroutine
01733 !
01734     subroutine psmile_locations_gauss2 (found, loc, range, control, &
01735                                    search, method_id,               &
01736                                    dir_index, cpl_index, len_cpl, ierror)
01737        Use PSMILe_common
01738 
01739        Type (Enddef_search), Intent (InOut) :: search
01740        Type (integer_vector)                :: found (search%search_data%npart, 2)
01741        Type (integer_vector)                :: loc   (search%search_data%npart, 2)
01742        Integer, Intent (In)                 :: range   (2, ndim_2d, search%search_data%npart)
01743        Integer, Intent (In)                 :: control (2, ndim_2d, search%search_data%npart)
01744        Integer, Intent (In)                 :: method_id
01745        Integer, Intent (Out)                :: len_cpl (search%search_data%npart)
01746        Integer, Intent (Out)                :: ierror, cpl_index, dir_index
01747     End Subroutine
01748 !
01749     subroutine psmile_locations_irreg2 (found, loc, range, control, &
01750                     search, method_id, msk_required,       &
01751                     virtual_cell, virtual_cell_required,   &
01752                     dir_index, cpl_index, len_cpl, ierror)
01753        Use PSMILe_common
01754 
01755        Type (Enddef_search), Intent (InOut) :: search
01756        Type (integer_vector)                :: found (search%search_data%npart, 2)
01757        Type (integer_vector)                :: loc   (search%search_data%npart, 2)
01758        Type (integer_vector)                :: virtual_cell (search%search_data%npart)
01759        Integer,               Intent (In)   :: range   (2, ndim_2d, search%search_data%npart)
01760        Integer,               Intent (In)   :: control (2, ndim_2d, search%search_data%npart)
01761        Integer,               Intent (In)   :: method_id
01762        Logical,               Intent (In)   :: msk_required
01763        Logical,               Intent (In)   :: virtual_cell_required
01764 !
01765        Integer,               Intent (Out)  :: len_cpl (search%search_data%npart)
01766        Integer,               Intent (Out)  :: ierror, cpl_index, dir_index
01767     End Subroutine
01768 !
01769     subroutine psmile_locations_3d_mask (search, inter, shift, method_id, &
01770                                          dir_index, ierror)
01771        Use PSMILe_common
01772 
01773        Type (Enddef_search), Intent (InOut) :: search
01774        Integer, Intent (In)                 :: inter (2, ndim_3d, search%search_data%npart)
01775        Integer, Intent (In)                 :: shift (ndim_3d)
01776        Integer, Intent (In)                 :: method_id
01777        Integer, Intent (Out)                :: ierror, dir_index
01778     End Subroutine
01779 !
01780     subroutine psmile_locations_3d (found, loc, range, control,          &
01781                                     search, method_id, msk_required,     &
01782                                     virtual_cell, virtual_cell_required, &
01783                                     dir_index, cpl_index, len_cpl, ierror)
01784        Use PSMILe_common
01785 
01786        Type (Enddef_search), Intent (InOut) :: search
01787        Type (integer_vector)                :: found (search%search_data%npart)
01788        Type (integer_vector)                :: loc   (search%search_data%npart)
01789        Type (integer_vector)                :: virtual_cell (search%search_data%npart)
01790        Integer, Intent (In)                 :: range   (2, ndim_3d, *)
01791        Integer, Intent (In)                 :: control (2, ndim_3d, *)
01792        Integer, Intent (In)                 :: method_id
01793        Logical, Intent (In)                 :: msk_required
01794        Logical, Intent (In)                 :: virtual_cell_required
01795        Integer, Intent (Out)                :: len_cpl (search%search_data%npart)
01796        Integer, Intent (Out)                :: ierror, cpl_index, dir_index
01797     End Subroutine
01798 !
01799     subroutine psmile_locations_3d_reg (found, loc, range, control, &
01800                                         search, method_id,          &
01801                                         dir_index, cpl_index, len_cpl, ierror)
01802        Use PSMILe_common
01803 
01804        Type (Enddef_search), Intent (InOut) :: search
01805        Type (integer_vector)                :: found (search%search_data%npart, ndim_3d)
01806        Type (integer_vector)                :: loc   (search%search_data%npart, ndim_3d)
01807        Integer, Intent (In)                 :: range   (2, ndim_3d, search%search_data%npart)
01808        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
01809        Integer, Intent (In)                 :: method_id
01810        Integer, Intent (Out)                :: len_cpl (search%search_data%npart)
01811        Integer, Intent (Out)                :: ierror, cpl_index, dir_index
01812     End Subroutine
01813 
01814     subroutine psmile_neigh_extra_points (search, extra_search,      &
01815                     mask_array, mask_shape, mask_available, use_how, &
01816                     grid_valid_shape,                                &
01817                     neighbors_3d, nloc, n_corners, len_cpl, ierror)
01818 
01819        Use PSMILe_common
01820 
01821        Type (Enddef_search),     Intent (In)    :: search
01822        Logical,                  Intent (In)    :: mask_array (*)
01823        Integer,                  Intent (In)    :: mask_shape (2, ndim_3d)
01824        Logical,                  Intent (In)    :: mask_available
01825        Integer,                  Intent (In)    :: use_how(3)
01826        Integer,                  Intent (In)    :: grid_valid_shape (2, ndim_3d)
01827        Integer,                  Intent (In)    :: nloc, n_corners
01828        Integer,                  Intent (In)    :: len_cpl (search%search_data%npart)
01829        Type (Extra_search_info), Intent (InOut) :: extra_search
01830        Integer,                  Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
01831                                                                  n_corners)
01832        Integer,                  Intent (Out)   :: ierror
01833     End Subroutine
01834 
01835     subroutine psmile_neigh_extra_search_clean (search, extra_search, ierror)
01836        Use PSMILe_common
01837 
01838        Type (Enddef_search),     Intent (In)    :: search
01839        Type (Extra_search_info), Intent (InOut) :: extra_search
01840        Integer,                  Intent (Out)   :: ierror
01841     End Subroutine
01842 
01843     subroutine psmile_neigh_extra_search_init (search, grid_id, &
01844                                                extra_search, ierror)
01845        Use PSMILe_common
01846 
01847        Type (Enddef_search),     Intent (In)    :: search
01848        Integer,                  Intent(In)     :: grid_id
01849        Type (Extra_search_info), Intent (InOut) :: extra_search
01850        Integer,                  Intent (Out)   :: ierror
01851     End Subroutine
01852 
01853     subroutine psmile_neigh_global_gauss2 (grid_id,                  &
01854                     mask_array, mask_shape, mask_available, use_how, &
01855                     grid_valid_shape,                                &
01856                     neighbors_3d, nloc, n_corners, search_required,  &
01857                     ierror)
01858        Use PSMILe_common
01859 
01860        Logical,                  Intent (In)    :: mask_array (*)
01861        Integer,                  Intent (In)    :: mask_shape (2, ndim_3d)
01862        Logical,                  Intent (In)    :: mask_available
01863        Integer,                  Intent (In)    :: grid_id, use_how
01864        Integer,                  Intent (In)    :: grid_valid_shape (2, ndim_3d)
01865        Integer,                  Intent (In)    :: nloc, n_corners
01866        Integer,                  Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
01867                                                                  n_corners)
01868        Integer,                  Intent (InOut) :: search_required (nloc)
01869        Integer,                  Intent (Out)   :: ierror
01870     End Subroutine
01871 
01872     subroutine psmile_neigh_global_points (search, extra_search,     &
01873                     mask_array, mask_shape, mask_available, use_how, &
01874                     grid_id, grid_valid_shape,                       &
01875                     neighbors_3d, nloc, n_corners, len_cpl, ierror)
01876 
01877        Use PSMILe_common
01878 
01879        Type (Enddef_search),     Intent (In)    :: search
01880        Logical,                  Intent (In)    :: mask_array (*)
01881        Integer,                  Intent (In)    :: mask_shape (2, ndim_3d)
01882        Logical,                  Intent (In)    :: mask_available
01883        Integer,                  Intent (In)    :: grid_id, use_how
01884        Integer,                  Intent (In)    :: grid_valid_shape (2, ndim_3d)
01885        Integer,                  Intent (In)    :: nloc, n_corners
01886        Integer,                  Intent (In)    :: len_cpl (search%search_data%npart)
01887 !
01888        Type (Extra_search_info), Intent (InOut) :: extra_search
01889        Integer,                  Intent (InOut) :: 
01890           neighbors_3d (ndim_3d, nloc, n_corners)
01891        Integer,                  Intent (Out)   :: ierror
01892     End Subroutine
01893 !
01894     subroutine psmile_recv_req_mask (sender, tag,      &
01895                                      search, recv_req, &
01896                                      recv_mask, new_search, ierror)
01897        Use PSMILe_common
01898 
01899        Integer,              Intent (In)    :: sender, tag
01900        Logical,              Intent (In)    :: recv_mask, new_search
01901        Type (Enddef_search), Intent (InOut) :: search
01902        Integer,              Intent (Out)   :: recv_req (ndim_3d+1, *)
01903        Integer,              Intent (Out)   :: ierror
01904     End Subroutine
01905 !
01906     subroutine psmile_recv_req_subgrid (msg_intersections,   &
01907                                         sender, tag, search, &
01908                                         recv_req, new_search, ierror)
01909        Use PSMILe_common
01910 
01911        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
01912        Type (Enddef_search), Intent (InOut)         :: search
01913        Integer, Intent (In)                         :: sender, tag
01914        Integer, Intent (InOut)                      :: recv_req (ndim_3d+2, *)
01915        Logical, Intent (In)                         :: new_search
01916        Integer, Intent (Out)                        :: ierror
01917     End Subroutine
01918 !
01919     subroutine psmile_remove_intersect (inter, idl, idg, npart,  &
01920                     local_extent_info, global_extent_info, ierror)
01921        Use PSMILe_common
01922        Type (Enddef_extent_info), Intent (In)    :: local_extent_info  (*), 
01923                                                     global_extent_info (*)
01924        Integer,                   Intent (InOut) :: npart
01925        Real (PSMILe_float_kind),  Intent (InOut) :: inter (2, ndim_3d, npart)
01926        Integer,                   Intent (InOut) :: idl (npart), idg (npart)
01927        Integer,                   Intent (Out)   :: ierror
01928     End Subroutine
01929 !
01930     subroutine psmile_remove_intersect_int (inter, id1, id2, npart, ierror)
01931        Use PSMILe_common
01932        Integer,          Intent (InOut) :: npart
01933        Integer,          Intent (InOut) :: inter (2, ndim_3d, npart)
01934        Integer,          Intent (InOut) :: id1 (npart), id2 (npart)
01935        Integer,          Intent (Out)   :: ierror
01936     End Subroutine
01937 !
01938     subroutine psmile_return_locations_3d ( msg_intersections, &
01939                                    sender, method_id,          &
01940                                    dir_index, cpl_index,       &
01941                                    n_vars, n_vars_ret, ierror)
01942        Use PSMILe_common
01943 
01944        Integer, Intent (In)                         :: sender
01945        Integer, Intent (In)                         :: method_id
01946        Type (enddef_msg_intersections), intent (in) :: msg_intersections
01947        Integer, Intent (In)                         :: cpl_index, dir_index
01948        Integer, Intent (In)                         :: n_vars, n_vars_ret
01949        Integer, Intent (Out)                        :: ierror
01950     End Subroutine
01951 
01952     subroutine psmile_search_donor_cells (search, tol, ierror)
01953        Use PSMILe_common
01954 
01955        Type (Enddef_search), Intent (InOut) :: search
01956        Double Precision,     Intent (In)    :: tol
01957        Integer,              Intent (Out)   :: ierror
01958     End Subroutine
01959 
01960     subroutine psmile_search_donor_extra (search_global, tol, ierror)
01961        Use PSMILe_common
01962 
01963        Type (Enddef_global_search), Intent (InOut) :: search_global
01964        Double Precision,            Intent (In)    :: tol
01965        Integer,                     Intent (Out)   :: ierror
01966     End Subroutine
01967 
01968     subroutine psmile_search_donor_extra_off (comp_info, search, &
01969                       var_id, tol, ierror)
01970        Use PSMILe_common
01971 
01972        Type (Enddef_comp),          Intent (In)    :: comp_info
01973        Integer,                     Intent (In)    :: var_id
01974        Double Precision,            Intent (In)    :: tol
01975        Type (Enddef_global_search), Intent (InOut) :: search
01976        Integer,                     Intent (Out)   :: ierror
01977     End Subroutine
01978 
01979 
01980     subroutine psmile_search_donor_extra_nn (comp_info, &
01981                       search, var_id, tol, ierror)
01982        Use PSMILe_common
01983 
01984        Type (Enddef_comp),          Intent (In)    :: comp_info
01985        Integer,                     Intent (In)    :: var_id
01986        Double Precision,            Intent (In)    :: tol
01987        Type (Enddef_global_search), Intent (InOut) :: search
01988        Integer,                     Intent (Out)   :: ierror
01989     End Subroutine
01990 
01991     subroutine psmile_search_donor_gridless (comp_info, search,          &
01992                                              field_list, n_vars,         &
01993                                              grid_id, method_id, var_id, &
01994                                              ierror)
01995        Use PSMILe_common
01996 
01997        Type (Enddef_comp),       Intent (In)    :: comp_info
01998        Type (Enddef_search),     Intent (InOut) :: search
01999        Integer,                  Intent (In)    :: grid_id
02000        Integer,                  Intent (InOut) :: method_id, var_id
02001        Integer,                  Intent (In)    :: n_vars
02002        Type (Enddef_field_info), Intent (In)    :: field_list (n_vars)
02003        Integer,                  Intent (Out)   :: ierror
02004     End Subroutine
02005 !
02006     subroutine psmile_send_req_mask (msg_intersections, &
02007                                      dest, tag, ierror)
02008        use psmile_common, only : enddef_msg_intersections
02009 
02010        Integer, Intent (In)                         :: dest, tag
02011        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
02012        Integer, Intent (Out)                        :: ierror
02013     End Subroutine
02014 !
02015     subroutine psmile_send_req_subgrid (msg_intersections, &
02016                                         dest, tag, ierror)
02017        use psmile_common, only : enddef_msg_intersections
02018 
02019        Integer, Intent (In)                         :: dest, tag
02020        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
02021        Integer, Intent (Out)                        :: ierror
02022     End Subroutine
02023 
02024     subroutine psmile_transform_gauss2 ( search_data, glen, map_shape,  &
02025                              map, locations, found, glocations, gfound, &
02026                              cell_based_switch, nlev, grid_valid_shape, &
02027                              ierror )
02028       Use PSMILe_Common
02029 
02030       Type (Enddef_search_data)             :: search_data
02031       Integer, Intent (In)                  :: glen (search_data%npart, ndim_2d)
02032       Integer, Intent (In)                  :: map_shape(ndim_3d)
02033       Integer, Intent (In)                  :: map (map_shape(1), 
02034                                                     map_shape(2), 
02035                                                     map_shape(3))
02036       Logical, Intent (In)                  :: cell_based_switch
02037       Integer, Intent (In)                  :: nlev
02038       Integer, Intent (In)                  :: grid_valid_shape(2)
02039       Type (integer_vector), Intent (In)    :: locations (search_data%npart, ndim_3d)
02040       Type (integer_vector), Intent (In)    :: found (search_data%npart, ndim_3d)
02041       Type (integer_vector), Intent (InOut) :: glocations (search_data%npart, ndim_2d)
02042       Type (integer_vector), Intent (InOut) :: gfound (search_data%npart, ndim_2d)
02043       Integer,               Intent (Out)   :: ierror
02044     End Subroutine
02045 
02046     subroutine psmile_trans_loc2glob_3d (grid_id, &
02047                     ibuf, len_item, nloc, ierror)
02048       Integer,              Intent (In)    :: grid_id, len_item, nloc
02049 !
02050       Integer,              Intent (InOut) :: ibuf (len_item, nloc)
02051       Integer,              Intent (Out)   :: ierror
02052     End Subroutine
02053 
02054     subroutine psmile_trans_loc2glob_gauss2 (grid_id, &
02055                     ibuf, len_item, nloc, ierror)
02056       Integer,              Intent (In)    :: grid_id, len_item, nloc
02057 !
02058       Integer,              Intent (InOut) :: ibuf (len_item, nloc)
02059       Integer,              Intent (Out)   :: ierror
02060     End Subroutine
02061 
02062     subroutine psmile_tricu_3d_extra_off (comp_info, search,   &
02063                     mask_array, mask_shape, mask_available,    &
02064                     ibuf, len_item, n_send, num_neigh,         &
02065                     grid_valid_shape, cyclic, ierror)
02066        Use PSMILe_common
02067 
02068        Type (Enddef_comp),   Intent (In)    :: comp_info
02069        Integer,              Intent (In)    :: mask_shape (2, ndim_3d)
02070        Logical,              Intent (In)    :: mask_array (mask_shape (1,1): 
02071                                                            mask_shape (2,1), 
02072                                                            mask_shape (1,2): 
02073                                                            mask_shape (2,2), 
02074                                                            mask_shape (1,3): 
02075                                                            mask_shape (2,3))
02076        Logical,              Intent (In)    :: mask_available
02077        Logical,              Intent (In)    :: cyclic (ndim_3d)
02078        Integer,              Intent (In)    :: len_item, n_send, num_neigh
02079        Integer,              Intent (In)    :: grid_valid_shape (2, ndim_3d)
02080        Type (Enddef_global_search), Intent (InOut) :: search
02081        Integer,              Intent (InOut) :: ibuf (len_item, n_send)
02082        Integer,              Intent (Out)   :: ierror
02083     End Subroutine
02084 
02085     subroutine psmile_trili_3d_extra_off (comp_info, search, grid_id, &
02086                     mask_array, mask_shape, mask_available,           &
02087                     ibuf, len_item, n_send, num_neigh,                &
02088                     ierror)
02089        Use PSMILe_common
02090 
02091        Type (Enddef_comp),   Intent (In)    :: comp_info
02092        Integer,              Intent (In)    :: mask_shape (2, ndim_3d)
02093        Logical,              Intent (In)    :: mask_array (mask_shape (1,1): 
02094                                                            mask_shape (2,1), 
02095                                                            mask_shape (1,2): 
02096                                                            mask_shape (2,2), 
02097                                                            mask_shape (1,3): 
02098                                                            mask_shape (2,3))
02099        Logical,              Intent (In)    :: mask_available
02100        Integer,              Intent (In)    :: grid_id
02101        Integer,              Intent (In)    :: len_item, n_send, num_neigh
02102        Type (Enddef_global_search), Intent (InOut) :: search
02103        Integer,              Intent (InOut) :: ibuf (len_item, n_send)
02104        Integer,              Intent (Out)   :: ierror
02105     End Subroutine
02106 
02107     subroutine psmile_mg_cells_gauss2 ( grid_id, search_grid_type, &
02108                            found, loc, loc_fnd_shape, control, ierror )
02109 
02110       Use PSMILe_common
02111       Integer, Intent (In)          :: grid_id
02112       Integer, Intent (In)          :: search_grid_type
02113       Integer, Intent (In)          :: loc_fnd_shape (2, ndim_3d)
02114       Integer, Intent (In)          :: control (2, ndim_3d)
02115       Integer, Intent (InOut)       :: found ( loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
02116                                                loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
02117                                                loc_fnd_shape(1,3):loc_fnd_shape(2,3) )
02118       Integer, Intent (InOut)       :: loc ( loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
02119                                              loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
02120                                              loc_fnd_shape(1,3):loc_fnd_shape(2,3) )
02121       Integer, Intent (Out)         :: ierror
02122     End Subroutine
02123 
02124     subroutine psmile_mg_found_loc_to_3d (search, nlev,  &
02125                     source_grid_type,                    &
02126                     found, locations, len,               &
02127                     virtual_cell, virtual_cell_required, &
02128                     found_3d, locations_3d, virtual_3d, ierror)
02129        Use PSMILe_common
02130 
02131        Type (Enddef_search),  Intent (In)   :: search
02132        Integer,               Intent (In)   :: nlev
02133        Integer,               Intent (In)   :: source_grid_type
02134        Type (integer_vector), Intent (In)   :: found (search%search_data%npart, ndim_3d)
02135        Type (integer_vector), Intent (In)   :: locations (search%search_data%npart, ndim_3d)
02136        Type (integer_vector), Intent (In)   :: virtual_cell (search%search_data%npart)
02137        Logical,               Intent (In)   :: virtual_cell_required
02138        Integer,               Intent (In)   :: len (search%search_data%npart, *)
02139        Type (integer_vector), Intent (Out)  :: found_3d (search%search_data%npart)
02140        Type (integer_vector), Intent (Out)  :: locations_3d (search%search_data%npart)
02141        Type (integer_vector), Intent (Out)  :: virtual_3d (search%search_data%npart)
02142        Integer,               Intent (Out)  :: ierror
02143     End Subroutine
02144 
02145     subroutine psmile_mg_search (comp_info, grid_id, search_data, &
02146                                  requires_conserv_remap, found,   &
02147                                  locations, len, tol, ierror)
02148        Use PSMILe_common
02149        Type (Enddef_comp), Intent (In)           :: comp_info
02150        Integer, Intent (In)                      :: grid_id
02151        Type (Enddef_search_data), Intent (InOut) :: search_data
02152        Logical, Intent (In)                      :: requires_conserv_remap
02153        Double Precision, Intent (In)             :: tol
02154        Type (integer_vector), Intent (Out)       :: found     (search_data%npart, ndim_3d)
02155        Type (integer_vector), Intent (Out)       :: locations (search_data%npart, ndim_3d)
02156        Integer, Intent (Out)                     :: len       (search_data%npart, ndim_3d)
02157        Integer, Intent (Out)                     :: ierror
02158     end subroutine
02159 
02160     subroutine psmile_store_dest_locs_21d (found,  range,  control,     &
02161                                            foundz,send_info, nloc, opt, &
02162                                            nprev, nadd, ierror)
02163        Use PSMILe_common
02164        Integer, Intent (In)                  :: range   (2, ndim_3d)
02165        Integer, Intent (In)                  :: control (2, ndim_3d)
02166        Integer, Intent (In)                  :: found (*), foundz (*)
02167        Integer, Intent (In)                  :: nloc, nprev, opt
02168        Type(Send_information), Intent(Inout) :: send_info
02169        Integer, Intent (Out)                 :: ierror, nadd
02170     End Subroutine
02171 !
02172     subroutine psmile_store_dest_locs_3d (found, loc, range, control, &
02173                                           send_info, nloc, opt, &
02174                                           nprev, nadd, ierror)
02175        Use PSMILe_common
02176        Integer, Intent (In)                  :: range   (2, ndim_3d)
02177        Integer, Intent (In)                  :: control (2, ndim_3d)
02178 
02179        Integer, Intent (In)                  :: found (*)
02180        Integer, Intent (In)                  :: loc (ndim_3d, *)
02181        Integer, Intent (In)                  :: nloc, nprev, opt
02182        Type(Send_information), Intent(Inout) :: send_info
02183        Integer, Intent (Out)                 :: ierror, nadd
02184     End Subroutine
02185 !
02186     subroutine psmile_store_dest_locs_3d_msk (mask_array, mask_shape, &
02187                                           inter, send_info, nloc, &
02188                                           nprev, nadd, ierror)
02189        Use PSMILe_common
02190        Integer,                Intent (In)   :: mask_shape (2, ndim_3d)
02191        Logical,                Intent (In)   :: mask_array (                    
02192                                                 mask_shape(1,1):mask_shape(2,1),
02193                                                 mask_shape(1,2):mask_shape(2,2),
02194                                                 mask_shape(1,3):mask_shape(2,3))
02195        Integer,                Intent (In)   :: inter (2, ndim_3d)
02196        Integer,                Intent (In)   :: nloc, nprev
02197        Type(Send_information), Intent(Inout) :: send_info
02198        Integer,                Intent (Out)  :: ierror, nadd
02199     End Subroutine
02200 !
02201     subroutine psmile_store_dest_locs_3d_reg (found, loc, range, control, &
02202                                               send_info, nloc, opt, &
02203                                               nprev, nadd, ierror)
02204        Use PSMILe_common
02205        Integer, Intent (In)                  :: range   (2, ndim_3d)
02206        Integer, Intent (In)                  :: control (2, ndim_3d)
02207 
02208        Type (integer_vector), Intent (In)    :: found  (ndim_3d)
02209        Type (integer_vector), Intent (In)    :: loc  (ndim_3d)
02210        Integer, Intent (In)                  :: nloc, nprev, opt
02211        Type(Send_information), Intent(Inout) :: send_info
02212        Integer, Intent (Out)                 :: ierror, nadd
02213     End Subroutine
02214 !
02215     subroutine psmile_store_mask_locs_3d ( ipart, range,  control,  found,  &
02216                                            send_info, nprev, ncpl, ierror )
02217        Use PSMILe_common
02218        Integer, Intent(In)                   :: ipart
02219        Integer, Intent(In)                   :: range  (2,ndim_3d)
02220        Integer, Intent(In)                   :: control(2,ndim_3d)
02221        Integer, Intent(In)                   :: found ( range(1,1):range(2,1), 
02222                                                         range(1,2):range(2,2), 
02223                                                         range(1,3):range(2,3))
02224        Type(Send_information), Intent(InOut) :: send_info
02225        Integer, Intent(In)                   :: nprev
02226        Integer, Intent(In)                   :: ncpl
02227 
02228        Integer, Intent(Out)                  :: ierror
02229 
02230     End Subroutine
02231 
02232     subroutine psmile_store_source_locs_1d (found,  loc,  ibeg, len, &
02233                                             send_info, nloc, opt, ialloc, ipart,&
02234                                             nprev, nadd, ierror)
02235        Use PSMILe_common
02236        Integer, Intent (In)                  :: ibeg, len
02237        Integer, Intent (In)                  :: found (*)
02238        Integer, Intent (In)                  :: loc (*)
02239        Integer, Intent (In)                  :: nloc, nprev, opt, ialloc, ipart
02240        Type(Send_information), Intent(Inout) :: send_info
02241        Integer, Intent (Out)                 :: ierror, nadd
02242     End Subroutine
02243 !
02244     subroutine psmile_store_source_locs_2d (found,  loc,  ibeg, len, &
02245                                             send_info, nloc, opt, ialloc, ipart,&
02246                                             nprev, nadd, ierror)
02247        Use PSMILe_common
02248        Integer, Intent (In)                  :: ibeg, len
02249        Integer, Intent (In)                  :: found (*)
02250        Integer, Intent (In)                  :: loc (ndim_2d, *)
02251        Integer, Intent (In)                  :: nloc, nprev, opt, ialloc, ipart
02252        Type(Send_information), Intent(Inout) :: send_info
02253        Integer, Intent (Out)                 :: ierror, nadd
02254     End Subroutine
02255 !
02256     subroutine psmile_store_source_locs_3d (found, loc, ibeg, len, &
02257                                             send_info, nloc, opt,  &
02258                                             nprev, nadd, ierror)
02259        Use PSMILe_common
02260        Integer, Intent (In)                  :: ibeg, len
02261        Integer, Intent (In)                  :: found (*)
02262        Integer, Intent (In)                  :: loc (ndim_3d, *)
02263        Integer, Intent (In)                  :: nloc, nprev, opt
02264        Type(Send_information), Intent(Inout) :: send_info
02265        Integer, Intent (Out)                 :: ierror, nadd
02266     End Subroutine
02267 !
02268     subroutine psmile_store_source_locs_3d_msk (mask_array, mask_shape, &
02269                                                 inter, send_info, nloc, &
02270                                                 nprev, nadd, ierror)
02271        Use PSMILe_common
02272        Integer,                Intent (In)   :: mask_shape (2, ndim_3d)
02273        Logical,                Intent (In)   :: mask_array (                    
02274                                                 mask_shape(1,1):mask_shape(2,1),
02275                                                 mask_shape(1,2):mask_shape(2,2),
02276                                                 mask_shape(1,3):mask_shape(2,3))
02277        Integer,                Intent (In)   :: inter (2, ndim_3d)
02278        Integer,                Intent (In)   :: nloc, nprev
02279        Type(Send_information), Intent(Inout) :: send_info
02280        Integer,                Intent (Out)  :: ierror, nadd
02281     End Subroutine
02282 !
02283     subroutine psmile_store_source_locs_3d_reg (               &
02284                     found, loc, range, control,                &
02285                     send_info, nloc, opt, nprev, nadd, ierror)
02286        Use PSMILe_common
02287        Integer,                Intent (In)   :: range   (2, ndim_3d)
02288        Integer,                Intent (In)   :: control (2, ndim_3d)
02289        Type (integer_vector),  Intent (In)   :: found  (ndim_3d)
02290        Type (integer_vector),  Intent (In)   :: loc    (ndim_3d)
02291        Integer,                Intent (In)   :: nloc, nprev, opt
02292 !
02293        Type(Send_information), Intent(InOut) :: send_info
02294        Integer,                Intent (Out)  :: ierror, nadd
02295     End Subroutine
02296 !
02297     subroutine psmile_store_source_virt_3d (                           &
02298                     found, virtual_cell, ibeg, len,                    &
02299                     send_info, nloc, opt, ialloc, ipart, nprev, ierror)
02300        Use PSMILe_common
02301 !
02302        Integer,                Intent (In)   :: ibeg, len
02303        Integer,                Intent (In)   :: found (len)
02304        Integer,                Intent (In)   :: virtual_cell (len)
02305        Integer,                Intent (In)   :: nloc, nprev, opt
02306        Integer,                Intent (In)   :: ialloc, ipart
02307 !
02308        Type(Send_information), Intent(InOut) :: send_info
02309        Integer,                Intent (Out)  :: ierror
02310     End Subroutine
02311 !
02312     subroutine psmile_send_destinations (            &
02313                     method_id, cpl_index, dir_index, &
02314                     sender, tag, ierror)
02315        Integer,                Intent (In)   :: method_id
02316        Integer,                Intent (In)   :: cpl_index, dir_index
02317        Integer,                Intent (In)   :: sender, tag
02318 !
02319        Integer,                Intent (Out)  :: ierror
02320     End Subroutine
02321 !
02322 !   Multigrid for seach of donor cells
02323 !
02324     subroutine psmile_mg_clean (ierror)
02325        Integer,                Intent (Out)  :: ierror
02326     End Subroutine
02327 
02328     subroutine psmile_mg_setup (grid_id, range, tol, ierror)
02329        Use PSMILe_common
02330        Integer, Intent (In)               :: grid_id
02331        Integer, Intent (In)               :: range (2, ndim_3d)
02332        Double Precision, Intent (In)      :: tol
02333        Integer, Intent (Out)              :: ierror
02334     End Subroutine
02335 
02336     subroutine psmile_mg_first_level (grid_id, range, &
02337                     mg_info, tol, simplified_grid, ierror)
02338        Use PSMILe_common
02339        Integer,          Intent (In)    :: grid_id
02340        Integer,          Intent (In)    :: range (2, ndim_3d)
02341        Type (Enddef_mg), Intent (InOut) :: mg_info
02342        Real (PSMILe_float_kind), Intent (In) :: tol
02343        Logical,          Intent (In)    :: simplified_grid
02344        Integer,          Intent (Out)   :: ierror
02345     End Subroutine
02346 
02347     Logical Function PSMILe_to_be_coupled (comp_id1, comp_id2)
02348        Integer, Intent (In)           :: comp_id1, comp_id2
02349     End Function
02350 
02351     subroutine psmile_mg_coars_level (grid_id, mg_info_fine, &
02352                                       mg_info_coarse, &
02353                                       icoarse, ierror)
02354        Use PSMILe_common
02355 
02356        Integer, Intent (In)            :: grid_id
02357        Type (Enddef_mg), Intent (In)   :: mg_info_fine
02358        Type (Enddef_mg), Intent (InOut):: mg_info_coarse
02359        Integer, Intent (In)            :: icoarse (ndim_3d)
02360        Integer, Intent (Out)           :: ierror
02361     End Subroutine
02362 
02363     subroutine psmile_mg_get_cyclic (grid_id, range, &
02364                                      tol, ierror)
02365        Use PSMILe_common
02366 
02367        Integer, Intent (In)            :: grid_id
02368        Integer, Intent (In)            :: range (2, ndim_3d)
02369        Double Precision, Intent (In)   :: tol
02370        Integer, Intent (Out)           :: ierror
02371     End Subroutine
02372 
02373 ! Get info's on all active components in all processes
02374 
02375     subroutine psmile_get_act_comps (a_comps, nd_acomps, n_act, ierror)
02376        Integer, Intent (In)            :: nd_acomps
02377        Integer, Intent (Out)           :: a_comps (nd_acomps, *)
02378        Integer, Intent (Out)           :: ierror, n_act
02379     End Subroutine
02380 
02381 ! Get extension of SubGrids
02382 
02383     subroutine psmile_get_grid_extent (grid_id, extent, ierror)
02384        Use PSMILe_common
02385        Integer,                  Intent (In)  :: grid_id
02386        Real (PSMILe_float_kind), Intent (Out) :: extent (2, ndim_3d)
02387        Integer,                  Intent (Out) :: ierror
02388     End Subroutine
02389 
02390 ! Select range of a subgrid (intersection)
02391 
02392     subroutine psmile_sel_grid_range (grid_id, dinter, inter, ierror)
02393        Use PSMILe_common
02394        Integer,                  Intent (In)  :: grid_id
02395        Real (PSMILe_float_kind), Intent (In)  :: dinter (2, ndim_3d)
02396        Integer,                  Intent (Out) ::  inter (2, ndim_3d)
02397        Integer,                  Intent (Out) :: ierror
02398     End Subroutine
02399 
02400 ! Generate compact list of entries
02401 
02402     subroutine psmile_compact_locations ( grid_id, search, ndim, found, ierror )
02403       Use PSMILe_common
02404       Integer,                  Intent (In) :: grid_id
02405       Type (Enddef_search), Intent (In)     :: search
02406       Integer,                  Intent (In) :: ndim
02407       Type (integer_vector), Intent (InOut) :: found (search%search_data%npart, ndim)
02408       Integer, Intent (Out)                 :: ierror
02409 
02410     End Subroutine
02411 
02412     subroutine psmile_compact_neighbors_3d (neighbors_3d, nloc, num_neigh,  &
02413                                             grid_valid_shape, extra_search, &
02414                                             send_info, neighbors, ierror)
02415        Use PSMILe_common
02416 
02417        Integer, Intent (In)            :: nloc, num_neigh
02418        Integer, Intent (In)            :: neighbors_3d (ndim_3d, nloc, num_neigh)
02419        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
02420        Type(Extra_search_info), Intent(in)      :: extra_search
02421        Type (Send_information), Intent (InOut)  :: send_info
02422        Integer, Intent (Out)           :: neighbors (nloc, num_neigh)
02423        Integer, Intent (Out)           :: ierror
02424     End Subroutine
02425 !
02426     subroutine psmile_move0_neighbors (neighbors, nloc, num_neigh, ierror)
02427        Integer, Intent (In)            :: nloc, num_neigh
02428        Integer, Intent (InOut)         :: neighbors (nloc, num_neigh)
02429        Integer, Intent (Out)           :: ierror
02430     End Subroutine
02431 
02432 ! Utilities
02433 
02434     subroutine psmile_quicksort ( a, n )
02435       Integer, Intent(In)                  :: n
02436       Integer, Intent(InOut)               :: a(n)
02437     End Subroutine PSMILe_Quicksort
02438 
02439     subroutine psmile_quicksort_index ( a, n, t )
02440       Integer, Intent(In)                  :: n
02441       Integer, Intent(InOut)               :: a(n)
02442       Integer, Intent(InOut)               :: t(n)
02443     End Subroutine PSMILe_Quicksort_index
02444 
02445     subroutine psmile_type_create_subarray (ndims, array_of_sizes,  &
02446                                 array_of_subsizes, array_of_starts, &
02447                                 oldtype, newtype, ierror)
02448        Integer,            Intent (In)  :: ndims, oldtype
02449        Integer,            Intent (In)  :: array_of_sizes (ndims)
02450        Integer,            Intent (In)  :: array_of_subsizes (ndims)
02451        Integer,            Intent (In)  :: array_of_starts (ndims)
02452        Integer,            Intent (Out) :: newtype
02453        Integer,            Intent (Out) :: ierror
02454     End Subroutine
02455 
02456 ! Blocking send
02457 
02458     subroutine psmile_bsend_init (ftypes, flengths, number_of_ftypes, ierror)
02459        Integer, Intent (In)            :: number_of_ftypes
02460        Integer, Intent (In)            :: ftypes (number_of_ftypes)
02461        Integer, Intent (In)            :: flengths (number_of_ftypes)
02462        Integer, Intent (Out)           :: ierror
02463     End Subroutine
02464 
02465 !
02466 !   ------ Routines for Integer variables -----------
02467 !
02468 
02469 ! Utilities
02470 
02471     subroutine psmile_copy_subarray_3d_int (dest_vector, size, &
02472                iarray, idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
02473                sub, ierror)
02474        Use PSMILe_common
02475 
02476        Integer(kind=int64), Intent (In) :: size
02477        Integer, Intent (In)             :: idlow, idhigh, jdlow, jdhigh, 
02478                                            kdlow, kdhigh
02479        Integer, Intent (In)             :: sub (2, ndim_3d)
02480        Integer, Intent (In)             :: iarray (idlow:idhigh, jdlow:jdhigh, 
02481                                                    kdlow:kdhigh)
02482        Integer, Intent (Out)            :: dest_vector (size)
02483        Integer, Intent (Out)            :: ierror
02484     End Subroutine
02485 
02486 ! Get and Put
02487 
02488     subroutine psmile_ext_compact_list_log2int (send_info, extra_search,        &
02489                                                 array, shape, grid_valid_shape, &
02490                                                 dest_vector, dest_size, ierror)
02491        Use PSMILe_common
02492        Type(Send_information), Intent(In) :: send_info
02493        Type (Extra_search_info), Intent (InOut) :: extra_search
02494        Logical, Intent (In)               :: array (*)
02495        Integer, Intent (In)               :: shape (2, ndim_3d)
02496        Integer, Intent (In)               :: grid_valid_shape (2, ndim_3d)
02497        Integer, Intent (In)               :: dest_size
02498        Integer, Intent (Out)              :: dest_vector (dest_size)
02499        Integer, Intent (Out)              :: ierror
02500     End Subroutine
02501 
02502     subroutine psmile_ext_compact_list_3d_int (send_info, array, shape, &
02503                                                grid_valid_shape,        &
02504                                                dest_vector, dest_size, ierror)
02505        Use PSMILe_common
02506        Type(Send_information), Intent(In) :: send_info
02507        Integer, Intent (In)               :: array (*)
02508        Integer, Intent (In)               :: shape (2, ndim_3d)
02509        Integer, Intent (In)               :: grid_valid_shape (2, ndim_3d)
02510        Integer, Intent (In)               :: dest_size
02511        Integer, Intent (Out)              :: dest_vector (dest_size)
02512        Integer, Intent (Out)              :: ierror
02513     End Subroutine
02514 
02515     subroutine psmile_extract_indices_3d_int (array, shape, &
02516                                               dstijk, ncpl, &
02517                                               dest_vector, ierror)
02518        Use PSMILe_common
02519        Integer, Intent (In)               :: array (*)
02520        Integer, Intent (In)               :: shape (2, ndim_3d)
02521        Integer, Intent (In)               :: ncpl
02522        Integer, Intent (In)               :: dstijk (ndim_3d, ncpl)
02523        Integer, Intent (Out)              :: dest_vector (ncpl)
02524        Integer, Intent (Out)              :: ierror
02525     End Subroutine
02526 
02527     subroutine psmile_get_field_int (field_id, data_array, len, &
02528                                      nbr_fields, ierror)
02529 
02530        Integer, Intent (In)          :: field_id
02531        Integer, Intent (In)          :: len, nbr_fields
02532        Integer, Intent (InOut)       :: data_array(*)
02533        Integer, Intent (Out)         :: ierror
02534     End Subroutine
02535 
02536     subroutine psmile_get_irr_field_int (data_array, data_shape, nbr_fields,  &
02537                                          dstijk, npoints, dstars, nars, nloc, &
02538                                          source, tag, comm, ierror)
02539        Use PSMILe_common
02540 
02541        Integer, Intent (In)          :: nars, nloc, npoints, nbr_fields
02542        Integer, Intent (In)          :: source, tag, comm
02543        Integer, Intent (In)          :: data_shape (2, ndim_3d)
02544        Integer, Intent (In)          :: dstijk (ndim_3d, npoints)
02545        Integer, Intent (In)          :: dstars (2, ndim_3d, nars)
02546        Integer, Intent (InOut)       :: data_array (*)
02547        Integer, Intent (Out)         :: ierror
02548     End Subroutine
02549 
02550     subroutine psmile_put_compact_list_3d_int (source_list, dstijk, nloc, &
02551                                                array, shape, nbr_fields,  &
02552                                                ierror)
02553        Use PSMILe_common
02554        Integer, Intent (InOut)            :: array (*)
02555        Integer, Intent (In)               :: shape (2, ndim_3d)
02556        Integer, Intent (In)               :: nloc, nbr_fields
02557        Integer, Intent (In)               :: dstijk (ndim_3d, nbr_fields)
02558        Integer, Intent (In)               :: source_list (nloc, nbr_fields)
02559        Integer, Intent (Out)              :: ierror
02560     End Subroutine
02561 
02562     subroutine psmile_put_field_int (field_id, task_id, data_array, len, &
02563                                      nbr_fields, ierror)
02564 
02565        Integer, Intent (In)          :: field_id
02566        Integer, Intent (In)          :: task_id
02567        Integer, Intent (In)          :: len, nbr_fields
02568        Integer, Intent (In)          :: data_array(*)
02569        Integer, Intent (Out)         :: ierror
02570     End Subroutine
02571 
02572     subroutine psmile_put_field_gauss2_int  (data_array, data_shape, nbr_fields, &
02573                                           srcloc, nparts, nloc, npoints, &
02574                                           dest, tag, comm, ierror)
02575        Use PSMILe_common
02576 
02577        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
02578        Integer, Intent (In)          :: nparts
02579        Integer, Intent (In)          :: npoints (2, nparts)
02580        Integer, Intent (In)          :: data_shape (2, ndim_3d)
02581        Type (integer_vector), Intent (In) :: srcloc (2, nparts)
02582        Integer, Intent (In)          :: data_array (*)
02583        Integer, Intent (Out)         :: ierror
02584     End Subroutine
02585 
02586     subroutine psmile_put_field_21d_int  (data_array, data_shape, nbr_fields, &
02587                                           srcloc, nparts, nloc, npoints, &
02588                                           dest, tag, comm, ierror)
02589        Use PSMILe_common
02590 
02591        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
02592        Integer, Intent (In)          :: nparts
02593        Integer, Intent (In)          :: npoints (2, nparts)
02594        Integer, Intent (In)          :: data_shape (2, ndim_3d)
02595        Type (integer_vector), Intent (In) :: srcloc (2, nparts)
02596        Integer, Intent (In)          :: data_array (*)
02597        Integer, Intent (Out)         :: ierror
02598     End Subroutine
02599 
02600     subroutine psmile_put_field_3d_int  (data_array, data_shape, nbr_fields, &
02601                                          srcloc, nparts, nloc, npoints, &
02602                                          dest, tag, comm, ierror)
02603        Use PSMILe_common
02604 
02605        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
02606        Integer, Intent (In)          :: nparts
02607        Integer, Intent (In)          :: npoints (ndim_3d, nparts)
02608        Integer, Intent (In)          :: data_shape (2, ndim_3d)
02609        Type (integer_vector), Intent (In) :: srcloc (ndim_3d, nparts)
02610        Integer, Intent (In)          :: data_array (*)
02611        Integer, Intent (Out)         :: ierror
02612     End Subroutine
02613 
02614     subroutine psmile_put_irr_field_int  (data_array, data_shape, nbr_fields,  &
02615                                           srcloc, npoints, srcars, nars, nloc, &
02616                                           dest, tag, comm, ierror)
02617        Use PSMILe_common
02618 
02619        Integer, Intent (In)          :: nars, nloc, npoints, nbr_fields
02620        Integer, Intent (In)          :: dest, tag, comm
02621        Integer, Intent (In)          :: data_shape (2, ndim_3d)
02622        Integer, Intent (In)          :: srcloc (ndim_3d, npoints)
02623        Integer, Intent (In)          :: srcars (2, ndim_3d, nars)
02624        Integer, Intent (In)          :: data_array (*)
02625        Integer, Intent (Out)         :: ierror
02626     End Subroutine
02627 !
02628 !   ------ Routines for Logical variables -----------
02629 !
02630 
02631 ! Utilities
02632 
02633     subroutine psmile_copy_subarray_2d_log (dest_vector, size, &
02634                darray, idlow, idhigh, jdlow, jdhigh, &
02635                        ibeg,  iend,   jbeg,  jend,   ierror)
02636        Use PSMILe_common
02637        Integer(kind=int64), Intent (In) :: size
02638        Integer, Intent (In)             :: idlow, idhigh, jdlow, jdhigh
02639        Integer, Intent (In)             :: ibeg,  iend,   jbeg,  jend
02640        Logical, Intent (In)             :: darray (idlow:idhigh, jdlow:jdhigh)
02641        Logical, Intent (Out)            :: dest_vector (size)
02642        Integer, Intent (Out)            :: ierror
02643     End Subroutine
02644 
02645     subroutine psmile_copy_subarray_3d_log  (dest_vector, size, &
02646                iarray, idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
02647                sub, ierror)
02648        Use PSMILe_common
02649 
02650        Integer(kind=int64), Intent (In)  :: size
02651        Integer,             Intent (In)  :: idlow, idhigh, jdlow, jdhigh, 
02652                                             kdlow, kdhigh
02653        Integer,             Intent (In)  :: sub (2, ndim_3d)
02654        Logical,             Intent (In)  :: iarray (idlow:idhigh, jdlow:jdhigh, 
02655                                                     kdlow:kdhigh)
02656        Logical,             Intent (Out) :: dest_vector (size)
02657        Integer,             Intent (Out) :: ierror
02658     End Subroutine
02659 
02660 !
02661 !   ------ Routines for Single Precision ------------
02662 !
02663 
02664     subroutine psmile_add_nn_found_real (search, extra_search,  &
02665                       index_sent, found, n_send,                &
02666                       index_found, distance, n_found, nb_extra, &
02667                       selected, sel_info, nrecv, ierror)
02668        Use PSMILe_common
02669 
02670        Integer,           Intent (InOut) :: nrecv
02671        Type (Enddef_search),      Intent (In)    :: search
02672        Type (Extra_search_info),  Intent (InOut) :: extra_search
02673        Type (Select_search_info), Intent (InOut) :: sel_info (nrecv)
02674        Integer,           Intent (In)    :: nb_extra, n_found, n_send
02675        Integer,           Intent (In)    :: index_sent  (n_send)
02676        Integer,           Intent (In)    :: found (n_send)
02677        Integer,           Intent (In)    :: index_found (n_found)
02678        Real,              Intent (In)    :: distance (n_found)
02679        Integer,           Intent (InOut) :: selected (2, extra_search%n_extra)
02680        Integer,           Intent (Out)   :: ierror
02681     End Subroutine
02682 
02683     subroutine psmile_bbcells_1d_real (array, shape, range, &
02684                                        corners, corner_shape, nbr_corners, &
02685                                        chmin, chmax, levdim, ierror)
02686        Integer,           Intent (In)  :: shape (2)
02687        Integer,           Intent (In)  :: range (2)
02688        Real,              Intent (In)  :: array (shape(1):shape(2))
02689        Integer,           Intent (In)  :: corner_shape (2), nbr_corners
02690        Real,              Intent (In)  :: corners (corner_shape(1):corner_shape(2), 
02691                                                    nbr_corners)
02692        Integer,           Intent (In)  :: levdim
02693        Real,              Intent (Out) :: chmin (range(1)-1:range(2))
02694        Real,              Intent (Out) :: chmax (range(1)-1:range(2))
02695        Integer,           Intent (Out) :: ierror
02696     End Subroutine
02697 
02698     subroutine psmile_bbcells_2d_real (           &
02699                     coords, coords_shape, sub_range, &
02700                     corner_shape,                    &
02701                     chmin, chmax, midp, levdim,      &
02702                     period, ierror)
02703        Use psmile_common
02704        Integer,           Intent (In)  :: coords_shape  (2, ndim_2d)
02705        Integer,           Intent (In)  :: sub_range  (2, ndim_2d)
02706        Integer,           Intent (In)  :: corner_shape (2, ndim_2d)
02707        Real,              Intent (In)  :: 
02708           coords(coords_shape(1,1):coords_shape(2,1), 
02709                  coords_shape(1,2):coords_shape(2,2))
02710        Integer,           Intent (In)  :: levdim (ndim_2d)
02711        Real,              Intent (In)  :: period
02712        Real,              Intent (Out) :: 
02713           chmin (sub_range(1,1)-1:sub_range(2,1), 
02714                  sub_range(1,2)-1:sub_range(2,2))
02715        Real,              Intent (Out) :: 
02716           chmax (sub_range(1,1)-1:sub_range(2,1), 
02717                  sub_range(1,2)-1:sub_range(2,2))
02718        Real,              Intent (Out) :: 
02719           midp  (sub_range(1,1)-1:sub_range(2,1), 
02720                  sub_range(1,2)-1:sub_range(2,2))
02721        Integer,           Intent (Out) :: ierror
02722     End Subroutine
02723 
02724     subroutine psmile_bbcells_virt_2d_real (method_id,                &
02725                     coords1, coords2, coords_shape, coords_range,     &
02726                     corners1, corners2, corner_shape, nbr_corners,    &
02727                     chmin1_corner, chmin2_corner,                     &
02728                     chmax1_corner, chmax2_corner, levdim_corner,      &
02729                     chmin1,  chmin2, chmax1, chmax2, midp1, midp2,    &
02730                     levdim,  period, bmaski, bmaskj, ierror)
02731        Use PSMILe_common
02732        Integer,           Intent (In)  :: method_id, nbr_corners
02733        Integer,           Intent (In)  :: coords_shape (2, ndim_2d)
02734        Integer,           Intent (In)  :: coords_range (2, ndim_2d)
02735        Integer,           Intent (In)  :: corner_shape (2, ndim_2d)
02736        Integer,           Intent (In)  :: levdim_corner (2, ndim_2d)
02737        Integer,           Intent (In)  :: levdim (ndim_2d)
02738        Real,              Intent (In)  :: period
02739        Real,              Intent (InOut)  ::              
02740           coords1(coords_shape(1,1):coords_shape(2,1), 
02741                   coords_shape(1,2):coords_shape(2,2))
02742        Real,              Intent (InOut)  ::              
02743           coords2(coords_shape(1,1):coords_shape(2,1), 
02744                   coords_shape(1,2):coords_shape(2,2))
02745        Real,              Intent (In)  :: 
02746           corners1 (corner_shape(1,1):corner_shape(2,1), 
02747                     corner_shape(1,2):corner_shape(2,2), 
02748                     nbr_corners)
02749        Real,              Intent (In)  :: 
02750           corners2 (corner_shape(1,1):corner_shape(2,1), 
02751                     corner_shape(1,2):corner_shape(2,2), 
02752                     nbr_corners)
02753        Real,              Intent (In)  :: 
02754           chmin1_corner (levdim_corner(1,1):levdim_corner(2,1), 
02755                          levdim_corner(1,2):levdim_corner(2,2))
02756        Real,              Intent (In)  :: 
02757           chmin2_corner (levdim_corner(1,1):levdim_corner(2,1), 
02758                          levdim_corner(1,2):levdim_corner(2,2))
02759        Real,              Intent (In)  :: 
02760           chmax1_corner (levdim_corner(1,1):levdim_corner(2,1), 
02761                          levdim_corner(1,2):levdim_corner(2,2))
02762        Real,              Intent (In)  :: 
02763           chmax2_corner (levdim_corner(1,1):levdim_corner(2,1), 
02764                          levdim_corner(1,2):levdim_corner(2,2))
02765        Real,             Intent (InOut) :: 
02766           chmin1 (coords_range(1,1)-1:coords_range(2,1), 
02767                   coords_range(1,2)-1:coords_range(2,2))
02768        Real,              Intent (InOut) :: 
02769           chmin2 (coords_range(1,1)-1:coords_range(2,1), 
02770                   coords_range(1,2)-1:coords_range(2,2))
02771        Real,             Intent (InOut) :: 
02772           chmax1 (coords_range(1,1)-1:coords_range(2,1), 
02773                   coords_range(1,2)-1:coords_range(2,2))
02774        Real,             Intent (InOut) :: 
02775           chmax2 (coords_range(1,1)-1:coords_range(2,1), 
02776                   coords_range(1,2)-1:coords_range(2,2))
02777        Real,             Intent (InOut) :: 
02778           midp1  (coords_range(1,1)-1:coords_range(2,1), 
02779                   coords_range(1,2)-1:coords_range(2,2))
02780        Real,             Intent (InOut) :: 
02781           midp2  (coords_range(1,1)-1:coords_range(2,1), 
02782                   coords_range(1,2)-1:coords_range(2,2))
02783        Integer,           Intent (Out) :: 
02784           bmaski (coords_range(1,1)-1:coords_range(2,1)+1, 2)
02785        Integer,           Intent (Out) :: 
02786           bmaskj (coords_range(1,2)-1:coords_range(2,2)+1, 2)
02787        Integer,           Intent (Out) :: ierror
02788     End Subroutine
02789 
02790     subroutine psmile_bbcells_3d_real (method_id, array, shape, range,     &
02791                                        corners, corner_shape, nbr_corners, &
02792                                        chmin, chmax, midp, levdim, cyclic, &
02793                                        period, ierror)
02794        Use PSMILe_common
02795        Integer,           Intent (In)  :: method_id
02796        Integer,           Intent (In)  :: shape (2, ndim_3d)
02797        Integer,           Intent (In)  :: range (2, ndim_3d)
02798        Integer,           Intent (In)  :: corner_shape (2, ndim_3d), nbr_corners
02799        Real,              Intent (In)  :: array(shape(1,1):shape(2,1), 
02800                                                 shape(1,2):shape(2,2), 
02801                                                 shape(1,3):shape(2,3))
02802        Integer,           Intent (In)  :: levdim (ndim_3d)
02803        Real,              Intent (In)  :: corners (corner_shape(1,1): 
02804                                                    corner_shape(2,1), 
02805                                                    corner_shape(1,2): 
02806                                                    corner_shape(2,2), 
02807                                                    corner_shape(1,3): 
02808                                                    corner_shape(2,3), 
02809                                                    nbr_corners)
02810        Logical,           Intent (In)  :: cyclic
02811        Real,              Intent (In)  :: period
02812        Real,              Intent (Out) :: chmin (range(1,1)-1:range(2,1), 
02813                                                  range(1,2)-1:range(2,2), 
02814                                                  range(1,3)-1:range(2,3))
02815        Real,              Intent (Out) :: chmax (range(1,1)-1:range(2,1), 
02816                                                  range(1,2)-1:range(2,2), 
02817                                                  range(1,3)-1:range(2,3))
02818        Real,              Intent (Out) :: midp  (range(1,1)-1:range(2,1), 
02819                                                  range(1,2)-1:range(2,2), 
02820                                                  range(1,3)-1:range(2,3))
02821        Integer,           Intent (Out) :: ierror
02822     End Subroutine
02823 
02824     subroutine psmile_bbcells_gauss2_real (array_x, array_y,          &
02825                                            shape, range, nbr_lats,    &
02826                                            points_per_lat, corners_y, &
02827                                            corner_shape, nbr_corners, &
02828                                            chmin_x, chmax_x, midp_x,  &
02829                                            chmin_y, chmax_y, midp_y,  &
02830                                            nbrs, levdim, ierror )
02831 
02832       Integer, Intent (In)             :: shape (2)
02833       Real, Intent (In)                :: array_x(shape(1):shape(2))
02834       Real, Intent (In)                :: array_y(shape(1):shape(2))
02835       Integer, Intent (In)             :: range (2)
02836       Integer, Intent (In)             :: corner_shape (2)
02837       Integer, Intent (In)             :: nbr_lats
02838       Integer, Intent (In)             :: points_per_lat(nbr_lats,1)
02839       Integer, Intent (In)             :: nbr_corners
02840       Real, Intent (In)                :: corners_y (corner_shape(1):corner_shape(2), 
02841                                                      nbr_corners)
02842       Integer, Intent (In)             :: levdim(1)
02843       Real, Intent (Out)               :: chmin_x (range(1)-1:range(2))
02844       Real, Intent (Out)               :: chmax_x (range(1)-1:range(2))
02845       Real, Intent (Out)               :: midp_x  (range(1)-1:range(2))
02846       Real, Intent (Out)               :: chmin_y (range(1)-1:range(2))
02847       Real, Intent (Out)               :: chmax_y (range(1)-1:range(2))
02848       Real, Intent (Out)               :: midp_y  (range(1)-1:range(2))
02849       Integer, Intent (Out)            :: nbrs    (range(2)-range(1)+1,4)
02850       Integer, Intent (Out)            :: ierror
02851     End Subroutine
02852 
02853     subroutine psmile_bbcells_pole_dble (              &
02854                    coords_shape, coords_x, coords_y,   &
02855                    corner_shape, sub_range,            &
02856                    chmin_x, chmax_x, chmin_y, chmax_y, &
02857                    midp_x, midp_y, pole_array, period, &
02858                    ierror)
02859       use psmile_common, only : ndim_2d, ndim_3d
02860       integer,          intent (in)    :: coords_shape (2, ndim_2d)
02861       double precision, intent (in)    :: 
02862          coords_x(coords_shape(1,1):coords_shape(2,1),  
02863                   coords_shape(1,2):coords_shape(2,2)), 
02864          coords_y(coords_shape(1,1):coords_shape(2,1),  
02865                   coords_shape(1,2):coords_shape(2,2))
02866       integer,          intent (in)    :: corner_shape (2, ndim_3d)
02867       integer,          intent (in)    :: sub_range (2, ndim_2d)
02868       integer,          intent (in)    :: pole_array(:)
02869       double precision, intent (in)    :: period
02870       double precision, intent (inout) :: chmin_x (sub_range(1,1)-1:sub_range(2,1), 
02871                                                    sub_range(1,2)-1:sub_range(2,2))
02872       double precision, intent (inout) :: chmax_x (sub_range(1,1)-1:sub_range(2,1), 
02873                                                    sub_range(1,2)-1:sub_range(2,2))
02874       double precision, intent (inout) :: chmin_y (sub_range(1,1)-1:sub_range(2,1), 
02875                                                    sub_range(1,2)-1:sub_range(2,2))
02876       double precision, intent (inout) :: chmax_y (sub_range(1,1)-1:sub_range(2,1), 
02877                                                    sub_range(1,2)-1:sub_range(2,2))
02878       double precision, intent (inout) :: midp_x(sub_range(1,1)-1:sub_range(2,1), 
02879                                                  sub_range(1,2)-1:sub_range(2,2))
02880       double precision, intent (inout) :: midp_y(sub_range(1,1)-1:sub_range(2,1), 
02881                                                  sub_range(1,2)-1:sub_range(2,2))
02882       integer,          intent (out)   :: ierror
02883     end subroutine psmile_bbcells_pole_dble
02884 
02885     subroutine psmile_bbcells_pole_real (              &
02886                    coords_shape, coords_x, coords_y,   &
02887                    corner_shape, sub_range,            &
02888                    chmin_x, chmax_x, chmin_y, chmax_y, &
02889                    midp_x, midp_y, pole_array, period, &
02890                    ierror)
02891       use psmile_common, only : ndim_2d, ndim_3d
02892       integer,          intent (in)    :: coords_shape (2, ndim_2d)
02893       real,             intent (in)    :: 
02894          coords_x(coords_shape(1,1):coords_shape(2,1),  
02895                   coords_shape(1,2):coords_shape(2,2)), 
02896          coords_y(coords_shape(1,1):coords_shape(2,1),  
02897                   coords_shape(1,2):coords_shape(2,2))
02898       integer,          intent (in)    :: corner_shape (2, ndim_3d)
02899       integer,          intent (in)    :: sub_range (2, ndim_2d)
02900       integer,          intent (in)    :: pole_array(:)
02901       real,             intent (in)    :: period
02902       real,             intent (inout) :: chmin_x (sub_range(1,1)-1:sub_range(2,1), 
02903                                                    sub_range(1,2)-1:sub_range(2,2))
02904       real,             intent (inout) :: chmax_x (sub_range(1,1)-1:sub_range(2,1), 
02905                                                    sub_range(1,2)-1:sub_range(2,2))
02906       real,             intent (inout) :: chmin_y (sub_range(1,1)-1:sub_range(2,1), 
02907                                                    sub_range(1,2)-1:sub_range(2,2))
02908       real,             intent (inout) :: chmax_y (sub_range(1,1)-1:sub_range(2,1), 
02909                                                    sub_range(1,2)-1:sub_range(2,2))
02910       real,             intent (inout) :: midp_x(sub_range(1,1)-1:sub_range(2,1), 
02911                                                  sub_range(1,2)-1:sub_range(2,2))
02912       real,             intent (inout) :: midp_y(sub_range(1,1)-1:sub_range(2,1), 
02913                                                  sub_range(1,2)-1:sub_range(2,2))
02914       integer,          intent (out)   :: ierror
02915     end subroutine psmile_bbcells_pole_real
02916 
02917     subroutine psmile_celltest_real ( grid_id, range, sense, ierror )
02918       Use PSMILe_common
02919       Integer, Intent (In)             :: grid_id
02920       Integer, Intent (In)             :: range(2,ndim_2d)
02921       Integer, Intent (Out)            :: sense
02922       Integer, Intent (Out)            :: ierror
02923     End Subroutine
02924 
02925     subroutine psmile_ccompact_gauss2_real ( send_info,     &
02926                grid_valid_shape, shape, nb_corners,         &
02927                array_x, array_y, array_z,                   &
02928                extra_search, dest_size, nbr_cells_tot,      &
02929                source_cell_index,                           &
02930                neighcells, dest_x, dest_y, dest_z, ierror )
02931 
02932        USE PSMILe_Common
02933 
02934        Type (Send_information), Intent (InOut)  :: send_info
02935        Integer, Intent (In)                     :: grid_valid_shape (2, ndim_3d)
02936        Integer, Intent (In)                     :: shape (2, ndim_3d)
02937        Integer, Intent (In)                     :: nb_corners
02938        Real, Intent (In)                        :: array_x ( shape(1,1):shape(2,1), 
02939                                                              nb_corners )
02940        Real, Intent (In)                        :: array_y ( shape(1,1):shape(2,1), 
02941                                                              nb_corners )
02942        Real, Intent (In)                        :: array_z ( shape(1,3):shape(2,3) )
02943        Integer, Intent (In)                     :: dest_size
02944        Integer, Intent (In)                     :: nbr_cells_tot
02945        Type (Extra_search_info), Intent (InOut) :: extra_search
02946        Integer, Intent (InOut)                  :: source_cell_index (nbr_cells_tot)
02947        Integer, Intent (InOut)                  :: neighcells (nbr_cells_tot, nb_corners)
02948        Real, Intent (Out)                       :: dest_x (2*dest_size)
02949        Real, Intent (Out)                       :: dest_y (2*dest_size)
02950        Real, Intent (Out)                       :: dest_z (2*dest_size)
02951        Integer, Intent (Out)                    :: ierror
02952     End Subroutine
02953 
02954     subroutine psmile_ccompact_irreg2_real ( send_info,     &
02955                grid_valid_shape, shape, nb_corners,         &
02956                array_x, array_y, array_z,                   &
02957                extra_search, dest_size, nbr_cells_tot,      &
02958                source_cell_index,                           &
02959                neighcells, dest_x, dest_y, dest_z, ierror )
02960 
02961        USE PSMILe_Common
02962 
02963        Type (Send_information), Intent (InOut)  :: send_info
02964        Type (Extra_search_info), Intent (InOut) :: extra_search
02965 
02966        Integer, Intent (In)                     :: grid_valid_shape (2, ndim_3d)
02967        Integer, Intent (In)                     :: shape (2, ndim_3d)
02968        Integer, Intent (In)                     :: nb_corners
02969        Real, Intent (In)                        :: array_x ( shape(1,1):shape(2,1), 
02970                                                              shape(1,2):shape(2,2), 
02971                                                              nb_corners )
02972        Real, Intent (In)                        :: array_y ( shape(1,1):shape(2,1), 
02973                                                              shape(1,2):shape(2,2), 
02974                                                              nb_corners )
02975        Real, Intent (In)                        :: array_z ( shape(1,3):shape(2,3) )
02976        Integer, Intent (In)                     :: dest_size
02977        Integer, Intent (In)                     :: nbr_cells_tot
02978        Integer, Intent (InOut)                  :: source_cell_index (nbr_cells_tot)
02979        Integer, Intent (InOut)                  :: neighcells(nbr_cells_tot, nb_corners)
02980        Real, Intent (Out)                       :: dest_x (dest_size)
02981        Real, Intent (Out)                       :: dest_y (dest_size)
02982        Real, Intent (Out)                       :: dest_z (dest_size)
02983        Integer, Intent (Out)                    :: ierror
02984     End Subroutine
02985 
02986     subroutine psmile_ccompact_3d_reg_real ( send_info,     &
02987                grid_valid_shape, shape, nb_corners,         &
02988                array_x, array_y, array_z,                   &
02989                extra_search, dest_size, nbr_cells_tot,      &
02990                source_cell_index,                           &
02991                neighcells, dest_x, dest_y, dest_z, ierror )
02992 
02993        USE PSMILe_Common
02994 
02995        Type (Send_information), Intent (InOut)  :: send_info
02996        Integer, Intent (In)                     :: grid_valid_shape (2, ndim_3d)
02997        Integer, Intent (In)                     :: shape (2, ndim_3d)
02998        Integer, Intent (In)                     :: nb_corners
02999        Real, Intent (In)                        :: array_x ( shape(1,1):shape(2,1), 
03000                                                              nb_corners )
03001        Real, Intent (In)                        :: array_y ( shape(1,2):shape(2,2), 
03002                                                              nb_corners )
03003        Real, Intent (In)                        :: array_z ( shape(1,3):shape(2,3) )
03004        Type (Extra_search_info), Intent (InOut) :: extra_search
03005        Integer, Intent (In)                     :: dest_size
03006        Integer, Intent (In)                     :: nbr_cells_tot
03007        Integer, Intent (InOut)                  :: source_cell_index (nbr_cells_tot)
03008        Real, Intent (Out)                       :: dest_x (dest_size)
03009        Real, Intent (Out)                       :: dest_y (dest_size)
03010        Real, Intent (Out)                       :: dest_z (dest_size)
03011        Integer, Intent (InOut)                  :: neighcells (nbr_cells_tot, nb_corners)
03012        Integer, Intent (Out)                    :: ierror
03013     End Subroutine
03014 
03015     subroutine psmile_control_cell_2d_real (grid_id,               &
03016                     ic, nc, icdim1, list, j, k,                    &
03017                     coords1,  coords2,  shape,                     &
03018                     corners1, corners2, corner_shape, nbr_corners, &
03019                     tol, fnd, ierror)
03020       Use PSMILe_common
03021 
03022       Integer,          Intent (In)   :: grid_id, nc, icdim1
03023       Integer,          Intent (In)   :: ic (icdim1, ndim_2d)
03024       Integer,          Intent (In)   :: list (nc), j, k
03025       Integer,          Intent (In)   :: shape (2, ndim_3d)
03026       Real,             Intent (In)   :: coords1 (shape(1,1):shape(2,1), 
03027                                                   shape(1,2):shape(2,2), 
03028                                                   shape(1,3):shape(2,3))
03029       Real,             Intent (In)   :: coords2 (shape(1,1):shape(2,1), 
03030                                                   shape(1,2):shape(2,2), 
03031                                                   shape(1,3):shape(2,3))
03032       Integer,          Intent (In)   :: corner_shape (2, ndim_2d)
03033       Integer,          Intent (In)   :: nbr_corners
03034       Real,             Intent (In)   ::                 
03035          corners1 ( corner_shape(1,1):corner_shape(2,1), 
03036                     corner_shape(1,2):corner_shape(2,2), nbr_corners)
03037       Real,             Intent (In)   ::                 
03038          corners2 ( corner_shape(1,1):corner_shape(2,1), 
03039                     corner_shape(1,2):corner_shape(2,2), nbr_corners)
03040       Real,             Intent (In)   :: tol
03041       Logical,          Intent (Out)  :: fnd (nc)
03042       Integer,          Intent (Out)  :: ierror
03043     End Subroutine
03044 
03045     subroutine psmile_ext_compact_irreg2_real (send_info, array, shape, &
03046                                                grid_valid_shape,        &
03047                                                dest_vector, dest_size, ierror)
03048        Use PSMILe_common
03049        Type(Send_information), Intent(InOut) :: send_info
03050        Real, Intent (In)                     :: array (*)
03051        Integer, Intent (In)                  :: shape (2, ndim_2d)
03052        Integer, Intent (In)                  :: grid_valid_shape (2, ndim_3d)
03053        Integer, Intent (In)                  :: dest_size
03054        Real, Intent (Out)                    :: dest_vector (dest_size)
03055        Integer, Intent (Out)                 :: ierror
03056     End Subroutine
03057 
03058     subroutine psmile_ext_compact_list_3d_real (send_info, array, shape, &
03059                                                 grid_valid_shape,        &
03060                                                 dest_vector, dest_size, ierror)
03061        Use PSMILe_common
03062        Type(Send_information), Intent(In)    :: send_info
03063        Real, Intent (In)                     :: array (*)
03064        Integer, Intent (In)                  :: shape (2, ndim_3d)
03065        Integer, Intent (In)                  :: grid_valid_shape (2, ndim_3d)
03066        Integer, Intent (In)                  :: dest_size
03067        Real, Intent (Out)                    :: dest_vector (dest_size)
03068        Integer, Intent (Out)                 :: ierror
03069     End Subroutine
03070 
03071     subroutine psmile_put_compact_list_3d_real (source_list, dstijk, nloc, &
03072                                                 array, shape, nbr_fields,  &
03073                                                 ierror)
03074        Use PSMILe_common
03075        Real, Intent (InOut)               :: array (*)
03076        Integer, Intent (In)               :: shape (2, ndim_3d)
03077        Integer, Intent (In)               :: nloc, nbr_fields
03078        Integer, Intent (In)               :: dstijk (ndim_3d, nbr_fields)
03079        Real, Intent (In)                  :: source_list (nloc, nbr_fields)
03080        Integer, Intent (Out)              :: ierror
03081     End Subroutine
03082 
03083     subroutine psmile_extract_indices_2d_real (array, shape, &
03084                                                dstijk, ncpl, &
03085                                                dest_vector, ierror)
03086        Use PSMILe_common
03087        Real, Intent (In)                  :: array (*)
03088        Integer, Intent (In)               :: shape (2, ndim_2d)
03089        Integer, Intent (In)               :: ncpl
03090        Integer, Intent (In)               :: dstijk (ndim_3d, ncpl)
03091        Real, Intent (Out)                 :: dest_vector (ncpl)
03092        Integer, Intent (Out)              :: ierror
03093     End Subroutine
03094 
03095     subroutine psmile_extract_indices_3d_real (array, shape, &
03096                                                dstijk, ncpl, &
03097                                                dest_vector, ierror)
03098        Use PSMILe_common
03099        Real, Intent (In)                  :: array (*)
03100        Integer, Intent (In)               :: shape (2, ndim_3d)
03101        Integer, Intent (In)               :: ncpl
03102        Integer, Intent (In)               :: dstijk (ndim_3d, ncpl)
03103        Real, Intent (Out)                 :: dest_vector (ncpl)
03104        Integer, Intent (Out)              :: ierror
03105     End Subroutine
03106 
03107     subroutine psmile_extent_subgrid_1d_real (           &
03108                     array, idlow, idhigh, nbr_corners,   &
03109                            ibeg,  iend,                  &
03110                     extent, ierror)
03111        Integer, Intent (In)            :: idlow, idhigh, nbr_corners
03112        Integer, Intent (In)            :: ibeg, iend
03113        Real, Intent (In)               :: array (idlow:idhigh, nbr_corners)
03114        Real, Intent (Out)              :: extent (2)
03115        Integer, Intent (Out)           :: ierror
03116     End Subroutine
03117 
03118     subroutine psmile_extent_subgrid_2d_real (           &
03119                     array, idlow, idhigh, jdlow, jdhigh, nbr_corners,   &
03120                            ibeg,  iend,   jbeg,  jend,                  &
03121                     extent, ierror)
03122        Integer, Intent (In)            :: idlow, idhigh
03123        Integer, Intent (In)            :: jdlow, jdhigh, nbr_corners
03124        Integer, Intent (In)            :: ibeg, iend, jbeg, jend
03125        Real, Intent (In)               :: array (idlow:idhigh,          
03126                                                  jdlow:jdhigh, nbr_corners)
03127        Real, Intent (Out)              :: extent (2)
03128        Integer, Intent (Out)           :: ierror
03129     End Subroutine
03130 
03131     subroutine psmile_extent_subgrid_3d_real (           &
03132                     array, idlow, idhigh, jdlow, jdhigh, &
03133                            kdlow, kdhigh, nbr_corners,   &
03134                            grid_shape,                   &
03135                     extent, ierror)
03136        Use PSMILe_common
03137        Integer, Intent (In)            :: idlow, idhigh, jdlow, jdhigh
03138        Integer, Intent (In)            :: kdlow, kdhigh, nbr_corners
03139        Integer, Intent (In)            :: grid_shape (2, ndim_3d)
03140        Real, Intent (In)               :: array (idlow:idhigh, jdlow:jdhigh, 
03141                                                  kdlow:kdhigh, nbr_corners)
03142        Real, Intent (Out)              :: extent (2)
03143        Integer, Intent (Out)           :: ierror
03144     End Subroutine
03145 
03146     subroutine psmile_gauss_setup_real (grid_id, counts, displs, ierror)
03147       Integer, Intent (In)             :: grid_id
03148       Integer, Intent (In)             :: counts (*)
03149       Integer, Intent (In)             :: displs (*)
03150       Integer, Intent (Out)            :: ierror
03151     End Subroutine PSMILe_gauss_setup_real
03152 
03153     subroutine psmile_generate_1d_3d_real (            &
03154                     vector1, vector2, vector3, shape,  &
03155                     dest_array, dest_shape,            &
03156                     grid_valid_shape, ierror)
03157        Use PSMILe_common
03158 
03159        Real,             Intent (In)   :: vector1 (*)
03160        Real,             Intent (In)   :: vector2 (*)
03161        Real,             Intent (In)   :: vector3 (*)
03162        Integer,          Intent (In)   :: shape (2, ndim_3d)
03163        Integer,          Intent (In)   :: dest_shape (2, ndim_3d)
03164        Real,             Intent (Out)  :: dest_array ( 
03165                                              dest_shape(1,1):dest_shape(2,1), 
03166                                              dest_shape(1,2):dest_shape(2,2), 
03167                                              dest_shape(1,3):dest_shape(2,3))
03168        Integer,          Intent (In)   :: grid_valid_shape (2, ndim_3d)
03169        Integer,          Intent (Out)  :: ierror
03170     End Subroutine
03171 !
03172     subroutine psmile_get_cyclic_dir_3d_real (                 &
03173                            chmin, chmin2, chmin3,              &
03174                            chmax, chmax2, chmax3, levdim,      &
03175                            corners, corners2, corners3,        &
03176                            corner_shape, nbr_corners,          &
03177                            grid_valid_shape,                   &
03178                            len_cyclic, rtol, index, cyclic, ierror)
03179        Use PSMILe_common
03180 
03181        Real, Intent (In)               :: chmin (*)
03182        Real, Intent (In)               :: chmax (*)
03183        Real, Intent (In)               :: chmin2 (*)
03184        Real, Intent (In)               :: chmax2 (*)
03185        Real, Intent (In)               :: chmin3 (*)
03186        Real, Intent (In)               :: chmax3 (*)
03187        Integer, Intent (In)            :: levdim (ndim_3d)
03188        Real, Intent (In)               :: corners (*)
03189        Real, Intent (In)               :: corners2 (*)
03190        Real, Intent (In)               :: corners3 (*)
03191        Integer, Intent (In)            :: corner_shape (2, ndim_3d)
03192        Integer, Intent (In)            :: nbr_corners
03193        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
03194        Real, Intent (In)               :: len_cyclic, rtol
03195        Integer, Intent (In)            :: index
03196        Logical, Intent (Out)           :: cyclic
03197        Integer, Intent (Out)           :: ierror
03198     End Subroutine
03199 
03200     subroutine psmile_get_faces_3d_real (search, extra_search,     &
03201                     corners1, corners2, corners3,                  &
03202                     corner_shape, nbr_corners, grid_valid_shape,   &
03203                     neighbors_3d, nloc, num_neigh,                 &
03204                     faces, n_faces, nreq, ierror)
03205        Use PSMILe_common
03206 
03207        Type (Enddef_search),     Intent (In)  :: search
03208        Type (Extra_search_info), Intent (In)  :: extra_search
03209        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
03210        Integer,                  Intent (In)  :: nreq
03211        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
03212        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
03213        Real,                     Intent (In)  :: 
03214           corners1 ( corner_shape(1,1):corner_shape(2,1), 
03215                      corner_shape(1,2):corner_shape(2,2), 
03216                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
03217        Real,                     Intent (In)  :: 
03218           corners2 ( corner_shape(1,1):corner_shape(2,1), 
03219                      corner_shape(1,2):corner_shape(2,2), 
03220                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
03221        Real,                     Intent (In)  :: 
03222           corners3 ( corner_shape(1,1):corner_shape(2,1), 
03223                      corner_shape(1,2):corner_shape(2,2), 
03224                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
03225        Integer,                  Intent (In)  :: 
03226           neighbors_3d (ndim_3d, nloc, num_neigh)
03227 !
03228        Real,                     Intent (Out) :: faces (2, ndim_3d, nreq)
03229        Integer,                  Intent (Out) :: n_faces (nreq)
03230        Integer,                  Intent (Out) :: ierror
03231     End Subroutine
03232 
03233     subroutine psmile_get_faces_3d_reg_real (search, extra_search, &
03234                     corners1, corners2, corners3,                  &
03235                     corner_shape, nbr_corners, grid_valid_shape,   &
03236                     neighbors_3d, nloc, num_neigh,                 &
03237                     faces, n_faces, nreq, ierror)
03238        Use PSMILe_common
03239 
03240        Type (Enddef_search),     Intent (In)  :: search
03241        Type (Extra_search_info), Intent (In)  :: extra_search
03242        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
03243        Integer,                  Intent (In)  :: nreq
03244        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
03245        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
03246        Real,                     Intent (In)  :: 
03247           corners1 ( corner_shape(1,1):corner_shape(2,1), 2)
03248        Real,                     Intent (In)  :: 
03249           corners2 ( corner_shape(1,2):corner_shape(2,2), 2)
03250        Real,                     Intent (In)  :: 
03251           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
03252        Integer,                  Intent (In)  :: 
03253           neighbors_3d (ndim_3d, nloc, num_neigh)
03254 !
03255        Real,                     Intent (Out) :: faces (2, ndim_3d, nreq)
03256        Integer,                  Intent (Out) :: n_faces (nreq)
03257        Integer,                  Intent (Out) :: ierror
03258     End Subroutine
03259 
03260     subroutine psmile_get_faces_gauss2_real (search, extra_search, &
03261                     corners1, corners2, corners3,                  &
03262                     corner_shape, nbr_corners, grid_valid_shape,   &
03263                     neighbors_3d, nloc, num_neigh,                 &
03264                     faces, nreq, ierror)
03265 
03266        Use PSMILe_common
03267 
03268        Type (Enddef_search),     Intent (In)  :: search
03269        Type (Extra_search_info), Intent (In)  :: extra_search
03270        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
03271        Integer,                  Intent (In)  :: nreq
03272        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
03273        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
03274        Real,                     Intent (In)  :: 
03275           corners1 ( corner_shape(1,1):corner_shape(2,1), 2 )
03276        Real,                     Intent (In)  :: 
03277           corners2 ( corner_shape(1,1):corner_shape(2,1), 2 )
03278        Real,                     Intent (In)  :: 
03279           corners3 ( corner_shape(1,3):corner_shape(2,3), 2 )
03280        Integer,                  Intent (In)  :: 
03281           neighbors_3d (ndim_3d, nloc, num_neigh)
03282 !
03283        Real,                     Intent (Out) :: faces (2, ndim_3d, nreq)
03284        Integer,                  Intent (Out) :: ierror
03285     End Subroutine
03286 
03287     subroutine psmile_get_faces_irreg2_real (search, extra_search, &
03288                     corners1, corners2, corners3,                  &
03289                     corner_shape, nbr_corners, grid_valid_shape,   &
03290                     neighbors_3d, nloc, num_neigh,                 &
03291                     faces, n_faces, nreq, ierror)
03292        Use PSMILe_common
03293 
03294        Type (Enddef_search),     Intent (In)  :: search
03295        Type (Extra_search_info), Intent (In)  :: extra_search
03296        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
03297        Integer,                  Intent (In)  :: nreq
03298        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
03299        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
03300        Real,                     Intent (In)  :: 
03301           corners1 ( corner_shape(1,1):corner_shape(2,1), 
03302                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
03303        Real,                     Intent (In)  :: 
03304           corners2 ( corner_shape(1,1):corner_shape(2,1), 
03305                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
03306        Real,                     Intent (In)  :: 
03307           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
03308        Integer,                  Intent (In)  :: 
03309           neighbors_3d (ndim_3d, nloc, num_neigh)
03310 !
03311        Real,                     Intent (Out) :: faces (2, ndim_3d, nreq)
03312        Integer,                  Intent (Out) :: n_faces (nreq)
03313        Integer,                  Intent (Out) :: ierror
03314     End Subroutine
03315 
03316     subroutine psmile_get_grid_extent_real (grid_id, extent, ierror)
03317        Use PSMILe_common
03318        Integer,                  Intent (In)   :: grid_id
03319        Real (PSMILe_float_kind), Intent (Out)  :: extent (2, ndim_3d)
03320        Integer,                  Intent (Out)  :: ierror
03321     End Subroutine
03322 
03323     subroutine psmile_global_search_nnx_real (comp_info,         &
03324                     search, var_id,                              &
03325                     tgt_coords_x, tgt_coords_y, tgt_coords_z,    &
03326                     neighbors_3d, nloc, num_neigh, nb_extra,     &
03327                     extra_search, send_index,                    &
03328                     ierror)
03329        Use PSMILe_common
03330 
03331        Type (Enddef_comp),   Intent (In)    :: comp_info
03332        Type (Enddef_search), Intent (InOut) :: search
03333        Integer,              Intent (In)    :: var_id
03334        Integer,              Intent (In)    :: send_index
03335        Integer,              Intent (In)    :: nb_extra, nloc, num_neigh
03336        Real,                 Intent (In)    :: tgt_coords_x (nloc)
03337        Real,                 Intent (In)    :: tgt_coords_y (nloc)
03338        Real,                 Intent (In)    :: tgt_coords_z (nloc)
03339        Integer,              Intent (InOut) :: 
03340           neighbors_3d (ndim_3d, nloc,  num_neigh)
03341        Type (Extra_search_info), Intent (InOut) :: extra_search
03342        Integer,              Intent (Out)   :: ierror
03343     End Subroutine
03344 
03345     subroutine psmile_global_search_real (comp_info,             &
03346                     control, len_cpl, var_id, grid_valid_shape,  &
03347                     search, tgt_coords,                          &
03348                     neighbors_3d, nloc, num_neigh, extra_search, &
03349                     interpolation_methods, interpolation_search, n_intmethods, &
03350                     send_index,                                  &
03351                     mask_available, use_mask, use_how,           &
03352                     grid_type, ierror)
03353        Use PSMILe_common
03354 
03355        Type (Enddef_comp),   Intent (In)    :: comp_info
03356        Type (Enddef_search), Intent (InOut) :: search
03357        Type (real_vector),   Intent (In)    :: tgt_coords (ndim_3d)
03358        Integer,              Intent (In)    :: control (2, ndim_3d, 
03359                                                search%search_data%npart)
03360        Integer,              Intent (In)    :: len_cpl (search%search_data%npart)
03361        Integer,              Intent (In)    :: var_id
03362        Integer,              Intent (In)    :: grid_valid_shape (2, ndim_3d)
03363        Integer,              Intent (In)    :: send_index
03364        Integer,              Intent (In)    :: nloc, num_neigh
03365        Integer,              Intent (In)    :: n_intmethods
03366        Integer,              Intent (In)    :: interpolation_methods (n_intmethods)
03367        Logical,              Intent (In)    :: interpolation_search  (n_intmethods)
03368        Logical,              Intent (In)    :: mask_available, use_mask
03369        Integer,              Intent (In)    :: use_how
03370        Integer,              Intent (In)    :: grid_type
03371        Integer,              Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
03372                                                              num_neigh)
03373        Type (Extra_search_info), Intent (InOut) :: extra_search
03374        Integer,              Intent (Out)   :: ierror
03375     End Subroutine
03376 
03377     subroutine psmile_global_search_cell_real ( grid_id, var_id,    &
03378                   comp_info, send_info, search, extra_search, ncpl, &
03379                   nbr_cells, n_intmethods, interpolation_methods,   &
03380                   interpolation_search, ierror )
03381        Use PSMILe_common
03382 
03383        Integer,                  Intent (In)    :: grid_id
03384        Integer,                  Intent (In)    :: var_id
03385        Type (Enddef_comp),       Intent (In)    :: comp_info
03386        Type (Send_information),  Intent (InOut) :: send_info
03387        Type (Enddef_search),     Intent (InOut) :: search
03388        Type (Extra_search_info), Intent (InOut) :: extra_search
03389        Integer,                  Intent (In)    :: ncpl
03390        Integer,                  Intent (InOut) :: nbr_cells(ncpl)
03391        Integer,                  Intent (In)    :: n_intmethods
03392        Integer,                  Intent (In)    :: interpolation_methods (n_intmethods)
03393        Logical,                  Intent (In)    :: interpolation_search  (n_intmethods)
03394        Integer,                  Intent (Out)   :: ierror
03395     End Subroutine
03396 
03397     subroutine psmile_return_extra_off_real (comp_info, search, var_id, &
03398                       found, distance, nd_dist, nb_extra, ierror)
03399        Use PSMILe_common
03400 
03401        Type (Enddef_comp),          Intent (In)    :: comp_info
03402        Type (Enddef_global_search), Intent (InOut) :: search
03403        Integer,                     Intent (In)    :: var_id
03404        Integer,                     Intent (In)    :: nd_dist, nb_extra
03405        Integer,                     Intent (In)    :: found (nd_dist)
03406        Real,                        Intent (In)    :: distance (nd_dist, 
03407                                                                 nb_extra)
03408 
03409        Integer,                     Intent (Out)   :: ierror
03410     End Subroutine
03411 
03412     subroutine psmile_sel_grid_range_real (grid_id, dinter, inter, ierror)
03413        Use PSMILe_common
03414        Integer,                  Intent (In)  :: grid_id
03415        Real (PSMILe_float_kind), Intent (In)  :: dinter (2, ndim_3d)
03416        Integer,                  Intent (Out) ::  inter (2, ndim_3d)
03417        Integer,                  Intent (Out) :: ierror
03418     End Subroutine
03419 
03420     subroutine psmile_range_subgrid_1d_real (            &
03421                     array, idlow, idhigh, nbr_corners,   &
03422                            ibeg,  iend,                  &
03423                     extent, inter, ierror)
03424        Integer, Intent (In)            :: idlow, idhigh, nbr_corners
03425        Integer, Intent (In)            :: ibeg, iend
03426        Real, Intent (In)               :: array (idlow:idhigh, nbr_corners)
03427        Real, Intent (In)               :: extent (2)
03428        Integer, Intent (Out)           :: inter (2)
03429        Integer, Intent (Out)           :: ierror
03430     End Subroutine
03431 
03432     subroutine psmile_range_subgrid_2d_real (           &
03433                     array1, array2,                                     &
03434                           idlow, idhigh, jdlow, jdhigh, nbr_corners,    &
03435                            ibeg,  iend,   jbeg,  jend,                  &
03436                     extent, inter, ierror)
03437        Integer, Intent (In)            :: idlow, idhigh
03438        Integer, Intent (In)            :: jdlow, jdhigh, nbr_corners
03439        Integer, Intent (In)            :: ibeg, iend, jbeg, jend
03440        Real, Intent (In)               :: array1(idlow:idhigh,          
03441                                                  jdlow:jdhigh, nbr_corners)
03442        Real, Intent (In)               :: array2(idlow:idhigh,          
03443                                                  jdlow:jdhigh, nbr_corners)
03444        Real, Intent (In)               :: extent (2,2)
03445        Integer, Intent (Out)           :: inter (2,2)
03446        Integer, Intent (Out)           :: ierror
03447     End Subroutine
03448 
03449     subroutine psmile_range_subgrid_3d_real (           &
03450                    array1, array2, array3,               &
03451                            idlow, idhigh, jdlow, jdhigh, &
03452                            kdlow, kdhigh, nbr_corners,   &
03453                            grid_shape,                   &
03454                            rinter, inter, ierror)
03455        Use PSMILe_common
03456        Integer, Intent (In)            :: idlow, idhigh, jdlow, jdhigh
03457        Integer, Intent (In)            :: kdlow, kdhigh, nbr_corners
03458        Real, Intent (In)               :: array1(idlow:idhigh, jdlow:jdhigh, 
03459                                                  kdlow:kdhigh, nbr_corners)
03460        Real, Intent (In)               :: array2(idlow:idhigh, jdlow:jdhigh, 
03461                                                  kdlow:kdhigh, nbr_corners)
03462        Real, Intent (In)               :: array3(idlow:idhigh, jdlow:jdhigh, 
03463                                                  kdlow:kdhigh, nbr_corners)
03464        Integer, Intent (In)            :: grid_shape (2, ndim_3d)
03465        Real, Intent (In)               :: rinter (2, ndim_3d)
03466        Integer, Intent (Out)           ::  inter (2, ndim_3d)
03467        Integer, Intent (Out)           :: ierror
03468     End Subroutine
03469 
03470     subroutine psmile_mg_ctrl_subgrid_1d_real (       &
03471                     array, corner_shape, nbr_corners, &
03472                            range,                     &
03473                     chmin, chmax, levdim, period,     &
03474                     grid_id, ind, ierror)
03475        Integer, Intent (In)             :: nbr_corners
03476        Integer, Intent (In)             :: corner_shape (2)
03477        Integer, Intent (In)             :: range (2)
03478        Integer, Intent (In)             :: levdim
03479        Real, Intent (In)                :: period
03480        Real, Intent (In)                :: array(corner_shape(1):
03481                                                  corner_shape(2),
03482                                                  nbr_corners)
03483        Real, Intent (In)                :: chmin (0:levdim)
03484        Real, Intent (In)                :: chmax (0:levdim)
03485        Integer, Intent (In)             :: grid_id, ind
03486        Integer, Intent (Out)            :: ierror
03487     End Subroutine
03488 
03489     subroutine psmile_mg_ctrl_subgrid_2d_real (       &
03490                     array, corner_shape, nbr_corners, &
03491                            range,                     &
03492                     chmin, chmax, levdim, period,     &
03493                     grid_id, ind, ierror)
03494        Integer, Intent (In)             :: nbr_corners
03495        Integer, Intent (In)             :: corner_shape (2, 2)
03496        Integer, Intent (In)             :: range (2, 2)
03497        Integer, Intent (In)             :: levdim (2)
03498        Real, Intent (In)                :: period
03499        Real, Intent (In)                :: array(corner_shape(1,1):
03500                                                  corner_shape(2,1),
03501                                                  corner_shape(1,2):
03502                                                  corner_shape(2,2),
03503                                                  nbr_corners)
03504        Real, Intent (In)                :: chmin (0:levdim(1), 0:levdim(2))
03505        Real, Intent (In)                :: chmax (0:levdim(1), 0:levdim(2))
03506        Integer, Intent (In)             :: grid_id, ind
03507        Integer, Intent (Out)            :: ierror
03508     End Subroutine
03509 
03510     subroutine psmile_mg_ctrl_subgrid_3d_real (       &
03511                     array, corner_shape, nbr_corners, &
03512                            range,                     &
03513                     chmin, chmax, levdim, period,     &
03514                     grid_id, ind, ierror)
03515        Use PSMILe_common
03516        Integer, Intent (In)             :: nbr_corners
03517        Integer, Intent (In)             :: corner_shape (2, ndim_3d)
03518        Integer, Intent (In)             :: range (2, ndim_3d)
03519        Integer, Intent (In)             :: levdim (ndim_3d)
03520        Real, Intent (In)                :: period
03521        Real, Intent (In)                :: array(corner_shape(1,1):
03522                                                  corner_shape(2,1),
03523                                                  corner_shape(1,2):
03524                                                  corner_shape(2,2),
03525                                                  corner_shape(1,3):
03526                                                  corner_shape(2,3),
03527                                                  nbr_corners)
03528        Real, Intent (In)                :: chmin (0:levdim(1), 0:levdim(2), 
03529                                                   0:levdim(3))
03530        Real, Intent (In)                :: chmax (0:levdim(1), 0:levdim(2), 
03531                                                   0:levdim(3))
03532        Integer, Intent (In)             :: grid_id, ind
03533        Integer, Intent (Out)            :: ierror
03534     End Subroutine
03535 
03536 
03537     subroutine psmile_mg_first_level_real (grid_id, range, &
03538                     mg_info, tol, simplified_grid, ierror)
03539        Use PSMILe_common
03540        Integer,          Intent (In)    :: grid_id
03541        Integer,          Intent (In)    :: range (2, ndim_3d)
03542        Type (Enddef_mg), Intent (InOut) :: mg_info
03543        Real (PSMILe_float_kind), Intent (In) :: tol
03544        Logical,          Intent (In)    :: simplified_grid
03545        Integer,          Intent (Out)   :: ierror
03546     End Subroutine
03547 
03548     subroutine psmile_mg_first_subgrid_1d_real (         &
03549                     array, idlow, idhigh, nbr_corners,   &
03550                            range,                        &
03551                     chmin, chmax, midp,                  &
03552                     levdim, ierror)
03553        Integer, Intent (In)            :: idlow, idhigh, nbr_corners
03554        Integer, Intent (In)            :: range (2)
03555        Integer, Intent (In)            :: levdim
03556        Real, Intent (In)               :: array (idlow:idhigh, nbr_corners)
03557        Real, Intent (Out)              :: chmin (0:levdim)
03558        Real, Intent (Out)              :: chmax (0:levdim)
03559        Real, Intent (Out)              :: midp  (0:levdim)
03560        Integer, Intent (Out)           :: ierror
03561     End Subroutine
03562 
03563     subroutine psmile_mg_first_subgrid_2d_real (array, &
03564                     idlow, idhigh, jdlow, jdhigh, nbr_corners,   &
03565                            range,                        &
03566                     chmin, chmax, midp,                  &
03567                     levdim1, levdim2, ierror)
03568        Integer, Intent (In)            :: idlow, idhigh, jdlow, jdhigh
03569        Integer, Intent (In)            :: nbr_corners
03570        Integer, Intent (In)            :: range (2, 2)
03571        Integer, Intent (In)            :: levdim1, levdim2
03572        Real, Intent (In)               :: array (idlow:idhigh, jdlow:jdhigh, 
03573                                                  nbr_corners)
03574        Real, Intent (Out)              :: chmin (0:levdim1, 0:levdim2)
03575        Real, Intent (Out)              :: chmax (0:levdim1, 0:levdim2)
03576        Real, Intent (Out)              :: midp  (0:levdim1, 0:levdim2)
03577        Integer, Intent (Out)           :: ierror
03578     End Subroutine
03579 
03580     subroutine psmile_mg_first_subgrid_3d_real (array, &
03581                     idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
03582                     nbr_corners,   &
03583                            range,                        &
03584                     chmin, chmax, midp,                  &
03585                     levdim1, levdim2, levdim3, ierror)
03586        Use PSMILe_common
03587        Integer, Intent (In)            :: idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh
03588        Integer, Intent (In)            :: nbr_corners
03589        Real, Intent (In)               :: array (idlow:idhigh, jdlow:jdhigh, 
03590                                                  kdlow:kdhigh, nbr_corners)
03591        Integer, Intent (In)            :: range (2, ndim_3d)
03592        Integer, Intent (In)            :: levdim1, levdim2, levdim3
03593        Real, Intent (Out)              :: chmin (0:levdim1, 0:levdim2, 0:levdim3)
03594        Real, Intent (Out)              :: chmax (0:levdim1, 0:levdim2, 0:levdim3)
03595        Real, Intent (Out)              :: midp  (0:levdim1, 0:levdim2, 0:levdim3)
03596        Integer, Intent (Out)           :: ierror
03597     End Subroutine
03598 
03599     subroutine psmile_mg_coars_level_real (grid_id, mg_info_fine, &
03600                                      mg_info_coarse, &
03601                                      icoarse, ierror)
03602        Use PSMILe_common
03603        Integer, Intent (In)            :: grid_id
03604        Type (Enddef_mg), Intent (In)   :: mg_info_fine
03605        Type (Enddef_mg), Intent (InOut):: mg_info_coarse
03606        Integer, Intent (In)            :: icoarse (ndim_3d)
03607        Integer, Intent (Out)           :: ierror
03608     End Subroutine
03609 
03610     subroutine psmile_mg_coars_subgrid_3d_real ( chfmin, chfmax, midfp, &
03611                              levdim1_fine, levdim2_fine, levdim3_fine,  &
03612                                                 chcmin, chcmax, midcp,  &
03613                                             levdim1, levdim2, levdim3,  &
03614                                                 icoarse, ierror)
03615        Use PSMILe_common
03616        Integer, Intent (In)            :: levdim1_fine, levdim2_fine, 
03617                                           levdim3_fine
03618        Integer, Intent (In)            :: levdim1, levdim2, levdim3
03619        Real, Intent (In)               :: chfmin (0:levdim1_fine,  
03620                                                   0:levdim2_fine,  
03621                                                   0:levdim3_fine)
03622        Real, Intent (In)               :: chfmax (0:levdim1_fine,  
03623                                                   0:levdim2_fine,  
03624                                                   0:levdim3_fine)
03625        Real, Intent (In)               ::  midfp (0:levdim1_fine,  
03626                                                   0:levdim2_fine,  
03627                                                   0:levdim3_fine)
03628        Real, Intent (Out)              :: chcmin (0:levdim1, 0:levdim2, 
03629                                                   0:levdim3)
03630        Real, Intent (Out)              :: chcmax (0:levdim1, 0:levdim2, 
03631                                                   0:levdim3)
03632        Real, Intent (Out)              ::  midcp (0:levdim1, 0:levdim2, 
03633                                                   0:levdim3)
03634        Integer, Intent (In)            :: icoarse (ndim_3d)
03635        Integer, Intent (Out)           :: ierror
03636     End Subroutine
03637 
03638     subroutine psmile_mg_get_cyclic_real (grid_id, range, &
03639                                           tol, ierror)
03640        Use PSMILe_common
03641 
03642        Integer, Intent (In)               :: grid_id
03643        Integer, Intent (In)               :: range (2, ndim_3d)
03644        Real, Intent (In)                  :: tol
03645        Integer, Intent (Out)              :: ierror
03646     End Subroutine
03647 !
03648     subroutine psmile_neigh_extra_search_real (search, extra_search, &
03649                                                nb_extra, ierror)
03650        Use PSMILe_common
03651 
03652        Type (Enddef_search),     Intent (In)    :: search
03653        Type (Extra_search_info), Intent (InOut) :: extra_search
03654        Integer,                  Intent (In)    :: nb_extra
03655        Integer,                  Intent (Out)   :: ierror
03656     End Subroutine
03657 !
03658     subroutine psmile_send_req_coords_real (msg_intersections, &
03659                                             dest, tag, ierror)
03660        use psmile_common, only : enddef_msg_intersections
03661 
03662        Integer, Intent (In)                         :: dest, tag
03663        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
03664        Integer, Intent (Out)                        :: ierror
03665     End Subroutine
03666 !
03667     subroutine psmile_send_req_corners_real (msg_intersections, &
03668                                              dest, tag, ierror)
03669        use psmile_common, only : enddef_msg_intersections
03670 
03671        Integer, Intent (In)                         :: dest, tag
03672        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
03673        Integer, Intent (Out)                        :: ierror
03674 
03675     End Subroutine
03676 !
03677     subroutine psmile_recv_req_coords_real (sender, tag, search, &
03678                                             recv_req, recv_mask, new_search, ierror)
03679        Use PSMILe_common
03680        Integer, Intent (In)                 :: sender, tag
03681        Logical, Intent (In)                 :: recv_mask, new_search
03682        Type (Enddef_search), Intent (InOut) :: search
03683        Integer, Intent (Out)                :: recv_req (ndim_3d+2, *)
03684        Integer, Intent (Out)                :: ierror
03685     End Subroutine
03686 !
03687     subroutine psmile_recv_req_corners_real (sender, tag,      &
03688                                              search, recv_req, &
03689                                              recv_mask, new_search, &
03690                                              ierror)
03691        Use PSMILe_common
03692        Integer, Intent (In)                 :: sender, tag
03693        Logical, Intent (In)                 :: recv_mask, new_search
03694        Type (Enddef_search), Intent (InOut) :: search
03695        Integer, Intent (Out)                :: recv_req (ndim_3d+2, *)
03696        Integer, Intent (Out)                :: ierror
03697     End Subroutine
03698 !
03699     subroutine psmile_mg_search_1d_real (grid_id, idim, found,   &
03700                                          locations, coords, len, &
03701                                          tol, ierror)
03702        Use PSMILe_common
03703 
03704        Integer, Intent (In)            :: grid_id
03705        Integer, Intent (In)            :: idim
03706        Integer, Intent (In)            :: len
03707        Integer, Intent (InOut)         :: found (len)
03708        Integer, Intent (InOut)         :: locations (len)
03709        Real, Intent (In)               :: coords (len)
03710        Real, Intent (In)               :: tol
03711        Integer, Intent (Out)           :: ierror
03712     End Subroutine
03713 
03714     subroutine psmile_mg_search_2d_real (grid_id, found, &
03715                                          locations, len, &
03716                                          search_data,    &
03717                                          ipart,  tol, ierror)
03718        Use PSMILe_common
03719 
03720        Integer, Intent (In)            :: grid_id
03721        Integer, Intent (In)            :: len
03722        Integer, Intent (InOut)         :: found (len)
03723        Integer, Intent (InOut)         :: locations (ndim_2d, len)
03724        Type (Enddef_search_data)       :: search_data
03725        Integer, Intent (In)            :: ipart
03726        Real, Intent (In)               :: tol
03727        Integer, Intent (Out)           :: ierror
03728     End Subroutine
03729 
03730     subroutine psmile_mg_search_3d_real (comp_info, found,            &
03731                                          locations, len, search_data, &
03732                                          grid_id, tol, ierror)
03733        Use PSMILe_common
03734 
03735        Type (Enddef_comp), Intent (In)       :: comp_info
03736        Type (integer_vector), Intent(InOut)  :: found (*)
03737        Type (integer_vector), Intent(InOut)  :: locations (*)
03738        Integer, Intent (In)                  :: len (*)
03739        Type (Enddef_search_data)             :: search_data
03740        Integer, Intent (In)                  :: grid_id
03741        Real, Intent (In)                     :: tol
03742        Integer, Intent (Out)                 :: ierror
03743     End Subroutine
03744 
03745     subroutine psmile_search_donor_irreg3_real (comp_info, found,           &
03746                                                 locations, len, search,     &
03747                                                 field_list, n_vars,         &
03748                                                 grid_id, method_id, var_id, &
03749                                                 tol, ierror)
03750        Use PSMILe_common
03751 
03752        Type (Enddef_comp), Intent (In)       :: comp_info
03753        Type (integer_vector), Intent(InOut)  :: found (*)
03754        Type (integer_vector), Intent(InOut)  :: locations (*)
03755        Integer, Intent (In)                  :: len (*)
03756        Type (Enddef_search)                  :: search
03757        Integer, Intent (In)                  :: grid_id
03758        Integer, Intent (InOut)               :: method_id, var_id
03759        Integer, Intent (In)                  :: n_vars
03760        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
03761        Real, Intent (In)                     :: tol
03762        Integer, Intent (Out)                 :: ierror
03763     End Subroutine
03764 
03765     subroutine psmile_search_donor_3d_reg_real (comp_info,   &
03766                                             found, locations, len, &
03767                                             search, field_list, n_vars, &
03768                                             grid_id, method_id, var_id, &
03769                                             tol, ierror)
03770        Use PSMILe_common
03771 
03772        Type (Enddef_comp),    Intent (In)    :: comp_info
03773        Type (Enddef_search)                  :: search
03774        Type (integer_vector), Intent (InOut) :: found (ndim_3d, *)
03775        Type (integer_vector), Intent (InOut) :: locations (ndim_3d, *)
03776        Integer, Intent (In)                  :: len (search%search_data%npart)
03777        Integer, Intent (In)                  :: grid_id
03778        Integer, Intent (InOut)               :: method_id, var_id
03779        Integer, Intent (In)                  :: n_vars
03780        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
03781        Real, Intent (In)                     :: tol
03782        Integer, Intent (Out)                 :: ierror
03783     End Subroutine
03784 
03785     subroutine psmile_search_donor_gauss2_real (comp_info, found, &
03786                                             locations, len, search, &
03787                                             field_list, n_vars, &
03788                                             grid_id, method_id, var_id, &
03789                                             tol, ierror)
03790        Use PSMILe_common
03791 
03792        Type (Enddef_comp), Intent (In)       :: comp_info
03793        Type (Enddef_search)                  :: search
03794        Type (integer_vector)                 :: found (search%search_data%npart, 2)
03795        Type (integer_vector)                 :: locations (search%search_data%npart, 2)
03796        Integer, Intent (In)                  :: len (search%search_data%npart, 2)
03797        Integer, Intent (In)                  :: grid_id
03798        Integer, Intent (InOut)               :: method_id, var_id
03799        Integer, Intent (In)                  :: n_vars
03800        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
03801        Real, Intent (In)                     :: tol
03802        Integer, Intent (Out)                 :: ierror
03803     End Subroutine
03804 
03805     subroutine psmile_search_donor_irreg2_real (comp_info, found,     &
03806                       locations, len, search,                         &
03807                       field_list, n_vars, grid_id, method_id, var_id, &
03808                       tol, ierror)
03809        Use PSMILe_common
03810 
03811        Type (Enddef_comp), Intent (In)       :: comp_info
03812        Type (Enddef_search)                  :: search
03813        Type (integer_vector)                 :: found (search%search_data%npart, 2)
03814        Type (integer_vector)                 :: locations (search%search_data%npart, 2)
03815        Integer, Intent (In)                  :: len (search%search_data%npart, 2)
03816        Integer, Intent (In)                  :: grid_id
03817        Integer, Intent (InOut)               :: method_id, var_id
03818        Integer, Intent (In)                  :: n_vars
03819        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
03820        Real, Intent (In)                     :: tol
03821        Integer, Intent (Out)                 :: ierror
03822     End Subroutine
03823 
03824     subroutine psmile_search_donor_nnx_real (comp_info, search, var_id, &
03825                       coords1, coords2, coords3, distance,              &
03826                       nfound, locations, n_send, nb_extra,              &
03827                       tol, ierror)
03828        Use PSMILe_common
03829 
03830        Type (Enddef_comp),          Intent (In)    :: comp_info
03831        Integer,                     Intent (In)    :: var_id
03832        Integer,                     Intent (In)    :: n_send
03833        Integer,                     Intent (In)    :: nb_extra
03834        Real,                        Intent (In)    :: coords1 (n_send)
03835        Real,                        Intent (In)    :: coords2 (n_send)
03836        Real,                        Intent (In)    :: coords3 (n_send)
03837        Real,                        Intent (InOut) :: distance (n_send)
03838        Real,                        Intent (In)    :: tol
03839        Type (Enddef_global_search), Intent (InOut) :: search
03840        Integer,                     Intent (InOut) :: nfound (n_send)
03841        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
03842        Integer,                     Intent (Out)   :: ierror
03843     End Subroutine
03844 
03845     subroutine psmile_search_nn_3d_real (                         &
03846                       sin_search, cos_search, z_search, distance, &
03847                       nfound, locations, n_send,                  &
03848                       x_coords, y_coords, z_coords, coords_shape, &
03849                       sin_values, cos_values, grid_valid_shape,   &
03850                       mask_array, mask_shape, mask_available,     &
03851                       tol, ierror)
03852        Use PSMILe_common
03853 
03854        Integer,                     Intent (In)    :: n_send
03855        Real,                        Intent (In)    :: sin_search (n_send, 2)
03856        Real,                        Intent (In)    :: cos_search (n_send, 2)
03857        Real,                        Intent (In)    :: z_search (n_send)
03858        Integer,                     Intent (In)    :: coords_shape (2, ndim_3d)
03859        Real,                        Intent (In)    ::    
03860           x_coords (coords_shape(1,1):coords_shape(2,1), 
03861                     coords_shape(1,2):coords_shape(2,2), 
03862                     coords_shape(1,3):coords_shape(2,3))
03863        Real,                        Intent (In)    ::    
03864           y_coords (coords_shape(1,1):coords_shape(2,1), 
03865                     coords_shape(1,2):coords_shape(2,2), 
03866                     coords_shape(1,3):coords_shape(2,3))
03867        Real,                        Intent (In)    ::    
03868           z_coords (coords_shape(1,1):coords_shape(2,1), 
03869                     coords_shape(1,2):coords_shape(2,2), 
03870                     coords_shape(1,3):coords_shape(2,3))
03871 
03872        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
03873        Logical,                     Intent (In)    ::    
03874           mask_array (mask_shape (1,1):mask_shape (2,1), 
03875                       mask_shape (1,2):mask_shape (2,2), 
03876                       mask_shape (1,3):mask_shape (2,3))
03877        Logical,                     Intent (In)    :: mask_available
03878        Integer,                     Intent (In)    :: 
03879           grid_valid_shape (2, ndim_3d)
03880 
03881        Real,                        Intent (In)   ::               
03882           sin_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
03883                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
03884        Real,                        Intent (In)   ::               
03885           cos_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
03886                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
03887        Real,                        Intent (In)    :: tol
03888        Real,                        Intent (InOut) :: distance (n_send)
03889        Integer,                     Intent (InOut) :: nfound (n_send)
03890        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
03891        Integer,                     Intent (Out)   :: ierror
03892     End Subroutine
03893 
03894     subroutine psmile_search_nn_3d_reg_real (                     &
03895                       sin_search, cos_search, z_search, distance, &
03896                       nfound, locations, n_send,                  &
03897                       x_coords, y_coords, z_coords, coords_shape, &
03898                       sin_values_lon, cos_values_lon,             &
03899                       sin_values_lat, cos_values_lat,             &
03900                       grid_valid_shape,                           &
03901                       mask_array, mask_shape, mask_available,     &
03902                       tol, ierror)
03903        Use PSMILe_common
03904 
03905        Integer,                     Intent (In)    :: n_send
03906        Real,                        Intent (In)    :: sin_search (n_send, 2)
03907        Real,                        Intent (In)    :: cos_search (n_send, 2)
03908        Real,                        Intent (In)    :: z_search (n_send)
03909        Integer,                     Intent (In)    :: coords_shape (2, ndim_3d)
03910        Real,                        Intent (In)    ::    
03911           x_coords (coords_shape(1,1):coords_shape(2,1))
03912        Real,                        Intent (In)    ::    
03913           y_coords (coords_shape(1,1):coords_shape(2,1))
03914        Real,                        Intent (In)    ::    
03915           z_coords (coords_shape(1,3):coords_shape(2,3))
03916 
03917        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
03918        Logical,                     Intent (In)    ::    
03919           mask_array (mask_shape (1,1):mask_shape (2,1), 
03920                       mask_shape (1,2):mask_shape (2,2), 
03921                       mask_shape (1,3):mask_shape (2,3))
03922        Logical,                     Intent (In)    :: mask_available
03923        Integer,                     Intent (In)    :: 
03924           grid_valid_shape (2, ndim_3d)
03925 
03926        Real,                        Intent (In)    ::                  
03927           sin_values_lon (grid_valid_shape(1,1):grid_valid_shape(2,1))
03928        Real,                        Intent (In)    ::                  
03929           cos_values_lon (grid_valid_shape(1,1):grid_valid_shape(2,1))
03930        Real,                        Intent (In)   ::                   
03931           sin_values_lat (grid_valid_shape(1,2):grid_valid_shape(2,2))
03932        Real,                        Intent (In)   ::                   
03933           cos_values_lat (grid_valid_shape(1,2):grid_valid_shape(2,2))
03934        Real,                        Intent (In)    :: tol
03935        Real,                        Intent (InOut) :: distance (n_send)
03936        Integer,                     Intent (InOut) :: nfound (n_send)
03937        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
03938        Integer,                     Intent (Out)   :: ierror
03939     End Subroutine
03940 
03941     subroutine psmile_search_nn_irreg2_real (                     &
03942                       sin_search, cos_search, z_search, distance, &
03943                       nfound, locations, n_send,                  &
03944                       x_coords, y_coords, z_coords, coords_shape, &
03945                       sin_values, cos_values, grid_valid_shape,   &
03946                       mask_array, mask_shape, mask_available,     &
03947                       tol, ierror)
03948        Use PSMILe_common
03949 
03950        Integer,                     Intent (In)    :: n_send
03951        Real,                        Intent (In)    :: sin_search (n_send, 2)
03952        Real,                        Intent (In)    :: cos_search (n_send, 2)
03953        Real,                        Intent (In)    :: z_search (n_send)
03954        Integer,                     Intent (In)    :: coords_shape (2, ndim_3d)
03955        Real,                        Intent (In)    :: x_coords(  
03956                                                         coords_shape(1,1):coords_shape(2,1), 
03957                                                         coords_shape(1,2):coords_shape(2,2))
03958        Real,                        Intent (In)    :: y_coords(  
03959                                                         coords_shape(1,1):coords_shape(2,1), 
03960                                                         coords_shape(1,2):coords_shape(2,2))
03961        Real,                        Intent (In)    :: z_coords(  
03962                                                         coords_shape(1,3):coords_shape(2,3))
03963 
03964        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
03965        Logical,                     Intent (In)    :: mask_array ( 
03966                                                         mask_shape (1,1):mask_shape (2,1), 
03967                                                         mask_shape (1,2):mask_shape (2,2), 
03968                                                         mask_shape (1,3):mask_shape (2,3))
03969        Logical,                     Intent (In)    :: mask_available
03970        Integer,                     Intent (In)    :: grid_valid_shape (2, ndim_3d)
03971 
03972        Real,                        Intent (In)   :: sin_values ( 
03973                                                         grid_valid_shape(1,1):grid_valid_shape(2,1), 
03974                                                         grid_valid_shape(1,2):grid_valid_shape(2,2), 
03975                                                         2)
03976        Real,                        Intent (In)   :: cos_values ( 
03977                                                        grid_valid_shape(1,1):grid_valid_shape(2,1), 
03978                                                        grid_valid_shape(1,2):grid_valid_shape(2,2), 
03979                                                        2)
03980        Real,                        Intent (In)    :: tol
03981        Real,                        Intent (InOut) :: distance (n_send)
03982        Integer,                     Intent (InOut) :: nfound (n_send)
03983        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
03984        Integer,                     Intent (Out)   :: ierror
03985     End Subroutine
03986 
03987     subroutine psmile_select_nn_found (search, extra_search,      &
03988                         send_info,                                &
03989                         selected, sel_info, nrecv, nb_extra,      &
03990                         neighbors_3d, nloc, num_neigh,            &
03991                         grid_valid_shape, ierror)
03992        Use PSMILe_common
03993 
03994        Type (Enddef_search),      Intent (In)    :: search
03995        Integer,                   Intent (In)    :: nb_extra
03996        Integer,                   Intent (In)    :: nloc
03997        Integer,                   Intent (In)    :: num_neigh
03998        Integer,                   Intent (In)    :: grid_valid_shape (2, ndim_3d)
03999        Integer,                   Intent (InOut) :: nrecv
04000        Type (Extra_search_info),  Intent (InOut) :: extra_search
04001        Type (Send_information),   Intent (InOut) :: send_info
04002        Integer,                   Intent (InOut) :: selected (2, extra_search%n_extra)
04003        Type (Select_search_info), Intent (InOut) :: sel_info (nrecv)
04004        Integer,                   Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
04005                                                           num_neigh)
04006        Integer,                   Intent (Out)   :: ierror
04007     End Subroutine
04008 
04009     subroutine psmile_store_faces_3d_real (indices_req, required,     &
04010                     nreq,                                             &
04011                     tgt_coords1, tgt_coords2, tgt_coords3, ncpl,      &
04012                     corners1, corners2, corners3,                     &
04013                     corner_shape, nbr_corners, grid_valid_shape,      &
04014                     send_mask, srcloc_ind,                            &
04015                     ibuf, len_item, ndibuf, ipia,                     &
04016                      buf, len_rtem, ndrbuf, ipa, ierror)
04017        Use PSMILe_common
04018 
04019        Integer,                  Intent (In)  :: nreq, ncpl
04020        Integer,                  Intent (In)  :: indices_req (nreq)
04021        Integer,                  Intent (In)  :: required    (nreq)
04022        Integer,                  Intent (In)  :: nbr_corners
04023        Integer,                  Intent (In)  :: corner_shape (2, ndim_3d)
04024        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
04025        Real,                     Intent (In)  :: tgt_coords1 (ncpl)
04026        Real,                     Intent (In)  :: tgt_coords2 (ncpl)
04027        Real,                     Intent (In)  :: tgt_coords3 (ncpl)
04028        Real,                     Intent (In)  :: corners1 (                          
04029                                                  corner_shape(1,1):corner_shape(2,1),
04030                                                  corner_shape(1,2):corner_shape(2,2),
04031                                                  corner_shape(1,3):corner_shape(2,3),
04032                                                  nbr_corners)
04033        Real,                     Intent (In)  :: corners2 (                          
04034                                                  corner_shape(1,1):corner_shape(2,1),
04035                                                  corner_shape(1,2):corner_shape(2,2),
04036                                                  corner_shape(1,3):corner_shape(2,3),
04037                                                  nbr_corners)
04038        Real,                     Intent (In)  :: corners3 (                          
04039                                                  corner_shape(1,1):corner_shape(2,1),
04040                                                  corner_shape(1,2):corner_shape(2,2),
04041                                                  corner_shape(1,3):corner_shape(2,3),
04042                                                  nbr_corners)
04043        Logical,                  Intent (In)  :: send_mask (nreq)
04044        Integer,                  Intent (In)  :: len_item, len_rtem, ndibuf, ndrbuf
04045        Integer,                  Intent (In)  :: srcloc_ind (ndim_3d, ndibuf)
04046        Real,                     Intent (InOut) ::  buf (len_rtem, ndrbuf)
04047        Integer,                  Intent (InOut) :: ibuf (len_item, ndibuf)
04048        Integer,                  Intent (InOut) :: ipa, ipia
04049        Integer,                  Intent (Out) :: ierror
04050     End Subroutine
04051 
04052     subroutine psmile_store_faces_3d_reg_real (indices_req, required, &
04053                     nreq,                                             &
04054                     tgt_coords1, tgt_coords2, tgt_coords3, ncpl,      &
04055                     corners1, corners2, corners3,                     &
04056                     corner_shape, nbr_corners, grid_valid_shape,      &
04057                     send_mask, srcloc_ind,                            &
04058                     ibuf, len_item, ndibuf, ipia,                     &
04059                      buf, len_rtem, ndrbuf, ipa, ierror)
04060        Use PSMILe_common
04061 
04062        Integer,                  Intent (In)  :: nreq, ncpl
04063        Integer,                  Intent (In)  :: indices_req (nreq)
04064        Integer,                  Intent (In)  :: required    (nreq)
04065        Integer,                  Intent (In)  :: nbr_corners
04066        Integer,                  Intent (In)  :: corner_shape (2, ndim_3d)
04067        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
04068        Real,                     Intent (In)  :: tgt_coords1 (ncpl)
04069        Real,                     Intent (In)  :: tgt_coords2 (ncpl)
04070        Real,                     Intent (In)  :: tgt_coords3 (ncpl)
04071        Real,                     Intent (In)  :: corners1 (                             
04072                                                     corner_shape(1,1):corner_shape(2,1),
04073                                                     2)
04074        Real,                     Intent (In)  :: corners2 (                             
04075                                                     corner_shape(1,2):corner_shape(2,2),
04076                                                     2)
04077        Real,                     Intent (In)  :: corners3 (                             
04078                                                     corner_shape(1,3):corner_shape(2,3),
04079                                                     2)
04080        Logical,                  Intent (In)  :: send_mask (nreq)
04081        Integer,                  Intent (In)  :: len_item, len_rtem, ndibuf, ndrbuf
04082        Integer,                  Intent (In)  :: srcloc_ind (ndim_3d, ndibuf)
04083        Real,                     Intent (InOut) ::  buf (len_rtem, ndrbuf)
04084        Integer,                  Intent (InOut) :: ibuf (len_item, ndibuf)
04085        Integer,                  Intent (InOut) :: ipa, ipia
04086        Integer,                  Intent (Out) :: ierror
04087     End Subroutine
04088 
04089     subroutine psmile_store_faces_gauss2_real (indices_req,      &
04090                       required, nreq,                              &
04091                       tgt_coords1, tgt_coords2, tgt_coords3, ncpl, &
04092                       corners1, corners2, corners3, corner_shape,  &
04093                       nbr_corners, grid_id, grid_valid_shape,      &
04094                       send_mask, srcloc_ind,                       &
04095                       virtual_ind, virtual_cell_available,         &
04096                       ibuf, len_item, ndibuf, ipia,                &
04097                       buf,  len_rtem, ndrbuf, ipa, ierror)
04098       Use PSMILe_common
04099 
04100       Integer,           Intent (In)    :: nreq
04101       Integer,           Intent (In)    :: indices_req (nreq)
04102       Integer,           Intent (In)    :: required    (nreq)
04103       Integer,           Intent (In)    :: corner_shape (2, ndim_3d)
04104       Integer,           Intent (In)    :: nbr_corners
04105       Integer,           Intent (In)    :: grid_id
04106       Integer,           Intent (In)    :: grid_valid_shape (2, ndim_3d)
04107       Integer,           Intent (In)    :: ncpl
04108       Real,              Intent (In)    :: tgt_coords1 (ncpl)
04109       Real,              Intent (In)    :: tgt_coords2 (ncpl)
04110       Real,              Intent (In)    :: tgt_coords3 (ncpl)
04111       Real,              Intent (In)    :: corners1 ( corner_shape(1,1):corner_shape(2,1), 2)
04112       Real,              Intent (In)    :: corners2 ( corner_shape(1,1):corner_shape(2,1), 2)
04113       Real,              Intent (In)    :: corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
04114       Logical,           Intent (In)    :: send_mask (nreq)
04115       Integer,           Intent (In)    :: ndibuf
04116       Integer,           Intent (In)    :: srcloc_ind (ndim_3d, ndibuf)
04117       Integer,           Intent (In)    :: virtual_ind (ndibuf)
04118       Logical,           Intent (In)    :: virtual_cell_available
04119       Integer,           Intent (In)    :: len_item
04120       Integer,           Intent (In)    :: ndrbuf
04121       Integer,           Intent (In)    :: len_rtem
04122       Real,              Intent (InOut) :: buf (len_rtem, ndrbuf)
04123       Integer,           Intent (InOut) :: ipa
04124       Integer,           Intent (InOut) :: ibuf (len_item, ndibuf)
04125       Integer,           Intent (InOut) :: ipia
04126       Integer,           Intent (Out)   :: ierror
04127     End Subroutine
04128 
04129     subroutine psmile_store_faces_irreg2_real (indices_req, required, &
04130                     nreq,                                             &
04131                     tgt_coords1, tgt_coords2, tgt_coords3, ncpl,      &
04132                     corners1, corners2, corners3,                     &
04133                     corner_shape, nbr_corners, grid_valid_shape,      &
04134                     send_mask, srcloc_ind,                            &
04135                     ibuf, len_item, ndibuf, ipia,                     &
04136                      buf, len_rtem, ndrbuf, ipa, ierror)
04137        Use PSMILe_common
04138 
04139        Integer,                  Intent (In)  :: nreq, ncpl
04140        Integer,                  Intent (In)  :: indices_req (nreq)
04141        Integer,                  Intent (In)  :: required    (nreq)
04142        Integer,                  Intent (In)  :: nbr_corners
04143        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
04144        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
04145        Real,                     Intent (In)  :: tgt_coords1 (ncpl)
04146        Real,                     Intent (In)  :: tgt_coords2 (ncpl)
04147        Real,                     Intent (In)  :: tgt_coords3 (ncpl)
04148        Real,                     Intent (In)  :: 
04149           corners1 ( corner_shape(1,1):corner_shape(2,1), 
04150                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
04151        Real,                     Intent (In)  :: 
04152           corners2 ( corner_shape(1,1):corner_shape(2,1), 
04153                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
04154        Real,                     Intent (In)  :: 
04155           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
04156        Logical,                  Intent (In)  :: send_mask (nreq)
04157        Integer,                  Intent (In)  :: len_item, len_rtem
04158        Integer,                  Intent (In)  :: ndibuf, ndrbuf
04159        Integer,                  Intent (In)  :: srcloc_ind (ndim_3d, ndibuf)
04160 !
04161        Real,                     Intent (InOut) ::  buf (len_rtem, ndrbuf)
04162        Integer,                  Intent (InOut) :: ibuf (len_item, ndibuf)
04163        Integer,                  Intent (InOut) :: ipa, ipia
04164        Integer,                  Intent (Out)   :: ierror
04165     End Subroutine
04166 
04167     subroutine psmile_trf_lonlat_1d_real (x_coords, y_coords,        &
04168                                           coords_shape, grid_valid_shape, &
04169                                           sin_values_lon, cos_values_lon, &
04170                                           sin_values_lat, cos_values_lat, ierror)
04171        Use PSMILe_common
04172 
04173        Integer, Intent (In)            :: coords_shape (2, ndim_2d)
04174        Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
04175 
04176        Real, Intent (In)               :: x_coords(coords_shape(1,1): 
04177                                                    coords_shape(2,1))
04178        Real, Intent (In)               :: y_coords(coords_shape(1,2): 
04179                                                    coords_shape(2,2))
04180        Real, Intent (Out)              :: sin_values_lon (grid_valid_shape(1,1):
04181                                                           grid_valid_shape(2,1))
04182        Real, Intent (Out)              :: sin_values_lat (grid_valid_shape(1,2):
04183                                                           grid_valid_shape(2,2))
04184        Real, Intent (Out)              :: cos_values_lon (grid_valid_shape(1,1):
04185                                                           grid_valid_shape(2,1))
04186        Real, Intent (Out)              :: cos_values_lat (grid_valid_shape(1,2):
04187                                                           grid_valid_shape(2,2))
04188        Integer, Intent (Out)           :: ierror
04189     End Subroutine
04190 
04191     subroutine psmile_trf_lonlat_2d_real (x_coords, y_coords,             &
04192                                           coords_shape, grid_valid_shape, &
04193                                           sin_values, cos_values, ierror)
04194        Use PSMILe_common
04195 
04196        Integer, Intent (In)            :: coords_shape (2, ndim_2d)
04197        Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
04198 
04199        Real, Intent (In)               :: x_coords(coords_shape(1,1): 
04200                                                    coords_shape(2,1), 
04201                                                    coords_shape(1,2): 
04202                                                    coords_shape(2,2))
04203        Real, Intent (In)               :: y_coords(coords_shape(1,1): 
04204                                                    coords_shape(2,1), 
04205                                                    coords_shape(1,2): 
04206                                                    coords_shape(2,2))
04207        Real, Intent (Out)              :: sin_values (grid_valid_shape(1,1): 
04208                                                       grid_valid_shape(2,1), 
04209                                                       grid_valid_shape(1,2): 
04210                                                       grid_valid_shape(2,2), 
04211                                                       2)
04212        Real, Intent (Out)              :: cos_values (grid_valid_shape(1,1): 
04213                                                       grid_valid_shape(2,1), 
04214                                                       grid_valid_shape(1,2): 
04215                                                       grid_valid_shape(2,2), 
04216                                                       2)
04217        Integer, Intent (Out)           :: ierror
04218     End Subroutine
04219 
04220     subroutine psmile_trf_lonlat_3d_real (x_coords, y_coords,             &
04221                                           coords_shape, grid_valid_shape, &
04222                                           sin_values, cos_values, ierror)
04223        Use PSMILe_common
04224 
04225        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04226        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04227 
04228        Real, Intent (In)               :: x_coords(coords_shape(1,1): 
04229                                                    coords_shape(2,1), 
04230                                                    coords_shape(1,2): 
04231                                                    coords_shape(2,2), 
04232                                                    coords_shape(1,3): 
04233                                                    coords_shape(2,3))
04234        Real, Intent (In)               :: y_coords(coords_shape(1,1): 
04235                                                    coords_shape(2,1), 
04236                                                    coords_shape(1,2): 
04237                                                    coords_shape(2,2), 
04238                                                    coords_shape(1,3): 
04239                                                    coords_shape(2,3))
04240        Real, Intent (Out)              :: sin_values (grid_valid_shape(1,1): 
04241                                                       grid_valid_shape(2,1), 
04242                                                       grid_valid_shape(1,2): 
04243                                                       grid_valid_shape(2,2), 
04244                                                       grid_valid_shape(1,3): 
04245                                                       grid_valid_shape(2,3), 
04246                                                       2)
04247        Real, Intent (Out)              :: cos_values (grid_valid_shape(1,1): 
04248                                                       grid_valid_shape(2,1), 
04249                                                       grid_valid_shape(1,2): 
04250                                                       grid_valid_shape(2,2), 
04251                                                       grid_valid_shape(1,3): 
04252                                                       grid_valid_shape(2,3), 
04253                                                       2)
04254        Integer, Intent (Out)           :: ierror
04255     End Subroutine
04256 
04257     subroutine psmile_info_coords_3d_reg_real (              &
04258                              x_coords, y_coords, z_coords,   &
04259                              coords_shape, grid_valid_shape, &
04260                              sinvec, cosvec, ierror)
04261        Use PSMILe_common
04262 
04263        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04264        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04265 
04266        Real, Intent (In)               :: x_coords(*)
04267        Real, Intent (In)               :: y_coords(*)
04268        Real, Intent (In)               :: z_coords(*)
04269 
04270        Type (real_vector)              :: sinvec (ndim_2d)
04271        Type (real_vector)              :: cosvec (ndim_2d)
04272        Integer, Intent (Out)           :: ierror
04273     End Subroutine
04274 
04275     subroutine psmile_info_coords_irreg2_real (              &
04276                              x_coords, y_coords, z_coords,   &
04277                              coords_shape, grid_valid_shape, &
04278                              sinvec, cosvec, ierror)
04279        Use PSMILe_common
04280 
04281        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04282        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04283 
04284        Real, Intent (In)               :: x_coords(*)
04285        Real, Intent (In)               :: y_coords(*)
04286        Real, Intent (In)               :: z_coords(*)
04287 
04288        Type (real_vector)              :: sinvec
04289        Type (real_vector)              :: cosvec
04290        Integer, Intent (Out)           :: ierror
04291     End Subroutine
04292 
04293     subroutine psmile_info_trf_coords_3d_real (              &
04294                              x_coords, y_coords, z_coords,   &
04295                              coords_shape, grid_valid_shape, &
04296                              sinvec, cosvec, ierror)
04297        Use PSMILe_common
04298 
04299        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04300        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04301 
04302        Real, Intent (In)               :: x_coords(*)
04303        Real, Intent (In)               :: y_coords(*)
04304        Real, Intent (In)               :: z_coords(*)
04305 
04306        Type (real_vector)              :: sinvec
04307        Type (real_vector)              :: cosvec
04308        Integer, Intent (Out)           :: ierror
04309     End Subroutine
04310 
04311     subroutine psmile_info_trs_locs_3d_real (comp_info,                 &
04312                                              coords, shape, control,    &
04313                                              len_cpl,                   &
04314                                              var_id, grid_valid_shape,  &
04315                                              search,                    &
04316                                              method_id, send_index,     &
04317                                              ierror)
04318        Use PSMILe_common
04319 
04320        Type (Enddef_comp), Intent (In)      :: comp_info
04321        Type (Enddef_search), Intent (InOut) :: search
04322        Type (real_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
04323        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
04324        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
04325        Integer, Intent (In)                 :: len_cpl (search%search_data%npart)
04326        Integer, Intent (In)                 :: var_id, method_id
04327        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
04328        Integer, Intent (InOut)              :: send_index
04329        Integer, Intent (Out)                :: ierror
04330     End Subroutine
04331 
04332     subroutine psmile_info_trs_loc_3d_reg_real (comp_info,              &
04333                                              coords, shape, control,    &
04334                                              len_cpl,                   &
04335                                              var_id, grid_valid_shape,  &
04336                                              search,                    &
04337                                              method_id, send_index,     &
04338                                              ierror)
04339        Use PSMILe_common
04340 
04341        Type (Enddef_comp), Intent (In)      :: comp_info
04342        Type (Enddef_search), Intent (InOut) :: search
04343        Type (real_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
04344        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
04345        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
04346        Integer, Intent (InOut)              :: len_cpl (search%search_data%npart)
04347        Integer, Intent (In)                 :: var_id, method_id
04348        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
04349        Integer, Intent (InOut)              :: send_index
04350        Integer, Intent (Out)                :: ierror
04351     End Subroutine
04352 
04353     subroutine psmile_info_trs_loc_irreg2_real (comp_info,              &
04354                                              coords, shape, control,    &
04355                                              len_cpl,                   &
04356                                              var_id, grid_valid_shape,  &
04357                                              search,                    &
04358                                              method_id, send_index,     &
04359                                              ierror)
04360        Use PSMILe_common
04361 
04362        Type (Enddef_comp), Intent (In)      :: comp_info
04363        Type (Enddef_search), Intent (InOut) :: search
04364        Type (real_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
04365        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
04366        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
04367        Integer, Intent (InOut)              :: len_cpl (search%search_data%npart)
04368        Integer, Intent (In)                 :: var_id, method_id
04369        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
04370        Integer, Intent (InOut)              :: send_index
04371        Integer, Intent (Out)                :: ierror
04372     End Subroutine
04373 
04374     subroutine psmile_info_trs_loc_gauss2_real (comp_info,                      &
04375                                              coords, shape, control, len_cpl,   &
04376                                              var_id, grid_valid_shape,          &
04377                                              search, method_id,                 &
04378                                              send_index, ierror)
04379        Use PSMILe_common
04380 
04381        Type (Enddef_comp), Intent (In)      :: comp_info
04382        Type (Enddef_search), Intent (InOut) :: search
04383        Type (real_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
04384        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
04385        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
04386        Integer, Intent (InOut)              :: len_cpl (search%search_data%npart)
04387        Integer, Intent (In)                 :: var_id, method_id
04388        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
04389        Integer, Intent (InOut)              :: send_index
04390        Integer, Intent (Out)                :: ierror
04391     End Subroutine
04392 
04393     subroutine psmile_neigh_cells_3d_real ( use_how,        &
04394                grid_shape, interpolation_mode, cyclic,      &
04395                corner_shape_3d, nbr_corners,                &
04396                corner_x, corner_y, corner_z,                &
04397                search,  control, tgt_cell, tgt_corners,     &
04398                npoints, srclocs, msklocs, ncpl,             &
04399                num_neigh, nbr_cells, ierror )
04400 
04401       USE PSMILe_Common
04402 
04403       Integer, Intent (In)            :: use_how(3)
04404       Integer, Intent (In)            :: grid_shape (2, ndim_3d)
04405       Integer, Intent (In)            :: interpolation_mode
04406       Logical, Intent (In)            :: cyclic (ndim_3d)
04407       Integer, Intent (In)            :: corner_shape_3d (2,ndim_3d,ndim_3d)
04408       Integer, Intent (In)            :: nbr_corners(ndim_3d)
04409       Type (Enddef_search), Intent (InOut) :: search
04410       Integer, Intent (In)            :: control (2, ndim_3d, search%search_data%npart)
04411       Type (real_vector), Intent (InOut) :: tgt_cell(ndim_3d)
04412       Integer, Intent (In)            :: tgt_corners(ndim_3d)
04413       Integer, Intent (In)            :: npoints
04414       Integer, Intent (In)            :: ncpl
04415       Integer, Intent (In)            :: srclocs (ndim_3d, npoints)
04416       Logical, Intent (In)            :: msklocs (npoints)
04417       Integer, Intent (In)            :: num_neigh
04418       Real, Intent (In)               :: corner_x (corner_shape_3d (1,1,1):corner_shape_3d(2,1,1), 
04419                                                    corner_shape_3d (1,2,1):corner_shape_3d(2,2,1), 
04420                                                    corner_shape_3d (1,3,1):corner_shape_3d(2,3,1), 
04421                                                    nbr_corners(1))
04422 
04423       Real, Intent (In)               :: corner_y (corner_shape_3d (1,1,2):corner_shape_3d(2,1,2), 
04424                                                    corner_shape_3d (1,2,2):corner_shape_3d(2,2,2), 
04425                                                    corner_shape_3d (1,3,2):corner_shape_3d(2,3,2), 
04426                                                    nbr_corners(2))
04427 
04428       Real, Intent (In)               :: corner_z (corner_shape_3d (1,1,3):corner_shape_3d(2,1,3), 
04429                                                    corner_shape_3d (1,2,3):corner_shape_3d(2,2,3), 
04430                                                    corner_shape_3d (1,3,3):corner_shape_3d(2,3,3), 
04431                                                    nbr_corners(3))
04432       Integer, Intent (Out)           :: nbr_cells(ncpl)
04433       Integer, Intent (Out)           :: ierror
04434     End Subroutine
04435 
04436     subroutine psmile_neigh_cells_3d_reg_real (      &
04437                grid_valid_shape, interpolation_mode, &
04438                cyclic, grid_id, search, corners,     &
04439                npoints, srclocs, ncpl, nbr_cells,    &
04440                ierror )
04441 
04442       USE PSMILe_Common
04443 
04444       Integer, Intent (In)               :: grid_valid_shape (2, ndim_3d)
04445       Integer,            Intent (In)    :: interpolation_mode
04446       Logical,            Intent (In)    :: cyclic (ndim_3d)
04447       Integer,            Intent (In)    :: grid_id
04448       Type (Enddef_search), Intent (In)  :: search
04449       Type (real_vector), Intent (In)    :: corners (ndim_3d, search%search_data%npart)
04450       Integer, Intent (In)               :: npoints (ndim_3d, search%search_data%npart)
04451       Type (integer_vector), Intent (In) :: srclocs (ndim_3d, search%search_data%npart)
04452       Integer, Intent (In)               :: ncpl
04453       Integer, Intent (Out)              :: nbr_cells(ncpl)
04454       Integer, Intent (Out)              :: ierror
04455     End Subroutine
04456 
04457     subroutine psmile_neigh_cells_irreg2_real ( use_how,        &
04458                grid_shape, interpolation_mode, cyclic,          &
04459                corner_shape_3d, nbr_corners,                    &
04460                corner_x, corner_y,                              &
04461                search,  control, tgt_cell, tgt_corners,         &
04462                npoints, srclocs, msklocs, ncpl,                 &
04463                num_neigh, nbr_cells, ierror )
04464 
04465       USE PSMILe_Common
04466 
04467       Integer, Intent (In)            :: use_how(3)
04468       Integer, Intent (In)            :: grid_shape (2, ndim_3d)
04469       Integer, Intent (In)            :: interpolation_mode
04470       Logical, Intent (In)            :: cyclic (ndim_3d)
04471       Integer, Intent (In)            :: corner_shape_3d(2,ndim_3d,ndim_3d)
04472       Integer, Intent (In)            :: nbr_corners(ndim_3d)
04473       Type (Enddef_search), Intent (InOut) :: search
04474       Integer, Intent (In)            :: control (2, ndim_3d, search%search_data%npart)
04475       Type (real_vector), Intent (InOut) :: tgt_cell(ndim_3d)
04476       Integer, Intent (In)            :: tgt_corners
04477       Integer, Intent (In)            :: npoints (ndim_2d, search%search_data%npart)
04478       Integer, Intent (In)            :: ncpl
04479       Type (integer_vector), Intent (In) :: srclocs (2,search%search_data%npart)
04480       Type (logical_vector), Intent (In) :: msklocs (2,search%search_data%npart)
04481       Integer, Intent (In)            :: num_neigh
04482       Real, Intent (In)               :: corner_x (corner_shape_3d (1,1,1):corner_shape_3d(2,1,1), 
04483                                                    corner_shape_3d (1,2,1):corner_shape_3d(2,2,1), 
04484                                                    nbr_corners(1))
04485       Real, Intent (In)               :: corner_y (corner_shape_3d (1,1,2):corner_shape_3d(2,1,2), 
04486                                                    corner_shape_3d (1,2,2):corner_shape_3d(2,2,2), 
04487                                                    nbr_corners(2))
04488       Integer, Intent (Out)           :: nbr_cells(ncpl)
04489       Integer, Intent (Out)           :: ierror
04490     End Subroutine
04491 !
04492     subroutine psmile_neigh_near_irr2_3d_real (grid_id,    &
04493                coords1, coords2, coords3,                  &
04494                x_coords, y_coords, z_coords,               &
04495                coords_shape,                               &
04496                mask_array, mask_shape,  mask_available,    &
04497                sin_values, cos_values, grid_valid_shape,   &
04498                search_mode,                                &
04499                srcloc, nloc, nprev, nsearch,               &
04500                neighbors_3d, num_neigh,                    &
04501                extra_search, ierror)
04502 
04503        Use PSMILe_common
04504 
04505        Integer, Intent (In)            :: grid_id
04506        Integer, Intent (In)            :: nloc, nprev, nsearch, search_mode
04507        Real, Intent (In)               :: coords1 (nloc)
04508        Real, Intent (In)               :: coords2 (nloc)
04509        Real, Intent (In)               :: coords3 (nloc)
04510        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04511        Real, Intent (In)               :: x_coords (*)
04512        Real, Intent (In)               :: y_coords (*)
04513        Real, Intent (In)               :: z_coords (*)
04514        Logical, Intent (In)            :: mask_array (*)
04515        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04516        Logical, Intent (In)            :: mask_available
04517        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04518        Real, Intent (In)               :: sin_values (*)
04519        Real, Intent (In)               :: cos_values (*)
04520        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
04521        Integer, Intent (In)            :: num_neigh
04522        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04523        Type (Extra_search_info)        :: extra_search
04524        Integer, Intent (Out)           :: ierror
04525     End Subroutine
04526 
04527     subroutine psmile_neigh_near_3d_irr2_real (grid_id,    &
04528                coords1, coords2, coords3,                  &
04529                x_coords, y_coords, z_coords,               &
04530                coords_shape,                               &
04531                mask_array, mask_shape,  mask_available,    &
04532                sin_values_lon, cos_values_lon,             &
04533                sin_values_lat, cos_values_lat,             &
04534                grid_valid_shape, search_mode,              &
04535                srcloc, srclocz, nlocs, nloc, nprev,        &
04536                neighbors_3d, num_neigh,                    &
04537                extra_search, ierror)
04538 
04539        Use PSMILe_common
04540 
04541        Integer, Intent (In)            :: grid_id
04542        Integer, Intent (In)            :: nloc, nprev, search_mode
04543        Integer, Intent (In)            :: nlocs (ndim_2d)
04544        Real, Intent (In)               :: coords1 (*)
04545        Real, Intent (In)               :: coords2 (*)
04546        Real, Intent (In)               :: coords3 (*)
04547        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04548        Real, Intent (In)               :: x_coords (*)
04549        Real, Intent (In)               :: y_coords (*)
04550        Real, Intent (In)               :: z_coords (*)
04551        Logical, Intent (In)            :: mask_array (*)
04552        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04553        Logical, Intent (In)            :: mask_available
04554        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04555        Real, Intent (In)               :: sin_values_lon (*)
04556        Real, Intent (In)               :: cos_values_lon (*)
04557        Real, Intent (In)               :: sin_values_lat (*)
04558        Real, Intent (In)               :: cos_values_lat (*)
04559        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
04560        Integer, Intent (In)            :: srclocz (nlocs(2))
04561        Integer, Intent (In)            :: num_neigh
04562        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04563        Type (Extra_search_info)        :: extra_search
04564        Integer, Intent (Out)           :: ierror
04565     End Subroutine
04566 
04567     subroutine psmile_neigh_near_3d_irr3_real (grid_id,    &
04568                coords1, coords2, coords3,                  &
04569                x_coords, y_coords, z_coords,               &
04570                coords_shape,                               &
04571                mask_array, mask_shape,  mask_available,    &
04572                sin_values_lon, cos_values_lon,             &
04573                sin_values_lat, cos_values_lat,             &
04574                grid_valid_shape, search_mode,              &
04575                srcloc, nsearch, nloc, nprev,               &
04576                neighbors_3d, num_neigh,                    &
04577                extra_search, ierror)
04578 
04579        Use PSMILe_common
04580 
04581        Integer,            Intent (In)  :: grid_id
04582        Integer,            Intent (In)  :: nloc, nprev, search_mode
04583        Integer,            Intent (In)  :: nsearch
04584        Real,               Intent (In)  :: coords1 (*)
04585        Real,               Intent (In)  :: coords2 (*)
04586        Real,               Intent (In)  :: coords3 (*)
04587        Integer,            Intent (In)  :: coords_shape (2, ndim_3d)
04588        Real,               Intent (In)  :: x_coords (*)
04589        Real,               Intent (In)  :: y_coords (*)
04590        Real,               Intent (In)  :: z_coords (*)
04591        Logical,            Intent (In)  :: mask_array (*)
04592        Integer,            Intent (In)  :: mask_shape (2, ndim_3d)
04593        Logical,            Intent (In)  :: mask_available
04594        Integer,            Intent (In)  :: grid_valid_shape (2, ndim_3d)
04595        Real,               Intent (In)  :: sin_values_lon (*)
04596        Real,               Intent (In)  :: cos_values_lon (*)
04597        Real,               Intent (In)  :: sin_values_lat (*)
04598        Real,               Intent (In)  :: cos_values_lat (*)
04599        Integer,            Intent (In)  :: srcloc (ndim_3d, nloc)
04600        Integer,            Intent (In)  :: num_neigh
04601        Integer,            Intent (Out) :: neighbors_3d (ndim_3d, nloc, 
04602                                                           num_neigh)
04603        Type (Extra_search_info)         :: extra_search
04604        Integer,            Intent (Out) :: ierror
04605     End Subroutine
04606 
04607     subroutine psmile_neigh_nearx_irr2_3d_real (grid_id,   &
04608                coords1, coords2, coords3,                  &
04609                x_coords, y_coords, z_coords,               &
04610                coords_shape,                               &
04611                mask_array, mask_shape,  mask_available,    &
04612                sin_values, cos_values, grid_valid_shape,   &
04613                search_mode,                                &
04614                srcloc, nloc, nprev, nsearch,               &
04615                neighbors_3d, num_neigh,                    &
04616                extra_search, ierror)
04617 
04618        Use PSMILe_common
04619 
04620        Integer,            Intent (In)  :: grid_id
04621        Integer,            Intent (In)  :: nloc, nprev, nsearch, search_mode
04622        Real,               Intent (In)  :: coords1 (nloc)
04623        Real,               Intent (In)  :: coords2 (nloc)
04624        Real,               Intent (In)  :: coords3 (nloc)
04625        Integer,            Intent (In)  :: coords_shape (2, ndim_3d)
04626        Real,               Intent (In)  :: x_coords (*)
04627        Real,               Intent (In)  :: y_coords (*)
04628        Real,               Intent (In)  :: z_coords (*)
04629        Logical,            Intent (In)  :: mask_array (*)
04630        Integer,            Intent (In)  :: mask_shape (2, ndim_3d)
04631        Logical,            Intent (In)  :: mask_available
04632        Integer,            Intent (In)  :: grid_valid_shape (2, ndim_3d)
04633        Real,               Intent (In)  :: sin_values (*)
04634        Real,               Intent (In)  :: cos_values (*)
04635        Integer,            Intent (In)  :: srcloc (ndim_3d, nloc)
04636        Integer,            Intent (In)  :: num_neigh
04637        Integer,            Intent (Out) :: neighbors_3d (ndim_3d, nloc, 
04638                                                          num_neigh)
04639        Type (Extra_search_info)         :: extra_search
04640        Integer,            Intent (Out) :: ierror
04641     End Subroutine
04642 
04643     subroutine psmile_neigh_near_3d_reg_real (grid_id,     &
04644                coords1, coords2, coords3,                  &
04645                x_coords, y_coords, z_coords,               &
04646                coords_shape,                               &
04647                mask_array, mask_shape,  mask_available,    &
04648                sin_values_lon, cos_values_lon,             &
04649                sin_values_lat, cos_values_lat,             &
04650                grid_valid_shape, search_mode,              &
04651                srclocs, nlocs, nloc, nprev,                &
04652                neighbors_3d, num_neigh,                    &
04653                extra_search, ierror)
04654 
04655        Use PSMILe_common
04656 
04657        Integer, Intent (In)            :: grid_id
04658        Integer, Intent (In)            :: nloc, nprev, search_mode
04659        Integer, Intent (In)            :: nlocs (ndim_3d)
04660        Real, Intent (In)               :: coords1 (*)
04661        Real, Intent (In)               :: coords2 (*)
04662        Real, Intent (In)               :: coords3 (*)
04663        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04664        Real, Intent (In)               :: x_coords (*)
04665        Real, Intent (In)               :: y_coords (*)
04666        Real, Intent (In)               :: z_coords (*)
04667        Logical, Intent (In)            :: mask_array (*)
04668        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04669        Logical, Intent (In)            :: mask_available
04670        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04671        Real, Intent (In)               :: sin_values_lon (*)
04672        Real, Intent (In)               :: cos_values_lon (*)
04673        Real, Intent (In)               :: sin_values_lat (*)
04674        Real, Intent (In)               :: cos_values_lat (*)
04675        Type (integer_vector), Intent (In) :: srclocs (ndim_3d)
04676        Integer, Intent (In)            :: num_neigh
04677        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04678        Type (Extra_search_info)        :: extra_search
04679        Integer, Intent (Out)           :: ierror
04680     End Subroutine
04681 
04682     subroutine psmile_neigh_nearx_3d_irr2_real (grid_id,   &
04683                coords1, coords2, coords3,                  &
04684                x_coords, y_coords, z_coords,               &
04685                coords_shape,                               &
04686                mask_array, mask_shape,  mask_available,    &
04687                sin_values_lon, cos_values_lon,             &
04688                sin_values_lat, cos_values_lat,             &
04689                grid_valid_shape, search_mode,              &
04690                srcloc, srclocz, nlocs, nloc, nprev,        &
04691                neighbors_3d, num_neigh,                    &
04692                extra_search, ierror)
04693 
04694        Use PSMILe_common
04695 
04696        Integer, Intent (In)            :: grid_id
04697        Integer, Intent (In)            :: nloc, nprev, search_mode
04698        Integer, Intent (In)            :: nlocs (ndim_2d)
04699        Real, Intent (In)               :: coords1 (*)
04700        Real, Intent (In)               :: coords2 (*)
04701        Real, Intent (In)               :: coords3 (*)
04702        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04703        Real, Intent (In)               :: x_coords (*)
04704        Real, Intent (In)               :: y_coords (*)
04705        Real, Intent (In)               :: z_coords (*)
04706        Logical, Intent (In)            :: mask_array (*)
04707        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04708        Logical, Intent (In)            :: mask_available
04709        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04710        Real, Intent (In)               :: sin_values_lon (*)
04711        Real, Intent (In)               :: cos_values_lon (*)
04712        Real, Intent (In)               :: sin_values_lat (*)
04713        Real, Intent (In)               :: cos_values_lat (*)
04714        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
04715        Integer, Intent (In)            :: srclocz (nlocs(2))
04716        Integer, Intent (In)            :: num_neigh
04717        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04718        Type (Extra_search_info)        :: extra_search
04719        Integer, Intent (Out)           :: ierror
04720     End Subroutine
04721 
04722     subroutine psmile_neigh_nearx_3d_irr3_real (grid_id,   &
04723                coords1, coords2, coords3,                  &
04724                x_coords, y_coords, z_coords,               &
04725                coords_shape,                               &
04726                mask_array, mask_shape,  mask_available,    &
04727                sin_values_lon, cos_values_lon,             &
04728                sin_values_lat, cos_values_lat,             &
04729                grid_valid_shape, search_mode,              &
04730                srcloc, nsearch, nloc, nprev,               &
04731                neighbors_3d, num_neigh,                    &
04732                extra_search, ierror)
04733 
04734        Use PSMILe_common
04735 
04736        Integer, Intent (In)            :: grid_id
04737        Integer, Intent (In)            :: nloc, nprev, search_mode
04738        Integer, Intent (In)            :: nsearch
04739        Real, Intent (In)               :: coords1 (*)
04740        Real, Intent (In)               :: coords2 (*)
04741        Real, Intent (In)               :: coords3 (*)
04742        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04743        Real, Intent (In)               :: x_coords (*)
04744        Real, Intent (In)               :: y_coords (*)
04745        Real, Intent (In)               :: z_coords (*)
04746        Logical, Intent (In)            :: mask_array (*)
04747        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04748        Logical, Intent (In)            :: mask_available
04749        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04750        Real, Intent (In)               :: sin_values_lon (*)
04751        Real, Intent (In)               :: cos_values_lon (*)
04752        Real, Intent (In)               :: sin_values_lat (*)
04753        Real, Intent (In)               :: cos_values_lat (*)
04754        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
04755        Integer, Intent (In)            :: num_neigh
04756        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04757        Type (Extra_search_info)        :: extra_search
04758        Integer, Intent (Out)           :: ierror
04759     End Subroutine
04760 
04761     subroutine psmile_neigh_nearx_3d_reg_real (grid_id,    &
04762                coords1, coords2, coords3,                  &
04763                x_coords, y_coords, z_coords,               &
04764                coords_shape,                               &
04765                mask_array, mask_shape,  mask_available,    &
04766                sin_values_lon, cos_values_lon,             &
04767                sin_values_lat, cos_values_lat,             &
04768                grid_valid_shape, search_mode,              &
04769                srclocs, nlocs, nloc, nprev,                &
04770                neighbors_3d, num_neigh,                    &
04771                extra_search, ierror)
04772 
04773        Use PSMILe_common
04774 
04775        Integer, Intent (In)            :: grid_id
04776        Integer, Intent (In)            :: nloc, nprev, search_mode
04777        Integer, Intent (In)            :: nlocs (ndim_3d)
04778        Real, Intent (In)               :: coords1 (*)
04779        Real, Intent (In)               :: coords2 (*)
04780        Real, Intent (In)               :: coords3 (*)
04781        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04782        Real, Intent (In)               :: x_coords (*)
04783        Real, Intent (In)               :: y_coords (*)
04784        Real, Intent (In)               :: z_coords (*)
04785        Logical, Intent (In)            :: mask_array (*)
04786        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04787        Logical, Intent (In)            :: mask_available
04788        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04789        Real, Intent (In)               :: sin_values_lon (*)
04790        Real, Intent (In)               :: cos_values_lon (*)
04791        Real, Intent (In)               :: sin_values_lat (*)
04792        Real, Intent (In)               :: cos_values_lat (*)
04793        Type (integer_vector), Intent (In) :: srclocs (ndim_3d)
04794        Integer, Intent (In)            :: num_neigh
04795        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04796        Type (Extra_search_info)        :: extra_search
04797        Integer, Intent (Out)           :: ierror
04798     End Subroutine
04799 
04800     subroutine psmile_neigh_near_irreg2_real (grid_id,     &
04801                coords1, coords2, coords3,                  &
04802                x_coords, y_coords, z_coords,               &
04803                coords_shape,                               &
04804                mask_array, mask_shape,  mask_available,    &
04805                sin_values, cos_values, grid_valid_shape,   &
04806                search_mode,                                &
04807                srcloc, srclocz, nlocs,                     &
04808                nloc, nprev,                                &
04809                neighbors_3d, num_neigh,                    &
04810                extra_search, ierror)
04811 
04812        Use PSMILe_common
04813 
04814        Integer, Intent (In)            :: grid_id
04815        Integer, Intent (In)            :: nloc, nprev, search_mode
04816        Integer, Intent (In)            :: nlocs (ndim_2d)
04817        Real, Intent (In)               :: coords1 (nlocs(1)*nlocs(2))
04818        Real, Intent (In)               :: coords2 (nlocs(1)*nlocs(2))
04819        Real, Intent (In)               :: coords3 (nlocs(1)*nlocs(2))
04820        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04821        Real, Intent (In)               :: x_coords (*)
04822        Real, Intent (In)               :: y_coords (*)
04823        Real, Intent (In)               :: z_coords (*)
04824        Logical, Intent (In)            :: mask_array (*)
04825        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04826        Logical, Intent (In)            :: mask_available
04827        Real, Intent (In)               :: sin_values (*)
04828        Real, Intent (In)               :: cos_values (*)
04829        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04830        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
04831        Integer, Intent (In)            :: srclocz (nlocs(2))
04832        Integer, Intent (In)            :: num_neigh
04833        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04834        Type (Extra_search_info)        :: extra_search
04835        Integer, Intent (Out)           :: ierror
04836     End Subroutine
04837 
04838     subroutine psmile_neigh_nearx_irreg2_real (grid_id,    &
04839                coords1, coords2, coords3,                  &
04840                x_coords, y_coords, z_coords,               &
04841                coords_shape,                               &
04842                mask_array, mask_shape,  mask_available,    &
04843                sin_values, cos_values, grid_valid_shape,   &
04844                search_mode,                                &
04845                srcloc, srclocz, nlocs,                     &
04846                nloc, nprev,                                &
04847                neighbors_3d, num_neigh,                    &
04848                extra_search, ierror)
04849 
04850        Use PSMILe_common
04851 
04852        Integer, Intent (In)            :: grid_id
04853        Integer, Intent (In)            :: nloc, nprev, search_mode
04854        Integer, Intent (In)            :: nlocs (ndim_2d)
04855        Real, Intent (In)               :: coords1 (nlocs(1)*nlocs(2))
04856        Real, Intent (In)               :: coords2 (nlocs(1)*nlocs(2))
04857        Real, Intent (In)               :: coords3 (nlocs(1)*nlocs(2))
04858        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04859        Real, Intent (In)               :: x_coords (*)
04860        Real, Intent (In)               :: y_coords (*)
04861        Real, Intent (In)               :: z_coords (*)
04862        Logical, Intent (In)            :: mask_array (*)
04863        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
04864        Logical, Intent (In)            :: mask_available
04865        Real, Intent (In)               :: sin_values (*)
04866        Real, Intent (In)               :: cos_values (*)
04867        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04868        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
04869        Integer, Intent (In)            :: srclocz (nlocs(2))
04870        Integer, Intent (In)            :: num_neigh
04871        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04872        Type (Extra_search_info)        :: extra_search
04873        Integer, Intent (Out)           :: ierror
04874     End Subroutine
04875 
04876     subroutine psmile_neigh_nearx_sub_irr_real (           &
04877                            grid_id,                        &
04878                            x_coords, y_coords, z_coords,   &
04879                            coords_shape,                   &
04880                            mask_array, mask_shape,  mask_available,    &
04881                            sin_values, cos_values,         &
04882                            grid_valid_shape, search_mode,  &
04883                            neighbors_3d, num_neigh, nloc,  &
04884                            extra_search,                   &
04885                            ijk, sin_search, cos_search,    &
04886                            z_search, jbeg, jend, width, ierror)
04887 
04888        Use PSMILe_common
04889 
04890        Integer,            Intent (In)   :: grid_id
04891        Integer,            Intent (In)   :: search_mode
04892        Integer,            Intent (In)   :: coords_shape (2, ndim_3d)
04893        Real,               Intent (In)   :: x_coords (*)
04894        Real,               Intent (In)   :: y_coords (*)
04895        Real,               Intent (In)   :: z_coords (*)
04896        Logical,            Intent (In)   :: mask_array (*)
04897        Integer,            Intent (In)   :: mask_shape (2, ndim_3d)
04898        Logical,            Intent (In)   :: mask_available
04899        Integer,            Intent (In)   :: grid_valid_shape (2, ndim_3d)
04900        Real,               Intent (In)   :: sin_values (*)
04901        Real,               Intent (In)   :: cos_values (*)
04902        Integer,            Intent (In)   :: nloc, num_neigh
04903        Type (Extra_search_info), Intent(InOut) :: extra_search
04904        Integer,            Intent (In)   :: jbeg, jend
04905        Integer,            Intent (In)   :: ijk (ndim_3d, jbeg:jend)
04906        Integer,            Intent (In)   :: width (ndim_3d)
04907        Real,               Intent (In)   :: sin_search (jbeg:jend, 2)
04908        Real,               Intent (In)   :: cos_search (jbeg:jend, 2)
04909        Real,               Intent (In)   :: z_search   (jbeg:jend)
04910        Integer,            Intent (Out)  :: neighbors_3d (ndim_3d, nloc, num_neigh)
04911        Integer,            Intent (Out)  :: ierror
04912     End Subroutine
04913 
04914     subroutine psmile_neigh_nearx_sub_reg_real (           &
04915                            grid_id,                        &
04916                            x_coords, y_coords, z_coords,   &
04917                            coords_shape,                   &
04918                            mask_array, mask_shape,  mask_available,    &
04919                            sin_values_lon, cos_values_lon, &
04920                            sin_values_lat, cos_values_lat, &
04921                            grid_valid_shape, search_mode,  &
04922                            neighbors_3d, num_neigh, nloc,  &
04923                            extra_search,                   &
04924                            ijk, sin_search, cos_search,    &
04925                            z_search, jbeg, jend, width, ierror)
04926 
04927        Use PSMILe_common
04928 
04929        Integer,            Intent (In)   :: grid_id
04930        Integer,            Intent (In)   :: search_mode
04931        Integer,            Intent (In)   :: coords_shape (2, ndim_3d)
04932        Real,               Intent (In)   :: x_coords (*)
04933        Real,               Intent (In)   :: y_coords (*)
04934        Real,               Intent (In)   :: z_coords (*)
04935        Logical,            Intent (In)   :: mask_array (*)
04936        Integer,            Intent (In)   :: mask_shape (2, ndim_3d)
04937        Logical,            Intent (In)   :: mask_available
04938        Integer,            Intent (In)   :: grid_valid_shape (2, ndim_3d)
04939        Real,               Intent (In)   :: sin_values_lon (*)
04940        Real,               Intent (In)   :: cos_values_lon (*)
04941        Real,               Intent (In)   :: sin_values_lat (*)
04942        Real,               Intent (In)   :: cos_values_lat (*)
04943        Integer,            Intent (In)   :: nloc, num_neigh
04944        Type (Extra_search_info), Intent(In) :: extra_search
04945        Integer,            Intent (In)   :: jbeg, jend
04946        Integer,            Intent (In)   :: ijk (ndim_3d, jbeg:jend)
04947        Integer,            Intent (In)   :: width (ndim_3d)
04948        Real,               Intent (In)   :: sin_search (jbeg:jend, 2)
04949        Real,               Intent (In)   :: cos_search (jbeg:jend, 2)
04950        Real,               Intent (In)   :: z_search   (jbeg:jend)
04951        Integer,            Intent (Out)  :: neighbors_3d (ndim_3d, nloc, num_neigh)
04952        Integer,            Intent (Out)  :: ierror
04953     End Subroutine
04954 
04955     subroutine psmile_neigh_nearest_3d_real (grid_id,         &
04956                     coords1, coords2, coords3,                &
04957                     x_coords, y_coords, z_coords,             &
04958                     coords_shape,                             &
04959                     mask_array, mask_shape,  mask_available,  &
04960                     sin_values, cos_values, grid_valid_shape, &
04961                     srcloc, nloc, nprev, nsearch,             &
04962                     neighbors_3d, num_neigh,                  &
04963                     extra_search, ierror)
04964 
04965        Use PSMILe_common
04966 
04967        Integer, Intent (In)            :: grid_id
04968        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
04969        Integer, Intent (In)            ::   mask_shape (2, ndim_3d)
04970        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
04971        Real, Intent (In)               :: x_coords (*)
04972        Real, Intent (In)               :: y_coords (*)
04973        Real, Intent (In)               :: z_coords (*)
04974        Logical, Intent (In)            :: mask_array (*)
04975        Logical, Intent (In)            :: mask_available
04976        Real, Intent (In)               :: sin_values (*)
04977        Real, Intent (In)               :: cos_values (*)
04978        Integer, Intent (In)            :: nloc, nprev, nsearch
04979        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
04980        Real, Intent (In)               :: coords1 (nloc)
04981        Real, Intent (In)               :: coords2 (nloc)
04982        Real, Intent (In)               :: coords3 (nloc)
04983        Integer, Intent (In)            :: num_neigh
04984 !
04985        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
04986        Type (Extra_search_info)        :: extra_search
04987        Integer, Intent (Out)           :: ierror
04988     End Subroutine
04989 
04990     subroutine psmile_neigh_nearestx_3d_real (grid_id,     &
04991                coords1, coords2, coords3,                  &
04992                x_coords, y_coords, z_coords,               &
04993                coords_shape,                               &
04994                mask_array, mask_shape,  mask_available,    &
04995                sin_values, cos_values, grid_valid_shape,   &
04996                srcloc, nloc, nprev, nsearch,               &
04997                neighbors_3d, num_neigh,                    &
04998                extra_search, ierror)
04999 
05000        Use PSMILe_common
05001 
05002        Integer, Intent (In)            :: grid_id
05003        Integer, Intent (In)            :: nloc, nprev, nsearch
05004        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
05005        Integer, Intent (In)            :: mask_shape   (2, ndim_3d)
05006        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05007        Real, Intent (In)               :: coords1 (nloc)
05008        Real, Intent (In)               :: coords2 (nloc)
05009        Real, Intent (In)               :: coords3 (nloc)
05010        Real, Intent (In)               :: x_coords (*)
05011        Real, Intent (In)               :: y_coords (*)
05012        Real, Intent (In)               :: z_coords (*)
05013        Logical, Intent (In)            :: mask_array (*)
05014        Logical, Intent (In)            :: mask_available
05015        Real, Intent (In)               :: sin_values (*)
05016        Real, Intent (In)               :: cos_values (*)
05017        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
05018        Integer, Intent (In)            :: num_neigh
05019        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05020 !
05021        Type (Extra_search_info)        :: extra_search
05022        Integer, Intent (Out)           :: ierror
05023     End Subroutine
05024 
05025     subroutine psmile_neigh_tricu_3d (                       &
05026                     grid_valid_shape, interp_mode, cyclic,   &
05027                     srcloc, nloc,neighbors_3d, num_neigh, ierror)
05028 
05029        Use PSMILe_common
05030 
05031        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05032        Integer, Intent (In)            :: interp_mode
05033        Logical, Intent (In)            :: cyclic (ndim_3d)
05034        Integer, Intent (In)            :: nloc
05035        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
05036        Integer, Intent (In)            :: num_neigh
05037        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05038        Integer, Intent (Out)           :: ierror
05039     End Subroutine
05040 
05041     subroutine psmile_neigh_tricu_3d_reg (                            &
05042                     grid_valid_shape, interp_mode, cyclic,            &
05043                     srclocs, nlocs, nloc, nprev, neighbors_3d,        &
05044                     num_neigh, ierror)
05045 
05046        Use PSMILe_common
05047 
05048        Integer, Intent (In)               :: grid_valid_shape (2, ndim_3d)
05049        Integer, Intent (In)               :: interp_mode
05050        Logical, Intent (In)               :: cyclic (ndim_3d)
05051        Type (integer_vector), Intent (In) :: srclocs (ndim_3d)
05052        Integer, Intent (In)               :: nlocs (ndim_3d)
05053        Integer, Intent (In)               :: nloc, nprev
05054        Integer, Intent (In)               :: num_neigh
05055        Integer, Intent (Out)              :: neighbors_3d (ndim_3d, nloc, num_neigh)
05056        Integer, Intent (Out)              :: ierror
05057     End Subroutine
05058 
05059     subroutine psmile_neigh_tricu_gauss2 (                            &
05060                     grid_id, grid_valid_shape, interp_mode,           &
05061                     srcloc, virtual_cell, nloc,virtual_cell_available,&
05062                     neighbors_3d, num_neigh, neigh_bascule, ierror)
05063 
05064        Use PSMILe_common
05065 
05066        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05067        Integer, Intent (In)            :: grid_id, interp_mode
05068        Logical, Intent (In)            :: virtual_cell_available
05069        Integer, Intent (In)            :: nloc
05070        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
05071        Integer, Intent (In)            :: virtual_cell (nloc)
05072        Integer, Intent (In)            :: num_neigh
05073        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05074        Integer, Intent (Out)           :: neigh_bascule(nloc)
05075        Integer, Intent (Out)           :: ierror
05076     End Subroutine
05077 
05078     subroutine psmile_neigh_tricu_gauss2_irreg (                      &
05079                     grid_id, grid_valid_shape, interp_mode,           &
05080                     srcloc, srclocz, virtual_cell, nlocs, nloc, nprev,&
05081                     virtual_cell_available, neighbors_3d, num_neigh,  &
05082                     neigh_bascule, ierror)
05083 
05084        Use PSMILe_common
05085 
05086        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05087        Integer, Intent (In)            :: grid_id, interp_mode
05088        Integer, Intent (In)            :: nlocs (ndim_2d)
05089        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
05090        Integer, Intent (In)            :: srclocz (nlocs(2))
05091        Integer, Intent (In)            :: virtual_cell (nlocs(1))
05092        Integer, Intent (In)            :: nloc, nprev
05093        Integer, Intent (In)            :: num_neigh
05094        Logical, Intent (In)            :: virtual_cell_available
05095        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05096        Integer, Intent (Out)           :: neigh_bascule(nloc)
05097        Integer, Intent (Out)           :: ierror
05098     End Subroutine
05099 
05100     subroutine psmile_neigh_tricu_irreg2 (                            &
05101                     grid_valid_shape, interp_mode, cyclic,            &
05102                     srcloc, srclocz, nlocs, nloc, nprev,neighbors_3d, &
05103                     num_neigh, ierror)
05104 
05105        Use PSMILe_common
05106 
05107        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05108        Integer, Intent (In)            :: interp_mode
05109        Logical, Intent (In)            :: cyclic (ndim_3d)
05110        Integer, Intent (In)            :: nlocs (ndim_2d)
05111        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
05112        Integer, Intent (In)            :: srclocz (nlocs(2))
05113        Integer, Intent (In)            :: nloc, nprev
05114        Integer, Intent (In)            :: num_neigh
05115        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05116        Integer, Intent (Out)           :: ierror
05117     End Subroutine
05118 
05119     subroutine psmile_neigh_trili_3d (                       &
05120                     grid_valid_shape, interp_mode, cyclic,   &
05121                     srcloc, nloc, neighbors_3d, num_neigh,   &
05122                     ierror)
05123 
05124        Use PSMILe_common
05125 
05126        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05127        Integer, Intent (In)            :: interp_mode
05128        Logical, Intent (In)            :: cyclic (ndim_3d)
05129        Integer, Intent (In)            :: nloc
05130        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
05131        Integer, Intent (In)            :: num_neigh
05132        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05133        Integer, Intent (Out)           :: ierror
05134     End Subroutine
05135 
05136     subroutine psmile_neigh_trili_3d_reg (                            &
05137                     grid_valid_shape, interp_mode, cyclic,            &
05138                     srclocs, nlocs, nloc, nprev,neighbors_3d,         &
05139                     num_neigh, ierror)
05140 
05141        Use PSMILe_common
05142 
05143        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05144        Integer, Intent (In)            :: interp_mode
05145        Logical, Intent (In)            :: cyclic (ndim_3d)
05146        Type (integer_vector), Intent (In) :: srclocs (ndim_3d)
05147        Integer, Intent (In)            :: nlocs (ndim_3d)
05148        Integer, Intent (In)            :: nloc, nprev
05149        Integer, Intent (In)            :: num_neigh
05150        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05151        Integer, Intent (Out)           :: ierror
05152     End Subroutine
05153 
05154     subroutine psmile_neigh_trili_gauss2 (                          &
05155                     grid_id, grid_valid_shape, interp_mode, srcloc, &
05156                     virtual_cell, nloc, virtual_cell_available,     &
05157                     neighbors_3d, num_neigh, ierror)
05158 
05159        Use PSMILe_common
05160 
05161        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05162        Integer, Intent (In)            :: grid_id, interp_mode
05163        Logical, Intent (In)            :: virtual_cell_available
05164        Integer, Intent (In)            :: nloc
05165        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
05166        Integer, Intent (In)            :: virtual_cell (nloc)
05167        Integer, Intent (In)            :: num_neigh
05168        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05169        Integer, Intent (Out)           :: ierror
05170     End Subroutine
05171 
05172     subroutine psmile_neigh_trili_gauss2_irreg (                      &
05173                     grid_id, grid_valid_shape, interp_mode,           &
05174                     srcloc, srclocz, virtual_cell, nlocs,             &
05175                     nloc, nprev, virtual_cell_available,neighbors_3d, &
05176                     num_neigh, ierror)
05177 
05178        Use PSMILe_common
05179 
05180        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05181        Integer, Intent (In)            :: grid_id, interp_mode
05182        Integer, Intent (In)            :: nlocs (ndim_2d)
05183        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
05184        Integer, Intent (In)            :: srclocz (nlocs(2))
05185        Integer, Intent (In)            :: virtual_cell (nlocs(1))
05186        Integer, Intent (In)            :: nloc, nprev
05187        Integer, Intent (In)            :: num_neigh
05188        Logical, Intent (In)            :: virtual_cell_available
05189        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05190        Integer, Intent (Out)           :: ierror
05191     End Subroutine
05192 
05193     subroutine psmile_neigh_trili_irreg2 (                            &
05194                     grid_valid_shape, interp_mode, cyclic,            &
05195                     srcloc, srclocz, nlocs, nloc, nprev, neighbors_3d,&
05196                     num_neigh, ierror)
05197 
05198        Use PSMILe_common
05199 
05200        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05201        Integer, Intent (In)            :: interp_mode
05202        Logical, Intent (In)            :: cyclic (ndim_3d)
05203        Integer, Intent (In)            :: nlocs (ndim_2d)
05204        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
05205        Integer, Intent (In)            :: srclocz (nlocs(2))
05206        Integer, Intent (In)            :: nloc, nprev
05207        Integer, Intent (In)            :: num_neigh
05208        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
05209        Integer, Intent (Out)           :: ierror
05210     End Subroutine
05211 
05212     subroutine psmile_mg_coarse_1d_real (lev, chmin, chmax,        &
05213                                          found, locations, coords, &
05214                                          ibeg, iend)
05215        Integer, Intent (In)            :: lev
05216        Integer, Intent (InOut)         :: ibeg, iend
05217        Real, Intent (In)               :: chmin (0:0), chmax (0:0)
05218        Integer, Intent (InOut)         :: found (iend)
05219        Integer, Intent (InOut)         :: locations (iend)
05220        Real, Intent (In)               :: coords (iend)
05221     End Subroutine
05222 
05223     subroutine psmile_mg_coarse_2d_real (lev, chmin, chmax,         &
05224                                          found, locations, coords1, &
05225                                          coords2, ibeg, iend)
05226        Use PSMILe_common
05227 
05228        Integer, Intent (In)            :: lev
05229        Integer, Intent (InOut)         :: ibeg, iend
05230        Type (real_vector), Intent (In) :: chmin (ndim_2d), chmax (ndim_2d)
05231        Integer, Intent (InOut)         :: found (iend)
05232        Integer, Intent (InOut)         :: locations (iend)
05233        Real, Intent (In)               :: coords1 (iend)
05234        Real, Intent (In)               :: coords2 (iend)
05235     End Subroutine
05236 
05237     subroutine psmile_mg_coarse_3d_real (lev, chmin, chmax,         &
05238                                          found, locations, coords1, &
05239                                          coords2, coords3, ibeg, iend)
05240        Use PSMILe_common
05241 
05242        Integer, Intent (In)            :: lev
05243        Integer, Intent (InOut)         :: ibeg, iend
05244        Type (real_vector), Intent (In) :: chmin (ndim_3d), chmax (ndim_3d)
05245        Integer, Intent (InOut)         :: found (iend)
05246        Integer, Intent (InOut)         :: locations (iend)
05247        Real, Intent (In)               :: coords1 (iend)
05248        Real, Intent (In)               :: coords2 (iend)
05249        Real, Intent (In)               :: coords3 (iend)
05250     End Subroutine
05251 
05252     subroutine psmile_mg_next_level_1d_real (grid_id, idim,          &
05253                                      lev, nlev,                      &
05254                                      chmin, chmax, midp, levdim,     &
05255                                      found, loc, coords, ibeg, iend, &
05256                                      ijkinc, ijkcoa, ierror)
05257 
05258        Use PSMILe_common
05259        Integer, Intent (In)            :: grid_id
05260        Integer, Intent (In)            :: idim, levdim
05261        Integer, Intent (InOut)         :: ibeg, iend
05262        Integer, Intent (In)            :: lev, nlev, ijkinc, ijkcoa
05263        Real, Intent (In)               :: chmin (0:levdim)
05264        Real, Intent (In)               :: chmax (0:levdim)
05265        Real, Intent (In)               :: midp  (0:levdim)
05266        Integer, Intent (InOut)         :: found (iend)
05267        Integer, Intent (InOut)         :: loc   (iend)
05268        Real, Intent (In)               :: coords (iend)
05269        Integer, Intent (Out)           :: ierror
05270     End Subroutine
05271 
05272     subroutine psmile_mg_next_level_2d_real (grid_id, lev, nlev,     &
05273                                      chmin1, chmin2,                 &
05274                                      chmax1, chmax2,                 &
05275                                      midp1,  midp2,                  &
05276                                      levdim,                         &
05277                                      found, loc, range,              &
05278                                      coords1, coords2,               &
05279                                      shape, control,                 &
05280                                      ijkinc, ijkcoa, ierror)
05281 
05282        Use PSMILe_common
05283        Integer, Intent (In)            :: grid_id
05284        Integer, Intent (In)            :: levdim (ndim_2d)
05285        Integer, Intent (In)            :: lev, nlev
05286        Integer, Intent (In)            :: ijkinc(ndim_3d), ijkcoa(ndim_2d)
05287        Real, Intent (In)               :: chmin1 (*), chmin2 (*)
05288        Real, Intent (In)               :: chmax1 (*), chmax2 (*)
05289        Real, Intent (In)               :: midp1  (*), midp2  (*)
05290        Integer, Intent (InOut)         :: found (*)
05291        Integer, Intent (InOut)         :: loc   (2, *)
05292        Integer, Intent (In)            :: range (2, ndim_3d)
05293        Real, Intent (In)               :: coords1 (*)
05294        Real, Intent (In)               :: coords2 (*)
05295        Integer, Intent (In)            :: shape (2, ndim_3d)
05296        Integer, Intent (InOut)         :: control (2, ndim_3d)
05297        Integer, Intent (Out)           :: ierror
05298     End Subroutine
05299 
05300     subroutine psmile_mg_next_level_3d_real (grid_id, lev, nlev,     &
05301                                      chmin1, chmin2, chmin3,         &
05302                                      chmax1, chmax2, chmax3,         &
05303                                      midp1,  midp2,  midp3,          &
05304                                      levdim,                         &
05305                                      found, loc, range,              &
05306                                      coords1, coords2, coords3,      &
05307                                      shape, control,                 &
05308                                      ijkinc, ijkcoa, ierror)
05309 
05310        Use PSMILe_common
05311        Integer, Intent (In)            :: grid_id
05312        Integer, Intent (In)            :: levdim (ndim_3d)
05313        Integer, Intent (In)            :: lev, nlev
05314        Integer, Intent (In)            :: ijkinc(ndim_3d), ijkcoa(ndim_3d)
05315        Real, Intent (In)               :: chmin1 (*), chmin2 (*), chmin3 (*)
05316        Real, Intent (In)               :: chmax1 (*), chmax2 (*), chmax3 (*)
05317        Real, Intent (In)               :: midp1  (*), midp2  (*), midp3  (*)
05318        Integer, Intent (InOut)         :: found (*)
05319        Integer, Intent (InOut)         :: loc   (ndim_3d, *)
05320        Integer, Intent (In)            :: range (2, ndim_3d)
05321        Real, Intent (In)               :: coords1 (*)
05322        Real, Intent (In)               :: coords2 (*)
05323        Real, Intent (In)               :: coords3 (*)
05324        Integer, Intent (In)            :: shape (2, ndim_3d)
05325        Integer, Intent (InOut)         :: control (2, ndim_3d)
05326        Integer, Intent (Out)           :: ierror
05327     End Subroutine
05328 
05329     subroutine psmile_mg_prev_levels_1d_real (grid_id, idim,   &
05330                            lev, nlev,                          &
05331                            lstijk, xyz, found, newijk)
05332        Use PSMILe_common
05333        Integer, Intent (In)            :: grid_id
05334        Integer, Intent (In)            :: idim
05335        Integer, Intent (In)            :: lev, nlev
05336        Integer, Intent (In)            :: lstijk
05337        Real, Intent (In)               :: xyz
05338        Integer, Intent (Out)           :: found, newijk
05339     End Subroutine
05340 
05341     subroutine psmile_mg_prev_levels_2d_real (grid_id, &
05342                            lev, nlev,                  &
05343                            lstijk, xyz, found, newijk, nc)
05344        Use PSMILe_Common
05345        Integer,          Intent (In)   :: grid_id
05346        Integer,          Intent (In)   :: lev, nlev, nc
05347        Integer,          Intent (In)   :: lstijk (ndim_2d, nc)
05348        Real,             Intent (In)   :: xyz (ndim_2d, nc)
05349        Integer,          Intent (Out)  :: found (nc), newijk (ndim_2d, nc)
05350     End Subroutine
05351 
05352     subroutine psmile_mg_prev_levels_3d_real (grid_id, &
05353                            lev, nlev,                  &
05354                            lstijk, xyz, found, newijk)
05355        Use PSMILe_common
05356        Integer, Intent (In)            :: grid_id
05357        Integer, Intent (In)            :: lev, nlev
05358        Integer, Intent (In)            :: lstijk (ndim_3d)
05359        Real, Intent (In)               :: xyz (ndim_3d)
05360        Integer, Intent (Out)           :: found, newijk (ndim_3d)
05361     End Subroutine
05362 
05363     subroutine psmile_mg_cells_1d_real ( nlev, found, loc, range,    &
05364                                          search_grid_type,           &
05365                                          corners1, search_dim,       &
05366                                          shape, control,             &
05367                                          grid_valid_shape, cyclic,   &
05368                                          chmin, chmax, tol, ierror )
05369       Use PSMILe_common
05370       Integer, Intent (In)            :: nlev
05371       Integer, Intent (In)            :: search_grid_type
05372       Integer, Intent (In)            :: range (2, ndim_3d)
05373       Integer, Intent (In)            :: shape (2, ndim_3d)
05374       Integer, Intent (InOut)         :: found (range(1,1):range(2,1), 
05375                                                 range(1,2):range(2,2), 
05376                                                 range(1,3):range(2,3))
05377       Integer, Intent (InOut)         :: loc   (range(1,1):range(2,1), 
05378                                                 range(1,2):range(2,2), 
05379                                                 range(1,3):range(2,3))
05380       Real, Intent (In)               :: corners1 (shape(1,1):shape(2,1), 
05381                                                    shape(1,2):shape(2,2), 
05382                                                    shape(1,3):shape(2,3))
05383       Integer, Intent (In)            :: control (2, ndim_3d)
05384       Integer,          Intent (In)   :: search_dim
05385       Integer,          Intent (In)   :: grid_valid_shape (2)
05386       Logical,          Intent (In)   :: cyclic
05387       Real, Intent (In)               :: chmin (grid_valid_shape(1): 
05388                                                 grid_valid_shape(2)+2)
05389       Real, Intent (In)               :: chmax (grid_valid_shape(1): 
05390                                                 grid_valid_shape(2)+2)
05391       Real, Intent (In)               :: tol
05392       Integer, Intent (Out)           :: ierror
05393     End Subroutine
05394 
05395     subroutine psmile_mg_cells_2d_real ( grid_id, search_grid_type,            &
05396                                          found, loc, loc_fnd_shape,            &
05397                                          tgt_corners_x, tgt_corners_y,         &
05398                                          tgt_corner_shape, control,            &
05399                                          grid_valid_shape,                     &
05400                                          ipart, src_corner_shape, nbr_corners, &
05401                                          src_corners_x, src_corners_y,         &
05402                                          chmin1, chmax1, chmin2, chmax2,       &
05403                                          tol, ierror )
05404       Use PSMILe_common
05405       Integer, Intent (In)            :: grid_id
05406       Integer, Intent (In)            :: search_grid_type
05407       Integer, Intent (In)            :: loc_fnd_shape (2, ndim_3d)
05408       Integer, Intent (In)            :: tgt_corner_shape (2, ndim_3d)
05409       Integer, Intent (InOut)         :: found (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
05410                                                 loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
05411                                                 loc_fnd_shape(1,3):loc_fnd_shape(2,3))
05412       Integer, Intent (InOut)         :: loc   (ndim_2d,                               
05413                                                 loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
05414                                                 loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
05415                                                 loc_fnd_shape(1,3):loc_fnd_shape(2,3))
05416       Real, Intent (In)               :: tgt_corners_x (                               
05417                                           tgt_corner_shape(1,1):tgt_corner_shape(2,1), 
05418                                           tgt_corner_shape(1,2):tgt_corner_shape(2,2), 
05419                                           tgt_corner_shape(1,3):tgt_corner_shape(2,3))
05420       Real, Intent (In)               :: tgt_corners_y (                               
05421                                           tgt_corner_shape(1,1):tgt_corner_shape(2,1), 
05422                                           tgt_corner_shape(1,2):tgt_corner_shape(2,2), 
05423                                           tgt_corner_shape(1,3):tgt_corner_shape(2,3))
05424       Integer, Intent (In)            :: control (2,  ndim_3d)
05425       Integer,          Intent (In)   :: grid_valid_shape(2,ndim_2d)
05426       Integer,          Intent (In)   :: ipart
05427       Integer,          Intent (In)   :: src_corner_shape (2,2)
05428       Integer,          Intent (In)   :: nbr_corners
05429       Real, Intent (In)               :: src_corners_x (                                
05430                                           src_corner_shape (1,1):src_corner_shape(2,1), 
05431                                           src_corner_shape (1,2):src_corner_shape(2,2), 
05432                                           nbr_corners)
05433       Real, Intent (In)               :: src_corners_y (                                
05434                                           src_corner_shape (1,1):src_corner_shape(2,1), 
05435                                           src_corner_shape (1,2):src_corner_shape(2,2), 
05436                                           nbr_corners)
05437       Real, Intent (InOut)            :: chmin1 (grid_valid_shape(1,1):    
05438                                                  grid_valid_shape(2,1)+1 , 
05439                                                  grid_valid_shape(1,2):    
05440                                                  grid_valid_shape(2,2)+1)
05441       Real, Intent (InOut)            :: chmin2 (grid_valid_shape(1,1):    
05442                                                  grid_valid_shape(2,1)+1,  
05443                                                  grid_valid_shape(1,2):    
05444                                                  grid_valid_shape(2,2)+1)
05445       Real, Intent (InOut)            :: chmax1 (grid_valid_shape(1,1):    
05446                                                  grid_valid_shape(2,1)+1 , 
05447                                                  grid_valid_shape(1,2):    
05448                                                  grid_valid_shape(2,2)+1)
05449       Real, Intent (InOut)            :: chmax2 (grid_valid_shape(1,1):    
05450                                                  grid_valid_shape(2,1)+1,  
05451                                                  grid_valid_shape(1,2):    
05452                                                  grid_valid_shape(2,2)+1)
05453       Real, Intent (In)               :: tol
05454       Integer, Intent (Out)           :: ierror
05455     End Subroutine
05456 
05457     subroutine psmile_mg_control_cell_1d_real (            &
05458                            chmin, chmax, midp, levdim,     &
05459                            ijk, xyz, nold, all, wide, found, newijk)
05460        Use PSMILe_common
05461 
05462        Integer, Intent (In)            :: levdim
05463        Real, Intent (In)               :: chmin (0:levdim)
05464        Real, Intent (In)               :: chmax (0:levdim)
05465        Real, Intent (In)               :: midp  (0:levdim)
05466        Integer, Intent (In)            :: ijk, nold
05467        Logical, Intent (In)            :: all, wide
05468        Real, Intent (In)               :: xyz
05469        Integer, Intent (Out)           :: found, newijk
05470     End Subroutine
05471 
05472     subroutine psmile_mg_control_cell_2d_real (     &
05473                     chmin1, chmin2,                 &
05474                     chmax1, chmax2,                 &
05475                     midp1,  midp2,                  &
05476                     levdim,                         &
05477                     ijk, xyz, nold, ignore, wide, found, newijk)
05478        Use PSMILe_common
05479 
05480        Real, Intent (In)               :: chmin1 (*), chmin2 (*)
05481        Real, Intent (In)               :: chmax1 (*), chmax2 (*)
05482        Real, Intent (In)               :: midp1  (*), midp2  (*)
05483        Integer, Intent (In)            :: levdim (ndim_2d)
05484        Integer, Intent (In)            :: ijk(ndim_2d), nold
05485        Integer, Intent (In)            :: ignore(ndim_2d)
05486        Logical, Intent (In)            :: wide
05487        Real, Intent (In)               :: xyz(ndim_2d)
05488        Integer, Intent (Out)           :: found, newijk(ndim_2d)
05489     End Subroutine
05490 
05491     subroutine psmile_mg_control_cell_3d_real (            &
05492                            chmin1, chmin2, chmin3,         &
05493                            chmax1, chmax2, chmax3,         &
05494                            midp1,  midp2,  midp3,          &
05495                            levdim,                         &
05496                            ijk, xyz, nold, all, wide, found, newijk)
05497        Use PSMILe_common
05498 
05499        Real, Intent (In)               :: chmin1 (*), chmin2 (*), chmin3 (*)
05500        Real, Intent (In)               :: chmax1 (*), chmax2 (*), chmax3 (*)
05501        Real, Intent (In)               :: midp1  (*), midp2  (*), midp3  (*)
05502        Integer, Intent (In)            :: levdim (ndim_3d)
05503        Integer, Intent (In)            :: ijk(ndim_3d), nold
05504        Logical, Intent (In)            :: all, wide
05505        Real, Intent (In)               :: xyz(ndim_3d)
05506        Integer, Intent (Out)           :: found, newijk(ndim_3d)
05507     End Subroutine
05508 
05509     subroutine psmile_mg_final_2d_real (grid_id, nlev,             &
05510                     chmin1, chmin2, chmax1, chmax2,                &
05511                     midp1,  midp2,  levdim,                        &
05512                     found, loc, range,                             &
05513                     coords1, coords2, shape, control,              &
05514                     corners1, corners2, corner_shape, nbr_corners, &
05515                     tol, ierror)
05516        Use PSMILe_common
05517 
05518        Integer,          Intent (In)    :: grid_id, nlev
05519        Integer,          Intent (In)    :: levdim (ndim_2d)
05520        Real,             Intent (In)    :: chmin1 (0:levdim(1), 
05521                                                    0:levdim(2))
05522        Real,             Intent (In)    :: chmin2 (0:levdim(1), 
05523                                                    0:levdim(2))
05524        Real,             Intent (In)    :: chmax1 (0:levdim(1), 
05525                                                    0:levdim(2))
05526        Real,             Intent (In)    :: chmax2 (0:levdim(1), 
05527                                                    0:levdim(2))
05528        Real,             Intent (In)    :: midp1  (0:levdim(1), 
05529                                                    0:levdim(2))
05530        Real,             Intent (In)    :: midp2  (0:levdim(1), 
05531                                                    0:levdim(2))
05532        Integer,          Intent (In)    :: range (2, ndim_3d)
05533        Integer,          Intent (In)    :: shape (2, ndim_3d)
05534        Integer,          Intent (InOut) :: found (range(1,1):range(2,1), 
05535                                                   range(1,2):range(2,2), 
05536                                                   range(1,3):range(2,3))
05537        Integer,          Intent (InOut) :: loc   (ndim_2d,               
05538                                                   range(1,1):range(2,1), 
05539                                                   range(1,2):range(2,2), 
05540                                                   range(1,3):range(2,3))
05541        Real,             Intent (In)    :: coords1 (shape(1,1):shape(2,1), 
05542                                                     shape(1,2):shape(2,2), 
05543                                                     shape(1,3):shape(2,3))
05544        Real,             Intent (In)    :: coords2 (shape(1,1):shape(2,1), 
05545                                                     shape(1,2):shape(2,2), 
05546                                                     shape(1,3):shape(2,3))
05547        Integer,          Intent (In)    :: control (2, ndim_3d)
05548        Integer,          Intent (In)    :: corner_shape (2, ndim_2d)
05549        Integer,          Intent (In)    :: nbr_corners
05550        Real,             Intent (In)    ::                 
05551           corners1 ( corner_shape(1,1):corner_shape(2,1), 
05552                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
05553        Real,             Intent (In)    ::                 
05554           corners2 ( corner_shape(1,1):corner_shape(2,1), 
05555                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
05556        Real,             Intent (In)    :: tol
05557        Integer,          Intent (Out)   :: ierror
05558     End Subroutine
05559 
05560     subroutine psmile_mg_final_3d_real (comp_info, nlev,             &
05561                                      found, loc, range,              &
05562                                      coords1, coords2, coords3,      &
05563                                      shape, control,                 &
05564                                      grid_id,                        &
05565                                      x_coords, y_coords, z_coords,   &
05566                                      coords_shape,                   &
05567                                      nbr_corners,                    &
05568                                      ijk0, tol, ierror)
05569 
05570        Use PSMILe_common
05571        Type (Enddef_comp), Intent (In) :: comp_info
05572        Integer, Intent (In)            :: nlev
05573        Integer, Intent (InOut)         :: found (*)
05574        Integer, Intent (InOut)         :: loc   (ndim_3d, *)
05575        Integer, Intent (In)            :: range (2, ndim_3d)
05576        Real, Intent (In)               :: coords1 (*)
05577        Real, Intent (In)               :: coords2 (*)
05578        Real, Intent (In)               :: coords3 (*)
05579        Integer, Intent (In)            :: shape (2, ndim_3d)
05580        Integer, Intent (InOut)         :: control (2, ndim_3d)
05581        Integer, Intent (In)            :: grid_id
05582        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
05583        Real, Intent (In)               :: x_coords (*)
05584        Real, Intent (In)               :: y_coords (*)
05585        Real, Intent (In)               :: z_coords (*)
05586        Integer, Intent (In)            :: nbr_corners
05587        Integer, Intent (In)            :: ijk0 (ndim_3d)
05588        Real, Intent (In)               :: tol
05589        Integer, Intent (Out)           :: ierror
05590     End Subroutine
05591 
05592    subroutine psmile_mg_final_gauss2_real (                                       &
05593                      grid_id, found, locations, fnd_loc_range,                    &
05594                      tgt_coords_x, tgt_coords_y, tgt_coords_shape, search_range,  &
05595                      src_corners_x, src_corners_y, src_corner_shape, nbr_corners, &
05596                      ierror)
05597 
05598       use psmile_common
05599 
05600       integer, intent (in)            :: grid_id
05601       integer, intent (in)            :: fnd_loc_range (2, ndim_3d)
05602       integer, intent (in)            :: tgt_coords_shape (2, ndim_3d)
05603       real, intent (in)   ::                                        
05604          tgt_coords_x (tgt_coords_shape(1,1):tgt_coords_shape(2,1), 
05605                        tgt_coords_shape(1,2):tgt_coords_shape(2,2), 
05606                        tgt_coords_shape(1,3):tgt_coords_shape(2,3))
05607       real, intent (in)   ::                                        
05608          tgt_coords_y (tgt_coords_shape(1,1):tgt_coords_shape(2,1), 
05609                        tgt_coords_shape(1,2):tgt_coords_shape(2,2), 
05610                        tgt_coords_shape(1,3):tgt_coords_shape(2,3))
05611       integer, intent (in)            :: search_range (2, ndim_3d)
05612       integer, intent (in)            :: src_corner_shape (2, ndim_2d)
05613       integer, intent (in)            :: nbr_corners
05614       real,   intent (in) ::                                        
05615          src_corners_x ( src_corner_shape(1,1):src_corner_shape(2,1), nbr_corners)
05616       real,   intent (in) ::                                        
05617          src_corners_y ( src_corner_shape(1,1):src_corner_shape(2,1), nbr_corners)
05618       integer, intent (inout)         :: found (fnd_loc_range(1,1):fnd_loc_range(2,1), 
05619                                                 fnd_loc_range(1,2):fnd_loc_range(2,2), 
05620                                                 fnd_loc_range(1,3):fnd_loc_range(2,3))
05621       integer, intent (inout)         :: locations (fnd_loc_range(1,1):fnd_loc_range(2,1), 
05622                                                     fnd_loc_range(1,2):fnd_loc_range(2,2), 
05623                                                     fnd_loc_range(1,3):fnd_loc_range(2,3))
05624       integer, intent (out)           :: ierror
05625    end subroutine
05626 
05627     subroutine psmile_mg_final_prev_2d_real (grid_id, nlev,        &
05628                     lstijk, xyz, found, newijk, nc,                &
05629                     corners1, corners2, corner_shape, nbr_corners, &
05630                     tol, ierror)
05631        Use PSMILe_common
05632 
05633        Integer,          Intent (In)   :: grid_id, nlev
05634        Integer,          Intent (In)   :: nc
05635        Integer,          Intent (In)   :: lstijk (ndim_2d, nc)
05636        Real,             Intent (In)   :: xyz (ndim_2d, nc)
05637        Integer,          Intent (In)   :: corner_shape (2, ndim_2d)
05638        Integer,          Intent (In)   :: nbr_corners
05639        Real,             Intent (In)   ::                 
05640           corners1 ( corner_shape(1,1):corner_shape(2,1), 
05641                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
05642        Real,             Intent (In)   ::                 
05643           corners2 ( corner_shape(1,1):corner_shape(2,1), 
05644                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
05645        Real,             Intent (In)   :: tol
05646 
05647        Integer,          Intent (Out)  :: found (nc)
05648        Integer,          Intent (Out)  :: newijk (ndim_2d, nc)
05649        Integer,          Intent (Out)  :: ierror
05650     End Subroutine
05651 
05652     subroutine psmile_mg_method_1d_real (comp_info, nlev,            &
05653                                      found, loc, range,              &
05654                                      coords1,                        &
05655                                      shape, control,                 &
05656                                      method_id,                      &
05657                                      x_coords,                       &
05658                                      coords_shape,                   &
05659                                      grid_valid_shape, cyclic,       &
05660                                      chmin, chmax,                   &
05661                                      tol, ierror)
05662 
05663        Use PSMILe_common
05664 
05665        Type (Enddef_comp), Intent (In) :: comp_info
05666        Integer, Intent (In)            :: nlev
05667        Integer, Intent (InOut)         :: found (*)
05668        Integer, Intent (InOut)         :: loc   (*)
05669        Integer, Intent (In)            :: range (2, ndim_3d)
05670        Real, Intent (In)               :: coords1 (*)
05671        Integer, Intent (In)            :: shape (2, ndim_3d)
05672        Integer, Intent (In)            :: control (2, ndim_3d)
05673        Integer, Intent (In)            :: method_id
05674        Integer, Intent (In)            :: coords_shape (2)
05675        Integer, Intent (In)            :: grid_valid_shape (2)
05676        Logical, Intent (In)            :: cyclic
05677        Real, Intent (In)               :: x_coords (*)
05678        Real, Intent (In)               :: chmin (*), chmax (*)
05679        Real, Intent (In)               :: tol
05680        Integer, Intent (Out)           :: ierror
05681     End Subroutine
05682 
05683     subroutine psmile_mg_method_2d_real (comp_info,   &
05684                     nlev, found, loc, range,          &
05685                     coords1, coords2, search_shape, control, &
05686                     x_coords, y_coords, coords_shape, &
05687                     grid_valid_shape, cyclic, period, &
05688                     chmin1, chmin2, chmax1, chmax2,   &
05689                     tol, ierror)
05690        Use PSMILe_common
05691 
05692        Type (Enddef_comp), Intent (In) :: comp_info
05693        Integer, Intent (In)            :: nlev
05694        Integer, Intent (InOut)         :: found (*)
05695        Integer, Intent (InOut)         :: loc   (ndim_2d, *)
05696        Integer, Intent (In)            :: range (2, ndim_3d)
05697        Real,    Intent (In)            :: coords1 (*)
05698        Real,    Intent (In)            :: coords2 (*)
05699        Integer, Intent (In)            :: search_shape (2, ndim_3d)
05700        Integer, Intent (In)            :: control (2, ndim_3d)
05701        Integer, Intent (In)            :: coords_shape (2, ndim_2d)
05702        Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
05703        Logical, Intent (In)            :: cyclic (ndim_2d)
05704        Real,    Intent (In)            :: period (ndim_2d)
05705        Real,    Intent (In)            :: x_coords (*)
05706        Real,    Intent (In)            :: y_coords (*)
05707        Real,    Intent (In)            :: chmin1 (*), chmin2 (*)
05708        Real,    Intent (In)            :: chmax1 (*), chmax2 (*)
05709        Real,    Intent (In)            :: tol
05710        Integer, Intent (Out)           :: ierror
05711     End Subroutine
05712 
05713     subroutine psmile_mg_method_3d_real (comp_info, nlev,            &
05714                                      found, loc, range,              &
05715                                      coords1, coords2, coords3,      &
05716                                      shape, control,                 &
05717                                      method_id,                      &
05718                                      x_coords, y_coords, z_coords,   &
05719                                      coords_shape,                   &
05720                                      grid_valid_shape, cyclic,       &
05721                                      chmin1, chmin2, chmin3,         &
05722                                      chmax1, chmax2, chmax3,         &
05723                                      midp1,  midp2,  midp3,          &
05724                                      tol, ierror)
05725 
05726        Use PSMILe_common
05727 
05728        Type (Enddef_comp), Intent (In)    :: comp_info
05729        Integer,            Intent (In)    :: nlev
05730        Integer,            Intent (InOut) :: found (*)
05731        Integer,            Intent (InOut) :: loc   (ndim_3d, *)
05732        Integer,            Intent (In)    :: range (2, ndim_3d)
05733        Real,               Intent (In)    :: coords1 (*)
05734        Real,               Intent (In)    :: coords2 (*)
05735        Real,               Intent (In)    :: coords3 (*)
05736        Integer,            Intent (In)    :: shape (2, ndim_3d)
05737        Integer,            Intent (In)    :: control (2, ndim_3d)
05738        Integer,            Intent (In)    :: method_id
05739        Integer,            Intent (In)    :: coords_shape (2, ndim_3d)
05740        Integer,            Intent (In)    :: grid_valid_shape (2, ndim_3d)
05741        Logical,            Intent (In)    :: cyclic (ndim_3d)
05742        Real,               Intent (In)    :: x_coords (*)
05743        Real,               Intent (In)    :: y_coords (*)
05744        Real,               Intent (In)    :: z_coords (*)
05745        Real,               Intent (In)    :: tol
05746        Real,               Intent (In)    :: chmin1 (*), chmin2 (*), chmin3 (*)
05747        Real,               Intent (In)    :: chmax1 (*), chmax2 (*), chmax3 (*)
05748        Real,               Intent (In)    :: midp1  (*), midp2  (*), midp3  (*)
05749        Integer,            Intent (Out)   :: ierror
05750     End Subroutine
05751 
05752    subroutine psmile_mg_method_gauss2_real (method_id, search_range,     &
05753                                             tgt_shape, tgt_coords_x,     &
05754                                             tgt_coords_y, loc_fnd_shape, &
05755                                             found, loc, virtual_cell,    &
05756                                             ierror)
05757 
05758       use psmile_common
05759 
05760       Integer, Intent (In)    :: method_id
05761       Integer, Intent (In)    :: search_range (2, ndim_3d)
05762       Integer, Intent (In)    :: loc_fnd_shape (2, ndim_3d)
05763       Integer, Intent (In)    :: tgt_shape (2, ndim_3d)
05764       Real, Intent (In)       :: tgt_coords_x (tgt_shape(1,1):tgt_shape(2,1),  
05765                                                tgt_shape(1,2):tgt_shape(2,2),  
05766                                                tgt_shape(1,3):tgt_shape(2,3)), 
05767                                  tgt_coords_y (tgt_shape(1,1):tgt_shape(2,1),  
05768                                                tgt_shape(1,2):tgt_shape(2,2),  
05769                                                tgt_shape(1,3):tgt_shape(2,3))
05770       Integer, Intent (InOut) :: found (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
05771                                         loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
05772                                         loc_fnd_shape(1,3):loc_fnd_shape(2,3))
05773       Integer, Intent (InOut) :: loc   (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
05774                                         loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
05775                                         loc_fnd_shape(1,3):loc_fnd_shape(2,3))
05776       Integer, Intent (Out)   :: virtual_cell (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
05777                                                loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
05778                                                loc_fnd_shape(1,3):loc_fnd_shape(2,3))
05779       Integer, Intent (Out)   :: ierror
05780    end subroutine
05781 
05782     subroutine psmile_mg_method_irreg2_real (comp_info,    &
05783                     found, locations, search,              &
05784                     array, shape_2d, range_2d, control_2d, &
05785                            shape_1d, range_1d, control_1d, &
05786                     m_arrays, m_levdim,                    &
05787                     grid_id, method_id, tol, ierror)
05788 
05789        Use PSMILe_common
05790 
05791        Type (Enddef_comp), Intent (In)  :: comp_info
05792        Type (Enddef_search)             :: search
05793        Integer,            Intent (In)  :: grid_id, method_id
05794        Real,               Intent (In)  :: tol
05795        Type (real_vector), Intent (In)  :: array (        ndim_3d, search%search_data%npart)
05796        Integer,            Intent (In)  :: shape_2d   (2, ndim_3d, search%search_data%npart)
05797        Integer,            Intent (In)  :: range_2d   (2, ndim_3d, search%search_data%npart)
05798        Integer,            Intent (In)  :: control_2d (2, ndim_3d, search%search_data%npart)
05799        Integer,            Intent (In)  :: shape_1d   (2, ndim_3d, search%search_data%npart)
05800        Integer,            Intent (In)  :: range_1d   (2, ndim_3d, search%search_data%npart)
05801        Integer,            Intent (In)  :: control_1d (2, ndim_3d, search%search_data%npart)
05802        Type (Enddef_mg_real)            :: m_arrays
05803        Integer,            Intent (In)  :: m_levdim (ndim_3d)
05804        Type (integer_vector)            :: found     (search%search_data%npart, 2)
05805        Type (integer_vector)            :: locations (search%search_data%npart, 2)
05806        Integer,            Intent (Out) :: ierror
05807     End Subroutine
05808 
05809     subroutine psmile_mg_srch_nneigh_reg_real (grid_id, nn_srch,     &
05810                     arrays, search_mode, nref_3d, grid_valid_shape,  &
05811                     neighbors_3d, nloc, num_neigh,                   &
05812                     sin_search, cos_search, z_search,                &
05813                     dist_real, dim1, indices, jbeg, jend,            &
05814                     mask_array, mask_shape, mask_available,          &
05815                     tol, ierror)
05816 
05817        Use PSMILe_common
05818 
05819        Integer,          Intent (In)   :: grid_id
05820        Type (Extra_search_nn), Intent (In) :: nn_srch
05821        Type (Extra_search_real)        :: arrays
05822        Integer,          Intent (In)   :: search_mode, nref_3d
05823        Integer,          Intent (In)   :: jbeg, jend, nloc
05824        Integer,          Intent (In)   :: grid_valid_shape (2, ndim_3d)
05825        Integer,          Intent (In)   ::       mask_shape (2, ndim_3d)
05826        Integer,          Intent (In)   :: num_neigh
05827        Integer,          Intent (In)   :: indices (:), dim1 (2)
05828        Real,             Intent (In)   :: sin_search (jbeg:jend, 2)
05829        Real,             Intent (In)   :: cos_search (jbeg:jend, 2)
05830        Real,             Intent (In)   ::   z_search (jbeg:jend)
05831        Logical,          Intent (In)   :: 
05832           mask_array (mask_shape (1,1):mask_shape (2,1), 
05833                       mask_shape (1,2):mask_shape (2,2), 
05834                       mask_shape (1,3): mask_shape (2,3))
05835        Logical,          Intent (In)   :: mask_available
05836        Real,             Intent (In)   :: tol
05837 !
05838        Real,             Intent (InOut) :: 
05839           dist_real (dim1(1):dim1(2), num_neigh)
05840 !
05841        Integer,          Intent (Out)   :: 
05842           neighbors_3d (ndim_3d, nloc, num_neigh)
05843        Integer,          Intent (Out)   :: ierror
05844     End Subroutine
05845 
05846     subroutine psmile_mg_srch_nneigh_irr_real (grid_id,     &
05847                 arrays, search_mode, nref_3d,               &
05848                 sin_values, cos_values, grid_valid_shape,   &
05849                 z_coords, coords_shape,                     &
05850                 neighbors_3d, nloc, num_neigh,              &
05851                 sin_search, cos_search, z_search,           &
05852                 dist_dble, dim1, indices, jbeg, jend,       &
05853                 mask_ind,                                   &
05854                 mask_array, mask_shape, mask_available,     &
05855                 tol, ierror)
05856 
05857        Use PSMILe_common
05858 
05859        Integer, Intent (In)            :: grid_id
05860        Type (Extra_search_real)        :: arrays
05861        Integer, Intent (In)            :: nref_3d
05862        Integer, Intent (In)            :: nloc
05863        Integer, Intent (In)            :: search_mode
05864        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
05865        Real,             Intent (In)   :: sin_values (grid_valid_shape(1,1): 
05866                                                       grid_valid_shape(2,1), 
05867                                                       grid_valid_shape(1,2): 
05868                                                       grid_valid_shape(2,2), 
05869                                                       2)
05870        Real,             Intent (In)   :: cos_values (grid_valid_shape(1,1): 
05871                                                       grid_valid_shape(2,1), 
05872                                                       grid_valid_shape(1,2): 
05873                                                       grid_valid_shape(2,2), 
05874                                                       2)
05875        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
05876        Real,             Intent (In)   :: z_coords(coords_shape(1,3): 
05877                                                    coords_shape(2,3))
05878        Integer, Intent (In)            :: num_neigh
05879        Integer, Intent (In)            :: jbeg, jend
05880        Integer, Intent (In)            :: indices (:), dim1 (2)
05881        Real,             Intent (InOut) :: dist_dble (dim1(1):dim1(2), num_neigh)
05882        Real,             Intent (In)   :: sin_search (jbeg:jend, 2)
05883        Real,             Intent (In)   :: cos_search (jbeg:jend, 2)
05884        Real,             Intent (In)   :: z_search   (jbeg:jend)
05885        Logical, Intent (In)            :: mask_ind   (jbeg:jend)
05886        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
05887        Logical, Intent (In)            :: mask_array (mask_shape (1,1): 
05888                                                       mask_shape (2,1), 
05889                                                       mask_shape (1,2): 
05890                                                       mask_shape (2,2), 
05891                                                       mask_shape (1,3): 
05892                                                       mask_shape (2,3))
05893        Logical,           Intent (In)  :: mask_available
05894        Real,              Intent (In)  :: tol
05895        Integer,           Intent (Out) :: neighbors_3d (ndim_3d, nloc, num_neigh)
05896        Integer,           Intent (Out) :: ierror
05897     End Subroutine
05898 !
05899     subroutine psmile_print_3d_coord_real (x, y, z, shape,     &
05900                                            ind, nloc, message)
05901        Use PSMILe_common
05902 
05903        Integer, Intent (In)            :: shape (2, ndim_3d)
05904        Real, Intent (In)               :: x (*), y (*), z (*)
05905        Integer, Intent(In)             :: nloc
05906        Integer, Intent(In)             :: ind (ndim_3d, nloc)
05907        Character (len=*), Intent(In)   :: message
05908     End Subroutine
05909 !
05910     subroutine psmile_print_3d_reg_coord_real (x, y, z, shape,     &
05911                                                ind, nloc, message)
05912        Use PSMILe_common
05913 
05914        Integer, Intent (In)            :: shape (2, ndim_3d)
05915        Real, Intent (In)               :: x (*), y (*), z (*)
05916        Integer, Intent(In)             :: nloc
05917        Integer, Intent(In)             :: ind (ndim_3d, nloc)
05918        Character (len=*), Intent(In)   :: message
05919     End Subroutine
05920 !
05921     subroutine psmile_print_irreg2_coord_real (x, y, z, shape,     &
05922                                                ind, nloc, message)
05923        Use PSMILe_common
05924 
05925        Integer, Intent (In)            :: shape (2, ndim_3d)
05926        Real, Intent (In)               :: x (*), y (*), z (*)
05927        Integer, Intent(In)             :: nloc
05928        Integer, Intent(In)             :: ind (ndim_3d, nloc)
05929        Character (len=*), Intent(In)   :: message
05930     End Subroutine
05931 
05932 !   Put / Get
05933 
05934 !!$    We cannot include an interface description here since this
05935 !!$      is overloaded wrt. data_array by the calling routine prism_put.
05936 !!$
05937 !!$    Subroutine PSMILe_Put_real ( field_id, julian_day, julian_sec, &
05938 !!$              julian_dayb, julian_secb, data_array, info, ierror )
05939 
05940 !!$       use PRISM, only : PSMILe_Time_Struct
05941 !!$
05942 !!$       Integer, Intent (In)                 :: field_id
05943 !!$
05944 !!$       Double Precision, Intent (In)        :: julian_day, julian_dayb(2)
05945 !!$       Double Precision, Intent (In)        :: julian_sec, julian_secb(2)
05946 !!$
05947 !!$       Real,    Intent (In)                 :: data_array(*)
05948 !!$       Integer, Intent (Out)                :: info, ierror
05949 !!$    End Subroutine
05950 
05951     subroutine psmile_put_field_real (field_id, task_id, data_array, len, &
05952                                       nbr_fields, ierror)
05953 
05954        Integer, Intent (In)          :: field_id
05955        Integer, Intent (In)          :: task_id
05956        Integer, Intent (In)          :: len, nbr_fields
05957        Real,    Intent (In)          :: data_array(*)
05958        Integer, Intent (Out)         :: ierror
05959     End Subroutine
05960 
05961     subroutine psmile_put_field_gauss2_real (data_array, data_shape, nbr_fields, &
05962                                           srcloc, nparts, nloc, npoints, &
05963                                           dest, tag, comm, ierror)
05964        Use PSMILe_common
05965 
05966        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
05967        Integer, Intent (In)          :: nparts
05968        Integer, Intent (In)          :: npoints (2, nparts)
05969        Integer, Intent (In)          :: data_shape (2, ndim_3d)
05970        Type (integer_vector), Intent (In) :: srcloc (2, nparts)
05971        Real,    Intent (In)          :: data_array (*)
05972        Integer, Intent (Out)         :: ierror
05973     End Subroutine
05974 
05975     subroutine psmile_put_field_21d_real (data_array, data_shape, nbr_fields, &
05976                                          srcloc, nparts, nloc, npoints, &
05977                                          dest, tag, comm, ierror)
05978        Use PSMILe_common
05979 
05980        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
05981        Integer, Intent (In)          :: nparts
05982        Integer, Intent (In)          :: npoints (ndim_3d, nparts)
05983        Integer, Intent (In)          :: data_shape (2, ndim_3d)
05984        Type (integer_vector), Intent (In) :: srcloc (ndim_3d, nparts)
05985        Real,    Intent (In)          :: data_array (*)
05986        Integer, Intent (Out)         :: ierror
05987     End Subroutine
05988 
05989     subroutine psmile_put_field_3d_real (data_array, data_shape, nbr_fields, &
05990                                          srcloc, nparts, nloc, npoints, &
05991                                          dest, tag, comm, ierror)
05992        Use PSMILe_common
05993 
05994        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
05995        Integer, Intent (In)          :: nparts
05996        Integer, Intent (In)          :: npoints (ndim_3d, nparts)
05997        Integer, Intent (In)          :: data_shape (2, ndim_3d)
05998        Type (integer_vector), Intent (In) :: srcloc (ndim_3d, nparts)
05999        Real,    Intent (In)          :: data_array (*)
06000        Integer, Intent (Out)         :: ierror
06001     End Subroutine
06002 
06003     subroutine psmile_put_irr_field_real (data_array, data_shape, nbr_fields,  &
06004                                           srcloc, npoints, srcars, nars, nloc, &
06005                                           dest, tag, comm, ierror)
06006        Use PSMILe_common
06007 
06008        Integer, Intent (In)          :: nars, nloc, npoints, nbr_fields
06009        Integer, Intent (In)          :: dest, tag, comm
06010        Integer, Intent (In)          :: data_shape (2, ndim_3d)
06011        Integer, Intent (In)          :: srcloc (ndim_3d, npoints)
06012        Integer, Intent (In)          :: srcars (2, ndim_3d, nars)
06013        Real,    Intent (In)          :: data_array (*)
06014        Integer, Intent (Out)         :: ierror
06015     End Subroutine
06016 
06017     subroutine psmile_get_field_real (field_id, data_array, len, &
06018                                       nbr_fields, ierror)
06019 
06020        Integer, Intent (In)          :: field_id
06021        Integer, Intent (In)          :: len, nbr_fields
06022        Real,    Intent (InOut)       :: data_array(*)
06023        Integer, Intent (Out)         :: ierror
06024     End Subroutine
06025 
06026     subroutine psmile_get_irr_field_real (data_array, data_shape, nbr_fields,  &
06027                                           dstijk, npoints, dstars, nars, nloc, &
06028                                           source, tag, comm, ierror)
06029        Use PSMILe_common
06030 
06031        Integer, Intent (In)          :: nars, nloc, npoints, nbr_fields
06032        Integer, Intent (In)          :: source, tag, comm
06033        Integer, Intent (In)          :: data_shape (2, ndim_3d)
06034        Integer, Intent (In)          :: dstijk (ndim_3d, npoints)
06035        Integer, Intent (In)          :: dstars (2, ndim_3d, nars)
06036        Real,    Intent (InOut)       :: data_array (*)
06037        Integer, Intent (Out)         :: ierror
06038     End Subroutine
06039 
06040 !   Utilities
06041 
06042     subroutine psmile_copy_subarray_2d_real (dest_vector, size, &
06043                darray, idlow, idhigh, jdlow, jdhigh, &
06044                        ibeg,  iend,   jbeg,  jend,   ierror)
06045        Use PSMILe_common
06046        Integer(kind=int64), Intent (In) :: size
06047        Integer, Intent (In)             :: idlow, idhigh, jdlow, jdhigh
06048        Integer, Intent (In)             :: ibeg,  iend,   jbeg,  jend
06049        Real, Intent (In)                :: darray (idlow:idhigh, jdlow:jdhigh)
06050        Real, Intent (Out)               :: dest_vector (size)
06051        Integer, Intent (Out)            :: ierror
06052     End Subroutine
06053 
06054     subroutine psmile_copy_subarray_3d_real (dest_vector, size, &
06055                darray, idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
06056                sub, ierror)
06057        Use PSMILe_common
06058 
06059        Integer(kind=int64), Intent (In)  :: size
06060        Integer,             Intent (In)  :: idlow, idhigh, jdlow, jdhigh, 
06061                                             kdlow, kdhigh
06062        Integer,             Intent (In)  :: sub (2, ndim_3d)
06063        Real,                Intent (In)  :: darray (idlow:idhigh, jdlow:jdhigh, 
06064                                                     kdlow:kdhigh)
06065        Real,                Intent (Out) :: dest_vector (size)
06066        Integer,             Intent (Out) :: ierror
06067     End Subroutine
06068 
06069 !
06070 !   ------ Routines for Double Precision ------------
06071 !
06072 
06073     subroutine psmile_add_nn_found_dble (search, extra_search,  &
06074                       index_sent, found, n_send,                &
06075                       index_found, distance, n_found, nb_extra, &
06076                       selected, sel_info, nrecv, ierror)
06077        Use PSMILe_common
06078 
06079        Integer,           Intent (InOut) :: nrecv
06080        Type (Enddef_search),      Intent (In)    :: search
06081        Type (Extra_search_info),  Intent (InOut) :: extra_search
06082        Type (Select_search_info), Intent (InOut) :: sel_info (nrecv)
06083        Integer,           Intent (In)    :: nb_extra, n_found, n_send
06084        Integer,           Intent (In)    :: index_sent  (n_send)
06085        Integer,           Intent (In)    :: found (n_send)
06086        Integer,           Intent (In)    :: index_found (n_found)
06087        Double Precision,  Intent (In)    :: distance (n_found)
06088        Integer,           Intent (InOut) :: selected (2, extra_search%n_extra)
06089        Integer,           Intent (Out)   :: ierror
06090     End Subroutine
06091 
06092     subroutine psmile_bbcells_1d_dble (array, shape, range, &
06093                                        corners, corner_shape, nbr_corners, &
06094                                        chmin, chmax, levdim, ierror)
06095        Integer,           Intent (In)  :: shape (2)
06096        Integer,           Intent (In)  :: range (2)
06097        Double Precision,  Intent (In)  :: array (shape(1):shape(2))
06098        Integer,           Intent (In)  :: corner_shape (2), nbr_corners
06099        Double Precision,  Intent (In)  :: corners (corner_shape(1):corner_shape(2), 
06100                                                    nbr_corners)
06101        Integer,           Intent (In)  :: levdim
06102        Double Precision,  Intent (Out) :: chmin (range(1)-1:range(2))
06103        Double Precision,  Intent (Out) :: chmax (range(1)-1:range(2))
06104        Integer,           Intent (Out) :: ierror
06105     End Subroutine
06106 
06107     subroutine psmile_bbcells_2d_dble (           &
06108                     coords, coords_shape, sub_range, &
06109                     corner_shape,                    &
06110                     chmin, chmax, midp, levdim,      &
06111                     period, ierror)
06112        Use psmile_common
06113        Integer,           Intent (In)  :: coords_shape  (2, ndim_2d)
06114        Integer,           Intent (In)  :: sub_range  (2, ndim_2d)
06115        Integer,           Intent (In)  :: corner_shape (2, ndim_2d)
06116        Double Precision,  Intent (In)  :: 
06117           coords(coords_shape(1,1):coords_shape(2,1), 
06118                  coords_shape(1,2):coords_shape(2,2))
06119        Integer,           Intent (In)  :: levdim (ndim_2d)
06120        Double Precision,  Intent (In)  :: period
06121        Double Precision,  Intent (Out) :: 
06122           chmin (sub_range(1,1)-1:sub_range(2,1), 
06123                  sub_range(1,2)-1:sub_range(2,2))
06124        Double Precision,  Intent (Out) :: 
06125           chmax (sub_range(1,1)-1:sub_range(2,1), 
06126                  sub_range(1,2)-1:sub_range(2,2))
06127        Double Precision,  Intent (Out) :: 
06128           midp  (sub_range(1,1)-1:sub_range(2,1), 
06129                  sub_range(1,2)-1:sub_range(2,2))
06130        Integer,           Intent (Out) :: ierror
06131     End Subroutine
06132 
06133     subroutine psmile_bbcells_virt_2d_dble (method_id,                &
06134                     coords1, coords2, coords_shape, coords_range,     &
06135                     corners1, corners2, corner_shape, nbr_corners,    &
06136                     chmin1_corner, chmin2_corner,                     &
06137                     chmax1_corner, chmax2_corner, levdim_corner,      &
06138                     chmin1,  chmin2, chmax1, chmax2, midp1, midp2,    &
06139                     levdim,  period, bmaski, bmaskj, ierror)
06140        Use PSMILe_common
06141        Integer,           Intent (In)  :: method_id, nbr_corners
06142        Integer,           Intent (In)  :: coords_shape (2, ndim_2d)
06143        Integer,           Intent (In)  :: coords_range (2, ndim_2d)
06144        Integer,           Intent (In)  :: corner_shape (2, ndim_2d)
06145        Integer,           Intent (In)  :: levdim_corner (2, ndim_2d)
06146        Integer,           Intent (In)  :: levdim (ndim_2d)
06147        Double Precision,  Intent (In)  :: period
06148        Double Precision,  Intent (InOut)  ::              
06149           coords1(coords_shape(1,1):coords_shape(2,1), 
06150                   coords_shape(1,2):coords_shape(2,2))
06151        Double Precision,  Intent (InOut)  ::              
06152           coords2(coords_shape(1,1):coords_shape(2,1), 
06153                   coords_shape(1,2):coords_shape(2,2))
06154        Double Precision,  Intent (In)  :: 
06155           corners1 (corner_shape(1,1):corner_shape(2,1), 
06156                     corner_shape(1,2):corner_shape(2,2), 
06157                     nbr_corners)
06158        Double Precision,  Intent (In)  :: 
06159           corners2 (corner_shape(1,1):corner_shape(2,1), 
06160                     corner_shape(1,2):corner_shape(2,2), 
06161                     nbr_corners)
06162        Double Precision,  Intent (In)  :: 
06163           chmin1_corner (levdim_corner(1,1):levdim_corner(2,1), 
06164                          levdim_corner(1,2):levdim_corner(2,2))
06165        Double Precision,  Intent (In)  :: 
06166           chmin2_corner (levdim_corner(1,1):levdim_corner(2,1), 
06167                          levdim_corner(1,2):levdim_corner(2,2))
06168        Double Precision,  Intent (In)  :: 
06169           chmax1_corner (levdim_corner(1,1):levdim_corner(2,1), 
06170                          levdim_corner(1,2):levdim_corner(2,2))
06171        Double Precision,  Intent (In)  :: 
06172           chmax2_corner (levdim_corner(1,1):levdim_corner(2,1), 
06173                          levdim_corner(1,2):levdim_corner(2,2))
06174        Double Precision, Intent (InOut) :: 
06175           chmin1 (coords_range(1,1)-1:coords_range(2,1), 
06176                   coords_range(1,2)-1:coords_range(2,2))
06177        Double Precision,  Intent (InOut) :: 
06178           chmin2 (coords_range(1,1)-1:coords_range(2,1), 
06179                   coords_range(1,2)-1:coords_range(2,2))
06180        Double Precision, Intent (InOut) :: 
06181           chmax1 (coords_range(1,1)-1:coords_range(2,1), 
06182                   coords_range(1,2)-1:coords_range(2,2))
06183        Double Precision, Intent (InOut) :: 
06184           chmax2 (coords_range(1,1)-1:coords_range(2,1), 
06185                   coords_range(1,2)-1:coords_range(2,2))
06186        Double Precision, Intent (InOut) :: 
06187           midp1  (coords_range(1,1)-1:coords_range(2,1), 
06188                   coords_range(1,2)-1:coords_range(2,2))
06189        Double Precision, Intent (InOut) :: 
06190           midp2  (coords_range(1,1)-1:coords_range(2,1), 
06191                   coords_range(1,2)-1:coords_range(2,2))
06192        Integer,           Intent (Out) :: 
06193           bmaski (coords_range(1,1)-1:coords_range(2,1)+1, 2)
06194        Integer,           Intent (Out) :: 
06195           bmaskj (coords_range(1,2)-1:coords_range(2,2)+1, 2)
06196        Integer,           Intent (Out) :: ierror
06197     End Subroutine
06198 
06199     subroutine psmile_bbcells_3d_dble (method_id, array, shape, range,     &
06200                                        corners, corner_shape, nbr_corners, &
06201                                        chmin, chmax, midp,                 &
06202                                        levdim, cyclic, period, ierror)
06203        Use PSMILe_common
06204        Integer,           Intent (In)  :: method_id
06205        Integer,           Intent (In)  :: shape (2, ndim_3d)
06206        Integer,           Intent (In)  :: range (2, ndim_3d)
06207        Integer,           Intent (In)  :: corner_shape (2, ndim_3d), nbr_corners
06208        Double Precision,  Intent (In)  :: array(shape(1,1):shape(2,1), 
06209                                                 shape(1,2):shape(2,2), 
06210                                                 shape(1,3):shape(2,3))
06211        Double Precision,  Intent (In)  :: corners (corner_shape(1,1): 
06212                                                    corner_shape(2,1), 
06213                                                    corner_shape(1,2): 
06214                                                    corner_shape(2,2), 
06215                                                    corner_shape(1,3): 
06216                                                    corner_shape(2,3), 
06217                                                    nbr_corners)
06218        Integer,           Intent (In)  :: levdim (ndim_3d)
06219        Logical,           Intent (In)  :: cyclic
06220        Double Precision,  Intent (In)  :: period
06221        Double Precision,  Intent (Out) :: chmin (range(1,1)-1:range(2,1), 
06222                                                  range(1,2)-1:range(2,2), 
06223                                                  range(1,3)-1:range(2,3))
06224        Double Precision,  Intent (Out) :: chmax (range(1,1)-1:range(2,1), 
06225                                                  range(1,2)-1:range(2,2), 
06226                                                  range(1,3)-1:range(2,3))
06227        Double Precision,  Intent (Out) :: midp  (range(1,1)-1:range(2,1), 
06228                                                  range(1,2)-1:range(2,2), 
06229                                                  range(1,3)-1:range(2,3))
06230        Integer,           Intent (Out) :: ierror
06231     End Subroutine
06232 
06233     subroutine psmile_bbcells_gauss2_dble (array_x, array_y,          &
06234                                            shape, range, nbr_lats,    &
06235                                            points_per_lat, corners_y, &
06236                                            corner_shape, nbr_corners, &
06237                                            chmin_x, chmax_x, midp_x,  &
06238                                            chmin_y, chmax_y, midp_y,  &
06239                                            nbrs, levdim, ierror )
06240 
06241       Integer, Intent (In)             :: shape (2)
06242       Double Precision, Intent (In)    :: array_x(shape(1):shape(2))
06243       Double Precision, Intent (In)    :: array_y(shape(1):shape(2))
06244       Integer, Intent (In)             :: range (2)
06245       Integer, Intent (In)             :: corner_shape (2)
06246       Integer, Intent (In)             :: nbr_lats
06247       Integer, Intent (In)             :: points_per_lat(nbr_lats,1)
06248       Integer, Intent (In)             :: nbr_corners
06249       Double Precision, Intent (In)    :: corners_y (corner_shape(1):corner_shape(2), 
06250                                                      nbr_corners)
06251       Integer, Intent (In)             :: levdim(1)
06252       Double Precision, Intent (Out)   :: chmin_x (range(1)-1:range(2))
06253       Double Precision, Intent (Out)   :: chmax_x (range(1)-1:range(2))
06254       Double Precision, Intent (Out)   :: midp_x  (range(1)-1:range(2))
06255       Double Precision, Intent (Out)   :: chmin_y (range(1)-1:range(2))
06256       Double Precision, Intent (Out)   :: chmax_y (range(1)-1:range(2))
06257       Double Precision, Intent (Out)   :: midp_y  (range(1)-1:range(2))
06258       Integer, Intent (Out)            :: nbrs    (range(2)-range(1)+1,4)
06259       Integer, Intent (Out)            :: ierror
06260     End Subroutine
06261 
06262     subroutine psmile_celltest_dble ( grid_id, range, sense, ierror )
06263       Use PSMILe_common
06264       Integer, Intent (In)             :: grid_id
06265       Integer, Intent (In)             :: range(2,ndim_2d)
06266       Integer, Intent (Out)            :: sense
06267       Integer, Intent (Out)            :: ierror
06268     End Subroutine
06269 
06270     subroutine psmile_ccompact_gauss2_dble ( send_info,     &
06271                grid_valid_shape, shape, nb_corners,         &
06272                array_x, array_y, array_z,                   &
06273                extra_search, dest_size, nbr_cells_tot,      &
06274                source_cell_index,                           &
06275                neighcells, dest_x, dest_y, dest_z, ierror )
06276 
06277        USE PSMILe_Common
06278 
06279        Type (Send_information), Intent (InOut)  :: send_info
06280        Integer, Intent (In)                     :: grid_valid_shape (2, ndim_3d)
06281        Integer, Intent (In)                     :: shape (2, ndim_3d)
06282        Integer, Intent (In)                     :: nb_corners
06283        Double Precision, Intent (In)            :: array_x ( shape(1,1):shape(2,1), 
06284                                                              nb_corners )
06285        Double Precision, Intent (In)            :: array_y ( shape(1,1):shape(2,1), 
06286                                                              nb_corners )
06287        Double Precision, Intent (In)            :: array_z ( shape(1,3):shape(2,3) )
06288        Integer, Intent (In)                     :: dest_size
06289        Integer, Intent (In)                     :: nbr_cells_tot
06290        Type (Extra_search_info), Intent (InOut) :: extra_search
06291        Integer, Intent (InOut)                  :: source_cell_index (nbr_cells_tot)
06292        Integer, Intent (InOut)                  :: neighcells (nbr_cells_tot, nb_corners)
06293        Double Precision, Intent (Out)           :: dest_x (2*dest_size)
06294        Double Precision, Intent (Out)           :: dest_y (2*dest_size)
06295        Double Precision, Intent (Out)           :: dest_z (2*dest_size)
06296        Integer, Intent (Out)                    :: ierror
06297     End Subroutine
06298 
06299     subroutine psmile_ccompact_irreg2_dble ( send_info,     &
06300                grid_valid_shape, shape, nb_corners,         &
06301                array_x, array_y, array_z,                   &
06302                extra_search, dest_size, nbr_cells_tot,      &
06303                source_cell_index,                           &
06304                neighcells, dest_x, dest_y, dest_z, ierror )
06305 
06306        USE PSMILe_Common
06307 
06308        Type (Send_information), Intent (InOut)  :: send_info
06309        Type (Extra_search_info), Intent (InOut) :: extra_search
06310 
06311        Integer, Intent (In)                     :: grid_valid_shape (2, ndim_3d)
06312        Integer, Intent (In)                     :: shape (2, ndim_3d)
06313        Integer, Intent (In)                     :: nb_corners
06314        Double Precision, Intent (In)            :: array_x ( shape(1,1):shape(2,1), 
06315                                                              shape(1,2):shape(2,2), 
06316                                                              nb_corners )
06317        Double Precision, Intent (In)            :: array_y ( shape(1,1):shape(2,1), 
06318                                                              shape(1,2):shape(2,2), 
06319                                                              nb_corners )
06320        Double Precision, Intent (In)            :: array_z ( shape(1,3):shape(2,3) )
06321        Integer, Intent (In)                     :: dest_size
06322        Integer, Intent (In)                     :: nbr_cells_tot
06323        Integer, Intent (InOut)                  :: source_cell_index (nbr_cells_tot)
06324        Integer, Intent (InOut)                  :: neighcells(nbr_cells_tot, nb_corners)
06325        Double Precision, Intent (Out)           :: dest_x (dest_size)
06326        Double Precision, Intent (Out)           :: dest_y (dest_size)
06327        Double Precision, Intent (Out)           :: dest_z (dest_size)
06328        Integer, Intent (Out)                    :: ierror
06329     End Subroutine
06330 
06331     subroutine psmile_ccompact_3d_reg_dble ( send_info,     &
06332                grid_valid_shape, shape, nb_corners,         &
06333                array_x, array_y, array_z,                   &
06334                extra_search, dest_size, nbr_cells_tot,      &
06335                source_cell_index,                           &
06336                neighcells, dest_x, dest_y, dest_z, ierror )
06337 
06338        USE PSMILe_Common
06339 
06340        Type (Send_information), Intent (InOut)  :: send_info
06341        Integer, Intent (In)                     :: grid_valid_shape (2, ndim_3d)
06342        Integer, Intent (In)                     :: shape (2, ndim_3d)
06343        Integer, Intent (In)                     :: nb_corners
06344        Double Precision, Intent (In)            :: array_x ( shape(1,1):shape(2,1), 
06345                                                              nb_corners )
06346        Double Precision, Intent (In)            :: array_y ( shape(1,2):shape(2,2), 
06347                                                              nb_corners )
06348        Double Precision, Intent (In)            :: array_z ( shape(1,3):shape(2,3) )
06349        Type (Extra_search_info), Intent (InOut) :: extra_search
06350        Integer, Intent (In)                     :: dest_size
06351        Integer, Intent (In)                     :: nbr_cells_tot
06352        Integer, Intent (InOut)                  :: source_cell_index (nbr_cells_tot)
06353        Double Precision, Intent (Out)           :: dest_x (dest_size)
06354        Double Precision, Intent (Out)           :: dest_y (dest_size)
06355        Double Precision, Intent (Out)           :: dest_z (dest_size)
06356        Integer, Intent (InOut)                  :: neighcells (nbr_cells_tot, nb_corners)
06357        Integer, Intent (Out)                    :: ierror
06358     End Subroutine
06359 
06360     subroutine psmile_control_cell_2d_dble (grid_id,               &
06361                     ic, nc, icdim1, list, j, k,                    &
06362                     coords1,  coords2,  shape,                     &
06363                     corners1, corners2, corner_shape, nbr_corners, &
06364                     tol, fnd, ierror)
06365       Use PSMILe_common
06366 
06367       Integer,          Intent (In)   :: grid_id, nc, icdim1
06368       Integer,          Intent (In)   :: ic (icdim1, ndim_2d)
06369       Integer,          Intent (In)   :: list (nc), j, k
06370       Integer,          Intent (In)   :: shape (2, ndim_3d)
06371       Double Precision, Intent (In)   :: coords1 (shape(1,1):shape(2,1), 
06372                                                   shape(1,2):shape(2,2), 
06373                                                   shape(1,3):shape(2,3))
06374       Double Precision, Intent (In)   :: coords2 (shape(1,1):shape(2,1), 
06375                                                   shape(1,2):shape(2,2), 
06376                                                   shape(1,3):shape(2,3))
06377       Integer,          Intent (In)   :: corner_shape (2, ndim_2d)
06378       Integer,          Intent (In)   :: nbr_corners
06379       Double Precision, Intent (In)   ::                 
06380          corners1 ( corner_shape(1,1):corner_shape(2,1), 
06381                     corner_shape(1,2):corner_shape(2,2), nbr_corners)
06382       Double Precision, Intent (In)   ::                 
06383          corners2 ( corner_shape(1,1):corner_shape(2,1), 
06384                     corner_shape(1,2):corner_shape(2,2), nbr_corners)
06385       Double Precision, Intent (In)   :: tol
06386       Logical,          Intent (Out)  :: fnd (nc)
06387       Integer,          Intent (Out)  :: ierror
06388     End Subroutine
06389 
06390     subroutine psmile_ext_compact_irreg2_dble (send_info, array, shape, &
06391                                                grid_valid_shape,        &
06392                                                dest_vector, dest_size, ierror)
06393        Use PSMILe_common
06394        Type(Send_information), Intent(InOut) :: send_info
06395        Double Precision, Intent (In)         :: array (*)
06396        Integer, Intent (In)                  :: shape (2, ndim_2d)
06397        Integer, Intent (In)                  :: grid_valid_shape (2, ndim_3d)
06398        Integer, Intent (In)                  :: dest_size
06399        Double Precision, Intent (Out)        :: dest_vector (dest_size)
06400        Integer, Intent (Out)                 :: ierror
06401     End Subroutine
06402 
06403     subroutine psmile_ext_compact_list_3d_dble (send_info, array, shape, &
06404                                                 grid_valid_shape,        &
06405                                                 dest_vector, dest_size, ierror)
06406        Use PSMILe_common
06407        Type(Send_information), Intent(In) :: send_info
06408        Double Precision, Intent (In)      :: array (*)
06409        Integer, Intent (In)               :: shape (2, ndim_3d)
06410        Integer, Intent (In)               :: grid_valid_shape (2, ndim_3d)
06411        Integer, Intent (In)               :: dest_size
06412        Double Precision, Intent (Out)     :: dest_vector (dest_size)
06413        Integer, Intent (Out)              :: ierror
06414     End Subroutine
06415 
06416     subroutine psmile_put_compact_list_3d_dble (source_list, dstijk, nloc, &
06417                                                 array, shape, nbr_fields,  &
06418                                                 ierror)
06419        Use PSMILe_common
06420        Double Precision, Intent (InOut)   :: array (*)
06421        Integer, Intent (In)               :: shape (2, ndim_3d)
06422        Integer, Intent (In)               :: nloc, nbr_fields
06423        Integer, Intent (In)               :: dstijk (ndim_3d, nbr_fields)
06424        Double Precision, Intent (In)      :: source_list (nloc, nbr_fields)
06425        Integer, Intent (Out)              :: ierror
06426     End Subroutine
06427 
06428     subroutine psmile_extract_indices_2d_dble (array, shape, &
06429                                                dstijk, ncpl, &
06430                                                dest_vector, ierror)
06431        Use PSMILe_common
06432        Double Precision, Intent (In)      :: array (*)
06433        Integer, Intent (In)               :: shape (2, ndim_2d)
06434        Integer, Intent (In)               :: ncpl
06435        Integer, Intent (In)               :: dstijk (ndim_3d, ncpl)
06436        Double Precision, Intent (Out)     :: dest_vector (ncpl)
06437        Integer, Intent (Out)              :: ierror
06438     End Subroutine
06439 
06440     subroutine psmile_extract_indices_3d_dble (array, shape, &
06441                                                dstijk, ncpl, &
06442                                                dest_vector, ierror)
06443        Use PSMILe_common
06444        Double Precision, Intent (In)      :: array (*)
06445        Integer, Intent (In)               :: shape (2, ndim_3d)
06446        Integer, Intent (In)               :: ncpl
06447        Integer, Intent (In)               :: dstijk (ndim_3d, ncpl)
06448        Double Precision, Intent (Out)     :: dest_vector (ncpl)
06449        Integer, Intent (Out)              :: ierror
06450     End Subroutine
06451 
06452     subroutine psmile_gauss_setup_dble (grid_id, counts, displs, ierror)
06453       Integer, Intent (In)                :: grid_id
06454       Integer, Intent (In)                :: counts (*)
06455       Integer, Intent (In)                :: displs (*)
06456 !
06457       Integer, Intent (Out)               :: ierror
06458     End Subroutine PSMILe_gauss_setup_dble
06459 
06460     subroutine psmile_extent_subgrid_1d_dble (           &
06461                     array, idlow, idhigh, nbr_corners,   &
06462                            ibeg,  iend,                  &
06463                     extent, ierror)
06464        Integer, Intent (In)            :: idlow, idhigh, nbr_corners
06465        Integer, Intent (In)            :: ibeg, iend
06466        Double Precision, Intent (In)   :: array (idlow:idhigh, nbr_corners)
06467        Double Precision, Intent (Out)  :: extent (2)
06468        Integer, Intent (Out)           :: ierror
06469     End Subroutine
06470 
06471     subroutine psmile_extent_subgrid_2d_dble (           &
06472                     array, idlow, idhigh, jdlow, jdhigh, nbr_corners,   &
06473                            ibeg,  iend,   jbeg,  jend,                  &
06474                     extent, ierror)
06475        Integer, Intent (In)            :: idlow, idhigh
06476        Integer, Intent (In)            :: jdlow, jdhigh, nbr_corners
06477        Integer, Intent (In)            :: ibeg, iend, jbeg, jend
06478        Double Precision, Intent (In)   :: array (idlow:idhigh,          
06479                                                  jdlow:jdhigh, nbr_corners)
06480        Double Precision, Intent (Out)  :: extent (2)
06481        Integer, Intent (Out)           :: ierror
06482     End Subroutine
06483 
06484     subroutine psmile_extent_subgrid_3d_dble (           &
06485                     array, idlow, idhigh, jdlow, jdhigh, &
06486                            kdlow, kdhigh, nbr_corners,   &
06487                            grid_shape,                   &
06488                     extent, ierror)
06489        Use PSMILe_common
06490        Integer, Intent (In)            :: idlow, idhigh
06491        Integer, Intent (In)            :: jdlow, jdhigh
06492        Integer, Intent (In)            :: kdlow, kdhigh, nbr_corners
06493        Double Precision, Intent (In)   :: array (idlow:idhigh, jdlow:jdhigh, 
06494                                                  kdlow:kdhigh, nbr_corners)
06495        Integer, Intent (In)            :: grid_shape (2, ndim_3d)
06496        Double Precision, Intent (Out)  :: extent (2)
06497        Integer, Intent (Out)           :: ierror
06498     End Subroutine
06499 
06500     subroutine psmile_generate_1d_3d_dble (            &
06501                     vector1, vector2, vector3, shape,  &
06502                     dest_array, dest_shape,            &
06503                     grid_valid_shape, ierror)
06504        Use PSMILe_common
06505 
06506        Double Precision, Intent (In)   :: vector1 (*)
06507        Double Precision, Intent (In)   :: vector2 (*)
06508        Double Precision, Intent (In)   :: vector3 (*)
06509        Integer,          Intent (In)   :: shape (2, ndim_3d)
06510        Integer,          Intent (In)   :: dest_shape (2, ndim_3d)
06511        Double Precision, Intent (Out)  :: dest_array ( 
06512                                              dest_shape(1,1):dest_shape(2,1), 
06513                                              dest_shape(1,2):dest_shape(2,2), 
06514                                              dest_shape(1,3):dest_shape(2,3))
06515        Integer,          Intent (In)   :: grid_valid_shape (2, ndim_3d)
06516        Integer,          Intent (Out)  :: ierror
06517     End Subroutine
06518 
06519     subroutine psmile_get_cyclic_dir_3d_dble (                 &
06520                            chmin, chmin2, chmin3,              &
06521                            chmax, chmax2, chmax3, levdim,      &
06522                            corners, corners2, corners3,        &
06523                            corner_shape, nbr_corners,          &
06524                            grid_valid_shape,                   &
06525                            len_cyclic, rtol, index, cyclic, ierror)
06526        Use PSMILe_common
06527 
06528        Double Precision, Intent (In)   :: chmin (*)
06529        Double Precision, Intent (In)   :: chmax (*)
06530        Double Precision, Intent (In)   :: chmin2 (*)
06531        Double Precision, Intent (In)   :: chmax2 (*)
06532        Double Precision, Intent (In)   :: chmin3 (*)
06533        Double Precision, Intent (In)   :: chmax3 (*)
06534        Integer, Intent (In)            :: levdim (ndim_3d)
06535        Double Precision, Intent (In)   :: corners (*)
06536        Double Precision, Intent (In)   :: corners2 (*)
06537        Double Precision, Intent (In)   :: corners3 (*)
06538        Integer, Intent (In)            :: corner_shape (2, ndim_3d)
06539        Integer, Intent (In)            :: nbr_corners
06540        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
06541        Double Precision, Intent (In)   :: len_cyclic, rtol
06542        Integer, Intent (In)            :: index
06543        Logical, Intent (Out)           :: cyclic
06544        Integer, Intent (Out)           :: ierror
06545     End Subroutine
06546 
06547     subroutine psmile_get_faces_3d_dble (search, extra_search,     &
06548                     corners1, corners2, corners3,                  &
06549                     corner_shape, nbr_corners, grid_valid_shape,   &
06550                     neighbors_3d, nloc, num_neigh,                 &
06551                     faces, n_faces, nreq, ierror)
06552        Use PSMILe_common
06553 
06554        Type (Enddef_search),     Intent (In)  :: search
06555        Type (Extra_search_info), Intent (In)  :: extra_search
06556        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
06557        Integer,                  Intent (In)  :: nreq
06558        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
06559        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
06560        Double Precision,         Intent (In)  :: 
06561           corners1 ( corner_shape(1,1):corner_shape(2,1), 
06562                      corner_shape(1,2):corner_shape(2,2), 
06563                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
06564        Double Precision,         Intent (In)  :: 
06565           corners2 ( corner_shape(1,1):corner_shape(2,1), 
06566                      corner_shape(1,2):corner_shape(2,2), 
06567                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
06568        Double Precision,         Intent (In)  :: 
06569           corners3 ( corner_shape(1,1):corner_shape(2,1), 
06570                      corner_shape(1,2):corner_shape(2,2), 
06571                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
06572        Integer,                  Intent (In)  :: 
06573           neighbors_3d (ndim_3d, nloc, num_neigh)
06574 !
06575        Double Precision,         Intent (Out) :: faces (2, ndim_3d, nreq)
06576        Integer,                  Intent (Out) :: n_faces (nreq)
06577        Integer,                  Intent (Out) :: ierror
06578     End Subroutine
06579 
06580     subroutine psmile_get_faces_3d_reg_dble (search, extra_search, &
06581                     corners1, corners2, corners3,                  &
06582                     corner_shape, nbr_corners, grid_valid_shape,   &
06583                     neighbors_3d, nloc, num_neigh,                 &
06584                     faces, n_faces, nreq, ierror)
06585        Use PSMILe_common
06586 
06587        Type (Enddef_search),     Intent (In)  :: search
06588        Type (Extra_search_info), Intent (In)  :: extra_search
06589        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
06590        Integer,                  Intent (In)  :: nreq
06591        Integer,                  Intent (In)  :: corner_shape (2, ndim_3d)
06592        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
06593        Double Precision,         Intent (In)  :: 
06594           corners1 ( corner_shape(1,1):corner_shape(2,1), 2)
06595        Double Precision,         Intent (In)  :: 
06596           corners2 ( corner_shape(1,2):corner_shape(2,2), 2)
06597        Double Precision,         Intent (In)  :: 
06598           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
06599        Integer,                  Intent (In)  :: 
06600           neighbors_3d (ndim_3d, nloc, num_neigh)
06601 !
06602        Double Precision,         Intent (Out) :: faces (2, ndim_3d, nreq)
06603        Integer,                  Intent (Out) :: n_faces (nreq)
06604        Integer,                  Intent (Out) :: ierror
06605     End Subroutine
06606 
06607     subroutine psmile_get_faces_gauss2_dble (search, extra_search, &
06608                     corners1, corners2, corners3,                  &
06609                     corner_shape, nbr_corners, grid_valid_shape,   &
06610                     neighbors_3d, nloc, num_neigh,                 &
06611                     faces, nreq, ierror)
06612 
06613        Use PSMILe_common
06614 
06615        Type (Enddef_search),     Intent (In)  :: search
06616        Type (Extra_search_info), Intent (In)  :: extra_search
06617        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
06618        Integer,                  Intent (In)  :: nreq
06619        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
06620        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
06621        Double Precision,         Intent (In)  :: 
06622           corners1 ( corner_shape(1,1):corner_shape(2,1), 2 )
06623        Double Precision,         Intent (In)  :: 
06624           corners2 ( corner_shape(1,1):corner_shape(2,1), 2 )
06625        Double Precision,         Intent (In)  :: 
06626           corners3 ( corner_shape(1,3):corner_shape(2,3), 2 )
06627        Integer,                  Intent (In)  :: 
06628           neighbors_3d (ndim_3d, nloc, num_neigh)
06629 !
06630        Double Precision,         Intent (Out) :: faces (2, ndim_3d, nreq)
06631        Integer,                  Intent (Out) :: ierror
06632     End Subroutine
06633 
06634     subroutine psmile_get_faces_irreg2_dble (search, extra_search, &
06635                     corners1, corners2, corners3,                  &
06636                     corner_shape, nbr_corners, grid_valid_shape,   &
06637                     neighbors_3d, nloc, num_neigh,                 &
06638                     faces, n_faces, nreq, ierror)
06639        Use PSMILe_common
06640 
06641        Type (Enddef_search),     Intent (In)  :: search
06642        Type (Extra_search_info), Intent (In)  :: extra_search
06643        Integer,                  Intent (In)  :: nbr_corners, nloc, num_neigh
06644        Integer,                  Intent (In)  :: nreq
06645        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
06646        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
06647        Double Precision,         Intent (In)  :: 
06648           corners1 ( corner_shape(1,1):corner_shape(2,1), 
06649                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
06650        Double Precision,         Intent (In)  :: 
06651           corners2 ( corner_shape(1,1):corner_shape(2,1), 
06652                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
06653        Double Precision,         Intent (In)  :: 
06654           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
06655        Integer,                  Intent (In)  :: 
06656           neighbors_3d (ndim_3d, nloc, num_neigh)
06657 !
06658        Double Precision,         Intent (Out) :: faces (2, ndim_3d, nreq)
06659        Integer,                  Intent (Out) :: n_faces (nreq)
06660        Integer,                  Intent (Out) :: ierror
06661     End Subroutine
06662 
06663     subroutine psmile_get_grid_extent_dble (grid_id, extent, ierror)
06664        Use PSMILe_common
06665        Integer,                  Intent (In)   :: grid_id
06666        Real (PSMILe_float_kind), Intent (Out)  :: extent (2, ndim_3d)
06667        Integer,                  Intent (Out)  :: ierror
06668     End Subroutine
06669 
06670     subroutine psmile_global_search_dble (comp_info,             &
06671                     control, len_cpl, var_id, grid_valid_shape,  &
06672                     search, tgt_coords,                          &
06673                     neighbors_3d, nloc, num_neigh, extra_search, &
06674                     interpolation_methods, interpolation_search, n_intmethods, &
06675                     send_index,                                  &
06676                     mask_available, use_mask, use_how,           &
06677                     grid_type, ierror)
06678        Use PSMILe_common
06679 
06680        Type (Enddef_comp),   Intent (In)    :: comp_info
06681        Type (Enddef_search), Intent (InOut) :: search
06682        Type (dble_vector),   Intent (In)    :: tgt_coords (ndim_3d)
06683        Integer,              Intent (In)    :: control (2, ndim_3d, 
06684                                                search%search_data%npart)
06685        Integer,              Intent (In)    :: len_cpl (search%search_data%npart)
06686        Integer,              Intent (In)    :: var_id
06687        Integer,              Intent (In)    :: grid_valid_shape (2, ndim_3d)
06688        Integer,              Intent (In)    :: send_index
06689        Integer,              Intent (In)    :: nloc, num_neigh
06690        Integer,              Intent (In)    :: n_intmethods
06691        Integer,              Intent (In)    :: interpolation_methods (n_intmethods)
06692        Logical,              Intent (In)    :: interpolation_search  (n_intmethods)
06693        Logical,              Intent (In)    :: mask_available, use_mask
06694        Integer,              Intent (In)    :: use_how
06695        Integer,              Intent (In)    :: grid_type
06696        Integer,              Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
06697                                                              num_neigh)
06698        Type (Extra_search_info), Intent (InOut) :: extra_search
06699        Integer,              Intent (Out)   :: ierror
06700     End Subroutine
06701 
06702     subroutine psmile_global_search_cell_dble ( grid_id, var_id,    &
06703                   comp_info, send_info, search, extra_search, ncpl, &
06704                   nbr_cells, n_intmethods, interpolation_methods,   &
06705                   interpolation_search, ierror )
06706        Use PSMILe_common
06707 
06708        Integer,                  Intent (In)    :: grid_id
06709        Integer,                  Intent (In)    :: var_id
06710        Type (Enddef_comp),       Intent (In)    :: comp_info
06711        Type (Send_information),  Intent (InOut) :: send_info
06712        Type (Enddef_search),     Intent (InOut) :: search
06713        Type (Extra_search_info), Intent (InOut) :: extra_search
06714        Integer,                  Intent (In)    :: ncpl
06715        Integer,                  Intent (InOut) :: nbr_cells(ncpl)
06716        Integer,                  Intent (In)    :: n_intmethods
06717        Integer,                  Intent (In)    :: interpolation_methods (n_intmethods)
06718        Logical,                  Intent (In)    :: interpolation_search  (n_intmethods)
06719        Integer,                  Intent (Out)   :: ierror
06720     End Subroutine
06721 
06722     subroutine psmile_global_search_nnx_dble (comp_info,         &
06723                     search, var_id,                              &
06724                     tgt_coords_x, tgt_coords_y, tgt_coords_z,    &
06725                     neighbors_3d, nloc, num_neigh, nb_extra,     &
06726                     extra_search, send_index,                    &
06727                     ierror)
06728        Use PSMILe_common
06729 
06730        Type (Enddef_comp),   Intent (In)    :: comp_info
06731        Type (Enddef_search), Intent (InOut) :: search
06732        Integer,              Intent (In)    :: var_id
06733        Integer,              Intent (In)    :: send_index
06734        Integer,              Intent (In)    :: nb_extra, nloc, num_neigh
06735        Double Precision,     Intent (In)    :: tgt_coords_x (nloc)
06736        Double Precision,     Intent (In)    :: tgt_coords_y (nloc)
06737        Double Precision,     Intent (In)    :: tgt_coords_z (nloc)
06738        Integer,              Intent (InOut) :: neighbors_3d (ndim_3d, nloc, 
06739                                                              num_neigh)
06740        Type (Extra_search_info), Intent (InOut) :: extra_search
06741        Integer,              Intent (Out)   :: ierror
06742     End Subroutine
06743 
06744     subroutine psmile_return_extra_off_dble (comp_info, search, var_id, &
06745                       found, distance, nd_dist, nb_extra, ierror)
06746        Use PSMILe_common
06747 
06748        Type (Enddef_comp),          Intent (In)    :: comp_info
06749        Type (Enddef_global_search), Intent (InOut) :: search
06750        Integer,                     Intent (In)    :: var_id
06751        Integer,                     Intent (In)    :: nd_dist, nb_extra
06752        Integer,                     Intent (In)    :: found (nd_dist)
06753        Double Precision,            Intent (In)    :: distance (nd_dist, 
06754                                                                 nb_extra)
06755        Integer,                     Intent (Out)   :: ierror
06756     End Subroutine
06757 
06758     subroutine psmile_sel_grid_range_dble (grid_id, dinter, inter, ierror)
06759        Use PSMILe_common
06760        Integer,                  Intent (In)  :: grid_id
06761        Real (PSMILe_float_kind), Intent (In)  :: dinter (2, ndim_3d)
06762        Integer,                  Intent (Out) ::  inter (2, ndim_3d)
06763        Integer,                  Intent (Out) :: ierror
06764     End Subroutine
06765 
06766     subroutine psmile_range_subgrid_1d_dble (            &
06767                     array, idlow, idhigh, nbr_corners,   &
06768                            ibeg,  iend,                  &
06769                     extent, inter, ierror)
06770        Integer, Intent (In)            :: idlow, idhigh, nbr_corners
06771        Integer, Intent (In)            :: ibeg, iend
06772        Double Precision, Intent (In)   :: array (idlow:idhigh, nbr_corners)
06773        Double Precision, Intent (In)   :: extent (2)
06774        Integer, Intent (Out)           :: inter (2)
06775        Integer, Intent (Out)           :: ierror
06776     End Subroutine
06777 
06778     subroutine psmile_range_subgrid_2d_dble (                  &
06779                     array1, array2,                            &
06780                     idlow, idhigh, jdlow, jdhigh, nbr_corners, &
06781                     ibeg,  iend,   jbeg,  jend,                &
06782                     extent, inter, ierror)
06783        Integer,          Intent (In)   :: idlow, idhigh
06784        Integer,          Intent (In)   :: jdlow, jdhigh, nbr_corners
06785        Integer,          Intent (In)   :: ibeg, iend, jbeg, jend
06786        Double Precision, Intent (In)   :: 
06787           array1 (idlow:idhigh, jdlow:jdhigh, nbr_corners)
06788        Double Precision, Intent (In)   :: 
06789           array2 (idlow:idhigh, jdlow:jdhigh, nbr_corners)
06790        Double Precision, Intent (In)   :: extent (2,2)
06791 !
06792        Integer,          Intent (Out)  :: inter  (2,2)
06793        Integer,          Intent (Out)  :: ierror
06794     End Subroutine
06795 
06796     subroutine psmile_range_subgrid_3d_dble (                    &
06797                     array1, array2, array3,                      &
06798                     idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
06799                     nbr_corners, grid_shape, rinter, inter, ierror)
06800        Use PSMILe_common
06801        Integer,          Intent (In)   :: idlow, idhigh, jdlow, jdhigh
06802        Integer,          Intent (In)   :: kdlow, kdhigh, nbr_corners
06803        Integer,          Intent (In)   :: grid_shape (2, ndim_3d)
06804        Double Precision, Intent (In)   :: 
06805           array1 (idlow:idhigh, jdlow:jdhigh, kdlow:kdhigh, nbr_corners)
06806        Double Precision, Intent (In)   :: 
06807           array2 (idlow:idhigh, jdlow:jdhigh, kdlow:kdhigh, nbr_corners)
06808        Double Precision, Intent (In)   :: 
06809           array3 (idlow:idhigh, jdlow:jdhigh, kdlow:kdhigh, nbr_corners)
06810        Double Precision, Intent (In)   :: rinter (2, ndim_3d)
06811 !
06812        Integer,          Intent (Out)  :: inter  (2, ndim_3d)
06813        Integer,          Intent (Out)  :: ierror
06814     End Subroutine
06815 
06816     subroutine psmile_mg_ctrl_subgrid_1d_dble (              &
06817                     array, corner_shape, nbr_corners, range, &
06818                     chmin, chmax, levdim, period, grid_id, ind, ierror)
06819        Integer,          Intent (In)    :: nbr_corners
06820        Integer,          Intent (In)    :: corner_shape (2)
06821        Integer,          Intent (In)    :: range (2)
06822        Integer,          Intent (In)    :: levdim
06823        Double Precision, Intent (In)    :: period
06824        Double Precision, Intent (In)    :: 
06825           array ( corner_shape(1):corner_shape(2), nbr_corners)
06826        Double Precision, Intent (In)    :: chmin (0:levdim)
06827        Double Precision, Intent (In)    :: chmax (0:levdim)
06828        Integer,          Intent (In)    :: grid_id, ind
06829 !
06830        Integer,          Intent (Out)   :: ierror
06831     End Subroutine
06832 
06833     subroutine psmile_mg_ctrl_subgrid_2d_dble (       &
06834                     array, corner_shape, nbr_corners, &
06835                            range,                     &
06836                     chmin, chmax, levdim, period,     &
06837                     grid_id, ind, ierror)
06838        Integer, Intent (In)             :: nbr_corners
06839        Integer, Intent (In)             :: corner_shape (2, 2)
06840        Integer, Intent (In)             :: range (2, 2)
06841        Integer, Intent (In)             :: levdim (2)
06842        Double Precision, Intent (In)    :: period
06843        Double Precision, Intent (In)    :: array(corner_shape(1,1):
06844                                                  corner_shape(2,1),
06845                                                  corner_shape(1,2):
06846                                                  corner_shape(2,2),
06847                                                  nbr_corners)
06848        Double Precision, Intent (In)    :: chmin (0:levdim(1), 0:levdim(2))
06849        Double Precision, Intent (In)    :: chmax (0:levdim(1), 0:levdim(2))
06850        Integer, Intent (In)             :: grid_id, ind
06851        Integer, Intent (Out)            :: ierror
06852     End Subroutine
06853 
06854     subroutine psmile_mg_ctrl_subgrid_3d_dble (       &
06855                     array, corner_shape, nbr_corners, &
06856                            range,                     &
06857                     chmin, chmax, levdim, period,     &
06858                     grid_id, ind, ierror)
06859        Use PSMILe_common
06860        Integer, Intent (In)             :: nbr_corners
06861        Integer, Intent (In)             :: corner_shape (2, ndim_3d)
06862        Integer, Intent (In)             :: range (2, ndim_3d)
06863        Integer, Intent (In)             :: levdim (ndim_3d)
06864        Double Precision, Intent (In)    :: period
06865        Double Precision, Intent (In)    :: array(corner_shape(1,1):
06866                                                  corner_shape(2,1),
06867                                                  corner_shape(1,2):
06868                                                  corner_shape(2,2),
06869                                                  corner_shape(1,3):
06870                                                  corner_shape(2,3),
06871                                                  nbr_corners)
06872        Double Precision, Intent (In)    :: chmin (0:levdim(1), 0:levdim(2), 
06873                                                   0:levdim(3))
06874        Double Precision, Intent (In)    :: chmax (0:levdim(1), 0:levdim(2), 
06875                                                   0:levdim(3))
06876        Integer, Intent (In)             :: grid_id, ind
06877        Integer, Intent (Out)            :: ierror
06878     End Subroutine
06879 
06880     subroutine psmile_mg_first_level_dble (grid_id, range, &
06881                     mg_info, tol, simplified_grid, ierror)
06882        Use PSMILe_common
06883        Integer,          Intent (In)    :: grid_id
06884        Integer,          Intent (In)    :: range (2, ndim_3d)
06885        Type (Enddef_mg), Intent (InOut) :: mg_info
06886        Real (PSMILe_float_kind), Intent (In)   :: tol
06887        Logical,          Intent (In)    :: simplified_grid
06888        Integer,          Intent (Out)   :: ierror
06889     End Subroutine
06890 
06891     subroutine psmile_mg_first_subgrid_1d_dble (         &
06892                     array, idlow, idhigh, nbr_corners,   &
06893                            range,                        &
06894                     chmin, chmax, midp,                  &
06895                     levdim, ierror)
06896        Integer, Intent (In)            :: idlow, idhigh, nbr_corners
06897        Integer, Intent (In)            :: range (2)
06898        Integer, Intent (In)            :: levdim
06899        Double Precision, Intent (In)   :: array (idlow:idhigh, nbr_corners)
06900        Double Precision, Intent (Out)  :: chmin (0:levdim)
06901        Double Precision, Intent (Out)  :: chmax (0:levdim)
06902        Double Precision, Intent (Out)  :: midp  (0:levdim)
06903        Integer, Intent (Out)           :: ierror
06904     End Subroutine
06905 
06906     subroutine psmile_mg_first_subgrid_2d_dble (array, &
06907                     idlow, idhigh, jdlow, jdhigh, nbr_corners,   &
06908                            range,                        &
06909                     chmin, chmax, midp,                  &
06910                     levdim1, levdim2, ierror)
06911        Integer, Intent (In)            :: idlow, idhigh, jdlow, jdhigh
06912        Integer, Intent (In)            :: nbr_corners
06913        Integer, Intent (In)            :: range (2, 2)
06914        Integer, Intent (In)            :: levdim1, levdim2
06915        Double Precision, Intent (In)   :: array (idlow:idhigh, jdlow:jdhigh, 
06916                                                  nbr_corners)
06917        Double Precision, Intent (Out)  :: chmin (0:levdim1, 0:levdim2)
06918        Double Precision, Intent (Out)  :: chmax (0:levdim1, 0:levdim2)
06919        Double Precision, Intent (Out)  :: midp  (0:levdim1, 0:levdim2)
06920        Integer, Intent (Out)           :: ierror
06921     End Subroutine
06922 
06923     subroutine psmile_mg_first_subgrid_3d_dble (array, &
06924                     idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
06925                     nbr_corners,   &
06926                            range,                        &
06927                     chmin, chmax, midp,                  &
06928                     levdim1, levdim2, levdim3, ierror)
06929        Use PSMILe_common
06930        Integer, Intent (In)            :: idlow, idhigh, jdlow, jdhigh
06931        Integer, Intent (In)            :: kdlow, kdhigh
06932        Integer, Intent (In)            :: nbr_corners
06933        Double Precision, Intent (In)   :: array (idlow:idhigh, jdlow:jdhigh, 
06934                                                  kdlow:kdhigh, nbr_corners)
06935        Integer, Intent (In)            :: range (2, ndim_3d)
06936        Integer, Intent (In)            :: levdim1, levdim2, levdim3
06937        Double Precision, Intent (Out)  :: chmin (0:levdim1, 0:levdim2, 0:levdim3)
06938        Double Precision, Intent (Out)  :: chmax (0:levdim1, 0:levdim2, 0:levdim3)
06939        Double Precision, Intent (Out)  :: midp  (0:levdim1, 0:levdim2, 0:levdim3)
06940        Integer, Intent (Out)           :: ierror
06941     End Subroutine
06942 
06943     subroutine psmile_mg_coars_level_dble (grid_id, mg_info_fine, &
06944                                      mg_info_coarse, &
06945                                      icoarse, ierror)
06946        Use PSMILe_common
06947        Integer, Intent (In)            :: grid_id
06948        Type (Enddef_mg), Intent (In)   :: mg_info_fine
06949        Type (Enddef_mg), Intent (InOut):: mg_info_coarse
06950        Integer, Intent (In)            :: icoarse (ndim_3d)
06951        Integer, Intent (Out)           :: ierror
06952     End Subroutine
06953 
06954     subroutine psmile_mg_coars_subgrid_3d_dble ( chfmin, chfmax, midfp, &
06955                              levdim1_fine, levdim2_fine, levdim3_fine, &
06956                                                 chcmin, chcmax, midcp, &
06957                                             levdim1, levdim2, levdim3, &
06958                                                 icoarse, ierror)
06959        Use PSMILe_common
06960        Integer, Intent (In)            :: levdim1_fine, levdim2_fine, 
06961                                           levdim3_fine
06962        Integer, Intent (In)            :: levdim1, levdim2, levdim3
06963        Double Precision, Intent (In)   :: chfmin (0:levdim1_fine,  
06964                                                   0:levdim2_fine,  
06965                                                   0:levdim3_fine)
06966        Double Precision, Intent (In)   :: chfmax (0:levdim1_fine,  
06967                                                   0:levdim2_fine,  
06968                                                   0:levdim3_fine)
06969        Double Precision, Intent (In)   ::  midfp (0:levdim1_fine,  
06970                                                   0:levdim2_fine,  
06971                                                   0:levdim3_fine)
06972        Double Precision, Intent (Out)  :: chcmin (0:levdim1, 0:levdim2, 
06973                                                   0:levdim3)
06974        Double Precision, Intent (Out)  :: chcmax (0:levdim1, 0:levdim2, 
06975                                                   0:levdim3)
06976        Double Precision, Intent (Out)  ::  midcp (0:levdim1, 0:levdim2, 
06977                                                   0:levdim3)
06978        Integer, Intent (In)            :: icoarse (ndim_3d)
06979        Integer, Intent (Out)           :: ierror
06980     End Subroutine
06981 
06982     subroutine psmile_mg_get_cyclic_dble (grid_id, range, &
06983                                           tol, ierror)
06984        Use PSMILe_common
06985 
06986        Integer, Intent (In)               :: grid_id
06987        Integer, Intent (In)               :: range (2, ndim_3d)
06988        Double Precision, Intent (In)      :: tol
06989        Integer, Intent (Out)              :: ierror
06990     End Subroutine
06991 
06992     subroutine psmile_neigh_extra_search_dble (search, extra_search, &
06993                                                nb_extra, ierror)
06994        Use PSMILe_common
06995 
06996        Type (Enddef_search),     Intent (In)    :: search
06997        Type (Extra_search_info), Intent (InOut) :: extra_search
06998        Integer,                  Intent (In)    :: nb_extra
06999        Integer,                  Intent (Out)   :: ierror
07000     End Subroutine
07001 
07002     subroutine psmile_send_req_coords_dble (msg_intersections, &
07003                                             dest, tag, ierror)
07004        use psmile_common, only : enddef_msg_intersections
07005 
07006        Integer, Intent (In)                         :: dest, tag
07007        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
07008        Integer, Intent (Out)                        :: ierror
07009     End Subroutine
07010 
07011     subroutine psmile_send_req_corners_dble (msg_intersections, &
07012                                              dest, tag, ierror)
07013        use psmile_common, only : enddef_msg_intersections
07014 
07015        Integer, Intent (In)                         :: dest, tag
07016        Type (enddef_msg_intersections), Intent (In) :: msg_intersections
07017        Integer, Intent (Out)                        :: ierror
07018     End Subroutine
07019 
07020     subroutine psmile_recv_req_coords_dble (sender, tag, search, &
07021                                             recv_req, recv_mask, new_search, &
07022                                             ierror)
07023        Use PSMILe_common
07024        Integer, Intent (In)                 :: sender, tag
07025        Logical, Intent (In)                 :: recv_mask, new_search
07026        Type (Enddef_search), Intent (InOut) :: search
07027        Integer, Intent (Out)                :: recv_req (ndim_3d+2, *)
07028        Integer, Intent (Out)                :: ierror
07029     End Subroutine
07030 
07031     subroutine psmile_recv_req_corners_dble (sender, tag,      &
07032                                              search, recv_req, &
07033                                              recv_mask, new_search, &
07034                                              ierror)
07035        Use PSMILe_common
07036        Integer, Intent (In)                 :: sender, tag
07037        Logical, Intent (In)                 :: recv_mask, new_search
07038        Type (Enddef_search), Intent (InOut) :: search
07039        Integer, Intent (Out)                :: recv_req (ndim_3d+2, *)
07040        Integer, Intent (Out)                :: ierror
07041     End Subroutine
07042 
07043     subroutine psmile_mg_search_1d_dble (grid_id, idim, found,   &
07044                                          locations, coords, len, &
07045                                          tol, ierror)
07046        Use PSMILe_common
07047 
07048        Integer, Intent (In)            :: grid_id
07049        Integer, Intent (In)            :: idim
07050        Integer, Intent (In)            :: len
07051        Integer, Intent (InOut)         :: found (len)
07052        Integer, Intent (InOut)         :: locations (len)
07053        Double Precision, Intent (In)   :: coords (len)
07054        Double Precision, Intent (In)   :: tol
07055        Integer, Intent (Out)           :: ierror
07056     End Subroutine
07057 
07058     subroutine psmile_mg_search_2d_dble (grid_id, found, &
07059                                          locations, len, &
07060                                          search_data,    &
07061                                          ipart,  tol, ierror)
07062        Use PSMILe_common
07063 
07064        Integer, Intent (In)            :: grid_id
07065        Integer, Intent (In)            :: len
07066        Integer, Intent (InOut)         :: found (len)
07067        Integer, Intent (InOut)         :: locations (ndim_2d, len)
07068        Type (Enddef_search_data)       :: search_data
07069        Integer, Intent (In)            :: ipart
07070        Double Precision, Intent (In)   :: tol
07071        Integer, Intent (Out)           :: ierror
07072     End Subroutine
07073 
07074     subroutine psmile_mg_search_3d_dble (comp_info, found,            &
07075                                          locations, len, search_data, &
07076                                          grid_id, tol, ierror)
07077        Use PSMILe_common
07078 
07079        Type (Enddef_comp), Intent (In)       :: comp_info
07080        Type (integer_vector), Intent(InOut)  :: found (*)
07081        Type (integer_vector), Intent(InOut)  :: locations (*)
07082        Integer, Intent (In)                  :: len (*)
07083        Type (Enddef_search_data)             :: search_data
07084        Integer, Intent (In)                  :: grid_id
07085        Double Precision, Intent (In)         :: tol
07086        Integer, Intent (Out)                 :: ierror
07087     End Subroutine
07088 
07089     subroutine psmile_search_donor_irreg3_dble (comp_info, found,           &
07090                                                 locations, len, search,     &
07091                                                 field_list, n_vars,         &
07092                                                 grid_id, method_id, var_id, &
07093                                                 tol, ierror)
07094        Use PSMILe_common
07095 
07096        Type (Enddef_comp), Intent (In)       :: comp_info
07097        Type (integer_vector), Intent(InOut)  :: found (*)
07098        Type (integer_vector), Intent(InOut)  :: locations (*)
07099        Integer, Intent (In)                  :: len (*)
07100        Type (Enddef_search)                  :: search
07101        Integer, Intent (In)                  :: grid_id
07102        Integer, Intent (InOut)               :: method_id, var_id
07103        Integer, Intent (In)                  :: n_vars
07104        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
07105        Double Precision, Intent (In)         :: tol
07106        Integer, Intent (Out)                 :: ierror
07107     End Subroutine
07108 
07109     subroutine psmile_search_donor_3d_reg_dble (comp_info,   &
07110                                             found, locations, len, &
07111                                             search, field_list, n_vars, &
07112                                             grid_id, method_id, var_id, &
07113                                             tol, ierror)
07114        Use PSMILe_common
07115 
07116        Type (Enddef_comp),    Intent (In)    :: comp_info
07117        Type (Enddef_search)                  :: search
07118        Type (integer_vector), Intent (InOut) :: found (ndim_3d, *)
07119        Type (integer_vector), Intent (InOut) :: locations (ndim_3d, *)
07120        Integer, Intent (In)                  :: len (search%search_data%npart)
07121        Integer, Intent (In)                  :: grid_id
07122        Integer, Intent (InOut)               :: method_id, var_id
07123        Integer, Intent (In)                  :: n_vars
07124        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
07125        Double Precision, Intent (In)         :: tol
07126        Integer, Intent (Out)                 :: ierror
07127     End Subroutine
07128 
07129     subroutine psmile_search_donor_gauss2_dble (comp_info, found, &
07130                                             locations, len, search, &
07131                                             field_list, n_vars, &
07132                                             grid_id, method_id, var_id, &
07133                                             tol, ierror)
07134        Use PSMILe_common
07135 
07136        Type (Enddef_comp), Intent (In)       :: comp_info
07137        Type (Enddef_search)                  :: search
07138        Type (integer_vector)                 :: found (search%search_data%npart, 2)
07139        Type (integer_vector)                 :: locations (search%search_data%npart, 2)
07140        Integer, Intent (In)                  :: len (search%search_data%npart, 2)
07141        Integer, Intent (In)                  :: grid_id
07142        Integer, Intent (InOut)               :: method_id, var_id
07143        Integer, Intent (In)                  :: n_vars
07144        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
07145        Double Precision, Intent (In)         :: tol
07146        Integer, Intent (Out)                 :: ierror
07147     End Subroutine
07148 
07149     subroutine psmile_search_donor_irreg2_dble (comp_info, found,     &
07150                       locations, len, search,                         &
07151                       field_list, n_vars, grid_id, method_id, var_id, &
07152                       tol, ierror)
07153        Use PSMILe_common
07154 
07155        Type (Enddef_comp), Intent (In)       :: comp_info
07156        Type (Enddef_search)                  :: search
07157        Type (integer_vector)                 :: found (search%search_data%npart, 2)
07158        Type (integer_vector)                 :: locations (search%search_data%npart, 2)
07159        Integer, Intent (In)                  :: len (search%search_data%npart, 2)
07160        Integer, Intent (In)                  :: grid_id
07161        Integer, Intent (InOut)               :: method_id, var_id
07162        Integer, Intent (In)                  :: n_vars
07163        Type (Enddef_field_info), Intent (In) :: field_list (n_vars)
07164        Double Precision,   Intent (In)       :: tol
07165        Integer, Intent (Out)                 :: ierror
07166     End Subroutine
07167 
07168     subroutine psmile_search_donor_nnx_dble (comp_info, search, var_id, &
07169                       coords1, coords2, coords3, distance,              &
07170                       nfound, locations, n_send, nb_extra,              &
07171                       tol, ierror)
07172        Use PSMILe_common
07173 
07174        Type (Enddef_comp),          Intent (In)    :: comp_info
07175        Integer,                     Intent (In)    :: var_id
07176        Integer,                     Intent (In)    :: n_send
07177        Integer,                     Intent (In)    :: nb_extra
07178        Double Precision,            Intent (In)    :: coords1 (n_send)
07179        Double Precision,            Intent (In)    :: coords2 (n_send)
07180        Double Precision,            Intent (In)    :: coords3 (n_send)
07181        Double Precision,            Intent (InOut) :: distance (n_send)
07182        Double Precision,            Intent (In)    :: tol
07183        Type (Enddef_global_search), Intent (InOut) :: search
07184        Integer,                     Intent (InOut) :: nfound (n_send)
07185        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
07186        Integer,                     Intent (Out)   :: ierror
07187     End Subroutine
07188 
07189     subroutine psmile_search_nn_3d_dble (                         &
07190                       sin_search, cos_search, z_search, distance, &
07191                       nfound, locations, n_send,                  &
07192                       x_coords, y_coords, z_coords, coords_shape, &
07193                       sin_values, cos_values, grid_valid_shape,   &
07194                       mask_array, mask_shape, mask_available,     &
07195                       tol, ierror)
07196        Use PSMILe_common
07197 
07198        Integer,                     Intent (In)    :: n_send
07199        Double Precision,            Intent (In)    :: sin_search (n_send, 2)
07200        Double Precision,            Intent (In)    :: cos_search (n_send, 2)
07201        Double Precision,            Intent (In)    :: z_search (n_send)
07202        Integer,                     Intent (In)    :: coords_shape (2, ndim_3d)
07203        Double Precision,            Intent (In)    ::    
07204           x_coords (coords_shape(1,1):coords_shape(2,1), 
07205                     coords_shape(1,2):coords_shape(2,2), 
07206                     coords_shape(1,3):coords_shape(2,3))
07207        Double Precision,            Intent (In)    ::    
07208           y_coords (coords_shape(1,1):coords_shape(2,1), 
07209                     coords_shape(1,2):coords_shape(2,2), 
07210                     coords_shape(1,3):coords_shape(2,3))
07211        Double Precision,            Intent (In)    ::    
07212           z_coords (coords_shape(1,1):coords_shape(2,1), 
07213                     coords_shape(1,2):coords_shape(2,2), 
07214                     coords_shape(1,3):coords_shape(2,3))
07215 
07216        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
07217        Logical,                     Intent (In)    ::    
07218           mask_array (mask_shape (1,1):mask_shape (2,1), 
07219                       mask_shape (1,2):mask_shape (2,2), 
07220                       mask_shape (1,3):mask_shape (2,3))
07221        Logical,                     Intent (In)    :: mask_available
07222        Integer,                     Intent (In)    :: 
07223           grid_valid_shape (2, ndim_3d)
07224 
07225        Double Precision,            Intent (In)   ::               
07226           sin_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
07227                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
07228        Double Precision,            Intent (In)   ::               
07229           cos_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
07230                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
07231        Double Precision,            Intent (In)    :: tol
07232        Double Precision,            Intent (InOut) :: distance (n_send)
07233        Integer,                     Intent (InOut) :: nfound (n_send)
07234        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
07235        Integer,                     Intent (Out)   :: ierror
07236     End Subroutine
07237 
07238     subroutine psmile_search_nn_3d_reg_dble (                     &
07239                       sin_search, cos_search, z_search, distance, &
07240                       nfound, locations, n_send,                  &
07241                       x_coords, y_coords, z_coords, coords_shape, &
07242                       sin_values_lon, cos_values_lon,             &
07243                       sin_values_lat, cos_values_lat,             &
07244                       grid_valid_shape,                           &
07245                       mask_array, mask_shape, mask_available,     &
07246                       tol, ierror)
07247        Use PSMILe_common
07248 
07249        Integer,                     Intent (In)    :: n_send
07250        Double Precision,            Intent (In)    :: sin_search (n_send, 2)
07251        Double Precision,            Intent (In)    :: cos_search (n_send, 2)
07252        Double Precision,            Intent (In)    :: z_search (n_send)
07253        Integer,                     Intent (In)    :: coords_shape (2, ndim_3d)
07254        Double Precision,            Intent (In)    ::    
07255           x_coords (coords_shape(1,1):coords_shape(2,1))
07256        Double Precision,            Intent (In)    ::    
07257           y_coords (coords_shape(1,1):coords_shape(2,1))
07258        Double Precision,            Intent (In)    ::    
07259           z_coords (coords_shape(1,3):coords_shape(2,3))
07260 
07261        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
07262        Logical,                     Intent (In)    ::    
07263           mask_array (mask_shape (1,1):mask_shape (2,1), 
07264                       mask_shape (1,2):mask_shape (2,2), 
07265                       mask_shape (1,3):mask_shape (2,3))
07266        Logical,                     Intent (In)    :: mask_available
07267        Integer,                     Intent (In)    :: 
07268           grid_valid_shape (2, ndim_3d)
07269 
07270        Double Precision,            Intent (In)    ::                  
07271           sin_values_lon (grid_valid_shape(1,1):grid_valid_shape(2,1))
07272        Double Precision,            Intent (In)    ::                  
07273           cos_values_lon (grid_valid_shape(1,1):grid_valid_shape(2,1))
07274        Double Precision,            Intent (In)   ::                   
07275           sin_values_lat (grid_valid_shape(1,2):grid_valid_shape(2,2))
07276        Double Precision,            Intent (In)   ::                   
07277           cos_values_lat (grid_valid_shape(1,2):grid_valid_shape(2,2))
07278        Double Precision,            Intent (In)    :: tol
07279        Double Precision,            Intent (InOut) :: distance (n_send)
07280        Integer,                     Intent (InOut) :: nfound (n_send)
07281        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
07282        Integer,                     Intent (Out)   :: ierror
07283     End Subroutine
07284 
07285     subroutine psmile_search_nn_irreg2_dble (                     &
07286                       sin_search, cos_search, z_search, distance, &
07287                       nfound, locations, n_send,                  &
07288                       x_coords, y_coords, z_coords, coords_shape, &
07289                       sin_values, cos_values, grid_valid_shape,   &
07290                       mask_array, mask_shape, mask_available,     &
07291                       tol, ierror)
07292        Use PSMILe_common
07293 
07294        Integer,                     Intent (In)    :: n_send
07295        Double Precision,            Intent (In)    :: sin_search (n_send, 2)
07296        Double Precision,            Intent (In)    :: cos_search (n_send, 2)
07297        Double Precision,            Intent (In)    :: z_search (n_send)
07298        Integer,                     Intent (In)    :: coords_shape (2, ndim_3d)
07299        Double Precision,            Intent (In)    :: x_coords(  
07300                                                         coords_shape(1,1):coords_shape(2,1), 
07301                                                         coords_shape(1,2):coords_shape(2,2))
07302        Double Precision,            Intent (In)    :: y_coords(  
07303                                                         coords_shape(1,1):coords_shape(2,1), 
07304                                                         coords_shape(1,2):coords_shape(2,2))
07305        Double Precision,            Intent (In)    :: z_coords(  
07306                                                         coords_shape(1,3):coords_shape(2,3))
07307 
07308        Integer,                     Intent (In)    :: mask_shape (2, ndim_3d)
07309        Logical,                     Intent (In)    :: mask_array ( 
07310                                                         mask_shape (1,1):mask_shape (2,1), 
07311                                                         mask_shape (1,2):mask_shape (2,2), 
07312                                                         mask_shape (1,3):mask_shape (2,3))
07313        Logical,                     Intent (In)    :: mask_available
07314        Integer,                     Intent (In)    :: grid_valid_shape (2, ndim_3d)
07315 
07316        Double Precision,            Intent (In)   ::               
07317           sin_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
07318                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
07319        Double Precision,            Intent (In)   ::               
07320           cos_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
07321                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
07322        Double Precision,            Intent (In)    :: tol
07323        Double Precision,            Intent (InOut) :: distance (n_send)
07324        Integer,                     Intent (InOut) :: nfound (n_send)
07325        Integer,                     Intent (Out)   :: locations (ndim_3d, n_send)
07326        Integer,                     Intent (Out)   :: ierror
07327     End Subroutine
07328 
07329     subroutine psmile_store_faces_3d_dble (indices_req, required,     &
07330                     nreq,                                             &
07331                     tgt_coords1, tgt_coords2, tgt_coords3, ncpl,      &
07332                     corners1, corners2, corners3,                     &
07333                     corner_shape, nbr_corners, grid_valid_shape,      &
07334                     send_mask, srcloc_ind,                            &
07335                     ibuf, len_item, ndibuf, ipia,                     &
07336                      buf, len_rtem, ndrbuf, ipa, ierror)
07337        Use PSMILe_common
07338 
07339        Integer,                  Intent (In)  :: nreq, ncpl
07340        Integer,                  Intent (In)  :: indices_req (nreq)
07341        Integer,                  Intent (In)  :: required    (nreq)
07342        Integer,                  Intent (In)  :: nbr_corners
07343        Integer,                  Intent (In)  :: corner_shape (2, ndim_3d)
07344        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
07345        Double Precision,         Intent (In)  :: tgt_coords1 (ncpl)
07346        Double Precision,         Intent (In)  :: tgt_coords2 (ncpl)
07347        Double Precision,         Intent (In)  :: tgt_coords3 (ncpl)
07348        Double Precision,         Intent (In)  :: 
07349           corners1 ( corner_shape(1,1):corner_shape(2,1), 
07350                      corner_shape(1,2):corner_shape(2,2), 
07351                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
07352        Double Precision,         Intent (In)  :: 
07353           corners2 ( corner_shape(1,1):corner_shape(2,1), 
07354                      corner_shape(1,2):corner_shape(2,2), 
07355                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
07356        Double Precision,         Intent (In)  :: 
07357           corners3 ( corner_shape(1,1):corner_shape(2,1), 
07358                      corner_shape(1,2):corner_shape(2,2), 
07359                      corner_shape(1,3):corner_shape(2,3), nbr_corners)
07360        Logical,                  Intent (In)  :: send_mask (nreq)
07361        Integer,                  Intent (In)  :: len_item, len_rtem, ndibuf, ndrbuf
07362        Integer,                  Intent (In)  :: srcloc_ind (ndim_3d, ndibuf)
07363        Double Precision,         Intent (InOut) ::  buf (len_rtem, ndrbuf)
07364        Integer,                  Intent (InOut) :: ibuf (len_item, ndibuf)
07365        Integer,                  Intent (InOut) :: ipa, ipia
07366        Integer,                  Intent (Out) :: ierror
07367     End Subroutine
07368 
07369     subroutine psmile_store_faces_3d_reg_dble (indices_req, required, &
07370                     nreq,                                             &
07371                     tgt_coords1, tgt_coords2, tgt_coords3, ncpl,      &
07372                     corners1, corners2, corners3,                     &
07373                     corner_shape, nbr_corners, grid_valid_shape,      &
07374                     send_mask, srcloc_ind,                            &
07375                     ibuf, len_item, ndibuf, ipia,                     &
07376                      buf, len_rtem, ndrbuf, ipa, ierror)
07377        Use PSMILe_common
07378 
07379        Integer,                  Intent (In)  :: nreq, ncpl
07380        Integer,                  Intent (In)  :: indices_req (nreq)
07381        Integer,                  Intent (In)  :: required    (nreq)
07382        Integer,                  Intent (In)  :: nbr_corners
07383        Integer,                  Intent (In)  :: corner_shape (2, ndim_3d)
07384        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
07385        Double Precision,         Intent (In)  :: tgt_coords1 (ncpl)
07386        Double Precision,         Intent (In)  :: tgt_coords2 (ncpl)
07387        Double Precision,         Intent (In)  :: tgt_coords3 (ncpl)
07388        Double Precision,         Intent (In)  :: 
07389           corners1 ( corner_shape(1,1):corner_shape(2,1), 2)
07390        Double Precision,         Intent (In)  :: 
07391           corners2 ( corner_shape(1,2):corner_shape(2,2), 2)
07392        Double Precision,         Intent (In)  :: 
07393           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
07394        Logical,                  Intent (In)  :: send_mask (nreq)
07395        Integer,                  Intent (In)  :: len_item, len_rtem, ndibuf, ndrbuf
07396        Integer,                  Intent (In)  :: srcloc_ind (ndim_3d, ndibuf)
07397        Double Precision,         Intent (InOut) ::  buf (len_rtem, ndrbuf)
07398        Integer,                  Intent (InOut) :: ibuf (len_item, ndibuf)
07399        Integer,                  Intent (InOut) :: ipa, ipia
07400        Integer,                  Intent (Out) :: ierror
07401     End Subroutine
07402 
07403     subroutine psmile_store_faces_gauss2_dble (indices_req,      &
07404                       required, nreq,                              &
07405                       tgt_coords1, tgt_coords2, tgt_coords3, ncpl, &
07406                       corners1, corners2, corners3, corner_shape,  &
07407                       nbr_corners, grid_id, grid_valid_shape,      &
07408                       send_mask, srcloc_ind,                       &
07409                       virtual_ind, virtual_cell_available,         &
07410                       ibuf, len_item, ndibuf, ipia,                &
07411                       buf,  len_rtem, ndrbuf, ipa, ierror)
07412       Use PSMILe_common
07413 
07414       Integer,           Intent (In)    :: nreq
07415       Integer,           Intent (In)    :: indices_req (nreq)
07416       Integer,           Intent (In)    :: required    (nreq)
07417       Integer,           Intent (In)    :: corner_shape (2, ndim_3d)
07418       Integer,           Intent (In)    :: nbr_corners
07419       Integer,           Intent (In)    :: grid_id
07420       Integer,           Intent (In)    :: grid_valid_shape (2, ndim_3d)
07421       Integer,           Intent (In)    :: ncpl
07422       Double Precision,  Intent (In)    :: tgt_coords1 (ncpl)
07423       Double Precision,  Intent (In)    :: tgt_coords2 (ncpl)
07424       Double Precision,  Intent (In)    :: tgt_coords3 (ncpl)
07425       Double Precision,  Intent (In)    :: corners1 ( corner_shape(1,1):corner_shape(2,1), 2)
07426       Double Precision,  Intent (In)    :: corners2 ( corner_shape(1,1):corner_shape(2,1), 2)
07427       Double Precision,  Intent (In)    :: corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
07428       Logical,           Intent (In)    :: send_mask (nreq)
07429       Integer,           Intent (In)    :: ndibuf
07430       Integer,           Intent (In)    :: srcloc_ind (ndim_3d, ndibuf)
07431       Integer,           Intent (In)    :: virtual_ind (ndibuf)
07432       Logical,           Intent (In)    :: virtual_cell_available
07433       Integer,           Intent (In)    :: len_item
07434       Integer,           Intent (In)    :: ndrbuf
07435       Integer,           Intent (In)    :: len_rtem
07436       Double Precision,  Intent (InOut) :: buf (len_rtem, ndrbuf)
07437       Integer,           Intent (InOut) :: ipa
07438       Integer,           Intent (InOut) :: ibuf (len_item, ndibuf)
07439       Integer,           Intent (InOut) :: ipia
07440       Integer,           Intent (Out)   :: ierror
07441     End Subroutine
07442 
07443     subroutine psmile_store_faces_irreg2_dble (indices_req, required, &
07444                     nreq,                                             &
07445                     tgt_coords1, tgt_coords2, tgt_coords3, ncpl,      &
07446                     corners1, corners2, corners3,                     &
07447                     corner_shape, nbr_corners, grid_valid_shape,      &
07448                     send_mask, srcloc_ind,                            &
07449                     ibuf, len_item, ndibuf, ipia,                     &
07450                      buf, len_rtem, ndrbuf, ipa, ierror)
07451        Use PSMILe_common
07452 
07453        Integer,                  Intent (In)  :: nreq, ncpl
07454        Integer,                  Intent (In)  :: indices_req (nreq)
07455        Integer,                  Intent (In)  :: required    (nreq)
07456        Integer,                  Intent (In)  :: nbr_corners
07457        Integer,                  Intent (In)  :: corner_shape     (2, ndim_3d)
07458        Integer,                  Intent (In)  :: grid_valid_shape (2, ndim_3d)
07459        Double Precision,         Intent (In)  :: tgt_coords1 (ncpl)
07460        Double Precision,         Intent (In)  :: tgt_coords2 (ncpl)
07461        Double Precision,         Intent (In)  :: tgt_coords3 (ncpl)
07462        Double Precision,         Intent (In)  :: 
07463           corners1 ( corner_shape(1,1):corner_shape(2,1), 
07464                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
07465        Double Precision,         Intent (In)  :: 
07466           corners2 ( corner_shape(1,1):corner_shape(2,1), 
07467                      corner_shape(1,2):corner_shape(2,2), nbr_corners/2)
07468        Double Precision,         Intent (In)  :: 
07469           corners3 ( corner_shape(1,3):corner_shape(2,3), 2)
07470        Logical,                  Intent (In)  :: send_mask (nreq)
07471        Integer,                  Intent (In)  :: len_item, len_rtem
07472        Integer,                  Intent (In)  :: ndibuf, ndrbuf
07473        Integer,                  Intent (In)  :: srcloc_ind (ndim_3d, ndibuf)
07474 !
07475        Double Precision,         Intent (InOut) ::  buf (len_rtem, ndrbuf)
07476        Integer,                  Intent (InOut) :: ibuf (len_item, ndibuf)
07477        Integer,                  Intent (InOut) :: ipa, ipia
07478        Integer,                  Intent (Out)   :: ierror
07479     End Subroutine
07480 
07481     subroutine psmile_trf_lonlat_1d_dble (x_coords, y_coords,        &
07482                                           coords_shape, grid_valid_shape, &
07483                                           sin_values_lon, cos_values_lon, &
07484                                           sin_values_lat, cos_values_lat, ierror)
07485        Use PSMILe_common
07486 
07487        Integer, Intent (In)            :: coords_shape (2, ndim_2d)
07488        Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
07489 
07490        Double Precision, Intent (In)   :: x_coords(coords_shape(1,1): 
07491                                                    coords_shape(2,1))
07492        Double Precision, Intent (In)   :: y_coords(coords_shape(1,2): 
07493                                                    coords_shape(2,2))
07494        Double Precision, Intent (Out)  :: sin_values_lon (grid_valid_shape(1,1):
07495                                                           grid_valid_shape(2,1))
07496        Double Precision, Intent (Out)  :: sin_values_lat (grid_valid_shape(1,2):
07497                                                           grid_valid_shape(2,2))
07498        Double Precision, Intent (Out)  :: cos_values_lon (grid_valid_shape(1,1):
07499                                                           grid_valid_shape(2,1))
07500        Double Precision, Intent (Out)  :: cos_values_lat (grid_valid_shape(1,2):
07501                                                           grid_valid_shape(2,2))
07502        Integer, Intent (Out)           :: ierror
07503     End Subroutine
07504 
07505     subroutine psmile_trf_lonlat_2d_dble (x_coords, y_coords,        &
07506                                           coords_shape, grid_valid_shape, &
07507                                           sin_values, cos_values, ierror)
07508        Use PSMILe_common
07509 
07510        Integer, Intent (In)            :: coords_shape (2, ndim_2d)
07511        Integer, Intent (In)            :: grid_valid_shape (2, ndim_2d)
07512 
07513        Double Precision, Intent (In)   :: x_coords(coords_shape(1,1): 
07514                                                    coords_shape(2,1), 
07515                                                    coords_shape(1,2): 
07516                                                    coords_shape(2,2))
07517        Double Precision, Intent (In)   :: y_coords(coords_shape(1,1): 
07518                                                    coords_shape(2,1), 
07519                                                    coords_shape(1,2): 
07520                                                    coords_shape(2,2))
07521        Double Precision, Intent (Out)  :: sin_values (grid_valid_shape(1,1): 
07522                                                       grid_valid_shape(2,1), 
07523                                                       grid_valid_shape(1,2): 
07524                                                       grid_valid_shape(2,2), 
07525                                                       2)
07526        Double Precision, Intent (Out)  :: cos_values (grid_valid_shape(1,1): 
07527                                                       grid_valid_shape(2,1), 
07528                                                       grid_valid_shape(1,2): 
07529                                                       grid_valid_shape(2,2), 
07530                                                       2)
07531        Integer, Intent (Out)           :: ierror
07532     End Subroutine
07533 
07534     subroutine psmile_trf_lonlat_3d_dble (x_coords, y_coords,             &
07535                                           coords_shape, grid_valid_shape, &
07536                                           sin_values, cos_values, ierror)
07537        Use PSMILe_common
07538 
07539        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07540        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07541 
07542        Double Precision, Intent (In)   :: x_coords(coords_shape(1,1): 
07543                                                    coords_shape(2,1), 
07544                                                    coords_shape(1,2): 
07545                                                    coords_shape(2,2), 
07546                                                    coords_shape(1,3): 
07547                                                    coords_shape(2,3))
07548        Double Precision, Intent (In)   :: y_coords(coords_shape(1,1): 
07549                                                    coords_shape(2,1), 
07550                                                    coords_shape(1,2): 
07551                                                    coords_shape(2,2), 
07552                                                    coords_shape(1,3): 
07553                                                    coords_shape(2,3))
07554        Double Precision, Intent (Out)  :: sin_values (grid_valid_shape(1,1): 
07555                                                       grid_valid_shape(2,1), 
07556                                                       grid_valid_shape(1,2): 
07557                                                       grid_valid_shape(2,2), 
07558                                                       grid_valid_shape(1,3): 
07559                                                       grid_valid_shape(2,3), 
07560                                                       2)
07561        Double Precision, Intent (Out)  :: cos_values (grid_valid_shape(1,1): 
07562                                                       grid_valid_shape(2,1), 
07563                                                       grid_valid_shape(1,2): 
07564                                                       grid_valid_shape(2,2), 
07565                                                       grid_valid_shape(1,3): 
07566                                                       grid_valid_shape(2,3), 
07567                                                       2)
07568        Integer, Intent (Out)           :: ierror
07569     End Subroutine
07570 
07571     subroutine psmile_info_coords_irreg2_dble (              &
07572                              x_coords, y_coords, z_coords,   &
07573                              coords_shape, grid_valid_shape, &
07574                              sinvec, cosvec, ierror)
07575        Use PSMILe_common
07576 
07577        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07578        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07579 
07580        Double Precision, Intent (In)   :: x_coords(*)
07581        Double Precision, Intent (In)   :: y_coords(*)
07582        Double Precision, Intent (In)   :: z_coords(*)
07583 
07584        Type (dble_vector)              :: sinvec
07585        Type (dble_vector)              :: cosvec
07586        Integer, Intent (Out)           :: ierror
07587     End Subroutine
07588 
07589     subroutine psmile_info_coords_3d_reg_dble (              &
07590                              x_coords, y_coords, z_coords,   &
07591                              coords_shape, grid_valid_shape, &
07592                              sinvec, cosvec, ierror)
07593        Use PSMILe_common
07594 
07595        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07596        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07597 
07598        Double Precision, Intent (In)   :: x_coords(*)
07599        Double Precision, Intent (In)   :: y_coords(*)
07600        Double Precision, Intent (In)   :: z_coords(*)
07601 
07602        Type (dble_vector)              :: sinvec (ndim_2d)
07603        Type (dble_vector)              :: cosvec (ndim_2d)
07604        Integer, Intent (Out)           :: ierror
07605     End Subroutine
07606 
07607     subroutine psmile_info_trf_coords_3d_dble (              &
07608                              x_coords, y_coords, z_coords,   &
07609                              coords_shape, grid_valid_shape, &
07610                              sinvec, cosvec, ierror)
07611        Use PSMILe_common
07612 
07613        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07614        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07615 
07616        Double Precision, Intent (In)   :: x_coords(*)
07617        Double Precision, Intent (In)   :: y_coords(*)
07618        Double Precision, Intent (In)   :: z_coords(*)
07619 
07620        Type (dble_vector)              :: sinvec
07621        Type (dble_vector)              :: cosvec
07622        Integer, Intent (Out)           :: ierror
07623     End Subroutine
07624 
07625     subroutine psmile_info_trs_locs_3d_dble (comp_info,                 &
07626                                              coords, shape, control,    &
07627                                              len_cpl,                   &
07628                                              var_id, grid_valid_shape,  &
07629                                              search,                    &
07630                                              method_id, send_index,     &
07631                                              ierror)
07632        Use PSMILe_common
07633 
07634        Type (Enddef_comp), Intent (In)      :: comp_info
07635        Type (Enddef_search), Intent (InOut) :: search
07636        Type (dble_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
07637        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
07638        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
07639        Integer, Intent (In)                 :: len_cpl (search%search_data%npart)
07640        Integer, Intent (In)                 :: var_id, method_id
07641        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
07642        Integer, Intent (InOut)              :: send_index
07643        Integer, Intent (Out)                :: ierror
07644     End Subroutine
07645 
07646     subroutine psmile_info_trs_loc_3d_reg_dble (comp_info,              &
07647                                              coords, shape, control,    &
07648                                              len_cpl,                   &
07649                                              var_id, grid_valid_shape,  &
07650                                              search,                    &
07651                                              method_id, send_index,     &
07652                                              ierror)
07653        Use PSMILe_common
07654 
07655        Type (Enddef_comp), Intent (In)      :: comp_info
07656        Type (Enddef_search), Intent (InOut) :: search
07657        Type (dble_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
07658        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
07659        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
07660        Integer, Intent (InOut)              :: len_cpl (search%search_data%npart)
07661        Integer, Intent (In)                 :: var_id, method_id
07662        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
07663        Integer, Intent (InOut)              :: send_index
07664        Integer, Intent (Out)                :: ierror
07665     End Subroutine
07666 
07667     subroutine psmile_info_trs_loc_irreg2_dble (comp_info,              &
07668                                              coords, shape, control,    &
07669                                              len_cpl,                   &
07670                                              var_id, grid_valid_shape,  &
07671                                              search,                    &
07672                                              method_id, send_index,     &
07673                                              ierror)
07674        Use PSMILe_common
07675 
07676        Type (Enddef_comp), Intent (In)      :: comp_info
07677        Type (Enddef_search), Intent (InOut) :: search
07678        Type (dble_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
07679        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
07680        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
07681        Integer, Intent (InOut)              :: len_cpl (search%search_data%npart)
07682        Integer, Intent (In)                 :: var_id, method_id
07683        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
07684        Integer, Intent (InOut)              :: send_index
07685        Integer, Intent (Out)                :: ierror
07686     End Subroutine
07687 
07688     subroutine psmile_info_trs_loc_gauss2_dble (comp_info,                      &
07689                                              coords, shape, control, len_cpl,   &
07690                                              var_id, grid_valid_shape,          &
07691                                              search, method_id,                 &
07692                                              send_index, ierror)
07693        Use PSMILe_common
07694 
07695        Type (Enddef_comp), Intent (In)      :: comp_info
07696        Type (Enddef_search), Intent (InOut) :: search
07697        Type (dble_vector), Intent (In)      :: coords (ndim_3d, search%search_data%npart)
07698        Integer, Intent (In)                 :: shape (2, ndim_3d, search%search_data%npart)
07699        Integer, Intent (In)                 :: control (2, ndim_3d, search%search_data%npart)
07700        Integer, Intent (InOut)              :: len_cpl (search%search_data%npart)
07701        Integer, Intent (In)                 :: var_id, method_id
07702        Integer, Intent (In)                 :: grid_valid_shape (2, ndim_3d)
07703        Integer, Intent (InOut)              :: send_index
07704        Integer, Intent (Out)                :: ierror
07705     End Subroutine
07706 
07707     subroutine psmile_neigh_near_irreg2_dble (grid_id,     &
07708                coords1, coords2, coords3,                  &
07709                x_coords, y_coords, z_coords,               &
07710                coords_shape,                               &
07711                mask_array, mask_shape,  mask_available,    &
07712                sin_values, cos_values, grid_valid_shape,   &
07713                search_mode,                                &
07714                srcloc, srclocz, nlocs,                     &
07715                nloc, nprev,                                &
07716                neighbors_3d, num_neigh,                    &
07717                extra_search, ierror)
07718 
07719        Use PSMILe_common
07720 
07721        Integer, Intent (In)            :: grid_id
07722        Integer, Intent (In)            :: nloc, nprev, search_mode
07723        Integer, Intent (In)            :: nlocs (ndim_2d)
07724        Double Precision, Intent (In)   :: coords1 (nloc)
07725        Double Precision, Intent (In)   :: coords2 (nloc)
07726        Double Precision, Intent (In)   :: coords3 (nloc)
07727        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07728        Double Precision, Intent (In)   :: x_coords (*)
07729        Double Precision, Intent (In)   :: y_coords (*)
07730        Double Precision, Intent (In)   :: z_coords (*)
07731        Logical, Intent (In)            :: mask_array (*)
07732        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
07733        Logical, Intent (In)            :: mask_available
07734        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07735        Double Precision, Intent (In)   :: sin_values (*)
07736        Double Precision, Intent (In)   :: cos_values (*)
07737        Integer, Intent (In)            :: srcloc (ndim_2d, nloc)
07738        Integer, Intent (In)            :: srclocz (nloc)
07739        Integer, Intent (In)            :: num_neigh
07740        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
07741        Type (Extra_search_info)        :: extra_search
07742        Integer, Intent (Out)           :: ierror
07743     End Subroutine
07744 
07745     subroutine psmile_neigh_nearx_irreg2_dble (grid_id,    &
07746                coords1, coords2, coords3,                  &
07747                x_coords, y_coords, z_coords,               &
07748                coords_shape,                               &
07749                mask_array, mask_shape,  mask_available,    &
07750                sin_values, cos_values, grid_valid_shape,   &
07751                search_mode,                                &
07752                srcloc, srclocz, nlocs,                     &
07753                nloc, nprev,                                &
07754                neighbors_3d, num_neigh,                    &
07755                extra_search, ierror)
07756 
07757        Use PSMILe_common
07758 
07759        Integer, Intent (In)            :: grid_id
07760        Integer, Intent (In)            :: nloc, nprev, search_mode
07761        Integer, Intent (In)            :: nlocs (ndim_2d)
07762        Double Precision, Intent (In)   :: coords1 (nlocs(1)*nlocs(2))
07763        Double Precision, Intent (In)   :: coords2 (nlocs(1)*nlocs(2))
07764        Double Precision, Intent (In)   :: coords3 (nlocs(1)*nlocs(2))
07765        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07766        Double Precision, Intent (In)   :: x_coords (*)
07767        Double Precision, Intent (In)   :: y_coords (*)
07768        Double Precision, Intent (In)   :: z_coords (*)
07769        Logical, Intent (In)            :: mask_array (*)
07770        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
07771        Logical, Intent (In)            :: mask_available
07772        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07773        Double Precision, Intent (In)   :: sin_values (*)
07774        Double Precision, Intent (In)   :: cos_values (*)
07775        Integer, Intent (In)            :: srcloc (ndim_2d, nlocs(1))
07776        Integer, Intent (In)            :: srclocz (nlocs(2))
07777        Integer, Intent (In)            :: num_neigh
07778        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
07779        Type (Extra_search_info)        :: extra_search
07780        Integer, Intent (Out)           :: ierror
07781     End Subroutine
07782 
07783     subroutine psmile_neigh_cells_3d_dble ( use_how,        &
07784                grid_shape, interpolation_mode, cyclic,      &
07785                corner_shape_3d, nbr_corners,                &
07786                corner_x, corner_y, corner_z,                &
07787                search,  control, tgt_cell, tgt_corners,     &
07788                npoints, srclocs, msklocs, ncpl,             &
07789                num_neigh, nbr_cells, ierror )
07790 
07791       USE PSMILe_Common
07792 
07793       Integer, Intent (In)            :: use_how(3)
07794       Integer, Intent (In)            :: grid_shape (2, ndim_3d)
07795       Integer, Intent (In)            :: interpolation_mode
07796       Logical, Intent (In)            :: cyclic (ndim_3d)
07797       Integer, Intent (In)            :: corner_shape_3d (2,ndim_3d,ndim_3d)
07798       Integer, Intent (In)            :: nbr_corners(ndim_3d)
07799       Type (Enddef_search), Intent (InOut) :: search
07800       Integer, Intent (In)            :: control (2, ndim_3d, search%search_data%npart)
07801       Type (dble_vector), Intent (InOut) :: tgt_cell(ndim_3d)
07802       Integer, Intent (In)            :: tgt_corners(ndim_3d)
07803       Integer, Intent (In)            :: npoints
07804       Integer, Intent (In)            :: ncpl
07805       Integer, Intent (In)            :: srclocs (ndim_3d, npoints)
07806       Logical, Intent (In)            :: msklocs (npoints)
07807       Integer, Intent (In)            :: num_neigh
07808       Double Precision, Intent (In)   :: corner_x (corner_shape_3d (1,1,1):corner_shape_3d(2,1,1), 
07809                                                    corner_shape_3d (1,2,1):corner_shape_3d(2,2,1), 
07810                                                    corner_shape_3d (1,3,1):corner_shape_3d(2,3,1), 
07811                                                    nbr_corners(1))
07812 
07813       Double Precision, Intent (In)   :: corner_y (corner_shape_3d (1,1,2):corner_shape_3d(2,1,2), 
07814                                                    corner_shape_3d (1,2,2):corner_shape_3d(2,2,2), 
07815                                                    corner_shape_3d (1,3,2):corner_shape_3d(2,3,2), 
07816                                                    nbr_corners(2))
07817 
07818       Double Precision, Intent (In)   :: corner_z (corner_shape_3d (1,1,3):corner_shape_3d(2,1,3), 
07819                                                    corner_shape_3d (1,2,3):corner_shape_3d(2,2,3), 
07820                                                    corner_shape_3d (1,3,3):corner_shape_3d(2,3,3), 
07821                                                    nbr_corners(3))
07822       Integer, Intent (Out)           :: nbr_cells(ncpl)
07823       Integer, Intent (Out)           :: ierror
07824     End Subroutine
07825 
07826     subroutine psmile_neigh_cells_3d_reg_dble (      &
07827                grid_valid_shape, interpolation_mode, &
07828                cyclic, grid_id, search, corners,     &
07829                npoints, srclocs, ncpl, nbr_cells,    &
07830                ierror )
07831 
07832       USE PSMILe_Common
07833 
07834       Integer, Intent (In)               :: grid_valid_shape (2, ndim_3d)
07835       Integer,            Intent (In)    :: interpolation_mode
07836       Logical,            Intent (In)    :: cyclic (ndim_3d)
07837       Integer,            Intent (In)    :: grid_id
07838       Type (Enddef_search), Intent (In)  :: search
07839       Type (dble_vector), Intent (In)    :: corners (ndim_3d, search%search_data%npart)
07840       Integer, Intent (In)               :: npoints (ndim_3d, search%search_data%npart)
07841       Type (integer_vector), Intent (In) :: srclocs (ndim_3d, search%search_data%npart)
07842       Integer, Intent (In)               :: ncpl
07843       Integer, Intent (Out)              :: nbr_cells(ncpl)
07844       Integer, Intent (Out)              :: ierror
07845     End Subroutine
07846 
07847     subroutine psmile_neigh_cells_irreg2_dble ( use_how,        &
07848                grid_shape, interpolation_mode, cyclic,          &
07849                corner_shape_3d, nbr_corners,                    &
07850                corner_x, corner_y,                              &
07851                search,  control, tgt_cell, tgt_corners,         &
07852                npoints, srclocs, msklocs, ncpl,                 &
07853                num_neigh, nbr_cells, ierror )
07854 
07855       USE PSMILe_Common
07856 
07857       Integer, Intent (In)            :: use_how(3)
07858       Integer, Intent (In)            :: grid_shape (2, ndim_3d)
07859       Integer, Intent (In)            :: interpolation_mode
07860       Logical, Intent (In)            :: cyclic (ndim_3d)
07861       Integer, Intent (In)            :: corner_shape_3d(2,ndim_3d,ndim_3d)
07862       Integer, Intent (In)            :: nbr_corners(ndim_3d)
07863       Type (Enddef_search), Intent (InOut) :: search
07864       Integer, Intent (In)            :: control (2, ndim_3d, search%search_data%npart)
07865       Type (dble_vector), Intent (InOut) :: tgt_cell(ndim_3d)
07866       Integer, Intent (In)            :: tgt_corners
07867       Integer, Intent (In)            :: npoints (ndim_2d, search%search_data%npart)
07868       Integer, Intent (In)            :: ncpl
07869       Type (integer_vector), Intent (In) :: srclocs (2,search%search_data%npart)
07870       Type (logical_vector), Intent (In) :: msklocs (2,search%search_data%npart)
07871       Integer, Intent (In)            :: num_neigh
07872       Double Precision, Intent (In)   :: corner_x (corner_shape_3d (1,1,1):corner_shape_3d(2,1,1), 
07873                                                    corner_shape_3d (1,2,1):corner_shape_3d(2,2,1), 
07874                                                    nbr_corners(1))
07875       Double Precision, Intent (In)   :: corner_y (corner_shape_3d (1,1,2):corner_shape_3d(2,1,2), 
07876                                                    corner_shape_3d (1,2,2):corner_shape_3d(2,2,2), 
07877                                                    nbr_corners(2))
07878       Integer, Intent (Out)           :: nbr_cells(ncpl)
07879       Integer, Intent (Out)           :: ierror
07880     End Subroutine
07881 
07882     subroutine psmile_neigh_near_irr2_3d_dble (grid_id,  &
07883                coords1, coords2, coords3,                  &
07884                x_coords, y_coords, z_coords,               &
07885                coords_shape,                               &
07886                mask_array, mask_shape,  mask_available,    &
07887                sin_values, cos_values, grid_valid_shape,   &
07888                search_mode,                                &
07889                srcloc, nloc, nprev, nsearch,               &
07890                neighbors_3d, num_neigh,                    &
07891                extra_search, ierror)
07892 
07893        Use PSMILe_common
07894 
07895        Integer, Intent (In)            :: grid_id
07896        Integer, Intent (In)            :: nloc, nprev, nsearch, search_mode
07897        Double Precision, Intent (In)   :: coords1 (nloc)
07898        Double Precision, Intent (In)   :: coords2 (nloc)
07899        Double Precision, Intent (In)   :: coords3 (nloc)
07900        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07901        Double Precision, Intent (In)   :: x_coords (*)
07902        Double Precision, Intent (In)   :: y_coords (*)
07903        Double Precision, Intent (In)   :: z_coords (*)
07904        Logical, Intent (In)            :: mask_array (*)
07905        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
07906        Logical, Intent (In)            :: mask_available
07907        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07908        Double Precision, Intent (In)   :: sin_values (*)
07909        Double Precision, Intent (In)   :: cos_values (*)
07910        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
07911        Integer, Intent (In)            :: num_neigh
07912        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
07913        Type (Extra_search_info)        :: extra_search
07914        Integer, Intent (Out)           :: ierror
07915     End Subroutine
07916 
07917     subroutine psmile_neigh_nearx_irr2_3d_dble (grid_id,   &
07918                coords1, coords2, coords3,                  &
07919                x_coords, y_coords, z_coords,               &
07920                coords_shape,                               &
07921                mask_array, mask_shape,  mask_available,    &
07922                sin_values, cos_values, grid_valid_shape,   &
07923                search_mode,                                &
07924                srcloc, nloc, nprev, nsearch,               &
07925                neighbors_3d, num_neigh,                    &
07926                extra_search, ierror)
07927 
07928        Use PSMILe_common
07929 
07930        Integer, Intent (In)            :: grid_id
07931        Integer, Intent (In)            :: nloc, nprev, nsearch, search_mode
07932        Double Precision, Intent (In)   :: coords1 (nloc)
07933        Double Precision, Intent (In)   :: coords2 (nloc)
07934        Double Precision, Intent (In)   :: coords3 (nloc)
07935        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
07936        Double Precision, Intent (In)   :: x_coords (*)
07937        Double Precision, Intent (In)   :: y_coords (*)
07938        Double Precision, Intent (In)   :: z_coords (*)
07939        Logical, Intent (In)            :: mask_array (*)
07940        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
07941        Logical, Intent (In)            :: mask_available
07942        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
07943        Double Precision, Intent (In)   :: sin_values (*)
07944        Double Precision, Intent (In)   :: cos_values (*)
07945        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
07946        Integer, Intent (In)            :: num_neigh
07947        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
07948        Type (Extra_search_info)        :: extra_search
07949        Integer, Intent (Out)           :: ierror
07950     End Subroutine
07951 
07952     subroutine psmile_neigh_near_3d_irr2_dble (grid_id,    &
07953                coords1, coords2, coords3,                  &
07954                x_coords, y_coords, z_coords,               &
07955                coords_shape,                               &
07956                mask_array, mask_shape,  mask_available,    &
07957                sin_values_lon, cos_values_lon,             &
07958                sin_values_lat, cos_values_lat,             &
07959                grid_valid_shape, search_mode,              &
07960                srcloc, srclocz, nlocs, nloc, nprev,        &
07961                neighbors_3d, num_neigh,                    &
07962                extra_search, ierror)
07963 
07964        Use PSMILe_common
07965 
07966        Integer,             Intent (In)  :: grid_id
07967        Integer,             Intent (In)  :: nloc, nprev, search_mode
07968        Integer,             Intent (In)  :: nlocs (ndim_2d)
07969        Double Precision,    Intent (In)  :: coords1 (*)
07970        Double Precision,    Intent (In)  :: coords2 (*)
07971        Double Precision,    Intent (In)  :: coords3 (*)
07972        Integer,             Intent (In)  :: coords_shape (2, ndim_3d)
07973        Double Precision,    Intent (In)  :: x_coords (*)
07974        Double Precision,    Intent (In)  :: y_coords (*)
07975        Double Precision,    Intent (In)  :: z_coords (*)
07976        Logical,             Intent (In)  :: mask_array (*)
07977        Integer,             Intent (In)  :: mask_shape (2, ndim_3d)
07978        Logical,             Intent (In)  :: mask_available
07979        Integer,             Intent (In)  :: grid_valid_shape (2, ndim_3d)
07980        Double Precision,    Intent (In)  :: sin_values_lon (*)
07981        Double Precision,    Intent (In)  :: cos_values_lon (*)
07982        Double Precision,    Intent (In)  :: sin_values_lat (*)
07983        Double Precision,    Intent (In)  :: cos_values_lat (*)
07984        Integer,             Intent (In)  :: srcloc (ndim_2d, nlocs(1))
07985        Integer,             Intent (In)  :: srclocz (nlocs(2))
07986        Integer,             Intent (In)  :: num_neigh
07987        Integer,             Intent (Out) :: neighbors_3d (ndim_3d, nloc, 
07988                                                           num_neigh)
07989        Type (Extra_search_info)          :: extra_search
07990        Integer,             Intent (Out) :: ierror
07991     End Subroutine
07992 
07993     subroutine psmile_neigh_near_3d_irr3_dble (grid_id,    &
07994                coords1, coords2, coords3,                  &
07995                x_coords, y_coords, z_coords,               &
07996                coords_shape,                               &
07997                mask_array, mask_shape,  mask_available,    &
07998                sin_values_lon, cos_values_lon,             &
07999                sin_values_lat, cos_values_lat,             &
08000                grid_valid_shape, search_mode,              &
08001                srcloc, nsearch, nloc, nprev,               &
08002                neighbors_3d, num_neigh,                    &
08003                extra_search, ierror)
08004 
08005        Use PSMILe_common
08006 
08007        Integer,            Intent (In)  :: grid_id
08008        Integer,            Intent (In)  :: nloc, nprev, search_mode
08009        Integer,            Intent (In)  :: nsearch
08010        Double Precision,   Intent (In)  :: coords1 (*)
08011        Double Precision,   Intent (In)  :: coords2 (*)
08012        Double Precision,   Intent (In)  :: coords3 (*)
08013        Integer,            Intent (In)  :: coords_shape (2, ndim_3d)
08014        Double Precision,   Intent (In)  :: x_coords (*)
08015        Double Precision,   Intent (In)  :: y_coords (*)
08016        Double Precision,   Intent (In)  :: z_coords (*)
08017        Logical,            Intent (In)  :: mask_array (*)
08018        Integer,            Intent (In)  :: mask_shape (2, ndim_3d)
08019        Logical,            Intent (In)  :: mask_available
08020        Integer,            Intent (In)  :: grid_valid_shape (2, ndim_3d)
08021        Double Precision,   Intent (In)  :: sin_values_lon (*)
08022        Double Precision,   Intent (In)  :: cos_values_lon (*)
08023        Double Precision,   Intent (In)  :: sin_values_lat (*)
08024        Double Precision,   Intent (In)  :: cos_values_lat (*)
08025        Integer,            Intent (In)  :: srcloc (ndim_3d, nloc)
08026        Integer,            Intent (In)  :: num_neigh
08027        Integer,            Intent (Out) :: neighbors_3d (ndim_3d, nloc, 
08028                                                           num_neigh)
08029        Type (Extra_search_info)         :: extra_search
08030        Integer,            Intent (Out) :: ierror
08031     End Subroutine
08032 
08033     subroutine psmile_neigh_near_3d_reg_dble (grid_id,     &
08034                coords1, coords2, coords3,                  &
08035                x_coords, y_coords, z_coords,               &
08036                coords_shape,                               &
08037                mask_array, mask_shape,  mask_available,    &
08038                sin_values_lon, cos_values_lon,             &
08039                sin_values_lat, cos_values_lat,             &
08040                grid_valid_shape, search_mode,              &
08041                srclocs, nlocs, nloc, nprev,                &
08042                neighbors_3d, num_neigh,                    &
08043                extra_search, ierror)
08044 
08045        Use PSMILe_common
08046 
08047        Integer, Intent (In)            :: grid_id
08048        Integer, Intent (In)            :: nloc, nprev, search_mode
08049        Integer, Intent (In)            :: nlocs (ndim_3d)
08050        Double Precision, Intent (In)   :: coords1 (*)
08051        Double Precision, Intent (In)   :: coords2 (*)
08052        Double Precision, Intent (In)   :: coords3 (*)
08053        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
08054        Double Precision, Intent (In)   :: x_coords (*)
08055        Double Precision, Intent (In)   :: y_coords (*)
08056        Double Precision, Intent (In)   :: z_coords (*)
08057        Logical, Intent (In)            :: mask_array (*)
08058        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
08059        Logical, Intent (In)            :: mask_available
08060        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
08061        Double Precision, Intent (In)   :: sin_values_lon (*)
08062        Double Precision, Intent (In)   :: cos_values_lon (*)
08063        Double Precision, Intent (In)   :: sin_values_lat (*)
08064        Double Precision, Intent (In)   :: cos_values_lat (*)
08065        Type (integer_vector), Intent (In) :: srclocs (ndim_3d)
08066        Integer, Intent (In)            :: num_neigh
08067        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
08068        Type (Extra_search_info)        :: extra_search
08069        Integer, Intent (Out)           :: ierror
08070     End Subroutine
08071 
08072     subroutine psmile_neigh_nearx_3d_irr2_dble (grid_id,   &
08073                coords1, coords2, coords3,                  &
08074                x_coords, y_coords, z_coords,               &
08075                coords_shape,                               &
08076                mask_array, mask_shape,  mask_available,    &
08077                sin_values_lon, cos_values_lon,             &
08078                sin_values_lat, cos_values_lat,             &
08079                grid_valid_shape, search_mode,              &
08080                srcloc, srclocz, nlocs, nloc, nprev,        &
08081                neighbors_3d, num_neigh,                    &
08082                extra_search, ierror)
08083 
08084        Use PSMILe_common
08085 
08086        Integer, Intent (In)             :: grid_id
08087        Integer,            Intent (In)  :: nloc, nprev, search_mode
08088        Integer,            Intent (In)  :: nlocs (ndim_2d)
08089        Double Precision,   Intent (In)  :: coords1 (*)
08090        Double Precision,   Intent (In)  :: coords2 (*)
08091        Double Precision,   Intent (In)  :: coords3 (*)
08092        Integer,            Intent (In)  :: coords_shape (2, ndim_3d)
08093        Double Precision,   Intent (In)  :: x_coords (*)
08094        Double Precision,   Intent (In)  :: y_coords (*)
08095        Double Precision,   Intent (In)  :: z_coords (*)
08096        Logical,            Intent (In)  :: mask_array (*)
08097        Integer,            Intent (In)  :: mask_shape (2, ndim_3d)
08098        Logical,            Intent (In)  :: mask_available
08099        Integer,            Intent (In)  :: grid_valid_shape (2, ndim_3d)
08100        Double Precision,   Intent (In)  :: sin_values_lon (*)
08101        Double Precision,   Intent (In)  :: cos_values_lon (*)
08102        Double Precision,   Intent (In)  :: sin_values_lat (*)
08103        Double Precision,   Intent (In)  :: cos_values_lat (*)
08104        Integer,            Intent (In)  :: srcloc (ndim_2d, nlocs(1))
08105        Integer,            Intent (In)  :: srclocz (nlocs(2))
08106        Integer,            Intent (In)  :: num_neigh
08107        Integer,            Intent (Out) :: neighbors_3d (ndim_3d, nloc, num_neigh)
08108        Type (Extra_search_info)         :: extra_search
08109        Integer,            Intent (Out) :: ierror
08110     End Subroutine
08111 
08112     subroutine psmile_neigh_nearx_3d_irr3_dble (grid_id,   &
08113                coords1, coords2, coords3,                  &
08114                x_coords, y_coords, z_coords,               &
08115                coords_shape,                               &
08116                mask_array, mask_shape,  mask_available,    &
08117                sin_values_lon, cos_values_lon,             &
08118                sin_values_lat, cos_values_lat,             &
08119                grid_valid_shape, search_mode,              &
08120                srcloc, nsearch, nloc, nprev,               &
08121                neighbors_3d, num_neigh,                    &
08122                extra_search, ierror)
08123 
08124        Use PSMILe_common
08125 
08126        Integer, Intent (In)             :: grid_id
08127        Integer,            Intent (In)  :: nloc, nprev, search_mode
08128        Integer,            Intent (In)  :: nsearch
08129        Double Precision,   Intent (In)  :: coords1 (*)
08130        Double Precision,   Intent (In)  :: coords2 (*)
08131        Double Precision,   Intent (In)  :: coords3 (*)
08132        Integer,            Intent (In)  :: coords_shape (2, ndim_3d)
08133        Double Precision,   Intent (In)  :: x_coords (*)
08134        Double Precision,   Intent (In)  :: y_coords (*)
08135        Double Precision,   Intent (In)  :: z_coords (*)
08136        Logical,            Intent (In)  :: mask_array (*)
08137        Integer,            Intent (In)  :: mask_shape (2, ndim_3d)
08138        Logical,            Intent (In)  :: mask_available
08139        Integer,            Intent (In)  :: grid_valid_shape (2, ndim_3d)
08140        Double Precision,   Intent (In)  :: sin_values_lon (*)
08141        Double Precision,   Intent (In)  :: cos_values_lon (*)
08142        Double Precision,   Intent (In)  :: sin_values_lat (*)
08143        Double Precision,   Intent (In)  :: cos_values_lat (*)
08144        Integer,            Intent (In)  :: srcloc (ndim_3d, nloc)
08145        Integer,            Intent (In)  :: num_neigh
08146        Integer,            Intent (Out) :: neighbors_3d (ndim_3d, nloc, num_neigh)
08147        Type (Extra_search_info)         :: extra_search
08148        Integer,            Intent (Out) :: ierror
08149     End Subroutine
08150 
08151     subroutine psmile_neigh_nearx_3d_reg_dble (grid_id,    &
08152                coords1, coords2, coords3,                  &
08153                x_coords, y_coords, z_coords,               &
08154                coords_shape,                               &
08155                mask_array, mask_shape,  mask_available,    &
08156                sin_values_lon, cos_values_lon,             &
08157                sin_values_lat, cos_values_lat,             &
08158                grid_valid_shape, search_mode,              &
08159                srclocs, nlocs, nloc, nprev,                &
08160                neighbors_3d, num_neigh,                    &
08161                extra_search, ierror)
08162 
08163        Use PSMILe_common
08164 
08165        Integer, Intent (In)            :: grid_id
08166        Integer, Intent (In)            :: nloc, nprev, search_mode
08167        Integer, Intent (In)            :: nlocs (ndim_3d)
08168        Double Precision, Intent (In)   :: coords1 (*)
08169        Double Precision, Intent (In)   :: coords2 (*)
08170        Double Precision, Intent (In)   :: coords3 (*)
08171        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
08172        Double Precision, Intent (In)   :: x_coords (*)
08173        Double Precision, Intent (In)   :: y_coords (*)
08174        Double Precision, Intent (In)   :: z_coords (*)
08175        Logical, Intent (In)            :: mask_array (*)
08176        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
08177        Logical, Intent (In)            :: mask_available
08178        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
08179        Double Precision, Intent (In)   :: sin_values_lon (*)
08180        Double Precision, Intent (In)   :: cos_values_lon (*)
08181        Double Precision, Intent (In)   :: sin_values_lat (*)
08182        Double Precision, Intent (In)   :: cos_values_lat (*)
08183        Type (integer_vector), Intent (In) :: srclocs (ndim_3d)
08184        Integer, Intent (In)            :: num_neigh
08185        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
08186        Type (Extra_search_info)        :: extra_search
08187        Integer, Intent (Out)           :: ierror
08188     End Subroutine
08189 
08190     subroutine psmile_neigh_nearx_sub_irr_dble (           &
08191                            grid_id,                        &
08192                            x_coords, y_coords, z_coords,   &
08193                            coords_shape,                   &
08194                            mask_array, mask_shape,  mask_available,    &
08195                            sin_values, cos_values,         &
08196                            grid_valid_shape, search_mode,  &
08197                            neighbors_3d, num_neigh, nloc,  &
08198                            extra_search,                   &
08199                            ijk, sin_search, cos_search,    &
08200                            z_search, jbeg, jend, width, ierror)
08201 
08202        Use PSMILe_common
08203 
08204        Integer,            Intent (In)   :: grid_id
08205        Integer,            Intent (In)   :: search_mode
08206        Integer,            Intent (In)   :: coords_shape (2, ndim_3d)
08207        Double Precision,   Intent (In)   :: x_coords (*)
08208        Double Precision,   Intent (In)   :: y_coords (*)
08209        Double Precision,   Intent (In)   :: z_coords (*)
08210        Logical,            Intent (In)   :: mask_array (*)
08211        Integer,            Intent (In)   :: mask_shape (2, ndim_3d)
08212        Logical,            Intent (In)   :: mask_available
08213        Integer,            Intent (In)   :: grid_valid_shape (2, ndim_3d)
08214        Double Precision,   Intent (In)   :: sin_values (*)
08215        Double Precision,   Intent (In)   :: cos_values (*)
08216        Integer,            Intent (In)   :: nloc, num_neigh
08217        Type (Extra_search_info), Intent (InOut) :: extra_search
08218        Integer,            Intent (In)   :: jbeg, jend
08219        Integer,            Intent (In)   :: ijk (ndim_3d, jbeg:jend)
08220        Integer,            Intent (In)   :: width (ndim_3d)
08221        Double Precision,   Intent (In)   :: sin_search (jbeg:jend, 2)
08222        Double Precision,   Intent (In)   :: cos_search (jbeg:jend, 2)
08223        Double Precision,   Intent (In)   :: z_search   (jbeg:jend)
08224        Integer,            Intent (Out)  :: neighbors_3d (ndim_3d, nloc, num_neigh)
08225        Integer,            Intent (Out)  :: ierror
08226     End Subroutine
08227 
08228     subroutine psmile_neigh_nearx_sub_reg_dble (           &
08229                            grid_id,                        &
08230                            x_coords, y_coords, z_coords,   &
08231                            coords_shape,                   &
08232                            mask_array, mask_shape,  mask_available,    &
08233                            sin_values_lon, cos_values_lon, &
08234                            sin_values_lat, cos_values_lat, &
08235                            grid_valid_shape, search_mode,  &
08236                            neighbors_3d, num_neigh, nloc,  &
08237                            extra_search,                   &
08238                            ijk, sin_search, cos_search,    &
08239                            z_search, jbeg, jend, width, ierror)
08240 
08241        Use PSMILe_common
08242 
08243        Integer, Intent (In)              :: grid_id
08244        Integer,            Intent (In)   :: search_mode
08245        Integer,            Intent (In)   :: coords_shape (2, ndim_3d)
08246        Double Precision,   Intent (In)   :: x_coords (*)
08247        Double Precision,   Intent (In)   :: y_coords (*)
08248        Double Precision,   Intent (In)   :: z_coords (*)
08249        Logical,            Intent (In)   :: mask_array (*)
08250        Integer,            Intent (In)   :: mask_shape (2, ndim_3d)
08251        Logical,            Intent (In)   :: mask_available
08252        Integer,            Intent (In)   :: grid_valid_shape (2, ndim_3d)
08253        Double Precision,   Intent (In)   :: sin_values_lon (*)
08254        Double Precision,   Intent (In)   :: cos_values_lon (*)
08255        Double Precision,   Intent (In)   :: sin_values_lat (*)
08256        Double Precision,   Intent (In)   :: cos_values_lat (*)
08257        Integer,            Intent (In)   :: nloc, num_neigh
08258        Type (Extra_search_info), Intent(In) :: extra_search
08259        Integer,            Intent (In)   :: jbeg, jend
08260        Integer,            Intent (In)   :: ijk (ndim_3d, jbeg:jend)
08261        Integer,            Intent (In)   :: width (ndim_3d)
08262        Double Precision,   Intent (In)   :: sin_search (jbeg:jend, 2)
08263        Double Precision,   Intent (In)   :: cos_search (jbeg:jend, 2)
08264        Double Precision,   Intent (In)   :: z_search   (jbeg:jend)
08265        Integer,            Intent (Out)  :: neighbors_3d (ndim_3d, nloc, num_neigh)
08266        Integer,            Intent (Out)  :: ierror
08267     End Subroutine
08268 
08269     subroutine psmile_neigh_nearest_3d_dble (grid_id,         &
08270                     coords1, coords2, coords3,                &
08271                     x_coords, y_coords, z_coords,             &
08272                     coords_shape,                             &
08273                     mask_array, mask_shape,  mask_available,  &
08274                     sin_values, cos_values, grid_valid_shape, &
08275                     srcloc, nloc, nprev, nsearch,             &
08276                     neighbors_3d, num_neigh,                  &
08277                     extra_search, ierror)
08278 
08279        Use PSMILe_common
08280 
08281        Integer, Intent (In)            :: grid_id
08282        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
08283        Integer, Intent (In)            ::   mask_shape (2, ndim_3d)
08284        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
08285        Double Precision, Intent (In)   :: x_coords (*)
08286        Double Precision, Intent (In)   :: y_coords (*)
08287        Double Precision, Intent (In)   :: z_coords (*)
08288        Logical, Intent (In)            :: mask_array (*)
08289        Logical, Intent (In)            :: mask_available
08290        Double Precision, Intent (In)   :: sin_values (*)
08291        Double Precision, Intent (In)   :: cos_values (*)
08292        Integer, Intent (In)            :: nloc, nprev, nsearch
08293        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
08294        Double Precision, Intent (In)   :: coords1 (nloc)
08295        Double Precision, Intent (In)   :: coords2 (nloc)
08296        Double Precision, Intent (In)   :: coords3 (nloc)
08297        Integer, Intent (In)            :: num_neigh
08298 !
08299        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
08300        Type (Extra_search_info)        :: extra_search
08301        Integer, Intent (Out)           :: ierror
08302     End Subroutine
08303 
08304     subroutine psmile_neigh_nearestx_3d_dble (grid_id,     &
08305                coords1, coords2, coords3,                  &
08306                x_coords, y_coords, z_coords,               &
08307                coords_shape,                               &
08308                mask_array, mask_shape,  mask_available,    &
08309                sin_values, cos_values, grid_valid_shape,   &
08310                srcloc, nloc, nprev, nsearch,               &
08311                neighbors_3d, num_neigh,                    &
08312                extra_search, ierror)
08313 
08314        Use PSMILe_common
08315 
08316        Integer, Intent (In)            :: grid_id
08317        Integer, Intent (In)            :: nloc, nprev, nsearch
08318        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
08319        Integer, Intent (In)            :: mask_shape (2, ndim_3d)
08320        Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
08321        Double Precision, Intent (In)   :: coords1 (nloc)
08322        Double Precision, Intent (In)   :: coords2 (nloc)
08323        Double Precision, Intent (In)   :: coords3 (nloc)
08324        Double Precision, Intent (In)   :: x_coords (*)
08325        Double Precision, Intent (In)   :: y_coords (*)
08326        Double Precision, Intent (In)   :: z_coords (*)
08327        Logical, Intent (In)            :: mask_array (*)
08328        Logical, Intent (In)            :: mask_available
08329        Double Precision, Intent (In)   :: sin_values (*)
08330        Double Precision, Intent (In)   :: cos_values (*)
08331        Integer, Intent (In)            :: srcloc (ndim_3d, nloc)
08332        Integer, Intent (In)            :: num_neigh
08333        Integer, Intent (Out)           :: neighbors_3d (ndim_3d, nloc, num_neigh)
08334 !
08335        Type (Extra_search_info)        :: extra_search
08336        Integer, Intent (Out)           :: ierror
08337     End Subroutine
08338 
08339     subroutine psmile_mg_coarse_1d_dble (lev, chmin, chmax,        &
08340                                          found, locations, coords, &
08341                                          ibeg, iend)
08342        Integer, Intent (In)            :: lev
08343        Double Precision, Intent (In)   :: chmin (0:0), chmax (0:0)
08344        Integer, Intent (InOut)         :: ibeg, iend
08345        Integer, Intent (InOut)         :: found (iend)
08346        Integer, Intent (InOut)         :: locations (iend)
08347        Double Precision, Intent (In)   :: coords (iend)
08348     End Subroutine
08349 
08350     subroutine psmile_mg_coarse_2d_dble (lev, chmin, chmax,         &
08351                                          found, locations, coords1, &
08352                                          coords2, ibeg, iend)
08353        Use PSMILe_common
08354 
08355        Integer, Intent (In)            :: lev
08356        Type (dble_vector), Intent (In) :: chmin (ndim_2d), chmax (ndim_2d)
08357        Integer, Intent (InOut)         :: ibeg, iend
08358        Integer, Intent (InOut)         :: found (iend)
08359        Integer, Intent (InOut)         :: locations (iend)
08360        Double Precision, Intent (In)   :: coords1 (iend)
08361        Double Precision, Intent (In)   :: coords2 (iend)
08362     End Subroutine
08363 
08364     subroutine psmile_mg_coarse_3d_dble (lev, chmin, chmax,         &
08365                                          found, locations, coords1, &
08366                                          coords2, coords3, ibeg, iend)
08367        Use PSMILe_common
08368 
08369        Integer, Intent (In)            :: lev
08370        Type (dble_vector), Intent (In) :: chmin (ndim_3d), chmax (ndim_3d)
08371        Integer, Intent (InOut)         :: ibeg, iend
08372        Integer, Intent (InOut)         :: found (iend)
08373        Integer, Intent (InOut)         :: locations (iend)
08374        Double Precision, Intent (In)   :: coords1 (iend)
08375        Double Precision, Intent (In)   :: coords2 (iend)
08376        Double Precision, Intent (In)   :: coords3 (iend)
08377     End Subroutine
08378 
08379     subroutine psmile_mg_next_level_1d_dble (grid_id, idim,        &
08380                                      lev, nlev,                      &
08381                                      chmin, chmax, midp, levdim,     &
08382                                      found, loc, coords, ibeg, iend, &
08383                                      ijkinc, ijkcoa, ierror)
08384 
08385        Use PSMILe_common
08386        Integer, Intent (In)            :: grid_id
08387        Integer, Intent (In)            :: idim, levdim
08388        Integer, Intent (In)            :: lev, nlev, ijkinc, ijkcoa
08389        Double Precision, Intent (In)   :: chmin (0:levdim)
08390        Double Precision, Intent (In)   :: chmax (0:levdim)
08391        Double Precision, Intent (In)   :: midp  (0:levdim)
08392        Integer, Intent (InOut)         :: ibeg, iend
08393        Integer, Intent (InOut)         :: found (iend)
08394        Integer, Intent (InOut)         :: loc   (iend)
08395        Double Precision, Intent (In)   :: coords (iend)
08396        Integer, Intent (Out)           :: ierror
08397     End Subroutine
08398 
08399     subroutine psmile_mg_next_level_2d_dble (grid_id, lev, nlev,   &
08400                                      chmin1, chmin2,                 &
08401                                      chmax1, chmax2,                 &
08402                                      midp1,  midp2,                  &
08403                                      levdim,                         &
08404                                      found, loc, range,              &
08405                                      coords1, coords2,               &
08406                                      shape, control,                 &
08407                                      ijkinc, ijkcoa, ierror)
08408 
08409        Use PSMILe_common
08410        Integer, Intent (In)            :: grid_id
08411        Integer, Intent (In)            :: levdim (ndim_2d)
08412        Integer, Intent (In)            :: lev, nlev
08413        Integer, Intent (In)            :: ijkinc(ndim_3d), ijkcoa(ndim_2d)
08414        Double Precision, Intent (In)   :: chmin1 (*), chmin2 (*)
08415        Double Precision, Intent (In)   :: chmax1 (*), chmax2 (*)
08416        Double Precision, Intent (In)   :: midp1  (*), midp2  (*)
08417        Integer, Intent (InOut)         :: found (*)
08418        Integer, Intent (InOut)         :: loc   (2, *)
08419        Integer, Intent (In)            :: range (2, ndim_3d)
08420        Double Precision, Intent (In)   :: coords1 (*)
08421        Double Precision, Intent (In)   :: coords2 (*)
08422        Integer, Intent (In)            :: shape (2, ndim_3d)
08423        Integer, Intent (InOut)         :: control (2, ndim_3d)
08424        Integer, Intent (Out)           :: ierror
08425     End Subroutine
08426 
08427     subroutine psmile_mg_next_level_3d_dble (grid_id, lev, nlev,     &
08428                                      chmin1, chmin2, chmin3,         &
08429                                      chmax1, chmax2, chmax3,         &
08430                                      midp1,  midp2,  midp3,          &
08431                                      levdim,                         &
08432                                      found, loc, range,              &
08433                                      coords1, coords2, coords3,      &
08434                                      shape, control,                 &
08435                                      ijkinc, ijkcoa, ierror)
08436 
08437        Use PSMILe_common
08438        Integer, Intent (In)            :: grid_id
08439        Integer, Intent (In)            :: levdim (ndim_3d)
08440        Integer, Intent (In)            :: lev, nlev
08441        Integer, Intent (In)            :: ijkinc(ndim_3d), ijkcoa(ndim_3d)
08442        Double Precision, Intent (In)   :: chmin1 (*), chmin2 (*), chmin3 (*)
08443        Double Precision, Intent (In)   :: chmax1 (*), chmax2 (*), chmax3 (*)
08444        Double Precision, Intent (In)   :: midp1  (*), midp2  (*), midp3  (*)
08445        Integer, Intent (InOut)         :: found (*)
08446        Integer, Intent (InOut)         :: loc   (ndim_3d, *)
08447        Integer, Intent (In)            :: range (2, ndim_3d)
08448        Double Precision, Intent (In)   :: coords1 (*)
08449        Double Precision, Intent (In)   :: coords2 (*)
08450        Double Precision, Intent (In)   :: coords3 (*)
08451        Integer, Intent (In)            :: shape (2, ndim_3d)
08452        Integer, Intent (InOut)         :: control (2, ndim_3d)
08453        Integer, Intent (Out)           :: ierror
08454     End Subroutine
08455 
08456     subroutine psmile_mg_prev_levels_1d_dble (grid_id, idim, &
08457                            lev, nlev,                        &
08458                            lstijk, xyz, found, newijk)
08459        Use PSMILe_common
08460        Integer, Intent (In)            :: grid_id
08461        Integer, Intent (In)            :: idim
08462        Integer, Intent (In)            :: lev, nlev
08463        Integer, Intent (In)            :: lstijk
08464        Double Precision, Intent (In)   :: xyz
08465        Integer, Intent (Out)           :: found, newijk
08466     End Subroutine
08467 
08468     subroutine psmile_mg_prev_levels_2d_dble (grid_id, &
08469                            lev, nlev,                  &
08470                            lstijk, xyz, found, newijk, nc)
08471        Use PSMILe_Common
08472        Integer,          Intent (In)   :: grid_id
08473        Integer,          Intent (In)   :: lev, nlev, nc
08474        Integer,          Intent (In)   :: lstijk (ndim_2d, nc)
08475        Double Precision, Intent (In)   :: xyz (ndim_2d, nc)
08476        Integer,          Intent (Out)  :: found (nc), newijk (ndim_2d, nc)
08477     End Subroutine
08478 
08479     subroutine psmile_mg_prev_levels_3d_dble (grid_id, &
08480                            lev, nlev,                  &
08481                            lstijk, xyz, found, newijk)
08482        Use PSMILe_common
08483        Integer, Intent (In)            :: grid_id
08484        Integer, Intent (In)            :: lev, nlev
08485        Integer, Intent (In)            :: lstijk (ndim_3d)
08486        Double Precision, Intent (In)   :: xyz (ndim_3d)
08487        Integer, Intent (Out)           :: found, newijk (ndim_3d)
08488     End Subroutine
08489 
08490     subroutine psmile_mg_cells_1d_dble ( nlev, found, loc, range,    &
08491                                          search_grid_type,           &
08492                                          corners1, search_dim,       &
08493                                          shape, control,             &
08494                                          grid_valid_shape, cyclic,   &
08495                                          chmin, chmax, tol, ierror )
08496       Use PSMILe_common
08497       Integer, Intent (In)            :: nlev
08498       Integer, Intent (In)            :: search_grid_type
08499       Integer, Intent (In)            :: range (2, ndim_3d)
08500       Integer, Intent (In)            :: shape (2, ndim_3d)
08501       Integer, Intent (InOut)         :: found (range(1,1):range(2,1), 
08502                                                 range(1,2):range(2,2), 
08503                                                 range(1,3):range(2,3))
08504       Integer, Intent (InOut)         :: loc   (range(1,1):range(2,1), 
08505                                                 range(1,2):range(2,2), 
08506                                                 range(1,3):range(2,3))
08507       Double Precision, Intent (In)   :: corners1 (shape(1,1):shape(2,1), 
08508                                                    shape(1,2):shape(2,2), 
08509                                                    shape(1,3):shape(2,3))
08510       Integer, Intent (In)            :: control (2, ndim_3d)
08511       Integer,          Intent (In)   :: search_dim
08512       Integer,          Intent (In)   :: grid_valid_shape (2)
08513       Logical,          Intent (In)   :: cyclic
08514       Double Precision, Intent (In)   :: chmin (grid_valid_shape(1): 
08515                                                 grid_valid_shape(2)+2)
08516       Double Precision, Intent (In)   :: chmax (grid_valid_shape(1): 
08517                                                 grid_valid_shape(2)+2)
08518       Double Precision, Intent (In)   :: tol
08519       Integer, Intent (Out)           :: ierror
08520     End Subroutine
08521 
08522     subroutine psmile_mg_cells_2d_dble ( grid_id, search_grid_type,                &
08523                                          found, loc, loc_fnd_shape,                &
08524                                          tgt_src_corners_x, tgt_src_corners_y,     &
08525                                          src_corner_shape, control,                &
08526                                          grid_valid_shape,                         &
08527                                          ipart, corner_shape, nbr_corners,         &
08528                                          src_corners_x, src_corners_y,             &
08529                                          chmin1, chmax1, chmin2, chmax2,           &
08530                                          tol, ierror )
08531       Use PSMILe_common
08532       Integer, Intent (In)            :: grid_id
08533       Integer, Intent (In)            :: search_grid_type
08534       Integer, Intent (In)            :: loc_fnd_shape (2, ndim_3d)
08535       Integer, Intent (In)            :: src_corner_shape (2, ndim_3d)
08536       Integer, Intent (In)            :: grid_valid_shape(2,ndim_2d)
08537       Integer, Intent (InOut)         :: found (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
08538                                                 loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
08539                                                 loc_fnd_shape(1,3):loc_fnd_shape(2,3))
08540       Integer, Intent (InOut)         :: loc   (ndim_2d,                               
08541                                                 loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
08542                                                 loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
08543                                                 loc_fnd_shape(1,3):loc_fnd_shape(2,3))
08544       Double Precision, Intent (In)   :: tgt_src_corners_x (                           
08545                                           src_corner_shape(1,1):src_corner_shape(2,1), 
08546                                           src_corner_shape(1,2):src_corner_shape(2,2), 
08547                                           src_corner_shape(1,3):src_corner_shape(2,3))
08548       Double Precision, Intent (In)   :: tgt_src_corners_y (                           
08549                                           src_corner_shape(1,1):src_corner_shape(2,1), 
08550                                           src_corner_shape(1,2):src_corner_shape(2,2), 
08551                                           src_corner_shape(1,3):src_corner_shape(2,3))
08552       Integer, Intent (In)            :: control (2, ndim_3d)
08553       Integer,          Intent (In)   :: ipart
08554       Integer,          Intent (In)   :: corner_shape (2,2)
08555       Integer,          Intent (In)   :: nbr_corners
08556       Double Precision, Intent (In)   :: src_corners_x (                        
08557                                           corner_shape (1,1):corner_shape(2,1), 
08558                                           corner_shape (1,2):corner_shape(2,2), 
08559                                           nbr_corners)
08560       Double Precision, Intent (In)   :: src_corners_y (                        
08561                                           corner_shape (1,1):corner_shape(2,1), 
08562                                           corner_shape (1,2):corner_shape(2,2), 
08563                                           nbr_corners)
08564       Double Precision, Intent (InOut):: chmin1 (grid_valid_shape(1,1):    
08565                                                  grid_valid_shape(2,1)+1 , 
08566                                                  grid_valid_shape(1,2):    
08567                                                  grid_valid_shape(2,2)+1)
08568       Double Precision, Intent (InOut):: chmin2 (grid_valid_shape(1,1):    
08569                                                  grid_valid_shape(2,1)+1,  
08570                                                  grid_valid_shape(1,2):    
08571                                                  grid_valid_shape(2,2)+1)
08572       Double Precision, Intent (InOut):: chmax1 (grid_valid_shape(1,1):    
08573                                                  grid_valid_shape(2,1)+1 , 
08574                                                  grid_valid_shape(1,2):    
08575                                                  grid_valid_shape(2,2)+1)
08576       Double Precision, Intent (InOut):: chmax2 (grid_valid_shape(1,1):    
08577                                                  grid_valid_shape(2,1)+1,  
08578                                                  grid_valid_shape(1,2):    
08579                                                  grid_valid_shape(2,2)+1)
08580       Double Precision, Intent (In)   :: tol
08581       Integer, Intent (Out)           :: ierror
08582     End Subroutine
08583 
08584 
08585 
08586     subroutine psmile_mg_control_cell_1d_dble (            &
08587                            chmin, chmax, midp, levdim,     &
08588                            ijk, xyz, nold, all, wide, found, newijk)
08589        Use PSMILe_common
08590 
08591        Integer, Intent (In)            :: levdim
08592        Double Precision, Intent (In)   :: chmin (0:levdim)
08593        Double Precision, Intent (In)   :: chmax (0:levdim)
08594        Double Precision, Intent (In)   :: midp  (0:levdim)
08595        Integer, Intent (In)            :: ijk, nold
08596        Logical, Intent (In)            :: all, wide
08597        Double Precision, Intent (In)   :: xyz
08598        Integer, Intent (Out)           :: found, newijk
08599     End Subroutine
08600 
08601     subroutine psmile_mg_control_cell_2d_dble (     &
08602                     chmin1, chmin2,                 &
08603                     chmax1, chmax2,                 &
08604                     midp1,  midp2,                  &
08605                     levdim,                         &
08606                     ijk, xyz, nold, ignore, wide, found, newijk)
08607        Use PSMILe_common
08608 
08609        Double Precision, Intent (In)   :: chmin1 (*), chmin2 (*)
08610        Double Precision, Intent (In)   :: chmax1 (*), chmax2 (*)
08611        Double Precision, Intent (In)   :: midp1  (*), midp2  (*)
08612        Integer, Intent (In)            :: levdim (ndim_2d)
08613        Integer, Intent (In)            :: ijk(ndim_2d), nold
08614        Integer, Intent (In)            :: ignore(ndim_2d)
08615        Logical, Intent (In)            :: wide
08616        Double Precision, Intent (In)   :: xyz(ndim_2d)
08617        Integer, Intent (Out)           :: found, newijk(ndim_2d)
08618     End Subroutine
08619 
08620     subroutine psmile_mg_control_cell_3d_dble (            &
08621                            chmin1, chmin2, chmin3,         &
08622                            chmax1, chmax2, chmax3,         &
08623                            midp1,  midp2,  midp3,          &
08624                            levdim,                         &
08625                            ijk, xyz, nold, all, wide, found, newijk)
08626        Use PSMILe_common
08627 
08628        Double Precision, Intent (In)   :: chmin1 (*), chmin2 (*), chmin3 (*)
08629        Double Precision, Intent (In)   :: chmax1 (*), chmax2 (*), chmax3 (*)
08630        Double Precision, Intent (In)   :: midp1  (*), midp2  (*), midp3  (*)
08631        Integer, Intent (In)            :: levdim (ndim_3d)
08632        Integer, Intent (In)            :: ijk(ndim_3d), nold
08633        Logical, Intent (In)            :: all, wide
08634        Double Precision, Intent (In)   :: xyz(ndim_3d)
08635        Integer, Intent (Out)           :: found, newijk(ndim_3d)
08636     End Subroutine
08637 
08638     subroutine psmile_mg_final_2d_dble (grid_id, nlev,             &
08639                     chmin1, chmin2, chmax1, chmax2,                &
08640                     midp1,  midp2,  levdim,                        &
08641                     found, loc, range,                             &
08642                     coords1, coords2, shape, control,              &
08643                     corners1, corners2, corner_shape, nbr_corners, &
08644                     tol, ierror)
08645        Use PSMILe_common
08646 
08647        Integer,          Intent (In)    :: grid_id, nlev
08648        Integer,          Intent (In)    :: levdim (ndim_2d)
08649        Double Precision, Intent (In)    :: chmin1 (0:levdim(1), 
08650                                                    0:levdim(2))
08651        Double Precision, Intent (In)    :: chmin2 (0:levdim(1), 
08652                                                    0:levdim(2))
08653        Double Precision, Intent (In)    :: chmax1 (0:levdim(1), 
08654                                                    0:levdim(2))
08655        Double Precision, Intent (In)    :: chmax2 (0:levdim(1), 
08656                                                    0:levdim(2))
08657        Double Precision, Intent (In)    :: midp1  (0:levdim(1), 
08658                                                    0:levdim(2))
08659        Double Precision, Intent (In)    :: midp2  (0:levdim(1), 
08660                                                    0:levdim(2))
08661        Integer,          Intent (In)    :: range (2, ndim_3d)
08662        Integer,          Intent (In)    :: shape (2, ndim_3d)
08663        Integer,          Intent (InOut) :: found (range(1,1):range(2,1), 
08664                                                   range(1,2):range(2,2), 
08665                                                   range(1,3):range(2,3))
08666        Integer,          Intent (InOut) :: loc   (ndim_2d,               
08667                                                   range(1,1):range(2,1), 
08668                                                   range(1,2):range(2,2), 
08669                                                   range(1,3):range(2,3))
08670        Double Precision, Intent (In)    :: coords1 (shape(1,1):shape(2,1), 
08671                                                     shape(1,2):shape(2,2), 
08672                                                     shape(1,3):shape(2,3))
08673        Double Precision, Intent (In)    :: coords2 (shape(1,1):shape(2,1), 
08674                                                     shape(1,2):shape(2,2), 
08675                                                     shape(1,3):shape(2,3))
08676        Integer,          Intent (In)    :: control (2, ndim_3d)
08677        Integer,          Intent (In)    :: corner_shape (2, ndim_2d)
08678        Integer,          Intent (In)    :: nbr_corners
08679        Double Precision, Intent (In)    ::                 
08680           corners1 ( corner_shape(1,1):corner_shape(2,1), 
08681                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
08682        Double Precision, Intent (In)    ::                 
08683           corners2 ( corner_shape(1,1):corner_shape(2,1), 
08684                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
08685        Double Precision, Intent (In)    :: tol
08686        Integer,          Intent (Out)   :: ierror
08687     End Subroutine
08688 
08689     subroutine psmile_mg_final_3d_dble (comp_info, nlev,             &
08690                                      found, loc, range,              &
08691                                      coords1, coords2, coords3,      &
08692                                      shape, control,                 &
08693                                      grid_id,                        &
08694                                      x_coords, y_coords, z_coords,   &
08695                                      coords_shape,                   &
08696                                      nbr_corners,                    &
08697                                      ijk0, tol, ierror)
08698 
08699        Use PSMILe_common
08700 
08701        Type (Enddef_comp), Intent (In) :: comp_info
08702        Integer, Intent (In)            :: nlev
08703        Integer, Intent (InOut)         :: found (*)
08704        Integer, Intent (InOut)         :: loc   (ndim_3d, *)
08705        Integer, Intent (In)            :: range (2, ndim_3d)
08706        Double Precision, Intent (In)   :: coords1 (*)
08707        Double Precision, Intent (In)   :: coords2 (*)
08708        Double Precision, Intent (In)   :: coords3 (*)
08709        Integer, Intent (In)            :: shape (2, ndim_3d)
08710        Integer, Intent (InOut)         :: control (2, ndim_3d)
08711        Integer, Intent (In)            :: grid_id
08712        Integer, Intent (In)            :: coords_shape (2, ndim_3d)
08713        Double Precision, Intent (In)   :: x_coords (*)
08714        Double Precision, Intent (In)   :: y_coords (*)
08715        Double Precision, Intent (In)   :: z_coords (*)
08716        Integer, Intent (In)            :: nbr_corners
08717        Integer, Intent (In)            :: ijk0 (ndim_3d)
08718        Double Precision, Intent (In)   :: tol
08719        Integer, Intent (Out)           :: ierror
08720     End Subroutine
08721 
08722    subroutine psmile_mg_final_gauss2_dble (                                       &
08723                      grid_id, found, locations, fnd_loc_range,                    &
08724                      tgt_coords_x, tgt_coords_y, tgt_coords_shape, search_range,  &
08725                      src_corners_x, src_corners_y, src_corner_shape, nbr_corners, &
08726                      ierror)
08727 
08728       use psmile_common
08729 
08730       integer, intent (in)            :: grid_id
08731       integer, intent (in)            :: fnd_loc_range (2, ndim_3d)
08732       integer, intent (in)            :: tgt_coords_shape (2, ndim_3d)
08733       double precision, intent (in)   ::                            
08734          tgt_coords_x (tgt_coords_shape(1,1):tgt_coords_shape(2,1), 
08735                        tgt_coords_shape(1,2):tgt_coords_shape(2,2), 
08736                        tgt_coords_shape(1,3):tgt_coords_shape(2,3))
08737       double precision, intent (in)   ::                            
08738          tgt_coords_y (tgt_coords_shape(1,1):tgt_coords_shape(2,1), 
08739                        tgt_coords_shape(1,2):tgt_coords_shape(2,2), 
08740                        tgt_coords_shape(1,3):tgt_coords_shape(2,3))
08741       integer, intent (in)            :: search_range (2, ndim_3d)
08742       integer, intent (in)            :: src_corner_shape (2, ndim_2d)
08743       integer, intent (in)            :: nbr_corners
08744       double precision,   intent (in) ::                 
08745          src_corners_x ( src_corner_shape(1,1):src_corner_shape(2,1), nbr_corners)
08746       double precision,   intent (in) ::                 
08747          src_corners_y ( src_corner_shape(1,1):src_corner_shape(2,1), nbr_corners)
08748       integer, intent (inout)         :: found (fnd_loc_range(1,1):fnd_loc_range(2,1), 
08749                                                 fnd_loc_range(1,2):fnd_loc_range(2,2), 
08750                                                 fnd_loc_range(1,3):fnd_loc_range(2,3))
08751       integer, intent (inout)         :: locations (fnd_loc_range(1,1):fnd_loc_range(2,1), 
08752                                                     fnd_loc_range(1,2):fnd_loc_range(2,2), 
08753                                                     fnd_loc_range(1,3):fnd_loc_range(2,3))
08754       integer, intent (out)           :: ierror
08755    end subroutine
08756 
08757     subroutine psmile_mg_final_prev_2d_dble (grid_id, nlev,        &
08758                     lstijk, xyz, found, newijk, nc,                &
08759                     corners1, corners2, corner_shape, nbr_corners, &
08760                     tol, ierror)
08761        Use PSMILe_common
08762 
08763        Integer,          Intent (In)   :: grid_id, nlev
08764        Integer,          Intent (In)   :: nc
08765        Integer,          Intent (In)   :: lstijk (ndim_2d, nc)
08766        Double Precision, Intent (In)   :: xyz (ndim_2d, nc)
08767        Integer,          Intent (In)   :: corner_shape (2, ndim_2d)
08768        Integer,          Intent (In)   :: nbr_corners
08769        Double Precision, Intent (In)   ::                 
08770           corners1 ( corner_shape(1,1):corner_shape(2,1), 
08771                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
08772        Double Precision, Intent (In)   ::                 
08773           corners2 ( corner_shape(1,1):corner_shape(2,1), 
08774                      corner_shape(1,2):corner_shape(2,2), nbr_corners)
08775        Double Precision, Intent (In)   :: tol
08776 
08777        Integer,          Intent (Out)  :: found (nc)
08778        Integer,          Intent (Out)  :: newijk (ndim_2d, nc)
08779        Integer,          Intent (Out)  :: ierror
08780     End Subroutine
08781 
08782     subroutine psmile_mg_method_1d_dble (comp_info, nlev,            &
08783                                      found, loc, range,              &
08784                                      coords1,                        &
08785                                      shape, control,                 &
08786                                      method_id,                      &
08787                                      x_coords,                       &
08788                                      coords_shape,                   &
08789                                      grid_valid_shape, cyclic,       &
08790                                      chmin, chmax,                   &
08791                                      tol, ierror)
08792 
08793        Use PSMILe_common
08794 
08795        Type (Enddef_comp), Intent (In)  :: comp_info
08796        Integer,          Intent (In)    :: nlev
08797        Integer,          Intent (InOut) :: found (*)
08798        Integer,          Intent (InOut) :: loc   (*)
08799        Integer,          Intent (In)    :: range (2, ndim_3d)
08800        Double Precision, Intent (In)    :: coords1 (*)
08801        Integer,          Intent (In)    :: shape (2, ndim_3d)
08802        Integer,          Intent (In)    :: control (2, ndim_3d)
08803        Integer,          Intent (In)    :: method_id
08804        Integer,          Intent (In)    :: coords_shape (2)
08805        Integer,          Intent (In)    :: grid_valid_shape (2)
08806        Logical,          Intent (In)    :: cyclic
08807        Double Precision, Intent (In)    :: x_coords (*)
08808        Double Precision, Intent (In)    :: chmin (*), chmax (*)
08809        Double Precision, Intent (In)    :: tol
08810        Integer,          Intent (Out)   :: ierror
08811     End Subroutine
08812 
08813     subroutine psmile_mg_method_2d_dble (comp_info,   &
08814                     nlev, found, loc, range,          &
08815                     coords1, coords2, search_shape, control, &
08816                     x_coords, y_coords, coords_shape, &
08817                     grid_valid_shape, cyclic, period, &
08818                     chmin1, chmin2, chmax1, chmax2,   &
08819                     tol, ierror)
08820 
08821        Use PSMILe_common
08822 
08823        Type (Enddef_comp), Intent (In)   :: comp_info
08824        Integer,            Intent (In)   :: nlev
08825        Integer,            Intent (InOut):: found (*)
08826        Integer,            Intent (InOut):: loc   (ndim_2d, *)
08827        Integer,            Intent (In)   :: range (2, ndim_3d)
08828        Double Precision,   Intent (In)   :: coords1 (*)
08829        Double Precision,   Intent (In)   :: coords2 (*)
08830        Integer,            Intent (In)   :: search_shape (2, ndim_3d)
08831        Integer,            Intent (In)   :: control (2, ndim_3d)
08832        Integer,            Intent (In)   :: coords_shape (2, ndim_2d)
08833        Integer,            Intent (In)   :: grid_valid_shape (2, ndim_2d)
08834        Logical,            Intent (In)   :: cyclic (ndim_2d)
08835        Double Precision,   Intent (In)   :: period (ndim_2d)
08836        Double Precision,   Intent (In)   :: x_coords (*)
08837        Double Precision,   Intent (In)   :: y_coords (*)
08838        Double Precision,   Intent (In)   :: chmin1 (*), chmin2 (*)
08839        Double Precision,   Intent (In)   :: chmax1 (*), chmax2 (*)
08840        Double Precision,   Intent (In)   :: tol
08841        Integer,           Intent (Out)   :: ierror
08842     End Subroutine
08843 
08844     subroutine psmile_mg_method_3d_dble (comp_info, nlev,            &
08845                                      found, loc, range,              &
08846                                      coords1, coords2, coords3,      &
08847                                      shape, control,                 &
08848                                      method_id,                      &
08849                                      x_coords, y_coords, z_coords,   &
08850                                      coords_shape,                   &
08851                                      grid_valid_shape, cyclic,       &
08852                                      chmin1, chmin2, chmin3,         &
08853                                      chmax1, chmax2, chmax3,         &
08854                                      midp1,  midp2,  midp3,          &
08855                                      tol, ierror)
08856 
08857        Use PSMILe_common
08858 
08859        Type (Enddef_comp), Intent (In)  :: comp_info
08860        Integer,          Intent (In)    :: nlev
08861        Integer,          Intent (InOut) :: found (*)
08862        Integer,          Intent (InOut) :: loc   (ndim_3d, *)
08863        Integer,          Intent (In)    :: range (2, ndim_3d)
08864        Double Precision, Intent (In)    :: coords1 (*)
08865        Double Precision, Intent (In)    :: coords2 (*)
08866        Double Precision, Intent (In)    :: coords3 (*)
08867        Integer,          Intent (In)    :: shape (2, ndim_3d)
08868        Integer,          Intent (In)    :: control (2, ndim_3d)
08869        Integer,          Intent (In)    :: method_id
08870        Integer,          Intent (In)    :: coords_shape (2, ndim_3d)
08871        Integer,          Intent (In)    :: grid_valid_shape (2, ndim_3d)
08872        Logical,          Intent (In)    :: cyclic (ndim_3d)
08873        Double Precision, Intent (In)    :: x_coords (*)
08874        Double Precision, Intent (In)    :: y_coords (*)
08875        Double Precision, Intent (In)    :: z_coords (*)
08876        Double Precision, Intent (In)    :: chmin1 (*), chmin2 (*), chmin3 (*)
08877        Double Precision, Intent (In)    :: chmax1 (*), chmax2 (*), chmax3 (*)
08878        Double Precision, Intent (In)    :: midp1  (*), midp2  (*), midp3  (*)
08879        Double Precision, Intent (In)    :: tol
08880        Integer,          Intent (Out)   :: ierror
08881     End Subroutine
08882 
08883    subroutine psmile_mg_method_gauss2_dble (method_id, search_range,     &
08884                                             tgt_shape, tgt_coords_x,     &
08885                                             tgt_coords_y, loc_fnd_shape, &
08886                                             found, loc, virtual_cell,    &
08887                                             ierror)
08888 
08889       use psmile_common
08890 
08891       Integer, Intent (In)            :: method_id
08892       Integer, Intent (In)            :: search_range (2, ndim_3d)
08893       Integer, Intent (In)            :: loc_fnd_shape (2, ndim_3d)
08894       Integer, Intent (In)            :: tgt_shape (2, ndim_3d)
08895       Double Precision, Intent (In)   :: tgt_coords_x (tgt_shape(1,1):tgt_shape(2,1),  
08896                                                        tgt_shape(1,2):tgt_shape(2,2),  
08897                                                        tgt_shape(1,3):tgt_shape(2,3)), 
08898                                          tgt_coords_y (tgt_shape(1,1):tgt_shape(2,1),  
08899                                                        tgt_shape(1,2):tgt_shape(2,2),  
08900                                                        tgt_shape(1,3):tgt_shape(2,3))
08901       Integer, Intent (InOut)         :: found (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
08902                                                 loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
08903                                                 loc_fnd_shape(1,3):loc_fnd_shape(2,3))
08904       Integer, Intent (InOut)         :: loc   (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
08905                                                 loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
08906                                                 loc_fnd_shape(1,3):loc_fnd_shape(2,3))
08907       Integer, Intent (Out)           :: virtual_cell (loc_fnd_shape(1,1):loc_fnd_shape(2,1), 
08908                                                        loc_fnd_shape(1,2):loc_fnd_shape(2,2), 
08909                                                        loc_fnd_shape(1,3):loc_fnd_shape(2,3))
08910       Integer, Intent (Out)           :: ierror
08911    end subroutine
08912 
08913     subroutine psmile_mg_method_irreg2_dble (comp_info,    &
08914                     found, locations, search,              &
08915                     array, shape_2d, range_2d, control_2d, &
08916                            shape_1d, range_1d, control_1d, &
08917                     m_arrays, m_levdim,                    &
08918                     grid_id, method_id, tol, ierror)
08919 
08920        Use PSMILe_common
08921 
08922        Type (Enddef_comp), Intent (In)  :: comp_info
08923        Type (Enddef_search)             :: search
08924        Integer,            Intent (In)  :: grid_id, method_id
08925        Double Precision,   Intent (In)  :: tol
08926        Type (dble_vector), Intent (In)  :: array (        ndim_3d, search%search_data%npart)
08927        Integer,            Intent (In)  :: shape_2d   (2, ndim_3d, search%search_data%npart)
08928        Integer,            Intent (In)  :: range_2d   (2, ndim_3d, search%search_data%npart)
08929        Integer,            Intent (In)  :: control_2d (2, ndim_3d, search%search_data%npart)
08930        Integer,            Intent (In)  :: shape_1d   (2, ndim_3d, search%search_data%npart)
08931        Integer,            Intent (In)  :: range_1d   (2, ndim_3d, search%search_data%npart)
08932        Integer,            Intent (In)  :: control_1d (2, ndim_3d, search%search_data%npart)
08933        Type (Enddef_mg_double)          :: m_arrays
08934        Integer,            Intent (In)  :: m_levdim (ndim_3d)
08935        Type (integer_vector)            :: found     (search%search_data%npart, 2)
08936        Type (integer_vector)            :: locations (search%search_data%npart, 2)
08937        Integer,            Intent (Out) :: ierror
08938     End Subroutine
08939 
08940     subroutine psmile_mg_srch_nneigh_reg_dble (grid_id, nn_srch,     &
08941                     arrays, search_mode, nref_3d, grid_valid_shape,  &
08942                     neighbors_3d, nloc, num_neigh,                   &
08943                     sin_search, cos_search, z_search,                &
08944                     dist_dble, dim1, indices, jbeg, jend,            &
08945                     mask_array, mask_shape, mask_available,          &
08946                     tol, ierror)
08947 
08948        Use PSMILe_common
08949 
08950        Integer,          Intent (In)   :: grid_id
08951        Type (Extra_search_nn), Intent (In) :: nn_srch
08952        Type (Extra_search_dble)        :: arrays
08953        Integer,          Intent (In)   :: search_mode, nref_3d
08954        Integer,          Intent (In)   :: jbeg, jend, nloc
08955        Integer,          Intent (In)   :: grid_valid_shape (2, ndim_3d)
08956        Integer,          Intent (In)   ::       mask_shape (2, ndim_3d)
08957        Integer,          Intent (In)   :: num_neigh
08958        Integer,          Intent (In)   :: indices (:), dim1 (2)
08959        Double Precision, Intent (In)   :: sin_search (jbeg:jend, 2)
08960        Double Precision, Intent (In)   :: cos_search (jbeg:jend, 2)
08961        Double Precision, Intent (In)   ::   z_search (jbeg:jend)
08962        Logical,          Intent (In)   :: 
08963           mask_array (mask_shape (1,1):mask_shape (2,1), 
08964                       mask_shape (1,2):mask_shape (2,2), 
08965                       mask_shape (1,3): mask_shape (2,3))
08966        Logical,          Intent (In)   :: mask_available
08967        Double Precision, Intent (In)   :: tol
08968 !
08969        Double Precision, Intent (InOut) :: 
08970           dist_dble (dim1(1):dim1(2), num_neigh)
08971 !
08972        Integer,          Intent (Out)   :: 
08973           neighbors_3d (ndim_3d, nloc, num_neigh)
08974        Integer,          Intent (Out)   :: ierror
08975     End Subroutine
08976 
08977     subroutine psmile_mg_srch_nneigh_irr_dble (grid_id,        &
08978                     arrays, search_mode, nref_3d,              &
08979                     sin_values, cos_values, grid_valid_shape,  &
08980                     z_coords, coords_shape,                    &
08981                     neighbors_3d, nloc, num_neigh,             &
08982                     sin_search, cos_search, z_search,          &
08983                     dist_dble, dim1, indices, jbeg, jend,      &
08984                     mask_ind,                                  &
08985                     mask_array, mask_shape, mask_available,    &
08986                     tol, ierror)
08987 
08988        Use PSMILe_common
08989 
08990        Integer,          Intent (In)   :: grid_id
08991        Type (Extra_search_dble)        :: arrays
08992        Integer,          Intent (In)   :: search_mode, nref_3d
08993        Integer,          Intent (In)   :: jbeg, jend, nloc
08994        Integer,          Intent (In)   :: grid_valid_shape (2, ndim_3d)
08995        Integer,          Intent (In)   ::     coords_shape (2, ndim_3d)
08996        Integer,          Intent (In)   ::       mask_shape (2, ndim_3d)
08997        Double Precision, Intent (In)   :: 
08998           sin_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
08999                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
09000        Double Precision, Intent (In)   :: 
09001           cos_values (grid_valid_shape(1,1):grid_valid_shape(2,1), 
09002                       grid_valid_shape(1,2):grid_valid_shape(2,2), 2)
09003        Double Precision, Intent (In)   :: 
09004           z_coords (coords_shape(1,3):coords_shape(2,3))
09005        Integer,          Intent (In)   :: num_neigh
09006        Integer,          Intent (In)   :: indices (:), dim1 (2)
09007        Double Precision, Intent (In)   :: sin_search (jbeg:jend, 2)
09008        Double Precision, Intent (In)   :: cos_search (jbeg:jend, 2)
09009        Double Precision, Intent (In)   ::   z_search (jbeg:jend)
09010        Logical,          Intent (In)   :: mask_ind   (jbeg:jend)
09011        Logical,          Intent (In)   :: 
09012           mask_array (mask_shape (1,1):mask_shape (2,1), 
09013                       mask_shape (1,2):mask_shape (2,2), 
09014                       mask_shape (1,3): mask_shape (2,3))
09015        Logical,          Intent (In)   :: mask_available
09016        Double Precision, Intent (In)   :: tol
09017 !
09018        Double Precision, Intent (InOut) :: 
09019           dist_dble (dim1(1):dim1(2), num_neigh)
09020 !
09021        Integer,          Intent (Out)   :: 
09022           neighbors_3d (ndim_3d, nloc, num_neigh)
09023        Integer,          Intent (Out)   :: ierror
09024     End Subroutine
09025 !
09026     subroutine psmile_print_3d_coord_dble (x, y, z, shape,     &
09027                                            ind, nloc, message)
09028        Use PSMILe_common
09029 
09030        Integer, Intent (In)            :: shape (2, ndim_3d)
09031        Double Precision, Intent (In)   :: x (*), y (*), z (*)
09032        Integer, Intent(In)             :: nloc
09033        Integer, Intent(In)             :: ind (ndim_3d, nloc)
09034        Character (len=*), Intent(In)   :: message
09035     End Subroutine
09036 !
09037     subroutine psmile_print_3d_reg_coord_dble (x, y, z, shape,     &
09038                                                ind, nloc, message)
09039        Use PSMILe_common
09040 
09041        Integer, Intent (In)            :: shape (2, ndim_3d)
09042        Double Precision, Intent (In)   :: x (*), y (*), z (*)
09043        Integer, Intent(In)             :: nloc
09044        Integer, Intent(In)             :: ind (ndim_3d, nloc)
09045        Character (len=*), Intent(In)   :: message
09046     End Subroutine
09047 !
09048     subroutine psmile_print_irreg2_coord_dble (x, y, z, shape,     &
09049                                                ind, nloc, message)
09050        Use PSMILe_common
09051 
09052        Integer, Intent (In)            :: shape (2, ndim_3d)
09053        Double Precision, Intent (In)   :: x (*), y (*), z (*)
09054        Integer, Intent(In)             :: nloc
09055        Integer, Intent(In)             :: ind (ndim_3d, nloc)
09056        Character (len=*), Intent(In)   :: message
09057     End Subroutine
09058 
09059 !   Put / Get
09060 
09061 !!$    We cannot include an interface description here since this
09062 !!$      is overloaded wrt. data_array by the calling routine prism_put.
09063 !!$
09064 !!$    Subroutine PSMILe_Put_dble ( field_id, julian_day, julian_sec, &
09065 !!$              julian_dayb, julian_secb, data_array, info, ierror )
09066 !!$
09067 !!$       use PRISM, only: PSMILe_Time_Struct
09068 !!$
09069 !!$       Integer, Intent (In)                 :: field_id
09070 !!$
09071 !!$       Double Precision, Intent (In)        :: julian_day, julian_dayb(2)
09072 !!$       Double Precision, Intent (In)        :: julian_sec, julian_secb(2)
09073 !!$
09074 !!$       Double Precision, Intent (In)        :: data_array(*)
09075 !!$       Integer, Intent (Out)                :: info, ierror
09076 !!$    End Subroutine
09077 
09078     subroutine psmile_put_field_dble (field_id, task_id, data_array, len, &
09079                                       nbr_fields, ierror)
09080 
09081        Integer, Intent (In)                 :: field_id
09082        Integer, Intent (In)                 :: task_id
09083        Integer, Intent (In)                 :: len, nbr_fields
09084        Double Precision, Intent (In)        :: data_array(*)
09085        Integer, Intent (Out)                :: ierror
09086     End Subroutine
09087 
09088     subroutine psmile_put_field_gauss2_dble (data_array, data_shape, nbr_fields, &
09089                                           srcloc, nparts, nloc, npoints, &
09090                                           dest, tag, comm, ierror)
09091        Use PSMILe_common
09092 
09093        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
09094        Integer, Intent (In)          :: nparts
09095        Integer, Intent (In)          :: npoints (2, nparts)
09096        Integer, Intent (In)          :: data_shape (2, ndim_3d)
09097        Type (integer_vector), Intent (In) :: srcloc (2, nparts)
09098        Double Precision, Intent (In) :: data_array (*)
09099        Integer, Intent (Out)         :: ierror
09100     End Subroutine
09101 
09102     subroutine psmile_put_field_21d_dble (data_array, data_shape, nbr_fields, &
09103                                           srcloc, nparts, nloc, npoints, &
09104                                           dest, tag, comm, ierror)
09105        Use PSMILe_common
09106 
09107        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
09108        Integer, Intent (In)          :: nparts
09109        Integer, Intent (In)          :: npoints (2, nparts)
09110        Integer, Intent (In)          :: data_shape (2, ndim_3d)
09111        Type (integer_vector), Intent (In) :: srcloc (2, nparts)
09112        Double Precision, Intent (In) :: data_array (*)
09113        Integer, Intent (Out)         :: ierror
09114     End Subroutine
09115 
09116     subroutine psmile_put_field_3d_dble (data_array, data_shape, nbr_fields, &
09117                                          srcloc, nparts, nloc, npoints, &
09118                                          dest, tag, comm, ierror)
09119        Use PSMILe_common
09120 
09121        Integer, Intent (In)          :: nloc, dest, tag, comm, nbr_fields
09122        Integer, Intent (In)          :: nparts
09123        Integer, Intent (In)          :: npoints (ndim_3d, nparts)
09124        Integer, Intent (In)          :: data_shape (2, ndim_3d)
09125        Type (integer_vector), Intent (In) :: srcloc (ndim_3d, nparts)
09126        Double Precision, Intent (In) :: data_array (*)
09127        Integer, Intent (Out)         :: ierror
09128     End Subroutine
09129 
09130     subroutine psmile_put_irr_field_dble (data_array, data_shape, nbr_fields,  &
09131                                           srcloc, npoints, srcars, nars, nloc, &
09132                                           dest, tag, comm, ierror)
09133        Use PSMILe_common
09134 
09135        Integer,          Intent (In)    :: nars, nloc, npoints, nbr_fields
09136        Integer,          Intent (In)    :: dest, tag, comm
09137        Integer,          Intent (In)    :: data_shape (2, ndim_3d)
09138        Integer,          Intent (In)    :: srcloc (ndim_3d, npoints)
09139        Integer,          Intent (In)    :: srcars (2, ndim_3d, nars)
09140        Double Precision, Intent (In)    :: data_array (*)
09141        Integer,          Intent (Out)   :: ierror
09142     End Subroutine
09143 
09144     subroutine psmile_get_field_dble (field_id, data_array, len, &
09145                                       nbr_fields, ierror)
09146 
09147        Integer,          Intent (In)    :: field_id
09148        Integer,          Intent (In)    :: len, nbr_fields
09149        Double Precision, Intent (InOut) :: data_array(*)
09150        Integer,          Intent (Out)   :: ierror
09151     End Subroutine
09152 
09153     subroutine psmile_get_irr_field_dble (data_array, data_shape, nbr_fields,  &
09154                                           dstijk, npoints, dstars, nars, nloc, &
09155                                           source, tag, comm, ierror)
09156        Use PSMILe_common
09157 
09158        Integer,          Intent (In)    :: nars, nloc, npoints, nbr_fields
09159        Integer,          Intent (In)    :: source, tag, comm
09160        Integer,          Intent (In)    :: data_shape (2, ndim_3d)
09161        Integer,          Intent (In)    :: dstijk (ndim_3d, npoints)
09162        Integer,          Intent (In)    :: dstars (2, ndim_3d, nars)
09163        Double Precision, Intent (InOut) :: data_array (*)
09164        Integer,          Intent (Out)   :: ierror
09165     End Subroutine
09166 
09167 !   Utilities
09168 
09169     subroutine psmile_copy_subarray_3d_double (dest_vector, size, &
09170                darray, idlow, idhigh, jdlow, jdhigh, kdlow, kdhigh, &
09171                sub, ierror)
09172        Use PSMILe_common
09173 
09174        Integer(kind=int64), Intent (In) :: size
09175        Integer, Intent (In)             :: idlow, idhigh, jdlow, jdhigh, 
09176                                            kdlow, kdhigh
09177        Integer, Intent (In)             :: sub (2, ndim_3d)
09178        Double Precision, Intent (In)    :: darray (idlow:idhigh, jdlow:jdhigh, 
09179                                                    kdlow:kdhigh)
09180        Double Precision, Intent (Out)   :: dest_vector (size)
09181        Integer, Intent (Out)            :: ierror
09182     End Subroutine
09183 
09184     subroutine psmile_copy_subarray_2d_double (dest_vector, size, &
09185                darray, idlow, idhigh, jdlow, jdhigh, &
09186                        ibeg,  iend,   jbeg,  jend,   ierror)
09187        Use PSMILe_common
09188        Integer(kind=int64), Intent (In) :: size
09189        Integer, Intent (In)             :: idlow, idhigh, jdlow, jdhigh
09190        Integer, Intent (In)             :: ibeg,  iend,   jbeg,  jend
09191        Double Precision, Intent (In)    :: darray (idlow:idhigh, jdlow:jdhigh)
09192        Double Precision, Intent (Out)   :: dest_vector (size)
09193        Integer, Intent (Out)            :: ierror
09194     End Subroutine
09195 
09196     subroutine psmile_tricu_gauss2_extra (search, grid_id, mask_array, &
09197                      mask_shape, mask_available, ibuf, len_item,       &
09198                      n_send, num_neigh, ierror)
09199        Use PSMILe_common
09200 
09201        Integer,              Intent (In)    :: mask_shape   (2, ndim_3d)
09202        Logical,              Intent (In)    ::         
09203           mask_array (mask_shape(1,1):mask_shape(2,1), 
09204                       mask_shape(1,2):mask_shape(2,2), 
09205                       mask_shape(1,3):mask_shape(2,3))
09206        Logical,              Intent (In)    :: mask_available
09207        Integer,              Intent (In)    :: grid_id
09208        Integer,              Intent (In)    :: len_item, n_send, num_neigh
09209        Type (Enddef_global_search), Intent (InOut) :: search
09210        Integer,              Intent (InOut) :: ibuf (len_item, n_send)
09211        Integer,              Intent (Out)   :: ierror
09212     End Subroutine
09213 
09214     subroutine psmile_trili_gauss2_extra (search, grid_id, mask_array, &
09215                      mask_shape, mask_available, ibuf, len_item,       &
09216                      n_send, num_neigh, ierror)
09217        Use PSMILe_common
09218 
09219        Integer,              Intent (In)    :: mask_shape   (2, ndim_3d)
09220        Logical,              Intent (In)    ::         
09221           mask_array (mask_shape(1,1):mask_shape(2,1), 
09222                       mask_shape(1,2):mask_shape(2,2), 
09223                       mask_shape(1,3):mask_shape(2,3))
09224        Logical,              Intent (In)    :: mask_available
09225        Integer,              Intent (In)    :: grid_id
09226        Integer,              Intent (In)    :: len_item, n_send, num_neigh
09227        Type (Enddef_global_search), Intent (InOut) :: search
09228        Integer,              Intent (InOut) :: ibuf (len_item, n_send)
09229        Integer,              Intent (Out)   :: ierror
09230     End Subroutine
09231 
09232 subroutine psmile_global_sum_compute_dble(data, data_size, &
09233                         nbr_fields, comm, global_sum, ierror)
09234    Use PSMILe_common
09235    implicit none
09236 
09237    integer, intent (in)          :: data_size
09238    integer, intent (in)          :: nbr_fields
09239    double complex, intent (in)   :: data(data_size, nbr_fields)
09240    integer, intent (in)          :: comm
09241    double complex, intent(out)   :: global_sum(nbr_fields)
09242    integer, intent(out)          :: ierror
09243 end subroutine
09244 
09245 subroutine psmile_global_sum_compute_int(data, data_size, &
09246                         nbr_fields, comm, global_sum, ierror)
09247    integer, intent (in) :: data_size
09248    integer, intent (in) :: nbr_fields
09249    integer, intent (in) :: data(data_size, nbr_fields)
09250    integer, intent (in) :: comm
09251    integer, intent(out) :: global_sum(nbr_fields)
09252    integer, intent(out) :: ierror
09253 end subroutine
09254 
09255 subroutine psmile_global_sum_send_dble(data, nbr_fields, &
09256                                        rank, ierror)
09257    integer, intent(in)          :: nbr_fields
09258    double complex, intent(in)   :: data(nbr_fields)
09259    integer, intent(in)          :: rank
09260    integer, intent(out)         :: ierror
09261 end subroutine
09262 
09263 subroutine psmile_global_sum_send_int(data, nbr_fields, &
09264                                       rank, ierror)
09265    integer, intent(in)  :: nbr_fields
09266    integer, intent(in)  :: data(nbr_fields)
09267    integer, intent(in)  :: rank
09268 
09269    integer, intent(out) :: ierror
09270 end subroutine
09271 
09272 subroutine psmile_global_sum_recv_dble(data, nbr_fields, &
09273                                        rank, ierror)
09274    integer, intent(in)          :: nbr_fields
09275    double complex, intent(out)  :: data(nbr_fields)
09276    integer, intent(in)          :: rank
09277    integer, intent(out)         :: ierror
09278 end subroutine
09279 
09280 subroutine psmile_global_sum_recv_int(data, nbr_fields, &
09281                                       rank, ierror)
09282    integer, intent(in)  :: nbr_fields
09283    integer, intent(out) :: data(nbr_fields)
09284    integer, intent(in)  :: rank
09285 
09286    integer, intent(out) :: ierror
09287 end subroutine
09288 
09289 subroutine psmile_ddadd_mpi_callback (dda, ddb, len, itype)
09290    integer, intent(in)           :: len, itype
09291    double complex, intent(in)    :: dda(len)
09292    double complex, intent(inout) :: ddb(len)
09293 end subroutine
09294 
09295 ! ----------------------------------------------------------------------------
09296 ! Interfaces of PSMILe transformer routines
09297 ! ----------------------------------------------------------------------------
09298 
09299     subroutine psmile_trs_inform(ida_args, id_trs_rank, id_err)
09300        Use PSMILe_Common, only : PSMILe_Trans_header_length
09301        Integer, Dimension(PSMILe_Trans_header_length), Intent (In)             :: ida_args
09302        Integer, Intent (In)                            :: id_trs_rank
09303        Integer, Intent (Out)                           :: id_err
09304     End Subroutine
09305 
09306     subroutine psmile_trs_set_src_epio3d_dble(id_epio_id,            &
09307                                               id_trans_rank,         &
09308                                               id_src_epio_size,      &
09309                                               id_nbr_corner,         &
09310                                               dda_src_epio_lat,      &
09311                                               dda_src_epio_lon,      &
09312                                               dda_src_epio_z,        &
09313                                               id_src_mask,           &
09314                                               ida_src_epio_mask,     &
09315                                               id_err                 )
09316       Integer, Intent (Out)                             :: id_epio_id
09317       Integer, Intent (Out)                             :: id_trans_rank
09318       Integer, Intent (In)                              :: id_src_epio_size
09319       Integer, Intent (In)                              :: id_nbr_corner
09320       Double Precision,Dimension(id_src_epio_size),Intent(In)::dda_src_epio_lat
09321       Double Precision,Dimension(id_src_epio_size),Intent(In)::dda_src_epio_lon
09322       Double Precision,Dimension(id_src_epio_size),Intent(In)::dda_src_epio_z
09323       Integer, Intent (In)                              :: id_src_mask
09324       Integer, Dimension(id_src_epio_size), Intent (In) :: ida_src_epio_mask
09325       Integer, Intent (Out)                             :: id_err
09326     End Subroutine
09327 
09328     subroutine psmile_trs_set_src_epio3d_real(id_epio_id,            &
09329                                               id_trans_rank,         &
09330                                               id_src_epio_size,      &
09331                                               id_nbr_corner,         &
09332                                               rda_src_epio_lat,      &
09333                                               rda_src_epio_lon,      &
09334                                               rda_src_epio_z,        &
09335                                               id_src_mask,           &
09336                                               ida_src_epio_mask,     &
09337                                               id_err                 )
09338       Integer, Intent (Out)                             :: id_epio_id
09339       Integer, Intent (Out)                             :: id_trans_rank
09340       Integer, Intent (In)                              :: id_src_epio_size
09341       Integer, Intent (In)                              :: id_nbr_corner
09342       Real,Dimension(id_src_epio_size),Intent(In)       :: rda_src_epio_lat
09343       Real,Dimension(id_src_epio_size),Intent(In)       :: rda_src_epio_lon
09344       Real,Dimension(id_src_epio_size),Intent(In)       :: rda_src_epio_z
09345       Integer, Intent (In)                              :: id_src_mask
09346       Integer, Dimension(id_src_epio_size), Intent (In) :: ida_src_epio_mask
09347       Integer, Intent (Out)                             :: id_err
09348     End Subroutine
09349 
09350     subroutine psmile_trs_set_tgt_epio3d_dble(id_epio_id,            &
09351                                               id_trans_rank,         &
09352                                               id_tgt_epio_size,      &
09353                                               id_nbr_corner,         &
09354                                               dda_tgt_epio_lat,      &
09355                                               dda_tgt_epio_lon,      &
09356                                               dda_tgt_epio_z,        &
09357                                               id_tgt_mask,           &
09358                                               ida_tgt_epio_mask,     &
09359                                               id_err                 )
09360       Integer, Intent (In)                              :: id_epio_id
09361       Integer, Intent (In)                              :: id_trans_rank
09362       Integer, Intent (In)                              :: id_tgt_epio_size
09363       Integer, Intent (In)                              :: id_nbr_corner
09364       Double Precision,Dimension(id_tgt_epio_size),Intent(In)::dda_tgt_epio_lat
09365       Double Precision,Dimension(id_tgt_epio_size),Intent(In)::dda_tgt_epio_lon
09366       Double Precision,Dimension(id_tgt_epio_size),Intent(In)::dda_tgt_epio_z
09367       Integer, Intent (In)                              :: id_tgt_mask
09368       Integer, Dimension(id_tgt_epio_size), Intent (In) :: ida_tgt_epio_mask
09369       Integer, Intent (Out)                             :: id_err
09370     End Subroutine
09371 
09372     subroutine psmile_trs_set_tgt_epio3d_real(id_epio_id,            &
09373                                               id_trans_rank,         &
09374                                               id_tgt_epio_size,      &
09375                                               id_nbr_corner,         &
09376                                               rda_tgt_epio_lat,      &
09377                                               rda_tgt_epio_lon,      &
09378                                               rda_tgt_epio_z,        &
09379                                               id_tgt_mask,           &
09380                                               ida_tgt_epio_mask,     &
09381                                               id_err                 )
09382       Integer, Intent (In)                              :: id_epio_id
09383       Integer, Intent (In)                              :: id_trans_rank
09384       Integer, Intent (In)                              :: id_tgt_epio_size
09385       Integer, Intent (In)                              :: id_nbr_corner
09386       Real,Dimension(id_tgt_epio_size),Intent(In)       :: rda_tgt_epio_lat
09387       Real,Dimension(id_tgt_epio_size),Intent(In)       :: rda_tgt_epio_lon
09388       Real,Dimension(id_tgt_epio_size),Intent(In)       :: rda_tgt_epio_z
09389       Integer, Intent (In)                              :: id_tgt_mask
09390       Integer, Dimension(id_tgt_epio_size), Intent (In) :: ida_tgt_epio_mask
09391       Integer, Intent (Out)                             :: id_err
09392     End Subroutine
09393 
09394     subroutine psmile_trs_set_triple_links(id_trans_out_id,     &
09395                                            id_trans_in_id,      &
09396                                            id_epio_id,          &
09397                                            id_trans_rank,       &
09398                                            id_err               )
09399       Integer, Intent (In)              :: id_trans_out_id
09400       Integer, Intent (In)              :: id_trans_in_id
09401       Integer, Intent (In)              :: id_epio_id
09402       Integer, Intent (In)              :: id_trans_rank
09403       Integer, Intent (Out)             :: id_err
09404     End Subroutine
09405 
09406     subroutine psmile_trs_put_int(id_transient_out_id, &
09407                                   id_epio_id,          &
09408                                   id_trans_rank,       &
09409                                   id_epio_field_size,  &
09410                                   ida_field,           &
09411                                   id_nbr_fields,       &
09412                                   id_err)
09413       Integer, Intent (In)                     :: id_transient_out_id
09414       Integer, Intent (In)                     :: id_epio_id
09415       Integer, Intent (In)                     :: id_trans_rank
09416       Integer, Intent (In)                     :: id_epio_field_size
09417       Integer, Dimension(id_epio_field_size), Intent (In) :: ida_field
09418       Integer, Intent (In)                     :: id_nbr_fields
09419       Integer, Intent (Out)                    :: id_err
09420     End Subroutine
09421 
09422     subroutine psmile_trs_put_real(id_transient_out_id, &
09423                                    id_epio_id,          &
09424                                    id_trans_rank,       &
09425                                    id_epio_field_size,  &
09426                                    rda_field,           &
09427                                    id_nbr_fields,       &
09428                                    id_err)
09429       Integer, Intent (In)                     :: id_transient_out_id
09430       Integer, Intent (In)                     :: id_epio_id
09431       Integer, Intent (In)                     :: id_trans_rank
09432       Integer, Intent (In)                     :: id_epio_field_size
09433       Real, Dimension(id_epio_field_size), Intent (In) :: rda_field
09434       Integer, Intent (In)                     :: id_nbr_fields
09435       Integer, Intent (Out)                    :: id_err
09436     End Subroutine
09437 
09438     subroutine psmile_trs_put_dble(id_transient_out_id, &
09439                                    id_epio_id,          &
09440                                    id_trans_rank,       &
09441                                    id_epio_field_size,  &
09442                                    dda_field,           &
09443                                    id_nbr_fields,       &
09444                                    id_err)
09445       Integer, Intent (In)                     :: id_transient_out_id
09446       Integer, Intent (In)                     :: id_epio_id
09447       Integer, Intent (In)                     :: id_trans_rank
09448       Integer, Intent (In)                     :: id_epio_field_size
09449       Double Precision, Dimension(id_epio_field_size), Intent (In) :: dda_field
09450       Integer, Intent (In)                     :: id_nbr_fields
09451       Integer, Intent (Out)                    :: id_err
09452     End Subroutine
09453 
09454     subroutine psmile_trs_get_int(id_transient_in_id, &
09455                                   id_epio_id,         &
09456                                   id_trans_rank,      &
09457                                   id_epio_field_size, &
09458                                   ida_field,          &
09459                       id_nbr_fields,      &
09460                                   id_err)
09461       Integer, Intent (In)                     :: id_transient_in_id
09462       Integer, Intent (In)                     :: id_epio_id
09463       Integer, Intent (In)                     :: id_trans_rank
09464       Integer, Intent (In)                     :: id_epio_field_size
09465       Integer, Dimension(id_epio_field_size), Intent (Out) :: ida_field
09466       Integer, Intent (In)                     :: id_nbr_fields
09467       Integer, Intent (Out)                    :: id_err
09468     End Subroutine
09469 
09470     subroutine psmile_trs_get_real(id_transient_in_id, &
09471                                    id_epio_id,         &
09472                                    id_trans_rank,      &
09473                                    id_epio_field_size, &
09474                                    rda_field,          &
09475                    id_nbr_fields,      &
09476                                    id_err)
09477       Integer, Intent (In)                     :: id_transient_in_id
09478       Integer, Intent (In)                     :: id_epio_id
09479       Integer, Intent (In)                     :: id_trans_rank
09480       Integer, Intent (In)                     :: id_epio_field_size
09481       Real, Dimension(id_epio_field_size), Intent (Out) :: rda_field
09482       Integer, Intent (In)                     :: id_nbr_fields
09483       Integer, Intent (Out)                    :: id_err
09484     End Subroutine
09485 
09486     subroutine psmile_trs_get_dble(id_transient_in_id, &
09487                                    id_epio_id,         &
09488                                    id_trans_rank,      &
09489                                    id_epio_field_size, &
09490                                    dda_field,          &
09491                    id_nbr_fields,      &
09492                                    id_err)
09493       Integer, Intent (In)                     :: id_transient_in_id
09494       Integer, Intent (In)                     :: id_epio_id
09495       Integer, Intent (In)                     :: id_trans_rank
09496       Integer, Intent (In)                     :: id_epio_field_size
09497       Double Precision, Dimension(id_epio_field_size), Intent (Out) :: dda_field
09498       Integer, Intent (In)                     :: id_nbr_fields
09499       Integer, Intent (Out)                    :: id_err
09500     End Subroutine
09501 
09502     subroutine psmile_trs_give_neighbors3d (id_epio_id,           &
09503                                             id_trans_rank,        &
09504                                             id_epio_tgt_size,     &
09505                                             id_nb_neighbors,      &
09506                                             ida_neighbor_indices, &
09507                                             id_err)
09508 
09509       Integer, Intent (In)                     :: id_epio_id
09510       Integer, Intent (In)                     :: id_trans_rank
09511       Integer, Intent (In)                     :: id_epio_tgt_size
09512       Integer, Intent (In)                     :: id_nb_neighbors
09513       Integer, Dimension(id_nb_neighbors*id_epio_tgt_size), Intent (In) :: 
09514                                               ida_neighbor_indices
09515       Integer, Intent (Out)                    :: id_err
09516 
09517     End Subroutine
09518 
09519     subroutine psmile_trs_give_neighbors_gauss (id_epio_id,           &
09520                                                 id_trans_rank,        &
09521                                                 id_epio_tgt_size,     &
09522                                                 id_nb_neighbors,      &
09523                                                 ida_neighbor_indices, &
09524                                                 ida_neighbor_bascule, &
09525                                                 id_err)
09526 
09527       Integer, Intent (In)                     :: id_epio_id
09528       Integer, Intent (In)                     :: id_trans_rank
09529       Integer, Intent (In)                     :: id_epio_tgt_size
09530       Integer, Intent (In)                     :: id_nb_neighbors
09531       Integer, Dimension(id_nb_neighbors*id_epio_tgt_size), Intent (In) :: 
09532                                               ida_neighbor_indices
09533       Integer, Dimension(id_epio_tgt_size), Intent (In) :: 
09534                                               ida_neighbor_bascule
09535       Integer, Intent (Out)                    :: id_err
09536 
09537     End Subroutine
09538 
09539     subroutine psmile_trs_give_neighcells3d(id_epio_id,        &
09540                                             id_trans_rank,     &
09541                                             id_epio_tgt_size,  &
09542                                             ida_nbsrccells_pertgtpt,     &
09543                                             id_source_size,    &
09544                                             id_nb_corners,     &
09545                                             ida_source_cell_index, &
09546                                             ida_corner_index,  &
09547                                             id_grid_type,      &
09548                                             id_err)
09549 
09550       Integer, Intent (In)                     :: id_epio_id
09551       Integer, Intent (In)                     :: id_trans_rank
09552       Integer, Intent (In)                     :: id_epio_tgt_size
09553       Integer, Intent (In)                     :: id_source_size
09554       Integer, Intent (In)                     :: id_nb_corners
09555       Integer, Intent (In)                     :: id_grid_type
09556       Integer, Dimension(id_epio_tgt_size), Intent (In) :: 
09557                                                ida_nbsrccells_pertgtpt
09558       Integer, Dimension(id_source_size), INTENT (In)   :: 
09559                                               ida_source_cell_index
09560       Integer, Dimension(id_nb_corners*id_source_size), Intent (In) :: 
09561                                                ida_corner_index
09562       Integer, Intent (Out)                    :: id_err
09563     End Subroutine
09564 
09565     subroutine psmile_trs_trili_srch_neigh3d (                            &
09566          ila_grid1_dims, il_grid1_size, ila_grid1_mask,                   &
09567          ila_grid1_center_lon, ila_grid1_center_lat,ila_grid1_center_z,   &
09568          ila_grid2_dims, il_grid2_size, ila_grid2_mask,                   &
09569          ila_grid2_center_lon, ila_grid2_center_lat,ila_grid2_center_z,   &
09570          il_num_srch_bin, il_restrict_type, ila_neighbors, il_err)
09571       Integer, Dimension(3), Intent (In) :: ila_grid1_dims
09572       Integer, Dimension(3), Intent (In) :: ila_grid2_dims
09573       Integer, Intent (In) :: il_grid1_size
09574       Integer, Intent (In) :: il_grid2_size
09575       Integer, Dimension(il_grid1_size), Intent (In) :: ila_grid1_mask
09576       Integer, Dimension(il_grid2_size), Intent (In) :: ila_grid2_mask
09577       Real, Dimension(il_grid1_size), Intent (Inout) :: ila_grid1_center_lon
09578       Real, Dimension(il_grid1_size), Intent (Inout) :: ila_grid1_center_lat
09579       Real, Dimension(il_grid1_size), Intent (Inout) :: ila_grid1_center_z
09580       Real, Dimension(il_grid2_size), Intent (Inout) :: ila_grid2_center_lon
09581       Real, Dimension(il_grid2_size), Intent (Inout) :: ila_grid2_center_lat
09582       Real, Dimension(il_grid2_size), Intent (Inout) :: ila_grid2_center_z
09583       Integer, Intent (In) :: il_num_srch_bin
09584       Integer, Intent (In) :: il_restrict_type
09585       Integer, Dimension(il_grid2_size,8), Intent (Out) :: ila_neighbors
09586       Integer, Intent (Out)               :: il_err
09587     End Subroutine
09588 
09589      subroutine psmile_trs_finalize(id_trans_rank, id_err)
09590        Integer, Intent (In)                       :: id_trans_rank
09591        Integer, Intent (Out)                      :: id_err
09592      End Subroutine
09593 
09594 ! ----------------------------------------------------------------------------
09595 ! Interfaces of internal PSMILe I/O routines
09596 ! ----------------------------------------------------------------------------
09597 
09598     subroutine psmile_io_derive_pelist(id_comm_appl,id_comp_id, &
09599                                        comp_info,pelist,ierror)
09600       Use PSMILe_common
09601       Integer,Intent(In) :: id_comm_appl
09602       Integer,Intent(In) :: id_comp_id
09603       Type (Enddef_comp), Intent (In) :: comp_info
09604       Integer,Intent(Out):: pelist(*)
09605       Integer,Intent(Out):: ierror
09606 
09607     End Subroutine
09608 
09609     subroutine psmile_io_init ( ierror )
09610       Integer, Intent (Out)               :: ierror
09611     End Subroutine
09612 
09613     subroutine psmile_io_init_comp (id_comp_id, ierror)
09614        Integer, Intent (In)            :: id_comp_id
09615        Integer, Intent (Out)           :: ierror
09616     End Subroutine
09617 
09618     subroutine psmile_io_init_pelist (id_comp_id, comp_info, ierror)
09619 
09620        Use PSMILe_common
09621 
09622        Integer, Intent (In)            :: id_comp_id
09623        Type (Enddef_comp), Intent (In) :: comp_info
09624        Integer, Intent (Out)           :: ierror
09625     End Subroutine
09626 
09627     subroutine psmile_io_init_cf (ierror)
09628        Integer, Intent (Out)           :: ierror
09629     End Subroutine
09630 
09631     subroutine psmile_io_finalize (ierror)
09632        Integer, Intent (Out)           :: ierror
09633     End Subroutine
09634 
09635     subroutine psmile_io_close (ierror)
09636        Integer, Intent (Out)           :: ierror
09637     End Subroutine
09638 
09639     subroutine psmile_def_domains(ierror)
09640       Integer, Intent (Out)           :: ierror
09641     End Subroutine
09642 
09643     subroutine psmile_def_metadata (id_varid,ierror)
09644       Integer, Intent (In)            :: id_varid
09645       Integer, Intent (Out)           :: ierror
09646     End Subroutine
09647 
09648     subroutine psmile_enddef_metadata (ierror)
09649       Integer, Intent (Out)           :: ierror
09650     End Subroutine
09651 
09652     subroutine psmile_open_files ( ierror )
09653       Integer, Intent (Out)           :: ierror
09654     End Subroutine
09655 
09656     subroutine psmile_open_file_byid (varid, taskid, date, ierror)
09657       Use PRISM_Constants
09658       Integer, Intent (In)                 :: varid,taskid
09659       Type(PRISM_Time_Struct), Intent (In) :: date
09660       Integer, Intent (Out)                :: ierror
09661     End Subroutine
09662 
09663     subroutine  psmile_check_restart(id_varid,id_taskid,id_info,ierror)
09664       Integer, Intent (In)                 :: id_varid
09665       Integer, Intent (In)                 :: id_taskid
09666       Integer, Intent (Out)                :: id_info
09667       Integer, Intent (Out)                :: ierror
09668     End Subroutine
09669 
09670     subroutine psmile_close_files (ierror)
09671        Integer, Intent (Out)          :: ierror
09672     End Subroutine
09673 
09674     subroutine psmile_io_cleanup (ierror)
09675        Integer, Intent (Out)          :: ierror
09676     End Subroutine
09677 
09678     subroutine psmile_close_file_byid (varid, taskid, ierror)
09679        Integer, Intent (In)           :: varid, taskid
09680        Integer, Intent (Out)          :: ierror
09681     End Subroutine
09682 
09683     subroutine psmile_check_file_size (varids, size, flag, ierror)
09684       Integer, Intent (In)           :: varids(:)
09685       Integer, Intent (In)           :: size
09686       Logical, Intent (Out)          :: flag
09687       Integer, Intent (Out)          :: ierror
09688     End Subroutine
09689 
09690     subroutine psmile_io_scandir(basename,file_list,len_of_list,no_of_files,ierror)
09691       Character(len=*),Intent(in)    ::basename
09692       Character(len=*),Intent(out)   ::file_list(*)
09693       Integer,Intent(in)             ::len_of_list
09694       Integer,Intent(out)            ::no_of_files
09695       Integer,Intent(out)            ::ierror
09696     End Subroutine
09697 
09698     subroutine psmile_io_scandir_no_of_files(basename,no_of_files,ierror)
09699       Character(len=*),Intent(in)    ::basename
09700       Integer,Intent(out)            ::no_of_files
09701       Integer,Intent(out)            ::ierror
09702     End Subroutine
09703 
09704     subroutine psmile_write_meta_byid(id_varid,id_taskid,ierror)
09705       Integer,Intent(In) :: id_varid,id_taskid
09706       Integer,Intent(Out) :: ierror
09707     End Subroutine
09708 
09709     subroutine psmile_write_meta(ierror)
09710       Integer,Intent(Out) :: ierror
09711     End Subroutine
09712 
09713 !!$    We cannot include an interface description here since this
09714 !!$      is overloaded wrt. data_array by the calling routine prism_put.
09715 
09716 !!$    Subroutine psmile_write_byid_dble(id_varid,id_taskid &
09717 !!$                                     ,dd_a,ju_day,ju_sec,ierror)
09718 !!$      integer,intent(in)::id_varid,id_taskid
09719 !!$      integer,intent(out):: ierror
09720 !!$      double precision, Intent (In) :: dd_a(*)
09721 !!$      double precision, Intent (In) :: ju_day, ju_sec
09722 !!$    End Subroutine
09723 !!$
09724 !!$    Subroutine psmile_write_byid_real(id_varid,id_taskid &
09725 !!$                                     ,rd_a,ju_day,ju_sec,ierror)
09726 !!$      integer,intent(in)::id_varid,id_taskid
09727 !!$      integer,intent(out):: ierror
09728 !!$      real             , Intent (In) :: rd_a(*)
09729 !!$      double precision, Intent (In) :: ju_day, ju_sec
09730 !!$    End Subroutine
09731 !!$
09732 !!$    Subroutine psmile_write_byid_int(id_varid,id_taskid &
09733 !!$                                    ,id_a,ju_day,ju_sec,ierror)
09734 !!$      integer,intent(in)::id_varid,id_taskid
09735 !!$      integer,intent(out):: ierror
09736 !!$      integer          , Intent (In) :: id_a(*)
09737 !!$      double precision, Intent (In) :: ju_day, ju_sec
09738 !!$    End Subroutine
09739 
09740     subroutine psmile_read_byid_dble(id_varid,id_taskid,rd_a,ju_day,ju_sec &
09741                                     ,ju_dayb,ju_secb,timeop,ierror)
09742       Integer,Intent(in)::id_varid,id_taskid
09743       Logical,Intent(out):: timeop
09744       Integer,Intent(out):: ierror
09745       Double Precision             , Intent (InOut) :: rd_a(*)
09746       Double Precision, Intent (In) :: ju_day, ju_sec
09747       Double Precision, Intent (In) :: ju_dayb(2), ju_secb(2)
09748     End Subroutine
09749 
09750     subroutine psmile_read_byid_real(id_varid,id_taskid,rd_a,ju_day,ju_sec &
09751                                     ,ju_dayb,ju_secb,timeop,ierror)
09752       Integer,Intent(in)::id_varid,id_taskid
09753       Logical,Intent(out):: timeop
09754       Integer,Intent(out):: ierror
09755       Real             , Intent (InOut) :: rd_a(*)
09756       Double Precision, Intent (In) :: ju_day, ju_sec
09757       Double Precision, Intent (In) :: ju_dayb(2), ju_secb(2)
09758     End Subroutine
09759 
09760     subroutine psmile_read_byid_int(id_varid,id_taskid,rd_a,ju_day,ju_sec &
09761                                    ,ju_dayb,ju_secb,timeop,ierror)
09762       Integer,Intent(in)::id_varid,id_taskid
09763       Logical,Intent(out):: timeop
09764       Integer,Intent(out):: ierror
09765       Integer             , Intent (InOut) :: rd_a(*)
09766       Double Precision, Intent (In) :: ju_day, ju_sec
09767       Double Precision, Intent (In) :: ju_dayb(2), ju_secb(2)
09768     End Subroutine
09769 
09770 ! ----------------------------------------------------------------------------
09771 ! Interfaces of internal PSMILe reduction routines
09772 ! ----------------------------------------------------------------------------
09773 
09774     subroutine psmile_multi_reduce_int ( task, shape_in, data_in, &
09775                                         shape_out, data_out, mask, ierror )
09776       Integer, Intent (In)  :: task
09777       Integer, Intent (In)  :: shape_in(2,6)
09778       Integer, Intent (In)  :: shape_out(2,6)
09779       Integer, Intent (In)  :: data_in  ( shape_in(1,1) : shape_in (2,1), 
09780                                           shape_in(1,2) : shape_in (2,2), 
09781                                           shape_in(1,3) : shape_in (2,3), 
09782                                           shape_in(1,4) : shape_in (2,4), 
09783                                           shape_in(1,5) : shape_in (2,5), 
09784                                           shape_in(1,6) : shape_in (2,6) )
09785       Logical, Intent (In)  :: mask     ( shape_in(1,1) : shape_in (2,1), 
09786                                           shape_in(1,2) : shape_in (2,2), 
09787                                           shape_in(1,3) : shape_in (2,3), 
09788                                           shape_in(1,4) : shape_in (2,4), 
09789                                           shape_in(1,5) : shape_in (2,5) )
09790       Integer, Intent (Out) :: data_out ( shape_out(1,1) : shape_out (2,1), 
09791                                           shape_out(1,2) : shape_out (2,2), 
09792                                           shape_out(1,3) : shape_out (2,3), 
09793                                           shape_out(1,4) : shape_out (2,4), 
09794                                           shape_out(1,5) : shape_out (2,5), 
09795                                           shape_out(1,6) : shape_out (2,6) )
09796       Integer, Intent (Out) :: ierror
09797 
09798     End Subroutine
09799 
09800     subroutine psmile_multi_reduce_real ( task, shape_in, data_in, &
09801                                         shape_out, data_out, mask, ierror )
09802       Integer, Intent (In)  :: task
09803       Integer, Intent (In)  :: shape_in(2,6)
09804       Integer, Intent (In)  :: shape_out(2,6)
09805       Real, Intent (In)     :: data_in  ( shape_in(1,1) : shape_in (2,1), 
09806                                           shape_in(1,2) : shape_in (2,2), 
09807                                           shape_in(1,3) : shape_in (2,3), 
09808                                           shape_in(1,4) : shape_in (2,4), 
09809                                           shape_in(1,5) : shape_in (2,5), 
09810                                           shape_in(1,6) : shape_in (2,6) )
09811       Logical, Intent (In)  :: mask     ( shape_in(1,1) : shape_in (2,1), 
09812                                           shape_in(1,2) : shape_in (2,2), 
09813                                           shape_in(1,3) : shape_in (2,3), 
09814                                           shape_in(1,4) : shape_in (2,4), 
09815                                           shape_in(1,5) : shape_in (2,5) )
09816       Real, Intent (Out)    :: data_out ( shape_out(1,1) : shape_out (2,1), 
09817                                           shape_out(1,2) : shape_out (2,2), 
09818                                           shape_out(1,3) : shape_out (2,3), 
09819                                           shape_out(1,4) : shape_out (2,4), 
09820                                           shape_out(1,5) : shape_out (2,5), 
09821                                           shape_out(1,6) : shape_out (2,6) )
09822       Integer, Intent (Out) :: ierror
09823 
09824     End Subroutine
09825 
09826     subroutine psmile_multi_reduce_dble ( task, shape_in, data_in, &
09827                                         shape_out, data_out, mask, ierror )
09828       Integer, Intent (In)           :: task
09829       Integer, Intent (In)           :: shape_in(2,6)
09830       Integer, Intent (In)           :: shape_out(2,6)
09831       Double Precision, Intent (In)  :: data_in  ( shape_in(1,1) : shape_in (2,1), 
09832                                                    shape_in(1,2) : shape_in (2,2), 
09833                                                    shape_in(1,3) : shape_in (2,3), 
09834                                                    shape_in(1,4) : shape_in (2,4), 
09835                                                    shape_in(1,5) : shape_in (2,5), 
09836                                                    shape_in(1,6) : shape_in (2,6) )
09837       Logical, Intent (In)           :: mask     ( shape_in(1,1) : shape_in (2,1), 
09838                                                    shape_in(1,2) : shape_in (2,2), 
09839                                                    shape_in(1,3) : shape_in (2,3), 
09840                                                    shape_in(1,4) : shape_in (2,4), 
09841                                                    shape_in(1,5) : shape_in (2,5) )
09842       Double Precision, Intent (Out) :: data_out ( shape_out(1,1) : shape_out (2,1), 
09843                                                    shape_out(1,2) : shape_out (2,2), 
09844                                                    shape_out(1,3) : shape_out (2,3), 
09845                                                    shape_out(1,4) : shape_out (2,4), 
09846                                                    shape_out(1,5) : shape_out (2,5), 
09847                                                    shape_out(1,6) : shape_out (2,6) )
09848       Integer, Intent (Out)          :: ierror
09849 
09850     End Subroutine
09851 
09852     subroutine psmile_loc_trans_int ( task, nbr_fields, &
09853                                       len_in,  data_in,  &
09854                                       len_out, data_out, field_id )
09855       Integer, Intent (In)                :: task
09856       Integer, Intent (In)                :: nbr_fields
09857       Integer, Intent (In)                :: len_in
09858       Integer, Intent (In)                :: data_in(len_in,nbr_fields)
09859       Integer, Intent (In)                :: len_out
09860       Integer, Intent (InOut)             :: data_out(len_out,nbr_fields)
09861       Integer, Optional, Intent (In)      :: field_id
09862 
09863     End Subroutine
09864 
09865     subroutine psmile_loc_trans_real ( task, nbr_fields, &
09866                                        len_in,  data_in,  &
09867                                        len_out, data_out, field_id )
09868       Integer, Intent (In)                :: task
09869       Integer, Intent (In)                :: nbr_fields
09870       Integer, Intent (In)                :: len_in
09871       Real, Intent (In)                   :: data_in(len_in,nbr_fields)
09872       Integer, Intent (In)                :: len_out
09873       Real, Intent (InOut)                :: data_out(len_out,nbr_fields)
09874       Integer, Optional, Intent (In)      :: field_id
09875 
09876     End Subroutine
09877 
09878     subroutine psmile_loc_trans_dble ( task, nbr_fields, &
09879                                        len_in,  data_in,  &
09880                                        len_out, data_out, field_id )
09881       Integer, Intent (In)                :: task
09882       Integer, Intent (In)                :: nbr_fields
09883       Integer, Intent (In)                :: len_in
09884       Double Precision, Intent (In)       :: data_in(len_in,nbr_fields)
09885       Integer, Intent (In)                :: len_out
09886       Double Precision, Intent (InOut)    :: data_out(len_out,nbr_fields)
09887       Integer, Optional, Intent (In)      :: field_id
09888 
09889     End Subroutine
09890 
09891     subroutine psmile_get_initial_date ( initial_date, ierror )
09892       Use PRISM_Constants
09893       Type(PRISM_Time_struct), Intent(Out) :: initial_date
09894       Integer, Intent(Out)                  :: ierror
09895     End Subroutine
09896 
09897     Subroutine psmile_set_userdef (var_id, side, chan_id, ierror)
09898       Integer, intent (In)                :: var_id
09899       Integer, intent (In)                :: side
09900       Integer, intent (In)                :: chan_id
09901       Integer, Intent (Out)               :: ierror
09902     End Subroutine psmile_set_userdef
09903 !
09904 !==================================================================
09905 !
09906    subroutine psmile_pack_field_info (field_info, buffer, num_field_info)
09907       use psmile_common, only : enddef_field_info, nd_field_list
09908 
09909       integer, intent (in)                  :: num_field_info
09910       type (enddef_field_info), intent (in) :: field_info(num_field_info)
09911       integer, intent (out)                 :: buffer(nd_field_list, num_field_info)
09912    end subroutine psmile_pack_field_info
09913 
09914    subroutine psmile_unpack_field_info (field_info, buffer, num_field_info)
09915       use psmile_common, only : enddef_field_info, nd_field_list
09916 
09917       integer, intent (in)                   :: num_field_info
09918       type (enddef_field_info), intent (out) :: field_info(num_field_info)
09919       integer, intent (in)                   :: buffer(nd_field_list, num_field_info)
09920    end subroutine psmile_unpack_field_info
09921 
09922    subroutine psmile_init_enddef_msg_inters (msg_intersections)
09923       use psmile_common, only : enddef_msg_intersections
09924 
09925       type (enddef_msg_intersections), intent (out) :: msg_intersections
09926    end subroutine psmile_init_enddef_msg_inters
09927 
09928    subroutine psmile_pack_msg_intersections (msg_intersections, buffer)
09929       use psmile_common, only : enddef_msg_intersections, nd_msgint
09930 
09931       type (enddef_msg_intersections), intent (in) :: msg_intersections
09932       integer, intent (inout)                      :: buffer(nd_msgint)
09933    end subroutine psmile_pack_msg_intersections
09934 
09935    subroutine psmile_unpack_msg_intersections (msg_intersections, buffer)
09936       use psmile_common, only : enddef_msg_intersections, nd_msgint
09937 
09938       type (enddef_msg_intersections), intent (out) :: msg_intersections
09939       integer, intent (inout)                       :: buffer(nd_msgint)
09940    end subroutine psmile_unpack_msg_intersections
09941 
09942    subroutine psmile_copy_msg_intersections (msg_intersections_to, &
09943                                              msg_intersections_from)
09944       use psmile_common, only : enddef_msg_intersections
09945 
09946       type (enddef_msg_intersections), intent (in)  :: msg_intersections_from
09947       type (enddef_msg_intersections), intent (out) :: msg_intersections_to
09948    end subroutine psmile_copy_msg_intersections
09949 
09950    subroutine psmile_init_enddef_msg_locs (msg_locations)
09951       use psmile_common, only : enddef_msg_locations, &
09952                               psmile_undef
09953 
09954       type (enddef_msg_locations), intent (out) :: msg_locations
09955    end subroutine psmile_init_enddef_msg_locs
09956 
09957    subroutine psmile_pack_msg_locations (msg_locations, buffer)
09958       use psmile_common, only : enddef_msg_locations, msgloc_size
09959 
09960       type (enddef_msg_locations), intent (in) :: msg_locations
09961       integer, intent (out)                    :: buffer(msgloc_size)
09962    end subroutine psmile_pack_msg_locations
09963 
09964    subroutine psmile_unpack_msg_locations (msg_locations, buffer)
09965       use psmile_common, only : enddef_msg_locations, msgloc_size
09966 
09967       type (enddef_msg_locations), intent (out) :: msg_locations
09968       integer, intent (in)                      :: buffer(msgloc_size)
09969    end subroutine psmile_unpack_msg_locations
09970 
09971    subroutine psmile_init_enddef_msg_extra (msg_extra)
09972       use psmile_common, only : enddef_msg_extra, psmile_undef
09973 
09974       type (enddef_msg_extra), intent (out) :: msg_extra
09975    end subroutine psmile_init_enddef_msg_extra
09976 
09977    subroutine psmile_pack_msg_extra (msg_extra, buffer)
09978       use psmile_common, only : enddef_msg_extra, msg_extra_size
09979 
09980       type (enddef_msg_extra), intent (in) :: msg_extra
09981       integer, intent (out)                :: buffer(msg_extra_size)
09982    end subroutine psmile_pack_msg_extra
09983 
09984    subroutine psmile_unpack_msg_extra (msg_extra, buffer)
09985       use psmile_common, only : enddef_msg_extra, msg_extra_size
09986 
09987       type (enddef_msg_extra), intent (out) :: msg_extra
09988       integer, intent (in)                  :: buffer(msg_extra_size)
09989    end subroutine psmile_unpack_msg_extra
09990 
09991 End Interface
09992 
09993 End Module PSMILe

Generated on 1 Dec 2011 for Oasis4 by  doxygen 1.6.1