95 INTEGER(INTG),
INTENT(OUT) :: ERR
99 enters(
"DOMAIN_MAPPINGS_ADJACENT_DOMAIN_FINALISE",err,error,*999)
101 IF(
ALLOCATED(adjacent_domain%LOCAL_GHOST_SEND_INDICES))
DEALLOCATE(adjacent_domain%LOCAL_GHOST_SEND_INDICES)
102 IF(
ALLOCATED(adjacent_domain%LOCAL_GHOST_RECEIVE_INDICES))
DEALLOCATE(adjacent_domain%LOCAL_GHOST_RECEIVE_INDICES)
103 adjacent_domain%NUMBER_OF_SEND_GHOSTS=0
104 adjacent_domain%NUMBER_OF_RECEIVE_GHOSTS=0
105 adjacent_domain%DOMAIN_NUMBER=0
107 exits(
"DOMAIN_MAPPINGS_ADJACENT_DOMAIN_FINALISE")
109 999 errorsexits(
"DOMAIN_MAPPINGS_ADJACENT_DOMAIN_FINALISE",err,error)
122 INTEGER(INTG),
INTENT(OUT) :: ERR
126 enters(
"DOMAIN_MAPPINGS_ADJACENT_DOMAIN_INITIALISE",err,error,*999)
128 adjacent_domain%NUMBER_OF_SEND_GHOSTS=0
129 adjacent_domain%NUMBER_OF_RECEIVE_GHOSTS=0
130 adjacent_domain%DOMAIN_NUMBER=0
132 exits(
"DOMAIN_MAPPINGS_ADJACENT_DOMAIN_INITIALISE")
134 999 errorsexits(
"DOMAIN_MAPPINGS_ADJACENT_DOMAIN_INITIALISE",err,error)
147 INTEGER(INTG),
INTENT(IN) :: GLOBAL_NUMBER
148 LOGICAL,
INTENT(OUT) :: LOCAL_EXISTS
149 INTEGER(INTG),
INTENT(OUT) :: LOCAL_NUMBER
150 INTEGER(INTG),
INTENT(OUT) :: ERR
155 enters(
"DOMAIN_MAPPINGS_GLOBAL_TO_LOCAL_GET",err,error,*999)
159 IF(
ASSOCIATED(domain_mapping))
THEN 160 IF(global_number>=1.AND.global_number<=domain_mapping%NUMBER_OF_GLOBAL)
THEN 161 IF(domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(1)== &
163 local_number=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(1)
167 local_error=
"The specified global number of "//
trim(
number_to_vstring(global_number,
"*",err,error))// &
168 &
" is invalid. The number must be between 1 and "// &
170 CALL flagerror(local_error,err,error,*999)
173 CALL flagerror(
"Domain mapping is not associated.",err,error,*999)
176 exits(
"DOMAIN_MAPPINGS_GLOBAL_TO_LOCAL_GET")
178 999 errorsexits(
"DOMAIN_MAPPINGS_GLOBAL_TO_LOCAL_GET",err,error)
191 INTEGER(INTG),
INTENT(OUT) :: ERR
194 INTEGER(INTG) :: domain_idx,domain_idx2,domain_no,domain_no2,global_number,idx,local_number,local_number2,NUMBER_INTERNAL, &
195 & NUMBER_BOUNDARY,NUMBER_GHOST,my_computational_node_number,MY_DOMAIN_INDEX,TEMP,NUMBER_OF_ADJACENT_DOMAINS, &
196 & RECEIVE_FROM_DOMAIN,DUMMY_ERR,NUMBER_OF_GHOST_RECEIVE,NUMBER_OF_GHOST_SEND,local_type,COUNT, &
197 & TOTAL_NUMBER_OF_ADJACENT_DOMAINS
198 INTEGER(INTG),
ALLOCATABLE :: ADJACENT_DOMAIN_MAP(:),ADJACENT_DOMAINS(:,:),SEND_LIST(:),RECEIVE_LIST(:)
199 LOGICAL :: OWNED_BY_ALL,SEND_GLOBAL
200 TYPE(
list_ptr_type),
ALLOCATABLE :: GHOST_SEND_LISTS(:),GHOST_RECEIVE_LISTS(:)
203 enters(
"DOMAIN_MAPPINGS_LOCAL_FROM_GLOBAL_CALCULATE",err,error,*999)
205 IF(
ASSOCIATED(domain_mapping))
THEN 210 ALLOCATE(domain_mapping%NUMBER_OF_DOMAIN_LOCAL(0:domain_mapping%NUMBER_OF_DOMAINS-1),stat=err)
211 IF(err/=0)
CALL flagerror(
"Could not allocate number of domain local.",err,error,*999)
212 domain_mapping%NUMBER_OF_DOMAIN_LOCAL=0
214 ALLOCATE(domain_mapping%NUMBER_OF_DOMAIN_GHOST(0:domain_mapping%NUMBER_OF_DOMAINS-1),stat=err)
215 IF(err/=0)
CALL flagerror(
"Could not allocate number of domain ghost.",err,error,*999)
217 domain_mapping%NUMBER_OF_DOMAIN_GHOST=0
222 ALLOCATE(adjacent_domains(0:domain_mapping%NUMBER_OF_DOMAINS-1,0:domain_mapping%NUMBER_OF_DOMAINS-1),stat=err)
223 IF(err/=0)
CALL flagerror(
"Could not allocate adjacent domains.",err,error,*999)
227 DO global_number=1,domain_mapping%NUMBER_OF_GLOBAL
231 DO domain_idx=2,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
232 domain_no=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(domain_idx)
234 my_domain_index=domain_idx
240 IF(my_domain_index/=1)
THEN 242 temp=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(1)
243 domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(1) = &
244 & domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(my_domain_index)
245 domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(my_domain_index) = temp
247 temp=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(1)
248 domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(1) = &
249 & domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(my_domain_index)
250 domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(my_domain_index) = temp
252 temp=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(1)
253 domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(1) = &
254 & domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(my_domain_index)
255 domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(my_domain_index) = temp
259 DO domain_idx=1,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
260 domain_no=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(domain_idx)
261 DO domain_idx2=1,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
262 domain_no2=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(domain_idx2)
263 adjacent_domains(domain_no,domain_no2)=1
268 DO domain_idx=1,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
269 domain_no=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(domain_idx)
270 local_type=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(domain_idx)
273 domain_mapping%NUMBER_OF_DOMAIN_GHOST(domain_no)=domain_mapping%NUMBER_OF_DOMAIN_GHOST(domain_no)+1
275 domain_mapping%NUMBER_OF_DOMAIN_LOCAL(domain_no)=domain_mapping%NUMBER_OF_DOMAIN_LOCAL(domain_no)+1
280 SELECT CASE(local_type)
282 number_internal=number_internal+1
284 number_boundary=number_boundary+1
286 number_ghost=number_ghost+1
288 local_error=
"The domain local type of "//
trim(
number_to_vstring(domain_mapping%GLOBAL_TO_LOCAL_MAP( &
289 & global_number)%LOCAL_TYPE(domain_idx),
"*",err,error))//
" is invalid." 290 CALL flagerror(local_error,err,error,*999)
298 number_of_adjacent_domains=0
299 total_number_of_adjacent_domains=0
300 DO domain_no=0,domain_mapping%NUMBER_OF_DOMAINS-1
301 DO domain_no2=0,domain_mapping%NUMBER_OF_DOMAINS-1
302 IF(domain_no/=domain_no2)
THEN 303 IF(adjacent_domains(domain_no,domain_no2)>0)
THEN 304 total_number_of_adjacent_domains=total_number_of_adjacent_domains+1
311 ALLOCATE(domain_mapping%ADJACENT_DOMAINS_PTR(0:domain_mapping%NUMBER_OF_DOMAINS),stat=err)
312 IF(err/=0)
CALL flagerror(
"Could not allocate adjacent domains ptr.",err,error,*999)
313 ALLOCATE(domain_mapping%ADJACENT_DOMAINS_LIST(total_number_of_adjacent_domains),stat=err)
314 IF(err/=0)
CALL flagerror(
"Could not allocate adjacent domains list.",err,error,*999)
319 DO domain_no=0,domain_mapping%NUMBER_OF_DOMAINS-1
320 domain_mapping%ADJACENT_DOMAINS_PTR(domain_no)=count
321 DO domain_no2=0,domain_mapping%NUMBER_OF_DOMAINS-1
322 IF(domain_no/=domain_no2)
THEN 323 IF(adjacent_domains(domain_no,domain_no2)>0)
THEN 324 domain_mapping%ADJACENT_DOMAINS_LIST(count)=domain_no2
331 domain_mapping%ADJACENT_DOMAINS_PTR(domain_mapping%NUMBER_OF_DOMAINS)=count
332 DEALLOCATE(adjacent_domains)
335 ALLOCATE(domain_mapping%DOMAIN_LIST(number_internal+number_boundary+number_ghost),stat=err)
336 IF(err/=0)
CALL flagerror(
"Could not allocate domain map domain list.",err,error,*999)
337 ALLOCATE(domain_mapping%LOCAL_TO_GLOBAL_MAP(number_internal+number_boundary+number_ghost),stat=err)
338 IF(err/=0)
CALL flagerror(
"Could not allocate domain map local to global list.",err,error,*999)
341 domain_mapping%TOTAL_NUMBER_OF_LOCAL=number_internal+number_boundary+number_ghost
342 domain_mapping%NUMBER_OF_LOCAL=number_internal+number_boundary
343 domain_mapping%NUMBER_OF_INTERNAL=number_internal
344 domain_mapping%NUMBER_OF_BOUNDARY=number_boundary
345 domain_mapping%NUMBER_OF_GHOST=number_ghost
346 domain_mapping%INTERNAL_START=1
347 domain_mapping%INTERNAL_FINISH=number_internal
348 domain_mapping%BOUNDARY_START=number_internal+1
349 domain_mapping%BOUNDARY_FINISH=number_internal+number_boundary
350 domain_mapping%GHOST_START=number_internal+number_boundary+1
351 domain_mapping%GHOST_FINISH=number_internal+number_boundary+number_ghost
354 ALLOCATE(domain_mapping%ADJACENT_DOMAINS(number_of_adjacent_domains),stat=err)
355 IF(err/=0)
CALL flagerror(
"Could not allocate adjacent domains.",err,error,*999)
356 domain_mapping%NUMBER_OF_ADJACENT_DOMAINS=number_of_adjacent_domains
359 ALLOCATE(adjacent_domain_map(0:domain_mapping%NUMBER_OF_DOMAINS-1),stat=err)
360 IF(err/=0)
CALL flagerror(
"Could not allocate adjacent domain map.",err,error,*999)
363 ALLOCATE(ghost_send_lists(domain_mapping%NUMBER_OF_ADJACENT_DOMAINS),stat=err)
364 IF(err/=0)
CALL flagerror(
"Could not allocate ghost send list.",err,error,*999)
367 ALLOCATE(ghost_receive_lists(domain_mapping%NUMBER_OF_ADJACENT_DOMAINS),stat=err)
368 IF(err/=0)
CALL flagerror(
"Could not allocate ghost recieve list.",err,error,*999)
372 DO domain_idx=1,domain_mapping%NUMBER_OF_ADJACENT_DOMAINS
381 domain_mapping%ADJACENT_DOMAINS(domain_idx)%DOMAIN_NUMBER=domain_no
382 adjacent_domain_map(domain_no)=domain_idx
385 NULLIFY(ghost_send_lists(domain_idx)%PTR)
388 CALL list_initial_size_set(ghost_send_lists(domain_idx)%PTR,max(domain_mapping%NUMBER_OF_GHOST,1),err,error,*999)
391 NULLIFY(ghost_receive_lists(domain_idx)%PTR)
394 CALL list_initial_size_set(ghost_receive_lists(domain_idx)%PTR,max(domain_mapping%NUMBER_OF_GHOST,1),err,error,*999)
403 DO global_number=1,domain_mapping%NUMBER_OF_GLOBAL
408 IF(domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS>1)
THEN 411 IF(domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS==domain_mapping%NUMBER_OF_DOMAINS)
THEN 415 DO domain_idx=1,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
416 local_type=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(domain_idx)
424 IF(.NOT.owned_by_all)
THEN 425 receive_from_domain=-1
428 DO domain_idx=1,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
429 domain_no=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(domain_idx)
430 local_type=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(domain_idx)
434 IF(receive_from_domain==-1)
THEN 435 receive_from_domain=domain_no
437 local_error=
"Invalid domain mapping. Global number "//
trim(
number_to_vstring(global_number,
"*",err,error))// &
440 CALL flagerror(local_error,err,error,*999)
445 IF(receive_from_domain==-1)
THEN 446 local_error=
"Invalid domain mapping. Global number "//
trim(
number_to_vstring(global_number,
"*",err,error))// &
447 &
" is not owned by any domain." 448 CALL flagerror(local_error,err,error,*999)
454 DO domain_idx=1,domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%NUMBER_OF_DOMAINS
455 domain_no=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%DOMAIN_NUMBER(domain_idx)
456 local_number=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(domain_idx)
457 local_type=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(domain_idx)
461 domain_mapping%LOCAL_TO_GLOBAL_MAP(local_number)=global_number
464 SELECT CASE(domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_TYPE(domain_idx))
466 number_internal=number_internal+1
467 domain_mapping%DOMAIN_LIST(number_internal)=local_number
469 number_boundary=number_boundary+1
470 domain_mapping%DOMAIN_LIST(domain_mapping%INTERNAL_FINISH+number_boundary)=local_number
472 number_ghost=number_ghost+1
473 domain_mapping%DOMAIN_LIST(domain_mapping%BOUNDARY_FINISH+number_ghost)=local_number
476 CALL list_item_add(ghost_receive_lists(adjacent_domain_map(receive_from_domain))%PTR,local_number,err,error,*999)
478 local_error=
"The domain local type of "//
trim(
number_to_vstring(domain_mapping%GLOBAL_TO_LOCAL_MAP( &
479 & global_number)%LOCAL_TYPE(domain_idx),
"*",err,error))//
" is invalid." 480 CALL flagerror(local_error,err,error,*999)
484 local_number2=domain_mapping%GLOBAL_TO_LOCAL_MAP(global_number)%LOCAL_NUMBER(1)
485 CALL list_item_add(ghost_send_lists(adjacent_domain_map(domain_no))%PTR,local_number2,err,error,*999)
491 DO domain_idx=1,domain_mapping%NUMBER_OF_ADJACENT_DOMAINS
497 ALLOCATE(domain_mapping%ADJACENT_DOMAINS(domain_idx)%LOCAL_GHOST_SEND_INDICES(number_of_ghost_send),stat=err)
498 IF(err/=0)
CALL flagerror(
"Could not allocate local ghost send inidices.",err,error,*999)
500 domain_mapping%ADJACENT_DOMAINS(domain_idx)%LOCAL_GHOST_SEND_INDICES(1:number_of_ghost_send)= &
501 & send_list(1:number_of_ghost_send)
503 domain_mapping%ADJACENT_DOMAINS(domain_idx)%NUMBER_OF_SEND_GHOSTS=number_of_ghost_send
504 DEALLOCATE(send_list)
508 CALL list_detach_and_destroy(ghost_receive_lists(domain_idx)%PTR,number_of_ghost_receive,receive_list,err,error,*999)
510 ALLOCATE(domain_mapping%ADJACENT_DOMAINS(domain_idx)%LOCAL_GHOST_RECEIVE_INDICES(number_of_ghost_receive),stat=err)
511 IF(err/=0)
CALL flagerror(
"Could not allocate local ghost receive inidices.",err,error,*999)
513 domain_mapping%ADJACENT_DOMAINS(domain_idx)%LOCAL_GHOST_RECEIVE_INDICES(1:number_of_ghost_receive)= &
514 & receive_list(1:number_of_ghost_receive)
516 domain_mapping%ADJACENT_DOMAINS(domain_idx)%NUMBER_OF_RECEIVE_GHOSTS=number_of_ghost_receive
517 DEALLOCATE(receive_list)
521 DEALLOCATE(adjacent_domain_map)
522 DEALLOCATE(ghost_send_lists)
523 DEALLOCATE(ghost_receive_lists)
534 & number_of_domain_local,
'(" Number of domain local :",8(X,I10))',
'(26X,8(X,I10))',err,error,*999)
536 & number_of_domain_ghost,
'(" Number of domain ghost :",8(X,I10))',
'(26X,8(X,I10))',err,error,*999)
548 & domain_mapping%DOMAIN_LIST,
'(" Internal list :",8(X,I10))',
'(19X,8(X,I10))',err,error,*999)
550 & domain_mapping%DOMAIN_LIST,
'(" Boundary list :",8(X,I10))',
'(19X,8(X,I10))',err,error,*999)
552 & domain_mapping%DOMAIN_LIST,
'(" Ghost list :",8(X,I10))',
'(19X,8(X,I10))',err,error,*999)
554 DO idx=1,domain_mapping%TOTAL_NUMBER_OF_LOCAL
560 DO idx=1,domain_mapping%NUMBER_OF_GLOBAL
563 & domain_mapping%GLOBAL_TO_LOCAL_MAP(idx)%NUMBER_OF_DOMAINS,err,error,*999)
565 & number_of_domains,8,8,domain_mapping%GLOBAL_TO_LOCAL_MAP(idx)%LOCAL_NUMBER, &
566 &
'(" Local number :",8(X,I10))',
'(21X,8(X,I10))',err,error,*999)
568 & number_of_domains,8,8,domain_mapping%GLOBAL_TO_LOCAL_MAP(idx)%DOMAIN_NUMBER, &
569 &
'(" Domain number :",8(X,I10))',
'(21X,8(X,I10))',err,error,*999)
571 & number_of_domains,8,8,domain_mapping%GLOBAL_TO_LOCAL_MAP(idx)%LOCAL_TYPE, &
572 &
'(" Local type :",8(X,I10))',
'(21X,8(X,I10))',err,error,*999)
576 & domain_mapping%NUMBER_OF_ADJACENT_DOMAINS,err,error,*999)
578 & domain_mapping%ADJACENT_DOMAINS_PTR,
'(" Adjacent domains ptr :",8(X,I5))',
'(27X,8(X,I5))',err,error,*999)
579 IF(domain_mapping%NUMBER_OF_ADJACENT_DOMAINS>0)
THEN 581 & domain_mapping%NUMBER_OF_DOMAINS)-1,8,8,domain_mapping%ADJACENT_DOMAINS_LIST, &
582 '(" Adjacent domains list :",8(X,I5))',
'(27X,8(X,I5))',err,error,*999)
583 DO domain_idx=1,domain_mapping%NUMBER_OF_ADJACENT_DOMAINS
586 & domain_mapping%ADJACENT_DOMAINS(domain_idx)%DOMAIN_NUMBER,err,error,*999)
588 & domain_mapping%ADJACENT_DOMAINS(domain_idx)%NUMBER_OF_SEND_GHOSTS,err,error,*999)
590 & number_of_send_ghosts,8,8,domain_mapping%ADJACENT_DOMAINS(domain_idx)%LOCAL_GHOST_SEND_INDICES, &
591 &
'(" Local send ghost indices :",8(X,I10))',
'(39X,8(X,I10))',err,error,*999)
593 & domain_mapping%ADJACENT_DOMAINS(domain_idx)%NUMBER_OF_RECEIVE_GHOSTS,err,error,*999)
595 & number_of_receive_ghosts,8,8,domain_mapping%ADJACENT_DOMAINS(domain_idx)%LOCAL_GHOST_RECEIVE_INDICES, &
596 &
'(" Local receive ghost indices :",8(X,I10))',
'(39X,8(X,I10))',err,error,*999)
602 CALL flagerror(
"Domain mapping is not associated.",err,error,*999)
605 exits(
"DOMAIN_MAPPINGS_LOCAL_FROM_GLOBAL_CALCULATE")
607 999
IF(
ALLOCATED(send_list))
DEALLOCATE(send_list)
608 IF(
ALLOCATED(receive_list))
DEALLOCATE(receive_list)
609 IF(
ALLOCATED(adjacent_domain_map))
DEALLOCATE(adjacent_domain_map)
610 IF(
ALLOCATED(adjacent_domains))
DEALLOCATE(adjacent_domains)
611 IF(
ALLOCATED(ghost_send_lists))
THEN 612 DO domain_idx=1,
SIZE(ghost_send_lists)
613 IF(
ASSOCIATED(ghost_send_lists(domain_idx)%PTR)) &
614 &
CALL list_destroy(ghost_send_lists(domain_idx)%PTR,dummy_err,dummy_error,*998)
616 998
DEALLOCATE(ghost_send_lists)
618 IF(
ALLOCATED(ghost_receive_lists))
THEN 619 DO domain_idx=1,
SIZE(ghost_receive_lists)
620 IF(
ASSOCIATED(ghost_receive_lists(domain_idx)%PTR)) &
621 &
CALL list_destroy(ghost_receive_lists(domain_idx)%PTR,dummy_err,dummy_error,*997)
623 997
DEALLOCATE(ghost_receive_lists)
625 errorsexits(
"DOMAIN_MAPPINGS_LOCAL_FROM_GLOBAL_CALCULATE",err,error)
639 INTEGER(INTG),
INTENT(OUT) :: ERR
644 enters(
"DOMAIN_MAPPINGS_MAPPING_FINALISE",err,error,*999)
646 IF(
ASSOCIATED(domain_mapping))
THEN 647 IF(
ALLOCATED(domain_mapping%NUMBER_OF_DOMAIN_LOCAL))
DEALLOCATE(domain_mapping%NUMBER_OF_DOMAIN_LOCAL)
648 IF(
ALLOCATED(domain_mapping%NUMBER_OF_DOMAIN_GHOST))
DEALLOCATE(domain_mapping%NUMBER_OF_DOMAIN_GHOST)
649 IF(
ALLOCATED(domain_mapping%DOMAIN_LIST))
DEALLOCATE(domain_mapping%DOMAIN_LIST)
650 IF(
ALLOCATED(domain_mapping%LOCAL_TO_GLOBAL_MAP))
DEALLOCATE(domain_mapping%LOCAL_TO_GLOBAL_MAP)
651 IF(
ALLOCATED(domain_mapping%GLOBAL_TO_LOCAL_MAP))
THEN 652 DO idx=1,
SIZE(domain_mapping%GLOBAL_TO_LOCAL_MAP,1)
655 DEALLOCATE(domain_mapping%GLOBAL_TO_LOCAL_MAP)
657 IF(
ALLOCATED(domain_mapping%ADJACENT_DOMAINS_PTR))
DEALLOCATE(domain_mapping%ADJACENT_DOMAINS_PTR)
658 IF(
ALLOCATED(domain_mapping%ADJACENT_DOMAINS_LIST))
DEALLOCATE(domain_mapping%ADJACENT_DOMAINS_LIST)
659 IF(
ALLOCATED(domain_mapping%ADJACENT_DOMAINS))
THEN 660 DO idx=1,
SIZE(domain_mapping%ADJACENT_DOMAINS,1)
663 DEALLOCATE(domain_mapping%ADJACENT_DOMAINS)
665 DEALLOCATE(domain_mapping)
668 exits(
"DOMAIN_MAPPINGS_MAPPING_FINALISE")
670 999 errorsexits(
"DOMAIN_MAPPINGS_MAPPING_FINALISE",err,error)
683 INTEGER(INTG),
INTENT(OUT) :: ERR
687 enters(
"DOMAIN_MAPPINGS_MAPPING_GLOBAL_FINALISE",err,error,*999)
689 IF(
ALLOCATED(mapping_global_map%LOCAL_NUMBER))
DEALLOCATE(mapping_global_map%LOCAL_NUMBER)
690 IF(
ALLOCATED(mapping_global_map%DOMAIN_NUMBER))
DEALLOCATE(mapping_global_map%DOMAIN_NUMBER)
691 IF(
ALLOCATED(mapping_global_map%LOCAL_TYPE))
DEALLOCATE(mapping_global_map%LOCAL_TYPE)
693 exits(
"DOMAIN_MAPPINGS_MAPPING_GLOBAL_FINALISE")
695 999 errorsexits(
"DOMAIN_MAPPINGS_MAPPING_GLOBAL_FINALISE",err,error)
709 INTEGER(INTG),
INTENT(OUT) :: ERR
713 enters(
"DOMAIN_MAPPINGS_MAPPING_GLOBAL_INITIALISE",err,error,*999)
715 mapping_global_map%NUMBER_OF_DOMAINS=0
717 exits(
"DOMAIN_MAPPINGS_MAPPING_GLOBAL_INITIALISE")
719 999 errorsexits(
"DOMAIN_MAPPINGS_MAPPING_GLOBAL_INITIALISE",err,error)
733 INTEGER(INTG),
INTENT(IN) :: NUMBER_OF_DOMAINS
734 INTEGER(INTG),
INTENT(OUT) :: ERR
739 enters(
"DOMAIN_MAPPINGS_MAPPING_INITIALISE",err,error,*999)
741 IF(
ASSOCIATED(domain_mapping))
THEN 742 IF(number_of_domains>0)
THEN 743 domain_mapping%TOTAL_NUMBER_OF_LOCAL=0
744 domain_mapping%NUMBER_OF_LOCAL=0
745 domain_mapping%NUMBER_OF_GLOBAL=0
746 domain_mapping%NUMBER_OF_DOMAINS=number_of_domains
747 domain_mapping%NUMBER_OF_INTERNAL=0
748 domain_mapping%NUMBER_OF_BOUNDARY=0
749 domain_mapping%NUMBER_OF_GHOST=0
750 domain_mapping%INTERNAL_START=0
751 domain_mapping%INTERNAL_FINISH=0
752 domain_mapping%BOUNDARY_START=0
753 domain_mapping%BOUNDARY_FINISH=0
754 domain_mapping%GHOST_START=0
755 domain_mapping%GHOST_FINISH=0
756 domain_mapping%NUMBER_OF_ADJACENT_DOMAINS=0
758 local_error=
"The specified number of domains of "//
trim(
number_to_vstring(number_of_domains,
"*",err,error))// &
759 &
" is invalid. The number of domains must be > 0." 760 CALL flagerror(local_error,err,error,*999)
764 exits(
"DOMAIN_MAPPINGS_MAPPING_INITIALISE")
766 999 errorsexits(
"DOMAIN_MAPPINGS_MAPPING_INITIALISE",err,error)
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
Converts a number to its equivalent varying string representation.
integer(intg), parameter, public domain_local_boundary
The domain item is on the boundary of the domain.
This module contains all string manipulation and transformation routines.
subroutine domain_mappings_mapping_global_finalise(MAPPING_GLOBAL_MAP, ERR, ERROR,)
Finalises the global mapping in the given domain mappings.
integer(intg), parameter, public list_intg_type
Integer data type for a list.
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
subroutine, public list_remove_duplicates(LIST, ERR, ERROR,)
Removes duplicate entries from a list. A side effect of this is that the list is sorted.
integer(intg), parameter, public domain_local_ghost
The domain item is ghosted from another domain.
Detaches the list values from a list and returns them as a pointer to a array of base type before des...
subroutine, public exits(NAME)
Records the exit out of the named procedure.
This module contains all type definitions in order to avoid cyclic module references.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
subroutine domain_mappings_adjacent_domain_finalise(ADJACENT_DOMAIN, ERR, ERROR,)
Finalises the adjacent domain and deallocates all memory for a domain mapping.
subroutine, public domain_mappings_local_from_global_calculate(DOMAIN_MAPPING, ERR, ERROR,)
Calculates the domain mappings local map from a domain mappings global map.
subroutine, public list_create_finish(LIST, ERR, ERROR,)
Finishes the creation of a list created with LIST_CREATE_START.
This module contains all computational environment variables.
This module handles all domain mappings routines.
integer(intg), save my_computational_node_number
The computational rank for this node.
type(computational_environment_type), target, public computational_environment
The computational environment the program is running in.
integer(intg), parameter, public domain_local_internal
The domain item is internal to the domain.
Contains the local information for a global mapping number for a domain mapping.
subroutine, public domain_mappings_mapping_initialise(DOMAIN_MAPPING, NUMBER_OF_DOMAINS, ERR, ERROR,)
Initialises the mapping for a domain mappings mapping.
Contains the information on an adjacent domain to a domain in a domain mapping.
logical, save, public diagnostics1
.TRUE. if level 1 diagnostic output is active in the current routine
subroutine, public domain_mappings_mapping_finalise(DOMAIN_MAPPING, ERR, ERROR,)
Finalises the mapping for a domain mappings mapping and deallocates all memory.
integer(intg), parameter, public diagnostic_output_type
Diagnostic output type.
subroutine, public domain_mappings_global_to_local_get(DOMAIN_MAPPING, GLOBAL_NUMBER, LOCAL_EXISTS, LOCAL_NUMBER, ERR, ERROR,)
Returns the local number, if it exists on the rank, for the specifed global number.
subroutine, public list_create_start(LIST, ERR, ERROR,)
Starts the creation of a list and returns a pointer to the created list.
Contains information on the domain mappings (i.e., local and global numberings).
Adds an item to the end of a list.
subroutine, public domain_mappings_mapping_global_initialise(MAPPING_GLOBAL_MAP, ERR, ERROR,)
Finalises the global mapping in the given domain mappings.
subroutine domain_mappings_adjacent_domain_initialise(ADJACENT_DOMAIN, ERR, ERROR,)
Initialise the adjacent domain for a domain mapping.
Implements lists of base types.
subroutine, public list_data_type_set(LIST, DATA_TYPE, ERR, ERROR,)
Sets/changes the data type for a list.
subroutine, public list_destroy(LIST, ERR, ERROR,)
Destroys a list.
Flags an error condition.
Buffer type to allow arrays of pointers to a list.
subroutine, public list_initial_size_set(LIST, INITIAL_SIZE, ERR, ERROR,)
Sets/changes the initial size for a list.
integer(intg) function, public computational_node_number_get(ERR, ERROR)
Returns the number/rank of the computational nodes.
This module contains all kind definitions.