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.
limthd_2.F90 in trunk/NEMOGCM/NEMO/LIM_SRC_2 – NEMO

source: trunk/NEMOGCM/NEMO/LIM_SRC_2/limthd_2.F90 @ 2524

Last change on this file since 2524 was 2411, checked in by cetlod, 13 years ago

Small changes to get a better behavior of NEMO on IDRIS/IBM SP6 machine with fortran compiler xlf 13.1.0.3, see ticket #761

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 33.2 KB
Line 
1MODULE limthd_2
2   !!======================================================================
3   !!                  ***  MODULE limthd_2   ***
4   !!              LIM thermo ice model : ice thermodynamic
5   !!======================================================================
6   !! History :  1.0  ! 2000-01 (LIM)
7   !!            2.0  ! 2002-07 (C. Ethe, G. Madec) F90
8   !!            2.0  ! 2003-08 (C. Ethe)  add lim_thd_init
9   !!             -   ! 2008-2008  (A. Caubel, G. Madec, E. Maisonnave, S. Masson ) generic coupled interface
10   !!---------------------------------------------------------------------
11#if defined key_lim2
12   !!----------------------------------------------------------------------
13   !!   'key_lim2' :                                  LIM 2.0 sea-ice model
14   !!----------------------------------------------------------------------
15   !!   lim_thd_2      : thermodynamic of sea ice
16   !!   lim_thd_init_2 : initialisation of sea-ice thermodynamic
17   !!----------------------------------------------------------------------
18   USE phycst          ! physical constants
19   USE dom_oce         ! ocean space and time domain variables
20   USE domvvl
21   USE lbclnk
22   USE in_out_manager  ! I/O manager
23   USE lib_mpp
24   USE iom             ! IOM library
25   USE ice_2           ! LIM sea-ice variables
26   USE sbc_oce         !
27   USE sbc_ice         !
28   USE thd_ice_2       ! LIM thermodynamic sea-ice variables
29   USE dom_ice_2       ! LIM sea-ice domain
30   USE limthd_zdf_2
31   USE limthd_lac_2
32   USE limtab_2
33   USE prtctl          ! Print control
34   USE cpl_oasis3, ONLY : lk_cpl
35   USE diaar5, ONLY :   lk_diaar5
36     
37   IMPLICIT NONE
38   PRIVATE
39
40   PUBLIC   lim_thd_2  ! called by lim_step
41
42   REAL(wp) ::   epsi20 = 1.e-20   ! constant values
43   REAL(wp) ::   epsi16 = 1.e-16   !
44   REAL(wp) ::   epsi04 = 1.e-04   !
45   REAL(wp) ::   rzero  = 0.e0     !
46   REAL(wp) ::   rone   = 1.e0     !
47
48   !! * Substitutions
49#  include "domzgr_substitute.h90"
50#  include "vectopt_loop_substitute.h90"
51   !!-------- -------------------------------------------------------------
52   !! NEMO/LIM 3.2,  UCL-LOCEAN-IPSL (2009)
53   !! $Id$
54   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
55   !!----------------------------------------------------------------------
56
57CONTAINS
58
59   SUBROUTINE lim_thd_2( kt )
60      !!-------------------------------------------------------------------
61      !!                ***  ROUTINE lim_thd_2  ***       
62      !! 
63      !! ** Purpose : This routine manages the ice thermodynamic.
64      !!         
65      !! ** Action : - Initialisation of some variables
66      !!             - Some preliminary computation (oceanic heat flux
67      !!               at the ice base, snow acc.,heat budget of the leads)
68      !!             - selection of the icy points and put them in an array
69      !!             - call lim_vert_ther for vert ice thermodynamic
70      !!             - back to the geographic grid
71      !!             - selection of points for lateral accretion
72      !!             - call lim_lat_acc  for the ice accretion
73      !!             - back to the geographic grid
74      !!
75      !! References :   Goosse et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90
76      !!---------------------------------------------------------------------
77      INTEGER, INTENT(in) ::   kt     ! number of iteration
78      !!
79      INTEGER  ::   ji, jj               ! dummy loop indices
80      INTEGER  ::   nbpb                 ! nb of icy pts for thermo. cal.
81      INTEGER  ::   nbpac                ! nb of pts for lateral accretion
82      CHARACTER (len=22) :: charout
83      REAL(wp) ::   zfric_umin = 5e-03   ! lower bound for the friction velocity
84      REAL(wp) ::   zfric_umax = 2e-02   ! upper bound for the friction velocity
85      REAL(wp) ::   zinda                ! switch for test. the val. of concen.
86      REAL(wp) ::   zindb, zindg         ! switches for test. the val of arg
87      REAL(wp) ::   zfricp               ! temporary scalar
88      REAL(wp) ::   za , zh, zthsnice    !
89      REAL(wp) ::   zfric_u              ! friction velocity
90      REAL(wp) ::   zfnsol               ! total non solar heat
91      REAL(wp) ::   zfontn               ! heat flux from snow thickness
92      REAL(wp) ::   zfntlat, zpareff     ! test. the val. of lead heat budget
93      REAL(wp), DIMENSION(jpi,jpj)     ::   ztmp      ! 2D workspace
94      REAL(wp), DIMENSION(jpi,jpj)     ::   zqlbsbq   ! link with lead energy budget qldif
95      REAL(wp) ::   zuice_m, zvice_m     ! Sea-ice velocities at U & V-points
96      REAL(wp) ::   zhice_u, zhice_v     ! Sea-ice volume at U & V-points
97      REAL(wp) ::   ztr_fram             ! Sea-ice transport through Fram strait
98      REAL(wp) ::   zrhoij, zrhoijm1     ! temporary scalars
99      REAL(wp) ::   zztmp                ! temporary scalars within a loop
100      REAL(wp), DIMENSION(jpi,jpj)     ::   zlicegr   ! link with lateral ice growth
101      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmsk      ! 3D workspace
102!!$      REAL(wp), DIMENSION(jpi,jpj) ::   firic         !: IR flux over the ice            (outputs only)
103!!$      REAL(wp), DIMENSION(jpi,jpj) ::   fcsic         !: Sensible heat flux over the ice (outputs only)
104!!$      REAL(wp), DIMENSION(jpi,jpj) ::   fleic         !: Latent heat flux over the ice   (outputs only)
105!!$      REAL(wp), DIMENSION(jpi,jpj) ::   qlatic        !: latent flux                     (outputs only)
106      REAL(wp), DIMENSION(jpi,jpj) ::   zdvosif       !: Variation of volume at surface                (outputs only)
107      REAL(wp), DIMENSION(jpi,jpj) ::   zdvobif       !: Variation of ice volume at the bottom ice     (outputs only)
108      REAL(wp), DIMENSION(jpi,jpj) ::   zdvolif       !: Total variation of ice volume                 (outputs only)
109      REAL(wp), DIMENSION(jpi,jpj) ::   zdvonif       !: Surface accretion Snow to Ice transformation  (outputs only)
110      REAL(wp), DIMENSION(jpi,jpj) ::   zdvomif       !: Bottom variation of ice volume due to melting (outputs only)
111      REAL(wp), DIMENSION(jpi,jpj) ::   zu_imasstr    !: Sea-ice transport along i-axis at U-point     (outputs only)
112      REAL(wp), DIMENSION(jpi,jpj) ::   zv_imasstr    !: Sea-ice transport along j-axis at V-point     (outputs only)
113      !!-------------------------------------------------------------------
114
115      IF( kt == nit000 )   CALL lim_thd_init_2  ! Initialization (first time-step only)
116   
117      !-------------------------------------------!
118      !   Initilization of diagnostic variables   !
119      !-------------------------------------------!
120     
121!!gm needed?  yes at least for some of these arrays
122      zdvosif(:,:) = 0.e0   ! variation of ice volume at surface
123      zdvobif(:,:) = 0.e0   ! variation of ice volume at bottom
124      zdvolif(:,:) = 0.e0   ! total variation of ice volume
125      zdvonif(:,:) = 0.e0   ! transformation of snow to sea-ice volume
126!      zdvonif(:,:) = 0.e0   ! lateral variation of ice volume
127      zlicegr(:,:) = 0.e0   ! lateral variation of ice volume
128      zdvomif(:,:) = 0.e0   ! variation of ice volume at bottom due to melting only
129      ztr_fram     = 0.e0   ! sea-ice transport through Fram strait
130      fstric (:,:) = 0.e0   ! part of solar radiation absorbing inside the ice
131      fscmbq (:,:) = 0.e0   ! linked with fstric
132      ffltbif(:,:) = 0.e0   ! linked with fstric
133      qfvbq  (:,:) = 0.e0   ! linked with fstric
134      rdmsnif(:,:) = 0.e0   ! variation of snow mass per unit area
135      rdmicif(:,:) = 0.e0   ! variation of ice mass per unit area
136      zmsk (:,:,:) = 0.e0
137
138      ! set to zero snow thickness smaller than epsi04
139      DO jj = 1, jpj
140         DO ji = 1, jpi
141            hsnif(ji,jj)  = hsnif(ji,jj) *  MAX( rzero, SIGN( rone , hsnif(ji,jj) - epsi04 ) )
142         END DO
143      END DO
144!!gm better coded (do not use SIGN...)
145!     WHERE( hsnif(:,:) < epsi04 )   hsnif(:,:) = 0.e0
146!!gm
147
148      IF(ln_ctl)   CALL prt_ctl( tab2d_1=hsnif, clinfo1=' lim_thd: hsnif   : ' )
149     
150      !-----------------------------------!
151      !   Treatment of particular cases   !
152      !-----------------------------------!
153     
154      DO jj = 1, jpj
155         DO ji = 1, jpi
156            !  snow is transformed into ice if the original ice cover disappears.
157            zindg         = tms(ji,jj) *  MAX( rzero , SIGN( rone , -hicif(ji,jj) ) )
158            hicif(ji,jj)  = hicif(ji,jj) + zindg * rhosn * hsnif(ji,jj) / rau0
159            hsnif(ji,jj)  = ( rone - zindg ) * hsnif(ji,jj) + zindg * hicif(ji,jj) * ( rau0 - rhoic ) / rhosn
160            dmgwi(ji,jj)  = zindg * (1.0 - frld(ji,jj)) * rhoic * hicif(ji,jj)   ! snow/ice mass
161           
162            !  the lead fraction, frld, must be little than or equal to amax (ice ridging).
163            zthsnice      = hsnif(ji,jj) + hicif(ji,jj)
164            zindb         = tms(ji,jj) * ( 1.0 - MAX( rzero , SIGN( rone , - zthsnice ) ) ) 
165            za            = zindb * MIN( rone, ( 1.0 - frld(ji,jj) ) * uscomi )
166            hsnif (ji,jj) = hsnif(ji,jj)  * za
167            hicif (ji,jj) = hicif(ji,jj)  * za
168            qstoif(ji,jj) = qstoif(ji,jj) * za
169            frld  (ji,jj) = 1.0 - zindb * ( 1.0 - frld(ji,jj) ) / MAX( za, epsi20 )
170           
171            !  the in situ ice thickness, hicif, must be equal to or greater than hiclim.
172            zh            = MAX( rone , zindb * hiclim  / MAX( hicif(ji,jj), epsi20 ) )
173            hsnif (ji,jj) = hsnif(ji,jj)  * zh
174            hicif (ji,jj) = hicif(ji,jj)  * zh
175            qstoif(ji,jj) = qstoif(ji,jj) * zh
176            frld  (ji,jj) = ( frld(ji,jj) + ( zh - 1.0 ) ) / zh
177         END DO
178      END DO
179
180      IF(ln_ctl) THEN
181         CALL prt_ctl( tab2d_1=hicif , clinfo1=' lim_thd: hicif   : ' )
182         CALL prt_ctl( tab2d_1=hsnif , clinfo1=' lim_thd: hsnif   : ' )
183         CALL prt_ctl( tab2d_1=dmgwi , clinfo1=' lim_thd: dmgwi   : ' )
184         CALL prt_ctl( tab2d_1=qstoif, clinfo1=' lim_thd: qstoif  : ' )
185         CALL prt_ctl( tab2d_1=frld  , clinfo1=' lim_thd: frld    : ' )
186      ENDIF
187
188     
189      !-------------------------------!
190      !   Thermodynamics of sea ice   !
191      !-------------------------------!
192     
193      !      Partial computation of forcing for the thermodynamic sea ice model.
194      !--------------------------------------------------------------------------
195
196      sst_m(:,:) = sst_m(:,:) + rt0
197
198!CDIR NOVERRCHK
199      DO jj = 1, jpj
200!CDIR NOVERRCHK
201         DO ji = 1, jpi
202            zthsnice       = hsnif(ji,jj) + hicif(ji,jj)
203            zindb          = tms(ji,jj) * ( 1.0 - MAX( rzero , SIGN( rone , - zthsnice ) ) ) 
204            pfrld(ji,jj)   = frld(ji,jj)
205            zfricp         = 1.0 - frld(ji,jj)
206            zinda          = 1.0 - MAX( rzero , SIGN( rone , - zfricp ) )
207           
208            !  solar irradiance transmission at the mixed layer bottom and used in the lead heat budget
209            thcm(ji,jj)    = 0.e0 
210           
211            !  net downward heat flux from the ice to the ocean, expressed as a function of ocean
212            !  temperature and turbulent mixing (McPhee, 1992)
213            zfric_u        = MAX ( MIN( SQRT( ust2s(ji,jj) ) , zfric_umax ) , zfric_umin )  ! friction velocity
214            fdtcn(ji,jj)  = zindb * rau0 * rcp * 0.006  * zfric_u * ( sst_m(ji,jj) - tfu(ji,jj) ) 
215            qdtcn(ji,jj)  = zindb * fdtcn(ji,jj) * frld(ji,jj) * rdt_ice
216                       
217            !  partial computation of the lead energy budget (qldif)
218#if defined key_coupled 
219            qldif(ji,jj)   = tms(ji,jj) * rdt_ice                                             &
220               &    * (   ( qsr_tot(ji,jj) - qsr_ice(ji,jj,1) * zfricp ) * ( 1.0 - thcm(ji,jj) )   &
221               &        + ( qns_tot(ji,jj) - qns_ice(ji,jj,1) * zfricp )                           &
222               &        + frld(ji,jj) * ( fdtcn(ji,jj) + ( 1.0 - zindb ) * fsbbq(ji,jj) )   )
223#else
224            zfontn         = ( sprecip(ji,jj) / rhosn ) * xlsn  !   energy for melting solid precipitation
225            zfnsol         = qns(ji,jj)                         !  total non solar flux over the ocean
226            qldif(ji,jj)   = tms(ji,jj) * ( qsr(ji,jj) * ( 1.0 - thcm(ji,jj) )   &
227               &                               + zfnsol + fdtcn(ji,jj) - zfontn     &
228               &                               + ( 1.0 - zindb ) * fsbbq(ji,jj) )   &
229               &                        * frld(ji,jj) * rdt_ice   
230!!$            qldif(ji,jj)   = tms(ji,jj) * rdt_ice * frld(ji,jj)
231!!$               &           * ( qsr(ji,jj) * ( 1.0 - thcm(ji,jj) )      &
232!!$               &             + qns(ji,jj)  + fdtcn(ji,jj) - zfontn     &
233!!$               &             + ( 1.0 - zindb ) * fsbbq(ji,jj)      )   &
234#endif
235            !  parlat : percentage of energy used for lateral ablation (0.0)
236            zfntlat        = 1.0 - MAX( rzero , SIGN( rone ,  - qldif(ji,jj) ) )
237            zpareff        = 1.0 + ( parlat - 1.0 ) * zinda * zfntlat
238            zqlbsbq(ji,jj) = qldif(ji,jj) * ( 1.0 - zpareff ) / MAX( (1.0 - frld(ji,jj)) * rdt_ice , epsi16 )
239            qldif  (ji,jj) = zpareff *  qldif(ji,jj)
240            qdtcn  (ji,jj) = zpareff * qdtcn(ji,jj)
241           
242            !  energy needed to bring ocean surface layer until its freezing
243            qcmif  (ji,jj) =  rau0 * rcp * fse3t_m(ji,jj,1)   &
244                &          * ( tfu(ji,jj) - sst_m(ji,jj) ) * ( 1 - zinda )
245           
246            !  calculate oceanic heat flux.
247            fbif   (ji,jj) = zindb * (  fsbbq(ji,jj) / MAX( (1.0 - frld(ji,jj)) , epsi20 ) + fdtcn(ji,jj) )
248           
249            ! computation of the thermodynamic ice production (only needed for output)
250            hicifp(ji,jj) = hicif(ji,jj) * ( 1.0 - frld(ji,jj) )
251         END DO
252      END DO
253     
254      sst_m(:,:) = sst_m(:,:) - rt0
255               
256      !         Select icy points and fulfill arrays for the vectorial grid.
257      !----------------------------------------------------------------------
258      nbpb = 0
259      DO jj = 1, jpj
260         DO ji = 1, jpi
261            IF ( frld(ji,jj) < 1.0 ) THEN     
262               nbpb      = nbpb + 1
263               npb(nbpb) = (jj - 1) * jpi + ji
264            ENDIF
265         END DO
266      END DO
267
268      IF(ln_ctl) THEN
269         CALL prt_ctl(tab2d_1=pfrld, clinfo1=' lim_thd: pfrld   : ', tab2d_2=thcm   , clinfo2='  thcm    : ')
270         CALL prt_ctl(tab2d_1=fdtcn, clinfo1=' lim_thd: fdtcn   : ', tab2d_2=qdtcn  , clinfo2='  qdtcn   : ')
271         CALL prt_ctl(tab2d_1=qldif, clinfo1=' lim_thd: qldif   : ', tab2d_2=zqlbsbq, clinfo2='  zqlbsbq : ')
272         CALL prt_ctl(tab2d_1=qcmif, clinfo1=' lim_thd: qcmif   : ', tab2d_2=fbif   , clinfo2='  fbif    : ')
273         zmsk(:,:,1) = tms(:,:)
274         CALL prt_ctl(tab2d_1=qcmif , clinfo1=' lim_thd: qcmif  : ', mask1=zmsk)
275         CALL prt_ctl(tab2d_1=hicifp, clinfo1=' lim_thd: hicifp : ')
276         WRITE(charout, FMT="('lim_thd: nbpb = ',I4)") nbpb
277         CALL prt_ctl_info(charout)
278      ENDIF
279     
280     
281      ! If there is no ice, do nothing. Otherwise, compute Top and Bottom accretion/ablation
282      !------------------------------------------------------------------------------------
283
284      IF( nbpb > 0 ) THEN
285         !   
286         !  put the variable in a 1-D array for thermodynamics process
287         CALL tab_2d_1d_2( nbpb, frld_1d    (1:nbpb)     , frld           , jpi, jpj, npb(1:nbpb) )
288         CALL tab_2d_1d_2( nbpb, h_ice_1d   (1:nbpb)     , hicif          , jpi, jpj, npb(1:nbpb) )
289         CALL tab_2d_1d_2( nbpb, h_snow_1d  (1:nbpb)     , hsnif          , jpi, jpj, npb(1:nbpb) )
290         CALL tab_2d_1d_2( nbpb, sist_1d    (1:nbpb)     , sist           , jpi, jpj, npb(1:nbpb) )
291         CALL tab_2d_1d_2( nbpb, tbif_1d    (1:nbpb , 1 ), tbif(:,:,1)    , jpi, jpj, npb(1:nbpb) )
292         CALL tab_2d_1d_2( nbpb, tbif_1d    (1:nbpb , 2 ), tbif(:,:,2)    , jpi, jpj, npb(1:nbpb) )
293         CALL tab_2d_1d_2( nbpb, tbif_1d    (1:nbpb , 3 ), tbif(:,:,3)    , jpi, jpj, npb(1:nbpb) )
294         CALL tab_2d_1d_2( nbpb, qsr_ice_1d (1:nbpb)     , qsr_ice(:,:,1) , jpi, jpj, npb(1:nbpb) )
295         CALL tab_2d_1d_2( nbpb, fr1_i0_1d  (1:nbpb)     , fr1_i0         , jpi, jpj, npb(1:nbpb) )
296         CALL tab_2d_1d_2( nbpb, fr2_i0_1d  (1:nbpb)     , fr2_i0         , jpi, jpj, npb(1:nbpb) )
297         CALL tab_2d_1d_2( nbpb,  qns_ice_1d(1:nbpb)     ,  qns_ice(:,:,1), jpi, jpj, npb(1:nbpb) )
298         CALL tab_2d_1d_2( nbpb, dqns_ice_1d(1:nbpb)     , dqns_ice(:,:,1), jpi, jpj, npb(1:nbpb) )
299         IF( .NOT. lk_cpl ) THEN
300            CALL tab_2d_1d_2( nbpb, qla_ice_1d (1:nbpb)     ,  qla_ice(:,:,1), jpi, jpj, npb(1:nbpb) )
301            CALL tab_2d_1d_2( nbpb, dqla_ice_1d(1:nbpb)     , dqla_ice(:,:,1), jpi, jpj, npb(1:nbpb) )
302         ENDIF
303         CALL tab_2d_1d_2( nbpb, tfu_1d     (1:nbpb)     , tfu        , jpi, jpj, npb(1:nbpb) )
304         CALL tab_2d_1d_2( nbpb, sprecip_1d (1:nbpb)     , sprecip    , jpi, jpj, npb(1:nbpb) ) 
305         CALL tab_2d_1d_2( nbpb, fbif_1d    (1:nbpb)     , fbif       , jpi, jpj, npb(1:nbpb) )
306         CALL tab_2d_1d_2( nbpb, thcm_1d    (1:nbpb)     , thcm       , jpi, jpj, npb(1:nbpb) )
307         CALL tab_2d_1d_2( nbpb, qldif_1d   (1:nbpb)     , qldif      , jpi, jpj, npb(1:nbpb) )
308         CALL tab_2d_1d_2( nbpb, qstbif_1d  (1:nbpb)     , qstoif     , jpi, jpj, npb(1:nbpb) )
309         CALL tab_2d_1d_2( nbpb, rdmicif_1d (1:nbpb)     , rdmicif    , jpi, jpj, npb(1:nbpb) )
310         CALL tab_2d_1d_2( nbpb, dmgwi_1d   (1:nbpb)     , dmgwi      , jpi, jpj, npb(1:nbpb) )
311         CALL tab_2d_1d_2( nbpb, qlbbq_1d   (1:nbpb)     , zqlbsbq    , jpi, jpj, npb(1:nbpb) )
312         !
313         CALL lim_thd_zdf_2( 1, nbpb )       !  compute ice growth
314         !
315         !  back to the geographic grid.
316         CALL tab_1d_2d_2( nbpb, frld       , npb, frld_1d   (1:nbpb)     , jpi, jpj )
317         CALL tab_1d_2d_2( nbpb, hicif      , npb, h_ice_1d  (1:nbpb)     , jpi, jpj )
318         CALL tab_1d_2d_2( nbpb, hsnif      , npb, h_snow_1d (1:nbpb)     , jpi, jpj )
319         CALL tab_1d_2d_2( nbpb, sist       , npb, sist_1d   (1:nbpb)     , jpi, jpj )
320         CALL tab_1d_2d_2( nbpb, tbif(:,:,1), npb, tbif_1d   (1:nbpb , 1 ), jpi, jpj )   
321         CALL tab_1d_2d_2( nbpb, tbif(:,:,2), npb, tbif_1d   (1:nbpb , 2 ), jpi, jpj )   
322         CALL tab_1d_2d_2( nbpb, tbif(:,:,3), npb, tbif_1d   (1:nbpb , 3 ), jpi, jpj )   
323         CALL tab_1d_2d_2( nbpb, fscmbq     , npb, fscbq_1d  (1:nbpb)     , jpi, jpj )
324         CALL tab_1d_2d_2( nbpb, ffltbif    , npb, fltbif_1d (1:nbpb)     , jpi, jpj )
325         CALL tab_1d_2d_2( nbpb, fstric     , npb, fstbif_1d (1:nbpb)     , jpi, jpj )
326         CALL tab_1d_2d_2( nbpb, qldif      , npb, qldif_1d  (1:nbpb)     , jpi, jpj )
327         CALL tab_1d_2d_2( nbpb, qfvbq      , npb, qfvbq_1d  (1:nbpb)     , jpi, jpj )
328         CALL tab_1d_2d_2( nbpb, qstoif     , npb, qstbif_1d (1:nbpb)     , jpi, jpj )
329         CALL tab_1d_2d_2( nbpb, rdmicif    , npb, rdmicif_1d(1:nbpb)     , jpi, jpj )
330         CALL tab_1d_2d_2( nbpb, dmgwi      , npb, dmgwi_1d  (1:nbpb)     , jpi, jpj )
331         CALL tab_1d_2d_2( nbpb, rdmsnif    , npb, rdmsnif_1d(1:nbpb)     , jpi, jpj )
332         CALL tab_1d_2d_2( nbpb, zdvosif    , npb, dvsbq_1d  (1:nbpb)     , jpi, jpj )
333         CALL tab_1d_2d_2( nbpb, zdvobif    , npb, dvbbq_1d  (1:nbpb)     , jpi, jpj )
334         CALL tab_1d_2d_2( nbpb, zdvomif    , npb, rdvomif_1d(1:nbpb)     , jpi, jpj )
335         CALL tab_1d_2d_2( nbpb, zdvolif    , npb, dvlbq_1d  (1:nbpb)     , jpi, jpj )
336         CALL tab_1d_2d_2( nbpb, zdvonif    , npb, dvnbq_1d  (1:nbpb)     , jpi, jpj ) 
337         CALL tab_1d_2d_2( nbpb, qsr_ice(:,:,1), npb, qsr_ice_1d(1:nbpb)  , jpi, jpj )
338         CALL tab_1d_2d_2( nbpb, qns_ice(:,:,1), npb, qns_ice_1d(1:nbpb)  , jpi, jpj )
339         IF( .NOT. lk_cpl )   CALL tab_1d_2d_2( nbpb, qla_ice(:,:,1), npb, qla_ice_1d(1:nbpb)  , jpi, jpj )
340         !
341      ENDIF
342
343      ! Up-date sea ice thickness
344      !--------------------------
345      DO jj = 1, jpj
346         DO ji = 1, jpi
347            phicif(ji,jj) = hicif(ji,jj) 
348            hicif(ji,jj)  = hicif(ji,jj) *  ( rone -  MAX( rzero, SIGN( rone, - ( 1.0 - frld(ji,jj) ) ) ) )
349         END DO
350      END DO
351
352     
353      ! Tricky trick : add 2 to frld in the Southern Hemisphere
354      !--------------------------------------------------------
355      IF( fcor(1,1) < 0.e0 ) THEN
356         DO jj = 1, njeqm1
357            DO ji = 1, jpi
358               frld(ji,jj) = frld(ji,jj) + 2.0
359            END DO
360         END DO
361      ENDIF
362
363      CALL lbc_lnk( frld , 'T', 1. )     
364     
365      ! Select points for lateral accretion (this occurs when heat exchange
366      ! between ice and ocean is negative; ocean losing heat)
367      !-----------------------------------------------------------------
368      nbpac = 0
369      DO jj = 1, jpj
370         DO ji = 1, jpi
371!i yes!     IF ( ( qcmif(ji,jj) - qldif(ji,jj) ) > 0.e0 ) THEN
372            IF ( tms(ji,jj) * ( qcmif(ji,jj) - qldif(ji,jj) ) > 0.e0 ) THEN
373               nbpac = nbpac + 1
374               npac( nbpac ) = (jj - 1) * jpi + ji
375            ENDIF
376         END DO
377      END DO
378     
379      IF(ln_ctl) THEN
380         CALL prt_ctl(tab2d_1=phicif, clinfo1=' lim_thd: phicif  : ', tab2d_2=hicif, clinfo2=' hicif : ')
381         WRITE(charout, FMT="('lim_thd: nbpac = ',I4)") nbpac
382         CALL prt_ctl_info(charout)
383      ENDIF
384
385
386      ! If ocean gains heat do nothing ; otherwise, one performs lateral accretion
387      !--------------------------------------------------------------------------------
388      IF( nbpac > 0 ) THEN
389         !
390         zlicegr(:,:) = rdmicif(:,:)      ! to output the lateral sea-ice growth
391         !...Put the variable in a 1-D array for lateral accretion
392         CALL tab_2d_1d_2( nbpac, frld_1d   (1:nbpac)     , frld       , jpi, jpj, npac(1:nbpac) )
393         CALL tab_2d_1d_2( nbpac, h_snow_1d (1:nbpac)     , hsnif      , jpi, jpj, npac(1:nbpac) )
394         CALL tab_2d_1d_2( nbpac, h_ice_1d  (1:nbpac)     , hicif      , jpi, jpj, npac(1:nbpac) )
395         CALL tab_2d_1d_2( nbpac, tbif_1d   (1:nbpac , 1 ), tbif(:,:,1), jpi, jpj, npac(1:nbpac) )   
396         CALL tab_2d_1d_2( nbpac, tbif_1d   (1:nbpac , 2 ), tbif(:,:,2), jpi, jpj, npac(1:nbpac) )   
397         CALL tab_2d_1d_2( nbpac, tbif_1d   (1:nbpac , 3 ), tbif(:,:,3), jpi, jpj, npac(1:nbpac) )   
398         CALL tab_2d_1d_2( nbpac, qldif_1d  (1:nbpac)     , qldif      , jpi, jpj, npac(1:nbpac) )
399         CALL tab_2d_1d_2( nbpac, qcmif_1d  (1:nbpac)     , qcmif      , jpi, jpj, npac(1:nbpac) )
400         CALL tab_2d_1d_2( nbpac, qstbif_1d (1:nbpac)     , qstoif     , jpi, jpj, npac(1:nbpac) )
401         CALL tab_2d_1d_2( nbpac, rdmicif_1d(1:nbpac)     , rdmicif    , jpi, jpj, npac(1:nbpac) )
402         CALL tab_2d_1d_2( nbpac, dvlbq_1d  (1:nbpac)     , zdvolif    , jpi, jpj, npac(1:nbpac) )
403         CALL tab_2d_1d_2( nbpac, tfu_1d    (1:nbpac)     , tfu        , jpi, jpj, npac(1:nbpac) )
404         !
405         CALL lim_thd_lac_2( 1 , nbpac )         ! lateral accretion routine.
406         !
407         !   back to the geographic grid
408         CALL tab_1d_2d_2( nbpac, frld       , npac(1:nbpac), frld_1d   (1:nbpac)     , jpi, jpj )
409         CALL tab_1d_2d_2( nbpac, hsnif      , npac(1:nbpac), h_snow_1d (1:nbpac)     , jpi, jpj )
410         CALL tab_1d_2d_2( nbpac, hicif      , npac(1:nbpac), h_ice_1d  (1:nbpac)     , jpi, jpj )
411         CALL tab_1d_2d_2( nbpac, tbif(:,:,1), npac(1:nbpac), tbif_1d   (1:nbpac , 1 ), jpi, jpj )
412         CALL tab_1d_2d_2( nbpac, tbif(:,:,2), npac(1:nbpac), tbif_1d   (1:nbpac , 2 ), jpi, jpj )
413         CALL tab_1d_2d_2( nbpac, tbif(:,:,3), npac(1:nbpac), tbif_1d   (1:nbpac , 3 ), jpi, jpj )
414         CALL tab_1d_2d_2( nbpac, qstoif     , npac(1:nbpac), qstbif_1d (1:nbpac)     , jpi, jpj )
415         CALL tab_1d_2d_2( nbpac, rdmicif    , npac(1:nbpac), rdmicif_1d(1:nbpac)     , jpi, jpj )
416         CALL tab_1d_2d_2( nbpac, zdvolif    , npac(1:nbpac), dvlbq_1d  (1:nbpac)     , jpi, jpj )
417         !
418      ENDIF
419       
420       
421      ! Recover frld values between 0 and 1 in the Southern Hemisphere (tricky trick)
422      ! Update daily thermodynamic ice production.   
423      !------------------------------------------------------------------------------
424      DO jj = 1, jpj
425         DO ji = 1, jpi
426            frld  (ji,jj) = MIN( frld(ji,jj), ABS( frld(ji,jj) - 2.0 ) )
427            fr_i  (ji,jj) = 1.0 - frld(ji,jj) 
428            hicifp(ji,jj) = hicif(ji,jj) * fr_i(ji,jj) - hicifp(ji,jj)
429         END DO
430      END DO
431
432      ! Outputs
433      !--------------------------------------------------------------------------------
434      ztmp(:,:) = 1. - pfrld(:,:)                                ! fraction of ice after the dynamic, before the thermodynamic
435      CALL iom_put( 'ioceflxb', fbif )                           ! Oceanic flux at the ice base           [W/m2 ???]
436      CALL iom_put( 'ist_cea', (sist(:,:) - rt0) * ztmp(:,:) )   ! Ice surface temperature                [Celius]
437      CALL iom_put( 'qsr_ai_cea', qsr_ice(:,:,1) * ztmp(:,:) )   ! Solar flux over the ice                [W/m2]
438      CALL iom_put( 'qns_ai_cea', qns_ice(:,:,1) * ztmp(:,:) )   ! Non-solar flux over the ice            [W/m2]
439      IF( .NOT. lk_cpl )   CALL iom_put( 'qla_ai_cea', qla_ice(:,:,1) * ztmp(:,:) )     ! Latent flux over the ice  [W/m2]
440      !
441      CALL iom_put( 'snowthic_cea', hsnif  (:,:) * fr_i(:,:) )   ! Snow thickness             [m]
442      CALL iom_put( 'icethic_cea' , hicif  (:,:) * fr_i(:,:) )   ! Ice thickness              [m]
443      zztmp = 1.0 / rdt_ice
444      CALL iom_put( 'iceprod_cea' , hicifp (:,:) * zztmp     )   ! Ice produced               [m/s]
445      IF( lk_diaar5 ) THEN
446         CALL iom_put( 'snowmel_cea' , rdmsnif(:,:) * zztmp     )   ! Snow melt                  [kg/m2/s]
447         zztmp = rhoic / rdt_ice
448         CALL iom_put( 'sntoice_cea' , zdvonif(:,:) * zztmp     )   ! Snow to Ice transformation [kg/m2/s]
449         CALL iom_put( 'ticemel_cea' , zdvosif(:,:) * zztmp     )   ! Melt at Sea Ice top        [kg/m2/s]
450         CALL iom_put( 'bicemel_cea' , zdvomif(:,:) * zztmp     )   ! Melt at Sea Ice bottom     [kg/m2/s]
451         zlicegr(:,:) = MAX( 0.e0, rdmicif(:,:)-zlicegr(:,:) )
452         CALL iom_put( 'licepro_cea' , zlicegr(:,:) * zztmp     )   ! Latereal sea ice growth    [kg/m2/s]
453      ENDIF
454      !
455      ! Compute the Eastward & Northward sea-ice transport
456      zztmp = 0.25 * rhoic
457      DO jj = 1, jpjm1 
458         DO ji = 1, jpim1   ! NO vector opt.
459            ! Ice velocities, volume & transport at U & V-points
460            zuice_m = u_ice(ji+1,jj+1) + u_ice(ji+1,jj )
461            zvice_m = v_ice(ji+1,jj+1) + v_ice(ji ,jj+1)
462            zhice_u = hicif(ji,jj)*e2t(ji,jj)*fr_i(ji,jj) + hicif(ji+1,jj  )*e2t(ji+1,jj  )*fr_i(ji+1,jj  )
463            zhice_v = hicif(ji,jj)*e1t(ji,jj)*fr_i(ji,jj) + hicif(ji  ,jj+1)*e1t(ji  ,jj+1)*fr_i(ji  ,jj+1)
464            zu_imasstr(ji,jj) = zztmp * zhice_u * zuice_m 
465            zv_imasstr(ji,jj) = zztmp * zhice_v * zvice_m 
466         END DO
467      END DO
468      CALL lbc_lnk( zu_imasstr, 'U', -1. )   ;   CALL lbc_lnk( zv_imasstr, 'V', -1. )
469      CALL iom_put( 'u_imasstr',  zu_imasstr(:,:) )   ! Ice transport along i-axis at U-point [kg/s]
470      CALL iom_put( 'v_imasstr',  zv_imasstr(:,:) )   ! Ice transport along j-axis at V-point [kg/s]
471
472      !! Fram Strait sea-ice transport (sea-ice + snow)  (in ORCA2 = 5 points)
473      IF( cp_cfg == "orca" .AND. jp_cfg == 2 ) THEN    ! ORCA R2 configuration
474         DO jj = mj0(137), mj1(137) ! B grid
475            IF( mj0(jj-1) >= nldj ) THEN
476               DO ji = MAX(mi0(134),nldi), MIN(mi1(138),nlei)
477                  zrhoij    = e1t(ji,jj  ) * fr_i(ji,jj  ) * ( rhoic*hicif(ji,jj  ) + rhosn*hsnif(ji,jj  ) ) 
478                  zrhoijm1  = e1t(ji,jj-1) * fr_i(ji,jj-1) * ( rhoic*hicif(ji,jj-1) + rhosn*hsnif(ji,jj-1) ) 
479                  ztr_fram  = ztr_fram - 0.25 * ( v_ice(ji,jj)+ v_ice(ji+1,jj) ) * ( zrhoij + zrhoijm1 )
480               END DO
481            ENDIF
482         END DO
483         IF( lk_mpp )   CALL mpp_sum( ztr_fram )
484         CALL iom_put( 'fram_trans', ztr_fram )   ! Ice transport through Fram strait     [kg/s]
485      ENDIF
486
487!! ce     ztmp(:,:) = 1. - AINT( frld(:,:), wp )                        ! return 1 as soon as there is ice
488!! ce     A big warning because the model crashes on IDRIS/IBM SP6 with xlf 13.1.0.3, see ticket #761
489!! ce     We Unroll the loop and everything works fine
490      DO jj = 1, jpj
491         DO ji = 1, jpi
492            ztmp(ji,jj) = 1. - AINT( frld(ji,jj), wp )                ! return 1 as soon as there is ice
493         END DO
494      END DO
495      !
496      CALL iom_put( 'ice_pres'  , ztmp                            )   ! Ice presence                          [-]
497      CALL iom_put( 'ist_ipa'   , ( sist(:,:) - rt0 ) * ztmp(:,:) )   ! Ice surface temperature               [Celius]
498      CALL iom_put( 'uice_ipa'  ,  u_ice(:,:)         * ztmp(:,:) )   ! Ice velocity along i-axis at I-point  [m/s]
499      CALL iom_put( 'vice_ipa'  ,  v_ice(:,:)         * ztmp(:,:) )   ! Ice velocity along j-axis at I-point  [m/s]
500
501      IF(ln_ctl) THEN
502         CALL prt_ctl_info(' lim_thd  end  ')
503         CALL prt_ctl( tab2d_1=hicif      , clinfo1=' lim_thd: hicif   : ', tab2d_2=hsnif , clinfo2=' hsnif  : ' )
504         CALL prt_ctl( tab2d_1=frld       , clinfo1=' lim_thd: frld    : ', tab2d_2=hicifp, clinfo2=' hicifp : ' )
505         CALL prt_ctl( tab2d_1=phicif     , clinfo1=' lim_thd: phicif  : ', tab2d_2=pfrld , clinfo2=' pfrld  : ' )
506         CALL prt_ctl( tab2d_1=sist       , clinfo1=' lim_thd: sist    : ' )
507         CALL prt_ctl( tab2d_1=tbif(:,:,1), clinfo1=' lim_thd: tbif 1  : ' )
508         CALL prt_ctl( tab2d_1=tbif(:,:,2), clinfo1=' lim_thd: tbif 2  : ' )
509         CALL prt_ctl( tab2d_1=tbif(:,:,3), clinfo1=' lim_thd: tbif 3  : ' )
510         CALL prt_ctl( tab2d_1=fdtcn      , clinfo1=' lim_thd: fdtcn   : ', tab2d_2=qdtcn , clinfo2=' qdtcn  : ' )
511         CALL prt_ctl( tab2d_1=qstoif     , clinfo1=' lim_thd: qstoif  : ', tab2d_2=fsbbq , clinfo2=' fsbbq  : ' )
512      ENDIF
513       !
514    END SUBROUTINE lim_thd_2
515
516
517    SUBROUTINE lim_thd_init_2
518      !!-------------------------------------------------------------------
519      !!                   ***  ROUTINE lim_thd_init_2 ***
520      !!                 
521      !! ** Purpose :   Physical constants and parameters linked to the ice
522      !!      thermodynamics
523      !!
524      !! ** Method  :   Read the namicethd namelist and check the ice-thermo
525      !!       parameter values called at the first timestep (nit000)
526      !!
527      !! ** input   :   Namelist namicether
528      !!-------------------------------------------------------------------
529      NAMELIST/namicethd/ hmelt , hiccrit, hicmin, hiclim, amax  ,        &
530         &                swiqst, sbeta  , parlat, hakspl, hibspl, exld,  &
531         &                hakdif, hnzst  , thth  , parsub, alphs
532      !!-------------------------------------------------------------------
533      !
534      REWIND( numnam_ice )                  ! read namelist
535      READ  ( numnam_ice , namicethd )
536      IF( lk_cpl .AND. parsub /= 0.0 )   CALL ctl_stop( 'In coupled mode, use parsub = 0. or send dqla' )
537      !
538      IF(lwp) THEN                          ! control print
539         WRITE(numout,*)
540         WRITE(numout,*)'lim_thd_init_2: ice parameters for ice thermodynamic computation '
541         WRITE(numout,*)'~~~~~~~~~~~~~~'
542         WRITE(numout,*)'       maximum melting at the bottom                           hmelt        = ', hmelt
543         WRITE(numout,*)'       ice thick. for lateral accretion in NH (SH)             hiccrit(1/2) = ', hiccrit
544         WRITE(numout,*)'       ice thick. corr. to max. energy stored in brine pocket  hicmin       = ', hicmin 
545         WRITE(numout,*)'       minimum ice thickness                                   hiclim       = ', hiclim 
546         WRITE(numout,*)'       maximum lead fraction                                   amax         = ', amax
547         WRITE(numout,*)'       energy stored in brine pocket (=1) or not (=0)          swiqst       = ', swiqst 
548         WRITE(numout,*)'       numerical carac. of the scheme for diffusion in ice '
549         WRITE(numout,*)'       Cranck-Nicholson (=0.5), implicit (=1), explicit (=0)   sbeta        = ', sbeta
550         WRITE(numout,*)'       percentage of energy used for lateral ablation          parlat       = ', parlat
551         WRITE(numout,*)'       slope of distr. for Hakkinen-Mellor lateral melting     hakspl       = ', hakspl 
552         WRITE(numout,*)'       slope of distribution for Hibler lateral melting        hibspl       = ', hibspl
553         WRITE(numout,*)'       exponent for leads-closure rate                         exld         = ', exld
554         WRITE(numout,*)'       coefficient for diffusions of ice and snow              hakdif       = ', hakdif
555         WRITE(numout,*)'       threshold thick. for comp. of eq. thermal conductivity  zhth         = ', thth 
556         WRITE(numout,*)'       thickness of the surf. layer in temp. computation       hnzst        = ', hnzst
557         WRITE(numout,*)'       switch for snow sublimation  (=1) or not (=0)           parsub       = ', parsub 
558         WRITE(numout,*)'       coefficient for snow density when snow ice formation    alphs        = ', alphs
559      ENDIF
560      !         
561      uscomi = 1.0 / ( 1.0 - amax )   ! inverse of minimum lead fraction
562      rcdsn = hakdif * rcdsn 
563      rcdic = hakdif * rcdic
564      !
565      IF( hsndif > 100.e0 .OR. hicdif > 100.e0 ) THEN
566         cnscg = 0.e0
567      ELSE
568         cnscg = rcpsn / rcpic   ! ratio  rcpsn/rcpic
569      ENDIF
570      !
571   END SUBROUTINE lim_thd_init_2
572
573#else
574   !!----------------------------------------------------------------------
575   !!   Default option          Dummy module       NO LIM 2.0 sea-ice model
576   !!----------------------------------------------------------------------
577CONTAINS
578   SUBROUTINE lim_thd_2         ! Dummy routine
579   END SUBROUTINE lim_thd_2
580#endif
581
582   !!======================================================================
583END MODULE limthd_2
Note: See TracBrowser for help on using the repository browser.