1 |
mlosch |
1.3 |
C $Header: /u/gcmpack/MITgcm/pkg/shelfice/shelfice_update_masks.F,v 1.2 2008/09/12 14:07:02 jmc Exp $ |
2 |
mlosch |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "SHELFICE_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: SHELFICE_UPDATE_MASKS |
8 |
|
|
C !INTERFACE: |
9 |
jmc |
1.2 |
SUBROUTINE SHELFICE_UPDATE_MASKS( |
10 |
mlosch |
1.1 |
I rF, recip_drF, |
11 |
jmc |
1.2 |
U hFacC, |
12 |
mlosch |
1.1 |
I myThid ) |
13 |
|
|
C !DESCRIPTION: \bv |
14 |
|
|
C *==========================================================* |
15 |
|
|
C | SUBROUTINE SHELFICE_UPDATE_MASKS |
16 |
|
|
C | o modify topography factor hFacC according to ice shelf |
17 |
|
|
C | topography |
18 |
|
|
C *==========================================================* |
19 |
|
|
C \ev |
20 |
|
|
|
21 |
|
|
C !USES: |
22 |
|
|
IMPLICIT NONE |
23 |
|
|
C === Global variables === |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "EEPARAMS.h" |
26 |
|
|
#include "PARAMS.h" |
27 |
|
|
#ifdef ALLOW_SHELFICE |
28 |
|
|
# include "SHELFICE.h" |
29 |
|
|
#endif /* ALLOW_SHELFICE */ |
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 rF (1:Nr+1) |
38 |
|
|
_RS recip_drF (1:Nr) |
39 |
|
|
_RS hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy) |
40 |
|
|
INTEGER myThid |
41 |
|
|
|
42 |
|
|
#ifdef ALLOW_SHELFICE |
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 |
|
|
CEOP |
52 |
|
|
|
53 |
|
|
C initialize R_shelfIce |
54 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
55 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
56 |
jmc |
1.2 |
DO j=1-Oly,sNy+Oly |
57 |
|
|
DO i=1-Olx,sNx+Olx |
58 |
mlosch |
1.1 |
R_shelfIce(i,j,bi,bj) = 0. _d 0 |
59 |
|
|
ENDDO |
60 |
|
|
ENDDO |
61 |
|
|
ENDDO |
62 |
|
|
ENDDO |
63 |
jmc |
1.2 |
|
64 |
mlosch |
1.1 |
IF ( SHELFICEtopoFile .NE. ' ' ) THEN |
65 |
jmc |
1.2 |
_BARRIER |
66 |
mlosch |
1.1 |
C Read the shelfIce draught using the mid-level I/O pacakage read_write_rec |
67 |
|
|
C The 0 is the "iteration" argument. The 1 is the record number. |
68 |
|
|
CALL READ_REC_XY_RS( SHELFICEtopoFile, R_shelfIce, |
69 |
|
|
& 1, 0, myThid ) |
70 |
|
|
C Read the shelfIce draught using the mid-level I/O pacakage read_write_fld |
71 |
|
|
C The 0 is the "iteration" argument. The ' ' is an empty suffix |
72 |
jmc |
1.2 |
C CALL READ_FLD_XY_RS( SHELFICEtopoFile, ' ', R_shelfIce, |
73 |
mlosch |
1.1 |
C & 0, myThid ) |
74 |
|
|
ENDIF |
75 |
|
|
C- end setup R_shelfIce in the interior |
76 |
|
|
|
77 |
|
|
C- fill in the overlap (+ BARRIER): |
78 |
|
|
_EXCH_XY_R4(R_shelfIce, myThid ) |
79 |
|
|
|
80 |
|
|
C-- Calculate lopping factor hFacC : Remove part outside of the domain |
81 |
|
|
C taking into account the Reference (=at rest) Surface Position Ro_shelfIce |
82 |
|
|
DO bj=myByLo(myThid), myByHi(myThid) |
83 |
|
|
DO bi=myBxLo(myThid), myBxHi(myThid) |
84 |
|
|
|
85 |
|
|
C-- compute contributions of shelf ice to looping factors |
86 |
|
|
DO K=1, Nr |
87 |
|
|
hFacMnSz=max( hFacMin, min(hFacMinDr*recip_drF(k),1. _d 0) ) |
88 |
|
|
DO J=1-Oly,sNy+Oly |
89 |
|
|
DO I=1-Olx,sNx+Olx |
90 |
|
|
C o Non-dimensional distance between grid boundary and model surface |
91 |
|
|
hFacCtmp = (rF(k)-R_shelfIce(I,J,bi,bj))*recip_drF(K) |
92 |
|
|
C o Reduce the previous fraction : substract the outside part. |
93 |
|
|
hFacCtmp = hFacC(I,J,K,bi,bj) - max( hFacCtmp, 0. _d 0) |
94 |
|
|
C o set to zero if empty Column : |
95 |
|
|
hFacCtmp = max( hFacCtmp, 0. _d 0) |
96 |
|
|
C o Impose minimum fraction and/or size (dimensional) |
97 |
|
|
IF (hFacCtmp.LT.hFacMnSz) THEN |
98 |
|
|
IF (hFacCtmp.LT.hFacMnSz*0.5) THEN |
99 |
|
|
hFacC(I,J,K,bi,bj)=0. |
100 |
|
|
ELSE |
101 |
|
|
hFacC(I,J,K,bi,bj)=hFacMnSz |
102 |
|
|
ENDIF |
103 |
|
|
ELSE |
104 |
|
|
hFacC(I,J,K,bi,bj)=hFacCtmp |
105 |
|
|
ENDIF |
106 |
|
|
ENDDO |
107 |
|
|
ENDDO |
108 |
|
|
ENDDO |
109 |
|
|
C - end bi,bj loops. |
110 |
|
|
ENDDO |
111 |
|
|
ENDDO |
112 |
|
|
#endif /* ALLOW_SHELFICE */ |
113 |
|
|
|
114 |
|
|
|
115 |
|
|
RETURN |
116 |
|
|
END |