11 |
|
|
12 |
! file: optional argument for fileid |
! file: optional argument for fileid |
13 |
|
|
14 |
USE histcom_var, ONLY: nb_files, ncdf_ids |
use histbeg_totreg_m, ONLY: nb_files |
15 |
USE netcdf, ONLY: nf90_sync |
USE histcom_var, ONLY: ncdf_ids |
16 |
|
USE netcdf95, ONLY: nf95_sync |
17 |
|
|
18 |
INTEGER, INTENT(IN), OPTIONAL:: file |
INTEGER, INTENT(IN), OPTIONAL:: file |
19 |
|
|
20 |
INTEGER:: ifile, ncid, iret |
INTEGER:: ifile, ncid |
21 |
|
|
22 |
LOGICAL:: file_exists |
LOGICAL:: file_exists |
23 |
!--------------------------------------------------------------------- |
!--------------------------------------------------------------------- |
25 |
! 1.The loop on files to synchronise |
! 1.The loop on files to synchronise |
26 |
|
|
27 |
DO ifile = 1, nb_files |
DO ifile = 1, nb_files |
|
|
|
28 |
IF (present(file)) THEN |
IF (present(file)) THEN |
29 |
file_exists = (ifile==file) |
file_exists = (ifile==file) |
30 |
ELSE |
ELSE |
33 |
|
|
34 |
IF (file_exists) THEN |
IF (file_exists) THEN |
35 |
ncid = ncdf_ids(ifile) |
ncid = ncdf_ids(ifile) |
36 |
iret = nf90_sync(ncid) |
call nf95_sync(ncid) |
37 |
END IF |
END IF |
|
|
|
38 |
END DO |
END DO |
39 |
|
|
40 |
END SUBROUTINE histsync |
END SUBROUTINE histsync |