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

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1