Skip to content

Commit

Permalink
add namelist control variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards4b committed Jul 27, 2017
1 parent 3cc5957 commit 213d107
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 11 deletions.
15 changes: 14 additions & 1 deletion src/drivers/mct/cime_config/namelist_definition_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@
</values>
</entry>

<entry id="nan_check_component_fields">
<type>logical</type>
<category>seq_flds</category>
<group>seq_cplflds_inparm</group>
<desc>
.true. means that all fields passed to coupler are checked for NaN values
</desc>
<values>
<value>.false.</value>
<value cime_model='cesm'>.true.</value>
</values>
</entry>

<!-- =========================== -->
<!-- -group seq_cplflds_custom -->
<!-- =========================== -->
Expand Down Expand Up @@ -2677,7 +2690,7 @@
<group>ccsm_pes</group>
<desc>
Determines what ESMF log files (if any) are generated when
USE_ESMF_LIB is TRUE.
USE_ESMF_LIB is TRUE.
ESMF_LOGKIND_SINGLE: Use a single log file, combining messages from
all of the PETs. Not supported on some platforms.
ESMF_LOGKIND_MULTI: Use multiple log files — one per PET.
Expand Down
18 changes: 11 additions & 7 deletions src/drivers/mct/main/component_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module component_mod
use mct_mod ! mct_ wrappers for mct lib
use perf_mod
use ESMF

use seq_flds_mod, only: nan_check_component_fields
implicit none

#include <mpif.h>
Expand Down Expand Up @@ -226,9 +226,11 @@ end subroutine comp_init
call t_set_prefixf(comp(1)%oneletterid//"_i:")
call comp_init( EClock, comp(eci)%cdata_cc, comp(eci)%x2c_cc, comp(eci)%c2x_cc, &
NLFilename=NLFilename )
call t_drvstartf ('check_fields')
call check_fields(comp(eci), eci)
call t_drvstopf ('check_fields')
if(nan_check_component_fields) then
call t_drvstartf ('check_fields')
call check_fields(comp(eci), eci)
call t_drvstopf ('check_fields')
end If
call t_unset_prefixf()

if (present(seq_flds_c2x_fluxes)) then
Expand Down Expand Up @@ -682,9 +684,11 @@ end subroutine comp_run

call t_set_prefixf(comp(1)%oneletterid//":")
call comp_run(EClock, comp(eci)%cdata_cc, comp(eci)%x2c_cc, comp(eci)%c2x_cc)
call t_drvstartf ('check_fields')
call check_fields(comp(eci), eci)
call t_drvstopf ('check_fields')
if(nan_check_component_fields) then
call t_drvstartf ('check_fields')
call check_fields(comp(eci), eci)
call t_drvstopf ('check_fields')
endif
call t_unset_prefixf()

if ((phase == 1) .and. present(seq_flds_c2x_fluxes)) then
Expand Down
5 changes: 4 additions & 1 deletion src/drivers/mct/shr/seq_flds_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata)
character(len=CSS) :: fldname, fldflow
logical :: is_state, is_flux
integer :: i,n
logical :: nan_check_component_fields

! use cases namelists
logical :: flds_co2a
Expand All @@ -347,7 +348,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata)

namelist /seq_cplflds_inparm/ &
flds_co2a, flds_co2b, flds_co2c, flds_co2_dmsa, flds_wiso, glc_nec, &
ice_ncat, seq_flds_i2o_per_cat, flds_bgc
ice_ncat, seq_flds_i2o_per_cat, flds_bgc, nan_check_component_fields

! user specified new fields
integer, parameter :: nfldmax = 200
Expand Down Expand Up @@ -381,6 +382,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata)
glc_nec = 0
ice_ncat = 1
seq_flds_i2o_per_cat = .false.
nan_check_component_fields = .false.

unitn = shr_file_getUnit()
write(logunit,"(A)") subname//': read seq_cplflds_inparm namelist from: '&
Expand All @@ -406,6 +408,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata)
call shr_mpi_bcast(glc_nec , mpicom)
call shr_mpi_bcast(ice_ncat , mpicom)
call shr_mpi_bcast(seq_flds_i2o_per_cat, mpicom)
call shr_mpi_bcast(nan_check_component_fields, mpicom)

call glc_elevclass_init(glc_nec)

Expand Down
4 changes: 2 additions & 2 deletions src/drivers/mct/shr/seq_infodata_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ MODULE seq_infodata_mod
!===============================================================================
!BOP ===========================================================================
!
! !IROUTINE: seq_infodata_Init -- read in CCSM shared namelist
! !IROUTINE: seq_infodata_Init -- read in CIME shared namelist
!
! !DESCRIPTION:
!
! Read in input from seq_infodata_inparm namelist, output ccsm derived type for
! Read in input from seq_infodata_inparm namelist, output cime derived type for
! miscillaneous info.
!
! !INTERFACE: ------------------------------------------------------------------
Expand Down

0 comments on commit 213d107

Please sign in to comment.