48# if defined PIO_LIB && defined DISTRIBUTE
60 integer,
intent(in) :: ng, tile, model
64 integer :: lbi, ubi, lbj, ubj
66 character (len=*),
parameter :: myfile = &
78 SELECT CASE (
nud(ng)%IOtype)
83# if defined PIO_LIB && defined DISTRIBUTE
94 10
FORMAT (
' GET_NUDGCOEF - Illegal input file type, io_type = ',i0, &
95 & /,16x,
'Check KeyWord ''INP_LIB'' in ''roms.in''.')
102 & LBi, UBi, LBj, UBj)
109 integer,
intent(in) :: ng, tile, model
110 integer,
intent(in) :: lbi, ubi, lbj, ubj
115 logical :: got_generic
116 logical :: got_specific(
nt(ng))
119 integer :: gtype, i, ic, itrc
120 integer :: nvatt, nvdim, status, vindex
123 integer(i8b) :: fhash
127 real(r8) :: fmax, fmin
129 character (len=40 ) :: tunits
130 character (len=256) :: ncname
132 character (len=*),
parameter :: myfile = &
133 & __FILE__//
", get_nudgcoef_nf90"
147 IF (
nud(ng)%ncid.eq.-1)
THEN
150 WRITE (
stdout,10) trim(ncname)
158 & ncid =
nud(ng)%ncid)
164 & ncid =
nud(ng)%ncid)
207 &
nud(ng)%Vid(vindex))
208 IF (.not.(got_generic.or.got_specific(itrc)))
THEN
210 & trim(
vname(1,vindex)), &
242 & ncid =
nud(ng)%ncid, &
243 & myvarname = trim(
vname(1,vindex)), &
244 & varid =
nud(ng)%Vid(vindex), &
251 IF (tunits(1:3).eq.
'day')
THEN
253 ELSE IF (tunits(1:6).eq.
'second')
THEN
260 &
vname(1,vindex),
nud(ng)%Vid(vindex), &
262 & lbi, ubi, lbj, ubj, &
263 & fscl, fmin, fmax, &
265 &
grid(ng) % rmask, &
268 &
clima(ng) % M2nudgcof, &
271 &
clima(ng) % M2nudgcof)
273 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
280 & trim(
vname(1,vindex)), &
281 & ng, trim(ncname), fmin, fmax
290 & lbi, ubi, lbj, ubj, &
291 &
clima(ng) % M2nudgcof)
295 & lbi, ubi, lbj, ubj, &
298 &
clima(ng) % M2nudgcof)
313 & ncid =
nud(ng)%ncid, &
314 & myvarname = trim(
vname(1,vindex)), &
315 & varid =
nud(ng)%Vid(vindex), &
322 IF (tunits(1:3).eq.
'day')
THEN
324 ELSE IF (tunits(1:6).eq.
'second')
THEN
331 &
vname(1,vindex),
nud(ng)%Vid(vindex), &
333 & lbi, ubi, lbj, ubj, 1,
n(ng), &
334 & fscl, fmin, fmax, &
336 &
grid(ng) % rmask, &
339 &
clima(ng) % M3nudgcof, &
342 &
clima(ng) % M3nudgcof)
344 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
351 & trim(
vname(1,vindex)), &
352 & ng, trim(ncname), fmin, fmax
361 & lbi, ubi, lbj, ubj, 1,
n(ng), &
362 &
clima(ng) % M3nudgcof)
366 & lbi, ubi, lbj, ubj, 1,
n(ng), &
369 &
clima(ng) % M3nudgcof)
384 IF (got_specific(itrc))
THEN
387 ELSE IF (got_generic)
THEN
393 & ncid =
nud(ng)%ncid, &
394 & myvarname = trim(
vname(1,vindex)), &
395 & varid =
nud(ng)%Vid(vindex), &
402 IF (tunits(1:3).eq.
'day')
THEN
404 ELSE IF (tunits(1:6).eq.
'second')
THEN
411 &
vname(1,vindex),
nud(ng)%Vid(vindex), &
413 & lbi, ubi, lbj, ubj, 1,
n(ng), &
414 & fscl, fmin, fmax, &
416 &
grid(ng) % rmask, &
419 &
clima(ng) % Tnudgcof(:,:,:,ic), &
422 &
clima(ng) % Tnudgcof(:,:,:,ic))
424 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
431 & trim(
vname(1,vindex)), &
432 & ng, trim(ncname), fmin, fmax
441 & lbi, ubi, lbj, ubj, 1,
n(ng), &
442 &
clima(ng) % Tnudgcof(:,:,:,ic))
449 & lbi, ubi, lbj, ubj, 1,
n(ng), 1,
ntclm(ng), &
452 &
clima(ng) % Tnudgcof)
457 10
FORMAT (/,
' GET_NUDGCOEF_NF90 - unable to open nudging NetCDF', &
459 20
FORMAT (/,
' GET_NUDGCOEF_NF90 - unable to find nudging', &
460 &
' variable: ',a,/,21x,
'in NetCDF file: ',a)
461 30
FORMAT (/,
' GET_NUDGCOEF_NF90 - unable to find nudging', &
463 & /,21x,
'or generic nudging variable: ',a, &
464 & /,21x,
'in nudging NetCDF file: ',a)
465 40
FORMAT(2x,
' GET_NUDGCOEF_NF90 - ',a,/,21x, &
466 &
'(Grid = ',i2.2,
', File: ',a,
')',/,21x, &
467 &
'(Min = ', 1p,e15.8,0p,
' Max = ',1p,e15.8,0p,
')')
469 50
FORMAT (19x,
'(CheckSum = ',i0,
')')
475# if defined PIO_LIB && defined DISTRIBUTE
479 & LBi, UBi, LBj, UBj)
486 integer,
intent(in) :: ng, tile, model
487 integer,
intent(in) :: lbi, ubi, lbj, ubj
492 logical :: got_generic
493 logical :: got_specific(
nt(ng))
496 integer :: gtype, i, ic, ifield, itrc
497 integer :: nvatt, nvdim, status, vindex
500 integer(i8b) :: fhash
504 real(r8) :: fmax, fmin
506 character (len=40 ) :: tunits
507 character (len=256) :: ncname
509 character (len=*),
parameter :: myfile = &
510 & __FILE__//
", get_nudgcoef_nf90"
512 TYPE (io_desc_t),
pointer :: iodesc
526 IF (
nud(ng)%pioFile%fh.eq.-1)
THEN
529 WRITE (
stdout,10) trim(ncname)
537 & piofile =
nud(ng)%pioFile)
543 & piofile =
nud(ng)%pioFile)
592 got_specific(itrc)=.true.
595 got_specific(itrc)=.false.
598 IF (.not.(got_generic.or.got_specific(itrc)))
THEN
600 & trim(
vname(1,ifield)), &
632 & piofile =
nud(ng)%pioFile, &
633 & myvarname = trim(
vname(1,ifield)), &
634 & piovar =
nud(ng)%pioVar(ifield)%vd, &
640 IF (trim(var_aname(i)).eq.
'units')
THEN
641 tunits=trim(var_achar(i))
642 IF (tunits(1:3).eq.
'day')
THEN
644 ELSE IF (tunits(1:6).eq.
'second')
THEN
650 IF (kind(
clima(ng)%M2nudgcof).eq.8)
THEN
651 nud(ng)%pioVar(ifield)%dkind=pio_double
654 nud(ng)%pioVar(ifield)%dkind=pio_real
659 &
vname(1,ifield),
nud(ng)%pioVar(ifield), &
660 & 0, iodesc, vsize, &
661 & lbi, ubi, lbj, ubj, &
662 & fscl, fmin, fmax, &
664 &
grid(ng) % rmask, &
667 &
clima(ng) % M2nudgcof, &
670 &
clima(ng) % M2nudgcof)
672 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
679 & trim(
vname(1,ifield)), &
680 & ng, trim(ncname), fmin, fmax
689 & lbi, ubi, lbj, ubj, &
690 &
clima(ng) % M2nudgcof)
694 & lbi, ubi, lbj, ubj, &
697 &
clima(ng) % M2nudgcof)
712 & piofile =
nud(ng)%pioFile, &
713 & myvarname = trim(
vname(1,ifield)), &
714 & piovar =
nud(ng)%pioVar(ifield)%vd, &
720 IF (trim(var_aname(i)).eq.
'units')
THEN
721 tunits=trim(var_achar(i))
722 IF (tunits(1:3).eq.
'day')
THEN
724 ELSE IF (tunits(1:6).eq.
'second')
THEN
730 IF (kind(
clima(ng)%M3nudgcof).eq.8)
THEN
731 nud(ng)%pioVar(ifield)%dkind=pio_double
734 nud(ng)%pioVar(ifield)%dkind=pio_real
739 &
vname(1,ifield),
nud(ng)%pioVar(ifield), &
740 & 0, iodesc, vsize, &
741 & lbi, ubi, lbj, ubj, 1,
n(ng), &
742 & fscl, fmin, fmax, &
744 &
grid(ng) % rmask, &
747 &
clima(ng) % M3nudgcof, &
750 &
clima(ng) % M3nudgcof)
752 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
759 & trim(
vname(1,ifield)), &
760 & ng, trim(ncname), fmin, fmax
769 & lbi, ubi, lbj, ubj, 1,
n(ng), &
770 &
clima(ng) % M3nudgcof)
774 & lbi, ubi, lbj, ubj, 1,
n(ng), &
777 &
clima(ng) % M3nudgcof)
791 IF (got_specific(itrc))
THEN
794 ELSE IF (got_generic)
THEN
801 & piofile =
nud(ng)%pioFile, &
802 & myvarname = trim(
vname(1,ifield)), &
803 & piovar =
nud(ng)%pioVar(ifield)%vd, &
809 IF (trim(var_aname(i)).eq.
'units')
THEN
810 tunits=trim(var_achar(i))
811 IF (tunits(1:3).eq.
'day')
THEN
813 ELSE IF (tunits(1:6).eq.
'second')
THEN
819 IF (kind(
clima(ng)%Tnudgcof).eq.8)
THEN
820 nud(ng)%pioVar(ifield)%dkind=pio_double
823 nud(ng)%pioVar(ifield)%dkind=pio_real
828 &
vname(1,ifield),
nud(ng)%pioVar(ifield), &
829 & 0, iodesc, vsize, &
830 & lbi, ubi, lbj, ubj, 1,
n(ng), &
831 & fscl, fmin, fmax, &
833 &
grid(ng) % rmask, &
836 &
clima(ng) % Tnudgcof(:,:,:,ic), &
839 &
clima(ng) % Tnudgcof(:,:,:,ic))
841 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
848 & trim(
vname(1,ifield)), &
849 & ng, trim(ncname), fmin, fmax
858 & lbi, ubi, lbj, ubj, 1,
n(ng), &
859 &
clima(ng) % Tnudgcof(:,:,:,ic))
866 & lbi, ubi, lbj, ubj, 1,
n(ng), 1,
ntclm(ng), &
869 &
clima(ng) % Tnudgcof)
874 10
FORMAT (/,
' GET_NUDGCOEF_PIO - unable to open nudging NetCDF', &
876 20
FORMAT (/,
' GET_NUDGCOEF_PIO - unable to find nudging', &
877 &
' variable: ',a,/,20x,
'in NetCDF file: ',a)
878 30
FORMAT (/,
' GET_NUDGCOEF_PIO - unable to find nudging', &
880 & /,20x,
'or generic nudging variable: ',a, &
881 & /,20x,
'in nudging NetCDF file: ',a)
882 40
FORMAT(2x,
' GET_NUDGCOEF_PIO - ',a,/,21x, &
883 &
'(Grid = ',i2.2,
', File: ',a,
')',/,21x, &
884 &
'(Min = ', 1p,e15.8,0p,
' Max = ',1p,e15.8,0p,
')')
886 50
FORMAT (19x,
'(CheckSum = ',i0,
')')
subroutine exchange_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
subroutine exchange_r3d_tile(ng, tile, lbi, ubi, lbj, ubj, lbk, ubk, a)
subroutine, private get_nudgcoef_pio(ng, tile, model, lbi, ubi, lbj, ubj)
subroutine, public get_nudgcoef(ng, tile, model)
subroutine, private get_nudgcoef_nf90(ng, tile, model, lbi, ubi, lbj, ubj)
type(t_clima), dimension(:), allocatable clima
type(t_grid), dimension(:), allocatable grid
type(t_io), dimension(:), allocatable nud
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
integer, dimension(:), allocatable idtnud
character(len=maxlen), dimension(6, 0:nv) vname
character(len=1024), dimension(nvara) var_achar
subroutine, public netcdf_check_dim(ng, model, ncname, ncid)
subroutine, public netcdf_open(ng, model, ncname, omode, ncid)
character(len=100), dimension(mvars) var_name
character(len=100), dimension(nvara) var_aname
subroutine, public netcdf_inq_var(ng, model, ncname, ncid, myvarname, searchvar, varid, nvardim, nvaratt)
integer, dimension(:), allocatable ntclm
integer, dimension(:), allocatable n
type(t_bounds), dimension(:), allocatable bounds
integer, parameter r3dvar
integer, dimension(:), allocatable nt
integer, parameter r2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r3dvar
type(var_desc_t), dimension(:), pointer var_desc
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dvar
subroutine, public pio_netcdf_inq_var(ng, model, ncname, piofile, myvarname, searchvar, piovar, nvardim, nvaratt)
subroutine, public pio_netcdf_open(ng, model, ncname, omode, piofile)
subroutine, public pio_netcdf_check_dim(ng, model, ncname, piofile)
type(io_desc_t), dimension(:), pointer iodesc_sp_r3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r2dvar
real(dp), parameter day2sec
logical, dimension(:), allocatable lnudgem2clm
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
logical, dimension(:), allocatable lnudgem3clm
logical, dimension(:,:), allocatable lnudgetclm
subroutine mp_exchange4d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, lbk, ubk, lbt, ubt, nghost, ew_periodic, ns_periodic, a, b, c)
subroutine mp_exchange2d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, nghost, ew_periodic, ns_periodic, a, b, c, d)
subroutine mp_exchange3d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, lbk, ubk, nghost, ew_periodic, ns_periodic, a, b, c, d)
logical function, public find_string(a, asize, string, aindex)
logical function, public founderror(flag, noerr, line, routine)