Skip to content

Commit

Permalink
fixes for dbug_flag
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Aug 6, 2020
1 parent 7fc1c30 commit 1802396
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
17 changes: 13 additions & 4 deletions cicecore/drivers/nuopc/cmeps/ice_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module ice_comp_nuopc
character(len=*),parameter :: shr_cal_noleap = 'NO_LEAP'
character(len=*),parameter :: shr_cal_gregorian = 'GREGORIAN'

integer , parameter :: dbug = 10
integer :: dbug = 0
integer , parameter :: debug_import = 0 ! internal debug level
integer , parameter :: debug_export = 0 ! internal debug level
character(*), parameter :: modName = "(ice_comp_nuopc)"
Expand Down Expand Up @@ -236,6 +236,14 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif

call NUOPC_CompAttributeGet(gcomp, name='dbug_flag', value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) then
read(cvalue,*) dbug
end if
write(logmsg,'(i6)') dbug
call ESMF_LogWrite('CICE_cap: dbug = '//trim(logmsg), ESMF_LOGMSG_INFO)

call ice_advertise_fields(gcomp, importState, exportState, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

Expand Down Expand Up @@ -877,7 +885,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
! diagnostics
!--------------------------------

if (dbug > 1) then
if (dbug > 0) then
call state_diagnose(exportState,subname//':ES',rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
endif
Expand Down Expand Up @@ -957,6 +965,7 @@ subroutine ModelAdvance(gcomp, rc)
preString="--------------------------------> to: ", unit=msgString, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)

!--------------------------------
! Turn on timers
!--------------------------------
Expand Down Expand Up @@ -1074,7 +1083,7 @@ subroutine ModelAdvance(gcomp, rc)
idate, sec, nu_diag, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
if (dbug > 1) then
if (dbug > 0) then
call state_diagnose(importState,subname//':IS',rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
Expand All @@ -1101,7 +1110,7 @@ subroutine ModelAdvance(gcomp, rc)
idate, sec, nu_diag, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
if (dbug > 1) then
if (dbug > 0) then
call state_diagnose(exportState,subname//':ES',rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
Expand Down
14 changes: 8 additions & 6 deletions cicecore/drivers/nuopc/cmeps/ice_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ module ice_import_export
type (fld_list_type) :: fldsFrIce(fldsMax)
type(ESMF_GeomType_Flag) :: geomtype

integer , parameter :: dbug = 10 ! i/o debug messages
integer , parameter :: io_dbug = 10 ! i/o debug messages
character(*), parameter :: u_FILE_u = &
__FILE__

Expand Down Expand Up @@ -116,7 +116,7 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
!-------------------------------------------------------------------------------

rc = ESMF_SUCCESS
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)
if (io_dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

! Determine if the following attributes are sent by the driver and if so read them in
flds_wiso = .false.
Expand Down Expand Up @@ -266,7 +266,7 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
if (ChkErr(rc,__LINE__,u_FILE_u)) return
enddo

if (dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO)
if (io_dbug > 5) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO)

end subroutine ice_advertise_fields

Expand Down Expand Up @@ -373,9 +373,11 @@ subroutine ice_import( importState, rc )
call icepack_query_parameters(Tffresh_out=Tffresh)
call icepack_query_parameters(tfrz_option_out=tfrz_option)
call icepack_query_parameters(ktherm_out=ktherm)
write(msgString,'(A,i8)')trim(subname)//' tfrz_option = ' &
if (io_dbug > 5) then
write(msgString,'(A,i8)')trim(subname)//' tfrz_option = ' &
// trim(tfrz_option)//', ktherm = ',ktherm
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
end if
! call icepack_query_parameters(tfrz_option_out=tfrz_option, &
! modal_aero_out=modal_aero, z_tracers_out=z_tracers, skl_bgc_out=skl_bgc, &
! Tffresh_out=Tffresh)
Expand Down Expand Up @@ -782,7 +784,7 @@ subroutine ice_export( exportState, rc )
!-----------------------------------------------------

rc = ESMF_SUCCESS
if (dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)
if (io_dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)

call icepack_query_parameters(Tffresh_out=Tffresh)
! call icepack_query_parameters(tfrz_option_out=tfrz_option, &
Expand Down

0 comments on commit 1802396

Please sign in to comment.