icbthm.F90 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. MODULE icbthm
  2. !!======================================================================
  3. !! *** MODULE icbthm ***
  4. !! Icebergs: thermodynamics routines for icebergs
  5. !!======================================================================
  6. !! History : 3.3.1 ! 2010-01 (Martin&Adcroft) Original code
  7. !! - ! 2011-03 (Madec) Part conversion to NEMO form
  8. !! - ! Removal of mapping from another grid
  9. !! - ! 2011-04 (Alderson) Split into separate modules
  10. !! - ! 2011-05 (Alderson) Use tmask instead of tmask_i
  11. !!----------------------------------------------------------------------
  12. !!----------------------------------------------------------------------
  13. !! icb_thm : initialise
  14. !! reference for equations - M = Martin + Adcroft, OM 34, 2010
  15. !!----------------------------------------------------------------------
  16. USE par_oce ! NEMO parameters
  17. USE dom_oce ! NEMO domain
  18. USE in_out_manager ! NEMO IO routines, numout in particular
  19. USE lib_mpp ! NEMO MPI routines, ctl_stop in particular
  20. USE phycst ! NEMO physical constants
  21. USE sbc_oce
  22. USE icb_oce ! define iceberg arrays
  23. USE icbutl ! iceberg utility routines
  24. USE icbdia ! iceberg budget routines
  25. IMPLICIT NONE
  26. PRIVATE
  27. PUBLIC icb_thm ! routine called in icbstp.F90 module
  28. !! $Id: icbthm.F90 2355 2015-05-20 07:11:50Z ufla $
  29. CONTAINS
  30. SUBROUTINE icb_thm( kt )
  31. !!----------------------------------------------------------------------
  32. !! *** ROUTINE icb_thm ***
  33. !!
  34. !! ** Purpose : compute the iceberg thermodynamics.
  35. !!
  36. !! ** Method : - See Martin & Adcroft, Ocean Modelling 34, 2010
  37. !!----------------------------------------------------------------------
  38. INTEGER, INTENT(in) :: kt ! timestep number, just passed to icb_utl_print_berg
  39. !
  40. INTEGER :: ii, ij
  41. REAL(wp) :: zM, zT, zW, zL, zSST, zVol, zLn, zWn, zTn, znVol, zIC, zDn
  42. REAL(wp) :: zMv, zMe, zMb, zmelt, zdvo, zdva, zdM, zSs, zdMe, zdMb, zdMv
  43. REAL(wp) :: zMnew, zMnew1, zMnew2, zheat
  44. REAL(wp) :: zMbits, znMbits, zdMbitsE, zdMbitsM, zLbits, zAbits, zMbb
  45. REAL(wp) :: zxi, zyj, zff, z1_rday, z1_e1e2, zdt, z1_dt, z1_dt_e1e2
  46. TYPE(iceberg), POINTER :: this, next
  47. TYPE(point) , POINTER :: pt
  48. !!----------------------------------------------------------------------
  49. !
  50. z1_rday = 1._wp / rday
  51. ! we're either going to ignore berg fresh water melt flux and associated heat
  52. ! or we pass it into the ocean, so at this point we set them both to zero,
  53. ! accumulate the contributions to them from each iceberg in the while loop following
  54. ! and then pass them (or not) to the ocean
  55. !
  56. berg_grid%floating_melt(:,:) = 0._wp
  57. berg_grid%calving_hflx(:,:) = 0._wp
  58. this => first_berg
  59. DO WHILE( associated(this) )
  60. !
  61. pt => this%current_point
  62. nknberg = this%number(1)
  63. CALL icb_utl_interp( pt%xi, pt%e1, pt%uo, pt%ui, pt%ua, pt%ssh_x, &
  64. & pt%yj, pt%e2, pt%vo, pt%vi, pt%va, pt%ssh_y, &
  65. & pt%sst, pt%cn, pt%hi, zff )
  66. !
  67. zSST = pt%sst
  68. zIC = MIN( 1._wp, pt%cn + rn_sicn_shift ) ! Shift sea-ice concentration !!gm ???
  69. zM = pt%mass
  70. zT = pt%thickness ! total thickness
  71. ! D = (rn_rho_bergs/pp_rho_seawater)*zT ! draught (keel depth)
  72. ! F = zT - D ! freeboard
  73. zW = pt%width
  74. zL = pt%length
  75. zxi = pt%xi ! position in (i,j) referential
  76. zyj = pt%yj
  77. ii = INT( zxi + 0.5 ) ! T-cell of the berg
  78. ii = mi1( ii )
  79. ij = INT( zyj + 0.5 )
  80. ij = mj1( ij )
  81. zVol = zT * zW * zL
  82. zdt = berg_dt ; z1_dt = 1._wp / zdt
  83. ! Environment
  84. zdvo = SQRT( (pt%uvel-pt%uo)**2 + (pt%vvel-pt%vo)**2 )
  85. zdva = SQRT( (pt%ua -pt%uo)**2 + (pt%va -pt%vo)**2 )
  86. zSs = 1.5 * SQRT( zdva ) + 0.1 * zdva ! Sea state (eqn M.A9)
  87. ! Melt rates in m/s (i.e. division by rday)
  88. zMv = MAX( 7.62e-3*zSST+1.29e-3*(zSST**2) , 0._wp ) * z1_rday ! Buoyant convection at sides (eqn M.A10)
  89. zMb = MAX( 0.58*(zdvo**0.8)*(zSST+4.0)/(zL**0.2) , 0._wp ) * z1_rday ! Basal turbulent melting (eqn M.A7 )
  90. zMe = MAX( 1./12.*(zSST+2.)*zSs*(1+cos(rpi*(zIC**3))) , 0._wp ) * z1_rday ! Wave erosion (eqn M.A8 )
  91. IF( ln_operator_splitting ) THEN ! Operator split update of volume/mass
  92. zTn = MAX( zT - zMb*zdt , 0._wp ) ! new total thickness (m)
  93. znVol = zTn * zW * zL ! new volume (m^3)
  94. zMnew1 = (znVol/zVol) * zM ! new mass (kg)
  95. zdMb = zM - zMnew1 ! mass lost to basal melting (>0) (kg)
  96. !
  97. zLn = MAX( zL - zMv*zdt , 0._wp ) ! new length (m)
  98. zWn = MAX( zW - zMv*zdt , 0._wp ) ! new width (m)
  99. znVol = zTn * zWn * zLn ! new volume (m^3)
  100. zMnew2 = (znVol/zVol) * zM ! new mass (kg)
  101. zdMv = zMnew1 - zMnew2 ! mass lost to buoyant convection (>0) (kg)
  102. !
  103. zLn = MAX( zLn - zMe*zdt , 0._wp ) ! new length (m)
  104. zWn = MAX( zWn - zMe*zdt , 0._wp ) ! new width (m)
  105. znVol = zTn * zWn * zLn ! new volume (m^3)
  106. zMnew = ( znVol / zVol ) * zM ! new mass (kg)
  107. zdMe = zMnew2 - zMnew ! mass lost to erosion (>0) (kg)
  108. zdM = zM - zMnew ! mass lost to all erosion and melting (>0) (kg)
  109. !
  110. ELSE ! Update dimensions of berg
  111. zLn = MAX( zL -(zMv+zMe)*zdt ,0._wp ) ! (m)
  112. zWn = MAX( zW -(zMv+zMe)*zdt ,0._wp ) ! (m)
  113. zTn = MAX( zT - zMb *zdt ,0._wp ) ! (m)
  114. ! Update volume and mass of berg
  115. znVol = zTn*zWn*zLn ! (m^3)
  116. zMnew = (znVol/zVol)*zM ! (kg)
  117. zdM = zM - zMnew ! (kg)
  118. zdMb = (zM/zVol) * (zW* zL ) *zMb*zdt ! approx. mass loss to basal melting (kg)
  119. zdMe = (zM/zVol) * (zT*(zW+zL)) *zMe*zdt ! approx. mass lost to erosion (kg)
  120. zdMv = (zM/zVol) * (zT*(zW+zL)) *zMv*zdt ! approx. mass loss to buoyant convection (kg)
  121. ENDIF
  122. IF( rn_bits_erosion_fraction > 0._wp ) THEN ! Bergy bits
  123. !
  124. zMbits = pt%mass_of_bits ! mass of bergy bits (kg)
  125. zdMbitsE = rn_bits_erosion_fraction * zdMe ! change in mass of bits (kg)
  126. znMbits = zMbits + zdMbitsE ! add new bergy bits to mass (kg)
  127. zLbits = MIN( zL, zW, zT, 40._wp ) ! assume bergy bits are smallest dimension or 40 meters
  128. zAbits = ( zMbits / rn_rho_bergs ) / zLbits ! Effective bottom area (assuming T=Lbits)
  129. zMbb = MAX( 0.58*(zdvo**0.8)*(zSST+2.0)/(zLbits**0.2), 0.) * z1_rday ! Basal turbulent melting (for bits)
  130. zMbb = rn_rho_bergs * zAbits * zMbb ! in kg/s
  131. zdMbitsM = MIN( zMbb*zdt , znMbits ) ! bergy bits mass lost to melting (kg)
  132. znMbits = znMbits-zdMbitsM ! remove mass lost to bergy bits melt
  133. IF( zMnew == 0._wp ) THEN ! if parent berg has completely melted then
  134. zdMbitsM = zdMbitsM + znMbits ! instantly melt all the bergy bits
  135. znMbits = 0._wp
  136. ENDIF
  137. ELSE ! No bergy bits
  138. zAbits = 0._wp
  139. zdMbitsE = 0._wp
  140. zdMbitsM = 0._wp
  141. znMbits = pt%mass_of_bits ! retain previous value incase non-zero
  142. ENDIF
  143. ! use tmask rather than tmask_i when dealing with icebergs
  144. IF( tmask(ii,ij,1) /= 0._wp ) THEN ! Add melting to the grid and field diagnostics
  145. z1_e1e2 = 1._wp / e1e2t(ii,ij) * this%mass_scaling
  146. z1_dt_e1e2 = z1_dt * z1_e1e2
  147. zmelt = ( zdM - ( zdMbitsE - zdMbitsM ) ) * z1_dt ! kg/s
  148. berg_grid%floating_melt(ii,ij) = berg_grid%floating_melt(ii,ij) + zmelt * z1_e1e2 ! kg/m2/s
  149. zheat = zmelt * pt%heat_density ! kg/s x J/kg = J/s
  150. berg_grid%calving_hflx (ii,ij) = berg_grid%calving_hflx (ii,ij) + zheat * z1_e1e2 ! W/m2
  151. CALL icb_dia_melt( ii, ij, zMnew, zheat, this%mass_scaling, &
  152. & zdM, zdMbitsE, zdMbitsM, zdMb, zdMe, &
  153. & zdMv, z1_dt_e1e2 )
  154. ELSE
  155. WRITE(numout,*) 'icb_thm: berg ',this%number(:),' appears to have grounded at ',narea,ii,ij
  156. CALL icb_utl_print_berg( this, kt )
  157. WRITE(numout,*) 'msk=',tmask(ii,ij,1), e1e2t(ii,ij)
  158. CALL ctl_stop('icb_thm', 'berg appears to have grounded!')
  159. ENDIF
  160. ! Rolling
  161. zDn = ( rn_rho_bergs / pp_rho_seawater ) * zTn ! draught (keel depth)
  162. IF( zDn > 0._wp .AND. MAX(zWn,zLn) < SQRT( 0.92*(zDn**2) + 58.32*zDn ) ) THEN
  163. zT = zTn
  164. zTn = zWn
  165. zWn = zT
  166. endif
  167. ! Store the new state of iceberg (with L>W)
  168. pt%mass = zMnew
  169. pt%mass_of_bits = znMbits
  170. pt%thickness = zTn
  171. pt%width = min(zWn,zLn)
  172. pt%length = max(zWn,zLn)
  173. next=>this%next
  174. !!gm add a test to avoid over melting ?
  175. IF( zMnew <= 0._wp ) THEN ! Delete the berg if completely melted
  176. CALL icb_utl_delete( first_berg, this )
  177. !
  178. ELSE ! Diagnose mass distribution on grid
  179. z1_e1e2 = 1._wp / e1e2t(ii,ij) * this%mass_scaling
  180. CALL icb_dia_size( ii, ij, zWn, zLn, zAbits, &
  181. & this%mass_scaling, zMnew, znMbits, z1_e1e2)
  182. ENDIF
  183. !
  184. this=>next
  185. !
  186. END DO
  187. ! now use melt and associated heat flux in ocean (or not)
  188. !
  189. IF(.NOT. ln_passive_mode ) THEN
  190. emp (:,:) = emp (:,:) - berg_grid%floating_melt(:,:)
  191. !! qns (:,:) = qns (:,:) + berg_grid%calving_hflx (:,:) !!gm heat flux not yet properly coded ==>> need it, SOLVE that!
  192. ENDIF
  193. !
  194. END SUBROUTINE icb_thm
  195. !!======================================================================
  196. END MODULE icbthm