_MEDfieldComputingStepInfo236.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 #include <string.h>
00023 
00024 #include <2.3.6/med23v30.h>
00025 #include <2.3.6/med23v30_proto.h>
00026 #include "2.3.6/med23v30_misc.h"
00027 
00028 void
00029 _MEDfieldComputingStepInfo236(int dummy,...)
00030 
00031 {
00032 
00033 
00034   med_err   _ret=-1,_err=0;
00035   med_size  _num;
00036 
00037   med_idt   _datagroup1=0;
00038   char      _datagroupname1[2*MED_MAX_PARA+1]         ="";
00039   char      _ent_geo       [2*MED_TAILLE_NOM_ENTITE+2]="";
00040   char      _path          [(MED_TAILLE_CHA+MED_TAILLE_NOM+1)+
00041                             (2*MED_TAILLE_NOM_ENTITE+1)+1+(2*MED_MAX_PARA)+1]=MED_CHA;
00042   med_size _ncpst=0;
00043   med_bool _checkmultiplemesh=MED_TRUE, _multiplemesh       =MED_FALSE;
00044   med_bool _checkmeshname    =MED_TRUE, _samedefaultmeshname=MED_FALSE;
00045 
00046 
00047   MED_VARGS_DECL(const, med_idt       , , fid       );
00048   MED_VARGS_DECL(const, char * , const  , fieldname );
00049   MED_VARGS_DECL(const, int           , , csit      );
00050   MED_VARGS_DECL(, med_int *, const     , numdt     );
00051   MED_VARGS_DECL(, med_int *, const     , numit     );
00052   MED_VARGS_DECL(, med_float *, const   , dt        );
00053   MED_VARGS_DECL(, med_err *           ,, fret      );
00054 
00055   va_list params;
00056   va_start(params,dummy);
00057 
00058   MED_VARGS_DEF(const, med_idt       , , fid       );
00059   MED_VARGS_DEF(const, char * , const  , fieldname );
00060   MED_VARGS_DEF(const, int           , , csit      );
00061   MED_VARGS_DEF(, med_int *, const     , numdt     );
00062   MED_VARGS_DEF(, med_int *, const     , numit     );
00063   MED_VARGS_DEF(, med_float *, const   , dt        );
00064   MED_VARGS_DEF(, med_err *           ,, fret      );
00065 
00066   _num=csit-1;
00067 
00068   /*
00069    * On inhibe le gestionnaire d'erreur HDF 5
00070    */
00071   _MEDmodeErreurVerrouiller();
00072 
00073   /*
00074    * On construit le nom du datagroup
00075    */
00076   strcat(_path,fieldname);
00077 
00078 /*   if ( _MEDfieldComputingStepCheck236(fid,  fieldname, */
00079 /*                                    &_ncpst, */
00080 /*                                    _checkmultiplemesh, &_multiplemesh, */
00081 /*                                    _checkmeshname,     &_samedefaultmeshname) < 0) { */
00082 /*     MED_ERR_(_ret,MED_ERR_INVALID,MED_ERR_FIELD,fieldname); */
00083 /*     goto ERROR; */
00084 /*   } */
00085 
00086 /*
00087  * On suppose que le modèle 2.3.6 est respecté :
00088  * Il y a les mêmes séquences de calcul pour tous les couples
00089  * (typent,typegeo)
00090  */
00091   if ( _MEDobjectGetName(fid, _path ,0, _ent_geo) < 0 ) {
00092     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
00093     SSCRUTE(_path); SSCRUTE(_ent_geo); goto ERROR;
00094   }
00095 
00096   strcat(_path,"/");
00097   strcat(_path,_ent_geo);
00098 
00099   if ( _MEDobjectGetName(fid, _path ,_num, _datagroupname1) < 0 ) {
00100     MED_ERR_(_ret,MED_ERR_ACCESS,MED_ERR_DATAGROUP,_path);
00101     SSCRUTE(_path); SSCRUTE(_ent_geo); goto ERROR;
00102   }
00103 
00104   strcat(_path,"/");
00105   strcat(_path,_datagroupname1);
00106 
00107   if ((_datagroup1 = _MEDdatagroupOuvrir(fid,_path)) < 0) {
00108     MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_DATAGROUP,_path);
00109     goto ERROR;
00110   }
00111 
00112 
00113   /*
00114    * Lecture des attributs
00115    */
00116 
00117   if (_MEDattrEntierLire(_datagroup1,MED_NOM_NDT,(med_int*) numdt) < 0) {
00118     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NDT);
00119     SSCRUTE(_path);ISCRUTE(*numdt);goto ERROR;
00120   }
00121 
00122   if (_MEDattrFloatLire(_datagroup1,MED_NOM_PDT,(med_float*) dt) < 0) {
00123     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_PDT);
00124     SSCRUTE(_path);RSCRUTE(*dt);goto ERROR;
00125   }
00126 
00127   if (_MEDattrEntierLire(_datagroup1,MED_NOM_NOR,(med_int*) numit) < 0) {
00128     MED_ERR_(_ret,MED_ERR_READ,MED_ERR_ATTRIBUTE,MED_NOM_NOR);
00129     SSCRUTE(_path);ISCRUTE(*numit);goto ERROR;
00130   }
00131 
00132 
00133   _ret = 0;
00134 
00135  ERROR:
00136 
00137 
00138   if (_datagroup1>0)            if (_MEDdatagroupFermer(_datagroup1) < 0) {
00139     MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_DATAGROUP,_path);
00140     ISCRUTE_id(_datagroup1);
00141   }
00142 
00143   va_end(params);
00144   *fret = _ret;
00145   return;
00146 
00147 }

Généré le Mon Nov 7 16:21:23 2011 pour MED fichier par  doxygen 1.6.1