5 use netcdf
, only: nf90_close, nf90_enotnc, nf90_noerr
8 integer,
intent(in):: fileid
9 logical,
intent(out),
optional:: err
12 character(*),
parameter:: subname =
"GDNcFileClose" 20 if (.not.
associated(identptr))
goto 999
21 if (identptr % id == fileid)
exit 23 identptr => identptr % next
25 identptr % count = identptr % count - 1
26 if (identptr % count <= 0)
then 27 stat = nf90_close(fileid)
28 if (
associated(prev))
then 29 prev%next => identptr % next
34 call dbgmessage(subname //
': <%c> closed', c1=trim(identptr % filename))
37 call dbgmessage(subname //
': %d<%c> skipped for refcount=%d', &
38 & c1=trim(identptr % filename), i=(/fileid, identptr % count/))
subroutine gdncfileclose(fileid, err)
subroutine, public storeerror(number, where, err, cause_c, cause_i)
type(gd_nc_file_id_entry), pointer, save id_head
subroutine, public dbgmessage(fmt, i, r, d, L, n, c1, c2, c3, ca)
subroutine, public beginsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca, version)
subroutine, public endsub(name, fmt, i, r, d, L, n, c1, c2, c3, ca)