00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 program UsesCase_MEDmesh_1
00025
00026 implicit none
00027 include 'med.hf'
00028
00029
00030 integer cret
00031 integer fid
00032 integer sdim, mdim, stype, mtype, atype, nnode
00033 integer ntria, nquad
00034 integer fnum, ngro
00035 character*200 cmt1,mdesc
00036 character*64 fname
00037 character*64 mname
00038 character*16 nomcoo(2)
00039 character*16 unicoo(2)
00040 character*16 dtunit
00041 real*8 dt
00042 parameter (fname = "UsesCase_MEDmesh_1.med")
00043 parameter (mdesc = "A 2D unstructured mesh")
00044 parameter (cmt1 = "A 2D unstructured mesh : 15 nodes, 12 cells")
00045 parameter (mname = "2D unstructured mesh")
00046 parameter (sdim = 2, mdim = 2, nnode=15)
00047 parameter (stype=MED_SORT_DTIT, mtype=MED_UNSTRUCTURED_MESH)
00048 parameter (atype=MED_CARTESIAN)
00049 parameter (dt=0.0)
00050 parameter (ntria = 8, nquad = 4)
00051 parameter (fnum = 0, ngro = 0)
00052 data dtunit /""/
00053 data nomcoo /"x ","y "/
00054 data unicoo /"cm ","cm "/
00055 real*8 coo(30)
00056 data coo /2.,1.,7.,1.,12.,1.,17.,1.,22.,1.,
00057 & 2.,6., 7.,6., 12.,6., 17.,6., 22.,6.,
00058 & 2.,11., 7.,11., 12.,11., 17.,11., 22.,11./
00059 integer tricon(24)
00060 data tricon /1,7,6, 2,7,1, 3,7,2, 8,7,3,
00061 & 13,7,8, 12,7,13, 11,7,12, 6,7,11/
00062 integer quacon(16)
00063 data quacon /3,4,9,8, 4,5,10,9,
00064 & 15,14,9,10, 13,8,9,14 /
00065
00066
00067
00068 call mfiope(fid,fname,MED_ACC_CREAT,cret)
00069 print *,cret
00070 print *,fid
00071 if (cret .ne. 0 ) then
00072 print *,'ERROR : file creation'
00073 call efexit(-1)
00074 endif
00075
00076
00077
00078 call mficow(fid,cmt1,cret)
00079 print *,cret
00080 if (cret .ne. 0 ) then
00081 print *,'ERROR : write file description'
00082 call efexit(-1)
00083 endif
00084
00085
00086
00087 call mmhcre(fid, mname, sdim, mdim, mtype,mdesc,
00088 & dtunit, stype, atype, nomcoo, unicoo, cret)
00089 print *,cret
00090 if (cret .ne. 0 ) then
00091 print *,'ERROR : mesh creation'
00092 call efexit(-1)
00093 endif
00094
00095
00096
00097 call mmhcow(fid,mname,MED_NO_DT,MED_NO_IT,dt,
00098 & MED_FULL_INTERLACE,nnode,coo,cret)
00099 print *,cret
00100 if (cret .ne. 0 ) then
00101 print *,'ERROR : write nodes coordinates description'
00102 call efexit(-1)
00103 endif
00104
00105
00106
00107
00108 call mmhcyw(fid,mname,MED_NO_DT,MED_NO_IT,dt,MED_CELL,
00109 & MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,
00110 & ntria,tricon,cret)
00111 print *,cret
00112 if (cret .ne. 0 ) then
00113 print *,'ERROR : triangular cells connectivity'
00114 call efexit(-1)
00115 endif
00116
00117 call mmhcyw(fid,mname,MED_NO_DT,MED_NO_IT,dt,MED_CELL,
00118 & MED_QUAD4,MED_NODAL,MED_FULL_INTERLACE,
00119 & nquad,quacon,cret)
00120 print *,cret
00121 if (cret .ne. 0 ) then
00122 print *,'ERROR : quadrangular cells connectivity'
00123 call efexit(-1)
00124 endif
00125
00126
00127
00128 call mfacre(fid,mname,MED_NO_NAME,fnum,ngro,MED_NO_GROUP,cret)
00129 print *,cret
00130 if (cret .ne. 0 ) then
00131 print *,'ERROR : family 0 creation'
00132 call efexit(-1)
00133 endif
00134
00135
00136
00137 call mficlo(fid,cret)
00138 print *,cret
00139 if (cret .ne. 0 ) then
00140 print *,'ERROR : close file'
00141 call efexit(-1)
00142 endif
00143
00144
00145
00146 end
00147