Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
PROGRAM testinfo
USE mode_util
#ifdef NAGf95
USE F90_UNIX
#endif
IMPLICIT NONE
CHARACTER(LEN=80) :: yfilename
CHARACTER(LEN=50) :: yexe
INTEGER :: ibuflen
#ifndef NAGf95
INTEGER :: IARGC
! CRAY specific
INTEGER :: arglen
INTEGER :: iresp
!!!!!!!!!!!!!!!!!
#endif
INTEGER :: inarg
INTEGER :: ilu
INTEGER :: inaf
INTEGER :: icdf_id
TYPE(workfield), DIMENSION(:), POINTER :: tzreclist
LOGICAL :: glfi2cdf
INARG = IARGC()
#if defined(F90HP)
#define HPINCR 1
#else
#define HPINCR 0
#endif
#if defined(FUJI) || defined(NAGf95) || defined(NEC) || defined(HP) || defined(pgf) || defined(G95) || defined(GFORTRAN)
CALL GETARG(0+HPINCR,yexe)
IF (LEN_TRIM(yexe) == 0) THEN
PRINT *, 'FATAL ERROR : Activer la macro -DF90HP dans le Makefile et recompiler'
STOP
END IF
#else
CALL PXFGETARG(0,yexe,arglen,iresp)
#endif
! PRINT *,yexe, ' avec ',INARG,' arguments.'
IF (INARG == 1) THEN
#if defined(FUJI) || defined(NAGf95) || defined(NEC) || defined(HP) || defined(pgf) || defined(G95) || defined(GFORTRAN)
CALL GETARG(1+HPINCR,yfilename)
#else
CALL PXFGETARG(1,yfilename,arglen,iresp)
#endif
ELSE
PRINT *,'Usage : ', TRIM(yexe), ' [fichier lfi]'
STOP
END IF
glfi2cdf = (INDEX(yexe,'lfi2cdf') /= 0)
! CALL SAMPSTART
CALL OPEN_FILES(glfi2cdf, yfilename, icdf_id, ilu, inaf)
IF (glfi2cdf) THEN
! Conversion LFI -> NetCDF
CALL parse_lfi(ilu,inaf,tzreclist,ibuflen)
CALL def_ncdf(tzreclist,icdf_id)
CALL fill_ncdf(ilu,icdf_id,tzreclist,ibuflen)
ELSE
! Conversion NetCDF -> LFI
CALL parse_cdf(icdf_id,tzreclist,ibuflen)
CALL build_lfi(icdf_id,ilu,tzreclist,ibuflen)
END IF
CALL CLOSE_FILES(ilu,icdf_id)
! CALL SAMPSTOP
END PROGRAM testinfo