my_init1 Subroutine

public subroutine my_init1(gcomp, importState, exportState, externalclock, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp) :: gcomp
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
type(ESMF_Clock) :: externalclock
integer, intent(out) :: rc

Source Code

  subroutine my_init1(gcomp, importState, exportState, externalclock, rc)
    type(ESMF_GridComp)   :: gcomp
    type(ESMF_State)      :: importState
    type(ESMF_State)      :: exportState
    type(ESMF_Clock)      :: externalclock
    integer, intent(out)  :: rc

    ! local variables
    type(ESMF_Method_Flag)  :: currentMethod
    integer                 :: currentPhase
     
    ! Initialize return code
    rc = ESMF_SUCCESS

    print *, "User initialize 1 routine called"
      
    ! set user return code according to correctness of method and phase test

    call ESMF_GridCompGet(gcomp, currentMethod=currentMethod, &
      currentPhase=currentPhase, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
        
    if (currentMethod/=ESMF_METHOD_INITIALIZE) then
      rc = ESMF_FAILURE
      return  ! bail out
    endif

    if (currentPhase/=1) then
      rc = ESMF_FAILURE
      return  ! bail out
    endif

  end subroutine my_init1