New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
icbthm.F90 in NEMO/branches/UKMO/dev_r9885_GO6_mixing/src/OCE/ICB – NEMO

source: NEMO/branches/UKMO/dev_r9885_GO6_mixing/src/OCE/ICB/icbthm.F90 @ 9895

Last change on this file since 9895 was 9895, checked in by davestorkey, 6 years ago

UKMO/dev_r9885_GO6_mixing branch: clear SVN keywords.

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