2.3.6/test4.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 : test4.f
00020 C       *
00021 C       * - Description : ecriture des noeuds d'un maillage MED.
00022 C       *
00023 C       *****************************************************************************
00024         program test4
00025 C       
00026         implicit none
00027         include 'med.hf'
00028 C       
00029 C       
00030         integer cret, fid
00031         
00032 C       ** la dimension du maillage                         **
00033         integer      mdim
00034 C       ** nom du maillage de longueur maxi MED_TAILLE_NOM  **
00035         character*32 maa
00036 C       ** le nombre de noeuds                              **
00037         integer      nnoe 
00038 C       ** table des coordonnees                            **
00039 C       profil : (dimension * nombre de noeuds) ici 8       **
00040         real*8       coo(8)
00041 C       ** tables des noms et des unites des coordonnees    **
00042 C           profil : (dimension)                            **
00043         character*16 nomcoo(2)
00044         character*16 unicoo(2)
00045 C       ** tables des noms, numeros, numeros de familles des noeuds  **
00046 C       autant d'elements que de noeuds - les noms ont pout longueur **
00047 C       MED_TAILLE_PNOM                                              **
00048         character*16 nomnoe(4)
00049         integer     numnoe(4)
00050         integer     nufano(4)
00051         
00052         parameter    ( mdim = 2, maa = "maa1",nnoe = 4 )
00053         data  coo    /0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0/
00054         data  nomcoo /"x","y"/, unicoo /"cm","cm"/
00055         data  nomnoe /"nom1","nom2","nom3","nom4"/
00056         data  numnoe /1,2,3,4/, nufano /0,1,2,2/
00057 
00058 C       ** Creation du fichier test4.med          **
00059         call efouvr(fid,'test4.med',MED_LECTURE_ECRITURE, cret)
00060         print *,cret
00061         if (cret .ne. 0 ) then
00062            print *,'Erreur creation du fichier'
00063            call efexit(-1)
00064         endif      
00065         
00066 C       ** Creation du maillage maa de dimension 2 **
00067 C       **  et de type MED_NON_STRUCTURE           **
00068         call efmaac(fid,maa,mdim,MED_NON_STRUCTURE,
00069      &                 'un maillage pour test4',cret)
00070         print *,cret
00071         if (cret .ne. 0 ) then
00072            print *,'Erreur creation du maillage'
00073            call efexit(-1)
00074         endif      
00075         
00076 C       ** Ecriture des coordonnees en mode MED_FULL_INTERLACE : **
00077 C       ** (X1,Y1, X2,Y2, X3,Y3, ...)  dans un repere cartesien **
00078         call efcooe(fid,maa,mdim,coo,MED_FULL_INTERLACE,
00079      &     nnoe,MED_CART,nomcoo,unicoo,cret)
00080         print *,cret         
00081         if (cret .ne. 0 ) then
00082            print *,'Erreur ecriture des coordonnees des noeuds'
00083            call efexit(-1)
00084         endif      
00085         
00086 C       ** Ecriture des noms des noeuds (optionnel dans un maillage MED) **
00087         call efnome(fid,maa,nomnoe,nnoe,MED_NOEUD,0,cret)
00088         print *,cret
00089         if (cret .ne. 0 ) then
00090            print *,'Erreur ecriture des noms des noeuds'
00091            call efexit(-1)
00092         endif      
00093          
00094 C       ** Ecriture des numeros des noeuds (optionnel dans un maillage MED) **
00095         call efnume(fid,maa,numnoe,nnoe,MED_NOEUD,0,cret)
00096         print *,cret
00097         if (cret .ne. 0 ) then
00098            print *,'Erreur ecriture des numeros des noeuds'
00099          call efexit(-1)
00100         endif      
00101          
00102 
00103 C       ** Ecriture des numeros de familles des noeuds **             
00104         call effame(fid,maa,nufano,nnoe,MED_NOEUD,0,cret) 
00105         print *,cret
00106         if (cret .ne. 0 ) then
00107            print *,'Erreur ecriture des numeros de famille'
00108            call efexit(-1)
00109         endif      
00110 
00111 C       ** Fermeture du fichier **
00112         call efferm (fid,cret)
00113         print *,cret
00114         if (cret .ne. 0 ) then
00115            print *,'Erreur fermeture du fichier'
00116            call efexit(-1)
00117         endif      
00118         
00119         end
00120 
00121 
00122 
00123 

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