Skip to content

Commit

Permalink
Addedd comments to describe what is done in BufferPacking and BufferU…
Browse files Browse the repository at this point in the history
…npacking
  • Loading branch information
aoloso committed Sep 1, 2022
1 parent 9aad6f8 commit f27e02f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
! Code section for reordering original array pointers and packing them into
! 1D buffer that is then subsequently redistributed for load balancing.
! The actual pointers used for computation are then made to point back to the
! relevant porion of the 1D buffer after redistribution.
! ***CRITTICAL*** If fields are addedd or deleted to any of the ESMF states, or
! if any pointer name(s) is changed, this code section needs to modified accordingly.

! import packing and redistribution

numUsedImp = 34 ! should match the number of imports used in this subroutine + 2 (for LATS and LONS)
Expand Down Expand Up @@ -216,7 +223,7 @@

call MAPL_BalanceWork(BUFIMP, NUMMAX, Direction=MAPL_Distribute, Handle=CICECOREBalanceHandle, __RC__)

!REAL4 internal
! REAL4 internal packing and redistribution
numIntSlices = &
NUM_ICE_CATEGORIES + & ! TSKINI
NUM_SUBTILES + & ! QS
Expand Down Expand Up @@ -275,7 +282,7 @@

call MAPL_BalanceWork(BUFINT, NUMMAX, Direction=MAPL_Distribute, Handle=CICECOREBalanceHandle, __RC__)

!REAL8 internal
! REAL8 internal packing and redistribution
numIntSlices8 = &
NUM_SUBTILES + & ! FR
NUM_ICE_CATEGORIES + & ! VOLICE
Expand Down Expand Up @@ -342,8 +349,8 @@
call MAPL_BalanceWork(BUFINT8, NUMMAX, Direction=MAPL_Distribute, Handle=CICECOREBalanceHandle, __RC__)


!export
!not all exports will necessarily be needed but memory will be allocated just in case
! export packing and redistribution
! not all exports will necessarily be needed but memory will be allocated just in case
numExpSlices = &
79 + & ! 79 total single slice exports
NUM_ICE_CATEGORIES + & ! FCONDBOTN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
!retrieve real4 internal
! This section reverses what was done un BufferPacking by redistributing the
! the updated 1D buffer back to the original distribution and then map relevant
! portions to the original pointers in the INTERNAL and EXPORT fields.
! There is no need to do IMPORT on exit.
! ***CRITTICAL*** For any changes (pointer variable name change, field addition or
! deletion) made in BufferPacking, corresponding changes need to be made here
! as well.

! retrieve real4 internal
call MAPL_BalanceWork(BUFINT, NUMMAX, Direction=MAPL_Retrieve, Handle=CICECOREBalanceHandle, __RC__)
L1 = 1
call MAPL_GetPointer(INTERNAL,PTR2,'TSKINI', __RC__)
Expand All @@ -22,7 +30,7 @@
call MAPL_GetPointer(INTERNAL,PTR1,'SLMASK', __RC__)
call CICEReorder(BUFINT(L1),PTR1,TILE_WITH_ICE,NUMMAX,HorzDims,1,UNPACKIT)

!retrieve real8 internal
! retrieve real8 internal
call MAPL_BalanceWork(BUFINT8, NUMMAX, Direction=MAPL_Retrieve, Handle=CICECOREBalanceHandle, __RC__)
L1 = 1
call MAPL_GetPointer(INTERNAL,PTR2R8,'FR', __RC__)
Expand Down

0 comments on commit f27e02f

Please sign in to comment.