@@ -19,9 +19,8 @@ module mapl3g_FieldInfo
1919 public :: FieldInfoSetShared
2020 public :: FieldInfoSetInternal
2121 public :: FieldInfoGetInternal
22- public :: FieldInfoSetPrivate
23- public :: FieldInfoGetPrivate
2422 public :: FieldInfoCopyShared
23+ public :: RestartModePlusAliasId
2524
2625 interface FieldInfoSetShared
2726 procedure info_field_set_shared_i4
@@ -41,14 +40,6 @@ module mapl3g_FieldInfo
4140 module procedure field_info_get_internal
4241 end interface FieldInfoGetInternal
4342
44- interface FieldInfoSetPrivate
45- module procedure field_info_set_private
46- end interface FieldInfoSetPrivate
47-
48- interface FieldInfoGetPrivate
49- module procedure field_info_get_private
50- end interface FieldInfoGetPrivate
51-
5243 interface FieldInfoCopyShared
5344 procedure :: field_info_copy_shared
5445 end interface FieldInfoCopyShared
@@ -68,6 +59,11 @@ module mapl3g_FieldInfo
6859 character (* ), parameter :: KEY_SPEC_HANDLE = " /spec_handle"
6960 character (* ), parameter :: KEY_RESTART_MODE = " /restart_mode"
7061
62+ type RestartModePlusAliasId
63+ integer (kind= kind (MAPL_RESTART_MODE)) :: restart_mode = MAPL_RESTART_REQUIRED
64+ integer :: alias_id = - 1
65+ end type RestartModePlusAliasId
66+
7167contains
7268
7369 subroutine field_info_set_internal (info , unusable , &
@@ -77,6 +73,7 @@ subroutine field_info_set_internal(info, unusable, &
7773 units , long_name , standard_name , &
7874 allocation_status , &
7975 spec_handle , &
76+ restart_mode_plus_alias_id , &
8077 rc )
8178 type (ESMF_Info), intent (inout ) :: info
8279 class(KeywordEnforcer), optional , intent (in ) :: unusable
@@ -89,11 +86,13 @@ subroutine field_info_set_internal(info, unusable, &
8986 character (* ), optional , intent (in ) :: standard_name
9087 type (StateItemAllocation), optional , intent (in ) :: allocation_status
9188 integer , optional , intent (in ) :: spec_handle(:)
89+ type (RestartModePlusAliasId), optional , intent (in ) :: restart_mode_plus_alias_id
9290 integer , optional , intent (out ) :: rc
9391
94- integer :: status
9592 type (ESMF_Info) :: ungridded_info
96- character (:), allocatable :: namespace_
93+ character (:), allocatable :: id_str, namespace_
94+ integer (kind= kind (MAPL_RESTART_MODE)) :: restart_mode
95+ integer :: alias_id, status
9796
9897 namespace_ = INFO_INTERNAL_NAMESPACE
9998 if (present (namespace)) then
@@ -151,6 +150,15 @@ subroutine field_info_set_internal(info, unusable, &
151150 call MAPL_InfoSet(info, namespace_ // KEY_SPEC_HANDLE, spec_handle, _RC)
152151 end if
153152
153+ if (present (restart_mode_plus_alias_id)) then
154+ alias_id = restart_mode_plus_alias_id% alias_id
155+ restart_mode = restart_mode_plus_alias_id% restart_mode
156+ _ASSERT(alias_id >= 0 , " alias_id is not set" )
157+ id_str = ESMF_UtilStringInt2String(alias_id, _RC)
158+ ! NOTE: the 'x' is to keep ESMF_Info from getting confused
159+ call MAPL_InfoSet(info, namespace_ // " /x" // trim (id_str) // " /restart_mode" , restart_mode, _RC)
160+ end if
161+
154162 _RETURN(_SUCCESS)
155163 _UNUSED_DUMMY(unusable)
156164 end subroutine field_info_set_internal
@@ -162,6 +170,7 @@ subroutine field_info_get_internal(info, unusable, &
162170 ungridded_dims , &
163171 allocation_status , &
164172 spec_handle , &
173+ restart_mode_plus_alias_id , &
165174 rc )
166175 type (ESMF_Info), intent (in ) :: info
167176 class(KeywordEnforcer), optional , intent (in ) :: unusable
@@ -175,15 +184,16 @@ subroutine field_info_get_internal(info, unusable, &
175184 type (UngriddedDims), optional , intent (out ) :: ungridded_dims
176185 type (StateItemAllocation), optional , intent (out ) :: allocation_status
177186 integer , optional , allocatable , intent (out ) :: spec_handle(:)
187+ type (RestartModePlusAliasId), optional , intent (inout ) :: restart_mode_plus_alias_id
178188 integer , optional , intent (out ) :: rc
179189
180- integer :: status
181- integer :: num_levels_
182190 type (ESMF_Info) :: ungridded_info
183191 character (:), allocatable :: vert_staggerloc_str, allocation_status_str
184192 type (VerticalStaggerLoc) :: vert_staggerloc_
185- character (:), allocatable :: namespace_
193+ character (:), allocatable :: namespace_, id_str, key
186194 logical :: key_is_present
195+ integer (kind= kind (MAPL_RESTART_MODE)) :: restart_mode
196+ integer :: status, num_levels_, alias_id
187197
188198 namespace_ = INFO_INTERNAL_NAMESPACE
189199 if (present (namespace)) then
@@ -243,59 +253,23 @@ subroutine field_info_get_internal(info, unusable, &
243253 call MAPL_InfoGet(info, namespace_ // KEY_SPEC_HANDLE, spec_handle, _RC)
244254 end if
245255
246- _RETURN(_SUCCESS)
247- _UNUSED_DUMMY(unusable)
248- end subroutine field_info_get_internal
249-
250- subroutine field_info_set_private (info , named_alias_id , unusable , restart_mode , rc )
251- type (ESMF_Info), intent (inout ) :: info
252- integer , intent (in ) :: named_alias_id
253- class(KeywordEnforcer), optional , intent (in ) :: unusable
254- integer (kind= kind (MAPL_RESTART_MODE)), optional , intent (in ) :: restart_mode
255- integer , optional , intent (out ) :: rc
256-
257- integer :: status
258- character (:), allocatable :: id_str, namespace
259-
260- id_str = ESMF_UtilStringInt2String(named_alias_id, _RC)
261- ! NOTE: the 'x' is to keep ESMF_Info from getting confused
262- namespace = INFO_PRIVATE_NAMESPACE // " /x" // trim (id_str)
263-
264- if (present (restart_mode)) then
265- call MAPL_InfoSet(info, namespace // KEY_RESTART_MODE, restart_mode, _RC)
266- end if
267-
268- _RETURN(_SUCCESS)
269- _UNUSED_DUMMY(unusable)
270- end subroutine field_info_set_private
271-
272- subroutine field_info_get_private (info , named_alias_id , unusable , restart_mode , rc )
273- type (ESMF_Info), intent (in ) :: info
274- integer , intent (in ) :: named_alias_id
275- class(KeywordEnforcer), optional , intent (in ) :: unusable
276- integer (kind= kind (MAPL_RESTART_MODE)), optional , intent (out ) :: restart_mode
277- integer , optional , intent (out ) :: rc
278-
279- integer :: status
280- character (:), allocatable :: id_str, namespace, key
281- logical :: key_is_present
282-
283- id_str = ESMF_UtilStringInt2String(named_alias_id, _RC)
284- ! NOTE: the 'x' is to keep ESMF_Info from getting confused
285- namespace = INFO_PRIVATE_NAMESPACE // " /x" // trim (id_str)
286-
287- if (present (restart_mode)) then
288- key = namespace // KEY_RESTART_MODE
256+ if (present (restart_mode_plus_alias_id)) then
257+ alias_id = restart_mode_plus_alias_id% alias_id
258+ _ASSERT(alias_id >= 0 , " alias_id is not set" )
259+ id_str = ESMF_UtilStringInt2String(alias_id, _RC)
260+ ! NOTE: the 'x' is to keep ESMF_Info from getting confused
261+ key = namespace_ // " /x" // trim (id_str) // " /restart_mode"
289262 key_is_present = ESMF_InfoIsPresent(info, key= key, _RC)
290263 restart_mode = MAPL_RESTART_REQUIRED
291264 if (key_is_present) then
292265 call MAPL_InfoGet(info, key, restart_mode, _RC)
293266 end if
267+ restart_mode_plus_alias_id% restart_mode = restart_mode
294268 end if
295269
296270 _RETURN(_SUCCESS)
297271 _UNUSED_DUMMY(unusable)
298- end subroutine field_info_get_private
272+ end subroutine field_info_get_internal
299273
300274 subroutine info_field_get_shared_i4 (field , key , value , unusable , rc )
301275 type (ESMF_Field), intent (in ) :: field
0 commit comments