gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
gdncfilereopen.f90 File Reference

Increment reference count of an open netCDF file . More...

Go to the source code of this file.

Functions/Subroutines

subroutine gdncfilereopen (fileid, err)

Detailed Description

Increment reference count of an open netCDF file

.

Author
Yasuhiro MORIKAWA, Eizi TOYODA

Definition in file gdncfilereopen.f90.

Function/Subroutine Documentation

◆ gdncfilereopen()

subroutine gdncfilereopen ( integer, intent(in) fileid,
logical, intent(out), optional err )

Increment reference count of an open netCDF file

Searches the internal file list for the given file ID and increments its reference count. Returns an error if the file ID is not found.

Parameters
[in]fileidnetCDF file ID
[out]errError flag (optional)

Definition at line 35 of file gdncfilereopen.f90.

38 use netcdf, only: nf90_enotnc
39 use dc_error, only: storeerror
41 implicit none
42 integer, intent(in):: fileid
43 logical, intent(out), optional:: err
44 type(GD_NC_FILE_ID_ENTRY), pointer:: identptr
45 character(*), parameter:: subname = "GDNcFileReopen"
46continue
47 call beginsub(subname, 'file=%d', i=(/fileid/))
48 if (id_used) then
49 identptr => id_head
50 do
51 if (identptr % id == fileid) then
52 identptr % count = identptr % count + 1
53 if (present(err)) err = .false.
54 call endsub(subname, 'count=%d', i=(/identptr % count/))
55 return
56 endif
57 identptr => identptr % next
58 if (.not. associated(identptr)) exit
59 enddo
60 endif
61 call storeerror(nf90_enotnc, 'GDNcFileReopen', err, cause_i=fileid)
62 call endsub(subname, 'err')
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:680
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:476
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:599
logical, save id_used
Flag indicating whether id_head has been initialized
type(gd_nc_file_id_entry), pointer, save id_head
ID table for open/close of netCDF files

References dc_trace::beginsub(), dc_trace::dbgmessage(), dc_trace::endsub(), gtdata_netcdf_file_internal::id_head, gtdata_netcdf_file_internal::id_used, and dc_error::storeerror().

Here is the call graph for this function: