ROMS
Loading...
Searching...
No Matches
ice_frazil.F
Go to the documentation of this file.
1#include "cppdefs.h"
3
4#if defined ICE_MODEL && defined ICE_THERMO
5!
6!git $Id$
7!================================================== Hernan G. Arango ===
8! Copyright (c) 2002-2025 The ROMS Group Paul Budgell !
9! Licensed under a MIT/X style license Katherine Hedstrom !
10! See License_ROMS.md Scott M. Durski !
11!=======================================================================
12! !
13! This routine computes the frazil ice growth in the water when the !
14! water temperature gets below freezing. It adjusts both the water !
15! temperature and salinity accordingly. !
16! !
17! Reference: !
18! !
19! Steele, M., G.L. Mellor, and M.G. Mcphee, 1989: Role of the !
20! molecular sublayer in the melting or freezing of sea ice, !
21! J. Phys. Oceanogr., 19, 139-147. !
22! !
23!=======================================================================
24!
25 USE mod_param
26 USE mod_grid
27 USE mod_ice
28 USE mod_ocean
29 USE mod_scalars
30!
31 USE bc_2d_mod, ONLY : bc_r2d_tile
32# ifdef DISTRIBUTE
33 USE distribute_mod, ONLY : mp_reduce
35# endif
36!
37 implicit none
38!
39 PRIVATE
40 PUBLIC :: freezing_point
41 PUBLIC :: ice_frazil
42!
43 CONTAINS
44!
45!***********************************************************************
46 SUBROUTINE ice_frazil (ng, tile, model)
47!***********************************************************************
48!
49 USE mod_stepping
50!
51! Imported variable declarations.
52!
53 integer, intent(in) :: ng, tile, model
54!
55! Local variable declarations.
56!
57 character (len=*), parameter :: MyFile = &
58 & __FILE__
59!
60# include "tile.h"
61!
62# ifdef PROFILE
63 CALL wclock_on (ng, model, 42, __line__, myfile)
64# endif
65 CALL ice_frazil_tile (ng, tile, model, &
66 & lbi, ubi, lbj, ubj, &
67 & imins, imaxs, jmins, jmaxs, &
68 & nnew(ng), &
69# ifdef MASKING
70 & grid(ng) % rmask, &
71# endif
72# ifdef WET_DRY
73 & grid(ng) % rmask_wet, &
74# endif
75 & grid(ng) % Hz, &
76 & grid(ng) % z_r, &
77 & ocean(ng) % rho, &
78 & ocean(ng) % t, &
79 & ice(ng) % Fi)
80# ifdef PROFILE
81 CALL wclock_off (ng, model, 42, __line__, myfile)
82# endif
83!
84 RETURN
85 END SUBROUTINE ice_frazil
86!
87!***********************************************************************
88 SUBROUTINE ice_frazil_tile (ng, tile, model, &
89 & LBi, UBi, LBj, UBj, &
90 & IminS, ImaxS, JminS, JmaxS, &
91 & nnew, &
92# ifdef MASKING
93 & rmask, &
94# endif
95# ifdef WET_DRY
96 & rmask_wet, &
97# endif
98 & Hz, z_r, rho, t, &
99 & Fi)
100!***********************************************************************
101!
102! Imported variable declarations.
103!
104 integer, intent(in) :: ng, tile, model
105 integer, intent(in) :: LBi, UBi, LBj, UBj
106 integer, intent(in) :: IminS, ImaxS, JminS, JmaxS
107 integer, intent(in) :: nnew
108
109# ifdef ASSUMED_SHAPE
110# ifdef MASKING
111 real(r8), intent(in) :: rmask(LBi:,LBj:)
112# endif
113# ifdef WET_DRY
114 real(r8), intent(in) :: rmask_wet(LBi:,LBj:)
115# endif
116 real(r8), intent(in) :: Hz(LBi:,LBj:,:)
117 real(r8), intent(in) :: z_r(LBi:,LBj:,:)
118 real(r8), intent(in) :: rho(LBi:,LBj:,:)
119 real(r8), intent(inout) :: t(LBi:,LBj:,:,:,:)
120 real(r8), intent(inout) :: Fi(LBi:,LBj:,:)
121# else
122# ifdef MASKING
123 real(r8), intent(in) :: rmask(LBi:UBi,LBj:UBj)
124# endif
125# ifdef WET_DRY
126 real(r8), intent(in) :: rmask_wet(LBi:UBi,LBj:UBj)
127# endif
128 real(r8), intent(in) :: Hz(LBi:UBi,LBj:UBj,N(ng))
129 real(r8), intent(in) :: z_r(LBi:UBi,LBj:UBj,N(ng))
130 real(r8), intent(in) :: rho(LBi:UBi,LBj:UBj,N(ng))
131 real(r8), intent(inout) :: t(LBi:UBi,LBj:UBj,N(ng),3,NT(ng))
132 real(r8), intent(inout) :: Fi(LBi:UBi,LBj:UBj,nIceF)
133# endif
134!
135! Local variable definitions
136!
137 logical :: overLand
138!
139 integer :: i, j, k, itrc
140!
141 real(r8), parameter :: Lhat = 79.2_r8
142 real(r8), parameter :: r = 0.5_r8
143
144 real(r8) :: delta_wfr, gamma_k, orhoi, pfac, t_fr
145
146# ifdef DISTRIBUTE
147 real(r8), allocatable :: buffer(:)
148 character (len=3), allocatable :: op_handle(:)
149# endif
150
151# include "set_bounds.h"
152!
153!-----------------------------------------------------------------------
154! Compute frazil ice growth.
155!-----------------------------------------------------------------------
156!
157! Initialize rate of frazil ice growth (m3/s).
158!
159 DO j=jstr,jend
160 DO i=istr,iend
161 fi(i,j,icw_fr)=0.0_r8
162 END DO
163 END DO
164!
165! Original formulation.
166!
167 pfac=1.0_r8 ! adjusting factor
168 DO j=jstr,jend
169 DO i=istr,iend
170 DO k=1,n(ng)
171# ifdef MASKING
172 overland=rmask(i,j).lt.1.0_r8
173# ifdef WET_DRY
174 overland=overland.or.(rmask_wet(i,j).lt.1.0_r8)
175# endif
176# else
177 overland=.false.
178# endif
179 IF (.not.overland) THEN
180 orhoi=1.0_r8/icerho(ng)
181 t_fr=freezing_point(t(i,j,k,nnew,isalt), z_r(i,j,k))
182 IF (t(i,j,k,nnew,itemp).lt.t_fr) THEN
183 gamma_k=pfac*(t_fr-t(i,j,k,nnew,itemp))/ &
184 & (lhat+ &
185 t(i,j,k,nnew,itemp)*(1.0_r8-r)+ &
186 & 0.0543_r8*t(i,j,k,nnew,isalt))
187 IF ((gamma_k.lt.0.0_r8).and.(k.eq.n(ng))) THEN
188 gamma_k=0.0_r8
189 END IF
190 fi(i,j,icw_fr)=fi(i,j,icw_fr)+ &
191 & gamma_k*hz(i,j,k)* &
192 & (1000.0_r8+rho(i,j,k))*orhoi
193 t(i,j,k,nnew,itemp)=t(i,j,k,nnew,itemp)+ &
194 & gamma_k* &
195 & (lhat+ &
196 & t(i,j,k,nnew,itemp)*(1.0_r8-r))
197!
198! Use heat at this level to melt some ice from below (gamma_k becomes
199! negative here). The salinity is not adjusted since salt flux from
200! frazil ice is considered a surface flux (SMD).
201!
202 ELSE IF ((fi(i,j,icw_fr).gt.0.0_r8).and. &
203 & (t(i,j,k,nnew,itemp).gt.t_fr)) THEN
204 gamma_k=pfac*(t_fr-t(i,j,k,nnew,itemp))/ &
205 & (lhat+t(i,j,k,nnew,itemp)*(1.0_r8-r)+ &
206 & 0.0543_r8*t(i,j,k,nnew,isalt))
207 delta_wfr=gamma_k*hz(i,j,k)*(rho0+rho(i,j,k))*orhoi
208 IF ((fi(i,j,icw_fr)+delta_wfr).gt.0.0_r8) THEN
209 fi(i,j,icw_fr)=fi(i,j,icw_fr)+delta_wfr
210 ELSE
211 gamma_k=-fi(i,j,icw_fr)* &
212 & icerho(ng)/(hz(i,j,k)*(rho0+rho(i,j,k)))
213 fi(i,j,icw_fr)=0.0_r8
214 ENDIF
215 t(i,j,k,nnew,itemp)=t(i,j,k,nnew,itemp)+ &
216 & gamma_k* &
217 & (lhat+ &
218 & t(i,j,k,nnew,itemp)*(1.0_r8-r))
219 END IF
220 END IF
221 END DO
222!
223! Compute rate of frazil ice growth.
224!
225 fi(i,j,icw_fr)=fi(i,j,icw_fr)/dt(ng)
226!
227! If negative frazil growth, set it to zero. It implies that the melt
228! effect exceeded the freezing effect (SMD).
229!
230 IF (fi(i,j,icw_fr).lt.0.0_r8) THEN
231 fi(i,j,icw_fr)=0.0_r8
232 END IF
233 END DO
234 END DO
235!
236! Set lateral boundary conditions.
237!
238 CALL bc_r2d_tile (ng, tile, &
239 & lbi, ubi, lbj, ubj, &
240 & fi(:,:,icw_fr))
241
242# ifdef DISTRIBUTE
243!
244 CALL mp_exchange2d (ng, tile, model, 1, &
245 & lbi, ubi, lbj, ubj, &
246 & nghostpoints, ewperiodic(ng), nsperiodic(ng), &
247 & fi(:,:,icw_fr))
248# endif
249!
250 RETURN
251 END SUBROUTINE ice_frazil_tile
252!
253!***********************************************************************
254 FUNCTION freezing_point (S, Z) RESULT (FP)
255!***********************************************************************
256!
257! Imported variable declarations.
258!
259 real(r8), intent(in) :: S, Z
260!
261! Local variable declarations.
262!
263 real(r8) :: FP
264!
265!-----------------------------------------------------------------------
266! Freezing point temperature of sea water.
267!-----------------------------------------------------------------------
268!
269!! Gill (1982).
270!!
271!! FP = S*(-0.0575_r8 + 1.710523E-3_r8*SQRT(S) - 2.154996E-4_r8*S) + &
272!! & 0.000753_r8*Z
273!!
274!! Steele et al. (1989).
275!!
276!! FP = -0.0543_r8*S + 0.000759_r8*Z
277!!
278 fp = -0.0543_r8*s
279!
280 RETURN
281 END FUNCTION freezing_point
282#endif
283 END MODULE ice_frazil_mod
284
subroutine bc_r2d_tile(ng, tile, lbi, ubi, lbj, ubj, a)
Definition bc_2d.F:44
type(t_grid), dimension(:), allocatable grid
Definition mod_grid.F:365
real(r8), dimension(:), allocatable icerho
Definition ice_mod.h:223
type(t_ice), dimension(:), allocatable ice
Definition ice_mod.h:283
integer, parameter icw_fr
Definition ice_mod.h:192
type(t_ocean), dimension(:), allocatable ocean
Definition mod_ocean.F:351
integer nghostpoints
Definition mod_param.F:710
real(dp), dimension(:), allocatable dt
logical, dimension(:), allocatable ewperiodic
logical, dimension(:), allocatable nsperiodic
integer isalt
integer itemp
real(dp) rho0
integer, dimension(:), allocatable nnew
subroutine mp_exchange2d(ng, tile, model, nvar, lbi, ubi, lbj, ubj, nghost, ew_periodic, ns_periodic, a, b, c, d)
recursive subroutine wclock_off(ng, model, region, line, routine)
Definition timers.F:148
recursive subroutine wclock_on(ng, model, region, line, routine)
Definition timers.F:3