Skip to content

Commit

Permalink
RestartHandler - cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pchakraborty committed Jan 10, 2025
1 parent 15b80b9 commit 3cc5f81
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions generic3g/RestartHandler.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ subroutine write(this, state_type, state, rc)
! TODO: the file_name should come from OuterMetaComponents's hconfig
file_name = trim(this%gc_name) // "_" // trim(state_type) // "_checkpoint.nc4"
call this%lgr%info("Writing checkpoint: %a", trim(file_name))
out_bundle = MAPL_StateGet(state, _RC) !get_bundle_from_state_(state, _RC)
out_bundle = MAPL_StateGet(state, _RC)
call this%write_bundle_(out_bundle, file_name, rc)
end if

Expand Down Expand Up @@ -107,39 +107,6 @@ subroutine read(this, state_type, state, rc)
_RETURN(_SUCCESS)
end subroutine read

! type(ESMF_FieldBundle) function get_bundle_from_state_(state, rc) result(bundle)
! ! Arguments
! type(ESMF_State), intent(in) :: state
! integer, optional, intent(out) :: rc

! ! Locals
! character(len=ESMF_MAXSTR), allocatable :: item_name(:)
! type (ESMF_StateItem_Flag), allocatable :: item_type(:)
! type(ESMF_Field) :: field
! type(ESMF_FieldStatus_Flag) :: field_status
! integer :: item_count, idx, status

! ! bundle to pack fields in
! bundle = ESMF_FieldBundleCreate(_RC)
! call ESMF_StateGet(state, itemCount=item_count, _RC)
! allocate(item_name(item_count), _STAT)
! allocate(item_type(item_count), _STAT)
! call ESMF_StateGet(state, itemNameList=item_name, itemTypeList=item_type, _RC)
! do idx = 1, item_count
! if (item_type(idx) /= ESMF_STATEITEM_FIELD) then
! _FAIL("FieldBundle has not been implemented yet")
! end if
! call ESMF_StateGet(state, item_name(idx), field, _RC)
! call ESMF_FieldGet(field, status=field_status, _RC)
! if (field_status == ESMF_FIELDSTATUS_COMPLETE) then
! call ESMF_FieldBundleAdd(bundle, [field], _RC)
! end if
! end do
! deallocate(item_name, item_type, _STAT)

! _RETURN(_SUCCESS)
! end function get_bundle_from_state_

subroutine write_bundle_(this, bundle, file_name, rc)
! Arguments
class(RestartHandler), intent(in) :: this
Expand Down

0 comments on commit 3cc5f81

Please sign in to comment.