33#if defined PIO_LIB && defined DISTRIBUTE
89 logical,
intent(inout) :: first
91 integer,
intent(in),
optional :: mpiCOMM
95 logical :: allocate_vars = .true.
98 integer :: MyError, MySize
100 integer :: chunk_size, ng, thread
102 integer :: my_threadnum
105 character (len=*),
parameter :: MyFile = &
106 & __FILE__//
", ROMS_initialize"
114 IF (
PRESENT(mpicomm))
THEN
164#elif defined DISTRIBUTE
181 10
FORMAT (/,
' Process Information:',/)
185 DO thread=thread_range
198#if defined MCT_LIB && (defined ATM_COUPLING || defined WAV_COUPLING)
206 CALL initialize_ocn2atm_coupling (ng,
myrank)
209 CALL initialize_ocn2wav_coupling (ng,
myrank)
262 SELECT CASE (
lcz(ng)%IOtype)
272#if defined PIO_LIB && defined DISTRIBUTE
387 real(dp),
intent(in) :: RunInterval
397 integer :: i, iter, ng, tile
398 integer :: NconvRitz(Ngrids)
402 TYPE (T_GST),
allocatable :: ad_state(:)
403 TYPE (T_GST),
allocatable :: state(:)
405 character (len=55) :: string
407 character (len=*),
parameter :: MyFile = &
408 & __FILE__//
", ROMS_run"
417 IF (.not.
allocated(ad_state))
THEN
418 allocate ( ad_state(ngrids) )
420 IF (.not.
allocated(state))
THEN
421 allocate ( state(ngrids) )
433 iter_loop :
DO WHILE (iterate)
477 & (any(
ido.eq.99)))
THEN
495 IF (any(abs(
ido).eq.1))
THEN
501 IF (
ASSOCIATED(state(ng)%vector))
THEN
502 nullify (state(ng)%vector)
506 state(ng)%vector =>
storage(ng)%SworkD(is:ie)
508 IF (
ASSOCIATED(ad_state(ng)%vector))
THEN
509 nullify (ad_state(ng)%vector)
513 ad_state(ng)%vector =>
storage(ng)%SworkD(is:ie)
519 IF (any(
info.ne.0))
THEN
521 IF (
info(ng).ne.0)
THEN
524 WRITE (
stdout,10)
'DSAUPD', trim(string), &
525 &
', info = ',
info(ng)
537 nconvritz(ng)=
iparam(5,ng)
539 WRITE (
stdout,20)
'Number of converged Ritz values:', &
541 WRITE (
stdout,20)
'Number of Arnoldi iterations:', &
574 IF (any(
info.ne.0))
THEN
576 IF (
info(ng).ne.0)
THEN
579 WRITE (
stdout,10)
'DSEUPD', trim(string), &
580 &
', info = ',
info(ng)
592 DO i=1,maxval(nconvritz)
595 WRITE (
tlm(ng)%name,30) trim(
tlm(ng)%base), i
604 IF (
ASSOCIATED(state(ng)%vector))
THEN
605 nullify (state(ng)%vector)
608 IF (
ASSOCIATED(ad_state(ng)%vector))
THEN
609 nullify (ad_state(ng)%vector)
611 state(ng)%vector =>
storage(ng)%Rvector(is:ie,i)
612 ad_state(ng)%vector =>
sworkr(is:ie)
617 & __line__, myfile))
RETURN
622 & state(ng)%vector, &
623 & ad_state(ng)%vector, enorm)
637 SELECT CASE (
tlm(ng)%IOtype)
643 & start = (/
tlm(ng)%Rindex/), &
645 & ncid =
tlm(ng)%ncid)
648 & __line__, myfile))
RETURN
654 & start = (/
tlm(ng)%Rindex/), &
656 & ncid =
tlm(ng)%ncid)
659 & __line__, myfile))
RETURN
661#if defined PIO_LIB && defined DISTRIBUTE
667 & start = (/
tlm(ng)%Rindex/), &
669 & piofile =
tlm(ng)%pioFile)
672 & __line__, myfile))
RETURN
678 & start = (/
tlm(ng)%Rindex/), &
680 & piofile =
tlm(ng)%pioFile)
683 & __line__, myfile))
RETURN
690 & __line__, myfile))
RETURN
693 SELECT CASE (
adm(ng)%IOtype)
699 & start = (/
adm(ng)%Rindex/), &
701 & ncid =
adm(ng)%ncid)
703 & __line__, myfile))
RETURN
709 & start = (/
adm(ng)%Rindex/), &
711 & ncid =
adm(ng)%ncid)
714 & __line__, myfile))
RETURN
716#if defined PIO_LIB && defined DISTRIBUTE
722 & start = (/
adm(ng)%Rindex/), &
724 & piofile =
adm(ng)%pioFile)
726 & __line__, myfile))
RETURN
732 & start = (/
adm(ng)%Rindex/), &
734 & piofile =
adm(ng)%pioFile)
737 & __line__, myfile))
RETURN
749 10
FORMAT (/,1x,
'Error in ',a,1x,a,a,1x,i5,/)
750 20
FORMAT (/,a,1x,i2,/)
751 30
FORMAT (a,
'_',i3.3,
'.nc')
752 40
FORMAT (1x,i4.4,
'-th residual',1p,e14.6,0p, &
753 &
' Ritz value',1pe14.6,0p,2x,i4.4)
769 integer :: Fcount, ng, thread
771 character (len=*),
parameter :: MyFile = &
772 & __FILE__//
", ROMS_finalize"
784 10
FORMAT (/,
' Blowing-up: Saving latest model state into ', &
811 20
FORMAT (/,
'Elapsed wall CPU time for each process (seconds):',/)
815 DO thread=thread_range
846 integer,
intent(in) :: info
848 character (len=*),
intent(out) :: string
855 string=
'Normal exit '
856 ELSE IF (info.eq.1)
THEN
857 string=
'Maximum number of iterations taken '
858 ELSE IF (info.eq.3)
THEN
859 string=
'No shifts could be applied during an IRAM cycle '
860 ELSE IF (info.eq.-1)
THEN
861 string=
'Nstate must be positive '
862 ELSE IF (info.eq.-2)
THEN
863 string=
'NEV must be positive '
864 ELSE IF (info.eq.-3)
THEN
865 string=
'NCV must be greater NEV and less than or equal Nstate '
866 ELSE IF (info.eq.-4)
THEN
867 string=
'Maximum number of iterations must be greater than zero '
868 ELSE IF (info.eq.-5)
THEN
869 string=
'WHICH must be one of LM, SM, LA, SA or BE '
870 ELSE IF (info.eq.-6)
THEN
871 string=
'BMAT must be one of I or G '
872 ELSE IF (info.eq.-7)
THEN
873 string=
'Length of private work array SworkL is not sufficient '
874 ELSE IF (info.eq.-8)
THEN
875 string=
'Error in DSTEQR in the eigenvalue calculation '
876 ELSE IF (info.eq.-9)
THEN
877 string=
'Starting vector is zero '
878 ELSE IF (info.eq.-10)
THEN
879 string=
'IPARAM(7) must be 1, 2, 3, 4, 5 '
880 ELSE IF (info.eq.-11)
THEN
881 string=
'IPARAM(7) = 1 and BMAT = G are incompatable '
882 ELSE IF (info.eq.-12)
THEN
883 string=
'IPARAM(1) must be equal to 0 or 1 '
884 ELSE IF (info.eq.-13)
THEN
885 string=
'NEV and WHICH = BE are incompatable '
886 ELSE IF (info.eq.-14)
THEN
887 string=
'Did not find any eigenvalues to sufficient accuaracy '
888 ELSE IF (info.eq.-15)
THEN
889 string=
'HOWMANY must be one of A or S if RVEC = .TRUE. '
890 ELSE IF (info.eq.-16)
THEN
891 string=
'HOWMANY = S not yet implemented '
892 ELSE IF (info.eq.-17)
THEN
893 string=
'Different count of converge Ritz values in DSEUPD '
894 ELSE IF (info.eq.-9999)
THEN
895 string=
'Could not build and Arnoldi factorization '
subroutine edit_multifile(task)
subroutine, public close_out
subroutine, public close_file(ng, model, s, ncname, lupdate)
subroutine, public close_inp(ng, model)
subroutine, public def_gst(ng, model)
subroutine, public get_gst(ng, model)
subroutine, public inp_par(model)
subroutine, public roms_initialize_arrays
subroutine, public roms_allocate_arrays(allocate_vars)
real(dp), dimension(:,:), allocatable cg_beta
real(dp), dimension(:,:), allocatable cg_delta
type(t_io), dimension(:), allocatable lcz
type(t_io), dimension(:), allocatable adm
type(t_io), dimension(:), allocatable tlm
type(t_io), dimension(:), allocatable rst
character(len=256) sourcefile
integer, parameter io_nf90
integer, parameter io_pio
subroutine, public initialize_parallel
integer, dimension(:), allocatable first_tile
integer, dimension(:), allocatable last_tile
integer, dimension(:), allocatable ntilex
integer, dimension(:), allocatable nsize
integer, dimension(:), allocatable ntilee
integer, dimension(:), allocatable ntimes
integer, dimension(:), allocatable ntlm
integer, dimension(:), allocatable nconv
logical, dimension(:), allocatable lreadfrc
logical, dimension(:), allocatable lcycleadj
logical, dimension(:), allocatable lwrtadj
logical, dimension(:), allocatable lcycletlm
logical, dimension(:), allocatable lwrtper
logical, dimension(:), allocatable lwrthis
logical, dimension(:), allocatable lwrttlm
logical, dimension(:), allocatable lwrtrst
integer, dimension(:), allocatable nadj
logical, dimension(:), allocatable lreadfwd
logical, dimension(:), allocatable lcyclerst
logical, dimension(:), allocatable lreadblk
integer, dimension(8) iaup2
integer, dimension(:), allocatable ido
real(r8), dimension(:,:), allocatable sworkl
integer, dimension(:,:), allocatable ipntr
logical, dimension(5) laup2
type(t_storage), dimension(:), allocatable storage
real(r8), dimension(:,:), allocatable norm
integer, dimension(:), allocatable info
subroutine, public allocate_storage
integer, dimension(:,:), allocatable iparam
logical, dimension(:,:), allocatable pick
real(r8), dimension(:), pointer sworkr
real(r8), dimension(:,:), allocatable rvaluer
subroutine, public propagator_hso(runinterval, iter, state, ad_state)
subroutine, public roms_finalize
subroutine, public roms_run(runinterval)
subroutine, private iram_error(info, icall, string)
subroutine, public roms_initialize(first, mpicomm)
integer function, public stdout_unit(mymaster)
logical, save set_stdoutunit
logical function, public founderror(flag, noerr, line, routine)
subroutine, public wrt_gst(ng, model)
subroutine, public wrt_rst(ng, tile)
subroutine r_norm2(ng, model, mstr, mend, evalue, evector, state, norm2)
recursive subroutine wclock_off(ng, model, region, line, routine)
recursive subroutine wclock_on(ng, model, region, line, routine)
subroutine tl_initial(ng)