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

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

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


Revision 1.21 - (show annotations) (download)
Wed Jan 26 00:45:53 2005 UTC (19 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57g_pre, checkpoint57s_post, checkpoint57g_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint57n_post, checkpoint57l_post, checkpoint57t_post, checkpoint57v_post, checkpoint57f_post, checkpoint57h_pre, checkpoint57h_post, checkpoint57c_post, checkpoint57c_pre, checkpoint57e_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, eckpoint57e_pre, checkpoint57h_done, checkpoint57j_post, checkpoint57f_pre, checkpoint57o_post, checkpoint57k_post, checkpoint57w_post
Changes since 1.20: +40 -13 lines
comment out the k loops ; add code to read from files (but never used)

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_cori.F,v 1.20 2004/10/13 04:37:37 edhill Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: INI_CORI
9
10 C !INTERFACE:
11 SUBROUTINE INI_CORI( myThid )
12 C !DESCRIPTION:
13 C Initialise coriolis term.
14
15 C !USES:
16 IMPLICIT NONE
17 #include "SIZE.h"
18 #include "EEPARAMS.h"
19 #include "PARAMS.h"
20 #ifdef ALLOW_MNC
21 #include "MNC_PARAMS.h"
22 #endif
23 #include "GRID.h"
24 #include "DYNVARS.h"
25 #ifdef ALLOW_MONITOR
26 #include "MONITOR.h"
27 #endif
28
29 C !INPUT/OUTPUT PARAMETERS:
30 INTEGER myThid
31 CEOP
32
33 C !LOCAL VARIABLES:
34 C bi,bj - Loop counters
35 C I,J,K
36 C facGrid - Factor for grid to meter conversion
37 INTEGER bi, bj
38 INTEGER I, J, K
39 _RL facGrid
40
41 C Initialise coriolis parameter
42 IF ( useConstantF ) THEN
43 C Constant F case
44 DO bj = myByLo(myThid), myByHi(myThid)
45 DO bi = myBxLo(myThid), myBxHi(myThid)
46 c DO K=1,Nr
47 DO J=1-Oly,sNy+Oly
48 DO I=1-Olx,sNx+Olx
49 fCori(i,j,bi,bj)=f0
50 fCoriG(i,j,bi,bj)=f0
51 fCoriCos(i,j,bi,bj)=0.
52 ENDDO
53 ENDDO
54 c ENDDO
55 ENDDO
56 ENDDO
57 ELSEIF ( useBetaPlaneF ) THEN
58 C Beta plane case
59 facGrid = 1. _d 0
60 IF ( usingSphericalPolarGrid ) facGrid = deg2rad*rSphere
61 DO bj = myByLo(myThid), myByHi(myThid)
62 DO bi = myBxLo(myThid), myBxHi(myThid)
63 c DO K=1,Nr
64 DO J=1-Oly,sNy+Oly
65 DO I=1-Olx,sNx+Olx
66 fCori(i,j,bi,bj)=f0+beta*_yC(i,j,bi,bj)*facGrid
67 fCoriG(i,j,bi,bj)=f0+beta*yG(i,j,bi,bj)*facGrid
68 fCoriCos(i,j,bi,bj)=0.
69 ENDDO
70 ENDDO
71 c ENDDO
72 ENDDO
73 ENDDO
74 ELSEIF ( useSphereF ) THEN
75 C Spherical case
76 C Note in this case we assume yC is in degrees.
77 DO bj = myByLo(myThid), myByHi(myThid)
78 DO bi = myBxLo(myThid), myBxHi(myThid)
79 c DO K=1,Nr
80 DO J=1-Oly,sNy+Oly
81 DO I=1-Olx,sNx+Olx
82 fCori(i,j,bi,bj)=
83 & 2. _d 0*omega*sin(_yC(i,j,bi,bj)*deg2rad)
84 fCoriG(i,j,bi,bj)=
85 & 2. _d 0*omega*sin(yG(i,j,bi,bj)*deg2rad)
86 fCoriCos(i,j,bi,bj)=
87 & 2. _d 0*omega*cos(_yC(i,j,bi,bj)*deg2rad)
88 ENDDO
89 ENDDO
90 c ENDDO
91 ENDDO
92 ENDDO
93 c CALL WRITE_FLD_XY_RL('fCoriC',' ',fCori , 0,myThid)
94 c CALL WRITE_FLD_XY_RL('fCoriG',' ',fCoriG , 0,myThid)
95 c CALL WRITE_FLD_XY_RL('fCorCs',' ',fCoriCos,0,myThid)
96 ELSE
97 C Special custom form
98 DO bj = myByLo(myThid), myByHi(myThid)
99 DO bi = myBxLo(myThid), myBxHi(myThid)
100 c DO K=1,Nr
101 DO J=1-Oly,sNy+Oly
102 DO I=1-Olx,sNx+Olx
103 fCori(i,j,bi,bj)=0.
104 fCoriG(i,j,bi,bj)=0.
105 fCoriCos(i,j,bi,bj)=0.
106 ENDDO
107 ENDDO
108 c ENDDO
109 ENDDO
110 ENDDO
111 CALL READ_REC_XY_RS( 'fCoriC.bin', fCori, 1, 0, myThid )
112 CALL READ_REC_XY_RS( 'fCoriG.bin', fCoriG, 1, 0, myThid )
113 CALL READ_REC_XY_RS( 'fCorCs.bin', fCoriCos,1, 0, myThid )
114 IF ( useCubedSphereExchange ) THEN
115 C- deal with the 2 missing corners (for fCoriG):
116 DO bj = myByLo(myThid), myByHi(myThid)
117 DO bi = myBxLo(myThid), myBxHi(myThid)
118 C- Notes: this will only works with 6 tiles (1 per face) and
119 C with 2 polar faces + 4 equatorials:
120 IF (bi.LE.3 .OR. bi.GE.5) THEN
121 fCoriG(sNx+1,1,bi,bj) = fCoriG(1,1,bi,bj)
122 ELSE
123 fCoriG(sNx+1,1,bi,bj) = -fCoriG(1,1,bi,bj)
124 ENDIF
125 IF (bi.GE.3) THEN
126 fCoriG(1,sNy+1,bi,bj) = fCoriG(1,1,bi,bj)
127 fCoriG(sNx+1,sNy+1,bi,bj) = fCoriG(sNx+1,1,bi,bj)
128 ELSE
129 fCoriG(1,sNy+1,bi,bj) = -fCoriG(1,1,bi,bj)
130 fCoriG(sNx+1,sNy+1,bi,bj) = -fCoriG(sNx+1,1,bi,bj)
131 ENDIF
132 ENDDO
133 ENDDO
134 ENDIF
135
136 _EXCH_XY_R4(fCori,myThid)
137 CALL EXCH_Z_XY_RS(fCoriG,myThid)
138 _EXCH_XY_R4(fCoriCos,myThid)
139 ENDIF
140
141 #ifdef ALLOW_MONITOR
142 mon_write_stdout = .FALSE.
143 mon_write_mnc = .FALSE.
144 IF (monitor_stdio) THEN
145 mon_write_stdout = .TRUE.
146 ENDIF
147
148 #ifdef ALLOW_MNC
149 IF (useMNC .AND. monitor_mnc) THEN
150 DO i = 1,MAX_LEN_MBUF
151 mon_fname(i:i) = ' '
152 ENDDO
153 mon_fname(1:12) = 'monitor_grid'
154 CALL MNC_CW_SET_UDIM(mon_fname, 1, myThid)
155 mon_write_mnc = .TRUE.
156 ENDIF
157 #endif /* ALLOW_MNC */
158
159 CALL MON_PRINTSTATS_RS(1,fCori,'fCori',myThid)
160 CALL MON_PRINTSTATS_RS(1,fCoriG,'fCoriG',myThid)
161 CALL MON_PRINTSTATS_RS(1,fCoriCos,'fCoriCos',myThid)
162
163 mon_write_stdout = .FALSE.
164 mon_write_mnc = .FALSE.
165 #endif
166
167 RETURN
168 END

  ViewVC Help
Powered by ViewVC 1.1.22