Ignore:
Timestamp:
10/30/09 16:29:39 (15 years ago)
Author:
ymipsl
Message:

Correction bug sur les ids des file_group
+ possibilité de fixer les attributs des groupes à partir de l'ioserver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_SERVER/trunk/src/XMLIO/mod_file.f90

    r40 r42  
    2929  TYPE(sorted_list),POINTER,SAVE,PRIVATE     :: Ids  
    3030 
     31  INTERFACE file__set_attribut 
     32    MODULE PROCEDURE file__set_attribut_id,file__set_attribut_pt 
     33  END INTERFACE 
     34 
    3135CONTAINS 
    3236  INCLUDE 'vector_file_contains.inc' 
     
    138142  END SUBROUTINE file__set 
    139143 
    140   SUBROUTINE file__set_attribut(id,attrib) 
     144  SUBROUTINE file__set_attribut_id(id,attrib,ok) 
     145  USE mod_attribut 
     146  USE error_msg 
     147  IMPLICIT NONE 
     148    CHARACTER(LEN=*),INTENT(IN)   :: id 
     149    TYPE(attribut),INTENT(IN)     :: attrib 
     150    LOGICAL,OPTIONAL,INTENT(OUT)  :: ok 
     151     
     152    TYPE(file),POINTER              :: Pt_file 
     153    INTEGER                         :: Pos 
     154    LOGICAL                         :: success 
     155     
     156    CALL sorted_list__find(Ids,hash(Id),Pos,success) 
     157    IF (success) THEN 
     158      Pt_file=>file_ids%at(Pos)%Pt 
     159      CALL file__set_attribut_pt(Pt_file,attrib) 
     160      IF (PRESENT(OK)) OK=.TRUE. 
     161    ELSE 
     162      IF (.NOT.PRESENT(OK)) THEN 
     163        WRITE(message,*) 'File id : ',id,' is undefined' 
     164        CALL error('mod_file::file__set_attribut') 
     165      ELSE 
     166        OK=.FALSE. 
     167      ENDIF 
     168    ENDIF   
     169   
     170  END SUBROUTINE file__set_attribut_id 
     171       
     172  SUBROUTINE file__set_attribut_pt(Pt_file,attrib) 
    141173  USE mod_attribut 
    142174  USE mod_file_attribut 
    143175  USE error_msg 
    144176  IMPLICIT NONE 
    145     CHARACTER(LEN=*),INTENT(IN) :: id 
     177    TYPE(file),POINTER        :: Pt_file 
    146178    TYPE(attribut),INTENT(IN) :: attrib 
    147179 
    148     TYPE(file),POINTER              :: Pt_file 
    149     INTEGER                         :: Pos 
    150     LOGICAL                         :: success 
    151      
    152     CALL sorted_list__find(Ids,hash(Id),Pos,success) 
    153     IF (success) THEN 
    154       Pt_file=>file_ids%at(Pos)%Pt 
    155     ELSE 
    156       WRITE(message,*) 'File id :',id,'is undefined' 
    157       CALL error('mod_file::file__set_attribut') 
    158     ENDIF   
    159180     
    160181    SELECT CASE(attrib%name) 
     
    173194     END SELECT 
    174195 
    175      WRITE(message,*) 'file id ',id,' : Attribute type is incompatible with the provided value' 
     196     WRITE(message,*) 'file attribut ',attrib%name,' : type : ',attrib%type,' : Attribute type is incompatible with the provided value' 
    176197     CALL error('mod_file::file__set_attribut') 
    177198     
    178   END SUBROUTINE file__set_attribut 
     199  END SUBROUTINE file__set_attribut_pt 
    179200   
    180201      
Note: See TracChangeset for help on using the changeset viewer.