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

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

trunk: ensure that surface sea-ice temperature is set to 273 degK over land area, see ticket: #199

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