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

source: trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim.F90 @ 2715

Last change on this file since 2715 was 2715, checked in by rblod, 13 years ago

First attempt to put dynamic allocation on the trunk

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