implicit none
include 'med.hf'
integer*8 fid
integer cret,cres,type,cnu
character*64 maa
character*80 nomu
character*200 desc
integer nmaa,i,mdim,edim,nstep,stype,atype
character*16 nomcoo(3)
character*16 unicoo(3)
character*16 dtunit
integer maa1exist,maa4exist
call mfiope(fid,
'test2.med',med_acc_rdonly, cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur ouverture du fichier en lecture'
call efexit(-1)
endif
call mfioex(fid,med_mesh,
"maa1", maa1exist, cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur de test de présence de maillage'
call efexit(-1)
endif
print *,"Maillage maa1 existe : ",maa1exist
call mfioex(fid,med_mesh,
"maa4", maa4exist, cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur de test de présence de maillage'
call efexit(-1)
endif
print *,"Maillage maa4 existe : ",maa4exist
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur lecture du nombre de maillage'
call efexit(-1)
endif
print *,'Nombre de maillages = ',nmaa
do i=1,nmaa
call mmhmii(fid,i,maa,edim,mdim,
type,desc,
& dtunit,stype,nstep,atype,
& nomcoo,unicoo,cret)
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur acces au maillage'
call efexit(-1)
endif
print '(A,I1,A,A4,A,I1,A,A65,A65)','maillage '
& ,i,' de nom ',maa,' et de dimension ',mdim,
& ' de description ',desc
if (type.eq.med_unstructured_mesh) then
print *,'Maillage non structure'
else
print *,'Maillage structure'
endif
print *,'Dimension espace ', edim
print *,'Dimension maillage ', mdim
if (cnu.eq.0) then
print *,'Nom universel : ',nomu
else
print *,'Pas de nom universel'
endif
print *,'dt unit = ', dtunit
print *,'sorting type =', stype
print *,'number of computing step =', nstep
print *,'coordinates axis type =', atype
print *,'coordinates axis name =', nomcoo(1),nomcoo(2)
print *,'coordinates axis units =', unicoo(1),unicoo(2)
enddo
print *,cret
if (cret .ne. 0 ) then
print *,'Erreur fermeture du fichier'
call efexit(-1)
endif
end
subroutine mfioex(fid, class, oname, oexist, cret)
Interroge le fichier fid pour tester l'existence de l'objet objectname de type medclass.
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
subroutine mmhunr(fid, mname, uname, cret)
Cette routine permet la lecture du nom universel d'un maillage.
subroutine mmhnmh(fid, n, cret)
Cette routine permet de lire le nombre de maillages dans un fichier.
subroutine mmhmii(fid, it, name, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
Cette routine permet de lire les informations relatives à un maillage dans un fichier.