Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout: changed some logging from stderr to stdout #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/cppdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
! Handy for writing
#define STDOUT write(stdout,*)
#define STDERR write(stderr,*)
#define LEVEL0 STDERR
#define LEVEL1 STDERR ' ',
#define LEVEL2 STDERR ' ',
#define LEVEL3 STDERR ' ',
#define LEVEL4 STDERR ' ',
#define LEVEL0 STDOUT
#define LEVEL1 STDOUT ' ',
#define LEVEL2 STDOUT ' ',
#define LEVEL3 STDOUT ' ',
#define LEVEL4 STDOUT ' ',
#define FATAL STDERR 'FATAL ERROR: ',

#define LINE "------------------------------------------------------------------------"
Expand Down
8 changes: 4 additions & 4 deletions src/gotm/gotm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ subroutine init_gotm()
#endif

config_only = write_yaml_path /= '' .or. write_schema_path /= ''
STDERR LINE
STDOUT LINE

settings_store%path = ''
if (.not. read_nml) then
Expand Down Expand Up @@ -566,7 +566,7 @@ subroutine init_gotm()
if (list_fields) call fm%list()

LEVEL2 'done.'
STDERR LINE
STDOUT LINE

#ifdef _PRINTSTATE_
call print_state
Expand Down Expand Up @@ -639,7 +639,7 @@ subroutine time_loop()
LEVEL1 'saving initial conditions'
call output_manager_save(julianday,int(fsecondsofday),int(mod(fsecondsofday,_ONE_)*1000000),0)
end if
STDERR LINE
STDOUT LINE
LEVEL1 'time_loop'
progress = (MaxN-MinN+1)/10
i=0
Expand Down Expand Up @@ -807,7 +807,7 @@ subroutine time_loop()
call output_manager_save(julianday,int(fsecondsofday),int(mod(fsecondsofday,_ONE_)*1000000),int(n))

end do
STDERR LINE
STDOUT LINE

return
end subroutine time_loop
Expand Down
30 changes: 15 additions & 15 deletions src/gotm/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ program main

call Date_And_Time(DATE=systemdate,TIME=systemtime)

STDERR LINE
STDERR 'GOTM started on ', systemdate(1:4), '/', &
STDOUT LINE
STDOUT 'GOTM started on ', systemdate(1:4), '/', &
systemdate(5:6), '/', &
systemdate(7:8), &
' at ', systemtime(1:2), ':', &
systemtime(3:4), ':', &
systemtime(5:6)
STDERR LINE
STDOUT LINE
#else
STDERR LINE
STDERR 'GOTM'
STDERR LINE
STDOUT LINE
STDOUT 'GOTM'
STDOUT LINE
#endif

! run the model
Expand All @@ -69,26 +69,26 @@ program main
#ifdef FORTRAN95
call Date_And_Time(DATE=systemdate,TIME=systemtime)

STDERR LINE
STDERR 'GOTM finished on ', systemdate(1:4), '/', &
STDOUT LINE
STDOUT 'GOTM finished on ', systemdate(1:4), '/', &
systemdate(5:6), '/', &
systemdate(7:8), &
' at ', systemtime(1:2), ':', &
systemtime(3:4), ':', &
systemtime(5:6)
STDERR LINE
STDOUT LINE
#else
STDERR LINE
STDERR 'GOTM'
STDERR LINE
STDOUT LINE
STDOUT 'GOTM'
STDOUT LINE
#endif

! report CPU time used for run
#ifdef FORTRAN95
call CPU_Time(t2)

STDERR 'CPU time: ',t2-t1,' seconds'
STDERR 'Simulated time/CPU time: ',simtime/(t2-t1)
STDOUT 'CPU time: ',t2-t1,' seconds'
STDOUT 'Simulated time/CPU time: ',simtime/(t2-t1)
#endif

call print_version()
Expand Down Expand Up @@ -187,7 +187,7 @@ subroutine compilation_options()
#ifdef SEDIMENT
LEVEL1 'SEDIMENT'
#endif
STDERR LINE
STDOUT LINE
end subroutine compilation_options

subroutine print_help()
Expand Down
4 changes: 2 additions & 2 deletions src/util/time.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ subroutine init_time(MinN,MaxN)

ndays = nsecs/86400
nsecs = nsecs - 86400*ndays
STDERR ' ==> ',ndays,' day(s) and ',nsecs,' seconds ==> ',MaxN,' micro time steps'
STDOUT ' ==> ',ndays,' day(s) and ',nsecs,' seconds ==> ',MaxN,' micro time steps'
case (3)
HasRealTime=.true.
LEVEL2 'Start: ',start
Expand All @@ -135,7 +135,7 @@ subroutine init_time(MinN,MaxN)
call write_time_string(jul2,secs2,stop)
LEVEL2 'Stop: ',stop
case default
STDERR 'Fatal error: A non valid input format has been chosen'
STDOUT 'Fatal error: A non valid input format has been chosen'
stop 'init_time'
end select

Expand Down