3#if defined PROPAGATOR && defined CHECKPOINTING
31# if defined PIO_LIB && defined DISTRIBUTE
43 integer,
intent(in) :: ng, model
47 character (len=*),
parameter :: myfile = &
54 SELECT CASE (
gst(ng)%IOtype)
58# if defined PIO_LIB && defined DISTRIBUTE
68 10
FORMAT (
' WRT_GST - Illegal output file type, io_type = ',i0, &
69 & /,11x,
'Check KeyWord ''OUT_LIB'' in ''roms.in''.')
89 integer,
intent(in) :: ng, model
97 integer :: vrecord = -1
99 real(r8) :: scale = 1.0_r8
102 character (len=*),
parameter :: myfile = &
103 & __FILE__//
", wrt_gst_nf90"
120 &
nev, (/0/), (/0/), &
121 & ncid =
gst(ng)%ncid)
127 &
ncv, (/0/), (/0/), &
128 & ncid =
gst(ng)%ncid)
134 &
mstate(ng), (/0/), (/0/), &
135 & ncid =
gst(ng)%ncid)
141 &
nrun, (/0/), (/0/), &
142 & ncid =
gst(ng)%ncid)
148 &
ido(ng), (/0/), (/0/), &
149 & ncid =
gst(ng)%ncid)
155 &
info(ng), (/0/), (/0/), &
156 & ncid =
gst(ng)%ncid)
162 &
bmat, (/1/), (/1/), &
163 & ncid =
gst(ng)%ncid)
169 &
which, (/1/), (/2/), &
170 & ncid =
gst(ng)%ncid)
177 & ncid =
gst(ng)%ncid)
184 & ncid =
gst(ng)%ncid)
191 & ncid =
gst(ng)%ncid)
198 & ncid =
gst(ng)%ncid)
205 & ncid =
gst(ng)%ncid)
212 & ncid =
gst(ng)%ncid)
219 & ncid =
gst(ng)%ncid)
226 & ncid =
gst(ng)%ncid)
233 & ncid =
gst(ng)%ncid)
240 & ncid =
gst(ng)%ncid)
247 & ncid =
gst(ng)%ncid)
258 &
gst(ng)%name, vrecord, &
266 & ncid =
gst(ng)%ncid)
274 &
gst(ng)%name, vrecord, &
281 & ncid =
gst(ng)%ncid)
291 &
gst(ng)%name, vrecord, &
297 & (/1/), (/3*
nstate(ng)/), &
298 & ncid =
gst(ng)%ncid)
307 & ncid =
gst(ng)%ncid)
318 10
FORMAT (2x,
'WRT_GST_NF90 - writing GST checkpointing fields', &
319 &
' at iteration: ', i0)
324# if defined PIO_LIB && defined DISTRIBUTE
334 integer,
intent(in) :: ng, model
339 integer :: is, ie, i, j
341 real(r8) :: scale = 1.0_r8
343 real(r4),
pointer :: a1d_4(:), a2d_4(:,:)
344 real(r8),
pointer :: a1d_8(:), a2d_8(:,:)
346 character (len=*),
parameter :: myfile = &
347 & __FILE__//
", wrt_gst_pio"
349 TYPE (var_desc_t) :: piovar
366 &
nev, (/0/), (/0/), &
367 & piofile =
gst(ng)%pioFile)
373 &
ncv, (/0/), (/0/), &
374 & piofile =
gst(ng)%pioFile)
380 &
mstate(ng), (/0/), (/0/), &
381 & piofile =
gst(ng)%pioFile)
387 &
nrun, (/0/), (/0/), &
388 & piofile =
gst(ng)%pioFile)
394 &
ido(ng), (/0/), (/0/), &
395 & piofile =
gst(ng)%pioFile)
401 &
info(ng), (/0/), (/0/), &
402 & piofile =
gst(ng)%pioFile)
408 &
bmat, (/1/), (/1/), &
409 & piofile =
gst(ng)%pioFile)
415 &
which, (/1/), (/2/), &
416 & piofile =
gst(ng)%pioFile)
423 & piofile =
gst(ng)%pioFile)
430 & piofile =
gst(ng)%pioFile)
437 & piofile =
gst(ng)%pioFile)
444 & piofile =
gst(ng)%pioFile)
451 & piofile =
gst(ng)%pioFile)
458 & piofile =
gst(ng)%pioFile)
465 & piofile =
gst(ng)%pioFile)
472 & piofile =
gst(ng)%pioFile)
479 & piofile =
gst(ng)%pioFile)
486 & piofile =
gst(ng)%pioFile)
493 & piofile =
gst(ng)%pioFile)
502 status=pio_inq_varid(
gst(ng)%pioFile,
'Bvec', piovar)
503 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
509 a2d_8(i,j)=scale*
storage(ng)%Bvec(i,j)
512 CALL pio_write_darray (
gst(ng)%pioFile, piovar, &
515 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
521 a2d_4(i,j)=real(scale*
storage(ng)%Bvec(i,j), r4)
524 CALL pio_write_darray (
gst(ng)%pioFile, piovar, &
527 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
533 status=pio_inq_varid(
gst(ng)%pioFile,
'resid', piovar)
534 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
537 allocate ( a1d_8(
nstr(ng):
nend(ng)) )
539 a1d_8(i)=scale*
storage(ng)%resid(i)
541 CALL pio_write_darray (
gst(ng)%pioFile, piovar, &
544 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
547 allocate ( a1d_4(
nstr(ng):
nend(ng)) )
549 a1d_4(i)=real(scale*
storage(ng)%resid(i), r4)
551 CALL pio_write_darray (
gst(ng)%pioFile, piovar, &
554 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
563 status=pio_inq_varid(
gst(ng)%pioFile,
'SworkD', piovar)
564 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
567 allocate ( a1d_8(is:ie) )
569 a1d_8(i)=scale*
storage(ng)%SworkD(i)
571 CALL pio_write_darray (
gst(ng)%pioFile, piovar, &
574 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
577 allocate ( a1d_4(is:ie) )
579 a1d_4(i)=real(scale*
storage(ng)%SworkD(i), r4)
581 CALL pio_write_darray (
gst(ng)%pioFile, piovar, &
584 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
593 & piofile =
gst(ng)%pioFile)
604 10
FORMAT (2x,
'WRT_GST_PIO - writing GST checkpointing fields', &
605 &
' at iteration: ', i0)
integer function mp_ncwrite2d(ng, model, ncid, ncvname, ncname, ncrec, lb1, ub1, lb2, ub2, ascale, a)
integer function mp_ncwrite1d(ng, model, ncid, ncvname, ncname, ncrec, lb1, ub1, ascale, a)
type(t_io), dimension(:), allocatable gst
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
subroutine, public netcdf_sync(ng, model, ncname, ncid)
integer, dimension(:), allocatable nstate
integer, dimension(:), allocatable mstate
integer, dimension(:), allocatable nstr
integer, dimension(:), allocatable nend
type(io_desc_t), dimension(:), pointer iodesc_dp_resid
type(io_desc_t), dimension(:), pointer iodesc_sp_bvec
type(io_desc_t), dimension(:), pointer iodesc_dp_bvec
subroutine, public pio_netcdf_sync(ng, model, ncname, piofile)
integer, parameter pio_frst
type(io_desc_t), dimension(:), pointer iodesc_sp_sworkd
type(io_desc_t), dimension(:), pointer iodesc_sp_resid
type(io_desc_t), dimension(:), pointer iodesc_dp_sworkd
real(r8), dimension(2) raup2
integer, dimension(8) iaup2
integer, dimension(:), allocatable ido
integer, dimension(20) iaupd
real(r8), dimension(:,:), allocatable sworkl
integer, dimension(:,:), allocatable ipntr
real(r8), dimension(8) raitr
logical, dimension(5) laup2
type(t_storage), dimension(:), allocatable storage
integer, dimension(:), allocatable info
integer, dimension(:,:), allocatable iparam
integer, dimension(8) iaitr
logical, dimension(5) laitr
logical function, public founderror(flag, noerr, line, routine)
subroutine, public wrt_gst(ng, model)
subroutine, private wrt_gst_pio(ng, model)
subroutine, private wrt_gst_nf90(ng, model)