00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022       program MEDsupportMesh3
00023 
00024       implicit none
00025       include 'med.hf'
00026 
00027 
00028       integer cret
00029       integer fid
00030       character*64  fname
00031       parameter (fname = "Unittest_MEDsupportMesh_1.med")
00032       character*64 smname1
00033       integer sdim1,mdim1
00034       parameter (sdim1=2, mdim1=2)
00035       integer sdim2,mdim2
00036       parameter (sdim2=3,mdim2=2)
00037       parameter (smname1 = "supportMesh1")
00038       character*64 smname2
00039       parameter (smname2 = "supportMesh2")
00040       character*200 description1
00041       parameter (description1="support mesh1 description")
00042       character*200 description2
00043       parameter (description2="support mesh2 description")
00044       character*16 nomcoo2D(2)
00045       character*16 unicoo2D(2)
00046       data  nomcoo2D /"x","y"/, unicoo2D /"cm","cm"/
00047       character*16 nomcoo3D(3)
00048       character*16 unicoo3D(3)
00049       data  nomcoo3D /"x","y","z"/, unicoo3D /"cm","cm","cm"/
00050       integer atype1, atype2
00051       parameter (atype1=MED_CARTESIAN, atype2=MED_CARTESIAN)
00052       integer nsmesh, i
00053       character*64  smname
00054       character*16 aunit(3), aname(3)
00055       character*200 description
00056       integer sdim, mdim, atype
00057 
00058 
00059 
00060       call mfiope(fid,fname,MED_ACC_RDONLY,cret)
00061       print *,'Open file in RD_ONLY access mode',cret
00062       if (cret .ne. 0 ) then
00063          print *,'ERROR : open file in READ_ONLY access mode'
00064          call efexit(-1)
00065       endif  
00066 
00067 
00068 
00069       call msmnsm(fid,nsmesh,cret)
00070       print *,'Read number of support mesh : ',nsmesh
00071       print *,cret
00072       if (cret .ne. 0 ) then
00073          print *,'ERROR : read number of support mesh'
00074          call efexit(-1)
00075       endif
00076       if (nsmesh .ne. 2) then
00077          print *,'ERROR : number of support mesh'
00078          call efexit(-1)
00079       endif
00080 
00081 
00082 
00083 
00084       do i=1,nsmesh
00085          call msmnax(fid,i,sdim,cret)
00086          if (cret .ne. 0 ) then
00087             print *,'ERROR : read number of axis '
00088             call efexit(-1)
00089          endif  
00090          print *,'Number of axis : ',sdim
00091 
00092          if (i .eq. 1) then 
00093             if (sdim .ne. sdim1) then
00094                print *,'ERROR : support mesh information'
00095                call efexit(-1)
00096             endif  
00097          endif
00098          if (i .eq. 2) then 
00099             if (sdim .ne. sdim2) then
00100                print *,'ERROR : support mesh information'
00101                call efexit(-1)
00102             endif              
00103          endif
00104 
00105          call msmsmi(fid,i,smname,sdim,mdim, 
00106      &               description,
00107      &               atype,aname,aunit,cret)
00108          print *,'Support mesh information',cret
00109          if (cret .ne. 0 ) then
00110             print *,'ERROR : read support mesh information'
00111             call efexit(-1)
00112          endif  
00113 
00114          if (i .eq. 1) then 
00115             if ((sdim .ne. sdim1) .or.
00116      &           (mdim .ne. mdim1) .or.
00117      &           (description .ne. description1) .or.
00118      &           (atype .ne. atype1) .or.
00119      &           (aunit(1) .ne. unicoo2D(1)) .or.
00120      &           (aunit(2) .ne. unicoo2D(2)) .or.
00121      &           (aname(1) .ne. nomcoo2D(1)) .or.
00122      &           (aname(2) .ne. nomcoo2D(2))
00123      &           ) then
00124                print *,'ERROR : support mesh information by name'
00125                call efexit(-1)
00126             endif  
00127          endif
00128 
00129          if (i .eq. 2) then 
00130             if ((sdim .ne. sdim2) .or.
00131      &           (mdim .ne. mdim2) .or.
00132      &           (description .ne. description2) .or.
00133      &           (atype .ne. atype2) .or.
00134      &           (aunit(1) .ne. unicoo3D(1)) .or.
00135      &           (aunit(2) .ne. unicoo3D(2)) .or.
00136      &           (aunit(3) .ne. unicoo3D(3)) .or.
00137      &           (aname(1) .ne. nomcoo3D(1)) .or.
00138      &           (aname(2) .ne. nomcoo3D(2)) .or.
00139      &           (aname(3) .ne. nomcoo3D(3))
00140      &           ) then
00141                print *,'ERROR : support mesh information by name'
00142                call efexit(-1)
00143             endif     
00144          endif
00145 
00146       enddo
00147 
00148 
00149 
00150       call mficlo(fid,cret)
00151       print *,'Close file',cret
00152       if (cret .ne. 0 ) then
00153          print *,'ERROR :  close file'
00154          call efexit(-1)
00155       endif
00156 
00157 
00158 
00159       end
00160