11 character(len=*),
parameter,
public :: astr =
' ABORT: '
12 character(len=*),
parameter,
public :: estr =
' ERROR: '
13 character(len=*),
parameter,
public :: wstr =
' WARNING: '
26 integer(ip_intwp_p),
parameter :: muni = 20
27 integer(ip_intwp_p),
save :: unitno(muni) = -1
28 integer(ip_intwp_p),
save :: maxion
29 integer(ip_intwp_p),
parameter :: tree_delta = 2
30 integer(ip_intwp_p),
save :: tree_indent = 0
44 INTEGER(kind=ip_intwp_p),
INTENT(in),
optional :: id_compid
45 CHARACTER(len=*),
INTENT(in),
optional :: cd_routine
46 CHARACTER(len=*),
INTENT(in),
optional :: cd_message
49 character(len=*),
parameter :: subname =
'(oasis_abort)'
52 if (
present(id_compid)) &
53 WRITE (nulprt,*) subname,astr,
'compid = ',id_compid
54 if (
present(cd_routine)) &
55 WRITE (nulprt,*) subname,astr,
'called by = ',trim(cd_routine)
56 if (
present(cd_message)) &
57 WRITE (nulprt,*) subname,astr,
'message = ',trim(cd_message)
59 WRITE (nulprt,*) subname,astr,
'on model = ',trim(compnm)
60 WRITE (nulprt,*) subname,astr,
'on global rank = ',mpi_rank_global
61 WRITE (nulprt,*) subname,astr,
'on local rank = ',mpi_rank_local
62 WRITE (nulprt,*) subname,astr,
'CALLING ABORT FROM OASIS LAYER NOW'
65 #if defined use_comm_MPI1 || defined use_comm_MPI2
66 CALL mpi_abort(mpi_comm_global, 0, ierror)
82 INTEGER(kind=ip_intwp_p),
INTENT(in) :: nu
84 character(len=*),
parameter :: subname =
'(oasis_flush)'
100 INTEGER(kind=ip_intwp_p),
INTENT(out) :: uio
102 INTEGER(kind=ip_intwp_p) :: n1
104 character(len=*),
parameter :: subname =
'(oasis_unitget)'
109 do while (n1 < muni .and. .not.found)
111 if (unitno(n1) < 0)
then
115 if (oasis_debug >= 2)
write(nulprt,*) subname,n1,uio
120 write(nulprt,*) subname,estr,
'no unit number available '
135 INTEGER(kind=ip_intwp_p),
INTENT(in) :: uio
137 character(len=*),
parameter :: subname =
'(oasis_unitsetmin)'
141 if (oasis_debug >= 20)
write(nulprt,*) subname,maxion
154 INTEGER(kind=ip_intwp_p),
INTENT(in) :: uio
156 INTEGER(kind=ip_intwp_p) :: n1
157 character(len=*),
parameter :: subname =
'(oasis_unitfree)'
161 if (unitno(n1) == uio)
then
163 if (oasis_debug >= 20)
write(nulprt,*) subname,n1,uio
179 CHARACTER(len=*),
INTENT(in) :: string
181 character(len=*),
parameter :: subname =
'(oasis_debug_enter)'
182 CHARACTER(len=1),
pointer :: ch_blank(:)
183 CHARACTER(len=500) :: tree_enter
185 if (oasis_debug >= 10)
then
186 ALLOCATE (ch_blank(tree_indent))
188 tree_enter=
'-- ENTER '//trim(string)
189 WRITE(nulprt,*) ch_blank,trim(tree_enter)
190 tree_indent = tree_indent + tree_delta
191 DEALLOCATE (ch_blank)
206 CHARACTER(len=*),
INTENT(in) :: string
208 character(len=*),
parameter :: subname =
'(oasis_debug_exit)'
209 CHARACTER(len=1),
pointer :: ch_blank(:)
210 CHARACTER(len=500) :: tree_exit
212 IF (oasis_debug >= 10)
THEN
213 tree_indent = max(0,tree_indent - tree_delta)
214 ALLOCATE (ch_blank(tree_indent))
216 tree_exit=
'-- EXIT '//trim(string)
217 WRITE(nulprt,*) ch_blank,trim(tree_exit)
218 DEALLOCATE (ch_blank)
233 CHARACTER(len=*),
INTENT(in) :: string
235 character(len=*),
parameter :: subname =
'(oasis_debug_note)'
236 CHARACTER(len=1),
pointer :: ch_blank(:)
237 CHARACTER(len=500) :: tree_note
239 if (oasis_debug >= 12)
then
240 ALLOCATE (ch_blank(tree_indent))
242 tree_note=
'-- NOTE '//trim(string)
243 WRITE(nulprt,*) ch_blank,trim(tree_note)
subroutine, public oasis_debug_exit(string)
Used when a subroutine is exited, write info to log file at some debug level.
subroutine, public oasis_unitsetmin(uio)
Set the minimum unit number allowed.
Provides a common location for several OASIS variables.
subroutine, public oasis_debug_enter(string)
Used when a subroutine is entered, write info to log file at some debug level.
subroutine, public oasis_debug_note(string)
Used to write information from a subroutine, write info to log file at some debug level...
subroutine, public oasis_flush(nu)
Flushes output to file.
subroutine, public oasis_unitget(uio)
Get a free unit number.
subroutine, public oasis_abort(id_compid, cd_routine, cd_message)
OASIS abort method, publically available to users.
subroutine, public oasis_unitfree(uio)
Release a unit number for reuse.