Exemplo n.º 1
0
med_int
MEDfieldnComponent(const med_idt fid, 
		   const int ind)
{
  med_err _ret       = -1;
  char    _fieldname[MED_NAME_SIZE+1]="";
  int     _num       = ind-1;
  char    _path        [MED_TAILLE_CHA+MED_NAME_SIZE+1]=MED_CHA;
  /*
   * On inhibe le gestionnaire d'erreur HDF
   */
  _MEDmodeErreurVerrouiller();


  /*
   * On recupere le nom du champ
   */
  if ( _MEDobjectGetName(fid, _path ,_num, _fieldname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(_num);
    goto ERROR;
  }

  if ( (_ret=MEDfieldnComponentByName( fid, _fieldname )) < 0) {
    MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,MED_ERR_FIELD_MSG);
    SSCRUTE(_fieldname);SSCRUTE(_path);SSCRUTE("MEDfieldnComponentbyName");
    goto ERROR;
  }

 ERROR:
  return _ret;
}
Exemplo n.º 2
0
med_err
MEDstructElementInfo(const med_idt             fid,
		     const int                 mit,
		     char *              const modelname,
		     med_geometry_type * const mgeotype,
		     med_int*            const modeldim,
		     char*               const supportmeshname,
		     med_entity_type*    const sentitytype,
		     med_int*            const snnode,
		     med_int*            const sncell,
		     med_geometry_type*  const sgeotype,
		     med_int*            const nconstantattribute,
		     med_bool*           const anyprofile,
		     med_int*            const nvariableattribute
			   )
{

  med_err  _ret=-1;
  char     _path[MED_TAILLE_STRCT+MED_NAME_SIZE+1]=MED_STRCT;
  int      _num = mit -1;

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  /*
   * On recupere le nom de l'élément de structure
   */
  if ( _MEDobjectGetName(fid, _path ,_num, modelname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(mit);
    goto ERROR;
  }
  strcat(_path,modelname);

  if (
      MEDstructElementInfoByName(fid,
				 modelname,
				 mgeotype,
				 modeldim,
				 supportmeshname,
				 sentitytype,
				 snnode,
				 sncell,
				 sgeotype,
				 nconstantattribute,
				 anyprofile,
				 nvariableattribute
				 ) < 0 ) {
    MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,MED_ERR_STRUCT_MSG);
    SSCRUTE(modelname);SSCRUTE(_path);SSCRUTE("MEDstructElementInfoByName");
    goto ERROR;
  }

  _ret = 0;

 ERROR:

  return _ret;
}
med_err
MEDparameterComputationStepInfo(const med_idt      fid,
				const char * const paramname,
				const int          csit,
				med_int * const    numdt,
				med_int * const    numit,
				med_float * const  dt )
{
  med_err _ret = -1, _err = -1;
  med_idt _cpstidt = 0;
  char    _path[(MED_TAILLE_NUM_DATA+MED_NAME_SIZE+1)+2*MED_MAX_PARA+1]=MED_NUM_DATA;
  int     _num=csit-1;
  char    _cstpname[2*MED_MAX_PARA+1]="";

  _MEDmodeErreurVerrouiller();
  
  /* On recupere le nom du pas de temps */
  strcat(_path, paramname);
  if ( _MEDobjectGetName(fid, _path ,_num, _cstpname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(_num);
    goto ERROR;
  }

  /* on ouvre le groupe HDF correspondant */
  strcat(_path,"/");
  strcat(_path,_cstpname);
  if ((_cpstidt = _MEDdatagroupOuvrir(fid,_path)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
    goto ERROR;
  }

  /* Lecture des attributs */
  if (_MEDattrEntierLire(_cpstidt, MED_NOM_NDT, (med_int*) numdt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
    SSCRUTE(_path);ISCRUTE(*numdt);goto ERROR;
  }
  if (_MEDattrFloatLire(_cpstidt, MED_NOM_PDT, (med_float*) dt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_PDT);
    SSCRUTE(_path);RSCRUTE(*dt);goto ERROR;
  }
  if (_MEDattrEntierLire(_cpstidt, MED_NOM_NOR, (med_int*) numit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);
    SSCRUTE(_path);ISCRUTE(*numit);goto ERROR;
  }

  _ret = 0;
 ERROR:

  /* on ferme tout */
  if (_cpstidt > 0)            
    if (_MEDdatagroupFermer(_cpstidt) < 0) {
      MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
      ISCRUTE_id(_cpstidt);
    }

  return _ret;
}
Exemplo n.º 4
0
/**\ingroup MEDinterp
  \brief \MEDinterpInfoBrief
  \param fid           \fid
  \param interpit      \interpit
  \param interpname    \interpname
  \param geotype       \geotype
  \param cellnode      \cellnode
  \param nbasisfunc \nbasisfunc
  \param nvariable  \nvariable
  \param maxdegree     \maxdegree
  \param nmaxcoef      \nmaxcoef

  \return \error
  \details \MEDinterpInfoDetails
  \see     MEDinterpInfoByName

 */
med_err
MEDinterpInfo(const med_idt                 fid,
	      const int                      interpit,
	            char*              const interpname,
	            med_geometry_type* const geotype,
	            med_bool*          const cellnode,
	            med_int*           const nbasisfunc,
	            med_int*           const nvariable,
	            med_int*           const maxdegree,
	            med_int*           const nmaxcoef
	      )
{
  med_err  _ret=-1;
  char     _interppath[MED_TAILLE_INTERP+MED_NAME_SIZE+1]=MED_INTERP;
  int      _num = interpit -1;

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  /*
   * On recupere le nom de l'interpolation
   */
  if ( _MEDobjectGetName(fid, _interppath ,_num, interpname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_interppath);ISCRUTE_int(interpit);
    goto ERROR;
  }
  strcat(_interppath,interpname);

  if (  MEDinterpInfoByName(fid,
			    interpname,
			    geotype,
			    cellnode,
			    nbasisfunc,
			    nvariable,
			    maxdegree,
			    nmaxcoef
			    )    < 0 ) {
    MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,MED_ERR_INTERP_MSG);
    SSCRUTE(interpname);SSCRUTE(_interppath);SSCRUTE("MEDinterpInfoByName");
    goto ERROR;
  }

  _ret = 0;

 ERROR:

  return _ret;
}
Exemplo n.º 5
0
med_err
MEDlocalizationInfo(const med_idt             fid,
		    const int                 localizationit,
		    char              * const localizationname,
		    med_geometry_type * const geotype,
		    med_int           * const spacedimension,
		    med_int           * const nipoint,
		    char *              const geointerpname,
		    char *              const sectionmeshname,
		    med_int           * const nsectionmeshcell,
		    med_geometry_type * const sectiongeotype)
{
  med_err _ret=-1;
  char    _path[MED_TAILLE_GAUSS+MED_NAME_SIZE+1]=MED_GAUSS;
  int     _num=localizationit-1;

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  /*
   * ouverture du groupe /GAUSS/"nom"
   */
  if ( _MEDobjectGetName(fid, _path ,_num, localizationname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
    ISCRUTE_int(localizationit);
    goto ERROR;
  }

  if ( MEDlocalizationInfoByName(fid, localizationname, geotype, spacedimension,
				 nipoint,geointerpname, 
				 sectionmeshname, nsectionmeshcell,sectiongeotype ) < 0) {
    MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDlocalizationInfoByName");
    SSCRUTE(localizationname);
    goto ERROR;
  }

  _ret = 0;
 ERROR:

  return _ret;
}
Exemplo n.º 6
0
void MAJ_236_300_champs(med_idt fid)
{
  med_err lret,ret;
  /*   med_idt         _datagroup=0; */
  med_field_type   typcha;
  char nomcha    [MED_NAME_SIZE+1]="";
  char _meshname [MED_NAME_SIZE+1]="";
  char _dtunit   [MED_SNAME_SIZE+1]="";
  char *comp= NULL, *unit= NULL;
  med_int   ncomp,ncha;
  med_int  _ncstp=0;
  med_bool _local=MED_FALSE;
  htri_t   _datasetexist;
  char _pathi[MED_TAILLE_CHA+1+MED_NAME_SIZE+1]=MED_CHA;
  char _pathf[MED_TAILLE_CHA+2+MED_NAME_SIZE+1]="/CHA_/";
  char _pathtmp[MED_TAILLE_CHA+3]="/CHA__/";
  int i,j;

  char nomlien[MED_NAME_SIZE+1]="";
  char * lien = NULL;
  med_int nln,nval;

  med_int  _nloc,_intgeotype,_sdim;
  char     _pathloc[MED_TAILLE_GAUSS+MED_NAME_SIZE+1]=MED_GAUSS;

  med_int  _npar,_numdt,_numit;
  char     _pathpari[MED_TAILLE_NUM_DATA+MED_NAME_SIZE+1+2*MED_MAX_PARA+1+1]=MED_NUM_DATA;
  char     _pathparf[MED_TAILLE_NUM_DATA+MED_NAME_SIZE+1+2*MED_MAX_PARA+1+1]=MED_NUM_DATA;
  int      _pathparlen;
  med_size _n=0;
  char     _cpstnamei[2*MED_MAX_PARA+1]="";
  char     _cpstnamef[2*MED_MAX_PARA+1]="";
  char     _uniname[MED_SNAME_SIZE+1]="";
/*   hid_t    _lac_plist_id; */
  hid_t    _lcp_plist_id;
  hid_t    _ocp_plist_id;
  med_bool _createunt = MED_TRUE;

  MAJ_version_num(fid,2,3,6);

  /* MAJ des varaibles scalaires */
  _npar = MEDnParameter(fid);
  if (_npar > 0) {
    fprintf(stdout,"  >>> Normalisation des paramètres scalaires\n");
    _pathparf[MED_TAILLE_NUM_DATA-2]='_';
/*     _lac_plist_id = H5Pcreate( H5P_LINK_ACCESS ); */
    _ocp_plist_id = H5Pcreate( H5P_OBJECT_COPY );
    _lcp_plist_id = H5Pcreate( H5P_LINK_CREATE );
    H5Pset_create_intermediate_group( _lcp_plist_id, 1 );
    H5Pset_copy_object( _ocp_plist_id, H5O_COPY_SHALLOW_HIERARCHY_FLAG);
  }

  for (i=0 ; i < _npar ; i++ ) {

    MED_ERR_EXIT_IF (_MEDobjectGetName(fid, _pathpari ,i, &_pathpari[MED_TAILLE_NUM_DATA]) < 0,
		     MED_ERR_ACCESS,MED_ERR_DATAGROUP,_pathpari);


    strcpy(&_pathparf[MED_TAILLE_NUM_DATA],&_pathpari[MED_TAILLE_NUM_DATA]);
/*     SSCRUTE(_pathparf); */
/*     SSCRUTE(_pathpari); */

    /*Copie le group avec ses attributs et les objets de premier niveau.*/
    ret =  H5Ocopy(fid,_pathpari,fid,_pathparf,_ocp_plist_id,_lcp_plist_id);
/*     ret =  H5Lcopy(fid,_pathpari,fid,_pathparf,_lcp_plist_id,_lac_plist_id); */
    EXIT_IF(ret < 0,"Copie du datagroup",_pathpari);

    _pathparlen=strlen(_pathpari);
    _pathpari[_pathparlen]='/';_pathparf[_pathparlen]='/';
    ++_pathparlen;
    _pathpari[_pathparlen]='\0';_pathparf[_pathparlen]='\0';

/*     SSCRUTE(_pathparf); */
/*     SSCRUTE(_pathpari); */

    ret =_MEDnObjects(fid,_pathpari, &_n);
    MED_ERR_EXIT_IF( (ret == (MED_ERR_COUNT + MED_ERR_DATAGROUP)), MED_ERR_COUNT,MED_ERR_PARAMETER,_pathpari);

    for (j=0 ; j < _n ; ++j ) {
      MED_ERR_EXIT_IF (_MEDobjectGetName(fid, _pathpari ,j, &_pathpari[_pathparlen]) < 0,
		       MED_ERR_ACCESS,MED_ERR_DATAGROUP,_pathpari);

      MED_ERR_EXIT_IF (_MEDattributeNumRdByName(fid,_pathpari,MED_NOM_NOR,
						MED_INTERNAL_INT,(unsigned char * const ) &_numit) < 0,
		       MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);

      MED_ERR_EXIT_IF (_MEDattributeNumRdByName(fid,_pathpari,MED_NOM_NDT,
						MED_INTERNAL_INT,(unsigned char * const ) &_numdt) < 0,
		       MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
      
      MED_ERR_EXIT_IF (_MEDattributeStringRdByName(fid,_pathpari,MED_NOM_UNI,
						MED_SNAME_SIZE,_uniname) < 0,
		       MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
      
      _MEDgetComputationStepName(MED_SORT_DTIT,_numdt,_numit,&_pathparf[_pathparlen]);
/*       strcat(_pathpari,"/"); */
/*       strcat(_pathparf,"/"); */
/*       SSCRUTE(_pathparf); */
/*       SSCRUTE(_pathpari); */

/*       ret =  H5Ocopy(fid,_pathpari,fid,_pathparf,_ocp_plist_id,_lcp_plist_id); */
/*       ret =  H5Lcopy(fid,_pathpari,fid,_pathparf,_lcp_plist_id,_lac_plist_id); */
/*       H5Eprint1(stderr); */
/*       EXIT_IF(ret < 0,"Copie d'une étape de calcul du paramètre scalaire ",_pathpari); */

      /*On modifie temporairement _pathpari pour pointer dans _pathparf*/
      _pathpari[MED_TAILLE_NUM_DATA-2]='_';
/*       SSCRUTE(_pathparf); */
/*       SSCRUTE(_pathpari); */
      ret = H5Gmove(fid, _pathpari, _pathparf  );
      EXIT_IF(ret < 0,"Renommage de l'étape de calcul",_pathpari);
      _pathpari[MED_TAILLE_NUM_DATA-2]='A';


      MED_ERR_EXIT_IF(H5Adelete_by_name( fid, _pathparf, MED_NOM_UNI, H5P_DEFAULT ) < 0,
		      MED_ERR_DELETE,MED_ERR_ATTRIBUTE,_pathparf);

      _pathparf[_pathparlen]='\0';
      _pathpari[_pathparlen]='\0';
      if ( _createunt ) {
	MED_ERR_EXIT_IF (_MEDattributeStringWrByName(fid,_pathparf,MED_NOM_UNT, MED_SNAME_SIZE,_uniname) < 0,
			 MED_ERR_WRITE,MED_ERR_ATTRIBUTE,MED_NOM_UNT);
	_createunt = MED_FALSE;
      }
    }
    _createunt = MED_TRUE;
    _pathpari[MED_TAILLE_NUM_DATA]='\0';
  }

  if ( _npar > 0 ) {

    _pathpari[MED_TAILLE_NUM_DATA]='\0';
    _pathparf[MED_TAILLE_NUM_DATA]='\0';
    MED_ERR_EXIT_IF ( H5Ldelete(fid,_pathpari,H5P_DEFAULT) < 0 ,
		      MED_ERR_DELETE,MED_ERR_LINK,_pathpari);

    ret = H5Gmove(fid, _pathparf, _pathpari  );
    EXIT_IF(ret < 0,"Renommage du group de paramètres scalaires",_pathparf);

  }

  /* MAJ des localisations */
  _nloc = MEDnLocalization(fid);
/*   ISCRUTE(_nloc); */
  if (_nloc > 0)
    fprintf(stdout,"  >>> Normalisation des localisations des points d'intégration\n");
  for (i=0 ; i < _nloc ; i++ ) {

/*     SSCRUTE(_pathloc); */
    MED_ERR_EXIT_IF (_MEDobjectGetName(fid, _pathloc ,i, &_pathloc[MED_TAILLE_GAUSS]) < 0,
		     MED_ERR_ACCESS,MED_ERR_DATAGROUP,_pathloc);
/*     SSCRUTE(_pathloc); */
    MED_ERR_EXIT_IF (_MEDattributeNumRdByName(fid,_pathloc,MED_NOM_GEO,
					      MED_INTERNAL_INT,(unsigned char * const ) &_intgeotype) < 0,
		     MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
    _sdim = (_intgeotype/100);

    MED_ERR_EXIT_IF (_MEDattributeNumWrByName(fid,_pathloc,MED_NOM_DIM,
					      MED_INTERNAL_INT,(const unsigned char * const) &_sdim) < 0,
		     MED_ERR_WRITE,MED_ERR_ATTRIBUTE,MED_NOM_DIM);

    MED_ERR_EXIT_IF ( _MEDattributeStringWrByName(fid,_pathloc,MED_NOM_INM,MED_NAME_SIZE,"") < 0,
		      MED_ERR_WRITE,MED_ERR_ATTRIBUTE,MED_NOM_INM);
    _pathloc[MED_TAILLE_GAUSS]='\0';

  }

  /* MAJ des liens */
  nln = MEDnLink(fid);
  if (nln > 0)
    fprintf(stdout,"  >>> Normalisation des liens\n");
  for (i=1 ; i <= nln ; i++ ) {


    ret =  MEDlinkInfo(fid, i, nomlien, &nval);
    EXIT_IF(ret,"Erreur a la demande d'information sur le lien",NULL);

/*     printf("\t- Lien n°%i de nom |%s| et de taille "IFORMAT"\n",i,nomlien,nval); */

    lien = (char *) malloc((nval+1)*sizeof(char));
    EXIT_IF(lien == NULL,NULL,NULL);

    ret = MEDlinkRd(fid, nomlien, lien );
    EXIT_IF(ret,"Erreur a la lecture du lien : ",nomlien);

    MAJ_version_num(fid,3,0,8);
    ret = MED30linkWr(fid,nomlien,lien);
    EXIT_IF(ret,"Erreur a l'écrtiure du lien : ",nomlien);
    MAJ_version_num(fid,2,3,6);
 
    lien[nval] = '\0';
/*     printf("\t\t|%s|\n\n",lien); */

    free(lien);
  }

  /* combien de champs dans le fichier */
  ncha = MEDnField(fid);
  EXIT_IF(ncha < 0,"lors de la lecture du nombre de champs",NULL);

  /* MAJ des champs */
  for (i =0;i<ncha;i++) {
    lret = 0;

    /* Lecture du nombre de composantes */
    ncomp = MEDfieldnComponent(fid,i+1);
    if (ncomp < 0) {
      MESSAGE("Erreur à la lecture du nombre de composantes : "); ISCRUTE(ncomp);
      exit(1);
    }

    /* Lecture du type du champ, des noms des composantes et du nom de l'unité*/
    comp = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
    EXIT_IF(comp == NULL,NULL,NULL);
    unit = (char*) malloc(ncomp*MED_SNAME_SIZE+1);
    EXIT_IF(unit == NULL,NULL,NULL);

    /*     ret = MED231champInfoEtRen(fid,i+1,nomcha,&typcha,comp,unit,ncomp); */
    ret = MEDfieldInfo(fid,i+1,nomcha,_meshname,&_local,&typcha,comp,unit,_dtunit,&_ncstp);
    MED_ERR_EXIT_IF(ret,MED_ERR_ACCESS,MED_ERR_FIELD,nomcha);

    /* creation du champ destination */
    MAJ_version_num(fid,3,0,8);

    EXIT_IF( H5Gmove(fid, _pathi, _pathtmp  ) < 0,"Switch to ",_pathtmp);
    _datasetexist=H5Lexists( fid, _pathf, H5P_DEFAULT );
    if (_datasetexist ) { EXIT_IF( (H5Gmove(fid, _pathf, _pathi  ) < 0) ,"Switch to ",_pathi); }

    MED_ERR_EXIT_IF( MEDfieldCr(fid,nomcha,typcha,ncomp,comp,unit,_dtunit,_meshname ) < 0,
		     MED_ERR_CREATE,MED_ERR_FIELD,_pathf);
    EXIT_IF( H5Gmove(fid, _pathi  , _pathf  ) < 0,"Switch to ",_pathf);
    EXIT_IF( H5Gmove(fid, _pathtmp, _pathi  ) < 0,"Switch to ",_pathi);

    MAJ_version_num(fid,2,3,6);

    free(comp);
    free(unit);

    lret = MAJ_236_300_fieldOnEntity( fid, nomcha, _meshname, typcha, ncomp, MED_NODE,_ncstp, _pathi, _pathf);
    if (lret != 0) {
      MESSAGE("Erreur à la lecture des champs aux noeuds "); exit(1);
    }

    lret = MAJ_236_300_fieldOnEntity( fid, nomcha, _meshname, typcha, ncomp, MED_CELL,_ncstp, _pathi, _pathf);
    if (lret != 0) {
      MESSAGE("Erreur à la lecture des champs aux mailles "); exit(1);
    }

    lret = MAJ_236_300_fieldOnEntity( fid, nomcha, _meshname, typcha, ncomp, MED_DESCENDING_FACE,_ncstp, _pathi, _pathf);
    if (lret != 0) {
      MESSAGE("Erreur à la lecture des champs aux faces "); exit(1);
    }

    lret = MAJ_236_300_fieldOnEntity( fid, nomcha, _meshname, typcha, ncomp, MED_DESCENDING_EDGE,_ncstp, _pathi, _pathf);
    if (lret != 0) {
      MESSAGE("Erreur à la lecture des champs aux aretes "); exit(1);
    }

    lret = MAJ_236_300_fieldOnEntity( fid, nomcha, _meshname, typcha, ncomp, MED_NODE_ELEMENT,_ncstp, _pathi, _pathf);
    if (lret != 0) {
      MESSAGE("Erreur à la lecture des champs aux aretes "); exit(1);
    }

  }
  _datasetexist=H5Lexists( fid, _pathf, H5P_DEFAULT );

  if (_datasetexist ) {
    EXIT_IF( (H5Ldelete(fid,_pathi, H5P_DEFAULT) < 0) ,"Delete ",_pathi);
    EXIT_IF( (H5Gmove(fid, _pathf, _pathi  ) < 0) ,"Switch to ",_pathf);
  }


}
void
_MEDfield23ComputingStepMeshInfo236(int dummy,...)
{


  med_err   _ret=-1,_err=0;
  med_size  _num,_nmesh=0;

  med_idt   _datagroup1=0,_meshgid=0,_linkgid=0;
  char      _datagroupname1[2*MED_MAX_PARA+1]         ="";
  char      _ent_geo       [2*MED_TAILLE_NOM_ENTITE+2]="";
  char      _path          [(MED_TAILLE_CHA+MED_TAILLE_NOM+1)+
			    (2*MED_TAILLE_NOM_ENTITE+1)+1+(2*MED_MAX_PARA)+1]=MED_CHA;
  char     _meshpath [MED_TAILLE_MAA+MED_TAILLE_NOM+1]=MED_MAA;
  char     _linkpath [MED_TAILLE_LIENS+MED_TAILLE_NOM+1]=MED_LIENS;
  med_size _ncpst=0;
  med_bool _checkmultiplemesh=MED_TRUE, _multiplemesh       =MED_FALSE;
  med_bool _checkmeshname    =MED_TRUE, _samedefaultmeshname=MED_FALSE;


  MED_VARGS_DECL(const, med_idt       , , fid       );
  MED_VARGS_DECL(const, char * , const  , fieldname );
  MED_VARGS_DECL(const, int           , , csit      );
  MED_VARGS_DECL(, med_int *, const     , numdt     );
  MED_VARGS_DECL(, med_int *, const     , numit     );
  MED_VARGS_DECL(, med_float *, const   , dt        );
  MED_VARGS_DECL(, med_int *, const     , nmesh     );
  MED_VARGS_DECL(, char *, const        , meshname  );
  MED_VARGS_DECL(, med_bool *, const    , localmesh );
  MED_VARGS_DECL(, med_int *, const     , meshnumdt );
  MED_VARGS_DECL(, med_int *, const     , meshnumit );
  MED_VARGS_DECL(, med_err *           ,, fret      );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt       , , fid       );
  MED_VARGS_DEF(const, char * , const  , fieldname );
  MED_VARGS_DEF(const, int           , , csit      );
  MED_VARGS_DEF(, med_int *, const     , numdt     );
  MED_VARGS_DEF(, med_int *, const     , numit     );
  MED_VARGS_DEF(, med_float *, const   , dt        );
  MED_VARGS_DEF(, med_int *, const     , nmesh     );
  MED_VARGS_DEF(, char *, const        , meshname  );
  MED_VARGS_DEF(, med_bool *, const    , localmesh );
  MED_VARGS_DEF(, med_int *, const     , meshnumdt );
  MED_VARGS_DEF(, med_int *, const     , meshnumit );
  MED_VARGS_DEF(, med_err *           ,, fret      );

  _num=csit-1;

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  /*
   * On construit le nom du datagroup
   */
  strcat(_path,fieldname);

/*   if ( _MEDfieldComputingStepCheck236(fid,  fieldname, */
/* 				      &_ncpst, */
/* 				      _checkmultiplemesh, &_multiplemesh, */
/* 				      _checkmeshname,     &_samedefaultmeshname) < 0) { */
/*     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_FIELD,fieldname); */
/*     goto ERROR; */
/*   } */

/*
 * On suppose que le modèle 2.3.6 est respecté :
 * Il y a les mêmes séquences de calcul pour tous les couples
 * (typent,typegeo). Autrement dit selon l'utilisation de l'API 2.3.6 :
 * A chaque séquence de calcul, on utilise le même ensemble de (typent,typegeo).
 * En conséquence si l'on fixe le (typeent,typegeo) les séquences
 * de calcul que l'on va trouver seront représentatives de celles
 * présentent dans tous les (typent,typegeo) utilisés.
 */
  if ( _MEDobjectGetName(fid, _path ,0, _ent_geo) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
    SSCRUTE(_path); SSCRUTE(_ent_geo); goto ERROR;
  }

  strcat(_path,"/");
  strcat(_path,_ent_geo);

  if ( _MEDobjectGetName(fid, _path ,_num, _datagroupname1) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
    SSCRUTE(_path); SSCRUTE(_ent_geo); goto ERROR;
  }

  strcat(_path,"/");
  strcat(_path,_datagroupname1);

  if ((_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
    goto ERROR;
  }


  /*
   * Lecture des attributs
   */

  if (_MEDattrEntierLire(_datagroup1,MED_NOM_NDT,(med_int*) numdt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
    SSCRUTE(_path);ISCRUTE(*numdt);goto ERROR;
  }

  if (_MEDattrFloatLire(_datagroup1,MED_NOM_PDT,(med_float*) dt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_PDT);
    SSCRUTE(_path);RSCRUTE(*dt);goto ERROR;
  }

  if (_MEDattrEntierLire(_datagroup1,MED_NOM_NOR,(med_int*) numit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);
    SSCRUTE(_path);ISCRUTE(*numit);goto ERROR;
  }

  if (_MEDattrStringLire(_datagroup1,MED_NOM_MAI,MED_TAILLE_NOM,meshname) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_MAI);
    SSCRUTE(_path);SSCRUTE(meshname);goto ERROR;
  }


  /* Nombre de maillages
   * La gestion d'une incohérence sur le nombre de séquences de calcul par couple (entitytype,geotype)
   * se fait à partir des appels :
   *  MEDfieldnProfile,MEDfieldnValue*
   * La vérification complémentaire que l'ensemble des maillages utilisés sont les mêmes pour toutes les séquences
   * de calcul identiques est effectué dans MEDfield23nValue
   */
  if ( (_err=_MEDnObjects(_datagroup1,".",&_nmesh)) <0)
    if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
      MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_path);
      goto ERROR;
    }
  *nmesh = (med_int) _nmesh;


  /* Maillage local ou distant */
  strcat(_meshpath,meshname);

  /* Le maillage est il distant */
  if ( (_meshgid = _MEDdatagroupOuvrir(fid,_meshpath)) < 0)  {

    /* Verifie que le maillage est bien référencé comme distant */
    strcat(_linkpath,meshname);
    if ((_linkgid = _MEDdatagroupOuvrir(fid,_linkpath)) < 0) {
/*       MED_ERR_(_ret,MED_ERR_DOESNTEXIST,MED_ERR_MESH,MED_ERR_FIELD_MSG); */
/*       SSCRUTE(fieldname);SSCRUTE(_meshpath);SSCRUTE(_linkpath); */
/*       goto ERROR; */
      *localmesh = MED_FALSE;
    }
    *localmesh = MED_FALSE;
  } else
    *localmesh = MED_TRUE;

  *meshnumdt=MED_NO_DT;
  *meshnumit=MED_NO_IT;

  _ret = 0;

 ERROR:

  if (_datagroup1>0)            if (_MEDdatagroupFermer(_datagroup1) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
    ISCRUTE_id(_datagroup1);
  }

  if (_meshgid>0)            if (_MEDdatagroupFermer(_meshgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_meshpath);
    ISCRUTE_id(_meshgid);
  }

  if (_linkgid>0)            if (_MEDdatagroupFermer(_linkgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_linkpath);
    ISCRUTE_id(_linkgid);
  }

  va_end(params);
  *fret = _ret;
  return;

}
Exemplo n.º 8
0
void
_MEDequivalenceInfo30(int dummy, ...)
{


  med_idt  _eqid=0;
  med_err  _ret=-1,_err=-1;
  char     _path[MED_TAILLE_EQS+2*MED_NAME_SIZE+2]=MED_EQS;
  char     _cstpname[2*MED_MAX_PARA+1]="";
  int      _num;
  int      _pathreflen=0;
  med_size _nstep=0,_nocstpncorrespondence=0;


  MED_VARGS_DECL(const, med_idt      , , fid                    );
  MED_VARGS_DECL(const, char * , const , meshname               );
  MED_VARGS_DECL(const, int          , , equivit                );
  MED_VARGS_DECL(, char *, const       , equivname              );
  MED_VARGS_DECL(, char *, const       , equivdescription       );
  MED_VARGS_DECL(, med_int *, const    , nstep                  );
  MED_VARGS_DECL(, med_int *, const    , nocstpncorrespondence  );
  MED_VARGS_DECL(, med_err *                     ,, fret        );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt      , , fid                    );
  MED_VARGS_DEF(const, char * , const , meshname               );
  MED_VARGS_DEF(const, int          , , equivit                );
  MED_VARGS_DEF(, char *, const       , equivname              );
  MED_VARGS_DEF(, char *, const       , equivdescription       );
  MED_VARGS_DEF(, med_int *, const    , nstep                  );
  MED_VARGS_DEF(, med_int *, const    , nocstpncorrespondence  );
  MED_VARGS_DEF(, med_err *                     ,, fret        );

  _num=equivit-1;

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  /*
   * On recupere le nom de l'equivalence
   */
  strcat(_path,meshname);
  _pathreflen=strlen(_path);
  if ( _MEDobjectGetName(fid, _path ,_num, equivname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(equivit);
    goto ERROR;
  }

  _path[_pathreflen]='/';
  strncpy(&_path[_pathreflen+1],equivname,MED_NAME_SIZE+1);
  if ((_eqid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_EQUIVALENCE_MSG);
    SSCRUTE(_path);
    goto ERROR;
  }


  /*
   * L'attribut DES
   */
  if ( _MEDattrStringLire(_eqid,MED_NOM_DES,MED_COMMENT_SIZE,equivdescription) < 0) {
      MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
      SSCRUTE(equivname);SSCRUTE(_path);SSCRUTE(MED_NOM_DES);
      goto ERROR;
  }

  /*
   * Nombre d'$(0!;(Btapes de calcul
   */
  if (_MEDnObjects(_eqid,".",&_nstep) <0) {
    MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_path);
    goto ERROR;
  }
  *nstep = (med_int) _nstep;


  /*
   * Nombre de correspondence pour <MED_NO_DT,MED_NO_IT>
   */

  _MEDgetComputationStepName(MED_SORT_DTIT,MED_NO_DT,MED_NO_IT,_cstpname);


  if ( (_err=_MEDnObjects(_eqid, _cstpname, &_nocstpncorrespondence)) < 0 )
    if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
      MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_cstpname);
      goto ERROR;
    }

  *nocstpncorrespondence = (med_int) _nocstpncorrespondence;


 _ret = 0;

 ERROR:


 if (_eqid>0)         if (_MEDdatagroupFermer(_eqid) < 0) {
   MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,&_path[_pathreflen]);
   ISCRUTE_id(_eqid);
 }

  va_end(params);
  *fret = _ret;

  return;
}
void
_MEDfield23ComputingStepMeshInfo30(int dummy,...)
{


  med_err _ret=-1;
  med_idt _gid=0,_datagroup1=0,_meshgid=0,_linkgid=0;
  int     _num;
  char    _datagroupname1[2*MED_MAX_PARA+1]="";
  char    _path          [(MED_FIELD_GRP_SIZE+MED_NAME_SIZE+1)+2*MED_MAX_PARA+1]=MED_FIELD_GRP;
  char    _meshpath [MED_MESH_GRP_SIZE+MED_NAME_SIZE+1]=MED_MESH_GRP;
  char    _linkpath [MED_TAILLE_LIENS+MED_NAME_SIZE+1]=MED_LIENS;
  char    _cstpname[2*MED_MAX_PARA+1]="";


  MED_VARGS_DECL(const, med_idt       , , fid       );
  MED_VARGS_DECL(const, char * , const  , fieldname );
  MED_VARGS_DECL(const, int           , , csit      );
  MED_VARGS_DECL(, med_int *, const     , numdt     );
  MED_VARGS_DECL(, med_int *, const     , numit     );
  MED_VARGS_DECL(, med_float *, const   , dt        );
  MED_VARGS_DECL(, med_int *, const     , nmesh     );
  MED_VARGS_DECL(, char *, const        , meshname  );
  MED_VARGS_DECL(, med_bool *, const    , localmesh );
  MED_VARGS_DECL(, med_int *, const     , meshnumdt );
  MED_VARGS_DECL(, med_int *, const     , meshnumit );
  MED_VARGS_DECL(, med_err *           ,, fret      );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt       , , fid       );
  MED_VARGS_DEF(const, char * , const  , fieldname );
  MED_VARGS_DEF(const, int           , , csit      );
  MED_VARGS_DEF(, med_int *, const     , numdt     );
  MED_VARGS_DEF(, med_int *, const     , numit     );
  MED_VARGS_DEF(, med_float *, const   , dt        );
  MED_VARGS_DEF(, med_int *, const     , nmesh     );
  MED_VARGS_DEF(, char *, const        , meshname  );
  MED_VARGS_DEF(, med_bool *, const    , localmesh );
  MED_VARGS_DEF(, med_int *, const     , meshnumdt );
  MED_VARGS_DEF(, med_int *, const     , meshnumit );
  MED_VARGS_DEF(, med_err *           ,, fret      );

  _num=csit-1;

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  /*
   * On construit le nom du datagroup
   */
  strcat(_path,fieldname);

  /* Lecture de l'attribut MED_NOM_MAI */
  if ( _MEDattributeStringRdByName(fid,_path,MED_NOM_MAI,MED_NAME_SIZE,meshname) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
    SSCRUTE(_path);SSCRUTE(MED_NOM_MAI);SSCRUTE(meshname);
    goto ERROR;
  }

  /*
   * On recupere le nom de la séquence de calcul 
   */
  if ( _MEDobjectGetName(fid, _path ,_num, _cstpname) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(_num);
    goto ERROR;
  }

  strcat(_path,"/");
  strcat(_path,_cstpname);

  if ((_gid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
    goto ERROR;
  }

  /*
   * Lecture des attributs
   */

  if (_MEDattrEntierLire(_gid,MED_NOM_NDT,(med_int*) numdt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
    SSCRUTE(_path);ISCRUTE(*numdt);goto ERROR;
  }

  if (_MEDattrFloatLire(_gid,MED_NOM_PDT,(med_float*) dt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_PDT);
    SSCRUTE(_path);RSCRUTE(*dt);goto ERROR;
  }

  if (_MEDattrEntierLire(_gid,MED_NOM_NOR,(med_int*) numit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);
    SSCRUTE(_path);ISCRUTE(*numit);goto ERROR;
  }

  if (_MEDattrEntierLire(_gid,MED_NOM_RDT,(med_int*) meshnumdt) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_RDT);
    SSCRUTE(_path);ISCRUTE(*meshnumdt);goto ERROR;
  }

  if (_MEDattrEntierLire(_gid,MED_NOM_ROR,(med_int*) meshnumit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ROR);
    SSCRUTE(_path);ISCRUTE(*meshnumit);goto ERROR;
  }


 /* Maillage local ou distant */
  strcat(_meshpath,meshname);

  /* Le maillage est il distant */
  if ( (_meshgid = _MEDdatagroupOuvrir(fid,_meshpath)) < 0)  {

    /* Verifie que le maillage est bien référencé comme distant */
    strcat(_linkpath,meshname);
    if ((_linkgid = _MEDdatagroupOuvrir(fid,_linkpath)) < 0) {
/*       MED_ERR_(_ret,MED_ERR_DOESNTEXIST,MED_ERR_MESH,MED_ERR_FIELD_MSG); */
/*       SSCRUTE(fieldname);SSCRUTE(_meshpath);SSCRUTE(_linkpath); */
/*       goto ERROR; */
      *localmesh = MED_FALSE;
    }
    *localmesh = MED_FALSE;
  } else
    *localmesh = MED_TRUE;

  *nmesh = 1;

  _ret = 0;

 ERROR:


  if (_gid>0)            if (_MEDdatagroupFermer(_gid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
    ISCRUTE_id(_gid);
  }
  if (_meshgid>0)            if (_MEDdatagroupFermer(_meshgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_meshpath);
    ISCRUTE_id(_meshgid);
  }

  if (_linkgid>0)            if (_MEDdatagroupFermer(_linkgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_linkpath);
    ISCRUTE_id(_linkgid);
  }

  va_end(params);
  *fret = _ret;
  return;
}
void _MEDequivalenceComputingStepInfo30(int dummy, ...) {


  med_err  _ret=-1,_err=-1;
  med_idt  _eqid=0,_datagroup1=0;
  int      _num;
  char     _cstppath[MED_TAILLE_EQS+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1]=MED_EQS;
  char     _cstpname[2*MED_MAX_PARA+1]="";
  med_size _ncorrespondence=0;

  MED_VARGS_DECL(const, med_idt      , , fid                    );
  MED_VARGS_DECL(const, char * , const , meshname               );
  MED_VARGS_DECL(const, char * , const , equivname              );
  MED_VARGS_DECL(const, int          , , csit                   );
  MED_VARGS_DECL(, med_int *, const    , numdt                  );
  MED_VARGS_DECL(, med_int *, const    , numit                  );
  MED_VARGS_DECL(, med_int *, const    , nocstpncorrespondence  );
  MED_VARGS_DECL(, med_err *                  ,, fret          );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt      , , fid                    );
  MED_VARGS_DEF(const, char * , const , meshname               );
  MED_VARGS_DEF(const, char * , const , equivname              );
  MED_VARGS_DEF(const, int          , , csit                   );
  MED_VARGS_DEF(, med_int *, const    , numdt                  );
  MED_VARGS_DEF(, med_int *, const    , numit                  );
  MED_VARGS_DEF(, med_int *, const    , nocstpncorrespondence  );
  MED_VARGS_DEF(, med_err *                  ,, fret          );

  _num = csit -1;

  /*
   * On inhibe le gestionnaire d'erreur
   */
  _MEDmodeErreurVerrouiller();

  strcat( _cstppath, meshname);
  strcat( _cstppath, "/");
  strcat( _cstppath, equivname);

  if ((_eqid = _MEDdatagroupOuvrir(fid,_cstppath)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_cstppath);
    ISCRUTE_id(_eqid);goto ERROR;
  }

  strcat( _cstppath, "/");
  /*
   * On recupere le nom de l'~tape de calcul
   */
  if ( _MEDobjectGetName(fid, _cstppath ,_num, &_cstppath[strlen(_cstppath)]) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_cstppath);ISCRUTE_int(csit);
    goto ERROR;
  }

  if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_cstppath)) < 0 ) {
    MED_ERR_(_ret,MED_ERR_DOESNTEXIST,MED_ERR_COMPUTINGSTEP,_cstppath);
    SSCRUTE(_cstppath);goto ERROR;
  }

  /*Cree ou ouvre l'attribut MED_NOM_NDT pour lecture */
  if ( _MEDattrEntierLire(_datagroup1,MED_NOM_NDT,numdt) < 0 ) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
    SSCRUTE(equivname);SSCRUTE(_cstppath);SSCRUTE(MED_NOM_NDT);
    ISCRUTE(*numdt);goto ERROR;
  }


  /*Cree ou ouvre l'attribut MED_NOM_PDT pour lecture */
/*   if ( _MEDattrFloatLire(_datagroup1,MED_NOM_PDT,dt) < 0) { */
/*     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_MESH_MSG); */
/*     SSCRUTE(equivname);SSCRUTE(_cstppath);SSCRUTE(MED_NOM_PDT); */
/*     RSCRUTE(*dt);goto ERROR; */
/*   } */

  /*Cree ou ouvre l'attribut MED_NOM_NOR pour lecture */
  if ( _MEDattrEntierLire(_datagroup1,MED_NOM_NOR,numit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
    SSCRUTE(equivname);SSCRUTE(_cstppath);SSCRUTE(MED_NOM_NOR);
    ISCRUTE(*numit); goto ERROR;
  }

  /*
   * Nombre de tableau d'~quivalence
   */
  if ((_err=_MEDnObjects(_datagroup1,".",&_ncorrespondence)) <0)
    if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
      MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,equivname);
      goto ERROR;
    }

  *nocstpncorrespondence = (med_int) _ncorrespondence;

  _ret = 0;
 ERROR:

  if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_cstppath);
    ISCRUTE_id(_datagroup1);
  }

  if (_eqid>0)     if (_MEDdatagroupFermer(_eqid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,meshname);
    ISCRUTE_id(_eqid);
  }

  va_end(params);
  *fret = _ret;
  return;
}
void _MEDsubdomainCorrespondenceSizeInfo30(int dummy, ...) {


  med_err  _ret=-1;
  med_idt  _datagroup1=0,_dataset=0;
  int      _num;
  char     _path[MED_TAILLE_JNT+2*MED_NAME_SIZE+2+2*MED_MAX_PARA+1+4*MED_TAILLE_NOM_ENTITE+4]=MED_JNT;
  char     _datagroupname1[2*MED_TAILLE_NOM_ENTITE+2]="";
  char     _cstpname[2*MED_MAX_PARA+1]="";
  med_sorting_type  _sortingtype=0;
  med_int   _intlocalentitype;
  med_int   _intlocalgeotype;
  med_int   _intremoteentitype;
  med_int   _intremotegeotype;


  MED_VARGS_DECL(const, med_idt              , , fid            );
  MED_VARGS_DECL(const, char * , const         , meshname       );
  MED_VARGS_DECL(const, char * , const         , jointname      );
  MED_VARGS_DECL(const, med_int              , , numdt          );
  MED_VARGS_DECL(const, med_int              , , numit          );
  MED_VARGS_DECL(const, int                  , , corit          );
  MED_VARGS_DECL(, med_entity_type   *, const  , localentitype  );
  MED_VARGS_DECL(, med_geometry_type *, const  , localgeotype   );
  MED_VARGS_DECL(, med_entity_type   *, const  , remoteentitype );
  MED_VARGS_DECL(, med_geometry_type *, const  , remotegeotype  );
  MED_VARGS_DECL(, med_int *, const            , nentitycor     );
  MED_VARGS_DECL(, med_err *                  ,, fret           );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt              , , fid            );
  MED_VARGS_DEF(const, char * , const         , meshname       );
  MED_VARGS_DEF(const, char * , const         , jointname      );
  MED_VARGS_DEF(const, med_int              , , numdt          );
  MED_VARGS_DEF(const, med_int              , , numit          );
  MED_VARGS_DEF(const, int                  , , corit          );
  MED_VARGS_DEF(, med_entity_type   *, const  , localentitype  );
  MED_VARGS_DEF(, med_geometry_type *, const  , localgeotype   );
  MED_VARGS_DEF(, med_entity_type   *, const  , remoteentitype );
  MED_VARGS_DEF(, med_geometry_type *, const  , remotegeotype  );
  MED_VARGS_DEF(, med_int *, const            , nentitycor     );
  MED_VARGS_DEF(, med_err *                  ,, fret           );

  _num = corit -1;

  /*
   * On inhibe le gestionnaire d'erreur
   */

  _MEDmodeErreurVerrouiller();


  if ( MEDmeshSortingTypeRd(fid,meshname,&_sortingtype) < 0 ) {
    MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API," MEDmeshSortingTypeRd");
    SSCRUTE(meshname);ISCRUTE_int(_sortingtype);goto ERROR;
  }


  strcat( _path, meshname);
  strcat( _path, "/");
  strcat( _path, jointname);
  strcat( _path, "/");
  _MEDgetComputationStepName(_sortingtype,numdt,numit,&_path[strlen(_path)]);
  strcat( _path, "/");

  /*
   * On recupere le nom de <localentitype>[.<localgeotype>].<remoteentitype>[.<remotegeotype>]
   */
  if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit);
    goto ERROR;
  }

  if ( (_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0 ) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
    goto ERROR;
  }

  /*lecture localentitype et localgeotype */
  if (_MEDattrEntierLire(_datagroup1,MED_NOM_ENT,&_intlocalentitype) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
    ISCRUTE(_intlocalentitype);goto ERROR;
  }
  *localentitype = (med_entity_type) _intlocalentitype;

  if (_MEDattrEntierLire(_datagroup1,MED_NOM_GEO,&_intlocalgeotype) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
    ISCRUTE(_intlocalgeotype);goto ERROR;
  }
  *localgeotype = (med_geometry_type) _intlocalgeotype;

  /*lecture remoteentitype et remotegeotype */
  if (_MEDattrEntierLire(_datagroup1,MED_NOM_END,&_intremoteentitype) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
    ISCRUTE(_intremoteentitype);goto ERROR;
  }
  *remoteentitype = (med_entity_type) _intremoteentitype;

  if (_MEDattrEntierLire(_datagroup1,MED_NOM_GED,&_intremotegeotype) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
    ISCRUTE(_intremotegeotype);goto ERROR;
  }
  *remotegeotype = (med_geometry_type) _intremotegeotype;

  if ((_dataset = _MEDdatasetOuvrir(_datagroup1,MED_NOM_COR)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATASET,MED_NOM_COR);
    SSCRUTE(_path);
    goto ERROR;
  }

  if ( _MEDattrEntierLire(_dataset,MED_NOM_NBR,nentitycor) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_SUBDOMAINJOINT_MSG);
    SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentitycor);
    goto ERROR;
  }

  _ret = 0;
 ERROR:

  if (_dataset>0)     if (_MEDdatasetFermer(_dataset) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATASET,MED_NOM_COR);
    ISCRUTE_id(_dataset);
  }

  if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
    ISCRUTE_id(_datagroup1);
  }

  va_end(params);
  *fret = _ret;
  return;
}
med_err _MEDfieldComputingStepCheck236(med_idt fid, const char * const fieldname,
				       med_size * const ncpst,
				       med_bool checkmultiplemesh, med_bool * const multiplemesh,
				       med_bool checkmeshname, med_bool * const samedefaultmeshname)
{
  med_err   _ret=-1,_err=0;
  med_idt   _cstpid=0;
  char      _ent_geo       [2*MED_TAILLE_NOM_ENTITE+2]="";
  char      _path          [(MED_TAILLE_CHA+MED_TAILLE_NOM+1)+
			    (2*MED_TAILLE_NOM_ENTITE+1)+1+(2*MED_MAX_PARA)+1]=MED_CHA;
  int       _pathlen=0;
  med_size  _i=0,_n=0;
  med_size  _prevnseq=0,_nseq =0;
  med_string_itdatas _itdatas;

  if( _MEDfieldChecked(fid,fieldname) ) goto SORTIE;

  /*
   * On construit le nom du datagroup
   */
  strcat(_path,fieldname);

  /*
   * On compte le nombre de couple (entitytype,geotype)
   */
  if ((_err=_MEDnObjects(fid,_path,&_n)) <0)
    if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
      MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,MED_NOM_ENT "." MED_NOM_GEO);
      goto ERROR;
    }

  _pathlen =  strlen(_path);

  /*
   * Pour tous les couples (entitytype,geotype)
   * on vérifie qu'il y a le même nombre de séquences de calcul (sinon le fichier n'est pas conforme au modèle 2.3.6)
   * Ceci est une vérification partielle que le modèle 2.3.6 a été respecté :
   *  - Il faudrait normalement vérifier qu'il s'agit aussi des mêmes séquences de calcul
   * Etant donnée la faible utilisation du usecase multimaillages et le coût de traitement associé à cette
   * vérification complémentaire, celle-ci n'est pas faite.
   * Par contre, il est necessaire de savoir si plusieurs noms de maillages
     apparaissent ou si un seul est utilisé (ici on vérifie uniquement que le maillage par défaut est le même)
   */

  /*L'attribut dont il faut vérifier la valeur pour toutes les étapes de calcul de tous les
   couple (entitytype,geotype) est MED_NOM_MAI*/
  if (checkmeshname) _MEDcheckAttributeStringInit(&_itdatas,MED_NOM_MAI,MED_TAILLE_NOM);

  for (_i=0; _i <_n; ++_i ) {

    /*
     * On recupere le nom du couple (entitytype,geotype) n°_i
     */
    if ( _MEDobjectGetName(fid, _path ,_i, _ent_geo) < 0 ) {
      MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
      SSCRUTE(_path); goto ERROR;
    }

/*     SSCRUTE(_path); */
    strcpy(&_path[_pathlen],"/");
    strcat(_path,_ent_geo);
/*     SSCRUTE(_path); */

/*     ISCRUTE(_prevnseq); */
/*     ISCRUTE(_nseq); */

    /*
     * On vérifie qu'il y a le même nombre de séquences de calcul
     * que pour le couple (entitytype,geotype) précédent
     * on le vérifie pas que ce sont bien les mêmes
     */
    if ( _prevnseq != _nseq ) {
      MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_ent_geo);
      ISCRUTE_size(_prevnseq);ISCRUTE_size(_nseq);ISCRUTE_size(_i);
      goto ERROR;
    }

    /*
     * On compte le nombre de séquences de calcul pour le couple (entitytype,geotype) n°_i
     */
    if ((_err=_MEDnObjects(fid,_path,&_nseq)) <0)
      if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
	MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_ent_geo);
	goto ERROR;
      }

    _prevnseq = _nseq;

    if (checkmeshname || checkmultiplemesh) {
      if ((_cstpid = _MEDdatagroupOuvrir(fid,_path)) < 0) {
	MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
	goto ERROR;
      }
    }

    if (checkmeshname) {
      /*
       * On vérifie que le nom du maillage par défaut est le même pour toutes
       * les étapes de calcul de tous les couples (entitytype,geotype)
       */
      if (_MEDiterate(_cstpid, _MEDcheckAttributeStringFunc, &_itdatas ) < 0) {
	MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_ATTRIBUTE,MED_ERR_VALUE_MSG);
	SSCRUTE(_itdatas.attvalprec); SSCRUTE(_itdatas.attval); goto ERROR;
      }
    }

    /*
     * On vérifie qu'un seul  maillage est utilisé pour toutes
     * les étapes de calcul de tous les couples (entitytype,geotype)
     */
    if (checkmultiplemesh) {
      if (_MEDiterate(_cstpid, _MEDchecknSublinkFunc, multiplemesh ) < 0) {
	MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,MED_ERR_NBR_MSG MED_ERR_MESH_MSG);
	SSCRUTE(_path);goto ERROR;
      }
    }

    if (_cstpid>0) if (_MEDdatagroupFermer(_cstpid) < 0) {
      MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
      ISCRUTE_id(_cstpid);
    }

    _path[_pathlen]='\0';
  }

  if (checkmeshname) _MEDcheckAttributeStringFin(&_itdatas);

  *ncpst = _nseq;

  _MEDfieldCheckedSetCache(fid, fieldname,MED_TRUE);

 SORTIE:

 _ret = 0;

 ERROR:

  return _ret;

}
Exemplo n.º 13
0
void
_MEDfieldInfoByName236(int dummy, ...) {


  med_err  _ret=-1,_err=-1;
  med_idt  _fieldgid=0,_meshgid=0,_linkgid=0;
  char     _fieldpath[MED_TAILLE_CHA+MED_TAILLE_NOM+1]=MED_CHA;
  char     _meshpath [MED_TAILLE_MAA+MED_TAILLE_NOM+1]=MED_MAA;
  char     _linkpath [MED_TAILLE_LIENS+MED_TAILLE_NOM+1]=MED_LIENS;
  med_size _ncstp=0;
  med_int  _n=0;
  med_int  _intfieldtype=0;
  char     _meshrefpath236[(2*MED_TAILLE_NOM_ENTITE+1)+1+ (2*MED_MAX_PARA)+1]="";


  MED_VARGS_DECL(const, med_idt          , , fid           );
  MED_VARGS_DECL(const, char * , const     , fieldname     );
  MED_VARGS_DECL(, char *, const           , meshname      );
  MED_VARGS_DECL(, med_bool *, const       , localmesh     );
  MED_VARGS_DECL(, med_field_type *, const , fieldtype     );
  MED_VARGS_DECL(, char *, const           , componentname );
  MED_VARGS_DECL(, char *, const           , componentunit );
  MED_VARGS_DECL(, char *, const           , dtunit        );
  MED_VARGS_DECL(, med_int *, const        , ncstp      );
  MED_VARGS_DECL(, med_err *              ,, fret          );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt          , , fid           );
  MED_VARGS_DEF(const, char * , const     , fieldname     );
  MED_VARGS_DEF(, char *, const           , meshname      );
  MED_VARGS_DEF(, med_bool *, const       , localmesh     );
  MED_VARGS_DEF(, med_field_type *, const , fieldtype     );
  MED_VARGS_DEF(, char *, const           , componentname );
  MED_VARGS_DEF(, char *, const           , componentunit );
  MED_VARGS_DEF(, char *, const           , dtunit        );
  MED_VARGS_DEF(, med_int *, const        , ncstp      );
  MED_VARGS_DEF(, med_err *              ,, fret          );

  /*
   * On inhibe le gestionnaire d'erreur HDF 5
   */
  _MEDmodeErreurVerrouiller();

  strcat(_fieldpath,fieldname);

  if ((_fieldgid = _MEDdatagroupOuvrir(fid,_fieldpath)) < 0) {
    MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_fieldpath);
    goto ERROR;
  }

  /* Lecture de l'attribut MED_NOM_NCO */
  if ( _MEDattrEntierLire(_fieldgid,MED_NOM_NCO,&_n) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NCO);
    SSCRUTE(_fieldpath);goto ERROR;
  }

  /* Lecture de l'attribut MED_NOM_TYP */
  if ( _MEDattrEntierLire(_fieldgid,MED_NOM_TYP,&_intfieldtype) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
    SSCRUTE(fieldname);SSCRUTE(MED_NOM_TYP);
    goto ERROR;
  }
  *fieldtype = (med_field_type) (_intfieldtype);


  /*
   * Les infos sur les composantes du champ
   */
  if (_MEDattrStringLire(_fieldgid,MED_NOM_NOM,_n*MED_TAILLE_PNOM,
			 componentname) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
    SSCRUTE(fieldname);SSCRUTE(_fieldpath);SSCRUTE(MED_NOM_NOM);
    SSCRUTE(componentname);goto ERROR;
  }

  if (_MEDattrStringLire(_fieldgid,MED_NOM_UNI,_n*MED_TAILLE_PNOM,
			 componentunit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
    SSCRUTE(fieldname);SSCRUTE(_fieldpath);SSCRUTE(MED_NOM_UNI);
    SSCRUTE(componentunit);goto ERROR;
  }


  /*
   * On recupere le nom du premier couple (entitytype,geotype)
   */
  if ( _MEDobjectGetName(_fieldgid, "." , 0, _meshrefpath236) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,".");
    SSCRUTE(_meshrefpath236); goto ERROR;
  }

  /* Nombre d'étapes de calcul
   * La gestion d'une incohérence sur le nombre de séquences de calcul par couple (entitytype,geotype)
   * se fait à partir des appels :
   *  MEDfieldnProfile,MEDfieldnValue,MEDfieldnValueWithProfile
   */
  if ( (_err=_MEDnObjects(_fieldgid,_meshrefpath236,&_ncstp)) <0)
    if ( _err == (MED_ERR_COUNT + MED_ERR_DATAGROUP) ) {
      MED_ERR_(_ret,MED_ERR_COUNT,MED_ERR_DATAGROUP,_fieldpath);
      goto ERROR;
    }
  *ncstp = (med_int) _ncstp;

  /*
   * On recupere le nom de maillage par défaut du premier couple (entitytype,geotype)
   * La gestion des erreurs multimaillage 2.3.6 se fait à partir des appels :
   * MEDfieldnProfile,MEDfieldnValue,MEDfieldnValueWithProfile
   */
  strcat(_meshrefpath236,"/");
  if ( _MEDobjectGetName(_fieldgid, _meshrefpath236 , 0, &_meshrefpath236[strlen(_meshrefpath236)]) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_meshrefpath236);
    goto ERROR;
  }


  /* Lecture de l'attribut MED_NOM_UNI */
  if ( _MEDattributeStringRdByName(_fieldgid,_meshrefpath236,MED_NOM_UNI,MED_TAILLE_PNOM,dtunit) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
    SSCRUTE(fieldname);SSCRUTE(_meshrefpath236);SSCRUTE(MED_NOM_UNI);
    SSCRUTE(dtunit);goto ERROR;
  }

  /* Lecture de l'attribut MED_NOM_MAI */
  if ( _MEDattributeStringRdByName(_fieldgid,_meshrefpath236,MED_NOM_MAI,MED_NAME_SIZE,meshname) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
    SSCRUTE(fieldname);SSCRUTE(_meshrefpath236);SSCRUTE(MED_NOM_MAI);SSCRUTE(meshname);
    goto ERROR;
  }

 /* Maillage local ou distant */
  strcat(_meshpath,meshname);

  /* Le maillage est il distant */
  if ( (_meshgid = _MEDdatagroupOuvrir(fid,_meshpath)) < 0)  {

    /* Verifie que le maillage est bien référencé comme distant */
    strcat(_linkpath,meshname);
    if ((_linkgid = _MEDdatagroupOuvrir(fid,_linkpath)) < 0) {
/*       MED_ERR_(_ret,MED_ERR_DOESNTEXIST,MED_ERR_MESH,MED_ERR_FIELD_MSG); */
/*       SSCRUTE(fieldname);SSCRUTE(_meshpath);SSCRUTE(_linkpath); */
/*       goto ERROR; */
      *localmesh = MED_FALSE;
    }
    *localmesh = MED_FALSE;
  } else
    *localmesh = MED_TRUE;


  _ret = 0;

 ERROR:


  if (_fieldgid>0)            if (_MEDdatagroupFermer(_fieldgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_fieldpath);
    ISCRUTE_id(_fieldgid);
  }

  if (_meshgid>0)            if (_MEDdatagroupFermer(_meshgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_meshpath);
    ISCRUTE_id(_meshgid);
  }

  if (_linkgid>0)            if (_MEDdatagroupFermer(_linkgid) < 0) {
    MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_linkpath);
    ISCRUTE_id(_linkgid);
  }

  va_end(params);
  *fret = _ret;
  return;
}
void _MEDequivalenceCorrespondenceSizeInfo236( int dummy, ...) {


  med_err   _ret=-1,_err=-1;
  char      _path[MED_TAILLE_MAA+MED_TAILLE_EQS+2*MED_TAILLE_NOM+1+
		 2*MED_TAILLE_NOM_ENTITE+1+1]=MED_MAA;
  char      _entgeoname[2*MED_TAILLE_NOM_ENTITE+2]="";
  med_size  _nocstpncorrespondence=0;
  med_int   _intentitytype;
  med_int   _intgeotype;
  int       _num;

  MED_VARGS_DECL(const, med_idt              , , fid      );
  MED_VARGS_DECL(const, char * , const         , meshname );
  MED_VARGS_DECL(const, char * , const         , equivname);
  MED_VARGS_DECL(const, med_int              , , numdt    );
  MED_VARGS_DECL(const, med_int              , , numit    );
  MED_VARGS_DECL(const, int                  , , corit    );
  MED_VARGS_DECL(, med_entity_type *, const    , entitype );
  MED_VARGS_DECL(, med_geometry_type*, const   , geotype  );
  MED_VARGS_DECL(, med_int *, const            , nentity  );
  MED_VARGS_DECL(, med_err *                  ,, fret     );

  va_list params;
  va_start(params,dummy);

  MED_VARGS_DEF(const, med_idt              , , fid      );
  MED_VARGS_DEF(const, char * , const         , meshname );
  MED_VARGS_DEF(const, char * , const         , equivname);
  MED_VARGS_DEF(const, med_int              , , numdt    );
  MED_VARGS_DEF(const, med_int              , , numit    );
  MED_VARGS_DEF(const, int                  , , corit    );
  MED_VARGS_DEF(, med_entity_type *, const    , entitype );
  MED_VARGS_DEF(, med_geometry_type*, const   , geotype  );
  MED_VARGS_DEF(, med_int *, const            , nentity  );
  MED_VARGS_DEF(, med_err *                  ,, fret     );

  _num = corit -1;

  if ( (numdt != MED_NO_DT) || (numit != MED_NO_IT) ) {
    MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_PARAMETER,"");
    ISCRUTE(numdt);ISCRUTE(numit); goto ERROR;
  }

  /*
   * On inhibe le gestionnaire d'erreur
   */
  _MEDmodeErreurVerrouiller();

  strcat(_path,meshname);
  strcat(_path,MED_EQS);
  strcat(_path,equivname);
  strcat(_path,"/");


  /*
   * On recupere le nom de <entitype>[.<geotype>]
   */
  if ( _MEDobjectGetName(fid, _path ,_num, &_path[strlen(_path)]) < 0 ) {
    MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);ISCRUTE_int(corit);
    goto ERROR;
  }

  if ( _MEDattributeNumRdByName(fid, _path, MED_NOM_ENT,MED_INTERNAL_INT,(unsigned char *)&_intentitytype) < 0 ) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_ENT);
    SSCRUTE(_path);ISCRUTE(_intentitytype);goto ERROR;
  }
  *entitype = (med_entity_type) _intentitytype;

  if ( _MEDattributeNumRdByName(fid, _path,MED_NOM_GEO,MED_INTERNAL_INT,(unsigned char *)&_intgeotype) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_GEO);
    SSCRUTE(_path);ISCRUTE(_intgeotype);goto ERROR;
  }
  *geotype = (med_geometry_type) _intgeotype;


  if (  _MEDattributeNumRdByName(fid, _path, MED_NOM_NBR,MED_INTERNAL_INT, (unsigned char *) nentity) < 0) {
    MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_EQUIVALENCE_MSG);
    SSCRUTE(_path);SSCRUTE(MED_NOM_NBR);ISCRUTE(*nentity);
    goto ERROR;
  }

  _ret = 0;
 ERROR:

  va_end(params);
  *fret = _ret;

  return;
}