_MEDfieldValueAdvancedRd30.c

Aller à la documentation de ce fichier.
00001 /*  This file is part of MED.
00002  *
00003  *  COPYRIGHT (C) 1999 - 2011  EDF R&D, CEA/DEN
00004  *  MED is free software: you can redistribute it and/or modify
00005  *  it under the terms of the GNU Lesser General Public License as published by
00006  *  the Free Software Foundation, either version 3 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  MED is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Lesser General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Lesser General Public License
00015  *  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 
00019 #include <med.h>
00020 #include <med_config.h>
00021 #include <med_outils.h>
00022 
00023 #include <string.h>
00024 #include <stdlib.h>
00025 
00026 void _MEDfieldValueAdvancedRd30(int dummy,...) {
00027   va_list params;
00028 
00029   med_err               _ret=-1;
00030   med_idt               _gid=0,_locgid=0, _datagroup1=0, _datagroup2=0, _datagroup3=0;
00031   med_int               _nbofconstituentpervalue=0,_nbofvaluesperentityfromloc=0;
00032   med_int               _nbofvaluesperentity=0,_profilearraysize=0;
00033   med_int               _nbofsectiongeotype=0,_nbofsectioncell=1;
00034   med_bool              _filterparameterexist=MED_FALSE;
00035   med_field_type        _fieldtype=0;
00036   med_int               _intfieldtype=0;
00037   med_geometry_type     _locgeotype=0,_sectiongeotype=0;
00038   med_int               _intlocgeotype=0;
00039   char _gidname           [MED_TAILLE_CHA+MED_NAME_SIZE+1]=MED_CHA;
00040   char _datagroupname1    [2*MED_MAX_PARA+1]="";
00041   char _datagroupname2    [2*MED_TAILLE_NOM_ENTITE+2]="";
00042   char _profilename       [MED_NAME_SIZE+1]=""; /*TODO DEFAULT? */
00043   char _meshname          [MED_NAME_SIZE+1]="";
00044   char _locgidname        [MED_TAILLE_GAUSS+MED_NAME_SIZE+1]="";
00045   char _sectionmeshname      [MED_NAME_SIZE+1]="";
00046   char _sectiongeotypename   [MED_NAME_SIZE+1]="";
00047   char _localizationname  [MED_NAME_SIZE+1]=""; /*TODO DEFAULT? */
00048   char _geotypename[MED_TAILLE_NOM_ENTITE+1]="", pfltmp[MED_NAME_SIZE+1]="";
00049   med_filter *               _filter           = NULL;
00050   med_filter                 _tmpfilter        = MED_FILTER_INIT;
00051   med_filter                 _paramfilter      = MED_FILTER_INIT;
00052   med_bool                   _chgt=MED_FALSE,_trsf=MED_FALSE;
00053 
00054   va_start(params,dummy);
00055 
00056   const med_idt               fid              = va_arg(params, const  med_idt);
00057   const char * const          fieldname        = va_arg(params, const  char * const );
00058   const med_int               numdt            = va_arg(params, const  med_int);
00059   const med_int               numit            = va_arg(params, const  med_int);
00060   const med_entity_type       entitytype       = va_arg(params, const  med_entity_type);
00061   const med_geometry_type     geotype          = va_arg(params, const  med_geometry_type);
00062   const char * const          meshname         = va_arg(params, const  char * const );
00063   const med_storage_mode      storagemode      = va_arg(params, const  med_storage_mode);
00064   const char * const          profilename      = va_arg(params, const  char * const );
00065   const med_switch_mode       switchmode       = va_arg(params, const  med_switch_mode);
00066   const med_int               componentselect  = va_arg(params, const  med_int);
00067   const med_filter* const     filter           = va_arg(params, const  med_filter* const );
00068   unsigned char* const        value            = va_arg(params,        unsigned char * const );
00069   med_err *                   fret             = va_arg(params, med_err *);
00070 
00071   if (filter) {
00072     _filter=(med_filter*)(filter); _filterparameterexist=MED_TRUE;
00073   }
00074   else {
00075     _filter=&_tmpfilter;
00076 /*   (*_filter).nbofentity              = nbofentity; */
00077 /*   (*_filter).nbofvaluesperentity     = nbofvaluesperentity; */
00078 /*   (*_filter).nbofconstituentpervalue = nbofconstituentpervalue; */
00079     (*_filter).constituentselect       = componentselect;
00080     (*_filter).switchmode              = switchmode;
00081     (*_filter).storagemode             = storagemode;
00082     strcpy((*_filter).profilename,profilename);
00083 /*   (*_filter).profilearraysize        = profilearraysize; */
00084   }
00085 
00086   /*
00087    * On inhibe le gestionnaire d'erreur HDF 5
00088    */
00089   _MEDmodeErreurVerrouiller();
00090 
00091   /*
00092    * Si le Data Group cha n'existe pas => erreur
00093    */
00094   strcat(_gidname,fieldname);
00095 
00096   /* Lecture de l'attribut MED_NOM_MAI */
00097   if ( _MEDattributeStringRdByName(fid,_gidname,MED_NOM_MAI,MED_NAME_SIZE,_meshname) < 0) {
00098     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00099     SSCRUTE(_gidname);SSCRUTE(MED_NOM_MAI);SSCRUTE(_meshname);
00100     goto ERROR;
00101   }
00102 
00103   if (strlen(meshname) )
00104     if (strcmp(_meshname,meshname) ) {
00105       MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_PARAMETER,"meshname");
00106       SSCRUTE(_gidname);SSCRUTE(_meshname);SSCRUTE(meshname);
00107       goto ERROR;
00108     }
00109 
00110   if ((_gid = _MEDdatagroupOuvrir(fid,_gidname)) < 0) {
00111     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_FIELD_MSG);
00112     SSCRUTE(fieldname);SSCRUTE(_gidname); goto ERROR;
00113   }
00114 
00115   /* Lecture de l'attribut MED_NOM_NCO */
00116   /* Coh�rence de l'attribut MED_NOM_NCO avec le filtre*/
00117   if (_MEDattrEntierLire(_gid,MED_NOM_NCO,&_nbofconstituentpervalue) < 0) {
00118     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00119     SSCRUTE(fieldname);SSCRUTE(MED_NOM_NCO);goto ERROR;
00120   }
00121 
00122   if (_filterparameterexist) {
00123     if ((*_filter).nbofconstituentpervalue != _nbofconstituentpervalue ) {
00124       MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_ATTRIBUTE,MED_ERR_VALUE_MSG);
00125       ISCRUTE((*_filter).nbofconstituentpervalue); ISCRUTE(_nbofconstituentpervalue );
00126       goto ERROR;
00127     }
00128   } else {
00129     (*_filter).nbofconstituentpervalue = _nbofconstituentpervalue;
00130   }
00131 
00132   /* Lecture de l'attribut MED_NOM_TYP */
00133   if ( _MEDattrEntierLire(_gid,MED_NOM_TYP,&_intfieldtype) < 0) {
00134     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00135     SSCRUTE(fieldname);SSCRUTE(MED_NOM_TYP);
00136     goto ERROR;
00137   }
00138   _fieldtype = (med_field_type) (_intfieldtype);
00139 
00140   /*
00141    *  Si le Data Group de niveau 1 <numdt>.<numit> n'existe pas => erreur
00142    */
00143 
00144   _MEDgetComputationStepName(MED_SORT_DTIT,numdt,numit,_datagroupname1);
00145 
00146   _datagroup1 = 0;
00147   if ( (_datagroup1 = _MEDdatagroupOuvrir(_gid,_datagroupname1)) < 0 ) {
00148     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,MED_ERR_FIELD_MSG);
00149     SSCRUTE(fieldname);SSCRUTE(_datagroupname1);goto ERROR;
00150   }
00151 
00152 
00153   /*
00154    * Si le Data Group  de niveau 2 <type_ent>[.<type_geo>] n'existe pas => erreur
00155    */
00156 
00157   if (_MEDgetEntityTypeName(_datagroupname2,entitytype) < 0) {
00158     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_ENTITY,MED_ERR_VALUE_MSG);
00159     ISCRUTE_int(entitytype);SSCRUTE(fieldname);goto ERROR;
00160   }
00161 
00162   if ( entitytype != MED_NODE ) {
00163 
00164     if ( entitytype == MED_STRUCT_ELEMENT ) {
00165       if ( MEDstructElementName(fid, geotype,_geotypename) < 0 ) {
00166         MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDstructElementName");
00167         ISCRUTE_int(geotype);goto ERROR;
00168       }
00169     } else {
00170       if ( _MEDgetGeometryTypeName(_geotypename,geotype) < 0) {
00171         MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_GEOMETRIC,MED_ERR_VALUE_MSG);
00172         ISCRUTE_int(geotype);SSCRUTE(fieldname);goto ERROR;
00173       }
00174     }
00175       strcat(_datagroupname2,".");
00176       strcat(_datagroupname2,_geotypename);
00177   }
00178   _datagroup2 = 0;
00179   if ( (_datagroup2 = _MEDdatagroupOuvrir(_datagroup1,_datagroupname2)) < 0) {
00180     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_datagroupname2);
00181     SSCRUTE(fieldname);goto ERROR;
00182   }
00183 
00184 
00185   /*
00186    * Ouvre le datagroup de niveau 3 <profilename>
00187    */
00188 
00189   /*MODEL : Il n'y a plus de datagroup de niveau 3 <maa> mais <profilename> */
00190 
00191   /* MODEL : d�placement de l'attribut MED_NOM_PFL */
00192   /*Cree ou ouvre  l'attribut MED_NOM_PFL   */
00193 
00194   NOFINALBLANK(profilename,ERROR);
00195 
00196   if ( strlen((*_filter).profilename) == 0 ) {  /* idem MED_NOPFL*/
00197 
00198     /* Ecriture de MED_NO_PROFILE_INTERNAL car le datagroup profil ne peut �tre ""*/
00199     strncpy(_profilename,MED_NO_PROFILE_INTERNAL,MED_NAME_SIZE+1);
00200     _profilearraysize = MED_UNDEF_SIZE;
00201   } else {
00202     strncpy(_profilename,(*_filter).profilename,MED_NAME_SIZE+1);
00203     _profilename[MED_NAME_SIZE]='\0'; /*On tronque les eventuels noms trop long*/
00204     if ( ( _profilearraysize = MEDprofileSizeByName( fid,_profilename) ) < 0 ) {
00205       MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,MED_ERR_FIELD_MSG);
00206       SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);
00207       SSCRUTE(_profilename);SSCRUTE("MEDprofileSizeByName");goto ERROR;
00208     }
00209   }
00210 
00211   /*INUTILE : le param�tre est positionn� dans  MEDfilterEntityCr */
00212   if (!_filterparameterexist) (*_filter).profilearraysize =  _profilearraysize;
00213 
00214 
00215   _datagroup3 = 0;
00216   if ((_datagroup3 = _MEDdatagroupOuvrir(_datagroup2,_profilename)) < 0) {
00217         MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_profilename);
00218         SSCRUTE(fieldname);SSCRUTE(_profilename);goto ERROR;
00219   }
00220 
00221   /*MODEL : MED_NOM_NBR nbelem qui contenait nbofentity*nbofvalueperentity mais pas nbofconstituentpervalue  */
00222   /*Lit le nombre d'entit�s */
00223   if ( _MEDattrEntierLire(_datagroup3,MED_NOM_NBR,&((*_filter).nbofentity)) < 0) {
00224     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00225     SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00226     SSCRUTE(MED_NOM_NBR);ISCRUTE((*_filter).nbofentity);goto ERROR;
00227   }
00228 
00229   /* Lecture du nom de la localization  */
00230   if ( _MEDattrStringLire(_datagroup3,MED_NOM_GAU,MED_NAME_SIZE,_localizationname) < 0) {
00231       MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00232       SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00233       SSCRUTE(MED_NOM_GAU);SSCRUTE(_localizationname);goto ERROR;
00234   }
00235 /*   SSCRUTE(_localizationname); */
00236 
00237   /* Lecture du nombre de points d'int�gration */
00238   /* Ecriture de l'attribut portant le nombre de points de gauss  */
00239   if ( _MEDattrEntierLire(_datagroup3,MED_NOM_NGA,&_nbofvaluesperentity) < 0) {
00240     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_FIELD_MSG);
00241     SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00242     SSCRUTE(MED_NOM_NGA);ISCRUTE(_nbofvaluesperentity);goto ERROR;
00243   }
00244 
00245 
00246   if (entitytype == MED_NODE_ELEMENT ) {
00247     if (strlen(_localizationname) ) {
00248       MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_PARAMETER,_localizationname);
00249       SSCRUTE(MED_NO_LOCALIZATION);ISCRUTE_int(entitytype);goto ERROR;
00250     }
00251     _nbofvaluesperentityfromloc = geotype % 100;
00252   } else if (! strcmp(_localizationname,MED_GAUSS_ELNO)) {
00253     /* Les points de Gauss sont d�finis sur les noeuds de l'element (mot cle) */
00254     /* le nombre de points de Gauss est egal au nombre de noeuds de l'element */
00255     _nbofvaluesperentityfromloc = geotype % 100;
00256   } else  if ( strlen( _localizationname) ) {
00257     strcpy(_locgidname,MED_GAUSS);
00258     strcat(_locgidname,_localizationname);
00259 
00260     if ((_locgid = _MEDdatagroupOuvrir(fid,_locgidname)) < 0) {
00261       MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_locgidname);
00262       goto ERROR;
00263     }
00264 
00265     if (_MEDattrEntierLire(_locgid,MED_NOM_NBR,&_nbofvaluesperentityfromloc) < 0) {
00266       MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_LOCALIZATION_MSG);
00267       SSCRUTE(_localizationname);SSCRUTE(MED_NOM_NBR);ISCRUTE(_nbofvaluesperentity);goto ERROR;
00268     }
00269 
00270 
00271     if ( entitytype == MED_STRUCT_ELEMENT ) {
00272 
00273       /*
00274        * Lecture de l'attribut MED_NOM_NOM (nom du maillage support de section)
00275        */
00276       if ( _MEDattrStringLire(_locgid,MED_NOM_NOM,MED_NAME_SIZE,_sectionmeshname) < 0) {
00277         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,_locgidname);
00278         SSCRUTE(MED_NOM_NOM);SSCRUTE(_sectionmeshname);
00279         goto ERROR;
00280       }
00281 
00282       if (strlen(_sectionmeshname) ) {
00283 
00284         if ( (_nbofsectiongeotype = MEDmeshnEntity(fid,_sectionmeshname,MED_NO_DT,MED_NO_IT,
00285                                             MED_CELL,MED_ALL_GEOTYPE,MED_CONNECTIVITY,MED_NODAL,
00286                                             &_chgt,&_trsf) )  < 0) {
00287           MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshnEntity");
00288           ISCRUTE(_nbofsectiongeotype);goto ERROR;
00289         }
00290 
00291         if ( (_nbofsectiongeotype != 1 ) ) {
00292           MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_RANGE,""); ISCRUTE(_nbofsectiongeotype); goto ERROR;
00293         }
00294 
00295 
00296         if ( MEDmeshEntityInfo( fid,_sectionmeshname,MED_NO_DT,MED_NO_IT,
00297                                 MED_CELL, 1, _sectiongeotypename,
00298                                 &_sectiongeotype ) < 0 ) {
00299           MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshEntityInfo");
00300           SSCRUTE(_sectiongeotypename);ISCRUTE_int(_sectiongeotype);goto ERROR;
00301         }
00302 
00303         if ( (_nbofsectioncell = MEDmeshnEntity(fid,_sectionmeshname,MED_NO_DT,MED_NO_IT,
00304                                                MED_CELL,_sectiongeotype,MED_CONNECTIVITY,MED_NODAL,
00305                                                &_chgt,&_trsf) )  < 0) {
00306           MED_ERR_(_ret,MED_ERR_CALL,MED_ERR_API,"MEDmeshnEntity");
00307           ISCRUTE(_nbofsectioncell);goto ERROR;
00308         }
00309       }
00310     }
00311 
00312     _nbofvaluesperentityfromloc*=_nbofsectioncell;
00313 
00314 
00315     if (_MEDattrEntierLire(_locgid,MED_NOM_GEO,&_intlocgeotype) < 0) {
00316       MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_ERR_LOCALIZATION_MSG);
00317       SSCRUTE(_localizationname);SSCRUTE(MED_NOM_GEO);ISCRUTE_int(_locgeotype);goto ERROR;
00318     }
00319     _locgeotype = (med_geometry_type) _intlocgeotype;
00320 
00321     if ( _locgeotype != geotype ) {
00322       MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_ATTRIBUTE,MED_ERR_LOCALIZATION_MSG);
00323       SSCRUTE(_localizationname);SSCRUTE(MED_NOM_GEO);ISCRUTE_int(_locgeotype);ISCRUTE_int(geotype);goto ERROR;
00324     }
00325   } else {
00326     _nbofvaluesperentityfromloc = 1;
00327   }
00328 
00329   if ( _nbofvaluesperentityfromloc != _nbofvaluesperentity ) {
00330     MED_ERR_(_ret,MED_ERR_NOTEQUAL,MED_ERR_ATTRIBUTE,MED_ERR_LOCALIZATION_MSG);
00331     SSCRUTE(_localizationname);SSCRUTE(MED_NOM_GEO);ISCRUTE(_nbofvaluesperentityfromloc);
00332     ISCRUTE(_nbofvaluesperentity);goto ERROR;
00333   }
00334 
00335   if (!_filterparameterexist) (*_filter).nbofvaluesperentity=_nbofvaluesperentity;
00336 
00337 
00338   /*Ce n'est plus un param�tre de sortie*/
00339   /* FT 108 : on r�tablit la bonne valeur externe de locname : MED_NOGAUSS */
00340 /*   if ( ! strcmp(locname,MED_NOGAUSSi)) */
00341 /*     strcpy(locname,MED_NOGAUSS); */
00342 
00343 
00344   if (!_filterparameterexist) {
00345 
00346     if ( MEDfilterEntityCr(fid, (*_filter).nbofentity,         (*_filter).nbofvaluesperentity,
00347                            (*_filter).nbofconstituentpervalue, (*_filter).constituentselect,
00348                            (*_filter).switchmode,              (*_filter).storagemode, 
00349                            (*_filter).profilename, MED_UNDEF_SIZE, NULL, &_paramfilter) < 0 ) {
00350       MED_ERR_(_ret,MED_ERR_CREATE,MED_ERR_FILTER,MED_ERR_INTERNAL_MSG);
00351       goto ERROR;
00352     }
00353 
00354 
00355     _filter = &_paramfilter;
00356   }
00357 
00358 #ifdef _DEBUG_
00359     ISCRUTE((*_filter).nbofentity              );
00360     ISCRUTE((*_filter).nbofvaluesperentity     );
00361     ISCRUTE((*_filter).nbofconstituentpervalue );
00362     ISCRUTE((*_filter).constituentselect       );
00363     ISCRUTE_int((*_filter).switchmode              );
00364     ISCRUTE((*_filter).filterarraysize         );
00365     ISCRUTE((*_filter).profilearraysize        );
00366     ISCRUTE_int((*_filter).storagemode             );
00367     SSCRUTE((*_filter).profilename             );
00368 #endif
00369   /*
00370    * Lecture du champ
00371    */
00372 
00373 
00374   switch(_fieldtype)
00375     {
00376     case MED_FLOAT64 :
00377       if ( _MEDdatasetRd(_datagroup3,MED_NOM_CO,MED_FLOAT64,_filter,value) < 0) {
00378         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_DATASET,MED_NOM_CO);
00379         SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00380 /*      ISCRUTE((void*)value); */
00381 /*      H5Eprint1(stderr); */
00382         goto ERROR;
00383       }
00384       break;
00385 
00386     case MED_INT32 :
00387 #if defined(HAVE_F77INT64)
00388       if ( _MEDdatasetRd(_datagroup3,MED_NOM_CO,MED_INT64,_filter,value) < 0) {
00389         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_DATASET,MED_NOM_CO);
00390         SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00391         goto ERROR;
00392       }
00393 #else
00394       if ( _MEDdatasetRd(_datagroup3,MED_NOM_CO,MED_INT32,_filter,value) < 0) {
00395         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_DATASET,MED_NOM_CO);
00396         SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00397         goto ERROR;
00398       }
00399 #endif
00400      break;
00401 
00402     case MED_INT64 :
00403 #if defined(HAVE_F77INT64)
00404       if ( _MEDdatasetRd(_datagroup3,MED_NOM_CO,MED_INT64,_filter,value) < 0) {
00405         MED_ERR_(_ret,MED_ERR_READ,MED_ERR_DATASET,MED_NOM_CO);
00406         SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00407         goto ERROR;
00408       }
00409 
00410 #else
00411      MESSAGE("Impossible de lire le dataset de type MED_INT64 sur une plateforme dépourvue de int64 !");
00412      goto ERROR;
00413 #endif
00414       break;
00415 
00416     default :
00417       MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_RANGE,MED_ERR_FIELD_MSG);
00418       SSCRUTE(fieldname);ISCRUTE_int(_fieldtype);
00419       goto ERROR;
00420     }
00421 
00422 
00423   /*
00424    * On ferme tout
00425    */
00426 
00427   _ret = 0;
00428 
00429  ERROR:
00430 
00431 /*   if ( pfluse ) { free(pfltab); free(pfltabtmp);} */
00432   if (!_filterparameterexist) {
00433     if ( MEDfilterClose(_filter) < 0 ) {
00434       MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_FILTER,MED_ERR_FIELD_MSG);
00435       SSCRUTE(fieldname);SSCRUTE(_datagroupname1);SSCRUTE(_datagroupname2);SSCRUTE(_profilename);
00436       goto ERROR;
00437     }
00438   }
00439 
00440   if (_datagroup3>0)     if (_MEDdatagroupFermer(_datagroup3) < 0) {
00441     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_profilename);
00442     ISCRUTE_id(_datagroup3);
00443   }
00444 
00445   if (_datagroup2>0)     if (_MEDdatagroupFermer(_datagroup2) < 0) {
00446     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_datagroupname2);
00447     ISCRUTE_id(_datagroup2);
00448   }
00449 
00450   if (_datagroup1>0)     if (_MEDdatagroupFermer(_datagroup1) < 0) {
00451     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_datagroupname1);
00452     ISCRUTE_id(_datagroup1);
00453   }
00454 
00455   if (_gid>0)            if (_MEDdatagroupFermer(_gid) < 0) {
00456     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_gidname);
00457     ISCRUTE_id(_gid);
00458   }
00459 
00460   if (_locgid>0)     if (_MEDdatagroupFermer(_locgid) < 0) {
00461     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_locgidname);
00462     ISCRUTE_id(_locgid);
00463   }
00464 
00465   va_end(params);
00466   *fret = _ret;
00467   return;
00468 }
00469 
00470 
00471 
00472 

Généré le Mon May 16 17:10:22 2011 pour MED fichier par  doxygen 1.6.1