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

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1