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

Last change on this file since 1469 was 1469, checked in by smasson, 15 years ago

[uv]taui_ice renamed [uv]tau_ice, see ticket:452

  • Property svn:keywords set to Id
File size: 35.2 KB
Line 
1MODULE sbcice_lim
2   !!======================================================================
3   !!                       ***  MODULE  sbcice_lim  ***
4   !! Surface module :  update the ocean surface 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 :  2.0   !  2006-12  (M. Vancoppenolle) Original code
9   !!            3.0   !  2008-02  (C. Talandier)  Surface module from icestp.F90
10   !!            9.0   !  2008-04  (G. Madec)  sltyle and lim_ctl routine
11   !!----------------------------------------------------------------------
12#if defined key_lim3
13   !!----------------------------------------------------------------------
14   !!   'key_lim3' :                                  LIM 3.0 sea-ice model
15   !!----------------------------------------------------------------------
16   !!   sbc_ice_lim  : sea-ice model time-stepping and update ocean sbc over ice-covered area
17   !!   lim_ctl       : alerts in case of ice model crash
18   !!   lim_prt_state : ice control print at a given grid point
19   !!----------------------------------------------------------------------
20   USE oce             ! ocean dynamics and tracers
21   USE c1d             ! 1d configuration
22   USE dom_oce         ! ocean space and time domain
23   USE lib_mpp
24   USE par_ice         ! sea-ice parameters
25   USE ice
26   USE iceini
27   USE dom_ice
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   !! NEMO/LIM 3.0 , UCL-LOCEAN-IPSL  (2008)
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, kico )
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      INTEGER, INTENT(in) ::   kico    ! ice-ocean stress treatment
96      !!
97      INTEGER  ::   jl                 ! loop index
98      REAL(wp) ::   zcoef              ! temporary scalar
99      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   alb_ice_os   ! albedo of the ice under overcast sky
100      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   alb_ice_cs   ! albedo of ice under clear sky
101      !!----------------------------------------------------------------------
102
103      IF( kt == nit000 ) THEN
104         IF(lwp) WRITE(numout,*)
105         IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition' 
106         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   via Louvain la Neuve Ice Model (LIM-3) time stepping'
107         !
108         CALL ice_init
109         !
110         IF( ln_nicep ) THEN      ! control print at a given point
111            jiindx = 44   ;   jjindx = 140
112            WRITE(numout,*) ' The debugging point is : jiindx : ',jiindx, ' jjindx : ',jjindx
113         ENDIF
114      ENDIF
115
116      !                                        !----------------------!
117      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !  Ice time-step only  !
118         !                                     !----------------------!
119         !                                           !  Bulk Formulea !
120         !                                           !----------------!
121         !
122         u_oce(:,:) = ssu_m(:,:)                     ! mean surface ocean current at ice velocity point
123         v_oce(:,:) = ssv_m(:,:)                     ! (C-grid dynamics :  U- & V-points as the ocean)
124         !
125         t_bo(:,:) = tfreez( sss_m ) +  rt0          ! masked sea surface freezing temperature [Kelvin]
126         !                                           ! (set to rt0 over land)
127         CALL albedo_ice( t_su, ht_i, ht_s, alb_ice_cs, alb_ice_os )  ! ... ice albedo
128
129         DO jl = 1, jpl
130            t_su(:,:,jl) = t_su(:,:,jl) +  rt0 * ( 1. - tmask(:,:,1) )
131         END DO
132                                                     ! Bulk formulea - provides the following fields:
133         ! utau_ice, vtau_ice : surface ice stress                     (U- & V-points)   [N/m2]
134         ! qsr_ice , qns_ice  : solar & non solar heat flux over ice   (T-point)         [W/m2]
135         ! qla_ice            : latent heat flux over ice              (T-point)         [W/m2]
136         ! dqns_ice, dqla_ice : non solar & latent heat sensistivity   (T-point)         [W/m2]
137         ! tprecip , sprecip  : total & solid precipitation            (T-point)         [Kg/m2/s]
138         ! fr1_i0  , fr2_i0   : 1sr & 2nd fraction of qsr penetration in ice             [%]
139         !
140         SELECT CASE( kblk )
141         CASE( 3 )                                       ! CLIO bulk formulation
142            CALL blk_ice_clio( t_su , alb_ice_cs, alb_ice_os,                           &
143               &                      utau_ice  , vtau_ice  , qns_ice   , qsr_ice   ,   &
144               &                      qla_ice   , dqns_ice  , dqla_ice  ,               &
145               &                      tprecip   , sprecip   ,                           &
146               &                      fr1_i0    , fr2_i0    , cl_grid, jpl  )
147            !         
148         CASE( 4 )                                       ! CORE bulk formulation
149            CALL blk_ice_core( t_su , u_ice     , v_ice     , alb_ice_cs,               &
150               &                      utau_ice  , vtau_ice  , qns_ice   , qsr_ice   ,   &
151               &                      qla_ice   , dqns_ice  , dqla_ice  ,               &
152               &                      tprecip   , sprecip   ,                           &
153               &                      fr1_i0    , fr2_i0    , cl_grid, jpl  )
154         END SELECT
155
156         !                                           !----------------------!
157         !                                           ! LIM-3  time-stepping !
158         !                                           !----------------------!
159         !
160         numit = numit + nn_fsbc                     ! Ice model time step
161         !
162         !                                           ! Store previous ice values
163!!gm : remark   old_...   should becomes ...b  as tn versus tb 
164         old_a_i(:,:,:)   = a_i(:,:,:)     ! ice area
165         old_e_i(:,:,:,:) = e_i(:,:,:,:)   ! ice thermal energy
166         old_v_i(:,:,:)   = v_i(:,:,:)     ! ice volume
167         old_v_s(:,:,:)   = v_s(:,:,:)     ! snow volume
168         old_e_s(:,:,:,:) = e_s(:,:,:,:)   ! snow thermal energy
169         old_smv_i(:,:,:) = smv_i(:,:,:)   ! salt content
170         old_oa_i(:,:,:)  = oa_i(:,:,:)    ! areal age content
171
172         !                                           ! intialisation to zero    !!gm is it truly necessary ???
173         d_a_i_thd(:,:,:)   = 0.e0 ; d_a_i_trp(:,:,:)   = 0.e0
174         d_v_i_thd(:,:,:)   = 0.e0 ; d_v_i_trp(:,:,:)   = 0.e0
175         d_e_i_thd(:,:,:,:) = 0.e0 ; d_e_i_trp(:,:,:,:) = 0.e0
176         d_v_s_thd(:,:,:)   = 0.e0 ; d_v_s_trp(:,:,:)   = 0.e0
177         d_e_s_thd(:,:,:,:) = 0.e0 ; d_e_s_trp(:,:,:,:) = 0.e0
178         d_smv_i_thd(:,:,:) = 0.e0 ; d_smv_i_trp(:,:,:) = 0.e0
179         d_oa_i_thd(:,:,:)  = 0.e0 ; d_oa_i_trp(:,:,:)  = 0.e0
180         !
181         fseqv(:,:)     = 0.e0
182         fsbri(:,:)     = 0.e0     ; fsalt_res(:,:) = 0.e0
183         fsalt_rpo(:,:) = 0.e0
184         fhmec(:,:)     = 0.e0     ; fhbri(:,:)     = 0.e0
185         fmmec(:,:)     = 0.e0     ; fheat_res(:,:) = 0.e0
186         fheat_rpo(:,:) = 0.e0     ; focea2D(:,:)   = 0.e0
187         fsup2D(:,:)    = 0.e0
188         !
189         diag_sni_gr(:,:) = 0.e0   ; diag_lat_gr(:,:) = 0.e0
190         diag_bot_gr(:,:) = 0.e0   ; diag_dyn_gr(:,:) = 0.e0
191         diag_bot_me(:,:) = 0.e0   ; diag_sur_me(:,:) = 0.e0
192         ! dynamical invariants
193         delta_i(:,:) = 0.e0       ; divu_i (:,:) = 0.e0       ;    shear_i(:,:) = 0.e0
194
195                          CALL lim_rst_opn( kt )     ! Open Ice restart file
196         !
197         IF( ln_nicep )   CALL lim_prt_state( jiindx, jjindx, 1, ' - Beginning the time step - ' )   ! control print
198         !
199         IF( .NOT. lk_c1d ) THEN                     ! Ice dynamics & transport (not in 1D case)
200                          CALL lim_dyn( kt )              ! Ice dynamics    ( rheology/dynamics )
201                          CALL lim_trp( kt )              ! Ice transport   ( Advection/diffusion )
202                          CALL lim_var_agg(1)             ! aggregate categories, requested
203                          CALL lim_var_glo2eqv            ! equivalent variables, requested for rafting
204         IF( ln_nicep )   CALL lim_prt_state( jiindx, jjindx,-1, ' - ice dyn & trp - ' )   ! control print
205                          CALL lim_itd_me                 ! Mechanical redistribution ! (ridging/rafting)
206         ENDIF
207         !
208         !                                           ! Ice thermodynamics
209                          CALL lim_var_glo2eqv            ! equivalent variables
210                          CALL lim_var_agg(1)             ! aggregate ice categories
211                          CALL lim_var_bv                 ! bulk brine volume (diag)
212                          CALL lim_thd( kt )              ! Ice thermodynamics
213                          zcoef = rdt_ice / 86400.e0      !  Ice natural aging
214                          oa_i(:,:,:) = oa_i(:,:,:) + a_i(:,:,:) * zcoef
215                          CALL lim_var_glo2eqv            ! this CALL is maybe not necessary (Martin)
216         IF( ln_nicep )   CALL lim_prt_state( jiindx, jjindx, 1, ' - ice thermodyn. - ' )   ! control print
217                          CALL lim_itd_th( kt )           !  Remap ice categories, lateral accretion  !
218         !
219         !                                           ! Global variables update |
220                          CALL lim_var_agg( 1 )           ! requested by limupdate
221                          CALL lim_update                 ! Global variables update
222                          CALL lim_var_glo2eqv            ! equivalent variables (outputs)
223                          CALL lim_var_agg(2)             ! aggregate ice thickness categories
224         IF( ln_nicep )   CALL lim_prt_state( jiindx, jjindx, 2, ' - Final state - ' )   ! control print
225         !
226         !                                           ! Fluxes of mass and heat to the ocean |
227                         CALL lim_sbc_flx( kt )           ! Ice/Ocean heat freshwater/salt fluxes
228         IF( ln_limdyn .AND. kico == 0 )   &              ! Ice/Ocean stresses (only in ice-dynamic case)
229            &            CALL lim_sbc_tau( kt, kico )     ! otherwise the atm.-ocean stresses are used everywhere
230         !
231         IF( ln_nicep )   CALL lim_prt_state( jiindx, jjindx, 3, ' - Final state lim_sbc - ' )   ! control print
232         !
233         !                                           ! Diagnostics and outputs
234#if defined key_zdftke2
235         IF( kt .NE. nitend+1 ) THEN
236            IF( ( MOD( kt+nn_fsbc-1, ninfo ) == 0 .OR. ntmoy == 1 ) .AND. .NOT. lk_mpp )   &
237               &             CALL lim_dia 
238                             CALL lim_wri( 1  )              ! Ice outputs
239            IF( lrst_ice )   CALL lim_rst_write( kt )        ! Ice restart file
240                             CALL lim_var_glo2eqv            ! ???
241            !
242            IF( ln_nicep )   CALL lim_ctl               ! alerts in case of model crash
243            !
244         ENDIF
245#else
246         IF( ( MOD( kt+nn_fsbc-1, ninfo ) == 0 .OR. ntmoy == 1 ) .AND. .NOT. lk_mpp )   &
247            &             CALL lim_dia 
248                          CALL lim_wri( 1  )              ! Ice outputs
249         IF( lrst_ice )   CALL lim_rst_write( kt )        ! Ice restart file
250                          CALL lim_var_glo2eqv            ! ???
251         !
252         IF( ln_nicep )   CALL lim_ctl               ! alerts in case of model crash
253         !
254#endif
255      ENDIF                                          ! End sea-ice time step only
256
257      !                                              !--------------------------!
258      ! Ice/Ocean stresses (nn_ico_cpl=1 or 2 cases) !  at all ocean time step  !
259      !                                              !--------------------------!
260      IF( ln_limdyn .AND. kico /= 0 )   &
261         &                CALL lim_sbc_tau( kt, kico ) 
262!!gm   remark, in this case the ocean-ice stress is not saved in diag call above .....  find a solution!!!
263      !
264   END SUBROUTINE sbc_ice_lim
265
266
267   SUBROUTINE lim_ctl
268      !!-----------------------------------------------------------------------
269      !!                   ***  ROUTINE lim_ctl ***
270      !!                 
271      !! ** Purpose :   Alerts in case of model crash
272      !!-------------------------------------------------------------------
273      INTEGER  ::   ji, jj, jk,  jl   ! dummy loop indices
274      INTEGER  ::   inb_altests       ! number of alert tests (max 20)
275      INTEGER  ::   ialert_id         ! number of the current alert
276      REAL(wp) ::   ztmelts           ! ice layer melting point
277      CHARACTER (len=30), DIMENSION(20)      ::   cl_alname   ! name of alert
278      INTEGER           , DIMENSION(20)      ::   inb_alp     ! number of alerts positive
279      !!-------------------------------------------------------------------
280
281      inb_altests = 10
282      inb_alp(:) = 0
283
284      ! Alert if incompatible volume and concentration
285      ialert_id = 2 ! reference number of this alert
286      cl_alname(ialert_id) = ' Incompat vol and con         '    ! name of the alert
287
288      DO jl = 1, jpl
289         DO jj = 1, jpj
290            DO ji = 1, jpi
291               IF(  v_i(ji,jj,jl) /= 0.e0   .AND.   a_i(ji,jj,jl) == 0.e0   ) THEN
292                  WRITE(numout,*) ' ALERTE 2 :   Incompatible volume and concentration '
293                  WRITE(numout,*) ' at_i     ', at_i(ji,jj)
294                  WRITE(numout,*) ' Point - category', ji, jj, jl
295                  WRITE(numout,*) ' a_i *** a_i_old ', a_i      (ji,jj,jl), old_a_i  (ji,jj,jl)
296                  WRITE(numout,*) ' v_i *** v_i_old ', v_i      (ji,jj,jl), old_v_i  (ji,jj,jl)
297                  WRITE(numout,*) ' d_a_i_thd/trp   ', d_a_i_thd(ji,jj,jl), d_a_i_trp(ji,jj,jl)
298                  WRITE(numout,*) ' d_v_i_thd/trp   ', d_v_i_thd(ji,jj,jl), d_v_i_trp(ji,jj,jl)
299                  inb_alp(ialert_id) = inb_alp(ialert_id) + 1
300               ENDIF
301            END DO
302         END DO
303      END DO
304
305      ! Alerte if very thick ice
306      ialert_id = 3 ! reference number of this alert
307      cl_alname(ialert_id) = ' Very thick ice               ' ! name of the alert
308      jl = jpl 
309      DO jj = 1, jpj
310         DO ji = 1, jpi
311            IF(   ht_i(ji,jj,jl) .GT. 50.0   ) THEN
312               CALL lim_prt_state( ji, jj, 2, ' ALERTE 3 :   Very thick ice ' )
313               inb_alp(ialert_id) = inb_alp(ialert_id) + 1
314            ENDIF
315         END DO
316      END DO
317
318      ! Alert if very fast ice
319      ialert_id = 4 ! reference number of this alert
320      cl_alname(ialert_id) = ' Very fast ice               ' ! name of the alert
321      DO jj = 1, jpj
322         DO ji = 1, jpi
323            IF(   MAX( ABS( u_ice(ji,jj) ), ABS( v_ice(ji,jj) ) ) .GT. 0.5  .AND.  &
324               &  at_i(ji,jj) .GT. 0.e0   ) THEN
325               CALL lim_prt_state( ji, jj, 1, ' ALERTE 4 :   Very fast ice ' )
326               WRITE(numout,*) ' ice strength             : ', strength(ji,jj)
327               WRITE(numout,*) ' oceanic stress utau      : ', utau(ji,jj) 
328               WRITE(numout,*) ' oceanic stress vtau      : ', vtau(ji,jj)
329               WRITE(numout,*) ' sea-ice stress utau_ice  : ', utau_ice(ji,jj) 
330               WRITE(numout,*) ' sea-ice stress vtau_ice  : ', vtau_ice(ji,jj)
331               WRITE(numout,*) ' oceanic speed u          : ', u_oce(ji,jj)
332               WRITE(numout,*) ' oceanic speed v          : ', v_oce(ji,jj)
333               WRITE(numout,*) ' sst                      : ', sst_m(ji,jj)
334               WRITE(numout,*) ' sss                      : ', sss_m(ji,jj)
335               WRITE(numout,*) 
336               inb_alp(ialert_id) = inb_alp(ialert_id) + 1
337            ENDIF
338         END DO
339      END DO
340
341      ! Alert if there is ice on continents
342      ialert_id = 6 ! reference number of this alert
343      cl_alname(ialert_id) = ' Ice on continents           ' ! name of the alert
344      DO jj = 1, jpj
345         DO ji = 1, jpi
346            IF(   tms(ji,jj) .LE. 0.0   .AND.   at_i(ji,jj) .GT. 0.e0   ) THEN
347               CALL lim_prt_state( ji, jj, 1, ' ALERTE 6 :   Ice on continents ' )
348               WRITE(numout,*) ' masks s, u, v        : ', tms(ji,jj), tmu(ji,jj), tmv(ji,jj) 
349               WRITE(numout,*) ' sst                  : ', sst_m(ji,jj)
350               WRITE(numout,*) ' sss                  : ', sss_m(ji,jj)
351               WRITE(numout,*) ' at_i(ji,jj)          : ', at_i(ji,jj)
352               WRITE(numout,*) ' v_ice(ji,jj)         : ', v_ice(ji,jj)
353               WRITE(numout,*) ' v_ice(ji,jj-1)       : ', v_ice(ji,jj-1)
354               WRITE(numout,*) ' u_ice(ji-1,jj)       : ', u_ice(ji-1,jj)
355               WRITE(numout,*) ' u_ice(ji,jj)         : ', v_ice(ji,jj)
356               !
357               inb_alp(ialert_id) = inb_alp(ialert_id) + 1
358            ENDIF
359         END DO
360      END DO
361
362!
363!     ! Alert if very fresh ice
364      ialert_id = 7 ! reference number of this alert
365      cl_alname(ialert_id) = ' Very fresh ice               ' ! name of the alert
366      DO jl = 1, jpl
367         DO jj = 1, jpj
368            DO ji = 1, jpi
369!!gm  test twice sm_i ...  ????  bug?
370               IF( ( ( ABS( sm_i(ji,jj,jl) ) .LT. 0.50) .OR. &
371                     ( ABS( sm_i(ji,jj,jl) ) .LT. 0.50) ) .AND. &
372                             ( a_i(ji,jj,jl) .GT. 0.e0 ) ) THEN
373!                 CALL lim_prt_state(ji,jj,1, ' ALERTE 7 :   Very fresh ice ' )
374!                 WRITE(numout,*) ' sst                  : ', sst_m(ji,jj)
375!                 WRITE(numout,*) ' sss                  : ', sss_m(ji,jj)
376!                 WRITE(numout,*) ' s_i_newice           : ', s_i_newice(ji,jj,1:jpl)
377!                 WRITE(numout,*)
378                  inb_alp(ialert_id) = inb_alp(ialert_id) + 1
379               ENDIF
380            END DO
381         END DO
382      END DO
383!
384
385!     ! Alert if too old ice
386      ialert_id = 9 ! reference number of this alert
387      cl_alname(ialert_id) = ' Very old   ice               ' ! name of the alert
388      DO jl = 1, jpl
389         DO jj = 1, jpj
390            DO ji = 1, jpi
391               IF ( ( ( ABS( o_i(ji,jj,jl) ) .GT. rdt_ice ) .OR. &
392                      ( ABS( o_i(ji,jj,jl) ) .LT. 0.00) ) .AND. &
393                             ( a_i(ji,jj,jl) .GT. 0.0 ) ) THEN
394                  CALL lim_prt_state( ji, jj, 1, ' ALERTE 9 :   Wrong ice age ')
395                  inb_alp(ialert_id) = inb_alp(ialert_id) + 1
396               ENDIF
397            END DO
398         END DO
399      END DO
400 
401      ! Alert on salt flux
402      ialert_id = 5 ! reference number of this alert
403      cl_alname(ialert_id) = ' High salt flux               ' ! name of the alert
404      DO jj = 1, jpj
405         DO ji = 1, jpi
406            IF( ABS( emps(ji,jj) ) .GT. 1.0e-2 ) THEN
407               CALL lim_prt_state( ji, jj, 3, ' ALERTE 5 :   High salt flux ' )
408               DO jl = 1, jpl
409                  WRITE(numout,*) ' Category no: ', jl
410                  WRITE(numout,*) ' a_i        : ', a_i      (ji,jj,jl) , ' old_a_i    : ', old_a_i  (ji,jj,jl)   
411                  WRITE(numout,*) ' d_a_i_trp  : ', d_a_i_trp(ji,jj,jl) , ' d_a_i_thd  : ', d_a_i_thd(ji,jj,jl) 
412                  WRITE(numout,*) ' v_i        : ', v_i      (ji,jj,jl) , ' old_v_i    : ', old_v_i  (ji,jj,jl)   
413                  WRITE(numout,*) ' d_v_i_trp  : ', d_v_i_trp(ji,jj,jl) , ' d_v_i_thd  : ', d_v_i_thd(ji,jj,jl) 
414                  WRITE(numout,*) ' '
415               END DO
416               inb_alp(ialert_id) = inb_alp(ialert_id) + 1
417            ENDIF
418         END DO
419      END DO
420
421      ! Alert if qns very big
422      ialert_id = 8 ! reference number of this alert
423      cl_alname(ialert_id) = ' fnsolar very big             ' ! name of the alert
424      DO jj = 1, jpj
425         DO ji = 1, jpi
426            IF(   ABS( qns(ji,jj) ) .GT. 1500.0   .AND.  ( at_i(ji,jj) .GT. 0.0 ) )  THEN
427               !
428               WRITE(numout,*) ' ALERTE 8 :   Very high non-solar heat flux'
429               WRITE(numout,*) ' ji, jj    : ', ji, jj
430               WRITE(numout,*) ' qns       : ', qns(ji,jj)
431               WRITE(numout,*) ' sst       : ', sst_m(ji,jj)
432               WRITE(numout,*) ' sss       : ', sss_m(ji,jj)
433               WRITE(numout,*) ' qcmif     : ', qcmif(ji,jj)
434               WRITE(numout,*) ' qldif     : ', qldif(ji,jj)
435               WRITE(numout,*) ' qcmif     : ', qcmif(ji,jj) / rdt_ice
436               WRITE(numout,*) ' qldif     : ', qldif(ji,jj) / rdt_ice
437               WRITE(numout,*) ' qfvbq     : ', qfvbq(ji,jj)
438               WRITE(numout,*) ' qdtcn     : ', qdtcn(ji,jj)
439               WRITE(numout,*) ' qfvbq / dt: ', qfvbq(ji,jj) / rdt_ice
440               WRITE(numout,*) ' qdtcn / dt: ', qdtcn(ji,jj) / rdt_ice
441               WRITE(numout,*) ' fdtcn     : ', fdtcn(ji,jj) 
442               WRITE(numout,*) ' fhmec     : ', fhmec(ji,jj) 
443               WRITE(numout,*) ' fheat_rpo : ', fheat_rpo(ji,jj) 
444               WRITE(numout,*) ' fheat_res : ', fheat_res(ji,jj) 
445               WRITE(numout,*) ' fhbri     : ', fhbri(ji,jj) 
446               !
447               CALL lim_prt_state( ji, jj, 2, '   ')
448               inb_alp(ialert_id) = inb_alp(ialert_id) + 1
449               !
450            ENDIF
451         END DO
452      END DO
453      !+++++
454 
455      ! Alert if very warm ice
456      ialert_id = 10 ! reference number of this alert
457      cl_alname(ialert_id) = ' Very warm ice                ' ! name of the alert
458      inb_alp(ialert_id) = 0
459      DO jl = 1, jpl
460         DO jk = 1, nlay_i
461            DO jj = 1, jpj
462               DO ji = 1, jpi
463                  ztmelts    =  -tmut * s_i(ji,jj,jk,jl) + rtt
464                  IF( t_i(ji,jj,jk,jl) .GE. ztmelts  .AND.  v_i(ji,jj,jl) .GT. 1.e-6   &
465                     &                               .AND.  a_i(ji,jj,jl) .GT. 0.e0    ) THEN
466                     WRITE(numout,*) ' ALERTE 10 :   Very warm ice'
467                     WRITE(numout,*) ' ji, jj, jk, jl : ', ji, jj, jk, jl
468                     WRITE(numout,*) ' t_i : ', t_i(ji,jj,jk,jl)
469                     WRITE(numout,*) ' e_i : ', e_i(ji,jj,jk,jl)
470                     WRITE(numout,*) ' s_i : ', s_i(ji,jj,jk,jl)
471                     WRITE(numout,*) ' ztmelts : ', ztmelts
472                     inb_alp(ialert_id) = inb_alp(ialert_id) + 1
473                  ENDIF
474               END DO
475            END DO
476         END DO
477      END DO
478
479      ialert_id = 1                                 ! reference number of this alert
480      cl_alname(ialert_id) = ' NO alerte 1      '   ! name of the alert
481      WRITE(numout,*)
482      WRITE(numout,*) ' All alerts at the end of ice model '
483      DO ialert_id = 1, inb_altests
484         WRITE(numout,*) ialert_id, cl_alname(ialert_id)//' : ', inb_alp(ialert_id), ' times ! '
485      END DO
486      !
487   END SUBROUTINE lim_ctl
488 
489   
490   SUBROUTINE lim_prt_state( ki, kj, kn, cd1 )
491      !!-----------------------------------------------------------------------
492      !!                   ***  ROUTINE lim_prt_state ***
493      !!                 
494      !! ** Purpose :   Writes global ice state on the (i,j) point
495      !!                in ocean.ouput
496      !!                3 possibilities exist
497      !!                n = 1/-1 -> simple ice state (plus Mechanical Check if -1)
498      !!                n = 2    -> exhaustive state
499      !!                n = 3    -> ice/ocean salt fluxes
500      !!
501      !! ** input   :   point coordinates (i,j)
502      !!                n : number of the option
503      !!-------------------------------------------------------------------
504      INTEGER         , INTENT(in) ::   ki, kj, kn    ! ocean gridpoint indices
505      CHARACTER(len=*), INTENT(in) ::   cd1           !
506      !!
507      INTEGER :: jl
508      !!-------------------------------------------------------------------
509
510      WRITE(numout,*) cd1             ! print title
511
512      !----------------
513      !  Simple state
514      !----------------
515
516      IF ( kn == 1 .OR. kn == -1 ) THEN
517         WRITE(numout,*) ' lim_prt_state - Point : ',ki,kj
518         WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
519         WRITE(numout,*) ' Simple state '
520         WRITE(numout,*) ' masks s,u,v   : ', tms(ki,kj), tmu(ki,kj), tmv(ki,kj)
521         WRITE(numout,*) ' lat - long    : ', gphit(ki,kj), glamt(ki,kj)
522         WRITE(numout,*) ' Time step     : ', numit
523         WRITE(numout,*) ' - Ice drift   '
524         WRITE(numout,*) '   ~~~~~~~~~~~ '
525         WRITE(numout,*) ' u_ice(i-1,j)  : ', u_ice(ki-1,kj)
526         WRITE(numout,*) ' u_ice(i  ,j)  : ', u_ice(ki,kj)
527         WRITE(numout,*) ' v_ice(i  ,j-1): ', v_ice(ki,kj-1)
528         WRITE(numout,*) ' v_ice(i  ,j)  : ', v_ice(ki,kj)
529         WRITE(numout,*) ' strength      : ', strength(ki,kj)
530         WRITE(numout,*)
531         WRITE(numout,*) ' - Cell values '
532         WRITE(numout,*) '   ~~~~~~~~~~~ '
533         WRITE(numout,*) ' cell area     : ', area(ki,kj)
534         WRITE(numout,*) ' at_i          : ', at_i(ki,kj)       
535         WRITE(numout,*) ' vt_i          : ', vt_i(ki,kj)       
536         WRITE(numout,*) ' vt_s          : ', vt_s(ki,kj)       
537         DO jl = 1, jpl
538            WRITE(numout,*) ' - Category (', jl,')'
539            WRITE(numout,*) ' a_i           : ', a_i(ki,kj,jl)
540            WRITE(numout,*) ' ht_i          : ', ht_i(ki,kj,jl)
541            WRITE(numout,*) ' ht_s          : ', ht_s(ki,kj,jl)
542            WRITE(numout,*) ' v_i           : ', v_i(ki,kj,jl)
543            WRITE(numout,*) ' v_s           : ', v_s(ki,kj,jl)
544            WRITE(numout,*) ' e_s           : ', e_s(ki,kj,1,jl)/1.0e9
545            WRITE(numout,*) ' e_i           : ', e_i(ki,kj,1:nlay_i,jl)/1.0e9
546            WRITE(numout,*) ' t_su          : ', t_su(ki,kj,jl)
547            WRITE(numout,*) ' t_snow        : ', t_s(ki,kj,1,jl)
548            WRITE(numout,*) ' t_i           : ', t_i(ki,kj,1:nlay_i,jl)
549            WRITE(numout,*) ' sm_i          : ', sm_i(ki,kj,jl)
550            WRITE(numout,*) ' smv_i         : ', smv_i(ki,kj,jl)
551            WRITE(numout,*)
552            WRITE(numout,*) ' Pathological case : ', patho_case(ki,kj,jl)
553         END DO
554      ENDIF
555      IF( kn == -1 ) THEN
556         WRITE(numout,*) ' Mechanical Check ************** '
557         WRITE(numout,*) ' Check what means ice divergence '
558         WRITE(numout,*) ' Total ice concentration ', at_i (ki,kj)
559         WRITE(numout,*) ' Total lead fraction     ', ato_i(ki,kj)
560         WRITE(numout,*) ' Sum of both             ', ato_i(ki,kj) + at_i(ki,kj)
561         WRITE(numout,*) ' Sum of both minus 1     ', ato_i(ki,kj) + at_i(ki,kj) - 1.00
562      ENDIF
563
564
565      !--------------------
566      !  Exhaustive state
567      !--------------------
568
569      IF ( kn .EQ. 2 ) THEN
570         WRITE(numout,*) ' lim_prt_state - Point : ',ki,kj
571         WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
572         WRITE(numout,*) ' Exhaustive state '
573         WRITE(numout,*) ' lat - long ', gphit(ki,kj), glamt(ki,kj)
574         WRITE(numout,*) ' Time step ', numit
575         WRITE(numout,*) 
576         WRITE(numout,*) ' - Cell values '
577         WRITE(numout,*) '   ~~~~~~~~~~~ '
578         WRITE(numout,*) ' cell area     : ', area(ki,kj)
579         WRITE(numout,*) ' at_i          : ', at_i(ki,kj)       
580         WRITE(numout,*) ' vt_i          : ', vt_i(ki,kj)       
581         WRITE(numout,*) ' vt_s          : ', vt_s(ki,kj)       
582         WRITE(numout,*) ' u_ice(i-1,j)  : ', u_ice(ki-1,kj)
583         WRITE(numout,*) ' u_ice(i  ,j)  : ', u_ice(ki,kj)
584         WRITE(numout,*) ' v_ice(i  ,j-1): ', v_ice(ki,kj-1)
585         WRITE(numout,*) ' v_ice(i  ,j)  : ', v_ice(ki,kj)
586         WRITE(numout,*) ' strength      : ', strength(ki,kj)
587         WRITE(numout,*) ' d_u_ice_dyn   : ', d_u_ice_dyn(ki,kj), ' d_v_ice_dyn   : ', d_v_ice_dyn(ki,kj)
588         WRITE(numout,*) ' old_u_ice     : ', old_u_ice(ki,kj)  , ' old_v_ice     : ', old_v_ice(ki,kj) 
589         WRITE(numout,*)
590
591         DO jl = 1, jpl
592              WRITE(numout,*) ' - Category (',jl,')'
593              WRITE(numout,*) '   ~~~~~~~~         ' 
594              WRITE(numout,*) ' ht_i       : ', ht_i(ki,kj,jl)             , ' ht_s       : ', ht_s(ki,kj,jl)
595              WRITE(numout,*) ' t_i        : ', t_i(ki,kj,1:nlay_i,jl)
596              WRITE(numout,*) ' t_su       : ', t_su(ki,kj,jl)             , ' t_s        : ', t_s(ki,kj,1,jl)
597              WRITE(numout,*) ' sm_i       : ', sm_i(ki,kj,jl)             , ' o_i        : ', o_i(ki,kj,jl)
598              WRITE(numout,*) ' a_i        : ', a_i(ki,kj,jl)              , ' old_a_i    : ', old_a_i(ki,kj,jl)   
599              WRITE(numout,*) ' d_a_i_trp  : ', d_a_i_trp(ki,kj,jl)        , ' d_a_i_thd  : ', d_a_i_thd(ki,kj,jl) 
600              WRITE(numout,*) ' v_i        : ', v_i(ki,kj,jl)              , ' old_v_i    : ', old_v_i(ki,kj,jl)   
601              WRITE(numout,*) ' d_v_i_trp  : ', d_v_i_trp(ki,kj,jl)        , ' d_v_i_thd  : ', d_v_i_thd(ki,kj,jl) 
602              WRITE(numout,*) ' v_s        : ', v_s(ki,kj,jl)              , ' old_v_s    : ', old_v_s(ki,kj,jl) 
603              WRITE(numout,*) ' d_v_s_trp  : ', d_v_s_trp(ki,kj,jl)        , ' d_v_s_thd  : ', d_v_s_thd(ki,kj,jl)
604              WRITE(numout,*) ' e_i1       : ', e_i(ki,kj,1,jl)/1.0e9      , ' old_ei1    : ', old_e_i(ki,kj,1,jl)/1.0e9 
605              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
606              WRITE(numout,*) ' e_i2       : ', e_i(ki,kj,2,jl)/1.0e9      , ' old_ei2    : ', old_e_i(ki,kj,2,jl)/1.0e9 
607              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
608              WRITE(numout,*) ' e_snow     : ', e_s(ki,kj,1,jl)            , ' old_e_snow : ', old_e_s(ki,kj,1,jl) 
609              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)
610              WRITE(numout,*) ' smv_i      : ', smv_i(ki,kj,jl)            , ' old_smv_i  : ', old_smv_i(ki,kj,jl)   
611              WRITE(numout,*) ' d_smv_i_trp: ', d_smv_i_trp(ki,kj,jl)      , ' d_smv_i_thd: ', d_smv_i_thd(ki,kj,jl) 
612              WRITE(numout,*) ' oa_i       : ', oa_i(ki,kj,jl)             , ' old_oa_i   : ', old_oa_i(ki,kj,jl)
613              WRITE(numout,*) ' d_oa_i_trp : ', d_oa_i_trp(ki,kj,jl)       , ' d_oa_i_thd : ', d_oa_i_thd(ki,kj,jl)
614              WRITE(numout,*) ' Path. case : ', patho_case(ki,kj,jl)
615        END DO !jl
616
617        WRITE(numout,*)
618        WRITE(numout,*) ' - Heat / FW fluxes '
619        WRITE(numout,*) '   ~~~~~~~~~~~~~~~~ '
620!       WRITE(numout,*) ' fsbri      : ', fsbri(ki,kj)
621!       WRITE(numout,*) ' fseqv      : ', fseqv(ki,kj)
622!       WRITE(numout,*) ' fsalt_res  : ', fsalt_res(ki,kj)
623        WRITE(numout,*) ' fmmec      : ', fmmec(ki,kj)
624        WRITE(numout,*) ' fhmec      : ', fhmec(ki,kj)
625        WRITE(numout,*) ' fhbri      : ', fhbri(ki,kj)
626        WRITE(numout,*) ' fheat_rpo  : ', fheat_rpo(ki,kj)
627        WRITE(numout,*) 
628        WRITE(numout,*) ' sst        : ', sst_m(ki,kj) 
629        WRITE(numout,*) ' sss        : ', sss_m(ki,kj) 
630        WRITE(numout,*) 
631        WRITE(numout,*) ' - Stresses '
632        WRITE(numout,*) '   ~~~~~~~~ '
633        WRITE(numout,*) ' utau_ice   : ', utau_ice(ki,kj) 
634        WRITE(numout,*) ' vtau_ice   : ', vtau_ice(ki,kj)
635        WRITE(numout,*) ' utau       : ', utau(ki,kj) 
636        WRITE(numout,*) ' vtau       : ', vtau(ki,kj)
637        WRITE(numout,*) ' oc. vel. u : ', u_oce(ki,kj)
638        WRITE(numout,*) ' oc. vel. v : ', v_oce(ki,kj)
639     ENDIF
640
641     !---------------------
642     ! Salt / heat fluxes
643     !---------------------
644
645     IF ( kn .EQ. 3 ) THEN
646        WRITE(numout,*) ' lim_prt_state - Point : ',ki,kj
647        WRITE(numout,*) ' ~~~~~~~~~~~~~~ '
648        WRITE(numout,*) ' - Salt / Heat Fluxes '
649        WRITE(numout,*) '   ~~~~~~~~~~~~~~~~ '
650        WRITE(numout,*) ' lat - long ', gphit(ki,kj), glamt(ki,kj)
651        WRITE(numout,*) ' Time step ', numit
652        WRITE(numout,*)
653        WRITE(numout,*) ' - Heat fluxes at bottom interface ***'
654        WRITE(numout,*) ' qsr        : ', qsr(ki,kj)
655        WRITE(numout,*) ' qns        : ', qns(ki,kj)
656        WRITE(numout,*)
657        WRITE(numout,*) ' - Salt fluxes at bottom interface ***'
658        WRITE(numout,*) ' emps       : ', emps(ki,kj)
659        WRITE(numout,*) ' emp        : ', emp(ki,kj)
660        WRITE(numout,*) ' fsbri      : ', fsbri(ki,kj)
661        WRITE(numout,*) ' fseqv      : ', fseqv(ki,kj)
662        WRITE(numout,*) ' fsalt_res  : ', fsalt_res(ki,kj)
663        WRITE(numout,*) ' fsalt_rpo  : ', fsalt_rpo(ki,kj)
664        WRITE(numout,*) ' - Heat fluxes at bottom interface ***'
665        WRITE(numout,*) ' fheat_res  : ', fheat_res(ki,kj)
666        WRITE(numout,*)
667        WRITE(numout,*) ' - Momentum fluxes '
668        WRITE(numout,*) ' utau      : ', utau(ki,kj) 
669        WRITE(numout,*) ' vtau      : ', vtau(ki,kj)
670      ENDIF
671      WRITE(numout,*) ' '
672      !
673   END SUBROUTINE lim_prt_state
674
675#else
676   !!----------------------------------------------------------------------
677   !!   Default option           Dummy module      NO LIM 3.0 sea-ice model
678   !!----------------------------------------------------------------------
679CONTAINS
680   SUBROUTINE sbc_ice_lim ( kt, kblk, kico )     ! Dummy routine
681      WRITE(*,*) 'sbc_ice_lim: You should not have seen this print! error?', kt, kblk, kico
682   END SUBROUTINE sbc_ice_lim
683#endif
684
685   !!======================================================================
686END MODULE sbcice_lim
Note: See TracBrowser for help on using the repository browser.