prismdrv_get_comp_names.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: PRISMDrv_Get_comp_names
00008 !
00009 ! !INTERFACE
00010 subroutine prismdrv_get_comp_names(id_comp_id,       &
00011                                     cda_appli_name,   &
00012                                     cda_comp_name,    &
00013                                     id_err)
00014 
00015 !
00016 ! !USES:
00017 !
00018   USE PRISMDrv, dummy_interface => PRISMDrv_Get_comp_names
00019 
00020   IMPLICIT NONE
00021 
00022 !
00023 ! !PARAMETERS:
00024 !
00025   INTEGER, INTENT (In)                :: id_comp_id
00026 !
00027 ! ! RETURN VALUE
00028 !
00029   CHARACTER(LEN=max_name), INTENT (Out) :: cda_appli_name
00030   CHARACTER(LEN=max_name), INTENT (Out) :: cda_comp_name
00031   INTEGER, INTENT (Out)                 :: id_err   ! error value
00032 
00033 ! !DESCRIPTION
00034 ! Subroutine "PRISMDrv_Get_smioc_names" receive the comp_id and gives back
00035 ! the names of the appli and component.
00036 !
00037 ! !REVISED HISTORY
00038 !   Date      Programmer    Description
00039 ! ----------  ----------    -----------
00040 ! 19/10/2010  JM Epitalon    Creation
00041 !
00042 ! EOP
00043 !----------------------------------------------------------------------
00044 ! $Id: prismdrv_get_comp_names.F90 2399 2010-06-21 08:09:39Z coquart $
00045 ! $Author: coquart $
00046 !----------------------------------------------------------------------
00047 !
00048 ! 0. Local declarations
00049 !
00050   CHARACTER(LEN=len_cvs_string), SAVE  :: mycvs = 
00051      '$Id: prismdrv_get_comp_names.F90 2399 2010-06-21 08:09:39Z coquart $'
00052 !
00053   INTEGER                             :: ib, ib_ter
00054   LOGICAL                             :: ll_found
00055   INTEGER, PARAMETER                  :: nerrp=2
00056   INTEGER                             :: ierrp(nerrp)
00057 !
00058 ! ---------------------------------------------------------------------
00059 !
00060   id_err = 0
00061 !
00062 ! 1. With the comp_id get the comp name and the application name
00063 !
00064   ll_found = .false.
00065 
00066 !  for all processes except driver processes
00067   DO ib = 0, ig_nb_tot_pes + (ig_driver_nb_pes-1)
00068     IF ((ib < PRISMdrv_root) .OR. ((PRISMdrv_root + ig_driver_nb_pes) <= ib)) THEN
00069       DO ib_ter = 1, Drv_Procs(ib+1)%comps_per_rank
00070          IF (Drv_Procs(ib+1)%global_comp_id(ib_ter) == id_comp_id) THEN
00071 
00072             cda_appli_name = Drv_Procs(ib+1)%appli_name
00073             cda_comp_name = Drv_Procs(ib+1)%comp_name(ib_ter)
00074             ll_found = .true.
00075             EXIT
00076          END IF
00077       ENDDO
00078       IF ( ll_found ) EXIT
00079     END IF
00080   END DO
00081 
00082   IF (.NOT. ll_found) THEN
00083       ierrp(1) = ig_nb_tot_pes+(ig_driver_nb_pes-1)
00084       ierrp(2) = ib
00085       call psmile_error_common ( id_err, 'PRISMDrv_Get_comp_names', &
00086          ierrp, 2, __FILE__, __LINE__ )
00087   END IF
00088 
00089 !
00090 
00091 end subroutine prismdrv_get_comp_names
00092 

Generated on 1 Dec 2011 for Oasis4 by  doxygen 1.6.1