58#if defined PIO_LIB && defined DISTRIBUTE
94#if defined BALANCE_OPERATOR && defined ZETA_ELLIPTIC
117 logical,
intent(inout) :: first
119 integer,
intent(in),
optional :: mpiCOMM
123 logical :: allocate_vars = .true.
126 integer :: MyError, MySize
128 integer :: STDrec, Tindex
129 integer :: chunk_size, ng, thread
131 integer :: my_threadnum
134 character (len=*),
parameter :: MyFile = &
135 & __FILE__//
", ROMS_initialize"
143 IF (
PRESENT(mpicomm))
THEN
193#elif defined DISTRIBUTE
210 10
FORMAT (/,
' Process Information:',/)
214 DO thread=thread_range
227#if defined MCT_LIB && (defined ATM_COUPLING || defined WAV_COUPLING)
235 CALL initialize_ocn2atm_coupling (ng,
myrank)
238 CALL initialize_ocn2wav_coupling (ng,
myrank)
269#ifdef ADJUST_BOUNDARY
280#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
306 real(dp),
intent(in) :: RunInterval
310 logical :: Lcgini, Linner, Lposterior
312 integer :: my_inner, my_outer
313 integer :: Lbck, Lini, Rec, Rec1, Rec2
314 integer :: i, ng, status, tile
315 integer :: Fcount, Mstr, NRMrec
317 integer,
dimension(Ngrids) :: Nrec
319 character (len=9 ) :: driver
320 character (len=20) :: string
322 character (len=*),
parameter :: MyFile = &
323 & __FILE__//
", ROMS_run"
332#if defined ADJUST_STFLUX || defined ADJUST_WSTRESS
336#ifdef ADJUST_BOUNDARY
384 ini(ng)%Nrec(fcount)=1
431#ifdef ADJUST_BOUNDARY
436#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
456#ifdef ADJUST_BOUNDARY
461#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
557 outer_loop1 :
DO my_outer=1,
nouter
572 WRITE (
fwd(ng)%name,10) trim(
fwd(ng)%base),
outer-1
593#ifndef DATALESS_LOOPS
631 IF (
fourdvar(ng)%DataPenalty(i).ne.0.0_r8)
THEN
642 SELECT CASE (
dav(ng)%IOtype)
645 &
'RP_iDataPenalty', &
649 & ncid =
dav(ng)%ncid)
651#if defined PIO_LIB && defined DISTRIBUTE
654 &
'RP_iDataPenalty', &
658 & piofile =
dav(ng)%pioFile)
684# ifdef ADJUST_BOUNDARY
690# if defined BALANCE_OPERATOR && defined ZETA_ELLIPTIC
709 inner_loop1 :
DO my_inner=0,
ninner
733 inner_compute1 :
IF (linner)
THEN
745 & __line__, myfile))
RETURN
749# ifdef RPM_RELAXATION
766 adm(ng)%Nrec(fcount)=0
796 & __line__, myfile))
RETURN
810 & __line__, myfile))
RETURN
818 & rec1, rec2, lposterior)
838 & __line__, myfile))
RETURN
848 tlm(ng)%name=trim(
tlm(ng)%base)//
'.nc'
868 & __line__, myfile))
RETURN
887 tlm(ng)%Nrec(fcount)=0
923 & __line__, myfile))
RETURN
926 END IF inner_compute1
953# ifdef RPM_RELAXATION
970 adm(ng)%Nrec(fcount)=0
1021 & rec1, rec2, lposterior)
1043#endif /* !DATALESS_LOOPS */
1065 IF (
frcrec(ng).gt.3)
THEN
1073#ifdef DATALESS_LOOPS
1117 IF (
fourdvar(ng)%DataPenalty(i).ne.0.0_r8)
THEN
1121#ifdef DATALESS_LOOPS
1135 SELECT CASE (
dav(ng)%IOtype)
1138 &
'RP_fDataPenalty', &
1142 & ncid =
dav(ng)%ncid)
1144#if defined PIO_LIB && defined DISTRIBUTE
1147 &
'RP_fDataPenalty', &
1151 & piofile =
dav(ng)%pioFile)
1161#ifdef DATALESS_LOOPS
1202 SELECT CASE (
dav(ng)%IOtype)
1208 & total = (/
nobs(ng)/))
1210#if defined PIO_LIB && defined DISTRIBUTE
1216 & total = (/
nobs(ng)/))
1231 outer_loop2 :
DO my_outer=1,
nouter
1239 WRITE (
fwd(ng)%name,10) trim(
fwd(ng)%base),
outer-1
1253 inner_loop2 :
DO my_inner=0,
ninner
1257 WRITE (
stdout,50)
'Tangent linear of', &
1264 IF (
inner.eq.0)
THEN
1282 inner_compute2 :
IF (linner)
THEN
1294 & __line__, myfile))
RETURN
1312 adm(ng)%Nrec(fcount)=0
1342 & __line__, myfile))
RETURN
1356 & __line__, myfile))
RETURN
1364 & rec1, rec2, lposterior)
1384 & __line__, myfile))
RETURN
1394 tlm(ng)%name=trim(
tlm(ng)%base)//
'.nc'
1403 IF (
frcrec(ng).gt.3)
THEN
1414 & __line__, myfile))
RETURN
1433 tlm(ng)%Nrec(fcount)=0
1468 & __line__, myfile))
RETURN
1471 END IF inner_compute2
1504 adm(ng)%Nrec(fcount)=0
1555 & rec1, rec2, lposterior)
1584 WRITE (
fwd(ng)%name,10) trim(
fwd(ng)%base),
outer-1
1585 WRITE (
tlm(ng)%name,10) trim(
tlm(ng)%base),
outer+1
1602 IF (
frcrec(ng).gt.3)
THEN
1622 tlm(ng)%Nrec(fcount)=0
1665 10
FORMAT (a,
'_',i3.3,
'.nc')
1666 20
FORMAT (/,1x,a,1x,
'ROMS: started time-stepping:', &
1667 &
' (Grid: ',i2.2,
' TimeSteps: ',i8.8,
' - ',i8.8,
')',/)
1668 30
FORMAT (
' (',i3.3,
',',i3.3,
'): ',a,
' data penalty, Jdata = ', &
1669 & 1p,e17.10,0p,t68,a)
1670 40
FORMAT (/,
' Converting Convolved Adjoint Trajectory to', &
1671 &
' Impulses: Outer = ',i3.3,
' Inner = ',i3.3,/)
1672 50
FORMAT (/,
'ROMS: ',a,1x,a,
', Outer = ',i3.3, &
1673 &
' Inner = ',i3.3,/)
1689 integer :: Fcount, ng, thread
1691 character (len=*),
parameter :: MyFile = &
1692 & __FILE__//
", ROMS_finalize"
1704 10
FORMAT (/,
' Blowing-up: Saving latest model state into ', &
1705 &
' RESTART file',/)
1707 IF (
lcyclerst(ng).and.(
rst(ng)%Nrec(fcount).ge.2))
THEN
1731 20
FORMAT (/,
'Elapsed wall CPU time for each process (seconds):',/)
1735 DO thread=thread_range
subroutine ad_initial(ng)
subroutine ad_main3d(runinterval)
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
logical, dimension(:), allocatable lweakrelax
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 irp
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 blk
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
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 ldefitl
logical, dimension(:), allocatable balance
logical, dimension(:), allocatable ldeftlf
integer, dimension(:), allocatable frcrec
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 lcyclerst
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)
subroutine rp_initial(ng)
subroutine rp_main3d(runinterval)
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)