1 subroutine da_get_dims_cdf(file, var, dims, ndims, debug)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
11 character (len=*), intent(in) :: file
12 character (len=*), intent(in) :: var
13 logical, intent(in) :: debug
14 integer, intent(out) :: dims(4)
15 integer, intent(out) :: ndims
17 integer :: cdfid, rcode, id_time
18 character (len=80) :: varnam
19 integer :: natts, dimids(10)
22 ! if (trace_use) call da_trace_entry("da_get_dims_cdf")
24 cdfid = ncopn(file, NCNOWRIT, rcode)
27 if (debug) write(unit=stdout,fmt=*) ' open netcdf file ', trim(file)
29 write(unit=stdout,fmt=*) ' error openiing netcdf file ', trim(file)
33 id_time = ncvid(cdfid, var, rcode)
35 rcode = nf_inq_var(cdfid, id_time, varnam, ivtype, ndims, dimids, natts)
37 write(unit=stdout,fmt=*) ' number of dims for ',var,' ',ndims
40 rcode = nf_inq_dimlen(cdfid, dimids(i), dims(i))
41 if (debug) write(unit=stdout,fmt=*) ' dimension ',i,dims(i)
44 call ncclos(cdfid,rcode)
46 ! if (trace_use) call da_trace_exit("da_get_dims_cdf")
48 end subroutine da_get_dims_cdf