forked from NOAA-EMC/NEMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Remove driver level PIO initialization #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. VM is no longer needed. See lines
|
||
| 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) | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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