Skip to content
This repository has been archived by the owner on Oct 23, 2020. It is now read-only.

Commit

Permalink
export MOAB pid for consumption by the coupler
Browse files Browse the repository at this point in the history
  • Loading branch information
iulian787 committed Nov 21, 2017
1 parent b792ca7 commit e100606
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/framework/mpas_moabmesh.F
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module mpas_moabmesh
implicit none
#include "moab/MOABConfig.h"

integer, public :: MPOID ! app id on moab side, for MPAS ocean

contains

SUBROUTINE errorout(ierr, message)
Expand All @@ -33,7 +35,7 @@ subroutine mpas_moab_instance(domain)
type (block_type), pointer :: block
type (mpas_pool_type), pointer :: meshPool
integer, pointer :: nCells, nVertices, maxEdges
integer :: nVert, iCell, iVertex, nblocks
integer :: pid, nblocks
real (kind=RKIND), dimension(:), allocatable :: xv,yv,zv
integer, dimension(:,:), pointer :: verticesOnCell
integer, dimension(:), pointer :: nEdgesOnCell
Expand All @@ -49,7 +51,7 @@ subroutine mpas_moab_instance(domain)
integer , external :: iMOAB_RegisterFortranApplication, &
iMOAB_CreateVertices, iMOAB_WriteMesh, iMOAB_CreateElements, &
iMOAB_ResolveSharedEntities, iMOAB_DetermineGhostEntities
integer :: c_comm, pid, i1, j1, ic, lastvertex
integer :: c_comm, i1, j1, ic, lastvertex
character*12 appname
integer :: ierr, num_verts_in_cells, ext_comp_id
real(kind=RKIND), allocatable, target :: moab_vert_coords(:)
Expand All @@ -59,8 +61,10 @@ subroutine mpas_moab_instance(domain)

c_comm = domain % dminfo % comm
appname = 'MPAS_MESH'//CHAR(0)
ext_comp_id = 17 ! some number less than 33
MPOID = -1 ! initialized negative , so we know if this register passes
ext_comp_id = 17 ! some number less than 33 ! maybe this should be input
ierr = iMOAB_RegisterFortranApplication(appname, c_comm, ext_comp_id, pid)
MPOID = pid ! this is exported, need for send to work
call errorout(ierr, 'fail to register MPAS_MOAB mesh')
proc_id = domain % dminfo % my_proc_id
call mpas_log_write('MOAB MPAS app pid: $i task $i ', intArgs=(/pid, proc_id/) )
Expand Down

0 comments on commit e100606

Please sign in to comment.