The TELEMAC-MASCARET system  trunk
allspec.f
Go to the documentation of this file.
1 ! ******************
2  SUBROUTINE allspec
3 ! ******************
4 !
5  &(spec,nom)
6 !
7 !***********************************************************************
8 ! ARTEMIS V8P0 Jan 2019
9 !***********************************************************************
10 !
11 !brief ALLOCATES MEMORY FOR A SPECTRAL DATA STRUCTURE : SPEC.
12 !
13 !history N.DURAND (HRW)
14 !+ 09/03/01
15 !+
16 !+ Original
17 !
18 !history SRIRAM VENKATACHALAM (HRW)
19 !+ 13/08/08
20 !+
21 !+ Modified to be compatible with Artemis v5.8
22 !+ After executing allvec, the newer version will fill the arrays with
23 !+ huge numbers in order to check whether the array is initialised or
24 !+ not. Hence, we need to re-initialise the array with zeros.
25 !
26 !history N.DURAND (HRW)
27 !+ 20/06/14
28 !+ V7P0
29 !+ bief_allvec not used anymore as support is not MESH
30 !+ Streamlined for V7P0
31 !
32 !history N.DURAND (HRW)
33 !+ Feb 2017
34 !+ V7P2
35 !+ Updated for V7P2
36 !
37 !history N.DURAND (HRW)
38 !+ Jan 2019
39 !+ V8P0
40 !+ Tidied up
41 !
42 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43 !| SPEC |<--| STRUCTURE TO BE ALLOCATED
44 !| NOM |-->| NAME OF THE STRUCTURE SPECTRUM
45 !| OUTERMODEL |-->| IS THE STRUCTURE FOR THE OUTER MODEL OR ARTEMIS?
46 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47 !
48  USE bief
50 !
52  IMPLICIT NONE
53 !
54 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
55 !
56  TYPE(spectrum) , INTENT(INOUT) :: SPEC
57  CHARACTER(LEN=6) , INTENT(IN) :: NOM
58 !
59 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
60 !
61  INTEGER IERR
62  INTEGER I,II,JJ
63 !
64 !-----------------------------------------------------------------------
65 ! HEADER COMMON TO ALL OBJECTS IN SPEC
66 !-----------------------------------------------------------------------
67 !
68  spec%NAME = nom
69 !
70 ! NUMBER OF OBJECTS IN SPEC
71  spec%N = nspec
72 !
73 ! DIRECTION COMPONENTS IN SPEC
74 ! +1 TO CLOSE THE LOOP
75  ALLOCATE (spec%DIR(ndir+1),stat=ierr)
76  CALL check_allocate(ierr,'ALLSPEC:SPEC%DIR')
77  CALL ov('X=C ',spec%DIR,spec%DIR,spec%DIR,0.d0,ndir+1)
78 !
79 ! FREQUENCY COMPONENTS
80  ALLOCATE (spec%FRE(nf),stat=ierr)
81  CALL check_allocate(ierr,'ALLSPEC:SPEC%FRE')
82  CALL ov('X=C ',spec%FRE,spec%FRE,spec%FRE,0.d0,nf)
83 !
84 !_______________________________________________________________________
85 !
86 ! NODE NUMBER
87  ALLOCATE (spec%NOUTER(nspec),stat=ierr)
88  CALL check_allocate(ierr,'ALLSPEC:SPEC%NOUTER')
89  DO i=1,nspec
90  spec%NOUTER(i) = 0
91  ENDDO
92 ! X COORDINATE
93  ALLOCATE (spec%XOUTER(nspec),stat=ierr)
94  CALL check_allocate(ierr,'ALLSPEC:SPEC%XOUTER')
95  CALL ov
96  & ('X=C ',spec%XOUTER,spec%XOUTER,spec%XOUTER,0.d0,nspec)
97 ! Y COORDINATE
98  ALLOCATE (spec%YOUTER(nspec),stat=ierr)
99  CALL check_allocate(ierr,'ALLSPEC:SPEC%YOUTER')
100  CALL ov
101  & ('X=C ',spec%YOUTER,spec%YOUTER,spec%YOUTER,0.d0,nspec)
102 !
103 !-----------------------------------------------------------------------
104 ! ALLOCATES THE POINTERS ARRAY ADR
105 !-----------------------------------------------------------------------
106 !
107  ALLOCATE(spec%ADR(spec%N),stat=ierr)
108  CALL check_allocate(ierr,'ALLSPEC:SPEC%ADR')
109  WRITE(lu,*) 'SPECTRUM: ',nom,' ALLOCATED'
110 !
111 !_______________________________________________________________________
112 !
113  DO i=1,nspec
114  ALLOCATE(spec%ADR(i)%SOUTER(nf,ndir+1),stat=ierr)
115  CALL check_allocate(ierr,'ALLSPEC:SPEC%ADR(I)%SOUTER')
116  DO ii=1,nf
117  DO jj=1,ndir+1
118  spec%ADR(i)%SOUTER(ii,jj)=0.d0
119  ENDDO
120  ENDDO
121  ENDDO
122 !
123 !_______________________________________________________________________
124 !
125  RETURN
126  END
subroutine ov(OP, X, Y, Z, C, DIM1)
Definition: ov.f:7
subroutine allspec(SPEC, NOM)
Definition: allspec.f:7
Definition: bief.f:3