31 integer nmesh, it, naxis
32 character(64) :: mname =
"2D unstructured mesh"
33 character(200) :: desc
34 character(16) :: dtunit
35 integer nstep, mdim, sdim, stype, mtype, atype
36 character(16),
dimension(:),
allocatable :: aname
37 character(16),
dimension (:),
allocatable :: aunit
38 real*8,
dimension(:),
allocatable :: ncoord
39 integer coocha, geotra, nnodes, ntria3, nquad4
40 integer,
dimension(:),
allocatable :: tricon
41 integer,
dimension(:),
allocatable :: quacon
44 call mfiope(fid,
'UsesCase_MEDmesh_1.med',med_acc_rdonly, cret)
45 if (cret .ne. 0 )
then
46 print *,
'ERROR : open file'
54 call mmhnan(fid,mname,naxis,cret)
55 if (cret .ne. 0 )
then
56 print *,
'Read number of axis in the mesh'
59 print *,
'Number of axis in the mesh = ',naxis
62 allocate ( aname(naxis), aunit(naxis) ,stat=cret )
64 print *,
'Memory allocation'
68 call mmhmin(fid, mname, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
69 if (cret .ne. 0 )
then
70 print *,
'Read mesh informations'
73 print *,
"mesh name =", mname
74 print *,
"space dim =", sdim
75 print *,
"mesh dim =", mdim
76 print *,
"mesh type =", mtype
77 print *,
"mesh description =", desc
78 print *,
"dt unit = ", dtunit
79 print *,
"sorting type =", stype
80 print *,
"number of computing step =", nstep
81 print *,
"coordinates axis type =", atype
82 print *,
"coordinates axis name =", aname
83 print *,
"coordinates axis units =", aunit
84 deallocate(aname, aunit)
87 call mmhnme(fid,mname,med_no_dt,med_no_it,med_node,med_no_geotype,med_coordinate,med_no_cmode,coocha,geotra,nnodes,cret)
88 if (cret .ne. 0 )
then
89 print *,
'Read how many nodes in the mesh'
92 print *,
"number of nodes in the mesh =", nnodes
98 call mmhnme(fid,mname,med_no_dt,med_no_it,med_cell,med_tria3,med_connectivity,med_nodal,coocha,geotra,ntria3,cret)
99 if (cret .ne. 0 )
then
100 print *,
'Read how many nodes in the mesh'
103 print *,
"number of triangular cells in the mesh =", ntria3
106 call mmhnme(fid,mname,med_no_dt,med_no_it,med_cell,med_quad4,med_connectivity,med_nodal,coocha,geotra,nquad4,cret)
107 if (cret .ne. 0 )
then
108 print *,
'Read how many nodes in the mesh'
111 print *,
"number of quadrangular cells in the mesh =", nquad4
114 allocate (ncoord(nnodes*2),stat=cret)
116 print *,
'Memory allocation'
120 call mmhcor(fid,mname,med_no_dt,med_no_it,med_full_interlace,ncoord,cret)
121 if (cret .ne. 0 )
then
122 print *,
'Nodes coordinates'
125 print *,
"Nodes coordinates =", ncoord
129 allocate ( tricon(ntria3 * 3) ,stat=cret )
131 print *,
'Memory allocation'
135 call mmhcyr(fid,mname,med_no_dt,med_no_it,med_cell,med_tria3,med_nodal,med_full_interlace,tricon,cret)
136 if (cret .ne. 0 )
then
137 print *,
'MED_TRIA3 connectivity'
140 print *,
"MED_TRIA3 connectivity =", tricon
143 allocate ( quacon(nquad4*4) ,stat=cret )
145 print *,
'Memory allocation'
149 call mmhcyr(fid,mname,med_no_dt,med_no_it,med_cell,med_quad4,med_nodal,med_full_interlace,quacon,cret)
150 if (cret .ne. 0 )
then
151 print *,
'MED_QUAD4 connectivity'
154 print *,
"MED_QUAD4 connectivity =", quacon
161 if (cret .ne. 0 )
then
162 print *,
'ERROR : close file'
program usescase_medmesh_2
subroutine mfiope(fid, name, access, cret)
subroutine mficlo(fid, cret)
subroutine mmhcor(fid, name, numdt, numit, swm, coo, cret)
subroutine mmhmin(fid, name, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
subroutine mmhnme(fid, name, numdt, numit, entype, geotype, datype, cmode, chgt, tsf, n, cret)
subroutine mmhnan(fid, name, naxis, cret)
subroutine mmhcyr(fid, name, numdt, numit, entype, geotype, cmode, swm, con, cret)