From 90a0d7814bdb2cb0c7a60cf597abb315f5475576 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 16 Feb 2024 11:44:39 -0700 Subject: [PATCH 1/2] Remove references to mct in LILAC It looks like the need for MCT was removed in b4d64ac56ff84112631535eb9353853df1c8a951, when Mariana changed the stream code to use CDEPS, but the initialization of MCT wasn't removed at that time... but it looks like MCT is now unneeded, so going ahead and removing it now. --- lilac/src/lilac_mod.F90 | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/lilac/src/lilac_mod.F90 b/lilac/src/lilac_mod.F90 index 12dd4f74a6..af5e2edd22 100644 --- a/lilac/src/lilac_mod.F90 +++ b/lilac/src/lilac_mod.F90 @@ -8,7 +8,6 @@ module lilac_mod ! External libraries use ESMF - use mct_mod , only : mct_world_init ! shr code routines use shr_sys_mod , only : shr_sys_abort @@ -146,10 +145,7 @@ subroutine lilac_init2(mpicom, atm_global_index, atm_lons, atm_lats, & integer, parameter :: debug = 1 !-- internal debug level character(len=*), parameter :: subname=trim(modname)//': [lilac_init] ' - ! initialization of mct and pio - integer :: ncomps = 1 ! for mct - integer, pointer :: mycomms(:) ! for mct - integer, pointer :: myids(:) ! for mct + ! initialization of pio integer :: compids(1) = (/1/) ! for pio_init2 - array with component ids character(len=32) :: compLabels(1) = (/'LND'/) ! for pio_init2 character(len=64) :: comp_name(1) = (/'LND'/) ! for pio_init2 @@ -220,14 +216,6 @@ subroutine lilac_init2(mpicom, atm_global_index, atm_lons, atm_lats, & call ESMF_VMGet(vm, localPet=mytask, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - !------------------------------------------------------------------------- - ! Initialize MCT (this is needed for data model functionality) - !------------------------------------------- - allocate(mycomms(1), myids(1)) - mycomms = (/mpicom/) ; myids = (/1/) - call mct_world_init(ncomps, mpicom, mycomms, myids) - call ESMF_LogWrite(subname//"initialized mct ... ", ESMF_LOGMSG_INFO) - !------------------------------------------------------------------------- ! Initialize PIO with second initialization !------------------------------------------------------------------------- From 80568e20979fd10ddf431662505ed8281943c51e Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 16 Feb 2024 12:38:38 -0700 Subject: [PATCH 2/2] Remove references to mct in unit tests --- src/CMakeLists.txt | 9 ++---- src/unit_test_stubs/csm_share/CMakeLists.txt | 2 -- .../csm_share/mct_mod_stub.F90 | 30 ------------------- .../csm_share/seq_comm_mct.F90 | 10 ------- 4 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 src/unit_test_stubs/csm_share/mct_mod_stub.F90 delete mode 100644 src/unit_test_stubs/csm_share/seq_comm_mct.F90 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 27d85d464f..568b53cd15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,13 +19,10 @@ add_definitions(-DHIDE_MPI) add_subdirectory(${CLM_ROOT}/share/src csm_share) add_subdirectory(${CLM_ROOT}/share/unit_test_stubs/util csm_share_stubs) add_subdirectory(${CLM_ROOT}/share/src/esmf_wrf_timemgr esmf_wrf_timemgr) -add_subdirectory(${CLM_ROOT}/components/cpl7/driver/shr drv_share) -# Extract just the files we need from drv_share -set (drv_sources_needed_base - glc_elevclass_mod.F90 - ) -extract_sources("${drv_sources_needed_base}" "${drv_sources}" drv_sources_needed) +# Add the single file we need from CMEPS +set (drv_sources_needed + ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/glc_elevclass_mod.F90) # Add CLM source directories add_subdirectory(${CLM_ROOT}/src/utils clm_utils) diff --git a/src/unit_test_stubs/csm_share/CMakeLists.txt b/src/unit_test_stubs/csm_share/CMakeLists.txt index f1c6f12ded..33ddbfb342 100644 --- a/src/unit_test_stubs/csm_share/CMakeLists.txt +++ b/src/unit_test_stubs/csm_share/CMakeLists.txt @@ -1,6 +1,4 @@ list(APPEND share_sources - mct_mod_stub.F90 - seq_comm_mct.F90 shr_mpi_mod_stub.F90 ) diff --git a/src/unit_test_stubs/csm_share/mct_mod_stub.F90 b/src/unit_test_stubs/csm_share/mct_mod_stub.F90 deleted file mode 100644 index 832b8847d7..0000000000 --- a/src/unit_test_stubs/csm_share/mct_mod_stub.F90 +++ /dev/null @@ -1,30 +0,0 @@ -module mct_mod - - ! This is a stub of mct_mod, which only includes the bare minimum needed to build CLM - ! unit tests - - implicit none - - public :: mct_gsMap - public :: mct_gsMap_orderedPoints - - type mct_gsMap - ! Empty, dummy type - end type mct_gsMap - -contains - - subroutine mct_gsMap_orderedPoints(GSMap, PEno, Points) - ! Stub routine that simply matches the signature of mct_gsMap_orderedPoints - ! this routine allocates the Points array, to match the documented behavior of the - ! real routine. This is needed so that a later deallocate will succeed. But note that - ! it is just allocated to be of size 1, so it cannot be used for any real - ! calculations. - type(mct_gsMap), intent(in) :: GSMap - integer, intent(in) :: PEno - integer,dimension(:),pointer :: Points - - allocate(Points(1)) - end subroutine mct_gsMap_orderedPoints - -end module mct_mod diff --git a/src/unit_test_stubs/csm_share/seq_comm_mct.F90 b/src/unit_test_stubs/csm_share/seq_comm_mct.F90 deleted file mode 100644 index f8201284ba..0000000000 --- a/src/unit_test_stubs/csm_share/seq_comm_mct.F90 +++ /dev/null @@ -1,10 +0,0 @@ -module seq_comm_mct - ! Stub of seq_comm_mct, containing just what's needed for CLM modules. - ! - ! Note that the true seq_comm_mct is in cime/scr/drivers/mct/shr - - implicit none - save - - integer, public :: logunit = 6 -end module seq_comm_mct