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.
sbcice_lim.F90 in trunk/NEMO/OPA_SRC/SBC – NEMO

source: trunk/NEMO/OPA_SRC/SBC/sbcice_lim.F90 @ 918

Last change on this file since 918 was 918, checked in by rblod, 16 years ago

Change ice_ocean stress computation, step II, see ticket #128

File size: 37.1 KB
Line 
1MODULE sbcice_lim
2   !!======================================================================
3   !!                       ***  MODULE  sbcice_lim  ***
4   !! Surface module :  update surface ocean boundary condition over ice
5   !!                   covered area using LIM sea-ice model
6   !! Sea-Ice model  :  LIM 3.0 Sea ice model time-stepping
7   !!======================================================================
8   !! History :  9.0   !  06-12  (M. Vancoppenolle) Original code
9   !!            9.0   !  06-06  (G. Madec)  Surface module from icestp.F90
10   !!----------------------------------------------------------------------
11#if defined key_lim3
12   !!----------------------------------------------------------------------
13   !!   'key_lim3' :                                  LIM 3.0 sea-ice model
14   !!----------------------------------------------------------------------
15   !!----------------------------------------------------------------------
16   !!   sbc_ice_lim  : sea-ice model time-stepping and
17   !!                  update ocean sbc over ice-covered area
18   !!----------------------------------------------------------------------
19   USE oce             ! ocean dynamics and tracers
20   USE c1d             ! 1d configuration
21   USE dom_oce         ! ocean space and time domain
22   USE par_ice         ! sea-ice parameters
23   USE ice
24   USE iceini
25   USE ice_oce         ! ice variables
26   USE dom_ice
27   USE cpl_oce
28
29   USE sbc_oce         ! Surface boundary condition: ocean fields
30   USE sbc_ice         ! Surface boundary condition: ice   fields
31   USE sbcblk_core     ! Surface boundary condition: CORE bulk
32   USE sbcblk_clio     ! Surface boundary condition: CLIO bulk
33   USE albedo
34
35   USE daymod          ! day calendar
36   USE phycst          ! Define parameters for the routines
37   USE eosbn2          ! equation of state
38   USE limdyn          ! Ice dynamics
39   USE limtrp          ! Ice transport
40   USE limthd          ! Ice thermodynamics
41   USE limitd_th       ! Thermodynamics on ice thickness distribution
42   USE limitd_me       ! Mechanics on ice thickness distribution
43   USE limsbc          ! sea surface boundary condition
44   USE limdia          ! Ice diagnostics
45   USE limwri          ! Ice outputs
46   USE limrst          ! Ice restarts
47   USE limupdate       ! update of global variables
48   USE limvar          ! Ice variables switch
49
50   USE lbclnk
51   USE iom             ! I/O manager library
52   USE in_out_manager  ! I/O manager
53   USE prtctl          ! Print control
54   USE ocfzpt          ! ocean freezing point
55
56   IMPLICIT NONE
57   PRIVATE
58
59   PUBLIC sbc_ice_lim  ! routine called by sbcmod.F90
60   
61   CHARACTER(len=1) ::   cl_grid = 'C'     ! type of grid used in ice dynamics
62
63   !! * Substitutions
64#  include "domzgr_substitute.h90"
65#  include "vectopt_loop_substitute.h90"
66   !!----------------------------------------------------------------------
67   !!   OPA 9.0 , LOCEAN-IPSL (2006)
68   !! $ Id: $
69   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
70   !!----------------------------------------------------------------------
71
72CONTAINS
73
74   SUBROUTINE sbc_ice_lim( kt, kblk, kico )
75      !!---------------------------------------------------------------------
76      !!                  ***  ROUTINE sbc_ice_lim  ***
77      !!                   
78      !! ** Purpose :   update the ocean surface boundary condition via the
79      !!                Louvain la Neuve Sea Ice Model time stepping
80      !!
81      !! ** Method  :   ice model time stepping
82      !!              - call the ice dynamics routine
83      !!              - call the ice advection/diffusion routine
84      !!              - call the ice thermodynamics routine
85      !!              - call the routine that computes mass and
86      !!                heat fluxes at the ice/ocean interface
87      !!              - save the outputs
88      !!              - save the outputs for restart when necessary
89      !!
90      !! ** Action  : - time evolution of the LIM sea-ice model
91      !!              - update all sbc variables below sea-ice:
92      !!                utau, vtau, qns , qsr, emp , emps
93      !!---------------------------------------------------------------------
94      INTEGER, INTENT(in) ::   kt      ! ocean time step
95      INTEGER, INTENT(in) ::   kblk    ! type of bulk (=3 CLIO, =4 CORE)
96      INTEGER, INTENT(in) ::   kico    ! type of ice-ocean stress
97      !!
98      INTEGER  ::   ji, jj, jk, jl     ! dummy loop indices
99      INTEGER  ::   indx               ! indexes for ice points
100      INTEGER  ::   numaltests         ! number of alert tests (max 20)
101      INTEGER  ::   alert_id           ! number of the current alert
102      REAL(wp) ::   ztmelts            ! ice layer melting point
103      REAL(wp) ::   zinda   
104      INTEGER , DIMENSION(20) ::  numal                  ! number of alerts positive
105      CHARACTER (len=30), DIMENSION(20) ::   alname      ! name of alert
106      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   alb_ice_os   ! albedo of the ice under overcast sky
107      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   alb_ice_cs   ! albedo of ice under clear sky
108      !!----------------------------------------------------------------------
109
110      IF( kt == nit000 ) THEN
111         IF(lwp) WRITE(numout,*)
112         IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition' 
113         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   via Louvain la Neuve Ice Model (LIM) time stepping'
114
115         CALL ice_init
116
117         !+++++
118         indx = 12
119         jiindx = 44
120         jjindx = 140
121         WRITE(numout,*) ' The debugging point is : jiindx : ',jiindx,  &
122                                                  ' jjindx : ',jjindx
123         !+++++
124
125      ENDIF
126
127      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN
128         !
129         ! ... mean surface ocean current at ice dynamics point
130         !     C-grid dynamics :  U- & V-points as the ocean
131         u_oce(:,:) = ssu_m(:,:) * tmu(:,:)
132         v_oce(:,:) = ssv_m(:,:) * tmv(:,:)
133         !
134         CALL lbc_lnk( u_oce, 'U', -1. )   ! U-point
135         CALL lbc_lnk( v_oce, 'V', -1. )   ! V-point
136
137         ! ... masked sea surface freezing temperature [Kelvin] (set to rt0 over land)
138         t_bo(:,:) = tfreez( sss_m ) +  rt0 
139
140
141         ! ... ice albedo
142         CALL albedo_ice( t_su, ht_i, ht_s, alb_ice_cs, alb_ice_os )
143
144         ! ... Sea-ice surface boundary conditions output from bulk formulae :
145         !     - utaui_ice  ! surface ice stress i-component (I-point)   [N/m2]
146         !     - vtaui_ice  ! surface ice stress j-component (I-point)   [N/m2]
147         !     - qns_ice    ! non solar heat flux over ice   (T-point)   [W/m2]
148         !     - qsr_ice    !     solar heat flux over ice   (T-point)   [W/m2]
149         !     - qla_ice    ! latent    heat flux over ice   (T-point)   [W/m2]
150         !     - dqns_ice   ! non solar heat sensistivity    (T-point)   [W/m2]
151         !     - dqla_ice   ! latent    heat sensistivity    (T-point)   [W/m2]
152         !     - tprecip    ! total precipitation            (T-point)   [Kg/m2/s]
153         !     - sprecip    ! solid precipitation            (T-point)   [Kg/m2/s]
154         !     - fr1_i0     ! 1sr fraction of qsr penetration in ice     [%]
155         !     - fr2_i0     ! 2nd fraction of qsr penetration in ice     [%]
156         !
157         SELECT CASE( kblk )
158         CASE( 3 )           ! CLIO bulk formulation
159            CALL blk_ice_clio( t_su , u_ice , v_ice   , alb_ice_cs, alb_ice_os,            &
160               &                             utaui_ice, vtaui_ice , qns_ice   , qsr_ice,   &
161               &                             qla_ice  , dqns_ice  , dqla_ice  ,            &
162               &                             tprecip  , sprecip   ,                        &
163               &                             fr1_i0   , fr2_i0    , cl_grid  )
164
165            ! CAUTION: ocean shortwave radiation sets to zero if more than 50% of sea-ice !!gm to be removed
166            DO jj = 1, jpj
167               DO ji = 1, jpi
168                  zinda    = MAX(  0.e0, SIGN(  1.e0, -( -1.5 - freeze(ji,jj) )  )  )
169                  qsr(ji,jj) = zinda * qsr(ji,jj)
170               END DO
171            END DO
172
173         CASE( 4 )           ! CORE bulk formulation
174            CALL blk_ice_core( t_su , u_ice , v_ice   , alb_ice_cs,                      &
175               &                             utaui_ice, vtaui_ice , qns_ice , qsr_ice,   &
176               &                             qla_ice  , dqns_ice  , dqla_ice,            &
177               &                             tprecip  , sprecip   ,                      &
178               &                             fr1_i0   , fr2_i0    , cl_grid  )
179         END SELECT
180
181         IF(ln_ctl) THEN         ! print mean trends (used for debugging)
182            CALL prt_ctl_info( 'Ice Forcings ' )
183            CALL prt_ctl( tab2d_1=tprecip  ,clinfo1=' sbc_ice_lim: precip   : ' )
184            CALL prt_ctl( tab2d_1=utaui_ice,clinfo1=' sbc_ice_lim: utaui_ice: ', tab2d_2=vtaui_ice, clinfo2=' vtaui_ice: ' )
185            CALL prt_ctl( tab2d_1=sst_m    ,clinfo1=' sbc_ice_lim: sst      : ', tab2d_2=sss_m    , clinfo2=' sss      : ' )
186            CALL prt_ctl( tab2d_1=u_oce    ,clinfo1=' sbc_ice_lim: u_io     : ', tab2d_2=v_oce    , clinfo2=' v_io     : ' )
187            CALL prt_ctl( tab2d_1=frld     ,clinfo1=' sbc_ice_lim: frld   1 : ' )
188            !
189            DO jl = 1, jpl
190               CALL prt_ctl_info('* - category number ', ivar1=jl)
191               CALL prt_ctl(tab3d_1=t_su    , clinfo1=' sbc_ice_lim: t_su      : ', kdim=jl)
192               CALL prt_ctl(tab3d_1=qsr_ice , clinfo1=' sbc_ice_lim: qsr_ice   : ', kdim=jl)
193               CALL prt_ctl(tab3d_1=qns_ice , clinfo1=' sbc_ice_lim: qns_ice   : ', kdim=jl)
194               CALL prt_ctl(tab3d_1=dqns_ice, clinfo1=' sbc_ice_lim: dqns_ice  : ', kdim=jl)
195               CALL prt_ctl(tab3d_1=qla_ice , clinfo1=' sbc_ice_lim: qla_ice   : ', kdim=jl)
196               CALL prt_ctl(tab3d_1=dqla_ice, clinfo1=' sbc_ice_lim: dqla_ice  : ', kdim=jl)
197            END DO
198            !
199         ENDIF
200
201         !------------------------------------------------
202         ! Store old values of ice model global variables
203         !------------------------------------------------
204
205         old_a_i(:,:,:)   = a_i(:,:,:)     ! ice area
206         old_e_i(:,:,:,:) = e_i(:,:,:,:)   ! ice thermal energy
207         old_v_i(:,:,:)   = v_i(:,:,:)     ! ice volume
208         old_v_s(:,:,:)   = v_s(:,:,:)     ! snow volume
209         old_e_s(:,:,:,:) = e_s(:,:,:,:)   ! snow thermal energy
210         old_smv_i(:,:,:) = smv_i(:,:,:)   ! salt content
211         old_oa_i(:,:,:)  = oa_i(:,:,:)    ! areal age content
212
213         d_a_i_thd(:,:,:)   = 0.e0 ; d_a_i_trp(:,:,:)   = 0.e0
214         d_v_i_thd(:,:,:)   = 0.e0 ; d_v_i_trp(:,:,:)   = 0.e0
215         d_e_i_thd(:,:,:,:) = 0.e0 ; d_e_i_trp(:,:,:,:) = 0.e0
216         d_v_s_thd(:,:,:)   = 0.e0 ; d_v_s_trp(:,:,:)   = 0.e0
217         d_e_s_thd(:,:,:,:) = 0.e0 ; d_e_s_trp(:,:,:,:) = 0.e0
218         d_smv_i_thd(:,:,:) = 0.e0 ; d_smv_i_trp(:,:,:) = 0.e0
219         d_oa_i_thd(:,:,:)  = 0.e0 ; d_oa_i_trp(:,:,:)  = 0.e0
220
221         fseqv(:,:)     = 0.e0
222         fsbri(:,:)     = 0.e0     ; fsalt_res(:,:) = 0.e0
223         fsalt_rpo(:,:) = 0.e0
224         fhmec(:,:)     = 0.e0     ; fhbri(:,:)     = 0.e0
225         fmmec(:,:)     = 0.e0     ; fheat_res(:,:) = 0.e0
226         fheat_rpo(:,:) = 0.e0     ; focea2D(:,:)   = 0.e0
227         fsup2D(:,:)    = 0.e0
228
229         diag_sni_gr(:,:) = 0.e0   ; diag_lat_gr(:,:) = 0.e0
230         diag_bot_gr(:,:) = 0.e0   ; diag_dyn_gr(:,:) = 0.e0
231         diag_bot_me(:,:) = 0.e0   ; diag_sur_me(:,:) = 0.e0
232
233         ! dynamical invariants
234         delta_i(:,:) = 0.e0
235         divu_i(:,:)  = 0.e0
236         shear_i(:,:) = 0.e0
237
238         !----------------!
239         ! Ice model step !
240         !----------------!
241                         numit = numit + nn_fsbc
242                         CALL lim_rst_opn( kt )          ! Open Ice restart file
243                         !+++++
244                         WRITE(numout,*) ' - Beginning the time step - '
245                         CALL lim_inst_state(jiindx,jjindx,1)
246                         WRITE(numout,*) ' '
247                         !+++++
248         !---------------------|
249         ! Dynamical processes |       
250         !---------------------|
251         IF( .NOT. lk_c1d ) THEN                         ! Ice dynamics & transport (not in 1D case)
252                         CALL lim_dyn                         ! Ice dynamics    ( rheology/dynamics )
253                         CALL lim_trp                         ! Ice transport   ( Advection/diffusion )
254                         CALL lim_var_agg(1)                  ! aggregate categories, requested
255                         CALL lim_var_glo2eqv                 ! equivalent variables, requested for rafting
256                         !+++++
257                         WRITE(numout,*) ' - After ice dynamics and transport '
258                         CALL lim_inst_state( jiindx, jjindx, 1 )
259                         WRITE(numout,*)
260                         WRITE(numout,*) ' Mechanical Check ************** '
261                         WRITE(numout,*) ' Check what means ice divergence '
262                         WRITE(numout,*) ' Total ice concentration ', at_i (jiindx,jjindx)
263                         WRITE(numout,*) ' Total lead fraction     ', ato_i(jiindx,jjindx)
264                         WRITE(numout,*) ' Sum of both             ', ato_i(jiindx,jjindx) + at_i(jiindx,jjindx)
265                         WRITE(numout,*) ' Sum of both minus 1     ', ato_i(jiindx,jjindx) + at_i(jiindx,jjindx) - 1.00
266                         !+++++
267                         CALL lim_itd_me                      ! Mechanical redistribution ! (ridging/rafting)
268         ENDIF
269         !--------------------|
270         ! Ice thermodynamics |
271         !--------------------|
272                         CALL lim_var_glo2eqv            ! equivalent variables
273                         CALL lim_var_agg(1)             ! aggregate ice categories
274                         CALL lim_var_bv                 ! bulk brine volume (diag)
275                         CALL lim_thd                    ! Ice thermodynamics
276                         oa_i(:,:,:) = oa_i(:,:,:)   &
277                            &         + a_i(:,:,:)   &
278                            &         * rdt_ice      &
279                            &         / 86400.00         ! Ice natural aging
280                         CALL lim_var_glo2eqv            ! except info message that follows,
281                         !                               ! this CALL is maybe not necessary
282                         !+++++
283                         WRITE(numout,*) ' - After ice thermodynamics '
284                         CALL lim_inst_state(jiindx,jjindx,1)
285                         !+++++
286                         CALL lim_itd_th                 !  Remap ice categories, lateral accretion  !
287         !-------------------------|
288         ! Global variables update |
289         !-------------------------|
290                         CALL lim_var_agg(1)             ! requested by limupdate
291                         CALL lim_update                 ! Global variables update
292                         CALL lim_var_glo2eqv            ! equivalent variables (outputs)
293                         CALL lim_var_agg(2)             ! aggregate ice thickness categories
294                         !+++++
295                         IF(ln_nicep) THEN
296                            WRITE(numout,*) ' - Final ice state after lim_update '
297                            CALL lim_inst_state(jiindx,jjindx,2)
298                            WRITE(numout,*) ' '
299                         ENDIF
300                         !+++++
301         !--------------------------------------|
302         ! Fluxes of mass and heat to the ocean |
303         !--------------------------------------|
304                         CALL lim_sbc_flx( kt )           ! Ice/Ocean heat freshwater/salt fluxes
305         IF( ln_limdyn .AND. kico == 0 )   &              ! Ice/Ocean stresses (only in ice-dynamic case)
306            &            CALL lim_sbc_tau( kt, kico )     ! otherwise the atm.-ocean stresses are used everywhere
307
308                         !+++++
309                         WRITE(numout,*) ' - Final ice state after lim_flx    '
310                         CALL lim_inst_state(jiindx,jjindx,3)
311                         WRITE(numout,*) ' '
312                         !+++++
313         !-------------------------|
314         ! Diagnostics and outputs |
315         !-------------------------|
316         IF( MOD( kt+nn_fsbc-1, ninfo ) == 0 .OR. ntmoy == 1 )   &
317          &              CALL lim_dia                    ! Ice Diagnostics
318                         CALL lim_wri      ( 1  )        ! Ice outputs
319         IF( lrst_ice )  CALL lim_rst_write( kt )        ! Ice restart file
320                         CALL lim_var_glo2eqv
321         !
322         !-------------------------------|
323         ! Alerts in case of model crash |
324         !-------------------------------|
325
326         numaltests = 10
327         numal(:) = 0
328
329         ! Alert if incompatible volume and concentration
330         alert_id = 2 ! reference number of this alert
331         alname(alert_id) = ' Incompat vol and con         ' ! name of the alert
332
333         DO jl = 1, jpl
334            DO jj = 1, jpj
335               DO ji = 1, jpi
336                     IF ((v_i(ji,jj,jl).NE.0.0).AND.(a_i(ji,jj,jl).EQ.0.0)) THEN
337                        WRITE(numout,*) ' ALERTE 2 '
338                        WRITE(numout,*) ' Incompatible volume and concentration '
339                        WRITE(numout,*) ' at_i     ', at_i(ji,jj)
340                        WRITE(numout,*) ' Point - category', ji, jj, jl
341                        WRITE(numout,*)
342                        WRITE(numout,*) ' a_i *** a_i_old ', a_i(ji,jj,jl), old_a_i(ji,jj,jl)
343                        WRITE(numout,*) ' v_i *** v_i_old ', v_i(ji,jj,jl), old_v_i(ji,jj,jl)
344                        WRITE(numout,*) ' d_a_i_thd/trp   ', d_a_i_thd(ji,jj,jl), d_a_i_trp(ji,jj,jl)
345                        WRITE(numout,*) ' d_v_i_thd/trp   ', d_v_i_thd(ji,jj,jl), d_v_i_trp(ji,jj,jl)
346                        numal(alert_id) = numal(alert_id) + 1
347                     ENDIF
348               END DO
349            END DO
350         END DO
351
352         ! Alerte if very thick ice
353         alert_id = 3 ! reference number of this alert
354         alname(alert_id) = ' Very thick ice               ' ! name of the alert
355         jl = jpl 
356         DO jj = 1, jpj
357            DO ji = 1, jpi
358               IF (ht_i(ji,jj,jl) .GT. 50.0 ) THEN
359                  WRITE(numout,*) ' ALERTE 3 '
360                  WRITE(numout,*) ' Very thick ice '
361                  CALL lim_inst_state(ji,jj,2)
362                  WRITE(numout,*) ' '
363                  numal(alert_id) = numal(alert_id) + 1
364               ENDIF
365            END DO
366         END DO
367
368         ! Alert if very fast ice
369         alert_id = 4 ! reference number of this alert
370         alname(alert_id) = ' Very fast ice               ' ! name of the alert
371         DO jj = 1, jpj
372            DO ji = 1, jpi
373               IF ( ( ( ABS( u_ice(ji,jj) ) .GT. 0.50) .OR. &
374                      ( ABS( v_ice(ji,jj) ) .GT. 0.50) ) .AND. &
375                    ( at_i(ji,jj) .GT. 0.0 ) ) THEN
376                  WRITE(numout,*) ' ALERTE 4 '
377                  WRITE(numout,*) ' Very fast ice '
378                  CALL lim_inst_state(ji,jj,1)
379                  WRITE(numout,*) ' ice strength             : ', strength(ji,jj)
380                  WRITE(numout,*) ' oceanic stress utau      : ', utau(ji,jj) 
381                  WRITE(numout,*) ' oceanic stress vtau      : ', vtau(ji,jj)
382                  WRITE(numout,*) ' sea-ice stress utaui_ice : ', utaui_ice(ji,jj) 
383                  WRITE(numout,*) ' sea-ice stress vtaui_ice : ', vtaui_ice(ji,jj)
384                  WRITE(numout,*) ' oceanic speed u          : ', u_oce(ji,jj)
385                  WRITE(numout,*) ' oceanic speed v          : ', v_oce(ji,jj)
386                  WRITE(numout,*) ' sst                      : ', sst_m(ji,jj)
387                  WRITE(numout,*) ' sss                      : ', sss_m(ji,jj)
388                  WRITE(numout,*) 
389                  numal(alert_id) = numal(alert_id) + 1
390               ENDIF
391            END DO
392         END DO
393
394         ! Alert if there is ice on continents
395         alert_id = 6 ! reference number of this alert
396         alname(alert_id) = ' Ice on continents           ' ! name of the alert
397         DO jj = 1, jpj
398            DO ji = 1, jpi
399               IF ( ( tms(ji,jj) .LE. 0.0 ) .AND. ( at_i(ji,jj) .GT. 0.0 ) ) THEN
400                  WRITE(numout,*) ' ALERTE 6 '
401                  WRITE(numout,*) ' Ice on continents '
402                  CALL lim_inst_state(ji,jj,1)
403                  WRITE(numout,*) ' masks s, u, v        : ', tms(ji,jj), &
404                                                              tmu(ji,jj), &
405                                                              tmv(ji,jj) 
406                  WRITE(numout,*) ' sst                  : ', sst_m(ji,jj)
407                  WRITE(numout,*) ' sss                  : ', sss_m(ji,jj)
408                  WRITE(numout,*) ' at_i(ji,jj)          : ', at_i(ji,jj)
409                  WRITE(numout,*) ' v_ice(ji,jj)         : ', v_ice(ji,jj)
410                  WRITE(numout,*) ' v_ice(ji,jj-1)       : ', v_ice(ji,jj-1)
411                  WRITE(numout,*) ' u_ice(ji-1,jj)       : ', u_ice(ji-1,jj)
412                  WRITE(numout,*) ' u_ice(ji,jj)         : ', v_ice(ji,jj)
413
414                  numal(alert_id) = numal(alert_id) + 1
415
416               ENDIF
417            END DO
418         END DO
419
420         ! Alert if very fresh ice
421         alert_id = 7 ! reference number of this alert
422         alname(alert_id) = ' Very fresh ice               ' ! name of the alert
423         DO jl = 1, jpl
424         DO jj = 1, jpj
425            DO ji = 1, jpi
426               IF ( ( ( ABS( sm_i(ji,jj,jl) ) .LT. 0.50) .OR. &
427                      ( ABS( sm_i(ji,jj,jl) ) .LT. 0.50) ) .AND. &
428                    ( a_i(ji,jj,jl) .GT. 0.0 ) ) THEN
429!                 WRITE(numout,*) ' ALERTE 7 '
430!                 WRITE(numout,*) ' Very fresh ice '
431!                 CALL lim_inst_state(ji,jj,1)
432!                 WRITE(numout,*) ' sst                  : ', sst_m(ji,jj)
433!                 WRITE(numout,*) ' sss                  : ', sss_m(ji,jj)
434!                 WRITE(numout,*) ' s_i_newice           : ', s_i_newice(ji,jj,1:jpl)
435!                 WRITE(numout,*)
436                  numal(alert_id) = numal(alert_id) + 1
437               ENDIF
438            END DO
439         END DO
440         END DO
441
442         ! Alert if too old ice
443         alert_id = 9 ! reference number of this alert
444         alname(alert_id) = ' Very old   ice               ' ! name of the alert
445         DO jl = 1, jpl
446         DO jj = 1, jpj
447            DO ji = 1, jpi
448               IF ( ( ( ABS( o_i(ji,jj,jl) ) .GT. rdt_ice ) .OR. &
449                      ( ABS( o_i(ji,jj,jl) ) .LT. 0.00) ) .AND. &
450                    ( a_i(ji,jj,jl) .GT. 0.0 ) ) THEN
451                  WRITE(numout,*) ' ALERTE 9 '
452                  WRITE(numout,*) ' Wrong ice age '
453                  CALL lim_inst_state(ji,jj,1)
454                  WRITE(numout,*) 
455                  numal(alert_id) = numal(alert_id) + 1
456               ENDIF
457            END DO
458         END DO
459
460         END DO
461
462         ! Alert on salt flux
463         alert_id = 5 ! reference number of this alert
464         alname(alert_id) = ' High salt flux               ' ! name of the alert
465         DO jj = 1, jpj
466            DO ji = 1, jpi
467               IF (ABS(emps(ji,jj)).gt.1.0e-2) THEN
468               WRITE(numout,*) ' ALERTE 5 '
469               WRITE(numout,*) ' High salt flux '
470               CALL lim_inst_state(ji,jj,3)
471               WRITE(numout,*) ' '
472               DO jl = 1, jpl
473                  WRITE(numout,*) ' Category no: ', jl
474                  WRITE(numout,*) ' a_i        : ', a_i(ji,jj,jl)     , &
475                                  ' old_a_i    : ', old_a_i(ji,jj,jl)   
476                  WRITE(numout,*) ' d_a_i_trp  : ', d_a_i_trp(ji,jj,jl) , &
477                                  ' d_a_i_thd  : ', d_a_i_thd(ji,jj,jl) 
478                  WRITE(numout,*) ' v_i        : ', v_i(ji,jj,jl)    , &
479                                  ' old_v_i    : ', old_v_i(ji,jj,jl)   
480                  WRITE(numout,*) ' d_v_i_trp  : ', d_v_i_trp(ji,jj,jl) , &
481                                  ' d_v_i_thd  : ', d_v_i_thd(ji,jj,jl) 
482                  WRITE(numout,*) ' '
483                  END DO
484                  numal(alert_id) = numal(alert_id) + 1
485               ENDIF
486            END DO
487         END DO
488
489         ! Alert if qns very big
490         alert_id = 8 ! reference number of this alert
491         alname(alert_id) = ' qns very big             ' ! name of the alert
492         DO jj = 1, jpj
493            DO ji = 1, jpi
494               IF ( ( ABS( qns(ji,jj) ) .GT. 1500.0 ) .AND. &
495                    ( at_i(ji,jj) .GT. 0.0 ) )  THEN
496
497                  WRITE(numout,*) ' ALERTE 8 '
498                  WRITE(numout,*) ' ji, jj    : ', ji, jj
499                  WRITE(numout,*) ' qns       : ', qns(ji,jj)
500                  WRITE(numout,*) ' Very high non-solar heat flux '
501                  WRITE(numout,*) ' sst       : ', sst_m(ji,jj)
502                  WRITE(numout,*) ' sss       : ', sss_m(ji,jj)
503                  WRITE(numout,*) ' qcmif     : ', qcmif(jiindx,jjindx)
504                  WRITE(numout,*) ' qldif     : ', qldif(jiindx,jjindx)
505                  WRITE(numout,*) ' qcmif     : ', qcmif(jiindx,jjindx) / rdt_ice
506                  WRITE(numout,*) ' qldif     : ', qldif(jiindx,jjindx) / rdt_ice
507                  WRITE(numout,*) ' qfvbq     : ', qfvbq(jiindx,jjindx)
508                  WRITE(numout,*) ' qdtcn     : ', qdtcn(jiindx,jjindx)
509                  WRITE(numout,*) ' qfvbq / dt: ', qfvbq(jiindx,jjindx) / rdt_ice
510                  WRITE(numout,*) ' qdtcn / dt: ', qdtcn(jiindx,jjindx) / rdt_ice
511                  WRITE(numout,*) ' fdtcn     : ', fdtcn(jiindx,jjindx) 
512                  WRITE(numout,*) ' fhmec     : ', fhmec(jiindx,jjindx) 
513                  WRITE(numout,*) ' fheat_rpo : ', fheat_rpo(jiindx,jjindx) 
514                  WRITE(numout,*) ' fheat_res : ', fheat_res(jiindx,jjindx) 
515                  WRITE(numout,*) ' fhbri     : ', fhbri(jiindx,jjindx) 
516
517                  CALL lim_inst_state(ji,jj,2)
518                  numal(alert_id) = numal(alert_id) + 1
519
520               ENDIF
521            END DO
522         END DO
523         !+++++
524 
525         ! Alert if very warm ice
526         alert_id = 10 ! reference number of this alert
527         alname(alert_id) = ' Very warm ice                ' ! name of the alert
528         numal(alert_id) = 0
529         DO jl = 1, jpl
530         DO jk = 1, nlay_i
531         DO jj = 1, jpj
532            DO ji = 1, jpi
533               ztmelts    =  -tmut*s_i(ji,jj,jk,jl) + rtt
534               IF ( ( t_i(ji,jj,jk,jl) .GE. ztmelts) .AND. &
535                    ( v_i(ji,jj,jl)   .GT. 1.0e-6)   .AND. &
536                    ( a_i(ji,jj,jl) .GT. 0.0     )  ) THEN
537                  WRITE(numout,*) ' ALERTE 10 '
538                  WRITE(numout,*) ' ji, jj, jk, jl : ', ji, jj, jk, jl
539                  WRITE(numout,*) ' Very warm ice '
540                  WRITE(numout,*) ' t_i : ', t_i(ji,jj,jk,jl)
541                  WRITE(numout,*) ' e_i : ', e_i(ji,jj,jk,jl)
542                  WRITE(numout,*) ' s_i : ', s_i(ji,jj,jk,jl)
543                  WRITE(numout,*) ' ztmelts : ', ztmelts
544                  numal(alert_id) = numal(alert_id) + 1
545               ENDIF
546            END DO
547         END DO
548         END DO
549         END DO
550
551         alert_id = 1 ! reference number of this alert
552         alname(alert_id) = ' Il n''y a pas d''alerte 1       ' ! name of the alert
553         WRITE(numout,*)
554         WRITE(numout,*) ' All alerts at the end of ice model '
555         DO alert_id = 1, numaltests
556            WRITE(numout,*) alert_id, alname(alert_id)//' : ', numal(alert_id), ' times ! '
557         END DO
558         !
559      ENDIF  ! End sea-ice coupling
560      !
561   END SUBROUTINE sbc_ice_lim
562
563
564   SUBROUTINE lim_inst_state( ki, kj, kn )
565      !!-----------------------------------------------------------------------
566      !!                   ***  ROUTINE lim_inst_state ***
567      !!                 
568      !! ** Purpose :   Writes global ice state on the (i,j) point
569      !!                in ocean.ouput
570      !!                3 possibilities exist
571      !!                n = 1 -> simple ice state
572      !!                n = 2 -> exhaustive state
573      !!                n = 3 -> ice/ocean salt fluxes
574      !!
575      !! ** input   :   point coordinates (i,j)
576      !!                n : number of the option
577      !!-------------------------------------------------------------------
578      INTEGER, INTENT( in ) ::   ki, kj, kn     ! ocean time-step index
579      INTEGER :: jl
580      !!-------------------------------------------------------------------
581
582      !----------------
583      !  Simple state
584      !----------------
585
586      IF ( kn .EQ. 1 ) THEN
587         WRITE(numout,*) ' lim_inst_state - Point : ',ki,kj
588         WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
589         WRITE(numout,*) ' Simple state '
590         WRITE(numout,*) ' masks s,u,v   : ', tms(ki,kj), tmu(ki,kj), tmv(ki,kj)
591         WRITE(numout,*) ' lat - long    : ', gphit(ki,kj), glamt(ki,kj)
592         WRITE(numout,*) ' Time step     : ', numit
593         WRITE(numout,*) ' - Ice drift   '
594         WRITE(numout,*) '   ~~~~~~~~~~~ '
595         WRITE(numout,*) ' u_ice(i-1,j)  : ', u_ice(ki-1,kj)
596         WRITE(numout,*) ' u_ice(i  ,j)  : ', u_ice(ki,kj)
597         WRITE(numout,*) ' v_ice(i  ,j-1): ', v_ice(ki,kj-1)
598         WRITE(numout,*) ' v_ice(i  ,j)  : ', v_ice(ki,kj)
599         WRITE(numout,*) ' strength      : ', strength(ki,kj)
600         WRITE(numout,*)
601         WRITE(numout,*) ' - Cell values '
602         WRITE(numout,*) '   ~~~~~~~~~~~ '
603         WRITE(numout,*) ' cell area     : ', area(ki,kj)
604         WRITE(numout,*) ' at_i          : ', at_i(ki,kj)       
605         WRITE(numout,*) ' vt_i          : ', vt_i(ki,kj)       
606         WRITE(numout,*) ' vt_s          : ', vt_s(ki,kj)       
607         DO jl = 1, jpl
608            WRITE(numout,*) ' - Category (', jl,')'
609            WRITE(numout,*) ' a_i           : ', a_i(ki,kj,jl)
610            WRITE(numout,*) ' ht_i          : ', ht_i(ki,kj,jl)
611            WRITE(numout,*) ' ht_s          : ', ht_s(ki,kj,jl)
612            WRITE(numout,*) ' v_i           : ', v_i(ki,kj,jl)
613            WRITE(numout,*) ' v_s           : ', v_s(ki,kj,jl)
614            WRITE(numout,*) ' e_s           : ', e_s(ki,kj,1,jl)/1.0e9
615            WRITE(numout,*) ' e_i           : ', e_i(ki,kj,1:nlay_i,jl)/1.0e9
616            WRITE(numout,*) ' t_su          : ', t_su(ki,kj,jl)
617            WRITE(numout,*) ' t_snow        : ', t_s(ki,kj,1,jl)
618            WRITE(numout,*) ' t_i           : ', t_i(ki,kj,1:nlay_i,jl)
619            WRITE(numout,*) ' sm_i          : ', sm_i(ki,kj,jl)
620            WRITE(numout,*) ' smv_i         : ', smv_i(ki,kj,jl)
621            WRITE(numout,*)
622            WRITE(numout,*) ' Pathological case : ', patho_case(ki,kj,jl)
623         END DO
624      ENDIF
625
626      !--------------------
627      !  Exhaustive state
628      !--------------------
629
630      IF ( kn .EQ. 2 ) THEN
631         WRITE(numout,*) ' lim_inst_state - Point : ',ki,kj
632         WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
633         WRITE(numout,*) ' Exhaustive state '
634         WRITE(numout,*) ' lat - long ', gphit(ki,kj), glamt(ki,kj)
635         WRITE(numout,*) ' Time step ', numit
636         WRITE(numout,*) 
637         WRITE(numout,*) ' - Cell values '
638         WRITE(numout,*) '   ~~~~~~~~~~~ '
639         WRITE(numout,*) ' cell area     : ', area(ki,kj)
640         WRITE(numout,*) ' at_i          : ', at_i(ki,kj)       
641         WRITE(numout,*) ' vt_i          : ', vt_i(ki,kj)       
642         WRITE(numout,*) ' vt_s          : ', vt_s(ki,kj)       
643         WRITE(numout,*) ' u_ice(i-1,j)  : ', u_ice(ki-1,kj)
644         WRITE(numout,*) ' u_ice(i  ,j)  : ', u_ice(ki,kj)
645         WRITE(numout,*) ' v_ice(i  ,j-1): ', v_ice(ki,kj-1)
646         WRITE(numout,*) ' v_ice(i  ,j)  : ', v_ice(ki,kj)
647         WRITE(numout,*) ' strength      : ', strength(ki,kj)
648         WRITE(numout,*) ' d_u_ice_dyn   : ', d_u_ice_dyn(ki,kj), ' d_v_ice_dyn   : ', d_v_ice_dyn(ki,kj)
649         WRITE(numout,*) ' old_u_ice     : ', old_u_ice(ki,kj)  , ' old_v_ice     : ', old_v_ice(ki,kj) 
650         WRITE(numout,*)
651
652         DO jl = 1, jpl
653              WRITE(numout,*) ' - Category (',jl,')'
654              WRITE(numout,*) '   ~~~~~~~~         ' 
655              WRITE(numout,*) ' ht_i       : ', ht_i(ki,kj,jl)             , ' ht_s       : ', ht_s(ki,kj,jl)
656              WRITE(numout,*) ' t_i        : ', t_i(ki,kj,1:nlay_i,jl)
657              WRITE(numout,*) ' t_su       : ', t_su(ki,kj,jl)             , ' t_s        : ', t_s(ki,kj,1,jl)
658              WRITE(numout,*) ' sm_i       : ', sm_i(ki,kj,jl)             , ' o_i        : ', o_i(ki,kj,jl)
659              WRITE(numout,*) ' a_i        : ', a_i(ki,kj,jl)              , ' old_a_i    : ', old_a_i(ki,kj,jl)   
660              WRITE(numout,*) ' d_a_i_trp  : ', d_a_i_trp(ki,kj,jl)        , ' d_a_i_thd  : ', d_a_i_thd(ki,kj,jl) 
661              WRITE(numout,*) ' v_i        : ', v_i(ki,kj,jl)              , ' old_v_i    : ', old_v_i(ki,kj,jl)   
662              WRITE(numout,*) ' d_v_i_trp  : ', d_v_i_trp(ki,kj,jl)        , ' d_v_i_thd  : ', d_v_i_thd(ki,kj,jl) 
663              WRITE(numout,*) ' v_s        : ', v_s(ki,kj,jl)              , ' old_v_s    : ', old_v_s(ki,kj,jl) 
664              WRITE(numout,*) ' d_v_s_trp  : ', d_v_s_trp(ki,kj,jl)        , ' d_v_s_thd  : ', d_v_s_thd(ki,kj,jl)
665              WRITE(numout,*) ' e_i1       : ', e_i(ki,kj,1,jl)/1.0e9      , ' old_ei1    : ', old_e_i(ki,kj,1,jl)/1.0e9 
666              WRITE(numout,*) ' de_i1_trp  : ', d_e_i_trp(ki,kj,1,jl)/1.0e9, ' de_i1_thd  : ', d_e_i_thd(ki,kj,1,jl)/1.0e9
667              WRITE(numout,*) ' e_i2       : ', e_i(ki,kj,2,jl)/1.0e9      , ' old_ei2    : ', old_e_i(ki,kj,2,jl)/1.0e9 
668              WRITE(numout,*) ' de_i2_trp  : ', d_e_i_trp(ki,kj,2,jl)/1.0e9, ' de_i2_thd  : ', d_e_i_thd(ki,kj,2,jl)/1.0e9
669              WRITE(numout,*) ' e_snow     : ', e_s(ki,kj,1,jl)            , ' old_e_snow : ', old_e_s(ki,kj,1,jl) 
670              WRITE(numout,*) ' d_e_s_trp  : ', d_e_s_trp(ki,kj,1,jl)      , ' d_e_s_thd  : ', d_e_s_thd(ki,kj,1,jl)
671              WRITE(numout,*) ' smv_i      : ', smv_i(ki,kj,jl)            , ' old_smv_i  : ', old_smv_i(ki,kj,jl)   
672              WRITE(numout,*) ' d_smv_i_trp: ', d_smv_i_trp(ki,kj,jl)      , ' d_smv_i_thd: ', d_smv_i_thd(ki,kj,jl) 
673              WRITE(numout,*) ' oa_i       : ', oa_i(ki,kj,jl)             , ' old_oa_i   : ', old_oa_i(ki,kj,jl)
674              WRITE(numout,*) ' d_oa_i_trp : ', d_oa_i_trp(ki,kj,jl)       , ' d_oa_i_thd : ', d_oa_i_thd(ki,kj,jl)
675              WRITE(numout,*) ' Path. case : ', patho_case(ki,kj,jl)
676        END DO !jl
677
678        WRITE(numout,*)
679        WRITE(numout,*) ' - Heat / FW fluxes '
680        WRITE(numout,*) '   ~~~~~~~~~~~~~~~~ '
681!       WRITE(numout,*) ' fsbri      : ', fsbri(ki,kj)
682!       WRITE(numout,*) ' fseqv      : ', fseqv(ki,kj)
683!       WRITE(numout,*) ' fsalt_res  : ', fsalt_res(ki,kj)
684        WRITE(numout,*) ' fmmec      : ', fmmec(ki,kj)
685        WRITE(numout,*) ' fhmec      : ', fhmec(ki,kj)
686        WRITE(numout,*) ' fhbri      : ', fhbri(ki,kj)
687        WRITE(numout,*) ' fheat_rpo  : ', fheat_rpo(ki,kj)
688        WRITE(numout,*) 
689        WRITE(numout,*) ' sst        : ', sst_m(ki,kj) 
690        WRITE(numout,*) ' sss        : ', sss_m(ki,kj) 
691        WRITE(numout,*) 
692        WRITE(numout,*) ' - Stresses '
693        WRITE(numout,*) '   ~~~~~~~~ '
694        WRITE(numout,*) ' utaui_ice  : ', utaui_ice(ki,kj) 
695        WRITE(numout,*) ' vtaui_ice  : ', vtaui_ice(ki,kj)
696        WRITE(numout,*) ' utau       : ', utau(ki,kj) 
697        WRITE(numout,*) ' vtau       : ', vtau(ki,kj)
698        WRITE(numout,*) ' oc. vel. u : ', u_oce(ki,kj)
699        WRITE(numout,*) ' oc. vel. v : ', v_oce(ki,kj)
700     ENDIF
701
702     !---------------------
703     ! Salt / heat fluxes
704     !---------------------
705
706     IF ( kn .EQ. 3 ) THEN
707        WRITE(numout,*) ' lim_inst_state - Point : ',ki,kj
708        WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
709        WRITE(numout,*) ' - Salt / Heat Fluxes '
710        WRITE(numout,*) '   ~~~~~~~~~~~~~~~~ '
711        WRITE(numout,*) ' lat - long ', gphit(ki,kj), glamt(ki,kj)
712        WRITE(numout,*) ' Time step ', numit
713        WRITE(numout,*)
714        WRITE(numout,*) ' - Heat fluxes at bottom interface ***'
715        WRITE(numout,*) ' qsr        : ', qsr(ki,kj)
716        WRITE(numout,*) ' qns        : ', qns(ki,kj)
717        WRITE(numout,*)
718        WRITE(numout,*) ' - Salt fluxes at bottom interface ***'
719        WRITE(numout,*) ' emps       : ', emps(ki,kj)
720        WRITE(numout,*) ' emp        : ', emp(ki,kj)
721        WRITE(numout,*) ' fsbri      : ', fsbri(ki,kj)
722        WRITE(numout,*) ' fseqv      : ', fseqv(ki,kj)
723        WRITE(numout,*) ' fsalt_res  : ', fsalt_res(ki,kj)
724        WRITE(numout,*) ' fsalt_rpo  : ', fsalt_rpo(ki,kj)
725        WRITE(numout,*) ' - Heat fluxes at bottom interface ***'
726        WRITE(numout,*) ' fheat_res  : ', fheat_res(ki,kj)
727        WRITE(numout,*)
728        WRITE(numout,*) ' - Momentum fluxes '
729        WRITE(numout,*) ' utau      : ', utau(ki,kj) 
730        WRITE(numout,*) ' vtau      : ', vtau(ki,kj)
731      ENDIF
732
733   END SUBROUTINE lim_inst_state
734
735#else
736   !!----------------------------------------------------------------------
737   !!   Default option           Dummy module      NO LIM 3.0 sea-ice model
738   !!----------------------------------------------------------------------
739CONTAINS
740   SUBROUTINE sbc_ice_lim ( kt, kblk )     ! Dummy routine
741      WRITE(*,*) 'sbc_ice_lim: You should not have seen this print! error?', kt, kblk
742   END SUBROUTINE sbc_ice_lim
743#endif
744
745   !!======================================================================
746END MODULE sbcice_lim
Note: See TracBrowser for help on using the repository browser.