From 3b3f94dc5a9924fb96cac8ce493721822fbec4bb Mon Sep 17 00:00:00 2001 From: kvrigor Date: Fri, 25 Aug 2023 14:55:55 +0200 Subject: [PATCH] Fixed "Map Grid Size mismatch error" and "array PARTITION error" Error message for "Map Grid Size mismatch error" ``` MCT::oas_m_ExchangeMaps::ExGSMapGSMap_:: MCTERROR, Grid Size mismatch LocalMap Gsize = 199920 RemoteMap Gsize = 108550 MCT::oas_m_ExchangeMaps::ExGSMapGSMap_: Map Grid Size mismatch error, stat =3 000.MCT(MPEU)::die.: from MCT::oas_m_ExchangeMaps::ExGSMapGSMap_() application called MPI_Abort(MPI_COMM_WORLD, 2) - process 0 p_Abort(r0): aborting on users request MCT::oas_m_ExchangeMaps::ExGSMapGSMap_:: MCTERROR, Grid Size mismatch LocalMap Gsize = 108550 RemoteMap Gsize = 199920 MCT::oas_m_ExchangeMaps::ExGSMapGSMap_: Map Grid Size mismatch error, stat =3 0F0.MCT(MPEU)::die.: from MCT::oas_m_ExchangeMaps::ExGSMapGSMap_() application called MPI_Abort(MPI_COMM_WORLD, 2) - process 240 p_Abort(r240): aborting on users request forrtl: error (78): process killed (SIGTERM) Image PC Routine Line Source icon 0000000001BBFC6B Unknown Unknown Unknown libpthread-2.28.s 000014ED77C4FCF0 Unknown Unknown Unknown libpthread-2.28.s 000014ED77C4EAB2 __read Unknown Unknown libmpi.so.12.1.12 000014ED5E9831DF Unknown Unknown Unknown libmpi.so.12.1.12 000014ED5E986FA2 Unknown Unknown Unknown libmpi.so.12.1.12 000014ED5E9595A5 Unknown Unknown Unknown libmpi.so.12.1.12 000014ED5E816647 PMPI_Abort Unknown Unknown libmpifort.so.12. 000014ED78BEBA2D mpi_abort Unknown Unknown icon 0000000001B249C4 Unknown Unknown Unknown icon 0000000001B23BA4 Unknown Unknown Unknown icon 0000000001AFF0B2 Unknown Unknown Unknown icon 0000000001AE1D7A Unknown Unknown Unknown icon 0000000001935755 Unknown Unknown Unknown icon 0000000001992025 Unknown Unknown Unknown icon 000000000042B411 mo_atmo_model_mp_ 304 mo_atmo_model.f90 icon 00000000004173DB MAIN__ 229 icon.f90 icon 0000000000416FE2 Unknown Unknown Unknown libc-2.28.so 000014ED6E792D85 __libc_start_main Unknown Unknown icon 0000000000416EEE Unknown Unknown Unknown ``` Error message for "array PARTITION error" ``` forrtl: severe (408): fort: (2): Subscript #1 of the array PARTITION has value 201 which is greater than the upper bound of 200 Image PC Routine Line Source eclm.exe 0000000003F54CAF Unknown Unknown Unknown eclm.exe 000000000104F11F oas_definemod_mp_ 58 oas_defineMod.F90 eclm.exe 00000000007FA4BD lnd_comp_mct_mp_l 242 lnd_comp_mct.F90 eclm.exe 0000000000469837 component_mod_mp_ 267 component_mod.F90 eclm.exe 000000000042CCB9 cime_comp_mod_mp_ 1252 cime_comp_mod.F90 eclm.exe 000000000045F80C MAIN__ 114 cime_driver.F90 eclm.exe 000000000041AB62 Unknown Unknown Unknown libc-2.28.so 00001521FB380D85 __libc_start_main Unknown Unknown eclm.exe 000000000041AA6E Unknown Unknown Unknown ``` --- src/clm5/oasis3/oas_defineMod.F90 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/clm5/oasis3/oas_defineMod.F90 b/src/clm5/oasis3/oas_defineMod.F90 index 07605e6..c58b61f 100644 --- a/src/clm5/oasis3/oas_defineMod.F90 +++ b/src/clm5/oasis3/oas_defineMod.F90 @@ -10,6 +10,7 @@ module oas_defineMod subroutine oas_definitions_init(bounds) use spmdMod , only : masterproc + use domainMod , only : ldomain use clm_varpar , only : nlevsoi, nlevgrnd use decompMod , only : ldecomp, bounds_type use oas_vardefMod @@ -30,15 +31,17 @@ subroutine oas_definitions_init(bounds) integer :: var_nodims(2) ! var dimension parameters - if (masterproc) then - call define_grid() - end if - + ! TODO: Fix grids.nc and masks.nc generation for 1D grid representation + !if (masterproc) then + ! call define_grid() + !end if ! ----------------------------------------------------------------- ! ... Define partition ! ----------------------------------------------------------------- - allocate(partition(200)) + ! partition length = (# elements for partition info) + (max segments ORANGE partition) x (# elements per segment info) + ! = 2 + 200*2 = 402 + allocate(partition(402)) partition(:) = 0; k = 0 ! Use ORANGE partitioning scheme. This scheme defines an ensemble @@ -58,9 +61,8 @@ subroutine oas_definitions_init(bounds) partition(3+k) = gcell_start - 1 ! segment global offset (0-based) partition(4+k) = gcell_previous - gcell_start + 1 ! segment length k = k + 2 - gcell_start = ldecomp%gdc2glo(g) ! current gridcell marks the start of a new segment - partition(2) = partition(2) + 1 ! increment number of segments + partition(2) = partition(2) + 1 ! increment number of segments (limited to 200 based from OASIS3-MCT User's guide) end if gcell_previous = ldecomp%gdc2glo(g) enddo @@ -68,8 +70,9 @@ subroutine oas_definitions_init(bounds) ! Define partition params for last segment partition(3+k) = gcell_start - 1 partition(4+k) = gcell_previous - gcell_start + 1 + partition(2) = partition(2) + 1 - call oasis_def_partition(grid_id, partition, ierror) + call oasis_def_partition(grid_id, partition, ierror, ldomain%ns) deallocate(partition) ! ----------------------------------------------------------------- @@ -143,6 +146,7 @@ end subroutine oas_definitions_init subroutine define_grid() use shr_kind_mod , only : r8 => shr_kind_r8 use domainMod , only : ldomain + character(len=4), parameter :: grid_name='gclm' integer, parameter :: SOUTH = 1 integer, parameter :: NORTH = 2 @@ -244,5 +248,6 @@ subroutine define_grid() call oasis_terminate_grids_writing() deallocate(oas_lon, oas_lat, oas_corner_lon, oas_corner_lat, oas_mask, corner_lon, corner_lat) end if + end subroutine define_grid end module oas_defineMod