Loading...
Searching...
No Matches
Functions/Subroutines
gdncfilesync.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine gdncfilesync (fileid, stat)
 

Function/Subroutine Documentation

◆ gdncfilesync()

subroutine gdncfilesync ( integer, intent(in), optional  fileid,
integer, intent(out), optional  stat 
)

Definition at line 1 of file gdncfilesync.f90.

5 use netcdf, only: nf90_sync, nf90_noerr
6 use dc_error
7 integer, intent(in), optional:: fileid
8 integer, intent(out), optional:: stat
9 integer:: ncid, mystat
10 type(GD_NC_FILE_ID_ENTRY), pointer:: identptr
11continue
12 mystat = nf90_noerr
13 if (present(fileid)) then
14 ncid = fileid
15 mystat = gdncfiledatamode(ncid)
16 if (mystat /= nf90_noerr) goto 999
17 mystat = nf90_sync(ncid)
18 else if (id_used) then
19 identptr => id_head
20 do
21 if (.not. associated(identptr)) exit
22 ncid = identptr % id
23 mystat = gdncfiledatamode(ncid)
24 if (mystat /= nf90_noerr) exit
25 mystat = nf90_sync(ncid)
26 if (mystat /= nf90_noerr) exit
27 identptr => identptr % next
28 enddo
29 endif
30999 continue
31 ! 自発的には StoreError しない。StoreError の SysdepAbort
32 ! からも呼ばれる可能性があるためである。
33 if (present(stat)) stat = mystat
type(gd_nc_file_id_entry), pointer, save id_head

References gtdata_netcdf_file_internal::id_head, and gtdata_netcdf_file_internal::id_used.