MED fichier
f/test14.f
1C* This file is part of MED.
2C*
3C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4C* MED is free software: you can redistribute it and/or modify
5C* it under the terms of the GNU Lesser General Public License as published by
6C* the Free Software Foundation, either version 3 of the License, or
7C* (at your option) any later version.
8C*
9C* MED is distributed in the hope that it will be useful,
10C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12C* GNU Lesser General Public License for more details.
13C*
14C* You should have received a copy of the GNU Lesser General Public License
15C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16C*
17
18C ******************************************************************************
19C * - Nom du fichier : test14.f
20C *
21C * - Description : ecriture des noeuds d'un maillage MED
22C * a l'aide des routines de niveau 2
23C * MED - equivalent a test4.f
24C *
25C ******************************************************************************
26 program test14
27C
28 implicit none
29 include 'med.hf'
30C
31 integer*8 fid
32 integer cret
33C ** la dimension du maillage **
34 integer mdim,sdim
35C ** nom du maillage de longueur maxi MED_TAILLE_NOM **
36 character*64 maa
37C ** le nombre de noeuds **
38 integer nnoe
39 parameter(mdim=2,maa="maa1",nnoe=4,sdim=2)
40C ** table des coordonnees
41 real*8 coo(mdim*nnoe)
42C ** tables des noms et des unites des coordonnees
43 character*16 nomcoo(mdim), unicoo(mdim)
44C ** tables des noms, numeros, numeros de familles des noeuds
45C autant d'elements que de noeuds - les noms ont pout longueur
46C MED_TAILLE_PNOM : 8 **
47 character*16 nomnoe(nnoe)
48 integer numnoe(nnoe), nufano(nnoe)
49 real*8 dt
50 parameter(dt=0.0)
51
52 data coo /0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0/
53 data nomcoo /"x","y"/, unicoo /"cm","cm"/
54 data nomnoe /"nom1","nom2","nom3","nom4"/
55 data numnoe /1,2,3,4/,nufano /0,1,2,2/
56
57C ** Creation du fichier test14.med **
58 call mfiope(fid,'test14.med',med_acc_rdwr, cret)
59 print *,cret
60 if (cret .ne. 0 ) then
61 print *,'Erreur creation du fichier'
62 call efexit(-1)
63 endif
64
65C ** Creation du maillage **
66 call mmhcre(fid,maa,mdim,sdim,med_unstructured_mesh,
67 & 'un maillage pour test14',"",med_sort_dtit,
68 & med_cartesian,nomcoo,unicoo,cret)
69 print *,cret
70 if (cret .ne. 0 ) then
71 print *,'Erreur creation du maillage'
72 call efexit(-1)
73 endif
74
75C ** Ecriture des noeuds d'un maillage MED :
76C - Des coordonnees en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...)
77C dans un repere cartesien
78C - Des noms (optionnel dans un fichier MED)
79C - Des numeros (optionnel dans un fichier MED)
80C - Des numeros de familles des noeuds **
81 call mmhnow(fid,maa,med_no_dt,med_no_it,dt,med_full_interlace,
82 & nnoe,coo,med_true,nomnoe,med_true,numnoe,
83 & med_true,nufano,cret)
84 print *,cret
85 if (cret .ne. 0 ) then
86 print *,'Erreur ecriture des noeuds'
87 call efexit(-1)
88 endif
89
90C ** Fermeture du fichier **
91 call mficlo(fid,cret)
92 print *,cret
93 if (cret .ne. 0 ) then
94 print *,'Erreur fermeture du fichier'
95 call efexit(-1)
96 endif
97C
98 end
99
100
101
subroutine mfiope(fid, name, access, cret)
Definition medfile.f:42
subroutine mficlo(fid, cret)
Definition medfile.f:82
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
Definition medmesh.f:20
subroutine mmhnow(fid, name, numdt, numit, dt, swm, n, coo, iname, nname, inum, num, ifam, fam, cret)
Definition medmesh.f:726
program test14
Definition test14.f:26