29 integer fid, nmesh, it, naxis, axis
30 integer coocha, geotra
31 character(64) :: mname =
"2D structured mesh" 32 character(200) :: desc
33 character(16) :: dtunit
34 integer nstep, mdim, sdim, stype, mtype, atype, asize
36 character(16),
dimension(:),
allocatable :: aname
37 character(16),
dimension (:),
allocatable :: aunit
38 real*8,
dimension (:),
allocatable :: cooXaxis
39 real*8,
dimension (:),
allocatable :: cooYaxis
40 character*16,
dimension (:),
allocatable :: cnames
43 call mfiope(fid,
'UsesCase_MEDmesh_4.med',med_acc_rdonly, cret)
44 if (cret .ne. 0 )
then 45 print *,
'ERROR : open file' 53 call mmhnan(fid,mname,naxis,cret)
54 if (cret .ne. 0 )
then 55 print *,
'Read number of axis in the mesh' 58 print *,
'Number of axis in the mesh = ',naxis
61 allocate ( aname(naxis), aunit(naxis) ,stat=cret )
63 print *,
'Memory allocation' 67 call mmhmin(fid, mname, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
68 if (cret .ne. 0 )
then 69 print *,
'Read mesh informations' 72 print *,
"mesh name =", mname
73 print *,
"space dim =", sdim
74 print *,
"mesh dim =", mdim
75 print *,
"mesh type =", mtype
76 print *,
"mesh description =", desc
77 print *,
"dt unit = ", dtunit
78 print *,
"sorting type =", stype
79 print *,
"number of computing step =", nstep
80 print *,
"coordinates axis type =", atype
81 print *,
"coordinates axis name =", aname
82 print *,
"coordinates axis units =", aunit
83 deallocate(aname, aunit)
86 call mmhgtr(fid,mname,gtype,cret)
87 if (cret .ne. 0 )
then 88 print *,
'Read grid type' 91 print *,
"grid type =", gtype
99 call mmhnme(fid,mname,med_no_dt,med_no_it,med_node,med_none,med_coordinate_axis1,med_no_cmode,coocha,geotra,asize,cret)
100 if (cret .ne. 0 )
then 101 print *,
'Read number of coordinates on X axis ' 104 print *,
"Number of coordinates on X axis =", asize
107 allocate ( cooxaxis(asize),stat=cret )
109 print *,
'Memory allocation' 113 call mmhgcr(fid,mname,med_no_dt,med_no_it,axis,cooxaxis,cret)
114 if (cret .ne. 0 )
then 115 print *,
'Read axis X coordinates' 118 print *,
"Axis X coordinates =", cooxaxis
123 call mmhnme(fid,mname,med_no_dt,med_no_it,med_node,med_none,med_coordinate_axis2,med_no_cmode,coocha,geotra,asize,cret)
124 if (cret .ne. 0 )
then 125 print *,
'Read number of coordinates on Y axis ' 128 print *,
"Number of coordinates on Y axis =", asize
129 ncell = ncell * (asize-1)
131 allocate ( cooyaxis(asize),stat=cret )
133 print *,
'Memory allocation' 137 call mmhgcr(fid,mname,med_no_dt,med_no_it,axis,cooyaxis,cret)
138 if (cret .ne. 0 )
then 139 print *,
'Read axis Y coordinates' 142 print *,
"Axis Y coordinates =", cooyaxis
146 print *,
'ncell :', ncell
147 allocate ( cnames(ncell),stat=cret )
149 print *,
'Memory allocation' 153 call mmhear(fid,mname,med_no_dt,med_no_it,med_cell,med_quad4,cnames,cret)
154 if (cret .ne. 0 )
then 155 print *,
'Read names for elements' 158 print *,
'Cells names =', cnames
163 if (cret .ne. 0 )
then 164 print *,
'ERROR : close file' subroutine mficlo(fid, cret)
subroutine mmhnan(fid, name, naxis, cret)
subroutine mmhgtr(fid, name, gtype, cret)
subroutine mmhmin(fid, name, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
program usescase_medmesh_5
subroutine mmhear(fid, mname, numdt, numit, entype, geotype, ename, cret)
subroutine mmhnme(fid, name, numdt, numit, entype, geotype, datype, cmode, chgt, tsf, n, cret)
subroutine mmhgcr(fid, name, numdt, numit, axis, index, cret)
subroutine mfiope(fid, name, access, cret)