Subversion Repositories lagranto.wrf

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 michaesp 1
C     ********************************************************************
2
 
3
      program getvarnames
4
 
5
C     ********************************************************************
6
 
7
      implicit none
8
 
9
      include 'netcdf.inc'
10
 
11
      integer   ndims,nvars,ngatts,recdim,ierr
12
      integer   vartyp,ndim,nvatts,vardim(4)
13
      integer   cdfid,i
14
      character*80 cdfname
15
      character*20 vnam(100)
16
 
17
      integer   iargc
18
      character*(80) arg
19
 
20
c     check for sufficient requested arguments
21
      if (iargc().ne.1) then
22
         print*,'USAGE: getvars NetCDF-filename'
23
         call exit(1)
24
      endif
25
 
26
c     read and transform input
27
      call getarg(1,arg)
28
      cdfname=trim(arg)
29
 
30
      call cdfopn(cdfname,cdfid,ierr)
31
 
32
      call getvars(cdfid,nvars,vnam,ierr)
33
 
34
C     Write variable names to output
35
 
36
      do i=1,nvars
37
        write(*,*)vnam(i)
38
      enddo
39
 
40
C     Close the files
41
 
42
      call clscdf(cdfid,ierr)
43
 
44
      end