3#if defined WEAK_CONSTRAINT && defined RPCG
35# if defined PIO_LIB && defined DISTRIBUTE
47 integer,
intent(in) :: ng, tile, model, iinp, iout
51 integer :: lbi, ubi, lbj, ubj
53 character (len=*),
parameter :: myfile = &
65 SELECT CASE (
tlf(ng)%IOtype)
70# if defined PIO_LIB && defined DISTRIBUTE
81 10
FORMAT (
' WRT_AUG_IMP - Illegal output tile type, io_type = ',i0, &
82 & /,15x,
'Check KeyWord ''OUT_LIB'' in ''roms.in''.' )
96 integer,
intent(in) :: ng, tile, model, iinp, iout
97 integer,
intent(in) :: lbi, ubi, lbj, ubj
101 integer :: itrc, gfactor, gtype, status
105 character (len=*),
parameter :: myfile = &
106 & __FILE__//
", wrt_aug_imp_nf90"
108# include "set_bounds.h"
125# if defined WRITE_WATER && defined MASKING
138 & lbi, ubi, lbj, ubj, scale, &
140 &
grid(ng) % rmask, &
142 &
ocean(ng) % tl_zeta(:,:,iinp))
143 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
162 & lbi, ubi, lbj, ubj, scale, &
164 &
grid(ng) % umask_full, &
166 &
ocean(ng) % tl_ubar(:,:,iinp))
167 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
184 & lbi, ubi, lbj, ubj, scale, &
186 &
grid(ng) % vmask_full, &
188 &
ocean(ng) % tl_vbar(:,:,iinp))
189 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
208 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
210 &
grid(ng) % umask_full, &
212 &
ocean(ng) % tl_u(:,:,:,iinp))
213 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
230 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
232 &
grid(ng) % vmask_full, &
234 &
ocean(ng) % tl_v(:,:,:,iinp))
235 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
251 &
tlf(ng)%Tid(itrc), &
253 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
255 &
grid(ng) % rmask_full, &
257 &
ocean(ng) % tl_t(:,:,:,iinp,itrc))
258 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
278 10
FORMAT (2x,
'WRT_AUG_IMP_NF90 - writing augmented adjoint', &
279 &
' impulses, record: ',i0,/,22x,
'file: ',a)
280 20
FORMAT (/,
' WRT_AUG_IMP_NF90 - error while writing variable: ',a, &
281 & 2x,
'at time record = ',i0, &
282 & /,20x,
'into NetCDF file: ',a)
287# if defined PIO_LIB && defined DISTRIBUTE
291 & LBi, UBi, LBj, UBj)
298 integer,
intent(in) :: ng, tile, model, iinp, iout
299 integer,
intent(in) :: lbi, ubi, lbj, ubj
303 integer :: itrc, status
307 character (len=*),
parameter :: myfile = &
308 & __FILE__
", wrt_aug_imp_pio"
310 TYPE (io_desc_t),
pointer :: iodesc
312# include "set_bounds.h"
329 IF (
tlf(ng)%pioVar(
idztlf)%dkind.eq.pio_double)
THEN
338 & lbi, ubi, lbj, ubj, scale, &
340 &
grid(ng) % rmask, &
342 &
ocean(ng) % tl_zeta(:,:,iinp))
343 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
358 IF (
tlf(ng)%pioVar(
idubtf)%dkind.eq.pio_double)
THEN
367 & lbi, ubi, lbj, ubj, scale, &
369 &
grid(ng) % umask_full, &
371 &
ocean(ng) % tl_ubar(:,:,iinp))
372 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
385 IF (
tlf(ng)%pioVar(
idvbtf)%dkind.eq.pio_double)
THEN
394 & lbi, ubi, lbj, ubj, scale, &
396 &
grid(ng) % vmask_full, &
398 &
ocean(ng) % tl_vbar(:,:,iinp))
399 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
414 IF (
tlf(ng)%pioVar(
idutlf)%dkind.eq.pio_double)
THEN
423 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
425 &
grid(ng) % umask_full, &
427 &
ocean(ng) % tl_u(:,:,:,iinp))
428 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
441 IF (
tlf(ng)%pioVar(
idvtlf)%dkind.eq.pio_double)
THEN
450 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
452 &
grid(ng) % vmask_full, &
454 &
ocean(ng) % tl_v(:,:,:,iinp))
455 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
469 IF (
tlf(ng)%pioTrc(itrc)%dkind.eq.pio_double)
THEN
476 &
tlf(ng)%pioTrc(itrc), iout, &
478 & lbi, ubi, lbj, ubj, 1,
n(ng), scale, &
480 &
grid(ng) % rmask_full, &
482 &
ocean(ng) % tl_t(:,:,:,iinp,itrc))
483 IF (
founderror(status, nf90_noerr, __line__, myfile))
THEN
503 10
FORMAT (2x,
'WRT_AUG_IMP_PIO - writing augmented adjoint', &
504 &
' impulses, record: ',i0,/,22x,
'file: ',a)
505 20
FORMAT (/,
' WRT_AUG_IMP_PIO - error while writing variable: ',a, &
506 & 2x,
'at time record = ',i0, &
507 & /,20x,
'into NetCDF file: ',a)
type(t_grid), dimension(:), allocatable grid
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
subroutine, public netcdf_sync(ng, model, ncname, ncid)
type(t_ocean), dimension(:), allocatable ocean
integer, dimension(:), allocatable n
type(t_bounds), dimension(:), allocatable bounds
integer, parameter r3dvar
integer, parameter u3dvar
integer, parameter u2dvar
integer, dimension(:), allocatable nt
integer, parameter r2dvar
integer, parameter v2dvar
integer, parameter v3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_u3dvar
subroutine, public pio_netcdf_sync(ng, model, ncname, piofile)
type(io_desc_t), dimension(:), pointer iodesc_sp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_u3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_u2dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_v3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_v2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_v3dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_r3dvar
type(io_desc_t), dimension(:), pointer iodesc_dp_r2dvar
type(io_desc_t), dimension(:), pointer iodesc_sp_v2dvar
logical function, public find_string(a, asize, string, aindex)
logical function, public founderror(flag, noerr, line, routine)
subroutine, private wrt_aug_imp_pio(ng, tile, model, iinp, iout, lbi, ubi, lbj, ubj)
subroutine, private wrt_aug_imp_nf90(ng, tile, model, iinp, iout, lbi, ubi, lbj, ubj)
subroutine, public wrt_aug_imp(ng, tile, model, iinp, iout)