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 tags/nemo_v3_2/nemo_v3_2/NEMO/OPA_SRC/SBC – NEMO

source: tags/nemo_v3_2/nemo_v3_2/NEMO/OPA_SRC/SBC/sbcice_lim.F90 @ 1878

Last change on this file since 1878 was 1878, checked in by flavoni, 14 years ago

initial test for nemogcm

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