/[MITgcm]/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_update_masks.F
ViewVC logotype

Annotation of /MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_update_masks.F

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


Revision 1.3 - (hide annotations) (download)
Tue Jan 26 10:49:13 2016 UTC (10 years, 9 months ago) by dgoldberg
Branch: MAIN
CVS Tags: checkpoint65v, checkpoint65u
Changes since 1.2: +2 -6 lines
Removed use of R_Grounding

1 dgoldberg 1.3 C $Header: /u/gcmpack/MITgcm_contrib/verification_other/shelfice_remeshing/code/shelfice_update_masks.F,v 1.2 2016/01/22 16:09:34 dgoldberg Exp $
2 dgoldberg 1.1 C $Name: $
3    
4     #include "SHELFICE_OPTIONS.h"
5     #ifdef ALLOW_CTRL
6     # include "CTRL_OPTIONS.h"
7     #endif
8    
9     CBOP
10     C !ROUTINE: SHELFICE_UPDATE_MASKS
11     C !INTERFACE:
12     SUBROUTINE SHELFICE_UPDATE_MASKS(
13     I rF, recip_drF,
14     U hFacC,
15     I myThid )
16     C !DESCRIPTION: \bv
17     C *==========================================================*
18     C | SUBROUTINE SHELFICE_UPDATE_MASKS
19     C | o modify topography factor hFacC according to ice shelf
20     C | topography
21     C *==========================================================*
22     C \ev
23    
24     C !USES:
25     IMPLICIT NONE
26     C === Global variables ===
27     #include "SIZE.h"
28     #include "EEPARAMS.h"
29     #include "PARAMS.h"
30     #ifdef ALLOW_SHELFICE
31     # include "SHELFICE.h"
32     #endif /* ALLOW_SHELFICE */
33    
34     C !INPUT/OUTPUT PARAMETERS:
35     C == Routine arguments ==
36     C rF :: R-coordinate of face of cell (units of r).
37     C recip_drF :: Recipricol of cell face separation along Z axis ( units of r ).
38     C hFacC :: Fraction of cell in vertical which is open (see GRID.h)
39     C myThid :: Number of this instance of SHELFICE_UPDATE_MASKS
40     _RS rF (1:Nr+1)
41     _RS recip_drF (1:Nr)
42     _RS hFacC (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:Nr,nSx,nSy)
43     INTEGER myThid
44    
45     #ifdef ALLOW_SHELFICE
46     C !LOCAL VARIABLES:
47     C == Local variables ==
48     C bi,bj :: tile indices
49     C I,J,K :: Loop counters
50     INTEGER bi, bj
51     INTEGER I, J, K
52     _RL hFacCtmp
53     _RL hFacMnSz
54     CEOP
55    
56     C initialize R_shelfIce
57     DO bj = myByLo(myThid), myByHi(myThid)
58     DO bi = myBxLo(myThid), myBxHi(myThid)
59     DO j=1-OLy,sNy+OLy
60     DO i=1-OLx,sNx+OLx
61     R_shelfIce(i,j,bi,bj) = 0. _d 0
62     ENDDO
63     ENDDO
64     ENDDO
65     ENDDO
66    
67     IF ( SHELFICEtopoFile .NE. ' ' ) THEN
68     _BARRIER
69     C Read the shelfIce draught using the mid-level I/O pacakage read_write_rec
70     C The 0 is the "iteration" argument. The 1 is the record number.
71     CALL READ_REC_XY_RS( SHELFICEtopoFile, R_shelfIce,
72     & 1, 0, myThid )
73    
74     C Read the shelfIce draught using the mid-level I/O pacakage read_write_fld
75     C The 0 is the "iteration" argument. The ' ' is an empty suffix
76     C CALL READ_FLD_XY_RS( SHELFICEtopoFile, ' ', R_shelfIce,
77     C & 0, myThid )
78     ENDIF
79     C- end setup R_shelfIce in the interior
80    
81     C- fill in the overlap (+ BARRIER):
82     _EXCH_XY_RS(R_shelfIce, myThid )
83 dgoldberg 1.3
84 dgoldberg 1.1
85     C-- Calculate lopping factor hFacC : Remove part outside of the domain
86     C taking into account the Reference (=at rest) Surface Position Ro_shelfIce
87     DO bj=myByLo(myThid), myByHi(myThid)
88     DO bi=myBxLo(myThid), myBxHi(myThid)
89    
90     C-- compute contributions of shelf ice to looping factors
91     DO K=1, Nr
92     hFacMnSz=max( hFacMin, min(hFacMinDr*recip_drF(k),1. _d 0) )
93     DO J=1-OLy,sNy+OLy
94     DO I=1-OLx,sNx+OLx
95     C o Non-dimensional distance between grid boundary and model surface
96     hFacCtmp = (rF(k)-R_shelfIce(I,J,bi,bj))*recip_drF(K)
97     C o Reduce the previous fraction : substract the outside part.
98     hFacCtmp = hFacC(I,J,K,bi,bj) - max( hFacCtmp, 0. _d 0)
99     C o set to zero if empty Column :
100     hFacCtmp = max( hFacCtmp, 0. _d 0)
101     C o Impose minimum fraction and/or size (dimensional)
102     IF (hFacCtmp.LT.hFacMnSz) THEN
103     IF (hFacCtmp.LT.hFacMnSz*0.5) THEN
104     hFacC(I,J,K,bi,bj)=0.
105     ELSE
106     hFacC(I,J,K,bi,bj)=hFacMnSz
107     ENDIF
108     ELSE
109     hFacC(I,J,K,bi,bj)=hFacCtmp
110     ENDIF
111     ENDDO
112     ENDDO
113     ENDDO
114    
115     #ifdef ALLOW_SHIFWFLX_CONTROL
116     C maskSHI is a hack to play along with the general ctrl-package
117     C infrastructure, where only the k=1 layer of a 3D mask is used
118     C for 2D fields. We cannot use maskInC instead, because routines
119     C like ctrl_get_gen and ctrl_set_unpack_xy require 3D masks.
120     DO K=1,Nr
121     DO J=1-OLy,sNy+OLy
122     DO I=1-OLx,sNx+OLx
123     maskSHI(I,J,K,bi,bj) = 0. _d 0
124     ENDDO
125     ENDDO
126     ENDDO
127     DO K=1,Nr
128     DO J=1-OLy,sNy+OLy
129     DO I=1-OLx,sNx+OLx
130     IF ( ABS(R_shelfice(I,J,bi,bj)) .GT. 0. _d 0
131     & .AND. hFacC(I,J,K,bi,bj) .NE. 0. _d 0 ) THEN
132     maskSHI(I,J,K,bi,bj) = 1. _d 0
133     maskSHI(I,J,1,bi,bj) = 1. _d 0
134     ENDIF
135     ENDDO
136     ENDDO
137     ENDDO
138     #endif /* ALLOW_SHIFWFLX_CONTROL */
139    
140     C - end bi,bj loops.
141     ENDDO
142     ENDDO
143     #endif /* ALLOW_SHELFICE */
144    
145     RETURN
146     END

  ViewVC Help
Powered by ViewVC 1.1.22