Skip to content

Commit

Permalink
Added global grid nx and ny scalars to MOM6 cap for writing history f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
rsdunlapiv committed Jun 4, 2018
1 parent b7a88a6 commit eef4bf2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion config_src/nuopc_driver/mom_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ module mom_cap_mod
use mom_cap_methods, only: ocn_export, ocn_import
use esmFlds, only: flds_scalar_name, flds_scalar_num
use esmFlds, only: fldListFr, fldListTo, compocn, compname
use esmFlds, only: flds_scalar_index_nx, flds_scalar_index_ny
use shr_nuopc_fldList_mod, only: shr_nuopc_fldList_Realize
use shr_nuopc_fldList_mod, only: shr_nuopc_fldList_Concat
use shr_nuopc_fldList_mod, only: shr_nuopc_fldList_Getnumflds
Expand Down Expand Up @@ -868,6 +869,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
real(ESMF_KIND_R8), pointer :: dataPtr_xcor(:,:)
real(ESMF_KIND_R8), pointer :: dataPtr_ycor(:,:)
type(ESMF_Field) :: field_t_surf
integer :: mpicom
character(len=*),parameter :: subname='(mom_cap:InitializeRealize)'

rc = ESMF_SUCCESS
Expand All @@ -888,7 +890,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
file=__FILE__)) &
return ! bail out

call ESMF_VMGet(vm, petCount=npet, rc=rc)
call ESMF_VMGet(vm, petCount=npet, mpiCommunicator=mpicom, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
line=__LINE__, &
file=__FILE__)) &
Expand Down Expand Up @@ -1307,6 +1309,14 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
call shr_nuopc_fldList_Realize(exportState, fldListFr(compocn), flds_scalar_name, flds_scalar_num, &
grid=gridOut, tag=subname//':MOM6Export', rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call shr_nuopc_methods_State_SetScalar(dble(nxg),flds_scalar_index_nx, exportState, mpicom, &
flds_scalar_name, flds_scalar_num, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call shr_nuopc_methods_State_SetScalar(dble(nyg),flds_scalar_index_ny, exportState, mpicom, &
flds_scalar_name, flds_scalar_num, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
#else
call MOM_RealizeFields(importState, gridIn , fldsToOcn_num, fldsToOcn, "Ocn import", rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
Expand Down

0 comments on commit eef4bf2

Please sign in to comment.