test28.f

Aller à la documentation de ce fichier.
00001 C*  This file is part of MED.
00002 C*
00003 C*  COPYRIGHT (C) 1999 - 2015  EDF R&D, CEA/DEN
00004 C*  MED is free software: you can redistribute it and/or modify
00005 C*  it under the terms of the GNU Lesser General Public License as published by
00006 C*  the Free Software Foundation, either version 3 of the License, or
00007 C*  (at your option) any later version.
00008 C*
00009 C*  MED is distributed in the hope that it will be useful,
00010 C*  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 C*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 C*  GNU Lesser General Public License for more details.
00013 C*
00014 C*  You should have received a copy of the GNU Lesser General Public License
00015 C*  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016 C*
00017 
00018 C       ******************************************************************************
00019 C       * - Nom du fichier : test28.f
00020 C       *
00021 C       * - Description : lecture des maillages structures (grille cartesienne |
00022 C       *                 grille de-structuree ) dans le fichier test27.med
00023 C       *
00024 C       *****************************************************************************
00025         program test28
00026 C       
00027         implicit none
00028         include 'med.hf'
00029 C       
00030 C       
00031         integer       cret, fid,i,j
00032 C       ** la dimension du maillage                         **
00033         integer       mdim,nind,nmaa,type,quoi,rep,typmaa
00034         integer       edim,nstep,stype,atype, chgt, tsf
00035 C       ** nom du maillage de longueur maxi MED_TAILLE_NOM  **
00036         character*64  maa
00037 C       ** le nombre de noeuds                              **
00038         integer       nnoe 
00039 C       ** table des coordonnees                            **
00040         real*8        coo(8)
00041         character*16  nomcoo(2), unicoo(2)
00042         character*200 desc
00043         integer       strgri(2)
00044 C       ** grille cartesienne                               **
00045         integer       axe
00046         real*8        indice(4)
00047         character(16)  :: dtunit
00048         
00049 C
00050 C       On ouvre le fichier test27.med en lecture seule
00051         call mfiope(fid,'test27.med',MED_ACC_RDONLY, cret)
00052         if (cret .ne. 0 ) then
00053            print *,'Erreur ouverture du fichier'
00054            call efexit(-1)
00055         endif      
00056         print *,cret
00057         print *,'Ouverture du fichier test27.med'
00058 C       
00059 C       Combien de maillage ?
00060         call mmhnmh(fid,nmaa,cret)
00061         print *,cret
00062         if (cret .ne. 0 ) then
00063            print *,'Erreur lecture du nombre de maillage'
00064            call efexit(-1)
00065         endif      
00066 C
00067 C       On boucle sur les maillages et on ne lit que les
00068 C       maillages structures
00069         do 10 i=1,nmaa
00070 C
00071 C          On repere les maillages qui nous interessent
00072 C
00073            call mmhmii(fid,i,maa,edim,mdim,type,desc,
00074      &                 dtunit,stype,nstep,atype,
00075      &                 nomcoo,unicoo,cret)
00076            print *,cret
00077            if (cret .ne. 0 ) then
00078               print *,'Erreur lecture maillage info'
00079               call efexit(-1)
00080            endif      
00081            print *,'Maillage de nom : ',maa
00082            print *,'- Dimension : ',mdim
00083            if (type.eq.MED_STRUCTURED_MESH) then
00084               print *,'- Type : structure'
00085            else
00086               print *,'- Type : non structure'   
00087            endif
00088 C       
00089 C          On repere le type de la grille
00090            if (type.eq.MED_STRUCTURED_MESH) then
00091               call mmhgtr(fid,maa,typmaa,cret)
00092               print *,cret
00093               if (cret .ne. 0 ) then
00094                  print *,'Erreur lecture nature de la grille'
00095                  call efexit(-1)
00096               endif      
00097               if (typmaa.eq.MED_CARTESIAN_GRID) then
00098                  print *,'- Nature de la grille : cartesienne'
00099               endif
00100               if (typmaa.eq.MED_CURVILINEAR_GRID) then
00101                  print *,'- Nature de la grille : curviligne'
00102               endif
00103            endif
00104 C
00105 C          On regarde la structure et les coordonnees de la grille 
00106 C          MED_CURVILINEAR_GRID
00107            if ((typmaa.eq.MED_CURVILINEAR_GRID) 
00108      &           .and. (type.eq.MED_STRUCTURED_MESH)) then
00109 C
00110               call mmhnme(fid,maa,MED_NO_DT,MED_NO_IT,MED_NODE,
00111      &                    MED_NONE,MED_COORDINATE,MED_NO_CMODE,
00112      &                    chgt,tsf,nnoe,cret)
00113               print *,cret
00114               if (cret .ne. 0 ) then
00115                  print *,'Erreur lecture nombre de noeud'
00116                  call efexit(-1)
00117               endif      
00118               print *,'- Nombre de noeuds : ',nnoe
00119 C
00120               call mmhgsr(fid,maa,MED_NO_DT,MED_NO_IT,strgri,cret)
00121               
00122               print *,cret
00123               if (cret .ne. 0 ) then
00124                  print *,'Erreur lecture structure de la grille'
00125                  call efexit(-1)
00126               endif      
00127               print *,'- Structure de la grille : ',strgri
00128 C
00129               call mmhcor(fid,maa,MED_NO_DT,MED_NO_IT,
00130      &                    MED_FULL_INTERLACE,coo,cret) 
00131               print *,cret
00132               if (cret .ne. 0 ) then
00133                  print *,'Erreur lecture des coordonnees des noeuds'
00134                  call efexit(-1)
00135               endif      
00136               print *,'- Coordonnees :'
00137               do 20 j=1,nnoe*mdim
00138                  print *,coo(j)
00139  20           continue
00140            endif
00141 C
00142            if ((typmaa.eq.MED_CARTESIAN_GRID)
00143      &          .and. (type.eq. MED_STRUCTURED_MESH)) then
00144 C
00145               do 30 axe=1,mdim
00146                  if (axe.eq.1) then
00147                     quoi = MED_COORDINATE_AXIS1
00148                  endif
00149                  if (axe.eq.2) then
00150                     quoi = MED_COORDINATE_AXIS2
00151                  endif
00152                  if (axe.eq.3) then
00153                     quoi = MED_COORDINATE_AXIS3
00154                  endif
00155 C                Lecture de la taille de l'indice selon la dimension
00156 C                fournie par le parametre quoi
00157                  call mmhnme(fid,maa,MED_NO_DT,MED_NO_IT,MED_NODE,
00158      &                       MED_NONE,quoi,MED_NO_CMODE,
00159      &                       chgt,tsf,nind,cret)
00160                  print *,cret
00161                  if (cret .ne. 0 ) then
00162                     print *,'Erreur lecture taille indice'
00163                     call efexit(-1)
00164                  endif      
00165                  print *,'- Axe ',axe
00166                  print *,'- Nombre d indices : ',nind
00167 C                Lecture des indices des coordonnees de la grille
00168                  call mmhgcr(fid,maa,MED_NO_DT,MED_NO_IT,
00169      &                       axe,indice,cret)
00170                  print *,cret
00171                  if (cret .ne. 0 ) then
00172                     print *,'Erreur lecture indices de coordonnées'
00173                     call efexit(-1)
00174                  endif      
00175                  print *,'- Axe ', nomcoo
00176                  print *,'  unite : ',unicoo
00177                  do 40 j=1,nind
00178                     print *,indice(j)
00179  40              continue
00180  30           continue
00181 C
00182            endif
00183 C
00184  10     continue
00185 C
00186 C       On ferme le fichier
00187         call mficlo(fid,cret)
00188         print *,cret
00189         if (cret .ne. 0 ) then
00190            print *,'Erreur fermeture du fichier'
00191            call efexit(-1)
00192         endif      
00193         print *,'Fermeture du fichier'
00194 C
00195         end
00196         

Généré le Thu Oct 8 14:26:17 2015 pour MED fichier par  doxygen 1.6.1