1 subroutine da_get_att_cdf(file, var, debug)
3 !-----------------------------------------------------------------------
5 !-----------------------------------------------------------------------
11 character (len=*), intent(in) :: file
12 character (len=*), intent(in) :: var
13 logical, intent(in) :: debug
15 integer :: cdfid, status, varid, n, natts
16 character (len=256) :: att_name
18 ! if (trace_use) call da_trace_entry("da_get_att_cdf")
20 status = NF_OPEN(file, NF_NOWRITE, cdfid)
22 status = NF_inQ_VARID(cdfid, var, varid)
25 if (debug) write(unit=stdout,fmt=*) ' open netcdf file ', trim(file)
27 write(unit=stdout,fmt=*) ' error openiing netcdf file ', trim(file)
31 status = NF_inQ_VARNATTS(cdfid, varid, natts)
34 status = NF_inQ_ATTNAME(cdfid, varid, n, att_name)
36 write(unit=stdout, fmt='(a,i2,2a)') &
37 'att_name(',n,')=', trim(att_name)
40 status = NF_close(cdfid)
42 ! if (trace_use) call da_trace_exit("da_get_att_cdf")
44 end subroutine da_get_att_cdf