prismtrs_set_tgt_epio_real.F90

Go to the documentation of this file.
00001 !------------------------------------------------------------------------
00002 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00003 ! Copyright 2006-2010, NEC High Performance Computing, Duesseldorf, Germany.
00004 ! All rights reserved. Use is subject to OASIS4 license terms.
00005 !-----------------------------------------------------------------------
00006 !BOP
00007 !
00008 ! !ROUTINE: PRISMTrs_Set_tgt_epio_real
00009 !
00010 ! !INTERFACE
00011 subroutine prismtrs_set_tgt_epio_real(ida_loop, id_err)
00012 !
00013 ! !USES:
00014 !
00015   USE PRISMDrv, dummy_interface => PRISMTrs_Set_tgt_epio_real
00016 !
00017   IMPLICIT NONE
00018 !
00019 ! !PARAMETERS:
00020 !
00021   INTEGER, DIMENSION(PSMILe_trans_Header_length), INTENT (IN) :: ida_loop
00022 !
00023 ! ida_loop(2) : global rank of the psmile process sending the info
00024 ! ida_loop(6) : epio id
00025 ! ida_loop(4) : target component id
00026 ! ida_loop(5) : target process id
00027 ! ida_loop(7) : epio 3D size 
00028 ! ida_loop(8) : number of corners for target grid
00029 ! ida_loop(9) : PSMILe_3D
00030 ! ida_loop(10): indicates if the mask will be received or not
00031 !
00032 ! ! RETURN VALUE
00033 !
00034   INTEGER, INTENT (Out)               :: id_err   ! error value
00035 
00036 ! !DESCRIPTION
00037 ! Subroutine "PRISMTrs_Set_tgt_epio_real" insures the reception of the 
00038 ! informations about the epio sent by a model through the PSMILe.
00039 !
00040 ! !REVISED HISTORY
00041 !   Date      Programmer   Description
00042 ! ----------  ----------   -----------
00043 ! 01/12/2003  D. Declat    Creation from prismdrv_trs_set_epio_info
00044 ! 05/10/2006  S. Valcke    Revised for corner reception
00045 ! EOP
00046 !----------------------------------------------------------------------
00047 ! $Id: prismtrs_set_tgt_epio_real.F90 2685 2010-10-28 14:05:10Z coquart $
00048 ! $Author: coquart $
00049 !----------------------------------------------------------------------
00050 !
00051 ! 0. Local declarations
00052 !
00053   CHARACTER(LEN=len_cvs_string), SAVE  :: mycvs = 
00054      '$Id: prismtrs_set_tgt_epio_real.F90 2685 2010-10-28 14:05:10Z coquart $'
00055 !
00056 ! received in ida_loop
00057 !
00058   INTEGER :: il_process_global_rank, il_epio_id, il_tgt_comp_id
00059   INTEGER :: il_tgt_process
00060   INTEGER :: il_epio_size, il_nbr_corner
00061   INTEGER :: il_tgt_mask, il_dimtype
00062 !
00063 ! Auxiliary variables
00064 !
00065   INTEGER                            :: il_status(MPI_STATUS_SIZE)
00066 !
00067   INTEGER, PARAMETER  :: nerrp = 2
00068   INTEGER             :: ierrp (nerrp)
00069   INTEGER             :: il_recv_size
00070 !
00071 !----------------------------------------------------------------------
00072 !
00073 #ifdef VERBOSE
00074   PRINT *, '| | | Enter PRISMTrs_Set_tgt_epio_real'
00075   call psmile_flushstd
00076 #endif
00077 !
00078 ! Put received argument in local integer variables
00079   il_process_global_rank = ida_loop(2)
00080   il_epio_id             = ida_loop(6)
00081   il_tgt_comp_id         = ida_loop(4)
00082   il_tgt_process         = ida_loop(5)
00083   il_epio_size           = ida_loop(7)
00084   il_nbr_corner          = ida_loop(8)
00085   il_dimtype             = ida_loop(9)
00086   il_tgt_mask            = ida_loop(10)  
00087 !
00088 ! 1. Reception of the different vectors
00089 !
00090 #ifdef VERBOSE
00091   PRINT *, &
00092      '| | | | Reception of the EPIOS latitudes, longitudes and z'
00093   call psmile_flushstd
00094 #endif
00095 
00096   il_recv_size    = il_epio_size*il_nbr_corner
00097 
00098 ! 1.2. Reception of the lat, lon, z and mask
00099 !
00100   ALLOCATE(Drv_Epios(il_epio_id)%tgt_lat_pointer_real(1:il_recv_size), &
00101        stat = id_err)
00102   IF (id_err > 0) THEN
00103      ierrp (1) = id_err
00104      ierrp (2) = il_recv_size
00105      id_err = PRISM_Error_Alloc
00106 
00107      call psmile_error_common ( id_err, 'Tgt_lat_pointer_real', &
00108           ierrp, 2, __FILE__, __LINE__ )
00109      RETURN
00110   ENDIF
00111 
00112   ALLOCATE(Drv_Epios(il_epio_id)%tgt_lon_pointer_real(1:il_recv_size), &
00113        stat = id_err)
00114   IF (id_err > 0) THEN
00115      ierrp (1) = id_err
00116      ierrp (2) = il_recv_size
00117      id_err = PRISM_Error_Alloc
00118 
00119      call psmile_error_common ( id_err, 'Tgt_lon_pointer_real', &
00120           ierrp, 2, __FILE__, __LINE__ )
00121      RETURN
00122   ENDIF
00123 
00124   ALLOCATE(Drv_Epios(il_epio_id)%tgt_z_pointer_real(1:il_recv_size), &
00125        stat = id_err)
00126   IF (id_err > 0) THEN
00127      ierrp (1) = id_err
00128      ierrp (2) = il_recv_size
00129      id_err = PRISM_Error_Alloc
00130 
00131      call psmile_error_common ( id_err, 'Tgt_z_pointer_real', &
00132           ierrp, 2, __FILE__, __LINE__ )
00133      RETURN
00134   ENDIF
00135 
00136   ALLOCATE(Drv_Epios(il_epio_id)%tgt_mask_pointer(1:il_epio_size), &
00137      stat = id_err)
00138   IF (id_err > 0) THEN
00139       ierrp (1) = id_err
00140       ierrp (2) = il_epio_size
00141       id_err = PRISM_Error_Alloc
00142       
00143       call psmile_error_common ( id_err, 'Tgt_msk_pointer', &
00144          ierrp, 2, __FILE__, __LINE__ )
00145       RETURN
00146   ENDIF
00147 
00148   CALL MPI_Recv (Drv_Epios(il_epio_id)%tgt_lat_pointer_real, &
00149      il_recv_size, MPI_Real, &
00150      il_process_global_rank, 1, comm_drv_trans, il_status, id_err)
00151   Drv_Epios(il_epio_id)%tgt_lat_pointer_real(:) = &
00152      Drv_Epios(il_epio_id)%tgt_lat_pointer_real(:)*real_deg2rad
00153 
00154   CALL MPI_Recv (Drv_Epios(il_epio_id)%tgt_lon_pointer_real, &
00155      il_recv_size, MPI_Real, &
00156      il_process_global_rank, 2, comm_drv_trans, il_status, id_err)
00157   Drv_Epios(il_epio_id)%tgt_lon_pointer_real(:) = &
00158      Drv_Epios(il_epio_id)%tgt_lon_pointer_real(:)*real_deg2rad
00159 
00160   CALL MPI_Recv (Drv_Epios(il_epio_id)%tgt_z_pointer_real, &
00161      il_recv_size, MPI_Real, &
00162      il_process_global_rank, 3, comm_drv_trans, il_status, id_err)
00163 
00164   IF (il_tgt_mask > 0 ) THEN
00165       CALL MPI_Recv (Drv_Epios(il_epio_id)%tgt_mask_pointer, &
00166          il_epio_size, MPI_Integer, &
00167          il_process_global_rank, 4, comm_drv_trans, il_status, id_err)
00168   ELSE
00169       Drv_Epios(il_epio_id)%tgt_mask_pointer(:) = 1
00170   END IF
00171 
00172 #ifdef VERBOSE
00173   PRINT *, &
00174      '| | | | Set the EPIOS latitudes, longitudes and z'
00175   PRINT *, &
00176      '| | | | | Epio :',il_epio_id ,'Size :',il_epio_size
00177   call psmile_flushstd
00178 #endif  
00179   
00180 !
00181 ! 3. Set the general epio information
00182 !
00183   Drv_Epios(il_epio_id)%tgt_comp_id = il_tgt_comp_id
00184   Drv_Epios(il_epio_id)%tgt_process = il_tgt_process
00185 
00186 !
00187 ! 4. Set the arrays information
00188 !
00189   Drv_Epios(il_epio_id)%tgt_coord_type = PRISM_Real
00190   Drv_Epios(il_epio_id)%tgt_size = il_epio_size 
00191   Drv_Epios(il_epio_id)%tgt_nbr_corner = il_nbr_corner
00192   !  
00193 #ifdef VERBOSE
00194   PRINT *, '| | | Quit PRISMTrs_Set_tgt_epio_real '
00195   call psmile_flushstd
00196 #endif
00197   
00198 END SUBROUTINE PRISMTrs_Set_tgt_epio_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1