source: codes/icosagcm/devel/src/base/dimensions.f90 @ 856

Last change on this file since 856 was 856, checked in by dubos, 5 years ago

devel : towards Fortran driver for unstructured/LAM meshes

File size: 2.9 KB
Line 
1MODULE dimensions
2
3    INTEGER,SAVE :: iim
4!$OMP THREADPRIVATE(iim)
5    INTEGER,SAVE :: jjm
6!$OMP THREADPRIVATE(jjm)
7    INTEGER,SAVE :: ii_begin
8!$OMP THREADPRIVATE(ii_begin)
9    INTEGER,SAVE :: jj_begin
10!$OMP THREADPRIVATE(jj_begin)
11    INTEGER,SAVE :: ii_end
12!$OMP THREADPRIVATE(ii_end)
13    INTEGER,SAVE :: jj_end
14!$OMP THREADPRIVATE(jj_end)
15    INTEGER,SAVE :: ii_nb
16!$OMP THREADPRIVATE(ii_nb)
17    INTEGER,SAVE :: jj_nb
18!$OMP THREADPRIVATE(jj_nb)
19    INTEGER,SAVE :: ij_begin
20!$OMP THREADPRIVATE(ij_begin)
21    INTEGER,SAVE :: ij_end
22!$OMP THREADPRIVATE(ij_end)
23    INTEGER,SAVE :: ij_begin_ext
24!$OMP THREADPRIVATE(ij_begin_ext)
25    INTEGER,SAVE :: ij_end_ext
26!$OMP THREADPRIVATE(ij_end_ext)
27       
28    INTEGER,SAVE :: t_right
29!$OMP THREADPRIVATE(t_right)
30    INTEGER,SAVE :: t_rup
31!$OMP THREADPRIVATE(t_rup)
32    INTEGER,SAVE :: t_lup
33!$OMP THREADPRIVATE(t_lup)
34    INTEGER,SAVE :: t_left
35!$OMP THREADPRIVATE(t_left)
36    INTEGER,SAVE :: t_ldown
37!$OMP THREADPRIVATE(t_ldown)
38    INTEGER,SAVE :: t_rdown
39!$OMP THREADPRIVATE(t_rdown)
40
41    INTEGER,SAVE :: u_right
42!$OMP THREADPRIVATE(u_right)
43    INTEGER,SAVE :: u_rup
44!$OMP THREADPRIVATE(u_rup)
45    INTEGER,SAVE :: u_lup
46!$OMP THREADPRIVATE(u_lup)
47    INTEGER,SAVE :: u_left
48!$OMP THREADPRIVATE(u_left)
49    INTEGER,SAVE :: u_ldown
50!$OMP THREADPRIVATE(u_ldown)
51    INTEGER,SAVE :: u_rdown
52!$OMP THREADPRIVATE(u_rdown)
53
54    INTEGER,SAVE :: z_rup
55!$OMP THREADPRIVATE(z_rup)
56    INTEGER,SAVE :: z_up
57!$OMP THREADPRIVATE(z_up)
58    INTEGER,SAVE :: z_lup
59!$OMP THREADPRIVATE(z_lup)
60    INTEGER,SAVE :: z_ldown
61!$OMP THREADPRIVATE(z_ldown)
62    INTEGER,SAVE :: z_down
63!$OMP THREADPRIVATE(z_down)
64    INTEGER,SAVE :: z_rdown
65!$OMP THREADPRIVATE(z_rdown)
66
67    INTEGER,SAVE :: t_pos(6)
68!$OMP THREADPRIVATE(t_pos)
69    INTEGER,SAVE :: u_pos(6)
70!$OMP THREADPRIVATE(u_pos)
71    INTEGER,SAVE :: z_pos(6)
72!$OMP THREADPRIVATE(z_pos)
73       
74CONTAINS
75
76  SUBROUTINE swap_dimensions(ind)
77  USE domain_mod
78  IMPLICIT NONE
79    INTEGER,INTENT(IN) :: ind
80   
81    TYPE(t_domain),POINTER :: d
82
83    IF(.NOT. swap_needed) RETURN
84
85    d=>domain(ind)
86     
87     iim=d%iim
88     jjm=d%jjm
89     ii_begin=d%ii_begin
90     jj_begin=d%jj_begin
91     ii_end=d%ii_end
92     jj_end=d%jj_end
93     ii_nb=d%ii_nb
94     jj_nb=d%jj_nb
95   
96     ij_begin=(jj_begin-1)*iim+ii_begin
97     ij_end=(jj_end-1)*iim+ii_end 
98     ij_begin_ext=((jj_begin-1)-1)*iim+ii_begin-1
99     ij_end_ext = ((jj_end+1)-1)*iim+ii_end+1
100       
101     t_right=d%t_right
102     t_rup=d%t_rup
103     t_lup=d%t_lup
104     t_left=d%t_left
105     t_ldown=d%t_ldown
106     t_rdown=d%t_rdown
107
108     u_right=d%u_right
109     u_rup=d%u_rup
110     u_lup=d%u_lup
111     u_left=d%u_left
112     u_ldown=d%u_ldown
113     u_rdown=d%u_rdown
114
115     z_rup=d%z_rup
116     z_up=d%z_up
117     z_lup=d%z_lup
118     z_ldown=d%z_ldown
119     z_down=d%z_down
120     z_rdown=d%z_rdown
121     
122     t_pos(:)=d%t_pos(:)
123     u_pos(:)=d%u_pos(:)
124     z_pos(:)=d%z_pos(:)
125
126   END SUBROUTINE swap_dimensions
127   
128END MODULE dimensions   
129   
Note: See TracBrowser for help on using the repository browser.