get_transi_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 !BOP
00006 !
00007 !======================================================================
00008 !
00009   SUBROUTINE get_transi_details ( id_XML_doc,  &
00010      id_nb_transi,       &
00011      sda_smioc_transi,   &
00012      id_comp,            &
00013      ld_userdef_details,   &
00014      id_error )     
00015 
00016 ! !DESCRIPTION
00017 ! This routine extracts the informations about the transi, the input
00018 ! and output transi of one 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 transi variables
00037     INTEGER, INTENT(In) :: id_nb_transi
00038 
00039 ! transi structure
00040     TYPE(transient), DIMENSION(id_nb_transi), INTENT(InOut) :: sda_smioc_transi
00041 
00042 ! Component id
00043     INTEGER, INTENT(In) :: id_comp
00044 
00045 ! logical flag first pass / second pass
00046     LOGICAL, INTENT(In)  :: ld_userdef_details
00047                                                  
00048 ! returned error code
00049     INTEGER, INTENT(Out):: id_error 
00050 
00051 ! Loop indices
00052     INTEGER :: ib, ib_bis, ib_nt, ib_xml, ib_xmlv, ib_xud
00053 !!$    INTEGER :: il_nb, il_nb_bis, il_nb_ter, il_nb_terbis, il_nb_terter
00054     INTEGER :: il_nb, il_nb_bis, il_nb_ter, il_nb_terbis
00055     INTEGER :: il_nb_qua, il_nb_cin, il_nb_six, il_nb_hep, il_nb_oct
00056     INTEGER :: il_nb_bisbis
00057     INTEGER :: il_xml_transi
00058     INTEGER :: il_dim_i, il_dim_o, il_ch, il_side
00059 !
00060 ! Logical to test if PSMILe was compiled with __PSMILE_WITH_IO
00061     logical :: ll_io
00062 !
00063     CHARACTER(LEN=max_name) :: cla_char
00064 !
00065     INTEGER :: sasa_c_get_attri_1st_level, sasa_c_get_attri_2nd_level
00066     INTEGER :: sasa_c_get_attri_3rd_level, sasa_c_get_attri_4th_level
00067     INTEGER :: sasa_c_get_attri_5th_level
00068     INTEGER :: sasa_c_get_number_3rd_level, sasa_c_get_number_4th_level 
00069     INTEGER :: sasa_c_get_number_5th_level
00070     INTEGER :: sasa_c_get_number_6th_level, sasa_c_get_number_7th_level
00071     INTEGER :: sasa_c_get_number_8th_level, sasa_c_get_number_9th_level
00072     INTEGER :: sasa_c_get_number_10th_level, sasa_c_get_number_11th_level
00073     INTEGER :: sasa_c_get_element_2nd_level_c
00074     INTEGER :: sasa_c_get_element_3rd_level_c 
00075     INTEGER :: sasa_c_get_element_3rd_level_i
00076     INTEGER :: sasa_c_get_element_3rd_level_d
00077     INTEGER :: sasa_c_get_element_4th_level_c, sasa_c_get_element_4th_level_i
00078     INTEGER :: sasa_c_get_element_6th_level_c, sasa_c_get_element_6th_level_i
00079     INTEGER :: sasa_c_get_element_6th_level_d
00080     INTEGER :: sasa_c_get_element_5th_level_c, sasa_c_get_element_5th_level_i
00081     INTEGER :: sasa_c_get_element_5th_level_d
00082     INTEGER :: sasa_c_get_element_7th_level_c, sasa_c_get_element_7th_level_i
00083     INTEGER :: sasa_c_get_element_8th_level_c
00084     INTEGER :: sasa_c_get_element_9th_level_c, sasa_c_get_element_9th_level_i
00085     INTEGER :: sasa_c_get_element_9th_level_d
00086     INTEGER :: sasa_c_get_element_10th_level_c, sasa_c_get_element_10th_level_i
00087     INTEGER :: sasa_c_get_element_10th_level_d
00088     INTEGER :: sasa_c_convert_char2int
00089 !
00090     INTEGER :: il_test, il_length
00091     DOUBLE PRECISION :: dl_test
00092 !
00093 !----------------------------------------------------------------------
00094 !
00095 ! Fill up of the dummy structure
00096 
00097 !  
00098 !  At first pass (called from prismdrv_get_udef_transients) :
00099 !  id_nb_transi = il_xml_transi = number of transients in XML SMIOC file
00100 !  At second pass (called from prismdrv_init_smioc_struct) :
00101 !  id_nb_transi = total number of transients including "udef" transients
00102     il_xml_transi = id_nb_transi 
00103 #ifdef DEBUG
00104     print *,"get_transi_details : ld_userdef_details = ", ld_userdef_details
00105     print *,"get_transi_details : il_xml_transi    = ", il_xml_transi
00106     print *,"get_transi_details : id_nb_transi     = ", id_nb_transi
00107     print *,"get_transi_details : nb udef transi   = ", iga_comp_nb_udef(id_comp)
00108 #endif
00109 
00110 ! For all the transient_in of the component
00111     DO ib =1, il_xml_transi
00112 
00113 ! * get the transient level informations
00114       id_error = &
00115          sasa_c_get_attri_2nd_level (id_XML_doc,                     &
00116          'component', 0, 'transient', ib, 'local_name',         &
00117          sda_smioc_transi(ib)%cg_local_name, il_length)
00118 
00119       id_error = &
00120          sasa_c_get_attri_2nd_level (id_XML_doc,                     &
00121          'component', 0, 'transient', ib, 'long_name',          &
00122          sda_smioc_transi(ib)%cg_long_name, il_length)
00123 
00124       id_error = &
00125          sasa_c_get_attri_1st_level (id_XML_doc,                     &
00126          'component', 0, 'local_name',                          &
00127          sda_smioc_transi(ib)%cg_comp_name, il_length)
00128 
00129       id_error = &
00130          sasa_c_get_number_3rd_level(id_XML_doc,                             &
00131          'component', 0, 'transient', ib, 'transient_standard_name',    &
00132          il_nb)
00133 
00134       DO ib_bis = 1, il_nb
00135 
00136         id_error = &
00137            sasa_c_get_element_2nd_level_c (id_XML_doc,                        &
00138            'component', 0, 'transient', ib, 'transient_standard_name',   &
00139            ib_bis, sda_smioc_transi(ib)%cga_stand_name(ib_bis), il_length)
00140 
00141       END DO
00142 
00143       id_error = &
00144          sasa_c_get_attri_3rd_level (id_XML_doc,                     &
00145          'component', 0, 'transient', ib, 'physics', 0,         &
00146          'transient_type', cla_char, il_length)
00147       sda_smioc_transi(ib)%ig_transi_type =                     &
00148          sasa_c_convert_char2int(cla_char(1:il_length))
00149 
00150       id_error = &
00151          sasa_c_get_element_3rd_level_c (id_XML_doc,                 &
00152          'component', 0, 'transient', ib, 'physics', 0,         &
00153          'physical_units', 0, sda_smioc_transi(ib)%cg_units, il_length)
00154 
00155       id_error = &
00156          sasa_c_get_element_3rd_level_d (id_XML_doc,                 &
00157          'component', 0, 'transient', ib, 'physics', 0,         &
00158          'valid_min', 0, sda_smioc_transi(ib)%dg_transi_min)
00159 
00160       id_error = &
00161          sasa_c_get_element_3rd_level_d (id_XML_doc,                 &
00162          'component', 0, 'transient', ib, 'physics', 0,         &
00163          'valid_max', 0, sda_smioc_transi(ib)%dg_transi_max)
00164 
00165       id_error = &
00166          sasa_c_get_element_3rd_level_i (id_XML_doc,                 &
00167          'component', 0, 'transient', ib, 'physics', 0,         &
00168          'nbr_bundles', 0, sda_smioc_transi(ib)%ig_nb_bndl)
00169       IF (sda_smioc_transi(ib)%ig_nb_bndl .eq. -280177) THEN
00170           sda_smioc_transi(ib)%ig_nb_bndl = 0
00171       END IF
00172 
00173       id_error = &
00174          sasa_c_get_attri_3rd_level (id_XML_doc,                     &
00175          'component', 0, 'transient', ib, 'numerics', 0,        &
00176          'datatype', cla_char, il_length)
00177       sda_smioc_transi(ib)%ig_datatype =                        &
00178          sasa_c_convert_char2int(cla_char(1:il_length))
00179 
00180 ! ** Get the transient_in informations
00181 
00182 !!$! *** Get the shortest period of exchange
00183 !!$      id_error = &
00184 !!$         sasa_c_get_element_5th_level_i (id_XML_doc,         &
00185 !!$         'component', 0, 'transient', ib, 'intent', 0,  &
00186 !!$         'input', 0, 'minimal_period', 0, 'nbr_secs', 0,     &
00187 !!$         il_test)
00188 !!$      sda_smioc_transi(ib)%sg_transi_in%sg_min_period%second = il_test
00189 !!$
00190 !!$      id_error = &
00191 !!$         sasa_c_get_element_5th_level_i (id_XML_doc,         &
00192 !!$         'component', 0, 'transient', ib, 'intent', 0,  &
00193 !!$         'input', 0, 'minimal_period', 0,                    &
00194 !!$         'nbr_mins', 0, sda_smioc_transi(ib)%sg_transi_in%sg_min_period%minute)
00195 !!$
00196 !!$      id_error = &
00197 !!$         sasa_c_get_element_5th_level_i (id_XML_doc,         &
00198 !!$         'component', 0, 'transient', ib, 'intent', 0,  &
00199 !!$         'input', 0, 'minimal_period', 0,                    &
00200 !!$         'nbr_hours', 0, sda_smioc_transi(ib)%sg_transi_in%sg_min_period%hour)
00201 !!$
00202 !!$      id_error = &
00203 !!$         sasa_c_get_element_5th_level_i (id_XML_doc,         &
00204 !!$         'component', 0, 'transient', ib, 'intent', 0,  &
00205 !!$         'input', 0, 'minimal_period', 0,                    &
00206 !!$         'nbr_days', 0, sda_smioc_transi(ib)%sg_transi_in%sg_min_period%day)
00207 !!$
00208 !!$      id_error = &
00209 !!$         sasa_c_get_element_5th_level_i (id_XML_doc,         &
00210 !!$         'component', 0, 'transient', ib, 'intent', 0,  &
00211 !!$         'input', 0, 'minimal_period', 0,                    &
00212 !!$         'nbr_months', 0,sda_smioc_transi(ib)%sg_transi_in%sg_min_period%month)
00213 !!$
00214 !!$      id_error = &
00215 !!$         sasa_c_get_element_5th_level_i (id_XML_doc,         &
00216 !!$         'component', 0, 'transient', ib, 'intent', 0,  &
00217 !!$         'input', 0, 'minimal_period', 0,                    &
00218 !!$         'nbr_years', 0, sda_smioc_transi(ib)%sg_transi_in%sg_min_period%year)
00219 
00220 ! *** Get the exchange date format (is it the period format)
00221       id_error = &
00222          sasa_c_get_number_6th_level(id_XML_doc,             &
00223          'component', 0, 'transient', ib, 'intent', 0,  &
00224          'input', 0, 'exchange_date', 0, 'period',           &
00225          il_nb)
00226 
00227 ! **** Get the exchange date if it is the period format)
00228       IF (il_nb .eq. 1) THEN
00229 
00230           sda_smioc_transi(ib)%sg_transi_in%ig_exch_date_type = PSMILe_period
00231 
00232           id_error = &
00233              sasa_c_get_element_6th_level_d (id_XML_doc,         &
00234              'component', 0, 'transient', ib, 'intent', 0,  &
00235              'input', 0, 'exchange_date', 0, 'period', 0,        &
00236              'second', 0, dl_test)
00237           sda_smioc_transi(ib)%sg_transi_in%sg_exch_date%sg_period%second= &
00238              dl_test
00239           id_error = &
00240              sasa_c_get_element_6th_level_i (id_XML_doc,         &
00241              'component', 0, 'transient', ib, 'intent', 0,  &
00242              'input', 0, 'exchange_date', 0, 'period', 0,        &
00243              'minute', 0,                                        &
00244              sda_smioc_transi(ib)%sg_transi_in%sg_exch_date%sg_period%minute)
00245 
00246           id_error = &
00247              sasa_c_get_element_6th_level_i (id_XML_doc,         &
00248              'component', 0, 'transient', ib, 'intent', 0,  &
00249              'input', 0, 'exchange_date', 0, 'period', 0,        &
00250              'hour', 0,                                          &
00251              sda_smioc_transi(ib)%sg_transi_in%sg_exch_date%sg_period%hour)
00252 
00253           id_error = &
00254              sasa_c_get_element_6th_level_i (id_XML_doc,         &
00255              'component', 0, 'transient', ib, 'intent', 0,  &
00256              'input', 0, 'exchange_date', 0, 'period', 0,        &
00257              'day', 0,                                           &
00258              sda_smioc_transi(ib)%sg_transi_in%sg_exch_date%sg_period%day)
00259 
00260           id_error = &
00261              sasa_c_get_element_6th_level_i (id_XML_doc,         &
00262              'component', 0, 'transient', ib, 'intent', 0,  &
00263              'input', 0, 'exchange_date', 0, 'period', 0,        &
00264              'month', 0,                                         &
00265              sda_smioc_transi(ib)%sg_transi_in%sg_exch_date%sg_period%month)
00266 
00267           id_error = &
00268              sasa_c_get_element_6th_level_i (id_XML_doc,         &
00269              'component', 0, 'transient', ib, 'intent', 0,  &
00270              'input', 0, 'exchange_date', 0, 'period', 0,        &
00271              'year', 0,                                          &
00272              sda_smioc_transi(ib)%sg_transi_in%sg_exch_date%sg_period%year)
00273 
00274       END IF
00275 
00276 ! *** Get the exchange date format (is it the once format)
00277       id_error = &
00278          sasa_c_get_number_6th_level(id_XML_doc,             &
00279          'component', 0, 'transient', ib, 'intent', 0,  &
00280          'input', 0, 'exchange_date', 0, 'once',             & 
00281          il_nb)
00282 
00283 ! **** Get the exchange date if it is the precise format)
00284       IF (il_nb .eq. 1) THEN
00285 
00286           sda_smioc_transi(ib)%sg_transi_in%ig_exch_date_type = &
00287              PSMILe_once
00288 
00289           PRINT *, '******************************************************'
00290           PRINT *, 'The once format for exchange date is not yet supported'
00291           PRINT *, '******************************************************'
00292           CALL PSMILe_Flushstd
00293 
00294           CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00295 
00296       END IF
00297 
00298 ! *** Get the exchange date format (is it the precise_list format)
00299       id_error = &
00300          sasa_c_get_number_6th_level(id_XML_doc,             &
00301          'component', 0, 'transient', ib, 'intent', 0,  &
00302          'input', 0, 'exchange_date', 0, 'precise_list',     & 
00303          il_nb)
00304 
00305 ! **** Get the exchange date if it is the precise_list format)
00306       IF (il_nb .eq. 1) THEN
00307 
00308           sda_smioc_transi(ib)%sg_transi_in%ig_exch_date_type = &
00309              PSMILe_preciseday
00310 
00311           PRINT *, '**************************************************************'
00312           PRINT *, 'The precise_list format for exchange date is not yet supported'
00313           PRINT *, '**************************************************************'
00314           CALL PSMILe_Flushstd
00315 
00316           CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00317 
00318       END IF
00319 
00320 ! *** Get the exchange date format (is it the date_list format)
00321       id_error = &
00322          sasa_c_get_number_6th_level(id_XML_doc,             &
00323          'component', 0, 'transient', ib, 'intent', 0,  &
00324          'input', 0, 'exchange_date', 0, 'date_list',        & 
00325          il_nb)
00326 
00327 ! **** Get the exchange date if it is the date_list format)
00328       IF (il_nb .eq. 1) THEN
00329 
00330           sda_smioc_transi(ib)%sg_transi_in%ig_exch_date_type = &
00331              PSMILe_list
00332 
00333           PRINT *, '******************************************************'
00334           PRINT *, 'The date_list format for exchange date is not yet supported'
00335           PRINT *, '******************************************************'
00336           CALL PSMILe_Flushstd
00337 
00338           CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00339 
00340       END IF
00341 
00342 ! *** Get the exchange date format (is it the lastdayinmonth format)
00343       id_error = &
00344          sasa_c_get_number_6th_level(id_XML_doc,                &
00345          'component', 0, 'transient', ib, 'intent', 0,     &
00346          'input', 0, 'exchange_date', 0, 'lastdayinmonth',      &
00347          il_nb)
00348 
00349 ! **** Get the exchange date if it is the lastdayinmonth format)
00350       IF (il_nb .eq. 1) THEN
00351 
00352           sda_smioc_transi(ib)%sg_transi_in%ig_exch_date_type = &
00353              PSMILe_lastdayinmo
00354 
00355           PRINT *, '****************************************************************'
00356           PRINT *, 'The lastdayinmonth format for exchange date is not yet supported'
00357           PRINT *, '****************************************************************'
00358           CALL PSMILe_Flushstd
00359 
00360           CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00361 
00362       END IF
00363 
00364 ! *** Get the debug mode
00365       id_error = &
00366          sasa_c_get_element_4th_level_c (id_XML_doc,         &
00367          'component', 0, 'transient', ib, 'intent', 0,  &
00368          'input', 0, 'debug_mode', 0, cla_char, il_length)
00369       sda_smioc_transi(ib)%sg_transi_in%ig_debugmode = &
00370          sasa_c_convert_char2int(cla_char(1:il_length))
00371 
00372       ll_io = .FALSE.
00373 #ifdef __PSMILE_WITH_IO
00374       ll_io = .TRUE.
00375 #endif
00376       IF (sda_smioc_transi(ib)%sg_transi_in%ig_debugmode .EQ. PSMILe_true &
00377          .AND. .NOT. ll_io) THEN
00378           PRINT *, '***************************************************'
00379           PRINT *, 'The PSMILe is asked to perform I/O for debug mode'
00380           PRINT *, 'but it is compiled without __PSMILE_WITH_IO CPP key'
00381           PRINT *, 'Calling MPI_Abort'
00382           PRINT *, '***************************************************'
00383           CALL PSMILe_Flushstd
00384           
00385           CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00386       ENDIF
00387 ! *** Get the target time operation
00388       id_error = &
00389          sasa_c_get_element_5th_level_c (id_XML_doc,         &
00390          'component', 0, 'transient', ib, 'intent', 0,  &
00391          'input', 0, 'target_transformation', 0,             &
00392          'target_time_operation', 0, cla_char, il_length)
00393       sda_smioc_transi(ib)%sg_transi_in%ig_tgt_timeop = &
00394          sasa_c_convert_char2int(cla_char(1:il_length))
00395 
00396 ! *** Get the target local transformations informations
00397       id_error = &
00398          sasa_c_get_number_6th_level(id_XML_doc,                         &
00399          'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00400          'target_transformation', 0, 'target_local_transformation',      &
00401          il_nb)
00402 
00403       IF (il_nb .eq. 1) THEN
00404 
00405           id_error = &
00406              sasa_c_get_element_6th_level_i (id_XML_doc,                      &
00407              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,   &
00408              'target_transformation', 0, 'target_local_transformation', 0,    &
00409              'mult_scalar', 0, il_test)
00410           if ( il_test /= - 280177 ) then
00411               sda_smioc_transi(ib)%sg_transi_in%sg_tgt_local_trans% &
00412                  dg_mult_scalar=il_test
00413           endif
00414 
00415           id_error = &
00416              sasa_c_get_element_6th_level_i (id_XML_doc,                    &
00417              'component', 0, 'transient', ib, 'intent', 0, 'input', 0, &
00418              'target_transformation', 0, 'target_local_transformation', 0,  &
00419              'add_scalar', 0, il_test)
00420           if ( il_test /= - 280177 ) then
00421               sda_smioc_transi(ib)%sg_transi_in%sg_tgt_local_trans% &
00422                  dg_add_scalar = il_test
00423           endif
00424 
00425           id_error = &
00426              sasa_c_get_element_6th_level_c (id_XML_doc,                    &
00427              'component', 0, 'transient', ib, 'intent', 0, 'input', 0, &
00428              'target_transformation', 0, 'target_local_transformation', 0,  &
00429              'gathering', 0, cla_char, il_length)
00430           sda_smioc_transi(ib)%sg_transi_in%sg_tgt_local_trans%ig_gather = &
00431              sasa_c_convert_char2int(cla_char(1:il_length))
00432 
00433       END IF
00434 
00435 ! *** Set to one the integer that indicates if the stat is used or not
00436       sda_smioc_transi(ib)%sg_transi_in%iga_stats = 0
00437       id_error = &
00438          sasa_c_get_number_6th_level (id_XML_doc,                           &
00439          'component', 0, 'transient', ib, 'intent', 0, 'input', 0,     &
00440          'target_transformation', 0, 'statistics', il_nb)
00441 
00442       IF (il_nb .eq. 1) THEN
00443 
00444           id_error = &
00445              sasa_c_get_number_7th_level (id_XML_doc,                        &
00446              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00447              'target_transformation', 0, 'statistics', 0,                    &
00448              'masked_points', il_nb_bis)
00449 
00450           IF (il_nb_bis .eq. 1) THEN
00451               id_error = &
00452               sasa_c_get_element_6th_level_c (id_XML_doc,                    &
00453              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00454              'target_transformation', 0, 'statistics', 0,                    &
00455              'masked_points', 0, cla_char, il_length)
00456              sda_smioc_transi(ib)%sg_transi_in%iga_stats(1) = &
00457              sasa_c_convert_char2int(cla_char(1:il_length))
00458           END IF
00459 
00460           id_error = &
00461              sasa_c_get_number_7th_level (id_XML_doc,                        &
00462              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00463              'target_transformation', 0, 'statistics', 0,                    &
00464              'notmasked_points', il_nb_bis)
00465 
00466           IF (il_nb_bis .eq. 1) THEN
00467               id_error = &
00468               sasa_c_get_element_6th_level_c (id_XML_doc,                    &
00469              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00470              'target_transformation', 0, 'statistics', 0,                    &
00471              'notmasked_points', 0, cla_char, il_length)
00472              sda_smioc_transi(ib)%sg_transi_in%iga_stats(2) = &
00473              sasa_c_convert_char2int(cla_char(1:il_length))
00474           END IF
00475 
00476           id_error = &
00477              sasa_c_get_number_7th_level (id_XML_doc,                        &
00478              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00479              'target_transformation', 0, 'statistics', 0,                    &
00480              'all_points', il_nb_bis)
00481 
00482           IF (il_nb_bis .eq. 1) THEN
00483               id_error = &
00484               sasa_c_get_element_6th_level_c (id_XML_doc,                    &
00485              'component', 0, 'transient', ib, 'intent', 0, 'input', 0,  &
00486              'target_transformation', 0, 'statistics', 0,                    &
00487              'all_points', 0, cla_char, il_length)
00488              sda_smioc_transi(ib)%sg_transi_in%iga_stats(3) = &
00489              sasa_c_convert_char2int(cla_char(1:il_length))
00490           END IF
00491 
00492       END IF
00493 
00494 ! *** Get the number of origins
00495       id_error = &
00496          sasa_c_get_number_5th_level(id_XML_doc,             &
00497          'component', 0, 'transient', ib, 'intent', 0,  &
00498          'input', 0, 'origin',                               &
00499          sda_smioc_transi(ib)%sg_transi_in%ig_nb_in_orig)
00500 
00501 ! **** Get the origins' informations for each origin
00502       DO ib_bis = 1, sda_smioc_transi(ib)%sg_transi_in%ig_nb_in_orig
00503 
00504         id_error = &
00505            sasa_c_get_attri_5th_level (id_XML_doc,             &
00506            'component', 0, 'transient', ib, 'intent', 0,  &
00507            'input', 0, 'origin', ib_bis, 'transi_in_name',     &
00508            sda_smioc_transi(ib)%sg_transi_in%                  &
00509            sga_in_orig(ib_bis)%cg_transi_in_name, il_length)
00510 
00511         id_error = &
00512            sasa_c_get_element_5th_level_c (id_XML_doc,                  &
00513            'component', 0, 'transient', ib, 'intent', 0,           &
00514            'input', 0, 'origin', ib_bis, 'corresp_transi_out_name', 0,  &
00515            sda_smioc_transi(ib)%sg_transi_in%                           &
00516            sga_in_orig(ib_bis)%cg_orig_transi, il_length)
00517 
00518 ! ***** Check if the file is coming from a comp or a file
00519         id_error = &
00520            sasa_c_get_number_6th_level(id_XML_doc,                    &
00521            'component', 0, 'transient', ib, 'intent', 0    ,     &
00522            'input', 0, 'origin', ib_bis, 'component_name', il_nb_bis)
00523 
00524         id_error = &
00525            sasa_c_get_number_6th_level(id_XML_doc,              &
00526            'component', 0, 'transient', ib, 'intent', 0,   &
00527            'input', 0, 'origin', ib_bis, 'file', il_nb_ter)
00528 
00529         IF ((il_nb_bis .eq. 1) .and. (il_nb_ter .eq. 1)) THEN
00530 
00531             PRINT *, '**********************************************'
00532             PRINT *, 'The origin can not be a component and a file !'
00533             PRINT *, '**********************************************'
00534             CALL PSMILe_Flushstd
00535 
00536             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00537 
00538         ELSE IF (il_nb_bis .eq. 1) THEN
00539 
00540             sda_smioc_transi(ib)%sg_transi_in%             &
00541                sga_in_orig(ib_bis)%ig_orig_type = PSMILe_comp
00542 
00543             id_error = &
00544                sasa_c_get_element_5th_level_c (id_XML_doc,        &
00545                'component', 0, 'transient', ib, 'intent', 0, &
00546                'input', 0, 'origin', ib_bis, 'component_name', 0, &
00547                sda_smioc_transi(ib)%sg_transi_in%                 &
00548                sga_in_orig(ib_bis)%cg_orig_comp_name, il_length)
00549 
00550         ELSE IF (il_nb_ter .eq. 1) THEN
00551             ll_io = .false.
00552 #ifdef __PSMILE_WITH_IO
00553             ll_io = .TRUE.
00554 #endif
00555             IF (.NOT. ll_io) THEN
00556                 PRINT *, '***************************************************'
00557                 PRINT *, 'The PSMILe is asked to perform Input from file'
00558                 PRINT *, 'but it is compiled without __PSMILE_WITH_IO CPP key'
00559                 PRINT *, 'Calling MPI_Abort'
00560                 PRINT *, '***************************************************'
00561                 CALL PSMILe_Flushstd
00562 
00563                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00564             ENDIF
00565 
00566             sda_smioc_transi(ib)%sg_transi_in%             &
00567                sga_in_orig(ib_bis)%ig_orig_type = PSMILe_file
00568 
00569             il_length = 0
00570             id_error = &
00571                sasa_c_get_element_6th_level_c (id_XML_doc,         &
00572                'component', 0, 'transient', ib, 'intent', 0,  &
00573                'input', 0, 'origin', ib_bis, 'file', 0,            &
00574                'name', 0, sda_smioc_transi(ib)%sg_transi_in%       &
00575                sga_in_orig(ib_bis)%sg_orig_file%cg_file_name, il_length)  
00576             IF (il_length == 0) THEN
00577                 PRINT *, '*******************************************'
00578                 PRINT *, 'a name must be specified for each file     '
00579                 PRINT *, '*******************************************'
00580                 CALL PSMILe_Flushstd
00581                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00582             ENDIF
00583 
00584             il_length = 0
00585             id_error = &
00586                sasa_c_get_element_6th_level_c (id_XML_doc,         &
00587                'component', 0, 'transient', ib, 'intent', 0,  &
00588                'input', 0, 'origin', ib_bis, 'file', 0,            &
00589                'format', 0, cla_char, il_length)
00590             IF (il_length == 0) THEN
00591                 PRINT *, '*******************************************'
00592                 PRINT *, 'a format must be specified for each file     '
00593                 PRINT *, '*******************************************'
00594                 CALL PSMILe_Flushstd
00595                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00596             ENDIF
00597             sda_smioc_transi(ib)%sg_transi_in%                   &
00598                sga_in_orig(ib_bis)%sg_orig_file%ig_file_format = &
00599                sasa_c_convert_char2int(cla_char(1:il_length))          
00600 
00601             id_error = &
00602                sasa_c_get_element_6th_level_c (id_XML_doc,         &
00603                'component', 0, 'transient', ib, 'intent', 0,  &
00604                'input', 0, 'origin', ib_bis, 'file', 0,            &
00605                'suffix', 0, cla_char, il_length)
00606             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00607                sg_orig_file%ig_suffix = sasa_c_convert_char2int(cla_char(1:il_length))
00608             IF (sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00609                sg_orig_file%ig_suffix .eq. -280177)                         &
00610                sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%  &
00611                sg_orig_file%ig_suffix = 0
00612 
00613             il_length = 0
00614             id_error = &
00615                sasa_c_get_element_6th_level_c (id_XML_doc,         &
00616                'component', 0, 'transient', ib, 'intent', 0,  &
00617                'input', 0, 'origin', ib_bis, 'file', 0,            &
00618                'io_mode', 0, cla_char, il_length)
00619             IF (il_length == 0) THEN
00620 #ifdef VERBOSE
00621                 PRINT *, '************************************************************'
00622                 PRINT *, 'no io_mode for file; default value iosingle will be used    '
00623                 PRINT *, '************************************************************'
00624 #endif
00625                 sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00626                    sg_orig_file%ig_file_iomode = 3825
00627             ELSE
00628                 sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00629                    sg_orig_file%ig_file_iomode = &
00630                    sasa_c_convert_char2int(cla_char(1:il_length))
00631             ENDIF
00632             id_error = &
00633                sasa_c_get_element_6th_level_i (id_XML_doc,         &
00634                'component', 0, 'transient', ib, 'intent', 0,  &
00635                'input', 0, 'origin', ib_bis, 'file', 0,            &
00636                'packing', 0,                                    &
00637                sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00638                sg_orig_file%ig_file_pack)  
00639 
00640             id_error = &
00641                sasa_c_get_element_6th_level_d (id_XML_doc,         &
00642                'component', 0, 'transient', ib, 'intent', 0,       &
00643                'input', 0, 'origin', ib_bis, 'file', 0,            &
00644                'scaling', 0, sda_smioc_transi(ib)%sg_transi_in%    &
00645                sga_in_orig(ib_bis)%sg_orig_file%dg_file_scal)
00646 
00647             id_error = &
00648                sasa_c_get_element_6th_level_d (id_XML_doc,         &
00649                'component', 0, 'transient', ib, 'intent', 0,       &
00650                'input', 0, 'origin', ib_bis, 'file', 0,            &
00651                'adding', 0, sda_smioc_transi(ib)%sg_transi_in%     &
00652                sga_in_orig(ib_bis)%sg_orig_file%dg_file_add)
00653 
00654             id_error = &
00655                sasa_c_get_element_6th_level_d (id_XML_doc,         &
00656                'component', 0, 'transient', ib, 'intent', 0,       &
00657                'input', 0, 'origin', ib_bis, 'file', 0,            &
00658                'fill_value', 0, dl_test)
00659 
00660             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00661                sg_orig_file%dg_fill_val = dl_test 
00662 
00663         ELSE
00664 
00665             PRINT *, '******************************************'
00666             PRINT *, 'The origin must be a component or a file !'
00667             PRINT *, '******************************************'
00668             CALL PSMILe_Flushstd
00669 
00670             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00671 
00672         END IF
00673 
00674 !!$! ***** Get the coupling restart file informations
00675 !!$
00676 !!$        id_error = &
00677 !!$           sasa_c_get_number_6th_level(id_XML_doc,                      &
00678 !!$           'component', 0, 'transient', ib, 'intent', 0,           &
00679 !!$           'input', 0, 'origin', ib_bis, 'cpl_rst_file', il_nb)
00680 !!$
00681 !!$        IF (il_nb .EQ. 1) THEN
00682 !!$
00683 !!$            il_length = 0
00684 !!$            id_error = &
00685 !!$               sasa_c_get_element_7th_level_c (id_XML_doc,              &
00686 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00687 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00688 !!$               'file', 0,                                               &
00689 !!$               'name', 0, sda_smioc_transi(ib)%sg_transi_in%            &
00690 !!$               sga_in_orig(ib_bis)%sg_cpl_rst_file%cg_file_name, il_length)  
00691 !!$            IF (il_length == 0) THEN
00692 !!$                PRINT *, '*******************************************'
00693 !!$                PRINT *, 'a name must be specified for each file     '
00694 !!$                PRINT *, '*******************************************'
00695 !!$                CALL PSMILe_Flushstd
00696 !!$                CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00697 !!$            ENDIF
00698 !!$
00699 !!$            il_length = 0
00700 !!$            id_error = &
00701 !!$               sasa_c_get_element_7th_level_c (id_XML_doc,              &
00702 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00703 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00704 !!$               'file', 0,                                               &
00705 !!$               'format', 0, cla_char, il_length)
00706 !!$            IF (il_length == 0) THEN
00707 !!$                PRINT *, '*******************************************'
00708 !!$                PRINT *, 'a format must be specified for each file     '
00709 !!$                PRINT *, '*******************************************'
00710 !!$                CALL PSMILe_Flushstd
00711 !!$                CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00712 !!$            ENDIF
00713 !!$
00714 !!$            sda_smioc_transi(ib)%sg_transi_in%                          &
00715 !!$               sga_in_orig(ib_bis)%sg_cpl_rst_file%ig_file_format =     &
00716 !!$               sasa_c_convert_char2int(cla_char(1:il_length))          
00717 !!$
00718 !!$            id_error = &
00719 !!$               sasa_c_get_element_7th_level_c (id_XML_doc,              &
00720 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00721 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00722 !!$               'file', 0,                                               &
00723 !!$               'suffix', 0, cla_char, il_length)
00724 !!$            sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%      &
00725 !!$               sg_cpl_rst_file%ig_suffix = sasa_c_convert_char2int(cla_char(1:il_length))
00726 !!$            IF (sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%  &
00727 !!$               sg_cpl_rst_file%ig_suffix .eq. -280177)                  &
00728 !!$               sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%   &
00729 !!$               sg_cpl_rst_file%ig_suffix  = 0
00730 !!$
00731 !!$            il_length = 0
00732 !!$            id_error = &
00733 !!$               sasa_c_get_element_7th_level_c (id_XML_doc,              &
00734 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00735 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00736 !!$               'file', 0,                                               &
00737 !!$               'io_mode', 0, cla_char, il_length)
00738 !!$            IF (il_length == 0) THEN
00739 !!$#ifdef VERBOSE
00740 !!$                PRINT *, '************************************************************'
00741 !!$                PRINT *, 'no io_mode for file; default value iosingle will be used    '
00742 !!$                PRINT *, '************************************************************'
00743 !!$#endif
00744 !!$                sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00745 !!$                   sg_orig_file%ig_file_iomode = 3825
00746 !!$            ELSE
00747 !!$                sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00748 !!$                   sg_cpl_rst_file%ig_file_iomode = &
00749 !!$                   sasa_c_convert_char2int(cla_char(1:il_length))
00750 !!$            ENDIF
00751 !!$
00752 !!$            id_error = &
00753 !!$               sasa_c_get_element_7th_level_c (id_XML_doc,              &
00754 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00755 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00756 !!$               'file', 0,                                               &
00757 !!$               'packing', 0,                                            &
00758 !!$               sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%   &
00759 !!$               sg_cpl_rst_file%ig_file_pack)  
00760 !!$
00761 !!$            id_error = &
00762 !!$               sasa_c_get_element_7th_level_i (id_XML_doc,              &
00763 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00764 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00765 !!$               'file', 0,                                               &
00766 !!$               'scaling', 0, il_test)
00767 !!$            sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%      &
00768 !!$               sg_cpl_rst_file%dg_file_scal = il_test
00769 !!$
00770 !!$            id_error = &
00771 !!$               sasa_c_get_element_7th_level_i (id_XML_doc,              &
00772 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00773 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00774 !!$               'file', 0,                                               &
00775 !!$               'adding', 0, il_test)
00776 !!$            sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%      &
00777 !!$               sg_cpl_rst_file%dg_file_add = il_test
00778 !!$
00779 !!$            id_error = &
00780 !!$               sasa_c_get_element_7th_level_i (id_XML_doc,              &
00781 !!$               'component', 0, 'transient', ib, 'intent', 0,       &
00782 !!$               'input', 0, 'origin', ib_bis, 'cpl_rst_file', 0,         &
00783 !!$               'file', 0,                                               &
00784 !!$               'fill_value', 0, il_test)
00785 !!$            sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%      &
00786 !!$               sg_cpl_rst_file%dg_fill_val = il_test
00787 !!$        ENDIF
00788 
00789 ! ***** Get the conservation type, if there is conservation
00790         id_error = &
00791            sasa_c_get_number_7th_level(id_XML_doc,                    &
00792            'component', 0, 'transient', ib, 'intent', 0,         &
00793            'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00794            'conservation', il_nb_bis)
00795 
00796         IF (il_nb_bis .EQ. 1) THEN
00797             id_error = &
00798                sasa_c_get_element_6th_level_c (id_XML_doc,                  &
00799                'component', 0, 'transient', ib, 'intent', 0,           &
00800                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,    &
00801                'conservation', 0, cla_char, il_length)
00802             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%ig_conserv = &
00803                sasa_c_convert_char2int(cla_char(1:il_length))
00804         ENDIF
00805 
00806 ! *****Gget the algebraic combination informations, if there is algebraic combination
00807         id_error = &
00808            sasa_c_get_number_7th_level(id_XML_doc,                    &
00809            'component', 0, 'transient', ib, 'intent', 0,         &
00810            'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00811            'algebraic_combination', il_nb_bis)
00812 
00813         IF (il_nb_bis .eq. 1) THEN
00814 
00815             id_error = &
00816                sasa_c_get_element_7th_level_c (id_XML_doc,                &
00817                'component', 0, 'transient', ib, 'intent', 0,         &
00818                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00819                'algebraic_combination', 0,                                &
00820                'name', 0, sda_smioc_transi(ib)%sg_transi_in%              &
00821                sga_in_orig(ib_bis)%sg_combi%cg_combi_name, il_length)          
00822 
00823             id_error = &
00824                sasa_c_get_element_7th_level_i (id_XML_doc,                &
00825                'component', 0, 'transient', ib, 'intent', 0,         &
00826                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00827                'algebraic_combination', 0,                                &
00828                'comb_parameter', 0, il_test)
00829             sda_smioc_transi(ib)%sg_transi_in%             &
00830                sga_in_orig(ib_bis)%sg_combi%dg_combi_param = il_test
00831 
00832             id_error = &
00833                sasa_c_get_element_7th_level_c (id_XML_doc,                &
00834                'component', 0, 'transient', ib, 'intent', 0,         &
00835                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00836                'algebraic_combination', 0,                                &
00837                'comb_method', 0,  cla_char, il_length)
00838             sda_smioc_transi(ib)%sg_transi_in%                &
00839                sga_in_orig(ib_bis)%sg_combi%ig_combi_meth =   &
00840                sasa_c_convert_char2int(cla_char(1:il_length))
00841 
00842             id_error = &
00843                sasa_c_get_element_7th_level_c (id_XML_doc,                &
00844                'component', 0, 'transient', ib, 'intent', 0,         &
00845                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00846                'algebraic_combination', 0,                                &
00847                'operand', 0,  cla_char, il_length)
00848             sda_smioc_transi(ib)%sg_transi_in%                &
00849                sga_in_orig(ib_bis)%sg_combi%ig_operand =      &
00850                sasa_c_convert_char2int(cla_char(1:il_length))
00851 
00852             id_error = &
00853                sasa_c_get_element_7th_level_i (id_XML_doc,                &
00854                'component', 0, 'transient', ib, 'intent', 0,         &
00855                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00856                'algebraic_combination', 0,                                &
00857                'scalar', 0, il_test)
00858             sda_smioc_transi(ib)%sg_transi_in%             &
00859                sga_in_orig(ib_bis)%sg_combi%dg_scalar = il_test
00860 
00861 ! ****** Check if the mask is external or source_variable_mask or none
00862 !        Set first to none
00863             sda_smioc_transi(ib)%sg_transi_in%             &
00864                sga_in_orig(ib_bis)%sg_combi%ig_mask_type = -280177
00865 
00866             id_error = &
00867                sasa_c_get_number_8th_level(id_XML_doc,                    &
00868                'component', 0, 'transient', ib, 'intent', 0,         &
00869                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00870                'algebraic_combination', 0, 'source_variable_mask', il_nb_ter)
00871 
00872             id_error = &
00873                sasa_c_get_number_8th_level(id_XML_doc,                    &
00874                'component', 0, 'transient', ib, 'intent', 0,         &
00875                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
00876                'algebraic_combination', 0, 'external_mask', il_nb_qua)
00877 
00878             IF ((il_nb_ter .eq. 1) .and. (il_nb_qua .eq. 1)) THEN
00879 
00880                 PRINT *, '**********************************************************'
00881                 PRINT *, 'The mask can not be external_mask and source_variable_mask'
00882                 PRINT *, '**********************************************************'
00883                 CALL PSMILe_Flushstd
00884 
00885                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00886 
00887 
00888             ELSE IF (il_nb_ter .eq. 1) THEN
00889 
00890                 sda_smioc_transi(ib)%sg_transi_in%             &
00891                    sga_in_orig(ib_bis)%sg_combi%ig_mask_type = 3610
00892 
00893 
00894             ELSE IF (il_nb_qua .eq. 1) THEN
00895 
00896                 sda_smioc_transi(ib)%sg_transi_in%             &
00897                    sga_in_orig(ib_bis)%sg_combi%ig_mask_type = 3611
00898 
00899                 id_error = &
00900                    sasa_c_get_element_8th_level_c (id_XML_doc,      &
00901                    'component', 0, 'transient', ib, 'intent', 0,    &
00902                    'input', 0, 'origin', ib_bis,                    &
00903                    'middle_transformation', 0,                      &
00904                    'algebraic_combination', 0, 'external_mask', 0,  &
00905                    'name', 0, sda_smioc_transi(ib)%sg_transi_in%    &
00906                    sga_in_orig(ib_bis)%sg_combi%cg_ext_mask_name, il_length)
00907 
00908 ! ******* Get the external mask file informations
00909                 il_length = 0
00910                 id_error = &
00911                    sasa_c_get_element_8th_level_c (id_XML_doc,      &
00912                    'component', 0, 'transient', ib, 'intent', 0,    &
00913                    'input', 0, 'origin', ib_bis,                    &
00914                    'middle_transformation', 0,                      &
00915                    'algebraic_combination', 0, 'external_mask', 0,  &
00916                    'file', 0,                                       &
00917                    'name', 0, sda_smioc_transi(ib)%sg_transi_in%    &
00918                    sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%cg_file_name,&
00919                    il_length)
00920                 IF (il_length == 0) THEN
00921                     PRINT *, '*******************************************'
00922                     PRINT *, 'a name must be specified for each file     '
00923                     PRINT *, '*******************************************'
00924                     CALL PSMILe_Flushstd
00925                     CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00926                 ENDIF
00927 
00928                 il_length = 0
00929                 id_error = &
00930                    sasa_c_get_element_9th_level_c (id_XML_doc,      &
00931                    'component', 0, 'transient', ib, 'intent', 0,    &
00932                    'input', 0, 'origin', ib_bis,                    &
00933                    'middle_transformation', 0,                      &
00934                    'algebraic_combination', 0, 'external_mask', 0,  &
00935                    'file', 0,                                       &
00936                    'format', 0, cla_char, il_length)
00937                 IF (il_length == 0) THEN
00938                     PRINT *, '*******************************************'
00939                     PRINT *, 'a format must be specified for each file     '
00940                     PRINT *, '*******************************************'
00941                     CALL PSMILe_Flushstd
00942                     CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00943                 ENDIF
00944                 sda_smioc_transi(ib)%sg_transi_in%       &
00945                    sga_in_orig(ib_bis)%sg_combi%         &
00946                    sg_ext_mask_file%ig_file_format =     &
00947                    sasa_c_convert_char2int(cla_char(1:il_length))          
00948 
00949                 id_error = &
00950                    sasa_c_get_element_9th_level_c (id_XML_doc,      &
00951                    'component', 0, 'transient', ib, 'intent', 0,    &
00952                    'input', 0, 'origin', ib_bis,                    &
00953                    'middle_transformation', 0,                      &
00954                    'algebraic_combination', 0, 'external_mask', 0,  &
00955                    'file', 0,                                       &
00956                    'suffix', 0, cla_char, il_length)
00957                 sda_smioc_transi(ib)%sg_transi_in%                         &
00958                    sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%          &
00959                    ig_suffix = sasa_c_convert_char2int(cla_char(1:il_length))
00960                 IF (sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
00961                    sg_combi%sg_ext_mask_file%ig_suffix .eq. -280177)            &
00962                    sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%  &
00963                    sg_combi%sg_ext_mask_file%ig_suffix = 0
00964 
00965                 il_length = 0
00966                 id_error = &
00967                    sasa_c_get_element_9th_level_c (id_XML_doc,      &
00968                    'component', 0, 'transient', ib, 'intent', 0,    &
00969                    'input', 0, 'origin', ib_bis,                    &
00970                    'middle_transformation', 0,                      &
00971                    'algebraic_combination', 0, 'external_mask', 0,  &
00972                    'file', 0,                                       &
00973                    'io_mode', 0, cla_char, il_length)
00974                 IF (il_length == 0) THEN
00975 #ifdef VERBOSE
00976                     PRINT *, '************************************************************'
00977                     PRINT *, 'no io_mode for file; default value iosingle will be used    '
00978                     PRINT *, '************************************************************'
00979 #endif
00980                     sda_smioc_transi(ib)%sg_transi_in%                         &
00981                        sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%          &
00982                        ig_file_iomode = 3825
00983                 ELSE
00984                     sda_smioc_transi(ib)%sg_transi_in%                         &
00985                        sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%          &
00986                        ig_file_iomode = &
00987                        sasa_c_convert_char2int(cla_char(1:il_length))
00988                 ENDIF
00989 
00990                 id_error = &
00991                    sasa_c_get_element_9th_level_i (id_XML_doc,      &
00992                    'component', 0, 'transient', ib, 'intent', 0,    &
00993                    'input', 0, 'origin', ib_bis,                    &
00994                    'middle_transformation', 0,                      &
00995                    'algebraic_combination', 0, 'external_mask', 0,  &
00996                    'file', 0,                                       &
00997                    'packing', 0, sda_smioc_transi(ib)%sg_transi_in% &
00998                    sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%   &
00999                    ig_file_pack)  
01000 
01001                 id_error = &
01002                    sasa_c_get_element_9th_level_d (id_XML_doc,      &
01003                    'component', 0, 'transient', ib, 'intent', 0,    &
01004                    'input', 0, 'origin', ib_bis,                    &
01005                    'middle_transformation', 0,                      &
01006                    'algebraic_combination', 0, 'external_mask', 0,  &
01007                    'file', 0,                                       &
01008                    'scaling', 0, sda_smioc_transi(ib)%sg_transi_in% &
01009                    sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%   &
01010                    dg_file_scal) 
01011 
01012                 id_error = &
01013                    sasa_c_get_element_9th_level_d (id_XML_doc,      &
01014                    'component', 0, 'transient', ib, 'intent', 0,    &
01015                    'input', 0, 'origin', ib_bis,                    &
01016                    'middle_transformation', 0,                      &
01017                    'algebraic_combination', 0, 'external_mask', 0,  &
01018                    'file', 0,                                       &
01019                    'adding', 0, sda_smioc_transi(ib)%sg_transi_in%  &
01020                    sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%   &
01021                    dg_file_add)
01022 
01023                 id_error = &
01024                    sasa_c_get_element_9th_level_d (id_XML_doc,      &
01025                    'component', 0, 'transient', ib, 'intent', 0,    &
01026                    'input', 0, 'origin', ib_bis,                    &
01027                    'middle_transformation', 0,                      &
01028                    'algebraic_combination', 0, 'external_mask', 0,  &
01029                    'file', 0,                                       &
01030                    'fill_value', 0, sda_smioc_transi(ib)%sg_transi_in% &
01031                    sga_in_orig(ib_bis)%sg_combi%sg_ext_mask_file%   &
01032                    dg_fill_val)
01033 
01034             END IF
01035 
01036         END IF
01037 
01038 ! ***** Check if the transient_in took part of an interpolation
01039         id_error = &
01040            sasa_c_get_number_7th_level(id_XML_doc,                    &
01041            'component', 0, 'transient', ib, 'intent', 0,         &
01042            'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
01043            'interpolation', il_nb_bis)
01044 
01045         IF (il_nb_bis .eq. 1) THEN
01046 ! ****** Check if the interpolation is 3d
01047             id_error = &
01048                sasa_c_get_number_8th_level(id_XML_doc,                    &
01049                'component', 0, 'transient', ib, 'intent', 0,         &
01050                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
01051                'interpolation', 0, 'interp3D', il_nb_ter)
01052 
01053 ! ****** Check if the interpolation is 2d1d
01054             id_error = &
01055                sasa_c_get_number_8th_level(id_XML_doc,                    &
01056                'component', 0, 'transient', ib, 'intent', 0,         &
01057                'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
01058                'interpolation', 0, 'interp2D', il_nb_terbis)
01059 
01060 !!$! ****** Check if the interpolation is 1d1d1d
01061 !!$            id_error = &
01062 !!$               sasa_c_get_number_8th_level(id_XML_doc,                    &
01063 !!$               'component', 0, 'transient', ib, 'intent', 0,         &
01064 !!$               'input', 0, 'origin', ib_bis, 'middle_transformation', 0,  &
01065 !!$               'interpolation', 0, 'interp1D_i', il_nb_terter)
01066 !!$
01067 !!$! Check that the interpolation is 3D or 2D1D or 1D1D1D 
01068 !!$            IF (il_nb_ter + il_nb_terbis + il_nb_terter .GT. 1) THEN
01069 
01070 ! ******* Check that the interpolation is 3D or 2D1D 
01071             IF (il_nb_ter + il_nb_terbis .GT. 1) THEN
01072                 PRINT *, '********************************************'
01073                 PRINT *, 'Interpolation must be 3D or 2D1D !'
01074                 PRINT *, '********************************************'
01075                 CALL PSMILe_Flushstd
01076 
01077                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01078 
01079             END IF
01080 
01081 ! ****** If the interpolation is 3D
01082             IF (il_nb_ter .eq. 1) THEN
01083 
01084                 sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01085                    sg_interp%ig_interp_type = PSMILe_3D
01086 
01087 ! ****** Check if the interpolation is nneighbour3d
01088                 id_error = &
01089                    sasa_c_get_number_9th_level(id_XML_doc,                   &
01090                    'component', 0, 'transient', ib, 'intent', 0,        &
01091                    'input', 0, 'origin', ib_bis, 'middle_transformation', 0, &
01092                    'interpolation', 0, 'interp3D', 0, 'nneighbour3D',        &
01093                    il_nb_qua)
01094 
01095 ! ****** Check if the interpolation is trilinear
01096                 id_error = &
01097                    sasa_c_get_number_9th_level(id_XML_doc,                   &
01098                    'component', 0, 'transient', ib, 'intent', 0,        &
01099                    'input', 0, 'origin', ib_bis, 'middle_transformation', 0, &
01100                    'interpolation', 0, 'interp3D', 0, 'trilinear', il_nb_cin)
01101 
01102 ! ****** Check if the interpolation is conservative 3D
01103                 id_error = &
01104                    sasa_c_get_number_9th_level(id_XML_doc,                   &
01105                    'component', 0, 'transient', ib, 'intent', 0,        &
01106                    'input', 0, 'origin', ib_bis, 'middle_transformation', 0, &
01107                    'interpolation', 0, 'interp3D', 0, 'conservativ3D', il_nb_six)
01108 
01109 ! ****** Check if the interpolation is user defined 3D
01110                 id_error = &
01111                    sasa_c_get_number_9th_level(id_XML_doc,                   &
01112                    'component', 0, 'transient', ib, 'intent', 0,        &
01113                    'input', 0, 'origin', ib_bis, 'middle_transformation', 0, &
01114                    'interpolation', 0, 'interp3D', 0, 'user3D', il_nb_hep)
01115 
01116 ! ****** Check that there is only one 3D interpolation method
01117 
01118                 IF (il_nb_qua + il_nb_cin + il_nb_six + il_nb_hep .gt. 1) THEN
01119 
01120                     PRINT *, '*************************************************'
01121                     PRINT *, 'Only one 3D interpolation method can be chosen ! '
01122                     PRINT *, '*************************************************'
01123                     CALL PSMILe_Flushstd
01124 
01125                     CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01126 
01127                 END IF
01128 
01129 ! ******* if the interpolation is nneighbour3d get the informations
01130                 IF (il_nb_qua .EQ. 1) THEN
01131 
01132                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01133                        sg_interp%iga_interp_meth(1) = PSMILe_nnghbr3D
01134                     il_length = 0
01135                     id_error = &
01136                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01137                        'component', 0, 'transient', ib, 'intent', 0,    &
01138                        'input', 0, 'origin', ib_bis,                    &
01139                        'middle_transformation', 0, 'interpolation', 0,  &
01140                        'interp3D', 0, 'nneighbour3D', 0,                &
01141                        'para_search', 0, cla_char, il_length)
01142                     IF (il_length == 0) THEN
01143 #ifdef VERBOSE
01144                         PRINT *, '*******************************************'
01145                         PRINT *, 'Type of search for nneighbour3D  missing '
01146                         PRINT *, 'Default value PSMILe_global will be used   '
01147                         PRINT *, '*******************************************'
01148 #endif
01149                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01150                            sg_interp%iga_arg3(1)=PSMILe_global
01151                     ELSE
01152                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01153                            sg_interp%iga_arg3(1)= &
01154                            sasa_c_convert_char2int(cla_char(1:il_length))
01155                     ENDIF
01156                     id_error = &
01157                        sasa_c_get_number_10th_level(id_XML_doc,      &
01158                        'component', 0, 'transient', ib, 'intent', 0,    &
01159                        'input', 0, 'origin', ib_bis,                    &
01160                        'middle_transformation', 0, 'interpolation', 0,  &
01161                        'interp3D', 0, 'nneighbour3D', 0,                &
01162                        'nbr_neighbours', il_nb)
01163                     IF (il_nb == 0) THEN
01164                         PRINT *, '*******************************************'
01165                         PRINT *, 'nbr_neighbours must be specified' 
01166                         PRINT *, 'for nneighbour3D interpolation'
01167                         PRINT *, '*******************************************'
01168                         CALL PSMILe_Flushstd
01169                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01170                     ENDIF
01171                     id_error = &
01172                        sasa_c_get_element_9th_level_i (id_XML_doc,      &
01173                        'component', 0, 'transient', ib, 'intent', 0,    &
01174                        'input', 0, 'origin', ib_bis,                    &
01175                        'middle_transformation', 0, 'interpolation', 0,  &
01176                        'interp3D', 0, 'nneighbour3D', 0,                &
01177                        'nbr_neighbours', 0,                             &
01178                        sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01179                        sg_interp%iga_arg2(1))
01180                     dl_test = PSMILe_dundef
01181                     id_error = &
01182                        sasa_c_get_element_9th_level_d (id_XML_doc,      &
01183                        'component', 0, 'transient', ib, 'intent', 0,    &
01184                        'input', 0, 'origin', ib_bis,                    &
01185                        'middle_transformation', 0, 'interpolation', 0,  &
01186                        'interp3D', 0, 'nneighbour3D', 0,                &
01187                        'gaussian_variance', 0, dl_test)
01188                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01189                        sg_interp%dg_arg8 = dl_test
01190                     il_length = 0
01191                     id_error = &
01192                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01193                        'component', 0, 'transient', ib, 'intent', 0,    &
01194                        'input', 0, 'origin', ib_bis,                    &
01195                        'middle_transformation', 0, 'interpolation', 0,  &
01196                        'interp3D', 0, 'nneighbour3D', 0,                &
01197                        'if_masked', 0,                                  &
01198                        cla_char, il_length)
01199 !!$                    IF (il_length == 0) THEN
01200 !!$                        PRINT *, '********************************************'
01201 !!$                        PRINT *, 'if_masked must be specified'
01202 !!$                        PRINT *, 'for nneighbour3D interpolation'
01203 !!$                        PRINT *, '********************************************'
01204 !!$                        CALL PSMILe_Flushstd
01205 !!$
01206 !!$                        CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01207 !!$                    ENDIF
01208                     IF (il_length /= 0) THEN
01209                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01210                            sg_interp%iga_arg4(1)= &
01211                            sasa_c_convert_char2int(cla_char(1:il_length))
01212                         IF (sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01213                            sg_interp%iga_arg4(1) /= PSMILE_novalue) THEN
01214                             PRINT *, '********************************************'
01215                             PRINT *, 'Only novalue is implemented for if_masked'
01216                             PRINT *, 'for nneighbour3D interpolation'
01217                             PRINT *, '********************************************'
01218                             CALL PSMILe_Flushstd
01219                             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01220                         END IF
01221                     ENDIF
01222                 ENDIF
01223 ! ******* if the interpolation is trilinear get the informations
01224                 IF (il_nb_cin .eq. 1) THEN
01225 
01226                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01227                        sg_interp%iga_interp_meth(1) = PSMILe_trilinear
01228                     il_length = 0
01229                     id_error = &
01230                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01231                        'component', 0, 'transient', ib, 'intent', 0,    &
01232                        'input', 0, 'origin', ib_bis,                    &
01233                        'middle_transformation', 0, 'interpolation', 0,  &
01234                        'interp3D', 0, 'trilinear', 0,                   &
01235                        'para_search', 0,                                &
01236                        cla_char, il_length)
01237                     IF (il_length == 0) THEN
01238 #ifdef VERBOSE
01239                         PRINT *, '*******************************************'
01240                         PRINT *, 'Type of search for trilinear missing '
01241                         PRINT *, 'Default value PSMILe_global will be used   '
01242                         PRINT *, '*******************************************'
01243 #endif
01244                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01245                            sg_interp%iga_arg3(1)=PSMILe_global
01246                     ELSE
01247                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01248                            sg_interp%iga_arg3(1)= &
01249                            sasa_c_convert_char2int(cla_char(1:il_length))
01250                     ENDIF
01251 !rr
01252                     il_length = 0
01253                     id_error = &
01254                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01255                        'component', 0, 'transient', ib, 'intent', 0,    &
01256                        'input', 0, 'origin', ib_bis,                    &
01257                        'middle_transformation', 0, 'interpolation', 0,  &
01258                        'interp3D', 0, 'trilinear', 0,                   &
01259                        'if_masked', 0,                                  &
01260                        cla_char, il_length)
01261                     IF (il_length == 0) THEN
01262                         PRINT *, '********************************************'
01263                         PRINT *, 'if_masked must be specified'
01264                         PRINT *, 'for trilinear interpolation'
01265                         PRINT *, '********************************************'
01266                         CALL PSMILe_Flushstd
01267 
01268                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01269                     ENDIF
01270                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01271                        sg_interp%iga_arg4(1)= &
01272                        sasa_c_convert_char2int(cla_char(1:il_length))
01273 
01274                 END IF
01275 
01276 ! ******* if the interpolation is conserv3D get the informations
01277                 IF (il_nb_six .eq. 1) THEN
01278 
01279                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01280                        sg_interp%iga_interp_meth(1) = PSMILe_conserv3D
01281 
01282                     PRINT *, '******************************************************'
01283                     PRINT *, 'The 3D conservative interpolation is not yet supported'
01284                     PRINT *, '******************************************************'
01285                     CALL PSMILe_Flushstd
01286 
01287                             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01288 
01289                 END IF
01290 
01291 ! ******* if the interpolation is user3D get the informations
01292                 IF (il_nb_hep .eq. 1) THEN
01293 
01294                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01295                        sg_interp%iga_interp_meth(1) = PSMILe_user3D
01296 !* 
01297 ! ************** check that the name of the file is given or abort
01298 !*
01299                    il_length = 0
01300                    id_error = &
01301                       sasa_c_get_element_10th_level_c (id_XML_doc,        &
01302                       'component', 0, 'transient', ib, 'intent', 0,  &
01303                       'input', 0, 'origin', ib_bis,                       &
01304                       'middle_transformation', 0, 'interpolation', 0,     &
01305                       'interp3D', 0, 'user3D', 0,                         &
01306                       'file', 0,                                          &
01307                       'name', 0, sda_smioc_transi(ib)%sg_transi_in%       &
01308                       sga_in_orig(ib_bis)%sg_interp%sg_arg10%cg_file_name,&
01309                       il_length)
01310                    IF (il_length == 0) THEN
01311                        PRINT *, '*********************************************'
01312                        PRINT *, 'user3D interpolation needs a file for'
01313                        PRINT *, 'the definition of the weights and addresses'
01314                        PRINT *, '*********************************************'
01315                        CALL PSMILe_Flushstd
01316                        CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01317                    ENDIF
01318                     
01319                    il_length = 0
01320                    id_error = &
01321                        sasa_c_get_element_10th_level_c (id_XML_doc,            &
01322                        'component', 0, 'transient', ib, 'intent', 0,      &
01323                        'input', 0, 'origin', ib_bis,                           &
01324                        'middle_transformation', 0, 'interpolation', 0,         &
01325                        'interp3D', 0, 'user3D', 0,                             &
01326                        'file', 0,                                              &
01327                        'format', 0, cla_char, il_length)
01328                    IF (il_length == 0) THEN
01329                        PRINT *, '*******************************************'
01330                        PRINT *, 'a format must be specified for each file     '
01331                        PRINT *, '*******************************************'
01332                        CALL PSMILe_Flushstd
01333                        CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01334                    ENDIF
01335                     sda_smioc_transi(ib)%sg_transi_in%                         &
01336                        sga_in_orig(ib_bis)%sg_interp%sg_arg10%ig_file_format = &
01337                        sasa_c_convert_char2int(cla_char(1:il_length))
01338 
01339                     id_error = &
01340                        sasa_c_get_element_10th_level_c (id_XML_doc,            &
01341                        'component', 0, 'transient', ib, 'intent', 0,      &
01342                        'input', 0, 'origin', ib_bis,                           &
01343                        'middle_transformation', 0, 'interpolation', 0,         &
01344                        'interp3D', 0, 'user3D', 0,                             &
01345                        'file', 0,                                              &
01346                        'suffix', 0, cla_char, il_length)
01347                     sda_smioc_transi(ib)%sg_transi_in%                         &
01348                        sga_in_orig(ib_bis)%sg_interp%sg_arg10%          &
01349                        ig_suffix = sasa_c_convert_char2int(cla_char(1:il_length))
01350                     IF (sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01351                        sg_interp%sg_arg10%ig_suffix .eq. -280177)            &
01352                        sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%  &
01353                        sg_interp%sg_arg10%ig_suffix = 0
01354 
01355                     il_length = 0
01356                     id_error = &
01357                        sasa_c_get_element_10th_level_c (id_XML_doc,            &
01358                        'component', 0, 'transient', ib, 'intent', 0,      &
01359                        'input', 0, 'origin', ib_bis,                           &
01360                        'middle_transformation', 0, 'interpolation', 0,         &
01361                        'interp3D', 0, 'user3D', 0,                             &
01362                        'file', 0,                                              &
01363                        'io_mode', 0, cla_char, il_length)
01364                     IF (il_length == 0) THEN
01365 #ifdef VERBOSE
01366                         PRINT *, '************************************************************'
01367                         PRINT *, 'no io_mode for file; default value iosingle will be used    '
01368                         PRINT *, '************************************************************'
01369 #endif
01370                         sda_smioc_transi(ib)%sg_transi_in%                     &
01371                            sga_in_orig(ib_bis)%sg_interp%sg_arg10%             &
01372                            ig_file_iomode = 3825
01373                     ELSE
01374                         sda_smioc_transi(ib)%sg_transi_in%                     &
01375                            sga_in_orig(ib_bis)%sg_interp%sg_arg10%             &
01376                            ig_file_iomode =                                    &
01377                            sasa_c_convert_char2int(cla_char(1:il_length))
01378                     ENDIF
01379 
01380                     id_error = &
01381                        sasa_c_get_element_10th_level_i (id_XML_doc,            &
01382                        'component', 0, 'transient', ib, 'intent', 0,      &
01383                        'input', 0, 'origin', ib_bis,                           &
01384                        'middle_transformation', 0, 'interpolation', 0,         &
01385                        'interp3D', 0, 'user3D', 0,                             &
01386                        'file', 0,                                              &
01387                        'packing', 0, sda_smioc_transi(ib)%sg_transi_in%        &
01388                        sga_in_orig(ib_bis)%sg_interp%sg_arg10%                 &
01389                        ig_file_pack)
01390 
01391               id_error = &
01392                   sasa_c_get_element_10th_level_d (id_XML_doc,            &
01393                   'component', 0, 'transient', ib, 'intent', 0,      &
01394                   'input', 0, 'origin', ib_bis,                           &
01395                   'middle_transformation', 0, 'interpolation', 0,         &
01396                   'interp3D', 0, 'user3D', 0,                             &
01397                   'file', 0,                                              &
01398                   'scaling', 0, sda_smioc_transi(ib)%sg_transi_in%        &
01399                   sga_in_orig(ib_bis)%sg_interp%sg_arg10%dg_file_scal)
01400 
01401 
01402               id_error = &
01403                   sasa_c_get_element_10th_level_d (id_XML_doc,            &
01404                   'component', 0, 'transient', ib, 'intent', 0,      &
01405                   'input', 0, 'origin', ib_bis,                           &
01406                   'middle_transformation', 0, 'interpolation', 0,         &
01407                   'interp3D', 0, 'user3D', 0,                             &
01408                   'file', 0,                                              &
01409                   'adding', 0, sda_smioc_transi(ib)%sg_transi_in%         &
01410                   sga_in_orig(ib_bis)%sg_interp%sg_arg10%dg_file_add)
01411 
01412               id_error = &
01413                   sasa_c_get_element_10th_level_d (id_XML_doc,            &
01414                   'component', 0, 'transient', ib, 'intent', 0,      &
01415                   'input', 0, 'origin', ib_bis,                           &
01416                   'middle_transformation', 0, 'interpolation', 0,         &
01417                   'interp3D', 0, 'user3D', 0,                             &
01418                   'file', 0,                                              &
01419                   'fill_value', 0, sda_smioc_transi(ib)%sg_transi_in%     &
01420                   sga_in_orig(ib_bis)%sg_interp%sg_arg10%dg_fill_val)
01421 
01422 !  gather info on User-defined interpolation during first pass
01423                     IF ( ld_userdef_details ) THEN
01424 !  flag true for this origin
01425                        sga_comp_udef_idx(id_comp)%sla_driver_udef(ib)%    &
01426                                         lga_trin_orig(ib_bis) = .true.
01427 !  flag true for this XML transient 
01428                        sga_comp_udef_idx(id_comp)%sla_driver_udef(ib)%    &
01429                                         lg_trans_ud = .true.
01430 !  store name of transient for gridless grid name generation
01431                        sga_comp_udef_idx(id_comp)%sla_driver_udef(ib)%    &
01432                        cg_local_name = sda_smioc_transi(ib)%cg_local_name
01433                     ENDIF
01434 
01435                 END IF           !! il_nb_hep == 1
01436    
01437             END IF         !! 3D interpolations
01438 
01439 ! ****** If the interpolation is 2D
01440             IF (il_nb_terbis .EQ. 1) THEN
01441 
01442                 sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01443                    sg_interp%ig_interp_type = PSMILe_2D1D
01444 
01445 ! ****** Check if the 2D interpolation is nneighbour2d
01446                 id_error = &
01447                    sasa_c_get_number_9th_level(id_XML_doc,                &
01448                    'component', 0, 'transient', ib, 'intent', 0,     &
01449                    'input', 0, 'origin', ib_bis, 'middle_transformation', &
01450                    0, 'interpolation', 0, 'interp2D', 0, 'nneighbour2D',  &
01451                    il_nb_qua)
01452 
01453 ! ****** Check if the 2D interpolation is bilinear
01454                 id_error = &
01455                    sasa_c_get_number_9th_level(id_XML_doc,          &
01456                    'component', 0, 'transient', ib, 'intent', 0,    &
01457                    'input', 0, 'origin', ib_bis,                    &
01458                    'middle_transformation', 0, 'interpolation', 0,  &
01459                    'interp2D', 0, 'bilinear', il_nb_cin)
01460 
01461 ! ****** Check if the 2D interpolation is bicubic
01462                 id_error = &
01463                    sasa_c_get_number_9th_level(id_XML_doc,          &
01464                    'component', 0, 'transient', ib, 'intent', 0,    &
01465                    'input', 0, 'origin', ib_bis,                    &
01466                    'middle_transformation', 0, 'interpolation', 0,  &
01467                    'interp2D', 0, 'bicubic', il_nb_six)
01468 
01469 ! ****** Check if the 2D interpolation is conservative
01470                 id_error = &
01471                    sasa_c_get_number_9th_level(id_XML_doc,          &
01472                    'component', 0, 'transient', ib, 'intent', 0,    &
01473                    'input', 0, 'origin', ib_bis,                    &
01474                    'middle_transformation', 0, 'interpolation', 0,  &
01475                    'interp2D', 0, 'conservativ2D', il_nb_hep)
01476 
01477 ! ****** Check if the 2D interpolation is user defined
01478                 id_error = &
01479                    sasa_c_get_number_9th_level(id_XML_doc,          &
01480                    'component', 0, 'transient', ib, 'intent', 0,    &
01481                    'input', 0, 'origin', ib_bis,                    &
01482                    'middle_transformation', 0, 'interpolation', 0,  &
01483                    'interp2D', 0, 'user2D', il_nb_oct)
01484 
01485 ! ****** Check that there is only one 2D interpolation method
01486 
01487                 IF (il_nb_qua + il_nb_cin + il_nb_six + il_nb_hep + il_nb_oct .gt. 1) THEN
01488 
01489                     PRINT *, '*************************************************'
01490                     PRINT *, 'Only one 2D interpolation method can be chosen ! '
01491                     PRINT *, '*************************************************'
01492                     CALL PSMILe_Flushstd
01493 
01494                     CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01495 
01496                 END IF
01497 
01498 ! ******* if the interpolation is nneighbour2d get the informations
01499                 IF (il_nb_qua .eq. 1) THEN
01500 
01501                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01502                        sg_interp%iga_interp_meth(1) = PSMILe_nnghbr2D
01503                     il_length = 0
01504                     id_error = &
01505                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01506                        'component', 0, 'transient', ib, 'intent', 0,    &
01507                        'input', 0, 'origin', ib_bis,                    &
01508                        'middle_transformation', 0, 'interpolation', 0,  &
01509                        'interp2D', 0, 'nneighbour2D', 0, 'para_search', &
01510                        0, cla_char, il_length)
01511                     IF (il_length == 0) THEN
01512 #ifdef VERBOSE
01513                         PRINT *, '*******************************************'
01514                         PRINT *, 'Type of search for nneighbour2D missing '
01515                         PRINT *, 'Default value PSMILe_global will be used   '
01516                         PRINT *, '*******************************************'
01517 #endif
01518                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01519                            sg_interp%iga_arg3(1)=PSMILe_global
01520                     ELSE
01521                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01522                            sg_interp%iga_arg3(1)= &
01523                            sasa_c_convert_char2int(cla_char(1:il_length))
01524                     ENDIF
01525 
01526                     id_error = &
01527                        sasa_c_get_number_10th_level(id_XML_doc,      &
01528                        'component', 0, 'transient', ib, 'intent', 0,    &
01529                        'input', 0, 'origin', ib_bis,                    &
01530                        'middle_transformation', 0, 'interpolation', 0,  &
01531                        'interp2D', 0, 'nneighbour2D', 0,                &
01532                        'nbr_neighbours', il_nb)
01533                     IF (il_nb == 0) THEN
01534                         PRINT *, '*******************************************'
01535                         PRINT *, 'nbr_neighbours must be specified' 
01536                         PRINT *, 'for nneighbour2D interpolation'
01537                         PRINT *, '*******************************************'
01538                         CALL PSMILe_Flushstd
01539                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01540                     ENDIF
01541                     id_error = &
01542                        sasa_c_get_element_9th_level_i (id_XML_doc,      &
01543                        'component', 0, 'transient', ib, 'intent', 0,    &
01544                        'input', 0, 'origin', ib_bis,                    &
01545                        'middle_transformation', 0, 'interpolation', 0,  &
01546                        'interp2D', 0, 'nneighbour2D', 0,                &
01547                        'nbr_neighbours', 0,                             &
01548                        sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01549                        sg_interp%iga_arg2(1))
01550                     dl_test = PSMILe_dundef
01551                     id_error = &
01552                        sasa_c_get_element_9th_level_d (id_XML_doc,      &
01553                        'component', 0, 'transient', ib, 'intent', 0,    &
01554                        'input', 0, 'origin', ib_bis,                    &
01555                        'middle_transformation', 0, 'interpolation', 0,  &
01556                        'interp2D', 0, 'nneighbour2D', 0,                &
01557                        'gaussian_variance', 0, dl_test)
01558                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01559                        sg_interp%dg_arg8 = dl_test
01560 
01561                     il_length = 0
01562                     id_error = &
01563                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01564                        'component', 0, 'transient', ib, 'intent', 0,    &
01565                        'input', 0, 'origin', ib_bis,                    &
01566                        'middle_transformation', 0, 'interpolation', 0,  &
01567                        'interp2D', 0,                                   &
01568                        'nneighbour2D', 0, 'if_masked', 0,              &
01569                        cla_char, il_length)
01570 !!$                    IF (il_length == 0) THEN
01571 !!$                        PRINT *, '********************************************'
01572 !!$                        PRINT *, 'if_masked must be specified'
01573 !!$                        PRINT *, 'for nneighbour2D interpolation'
01574 !!$                        PRINT *, '********************************************'
01575 !!$                        CALL PSMILe_Flushstd
01576 !!$
01577 !!$                        CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01578 !!$                    ENDIF
01579                     IF (il_length /= 0) THEN
01580                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01581                            sg_interp%iga_arg4(1)= &
01582                            sasa_c_convert_char2int(cla_char(1:il_length))
01583                         if (sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01584                            sg_interp%iga_arg4(1)/= PSMILE_novalue) THEN
01585                             PRINT *, '********************************************'
01586                             PRINT *, 'Only novalue is implemented for if_masked'
01587                             PRINT *, 'for nneighbour2D interpolation'
01588                             PRINT *, '********************************************'
01589                             CALL PSMILe_Flushstd
01590                             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01591                         END IF
01592                     ENDIF
01593 
01594                 END IF
01595 
01596 ! ******* if the interpolation is bilinear get the informations
01597                 IF (il_nb_cin .eq. 1) THEN
01598 
01599                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01600                        sg_interp%iga_interp_meth(1) = PSMILe_bilinear
01601                     il_length = 0
01602                     id_error = &
01603                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01604                        'component', 0, 'transient', ib, 'intent', 0,    &
01605                        'input', 0, 'origin', ib_bis,                    &
01606                        'middle_transformation', 0, 'interpolation', 0,  &
01607                        'interp2D', 0, 'bilinear', 0,                    &
01608                        'para_search', 0, cla_char, il_length)
01609                     IF (il_length == 0) THEN
01610 #ifdef VERBOSE
01611                         PRINT *, '*******************************************'
01612                         PRINT *, 'Type of search for bilinear missing '
01613                         PRINT *, 'Default value PSMILe_global will be used   '
01614                         PRINT *, '*******************************************'
01615 #endif
01616                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01617                            sg_interp%iga_arg3(1)=PSMILe_global
01618                     ELSE
01619                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01620                            sg_interp%iga_arg3(1)= &
01621                            sasa_c_convert_char2int(cla_char(1:il_length))
01622                     ENDIF
01623 !rr
01624                     il_length = 0
01625                     id_error = &
01626                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01627                        'component', 0, 'transient', ib, 'intent', 0,    &
01628                        'input', 0, 'origin', ib_bis,                    &
01629                        'middle_transformation', 0, 'interpolation', 0,  &
01630                        'interp2D', 0, 'bilinear', 0,                    &
01631                        'if_masked', 0,                                  &
01632                        cla_char, il_length)
01633                     IF (il_length == 0) THEN
01634                         PRINT *, '********************************************'
01635                         PRINT *, 'if_masked must be specified'
01636                         PRINT *, 'for bilinear interpolation'
01637                         PRINT *, '********************************************'
01638                         CALL PSMILe_Flushstd
01639 
01640                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01641                     ENDIF                    
01642                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01643                        sg_interp%iga_arg4(1)= &
01644                        sasa_c_convert_char2int(cla_char(1:il_length))
01645                 END IF
01646 
01647 ! ******* if the interpolation is bicubic get the informations
01648                 IF (il_nb_six .eq. 1) THEN
01649 
01650                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01651                        sg_interp%iga_interp_meth(1) = PSMILe_bicubic
01652                     il_length = 0
01653                     id_error = &
01654                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01655                        'component', 0, 'transient', ib, 'intent', 0,    &
01656                        'input', 0, 'origin', ib_bis,                    &
01657                        'middle_transformation', 0, 'interpolation', 0,  &
01658                        'interp2D', 0, 'bicubic', 0,                     &
01659                        'para_search', 0, cla_char, il_length)
01660                     IF (il_length == 0) THEN
01661 #ifdef VERBOSE
01662                         PRINT *, '*******************************************'
01663                         PRINT *, 'Type of search for bicubic missing '
01664                         PRINT *, 'Default value PSMILe_global will be used   '
01665                         PRINT *, '*******************************************'
01666 #endif
01667                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01668                            sg_interp%iga_arg3(1)=PSMILe_global
01669                     ELSE
01670                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01671                            sg_interp%iga_arg3(1)= &
01672                            sasa_c_convert_char2int(cla_char(1:il_length))
01673                     ENDIF
01674 
01675                     il_length = 0
01676                     id_error = &
01677                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01678                        'component', 0, 'transient', ib, 'intent', 0,    &
01679                        'input', 0, 'origin', ib_bis,                    &
01680                        'middle_transformation', 0, 'interpolation', 0,  &
01681                        'interp2D', 0, 'bicubic', 0,                     &
01682                        'if_masked', 0,                                  &
01683                        cla_char, il_length)
01684                     IF (il_length == 0) THEN
01685                         PRINT *, '********************************************'
01686                         PRINT *, 'if_masked must be specified'
01687                         PRINT *, 'for bicubic interpolation'
01688                         PRINT *, '********************************************'
01689                         CALL PSMILe_Flushstd
01690 
01691                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01692                     ENDIF
01693                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01694                        sg_interp%iga_arg4(1)= &
01695                        sasa_c_convert_char2int(cla_char(1:il_length))
01696 
01697                     il_length = 0
01698                     id_error = &
01699                        sasa_c_get_element_9th_level_c (id_XML_doc,      &
01700                        'component', 0, 'transient', ib, 'intent', 0,    &
01701                        'input', 0, 'origin', ib_bis,                    &
01702                        'middle_transformation', 0, 'interpolation', 0,  &
01703                        'interp2D', 0, 'bicubic', 0,                     &
01704                        'bicubic_method', 0,                             &
01705                        cla_char, il_length)
01706 
01707                     IF (il_length == 0) THEN
01708                         PRINT *, '********************************************'
01709                         PRINT *, 'bicubic_method must be specified'
01710                         PRINT *, 'for bicubic interpolation'
01711                         PRINT *, '********************************************'
01712                         CALL PSMILe_Flushstd
01713                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01714                     ENDIF
01715 
01716                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01717                        sg_interp%iga_arg5(1)= &
01718                        sasa_c_convert_char2int(cla_char(1:il_length))
01719 
01720                 END IF
01721 
01722 ! ******* if the interpolation is conservative get the informations
01723 
01724                 IF (il_nb_hep .EQ. 1) THEN
01725                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01726                        sg_interp%iga_interp_meth(1) = PSMILe_conserv2D
01727 
01728             ! Get order of conservativ2D
01729                     id_error = &
01730                        sasa_c_get_number_10th_level(id_XML_doc,         &
01731                        'component', 0, 'transient', ib, 'intent', 0,    &
01732                        'input', 0, 'origin', ib_bis,                    &
01733                        'middle_transformation', 0, 'interpolation', 0,  &
01734                        'interp2D', 0, 'conservativ2D', 0, 'order', il_nb)
01735                     IF (il_nb == 0) THEN
01736 #ifdef VERBOSE
01737                         PRINT *, '*************************************'
01738                         PRINT *, 'Order for conservative 2D is missing '
01739                         PRINT *, 'First order will be used by default '
01740                         PRINT *, '*************************************'
01741 #endif
01742                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01743                            sg_interp%iga_arg2(1)= PSMILe_first
01744                     ELSE
01745                         id_error = &
01746                            sasa_c_get_element_9th_level_c (id_XML_doc,      &
01747                            'component', 0, 'transient', ib, 'intent', 0,    &
01748                            'input', 0, 'origin', ib_bis,                    &
01749                            'middle_transformation', 0, 'interpolation', 0,  &
01750                            'interp2D', 0, 'conservativ2D', 0, 'order',      &
01751                            0, cla_char, il_length)
01752                         id_error = sasa_c_convert_char2int(cla_char(1:il_length))
01753                         IF (id_error == 1) THEN
01754                             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01755                                sg_interp%iga_arg2(1)= PSMILe_first
01756                         ELSE IF (id_error == 2) THEN
01757                             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01758                                sg_interp%iga_arg2(1)= PSMILe_second
01759                             PRINT *, '**********************************************'
01760                             PRINT *, '2nd order of conservative 2D not supported yet'
01761                             PRINT *, '**********************************************'
01762                             CALL PSMILe_Flushstd
01763                             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01764                         ELSE
01765                             PRINT *, '*****************************************'
01766                             PRINT *, 'Order of conservative 2D is not known'
01767                             PRINT *, '*****************************************'
01768                             CALL PSMILe_Flushstd
01769                             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)                  
01770                         ENDIF
01771                     ENDIF
01772                     !
01773             ! Get type of parallel search
01774                     il_nb = 0
01775                     id_error = &
01776                        sasa_c_get_number_10th_level(id_XML_doc,         &
01777                        'component',0, 'transient',ib, 'intent', 0, &
01778                        'input', 0, 'origin', ib_bis,                    &
01779                        'middle_transformation', 0, 'interpolation', 0,  &
01780                        'interp2D', 0, 'conservativ2D', 0, 'para_search', il_nb)
01781                     IF (il_nb == 0) THEN
01782 #ifdef VERBOSE
01783                         PRINT *, '*******************************************'
01784                         PRINT *, 'Type of search for conservative 2D missing '
01785                         PRINT *, 'Default value PSMILe_global will be used   '
01786                         PRINT *, '*******************************************'
01787 #endif
01788                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01789                            sg_interp%iga_arg3(1)= PSMILe_global
01790                     ELSE
01791                         id_error = &
01792                            sasa_c_get_element_9th_level_c (id_XML_doc,      &
01793                            'component',0, 'transient',ib, 'intent', 0, &
01794                            'input', 0, 'origin', ib_bis,                    &
01795                            'middle_transformation', 0, 'interpolation', 0,  &
01796                            'interp2D', 0, 'conservativ2D', 0, 'para_search',&
01797                            0, cla_char, il_length)
01798                         id_error = sasa_c_convert_char2int(cla_char(1:il_length))
01799                         IF (id_error == PSMILe_global) THEN
01800                             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01801                                sg_interp%iga_arg3(1)= PSMILe_global
01802                         ELSE IF (id_error == PSMILe_local) THEN
01803                             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01804                                sg_interp%iga_arg3(1)= PSMILe_local
01805                         ELSE
01806                             PRINT *, '***********************************************'
01807                             PRINT *, 'Type of search for conservative 2D is not known'
01808                             PRINT *, '***********************************************'
01809                             CALL PSMILe_Flushstd
01810                             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error) 
01811                         ENDIF
01812                         !
01813 
01814                     ENDIF
01815                     !
01816             ! Get normalisation option of conservativ2D
01817                     id_error = &
01818                        sasa_c_get_number_10th_level(id_XML_doc,         &
01819                        'component', 0, 'transient', ib, 'intent', 0,    &
01820                        'input', 0, 'origin', ib_bis,                    &
01821                        'middle_transformation', 0, 'interpolation', 0,  &
01822                        'interp2D', 0, 'conservativ2D', 0, 'normalisation2D', il_nb)
01823                     IF (il_nb == 0) THEN
01824                         PRINT *, '********************************************'
01825                         PRINT *, 'No normalisation options for conservative 2D '
01826                         PRINT *, 'By default, no normalisation will be applied '
01827                         PRINT *, '********************************************'
01828                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01829                                    sg_interp%iga_arg4(1) = PSMILe_none
01830                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01831                                    sg_interp%iga_arg5(1) = PSMILe_false
01832                 ELSE
01833                         id_error = &
01834                            sasa_c_get_number_11th_level(id_XML_doc,              &
01835                            'component', 0, 'transient', ib, 'intent', 0,    &
01836                            'input', 0, 'origin', ib_bis,                         &
01837                            'middle_transformation', 0, 'interpolation', 0,       &
01838                            'interp2D', 0, 'conservativ2D', 0, 'normalisation2D', &
01839                            0, 'methodnorm2D', il_nb_bisbis)
01840                         IF (il_nb_bisbis == 0) THEN
01841                             PRINT *, '************************************'
01842                             PRINT *, 'No methodnorm2D for conservative 2D '
01843                             PRINT *, 'Default values will be used: '
01844                             PRINT *, '=> no normalisation'
01845                             PRINT *, '************************************'
01846                             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01847                                sg_interp%iga_arg4(1) = PSMILe_none
01848                         ELSE
01849                             id_error = &
01850                                sasa_c_get_element_10th_level_c (id_XML_doc,         &
01851                                'component', 0, 'transient', ib, 'intent', 0,   &
01852                                'input', 0, 'origin', ib_bis,                        &
01853                                'middle_transformation', 0, 'interpolation', 0,      &
01854                                'interp2D', 0, 'conservativ2D', 0, 'normalisation2D',&
01855                                0, 'methodnorm2D', 0, cla_char, il_length)
01856                             id_error = sasa_c_convert_char2int(cla_char(1:il_length))
01857                             IF (id_error == PSMILe_fracarea .OR. id_error == PSMILe_destarea &
01858                                .OR. id_error == PSMILe_none) THEN
01859                                 sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01860                                    sg_interp%iga_arg4(1) = id_error
01861                             ELSE
01862                                 PRINT *, '*****************************************************'
01863                                 PRINT *, 'Normalisation method for conservative 2D is not known'
01864                                 PRINT *, '*****************************************************'
01865                                 CALL PSMILe_Flushstd
01866                                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01867                             ENDIF
01868                         ENDIF
01869                         id_error = &
01870                            sasa_c_get_number_11th_level(id_XML_doc,              &
01871                            'component', 0, 'transient', ib, 'intent', 0,    &
01872                            'input', 0, 'origin', ib_bis,                         &
01873                            'middle_transformation', 0, 'interpolation', 0,       &
01874                            'interp2D', 0, 'conservativ2D', 0, 'normalisation2D', &
01875                            0, 'nearnei', il_nb_bisbis)
01876                         IF (il_nb_bisbis == 0) THEN
01877                             PRINT *, '************************************'
01878                             PRINT *, 'No nearnei for conservative 2D '
01879                             PRINT *, 'Default values will be used: '
01880                             PRINT *, '=> nearnei = false' 
01881                             PRINT *, '************************************'
01882                             sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01883                                sg_interp%iga_arg5(1) = PSMILe_false                           
01884                         ELSE
01885                             id_error = &
01886                                sasa_c_get_element_10th_level_c (id_XML_doc,         &
01887                                'component', 0, 'transient', ib, 'intent', 0,   &
01888                                'input', 0, 'origin', ib_bis,                        &
01889                                'middle_transformation', 0, 'interpolation', 0,      &
01890                                'interp2D', 0, 'conservativ2D', 0, 'normalisation2D',&
01891                                0, 'nearnei', 0, cla_char, il_length)
01892                             id_error = sasa_c_convert_char2int(cla_char(1:il_length))
01893                             IF (id_error == PSMILe_true) THEN
01894                                 PRINT *, '**********************************************'
01895                                 PRINT *, 'nearnei = true not supported yet'
01896                                 PRINT *, '**********************************************'
01897                                 CALL PSMILe_Flushstd
01898                                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01899                             ELSE IF (id_error == PSMILE_false) THEN
01900                                 sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01901                                    sg_interp%iga_arg5(1) = id_error
01902                             ELSE
01903                                 PRINT *, '**********************************************'
01904                                 PRINT *, 'Nearnei value for conservative 2D is not known'
01905                                 PRINT *, '**********************************************'
01906                                 CALL PSMILe_Flushstd
01907                                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01908                             ENDIF
01909                         ENDIF
01910                     END IF
01911                 ENDIF
01912 
01913 ! ******* if the interpolation is user defined get the informations
01914                 IF (il_nb_oct .eq. 1) THEN
01915 
01916                     sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)% &
01917                        sg_interp%iga_interp_meth(1) = PSMILe_user2D
01918 
01919                     PRINT *, '**********************************************'
01920                     PRINT *, 'The user 2D interpolation is not yet supported'
01921                     PRINT *, '**********************************************'
01922                     CALL PSMILe_Flushstd
01923 
01924                     CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01925 
01926                 END IF
01927 
01928 ! ****** Check if the 1D interpolation is defined
01929                 id_error = &
01930                    sasa_c_get_number_8th_level(id_XML_doc,         &
01931                    'component', 0, 'transient', ib, 'intent', 0,   &
01932                    'input', 0, 'origin', ib_bis,                   &
01933                    'middle_transformation', 0,                     &
01934                    'interpolation', 0, 'interp1D', il_nb_qua)
01935 
01936                 IF (il_nb_qua .NE. 1) THEN
01937 
01938                     PRINT *, '**********************************************'
01939                     PRINT *, 'One 1D interpolation must be defined for 2D1D '
01940                     PRINT *, '**********************************************'
01941                     CALL PSMILe_Flushstd
01942 
01943             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01944 
01945                 ELSE
01946 
01947                     il_nb_qua = 0
01948 
01949 ! ****** Check if the 1D interpolation is none
01950                     id_error = &
01951                        sasa_c_get_number_9th_level(id_XML_doc,         &
01952                        'component', 0, 'transient', ib, 'intent', 0,   &
01953                        'input', 0, 'origin', ib_bis,                   &
01954                        'middle_transformation', 0,                     &
01955                        'interpolation', 0, 'interp1D', 0,              &
01956                        'none', il_nb_qua)
01957 
01958                     IF (il_nb_qua == 1) THEN
01959 
01960                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%&
01961                            sg_interp%iga_interp_meth(2) = PSMILe_none
01962                     ENDIF
01963 
01964 ! ****** Check if the 1D interpolation is linear
01965                     id_error = &
01966                        sasa_c_get_number_9th_level(id_XML_doc,         &
01967                        'component', 0, 'transient', ib, 'intent', 0,   &
01968                        'input', 0, 'origin', ib_bis,                   &
01969                        'middle_transformation', 0,                     &
01970                        'interpolation', 0, 'interp1D', 0,              &
01971                        'linear', il_nb_cin)
01972 
01973                     IF (il_nb_cin == 1) THEN
01974 
01975                         sda_smioc_transi(ib)%sg_transi_in%sga_in_orig(ib_bis)%&
01976                            sg_interp%iga_interp_meth(2) = PSMILe_linear
01977                     ENDIF
01978                     IF (il_nb_qua == 0 .AND. il_nb_cin == 0) THEN
01979                         PRINT *, '**************************************************'
01980                         PRINT *, '1D interpolation none or linear must be specified '
01981                         PRINT *, '**************************************************'
01982                         CALL PSMILe_Flushstd
01983 
01984                         CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
01985 
01986                     END IF
01987 
01988                 END IF
01989                 
01990             END IF
01991 
01992 !!$! ****** If the interpolation is 1D
01993 !!$            IF (il_nb_terter .gt. 1) THEN
01994 !!$
01995 !!$                PRINT *, '********************************************'
01996 !!$                PRINT *, '1D1D1D interpolation not supported for now !'
01997 !!$                PRINT *, '********************************************'
01998 !!$                CALL PSMILe_Flushstd
01999 !!$
02000 !!$                CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02001 !!$
02002 !!$            END IF
02003 
02004         END IF
02005 
02006       END DO
02007 
02008 
02009 ! ** Get the number of transient out
02010       id_error = &
02011          sasa_c_get_number_4th_level(id_XML_doc,             &
02012          'component', 0, 'transient', ib, 'intent', 0,  &
02013          'output', sda_smioc_transi(ib)%ig_nb_transi_out)
02014 
02015 ! *** Set the transient out informations for all the transient out
02016       DO ib_bis = 1, sda_smioc_transi(ib)%ig_nb_transi_out
02017 
02018         id_error = &
02019            sasa_c_get_attri_4th_level (id_XML_doc,                         &
02020            'component', 0, 'transient', ib, 'intent', 0,              &
02021            'output', ib_bis, 'transi_out_name',                            &
02022            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%cg_transi_out_name, &
02023            il_length)
02024 
02025         id_error = &
02026            sasa_c_get_element_4th_level_c (id_XML_doc,                 &
02027            'component', 0, 'transient', ib, 'intent', 0,          &
02028            'output', ib_bis, 'corresp_transi_in_name', 0,              &
02029            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%cg_dest_transi, &
02030            il_length)
02031 
02032 ! **** Get the shortest period of exchange
02033         id_error = &
02034            sasa_c_get_element_5th_level_i (id_XML_doc,          &
02035            'component', 0, 'transient', ib, 'intent', 0,   &
02036            'output', ib_bis, 'minimal_period', 0,               &
02037            'nbr_secs', 0, il_test)
02038         sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_min_period%second= &
02039            il_test
02040 
02041         id_error = &
02042            sasa_c_get_element_5th_level_i (id_XML_doc,          &
02043            'component', 0, 'transient', ib, 'intent', 0,   &
02044            'output', ib_bis, 'minimal_period', 0,               &
02045            'nbr_mins', 0,                                       &
02046            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_min_period%minute)
02047 
02048         id_error = &
02049            sasa_c_get_element_5th_level_i (id_XML_doc,          &
02050            'component', 0, 'transient', ib, 'intent', 0,   &
02051            'output', ib_bis, 'minimal_period', 0,               &
02052            'nbr_hours', 0,                                      &
02053            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_min_period%hour)
02054 
02055         id_error = &
02056            sasa_c_get_element_5th_level_i (id_XML_doc,          &
02057            'component', 0, 'transient', ib, 'intent', 0,   &
02058            'output', ib_bis, 'minimal_period', 0,               &
02059            'nbr_days', 0,                                       &
02060            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_min_period%day)
02061 
02062         id_error = &
02063            sasa_c_get_element_5th_level_i (id_XML_doc,          &
02064            'component', 0, 'transient', ib, 'intent', 0,   &
02065            'output', ib_bis, 'minimal_period', 0,               &
02066            'nbr_months', 0,                                     &
02067            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_min_period%month)
02068 
02069         id_error = & 
02070            sasa_c_get_element_5th_level_i (id_XML_doc,          &
02071            'component', 0, 'transient', ib, 'intent', 0,   &
02072            'output', ib_bis, 'minimal_period', 0,               &
02073            'nbr_years', 0,                                      &
02074            sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_min_period%year)
02075 
02076 ! *** Get the exchange date format (is it the period format)
02077         id_error = &
02078            sasa_c_get_number_6th_level(id_XML_doc,                              &
02079            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02080            'exchange_date', 0, 'period', il_nb)
02081 
02082 ! **** Get the exchange date if it is the period format)
02083         IF (il_nb .eq. 1) THEN
02084 
02085             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_exch_date_type = &
02086                PSMILe_period
02087 
02088             id_error = &
02089                sasa_c_get_element_6th_level_d (id_XML_doc,        &
02090                'component', 0, 'transient', ib, 'intent', 0, &
02091                'output', ib_bis, 'exchange_date', 0, 'period', 0, &
02092                'second', 0, dl_test)
02093             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_exch_date% &
02094                sg_period%second = dl_test
02095 
02096             id_error = &
02097                sasa_c_get_element_6th_level_i (id_XML_doc,        &
02098                'component', 0, 'transient', ib, 'intent', 0, &
02099                'output', ib_bis, 'exchange_date', 0, 'period', 0, &
02100                'minute', 0,                                       &
02101                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%       &
02102                sg_exch_date%sg_period%minute)
02103 
02104             id_error = &
02105                sasa_c_get_element_6th_level_i (id_XML_doc,        &
02106                'component', 0, 'transient', ib, 'intent', 0, &
02107                'output', ib_bis, 'exchange_date', 0, 'period', 0, &
02108                'hour', 0,                                         &
02109                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%       &
02110                sg_exch_date%sg_period%hour)
02111 
02112             id_error = &
02113                sasa_c_get_element_6th_level_i (id_XML_doc,        &
02114                'component', 0, 'transient', ib, 'intent', 0, &
02115                'output', ib_bis, 'exchange_date', 0, 'period', 0, &
02116                'day', 0,                                          &
02117                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%       &
02118                sg_exch_date%sg_period%day)
02119 
02120             id_error = &
02121                sasa_c_get_element_6th_level_i (id_XML_doc,        &
02122                'component', 0, 'transient', ib, 'intent', 0, &
02123                'output', ib_bis, 'exchange_date', 0, 'period', 0, &
02124                'month', 0,                                        &
02125                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%       &
02126                sg_exch_date%sg_period%month)
02127 
02128             id_error = &
02129                sasa_c_get_element_6th_level_i (id_XML_doc,        &
02130                'component', 0, 'transient', ib, 'intent', 0, &
02131                'output', ib_bis, 'exchange_date', 0, 'period', 0, &
02132                'year', 0,                                         &
02133                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%       &
02134                sg_exch_date%sg_period%year)
02135 
02136         END IF
02137 
02138 ! *** Get the exchange date format (is it the once format)
02139         id_error = &
02140            sasa_c_get_number_6th_level(id_XML_doc,                               &
02141            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis,  &
02142            'exchange_date', 0, 'once', il_nb)
02143 
02144 ! **** Get the exchange date if it is the once format
02145         IF (il_nb .eq. 1) THEN
02146 
02147             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_exch_date_type = &
02148                PSMILe_once
02149 
02150             PRINT *, '******************************************************'
02151             PRINT *, 'The once format for exchange date is not yet supported'
02152             PRINT *, '******************************************************'
02153             CALL PSMILe_Flushstd
02154 
02155             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02156 
02157         END IF
02158 
02159 ! *** Get the exchange date format (is it the precise_list format)
02160         id_error = &
02161            sasa_c_get_number_6th_level(id_XML_doc,                               &
02162            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis,  &
02163            'exchange_date', 0, 'precise_list', il_nb)
02164 
02165 ! **** Get the exchange date if it is the precise_list format
02166         IF (il_nb .eq. 1) THEN
02167 
02168             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_exch_date_type = &
02169                PSMILe_preciseday
02170 
02171             PRINT *, '**************************************************************'
02172             PRINT *, 'The precise_list format for exchange date is not yet supported'
02173             PRINT *, '**************************************************************'
02174             CALL PSMILe_Flushstd
02175 
02176             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02177 
02178         END IF
02179 
02180 ! *** Get the exchange date format (is it the date_list format)
02181         id_error = &
02182            sasa_c_get_number_6th_level(id_XML_doc,                               &
02183            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis,  &
02184            'exchange_date', 0, 'date_list', il_nb)
02185 
02186 ! **** Get the exchange date if it is the date_list format
02187         IF (il_nb .eq. 1) THEN
02188 
02189             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_exch_date_type = &
02190                PSMILe_list
02191 
02192             PRINT *, '***********************************************************'
02193             PRINT *, 'The date_list format for exchange date is not yet supported'
02194             PRINT *, '***********************************************************'
02195             CALL PSMILe_Flushstd
02196 
02197             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02198 
02199         END IF
02200 
02201 ! *** Get the exchange date format (is it the lastdayinmonth format)
02202         id_error = &
02203            sasa_c_get_number_6th_level(id_XML_doc,                              &
02204            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02205            'exchange_date', 0, 'lastdayinmonth', il_nb)
02206 
02207 ! **** Get the exchange date if it is the lastdayinmonth format
02208         IF (il_nb .eq. 1) THEN
02209 
02210             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_exch_date_type = &
02211                PSMILe_lastdayinmo
02212 
02213             PRINT *, '****************************************************************'
02214             PRINT *, 'The lastdayinmonth format for exchange date is not yet supported'
02215             PRINT *, '****************************************************************'
02216             CALL PSMILe_Flushstd
02217 
02218             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02219 
02220         END IF
02221 
02222 ! *** Get the lag
02223         id_error = &
02224            sasa_c_get_element_4th_level_i (id_XML_doc,            &
02225            'component', 0, 'transient', ib,'intent', 0,      &
02226            'output', ib_bis, 'lag', 0, il_test)
02227            if ( il_test /= -280177 ) &
02228               sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_lag = il_test
02229 
02230 ! *** Get the debug mode
02231         id_error = &
02232            sasa_c_get_element_4th_level_c (id_XML_doc,                &
02233            'component', 0, 'transient', ib, 'intent', 0,         &
02234            'output', ib_bis, 'debug_mode', 0, cla_char, il_length)
02235         sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_debugmode = &
02236            sasa_c_convert_char2int(cla_char(1:il_length))
02237 
02238         ll_io = .FALSE.
02239 #ifdef __PSMILE_WITH_IO
02240         ll_io = .TRUE.
02241 #endif
02242         IF (sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_debugmode  &
02243            .EQ. PSMILe_true .AND. .NOT. ll_io) THEN
02244             PRINT *, '***************************************************'
02245             PRINT *, 'The PSMILe is asked to perform I/O for debug mode'
02246             PRINT *, 'but it is compiled without __PSMILE_WITH_IO CPP key.'
02247             PRINT *, 'Calling MPI_Abort'
02248             PRINT *, '***************************************************'
02249             CALL PSMILe_Flushstd
02250             
02251             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02252         ENDIF
02253 ! *** Get the source time operation
02254         id_error = &
02255            sasa_c_get_element_5th_level_c (id_XML_doc,         &
02256            'component', 0, 'transient', ib, 'intent', 0,  &
02257            'output', ib_bis, 'source_transformation', 0,       &
02258            'source_time_operation', 0, cla_char, il_length)
02259         sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_src_timeop = &
02260            sasa_c_convert_char2int(cla_char(1:il_length))
02261 
02262 ! *** Set to one the integer that indicates if the stat is used or not
02263         sda_smioc_transi(ib)%sga_transi_out(ib_bis)%iga_stats = 0
02264         id_error = &
02265            sasa_c_get_number_6th_level(id_XML_doc,                              &
02266            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02267            'source_transformation', 0, 'statistics', il_nb)
02268 
02269         IF (il_nb .eq. 1) THEN
02270 
02271             id_error = &
02272                sasa_c_get_number_7th_level(id_XML_doc,                              &
02273                'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02274                'source_transformation', 0, 'statistics', 0,                         &
02275                'masked_points', il_nb_bis)
02276 
02277             IF (il_nb_bis .eq. 1) THEN
02278                 id_error = &
02279                 sasa_c_get_element_6th_level_c (id_XML_doc,                        &
02280                'component', 0, 'transient', ib, 'intent', 0, 'output', 0,     &
02281                'source_transformation', 0, 'statistics', 0,                        &
02282                'masked_points', 0, cla_char, il_length)
02283                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%iga_stats(1) = &
02284                sasa_c_convert_char2int(cla_char(1:il_length))
02285             END IF
02286 
02287             id_error = &
02288                sasa_c_get_number_7th_level(id_XML_doc,                              &
02289                'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02290                'source_transformation', 0, 'statistics', 0,                         &
02291                'notmasked_points', il_nb_bis)
02292 
02293             IF (il_nb_bis .eq. 1) THEN
02294                 id_error = &
02295                 sasa_c_get_element_6th_level_c (id_XML_doc,                        &
02296                'component', 0, 'transient', ib, 'intent', 0, 'output', 0,     &
02297                'source_transformation', 0, 'statistics', 0,                        &
02298                'notmasked_points', 0, cla_char, il_length)
02299                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%iga_stats(2) = &
02300                sasa_c_convert_char2int(cla_char(1:il_length))
02301             END IF
02302 
02303             id_error = &
02304                sasa_c_get_number_7th_level(id_XML_doc,                              &
02305                'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02306                'source_transformation', 0, 'statistics', 0,                         &
02307                'all_points', il_nb_bis)
02308 
02309             IF (il_nb_bis .eq. 1) THEN
02310                 id_error = &
02311                 sasa_c_get_element_6th_level_c (id_XML_doc,                        &
02312                'component', 0, 'transient', ib, 'intent', 0, 'output', 0,     &
02313                'source_transformation', 0, 'statistics', 0,                        &
02314                'all_points', 0, cla_char, il_length)
02315                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%iga_stats(3) = &
02316                sasa_c_convert_char2int(cla_char(1:il_length))
02317             END IF
02318 
02319         END IF
02320 
02321 ! *** Get the source local transformation for add and mult scalar
02322 
02323         id_error = &
02324            sasa_c_get_element_6th_level_i (id_XML_doc,    &
02325            'component', 0, 'transient', ib, 'intent', 0,  &
02326            'output', ib_bis, 'source_transformation', 0,  &
02327            'source_local_transformation', 0,              &
02328            'mult_scalar', 0, il_test)
02329         IF ( il_test /= - 280177 ) THEN
02330             sda_smioc_transi(ib)%sga_transi_out(ib_bis)% &
02331                sg_src_local_trans%dg_mult_scalar = il_test
02332         ENDIF
02333 
02334         id_error = &
02335            sasa_c_get_element_6th_level_i (id_XML_doc,    &
02336            'component', 0, 'transient', ib, 'intent', 0,  &
02337            'output', ib_bis, 'source_transformation', 0,  &
02338            'source_local_transformation', 0,              &
02339            'add_scalar', 0, il_test)
02340         IF ( il_test /= - 280177 ) THEN
02341             sda_smioc_transi(ib)%sga_transi_out(ib_bis)% &
02342                sg_src_local_trans%dg_add_scalar = il_test
02343         ENDIF
02344 
02345 ! *** Get the source local transformation for scattering
02346         id_error = &
02347            sasa_c_get_element_6th_level_c (id_XML_doc,    &
02348            'component', 0, 'transient', ib, 'intent', 0,  &
02349            'output', ib_bis, 'source_transformation', 0,  &
02350            'source_local_transformation', 0,              &
02351            'scattering', 0, cla_char, il_length)
02352         sda_smioc_transi(ib)%sga_transi_out(ib_bis)%      &
02353            sg_src_local_trans%ig_scatter =                &
02354            sasa_c_convert_char2int(cla_char(1:il_length))
02355 
02356 ! *** Get the source local transformation for reduction
02357         id_error = &
02358            sasa_c_get_number_7th_level(id_XML_doc,                              &
02359            'component', 0, 'transient', ib, 'intent', 0, 'output', ib_bis, &
02360            'source_transformation', 0, 'source_local_transformation', 0,        &
02361            'reduction', il_test)
02362         IF (il_test .eq. 1) THEN
02363             PRINT *, '*********************************'
02364             PRINT *, 'Reduction not supported for now !'
02365             PRINT *, '*********************************'
02366             CALL PSMILe_Flushstd
02367             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02368         END IF
02369 
02370 ! ***** Check if the transient is sending to a comp or a file 
02371         id_error = &
02372            sasa_c_get_number_5th_level(id_XML_doc,              &
02373            'component', 0, 'transient', ib, 'intent', 0,   &
02374            'output', ib_bis, 'component_name', il_nb_bis)
02375 
02376         id_error = &
02377            sasa_c_get_number_5th_level(id_XML_doc,              &
02378            'component', 0, 'transient', ib, 'intent', 0,   &
02379            'output', ib_bis, 'file', il_nb_ter)
02380 
02381         IF ((il_nb_bis .eq. 1) .and. (il_nb_ter .eq. 1)) THEN
02382 
02383             PRINT *, '**********************************************'
02384             PRINT *, 'The target can not be a component and a file !'
02385             PRINT *, '**********************************************'
02386             CALL PSMILe_Flushstd
02387 
02388             CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02389 
02390         ELSE IF (il_nb_bis .eq. 1) THEN
02391 
02392 ! ***** Set the destination type to comp
02393             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_dest_type = &
02394                PSMILe_comp
02395 
02396             id_error = &
02397                sasa_c_get_element_4th_level_c (id_XML_doc,                    &
02398                'component', 0, 'transient', ib, 'intent', 0,             &
02399                'output', ib_bis, 'component_name', 0,                         &
02400                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%cg_dest_comp_name, &
02401                il_length)
02402 
02403         ELSE IF (il_nb_ter .eq. 1) THEN
02404             ll_io = .FALSE.
02405 #ifdef __PSMILE_WITH_IO
02406             ll_io = .TRUE.
02407 #endif
02408             IF (.NOT. ll_io) THEN
02409                 PRINT *, '***************************************************'
02410                 PRINT *, 'The PSMILe is asked to perform Output to file'
02411                 PRINT *, 'but it is compiled without __PSMILE_WITH_IO CPP key'
02412                 PRINT *, 'Calling MPI_Abort'
02413                 PRINT *, '***************************************************'
02414                 CALL PSMILe_Flushstd
02415 
02416                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02417             ENDIF
02418 !
02419 ! ***** Set the destination type to file
02420             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%ig_dest_type = &
02421                PSMILe_file
02422 
02423             il_length = 0
02424             id_error = &
02425                sasa_c_get_element_5th_level_c (id_XML_doc,    &
02426                'component', 0, 'transient', ib, 'intent', 0,  &
02427                'output', ib_bis, 'file', 0, 'name', 0,        &
02428                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%   &
02429                sg_dest_file%cg_file_name, il_length)  
02430             IF (il_length == 0) THEN
02431                 PRINT *, '*******************************************'
02432                 PRINT *, 'a name must be specified for each file     '
02433                 PRINT *, '*******************************************'
02434                 CALL PSMILe_Flushstd
02435                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02436             ENDIF
02437 
02438             il_length = 0
02439             id_error = &
02440                sasa_c_get_element_5th_level_c (id_XML_doc,    &
02441                'component', 0, 'transient', ib, 'intent', 0,  &
02442                'output', ib_bis, 'file', 0, 'format', 0,      &
02443                cla_char, il_length)
02444             IF (il_length == 0) THEN
02445                 PRINT *, '*******************************************'
02446                 PRINT *, 'a format must be specified for each file     '
02447                 PRINT *, '*******************************************'
02448                 CALL PSMILe_Flushstd
02449                 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
02450             ENDIF
02451             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%      &
02452                sg_dest_file%ig_file_format =                  &
02453                sasa_c_convert_char2int(cla_char(1:il_length))
02454 
02455             id_error = &
02456                sasa_c_get_element_5th_level_c (id_XML_doc,    &
02457                'component', 0, 'transient', ib, 'intent', 0,  &
02458                'output', ib_bis, 'file', 0, 'suffix', 0,      &
02459                cla_char, il_length)
02460             sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_dest_file% &
02461                ig_suffix = sasa_c_convert_char2int(cla_char(1:il_length))
02462             IF (sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_dest_file% &
02463                ig_suffix .eq. -280177) sda_smioc_transi(ib)%              &
02464                sga_transi_out(ib_bis)%sg_dest_file%ig_suffix = 0
02465 
02466             il_length = 0
02467             id_error = &
02468                sasa_c_get_element_5th_level_c (id_XML_doc,    &
02469                'component', 0, 'transient', ib, 'intent', 0,  &
02470                'output', ib_bis, 'file', 0, 'io_mode', 0,   &
02471                cla_char, il_length)
02472             IF (il_length == 0) THEN
02473 #ifdef VERBOSE
02474                 PRINT *, '************************************************************'
02475                 PRINT *, 'no io_mode for file; default value iosingle will be used    '
02476                 PRINT *, '************************************************************'
02477 #endif
02478                 sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_dest_file% &
02479                    ig_file_iomode = 3825
02480             ELSE
02481                 sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_dest_file% &
02482                    ig_file_iomode =                                    &
02483                    sasa_c_convert_char2int(cla_char(1:il_length))
02484             ENDIF
02485 
02486             id_error = &
02487                sasa_c_get_element_5th_level_i (id_XML_doc,    &
02488                'component', 0, 'transient', ib, 'intent', 0,  &
02489                'output', ib_bis, 'file', 0, 'packing', 0,     &
02490                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%sg_dest_file% &
02491                ig_file_pack)  
02492 
02493             id_error = &
02494                sasa_c_get_element_5th_level_d (id_XML_doc,    &
02495                'component', 0, 'transient', ib, 'intent', 0,  &
02496                'output', ib_bis, 'file', 0, 'scaling', 0,     &
02497                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%   &
02498                sg_dest_file%dg_file_scal)
02499 
02500             id_error = &
02501                sasa_c_get_element_5th_level_d (id_XML_doc,    &
02502                'component', 0, 'transient', ib, 'intent', 0,  &
02503                'output', ib_bis, 'file', 0, 'adding', 0,      &
02504                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%   &
02505                sg_dest_file%dg_file_add)
02506 
02507             id_error = &
02508                sasa_c_get_element_5th_level_d (id_XML_doc,    &
02509                'component', 0, 'transient', ib, 'intent', 0,  &
02510                'output', ib_bis, 'file', 0, 'fill_value', 0,  &
02511                sda_smioc_transi(ib)%sga_transi_out(ib_bis)%   &
02512                sg_dest_file%dg_fill_val)
02513 
02514         END IF
02515 
02516       END DO
02517 
02518     END DO
02519 
02520   END SUBROUTINE get_transi_details
02521 
02522 !
02523 !======================================================================

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1