[MITgcm-support] using gather/scatter to work with global fields
Matthew Mazloff
mmazloff at ucsd.edu
Thu Aug 23 14:03:09 EDT 2012
Hi Katherine
Do you have
DISABLE_MPI_READY_TO_RECEIVE
defined. If you do, perhaps try it with it undefined.
-Matt
On Aug 23, 2012, at 10:40 AM, Katherine Quinn wrote:
> Hi all,
> Within the MITgcm code (not matlab) I need to gather tiled variables
> into a global array, specifically I'm trying to gather XC and YC.
> I'm using the subroutine gather_2d_r4, which suggests "barrier
> calls" before and after but it seems no matter what various barrier
> calls I use, when I look at the global array there's chunks of tiles
> missing. Other relevant info - the MITgcm setup is for ecco version
> 4 runs, with all_exch2 turned on.
> Here's the relevant portions of my code, please suggest what I'm
> doing wrong:
>
> C == Global variables ===
> #include "SIZE.h"
> #include "EEPARAMS.h"
> #include "EESUPPORT.h"
> #include "PARAMS.h"
> #ifdef ALLOW_EXCH2
> # include "W2_EXCH2_SIZE.h"
> # include "W2_EXCH2_TOPOLOGY.h"
> # include "W2_EXCH2_PARAMS.h"
> #endif /* ALLOW_EXCH2 */
> #include "EEBUFF_SCPU.h"
> #include "GRID.h"
>
> C INPUT/OUTPUT PARAMETERS:
> C == Routine arguments ==
> C myThid - Thread number for this instance of the routine.
> INTEGER myThid
>
> C LOCAL VARIABLES:
> LOGICAL zeroBuff, useExch2ioLayOut
> INTEGER xSize, ySize
> #ifdef ALLOW_EXCH2
> _RL XC_global(exch2_global_Nx,exch2_global_Ny)
> _RL YC_global(exch2_global_Nx,exch2_global_Ny)
> #else /* ALLOW_EXCH2 */
> _RS XC_global(Nx,Ny)
> _RS YC_global(Nx,Ny)
> #endif /* ALLOW_EXCH2 */
>
> C Set dimensions and flags (e.g. mdsio_write_field.F)
> xSize = Nx
> ySize = Ny
> useExch2ioLayOut = .FALSE.
> zeroBuff = .TRUE.
> #ifdef ALLOW_EXCH2
> IF ( W2_useE2ioLayOut ) THEN
> xSize = exch2_global_Nx
> ySize = exch2_global_Ny
> useExch2ioLayOut = .TRUE.
> ENDIF
> #endif /* ALLOW_EXCH2 */
>
> C gather XC and YC into global model grid
>
> CALL BAR2( myThid )
> _BEGIN_MASTER( myThid )
> CALL GATHER_2D_R4(
> O XC_global,
> I XC,
> I xSize, ySize,
> I useExch2ioLayOut,
> I zeroBuff,
> I myThid )
> _END_MASTER( myThid )
> CALL BAR2( myThid )
>
> _BEGIN_MASTER( myThid )
> CALL GATHER_2D_R4(
> O YC_global,
> I YC,
> I xSize, ySize,
> I useExch2ioLayOut,
> I zeroBuff,
> I myThid )
> _END_MASTER( myThid )
> CALL BAR2( myThid )
>
>
>
> --
> Katherine J. Quinn
> Atmospheric and Environmental Research voice: 781-761-2234
> 131 Hartwell Avenue fax: 781-761-2299
> Lexington, MA 02421-3126 e-mail: kquinn at aer.com
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list