25#if defined PIO_LIB && defined DISTRIBUTE
47 integer,
intent(in) :: ng, model
49 TYPE(
t_io),
intent(inout) :: s
51 logical,
intent(in),
optional :: lupdate
53 character (len=*),
intent(in),
optional :: ncname
57 integer :: closedstate = -1
59 character (len=*),
parameter :: myfile = &
60 & __FILE__//
", close_file_nf90"
66 SELECT CASE (s%IOtype)
68 IF (s%ncid.ne.closedstate)
THEN
70 & trim(ncname), lupdate)
74#if defined PIO_LIB && defined DISTRIBUTE
76 IF (
ASSOCIATED(s%pioFile%iosystem))
THEN
77 IF (s%pioFile%fh.ne.closedstate)
THEN
79 & trim(ncname), lupdate)
80 s%pioFile%fh=closedstate
96 integer,
intent(in) :: ng, model
102 character (len=*),
parameter :: myfile = &
103 & __FILE__//
", close_inp"
121 IF ((
frc(i,ng)%Nfiles.gt.0).and.(
frc(i,ng)%ncid.ne.-1))
THEN
122 fcount=
frc(i,ng)%Fcount
124 &
frc(i,ng)%files(fcount), .false.)
129 frc(i,ng)%Fcount=fcount
130 frc(i,ng)%name=trim(
frc(i,ng)%files(fcount))
139 IF ((
bry(i,ng)%Nfiles.gt.0).and.(
bry(i,ng)%ncid.ne.-1))
THEN
140 fcount=
bry(i,ng)%Fcount
142 &
bry(i,ng)%files(fcount), .false.)
147 bry(i,ng)%Fcount=fcount
148 bry(i,ng)%name=trim(
bry(i,ng)%files(fcount))
157 IF ((
clm(i,ng)%Nfiles.gt.0).and.(
clm(i,ng)%ncid.ne.-1))
THEN
158 fcount=
clm(i,ng)%Fcount
160 &
clm(i,ng)%files(fcount), .false.)
165 clm(i,ng)%Fcount=fcount
166 clm(i,ng)%name=trim(
clm(i,ng)%files(fcount))
184 logical :: first, lupdate
186 integer :: fcount, myerror, i, ivalue, ng
188 character (len=256) :: ana_string
190 character (len=*),
parameter :: myfile = &
191 & __FILE__//
", close_out"
216#if defined FOUR_DVAR || defined ENKF_RESTART || defined VERIFICATION
220#if defined FORWARD_READ || defined FORWARD_WRITE
222 IF ((
fwd(ng)%ncid.ne.-1).and. &
223 & (
fwd(ng)%ncid.eq.
his(ng)%ncid))
THEN
226# if defined PIO_LIB && defined DISTRIBUTE
228 IF ((
fwd(ng)%pioFile%fh.ne.-1).and. &
229 & (
fwd(ng)%pioFile%fh.eq.
his(ng)%pioFile%fh))
THEN
230 fwd(ng)%pioFile%fh=-1
250#if defined TL_IOMS && defined FOUR_DVAR
253#ifdef WEAK_CONSTRAINT
260#if defined AVERAGES || \
261 (defined ad_averages && defined adjoint) || \
262 (defined rp_averages && defined tl_ioms) || \
263 (defined tl_averages && defined tangent)
266#if defined AVERAGES && defined AVERAGES_DETIDE && \
267 (defined ssh_tides || defined uv_tides)
279#if defined WEAK_CONSTRAINT && \
280 (defined posterior_error_f || defined posterior_error_i)
289 IF (
associated(
his(ng)%Nrec))
THEN
290 IF (any(
his(ng)%Nrec.gt.0))
THEN
291 WRITE (
stdout,20)
'HISTORY', sum(
his(ng)%Nrec)
295 IF (
associated(
rst(ng)%Nrec))
THEN
297 IF (
rst(ng)%Nrec(fcount).gt.0)
THEN
299 IF (
rst(ng)%Nrec(fcount).gt.1)
THEN
300 rst(ng)%Nrec(fcount)=2
302 rst(ng)%Nrec(fcount)=1
305 WRITE (
stdout,20)
'RESTART',
rst(ng)%Nrec(fcount)
309#if defined FOUR_DVAR || defined ENKF_RESTART
310 IF (
associated(
dai(ng)%Nrec))
THEN
311 IF (any(
dai(ng)%Nrec.gt.0))
THEN
312 WRITE (
stdout,20)
'DA IC ', sum(
dai(ng)%Nrec)
318 IF (
associated(
adm(ng)%Nrec))
THEN
319 IF (any(
adm(ng)%Nrec.gt.0))
THEN
320 WRITE (
stdout,20)
'ADJOINT', sum(
adm(ng)%Nrec)
326 IF (
associated(
tlm(ng)%Nrec))
THEN
327 IF (any(
tlm(ng)%Nrec.gt.0))
THEN
328 WRITE (
stdout,20)
'TANGENT', sum(
tlm(ng)%Nrec)
333#if defined AVERAGES || \
334 (defined ad_averages && defined adjoint) || \
335 (defined rp_averages && defined tl_ioms) || \
336 (defined tl_averages && defined tangent)
337 IF (
associated(
avg(ng)%Nrec))
THEN
338 IF (any(
avg(ng)%Nrec.gt.0))
THEN
339 WRITE (
stdout,20)
'AVERAGE', sum(
avg(ng)%Nrec)
345 IF (
associated(
sta(ng)%Nrec))
THEN
346 IF (any(
sta(ng)%Nrec.gt.0))
THEN
347 WRITE (
stdout,20)
'STATION', sum(
sta(ng)%Nrec)
352#if defined WEAK_CONSTRAINT && \
353 (defined posterior_error_f || defined posterior_error_i)
354 IF (
associated(
err(ng)%Nrec))
THEN
355 IF (any(
err(ng)%Nrec.gt.0))
THEN
356 WRITE (
stdout,20)
'ERROR ', sum(
err(ng)%Nrec)
371 ivalue=ichar(ana_string(1:1))
372 IF (ivalue.ge.47)
THEN
376 WRITE (
stdout,30)
' Analytical header files used:'
393 ana_string=trim(bioname(i))
394 ivalue=ichar(ana_string(1:1))
395 IF (ivalue.ge.47)
THEN
399 WRITE (
stdout,30)
' Biology model header files used:'
401 WRITE (
stdout,
'(5x,a)') trim(adjustl(bioname(i)))
447 10
FORMAT (/,
' ROMS - Output NetCDF summary for Grid ', &
449 20
FORMAT (13x,
'number of time records written in ', &
453 50
FORMAT (/,
' MAIN: Abnormal termination: BLOWUP.',/, &
455 60
FORMAT (/,
' ROMS: DONE... ',a)
456 70
FORMAT (/,
' ERROR: Abnormal termination: NetCDF INPUT.',/, &
458 80
FORMAT (/,
' ERROR: Abnormal termination: NetCDF OUTPUT.',/, &
460 90
FORMAT (/,
' ERROR: I/O related problem.')
461100
FORMAT (/,
' ERROR: Illegal model configuration.')
462110
FORMAT (/,
' ERROR: Illegal domain partition.')
463120
FORMAT (/,
' ERROR: Illegal input parameter.')
464130
FORMAT (/,
' ERROR: Fatal algorithm result.')
subroutine, public close_out
subroutine, public close_file(ng, model, s, ncname, lupdate)
subroutine, public close_inp(ng, model)
subroutine, public get_date(date_str)
type(t_io), dimension(:), allocatable lcz
type(t_io), dimension(:), allocatable spa
character(len=50), dimension(9) rerror
type(t_io), dimension(:), allocatable his
type(t_io), dimension(:), allocatable adm
type(t_io), dimension(:), allocatable spt
type(t_io), dimension(:), allocatable irp
integer, dimension(:,:), allocatable clmids
type(t_io), dimension(:), allocatable flt
type(t_io), dimension(:), allocatable sct
type(t_io), dimension(:), allocatable tlf
type(t_io), dimension(:), allocatable hss
integer, dimension(:), allocatable nclmfiles
type(t_io), dimension(:), allocatable har
type(t_io), dimension(:), allocatable tlm
type(t_io), dimension(:), allocatable itl
type(t_io), dimension(:,:), allocatable frc
type(t_io), dimension(:), allocatable dai
integer, dimension(:,:), allocatable bryids
type(t_io), dimension(:), allocatable dav
type(t_io), dimension(:), allocatable qck
type(t_io), dimension(:,:), allocatable bry
type(t_io), dimension(:), allocatable fwd
type(t_io), dimension(:), allocatable rst
integer, dimension(:), allocatable nbcfiles
type(t_io), dimension(:,:), allocatable clm
integer, dimension(:,:), allocatable frcids
type(t_io), dimension(:), allocatable avg
type(t_io), dimension(:), allocatable sta
type(t_io), dimension(:), allocatable err
character(len=256) sourcefile
type(t_io), dimension(:), allocatable dia
integer, dimension(:), allocatable nffiles
integer, parameter io_nf90
integer, dimension(:,:), allocatable clmncid
integer, parameter io_pio
character(len=44) date_str
integer, dimension(:,:), allocatable frcncid
integer, dimension(:,:), allocatable bryncid
character(len=256), dimension(39) ananame
subroutine, public netcdf_close(ng, model, ncid, ncname, lupdate)
subroutine, public pio_netcdf_close(ng, model, piofile, ncname, lupdate)
logical, dimension(:), allocatable clm_file
logical, dimension(:), allocatable obcdata
character(len=80) blowup_string
logical, dimension(:), allocatable lcyclerst
logical function, public founderror(flag, noerr, line, routine)