/[lmdze]/trunk/Sources/IOIPSL/Histcom/histsync.f
ViewVC logotype

Contents of /trunk/Sources/IOIPSL/Histcom/histsync.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 138 - (show annotations)
Fri May 22 23:13:19 2015 UTC (9 years ago) by guez
File size: 856 byte(s)
Moved variable nb_files from module histcom_var to module
histbeg_totreg_m.

Removed unused argument q of writehist.

No history file is created in program ce0l so there is no need to call
histclo in etat0.

In phyredem, access variables rlat and rlon directly from module
phyetat0_m instead of having them as arguments. This is clearer for
the program gcm. There are bad side effects for the program ce0l: we
have to modify the module variables rlat and rlon in procedure etat0,
and we need the additional file phyetat0.f to compile ce0l.

1 module histsync_m
2
3 implicit none
4
5 contains
6
7 SUBROUTINE histsync(file)
8
9 ! This subroutine will synchronise all
10 ! (or one if defined) opened files.
11
12 ! file: optional argument for fileid
13
14 use histbeg_totreg_m, ONLY: nb_files
15 USE histcom_var, ONLY: ncdf_ids
16 USE netcdf, ONLY: nf90_sync
17
18 INTEGER, INTENT(IN), OPTIONAL:: file
19
20 INTEGER:: ifile, ncid, iret
21
22 LOGICAL:: file_exists
23 !---------------------------------------------------------------------
24
25 ! 1.The loop on files to synchronise
26
27 DO ifile = 1, nb_files
28
29 IF (present(file)) THEN
30 file_exists = (ifile==file)
31 ELSE
32 file_exists = .TRUE.
33 END IF
34
35 IF (file_exists) THEN
36 ncid = ncdf_ids(ifile)
37 iret = nf90_sync(ncid)
38 END IF
39
40 END DO
41
42 END SUBROUTINE histsync
43
44 end module histsync_m

  ViewVC Help
Powered by ViewVC 1.1.21