Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ESMF Redist instead of Remap for history bundles with 'cubed_sphere_grid' output grid #929

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions fv3_cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ subroutine InitializeAdvertise(gcomp, rc)
integer :: sloc
type(ESMF_StaggerLoc) :: staggerloc
character(len=20) :: cvalue
character(ESMF_MAXSTR) :: output_grid
!
!------------------------------------------------------------------------
!
Expand Down Expand Up @@ -757,10 +758,13 @@ subroutine InitializeAdvertise(gcomp, rc)
if(mype == 0) print *,'af get wrtfb=',"output_"//trim(fcstItemNameList(j)),' rc=',rc
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call ESMF_AttributeGet(wrtFB(j,i), convention="NetCDF", purpose="FV3-nooutput", &
name="output_grid", value=output_grid, isPresent=isPresent, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

fieldbundle_uses_redist = .false.
! if (fcstItemNameList(j)(1:8) == "restart_" .or. fcstItemNameList(j)(1:18) == "cubed_sphere_grid_") then
if (fcstItemNameList(j)(1:8) == "restart_") then
! restart output forecast bundles, no need to set regridmethod
if (trim(output_grid) == "restart_grid" .or. trim(output_grid) == "cubed_sphere_grid") then
! restart output forecast bundles, or history cubed_sphere (native) grid; no need to set regridmethod
! Redist will be used instead of Regrid
fieldbundle_uses_redist = .true.
else
Expand Down
3 changes: 3 additions & 0 deletions io/module_wrt_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,9 @@ subroutine wrt_initialize_p1(wrt_comp, imp_state_write, exp_state_write, clock,
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
actualWrtGrid = ESMF_GridCreate(fcstGrid, newAcceptorDG, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return

call ESMF_AttributeSet(fieldbundle, convention="NetCDF", purpose="FV3-nooutput", name="output_grid", value="restart_grid", rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
else
actualWrtGrid = wrtGrid(grid_id)
call ESMF_AttributeSet(fieldbundle, convention="NetCDF", purpose="FV3-nooutput", name="output_grid", value=output_grid(grid_id), rc=rc)
Expand Down