87 logical,
intent(in) :: mymaster
88 logical,
intent(out) :: gotfile
92 integer :: inpunit, io_err
94 character (len=256) :: io_errmsg
95 character (len=*),
parameter :: myfile = &
96 & __FILE__//
", stdout_unit"
109# ifdef MODEL_COUPLING
121# if !(defined MODEL_COUPLING || defined JEDI)
125 OPEN (inpunit, file=trim(
iname), form=
'formatted', status=
'old', &
126 & iostat=io_err, iomsg=io_errmsg)
127 IF (io_err.ne.0)
THEN
128 IF (mymaster)
WRITE (
stdout,10) trim(io_errmsg)
143 10
FORMAT (/,
' STDINP_UNIT - Unable to open ROMS input script', &
145 & /,11x,
'ERROR: ',a,/, &
146 & /,11x,
'In distributed-memory applications, the input', &
147 & /,11x,
'script file is processed in parallel. The Unix', &
148 & /,11x,
'routine GETARG is used to get script file name.', &
149 & /,11x,
'For example, in MPI applications make sure that', &
150 & /,11x,
'command line is something like:',/, &
151 & /,11x,
'mpirun -np 4 romsM roms.in',/,/,11x,
'and not',/, &
152 & /,11x,
'mpirun -np 4 romsM < roms.in',/)
176 logical,
intent(in) :: MyMaster
178 integer,
intent(out) :: Value
180 character (len=*),
intent(in) :: KeyWord
181 character (len=*),
intent(in),
optional :: InpName
185 logical :: foundit, GotFile
187 integer :: InpUnit, Npts, Nval, io_err, status
190 real(dp),
dimension(nRval) :: Rval
192 character (len= 40) :: string
193 character (len=256) :: io_errmsg, line
194 character (len=256),
dimension(nCval) :: Cval
203 IF (
PRESENT(inpname))
THEN
205 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
206 & status=
'old', iostat=io_err, iomsg=io_errmsg)
207 IF (io_err.ne.0)
THEN
208 IF (mymaster)
WRITE (
stdout,10) trim(inpname), &
210 10
FORMAT (/,
' GETPAR_0D_I - Unable to open input script: ',a, &
225 READ (inpunit,
'(a)',
err=20,
END=40) line
227 IF (status.gt.0)
THEN
228 IF (trim(string).eq.trim(keyword))
THEN
229 npts=
load_i(nval, rval, 1, ivalue)
235 20
IF (mymaster)
THEN
237 30
FORMAT (/,
' GETPAR_0D_I - Error while processing line: ',/,a)
241 IF (.not.foundit)
THEN
243 WRITE (
stdout,50) trim(keyword)
244 50
FORMAT (/,
' GETPAR_0D_I - unable to find KeyWord: ',a, &
245 & /,15x,
'in ROMS standard input file.')
277 logical,
intent(in) :: MyMaster
279 integer,
intent(in) :: Ndim
280 integer,
intent(out) ::
Value(:)
282 character (len=*),
intent(in) :: KeyWord
283 character (len=*),
intent(in),
optional :: InpName
287 logical :: foundit, GotFile
289 integer :: InpUnit, Npts, Nval, io_err, status
291 real(dp),
dimension(nRval) :: Rval
293 character (len= 40) :: string
294 character (len=256) :: io_errmsg, line
295 character (len=256),
dimension(nCval) :: Cval
304 IF (
PRESENT(inpname))
THEN
306 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
307 & status=
'old', iostat=io_err, iomsg=io_errmsg)
308 IF (io_err.ne.0)
THEN
309 IF (mymaster)
WRITE (stdout,10) trim(inpname), &
311 10
FORMAT (/,
' GETPAR_1D_I - Unable to open input script: ',a, &
326 READ (inpunit,
'(a)',err=20,
END=40) line
327 status=decode_line(line, string, nval, cval, rval)
328 IF (status.gt.0)
THEN
329 IF (trim(string).eq.trim(keyword))
THEN
330 npts=load_i(nval, rval, ndim,
Value)
335 20
IF (mymaster)
THEN
336 WRITE (stdout,30) line
337 30
FORMAT (/,
' GETPAR_1D_I - Error while processing line: ',/,a)
341 IF (.not.foundit)
THEN
343 WRITE (stdout,50) trim(keyword)
344 50
FORMAT (/,
' GETPAR_1D_I - unable to find KeyWord: ',a, &
345 & /,15x,
'in ROMS standard input file.')
376 logical,
intent(in) :: MyMaster
377 logical,
intent(out) :: Value
379 character (len=*),
intent(in) :: KeyWord
380 character (len=*),
intent(in),
optional :: InpName
384 logical :: foundit, GotFile
387 integer :: InpUnit, Npts, Nval, io_err, status
389 real(dp),
dimension(nRval) :: Rval
391 character (len= 40) :: string
392 character (len=256) :: io_errmsg, line
393 character (len=256),
dimension(nCval) :: Cval
402 IF (
PRESENT(inpname))
THEN
404 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
405 & status=
'old', iostat=io_err, iomsg=io_errmsg)
406 IF (io_err.ne.0)
THEN
407 IF (mymaster)
WRITE (stdout,10) trim(inpname), &
409 10
FORMAT (/,
' GETPAR_0D_L - Unable to open input script: ',a, &
424 READ (inpunit,
'(a)',err=20,
END=40) line
425 status=decode_line(line, string, nval, cval, rval)
426 IF (status.gt.0)
THEN
427 IF (trim(string).eq.trim(keyword))
THEN
428 npts=load_l(nval, cval, 1, lvalue)
434 20
IF (mymaster)
THEN
435 WRITE (stdout,30) line
436 30
FORMAT (/,
' GETPAR_0D_L - Error while processing line: ',/,a)
440 IF (.not.foundit)
THEN
442 WRITE (stdout,50) trim(keyword)
443 50
FORMAT (/,
' GETPAR_0D_L - unable to find KeyWord: ',a, &
444 & /,15x,
'in ROMS standard input file.')
476 logical,
intent(in) :: MyMaster
477 logical,
intent(out) ::
Value(:)
479 integer,
intent(in) :: Ndim
481 character (len=*),
intent(in) :: KeyWord
482 character (len=*),
intent(in),
optional :: InpName
486 logical :: foundit, GotFile
488 integer :: InpUnit, Npts, Nval, io_err, status
490 real(dp),
dimension(nRval) :: Rval
492 character (len= 40) :: string
493 character (len=256) :: io_errmsg, line
494 character (len=256),
dimension(nCval) :: Cval
503 IF (
PRESENT(inpname))
THEN
505 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
506 & status=
'old', iostat=io_err, iomsg=io_errmsg)
507 IF (io_err.ne.0)
THEN
508 IF (mymaster)
WRITE (stdout,10) trim(inpname), &
510 10
FORMAT (/,
' GETPAR_1D_L - Unable to open input script: ',a, &
525 READ (inpunit,
'(a)',err=20,
END=40) line
526 status=decode_line(line, string, nval, cval, rval)
527 IF (status.gt.0)
THEN
528 IF (trim(string).eq.trim(keyword))
THEN
529 npts=load_l(nval, cval, ndim,
Value)
534 20
IF (mymaster)
THEN
535 WRITE (stdout,30) line
536 30
FORMAT (/,
' GETPAR_1D_L - Error while processing line: ',/,a)
540 IF (.not.foundit)
THEN
542 WRITE (stdout,50) trim(keyword)
543 50
FORMAT (/,
' GETPAR_1D_L - unable to find KeyWord: ',a, &
544 & /,15x,
'in ROMS standard input file.')
576 logical,
intent(in) :: MyMaster
578 real(r8),
intent(out) :: Value
580 character (len=*),
intent(in) :: KeyWord
581 character (len=*),
intent(in),
optional :: InpName
585 logical :: foundit, GotFile
587 integer :: InpUnit, Npts, Nval, io_err, status
589 real(r8) :: Rvalue(1)
591 real(dp),
dimension(nRval) :: Rval
593 character (len= 40) :: string
594 character (len=256) :: io_errmsg, line
595 character (len=256),
dimension(nCval) :: Cval
604 IF (
PRESENT(inpname))
THEN
606 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
607 & status=
'old', iostat=io_err, iomsg=io_errmsg)
608 IF (io_err.ne.0)
THEN
609 IF (mymaster)
WRITE (stdout,10) trim(inpname), &
611 10
FORMAT (/,
' GETPAR_0D_R - Unable to open input script: ',a, &
626 READ (inpunit,
'(a)',err=20,
END=40) line
627 status=decode_line(line, string, nval, cval, rval)
628 IF (status.gt.0)
THEN
629 IF (trim(string).eq.trim(keyword))
THEN
630 npts=load_r(nval, rval, 1, rvalue)
636 20
IF (mymaster)
THEN
637 WRITE (stdout,30) line
638 30
FORMAT (/,
' GETPAR_0D_R - Error while processing line: ',/,a)
642 IF (.not.foundit)
THEN
644 WRITE (stdout,50) trim(keyword)
645 50
FORMAT (/,
' GETPAR_0D_R - unable to find KeyWord: ',a, &
646 & /,15x,
'in ROMS standard input file.')
678 logical,
intent(in) :: MyMaster
680 integer,
intent(in) :: Ndim
682 real(r8),
intent(out) ::
Value(:)
684 character (len=*),
intent(in) :: KeyWord
685 character (len=*),
intent(in),
optional :: InpName
689 logical :: foundit, GotFile
691 integer :: InpUnit, Npts, Nval, io_err, status
693 real(dp),
dimension(nRval) :: Rval
695 character (len= 40) :: string
696 character (len=256) :: io_errmsg, line
697 character (len=256),
dimension(nCval) :: Cval
706 IF (
PRESENT(inpname))
THEN
708 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
709 & status=
'old', iostat=io_err, iomsg=io_errmsg)
710 IF (io_err.ne.0)
THEN
711 IF (mymaster)
WRITE (stdout,10) trim(inpname), &
713 10
FORMAT (/,
' GETPAR_1D_R - Unable to open input script: ',a, &
728 READ (inpunit,
'(a)',err=20,
END=40) line
729 status=decode_line(line, string, nval, cval, rval)
730 IF (status.gt.0)
THEN
731 IF (trim(string).eq.trim(keyword))
THEN
732 npts=load_r(nval, rval, ndim,
Value)
737 20
IF (mymaster)
THEN
738 WRITE (stdout,30) line
739 30
FORMAT (/,
' GETPAR_1D_R - Error while processing line: ',/,a)
743 IF (.not.foundit)
THEN
745 WRITE (stdout,50) trim(keyword)
746 50
FORMAT (/,
' GETPAR_1D_R - unable to find KeyWord: ',a, &
747 & /,15x,
'in ROMS standard input file.')
778 logical,
intent(in) :: MyMaster
780 character (len=*),
intent( in) :: KeyWord
781 character (len=*),
intent(out) :: Value
782 character (len=*),
intent( in),
optional :: InpName
786 logical :: foundit, GotFile
788 integer :: InpUnit, Npts, Nval, i, io_err, status
790 real(dp),
dimension(nRval) :: Rval
792 character (len=1 ),
parameter :: blank =
' '
793 character (len= 40) :: string
794 character (len=256) :: io_errmsg, line
795 character (len=256),
dimension(nCval) :: Cval
804 IF (
PRESENT(inpname))
THEN
806 OPEN (inpunit, file=trim(inpname), form=
'formatted', &
807 & status=
'old', iostat=io_err, iomsg=io_errmsg)
808 IF (io_err.ne.0)
THEN
809 IF (mymaster)
WRITE (stdout,10) trim(inpname), &
811 10
FORMAT (/,
' GETPAR_0D_S - Unable to open input script: ',a, &
826 READ (inpunit,
'(a)',err=20,
END=40) line
827 status=decode_line(line, string, nval, cval, rval)
828 IF (status.gt.0)
THEN
829 IF (trim(string).eq.trim(keyword))
THEN
833 Value=trim(adjustl(cval(nval)))
838 20
IF (mymaster)
THEN
839 WRITE (stdout,30) line
840 30
FORMAT (/,
' GETPAR_0D_S - Error while processing line: ',/,a)
844 IF (.not.foundit)
THEN
846 WRITE (stdout,50) trim(keyword)
847 50
FORMAT (/,
' GETPAR_0D_S - unable to find KeyWord: ',a, &
848 & /,15x,
'in ROMS standard input file.')
subroutine my_getarg(iarg, carg)
integer function decode_line(line_text, keyword, nval, cval, rval)
type(t_io), dimension(:), allocatable err
character(len=256) sourcefile
subroutine getpar_0d_s(mymaster, value, keyword, inpname)
subroutine getpar_1d_i(mymaster, ndim, value, keyword, inpname)
integer function, public stdinp_unit(mymaster, gotfile)
subroutine getpar_0d_l(mymaster, value, keyword, inpname)
subroutine getpar_0d_i(mymaster, value, keyword, inpname)
subroutine getpar_1d_l(mymaster, ndim, value, keyword, inpname)
subroutine getpar_1d_r(mymaster, ndim, value, keyword, inpname)
subroutine getpar_0d_r(mymaster, value, keyword, inpname)
logical function, public founderror(flag, noerr, line, routine)