Parent Directory | Revision Log
Moved variables date0, deltat, datasz_max, ncvar_ids, point, buff_pos, buffer, regular from module histcom_var to modules where they are defined. Removed procedure ioipslmpp, useless for a sequential program. Added argument datasz_max to histwrite_real (to avoid circular dependency with histwrite). Removed useless variables and computations everywhere. Changed real litteral constants from default kind to double precision in lwb, lwu, lwvn, sw1s, swtt, swtt1, swu. Removed unused arguments: paer of sw, sw1s, sw2s, swclr; pcldsw of sw1s, sw2s; pdsig, prayl of swr; co2_ppm of clmain, clqh; tsol of transp_lay; nsrf of screenp; kcrit and kknu of gwstress; pstd of orosetup. Added output of relative humidity.
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 | print *, "Call sequence information: histclo" |
28 | |
29 | IF (present(fid)) THEN |
30 | start_loop = fid |
31 | end_loop = fid |
32 | ELSE |
33 | start_loop = 1 |
34 | end_loop = nb_files |
35 | END IF |
36 | |
37 | DO ifile = start_loop, end_loop |
38 | ncid = ncdf_ids(ifile) |
39 | iret = nf90_close(ncid) |
40 | IF (iret/=nf90_noerr) THEN |
41 | WRITE(str70, '("This file has already been closed:", I3)') ifile |
42 | CALL histerr(2, 'histclo', str70, '', '') |
43 | END IF |
44 | END DO |
45 | |
46 | END SUBROUTINE histclo |
47 | |
48 | end module histclo_m |
ViewVC Help | |
Powered by ViewVC 1.1.21 |