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 @ 904

Last change on this file since 904 was 904, checked in by ctlod, 16 years ago

remove the sdvt(:,:) variable which is not initialized at all but is used in the computation of the friction velocity ust2s(:,:), see ticket: #121

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