Ocean Modeling Discussion


Search for:
It is currently Tue Sep 17, 2019 12:56 am

Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Author Message
PostPosted: Fri Aug 08, 2008 6:10 pm 
Site Admin
User avatar

Joined: Wed Feb 26, 2003 4:41 pm
Posts: 1081
Location: IMCS, Rutgers University
This is a complete update of ROMS private storage arrays that are automatically allocated when entering the _tile routines. These arrays needed to be redesigned to allow the different types of nesting: refinement, composite, and mosaics grids. These arrays where intentionally and temporarily changed to global dimensions in revision 168 (:arrow: src:ticket:142) but I forgot to change them back. Well, it happens...sorry :oops: The change was correct in distributed-memory applications since we only allocate the tile plus the ghost points. However, the private storage was much larger than needed in shared-memory and serial with partitions applications. This is not a bug but the model required larger memory in such applications. Perhaps, you didn't notice...

Four new variables are introduced in tile.h to set the size of the private storage arrays for each nested grid:
!  Set horizontal starting and ending indices for automatic private storage
!  arrays.

So now each tiled routine has the following additional arguments: IminS, ImaxS, JminS, and JmaxS, for example:

      CALL xxxxx_tile (ng, tile,                                        &
     &                 LBi, UBi, LBj, UBj,                              &
     &                 IminS, ImaxS, JminS, JmaxS,                      &
     &                 ...)

The values of IminS, ImaxS, JminS, and JmaxS will change in the future to allow for the different size of the contact areas. However, the change will be limited to tile.h. Notice that the numerous additions and subtractions per time-step that we did before are eliminated. The CPP tokens in globaldefs.h now look like:
#define PRIVATE_2D_SCRATCH_ARRAY IminS:ImaxS,JminS:JmaxS

These definitions are kept for compatibility but not used in the new version :!:


If you added additional routines to the model or have customized analytical (ana_xxx.h) routines that require private storage, you need to add the new four arguments:
#include "tile.h"

      CALL my_routine_tile (ng, tile,                                   &
     &                      LBi, UBi, LBj, UBj,                         &
     &                      IminS, ImaxS, JminS, JmaxS,                 &  ! <= insert
     &                      ...)

      END SUBROUTINE my_routine

      SUBROUTINE my_routine_tile (ng, tile,                             &
     &                            LBi, UBi, LBj, UBj,                   &
     &                            IminS, ImaxS, JminS, JmaxS,           &  ! <= insert
     &                            ...)


      integer, intent(in) :: ng, tile
      integer, intent(in) :: LBi, UBi, LBj, UBj
      integer, intent(in) :: IminS, ImaxS, JminS, JmaxS                    ! <= insert

      END SUBROUTINE my_routine_tile

The other thing that you may do is a string replace during editing in your routine: replace PRIVATE_1D_SCRATCH_ARRAY with IminS:ImaxS and replace PRIVATE_2D_SCRATCH_ARRAY with IminS:ImaxS,JminS:JmaxS. You can look at any ROMS tiled routine for guidance. This is a very simple change.

Notice that the following ROMS routines do not required these four additional arguments:

  • bc_r2d_tile, bc_u2d_tile, and bc_u3d_tile
  • bc_r3d_tile, bc_u3d_tile, bc_u3d_tile, and bc_w3d_tile
  • exchange_p2d_tile, exchange_r2d_tile, exchange_u2d_tile, and exchange_v2d_tile
  • exchange_p3d_tile, exchange_r3d_tile, exchange_u3d_tile, exchange_v3d_tile, and exchange_w3d_tile
  • mp_exchange2d, mp_exchange3d, and mp_exchange4d

and the respective adjoint-based routines. Notice that we sometimes pass private variables to these routines.

Good luck :!:

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group