Skip to content

Commit

Permalink
Rename init_pio to driver_pio
Browse files Browse the repository at this point in the history
As per Jim Edwards
suggestion (ESCOMP/CESM_CPL7andDataComps#16 (review))
  • Loading branch information
billsacks committed Jul 5, 2022
1 parent 03ce9b7 commit 1f8ce13
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
6 changes: 3 additions & 3 deletions cesm/driver/esm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
use mpi , only : MPI_COMM_NULL, mpi_comm_size
#endif
use mct_mod , only : mct_world_init
use init_pio_mod , only : init_pio_init, init_pio_component_init
use driver_pio_mod , only : driver_pio_init, driver_pio_component_init

#ifdef MED_PRESENT
use med_internalstate_mod , only : med_id
Expand Down Expand Up @@ -934,7 +934,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)

! Initialize PIO
! This reads in the pio parameters that are independent of component
call init_pio_init(driver, rc=rc)
call driver_pio_init(driver, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

allocate(comms(componentCount+1), comps(componentCount+1))
Expand Down Expand Up @@ -1182,7 +1182,7 @@ subroutine esm_init_pelayout(driver, maxthreads, rc)
enddo
! Read in component dependent PIO parameters and initialize
! IO systems
call init_pio_component_init(driver, size(comps), rc)
call driver_pio_component_init(driver, size(comps), rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return

! Initialize MCT (this is needed for data models and cice prescribed capability)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module init_pio_mod
module driver_pio_mod
use pio
use shr_pio_mod, only : io_compname, pio_comp_settings, iosystems, io_compid, shr_pio_getindex
use shr_kind_mod, only : CS=>shr_kind_CS, shr_kind_cl, shr_kind_in
Expand All @@ -15,10 +15,10 @@ module init_pio_mod
#include <mpif.h>
#endif
private
public :: init_pio_init
public :: init_pio_component_init
public :: init_pio_finalize
public :: init_pio_log_comp_settings
public :: driver_pio_init
public :: driver_pio_component_init
public :: driver_pio_finalize
public :: driver_pio_log_comp_settings

integer :: io_comm
integer :: pio_debug_level=0, pio_blocksize=0
Expand Down Expand Up @@ -50,7 +50,7 @@ module init_pio_mod
!!
!<

subroutine init_pio_init(driver, rc)
subroutine driver_pio_init(driver, rc)
use ESMF, only : ESMF_GridComp, ESMF_VM, ESMF_Config, ESMF_GridCompGet
use ESMF, only : ESMF_VMGet, ESMF_RC_NOT_VALID, ESMF_LogSetError
use NUOPC, only: NUOPC_CompAttributeGet
Expand All @@ -66,7 +66,7 @@ subroutine init_pio_init(driver, rc)
character(len=CS) :: pio_rearr_comm_type, pio_rearr_comm_fcd
character(CS) :: msgstr

character(*), parameter :: subName = '(init_pio_init) '
character(*), parameter :: subName = '(driver_pio_init) '

call ESMF_GridCompGet(driver, vm=vm, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
Expand Down Expand Up @@ -167,9 +167,9 @@ subroutine init_pio_init(driver, rc)
write(shr_log_unit, *) " enable_isend (io2comp) = ", pio_rearr_opts%comm_fc_opts_io2comp%enable_isend
end if

end subroutine init_pio_init
end subroutine driver_pio_init

subroutine init_pio_component_init(driver, ncomps, rc)
subroutine driver_pio_component_init(driver, ncomps, rc)
use ESMF, only : ESMF_GridComp, ESMF_LogSetError, ESMF_RC_NOT_VALID, ESMF_GridCompIsCreated, ESMF_VM, ESMF_VMGet
use ESMF, only : ESMF_GridCompGet, ESMF_GridCompIsPetLocal, ESMF_VMIsCreated
use NUOPC, only : NUOPC_CompAttributeGet, NUOPC_CompAttributeSet, NUOPC_CompAttributeAdd
Expand Down Expand Up @@ -278,7 +278,7 @@ subroutine init_pio_component_init(driver, ncomps, rc)

call NUOPC_CompAttributeGet(gcomp(i), name="pio_netcdf_format", value=cval, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
call init_pio_getioformatfromname(cval, pio_comp_settings(i)%pio_netcdf_ioformat, PIO_64BIT_DATA)
call driver_pio_getioformatfromname(cval, pio_comp_settings(i)%pio_netcdf_ioformat, PIO_64BIT_DATA)

if (pio_async_interface(i)) then
do_async_init = do_async_init + 1
Expand Down Expand Up @@ -308,9 +308,9 @@ subroutine init_pio_component_init(driver, ncomps, rc)
endif

deallocate(gcomp)
end subroutine init_pio_component_init
end subroutine driver_pio_component_init

subroutine init_pio_log_comp_settings(gcomp, logunit)
subroutine driver_pio_log_comp_settings(gcomp, logunit)
use ESMF, only : ESMF_GridComp, ESMF_GridCompGet
use NUOPC, only: NUOPC_CompAttributeGet

Expand Down Expand Up @@ -341,21 +341,21 @@ subroutine init_pio_log_comp_settings(gcomp, logunit)

write(logunit, *) trim(name),': PIO root=',pio_comp_settings(i)%pio_root

end subroutine init_pio_log_comp_settings
end subroutine driver_pio_log_comp_settings

!===============================================================================
subroutine init_pio_finalize( )
subroutine driver_pio_finalize( )
integer :: ierr
integer :: i
do i=1,total_comps
call pio_finalize(iosystems(i), ierr)
end do

end subroutine init_pio_finalize
end subroutine driver_pio_finalize

!===============================================================================

subroutine init_pio_getioformatfromname(pio_netcdf_format, pio_netcdf_ioformat, pio_default_netcdf_ioformat)
subroutine driver_pio_getioformatfromname(pio_netcdf_format, pio_netcdf_ioformat, pio_default_netcdf_ioformat)
use shr_string_mod, only : shr_string_toupper
character(len=*), intent(inout) :: pio_netcdf_format
integer, intent(out) :: pio_netcdf_ioformat
Expand All @@ -372,10 +372,10 @@ subroutine init_pio_getioformatfromname(pio_netcdf_format, pio_netcdf_ioformat,
pio_netcdf_ioformat = pio_default_netcdf_ioformat
endif

end subroutine init_pio_getioformatfromname
end subroutine driver_pio_getioformatfromname


subroutine init_pio_getiotypefromname(typename, iotype, defaulttype)
subroutine driver_pio_getiotypefromname(typename, iotype, defaulttype)
use shr_string_mod, only : shr_string_toupper
character(len=*), intent(inout) :: typename
integer, intent(out) :: iotype
Expand All @@ -395,12 +395,12 @@ subroutine init_pio_getiotypefromname(typename, iotype, defaulttype)
else if ( typename .eq. 'DEFAULT') then
iotype = defaulttype
else
write(shr_log_unit,*) 'init_pio_mod: WARNING Bad io_type argument - using iotype_netcdf'
write(shr_log_unit,*) 'driver_pio_mod: WARNING Bad io_type argument - using iotype_netcdf'
iotype=pio_iotype_netcdf
end if

end subroutine init_pio_getiotypefromname
end subroutine driver_pio_getiotypefromname

!===============================================================================

end module init_pio_mod
end module driver_pio_mod
4 changes: 2 additions & 2 deletions cesm/nuopc_cap_share/nuopc_shr_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ end subroutine get_component_instance
!===============================================================================

subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)
use init_pio_mod, only : init_pio_log_comp_settings
use driver_pio_mod, only : driver_pio_log_comp_settings
! input/output variables
type(ESMF_GridComp) :: gcomp
logical, intent(in) :: mastertask
Expand Down Expand Up @@ -165,7 +165,7 @@ subroutine set_component_logging(gcomp, mastertask, logunit, shrlogunit, rc)

open(newunit=logunit,file=trim(diro)//"/"//trim(logfile))
! Write the PIO settings to the beggining of each component log
call init_pio_log_comp_settings(gcomp, logunit)
call driver_pio_log_comp_settings(gcomp, logunit)

else
logUnit = 6
Expand Down

0 comments on commit 1f8ce13

Please sign in to comment.