1 subroutine da_get_times_cdf(file, times, n_times, max_times, debug)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
11 integer, intent(in) :: max_times
12 integer, intent(out) :: n_times
13 character (len=*), intent(in) :: file
14 character (len=80), intent(out) :: times(max_times)
15 logical, intent(in) :: debug
17 integer :: cdfid, rcode, id_time
18 character (len=80) :: varnam, time1
19 integer :: ndims, natts, idims(10), istart(10),iend(10), dimids(10)
22 ! if (trace_use) call da_trace_entry("da_get_times_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, 'Times', rcode)
35 rcode = nf_inq_var(cdfid, id_time, varnam, ivtype, ndims, dimids, natts)
37 write(unit=stdout,fmt=*) ' number of dims for Time ',ndims
40 rcode = nf_inq_dimlen(cdfid, dimids(i), idims(i))
41 if (debug) write(unit=stdout,fmt=*) ' dimension ',i,idims(i)
53 rcode = NF_GET_VARA_TEXT (cdfid, id_time, &
58 if (debug) write(unit=stdout,fmt=*) trim(file), time1(1:19)
59 times(i) = time1(1:19)
62 write(unit=stdout,fmt=*) ' exiting get_times_cdf '
64 call ncclos(cdfid,rcode)
66 ! if (trace_use) call da_trace_exit("da_get_times_cdf")
68 end subroutine da_get_times_cdf