1 |
dgoldberg |
1.1 |
C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_dig_shelf.F,v 1.3 2016/07/06 18:03:40 dgoldberg Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "SHELFICE_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
|
7 |
|
|
CBOP |
8 |
|
|
C !ROUTINE: SHELFICE_UPDATE_MASKS |
9 |
|
|
C !INTERFACE: |
10 |
|
|
SUBROUTINE SHELFICE_DIG_SHELF( |
11 |
|
|
I myThid ) |
12 |
|
|
C !DESCRIPTION: \bv |
13 |
|
|
C *==========================================================* |
14 |
|
|
C | SUBROUTINE SHELFICE_UPDATE_MASKS |
15 |
|
|
C | o modify topography factor hFacC according to ice shelf |
16 |
|
|
C | topography |
17 |
|
|
C *==========================================================* |
18 |
|
|
C \ev |
19 |
|
|
|
20 |
|
|
C !USES: |
21 |
|
|
IMPLICIT NONE |
22 |
|
|
C === Global variables === |
23 |
|
|
#include "SIZE.h" |
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "PARAMS.h" |
26 |
|
|
#ifdef ALLOW_SHELFICE |
27 |
|
|
# include "SHELFICE.h" |
28 |
|
|
#endif /* ALLOW_SHELFICE */ |
29 |
|
|
#include "GRID.h" |
30 |
|
|
|
31 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
32 |
|
|
C == Routine arguments == |
33 |
|
|
C rF :: R-coordinate of face of cell (units of r). |
34 |
|
|
C recip_drF :: Recipricol of cell face separation along Z axis ( units of r ). |
35 |
|
|
C hFacC :: Fraction of cell in vertical which is open (see GRID.h) |
36 |
|
|
C myThid :: Number of this instance of SHELFICE_UPDATE_MASKS |
37 |
|
|
! _RS recip_drF (1:Nr) |
38 |
|
|
! _RS hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
39 |
|
|
INTEGER myThid |
40 |
|
|
|
41 |
|
|
#ifdef ALLOW_SHELFICE |
42 |
|
|
#ifdef ALLOW_SHELFICE_GROUNDED_ICE |
43 |
|
|
C !LOCAL VARIABLES: |
44 |
|
|
C == Local variables == |
45 |
|
|
C bi,bj :: tile indices |
46 |
|
|
C I,J,K :: Loop counters |
47 |
|
|
INTEGER bi, bj |
48 |
|
|
INTEGER I, J, K |
49 |
|
|
_RL hFacCtmp |
50 |
|
|
_RL hFacMnSz |
51 |
|
|
_RL draft_west, draft_east, draft_south, draft_north |
52 |
|
|
_RS min_draft (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
53 |
|
|
INTEGER ktmp (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
54 |
|
|
CEOP |
55 |
|
|
|
56 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
57 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
58 |
|
|
DO j=1-OLy,sNy+OLy |
59 |
|
|
DO i=1-OLx,sNx+OLx |
60 |
|
|
DO k= 1, Nr |
61 |
|
|
IF (hFacC(i,j,k,bi,bj).NE.0) THEN |
62 |
|
|
ktmp(i,j,bi,bj) = k |
63 |
|
|
ENDIF |
64 |
|
|
ENDDO |
65 |
|
|
ENDDO |
66 |
|
|
ENDDO |
67 |
|
|
ENDDO |
68 |
|
|
ENDDO |
69 |
|
|
|
70 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
71 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
72 |
|
|
DO j=1-OLy+1,sNy+OLy-1 |
73 |
|
|
DO i=1-OLx,sNx+OLx |
74 |
|
|
|
75 |
|
|
R_MWCT(i,j,bi,bj) = 0. _d 0 |
76 |
|
|
|
77 |
|
|
ENDDO |
78 |
|
|
ENDDO |
79 |
|
|
ENDDO |
80 |
|
|
ENDDO |
81 |
|
|
|
82 |
|
|
! FIND MIN COL THICKNESS REGARDLESS OF NEIGHBORING CELLS |
83 |
|
|
|
84 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
85 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
86 |
|
|
DO j=1-OLy,sNy+OLy |
87 |
|
|
DO i=1-OLx,sNx+OLx |
88 |
|
|
|
89 |
|
|
IF(maskInC(i,j,bi,bj).eq.1) THEN |
90 |
|
|
min_draft(i,j,bi,bj) = R_low(i,j,bi,bj) + |
91 |
|
|
& 1.5*hfacmin*drF(ktmp(i,j,bi,bj)) |
92 |
|
|
ENDIF |
93 |
|
|
|
94 |
|
|
ENDDO |
95 |
|
|
ENDDO |
96 |
|
|
ENDDO |
97 |
|
|
ENDDO |
98 |
|
|
|
99 |
|
|
if (shelfice_dig_ice) then |
100 |
|
|
|
101 |
|
|
! NOW FIND MIN COL THICKNESS BASED ON U POINTS |
102 |
|
|
|
103 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
104 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
105 |
|
|
DO j=1-OLy,sNy+OLy |
106 |
|
|
DO i=1-OLx+1,sNx+OLx-1 |
107 |
|
|
|
108 |
|
|
IF(maskInC(i,j,bi,bj).eq.1 .AND. |
109 |
|
|
& maskInC(i-1,j,bi,bj).eq.1) THEN |
110 |
|
|
|
111 |
|
|
draft_west = max ( |
112 |
|
|
& min_draft(i-1,j,bi,bj), |
113 |
|
|
& R_low(i,j,bi,bj) + hfacmin * drF(ktmp(i,j,bi,bj))) |
114 |
|
|
|
115 |
|
|
draft_east = max ( |
116 |
|
|
& min_draft(i,j,bi,bj), |
117 |
|
|
& R_low(i-1,j,bi,bj) + hfacmin * drF(ktmp(i-1,j,bi,bj))) |
118 |
|
|
|
119 |
|
|
min_draft(i-1,j,bi,bj) = max |
120 |
|
|
& (draft_west, min_draft(i-1,j,bi,bj)) |
121 |
|
|
|
122 |
|
|
min_draft(i,j,bi,bj) = max |
123 |
|
|
& (draft_east, min_draft(i,j,bi,bj)) |
124 |
|
|
|
125 |
|
|
ENDIF |
126 |
|
|
|
127 |
|
|
ENDDO |
128 |
|
|
ENDDO |
129 |
|
|
ENDDO |
130 |
|
|
ENDDO |
131 |
|
|
|
132 |
|
|
_EXCH_XY_RS(min_draft, myThid) |
133 |
|
|
|
134 |
|
|
! NOW FIND MIN COL THICKNESS BASED ON V POINTS |
135 |
|
|
|
136 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
137 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
138 |
|
|
DO j=1-OLy+1,sNy+OLy-1 |
139 |
|
|
DO i=1-OLx,sNx+OLx |
140 |
|
|
|
141 |
|
|
IF(maskInC(i,j,bi,bj).eq.1 .AND. |
142 |
|
|
& maskInC(i,j-1,bi,bj).eq.1) THEN |
143 |
|
|
|
144 |
|
|
draft_south = max ( |
145 |
|
|
& min_draft(i,j-1,bi,bj), |
146 |
|
|
& R_low(i,j,bi,bj) + hfacmin * drF(ktmp(i,j,bi,bj))) |
147 |
|
|
|
148 |
|
|
draft_north = max ( |
149 |
|
|
& min_draft(i,j,bi,bj), |
150 |
|
|
& R_low(i,j-1,bi,bj) + hfacmin * drF(ktmp(i,j-1,bi,bj))) |
151 |
|
|
|
152 |
|
|
min_draft(i,j-1,bi,bj) = max |
153 |
|
|
& (draft_south, min_draft(i,j-1,bi,bj)) |
154 |
|
|
|
155 |
|
|
min_draft(i,j,bi,bj) = max |
156 |
|
|
& (draft_north, min_draft(i,j,bi,bj)) |
157 |
|
|
|
158 |
|
|
ENDIF |
159 |
|
|
|
160 |
|
|
ENDDO |
161 |
|
|
ENDDO |
162 |
|
|
ENDDO |
163 |
|
|
ENDDO |
164 |
|
|
|
165 |
|
|
_EXCH_XY_RS(min_draft, myThid) |
166 |
|
|
|
167 |
|
|
endif |
168 |
|
|
|
169 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
170 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
171 |
|
|
DO j=1-OLy+1,sNy+OLy-1 |
172 |
|
|
DO i=1-OLx,sNx+OLx |
173 |
|
|
|
174 |
|
|
IF(maskInC(i,j,bi,bj).eq.1) THEN |
175 |
|
|
R_MWCT(i,j,bi,bj) = min_draft(i,j,bi,bj) - |
176 |
|
|
& R_low(i,j,bi,bj) |
177 |
|
|
ENDIF |
178 |
|
|
|
179 |
|
|
ENDDO |
180 |
|
|
ENDDO |
181 |
|
|
ENDDO |
182 |
|
|
ENDDO |
183 |
|
|
|
184 |
|
|
|
185 |
|
|
|
186 |
|
|
|
187 |
|
|
IF ( debugLevel .GE. debLevD ) THEN |
188 |
|
|
|
189 |
|
|
CALL WRITE_FLD_XY_RL ("ShelficeMinColThick","",R_MWCT,0,mythid) |
190 |
|
|
|
191 |
|
|
ENDIF |
192 |
|
|
|
193 |
|
|
#endif /* GROUNDED_ICE */ |
194 |
|
|
#endif /* ALLOW_SHELFICE */ |
195 |
|
|
|
196 |
|
|
RETURN |
197 |
|
|
END |