135#if defined PIO_LIB && defined DISTRIBUTE
141#ifdef ADJUST_BOUNDARY
144#if defined OBS_IMPACT && defined OBS_IMPACT_SPLIT
149#ifdef BALANCE_OPERATOR
169#ifdef BALANCE_OPERATOR
175#if defined BALANCE_OPERATOR && defined ZETA_ELLIPTIC
198 logical,
intent(inout) :: first
200 integer,
intent(in),
optional :: mpiCOMM
204 logical :: allocate_vars = .true.
207 integer :: MyError, MySize
209 integer :: NRMrec, STDrec, Tindex
210 integer :: chunk_size, ng, thread
212 integer :: my_threadnum
215 character (len=*),
parameter :: MyFile = &
216 & __FILE__//
", ROMS_initialize"
224 IF (
PRESENT(mpicomm))
THEN
274#elif defined DISTRIBUTE
291 10
FORMAT (/,
' Process Information:',/)
295 DO thread=thread_range
308#if defined MCT_LIB && (defined ATM_COUPLING || defined WAV_COUPLING)
316 CALL initialize_ocn2atm_coupling (ng,
myrank)
319 CALL initialize_ocn2wav_coupling (ng,
myrank)
336 SELECT CASE (
lcz(ng)%IOtype)
346#if defined PIO_LIB && defined DISTRIBUTE
368 SELECT CASE (
lcz(ng)%IOtype)
374# if defined PIO_LIB && defined DISTRIBUTE
398#ifdef ADJUST_BOUNDARY
409#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
431#ifdef ADJUST_BOUNDARY
435#if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
457 real(dp),
intent(in) :: RunInterval
461 logical :: Ladjoint, Lweak
463 integer :: i, lstr, ng, tile
464 integer :: Fcount, Lbck, Lini, Litl, Rec
466 real (r8) :: str_day, end_day
468 character (len=*),
parameter :: MyFile = &
469 & __FILE__//
", ROMS_run"
482#if defined ADJUST_BOUNDARY || defined ADJUST_STFLUX || \
483 defined adjust_wstress
487#ifdef ADJUST_BOUNDARY
509 rst(ng)%Nrec(fcount)=0
515#if defined BALANCE_OPERATOR && defined ZETA_ELLIPTIC
608 IF ((
dstrs(ng).eq.0.0_r8).and.(
dends(ng).eq.0.0_r8))
THEN
617 IF ((
dstrs(ng).gt.str_day).or.(
dstrs(ng).lt.end_day))
THEN
623 IF ((
dends(ng).gt.str_day).or.(
dends(ng).lt.end_day))
THEN
669#ifdef BALANCE_OPERATOR
685#ifdef BALANCE_OPERATOR
699 SELECT CASE (
lcz(ng)%IOtype)
705#if defined PIO_LIB && defined DISTRIBUTE
725# ifdef FORWARD_FLUXES
734 rst(ng)%Nrec(fcount)=0
769# ifdef FORWARD_FLUXES
803#ifdef BALANCE_OPERATOR
817#ifdef OBS_IMPACT_SPLIT
826 SELECT CASE (
dav(ng)%IOtype)
831 & ncid =
dav(ng)%ncid)
834#if defined PIO_LIB && defined DISTRIBUTE
839 & piofile =
dav(ng)%pioFile)
861#if defined OBS_IMPACT && defined OBS_IMPACT_SPLIT
877# ifdef BALANCE_OPERATOR
893# ifdef ADJUST_BOUNDARY
904# ifdef BALANCE_OPERATOR
918 SELECT CASE (
lcz(ng)%IOtype)
924# if defined PIO_LIB && defined DISTRIBUTE
945# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
948# if defined ADJUST_BOUNDARY
959# ifdef BALANCE_OPERATOR
981# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
996# ifdef BALANCE_OPERATOR
1013# ifdef ADJUST_BOUNDARY
1024# ifdef BALANCE_OPERATOR
1038 SELECT CASE (
lcz(ng)%IOtype)
1044# if defined PIO_LIB && defined DISTRIBUTE
1066# if defined ADJUST_BOUNDARY
1077# ifdef BALANCE_OPERATOR
1100# if defined ADJUST_BOUNDARY
1115# ifdef BALANCE_OPERATOR
1140# ifdef BALANCE_OPERATOR
1154 SELECT CASE (
lcz(ng)%IOtype)
1160# if defined PIO_LIB && defined DISTRIBUTE
1182# if defined ADJUST_WSTRESS || defined ADJUST_STFLUX
1194# ifdef BALANCE_OPERATOR
1219 10
FORMAT (/,1x,a,1x,
'ROMS: started time-stepping:', &
1220 &
' (Grid: ',i2.2,
' TimeSteps: ',i8.8,
' - ',i8.8,
')',/)
1221 20
FORMAT (/,1x,a,1x,
'ROMS: started time-stepping:', &
1222 &
'( TimeSteps: ',i8.8,
' - ',i8.8,
')',/,15x, &
1223 &
'adjoint forcing time range: ',f12.4,
' - ',f12.4 ,/)
1224 30
FORMAT (/,
' Out of range adjoint forcing time, ',a,f12.4,/, &
1225 &
' It must be between ',f12.4,
' and ',f12.4)
1241 integer :: Fcount, ng, thread
1243 character (len=*),
parameter :: MyFile = &
1244 & __FILE__//
", ROMS_finalize"
1268 10
FORMAT (/,
' Blowing-up: Saving latest model state into ', &
1269 &
' RESTART file',/)
1271 IF (
lcyclerst(ng).and.(
rst(ng)%Nrec(fcount).ge.2))
THEN
1295 20
FORMAT (/,
'Elapsed wall CPU time for each process (seconds):',/)
1299 DO thread=thread_range
subroutine ad_initial(ng)
subroutine ad_main3d(runinterval)
subroutine edit_multifile(task)
subroutine main3d(runinterval)
subroutine, public ad_balance(ng, tile, lbck, linp)
subroutine, public ad_convolution(ng, tile, linp, lweak, ifac)
subroutine, public ad_variability(ng, tile, linp, lweak)
subroutine, public close_out
subroutine, public close_inp(ng, model)
subroutine, public def_mod(ng)
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)
real(dp), dimension(:,:), allocatable cg_beta
logical, dimension(:), allocatable wrtimpact_bc
logical, dimension(:), allocatable wrtimpact_fc
logical, dimension(:), allocatable wrtimpact_ic
logical, dimension(:), allocatable wrttlmod
logical, dimension(:), allocatable wrtnlmod
real(r8), dimension(:), allocatable obsscale
logical, dimension(:), allocatable wrtimpact_tot
logical, dimension(:), allocatable wrtobsscale
real(dp), dimension(:,:), allocatable cg_delta
logical, dimension(:), allocatable wrtzetaref
type(t_io), dimension(:), allocatable ads
type(t_io), dimension(:), allocatable lcz
type(t_io), dimension(:,:), allocatable std
type(t_io), dimension(:,:), allocatable nrm
type(t_io), dimension(:), allocatable adm
type(t_io), dimension(:), allocatable dav
type(t_io), dimension(:), allocatable rst
type(t_io), dimension(:), allocatable ini
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
character(len=maxlen), dimension(6, 0:nv) vname
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 lreadqck
integer, dimension(:), allocatable ntimes
real(dp), dimension(:), allocatable dt
logical, dimension(:), allocatable balance
logical, dimension(:), allocatable lreadfrc
logical, dimension(:), allocatable ldefini
real(dp), dimension(:), allocatable tdays
real(r8), dimension(:), allocatable dends
logical, dimension(:), allocatable ldefadj
logical, dimension(:), allocatable lcycleadj
logical, dimension(:), allocatable lwrtadj
real(dp), parameter sec2day
integer, dimension(:), allocatable ntend
logical, dimension(:), allocatable ldefmod
real(r8), dimension(:), allocatable dstrs
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 lbout
integer, dimension(:), allocatable nrhs
integer, dimension(:), allocatable lfinp
integer, dimension(:), allocatable lbinp
integer, dimension(:), allocatable lnew
integer, dimension(:), allocatable lfout
subroutine, public roms_finalize
subroutine, public roms_run(runinterval)
subroutine, public roms_initialize(first, mpicomm)
subroutine, public stats_modobs(ng, tile)
integer function, public stdout_unit(mymaster)
logical, save set_stdoutunit
logical function, public founderror(flag, noerr, line, routine)
subroutine, public tl_balance(ng, tile, lbck, linp)
subroutine, public tl_convolution(ng, tile, linp, lweak, ifac)
subroutine, public tl_variability(ng, tile, linp, lweak)
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)