2
!!======================================================================
3
!! *** PROGRAM cdfinfo ***
4
!!=====================================================================
5
!! ** Purpose : Give very basic informations for Netcdf File
7
!! ** Method : to be improved
9
!! History : 2.1 : 09/2010 : J.M. Molines : Original code
10
!! 3.0 : 01/2011 : J.M. Molines : Doctor norm + Lic.
11
!!----------------------------------------------------------------------
14
!!----------------------------------------------------------------------
15
!! CDFTOOLS_3.0 , MEOM 2011
17
!! Copyright (c) 2011, J.-M. Molines
18
!! Software governed by the CeCILL licence (Licence/CDFTOOLSCeCILL.txt)
19
!!----------------------------------------------------------------------
22
INTEGER(KIND=4) :: jvar ! dummy loop index
23
INTEGER(KIND=4) :: ierr ! working integer
24
INTEGER(KIND=4) :: narg, iargc !
25
INTEGER(KIND=4) :: npiglo, npjglo, npk ,npt ! size of the domain
26
INTEGER(KIND=4) :: nvars ! Number of variables in a file
28
CHARACTER(LEN=256) :: cf_in ! file name
29
CHARACTER(LEN=256) :: cv_dep ! depth name
30
CHARACTER(LEN=256), DIMENSION(:), ALLOCATABLE :: cv_names ! array of var name
32
TYPE(variable), DIMENSION(:), ALLOCATABLE :: stypvar ! variable attributes
33
!!----------------------------------------------------------------------
39
PRINT *,' usage : cdfinfo ''model cdf file'' '
42
PRINT *,' Gives very basic information about the file given in arguments.'
44
PRINT *,' ARGUMENTS :'
45
PRINT *,' model output file in netcdf.'
48
PRINT *,' On standard ouput, gives the size of the domain, the depth '
49
PRINT *,' dimension name, the number of variables.'
54
CALL getarg (1, cf_in)
55
IF ( chkfile(cf_in) ) STOP ! missing file
57
npiglo = getdim (cf_in,cn_x)
58
npjglo = getdim (cf_in,cn_y)
59
npk = getdim (cf_in,cn_z, cdtrue=cv_dep, kstatus=ierr)
62
npk = getdim (cf_in,'z',cdtrue=cv_dep,kstatus=ierr)
64
npk = getdim (cf_in,'sigma',cdtrue=cv_dep,kstatus=ierr)
66
npk = getdim (cf_in,'nav_lev',cdtrue=cv_dep,kstatus=ierr)
68
npk = getdim (cf_in,'levels',cdtrue=cv_dep,kstatus=ierr)
70
PRINT *,' assume file with no depth'
78
npt = getdim (cf_in,cn_t)
80
PRINT *, 'npiglo =', npiglo
81
PRINT *, 'npjglo =', npjglo
85
PRINT *,' Depth dimension name is ', TRIM(cv_dep)
87
nvars = getnvar(cf_in)
88
PRINT *,' nvars =', nvars
90
ALLOCATE (cv_names(nvars) )
91
ALLOCATE (stypvar(nvars) )
93
! get list of variable names
94
cv_names(:)=getvarname(cf_in, nvars, stypvar)
97
PRINT *, 'variable# ',jvar,' is : ',TRIM(cv_names(jvar))