1 ! Various dummy type definitions and routines for the sole purpose of
2 ! mimicking newer ESMF interface features without necessarily implementing
31 TYPE(ESMF_MsgType), PARAMETER :: &
32 ESMF_LOG_INFO = ESMF_MsgType(1), &
33 ESMF_LOG_WARNING = ESMF_MsgType(2), &
34 ESMF_LOG_ERROR = ESMF_MsgType(3)
40 LOGICAL, private, save :: initialized = .false.
42 PUBLIC ESMF_Grid, ESMF_GridComp, ESMF_State, ESMF_VM
43 PUBLIC ESMF_Initialize, ESMF_Finalize, ESMF_IsInitialized
44 PUBLIC ESMF_LogWrite, ESMF_LOG, ESMF_MsgType
45 PUBLIC ESMF_LOG_INFO, ESMF_LOG_WARNING, ESMF_LOG_ERROR
51 SUBROUTINE ESMF_Initialize( vm, defaultcalkind, rc )
53 USE WRF_ESMF_CalendarMod
54 TYPE(ESMF_VM), INTENT(IN ), OPTIONAL :: vm
55 TYPE(ESMF_CalendarType), INTENT(IN ), OPTIONAL :: defaultcalkind
56 INTEGER, INTENT( OUT), OPTIONAL :: rc
58 TYPE(ESMF_CalendarType) :: defaultCalType
61 IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
62 ! Initialize the default time manager calendar
63 IF ( PRESENT(defaultcalkind) )THEN
64 defaultCalType = defaultcalkind
66 defaultCalType = ESMF_CAL_NOLEAP
68 allocate( defaultCal )
69 defaultCal = ESMF_CalendarCreate( calendarType=defaultCalType, &
72 ! initialize tables in time manager
75 IF (status .ne. ESMF_SUCCESS) THEN
76 PRINT *, "Error initializing the default time manager calendar"
81 IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
82 END SUBROUTINE ESMF_Initialize
85 FUNCTION ESMF_IsInitialized()
86 LOGICAL ESMF_IsInitialized
87 ESMF_IsInitialized = initialized
88 END FUNCTION ESMF_IsInitialized
92 SUBROUTINE ESMF_Finalize( rc )
94 INTEGER, INTENT( OUT), OPTIONAL :: rc
95 #if (defined SPMD) || (defined COUP_CSM)
101 IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
102 #if (defined SPMD) || (defined COUP_CSM)
103 CALL MPI_Finalized( flag, ier )
104 IF ( ier .ne. mpi_success )THEN
105 IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
107 IF ( .NOT. flag ) THEN
108 CALL MPI_Finalize( ier )
109 IF ( ier .ne. mpi_success )THEN
110 IF ( PRESENT( rc ) ) rc = ESMF_FAILURE
114 END SUBROUTINE ESMF_Finalize
117 SUBROUTINE ESMF_LogWrite( msg, MsgType, line, file, method, log, rc )
119 CHARACTER(LEN=*), INTENT(IN) :: msg
120 TYPE(ESMF_MsgType), INTENT(IN) :: msgtype
121 INTEGER, INTENT(IN), OPTIONAL :: line
122 CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: file
123 CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: method
124 TYPE(ESMF_LOG),TARGET,OPTIONAL :: log
125 INTEGER, INTENT(OUT),OPTIONAL :: rc
126 IF ( PRESENT( rc ) ) rc = ESMF_SUCCESS
127 END SUBROUTINE ESMF_LogWrite
130 END MODULE WRF_ESMF_Stubs