39 |
|
|
40 |
_BEGIN_MASTER(myThid) |
_BEGIN_MASTER(myThid) |
41 |
|
|
42 |
|
WRITE(msgBuf,'(A,2(A,L5))') 'Enter INI_VERTICAL_GRID:', |
43 |
|
& ' setInterFDr=', setInterFDr, |
44 |
|
& ' ; setCenterDr=', setCenterDr |
45 |
|
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
46 |
|
& SQUEEZE_RIGHT, myThid ) |
47 |
|
|
48 |
C-- Set factors required for mixing pressure and meters as vertical coordinate. |
C-- Set factors required for mixing pressure and meters as vertical coordinate. |
49 |
C rkSign is a "sign" parameter which is used where the orientation of the vertical |
C rkSign is a "sign" parameter which is used where the orientation of the vertical |
50 |
C coordinate (pressure or meters) relative to the vertical index (k) is important. |
C coordinate (pressure or meters) relative to the vertical index (k) is important. |
56 |
gravitySign = 1. _d 0 |
gravitySign = 1. _d 0 |
57 |
ENDIF |
ENDIF |
58 |
|
|
59 |
IF ( .NOT.(setCenterDr.OR.setInterFDr) ) THEN |
IF ( .NOT.(setInterFDr.OR.setCenterDr) ) THEN |
60 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
61 |
& 'S/R INI_VERTICAL_GRID: neither delR nor delRc are defined' |
& 'S/R INI_VERTICAL_GRID: neither delR nor delRc are defined' |
62 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
63 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
64 |
& 'S/R INI_VERTICAL_GRID: Need at least 1 of the 2 (delR,delRc)' |
& 'S/R INI_VERTICAL_GRID: Need at least 1 of the 2 (delR,delRc)' |
65 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
66 |
STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID' |
STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID' |
67 |
ENDIF |
ENDIF |
68 |
|
|
69 |
C--- Set Level r-thickness (drF) and Center r-distances (drC) |
C--- Set Level r-thickness (drF) and Center r-distances (drC) |
70 |
|
|
71 |
IF (setInterFDr) THEN |
IF (setInterFDr) THEN |
72 |
C-- Interface r-distances are defined: |
C-- Interface r-distances are defined: |
73 |
DO k=1,Nr |
DO k=1,Nr |
74 |
drF(k) = delR(k) |
drF(k) = delR(k) |
75 |
ENDDO |
ENDDO |
76 |
C- Check that all thickness are > 0 : |
C- Check that all thickness are > 0 : |
77 |
DO k=1,Nr |
DO k=1,Nr |
78 |
IF (delR(k).LE.0.) THEN |
IF (delR(k).LE.0.) THEN |
79 |
WRITE(msgBuf,'(A,I4,A,E16.8)') |
WRITE(msgBuf,'(A,I4,A,E16.8)') |
80 |
& 'S/R INI_VERTICAL_GRID: delR(k=',k,' )=',delR(k) |
& 'S/R INI_VERTICAL_GRID: delR(k=',k,' )=',delR(k) |
81 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
82 |
WRITE(msgBuf,'(A)') |
WRITE(msgBuf,'(A)') |
83 |
& 'S/R INI_VERTICAL_GRID: Vert. grid spacing MUST BE > 0' |
& 'S/R INI_VERTICAL_GRID: Vert. grid spacing MUST BE > 0' |
84 |
CALL PRINT_ERROR( msgBuf, myThid ) |
CALL PRINT_ERROR( msgBuf, myThid ) |
85 |
STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID' |
STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID' |
86 |
ENDIF |
ENDIF |
87 |
ENDDO |
ENDDO |
88 |
ELSE |
ELSE |
89 |
C-- Interface r-distances undefined: |
C-- Interface r-distances undefined: |
90 |
C assume Interface at middle between 2 Center |
C assume Interface at middle between 2 Center |
91 |
drF(1) = delRc(1) |
drF(1) = delRc(1) |
92 |
DO k=2,Nr |
DO k=2,Nr |
93 |
drF(k-1) = 0.5 _d 0 *delRc(k) + drF(k-1) |
drF(k-1) = 0.5 _d 0 *delRc(k) + drF(k-1) |
94 |
drF( k ) = 0.5 _d 0 *delRc(k) |
drF( k ) = 0.5 _d 0 *delRc(k) |
95 |
ENDDO |
ENDDO |
96 |
drF(Nr) = delRc(Nr+1) + drF(Nr) |
drF(Nr) = delRc(Nr+1) + drF(Nr) |
97 |
ENDIF |
ENDIF |
162 |
recip_drF(k) = 1. _d 0/drF(k) |
recip_drF(k) = 1. _d 0/drF(k) |
163 |
ENDDO |
ENDDO |
164 |
|
|
165 |
|
C-- Calculate horizontal grid factor for the deep model (<=> dropping the |
166 |
|
C shallow atmosphere approximation): only function of the vertical index |
167 |
|
C- first: initialise deep-model grid factor: |
168 |
|
DO k=1,Nr |
169 |
|
deepFacC(k) = 1. _d 0 |
170 |
|
deepFac2C(k)= 1. _d 0 |
171 |
|
recip_deepFacC(k) = 1. _d 0 |
172 |
|
recip_deepFac2C(k)= 1. _d 0 |
173 |
|
ENDDO |
174 |
|
DO k=1,Nr+1 |
175 |
|
deepFacF(k) = 1. _d 0 |
176 |
|
deepFac2F(k)= 1. _d 0 |
177 |
|
recip_deepFacF(k) = 1. _d 0 |
178 |
|
recip_deepFac2F(k)= 1. _d 0 |
179 |
|
ENDDO |
180 |
|
IF ( deepAtmosphere ) THEN |
181 |
|
C- set deep-model grid factor: |
182 |
|
IF ( usingZCoords ) THEN |
183 |
|
DO k=1,Nr |
184 |
|
deepFacC(k) = (rSphere+rC(k))*recip_rSphere |
185 |
|
deepFac2C(k) = deepFacC(k)*deepFacC(k) |
186 |
|
ENDDO |
187 |
|
DO k=1,Nr+1 |
188 |
|
deepFacF(k) = (rSphere+rF(k))*recip_rSphere |
189 |
|
deepFac2F(k) = deepFacF(k)*deepFacF(k) |
190 |
|
ENDDO |
191 |
|
ELSE |
192 |
|
STOP 'INI_VERTICAL_GRID: setting deepFac is not coded' |
193 |
|
ENDIF |
194 |
|
C- set reciprocal of deep-model grid factor: |
195 |
|
DO k=1,Nr |
196 |
|
recip_deepFacC(k) = 1. _d 0/deepFacC(k) |
197 |
|
recip_deepFac2C(k)= 1. _d 0/deepFac2C(k) |
198 |
|
ENDDO |
199 |
|
DO k=1,Nr+1 |
200 |
|
recip_deepFacF(k) = 1. _d 0/deepFacF(k) |
201 |
|
recip_deepFac2F(k)= 1. _d 0/deepFac2F(k) |
202 |
|
ENDDO |
203 |
|
ENDIF |
204 |
|
|
205 |
_END_MASTER(myThid) |
_END_MASTER(myThid) |
206 |
_BARRIER |
_BARRIER |
207 |
|
|