27# if defined SEDIMENT || defined BBL_MODEL
41# if defined PIO_LIB && defined DISTRIBUTE
53 integer,
intent(in) :: ng
57 character (len=*),
parameter :: myfile = &
64 SELECT CASE (
tlf(ng)%IOtype)
68# if defined PIO_LIB && defined DISTRIBUTE
78 10
FORMAT (
' DEF_IMPULSE - Illegal output file type, io_type = ',i0, &
79 & /,15x,
'Check KeyWord ''OUT_LIB'' in ''roms.in''.')
92 integer,
intent(in) :: ng
96 logical :: ldefine, got_var(
nv)
98 integer,
parameter :: natt = 25
100 integer :: i, j, nvd3, nvd4
101 integer :: recdim, status, varid
105 integer :: t2dgrd(3), u2dgrd(3), v2dgrd(3)
110 integer :: t3dgrd(4), u3dgrd(4), v3dgrd(4)
115 character (len=256) :: ncname
116 character (len=MaxLen) :: vinfo(natt)
118 character (len=*),
parameter :: myfile = &
119 & __FILE__//
", def_impulse_nf90"
132 WRITE (
stdout,10) ng, trim(ncname)
134 WRITE (
stdout,20) ng, trim(ncname)
183# if defined WRITE_WATER && defined MASKING
198# if defined WRITE_WATER && defined MASKING
212 &
iobounds(ng)%xy_rho*(
n(ng)+1), dimids(23))
221 &
n(ng)+1, dimids(10))
225 &
nt(ng), dimids(11))
237# if defined WRITE_WATER && defined MASKING
279 & nf90_unlimited, dimids(12))
286# if defined WRITE_WATER && defined MASKING
296# if defined WRITE_WATER && defined MASKING
317# if defined WRITE_WATER && defined MASKING
338# if defined WRITE_WATER && defined MASKING
387 WRITE (vinfo( 3),
'(a,a)')
'seconds since ', trim(
rclock%string)
388 vinfo( 4)=trim(
rclock%calendar)
392 &
nf_tout, 1, (/recdim/), aval, vinfo, ncname, &
393 & setparaccess = .true.)
403# if defined WRITE_WATER && defined MASKING
407 vinfo(22)=
'coordinates'
410 &
nf_fout, nvd3, t2dgrd, aval, vinfo, ncname)
422# if defined WRITE_WATER && defined MASKING
426 vinfo(22)=
'coordinates'
429 &
nf_fout, nvd3, u2dgrd, aval, vinfo, ncname)
439# if defined WRITE_WATER && defined MASKING
443 vinfo(22)=
'coordinates'
446 &
nf_fout, nvd3, v2dgrd, aval, vinfo, ncname)
458# if defined WRITE_WATER && defined MASKING
462 vinfo(22)=
'coordinates'
465 &
nf_fout, nvd4, u3dgrd, aval, vinfo, ncname)
475# if defined WRITE_WATER && defined MASKING
479 vinfo(22)=
'coordinates'
482 &
nf_fout, nvd4, v3dgrd, aval, vinfo, ncname)
495 IF (itrc.eq.
idsed(i))
THEN
496 WRITE (vinfo(19),40) 1000.0_r8*
sd50(i,ng)
500# if defined WRITE_WATER && defined MASKING
504 vinfo(22)=
'coordinates'
507 &
nf_fout, nvd4, t3dgrd, aval, vinfo, ncname)
534 query :
IF (.not.
ldeftlf(ng))
THEN
539 IF (
tlf(ng)%ncid.eq.-1)
THEN
542 WRITE (
stdout,50) trim(ncname)
550 & ncid =
tlf(ng)%ncid)
556 & ncid =
tlf(ng)%ncid)
595 got_var(
idttlf(itrc))=.true.
605 IF (.not.got_var(
idtime))
THEN
611 IF (.not.got_var(
idztlf))
THEN
618 IF (.not.got_var(
idubtf))
THEN
624 IF (.not.got_var(
idvbtf))
THEN
631 IF (.not.got_var(
idutlf))
THEN
637 IF (.not.got_var(
idvtlf))
THEN
644 IF (.not.got_var(
idttlf(itrc)))
THEN
656 fcount=
tlf(ng)%Fcount
661 10
FORMAT (2x,
'DEF_IMPULSE_NF90 - creating impulse forcing file,', &
662 & t56,
'Grid ',i2.2,
': ',a)
663 20
FORMAT (2x,
'DEF_IMPULSE_NF90 - inquiring impulse forcing file,', &
664 & t56,
'Grid ',i2.2,
': ',a)
665 30
FORMAT (/,
' DEF_IMPULSE_NF90 - unable to create impulse forcing', &
666 &
' NetCDF file: ',a)
667 40
FORMAT (1pe11.4,1x,
'millimeter')
668 50
FORMAT (/,
' DEF_IMPULSE_NF90 - unable to open norm NetCDF', &
670 60
FORMAT (/,
' DEF_IMPULSE_NF90 - unable to find variable: ',a,2x, &
671 &
' in impulse forcing NetCDF file: ',a)
676# if defined PIO_LIB && defined DISTRIBUTE
686 integer,
intent(in) :: ng
690 logical :: ldefine, got_var(
nv)
692 integer,
parameter :: natt = 25
694 integer :: i, j, nvd3, nvd4
695 integer :: recdim, status
699 integer :: t2dgrd(3), u2dgrd(3), v2dgrd(3)
704 integer :: t3dgrd(4), u3dgrd(4), v3dgrd(4)
709 character (len=256) :: ncname
710 character (len=MaxLen) :: vinfo(natt)
712 character (len=*),
parameter :: myfile = &
713 & __FILE__//
", def_impulse_pio"
726 WRITE (
stdout,10) ng, trim(ncname)
728 WRITE (
stdout,20) ng, trim(ncname)
777# if defined WRITE_WATER && defined MASKING
792# if defined WRITE_WATER && defined MASKING
806 &
iobounds(ng)%xy_rho*(
n(ng)+1), dimids(23))
815 &
n(ng)+1, dimids(10))
819 &
nt(ng), dimids(11))
831# if defined WRITE_WATER && defined MASKING
873 & nf90_unlimited, dimids(12))
880# if defined WRITE_WATER && defined MASKING
890# if defined WRITE_WATER && defined MASKING
911# if defined WRITE_WATER && defined MASKING
932# if defined WRITE_WATER && defined MASKING
981 WRITE (vinfo( 3),
'(a,a)')
'seconds since ', trim(
rclock%string)
982 vinfo( 4)=trim(
rclock%calendar)
990 &
pio_tout, 1, (/recdim/), aval, vinfo, ncname, &
991 & setparaccess = .true.)
1001# if defined WRITE_WATER && defined MASKING
1002 vinfo(20)=
'mask_rho'
1005 vinfo(22)=
'coordinates'
1012 &
pio_fout, nvd3, t2dgrd, aval, vinfo, ncname)
1024# if defined WRITE_WATER && defined MASKING
1028 vinfo(22)=
'coordinates'
1035 &
pio_fout, nvd3, u2dgrd, aval, vinfo, ncname)
1045# if defined WRITE_WATER && defined MASKING
1049 vinfo(22)=
'coordinates'
1056 &
pio_fout, nvd3, v2dgrd, aval, vinfo, ncname)
1068# if defined WRITE_WATER && defined MASKING
1072 vinfo(22)=
'coordinates'
1079 &
pio_fout, nvd4, u3dgrd, aval, vinfo, ncname)
1089# if defined WRITE_WATER && defined MASKING
1093 vinfo(22)=
'coordinates'
1100 &
pio_fout, nvd4, v3dgrd, aval, vinfo, ncname)
1113 IF (itrc.eq.
idsed(i))
THEN
1114 WRITE (vinfo(19),40) 1000.0_r8*
sd50(i,ng)
1118# if defined WRITE_WATER && defined MASKING
1119 vinfo(20)=
'mask_rho'
1122 vinfo(22)=
'coordinates'
1128 &
tlf(ng)%pioTrc(itrc)%vd, &
1129 &
pio_fout, nvd4, t3dgrd, aval, vinfo, ncname)
1156 query :
IF (.not.
ldeftlf(ng))
THEN
1161 IF (
tlf(ng)%pioFile%fh.eq.-1)
THEN
1164 WRITE (
stdout,50) trim(ncname)
1172 & piofile =
tlf(ng)%pioFile)
1178 & piofile =
tlf(ng)%pioFile)
1191 IF (trim(var_name(i)).eq.trim(
vname(1,
idtime)))
THEN
1196 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idztlf)))
THEN
1202 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idubtf)))
THEN
1207 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idvbtf)))
THEN
1213 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idutlf)))
THEN
1218 ELSE IF (trim(var_name(i)).eq.trim(
vname(1,
idvtlf)))
THEN
1227 IF (trim(var_name(i)).eq.trim(
vname(1,
idttlf(itrc))))
THEN
1228 got_var(
idttlf(itrc))=.true.
1240 IF (.not.got_var(
idtime))
THEN
1246 IF (.not.got_var(
idztlf))
THEN
1253 IF (.not.got_var(
idubtf))
THEN
1259 IF (.not.got_var(
idvbtf))
THEN
1266 IF (.not.got_var(
idutlf))
THEN
1272 IF (.not.got_var(
idvtlf))
THEN
1279 IF (.not.got_var(
idttlf(itrc)))
THEN
1290 tlf(ng)%Rindex=rec_size
1291 fcount=
tlf(ng)%Fcount
1292 tlf(ng)%Nrec(fcount)=rec_size
1295 10
FORMAT (2x,
'DEF_IMPULSE_PIO - creating impulse forcing file,', &
1296 & t56,
'Grid ',i2.2,
': ',a)
1297 20
FORMAT (2x,
'DEF_IMPULSE_PIO - inquiring impulse forcing file,', &
1298 & t56,
'Grid ',i2.2,
': ',a)
1299 30
FORMAT (/,
' DEF_IMPULSE_PIO - unable to create impulse forcing', &
1300 &
' NetCDF file: ',a)
1301 40
FORMAT (1pe11.4,1x,
'millimeter')
1302 50
FORMAT (/,
' DEF_IMPULSE_PIO - unable to open norm NetCDF', &
1304 60
FORMAT (/,
' DEF_IMPULSE_PIO - unable to find variable: ',a,2x, &
1305 &
' in impulse forcing NetCDF file: ',a)
subroutine, private def_impulse_pio(ng)
subroutine, private def_impulse_nf90(ng)
subroutine, public def_impulse(ng)
integer, parameter nbands
integer, dimension(:), allocatable nstatevar
type(t_io), dimension(:), allocatable tlf
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
integer, dimension(:), allocatable idttlf
character(len=maxlen), dimension(6, 0:nv) vname
integer, dimension(:,:,:), allocatable iinfo
integer, parameter ndimid
integer, parameter nf_tout
subroutine, public netcdf_check_dim(ng, model, ncname, ncid)
subroutine, public netcdf_open(ng, model, ncname, omode, ncid)
integer, parameter nf_fout
subroutine, public netcdf_enddef(ng, model, ncname, ncid)
character(len=100), dimension(mvars) var_name
integer, dimension(mvars) var_id
subroutine, public netcdf_create(ng, model, ncname, ncid)
subroutine, public netcdf_inq_var(ng, model, ncname, ncid, myvarname, searchvar, varid, nvardim, nvaratt)
integer, dimension(:), allocatable n
integer, parameter r3dvar
type(t_iobounds), dimension(:), allocatable iobounds
integer, parameter u3dvar
integer, parameter u2dvar
integer, dimension(:), allocatable nt
integer, parameter r2dvar
integer, parameter v2dvar
integer, parameter v3dvar
integer, parameter pio_fout
type(var_desc_t), dimension(:), pointer var_desc
subroutine, public pio_netcdf_create(ng, model, ncname, piofile)
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)
integer, parameter pio_tout
subroutine, public pio_netcdf_enddef(ng, model, ncname, piofile)
logical, dimension(:), allocatable ldeftlf
integer, dimension(:), allocatable idsed
real(r8), dimension(:,:), allocatable sd50
logical function, public founderror(flag, noerr, line, routine)