ESMF_InternalStateModEx Program

Uses

  • program~~esmf_internalstatemodex~~UsesGraph program~esmf_internalstatemodex ESMF_InternalStateModEx module~esmf ESMF program~esmf_internalstatemodex->module~esmf module~esmf_testmod ESMF_TestMod program~esmf_internalstatemodex->module~esmf_testmod module~user_mod user_mod program~esmf_internalstatemodex->module~user_mod

Calls

program~~esmf_internalstatemodex~~CallsGraph program~esmf_internalstatemodex ESMF_InternalStateModEx esmf_gridcompsetservices esmf_gridcompsetservices program~esmf_internalstatemodex->esmf_gridcompsetservices proc~esmf_finalize ESMF_Finalize program~esmf_internalstatemodex->proc~esmf_finalize proc~esmf_gridcompcreate ESMF_GridCompCreate program~esmf_internalstatemodex->proc~esmf_gridcompcreate proc~esmf_gridcompdestroy ESMF_GridCompDestroy program~esmf_internalstatemodex->proc~esmf_gridcompdestroy proc~esmf_gridcompfinalize ESMF_GridCompFinalize program~esmf_internalstatemodex->proc~esmf_gridcompfinalize proc~esmf_gridcompinitialize ESMF_GridCompInitialize program~esmf_internalstatemodex->proc~esmf_gridcompinitialize proc~esmf_gridcomprun ESMF_GridCompRun program~esmf_internalstatemodex->proc~esmf_gridcomprun proc~esmf_initialize ESMF_Initialize program~esmf_internalstatemodex->proc~esmf_initialize proc~esmf_stest ESMF_STest program~esmf_internalstatemodex->proc~esmf_stest

Variables

Type Attributes Name Initial
character(len=ESMF_MAXSTR) :: failMsg
character(len=ESMF_MAXSTR) :: testname
integer :: finalrc
integer :: rc
integer :: result
type(ESMF_GridComp) :: comp1

Source Code

program ESMF_InternalStateModEx
#include "ESMF.h"

  use ESMF
  use ESMF_TestMod
  use user_mod
  implicit none

  type(ESMF_GridComp) :: comp1
  integer :: rc, finalrc, result
  character(ESMF_MAXSTR) :: testname
  character(ESMF_MAXSTR) :: failMsg

!-------------------------------------------------------------------------
!-------------------------------------------------------------------------

  write(failMsg, *) "Example failure"
  write(testname, *) "Example ESMF_InternalStateModEx"


! ------------------------------------------------------------------------------
! ------------------------------------------------------------------------------


  finalrc = ESMF_SUCCESS

  call ESMF_Initialize(defaultlogfilename="InternalStateModEx.Log", &
                    logkindflag=ESMF_LOGKIND_MULTI, rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  comp1 = ESMF_GridCompCreate(name="test", rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  call ESMF_GridCompSetServices(comp1, userRoutine=mygcomp_register, rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  call ESMF_GridCompInitialize(comp1, rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  call ESMF_GridCompRun(comp1, rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  call ESMF_GridCompFinalize(comp1, rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  call ESMF_GridCompDestroy(comp1, rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  ! IMPORTANT: ESMF_STest() prints the PASS string and the # of processors in the log
  ! file that the scripts grep for.
  call ESMF_STest((finalrc.eq.ESMF_SUCCESS), testname, failMsg, result, ESMF_SRCLINE)

  call ESMF_Finalize(rc=rc)
  if (rc .ne. ESMF_SUCCESS) finalrc = ESMF_FAILURE

  if (finalrc .eq. ESMF_SUCCESS) then
    print *, "PASS: ESMF_InternalStateEx.F90"
  else
    print *, "FAIL: ESMF_InternalStateEx.F90"
  end if

end program ESMF_InternalStateModEx