40#if defined PIO_LIB && defined DISTRIBUTE
95 logical,
intent(inout) :: first
97 integer,
intent(in),
optional :: mpiCOMM
101 logical :: allocate_vars = .true.
104 integer :: MyError, MySize
106 integer :: chunk_size, ng, thread
108 integer :: my_threadnum
111 character (len=*),
parameter :: MyFile = &
112 & __FILE__//
", ROMS_initialize"
120 IF (
PRESENT(mpicomm))
THEN
170#elif defined DISTRIBUTE
187 10
FORMAT (/,
' Process Information:',/)
191 DO thread=thread_range
204#if defined MCT_LIB && (defined ATM_COUPLING || defined WAV_COUPLING)
212 CALL initialize_ocn2atm_coupling (ng,
myrank)
215 CALL initialize_ocn2wav_coupling (ng,
myrank)
268 SELECT CASE (
lcz(ng)%IOtype)
278#if defined PIO_LIB && defined DISTRIBUTE
394 real(dp),
intent(in) :: RunInterval
403 integer :: Fcount, Is, Ie, i, iter, ng
404 integer :: NconvRitz(Ngrids)
408 real(r8),
dimension(2) :: my_norm, my_value
410 TYPE (T_GST),
allocatable :: ad_state(:)
411 TYPE (T_GST),
allocatable :: state(:)
413 character (len=55) :: string
415 character (len=*),
parameter :: MyFile = &
416 & __FILE__//
", ROMS_run"
425 IF (.not.
allocated(ad_state))
THEN
426 allocate ( ad_state(ngrids) )
428 IF (.not.
allocated(state))
THEN
429 allocate ( state(ngrids) )
441 iter_loop :
DO WHILE (iterate)
485 & (any(
ido.eq.99)))
THEN
503 IF (any(abs(
ido).eq.1))
THEN
506 adm(ng)%Nrec(fcount)=0
508 tlm(ng)%Nrec(fcount)=0
517 IF (
ASSOCIATED(state(ng)%vector))
THEN
518 nullify (state(ng)%vector)
522 state(ng)%vector =>
storage(ng)%SworkD(is:ie)
524 IF (
ASSOCIATED(ad_state(ng)%vector))
THEN
525 nullify (ad_state(ng)%vector)
529 ad_state(ng)%vector =>
storage(ng)%SworkD(is:ie)
535 IF (any(
info.ne.0))
THEN
537 IF (
info(ng).ne.0)
THEN
540 WRITE (
stdout,10)
'DSAUPD', trim(string), &
541 &
', info = ',
info(ng)
553 nconvritz(ng)=
iparam(5,ng)
555 WRITE (
stdout,20)
'Number of converged Ritz values:', &
557 WRITE (
stdout,20)
'Number of Arnoldi iterations:', &
590 IF (any(
info.ne.0))
THEN
592 IF (
info(ng).ne.0)
THEN
595 WRITE (
stdout,10)
'DSEUPD', trim(string), &
596 &
', info = ',
info(ng)
609 DO i=1,maxval(nconvritz)
613 adm(ng)%Nrec(fcount)=0
615 tlm(ng)%Nrec(fcount)=0
622 WRITE (
adm(ng)%name,30) trim(
adm(ng)%base), i
623 WRITE (
tlm(ng)%name,30) trim(
tlm(ng)%base), i
632 IF (
ASSOCIATED(state(ng)%vector))
THEN
633 nullify (state(ng)%vector)
636 IF (
ASSOCIATED(ad_state(ng)%vector))
THEN
637 nullify (ad_state(ng)%vector)
639 state(ng)%vector =>
storage(ng)%Rvector(is:ie,i)
640 ad_state(ng)%vector =>
sworkr(is:ie)
645 & __line__, myfile))
RETURN
650 & state(ng)%vector, &
651 & ad_state(ng)%vector, enorm)
665 my_norm(1)=
norm(i,ng)
666 my_norm(2)=my_norm(1)
668 my_value(2)=my_value(1)
671 SELECT CASE (
tlm(ng)%IOtype)
677 & start = (/
tlm(ng)%Rindex-1/), &
679 & ncid =
tlm(ng)%ncid)
682 & __line__, myfile))
RETURN
688 & start = (/
tlm(ng)%Rindex-1/), &
690 & ncid =
tlm(ng)%ncid)
693 & __line__, myfile))
RETURN
695#if defined PIO_LIB && defined DISTRIBUTE
701 & start = (/
tlm(ng)%Rindex-1/), &
703 & piofile =
tlm(ng)%pioFile)
706 & __line__, myfile))
RETURN
712 & start = (/
tlm(ng)%Rindex-1/), &
714 & piofile =
tlm(ng)%pioFile)
717 & __line__, myfile))
RETURN
724 & __line__, myfile))
RETURN
729 SELECT CASE (
adm(ng)%IOtype)
735 & start = (/
adm(ng)%Rindex/), &
737 & ncid =
adm(ng)%ncid)
740 & __line__, myfile))
RETURN
746 & start = (/
adm(ng)%Rindex/), &
748 & ncid =
adm(ng)%ncid)
751 & __line__, myfile))
RETURN
753#if defined PIO_LIB && defined DISTRIBUTE
759 & start = (/
adm(ng)%Rindex/), &
761 & piofile =
adm(ng)%pioFile)
764 & __line__, myfile))
RETURN
770 & start = (/
adm(ng)%Rindex/), &
772 & piofile =
adm(ng)%pioFile)
775 & __line__, myfile))
RETURN
783 & __line__, myfile))
RETURN
795 10
FORMAT (/,1x,
'Error in ',a,1x,a,a,1x,i5,/)
796 20
FORMAT (/,a,1x,i2,/)
797 30
FORMAT (a,
'_',i3.3,
'.nc')
798 40
FORMAT (1x,i4.4,
'-th residual',1p,e14.6,0p, &
799 &
' Ritz value',1pe14.6,0p,2x,i4.4)
815 integer :: Fcount, ng, thread
817 character (len=*),
parameter :: MyFile = &
818 & __FILE__//
", ROMS_finalize"
830 10
FORMAT (/,
' Blowing-up: Saving latest model state into ', &
857 20
FORMAT (/,
'Elapsed wall CPU time for each process (seconds):',/)
861 DO thread=thread_range
892 integer,
intent(in) :: info
894 character (len=*),
intent(out) :: string
901 string=
'Normal exit '
902 ELSE IF (info.eq.1)
THEN
903 string=
'Maximum number of iterations taken '
904 ELSE IF (info.eq.3)
THEN
905 string=
'No shifts could be applied during an IRAM cycle '
906 ELSE IF (info.eq.-1)
THEN
907 string=
'Nstate must be positive '
908 ELSE IF (info.eq.-2)
THEN
909 string=
'NEV must be positive '
910 ELSE IF (info.eq.-3)
THEN
911 string=
'NCV must be greater NEV and less than or equal Nstate '
912 ELSE IF (info.eq.-4)
THEN
913 string=
'Maximum number of iterations must be greater than zero '
914 ELSE IF (info.eq.-5)
THEN
915 string=
'WHICH must be one of LM, SM, LA, SA or BE '
916 ELSE IF (info.eq.-6)
THEN
917 string=
'BMAT must be one of I or G '
918 ELSE IF (info.eq.-7)
THEN
919 string=
'Length of private work array SworkL is not sufficient '
920 ELSE IF (info.eq.-8)
THEN
921 string=
'Error in DSTEQR in the eigenvalue calculation '
922 ELSE IF (info.eq.-9)
THEN
923 string=
'Starting vector is zero '
924 ELSE IF (info.eq.-10)
THEN
925 string=
'IPARAM(7) must be 1, 2, 3, 4, 5 '
926 ELSE IF (info.eq.-11)
THEN
927 string=
'IPARAM(7) = 1 and BMAT = G are incompatable '
928 ELSE IF (info.eq.-12)
THEN
929 string=
'IPARAM(1) must be equal to 0 or 1 '
930 ELSE IF (info.eq.-13)
THEN
931 string=
'NEV and WHICH = BE are incompatable '
932 ELSE IF (info.eq.-14)
THEN
933 string=
'Did not find any eigenvalues to sufficient accuaracy '
934 ELSE IF (info.eq.-15)
THEN
935 string=
'HOWMANY must be one of A or S if RVEC = .TRUE. '
936 ELSE IF (info.eq.-16)
THEN
937 string=
'HOWMANY = S not yet implemented '
938 ELSE IF (info.eq.-17)
THEN
939 string=
'Different count of converge Ritz values in DSEUPD '
940 ELSE IF (info.eq.-9999)
THEN
941 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 netcdf_close(ng, model, ncid, ncname, lupdate)
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 ldefadj
logical, dimension(:), allocatable lcycleadj
logical, dimension(:), allocatable lwrtadj
logical, dimension(:), allocatable lcycletlm
logical, dimension(:), allocatable lwrtper
logical, dimension(:), allocatable lwrttlm
logical, dimension(:), allocatable lwrtrst
logical, dimension(:), allocatable ldeftlm
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_hop(runinterval, 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)