get_grids_details.F90

Go to the documentation of this file.
00001 !------------------------------------------------------------------------
00002 ! Copyright 2006-2010, CERFACS, Toulouse, France.
00003 ! All rights reserved. Use is subject to license terms.
00004 !======================================================================
00005 !
00006   SUBROUTINE get_grids_details ( id_XML_doc,         &
00007                                  id_nb_grids,        &
00008                                  sda_smioc_grids,    &
00009                                  id_error )     
00010 
00011 ! !DESCRIPTION
00012 ! This routines gives extracts the grids informations for all the grids
00013 ! of one smioc
00014 !
00015 !----------------------------------------------------------------------
00016 !
00017     USE PSMILe_smioc
00018     IMPLICIT NONE
00019 !
00020 ! !REVISED HISTORY
00021 !   Date        Programmer     Description
00022 ! ----------    ----------     -----------
00023 ! 20/10/2003    S. Valcke      Creation
00024 ! 30/12/2003    D. Declat      Implemented as a module
00025 !
00026 !EOP
00027 !----------------------------------------------------------------------
00028 ! $Id: psmile_smioc.F90 1793 2008-11-25 14:58:31Z valcke $
00029 ! $Author: valcke $
00030 !----------------------------------------------------------------------
00031 !
00032 ! 0. Declaration
00033 !
00034 ! handle of XML content of the smioc file
00035     INTEGER, INTENT(In) :: id_XML_doc
00036 
00037 ! number of grids for the component
00038     INTEGER, INTENT(In) :: id_nb_grids  
00039 
00040 ! grids structure for the component
00041     TYPE (smioc_grid), DIMENSION(id_nb_grids), INTENT(Out) :: sda_smioc_grids 
00042 !
00043 ! returned error code
00044    INTEGER, INTENT(Out) :: id_error  
00045 !
00046     INTEGER :: sasa_c_convert_char2int
00047     INTEGER :: sasa_c_get_attri_2nd_level, sasa_c_get_attri_3rd_level
00048     INTEGER :: sasa_c_get_attri_4th_level, sasa_c_get_attri_5th_level
00049     INTEGER :: sasa_c_get_element_5th_level_i
00050     INTEGER :: sasa_c_get_element_5th_level_d
00051     INTEGER :: sasa_c_get_number_3rd_level
00052 !
00053     CHARACTER(LEN=max_name) :: cla_char
00054     INTEGER :: ib, ib_bis, ib_ind, il_index
00055 !
00056     INTEGER :: il_length
00057 !
00058 !-----------------------------------------------------------------------
00059 !
00060     DO ib =1, id_nb_grids
00061 
00062       ! get the grid local name
00063       id_error = &
00064          sasa_c_get_attri_2nd_level (id_XML_doc,          &
00065          'component', 0, 'grid', ib, 'local_name',   &
00066          sda_smioc_grids(ib)%cg_grid_name, il_length)
00067 
00068       ! get the indexing_dimension elements
00069       id_error = &
00070          sasa_c_get_number_3rd_level(id_XML_doc,               &
00071          'component', 0, 'grid', ib, 'indexing_dimension',&
00072          ib_ind)
00073       
00074       IF (ib_ind > 0) THEN
00075           DO ib_bis = 1, ib_ind
00076             id_error = &
00077                sasa_c_get_attri_3rd_level (id_XML_doc,                &
00078                'component', 0, 'grid', ib, 'indexing_dimension', &
00079                ib_bis, 'index', cla_char, il_length)
00080 
00081             IF (id_error .EQ. 0) THEN
00082                 READ (cla_char, *) il_index
00083             ELSE
00084                 PRINT *, '****************************************************'
00085                 PRINT *, 'Problem in reading index in indexing_dimension      '
00086                 PRINT *, '****************************************************'
00087                 CALL PSMILe_Flushstd
00088                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00089             ENDIF
00090 
00091             id_error = &
00092                sasa_c_get_attri_3rd_level (id_XML_doc,                &
00093                'component', 0, 'grid', ib, 'indexing_dimension', &
00094                ib_bis, 'periodic', cla_char, il_length)
00095             IF (id_error .EQ. 0) THEN
00096                 sda_smioc_grids(ib)%iga_periodic(il_index) =               &
00097                    sasa_c_convert_char2int(cla_char(1:il_length))
00098             ENDIF
00099         
00100           END DO
00101       ENDIF
00102     END DO
00103 
00104   END SUBROUTINE get_grids_details
00105 
00106 !
00107 !======================================================================

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1