OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
inter_check_sort.F File Reference
#include "implicit_f.inc"
#include "com04_c.inc"
#include "com08_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine inter_check_sort (itask, need_to_sort, nbintc, intlist, ipari, nsensor, intbuf_tab, sensor_tab, nb_inter_sorted, list_inter_sorted, inter_struct)

Function/Subroutine Documentation

◆ inter_check_sort()

subroutine inter_check_sort ( integer, intent(in) itask,
integer, intent(inout) need_to_sort,
integer, intent(in) nbintc,
integer, dimension(nbintc), intent(in) intlist,
integer, dimension(npari,ninter), intent(in) ipari,
integer, intent(in) nsensor,
type(intbuf_struct_), dimension(ninter) intbuf_tab,
type (sensor_str_), dimension(nsensor) sensor_tab,
integer, intent(inout) nb_inter_sorted,
integer, dimension(nbintc), intent(inout) list_inter_sorted,
type(inter_struct_type), dimension(ninter), intent(inout) inter_struct )

Definition at line 32 of file inter_check_sort.F.

35!$COMMENT
36! INTER_CHECK_SORT description
37! check if a interface must be sorted
38!
39! INTER_CHECK_SORT organization :
40! loop over the NBINTC interfaces and if
41! * dist < 0 & t_start < current time < t_stop --> must be sorted
42!$ENDCOMMENT
43C-----------------------------------------------
44C M o d u l e s
45C-----------------------------------------------
46 USE intbufdef_mod
48 USE sensor_mod
49C-----------------------------------------------
50C I m p l i c i t T y p e s
51C-----------------------------------------------
52#include "implicit_f.inc"
53C-----------------------------------------------
54C C o m m o n B l o c k s
55C-----------------------------------------------
56#include "com04_c.inc"
57#include "com08_c.inc"
58#include "param_c.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 INTEGER, INTENT(in) :: ITASK ! omp task id
63 INTEGER, INTENT(inout) :: NEED_TO_SORT ! 1 if one or more interfaces must be sorted
64 INTEGER, INTENT(in) :: NBINTC ! number of interface which are not TYPE2
65 INTEGER, INTENT(in) :: NSENSOR
66 INTEGER, DIMENSION(NBINTC), INTENT(in) :: INTLIST ! interface id
67 INTEGER, INTENT(inout) :: NB_INTER_SORTED ! number of interfaces that need to be sorted
68 INTEGER, DIMENSION(NBINTC), INTENT(inout) :: LIST_INTER_SORTED ! list of interfaces that need to be sorted
69 INTEGER, DIMENSION(NPARI,NINTER), INTENT(in) :: IPARI ! interface data
70 TYPE(INTBUF_STRUCT_),DIMENSION(NINTER) :: INTBUF_TAB ! interface data
71 TYPE(inter_struct_type), DIMENSION(NINTER), INTENT(inout) :: INTER_STRUCT ! structure for interface
72 TYPE (SENSOR_STR_) ,DIMENSION(NSENSOR) :: SENSOR_TAB
73C-----------------------------------------------
74C L o c a l V a r i a b l e s
75C-----------------------------------------------
76 INTEGER :: NTY,INACTI,ISENS
77 my_real :: ts,startt,stopt,dist
78 LOGICAL TYPE18
79 LOGICAL :: IS_SORTING_NEEDED
80 INTEGER :: KK,N
81! ----------------------------------------
82 nb_inter_sorted = 0
83 ! --------------------------
84 ! loop over the interface
85 DO kk=1,nbintc
86 ! find the interface type
87 n = intlist(kk)
88 nty = ipari(7,n)
89 inacti = ipari(22,n)
90 type18=.false.
91 IF(nty==7 .AND. inacti==7)type18=.true.
92
93 isens = 0
94 IF(nty == 7.OR.nty == 11.OR.nty == 24.OR.nty == 25) isens = ipari(64,n)
95 IF (isens > 0) THEN ! IF INTERFACE IS ACTIVATED BY SENSOR
96 ts = sensor_tab(isens)%TSTART
97 ELSE
98 ts = tt
99 ENDIF
100 is_sorting_needed=.false.
101 ! ------------------------
102 ! interface type 7
103 IF( (nty == 7.AND.tt>=ts).AND.(.NOT.type18) )THEN
104 ! check if the interface must be sorted (dist + t_start + t_stop)
105 dist = intbuf_tab(n)%VARIABLES(distance_index)
106 IF (dist<=zero) is_sorting_needed = .true.
107 startt=intbuf_tab(n)%VARIABLES(t_start_index)
108 stopt =intbuf_tab(n)%VARIABLES(t_stop_index)
109
110 IF(is_sorting_needed) THEN
111 IF(startt>tt) is_sorting_needed = .false.
112 ENDIF
113
114 IF(is_sorting_needed) THEN
115 IF(tt>stopt) is_sorting_needed = .false.
116 ENDIF
117 ! the current interface must be sorted --> IS_SORTING_NEEDED=true
118 IF (is_sorting_needed) THEN
119 IF(itask==0) need_to_sort = 1
120 nb_inter_sorted = nb_inter_sorted + 1
121 list_inter_sorted(nb_inter_sorted) = n
122 IF(itask==0) inter_struct(n)%CURV_MAX_MAX = zero
123 ENDIF
124 ENDIF
125 ! ------------------------
126 ENDDO
127 ! --------------------------
128 RETURN
#define my_real
Definition cppsort.cpp:32