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.
icethd_do.F90 in NEMO/branches/UKMO/dev_r10037_GPU/src/ICE – NEMO

source: NEMO/branches/UKMO/dev_r10037_GPU/src/ICE/icethd_do.F90 @ 11467

Last change on this file since 11467 was 11467, checked in by andmirek, 5 years ago

Ticket #2197 allocate arrays at the beggining of the run

File size: 23.2 KB
Line 
1MODULE icethd_do
2   !!======================================================================
3   !!                       ***  MODULE icethd_do   ***
4   !!   sea-ice: sea ice growth in the leads (open water) 
5   !!======================================================================
6   !! History :       !  2005-12  (M. Vancoppenolle) Original code
7   !!            4.0  !  2018     (many people)      SI3 [aka Sea Ice cube]
8   !!----------------------------------------------------------------------
9#if defined key_si3
10   !!----------------------------------------------------------------------
11   !!   'key_si3'                                       SI3 sea-ice model
12   !!----------------------------------------------------------------------
13   !!   ice_thd_do        : ice growth in open water (=lateral accretion of ice)
14   !!   ice_thd_do_init   : initialization
15   !!----------------------------------------------------------------------
16   USE dom_oce        ! ocean space and time domain
17   USE phycst         ! physical constants
18   USE sbc_oce , ONLY : sss_m
19   USE sbc_ice , ONLY : utau_ice, vtau_ice
20   USE ice1D          ! sea-ice: thermodynamics variables
21   USE ice            ! sea-ice: variables
22   USE icetab         ! sea-ice: 2D <==> 1D
23   USE icectl         ! sea-ice: conservation
24   USE icethd_ent     ! sea-ice: thermodynamics, enthalpy
25   USE icevar         ! sea-ice: operations
26   USE icethd_sal     ! sea-ice: salinity profiles
27   !
28   USE in_out_manager ! I/O manager
29   USE lib_mpp        ! MPP library
30   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
31   USE lbclnk         ! lateral boundary conditions (or mpp links)
32
33   IMPLICIT NONE
34   PRIVATE
35
36   PUBLIC   ice_thd_do        ! called by ice_thd
37   PUBLIC   ice_thd_do_init   ! called by ice_stp
38
39   !                          !!** namelist (namthd_do) **
40   REAL(wp) ::   rn_hinew      ! thickness for new ice formation (m)
41   LOGICAL  ::   ln_frazil     ! use of frazil ice collection as function of wind (T) or not (F)
42   REAL(wp) ::   rn_maxfraz    ! maximum portion of frazil ice collecting at the ice bottom
43   REAL(wp) ::   rn_vfraz      ! threshold drift speed for collection of bottom frazil ice
44   REAL(wp) ::   rn_Cfraz      ! squeezing coefficient for collection of bottom frazil ice
45
46   !!----------------------------------------------------------------------
47   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
48   !! $Id$
49   !! Software governed by the CeCILL license (see ./LICENSE)
50   !!----------------------------------------------------------------------
51CONTAINS
52
53   SUBROUTINE ice_thd_do
54      !!-------------------------------------------------------------------
55      !!               ***   ROUTINE ice_thd_do  ***
56      !! 
57      !! ** Purpose : Computation of the evolution of the ice thickness and
58      !!              concentration as a function of the heat balance in the leads
59      !!       
60      !! ** Method  : Ice is formed in the open water when ocean looses heat
61      !!              (heat budget of open water is negative) following
62      !!
63      !!       (dA/dt)acc = F[ (1-A)/(1-a) ] * [ Bl / (Li*h0) ]
64      !!          where - h0 is the thickness of ice created in the lead
65      !!                - a is a minimum fraction for leads
66      !!                - F is a monotonic non-increasing function defined as:
67      !!                  F(X)=( 1 - X**exld )**(1.0/exld)
68      !!                - exld is the exponent closure rate (=2 default val.)
69      !!
70      !! ** Action : - Adjustment of snow and ice thicknesses and heat
71      !!                content in brine pockets
72      !!             - Updating ice internal temperature
73      !!             - Computation of variation of ice volume and mass
74      !!             - Computation of a_i after lateral accretion and
75      !!               update h_s_1d, h_i_1d     
76      !!------------------------------------------------------------------------
77      USE scice, ONLY : jcat => iscr1D1i,     & ! indexes of categories where new ice grows
78                       zswinew => scr1D1i,   & ! switch for new ice or not
79                       zv_newice => scr1D2i, & ! volume of accreted ice
80                       za_newice => scr1D3i, & ! fractional area of accreted ice
81                       zh_newice => scr1D4i, & ! thickness of accreted ice
82                       ze_newice => scr1D5i, & ! heat content of accreted ice
83                       zs_newice => scr1D6i, & ! salinity of accreted ice
84                       zo_newice => scr1D7i, & ! age of accreted ice
85                       zdv_res   => scr1D8i, & ! residual volume in case of excessive heat budget
86                       zda_res   => scr1D9i, & ! residual area in case of excessive heat budget
87                       zv_frazb  => scr1D10i, & ! accretion of frazil ice at the ice bottom
88                       zvrel_1d  => scr1D11i, & ! relative ice / frazil velocity (1D vector)
89                       zv_b      => scr1ai,  & ! old volume of ice in category jl
90                       za_b      => scr2ai     ! old area of ice in category jl
91      USE scoce, ONLY : zvrel     => scr2D1     ! relative ice / frazil velocity
92
93      INTEGER  ::   ji, jj, jk, jl   ! dummy loop indices
94      INTEGER  ::   iter             !   -       -
95      REAL(wp) ::   ztmelts, zfrazb, zweight, zde                               ! local scalars
96      REAL(wp) ::   zgamafr, zvfrx, zvgx, ztaux, ztwogp, zf                     !   -      -
97      REAL(wp) ::   ztenagm, zvfry, zvgy, ztauy, zvrel2, zfp, zsqcd , zhicrit   !   -      -
98      !
99      REAL(wp) ::   zQm          ! enthalpy exchanged with the ocean (J/m2, >0 towards ocean)
100      REAL(wp) ::   zEi          ! sea ice specific enthalpy (J/kg)
101      REAL(wp) ::   zEw          ! seawater specific enthalpy (J/kg)
102      REAL(wp) ::   zfmdt        ! mass flux x time step (kg/m2, >0 towards ocean)
103      !
104      REAL(wp) ::   zv_newfra
105      !
106      REAL(wp), DIMENSION(jpij,nlay_i,jpl) ::   ze_i_2d !: 1-D version of e_i
107      !
108      REAL(wp) :: zcai = 1.4e-3_wp               ! ice-air drag (clem: should be dependent on coupling/forcing used)
109      !!-----------------------------------------------------------------------!
110
111      IF( ln_icediachk )   CALL ice_cons_hsm( 0, 'icethd_do', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft )
112
113      CALL ice_var_agg(1)
114      CALL ice_var_glo2eqv
115
116      !------------------------------------------------------------------------------!
117      ! 1) Collection thickness of ice formed in leads and polynyas
118      !------------------------------------------------------------------------------!   
119      ! ht_i_new is the thickness of new ice formed in open water
120      ! ht_i_new can be either prescribed (ln_frazil=F) or computed (ln_frazil=T)
121      ! Frazil ice forms in open water, is transported by wind
122      ! accumulates at the edge of the consolidated ice edge
123      ! where it forms aggregates of a specific thickness called
124      ! collection thickness.
125
126      zvrel(:,:) = 0._wp
127
128      ! Default new ice thickness
129      WHERE( qlead(:,:) < 0._wp )   ;   ht_i_new(:,:) = rn_hinew
130      ELSEWHERE                     ;   ht_i_new(:,:) = 0._wp
131      END WHERE
132
133      IF( ln_frazil ) THEN
134         !
135         ht_i_new(:,:) = 0._wp
136         !
137         ! Physical constants
138         zhicrit = 0.04                                          ! frazil ice thickness
139         ztwogp  = 2. * rau0 / ( grav * 0.3 * ( rau0 - rhoi ) )  ! reduced grav
140         zsqcd   = 1.0 / SQRT( 1.3 * zcai )                      ! 1/SQRT(airdensity*drag)
141         zgamafr = 0.03
142         !
143         DO jj = 2, jpjm1
144            DO ji = 2, jpim1
145               IF ( qlead(ji,jj) < 0._wp .AND. tau_icebfr(ji,jj) == 0._wp ) THEN ! activated if cooling and no landfast
146                  ! -- Wind stress -- !
147                  ztaux         = ( utau_ice(ji-1,jj  ) * umask(ji-1,jj  ,1)   &
148                     &          +   utau_ice(ji  ,jj  ) * umask(ji  ,jj  ,1) ) * 0.5_wp
149                  ztauy         = ( vtau_ice(ji  ,jj-1) * vmask(ji  ,jj-1,1)   &
150                     &          +   vtau_ice(ji  ,jj  ) * vmask(ji  ,jj  ,1) ) * 0.5_wp
151                  ! Square root of wind stress
152                  ztenagm       =  SQRT( SQRT( ztaux * ztaux + ztauy * ztauy ) )
153
154                  ! -- Frazil ice velocity -- !
155                  rswitch = MAX( 0._wp, SIGN( 1._wp , ztenagm - epsi10 ) )
156                  zvfrx   = rswitch * zgamafr * zsqcd * ztaux / MAX( ztenagm, epsi10 )
157                  zvfry   = rswitch * zgamafr * zsqcd * ztauy / MAX( ztenagm, epsi10 )
158
159                  ! -- Pack ice velocity -- !
160                  zvgx    = ( u_ice(ji-1,jj  ) * umask(ji-1,jj  ,1)  + u_ice(ji,jj) * umask(ji,jj,1) ) * 0.5_wp
161                  zvgy    = ( v_ice(ji  ,jj-1) * vmask(ji  ,jj-1,1)  + v_ice(ji,jj) * vmask(ji,jj,1) ) * 0.5_wp
162
163                  ! -- Relative frazil/pack ice velocity -- !
164                  rswitch      = MAX( 0._wp, SIGN( 1._wp , at_i(ji,jj) - epsi10 ) )
165                  zvrel2       = MAX(  ( zvfrx - zvgx ) * ( zvfrx - zvgx )   &
166                     &               + ( zvfry - zvgy ) * ( zvfry - zvgy ) , 0.15 * 0.15 ) * rswitch
167                  zvrel(ji,jj) = SQRT( zvrel2 )
168
169                  ! -- new ice thickness (iterative loop) -- !
170                  ht_i_new(ji,jj) = zhicrit +   ( zhicrit + 0.1 )    &
171                     &                   / ( ( zhicrit + 0.1 ) * ( zhicrit + 0.1 ) -  zhicrit * zhicrit ) * ztwogp * zvrel2
172
173                  iter = 1
174                  DO WHILE ( iter < 20 ) 
175                     zf  = ( ht_i_new(ji,jj) - zhicrit ) * ( ht_i_new(ji,jj) * ht_i_new(ji,jj) - zhicrit * zhicrit ) -   &
176                        &    ht_i_new(ji,jj) * zhicrit * ztwogp * zvrel2
177                     zfp = ( ht_i_new(ji,jj) - zhicrit ) * ( 3.0 * ht_i_new(ji,jj) + zhicrit ) - zhicrit * ztwogp * zvrel2
178
179                     ht_i_new(ji,jj) = ht_i_new(ji,jj) - zf / MAX( zfp, epsi20 )
180                     iter = iter + 1
181                  END DO
182                  !
183               ENDIF
184               !
185            END DO
186         END DO 
187         !
188         CALL lbc_lnk_multi( zvrel, 'T', 1., ht_i_new, 'T', 1.  )
189
190      ENDIF
191
192      !------------------------------------------------------------------------------!
193      ! 2) Compute thickness, salinity, enthalpy, age, area and volume of new ice
194      !------------------------------------------------------------------------------!
195      ! This occurs if open water energy budget is negative (cooling) and there is no landfast ice
196
197      ! Identify grid points where new ice forms
198      npti = 0   ;   nptidx(:) = 0
199      DO jj = 1, jpj
200         DO ji = 1, jpi
201            IF ( qlead(ji,jj)  <  0._wp .AND. tau_icebfr(ji,jj) == 0._wp ) THEN
202               npti = npti + 1
203               nptidx( npti ) = (jj - 1) * jpi + ji
204            ENDIF
205         END DO
206      END DO
207
208      ! Move from 2-D to 1-D vectors
209      IF ( npti > 0 ) THEN
210
211         CALL tab_2d_1d( npti, nptidx(1:npti), at_i_1d(1:npti)      , at_i        )
212         CALL tab_3d_2d( npti, nptidx(1:npti), a_i_2d (1:npti,1:jpl), a_i (:,:,:) )
213         CALL tab_3d_2d( npti, nptidx(1:npti), v_i_2d (1:npti,1:jpl), v_i (:,:,:) )
214         CALL tab_3d_2d( npti, nptidx(1:npti), sv_i_2d(1:npti,1:jpl), sv_i(:,:,:) )
215         DO jl = 1, jpl
216            DO jk = 1, nlay_i
217               CALL tab_2d_1d( npti, nptidx(1:npti), ze_i_2d(1:npti,jk,jl), e_i(:,:,jk,jl) )
218            END DO
219         END DO
220         CALL tab_2d_1d( npti, nptidx(1:npti), qlead_1d  (1:npti) , qlead      )
221         CALL tab_2d_1d( npti, nptidx(1:npti), t_bo_1d   (1:npti) , t_bo       )
222         CALL tab_2d_1d( npti, nptidx(1:npti), sfx_opw_1d(1:npti) , sfx_opw    )
223         CALL tab_2d_1d( npti, nptidx(1:npti), wfx_opw_1d(1:npti) , wfx_opw    )
224         CALL tab_2d_1d( npti, nptidx(1:npti), zh_newice (1:npti) , ht_i_new   )
225         CALL tab_2d_1d( npti, nptidx(1:npti), zvrel_1d  (1:npti) , zvrel      )
226
227         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_thd_1d(1:npti) , hfx_thd    )
228         CALL tab_2d_1d( npti, nptidx(1:npti), hfx_opw_1d(1:npti) , hfx_opw    )
229         CALL tab_2d_1d( npti, nptidx(1:npti), rn_amax_1d(1:npti) , rn_amax_2d )
230         CALL tab_2d_1d( npti, nptidx(1:npti), sss_1d    (1:npti) , sss_m      )
231
232         ! Convert units for ice internal energy
233         DO jl = 1, jpl
234            DO jk = 1, nlay_i               
235               WHERE( v_i_2d(1:npti,jl) > 0._wp )
236                  ze_i_2d(1:npti,jk,jl) = ze_i_2d(1:npti,jk,jl) / v_i_2d(1:npti,jl) * REAL( nlay_i )
237               ELSEWHERE
238                  ze_i_2d(1:npti,jk,jl) = 0._wp
239               END WHERE
240            END DO
241         END DO
242
243         ! Keep old ice areas and volume in memory
244         zv_b(1:npti,:) = v_i_2d(1:npti,:) 
245         za_b(1:npti,:) = a_i_2d(1:npti,:)
246
247         ! --- Salinity of new ice --- !
248         SELECT CASE ( nn_icesal )
249         CASE ( 1 )                    ! Sice = constant
250            zs_newice(1:npti) = rn_icesal
251         CASE ( 2 )                    ! Sice = F(z,t) [Vancoppenolle et al (2005)]
252            DO ji = 1, npti
253               zs_newice(ji) = MIN(  4.606 + 0.91 / zh_newice(ji) , rn_simax , 0.5 * sss_1d(ji) )
254            END DO
255         CASE ( 3 )                    ! Sice = F(z) [multiyear ice]
256            zs_newice(1:npti) =   2.3
257         END SELECT
258
259         ! --- Heat content of new ice --- !
260         ! We assume that new ice is formed at the seawater freezing point
261         DO ji = 1, npti
262            ztmelts       = - rTmlt * zs_newice(ji)                  ! Melting point (C)
263            ze_newice(ji) =   rhoi * (  rcpi  * ( ztmelts - ( t_bo_1d(ji) - rt0 ) )                     &
264               &                      + rLfus * ( 1.0 - ztmelts / MIN( t_bo_1d(ji) - rt0, -epsi10 ) )   &
265               &                      - rcp   *         ztmelts )
266         END DO
267
268         ! --- Age of new ice --- !
269         zo_newice(1:npti) = 0._wp
270
271         ! --- Volume of new ice --- !
272         DO ji = 1, npti
273
274            zEi           = - ze_newice(ji) * r1_rhoi              ! specific enthalpy of forming ice [J/kg]
275
276            zEw           = rcp * ( t_bo_1d(ji) - rt0 )            ! specific enthalpy of seawater at t_bo_1d [J/kg]
277                                                                   ! clem: we suppose we are already at the freezing point (condition qlead<0 is satisfyied)
278                                                                   
279            zdE           = zEi - zEw                              ! specific enthalpy difference [J/kg]
280                                             
281            zfmdt         = - qlead_1d(ji) / zdE                   ! Fm.dt [kg/m2] (<0)
282                                                                   ! clem: we use qlead instead of zqld (icethd) because we suppose we are at the freezing point   
283            zv_newice(ji) = - zfmdt * r1_rhoi
284
285            zQm           = zfmdt * zEw                            ! heat to the ocean >0 associated with mass flux 
286
287            ! Contribution to heat flux to the ocean [W.m-2], >0 
288            hfx_thd_1d(ji) = hfx_thd_1d(ji) + zfmdt * zEw * r1_rdtice
289            ! Total heat flux used in this process [W.m-2] 
290            hfx_opw_1d(ji) = hfx_opw_1d(ji) - zfmdt * zdE * r1_rdtice
291            ! mass flux
292            wfx_opw_1d(ji) = wfx_opw_1d(ji) - zv_newice(ji) * rhoi * r1_rdtice
293            ! salt flux
294            sfx_opw_1d(ji) = sfx_opw_1d(ji) - zv_newice(ji) * rhoi * zs_newice(ji) * r1_rdtice
295         END DO
296         
297         zv_frazb(1:npti) = 0._wp
298         IF( ln_frazil ) THEN
299            ! A fraction zfrazb of frazil ice is accreted at the ice bottom
300            DO ji = 1, npti
301               rswitch       = 1._wp - MAX( 0._wp, SIGN( 1._wp , - at_i_1d(ji) ) )
302               zfrazb        = rswitch * ( TANH( rn_Cfraz * ( zvrel_1d(ji) - rn_vfraz ) ) + 1.0 ) * 0.5 * rn_maxfraz
303               zv_frazb(ji)  =         zfrazb   * zv_newice(ji)
304               zv_newice(ji) = ( 1.0 - zfrazb ) * zv_newice(ji)
305            END DO
306         END IF
307         
308         ! --- Area of new ice --- !
309         DO ji = 1, npti
310            za_newice(ji) = zv_newice(ji) / zh_newice(ji)
311         END DO
312
313         !------------------------------------------------------------------------------!
314         ! 3) Redistribute new ice area and volume into ice categories                  !
315         !------------------------------------------------------------------------------!
316
317         ! --- lateral ice growth --- !
318         ! If lateral ice growth gives an ice concentration gt 1, then
319         ! we keep the excessive volume in memory and attribute it later to bottom accretion
320         DO ji = 1, npti
321            IF ( za_newice(ji) >  ( rn_amax_1d(ji) - at_i_1d(ji) ) ) THEN
322               zda_res(ji)   = za_newice(ji) - ( rn_amax_1d(ji) - at_i_1d(ji) )
323               zdv_res(ji)   = zda_res  (ji) * zh_newice(ji) 
324               za_newice(ji) = za_newice(ji) - zda_res  (ji)
325               zv_newice(ji) = zv_newice(ji) - zdv_res  (ji)
326            ELSE
327               zda_res(ji) = 0._wp
328               zdv_res(ji) = 0._wp
329            ENDIF
330         END DO
331
332         ! find which category to fill
333         DO jl = 1, jpl
334            DO ji = 1, npti
335               IF( zh_newice(ji) > hi_max(jl-1) .AND. zh_newice(ji) <= hi_max(jl) ) THEN
336                  a_i_2d(ji,jl) = a_i_2d(ji,jl) + za_newice(ji)
337                  v_i_2d(ji,jl) = v_i_2d(ji,jl) + zv_newice(ji)
338                  jcat(ji) = jl
339               ENDIF
340            END DO
341         END DO
342         at_i_1d(1:npti) = SUM( a_i_2d(1:npti,:), dim=2 )
343
344         ! Heat content
345         DO ji = 1, npti
346            jl = jcat(ji)                                                    ! categroy in which new ice is put
347            zswinew  (ji) = MAX( 0._wp , SIGN( 1._wp , - za_b(ji,jl) ) )   ! 0 if old ice
348         END DO
349
350         DO jk = 1, nlay_i
351            DO ji = 1, npti
352               jl = jcat(ji)
353               rswitch = MAX( 0._wp, SIGN( 1._wp , v_i_2d(ji,jl) - epsi20 ) )
354               ze_i_2d(ji,jk,jl) = zswinew(ji)   *   ze_newice(ji) +                                                    &
355                  &        ( 1.0 - zswinew(ji) ) * ( ze_newice(ji) * zv_newice(ji) + ze_i_2d(ji,jk,jl) * zv_b(ji,jl) )  &
356                  &        * rswitch / MAX( v_i_2d(ji,jl), epsi20 )
357            END DO
358         END DO
359
360         ! --- bottom ice growth + ice enthalpy remapping --- !
361         DO jl = 1, jpl
362
363            ! for remapping
364            h_i_old (1:npti,0:nlay_i+1) = 0._wp
365            eh_i_old(1:npti,0:nlay_i+1) = 0._wp
366            DO jk = 1, nlay_i
367               DO ji = 1, npti
368                  h_i_old (ji,jk) = v_i_2d(ji,jl) * r1_nlay_i
369                  eh_i_old(ji,jk) = ze_i_2d(ji,jk,jl) * h_i_old(ji,jk)
370               END DO
371            END DO
372
373            ! new volumes including lateral/bottom accretion + residual
374            DO ji = 1, npti
375               rswitch        = MAX( 0._wp, SIGN( 1._wp , at_i_1d(ji) - epsi20 ) )
376               zv_newfra     = rswitch * ( zdv_res(ji) + zv_frazb(ji) ) * a_i_2d(ji,jl) / MAX( at_i_1d(ji) , epsi20 )
377               a_i_2d(ji,jl) = rswitch * a_i_2d(ji,jl)               
378               v_i_2d(ji,jl) = v_i_2d(ji,jl) + zv_newfra
379               ! for remapping
380               h_i_old (ji,nlay_i+1) = zv_newfra
381               eh_i_old(ji,nlay_i+1) = ze_newice(ji) * zv_newfra
382            END DO
383            ! --- Ice enthalpy remapping --- !
384            CALL ice_thd_ent( ze_i_2d(1:npti,:,jl) ) 
385         END DO
386
387         ! --- Update salinity --- !
388         DO jl = 1, jpl
389            DO ji = 1, npti
390               sv_i_2d(ji,jl) = sv_i_2d(ji,jl) + zs_newice(ji) * ( v_i_2d(ji,jl) - zv_b(ji,jl) )
391            END DO
392         END DO
393
394         ! Change units for e_i
395         DO jl = 1, jpl
396            DO jk = 1, nlay_i
397               ze_i_2d(1:npti,jk,jl) = ze_i_2d(1:npti,jk,jl) * v_i_2d(1:npti,jl) * r1_nlay_i 
398            END DO
399         END DO
400
401         ! Move 2D vectors to 1D vectors
402         CALL tab_2d_3d( npti, nptidx(1:npti), a_i_2d (1:npti,1:jpl), a_i (:,:,:) )
403         CALL tab_2d_3d( npti, nptidx(1:npti), v_i_2d (1:npti,1:jpl), v_i (:,:,:) )
404         CALL tab_2d_3d( npti, nptidx(1:npti), sv_i_2d(1:npti,1:jpl), sv_i(:,:,:) )
405          DO jl = 1, jpl
406            DO jk = 1, nlay_i
407               CALL tab_1d_2d( npti, nptidx(1:npti), ze_i_2d(1:npti,jk,jl), e_i(:,:,jk,jl) )
408            END DO
409         END DO
410         CALL tab_1d_2d( npti, nptidx(1:npti), sfx_opw_1d(1:npti), sfx_opw )
411         CALL tab_1d_2d( npti, nptidx(1:npti), wfx_opw_1d(1:npti), wfx_opw )
412         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_thd_1d(1:npti), hfx_thd )
413         CALL tab_1d_2d( npti, nptidx(1:npti), hfx_opw_1d(1:npti), hfx_opw )
414         !
415      ENDIF ! npti > 0
416      !
417      IF( ln_icediachk )   CALL ice_cons_hsm(1, 'icethd_do', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft)
418      !
419   END SUBROUTINE ice_thd_do
420
421
422   SUBROUTINE ice_thd_do_init
423      !!-----------------------------------------------------------------------
424      !!                   ***  ROUTINE ice_thd_do_init ***
425      !!                 
426      !! ** Purpose :   Physical constants and parameters associated with
427      !!                ice growth in the leads
428      !!
429      !! ** Method  :   Read the namthd_do namelist and check the parameters
430      !!                called at the first timestep (nit000)
431      !!
432      !! ** input   :   Namelist namthd_do
433      !!-------------------------------------------------------------------
434      INTEGER  ::   ios   ! Local integer
435      !!
436      NAMELIST/namthd_do/ rn_hinew, ln_frazil, rn_maxfraz, rn_vfraz, rn_Cfraz
437      !!-------------------------------------------------------------------
438      !
439      REWIND( numnam_ice_ref )              ! Namelist namthd_do in reference namelist : Ice thermodynamics
440      READ  ( numnam_ice_ref, namthd_do, IOSTAT = ios, ERR = 901)
441901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namthd_do in reference namelist', lwp )
442      REWIND( numnam_ice_cfg )              ! Namelist namthd_do in configuration namelist : Ice thermodynamics
443      READ  ( numnam_ice_cfg, namthd_do, IOSTAT = ios, ERR = 902 )
444902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namthd_do in configuration namelist', lwp )
445      IF(lwm) WRITE( numoni, namthd_do )
446      !
447      IF(lwp) THEN                          ! control print
448         WRITE(numout,*)
449         WRITE(numout,*) 'ice_thd_do_init: Ice growth in open water'
450         WRITE(numout,*) '~~~~~~~~~~~~~~~'
451         WRITE(numout,*) '   Namelist namthd_do:'
452         WRITE(numout,*) '      ice thickness for lateral accretion                       rn_hinew   = ', rn_hinew
453         WRITE(numout,*) '      Frazil ice thickness as a function of wind or not         ln_frazil  = ', ln_frazil
454         WRITE(numout,*) '      Maximum proportion of frazil ice collecting at bottom     rn_maxfraz = ', rn_maxfraz
455         WRITE(numout,*) '      Threshold relative drift speed for collection of frazil   rn_vfraz   = ', rn_vfraz
456         WRITE(numout,*) '      Squeezing coefficient for collection of frazil            rn_Cfraz   = ', rn_Cfraz
457      ENDIF
458      !
459      IF ( rn_hinew < rn_himin )   CALL ctl_stop( 'ice_thd_do_init : rn_hinew should be >= rn_himin' )
460      !
461   END SUBROUTINE ice_thd_do_init
462   
463#else
464   !!----------------------------------------------------------------------
465   !!   Default option                                NO SI3 sea-ice model
466   !!----------------------------------------------------------------------
467#endif
468
469   !!======================================================================
470END MODULE icethd_do
Note: See TracBrowser for help on using the repository browser.