f/test4.f

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, sdim
00034 C       ** nom du maillage de longueur maxi MED_TAILLE_NOM  **
00035         character*64 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         real*8 dt
00052         
00053         parameter    (mdim = 2, maa = "maa1",nnoe = 4, sdim=2)
00054         parameter    (dt = 0.0)
00055         data  coo    /0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0/
00056         data  nomcoo /"x","y"/, unicoo /"cm","cm"/
00057         data  nomnoe /"nom1","nom2","nom3","nom4"/
00058         data  numnoe /1,2,3,4/, nufano /0,1,2,2/
00059 
00060 C       ** Creation du fichier test4.med          **
00061         call mfiope(fid,'test4.med',MED_ACC_RDWR, cret)
00062         print *,cret
00063         if (cret .ne. 0 ) then
00064            print *,'Erreur creation du fichier'
00065            call efexit(-1)
00066         endif      
00067         
00068 C       ** Creation du maillage maa de dimension 2 **
00069 C       **  et de type non structure               **
00070         call mmhcre(fid,maa,mdim,sdim,
00071      &     MED_UNSTRUCTURED_MESH,'un premier maillage pour test4', 
00072      &     "",MED_SORT_DTIT,MED_CARTESIAN,nomcoo,unicoo,cret)
00073         print *,cret
00074         if (cret .ne. 0 ) then
00075            print *,'Erreur creation du maillage'
00076            call efexit(-1)
00077         endif      
00078         
00079 C       ** Ecriture des coordonnees en mode MED_FULL_INTERLACE : **
00080 C       ** (X1,Y1, X2,Y2, X3,Y3, ...)  dans un repere cartesien **
00081         call mmhcow(fid,maa,MED_NO_DT,MED_NO_IT,dt,
00082      &     MED_FULL_INTERLACE,nnoe,coo,cret)
00083         print *,cret         
00084         if (cret .ne. 0 ) then
00085            print *,'Erreur ecriture des coordonnees des noeuds'
00086            call efexit(-1)
00087         endif      
00088         
00089 C       ** Ecriture des noms des noeuds (optionnel dans un maillage MED) **
00090         call mmheaw(fid,maa,MED_NO_DT,MED_NO_IT,MED_NODE,
00091      &              MED_NONE,nnoe,nomnoe,cret)
00092         print *,cret
00093         if (cret .ne. 0 ) then
00094            print *,'Erreur ecriture des noms des noeuds'
00095            call efexit(-1)
00096         endif      
00097          
00098 C       ** Ecriture des numeros des noeuds (optionnel dans un maillage MED) **
00099         call mmhenw(fid,maa,MED_NO_DT,MED_NO_IT,MED_NODE,
00100      &              MED_NONE,nnoe,numnoe,cret)
00101         print *,cret
00102         if (cret .ne. 0 ) then
00103            print *,'Erreur ecriture des numeros des noeuds'
00104          call efexit(-1)
00105         endif      
00106          
00107 
00108 C       ** Ecriture des numeros de familles des noeuds **
00109         call mmhfnw(fid,maa,MED_NO_DT,MED_NO_IT,MED_NODE,
00110      &              MED_NONE,nnoe,nufano,cret)        
00111         print *,cret
00112         if (cret .ne. 0 ) then
00113            print *,'Erreur ecriture des numeros de famille'
00114            call efexit(-1)
00115         endif      
00116 
00117 C       ** Fermeture du fichier **
00118         call mficlo(fid,cret)
00119         print *,cret
00120         if (cret .ne. 0 ) then
00121            print *,'Erreur fermeture du fichier'
00122            call efexit(-1)
00123         endif      
00124         
00125         end
00126 
00127 
00128 
00129 

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