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=80), 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 cdfid = ncopn(file, NCNOWRIT, rcode)
19
20 if (rcode == 0) then
21 if (debug) write(unit=stdout,fmt=*) ' open netcdf file ', trim(file)
22 else
23 write(unit=stdout,fmt=*) ' error openiing netcdf file ', trim(file)
24 stop
25 end if
26
27 rcode = NF_GET_ATT_inT(cdfid, nf_global, att_name, value)
28
29 call ncclos(cdfid,rcode)
30
31 if (debug) write(unit=stdout,fmt=*) ' global attribute ',att_name,' is ',value
32
33 end subroutine da_get_gl_att_int_cdf
34
35