4# if defined PIO_LIB && defined DISTRIBUTE
8 & LBi, UBi, LBj, UBj, Iout, Irec, &
30# if defined PIO_LIB && defined DISTRIBUTE
66 logical,
intent(out) :: update
68 integer,
intent(in) :: ng, model, ifield, nfiles, Iout, Irec
69 integer,
intent(in) :: LBi, UBi, LBj, UBj
70 integer,
intent(inout) :: ncid
72# if defined PIO_LIB && defined DISTRIBUTE
73 TYPE (File_desc_t),
intent(inout) :: pioFile
75 TYPE(
t_io),
intent(inout) :: S(nfiles)
78 real(r8),
intent(in) :: Fmask(LBi:UBi,LBj:UBj)
80 real(r8),
intent(inout) :: Fout(LBi:UBi,LBj:UBj,Iout)
84 character (len=*),
parameter :: MyFile = &
92 SELECT CASE (s(1)%IOtype)
95 & nfiles, s, update, &
96 & lbi, ubi, lbj, ubj, iout, irec, &
102# if defined PIO_LIB && defined DISTRIBUTE
105 & nfiles, s, update, &
106 & lbi, ubi, lbj, ubj, iout, irec, &
118 10
FORMAT (
' GET_2DFLDR - Illegal input file type, io_type = ',i0, &
119 & /,14x,
'Check KeyWord ''INP_LIB'' in ''roms.in''.')
126 & nfiles, S, update, &
127 & LBi, UBi, LBj, UBj, Iout, Irec, &
151 logical,
intent(out) :: update
153 integer,
intent(in) :: ng, model, ifield, nfiles, Iout, Irec
154 integer,
intent(in) :: LBi, UBi, LBj, UBj
155 integer,
intent(inout) :: ncid
157 TYPE(
t_io),
intent(inout) :: S(nfiles)
160 real(r8),
intent(in) :: Fmask(LBi:UBi,LBj:UBj)
162 real(r8),
intent(inout) :: Fout(LBi:UBi,LBj:UBj,Iout)
166 logical :: Lgridded, Linquire, Liocycle, Lmulti, Lonerec, Lregrid
169 integer :: Nrec, Tid, Tindex, Trec, Vid, Vtype
170 integer :: gtype, job, lend, lstr, lvar, status
173 integer(i8b) :: Fhash
176 real(r8) :: Fmax, Fmin, Fval
178 real(dp) :: Clength, Tdelta, Tend
179 real(dp) :: Tmax, Tmin, Tmono, Tscale, Tstr
180 real(dp) :: Tsec, Tval
182 character (len= 1) :: Rswitch
183 character (len=22) :: t_code
185 character (len=*),
parameter :: MyFile = &
202 IF (
iic(ng).eq.0) linquire=.true.
203 IF (.not.linquire.and. &
204 & ((
iinfo(10,ifield,ng).gt.1).and. &
205 & (
linfo( 5,ifield,ng).or. &
222 CALL inquiry (ng, model, job, iout, irec, 1, ifield, ncid, &
225 IF (
linfo(5,ifield,ng))
THEN
226 linfo(5,ifield,ng)=.false.
236 tmono=
finfo(7,ifield,ng)
238 IF ((tmono.gt.
time(ng)).or.(
iic(ng).eq.0).or. &
243 lgridded=
linfo(1,ifield,ng)
244 liocycle=
linfo(2,ifield,ng)
245 lonerec =
linfo(3,ifield,ng)
246 special =
linfo(4,ifield,ng)
247 vtype =
iinfo(1,ifield,ng)
248 vid =
iinfo(2,ifield,ng)
249 tid =
iinfo(3,ifield,ng)
250 nrec =
iinfo(4,ifield,ng)
251 vsize(1)=
iinfo(5,ifield,ng)
252 vsize(2)=
iinfo(6,ifield,ng)
253 tindex =
iinfo(8,ifield,ng)
254 trec =
iinfo(9,ifield,ng)
255 tmin =
finfo(1,ifield,ng)
256 tmax =
finfo(2,ifield,ng)
257 clength =
finfo(5,ifield,ng)
258 tscale =
finfo(6,ifield,ng)
262 trec=mod(trec,nrec)-1
263 IF (trec.le.0) trec=nrec+trec
267 iinfo(9,ifield,ng)=trec
269 IF ((1.le.trec).and.(trec.le.nrec))
THEN
277 IF (.not.special.and.(irec.eq.1))
THEN
283 iinfo(8,ifield,ng)=tindex
288 IF (.not.special.and.(tid.ge.0))
THEN
290 &
rclock%DateNumber, tval, &
292 & start = (/trec/), &
299 vtime(tindex,ifield,ng)=tval
305 IF ((trec.eq.1).and.(tval*
day2sec.ge.
time(ng)))
THEN
306 linfo(5,ifield,ng)=.true.
320 &
vname(1,ifield), vid, &
322 & lbi, ubi, lbj, ubj, 1, irec, &
323 &
fscale(ifield,ng), fmin, fmax, &
335 &
vname(1,ifield), vid, &
336 & trec, vtype, vsize, &
337 & lbi, ubi, lbj, ubj, &
338 &
fscale(ifield,ng), fmin, fmax, &
342 & fout(:,:,tindex), &
344 & checksum = fhash, &
350 &
vname(1,ifield), fval, &
352 & start = (/trec/), &
354 fval=fval*
fscale(ifield,ng)
355 fpoint(tindex,ifield,ng)=fval
363 finfo(8,ifield,ng)=fmin
364 finfo(9,ifield,ng)=fmax
367 WRITE (
stdout,50) trim(
vname(2,ifield)), ng, fmin, fmax
369 lstr=scan(
ncfile,
'/',back=.true.)+1
371 lvar=min(46,len_trim(
vname(2,ifield)))
379 WRITE (
stdout,60)
vname(2,ifield)(1:lvar), t_code, &
380 & ng, trec, tindex,
ncfile(lstr:lend), &
381 & tmin, tmax, tval, fmin, fmax, rswitch
396 IF (.not.lonerec.and.(.not.special))
THEN
397 tdelta=
vtime(3-tindex,ifield,ng)-
vtime(tindex,ifield,ng)
398 IF (liocycle.and.(tdelta.lt.0.0_r8))
THEN
399 tdelta=tdelta+clength
402 finfo(7,ifield,ng)=tmono
403 tintrp(tindex,ifield,ng)=tmono
407 10
FORMAT (/,
' GET_2DFLDR_NF90 - unable to find dimension ',a, &
408 & /,19x,
'for variable: ',a,/,19x,
'in file: ',a, &
409 & /,19x,
'file is not CF compliant...')
410 20
FORMAT (/,
' GET_2DFLDR_NF90 - unable to find requested', &
411 &
' variable:',a,/,19x,
'in ',a)
412 30
FORMAT (/,
' GET_2DFLDR_NF90 - unable to open input NetCDF', &
414 40
FORMAT (/,
' GET_2DFLDR_NF90 - error while reading variable: ',a, &
415 & 2x,
' at TIME index = ',i0)
416 50
FORMAT (2x,
'GET_2DFLDR_NF90 - ',a,/,22x,
'(Grid = ', &
417 &
', Min = ',1p,e15.8,0p,
' Max = ',1p,e15.8,0p,
')')
418 60
FORMAT (2x,
'GET_2DFLDR_NF90 - ',a,
',',t75,a,/,22x, &
419 &
'(Grid=',i2.2,
', Rec=',i0,
', Index=',i1, &
420 &
', File: ',a,
')',/,22x, &
421 &
'(Tmin= ', f15.4,
' Tmax= ', f15.4,
')', &
422 & t71,
't = ', f15.4 ,/,22x, &
423 &
'(Min = ', 1p,e15.8,0p,
' Max = ',1p,e15.8,0p,
')', &
424 & t71,
'regrid = ',a)
426 70
FORMAT (22x,
'(CheckSum = ',i0,
')')
432# if defined PIO_LIB && defined DISTRIBUTE
436 & nfiles, S, update, &
437 & LBi, UBi, LBj, UBj, Iout, Irec, &
461 logical,
intent(out) :: update
463 integer,
intent(in) :: ng, model, ifield, nfiles, Iout, Irec
464 integer,
intent(in) :: LBi, UBi, LBj, UBj
466 TYPE (File_desc_t),
intent(inout) :: pioFile
467 TYPE(
t_io),
intent(inout) :: S(nfiles)
470 real(r8),
intent(in) :: Fmask(LBi:UBi,LBj:UBj)
472 real(r8),
intent(inout) :: Fout(LBi:UBi,LBj:UBj,Iout)
476 logical :: Lgridded, Linquire, Liocycle, Lmulti, Lonerec, Lregrid
479 integer :: Nrec, Tindex, Trec, Vtype
480 integer :: i, job, lend, lstr, lvar, status
483 integer(i8b) :: Fhash
486 real(r8) :: Fmax, Fmin, Fval
488 real(dp) :: Clength, Tdelta, Tend
489 real(dp) :: Tmax, Tmin, Tmono, Tscale, Tstr
490 real(dp) :: Tsec, Tval
492 character (len= 1) :: Rswitch
493 character (len=22) :: t_code
495 character (len=*),
parameter :: MyFile = &
496 & __FILE__//
", get_3dfldr_pio"
498 TYPE (IO_Desc_t),
pointer :: ioDesc
499 TYPE (My_VarDesc) :: TpioVar, VpioVar
515 IF (
iic(ng).eq.0) linquire=.true.
516 IF (.not.linquire.and. &
517 & ((
iinfo(10,ifield,ng).gt.1).and. &
518 & (
linfo( 5,ifield,ng).or. &
535 CALL inquiry (ng, model, job, iout, irec, 1, ifield, piofile, &
538 IF (
linfo(5,ifield,ng))
THEN
539 linfo(5,ifield,ng)=.false.
549 tmono=
finfo(7,ifield,ng)
551 IF ((tmono.gt.
time(ng)).or.(
iic(ng).eq.0).or. &
556 lgridded=
linfo(1,ifield,ng)
557 liocycle=
linfo(2,ifield,ng)
558 lonerec =
linfo(3,ifield,ng)
559 special =
linfo(4,ifield,ng)
560 vtype =
iinfo(1,ifield,ng)
561 vpiovar =
dinfo(1,ifield,ng)
562 tpiovar =
dinfo(2,ifield,ng)
563 nrec =
iinfo(4,ifield,ng)
564 vsize(1)=
iinfo(5,ifield,ng)
565 vsize(2)=
iinfo(6,ifield,ng)
566 tindex =
iinfo(8,ifield,ng)
567 trec =
iinfo(9,ifield,ng)
568 tmin =
finfo(1,ifield,ng)
569 tmax =
finfo(2,ifield,ng)
570 clength =
finfo(5,ifield,ng)
571 tscale =
finfo(6,ifield,ng)
575 trec=mod(trec,nrec)-1
576 IF (trec.le.0) trec=nrec+trec
580 iinfo(9,ifield,ng)=trec
582 IF ((1.le.trec).and.(trec.le.nrec))
THEN
590 IF (.not.special.and.(irec.eq.1))
THEN
596 iinfo(8,ifield,ng)=tindex
601 IF (.not.special.and.(tpiovar%vd%varID.ge.0))
THEN
603 &
rclock%DateNumber, tval, &
604 & piofile = piofile, &
605 & start = (/trec/), &
612 vtime(tindex,ifield,ng)=tval
618 IF ((trec.eq.1).and.(tval*
day2sec.ge.
time(ng)))
THEN
619 linfo(5,ifield,ng)=.true.
628 IF (special) vtype=vtype+4
630 IF (vpiovar%vd%varID.ge.0)
THEN
633 IF (kind(fout).eq.8)
THEN
639 IF (kind(fout).eq.8)
THEN
645 IF (kind(fout).eq.8)
THEN
651 IF (kind(fout).eq.8)
THEN
656# if defined SSH_TIDES || defined UV_TIDES
659 IF (kind(fout).eq.8)
THEN
674 &
vname(1,ifield), vpiovar, &
675 & 0, iodesc, vsize, &
676 & lbi, ubi, lbj, ubj, 1, irec, &
677 &
fscale(ifield,ng), fmin, fmax, &
689 &
vname(1,ifield), vpiovar, &
690 & trec, iodesc, vsize, &
691 & lbi, ubi, lbj, ubj, &
692 &
fscale(ifield,ng), fmin, fmax, &
696 & fout(:,:,tindex), &
698 & checksum = fhash, &
704 &
vname(1,ifield), fval, &
705 & piofile = piofile, &
706 & start = (/trec/), &
708 fval=fval*
fscale(ifield,ng)
709 fpoint(tindex,ifield,ng)=fval
717 finfo(8,ifield,ng)=fmin
718 finfo(9,ifield,ng)=fmax
721 WRITE (
stdout,50) trim(
vname(2,ifield)), ng, fmin, fmax
723 lstr=scan(
ncfile,
'/',back=.true.)+1
725 lvar=min(46,len_trim(
vname(2,ifield)))
733 WRITE (
stdout,60)
vname(2,ifield)(1:lvar), t_code, &
734 & ng, trec, tindex,
ncfile(lstr:lend), &
735 & tmin, tmax, tval, fmin, fmax, rswitch
750 IF (.not.lonerec.and.(.not.special))
THEN
751 tdelta=
vtime(3-tindex,ifield,ng)-
vtime(tindex,ifield,ng)
752 IF (liocycle.and.(tdelta.lt.0.0_r8))
THEN
753 tdelta=tdelta+clength
756 finfo(7,ifield,ng)=tmono
757 tintrp(tindex,ifield,ng)=tmono
761 10
FORMAT (/,
' GET_2DFLDR_PIO - unable to find dimension ',a, &
762 & /,18x,
'for variable: ',a,/,18x,
'in file: ',a, &
763 & /,18x,
'file is not CF compliant...')
764 20
FORMAT (/,
' GET_2DFLDR_PIO - unable to find requested', &
765 &
' variable:',a,/,18x,
'in ',a)
766 30
FORMAT (/,
' GET_2DFLDR_PIO - unable to open input NetCDF', &
768 40
FORMAT (/,
' GET_2DFLDR_PIO - error while reading variable: ',a, &
769 & 2x,
' at TIME index = ',i0)
770 50
FORMAT (2x,
'GET_2DFLDR_PIO - ',a,/,22x,
'(Grid = ', &
771 &
', Min = ',1p,e15.8,0p,
' Max = ',1p,e15.8,0p,
')')
772 60
FORMAT (2x,
'GET_2DFLDR_PIO - ',a,
',',t75,a,/,22x, &
773 &
'(Grid=',i2.2,
', Rec=',i0,
', Index=',i1, &
774 &
', File: ',a,
')',/,22x, &
775 &
'(Tmin= ', f15.4,
' Tmax= ', f15.4,
')', &
776 & t71,
't = ', f15.4 ,/,22x, &
777 &
'(Min = ', 1p,e15.8,0p,
' Max = ',1p,e15.8,0p,
')', &
778 & t71,
'regrid = ',a)
780 70
FORMAT (22x,
'(CheckSum = ',i0,
')')
subroutine get_2dfldr(ng, model, ifield, ncid, piofile, nfiles, s, update, lbi, ubi, lbj, ubj, iout, irec, fmask, fout)
subroutine get_2dfldr_nf90(ng, model, ifield, ncid, nfiles, s, update, lbi, ubi, lbj, ubj, iout, irec, fmask, fout)
subroutine get_2dfldr_pio(ng, model, ifield, piofile, nfiles, s, update, lbi, ubi, lbj, ubj, iout, irec, fmask, fout)
subroutine, public time_string(mytime, date_string)
character(len=256) ncfile
character(len=256) sourcefile
integer, parameter io_nf90
character(len=256), dimension(:,:), allocatable cinfo
logical, dimension(:,:,:), allocatable linfo
integer, parameter io_pio
type(my_vardesc), dimension(:,:,:), pointer dinfo
real(dp), dimension(:,:,:), allocatable vtime
real(dp), dimension(:,:,:), allocatable tintrp
real(dp), dimension(:,:,:), allocatable fpoint
real(dp), dimension(:,:), allocatable fscale
character(len=46), dimension(0:nv) tname
real(dp), dimension(:,:,:), allocatable finfo
character(len=maxlen), dimension(6, 0:nv) vname
integer, dimension(:,:,:), allocatable iinfo
integer, parameter u2dvar
integer, parameter p2dvar
integer, parameter r2dvar
integer, parameter v2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_rtides
type(io_desc_t), dimension(:), pointer iodesc_dp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_p2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_rtides
type(io_desc_t), dimension(:), pointer iodesc_dp_v2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_p2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_v2dvar
real(dp), parameter day2sec
real(dp), parameter spval
integer, dimension(:), allocatable iic
real(dp), dimension(:), allocatable time
integer, dimension(:), allocatable ntstart
logical function, public founderror(flag, noerr, line, routine)