MED fichier
Unittest_MEDparameter_2.f
Aller à la documentation de ce fichier.
1C* This file is part of MED.
2C*
3C* COPYRIGHT (C) 1999 - 2020 EDF R&D, CEA/DEN
4C* MED is free software: you can redistribute it and/or modify
5C* it under the terms of the GNU Lesser General Public License as published by
6C* the Free Software Foundation, either version 3 of the License, or
7C* (at your option) any later version.
8C*
9C* MED is distributed in the hope that it will be useful,
10C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12C* GNU Lesser General Public License for more details.
13C*
14C* You should have received a copy of the GNU Lesser General Public License
15C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16C*
17
18C******************************************************************************
19C * Tests for parameter module
20C *
21C *****************************************************************************
23C
24 implicit none
25 include 'med.hf'
26C
27C
28 integer cret
29 integer*8 fid
30
31 character*64 fname
32 parameter(fname = "Unittest_MEDparameter_1.med")
33 character*64 pname1,pname2,pname
34 parameter(pname1="first parameter name")
35 parameter(pname2="second parameter name")
36 integer type1,type2,type
37 parameter(type1=med_float64, type2=med_int)
38 character*200 desc1,desc2,desc
39 parameter(desc1="First parameter description")
40 parameter(desc2="Second parameter description")
41 character*16 dtunit1,dtunit2,dtunit
42 parameter(dtunit1="unit1")
43 parameter(dtunit2="unit2")
44 integer nstep1,nstep2,nstep
45 parameter(nstep1=2,nstep2=2)
46C
47C
48C open file
49 call mfiope(fid,fname,med_acc_rdonly,cret)
50 print *,'Open file',cret
51 if (cret .ne. 0 ) then
52 print *,'ERROR : open file'
53 call efexit(-1)
54 endif
55C
56C
57C read information
58 call mprpin(fid,pname1,type,desc,dtunit,
59 & nstep,cret)
60 print *,'read information',cret
61 if (cret .ne. 0 ) then
62 print *,'ERROR : read information'
63 call efexit(-1)
64 endif
65c
66c if ( (type .ne. type1) .or.
67c & (desc .ne. desc1) .or.
68c & (dtunit .ne. dtunit1) .or.
69c & (nstep .ne. nstep1) ) then
70c print *,'ERROR : read information'
71c call efexit(-1)
72c endif
73C
74C read information
75C
76 call mprpin(fid,pname2,type,desc,dtunit,
77 & nstep,cret)
78 print *,'read information',cret
79 if (cret .ne. 0 ) then
80 print *,'ERROR : read information'
81 call efexit(-1)
82 endif
83c
84c if ((type .ne. type2) .or.
85c & (desc .ne. desc2) .or.
86c & (dtunit .ne. dtunit2) .or.
87c & (nstep .ne. nstep2)) then
88c print *,'ERROR : read information'
89c call efexit(-1)
90c endif
91C
92C
93C close file
94 call mficlo(fid,cret)
95 print *,'Close file',cret
96 if (cret .ne. 0 ) then
97 print *,'ERROR : close file'
98 call efexit(-1)
99 endif
100C
101C
102C
103 end
program medparameter2
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition medfile.f:42
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition medfile.f:82
subroutine mprpin(fid, name, type, desc, dtunit, nstep, cret)
Cette routine permet la lecture des informations relatives à un paramètre scalaire.
double med_float64
Definition med.h:328
int med_int
Definition med.h:333