-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMAPL_ServiceServicesTypes.F90
76 lines (58 loc) · 2.23 KB
/
MAPL_ServiceServicesTypes.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "MAPL_ErrLog.h"
module mapl_ServiceServicesTypes
use ESMF
use MAPL_ExceptionHandling
implicit none
private
! public ProvidedServiceType
public ServiceConnectionGet
type, public :: ProvidedServiceType
!!$ private
character(len=:), allocatable :: SERVICE_NAME
character(len=:), allocatable :: BUNDLE_NAME
type(ESMF_FieldBundle) :: BUNDLE
!ALT currect assumption is the bundle for the provider will be in the import state
end type ProvidedServiceType
type, public :: RequestedServiceType
!!$ private
character(len=:), allocatable :: SERVICE_NAME
!ALT currect assumption is the bundle for the request will be in the export state
character(len=:), allocatable :: VAR_LIST(:)
type(ESMF_FieldBundle) :: BUNDLE
end type RequestedServiceType
type, public :: ServiceConnectionType
!!$ private
character(len=:), allocatable :: SERVICE_NAME
character(len=:), allocatable :: PROVIDER_NAME
character(len=:), allocatable :: REQUESTER_NAME
end type ServiceConnectionType
interface ProvidedServiceType
module procedure newProvidedServiceType
end interface ProvidedServiceType
contains
function newProvidedServiceType(SERVICE, BUNDLE) result (item)
character (len=*) , intent(IN ) :: SERVICE
character (len=*) , intent(IN ) :: BUNDLE
type (ProvidedServiceType) :: item
item%Service_name = SERVICE
item%Bundle_name = BUNDLE
end function newProvidedServiceType
subroutine ServiceConnectionGet(item, &
Service, Provider, Requester, RC)
type (ServiceConnectionType), intent(IN) :: ITEM
character (len=*), optional, intent( OUT) :: SERVICE
character (len=*), optional, intent( OUT) :: PROVIDER
character (len=*), optional, intent( OUT) :: REQUESTER
integer, optional, intent( OUT) :: RC ! Error code:
if (present(Service)) then
Service = item%Service_name
end if
if (present(Provider)) then
Provider = item%Provider_name
end if
if (present(requester)) then
requester = item%requester_name
end if
_RETURN(ESMF_SUCCESS)
end subroutine ServiceConnectionGet
end module mapl_ServiceServicesTypes