3#if defined PROPAGATOR && defined CHECKPOINTING
30# if defined PIO_LIB && defined DISTRIBUTE
42 integer,
intent(in) :: ng, model
46 character (len=*),
parameter :: myfile = &
53 SELECT CASE (
gst(ng)%IOtype)
57# if defined PIO_LIB && defined DISTRIBUTE
67 10
FORMAT (
' GET_GST - Illegal input file type, io_type = ',i0, &
68 & /,11x,
'Check KeyWord ''INP_LIB'' in ''roms.in''.')
87 integer,
intent(in) :: ng, model
91 integer :: i, ivar, status
94 integer :: vrecord = -1
96 real(r8) :: scale = 1.0_r8
100 character (len=1 ) :: char1
101 character (len=2 ) :: char2
102 character (len=256) :: ncname
104 character (len=*),
parameter :: myfile = &
105 & __FILE__//
", get_gst_nf90"
116 IF (
gst(ng)%ncid.eq.-1)
THEN
119 WRITE (
stdout,10) trim(ncname)
127 & ncid =
gst(ng)%ncid)
129 IF (ivar.ne.
nev)
THEN
138 & ncid =
gst(ng)%ncid)
140 IF (ivar.ne.
ncv)
THEN
149 & ncid =
gst(ng)%ncid)
151 IF (ivar.ne.
mstate(ng))
THEN
162 & ncid =
gst(ng)%ncid)
174 & ncid =
gst(ng)%ncid)
180 & ncid =
gst(ng)%ncid)
186 & ncid =
gst(ng)%ncid)
192 & ncid =
gst(ng)%ncid, &
196 IF (char1.ne.
bmat)
THEN
205 & ncid =
gst(ng)%ncid, &
209 IF (char2(1:2).ne.
which(1:2))
THEN
218 & ncid =
gst(ng)%ncid, &
231 & ncid =
gst(ng)%ncid)
241 & ncid =
gst(ng)%ncid, &
243 & total = (/
SIZE(
iparam)/))
249 & ncid =
gst(ng)%ncid, &
251 & total = (/
SIZE(
ipntr)/))
257 & ncid =
gst(ng)%ncid, &
259 & total = (/
SIZE(
iaupd)/))
265 & ncid =
gst(ng)%ncid, &
267 & total = (/
SIZE(
iaitr)/))
273 & ncid =
gst(ng)%ncid, &
275 & total = (/
SIZE(
iaup2)/))
281 & ncid =
gst(ng)%ncid, &
283 & total = (/
SIZE(
laitr)/))
289 & ncid =
gst(ng)%ncid, &
291 & total = (/
SIZE(
laup2)/))
297 & ncid =
gst(ng)%ncid, &
299 & total = (/
SIZE(
raitr)/))
305 & ncid =
gst(ng)%ncid, &
307 & total = (/
SIZE(
raup2)/))
318 & trim(ncname), vrecord, &
324 & ncid =
gst(ng)%ncid, &
334 & trim(ncname), vrecord, &
340 & ncid =
gst(ng)%ncid, &
350 & trim(ncname), vrecord, &
351 & 1, 3*
nstate(ng), scale, &
356 & ncid =
gst(ng)%ncid, &
358 & total = (/3*
nstate(ng)/))
366 & ncid =
gst(ng)%ncid, &
371 10
FORMAT (/,
' GET_GST_NF90 - unable to open checkpointing NetCDF', &
373 20
FORMAT (/,
' GET_GST_NF90 - inconsistent input parameter', a, 2i4)
374 30
FORMAT (/,
' GET_GST_NF90 - inconsistent input parameter', a, a, a)
375 40
FORMAT (/,
' GET_GST_NF90 - input parameter', a, 1pe10.2,0p, &
376 & /, 16x,
'has been reset to: ', 1pe10.2)
381# if defined PIO_LIB && defined DISTRIBUTE
391 integer,
intent(in) :: ng, model
396 integer :: i, ivar, status
399 integer :: vrecord = -1
401 real(r8) :: scale = 1.0_r8
405 character (len=1 ) :: char1
406 character (len=2 ) :: char2
407 character (len=256) :: ncname
409 character (len=*),
parameter :: myfile = &
410 & __FILE__//
", get_gst_pio"
412 TYPE (var_desc_t) :: piovar
423 IF (
gst(ng)%pioFile%fh.eq.-1)
THEN
426 WRITE (
stdout,10) trim(ncname)
434 & piofile =
gst(ng)%pioFile)
436 IF (ivar.ne.
nev)
THEN
445 & piofile =
gst(ng)%pioFile)
447 IF (ivar.ne.
ncv)
THEN
456 & piofile =
gst(ng)%pioFile)
458 IF (ivar.ne.
mstate(ng))
THEN
467 & piofile =
gst(ng)%pioFile)
478 & piofile =
gst(ng)%pioFile)
484 & piofile =
gst(ng)%pioFile)
490 & piofile =
gst(ng)%pioFile)
496 & piofile =
gst(ng)%pioFile)
498 IF (char1.ne.
bmat)
THEN
507 & piofile =
gst(ng)%pioFile, &
511 IF (char2(1:2).ne.
which(1:2))
THEN
520 & piofile =
gst(ng)%pioFile, &
533 & piofile =
gst(ng)%pioFile)
543 & piofile =
gst(ng)%pioFile, &
545 & total = (/
SIZE(
iparam)/))
551 & piofile =
gst(ng)%pioFile, &
553 & total = (/
SIZE(
ipntr)/))
559 & piofile =
gst(ng)%pioFile, &
561 & total = (/
SIZE(
iaupd)/))
567 & piofile =
gst(ng)%pioFile, &
569 & total = (/
SIZE(
iaitr)/))
575 & piofile =
gst(ng)%pioFile, &
577 & total = (/
SIZE(
iaup2)/))
583 & piofile =
gst(ng)%pioFile, &
585 & total = (/
SIZE(
laitr)/))
591 & piofile =
gst(ng)%pioFile, &
593 & total = (/
SIZE(
laup2)/))
599 & piofile =
gst(ng)%pioFile, &
601 & total = (/
SIZE(
raitr)/))
607 & piofile =
gst(ng)%pioFile, &
609 & total = (/
SIZE(
raup2)/))
618 status=pio_inq_varid(
gst(ng)%pioFile,
'Bvec', piovar)
619 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
621 IF (kind(
storage(ng)%Bvec).eq.8)
THEN
622 CALL pio_read_darray (
gst(ng)%pioFile, piovar, &
625 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
627 CALL pio_read_darray (
gst(ng)%pioFile, piovar, &
630 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
635 status=pio_inq_varid(
gst(ng)%pioFile,
'resid', piovar)
636 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
638 IF (kind(
storage(ng)%Bvec).eq.8)
THEN
639 CALL pio_read_darray (
gst(ng)%pioFile, piovar, &
642 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
644 CALL pio_read_darray (
gst(ng)%pioFile, piovar, &
647 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
655 status=pio_inq_varid(
gst(ng)%pioFile,
'SworkD', piovar)
656 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
658 IF (kind(
storage(ng)%SworkD).eq.8)
THEN
659 CALL pio_read_darray (
gst(ng)%pioFile, piovar, &
662 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
664 CALL pio_read_darray (
gst(ng)%pioFile, piovar, &
667 IF (
founderror(status, pio_noerr, __line__, myfile))
RETURN
674 & piofile =
gst(ng)%pioFile, &
679 10
FORMAT (/,
' GET_GST_PIO - unable to open checkpointing NetCDF', &
681 20
FORMAT (/,
' GET_GST_PIO - inconsistent input parameter', a, 2i4)
682 30
FORMAT (/,
' GET_GST_PIO - inconsistent input parameter', a, a, a)
683 40
FORMAT (/,
' GET_GST_PIO - input parameter', a, 1pe10.2,0p, &
684 & /, 16x,
'has been reset to: ', 1pe10.2)
integer function mp_ncread1d(ng, model, ncid, ncvname, ncname, ncrec, lb1, ub1, ascale, a)
integer function mp_ncread2d(ng, model, ncid, ncvname, ncname, ncrec, lb1, ub1, lb2, ub2, ascale, a)
subroutine, private get_gst_nf90(ng, model)
subroutine, private get_gst_pio(ng, model)
subroutine, public get_gst(ng, model)
type(t_io), dimension(:), allocatable gst
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
subroutine, public netcdf_open(ng, model, ncname, omode, 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_open(ng, model, ncname, omode, piofile)
type(io_desc_t), dimension(:), pointer iodesc_sp_sworkd
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 iparam
integer, dimension(8) iaitr
logical, dimension(5) laitr
logical function, public founderror(flag, noerr, line, routine)