/[MITgcm]/MITgcm/model/src/ini_curvilinear_grid.F
ViewVC logotype

Contents of /MITgcm/model/src/ini_curvilinear_grid.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Sun Jul 13 18:44:51 2003 UTC (20 years, 10 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52d_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52, checkpoint52f_post, checkpoint51f_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, checkpoint51s_post, checkpoint51j_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint52b_pre, checkpoint51l_pre, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint52f_pre, branchpoint-genmake2, checkpoint51r_post, checkpoint51i_post, checkpoint52d_post, checkpoint52a_pre, checkpoint52i_post, checkpoint51i_pre, checkpoint52h_pre, branch-netcdf, checkpoint51e_post, checkpoint51o_post, checkpoint51f_pre, checkpoint52a_post, checkpoint51g_post, ecco_c52_e35, checkpoint51m_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.5: +8 -16 lines
correct definition of dxV & dyU in the overlap (Cubed-Sphere).

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_curvilinear_grid.F,v 1.5 2001/12/06 16:36:13 adcroft Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_CURVILINEAR_GRID
8 C !INTERFACE:
9 SUBROUTINE INI_CURVILINEAR_GRID( myThid )
10 C !DESCRIPTION: \bv
11 C *==========================================================*
12 C | SUBROUTINE INI_CURVILINEAR_GRID
13 C | o Initialise curvilinear coordinate system
14 C *==========================================================*
15 C | Curvilinear grid settings are read from a file rather
16 C | than coded in-line as for cartesian and spherical polar.
17 C | This is more general but you have to create the grid
18 C | yourself.
19 C *==========================================================*
20 C \ev
21
22 C !USES:
23 IMPLICIT NONE
24 C === Global variables ===
25 #include "SIZE.h"
26 #include "EEPARAMS.h"
27 #include "PARAMS.h"
28 #include "GRID.h"
29
30 C !INPUT/OUTPUT PARAMETERS:
31 C == Routine arguments ==
32 C myThid - Number of this instance of INI_CARTESIAN_GRID
33 INTEGER myThid
34
35 C !LOCAL VARIABLES:
36 C == Local variables ==
37 INTEGER bi,bj
38 INTEGER I,J
39 CEOP
40
41 C-- Set everything to zero everywhere
42 DO bj = myByLo(myThid), myByHi(myThid)
43 DO bi = myBxLo(myThid), myBxHi(myThid)
44
45 DO J=1-Oly,sNy+Oly
46 DO I=1-Olx,sNx+Olx
47 XC(i,j,bi,bj)=0.
48 YC(i,j,bi,bj)=0.
49 XG(i,j,bi,bj)=0.
50 YG(i,j,bi,bj)=0.
51 DXC(i,j,bi,bj)=0.
52 DYC(i,j,bi,bj)=0.
53 DXG(i,j,bi,bj)=0.
54 DYG(i,j,bi,bj)=0.
55 DXF(i,j,bi,bj)=0.
56 DYF(i,j,bi,bj)=0.
57 DXV(i,j,bi,bj)=0.
58 DYU(i,j,bi,bj)=0.
59 RA(i,j,bi,bj)=0.
60 RAZ(i,j,bi,bj)=0.
61 RAW(i,j,bi,bj)=0.
62 RAS(i,j,bi,bj)=0.
63 tanPhiAtU(i,j,bi,bj)=0.
64 tanPhiAtV(i,j,bi,bj)=0.
65 cosFacU(J,bi,bj)=1.
66 cosFacV(J,bi,bj)=1.
67 sqcosFacU(J,bi,bj)=1.
68 sqcosFacV(J,bi,bj)=1.
69 ENDDO
70 ENDDO
71
72 ENDDO ! bi
73 ENDDO ! bj
74
75 C Here we make no assumptions about grid symmetry and simply
76 C read the raw grid data from files
77
78 C- Cell centered quantities
79 CALL MDSREADFIELD('LONC.bin',readBinaryPrec,'RS',1,XC, 1,myThid)
80 CALL MDSREADFIELD('LATC.bin',readBinaryPrec,'RS',1,YC, 1,myThid)
81 _EXCH_XY_R4(XC,myThid)
82 _EXCH_XY_R4(YC,myThid)
83
84 CALL MDSREADFIELD('DXF.bin',readBinaryPrec,'RS',1,DXF, 1,myThid)
85 CALL MDSREADFIELD('DYF.bin',readBinaryPrec,'RS',1,DYF, 1,myThid)
86 C !!! _EXCH_OUV_XY_R4(DXF, DYF, unSigned, myThid )
87 cs! this is not correct! <= need paired exchange for DXF,DYF
88 _EXCH_XY_R4(DXF,myThid)
89 _EXCH_XY_R4(DYF,myThid)
90 cs! fix overlaps:
91 DO bj = myByLo(myThid), myByHi(myThid)
92 DO bi = myBxLo(myThid), myBxHi(myThid)
93 DO j=1,sNy
94 DO i=1,Olx
95 DXF(1-i,j,bi,bj)=DXF(i,j,bi,bj)
96 DXF(sNx+i,j,bi,bj)=DXF(sNx+1-i,j,bi,bj)
97 DYF(1-i,j,bi,bj)=DYF(i,j,bi,bj)
98 DYF(sNx+i,j,bi,bj)=DYF(sNx+1-i,j,bi,bj)
99 ENDDO
100 ENDDO
101 DO j=1,Oly
102 DO i=1,sNx
103 DXF(i,1-j,bi,bj)=DXF(i,j,bi,bj)
104 DXF(i,sNy+j,bi,bj)=DXF(i,sNy+1-j,bi,bj)
105 DYF(i,1-j,bi,bj)=DYF(i,j,bi,bj)
106 DYF(i,sNy+j,bi,bj)=DYF(i,sNy+1-j,bi,bj)
107 ENDDO
108 ENDDO
109 ENDDO
110 ENDDO
111 cs
112
113 CALL MDSREADFIELD('RA.bin',readBinaryPrec,'RS',1,RA, 1,myThid)
114 _EXCH_XY_R4(RA,myThid )
115
116 C- Corner quantities
117 C *********** this are not degbugged ************
118 CALL MDSREADFIELD('LONG.bin',readBinaryPrec,'RS',1,XG, 1,myThid)
119 CALL MDSREADFIELD('LATG.bin',readBinaryPrec,'RS',1,YG, 1,myThid)
120 cs- this block needed by cubed sphere until we write more useful I/O routines
121 bi=3
122 bj=1
123 YG(1,sNy+1,bj,1)=YG(1,1,bi,1)
124 bj=bj+2
125 YG(1,sNy+1,bj,1)=YG(1,1,bi,1)
126 bj=bj+2
127 YG(1,sNy+1,bj,1)=YG(1,1,bi,1)
128 bi=6
129 bj=2
130 YG(sNx+1,1,bj,1)=YG(1,1,bi,1)
131 bj=bj+2
132 YG(sNx+1,1,bj,1)=YG(1,1,bi,1)
133 bj=bj+2
134 YG(sNx+1,1,bj,1)=YG(1,1,bi,1)
135 cs- end block
136 CALL EXCH_Z_XY_RS(XG,myThid)
137 CALL EXCH_Z_XY_RS(YG,myThid)
138
139 CALL MDSREADFIELD('DXV.bin',readBinaryPrec,'RS',1,DXV, 1,myThid)
140 CALL MDSREADFIELD('DYU.bin',readBinaryPrec,'RS',1,DYU, 1,myThid)
141 cs- this block needed by cubed sphere until we write more useful I/O routines
142 C !!! _EXCH_ZUV_XY_R4(DXV, DYU, unSigned, myThid)
143 cs! this is not correct <= need paired exchange for dxv,dyu
144 cs CALL EXCH_Z_XY_RS(DXV,myThid)
145 cs CALL EXCH_Z_XY_RS(DYU,myThid)
146 DO bj = myByLo(myThid), myByHi(myThid)
147 DO bi = myBxLo(myThid), myBxHi(myThid)
148 cs! fix overlaps:
149 DO j=1,sNy
150 DO i=1,Olx
151 DXV(1-i,j,bi,bj)=DXV(1+i,j,bi,bj)
152 DXV(sNx+i,j,bi,bj)=DXV(i,j,bi,bj)
153 DYU(1-i,j,bi,bj)=DYU(1+i,j,bi,bj)
154 DYU(sNx+i,j,bi,bj)=DYU(i,j,bi,bj)
155 ENDDO
156 ENDDO
157 DO j=1,Oly
158 DO i=1-Olx,sNx+Olx
159 DXV(i,1-j,bi,bj)=DXV(i,1+j,bi,bj)
160 DXV(i,sNy+j,bi,bj)=DXV(i,j,bi,bj)
161 DYU(i,1-j,bi,bj)=DYU(i,1+j,bi,bj)
162 DYU(i,sNy+j,bi,bj)=DYU(i,j,bi,bj)
163 ENDDO
164 ENDDO
165 ENDDO
166 ENDDO
167 cs- end block
168
169 CALL MDSREADFIELD('RAZ.bin',readBinaryPrec,'RS',1,RAZ, 1,myThid)
170 cs- this block needed by cubed sphere until we write more useful I/O routines
171 CALL EXCH_Z_XY_RS(RAZ , myThid )
172 DO bj = myByLo(myThid), myByHi(myThid)
173 DO bi = myBxLo(myThid), myBxHi(myThid)
174 RAZ(sNx+1,1,bi,bj)=RAZ(1,1,bi,bj)
175 RAZ(1,sNy+1,bi,bj)=RAZ(1,1,bi,bj)
176 ENDDO
177 ENDDO
178 cs- end block
179 CALL EXCH_Z_XY_RS(RAZ,myThid)
180
181 C- Staggered (u,v pairs) quantities
182 CALL MDSREADFIELD('DXC.bin',readBinaryPrec,'RS',1,DXC, 1,myThid)
183 CALL MDSREADFIELD('DYC.bin',readBinaryPrec,'RS',1,DYC, 1,myThid)
184 CALL EXCH_UV_XY_RS(DXC,DYC,.FALSE.,myThid)
185
186 CALL MDSREADFIELD('RAW.bin',readBinaryPrec,'RS',1,RAW, 1,myThid)
187 CALL MDSREADFIELD('RAS.bin',readBinaryPrec,'RS',1,RAS, 1,myThid)
188 cs- this block needed by cubed sphere until we write more useful I/O routines
189 DO bj = myByLo(myThid), myByHi(myThid)
190 DO bi = myBxLo(myThid), myBxHi(myThid)
191 DO J = 1,sNy
192 c RAW(sNx+1,J,bi,bj)=RAW(1,J,bi,bj)
193 c RAS(J,sNy+1,bi,bj)=RAS(J,1,bi,bj)
194 ENDDO
195 ENDDO
196 ENDDO
197 cs- end block
198 CALL EXCH_UV_XY_RS(RAW,RAS,.FALSE.,myThid)
199
200 CALL MDSREADFIELD('DXG.bin',readBinaryPrec,'RS',1,DXG, 1,myThid)
201 CALL MDSREADFIELD('DYG.bin',readBinaryPrec,'RS',1,DYG, 1,myThid)
202 cs- this block needed by cubed sphere until we write more useful I/O routines
203 DO bj = myByLo(myThid), myByHi(myThid)
204 DO bi = myBxLo(myThid), myBxHi(myThid)
205 DO J = 1,sNy
206 c DYG(sNx+1,J,bi,bj)=DYG(1,J,bi,bj)
207 c DXG(J,sNy+1,bi,bj)=DXG(J,1,bi,bj)
208 ENDDO
209 ENDDO
210 ENDDO
211 cs- end block
212 CALL EXCH_UV_XY_RS(DYG,DXG,.FALSE.,myThid)
213
214 c write(10) XC
215 c write(10) YC
216 c write(10) DXF
217 c write(10) DYF
218 c write(10) RA
219 c write(10) XG
220 c write(10) YG
221 c write(10) DXV
222 c write(10) DYU
223 c write(10) RAZ
224 c write(10) DXC
225 c write(10) DYC
226 c write(10) RAW
227 c write(10) RAS
228 c write(10) DXG
229 c write(10) DYG
230
231 RETURN
232 END

  ViewVC Help
Powered by ViewVC 1.1.22