1 | ! |
---|
2 | ! $Id$ |
---|
3 | ! |
---|
4 | C Agrif (Adaptive Grid Refinement In Fortran) |
---|
5 | C |
---|
6 | C Copyright (C) 2003 Laurent Debreu (Laurent.Debreu@imag.fr) |
---|
7 | C Christophe Vouland (Christophe.Vouland@imag.fr) |
---|
8 | C |
---|
9 | C This program is free software; you can redistribute it and/or modify |
---|
10 | C it under the terms of the GNU General Public License as published by |
---|
11 | C the Free Software Foundation; either version 2 of the License, or |
---|
12 | C (at your option) any later version. |
---|
13 | C |
---|
14 | C This program is distributed in the hope that it will be useful, |
---|
15 | C but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | C GNU General Public License for more details. |
---|
18 | C |
---|
19 | C You should have received a copy of the GNU General Public License |
---|
20 | C along with this program; if not, write to the Free Software |
---|
21 | C Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
22 | C |
---|
23 | C |
---|
24 | C |
---|
25 | CCC Module Agrif_Init_Vars |
---|
26 | C |
---|
27 | Module Agrif_Init_Vars |
---|
28 | C |
---|
29 | CCC Description: |
---|
30 | CCC Initialization of the variables of the current grid. |
---|
31 | C |
---|
32 | C Modules used: |
---|
33 | C |
---|
34 | Use Agrif_Types |
---|
35 | Use Agrif_link |
---|
36 | C |
---|
37 | IMPLICIT NONE |
---|
38 | C |
---|
39 | Contains |
---|
40 | C Defininition of the procedures contained in this module |
---|
41 | C |
---|
42 | C |
---|
43 | C ************************************************************************** |
---|
44 | CCC Subroutine Agrif_Create_var |
---|
45 | C ************************************************************************** |
---|
46 | C |
---|
47 | Subroutine Agrif_Create_Var(Agrif_Gr) |
---|
48 | C |
---|
49 | CCC Description: |
---|
50 | CCC Allocation of the field "var" of the grid variables. |
---|
51 | CCC Fields "root_var", "nbdim" and "parent_var" of the grid variables. |
---|
52 | CCC Array "tabvars" of the current grid. |
---|
53 | C |
---|
54 | CC Method: |
---|
55 | C |
---|
56 | C Declarations: |
---|
57 | C |
---|
58 | |
---|
59 | C |
---|
60 | C Pointer argument: |
---|
61 | TYPE(Agrif_Grid),pointer :: Agrif_Gr ! Pointer on the current grid |
---|
62 | INTEGER :: nb |
---|
63 | C |
---|
64 | C Array "tabvars" of the current grid. |
---|
65 | C |
---|
66 | Allocate(Agrif_Gr % tabvars(Agrif_NbVariables)) |
---|
67 | C |
---|
68 | do nb = 1, Agrif_NbVariables |
---|
69 | Allocate(Agrif_Gr % tabvars(nb) % var) |
---|
70 | enddo |
---|
71 | |
---|
72 | C Fields "root_var", "nbdim" and "parent_var" of the grid variables. |
---|
73 | if (Agrif_Gr % fixedrank .NE.0) then |
---|
74 | do nb = 1, Agrif_NbVariables |
---|
75 | Agrif_Gr % tabvars(nb) % parent_var => |
---|
76 | & Agrif_Gr % parent %tabvars(nb) |
---|
77 | Agrif_Gr % tabvars(nb) % var % nbdim = |
---|
78 | & Agrif_Mygrid % tabvars(nb) % var % nbdim |
---|
79 | Agrif_Gr % tabvars(nb) % var % root_var => |
---|
80 | & Agrif_Mygrid % tabvars(nb) % var |
---|
81 | enddo |
---|
82 | endif |
---|
83 | C |
---|
84 | End Subroutine Agrif_Create_Var |
---|
85 | C |
---|
86 | C |
---|
87 | C ************************************************************************** |
---|
88 | CCC Subroutine Agrif_CreateVar |
---|
89 | C ************************************************************************** |
---|
90 | C |
---|
91 | Subroutine Agrif_CreateVar(Agrif_Gr) |
---|
92 | C |
---|
93 | CCC Description: |
---|
94 | CCC This subroutine allows to make a link between Mygrid and the current grid |
---|
95 | C |
---|
96 | C Modules used: |
---|
97 | C |
---|
98 | C |
---|
99 | C Declarations: |
---|
100 | C |
---|
101 | C |
---|
102 | C |
---|
103 | C Arguments |
---|
104 | C |
---|
105 | TYPE(Agrif_Grid),pointer :: Agrif_Gr ! Pointer on the current grid |
---|
106 | INTEGER :: i ! Loop |
---|
107 | C |
---|
108 | if (Agrif_Gr % fixedrank .NE. 0) then |
---|
109 | C |
---|
110 | do i = 1 , Agrif_NbVariables |
---|
111 | Agrif_Gr % tabvars(i) % parent_var => |
---|
112 | & Agrif_Gr % parent % tabvars(i) |
---|
113 | Agrif_Gr % tabvars(i) % var % root_var => |
---|
114 | & Agrif_Mygrid % tabvars(i) % var |
---|
115 | Agrif_Gr % tabvars(i) % var % nbdim = |
---|
116 | & Agrif_Gr % parent % tabvars(i) % var % nbdim |
---|
117 | enddo |
---|
118 | C |
---|
119 | endif |
---|
120 | C |
---|
121 | End Subroutine Agrif_CreateVar |
---|
122 | C |
---|
123 | C |
---|
124 | C |
---|
125 | End Module Agrif_Init_Vars |
---|