# test31.f

Aller à la documentation de ce fichier.

    00001 C*  This file is part of MED.
    00002 C*
    00003 C*  COPYRIGHT (C) 1999 - 2012  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
    00019 C ******************************************************************************
    00020 C * - Nom du fichier : test31.f
    00021 C *
    00022 C * - Description : ecriture d'une numerotation globale dans un maillage MED
    00023 C *
    00024 C ******************************************************************************
    00025         program test31
    00026 C
    00027         implicit none
    00028         include 'med.hf'
    00029 C
    00030 C
    00031         integer cret,fid
    00032         character*64 maa
    00033         character*200 des
    00034         integer nmaa, mdim , nnoe, type, ind,sdim
    00035         integer numglb(100),i
    00036         character*16 nomcoo(2)
    00037         character*16 unicoo(2)
    00038         character(16)  :: dtunit
    00039         real*8   coo(8)
    00040         integer nstep, stype, atype,chgt,tsf
    00041         real*8 dt
    00042         parameter    (mdim = 2, maa = "maa1",sdim=2)
    00043         parameter    (dt = 0.0)
    00044         data  coo    /0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0/
    00045         data  nomcoo /"x","y"/, unicoo /"cm","cm"/
    00046
    00047
    00048 C       ** Ouverture du fichier test4.med **
    00049         call mfiope(fid,'test31.med',MED_ACC_RDWR, cret)
    00050         print *,cret
    00051         if (cret .ne. 0 ) then
    00052            print *,'Erreur ouverture du fichier test31.med'
    00053            call efexit(-1)
    00054         endif
    00055
    00056 C       ** Creation du maillage maa de dimension 2 **
    00057 C       **  et de type non structure               **
    00058         nnoe=4
    00059         call mmhcre(fid,maa,mdim,sdim,
    00060      &              MED_UNSTRUCTURED_MESH,
    00061      &              'un premier maillage pour test4',
    00062      &              "",MED_SORT_DTIT,MED_CARTESIAN,nomcoo,unicoo,cret)
    00063         print *,cret
    00064         if (cret .ne. 0 ) then
    00065            print *,'Erreur creation du maillage'
    00066            call efexit(-1)
    00067         endif
    00068
    00069 C       ** Ecriture des coordonnees en mode MED_FULL_INTERLACE : **
    00070 C       ** (X1,Y1, X2,Y2, X3,Y3, ...)  dans un repere cartesien **
    00071         call mmhcow(fid,maa,MED_NO_DT,MED_NO_IT,dt,
    00072      &     MED_FULL_INTERLACE,nnoe,coo,cret)
    00073         print *,cret
    00074         if (cret .ne. 0 ) then
    00075            print *,'Erreur ecriture des coordonnees des noeuds'
    00076            call efexit(-1)
    00077         endif
    00078
    00079         print '(A,I1,A,A4,A,I1,A,I4)','maillage '
    00080      &        ,ind,' de nom ',maa,' et de dimension ',mdim,
    00081      &        ' comportant le nombre de noeud ',nnoe
    00082
    00083 C ** construction des numeros globaux
    00084
    00085          if (nnoe.gt.100) nnoe=100
    00086
    00087          do i=1,nnoe
    00088             numglb(i)=i+100
    00089          enddo
    00090
    00091 C ** ecriture de la numerotation globale
    00092          call  mmhgnw(fid,maa,MED_NO_DT,MED_NO_IT,MED_NODE,MED_NONE,
    00093      &                nnoe,numglb,cret)
    00094
    00095         if (cret .ne. 0 ) then
    00096            print *,'Erreur ecriture numerotation globale '
    00097            call efexit(-1)
    00098         endif
    00099 C ** Fermeture du fichier                                **
    00100         call mficlo(fid,cret)
    00101         print *,cret
    00102         if (cret .ne. 0 ) then
    00103            print *,'Erreur fermeture du fichier'
    00104            call efexit(-1)
    00105         endif
    00106 C
    00107         end