@@ -20,7 +20,7 @@ module GEOS_LdasGridCompMod
2020 use LDAS_TileCoordType, only: tile_coord_type , T_TILECOORD_STATE, TILECOORD_WRAP
2121 use LDAS_TileCoordType, only: grid_def_type, io_grid_def_type, operator (==)
2222 use LDAS_TileCoordRoutines, only: get_minExtent_grid, get_ij_ind_from_latlon, io_domain_files
23- use LDAS_ConvertMod, only: esmf2ldas, string2tile_types
23+ use LDAS_ConvertMod, only: esmf2ldas
2424 use LDAS_PertRoutinesMod, only: get_pert_grid
2525 use LDAS_ensdrv_functions, only: get_io_filename
2626 use LDAS_DateTimeMod, only: date_time_type
@@ -89,16 +89,17 @@ subroutine SetServices(gc, rc)
8989 character (len= ESMF_MAXSTR) :: Iam
9090 character (len= ESMF_MAXSTR) :: comp_name
9191 character (len= ESMF_MAXSTR) :: ensid_string,childname
92- character (len= ESMF_MAXSTR) :: LAND_ASSIM_STR, mwRTM_file, ENS_FORCING_STR, TILE_TYPES_STR
92+ character (len= ESMF_MAXSTR) :: LAND_ASSIM_STR, mwRTM_file, ENS_FORCING_STR
9393 integer :: ens_id_width
94- character ( 10 ) , allocatable :: tile_types(:)
94+ integer , allocatable :: tile_types(:)
9595 ! Local variables
9696 type (T_TILECOORD_STATE), pointer :: tcinternal
9797 type (TILECOORD_WRAP) :: tcwrap
9898
9999 type (ESMF_Config) :: CF
100- integer :: LSM_CHOICE
100+ integer :: LSM_CHOICE, NRA
101101 integer :: FIRST_ENS_ID
102+ logical :: isPresent
102103
103104 ! Begin...
104105
@@ -155,18 +156,24 @@ subroutine SetServices(gc, rc)
155156 VERIFY_(STATUS)
156157 ensemble_forcing = (trim (ENS_FORCING_STR) == ' YES' )
157158
158- call MAPL_GetResource ( MAPL, TILE_TYPES_STR, Label= " TILE_TYPES:" , DEFAULT= " LAND" , RC= STATUS)
159- VERIFY_(STATUS)
160- TILE_TYPES_STR = ESMF_UtilStringUpperCase(TILE_TYPES_STR, rc= STATUS)
161- VERIFY_(STATUS)
162- call string2tile_types(TILE_TYPES_STR, tile_types)
159+ call ESMF_ConfigFindLabel( CF, LABEL= " TILE_TYPES:" , isPresent= isPresent, _RC)
160+ if (isPresent) then
161+ nra = ESMF_ConfigGetLen( CF, _RC)
162+ allocate (tile_types(nra))
163+ call ESMF_ConfigFindLabel( CF, LABEL= " TILE_TYPES:" , _RC)
164+ call ESMF_ConfigGetAttribute( CF, valueList= tile_types, count= NRA, _RC)
165+ else
166+ ! default
167+ tile_types = [MAPL_LAND]
168+ endif
169+
163170 with_landice = .false.
164171 with_land = .false.
165172! with_lake = .false.
166173 do i = 1 , size (tile_types)
167- if (trim ( tile_types(i)) == ' LANDICE ' ) with_landice = .true.
168- if (trim ( tile_types(i)) == ' LAND ' ) with_land = .true.
169- ! if (trim( tile_types(i)) == 'LAKE' ) with_lake = .true.
174+ if (tile_types(i) == MAPL_LANDICE ) with_landice = .true.
175+ if (tile_types(i) == MAPL_LAND ) with_land = .true.
176+ ! if (tile_types(i) == MAPL_LAKE ) with_lake = .true.
170177 enddo
171178
172179 call MAPL_GetResource ( MAPL, LAND_ASSIM_STR, Label= " LAND_ASSIM:" , DEFAULT= " NO" , RC= STATUS)
0 commit comments