gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
gdncfilereopen.f90
Go to the documentation of this file.
1!>
2!> @file gdncfilereopen.f90
3!>
4!> @author Yasuhiro MORIKAWA, Eizi TOYODA
5!> @copyright Copyright (C) GFD Dennou Club, 2000-2026. All rights reserved. <br/>
6!> License is BSD-2-Clause. See [COPYRIGHT](@ref COPYRIGHT) in detail
7!>
8!> @en
9!> @brief Increment reference count of an open netCDF file
10!> @enden
11!>
12!> @ja
13!> @brief オープン中の netCDF ファイルの参照カウントを増加
14!> @endja
15!>
16
17!>
18!> @en
19!> @brief Increment reference count of an open netCDF file
20!>
21!> Searches the internal file list for the given file ID and increments
22!> its reference count. Returns an error if the file ID is not found.
23!> @enden
24!>
25!> @ja
26!> @brief オープン中の netCDF ファイルの参照カウントを増加
27!>
28!> 内部ファイルリストから指定されたファイル ID を検索し、
29!> 参照カウントを増加させます。ファイル ID が見つからない場合はエラーを返します。
30!> @endja
31!>
32!> @param[in] fileid @en netCDF file ID @enden @ja netCDF ファイル ID @endja
33!> @param[out] err @en Error flag (optional) @enden @ja エラーフラグ (省略可能) @endja
34!>
35subroutine gdncfilereopen(fileid, err)
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')
63end subroutine gdncfilereopen
subroutine gdncfilereopen(fileid, err)
エラー処理用モジュール
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
デバッグ時の追跡用モジュール
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
id_head が初期化済みかを示すフラグ
type(gd_nc_file_id_entry), pointer, save id_head
netCDF ファイルのオープンクローズのための ID テーブル