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

Add more default logging to desp #1790

Merged
merged 2 commits into from
Aug 3, 2017
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,6 @@
</values>
</entry>

<entry id="info_debug">
<type>integer</type>
<category>desp</category>
<group>desp_nml</group>
<desc>
Level of debug output, 0=minimum, 1=normal, 2=more, 3=too much (default: 0)
</desc>
<values>
<value>0</value>
</values>
</entry>

<entry id="restfilm">
<type>char</type>
<category>desp</category>
Expand Down
17 changes: 7 additions & 10 deletions src/components/data_comps/desp/desp_comp_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ subroutine desp_comp_init(EClock, espid, mpicom_in, phase, read_restart, &
character(len=CL) :: rest_file ! restart filename
character(len=CL) :: restfilm ! model restart file namelist
logical :: exists ! filename existance
integer(IN) :: info_debug ! logging level
integer(IN) :: nu ! unit number
integer(IN) :: CurrentYMD ! model date
integer(IN) :: CurrentTOD ! model sec into model date
Expand All @@ -136,7 +135,7 @@ subroutine desp_comp_init(EClock, espid, mpicom_in, phase, read_restart, &

!----- define namelist -----
namelist / desp_nml / &
desp_mode, info_debug, restfilm
desp_mode, restfilm

!--- formats ---
character(*), parameter :: subName = "(desp_comp_init) "
Expand Down Expand Up @@ -191,7 +190,6 @@ subroutine desp_comp_init(EClock, espid, mpicom_in, phase, read_restart, &

filename = "desp_in"//trim(inst_suffix)
desp_mode = trim(nullstr)
info_debug = -1
restfilm = trim(nullstr)
if (my_task == master_task) then
nunit = shr_file_getUnit() ! get unused unit number
Expand All @@ -204,19 +202,17 @@ subroutine desp_comp_init(EClock, espid, mpicom_in, phase, read_restart, &
write(logunit,F01) 'ERROR: reading input namelist, '//trim(filename)//' iostat=',ierr
call shr_sys_abort(subName//': namelist read error '//trim(filename))
end if
write(logunit,F01) 'info_debug = ',info_debug
write(logunit,F00) 'restfilm = ',trim(restfilm)
write(logunit,F01) 'inst_index = ',inst_index
write(logunit,F00) 'inst_name = ',trim(inst_name)
write(logunit,F00) 'inst_suffix = ',trim(inst_suffix)
call shr_sys_flush(logunit)
end if
call shr_mpi_bcast(desp_mode, mpicom, 'desp_mode')
call shr_mpi_bcast(info_debug, mpicom, 'info_debug')
call shr_mpi_bcast(restfilm, mpicom, 'restfilm')

rest_file = trim(restfilm)
loglevel = info_debug
loglevel = 1 ! could be shrloglev
call shr_file_setLogLevel(loglevel)

!------------------------------------------------------------------------
Expand All @@ -235,7 +231,7 @@ subroutine desp_comp_init(EClock, espid, mpicom_in, phase, read_restart, &
(trim(desp_mode) == test_mode)) then

if (my_task == master_task) then
write(logunit,F00) ' desp mode = ',trim(desp_mode)
write(logunit,F00) 'desp mode = ',trim(desp_mode)
call shr_sys_flush(logunit)
end if
if (trim(desp_mode) /= null_mode) then
Expand Down Expand Up @@ -428,9 +424,10 @@ subroutine desp_comp_run(EClock, case_name, pause_sig, atm_resume, &
call t_startf('desp_mode')

if (.not. ANY(pause_sig)) then
if ((my_task == master_task) .and. (loglevel > 0)) then
if ( (my_task == master_task) .and. &
((loglevel > 1) .or. (trim(desp_mode) == test_mode))) then
write(logunit, '(2a,i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') subname, &
'WARNING: No pause signals found at',yy,mm,dd,CurrentTOD
'WARNING: No pause signals found at ',yy,mm,dd,CurrentTOD
end if
end if

Expand Down Expand Up @@ -673,7 +670,7 @@ subroutine get_restart_filenames_a(comp_ind, filenames, retcode)
else
unitn = shr_file_getUnit()
if (loglevel > 0) then
write(logunit,"(3A)") subname,"read rpointer file ", rpointer_name
write(logunit,"(3A)") subname,"read rpointer file ", trim(rpointer_name)
end if
open(unitn, file=rpointer_name, form='FORMATTED', status='old', &
action='READ', iostat=ierr)
Expand Down