prismdrv_get_smioc_file_name.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_smioc_file_name
00008 !
00009 ! !INTERFACE
00010 subroutine prismdrv_get_smioc_file_name(id_comp_id,       &
00011                                         cda_file_name,    &
00012                                         id_file_name_len, &
00013                                         id_err)
00014 
00015 !
00016 ! !USES:
00017 !
00018   USE PRISMDrv, dummy_interface => PRISMDrv_Get_smioc_file_name
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_file_name
00030   INTEGER, INTENT (Out)                 :: id_file_name_len
00031   INTEGER, INTENT (Out)                 :: id_err   ! error value
00032 
00033 ! !DESCRIPTION
00034 ! Subroutine "PRISMDrv_Get_smioc_file_name" receive the comp_id and gives back
00035 ! the name of the smioc file to read.
00036 !
00037 ! !REVISED HISTORY
00038 !   Date      Programmer   Description
00039 ! ----------  ----------   -----------
00040 ! 10/02/2004  D. Declat    Creation
00041 !
00042 ! EOP
00043 !----------------------------------------------------------------------
00044 ! $Id: prismdrv_get_smioc_file_name.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_smioc_file_name.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_file_name = TRIM(Drv_Procs(ib+1)%appli_name)// &
00073                  "_"//                           &
00074                  TRIM(Drv_Procs(ib+1)%comp_name(ib_ter))// &
00075                  "_smioc.xml"
00076             id_file_name_len = 0
00077             id_file_name_len = LEN_TRIM(Drv_Procs(ib+1)%appli_name) + &
00078                            1 + LEN_TRIM(Drv_Procs(ib+1)%comp_name(ib_ter)) + 10
00079             ll_found = .true.
00080             EXIT
00081          END IF
00082       ENDDO
00083       IF ( ll_found ) EXIT
00084     END IF
00085   END DO
00086 
00087   IF (.NOT. ll_found) THEN
00088       ierrp(1) = ig_nb_tot_pes+(ig_driver_nb_pes-1)
00089       ierrp(2) = ib
00090       call psmile_error_common ( id_err, 'PRISMDrv_Get_smioc_file_name', &
00091          ierrp, 2, __FILE__, __LINE__ )
00092   END IF
00093 
00094 !
00095 
00096 end subroutine prismdrv_get_smioc_file_name
00097 
00098 

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1