107 logical,
intent(inout) :: first
109 integer,
intent(in),
optional :: mpicomm
110 integer,
intent(in),
optional :: kernel
114 logical :: allocate_vars = .true.
117 integer :: myerror, mysize
119 integer :: phase, chunk_size, ng, thread, tile
121 character (len=*),
parameter :: myfile = &
122 & __FILE__//
", ROMS_initialize"
130 IF (
PRESENT(mpicomm))
THEN
182#if defined DISTRIBUTE
199 10
FORMAT (/,
' Process Information:',/)
203 DO thread=thread_range
261 integer,
intent(in) :: kernel
308 integer,
intent(in) :: kernel
351 integer,
intent(in),
optional :: kernel
353 real(dp),
intent(in) :: runinterval
358 integer :: nstrstep, nendstep, extra
360 real(dp) :: endtime, nexttime
362 character (len=2),
dimension(4) :: mid = (/
'NL',
'TL',
'RP',
'AD'/)
364 character (len=*),
parameter :: myfile = &
365 & __FILE__//
", ROMS_run"
385 nexttime=
time(ng)+runinterval
397 & nstrstep, max(0,nendstep)
402 nexttime=
time(ng)+runinterval
414 & nstrstep, max(0,nendstep)
419 nexttime=
time(ng)-runinterval
426 & nstrstep, max(0,nendstep)
448 10
FORMAT (1x,a,1x,
'ROMS: started time-stepping:', &
449 &
' (Grid: ',i2.2,
' TimeSteps: ',i0,
' - ',i0,
')')
464 integer :: fcount, ng, thread
466 character (len=*),
parameter :: myfile = &
467 & __FILE__//
", ROMS_finalize"
479 10
FORMAT (/,
' Blowing-up: Saving latest model state into ', &
506 20
FORMAT (/,
'Elapsed wall CPU time for each process (seconds):',/)
510 DO thread=thread_range
550 integer,
intent(in) :: phase
555 integer :: ng, thread, tile
560 integer,
dimension(Ngrids) :: inirec, tindex
562 character (len=*),
parameter :: myfile = &
563 & __FILE__//
", nlm_initial"
572 DO thread=thread_range
582 phase1 :
IF (phase.eq.1)
THEN
585 WRITE (
stdout,10)
'NLM_INITIAL: Phase 1 Initialization: ', &
586 &
'Configuring ROMS nonlinear kernel ...'
644 fcount=
his(ng)%Fcount
645 his(ng)%Nrec(fcount)=0
650 fcount=
qck(ng)%Fcount
651 qck(ng)%Nrec(fcount)=0
656 fcount=
rst(ng)%Fcount
657 rst(ng)%Nrec(fcount)=0
666 phase2:
IF (phase.eq.2)
THEN
669 WRITE (
stdout,10)
'NLM_INITIAL: Phase 2 Initialization: ', &
670 &
'Get/Set required applications fields ...'
712 CALL wetdry (ng, tile, tindex(ng), .true.)
817# if defined MASKING || defined WET_DRY
871#if defined ANA_DRAG && defined UV_DRAG_GRID
899#if defined FLOATS || defined STATIONS
916 phase3:
IF (phase.eq.3)
THEN
919 WRITE (
stdout,10)
'NLM_INITIAL: Phase 3 Initialization: ', &
920 &
'State Lateral Boundary Conditions ...'
950 & __line__, myfile))
RETURN
986 DO thread=thread_range
992 10
FORMAT (/,1x,a,a,/,1x,
'***********',/)
1014 integer,
intent(in) :: phase
1019 integer :: ng, thread, tile
1020 integer :: lstr, ifile
1022 integer,
dimension(Ngrids) :: inirec, tindex
1024# ifdef GENERIC_DSTART
1026 real(dp) :: my_dstart
1029 character (len=10) :: suffix
1031 character (len=*),
parameter :: myfile = &
1032 & __FILE__//
", tlm_initial"
1041 DO thread=thread_range
1051 phase1 :
IF (phase.eq.1)
THEN
1054 WRITE (
stdout,10)
'TLM_INITIAL: Phase 1 Initialization: ', &
1055 &
'Configuring ROMS tangent linear kernel ...'
1075# ifdef FLOATS_NOT_YET
1089# if defined GENERIC_DSTART
1100 IF (
initime(ng).lt.0.0_dp)
THEN
1103 my_dstart=
initime(ng)/86400.0_dp
1117 inirec(ng)=
nrrec(ng)
1134 phase2:
IF (phase.eq.2)
THEN
1137 WRITE (
stdout,10)
'TLM_INITIAL: Phase 2 Initialization: ', &
1138 &
'Get/Set required applications fields ...'
1190 CALL wetdry (ng, tile, tindex(ng), .true.)
1195# ifdef FORWARD_FLUXES
1212 WRITE (
qck(ng)%name,
"(a,'.nc')") trim(
qck(ng)%head)
1213 lstr=len_trim(
qck(ng)%name)
1214 qck(ng)%base=
qck(ng)%name(1:lstr-3)
1215 IF (
qck(ng)%Nfiles.gt.1)
THEN
1216 DO ifile=1,
qck(ng)%Nfiles
1217 WRITE (suffix,
"('_',i4.4,'.nc')") ifile
1218 qck(ng)%files(ifile)=trim(
qck(ng)%base)//trim(suffix)
1220 qck(ng)%name=trim(
qck(ng)%files(1))
1222 qck(ng)%files(1)=trim(
qck(ng)%name)
1287# if defined ANA_DRAG && defined UV_DRAG_GRID
1315# if defined FLOATS_NOT_YET || defined STATIONS
1332 phase3:
IF (phase.eq.3)
THEN
1335 WRITE (
stdout,10)
'TLM_INITIAL: Phase 3 Initialization: ', &
1336 &
'State Lateral Boundary Conditions ...'
1369 & __line__, myfile))
RETURN
1405 DO thread=thread_range
1411 10
FORMAT (/,1x,a,a,/,1x,
'***********',/)
1434 integer,
intent(in) :: phase
1439 integer :: ng, thread, tile
1440 integer :: lstr, ifile
1442 integer,
dimension(Ngrids) :: inirec, tindex
1444# ifdef GENERIC_DSTART
1446 real(dp) :: my_dstart
1449 character (len=10) :: suffix
1451 character (len=*),
parameter :: myfile = &
1452 & __FILE__//
", adm_initial"
1461 DO thread=thread_range
1471 phase1 :
IF (phase.eq.1)
THEN
1474 WRITE (
stdout,10)
'ADM_INITIAL: Phase 1 Initialization: ', &
1475 &
'Configuring ROMS nonlinear kernel ...'
1497# ifdef FLOATS_NOT_YET
1509# ifdef GENERIC_DSTART
1520 IF (
initime(ng).lt.0.0_dp)
THEN
1523 my_dstart=
initime(ng)/86400.0_dp
1541 inirec(ng)=
nrrec(ng)
1558 phase2:
IF (phase.eq.2)
THEN
1561 WRITE (
stdout,10)
'ADM_INITIAL: Phase 2 Initialization: ', &
1562 &
'Get/Set required applications fields ...'
1604 CALL wetdry (ng, tile, tindex(ng), .true.)
1609# ifdef FORWARD_FLUXES
1626 WRITE (
qck(ng)%name,
"(a,'.nc')") trim(
qck(ng)%head)
1627 lstr=len_trim(
qck(ng)%name)
1628 qck(ng)%base=
qck(ng)%name(1:lstr-3)
1629 IF (
qck(ng)%Nfiles.gt.1)
THEN
1630 DO ifile=1,
qck(ng)%Nfiles
1631 WRITE (suffix,
"('_',i4.4,'.nc')") ifile
1632 qck(ng)%files(ifile)=trim(
qck(ng)%base)//trim(suffix)
1634 qck(ng)%name=trim(
qck(ng)%files(1))
1636 qck(ng)%files(1)=trim(
qck(ng)%name)
1701# if defined ANA_DRAG && defined UV_DRAG_GRID
1729# if defined FLOATS_NOT_YET || defined STATIONS
1766 DO thread=thread_range
1772 10
FORMAT (/,1x,a,a,/,1x,
'***********',/)
subroutine ad_get_data(ng)
subroutine ad_get_idata(ng)
subroutine ad_main3d(runinterval)
subroutine check_multifile(ng, model)
subroutine edit_multifile(task)
subroutine grid_coords(ng, model)
subroutine main3d(runinterval)
subroutine, public ad_post_initial(ng, model)
subroutine ana_sponge(ng, tile, model)
subroutine ana_drag(ng, tile, model)
subroutine ana_psource(ng, tile, model)
subroutine, public close_out
subroutine, public close_inp(ng, model)
subroutine, public time_string(mytime, date_string)
subroutine, public get_wetdry(ng, tile, model, inirec)
subroutine, public ini_hmixcoef(ng, tile, model)
subroutine, public inp_par(model)
subroutine, public roms_initialize_arrays
subroutine, public roms_allocate_arrays(allocate_vars)
type(t_io), dimension(:), allocatable his
type(t_io), dimension(:), allocatable qck
type(t_io), dimension(:), allocatable rst
character(len=256) sourcefile
subroutine, public initialize_parallel
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, dimension(:,:), allocatable gridnumber
integer, dimension(:), allocatable ntilex
integer, dimension(:), allocatable ntilee
integer, dimension(:), allocatable gridsinlayer
logical, dimension(:), allocatable luvsrc
logical, dimension(:), allocatable lwrtqck
real(dp), parameter day2sec
logical, dimension(:), allocatable lreadqck
integer, dimension(:), allocatable nrrec
logical, dimension(:,:), allocatable ltracersrc
integer, dimension(:), allocatable ntimes
integer, dimension(:), allocatable iic
real(dp), dimension(:), allocatable dt
logical, dimension(:), allocatable lsponge
logical, dimension(:), allocatable setgridconfig
logical, dimension(:), allocatable synchro_flag
logical, dimension(:), allocatable lreadfrc
logical, dimension(:), allocatable predictor_2d_step
logical, dimension(:), allocatable ldefqck
integer, dimension(:), allocatable jic
real(dp), dimension(:), allocatable tdays
logical, dimension(:), allocatable ldefadj
logical, dimension(:), allocatable ldefhis
logical, dimension(:), allocatable lwrtadj
logical, dimension(:), allocatable lwsrc
real(dp), parameter sec2day
integer, dimension(:), allocatable ntend
integer, dimension(:), allocatable first_time
character(len=22), dimension(:), allocatable time_code
real(dp), dimension(:), allocatable time4jedi
integer, dimension(:), allocatable indx1
logical, dimension(:,:), allocatable compositegrid
logical, dimension(:), allocatable lwrthis
logical, dimension(:,:), allocatable tl_volcons
integer, dimension(:), allocatable ntfirst
logical, dimension(:), allocatable ldefrst
logical, dimension(:), allocatable lwrttlm
logical, dimension(:), allocatable lwrtrst
real(dp), dimension(:), allocatable time
logical, dimension(:), allocatable ldeftlm
integer, dimension(:), allocatable ntstart
integer, dimension(:), allocatable step_counter
logical, dimension(:), allocatable processinputdata
integer, dimension(:), allocatable iif
real(dp), dimension(:), allocatable initime
logical, dimension(:), allocatable lcyclerst
logical, dimension(:), allocatable lreadblk
integer, dimension(:), allocatable nfm2
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 nstp
subroutine, public nesting(ng, model, isection)
subroutine, public omega(ng, tile, model)
subroutine, public post_initial(ng, model)
subroutine, public rho_eos(ng, tile, model)
subroutine, public roms_initializep1(first, mpicomm, kernel)
subroutine, public roms_finalize
subroutine, public roms_run(runinterval)
subroutine, private tlm_initial(phase)
subroutine, public roms_initializep2(kernel)
subroutine, private adm_initial(phase)
subroutine, private nlm_initial(phase)
subroutine, public roms_initializep3(kernel)
subroutine, public set_depth(ng, tile, model)
subroutine, public set_depth0(ng, tile, model)
subroutine, public set_masks(ng, tile, model)
subroutine, public set_massflux(ng, tile, model)
integer function, public stdout_unit(mymaster)
logical, save set_stdoutunit
subroutine, public stiffness(ng, tile, model)
logical function, public founderror(flag, noerr, line, routine)
subroutine, public tl_post_initial(ng, model)
subroutine, public tl_bath(ng, tile)
subroutine wetdry(ng, tile, tindex, linitialize)
subroutine, public wrt_rst(ng, tile)
subroutine set_data(ng, tile)
subroutine set_grid(ng, model)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)
subroutine tl_get_data(ng)
subroutine tl_get_idata(ng)
subroutine tl_main3d(runinterval)
subroutine tl_set_data(ng, tile)