61#if defined PIO_LIB && defined DISTRIBUTE
97#if defined BALANCE_OPERATOR && defined ZETA_ELLIPTIC
120 logical,
intent(inout) :: first
122 integer,
intent(in),
optional :: mpiCOMM
126 logical :: allocate_vars = .true.
129 integer :: MyError, MySize
131 integer :: STDrec, Tindex
132 integer :: chunk_size, ng, thread
134 integer :: my_threadnum
137 character (len=*),
parameter :: MyFile = &
138 & __FILE__//
", ROMS_initialize"
146 IF (
PRESENT(mpicomm))
THEN
196#elif defined DISTRIBUTE
213 10
FORMAT (/,
' Process Information:',/)
217 DO thread=thread_range
230#if defined MCT_LIB && (defined ATM_COUPLING || defined WAV_COUPLING)
238 CALL initialize_ocn2atm_coupling (ng,
myrank)
241 CALL initialize_ocn2wav_coupling (ng,
myrank)
272#ifdef ADJUST_BOUNDARY
283#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
309 real(dp),
intent(in) :: RunInterval
313 logical :: Lcgini, Linner, Lposterior
315 integer :: my_inner, my_outer
316 integer :: Lbck, Lini, Rec1, Rec2
317 integer :: i, lstr, ng, status, tile
318 integer :: Fcount, Mstr, NRMrec
320 integer,
dimension(Ngrids) :: indxSave
321 integer,
dimension(Ngrids) :: Nrec
323 character (len=11) :: driver
324 character (len=20) :: string
326 character (len=*),
parameter :: MyFile = &
327 & __FILE__//
", ROMS_run"
336#if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
340#ifdef ADJUST_BOUNDARY
387 ini(ng)%Nrec(fcount)=1
403 lstr=len_trim(
his(ng)%name)
404 his(ng)%base=
his(ng)%name(1:lstr-3)
426#ifdef ADJUST_BOUNDARY
431#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
451#ifdef ADJUST_BOUNDARY
456#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
562 IF (
fourdvar(ng)%NLPenalty(i).ne.0.0_r8)
THEN
573 SELECT CASE (
dav(ng)%IOtype)
576 &
'NL_iDataPenalty', &
579 & ncid =
dav(ng)%ncid)
581#if defined PIO_LIB && defined DISTRIBUTE
584 &
'NL_iDataPenalty', &
587 & piofile =
dav(ng)%pioFile)
631 outer_loop1 :
DO my_outer=1,
nouter
639 WRITE (
fwd(ng)%name,10) trim(
fwd(ng)%head),
outer-1
640 lstr=len_trim(
his(ng)%name)
641 his(ng)%base=
his(ng)%name(1:lstr-3)
651# ifdef ADJUST_BOUNDARY
657#if defined BALANCE_OPERATOR && defined ZETA_ELLIPTIC
676 inner_loop1 :
DO my_inner=0,
ninner
700 inner_compute1 :
IF (linner)
THEN
712 & __line__, myfile))
RETURN
723 adm(ng)%Nrec(fcount)=0
753 & __line__, myfile))
RETURN
767 & __line__, myfile))
RETURN
775 & rec1, rec2, lposterior)
795 & __line__, myfile))
RETURN
827 & __line__, myfile))
RETURN
845 tlm(ng)%Nrec(fcount)=0
880 & __line__, myfile))
RETURN
883 END IF inner_compute1
890 status=nf90_close(
tlm(ng)%ncid)
915 adm(ng)%Nrec(fcount)=0
966 & rec1, rec2, lposterior)
1001#ifdef FORWARD_FLUXES
1006 lstr=len_trim(
his(ng)%name)
1007 his(ng)%base=
his(ng)%name(1:lstr-3)
1014 IF (
frcrec(ng).gt.3)
THEN
1025# ifdef ADJUST_BOUNDARY
1036 indxsave(ng)=
ini(ng)%Rindex
1044 ini(ng)%Rindex=indxsave(ng)
1066 CALL main3d (runinterval)
1068 CALL main2d (runinterval)
1089#ifdef FORWARD_FLUXES
1116 IF (
fourdvar(ng)%NLPenalty(i).ne.0.0_r8)
THEN
1127 SELECT CASE (
dav(ng)%IOtype)
1130 &
'NL_fDataPenalty', &
1134 & ncid =
dav(ng)%ncid)
1136#if defined PIO_LIB && defined DISTRIBUTE
1139 &
'NL_fDataPenalty', &
1143 & piofile =
dav(ng)%pioFile)
1161#if defined PIO_LIB && defined DISTRIBUTE
1163 his(ng)%pioFile%fh=-1
1188 SELECT CASE (
obs(ng)%IOtype)
1194 & total = (/
nobs(ng)/))
1196#if defined PIO_LIB && defined DISTRIBUTE
1202 & total = (/
nobs(ng)/))
1214 outer_loop2 :
DO my_outer=1,
nouter
1222 WRITE (
fwd(ng)%name,10) trim(
fwd(ng)%head),
outer-1
1223 lstr=len_trim(
fwd(ng)%name)
1224 fwd(ng)%base=
fwd(ng)%name(1:lstr-3)
1237 inner_loop2 :
DO my_inner=0,
ninner
1241 WRITE (
stdout,50)
'Tangent linear of', &
1248 IF (
inner.eq.0)
THEN
1266 inner_compute2 :
IF (linner)
THEN
1278 & __line__, myfile))
RETURN
1289 adm(ng)%Nrec(fcount)=0
1319 & __line__, myfile))
RETURN
1333 & __line__, myfile))
RETURN
1341 & rec1, rec2, lposterior)
1361 & __line__, myfile))
RETURN
1382 IF (
frcrec(ng).gt.3)
THEN
1393 & __line__, myfile))
RETURN
1412 tlm(ng)%Nrec(fcount)=0
1448 & __line__, myfile))
RETURN
1451 END IF inner_compute2
1476 adm(ng)%Nrec(fcount)=0
1527 & rec1, rec2, lposterior)
1554 lstr=len_trim(
fwd(ng)%name)
1555 fwd(ng)%base=
fwd(ng)%name(1:lstr-3)
1572 IF (
frcrec(ng).gt.3)
THEN
1592 tlm(ng)%Nrec(fcount)=0
1634#if defined PIO_LIB && defined DISTRIBUTE
1636 his(ng)%pioFile%fh=-1
1643 10
FORMAT (a,
'_',i3.3,
'.nc')
1644 20
FORMAT (/,1x,a,1x,
'ROMS: started time-stepping:', &
1645 &
' (Grid: ',i2.2,
' TimeSteps: ',i0,
' - ',i0,
')',/)
1646 30
FORMAT (
' (',i3.3,
',',i3.3,
'): ',a,
' data penalty, Jdata = ', &
1647 & 1p,e17.10,0p,t68,a)
1648 40
FORMAT (/,
' Converting Convolved Adjoint Trajectory to', &
1649 &
' Impulses: Outer = ',i0,
' Inner = ',i0,/)
1650 50
FORMAT (/,
'ROMS: ',a,1x,a,
', Outer = ',i0,
' Inner = ',i0,/)
1666 integer :: Fcount, ng, thread
1668 character (len=*),
parameter :: MyFile = &
1669 & __FILE__//
", ROMS_finalize"
1681 10
FORMAT (/,
' Blowing-up: Saving latest model state into ', &
1682 &
' RESTART file',/)
1684 IF (
lcyclerst(ng).and.(
rst(ng)%Nrec(fcount).ge.2))
THEN
1708 20
FORMAT (/,
'Elapsed wall CPU time for each process (seconds):',/)
1712 DO thread=thread_range
subroutine ad_initial(ng)
subroutine ad_main3d(runinterval)
subroutine edit_multifile(task)
subroutine main3d(runinterval)
subroutine, public ad_wrt_his(ng, tile)
subroutine, public close_out
subroutine, public close_file(ng, model, s, ncname, lupdate)
subroutine, public close_inp(ng, model)
subroutine, public congrad(ng, model, outloop, innloop, ninnloop, lcgini)
subroutine, public error_covariance(model, driver, outloop, innloop, rbck, rini, rold, rnew, rec1, rec2, lposterior)
subroutine, public def_impulse(ng)
subroutine, public def_mod(ng)
subroutine, public def_norm(ng, model, ifile)
subroutine, public get_state(ng, model, msg, s, inirec, tindex)
subroutine, public inp_par(model)
subroutine, public roms_initialize_arrays
subroutine, public roms_allocate_arrays(allocate_vars)
subroutine, public initialize_boundary(ng, tile, model)
subroutine, public initialize_forces(ng, tile, model)
type(t_fourdvar), dimension(:), allocatable fourdvar
real(r8), dimension(:), allocatable tl_obsval
logical, dimension(:), allocatable wrtmisfit
logical, dimension(:), allocatable wrtrpmod
integer, dimension(:), allocatable nobs
integer, dimension(:), allocatable nobsvar
logical, dimension(:), allocatable wrttlmod
logical, dimension(:), allocatable wrtnlmod
logical, dimension(:), allocatable wrtforce
logical, dimension(:), allocatable wrtobsscale
character(len=40), dimension(:), allocatable obsname
logical, dimension(:), allocatable wrtzetaref
integer, dimension(:), allocatable nstrobs
type(t_io), dimension(:,:), allocatable std
type(t_io), dimension(:), allocatable his
type(t_io), dimension(:,:), allocatable nrm
type(t_io), dimension(:), allocatable adm
type(t_io), dimension(:), allocatable obs
type(t_io), dimension(:), allocatable tlf
type(t_io), dimension(:), allocatable tlm
type(t_io), dimension(:), allocatable itl
type(t_io), dimension(:), allocatable dav
type(t_io), dimension(:), allocatable fwd
type(t_io), dimension(:), allocatable rst
type(t_io), dimension(:), allocatable ini
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
integer, dimension(:), allocatable idefhis
subroutine, public initialize_ocean(ng, tile, model)
subroutine, public initialize_parallel
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, dimension(:), allocatable ntilex
integer, dimension(:), allocatable ntilee
logical, dimension(:,:), allocatable lwrtnrm
logical, dimension(:), allocatable lreadqck
logical, dimension(:), allocatable ldefitl
logical, dimension(:), allocatable balance
logical, dimension(:), allocatable ldeftlf
integer, dimension(:), allocatable frcrec
logical, dimension(:), allocatable lreadfrc
logical, dimension(:), allocatable ldefadj
logical, dimension(:), allocatable frequentimpulse
logical, dimension(:), allocatable ldefhis
integer, dimension(:), allocatable ntend
logical, dimension(:), allocatable ldefmod
logical, dimension(:,:), allocatable ldefnrm
logical, dimension(:), allocatable sporadicimpulse
logical, dimension(:), allocatable lwrthis
logical, dimension(:), allocatable lwrttlm
logical, dimension(:), allocatable lwrtrst
logical, dimension(:), allocatable ldeftlm
integer, dimension(:), allocatable ntstart
logical, dimension(:), allocatable lreadfwd
logical, dimension(:), allocatable lcyclerst
logical, dimension(:), allocatable lreadblk
integer, dimension(:), allocatable lold
integer, dimension(:), allocatable lbout
integer, dimension(:), allocatable lfinp
integer, dimension(:), allocatable lbinp
integer, dimension(:), allocatable lnew
integer, dimension(:), allocatable lfout
subroutine, public normalization(ng, tile, ifac)
subroutine, public roms_finalize
subroutine, public roms_run(runinterval)
subroutine, public roms_initialize(first, mpicomm)
integer function, public stdout_unit(mymaster)
logical, save set_stdoutunit
character(len(sinp)) function, public uppercase(sinp)
logical function, public founderror(flag, noerr, line, routine)
subroutine, public tl_def_ini(ng)
subroutine, public wrt_impulse(ng, tile, model, inpncname)
subroutine, public wrt_ini(ng, tile, tindex, outrec)
subroutine, public wrt_rst(ng, tile)
subroutine, public biconj(ng, tile, model, lbck)
subroutine, public balance_ref(ng, tile, lbck)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)
subroutine tl_initial(ng)
subroutine tl_main3d(runinterval)