initialize_field Subroutine

public subroutine initialize_field(field, typekind, grid, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Field), intent(inout) :: field
type(ESMF_TypeKind_Flag), intent(in) :: typekind
type(ESMF_Grid), intent(inout), optional :: grid
integer, intent(out), optional :: rc

Calls

proc~~initialize_field~~CallsGraph proc~initialize_field initialize_field ESMF_GridCreateNoPeriDimUfrm ESMF_GridCreateNoPeriDimUfrm proc~initialize_field->ESMF_GridCreateNoPeriDimUfrm ESMF_GridIsCreated ESMF_GridIsCreated proc~initialize_field->ESMF_GridIsCreated anyexceptions anyexceptions proc~initialize_field->anyexceptions assert_that assert_that proc~initialize_field->assert_that esmf_fieldcreate esmf_fieldcreate proc~initialize_field->esmf_fieldcreate sourcelocation sourcelocation proc~initialize_field->sourcelocation

Called by

proc~~initialize_field~~CalledByGraph proc~initialize_field initialize_field proc~test_accumulate test_accumulate proc~test_accumulate->proc~initialize_field proc~test_accumulate_mean_r4 test_accumulate_mean_R4 proc~test_accumulate_mean_r4->proc~initialize_field proc~test_accumulate_r4 test_accumulate_R4 proc~test_accumulate_r4->proc~initialize_field proc~test_accumulate_with_undef_some_steps test_accumulate_with_undef_some_steps proc~test_accumulate_with_undef_some_steps->proc~initialize_field proc~test_max_accumulate_r4 test_max_accumulate_R4 proc~test_max_accumulate_r4->proc~initialize_field proc~test_min_accumulate_r4 test_min_accumulate_R4 proc~test_min_accumulate_r4->proc~initialize_field

Source Code

   subroutine initialize_field(field, typekind, grid, rc)
      type(ESMF_Field), intent(inout) :: field
      type(ESMF_TypeKind_Flag), intent(in) :: typekind
      type(ESMF_Grid), optional, intent(inout) :: grid
      integer, optional, intent(out) :: rc
      type(ESMF_Grid) :: grid_
      logical :: grid_created

      integer :: status
      
      grid_created = .FALSE.
      if(present(grid)) then
         grid_created = ESMF_GridIsCreated(grid, _RC)
         if(grid_created) grid_ = grid
      end if

      if(.not. grid_created) then
         grid_ = ESMF_GridCreateNoPeriDimUfrm(maxIndex=MAX_INDEX, &
            & minCornerCoord=MIN_CORNER_COORD, maxCornerCoord=MAX_CORNER_COORD, _RC)
      end if

      field = ESMF_FieldCreate(grid=grid_, typekind=typekind, _RC)
      
      if(present(grid)) grid = grid_
      _RETURN(_SUCCESS)

   end subroutine initialize_field