Skip to content
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
23 changes: 13 additions & 10 deletions src/cpl/nuopc/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module atm_comp_nuopc
integer :: flds_scalar_index_nx = 0
integer :: flds_scalar_index_ny = 0
integer :: flds_scalar_index_nextsw_cday = 0

integer :: nthrds
integer , parameter :: dbug_flag = 0
type(cam_in_t) , pointer :: cam_in(:)
type(cam_out_t) , pointer :: cam_out(:)
Expand Down Expand Up @@ -351,7 +351,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
character(len=cl) :: model_doi_url ! DOI for CESM model run
logical :: aqua_planet ! Flag to run model in "aqua planet" mode
logical :: brnch_retain_casename ! true => branch run has same caseid as run being branched from
logical :: single_column
logical :: single_column = .false.
character(len=cl) :: single_column_lnd_domainfile
real(r8) :: scol_lon
real(r8) :: scol_lat
Expand Down Expand Up @@ -403,8 +403,16 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
call ESMF_VMGet(vm, pet=localPet, peCount=localPeCount, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

!$ call omp_set_num_threads(localPeCount)
print *,__FILE__,__LINE__,localPeCount
if(localPeCount == 1) then
call NUOPC_CompAttributeGet(gcomp, "nthreads", value=cvalue, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return
read(cvalue,*) nthrds
else
nthrds = localPeCount
endif

!$ call omp_set_num_threads(nthrds)
print *,__FILE__,__LINE__,nthrds

!----------------------------------------------------------------------------
! determine instance information
Expand Down Expand Up @@ -1008,12 +1016,7 @@ subroutine ModelAdvance(gcomp, rc)

rc = ESMF_SUCCESS

call ESMF_GridCompGet(gcomp, vm=vm, localPet=localPet, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call ESMF_VMGet(vm, pet=localPet, peCount=localPeCount, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

!$ call omp_set_num_threads(localPeCount)
!$ call omp_set_num_threads(nthrds)

call shr_file_getLogUnit (shrlogunit)
call shr_file_setLogUnit (iulog)
Expand Down
4 changes: 0 additions & 4 deletions src/physics/cam/physics_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ subroutine physics_update(state, ptend, dt, tend)
!-----------------------------------------------------------------------
! Update the state and or tendency structure with the parameterization tendencies
!-----------------------------------------------------------------------
use shr_sys_mod, only: shr_sys_flush
use constituents, only: cnst_get_ind
use scamMod, only: scm_crm_mode, single_column
use phys_control, only: phys_getopts
Expand Down Expand Up @@ -427,9 +426,6 @@ subroutine physics_update(state, ptend, dt, tend)
end do
end if

! Good idea to do this regularly.
call shr_sys_flush(iulog)

if (state_debug_checks) call physics_state_check(state, ptend%name)

deallocate(cpairv_loc, rairv_loc)
Expand Down