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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 138 - (show annotations)
Fri May 22 23:13:19 2015 UTC (9 years, 1 month ago) by guez
File size: 1113 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 histclo_m
2
3 implicit none
4
5 contains
6
7 SUBROUTINE histclo(fid)
8
9 ! This subroutine will close the file corresponding
10 ! to the argument, if the argument is present. Else it will close
11 ! all opened files.
12
13 USE errioipsl, ONLY: histerr
14 use histbeg_totreg_m, ONLY: nb_files
15 USE histcom_var, ONLY: ncdf_ids
16 USE netcdf, ONLY: nf90_close, nf90_noerr
17
18 INTEGER, INTENT (IN), OPTIONAL:: fid ! file id
19
20 ! Variables local to the procedure:
21 INTEGER ifile, ncid, iret
22 INTEGER start_loop, end_loop
23 CHARACTER(len=70) str70
24
25 !---------------------------------------------------------------------
26
27 IF (present(fid)) THEN
28 start_loop = fid
29 end_loop = fid
30 ELSE
31 start_loop = 1
32 end_loop = nb_files
33 END IF
34
35 DO ifile = start_loop, end_loop
36 ncid = ncdf_ids(ifile)
37 iret = nf90_close(ncid)
38 IF (iret/=nf90_noerr) THEN
39 WRITE(str70, '("This file has already been closed:", I3)') ifile
40 CALL histerr(2, 'histclo', str70, '', '')
41 END IF
42 END DO
43
44 END SUBROUTINE histclo
45
46 end module histclo_m

  ViewVC Help
Powered by ViewVC 1.1.21