psmile_smioc_interface.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   MODULE psmile_smioc_interface
00007 
00008 ! !PUBLIC TYPES
00009   USE PRISM_Constants
00010   USE PSMILe_Common
00011   IMPLICIT NONE
00012 
00013 ! ----------------------------------------------------------------------------
00014 ! Interfaces of smioc extraction routines
00015 ! ----------------------------------------------------------------------------
00016 !
00017 ! The following routines corresponds to the ones used to extract information
00018 ! from the smioc xml files.
00019 !
00020 
00021   INTERFACE
00022 
00023 !----------------------------------------------------------------------------
00024   SUBROUTINE get_smioc_numbers ( id_XML_doc,         &
00025                                  id_nb_unitsets,     &
00026                                  id_nb_grids,        &
00027                                  id_nb_transi,       &
00028                                  id_nb_persis,       &
00029                                  id_comp,            &
00030                                  ld_first_details,   &
00031                                  id_error )
00032 ! !DESCRIPTION
00033 ! This routine gives the numbers of Fortran unit sets, grids,
00034 ! transi and persis for one smioc
00035 !
00036 !----------------------------------------------------------------------
00037 !
00038 ! 0. Declaration
00039 !
00040     USE PSMILe_smioc
00041 !
00042 ! handle of XML content of the smioc file
00043     INTEGER, INTENT(In) :: id_XML_doc
00044 
00045 ! number of Fortran unit sets for the component
00046     INTEGER, INTENT(Out) :: id_nb_unitsets
00047 
00048 ! number of grids for the component
00049     INTEGER, INTENT(Out) :: id_nb_grids
00050 
00051 ! number of transi variables for the component
00052     INTEGER, INTENT(Out) :: id_nb_transi
00053 
00054 ! number of persis variables for the component!
00055     INTEGER, INTENT(Out) :: id_nb_persis
00056 
00057 ! id number of component
00058     INTEGER, INTENT(In)  :: id_comp
00059 
00060 ! logical flag first pass / second pass
00061     LOGICAL, INTENT(In)  :: ld_first_details
00062 
00063 ! returned error code
00064     INTEGER, INTENT(Out) :: id_error
00065 
00066   END SUBROUTINE get_smioc_numbers
00067 !--------------------------------------------------------------------------------
00068   SUBROUTINE get_unitsets_details ( id_XML_doc,         &
00069                                     id_nb_unitsets,     &
00070                                     ida_smioc_unitsets, &
00071                                     id_error)
00072 
00073 ! !DESCRIPTION
00074 ! This routines extracts the Fortran units sets for one smioc
00075 !
00076 !----------------------------------------------------------------------
00077 !
00078 ! 0. Declaration
00079 !
00080     USE PSMILe_smioc
00081 !
00082 ! handle of XML content of the smioc file
00083     INTEGER, INTENT(In) :: id_XML_doc
00084 
00085 ! number of Fortran units sets for the component
00086     INTEGER, INTENT(In) :: id_nb_unitsets
00087 
00088 ! Fortran units sets for the component
00089     INTEGER, DIMENSION(id_nb_unitsets,3), INTENT(Out) :: ida_smioc_unitsets
00090 
00091 ! returned error code
00092     INTEGER, INTENT(Out) :: id_error
00093 
00094   END SUBROUTINE get_unitsets_details
00095 !------------------------------------------------------------------------------
00096   SUBROUTINE get_transi_io_numbers ( id_XML_doc,         &
00097                                      id_nb_transi,       &
00098                                      ida_nb_stand_name,  &
00099                                      ida_nb_transi_in,   &
00100                                      ida_nb_transi_out,  &
00101                                      id_comp,            &
00102                                      ld_first_details,   &
00103                                      id_error  )
00104 !
00105 ! !DESCRIPTION
00106 ! This routine gives the number of input and output for each transi
00107 ! of one smioc
00108 !
00109 !----------------------------------------------------------------------
00110 !
00111 ! 0. Declaration
00112 !
00113     USE PSMILe_smioc
00114 
00115 ! handle of XML content of the smioc file
00116     INTEGER, INTENT(In) :: id_XML_doc
00117 
00118 ! number of transi variables for the component
00119     INTEGER, INTENT(In) :: id_nb_transi
00120 
00121 ! number of standard name per transi for the component
00122     INTEGER, DIMENSION(id_nb_transi), INTENT(Out) :: ida_nb_stand_name
00123 
00124 ! number of input transi per transi for the component
00125     INTEGER, DIMENSION(id_nb_transi), INTENT(Out) :: ida_nb_transi_in
00126 
00127 ! number of output transi per transi for the component
00128     INTEGER, DIMENSION(id_nb_transi), INTENT(Out) :: ida_nb_transi_out
00129 
00130 ! Component id
00131     INTEGER, INTENT(In) :: id_comp
00132 
00133 ! logical flag first pass / second pass
00134     LOGICAL, INTENT(In)  :: ld_first_details
00135 
00136 ! returned error code
00137    INTEGER, INTENT(Out) :: id_error
00138 
00139    END SUBROUTINE get_transi_io_numbers
00140 !----------------------------------------------------------------------------
00141 
00142 !-------------------------------------------------------------------------------
00143   SUBROUTINE get_smioc_transi_numbers ( id_XML_doc,         &
00144                                     id_nb_transi,       &
00145                                     id_error )
00146     USE PSMILe_smioc
00147 !
00148 ! handle of XML content of the smioc file
00149     INTEGER, INTENT(In) :: id_XML_doc
00150 
00151 ! number of transi variables for the component
00152     INTEGER, INTENT(Out) :: id_nb_transi
00153 
00154 ! returned error code
00155     INTEGER, INTENT(Out) :: id_error
00156 !
00157   END SUBROUTINE get_smioc_transi_numbers
00158 !-------------------------------------------------------------------------------
00159 
00160   SUBROUTINE init_grids (id_nb_grids, sda_smioc_grids, id_error)
00161 !
00162     USE PSMILe_smioc
00163 
00164 ! !INPUT PARAMETERS:
00165     INTEGER,INTENT(In):: id_nb_grids ! number of grids
00166 !
00167 ! !RETURN VALUE:
00168 !   grids structure
00169     TYPE (smioc_grid),DIMENSION(id_nb_grids),INTENT(Out):: sda_smioc_grids
00170 !
00171 ! returned error code
00172     INTEGER,INTENT(Out):: id_error
00173 
00174   END SUBROUTINE init_grids
00175 !-------------------------------------------------------------------------------
00176 
00177   SUBROUTINE init_transi (id_nb_transi,                 &
00178                           ida_nb_stand_name,            &
00179                           ida_nb_transi_in,             &
00180                           ida_nb_transi_out,            &
00181                           sda_smioc_transi,             &
00182                           id_error )
00183     USE PSMILe_smioc
00184 
00185 !   number of transient variables
00186     INTEGER,INTENT(In):: id_nb_transi
00187 
00188 !   number of standard names for each transient
00189     INTEGER,DIMENSION(id_nb_transi),INTENT(In):: ida_nb_stand_name
00190 
00191 !   number of input origins for each transient
00192     INTEGER,DIMENSION(id_nb_transi),INTENT(In):: ida_nb_transi_in
00193 
00194 !   number of output for each transient
00195     INTEGER,DIMENSION(id_nb_transi),INTENT(In):: ida_nb_transi_out
00196 !
00197 ! !RETURN VALUE:
00198 !   transients structure
00199     TYPE(transient),DIMENSION(id_nb_transi),INTENT(InOut):: 
00200        sda_smioc_transi
00201 !
00202 ! returned error code
00203    INTEGER,INTENT(Out):: id_error
00204 !
00205   END SUBROUTINE init_transi
00206 !----------------------------------------------------------------------------
00207 !
00208   SUBROUTINE get_transi_details ( id_XML_doc,         &
00209                                   id_nb_transi,       &
00210                                   sda_smioc_transi,   &
00211                                   id_comp,            &
00212                                   ld_first_details,   &
00213                                   id_error )
00214 
00215     USE PSMILe_smioc
00216 
00217 ! handle of XML content of the smioc file
00218     INTEGER, INTENT(In) :: id_XML_doc
00219 
00220 ! number of transi variables
00221     INTEGER, INTENT(In) :: id_nb_transi
00222 
00223 ! transi structure
00224     TYPE(transient), DIMENSION(id_nb_transi), INTENT(InOut) :: sda_smioc_transi
00225 
00226 ! Component id
00227     INTEGER, INTENT(In) :: id_comp
00228 
00229 ! logical flag first pass / second pass
00230     LOGICAL, INTENT(In)  :: ld_first_details
00231 
00232 ! returned error code
00233     INTEGER, INTENT(Out):: id_error
00234 
00235   END SUBROUTINE get_transi_details
00236 !---------------------------------------------------------------------------
00237 !
00238   SUBROUTINE get_persis_details ( id_XML_doc,        &
00239                                   id_nb_persis,      &
00240                                   sda_smioc_persis,  &
00241                                   id_error )
00242     USE PSMILe_smioc
00243 
00244 ! handle of XML content of the smioc file
00245     INTEGER, INTENT(In) :: id_XML_doc
00246 
00247 ! number of persis variables
00248     INTEGER,INTENT(In):: id_nb_persis
00249 
00250 ! persis structure
00251     TYPE(persistent),DIMENSION(id_nb_persis),INTENT (Out):: 
00252        sda_smioc_persis
00253 
00254 ! returned error code
00255     INTEGER,INTENT(Out):: id_error
00256 
00257   END SUBROUTINE get_persis_details 
00258 !-----------------------------------------------------------------------------
00259 !
00260   SUBROUTINE init_comp_udef ( id_nb_transi,                 &
00261                               ida_nb_transi_in,             &
00262                               ida_nb_transi_out,            &
00263                               id_comp,                      &
00264                               id_error )
00265     USE PSMILe_smioc
00266 
00267 !   number of transient variables in XML SMIOC for one component
00268     INTEGER,INTENT(In):: id_nb_transi
00269 
00270 !   number of input origins for each transient
00271     INTEGER,DIMENSION(id_nb_transi),INTENT(In):: ida_nb_transi_in
00272 
00273 !   number of output for each transient
00274     INTEGER,DIMENSION(id_nb_transi),INTENT(In):: ida_nb_transi_out
00275 
00276 !   index of component
00277     INTEGER, INTENT(In) :: id_comp
00278 !
00279 ! !RETURN VALUE:
00280 !   Global structure sga_comp_udef_idx variables are all = .false.
00281 !
00282 ! returned error code
00283    INTEGER,INTENT(Out):: id_error
00284 
00285   END SUBROUTINE init_comp_udef
00286 !------------------------------------------------------------------------------
00287 !
00288   SUBROUTINE create_transi_udef ( id_nb_transi,     &
00289                                   id_xml,           &
00290                                   id_u,             &
00291                                   id_ch,            &
00292                                   id_side,          &
00293                                   sda_smioc_transi, &
00294                                   id_comp,          &
00295                                   id_error )
00296 !
00297     USE PSMILe_smioc
00298 !   Dimensions of array sda_smioc_transi (2nd pass)
00299     Integer, Intent(In)          :: id_nb_transi
00300 
00301 !   Index of transient (geographic) to be copied (defined in the SMIOC XML)
00302     Integer, Intent(In)          :: id_xml
00303 
00304 !   Index of associated transient "udef" to be created for this component
00305     Integer, Intent(In)          :: id_u
00306 
00307 !   Index of channel (In OR Out) of the SMIOC XML (geographic) transient
00308     Integer, Intent(In)          :: id_ch
00309 
00310 !   Side of channel (In) only .XOR. (Out) only of the id_ch channel
00311     Integer, Intent(In)          :: id_side
00312 
00313 !   transients structure (array allocated with dimension id_nb_transi in second pass)
00314     TYPE(transient), Dimension(id_nb_transi), TARGET,  Intent(InOut)  ::  sda_smioc_transi
00315 !
00316 !   Index of component
00317     Integer, Intent(In)          :: id_comp
00318 
00319 !   returned error code
00320     Integer, Intent(Out)         :: id_error
00321 !
00322   END SUBROUTINE create_transi_udef
00323 !-----------------------------------------------------------------------------
00324 !
00325   SUBROUTINE init_persis (id_nb_persis,      &
00326                           sda_smioc_persis, &
00327                           id_error )
00328     USE PSMILe_smioc
00329 
00330 !   number of persistent variables
00331     INTEGER,INTENT(In):: id_nb_persis
00332 !
00333 ! !RETURN VALUE:
00334 !   persistents structure
00335     TYPE(persistent),DIMENSION(id_nb_persis),INTENT(Out):: 
00336        sda_smioc_persis
00337 !
00338 ! returned error code
00339    INTEGER,INTENT(Out):: id_error
00340 
00341   END SUBROUTINE init_persis
00342 !-----------------------------------------------------------------------------
00343 !
00344   SUBROUTINE write_grids_details (id_nb_grids,     &
00345                                   sda_grids,       &
00346                                   id_chanel,       &
00347                                   id_error )
00348     USE PSMILe_smioc
00349 
00350 !   number of grids
00351     INTEGER,INTENT(In):: id_nb_grids
00352 !   grids structure
00353     TYPE (smioc_grid),DIMENSION(id_nb_grids),INTENT (In):: sda_grids
00354 !   channel used for testing smioc infos
00355     INTEGER,INTENT(In):: id_chanel
00356 !
00357 !   returned error code
00358     INTEGER,INTENT(Out):: id_error
00359 
00360   END SUBROUTINE write_grids_details
00361 !------------------------------------------------------------------------------
00362 
00363   SUBROUTINE write_transi_details (id_nb_transi,    &
00364                                    sda_transi,      &
00365                                    id_chanel,       &
00366                                    id_error )
00367     USE PSMILe_smioc
00368 
00369 !   number of transient variables
00370     INTEGER,INTENT(In):: id_nb_transi
00371 !   transients structure
00372     TYPE(transient),DIMENSION(id_nb_transi),INTENT(In):: sda_transi
00373 !   channel used for testing smioc infos
00374     INTEGER,INTENT(In):: id_chanel
00375 !
00376 ! returned error code
00377    INTEGER,INTENT(Out):: id_error
00378 
00379   END SUBROUTINE write_transi_details
00380 !---------------------------------------------------------------------------------
00381 !
00382   SUBROUTINE write_persis_details (id_nb_persis,    &
00383                                    sda_persis,      &
00384                                    id_chanel,       &
00385                                    id_error)
00386     USE PSMILe_smioc
00387 
00388 !   number of persistent variables
00389     INTEGER,INTENT(In):: id_nb_persis
00390 
00391 !   persistents structure
00392     TYPE(persistent),DIMENSION(id_nb_persis),INTENT(In):: sda_persis
00393 
00394 !   channel used for testing smioc infos
00395     INTEGER,INTENT(In):: id_chanel
00396 !
00397 !  returned error code
00398     INTEGER,INTENT(Out):: id_error
00399 
00400   END SUBROUTINE write_persis_details
00401 !----------------------------------------------------------------------------
00402 !
00403   SUBROUTINE get_grids_details ( id_XML_doc,         &
00404                                  id_nb_grids,        &
00405                                  sda_smioc_grids,    &
00406                                  id_error )
00407     USE PSMILe_smioc
00408 
00409 ! handle of XML content of the smioc file
00410     INTEGER, INTENT(In) :: id_XML_doc
00411 
00412 ! number of grids for the component
00413     INTEGER, INTENT(In) :: id_nb_grids
00414 
00415 ! grids structure for the component
00416     TYPE (smioc_grid), DIMENSION(id_nb_grids), INTENT(Out) :: sda_smioc_grids
00417 !
00418 ! returned error code
00419    INTEGER, INTENT(Out) :: id_error
00420 
00421   END SUBROUTINE get_grids_details
00422 !------------------------------------------------------------------------------
00423 !
00424   SUBROUTINE get_smioc_grids_transi_nb ( id_XML_doc,       &
00425                                  id_nb_grids,              &
00426                                  id_nb_transi,             &
00427                                  id_error )
00428 
00429     USE PSMILe_smioc
00430 
00431 ! handle of XML content of the smioc file
00432     INTEGER, INTENT(In) :: id_XML_doc
00433 
00434 ! number of grids variables for the component
00435     INTEGER, INTENT(Out) :: id_nb_grids  
00436 
00437 ! number of transi variables for the component
00438     INTEGER, INTENT(Out) :: id_nb_transi  
00439 
00440 ! returned error code
00441     INTEGER, INTENT(Out) :: id_error 
00442 
00443   END SUBROUTINE get_smioc_grids_transi_nb
00444 !-------------------------------------------------------------------------------
00445 !
00446   SUBROUTINE put_udef_suffix ( cd_in, cd_out, id_chan, id_side )
00447 
00448   USE PSMILe_smioc
00449 
00450 ! !Input  argument
00451    Character(len=*),        Intent(In)  :: cd_in
00452 
00453 ! !Output argument
00454    Character(len=max_name), Intent(Out) :: cd_out
00455 !
00456 ! !Input argument
00457    Integer,                  Intent(In) :: id_chan
00458 !
00459 ! !Input argument : 0 = source = "O",       1 = target = "I"
00460    Integer,                  Intent(In) :: id_side
00461 
00462   END SUBROUTINE put_udef_suffix
00463 !-------------------------------------------------------------------------------
00464 !
00465   END INTERFACE
00466 !
00467   END MODULE psmile_smioc_interface

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1