2#if defined ADJOINT && defined SOLVE3D
21# if defined MODEL_COUPLING && defined MCT_LIB
28# ifdef SENSITIVITY_4DVAR
40# if defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
41 defined opt_observations || defined sensitivity_4dvar
50# ifdef BBL_MODEL_NOT_YET
53# if defined BULK_FLUXES_NOT_YET && !defined PRIOR_BULK_FLUXES
56# ifdef BVF_MIXING_NOT_YET
60# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
63# ifdef AD_OUTPUT_STATE
66# ifdef WEAK_CONSTRAINT
72# ifdef GLS_MIXING_NOT_YET
76# ifdef LMD_MIXING_NOT_YET
79# if defined FOUR_DVAR && defined OBSERVATIONS
80# ifdef WEAK_CONSTRAINT
97# ifdef ADJUST_BOUNDARY
106# ifdef NEARSHORE_MELLOR_NOT_YET
113# ifdef SEDIMENT_NOT_YET
121# if defined SSH_TIDES_NOT_YET || defined UV_TIDES_NOT_YET
131# ifdef FLOATS_NOT_YET
134# if defined BULK_FLUXES && !defined PRIOR_BULK_FLUXES
138# ifdef TIDE_GENERATING_FORCES
141# ifdef WEAK_CONSTRAINT
144# if defined ATM_COUPLING_NOT_YET && defined MCT_LIB
147# if defined WAV_COUPLING_NOT_YET && defined MCT_LIB
150# if (defined FOUR_DVAR && !defined I4DVAR_ANA_SENSITIVITY) && \
156 USE packing_mod,
ONLY :
ad_pack
162# ifdef SENSITIVITY_4DVAR
170 real(dp),
intent(in) :: RunInterval
174 logical :: backward = .true.
175 logical :: ad_advance
176 logical :: DoNestLayer, Time_Step
177 integer :: Nsteps, Rsteps
178 integer :: ig, il, is, istep, ng, nl, tile
179 integer :: my_iif, next_indx1
180# ifdef FLOATS_NOT_YET
181 integer :: Lend, Lstr, chunk_size
185 integer :: icount, itcount
188 real(r8) :: HalfDT, MaxDT, my_StepTime
190 character (len=*),
parameter :: MyFile = &
216 kernel_loop :
DO WHILE (time_step)
230 nest_layer :
DO WHILE (donestlayer)
241 IF (itcount.gt.0)
THEN
242 nl=stepinfo(itcount,1)
243 nsteps=stepinfo(itcount,2)
244 IF (itcount.eq.icount) nsteps=1
245 rsteps=stepinfo(itcount,3)
269 step_loop :
DO istep=nsteps,1,-1
301 & __line__, myfile))
RETURN
312# if defined FORWARD_READ || defined JEDI
315# ifdef TIDE_GENERATING_FORCES
316 CALL equilibrium_tide (ng, tile,
iadm)
322# if defined FORWARD_READ || defined JEDI
333# if defined BULK_FLUXES && !defined PRIOR_BULK_FLUXES
342 advance :
IF (ad_advance)
THEN
344# ifdef FLOATS_NOT_YET
368 lend=min(
nfloats(ng),lstr+chunk_size-1)
373 CALL ad_step_floats (ng, lstr, lend)
410 IF (do_twoway(
iadm,nl,il,ng,istep))
THEN
468# ifdef SEDIMENT_NOT_YET
469 CALL ad_sediment (ng, tile)
474# ifdef MY25_MIXING_NOT_YET
475 CALL ad_my25_corstep (ng, tile)
476# elif defined GLS_MIXING_NOT_YET
477 CALL ad_gls_corstep (ng, tile)
549# if defined MASKING && defined WET_DRY
568 loop_2d :
DO my_iif=maxval(
nfast)+1,1,-1
604 next_indx1=3-
indx1(ng)
648 IF (my_iif.le.(
nfast(ng)+1))
THEN
659 & my_iif.le.(
nfast(ng)+1))
THEN
679# if (defined FOUR_DVAR && !defined I4DVAR_ANA_SENSITIVITY) && \
689# ifdef SENSITIVITY_4DVAR
690# ifdef RBL4DVAR_FCT_SENSITIVITY
713# ifdef WEAK_CONSTRAINT
720 & __line__, myfile))
RETURN
721# ifdef SENSITIVITY_4DVAR
730# ifdef WEAK_CONSTRAINT
769# ifdef MY25_MIXING_NOT_YET
770 CALL ad_my25_prestep (ng, tile)
771# elif defined GLS_MIXING_NOT_YET
772 CALL ad_gls_prestep (ng, tile)
835# ifdef SENSITIVITY_4DVAR
841# if defined ANA_VMIX_NOT_YET
842 CALL ad_ana_vmix (ng, tile,
iadm)
843# elif defined LMD_MIXING_NOT_YET
844 CALL ad_lmd_vmix (ng, tile)
845# elif defined BVF_MIXING
846 CALL ad_bvf_mix (ng, tile)
861 IF (mod(
iic(ng)-1,
nadj(ng)).eq.0)
THEN
892# if defined SSH_TIDES_NOT_YET || defined UV_TIDES_NOT_YET
893 CALL ad_set_tides (ng, tile)
896# ifdef BBL_MODEL_NOT_YET
897 CALL ad_bblm (ng, tile)
899# if defined BULK_FLUXES_NOT_YET && !defined PRIOR_BULK_FLUXES
900 CALL ad_bulk_flux (ng, tile)
905# ifdef NEARSHORE_MELLOR_NOT_YET
914 CALL ad_radiation_stress (ng, tile)
919# if defined WAV_COUPLING_NOT_YET && defined MCT_LIB
931 CALL ocn2wav_coupling (ng, tile)
937# if defined ATM_COUPLING_NOT_YET && defined MCT_LIB
949 CALL ocn2atm_coupling (ng, tile)
1030# ifdef AD_OUTPUT_STATE
1069# if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
1076# ifdef RBL4DVAR_FCT_SENSITIVITY
1099# ifdef ADJUST_BOUNDARY
1106# ifdef RBL4DVAR_FCT_SENSITIVITY
1133# if defined WEAK_CONSTRAINT && !defined SP4DVAR
1159 & __line__, myfile))
RETURN
1162# if defined WEAK_CONSTRAINT && !defined SP4DVAR
1170 IF (mod(
iic(ng)-1,
nadj(ng)).eq.0)
THEN
1178# if (defined AD_SENSITIVITY || defined I4DVAR_ANA_SENSITIVITY || \
1179 defined opt_observations || defined sensitivity_4dvar) && \
1189# ifdef SENSITIVITY_4DVAR
1192# if !defined AD_IMPULSE
1199# if !defined AD_IMPULSE
1202# ifdef SENSITIVITY_4DVAR
subroutine ad_get_data(ng)
subroutine ad_main3d(runinterval)
subroutine ad_set_data(ng, tile)
subroutine, public ad_biology(ng, tile)
subroutine, public ad_diag(ng, tile)
subroutine, public ad_force_dual(ng, tile, kfrc, nfrc)
subroutine, public ad_forcing(ng, tile, kfrc, nfrc)
subroutine, public ad_frc_adjust(ng, tile, linp)
subroutine ad_htobs(ng, tile, model)
subroutine, public ad_out_zeta(ng, tile, model)
subroutine, public ad_out_fields(ng, tile, model)
subroutine ad_misfit(ng, tile, model)
subroutine, public ad_nesting(ng, model, isection)
subroutine, public ad_obc2d_adjust(ng, tile, linp)
subroutine, public ad_obc_adjust(ng, tile, linp)
subroutine, public ad_omega(ng, tile, model)
subroutine, public ad_post_initial(ng, model)
subroutine, public ad_rho_eos(ng, tile, model)
subroutine, public ad_rhs3d(ng, tile)
subroutine, public ad_set_avg(ng, tile)
subroutine, public ad_set_depth_bry(ng, tile, model)
subroutine, public ad_set_depth(ng, tile, model)
subroutine, public ad_set_massflux(ng, tile, model)
subroutine, public ad_set_vbc(ng, tile)
subroutine, public ad_set_zeta(ng, tile)
subroutine, public ad_step2d(ng, tile)
subroutine, public ad_step3d_t(ng, tile)
subroutine, public ad_step3d_uv(ng, tile)
subroutine, public ad_wvelocity(ng, tile, ninp)
subroutine, public adsen_force(ng, tile)
subroutine ana_vmix(ng, tile, model)
subroutine, public bulk_flux(ng, tile)
subroutine, public time_string(mytime, date_string)
subroutine, public frc_clear(ng, tile)
subroutine, public frc_adgather(ng, tile)
integer, dimension(:,:), allocatable couplesteps
logical, dimension(:), allocatable lsenfct
logical, dimension(:), allocatable lsadd
logical, dimension(:), allocatable lsen4dvar
logical, dimension(:), allocatable processobs
real(r8), dimension(:), allocatable twowayinterval
logical, dimension(:), allocatable donortofiner
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, dimension(:), allocatable nfloats
integer, dimension(:), allocatable nstr
integer, dimension(:,:), allocatable gridnumber
integer, dimension(:), allocatable nend
integer, dimension(:), allocatable gridsinlayer
logical, dimension(:), allocatable lfloats
real(dp), dimension(:), allocatable obstime
integer, dimension(:), allocatable iic
real(dp), dimension(:), allocatable dt
integer, dimension(:), allocatable sorec
logical, dimension(:), allocatable predictor_2d_step
integer, dimension(:), allocatable jic
real(dp), dimension(:), allocatable tdays
real(r8), dimension(:), allocatable dends
integer, dimension(:), allocatable nfast
real(dp), parameter sec2day
integer, dimension(:), allocatable ntend
character(len=22), dimension(:), allocatable time_code
real(dp), dimension(:), allocatable time4jedi
integer, dimension(:), allocatable indx1
logical, dimension(:,:), allocatable compositegrid
type(t_scalars), dimension(:), allocatable scalars
real(r8), dimension(:), allocatable dstrs
real(dp), dimension(:), allocatable time
logical, dimension(:), allocatable refinedgrid
integer, dimension(:), allocatable refinescale
integer, dimension(:), allocatable ntstart
integer, dimension(:), allocatable step_counter
integer, dimension(:), allocatable nadj
integer, dimension(:), allocatable iif
integer, dimension(:), allocatable nfm2
integer, dimension(:), allocatable lbout
integer, dimension(:), allocatable kstp
integer, dimension(:), allocatable knew
integer, dimension(:), allocatable nfm1
integer, dimension(:), allocatable nrhs
integer, dimension(:), allocatable nf
integer, dimension(:), allocatable nfm3
integer, dimension(:), allocatable nnew
integer, dimension(:), allocatable nfp1
integer, dimension(:), allocatable krhs
integer, dimension(:), allocatable lfout
integer, dimension(:), allocatable nstp
type(t_storage), dimension(:), allocatable storage
subroutine, public nesting(ng, model, isection)
subroutine, public obs_read(ng, model, backward)
subroutine, public omega(ng, tile, model)
subroutine, public rho_eos(ng, tile, model)
subroutine, public set_depth(ng, tile, model)
subroutine, public reset_massflux(ng, tile, model)
subroutine, public set_massflux(ng, tile, model)
logical function, public founderror(flag, noerr, line, routine)
subroutine nlm_step_sequence(runinterval, icount)
subroutine ntimesteps(model, runinterval, nl, nsteps, rsteps)
subroutine ad_pack(ng, tile, mstr, mend, ad_state)