| 1 |
C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_dig_shelf.F,v 1.2 2016/05/05 18:16:04 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 |
C !LOCAL VARIABLES: |
| 43 |
C == Local variables == |
| 44 |
C bi,bj :: tile indices |
| 45 |
C I,J,K :: Loop counters |
| 46 |
INTEGER bi, bj |
| 47 |
INTEGER I, J, K |
| 48 |
_RL hFacCtmp |
| 49 |
_RL hFacMnSz |
| 50 |
_RL draft_west, draft_east, draft_south, draft_north |
| 51 |
_RS min_draft (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
| 52 |
INTEGER ktmp (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
| 53 |
CEOP |
| 54 |
|
| 55 |
DO bj = myByLo(myThid), myByHi(myThid) |
| 56 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 57 |
DO j=1-OLy,sNy+OLy |
| 58 |
DO i=1-OLx,sNx+OLx |
| 59 |
DO k= 1, Nr |
| 60 |
IF (hFacC(i,j,k,bi,bj).NE.0) THEN |
| 61 |
ktmp(i,j,bi,bj) = k |
| 62 |
ENDIF |
| 63 |
ENDDO |
| 64 |
ENDDO |
| 65 |
ENDDO |
| 66 |
ENDDO |
| 67 |
ENDDO |
| 68 |
|
| 69 |
DO bj = myByLo(myThid), myByHi(myThid) |
| 70 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 71 |
DO j=1-OLy+1,sNy+OLy-1 |
| 72 |
DO i=1-OLx,sNx+OLx |
| 73 |
|
| 74 |
R_MWCT(i,j,bi,bj) = 0. _d 0 |
| 75 |
|
| 76 |
ENDDO |
| 77 |
ENDDO |
| 78 |
ENDDO |
| 79 |
ENDDO |
| 80 |
|
| 81 |
! FIND MIN COL THICKNESS REGARDLESS OF NEIGHBORING CELLS |
| 82 |
|
| 83 |
DO bj = myByLo(myThid), myByHi(myThid) |
| 84 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 85 |
DO j=1-OLy,sNy+OLy |
| 86 |
DO i=1-OLx,sNx+OLx |
| 87 |
|
| 88 |
IF(maskInC(i,j,bi,bj).eq.1) THEN |
| 89 |
min_draft(i,j,bi,bj) = R_low(i,j,bi,bj) + |
| 90 |
& 2.*hfacmin*drF(ktmp(i,j,bi,bj)) |
| 91 |
ENDIF |
| 92 |
|
| 93 |
ENDDO |
| 94 |
ENDDO |
| 95 |
ENDDO |
| 96 |
ENDDO |
| 97 |
|
| 98 |
if (shelfice_dig_ice) then |
| 99 |
|
| 100 |
! NOW FIND MIN COL THICKNESS BASED ON U POINTS |
| 101 |
|
| 102 |
DO bj = myByLo(myThid), myByHi(myThid) |
| 103 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 104 |
DO j=1-OLy,sNy+OLy |
| 105 |
DO i=1-OLx+1,sNx+OLx-1 |
| 106 |
|
| 107 |
IF(maskInC(i,j,bi,bj).eq.1 .AND. |
| 108 |
& maskInC(i-1,j,bi,bj).eq.1) THEN |
| 109 |
|
| 110 |
draft_west = max ( |
| 111 |
& min_draft(i-1,j,bi,bj), |
| 112 |
& R_low(i,j,bi,bj) + hfacmin * drF(ktmp(i,j,bi,bj))) |
| 113 |
|
| 114 |
draft_east = max ( |
| 115 |
& min_draft(i,j,bi,bj), |
| 116 |
& R_low(i-1,j,bi,bj) + hfacmin * drF(ktmp(i-1,j,bi,bj))) |
| 117 |
|
| 118 |
min_draft(i-1,j,bi,bj) = max |
| 119 |
& (draft_west, min_draft(i-1,j,bi,bj)) |
| 120 |
|
| 121 |
min_draft(i,j,bi,bj) = max |
| 122 |
& (draft_east, min_draft(i,j,bi,bj)) |
| 123 |
|
| 124 |
ENDIF |
| 125 |
|
| 126 |
ENDDO |
| 127 |
ENDDO |
| 128 |
ENDDO |
| 129 |
ENDDO |
| 130 |
|
| 131 |
_EXCH_XY_RS(min_draft, myThid) |
| 132 |
|
| 133 |
! NOW FIND MIN COL THICKNESS BASED ON V POINTS |
| 134 |
|
| 135 |
DO bj = myByLo(myThid), myByHi(myThid) |
| 136 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 137 |
DO j=1-OLy+1,sNy+OLy-1 |
| 138 |
DO i=1-OLx,sNx+OLx |
| 139 |
|
| 140 |
IF(maskInC(i,j,bi,bj).eq.1 .AND. |
| 141 |
& maskInC(i,j-1,bi,bj).eq.1) THEN |
| 142 |
|
| 143 |
draft_south = max ( |
| 144 |
& min_draft(i,j-1,bi,bj), |
| 145 |
& R_low(i,j,bi,bj) + hfacmin * drF(ktmp(i,j,bi,bj))) |
| 146 |
|
| 147 |
draft_north = max ( |
| 148 |
& min_draft(i,j,bi,bj), |
| 149 |
& R_low(i,j-1,bi,bj) + hfacmin * drF(ktmp(i,j-1,bi,bj))) |
| 150 |
|
| 151 |
min_draft(i,j-1,bi,bj) = max |
| 152 |
& (draft_south, min_draft(i,j-1,bi,bj)) |
| 153 |
|
| 154 |
min_draft(i,j,bi,bj) = max |
| 155 |
& (draft_north, min_draft(i,j,bi,bj)) |
| 156 |
|
| 157 |
ENDIF |
| 158 |
|
| 159 |
ENDDO |
| 160 |
ENDDO |
| 161 |
ENDDO |
| 162 |
ENDDO |
| 163 |
|
| 164 |
_EXCH_XY_RS(min_draft, myThid) |
| 165 |
|
| 166 |
endif |
| 167 |
|
| 168 |
DO bj = myByLo(myThid), myByHi(myThid) |
| 169 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 170 |
DO j=1-OLy+1,sNy+OLy-1 |
| 171 |
DO i=1-OLx,sNx+OLx |
| 172 |
|
| 173 |
IF(maskInC(i,j,bi,bj).eq.1) THEN |
| 174 |
R_MWCT(i,j,bi,bj) = min_draft(i,j,bi,bj) - |
| 175 |
& R_low(i,j,bi,bj) |
| 176 |
ENDIF |
| 177 |
|
| 178 |
ENDDO |
| 179 |
ENDDO |
| 180 |
ENDDO |
| 181 |
ENDDO |
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
IF ( debugLevel .GE. debLevD ) THEN |
| 187 |
|
| 188 |
CALL WRITE_FLD_XY_RL ("ShelficeMinColThick","",R_MWCT,0,mythid) |
| 189 |
|
| 190 |
ENDIF |
| 191 |
|
| 192 |
|
| 193 |
#endif /* ALLOW_SHELFICE */ |
| 194 |
|
| 195 |
RETURN |
| 196 |
END |