source: issm/trunk/test/MITgcm/code_4003/shelfice_step_icemass.F@ 27035

Last change on this file since 27035 was 27035, checked in by Mathieu Morlighem, 3 years ago

merged trunk-jpl and trunk for revision 27033

File size: 6.7 KB
Line 
1#include "SHELFICE_OPTIONS.h"
2#ifdef ALLOW_STREAMICE
3# include "STREAMICE_OPTIONS.h"
4#endif
5
6C-- File shelfice_step_icemass.F:
7C-- Contents:
8C-- o SHELFICE_STEP_ICEMASS
9C-- o SHELFICE_NETMASSFLUX_SURF
10
11C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
12CBOP
13C !ROUTINE: SHELFICE_STEP_ICEMASS
14
15C !INTERFACE: ==========================================================
16 SUBROUTINE SHELFICE_STEP_ICEMASS(
17 I myTime, myIter, myThid )
18
19C !DESCRIPTION:
20C Serves as a "stub" for ice dynamics
21C will later be used to
22
23C !USES: ===============================================================
24 IMPLICIT NONE
25#include "SIZE.h"
26#include "EEPARAMS.h"
27#include "PARAMS.h"
28#include "GRID.h"
29#include "SHELFICE.h"
30#ifdef ALLOW_STREAMICE
31# include "STREAMICE.h"
32#endif
33
34C !INPUT/OUTPUT PARAMETERS:
35C myTime :: current time in simulation
36C myIter :: current iteration number insimulation
37C myThid :: my thread Id number
38 _RL myTime
39 INTEGER myIter
40 INTEGER myThid
41CEOP
42
43#ifdef ALLOW_SHELFICE
44C !LOCAL VARIABLES : ====================================================
45C i,j, bi,bj :: loop indices
46 INTEGER bi,bj,i,j
47
48 IF ( SHELFICEMassStepping ) THEN
49
50 IF (useStreamIce) THEN
51
52#ifdef ALLOW_STREAMICE
53 DO bj = myByLo(myThid), myByHi(myThid)
54 DO bi = myBxLo(myThid), myBxHi(myThid)
55 DO j=1-OLy,sNy+OLy-1
56 DO i=1-OLx+1,sNx+OLx-1
57 IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
58 & streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
59 shelficeMass(i,j,bi,bj) =
60 & H_streamice(i,j,bi,bj) * streamice_density
61 ENDIF
62 ENDDO
63 ENDDO
64 ENDDO
65 ENDDO
66#endif /* ALLOW_STREAMICE */
67
68 ELSEIF (useCoupler) THEN
69
70#ifdef ALLOW_CPL_ISSM
71 DO bj = myByLo(myThid), myByHi(myThid)
72 DO bi = myBxLo(myThid), myBxHi(myThid)
73 DO j=1-OLy,sNy+OLy-1
74 DO i=1-OLx+1,sNx+OLx-1
75 shelficeMass(i,j,bi,bj) = -R_shelfIce(i,j,bi,bj) * rhoConst
76 ENDDO
77 ENDDO
78 ENDDO
79 ENDDO
80#endif /* ALLOW_CPL_ISSM */
81
82 ELSE
83
84 DO bj = myByLo(myThid), myByHi(myThid)
85 DO bi = myBxLo(myThid), myBxHi(myThid)
86
87 IF ( .NOT.SHELFICEDynMassOnly ) THEN
88 DO j=1-OLy,sNy+OLy
89 DO i=1-OLx,sNx+OLx
90 shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
91 & + shelfIceFreshWaterFlux(i,j,bi,bj)*deltaT
92 ENDDO
93 ENDDO
94 ENDIF
95
96 DO j=1-OLy,sNy+OLy
97 DO i=1-OLx,sNx+OLx
98 shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
99 & + shelfIceMassDynTendency(i,j,bi,bj)*deltaT
100 ENDDO
101 ENDDO
102
103C-- quick fix to prevent ice-shelf mass to become negative
104 DO j=1-OLy,sNy+OLy
105 DO i=1-OLx,sNx+OLx
106 shelficeMass(i,j,bi,bj) =
107 & MAX( shelficeMass(i,j,bi,bj), zeroRL )
108 ENDDO
109 ENDDO
110
111 ENDDO
112 ENDDO
113 ENDIF
114
115 _EXCH_XY_RL( shelficeMass, myThid )
116
117 ENDIF
118
119#ifdef ALLOW_DIAGNOSTICS
120 IF (useDiagnostics) THEN
121 CALL DIAGNOSTICS_FILL( shelficeMass, 'SHI_mass',
122 I 0, 1, 0, 1, 1, myThid )
123 ENDIF
124#endif /* ALLOW_DIAGNOSTICS */
125#endif /* ALLOW_SHELFICE */
126
127 RETURN
128 END
129
130C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
131CBOP
132C !ROUTINE: SHELFICE_NETMASSFLUX_SURF
133
134C !INTERFACE: ==========================================================
135 SUBROUTINE SHELFICE_NETMASSFLUX_SURF(
136 O shelfIceNetMassFlux,
137 I myTime, myIter, myThid )
138
139C !DESCRIPTION:
140C compute the net mass flux implied by S/R SHELFICE_STEP_MASS
141
142C !USES: ===============================================================
143 IMPLICIT NONE
144#include "SIZE.h"
145#include "EEPARAMS.h"
146#include "PARAMS.h"
147#include "GRID.h"
148#include "SHELFICE.h"
149#ifdef ALLOW_STREAMICE
150# include "STREAMICE.h"
151#endif
152#include "DYNVARS.h"
153
154C !INPUT/OUTPUT PARAMETERS:
155C myTime :: current time in simulation
156C myIter :: current iteration number insimulation
157C myThid :: my thread Id number
158 _RL myTime
159 INTEGER myIter
160 INTEGER myThid
161C net mass flux in m^3/s
162 _RL shelfIceNetMassFlux
163CEOP
164
165#ifdef ALLOW_SHELFICE
166C !LOCAL VARIABLES : ====================================================
167C i,j, bi,bj :: loop indices
168 INTEGER bi,bj,i,j
169 _RL shelfIceNetMassFluxTile(nSx,nSy)
170
171 shelfIceNetMassFlux = 0. _d 0
172
173 IF ( SHELFICEMassStepping ) THEN
174
175 IF (useStreamIce) THEN
176
177#ifdef ALLOW_STREAMICE
178 DO bj = myByLo(myThid), myByHi(myThid)
179 DO bi = myBxLo(myThid), myBxHi(myThid)
180 shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
181 DO j=1,sNy
182 DO i=1,sNx
183 IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
184 & streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
185C-- this assumes that the change in H_streamice include the melting flux
186CML shelfIceNetMassFluxTile(bi,bj) =
187CML & shelfIceNetMassFluxTile(bi,bj)
188CML & +(H_streamice(i,j,bi,bj)-H_streamice_prev(i,j,bi,bj))
189CML & /deltaT * streamice_density * mass2rUnit
190CML & * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
191 ENDIF
192 ENDDO
193 ENDDO
194 ENDDO
195 ENDDO
196#endif /* ALLOW_STREAMICE */
197
198 ELSE
199
200 DO bj = myByLo(myThid), myByHi(myThid)
201 DO bi = myBxLo(myThid), myBxHi(myThid)
202 shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
203 DO j=1,sNy
204 DO i=1,sNx
205C-- Flux of new ice will raise the sea level
206 shelfIceNetMassFluxTile(bi,bj) =
207 & shelfIceNetMassFluxTile(bi,bj)
208 & + shelfIceMassDynTendency(i,j,bi,bj)
209 & * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
210 IF ( .NOT.SHELFICEDynMassOnly ) THEN
211C-- Freshwater flux by thermodynamic processes. In the case of
212C melting this will be negative (positive upward) so it will reduce
213C the amount of added ice mass. The same freshwater flux is added
214C to the ocean in EmPmR and will raise the sea level, so that this
215C contribution is canceled.
216 shelfIceNetMassFluxTile(bi,bj) =
217 & shelfIceNetMassFluxTile(bi,bj)
218 & + shelfIceFreshWaterFlux(i,j,bi,bj)
219 & * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
220 ENDIF
221 ENDDO
222 ENDDO
223 ENDDO
224 ENDDO
225
226 ENDIF
227
228 CALL GLOBAL_SUM_TILE_RL( shelficeNetMassFluxTile,
229 & shelficeNetMassFlux, myThid )
230
231 ENDIF
232
233#endif /* ALLOW_SHELFICE */
234
235 RETURN
236 END
Note: See TracBrowser for help on using the repository browser.