Skip to content

Commit

Permalink
optionally read dststatus_print from MED_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Mar 24, 2021
1 parent 02ceba3 commit 9a0cad5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mediator/esmFlds.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ module esmflds
integer, public :: num_icesheets = 1
logical, public :: ocn2glc_coupling ! obtained from attribute

logical, public :: dststatus_print = .false.

!-----------------------------------------------
! Set mappers
!-----------------------------------------------
Expand Down
10 changes: 9 additions & 1 deletion mediator/med.F90
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_METHOD_INITIALIZE
use NUOPC , only : NUOPC_CompFilterPhaseMap, NUOPC_CompAttributeGet
use med_internalstate_mod, only : mastertask, logunit

use esmFlds, only : dststatus_print

type(ESMF_GridComp) :: gcomp
type(ESMF_State) :: importState, exportState
type(ESMF_Clock) :: clock
Expand Down Expand Up @@ -626,6 +627,13 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
write(msgString,'(A,i6)') trim(subname)//': Mediator dbug_flag is ',dbug_flag
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)

! Obtain dststatus_print setting if present; otherwise use default value in med_constants
call NUOPC_CompAttributeGet(gcomp, name='dststatus_print', value=cvalue, isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (isPresent .and. isSet) dststatus_print=(trim(cvalue)=="true")
write(msgString,*) trim(subname)//': Mediator dststatus_print is ',dststatus_print
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)

! Switch to IPDv03 by filtering all other phaseMap entries
call NUOPC_CompFilterPhaseMap(gcomp, ESMF_METHOD_INITIALIZE, acceptStringList=(/"IPDv03p"/), rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
Expand Down
3 changes: 1 addition & 2 deletions mediator/med_map_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ subroutine med_map_routehandles_initfrom_field(n1, n2, fldsrc, flddst, mapindex,
use esmFlds , only : mapfillv_bilnr, mapbilnr_nstod
use esmFlds , only : ncomps, compatm, compice, compocn, compname
use esmFlds , only : mapfcopy, mapconsd, mapconsf, mapnstod
use esmFlds , only : coupling_mode
use esmFlds , only : coupling_mode, dststatus_print
use esmFlds , only : atm_name
use med_constants_mod , only : ispval_mask => med_constants_ispval_mask

Expand All @@ -247,7 +247,6 @@ subroutine med_map_routehandles_initfrom_field(n1, n2, fldsrc, flddst, mapindex,
integer :: dstMaskValue
character(len=ESMF_MAXSTR) :: lmapfile
logical :: rhprint = .false.
logical :: dststatus_print = .false.
integer :: ns
integer(I4), pointer :: dof(:) => null()
integer :: srcTermProcessing_Value = 0
Expand Down

0 comments on commit 9a0cad5

Please sign in to comment.