get_smioc_numbers.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 !BOP
00006 !
00007   SUBROUTINE get_smioc_numbers ( id_XML_doc,         &
00008                                  id_nb_unitsets,     &
00009                                  id_nb_grids,        &
00010                                  id_nb_transi,       &
00011                                  id_nb_persis,       &
00012                                  id_comp,            &
00013                                  ld_userdef_details,   &
00014                                  id_error )
00015 
00016 ! !DESCRIPTION
00017 ! This routine gives the numbers of Fortran unit sets, grids, transi and persis
00018 ! for one XML smioc
00019 !
00020 !----------------------------------------------------------------------------------
00021 
00022     USE PSMILe_smioc
00023     IMPLICIT NONE
00024 !
00025 !EOP
00026 !----------------------------------------------------------------------
00027 ! $Id: psmile_smioc.F90 1793 2008-11-25 14:58:31Z valcke $
00028 ! $Author: valcke $
00029 !----------------------------------------------------------------------
00030 !
00031 ! 0. Declaration
00032 !
00033 ! handle of XML content of the smioc file
00034     INTEGER, INTENT(In) :: id_XML_doc
00035 
00036 ! number of Fortran unit sets for the component
00037     INTEGER, INTENT(Out) :: id_nb_unitsets
00038 
00039 ! number of grids for the component
00040     INTEGER, INTENT(Out) :: id_nb_grids       
00041 
00042 ! number of transi variables for the component
00043     INTEGER, INTENT(Out) :: id_nb_transi  
00044 
00045 ! number of persis variables for the component!
00046     INTEGER, INTENT(Out) :: id_nb_persis
00047 
00048 ! id number of component
00049     INTEGER, INTENT(In)  :: id_comp
00050 
00051 ! logical flag first pass / second pass
00052     LOGICAL, INTENT(In)  :: ld_userdef_details
00053 
00054 ! returned error code
00055     INTEGER, INTENT(Out) :: id_error 
00056 !
00057     INTEGER :: sasa_c_get_number_2nd_level, sasa_c_get_number_3rd_level
00058     INTEGER :: sasa_c_get_number_1st_level, il_nbpc
00059 !
00060 !----------------------------------------------------------------------
00061 !
00062     il_nbpc = 0
00063     id_error = &
00064        sasa_c_get_number_1st_level(id_XML_doc,    &
00065        'prismcomponent', il_nbpc)
00066     IF (il_nbpc == 1) THEN
00067         PRINT *, '******************************************************'
00068         PRINT *, 'Since SVN revision 2633, "prismcomponent" must be '
00069         PRINT *, 'replaced by "component" in all SMIOC XML file'
00070         PRINT *, '******************************************************'
00071         CALL PSMILe_Flushstd
00072         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00073     ENDIF
00074 
00075     id_error = &
00076        sasa_c_get_number_3rd_level(id_XML_doc, 'component', 0,   &
00077        'code', 0, 'Fortran_units', id_nb_unitsets)
00078     print *,' get_smioc_numbers id_error units = ',id_error
00079 
00080     id_error = &
00081        sasa_c_get_number_2nd_level(id_XML_doc,    &
00082        'component', 0, 'grid', id_nb_grids)
00083     print *,' get_smioc_numbers id_error grids = ',id_error
00084 
00085     id_error = &
00086        sasa_c_get_number_2nd_level(id_XML_doc,    &
00087        'component', 0, 'transient', id_nb_transi)
00088     print *,' get_smioc_numbers id_error transi = ',id_error
00089 
00090     id_error = &
00091        sasa_c_get_number_2nd_level(id_XML_doc,    &
00092        'component', 0, 'persistent', id_nb_persis)
00093     print *,' get_smioc_numbers id_error persist = ',id_error
00094 
00095 ! If called by driver, we must include "udef transients" of current component in id_nb_transi
00096 !                      and in id_nb_grids (one implicit "gridless" grid per udef transient)
00097 !
00098     if ( ld_userdef_details ) then
00099          id_nb_transi = id_nb_transi + iga_comp_nb_udef(id_comp)
00100          id_nb_grids  = id_nb_grids  + iga_comp_nb_udef(id_comp)
00101     endif
00102 !
00103   END SUBROUTINE get_smioc_numbers
00104 !
00105 !======================================================================

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1