MED fichier
f/test23.f
C* This file is part of MED.
C*
C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
C* MED is free software: you can redistribute it and/or modify
C* it under the terms of the GNU Lesser General Public License as published by
C* the Free Software Foundation, either version 3 of the License, or
C* (at your option) any later version.
C*
C* MED is distributed in the hope that it will be useful,
C* but WITHOUT ANY WARRANTY; without even the implied warranty of
C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
C* GNU Lesser General Public License for more details.
C*
C* You should have received a copy of the GNU Lesser General Public License
C* along with MED. If not, see <http://www.gnu.org/licenses/>.
C*
C *******************************************************************************
C * - Nom du fichier : test23.f
C *
C * - Description : ecriture de mailles MED_POLYGONE dans un maillage MED
C *
C ******************************************************************************
program test23
C
implicit none
include 'med.hf'
C
integer*8 fid
integer cret,mdim,sdim
parameter(mdim = 2, sdim = 2)
character*64 maa
integer ni, n
parameter(ni=4, n=3)
integer index(ni)
character*16 nom(n)
integer num(n),fam(n)
integer con(16)
C ** tables des noms et des unites des coordonnees **
C profil : (dimension) **
character*16 nomcoo(2)
character*16 unicoo(2)
C
data con / 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 /
data nom / "poly1", "poly2", "poly3"/
data num / 1,2,3 /, fam /0,-1,-2/
data index /1,6,12,17/
data maa /"maa1"/
data nomcoo /"x","y"/, unicoo /"cm","cm"/
C ** Creation du fichier test23.med **
call mfiope(fid,'test23.med',med_acc_rdwr, cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur creation du fichier'
call efexit(-1)
endif
print *,'Creation du fichier test23.med'
C ** Creation du maillage **
call mmhcre(fid,maa,mdim,sdim,
& med_unstructured_mesh,'un maillage pour test 23',
& "",med_sort_dtit,med_cartesian,nomcoo,unicoo,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur creation du maillage'
call efexit(-1)
endif
print *,'Creation du maillage'
C ** Ecriture de la connectivite des mailles polygones **
call mmhpgw(fid,maa,med_no_dt,med_no_it,med_undef_dt,med_cell,
& med_nodal,ni,index,con,cret)
if (cret .ne. 0 ) then
print *,'Erreur ecriture des connectivite polygones'
call efexit(-1)
endif
print *,cret
print *,'Ecriture des connectivites des mailles de type
& MED_POLYGONE'
C ** Ecriture des noms des mailles polygones **
call mmheaw(fid,maa,med_no_dt,med_no_it,med_cell,
& med_polygon,n,nom,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ecriture des noms polygones'
call efexit(-1)
endif
print *,'Ecriture des noms des polygones'
C ** Ecriture des numeros des mailles polygones **
call mmhenw(fid,maa,med_no_dt,med_no_it,med_cell,
& med_polygon,n,num,cret)
if (cret .ne. 0 ) then
print *,'Erreur ecriture des numeros polygones'
call efexit(-1)
endif
print *,cret
print *,'Ecriture des numeros des polygones'
C ** Ecriture des numeros des familles des mailles polygones **
call mmhfnw(fid,maa,med_no_dt,med_no_it,med_cell,
& med_polygon,n,fam,cret)
if (cret .ne. 0 ) then
print *,'Erreur ecriture des numeros de famille polygones'
call efexit(-1)
endif
print *,cret
print *,'Ecriture des numeros de familles des polygones'
C ** Fermeture du fichier **
call mficlo(fid,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur fermeture du fichier'
call efexit(-1)
endif
print *,'Fermeture du fichier'
C
end
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition medfile.f:42
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition medfile.f:82
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
Cette routine permet de créer un maillage dans un fichier.
Definition medmesh.f:20
subroutine mmheaw(fid, mname, numdt, numit, entype, geotype, n, ename, cret)
Cette routine permet d'écrire les noms d'un type d'entité d'un maillage.
Definition medmesh.f:508
subroutine mmhpgw(fid, name, numdt, numit, dt, entype, cmode, isize, index, con, cret)
Definition medmesh.f:890
subroutine mmhfnw(fid, name, numdt, numit, entype, geotype, n, num, cret)
Definition medmesh.f:466
subroutine mmhenw(fid, name, numdt, numit, entype, geotype, n, num, cret)
Definition medmesh.f:424
program test23
Definition test23.f:24