MED fichier
test14.f
Aller à la documentation de ce fichier.
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4 C* MED is free software: you can redistribute it and/or modify
5 C* it under the terms of the GNU Lesser General Public License as published by
6 C* the Free Software Foundation, either version 3 of the License, or
7 C* (at your option) any later version.
8 C*
9 C* MED is distributed in the hope that it will be useful,
10 C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11 C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 C* GNU Lesser General Public License for more details.
13 C*
14 C* You should have received a copy of the GNU Lesser General Public License
15 C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16 C*
17 
18 C ******************************************************************************
19 C * - Nom du fichier : test14.f
20 C *
21 C * - Description : ecriture des noeuds d'un maillage MED
22 C * a l'aide des routines de niveau 2
23 C * MED - equivalent a test4.f
24 C *
25 C ******************************************************************************
26  program test14
27 C
28  implicit none
29  include 'med.hf'
30 C
31  integer*8 fid
32  integer cret
33 C ** la dimension du maillage **
34  integer mdim,sdim
35 C ** nom du maillage de longueur maxi MED_TAILLE_NOM **
36  character*64 maa
37 C ** le nombre de noeuds **
38  integer nnoe
39  parameter(mdim=2,maa="maa1",nnoe=4,sdim=2)
40 C ** table des coordonnees
41  real*8 coo(mdim*nnoe)
42 C ** tables des noms et des unites des coordonnees
43  character*16 nomcoo(mdim), unicoo(mdim)
44 C ** tables des noms, numeros, numeros de familles des noeuds
45 C autant d'elements que de noeuds - les noms ont pout longueur
46 C 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 
57 C ** 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 
65 C ** 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 
75 C ** Ecriture des noeuds d'un maillage MED :
76 C - Des coordonnees en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...)
77 C dans un repere cartesien
78 C - Des noms (optionnel dans un fichier MED)
79 C - Des numeros (optionnel dans un fichier MED)
80 C - 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 
90 C ** 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
97 C
98  end
99 
100 
101 
test14
program test14
Definition: test14.f:26
mmhcre
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
mmhnow
subroutine mmhnow(fid, name, numdt, numit, dt, swm, n, coo, iname, nname, inum, num, ifam, fam, cret)
Definition: medmesh.f:726
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:82
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:42