implicit none
include 'med.hf'
integer*8 fid
integer ret,USER_INTERLACE,USER_MODE
integer FTYPECHA
real*8 a,b,p1,p2,dt
character*64 maa1,maa2,maa3
character*13 lien_maa2
character*16 nomcoo(3)
character*16 unicoo(3)
character*64 nomcha1
character*16 comp1(2), unit1(2)
character*16 dtunit1, nounit
integer ncomp1
integer ngauss1_1
character*64 gauss1_1
real*8 refcoo1(12), gscoo1_1(12), wg1_1(6)
integer nval1_1, nent1_1
real*8 valr1_1(1*6*2)
integer ngauss1_2
character*64 gauss1_2
real*8 gscoo1_2(6), wg1_2(3)
integer nval1_2, nent1_2
real*8 valr1_2(2*3*2)
real*8 valr1_2p(2*3)
integer ngauss1_3,nval1_3, nent1_3
real*8 valr1_3(2*3*2)
real*8 valr1_3p(2*2)
character*64 nomcha2
character*16 comp2(3), unit2(3)
integer ncomp2, nval2
integer valr2(5*3), valr2p(3*3)
character*64 nomcha3
character*16 comp3(2), unit3(2)
integer ncomp3, nval3, nent3
integer valr3(5*4*2), valr3p(3*4*2)
character*64 nomprofil1
integer profil1(2) , profil2(3)
parameter(user_interlace = med_full_interlace)
parameter(user_mode = med_compact_stmode )
parameter( a=0.446948490915965d0, b=0.091576213509771d0 )
parameter( p1=0.11169079483905d0, p2=0.0549758718227661d0 )
parameter( maa1 = "maa1", maa2 = "maa2", maa3 = "maa3" )
parameter( lien_maa2= "./testfoo.med" )
parameter( nomcha1 = "champ reel" )
parameter( ncomp1 = 2 )
parameter( dtunit1 = " ")
parameter( nounit = " ")
parameter( gauss1_1 = "Model n1" )
parameter( ngauss1_1 = 6 )
parameter( gauss1_2 = "Model n2" )
parameter( ngauss1_2 = 3 )
parameter( ngauss1_3 = 6 )
parameter( nval1_3 = 6 )
parameter( nomcha2="champ entier")
parameter( ncomp2 = 3, nval2= 5 )
parameter( nomcha3="champ entier 3")
parameter( ncomp3 = 2, nval3= 5*4 )
parameter( nomprofil1 = "PROFIL(champ(1))" )
data comp1 /"comp1", "comp2"/
data unit1 /"unit1","unit2"/
data nval1_1 / 1*6 /
data nent1_1 / 1 /
data refcoo1 / -1.0,1.0, -1.0,-1.0, 1.0,-1.0, -1.0,0.0,
1 0.0,-1.0, 0.0,0.0 /
data valr1_1 / 0.0,1.0, 2.0,3.0, 10.0,11.0, 12.0,13.0,
1 20.0,21.0, 22.0,23.0/
data nent1_2 / 2 /
data valr1_2 / 0.0,1.0, 2.0,3.0, 10.0,11.0,
1 12.0,13.0, 20.0,21.0, 22.0,23.0 /
data valr1_2p / 12.0,13.0, 20.0,21.0, 22.0,23.0 /
data nent1_3 / 6 /
data valr1_3 / 0.0,1.0, 2.0,3.0, 10.0,11.0, 12.0,13.0,
1 20.0,21.0, 22.0,23.0 /
data valr1_3p / 2.0,3.0, 10.0,11.0 /
data comp2 /"comp1", "comp2", "comp3"/
data unit2 /"unit1","unit2", "unit3"/
data valr2 / 0,1,2, 10,11,12, 20,21,22, 30,31,32, 40,41,42 /
data valr2p / 0,1,2, 20,21,22, 40,41,42 /
data nent3 / 5 /
data comp3 /"comp1", "comp2"/
data unit3 /"unit1","unit2"/
data valr3 / 0,1, 10,11, 20,21, 30,31,
1 40,41, 50,51, 60,61, 70,71,
1 80,81, 90,91, 100,101, 110,111,
1 120,121, 130,131, 140,141, 150,151,
1 160,161, 170,171, 180,181, 190,191 /
data valr3p / 0,1, 10,11, 20,21, 30,31,
1 80,81, 90,91, 100,101, 110,111,
1 160,161, 170,171, 180,181, 190,191 /
data profil1 /2,3/
data profil2 /1,3,5/
data nomcoo /"x","y","z"/, unicoo /"cm","cm","cm"/
ret = 0
gscoo1_1(1) = 2*b-1
gscoo1_1(2) = 1-4*b
gscoo1_1(3) = 2*b-1
gscoo1_1(4) = 2*b-1
gscoo1_1(5) = 1-4*b
gscoo1_1(6) = 2*b-1
gscoo1_1(7) = 1-4*a
gscoo1_1(8) = 2*a-1
gscoo1_1(9) = 2*a-1
gscoo1_1(10) = 1-4*a
gscoo1_1(11) = 2*a-1
gscoo1_1(12) = 2*a-1
wg1_1(1) = 4*p2
wg1_1(2) = 4*p2
wg1_1(3) = 4*p2
wg1_1(4) = 4*p1
wg1_1(5) = 4*p1
wg1_1(6) = 4*p1
nval1_2 = 2*3
gscoo1_2(1) = -2.0d0/3
gscoo1_2(2) = 1.0d0/3
gscoo1_2(3) = -2.0d0/3
gscoo1_2(4) = -2.0d0/3
gscoo1_2(5) = 1.0d0/3
gscoo1_2(6) = -2.0d0/3
wg1_2(1) = 2.0d0/3
wg1_2(2) = 2.0d0/3
wg1_2(3) = 2.0d0/3
call mfivop(fid,
'test10f.med', med_acc_rdwr,
& med_major_num, med_minor_num, med_release_num, ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''ouverture du fichier : ','test10.med'
call efexit(-1)
endif
& med_unstructured_mesh,'Maillage vide',
& "",med_sort_dtit,med_cartesian,nomcoo,unicoo,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du maillage : ', maa1
call efexit(-1)
endif
& med_unstructured_mesh,'Maillage vide',
& "",med_sort_dtit,med_cartesian,nomcoo,unicoo,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du maillage : ', maa3
call efexit(-1)
endif
call mfdcre(fid,nomcha1,ftypecha,ncomp1,comp1,unit1,
& dtunit1,maa1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du champ : ', nomcha1
call efexit(-1)
endif
& dtunit1,maa1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du champ : ', nomcha2
call efexit(-1)
endif
call mlnliw(fid,maa2,lien_maa2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du lien : ', lien_maa2
call efexit(-1)
endif
call mlclow(fid,gauss1_1,med_tria6,2,refcoo1,user_interlace,
& ngauss1_1,gscoo1_1, wg1_1,med_no_interpolation,
& med_no_mesh_support, ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du modèle n°1 : ', gauss1_1
call efexit(-1)
endif
call mlclow(fid,gauss1_2,med_tria6,2,refcoo1,user_interlace,
& ngauss1_2,gscoo1_2, wg1_2,med_no_interpolation,
& med_no_mesh_support, ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du modèle n°2 : ', gauss1_2
call efexit(-1)
endif
dt = 0.0
call mfdrpw(fid,nomcha1,med_no_dt,med_no_it,dt,med_cell,
& med_tria6,user_mode,med_allentities_profile,
& gauss1_1,user_interlace,2,nent1_1,valr1_1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.1'
call efexit(-1)
endif
call mfdrpw(fid,nomcha1,med_no_dt,med_no_it,dt,med_cell,
& med_tria6,user_mode,med_allentities_profile,
& gauss1_1,user_interlace,1,nent1_1,valr1_1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.2'
call efexit(-1)
endif
dt = 5.5
call mfdrpw(fid,nomcha1,1,med_no_it,dt,med_cell,med_tria6,
& user_mode,med_allentities_profile,gauss1_2,
& user_interlace,1,nent1_2,valr1_2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.3'
call efexit(-1)
endif
call mfdrpw(fid,nomcha1,1,med_no_it,dt,med_cell,med_tria6,
& user_mode,med_allentities_profile,gauss1_2,
& user_interlace,2,nent1_2,valr1_2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.4'
call efexit(-1)
endif
call mfdrpw(fid,nomcha1,1,2,dt,med_cell,med_tria6,
& user_mode,med_allentities_profile,gauss1_1,
& user_interlace,1,nent1_1,valr1_1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.5'
call efexit(-1)
endif
call mpfprw(fid,nomprofil1,1,profil1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du profil : ', nomprofil1
call efexit(-1)
endif
dt = 5.6
call mfdrpw(fid,nomcha1,2,2,dt,med_cell,med_tria6,
& user_mode, nomprofil1, med_no_localization,
& user_interlace,med_all_constituent,
& nval1_3,valr1_3p,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.6'
call efexit(-1)
endif
call mfdrpw(fid,nomcha1,2,2,dt,med_cell,med_tria6,
& user_mode, nomprofil1, gauss1_2,
& user_interlace,med_all_constituent,
& nent1_2,valr1_2p,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.7'
call efexit(-1)
endif
dt = 5.7
call mfdrpw(fid,nomcha1,3,2,dt,med_cell,med_tria6,
& user_mode, nomprofil1, med_no_localization,
& user_interlace,2,
& nent1_3,valr1_3p,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.8a'
call efexit(-1)
endif
dt = 5.7
call mfdrpw(fid,nomcha1,3,2,dt,med_cell,med_tria6,
& user_mode, nomprofil1, med_no_localization,
& user_interlace,1,
& nent1_3,valr1_3p,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha1,'et.8b'
call efexit(-1)
endif
dt = 0.0
call mfdivw(fid,nomcha2,med_no_dt,med_no_it,dt,
& med_descending_edge,med_seg2,user_interlace,
& 1,nval2,valr2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha2,'et.1'
call efexit(-1)
endif
call mfdivw(fid,nomcha2,med_no_dt,med_no_it,dt,
& med_node,med_none,user_interlace,
& 2,nval2,valr2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha2,'et.2'
call efexit(-1)
endif
call mfdivw(fid,nomcha2,med_no_dt,med_no_it,dt,
& med_descending_face,med_tria6,user_interlace,
& 3,nval2,valr2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha2,'et.3'
call efexit(-1)
endif
call mpfprw(fid,
"PROFIL(champ2)",3,profil2,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du profil : ',
1 'profil2(champ2)'
call efexit(-1)
endif
call mfdipw(fid,nomcha2,med_no_dt,med_no_it,dt,
& med_cell,med_tria6,user_mode,"PROFIL(champ2)",
& med_no_localization,user_interlace,3,
& nval2,valr2p,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du profil : ',
1 'profil2(champ2)'
call efexit(-1)
endif
& dtunit1,maa1,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à la création du champ : ', nomcha3
call efexit(-1)
endif
call mfdivw(fid,nomcha3,med_no_dt,med_no_it,dt,
& med_cell,med_quad4,user_interlace,
& 1,nval3,valr3,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha3,'et.1'
call efexit(-1)
endif
call mfdivw(fid,nomcha3,med_no_dt,med_no_it,dt,
& med_node_element,med_quad4,user_interlace,
& med_all_constituent,nent3,valr3,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du champ : ', nomcha3,'et.2'
call efexit(-1)
endif
call mfdipw(fid,nomcha3,med_no_dt,med_no_it,dt,
& med_node_element,med_quad4,user_mode,
& "PROFIL(champ2)",med_no_localization,
& user_interlace,med_all_constituent,
& nent3,valr3p,ret)
print *,ret
if (ret .ne. 0 ) then
print *,'Erreur à l''écriture du profil : ',
1 'profil2(champ2)'
call efexit(-1)
endif
if (ret .ne. 0 ) then
print *,'Erreur à la fermeture du fichier : '
ret = -1
endif
print *,"Le code retour : ",ret
call efexit(ret)
end
subroutine mfdcre(fid, fname, ftype, ncomp, cname, cunit, dtunit, mname, cret)
Cette fonction crée un champ dans un fichier.
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
subroutine mfivop(fid, name, access, major, minor, rel, cret)
Ouverture d'un fichier MED en indiquant la version du modèle à utiliser en cas de création d'un nouve...
subroutine mlnliw(fid, mname, lname, cret)
Cette routine permet d'écrire un lien dans un fichier MED.
subroutine mmhcre(fid, name, sdim, mdim, mtype, desc, dtunit, stype, atype, aname, aunit, cret)
Cette routine permet de créer un maillage dans un fichier.
subroutine mfdrpw(fid, fname, numdt, numit, dt, etype, gtype, stm, pname, lname, swm, cs, n, val, cret)
subroutine mfdipw(fid, fname, numdt, numit, dt, etype, gtype, stm, pname, lname, swm, cs, n, val, cret)
subroutine mfdivw(fid, fname, numdt, numit, dt, etype, gtype, swm, cs, n, val, cret)
subroutine mlclow(fid, lname, gtype, sdim, ecoo, swm, nip, ipcoo, wght, giname, isname, cret)
subroutine mpfprw(fid, pname, psize, profil, cret)