You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
! Adapted from : https://github.com/mapmeld/fortran-machine/blob/5e5e6bbdab353149047971a3f872238a2a4b716e/flibs-0.9/flibs/src/datastructures/queues.f90
2
+
3
+
! queues.f90 --
4
+
! Include file for defining queues with a fixed capacity
5
+
! Queues as implemented here are simply arrays where
6
+
! data are inserted at the end and retrieved from the
7
+
! top.
8
+
!
9
+
typeQUEUE_STRUCT
10
+
logical:: full
11
+
integer:: start
12
+
integer:: end
13
+
integer, dimension(:), pointer::data
14
+
endtype QUEUE_STRUCT
15
+
16
+
!
17
+
! Define the subroutines and functions
18
+
!
19
+
contains
20
+
21
+
! queue_create --
22
+
! Create and initialise a queue
23
+
! Arguments:
24
+
! queue Pointer to new queue
25
+
! capacity The number of data that can be stored
26
+
! Note:
27
+
! There is no check that the capacity is positive!
0 commit comments