psmile_trs_give_neighcells3d.F90

Go to the documentation of this file.
00001 !------------------------------------------------------------------------
00002 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PSMILe_Trs_give_neighcells3d
00008 !
00009 ! !INTERFACE:
00010 
00011 subroutine psmile_trs_give_neighcells3d(id_epio_id,        &
00012                                         id_trans_rank,     &
00013                                         id_epio_tgt_size,  &
00014                                         ida_nbsrccells_pertgtpt, &
00015                                         id_source_size,    &
00016                                         id_nb_corners,     &
00017                                         ida_source_cell_index, &
00018                                         ida_corner_index,  &
00019                                         id_grid_type,      &
00020                                         id_err)
00021 
00022 !
00023 ! !USES:
00024 !
00025   use PRISM_constants
00026   USE PSMILe, dummy_interface => PSMILe_Trs_give_neighcells3d
00027 
00028   IMPLICIT NONE
00029 !
00030 ! !INPUT PARAMETERS:
00031 !
00032 ! associated epio id
00033   INTEGER, INTENT (In)                     :: id_epio_id
00034   INTEGER, INTENT (In)                     :: id_trans_rank   
00035 
00036 ! size of the corresponding epiot
00037   INTEGER, INTENT (In)                     :: id_epio_tgt_size
00038 
00039 ! size of the corresponding epios
00040   INTEGER, INTENT (In)                     :: id_source_size
00041 
00042 ! number of neighbors
00043   INTEGER, INTENT (In)                     :: id_nb_corners 
00044 
00045 ! number of source cells per target cell
00046   INTEGER, DIMENSION(id_epio_tgt_size), INTENT (In) :: 
00047                                               ida_nbsrccells_pertgtpt
00048 
00049 ! index of the epio source cell
00050   INTEGER, DIMENSION(id_source_size), INTENT (In) ::   
00051                                               ida_source_cell_index
00052 
00053 ! index of the epio source cell corners in the corners lon/lat/z arrays
00054   INTEGER, DIMENSION(id_nb_corners*id_source_size), INTENT (In) :: 
00055                                               ida_corner_index
00056 
00057   INTEGER, INTENT (In)                     :: id_grid_type
00058 !
00059 ! !OUTPUT PARAMETERS:
00060 !
00061   INTEGER, INTENT (Out)                    :: id_err   ! error value
00062 
00063 ! !DESCRIPTION:
00064 !
00065 ! Subroutine "PSMILe_Trs_give_neighcells3d" insures the exchange of information,
00066 ! when an interpolation is required.
00067 !
00068 ! !REVISION HISTORY:
00069 !   Date      Programmer   Description
00070 ! ----------  ----------   -----------
00071 ! 24/03/2003  D. Declat    Creation
00072 !
00073 !EOP
00074 !----------------------------------------------------------------------
00075 ! $Id: psmile_trs_give_neighcells3d.F90 2082 2009-10-21 13:31:19Z hanke $
00076 ! $Author: hanke $
00077 !----------------------------------------------------------------------
00078 !
00079 ! 0. Local declarations
00080 !
00081   CHARACTER(LEN=len_cvs_string), SAVE  :: mycvs = 
00082     '$Id: psmile_trs_give_neighcells3d.F90 2082 2009-10-21 13:31:19Z hanke $'
00083 
00084   INTEGER, DIMENSION(PSMILe_trans_Header_length) :: ila_args 
00085 !
00086 !----------------------------------------------------------------------
00087 !
00088 #ifdef VERBOSE
00089       print *, trim(ch_id), ': PSMILe_Trs_give_neighcells3d: start'
00090       call psmile_flushstd
00091 #endif /* VERBOSE */
00092 
00093 #ifdef DEBUG
00094    print *, trim(ch_id), ': - id_epio_id       ', id_epio_id
00095    print *, trim(ch_id), ': - id_trans_rank    ', id_trans_rank
00096    print *, trim(ch_id), ': - id_epio_tgt_size ', id_epio_tgt_size
00097    print *, trim(ch_id), ': - id_source_size   ', id_source_size
00098    print *, trim(ch_id), ': - id_nb_corners    ', id_nb_corners
00099    print *, trim(ch_id), ': - id_grid_type     ', id_grid_type
00100 #endif
00101 !
00102 ! 1. Set the header message
00103 !
00104 ! 1.1. Initialize the contents to 999999
00105 
00106   ila_args = 999999
00107   id_err = 0
00108 
00109 ! 1.2. Content : action, global rank, number of the transformation, field_id,
00110 !                comp_id, size (of the EPIOT)
00111 
00112   ila_args(1)  = PSMILe_trans_Set_neighbors_info
00113   ila_args(2)  = global_rank
00114   ila_args(3)  = id_epio_id
00115   ila_args(4)  = id_epio_tgt_size
00116   ila_args(5)  = id_nb_corners
00117   ila_args(6)  = PSMILe_3D
00118   ila_args(7)  = id_source_size
00119   ila_args(11) = id_grid_type
00120 !
00121 ! 2. Send the header message to the transformer
00122 !
00123   call psmile_trs_inform(ila_args, id_trans_rank, id_err)
00124 !
00125 ! 3. Send the neighbors of the target points
00126 !
00127 !    The transformer has to evaluate ila_args(7) to check
00128 !    whether a second MPI_Recv has to be performed.
00129 !    ila_args(7) /= PSMILE_undef
00130 !
00131   CALL MPI_Send(ida_nbsrccells_pertgtpt(1), id_epio_tgt_size, &
00132      MPI_Integer, id_trans_rank, 5, comm_trans, id_err)
00133 
00134   CALL MPI_Send(ida_corner_index(1), id_nb_corners*id_source_size, &
00135      MPI_Integer, id_trans_rank, 6, comm_trans, id_err)
00136   CALL MPI_Send(ida_source_cell_index(1), id_source_size, &
00137      MPI_Integer, id_trans_rank, 7, comm_trans, id_err)
00138 !
00139 #ifdef VERBOSE
00140       print *, trim(ch_id), &
00141          ': PSMILe_Trs_give_neighcells3d: eof ierror =', id_err
00142       call psmile_flushstd
00143 #endif /* VERBOSE */
00144 
00145 END SUBROUTINE PSMILe_Trs_give_neighcells3d
00146 
00147 
00148 

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1