Skip to content
Closed
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
17 changes: 0 additions & 17 deletions src/MAIN_NEMS.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ PROGRAM MAIN_NEMS
USE module_NEMS_Rusage,ONLY: NEMS_Rusage
!
!-----------------------------------------------------------------------
!*** This module contains PIO initialization related routines.
!-----------------------------------------------------------------------
!
#if defined PIO
USE shr_pio_mod, ONLY: shr_pio_init1
#endif
!
!-----------------------------------------------------------------------
!
IMPLICIT NONE
!
Expand Down Expand Up @@ -200,15 +192,6 @@ PROGRAM MAIN_NEMS
! the start succeeded.
!
!-----------------------------------------------------------------------
!*** Initialize PIO. 8 is the maximum number of component models
!-----------------------------------------------------------------------
!
COMM_WORLD = MPI_COMM_WORLD
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove line 121 if no longer needed. INTEGER :: COMM_WORLD

#if defined PIO
call shr_pio_init1(8, "pio_in", COMM_WORLD)
#endif
!
!-----------------------------------------------------------------------
!*** Set up the default log.
!-----------------------------------------------------------------------
!
Expand Down
52 changes: 0 additions & 52 deletions src/module_EARTH_GRID_COMP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3380,10 +3380,6 @@ END SUBROUTINE EARTH_REGISTER
subroutine SetModelServices(driver, rc)
#ifdef CMEPS
use med_internalstate_mod , only : med_id
#endif
#ifdef PIO
use mpi, only : MPI_COMM_NULL
use shr_pio_mod , only : shr_pio_init2
#endif
type(ESMF_GridComp) :: driver
integer, intent(out) :: rc
Expand All @@ -3408,11 +3404,7 @@ subroutine SetModelServices(driver, rc)
character(len=5) :: inst_suffix
#endif
logical :: isPresent
integer, allocatable :: comms(:), comps(:)
integer, allocatable :: comp_comm_iam(:)
logical, allocatable :: comp_iamin(:)
type(ESMF_VM) :: vm
integer :: Global_Comm
rc = ESMF_SUCCESS

! query the Component for info
Expand All @@ -3435,11 +3427,6 @@ subroutine SetModelServices(driver, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out

! get MPI communicator
call ESMF_VMGet(vm, mpiCommunicator=Global_Comm, rc=rc)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VM is no longer needed. See lines

  • 3407
  • 3426
  • 4576

if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out

! read and ingest free format driver attributes
attrFF = NUOPC_FreeFormatCreate(config, label="EARTH_attributes::", &
relaxedflag=.true., rc=rc)
Expand Down Expand Up @@ -3505,19 +3492,8 @@ subroutine SetModelServices(driver, rc)
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out
#endif

! allocate arrays required for PIO initialization (phase 2)
if (.not. allocated(comms)) allocate(comms(componentCount+1))
if (.not. allocated(comps)) allocate(comps(componentCount+1))
if (.not. allocated(comp_iamin)) allocate(comp_iamin(componentCount))
if (.not. allocated(comp_comm_iam)) allocate(comp_comm_iam(componentCount))

comps(1) = 1
comms(1) = Global_Comm

! determine information for each component and add to the driver
do i=1, componentCount
comps(i+1) = i+1

! construct component prefix
prefix=trim(compLabels(i))
! read in petList bounds
Expand Down Expand Up @@ -4044,24 +4020,6 @@ subroutine SetModelServices(driver, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out
#endif
if (ESMF_GridCompIsPetLocal(comp, rc=rc)) then
call ESMF_GridCompGet(comp, vm=vm, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out

call ESMF_VMGet(vm, mpiCommunicator=comms(i+1), localPet=comp_comm_iam(i), rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out

comp_iamin(i) = .true.
else
#ifdef PIO
comms(i+1) = MPI_COMM_NULL
#else
comms(i+1) = 0
#endif
comp_iamin(i) = .false.
end if
enddo

#if ESMF_VERSION_MAJOR < 8
Expand All @@ -4071,18 +4029,8 @@ subroutine SetModelServices(driver, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, file=trim(name)//":"//__FILE__)) return ! bail out
#endif

#if defined PIO
! Initialize PIO
call shr_pio_init2(comps(2:), compLabels, comp_iamin, comms(2:), comp_comm_iam)
#endif

! clean-up
deallocate(compLabels)
if (allocated(comms)) deallocate(comms)
if (allocated(comps)) deallocate(comps)
if (allocated(comp_iamin)) deallocate(comp_iamin)
if (allocated(comp_comm_iam)) deallocate(comp_comm_iam)

end subroutine

Expand Down