27 use mpp_mod,
only : mpp_pe, mpp_declare_pelist
73 integer :: i, io_status, ioun, npes, ierr
77 #ifdef INTERNAL_FILE_NML 80 ioun = open_namelist_file()
81 read(ioun,nml=ensemble_nml,iostat = io_status)
87 'ensemble_manager_mod: ensemble_nml variable ensemble_size must be a positive integer')
89 'ensemble_manager_mod: ensemble_nml variable ensemble_size should be no larger than MAX_ENSEMBLE_SIZE, '// &
90 'change ensemble_size or increase MAX_ENSEMBLE_SIZE')
95 call mpp_error(fatal,
'npes must be >= ensemble_size')
100 call mpp_declare_pelist((/(i,i=0,npes-1)/),
'_ens0')
125 integer,
intent(inout) :: pelist(:,:)
126 character(len=*),
intent(in),
optional :: name
129 call mpp_error(fatal,
'get_ensemble_pelist: size of pelist 1st index < ensemble_size')
131 if(
present(name))
then 135 call mpp_error(fatal,
'get_ensemble_pelist: size of pelist 2nd index < ocean_npes_pm')
142 call mpp_error(fatal,
'get_ensemble_pelist: size of pelist 2nd index < atmos_npes_pm')
149 call mpp_error(fatal,
'get_ensemble_pelist: size of pelist 2nd index < land_npes_pm')
156 call mpp_error(fatal,
'get_ensemble_pelist: size of pelist 2nd index < ice_npes_pm')
162 call mpp_error(fatal,
'get_ensemble_pelist: unknown argument name='//name)
166 call mpp_error(fatal,
'get_ensemble_pelist: size of pelist 2nd index < total_npes_pm')
184 integer,
intent(inout) :: pelist(:)
185 character(len=*),
intent(in) :: name
190 call mpp_error(fatal,
'get_ensemble_filter_pelist: size of pelist argument < ensemble_size * ocean_npes_pm')
197 call mpp_error(fatal,
'get_ensemble_filter_pelist: size of pelist argument < ensemble_size * atmos_npes_pm')
204 call mpp_error(fatal,
'get_ensemble_filter_pelist: size of pelist argument < ensemble_size * land_npes_pm')
211 call mpp_error(fatal,
'get_ensemble_filter_pelist: size of pelist argument < ensemble_size * ice_npes_pm')
217 call mpp_error(fatal,
'get_ensemble_filter_pelist: unknown argument name='//name)
231 Atm_pelist, Ocean_pelist, Land_pelist, Ice_pelist)
232 logical,
intent(in) :: concurrent
233 integer,
intent(in) :: atmos_npes, ocean_npes
234 integer,
intent(in) :: land_npes, ice_npes
235 integer,
dimension(:),
intent(inout) :: atm_pelist, ocean_pelist
236 integer,
dimension(:),
intent(inout) :: land_pelist, ice_pelist
237 integer :: atmos_pe_start, atmos_pe_end, ocean_pe_start, ocean_pe_end
238 integer :: land_pe_start, land_pe_end, ice_pe_start, ice_pe_end
239 character(len=10) :: pelist_name, text
240 integer :: npes, n, m ,i
245 if(land_npes > atmos_npes)
call mpp_error(fatal,
'ensemble_manager_mod: land_npes > atmos_npes')
246 if(ice_npes > atmos_npes)
call mpp_error(fatal,
'ensemble_manager_mod: ice_npes > atmos_npes')
258 if( concurrent .OR. atmos_npes+ocean_npes == npes )
then 262 atmos_pe_end = atmos_pe_start + atmos_npes - 1
263 ocean_pe_end = ocean_pe_start + ocean_npes - 1
264 land_pe_end = land_pe_start + land_npes - 1
265 ice_pe_end = ice_pe_start + ice_npes - 1
271 if( concurrent .OR. atmos_npes+ocean_npes == npes ) &
274 write(pelist_name,
'(a,i2.2)')
'_ens',n
276 atmos_pe_start = atmos_pe_end + 1
277 ocean_pe_start = ocean_pe_end + 1
278 land_pe_start = atmos_pe_start
279 ice_pe_start = atmos_pe_start
336 write(pelist_name,
'(a,i2.2)')
'atm_ens',n
338 write(pelist_name,
'(a,i2.2)')
'ocn_ens',n
340 write(pelist_name,
'(a,i2.2)')
'lnd_ens',n
342 write(pelist_name,
'(a,i2.2)')
'ice_ens',n
346 write(pelist_name,
'(a,i2.2)')
'atm_ens',
ensemble_id 347 call mpp_declare_pelist(atm_pelist , trim(pelist_name) )
348 write(pelist_name,
'(a,i2.2)')
'ocn_ens',
ensemble_id 349 call mpp_declare_pelist(ocean_pelist , trim(pelist_name) )
350 write(pelist_name,
'(a,i2.2)')
'lnd_ens',
ensemble_id 351 call mpp_declare_pelist(land_pelist , trim(pelist_name) )
352 write(pelist_name,
'(a,i2.2)')
'ice_ens',
ensemble_id 353 call mpp_declare_pelist(ice_pelist , trim(pelist_name) )
385 write(pelist_name,
'(a)')
'ocn_filter' 388 write(pelist_name,
'(a)')
'atm_filter' 391 write(pelist_name,
'(a)')
'lnd_filter' 394 write(pelist_name,
'(a)')
'ice_filter'
integer, parameter max_ensemble_size
integer, dimension(:), allocatable ensemble_pelist_ice_filter
integer, dimension(:,:), allocatable ensemble_pelist
integer function, public check_nml_error(IOSTAT, NML_NAME)
character(len=input_str_length), dimension(:), allocatable, target, public input_nml_file
subroutine, public get_ensemble_pelist(pelist, name)
subroutine, public set_filename_appendix(string_in)
integer, dimension(:), allocatable ensemble_pelist_atmos_filter
subroutine, public get_ensemble_filter_pelist(pelist, name)
get_ensemble_filter_pelist
integer function, dimension(6), public get_ensemble_size()
integer, dimension(:,:), allocatable ensemble_pelist_ocean
integer, dimension(:), allocatable ensemble_pelist_ocean_filter
integer, dimension(:,:), allocatable ensemble_pelist_atmos
integer, dimension(:,:), allocatable ensemble_pelist_land
integer, dimension(:), allocatable ensemble_pelist_land_filter
subroutine, public ensemble_manager_init()
ensemble_manager_init
integer function, public get_ensemble_id()
subroutine, public ensemble_pelist_setup(concurrent, atmos_npes, ocean_npes, land_npes, ice_npes, Atm_pelist, Ocean_pelist, Land_pelist, Ice_pelist)
ensemble_pelist_setup
integer, dimension(:,:), allocatable ensemble_pelist_ice