psmile_trs_set_tgt_epio3d_real.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_set_tgt_epio3d_real
00008 !
00009 ! !INTERFACE:
00010 subroutine psmile_trs_set_tgt_epio3d_real(id_epio_id,            &     
00011                                           id_trans_rank,         &
00012                                           id_epio_size,          &
00013                                           id_nbr_corner,         &
00014                                           dda_epio_lon,          &
00015                                           dda_epio_lat,          &
00016                                           dda_epio_z,            &
00017                                           id_mask,               &
00018                                           ida_epio_mask,         &
00019                                           id_err )
00020 
00021 !
00022 ! !USES:
00023 !
00024   use PRISM_constants
00025   USE PSMILe, dummy_interface => PSMILe_Trs_set_tgt_epio3d_real
00026 
00027   IMPLICIT NONE
00028 !
00029 ! !INPUT PARAMETERS:
00030 !
00031   INTEGER, INTENT (In)               :: id_epio_id
00032   INTEGER, INTENT (In)               :: id_trans_rank   
00033   INTEGER, INTENT (In)               :: id_epio_size
00034   ! Number of corners =1 if only the grid point coordinate are transfered
00035   INTEGER, INTENT (In)                                    :: id_nbr_corner
00036   !dda_epio_lat: latitudes for grid points or grid corners
00037   REAL, DIMENSION(id_epio_size*id_nbr_corner), INTENT(In) :: dda_epio_lat
00038   !dda_epio_lon: longitudes for grid points or grid corners
00039   REAL, DIMENSION(id_epio_size*id_nbr_corner), INTENT(In) :: dda_epio_lon
00040   !dda_epio_z: vertical position for grid points or grid corners
00041   REAL, DIMENSION(id_epio_size*id_nbr_corner), INTENT(In) :: dda_epio_z
00042   INTEGER, INTENT (In)                                    :: id_mask
00043   INTEGER, DIMENSION(id_epio_size), INTENT (In)           :: ida_epio_mask
00044 
00045 !
00046 ! !OUTPUT PARAMETERS:
00047 !
00048   INTEGER, INTENT (Out)               :: id_err       ! error value
00049 
00050 ! !DESCRIPTION:
00051 ! Subroutine "PSMILe_Trs_set_tgt_epio3d_real" sends point or corner
00052 ! epio informations to the transformer. If id_nbr_corner=1, point
00053 ! information is sent; if id_nbr_corner>1, corner information is sent.
00054 ! Note: When compressed array of target epio information will be available
00055 !  this routine should be changed (see PSMILe_Trs_set_src_epio3d_real)
00056 !
00057 ! !REVISION HISTORY:
00058 !   Date      Programmer   Description
00059 ! ----------  ----------   -----------
00060 ! 24/03/2002  D. Declat    Creation of PSMILe_Trs_set_epio3d
00061 ! 01/12/2003  D. Declat    Modification to "real" version and tgt/tgt arrays
00062 ! 06/10/2006  S. Valcke    Modification for corners
00063 !
00064 !EOP
00065 !-------------------------------------------------------------------------
00066 ! $Id: psmile_trs_set_tgt_epio3d_real.F90 2325 2010-04-21 15:00:07Z valcke $
00067 ! $Author: valcke $
00068 !-------------------------------------------------------------------------
00069 !
00070 ! 0. Local declarations
00071 !
00072   CHARACTER(LEN=len_cvs_string), SAVE  :: mycvs = 
00073      '$Id: psmile_trs_set_tgt_epio3d_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00074 
00075   INTEGER, DIMENSION(PSMILe_trans_Header_length) :: ila_args
00076   INTEGER                                        :: il_send_size
00077 !
00078 !----------------------------------------------------------------------
00079 !
00080 #ifdef VERBOSE
00081       print *, trim(ch_id), ': PSMILe_Trs_set_tgt_epio3d_real: start'
00082       call psmile_flushstd
00083 #endif /* VERBOSE */
00084 
00085 #ifdef DEBUG
00086    print *, trim(ch_id), ': - id_epio_id    ', id_epio_id
00087    print *, trim(ch_id), ': - id_trans_rank ', id_trans_rank
00088    print *, trim(ch_id), ': - id_epio_size  ', id_epio_size
00089    print *, trim(ch_id), ': - id_nbr_corner ', id_nbr_corner
00090    print *, trim(ch_id), ': - id_mask       ', id_mask
00091 #endif
00092 !
00093 ! Initialize ila_args contents to 999999
00094 !
00095   ila_args = 999999
00096 
00097 ! 1.2. Fill the content
00098 
00099   ila_args(1) = PSMILe_trans_Set_tgt_epio_info
00100   ila_args(2) = global_rank
00101   ila_args(3) = PRISM_REAL
00102   ila_args(4) = Appl%sequence_number
00103   ila_args(5) = Appl%rank
00104   ila_args(6) = id_epio_id
00105   ila_args(7) = id_epio_size
00106 ! PSMILe_3D = PRISM_3d to indicate to the transformer this is a 3d information
00107 ! (ie reception of z coordinates)
00108   ila_args(8) = id_nbr_corner
00109   ila_args(9) = PSMILe_3D
00110   ila_args(10) = id_mask
00111 !
00112 ! 2. Send the header message to the transformer
00113 !
00114   call psmile_trs_inform(ila_args, id_trans_rank, id_err)
00115 
00116 !
00117 ! 3. Provide the elements involved in the interp to the transformer
00118 !
00119   il_send_size = id_epio_size*id_nbr_corner
00120 
00121   ! 3.1. The grid point or corner lat
00122   CALL MPI_Send(dda_epio_lat(1), il_send_size, MPI_Real, &
00123      id_trans_rank, 1, comm_trans, id_err)
00124   
00125   ! 3.2. The grid point or corner lon
00126   CALL MPI_Send(dda_epio_lon(1), il_send_size, MPI_Real, &
00127      id_trans_rank, 2, comm_trans, id_err)
00128   
00129   ! 3.3. The grid point or corner z
00130   CALL MPI_Send(dda_epio_z(1), il_send_size, MPI_Real, &
00131      id_trans_rank, 3, comm_trans, id_err)
00132 
00133   !
00134   ! 3.4. The mask
00135   IF (id_mask .EQ. 1) THEN
00136       CALL MPI_Send(ida_epio_mask(1), id_epio_size, MPI_Integer, &
00137          id_trans_rank, 4, comm_trans, id_err)
00138   END IF
00139 
00140 #ifdef VERBOSE
00141       print *,trim(ch_id),': PSMILe_Trs_set_tgt_epio3d_real: eof ierror =',&
00142                id_err
00143 
00144 #endif /* VERBOSE */
00145   
00146 END SUBROUTINE PSMILe_Trs_set_tgt_epio3d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1