5 use netcdf
, only: nf90_get_att, nf90_noerr
24 integer,
intent( in) :: ncid, varid
25 character(len = *),
intent( in) :: name
26 character(len = *),
intent(out) :: values
27 integer,
intent(out),
optional:: ncerr
38 if (ncerr_not_opt == nf90_noerr)
then
39 if (len(values) < att_len)
then
40 print *,
"nf95_get_att_text"
41 print *,
"varid = ", varid
42 print *,
"attribute name: ", name
43 print *,
'length of "values" is not large enough'
44 print *,
"len(values) = ", len(values)
45 print *,
"number of characters in attribute: ", att_len
51 ncerr_not_opt = nf90_get_att(ncid, varid, name, values)
52 if (
present(ncerr))
then
55 call handle_err(
"nf95_get_att_text " // trim(name), ncerr_not_opt, &
59 if (att_len >= 1 .and. ncerr_not_opt == nf90_noerr)
then
61 if (iachar(values(att_len:att_len)) == 0) values(att_len:att_len) =
" "
70 integer,
intent( in) :: ncid, varid
71 character(len = *),
intent( in) :: name
72 integer ,
intent(out) :: values
73 integer,
intent(out),
optional:: ncerr
84 if (ncerr_not_opt == nf90_noerr)
then
85 if (att_len /= 1)
then
86 print *,
"nf95_get_att_one_FourByteInt"
87 print *,
"varid = ", varid
88 print *,
"attribute name: ", name
89 print *,
'the attribute does not contain a single value'
90 print *,
"number of values in attribute: ", att_len
95 ncerr_not_opt = nf90_get_att(ncid, varid, name, values)
96 if (
present(ncerr))
then
99 call handle_err(
"nf95_get_att_one_FourByteInt " // trim(name), &
100 ncerr_not_opt, ncid, varid)
subroutine handle_err(status)
subroutine nf95_get_att_text(ncid, varid, name, values, ncerr)
subroutine nf95_inquire_attribute(ncid, varid, name, xtype, nclen, attnum, ncerr)
subroutine nf95_get_att_one_fourbyteint(ncid, varid, name, values, ncerr)