| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
program UsesCase_MEDmesh_14 |
| 22 |
|
| 23 |
implicit none |
| 24 |
include 'med.hf90' |
| 25 |
|
| 26 |
integer cret |
| 27 |
integer*8 fid |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
character*64 mname |
| 32 |
|
| 33 |
character*64 finame |
| 34 |
|
| 35 |
character*200 mdesc |
| 36 |
|
| 37 |
integer mdim, sdim |
| 38 |
|
| 39 |
integer stype |
| 40 |
|
| 41 |
integer nstep |
| 42 |
|
| 43 |
integer mtype, atype |
| 44 |
|
| 45 |
character*16 axname(2), unname(2) |
| 46 |
|
| 47 |
character*16 dtunit |
| 48 |
|
| 49 |
real*8, dimension(:), allocatable :: coords |
| 50 |
integer nnodes |
| 51 |
integer npoly |
| 52 |
|
| 53 |
integer isize |
| 54 |
integer, dimension(:), allocatable :: index |
| 55 |
|
| 56 |
integer, dimension(:), allocatable :: conity |
| 57 |
|
| 58 |
integer cosize |
| 59 |
|
| 60 |
integer coocha, geotra |
| 61 |
|
| 62 |
parameter (mname = "2D unstructured mesh") |
| 63 |
parameter (finame = "UsesCase_MEDmesh_13.med") |
| 64 |
|
| 65 |
|
| 66 |
call mfiope(fid, finame, MED_ACC_RDONLY, cret) |
| 67 |
if (cret .ne. 0 ) then |
| 68 |
print *,'ERROR : open file' |
| 69 |
call efexit(-1) |
| 70 |
endif |
| 71 |
|
| 72 |
|
| 73 |
call mmhmin(fid, mname, sdim, mdim, mtype, mdesc, dtunit, stype, nstep, atype, axname, unname, cret) |
| 74 |
if (cret .ne. 0 ) then |
| 75 |
print *,'Read mesh informations' |
| 76 |
call efexit(-1) |
| 77 |
endif |
| 78 |
print *,"mesh name =", mname |
| 79 |
print *,"space dim =", sdim |
| 80 |
print *,"mesh dim =", mdim |
| 81 |
print *,"mesh type =", mtype |
| 82 |
print *,"mesh description =", mdesc |
| 83 |
print *,"dt unit = ", dtunit |
| 84 |
print *,"sorting type =", stype |
| 85 |
print *,"number of computing step =", nstep |
| 86 |
print *,"coordinates axis type =", atype |
| 87 |
print *,"coordinates axis name =", axname |
| 88 |
print *,"coordinates axis units =", unname |
| 89 |
|
| 90 |
|
| 91 |
call mmhnme(fid,mname,MED_NO_DT,MED_NO_IT,MED_NODE,MED_POINT1,MED_COORDINATE,MED_NO_CMODE,coocha,geotra,nnodes,cret) |
| 92 |
if (cret .ne. 0 ) then |
| 93 |
print *,'Read number of nodes ...' |
| 94 |
call efexit(-1) |
| 95 |
endif |
| 96 |
print *,"Number of nodes =", nnodes |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
call mmhnme(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_POLYGON,MED_INDEX_NODE,MED_NODAL,coocha,geotra,isize,cret) |
| 104 |
if (cret .ne. 0 ) then |
| 105 |
print *,'Read number of polygon ...' |
| 106 |
call efexit(-1) |
| 107 |
endif |
| 108 |
npoly = isize - 1 |
| 109 |
print *,"Number of polygons =", npoly |
| 110 |
|
| 111 |
|
| 112 |
call mmhnme(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_POLYGON,MED_CONNECTIVITY,MED_NODAL,coocha,geotra,cosize,cret) |
| 113 |
if (cret .ne. 0 ) then |
| 114 |
print *,'Read connectivity size ...' |
| 115 |
call efexit(-1) |
| 116 |
endif |
| 117 |
print *,"Read connectivity size ...", cosize |
| 118 |
|
| 119 |
|
| 120 |
allocate (coords(nnodes*sdim),STAT=cret) |
| 121 |
if (cret .ne. 0) then |
| 122 |
print *,'Memory allocation' |
| 123 |
call efexit(-1) |
| 124 |
endif |
| 125 |
|
| 126 |
call mmhcor(fid,mname,MED_NO_DT,MED_NO_IT,MED_FULL_INTERLACE,coords,cret) |
| 127 |
if (cret .ne. 0 ) then |
| 128 |
print *,'Read nodes coordinates ...' |
| 129 |
call efexit(-1) |
| 130 |
endif |
| 131 |
print *,"Read nodes coordinates ...", coords |
| 132 |
|
| 133 |
deallocate(coords) |
| 134 |
|
| 135 |
|
| 136 |
allocate (index(isize),STAT=cret) |
| 137 |
if (cret .ne. 0) then |
| 138 |
print *,'Memory allocation' |
| 139 |
call efexit(-1) |
| 140 |
endif |
| 141 |
|
| 142 |
allocate (conity(cosize),STAT=cret) |
| 143 |
if (cret .ne. 0) then |
| 144 |
print *,'Memory allocation' |
| 145 |
call efexit(-1) |
| 146 |
endif |
| 147 |
|
| 148 |
call mmhpgr(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_NODAL,index,conity,cret) |
| 149 |
if (cret .ne. 0 ) then |
| 150 |
print *,'Read polygon connectivity ...' |
| 151 |
call efexit(-1) |
| 152 |
endif |
| 153 |
print *,"Read polygon connectivity ...", conity |
| 154 |
|
| 155 |
deallocate(index) |
| 156 |
deallocate(conity) |
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
call mficlo(fid,cret) |
| 162 |
if (cret .ne. 0 ) then |
| 163 |
print *,'ERROR : close file' |
| 164 |
call efexit(-1) |
| 165 |
endif |
| 166 |
|
| 167 |
end program UsesCase_MEDmesh_14 |