da_get_gl_att_int_cdf.inc

References to this file elsewhere.
1 subroutine da_get_gl_att_int_cdf(file, att_name, value, debug)
2  
3    !-----------------------------------------------------------------------
4    ! Purpose: TBD
5    !-----------------------------------------------------------------------
6         
7    implicit none
8 
9 #include "netcdf.inc"
10 
11    character (len=*),  intent(in)  :: file
12    character (len=*),  intent(in)  :: att_name
13    logical,            intent(in)  :: debug
14    integer,            intent(out) :: value
15 
16    integer :: cdfid, rcode
17 
18    ! if (trace_use_dull) call da_trace_entry("da_get_gl_att_int_cdf")
19 
20    cdfid = ncopn(file, NCNOWRIT, rcode)
21 
22    if (rcode == 0) then
23      if (debug) write(unit=stdout,fmt=*) ' open netcdf file ', trim(file)
24    else
25      write(unit=stdout,fmt=*) ' error openiing netcdf file ', trim(file)
26      stop
27    end if
28 
29    rcode = NF_GET_ATT_inT(cdfid, nf_global, att_name, value)
30 
31    call ncclos(cdfid,rcode)
32 
33    if (debug) write(unit=stdout,fmt=*) ' global attribute ',att_name,' is ',value
34 
35    ! if (trace_use_dull) call da_trace_exit("da_get_gl_att_int_cdf")
36 
37 end subroutine da_get_gl_att_int_cdf
38 
39