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.
icestp.F90 in NEMO/branches/UKMO/NEMO_4.0_GO8_coupled_iodef/src/ICE – NEMO

source: NEMO/branches/UKMO/NEMO_4.0_GO8_coupled_iodef/src/ICE/icestp.F90 @ 12779

Last change on this file since 12779 was 11367, checked in by dancopsey, 5 years ago

More print statements including fix

File size: 25.4 KB
Line 
1MODULE icestp
2   !!======================================================================
3   !!                       ***  MODULE  icestp  ***
4   !! sea ice : Master routine for all the sea ice model
5   !!=====================================================================
6   !!
7   !! The sea ice model SI3 (Sea Ice modelling Integrated Initiative),
8   !!                        aka Sea Ice cube for its nickname
9   !!
10   !!    is originally based on LIM3, developed in Louvain-la-Neuve by:
11   !!       * Martin Vancoppenolle (UCL-ASTR, Belgium)
12   !!       * Sylvain Bouillon (UCL-ASTR, Belgium)
13   !!       * Miguel Angel Morales Maqueda (NOC-L, UK)
14   !!      thanks to valuable earlier work by
15   !!       * Thierry Fichefet
16   !!       * Hugues Goosse
17   !!      thanks also to the following persons who contributed
18   !!       * Gurvan Madec, Claude Talandier, Christian Ethe (LOCEAN, France)
19   !!       * Xavier Fettweis (UCL-ASTR), Ralph Timmermann (AWI, Germany)
20   !!       * Bill Lipscomb (LANL), Cecilia Bitz (UWa) and Elisabeth Hunke (LANL), USA.
21   !!
22   !! SI3 has been made possible by a handful of persons who met as working group
23   !!      (from France, Belgium, UK and Italy)
24   !!    * Clement Rousset, Martin Vancoppenolle & Gurvan Madec (LOCEAN, France)
25   !!    * Matthieu Chevalier & David Salas (Meteo France, France)
26   !!    * Gilles Garric (Mercator Ocean, France)
27   !!    * Thierry Fichefet & Francois Massonnet (UCL, Belgium)
28   !!    * Ed Blockley & Jeff Ridley (Met Office, UK)
29   !!    * Danny Feltham & David Schroeder (CPOM, UK)
30   !!    * Yevgeny Aksenov (NOC, UK)
31   !!    * Paul Holland (BAS, UK)
32   !!    * Dorotea Iovino (CMCC, Italy)
33   !!======================================================================
34   !! History :  4.0  !  2018     (C. Rousset)      Original code SI3
35   !!----------------------------------------------------------------------
36#if defined key_si3
37   !!----------------------------------------------------------------------
38   !!   'key_si3'                                       SI3 sea-ice model
39   !!----------------------------------------------------------------------
40   !!   ice_stp       : sea-ice model time-stepping and update ocean SBC over ice-covered area
41   !!   ice_init      : initialize sea-ice
42   !!----------------------------------------------------------------------
43   USE oce            ! ocean dynamics and tracers
44   USE dom_oce        ! ocean space and time domain
45   USE c1d            ! 1D vertical configuration
46   USE ice            ! sea-ice: variables
47   USE ice1D          ! sea-ice: thermodynamical 1D variables
48   !
49   USE phycst         ! Define parameters for the routines
50   USE eosbn2         ! equation of state
51   USE sbc_oce        ! Surface boundary condition: ocean fields
52   USE sbc_ice        ! Surface boundary condition: ice   fields
53   !
54   USE icesbc         ! sea-ice: Surface boundary conditions
55   USE icedyn         ! sea-ice: dynamics
56   USE icethd         ! sea-ice: thermodynamics
57   USE icecor         ! sea-ice: corrections
58   USE iceupdate      ! sea-ice: sea surface boundary condition update
59   USE icedia         ! sea-ice: budget diagnostics
60   USE icewri         ! sea-ice: outputs
61   USE icerst         ! sea-ice: restarts
62   USE icevar         ! sea-ice: operations
63   USE icectl         ! sea-ice: control
64   USE iceistate      ! sea-ice: initial state
65   USE iceitd         ! sea-ice: remapping thickness distribution
66   USE icealb         ! sea-ice: albedo
67   !
68   USE bdy_oce , ONLY : ln_bdy   ! flag for bdy
69   USE bdyice         ! unstructured open boundary data for sea-ice
70# if defined key_agrif
71   USE agrif_ice
72   USE agrif_ice_interp
73# endif
74   !
75   USE in_out_manager ! I/O manager
76   USE iom            ! I/O manager library
77   USE lib_mpp        ! MPP library
78   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
79   USE timing         ! Timing
80   USE prtctl         ! Print control
81
82   IMPLICIT NONE
83   PRIVATE
84
85   PUBLIC   ice_stp    ! called by sbcmod.F90
86   PUBLIC   ice_init   ! called by sbcmod.F90
87
88   !! * Substitutions
89#  include "vectopt_loop_substitute.h90"
90   !!----------------------------------------------------------------------
91   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
92   !! $Id$
93   !! Software governed by the CeCILL license (see ./LICENSE)
94   !!----------------------------------------------------------------------
95CONTAINS
96
97   SUBROUTINE ice_stp( kt, ksbc )
98      !!---------------------------------------------------------------------
99      !!                  ***  ROUTINE ice_stp  ***
100      !!
101      !! ** Purpose :   sea-ice model time-stepping and update ocean surface
102      !!              boundary condition over ice-covered area
103      !!
104      !! ** Method  :   ice model time stepping
105      !!              - call the ice dynamics routine
106      !!              - call the ice advection/diffusion routine
107      !!              - call the ice thermodynamics routine
108      !!              - call the routine that computes mass and
109      !!                heat fluxes at the ice/ocean interface
110      !!              - save the outputs
111      !!              - save the outputs for restart when necessary
112      !!
113      !! ** Action  : - time evolution of the LIM sea-ice model
114      !!              - update all sbc variables below sea-ice:
115      !!                utau, vtau, taum, wndm, qns , qsr, emp , sfx
116      !!---------------------------------------------------------------------
117      INTEGER, INTENT(in) ::   kt      ! ocean time step
118      INTEGER, INTENT(in) ::   ksbc    ! flux formulation (user defined, bulk, or Pure Coupled)
119      !
120      INTEGER ::   jl   ! dummy loop index
121      !!----------------------------------------------------------------------
122      !
123      IF( ln_timing )   CALL timing_start('ice_stp')
124      !
125      !                                      !-----------------------!
126      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN   ! --- Ice time step --- !
127         !                                   !-----------------------!
128         !
129         kt_ice = kt                              ! -- Ice model time step
130         !
131         u_oce(:,:) = ssu_m(:,:)                  ! -- mean surface ocean current
132         v_oce(:,:) = ssv_m(:,:)
133         !
134         CALL eos_fzp( sss_m(:,:) , t_bo(:,:) )   ! -- freezing temperature [Kelvin] (set to rt0 over land)
135         t_bo(:,:) = ( t_bo(:,:) + rt0 ) * tmask(:,:,1) + rt0 * ( 1._wp - tmask(:,:,1) )
136         !
137         !                          !==  AGRIF Parent to Child  ==!
138#if defined key_agrif
139         !                              ! nbstep_ice ranges from 1 to the nb of child ocean steps inside one parent ice step
140         IF( .NOT. Agrif_Root() )       nbstep_ice = MOD( nbstep_ice, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) + 1
141         !                              ! these calls must remain here for restartability purposes
142                                        CALL agrif_interp_ice( 'T' ) 
143                                        CALL agrif_interp_ice( 'U' )
144                                        CALL agrif_interp_ice( 'V' )
145#endif
146                                        CALL store_fields             ! Store now ice values
147
148      IF(narea == 68) THEN
149         WRITE(968,*) 'in icestp before ice_sbc_tau: u_ice = ',SUM(u_ice)
150         WRITE(968,*) 'v_ice(54,0:2) = ',SUM(v_ice)
151         WRITE(968,*) 'h_i(54,0:2) = ',SUM(h_i)
152         WRITE(968,*) 'h_s(54,0:2) = ',SUM(h_s)
153         WRITE(968,*) 'v_i(54,0:2) = ',SUM(v_i)
154         WRITE(968,*) 'sv_i(54,0:2) = ',SUM(sv_i)
155         WRITE(968,*) 'e_s(54,0:2) = ',SUM(e_s)
156         WRITE(968,*) 'e_i(54,0:2) = ',SUM(e_i)
157         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
158      ENDIF
159         !
160         !------------------------------------------------!
161         ! --- Dynamical coupling with the atmosphere --- !
162         !------------------------------------------------!
163         ! It provides the following fields used in sea ice model:
164         !    utau_ice, vtau_ice = surface ice stress [N/m2]
165         !------------------------------------------------!
166                                        CALL ice_sbc_tau( kt, ksbc, utau_ice, vtau_ice )         
167         !-------------------------------------!
168         ! --- ice dynamics and advection  --- !
169         !-------------------------------------!
170                                        CALL diag_set0                ! set diag of mass, heat and salt fluxes to 0
171                                        CALL ice_rst_opn( kt )        ! Open Ice restart file (if necessary)
172         !
173
174      IF(narea == 68) THEN
175         WRITE(968,*) 'in icestp before ice_dyn: u_ice = ',SUM(u_ice)
176         WRITE(968,*) 'v_ice(54,0:2) = ',SUM(v_ice)
177         WRITE(968,*) 'h_i(54,0:2) = ',SUM(h_i)
178         WRITE(968,*) 'h_s(54,0:2) = ',SUM(h_s)
179         WRITE(968,*) 'v_i(54,0:2) = ',SUM(v_i)
180         WRITE(968,*) 'sv_i(54,0:2) = ',SUM(sv_i)
181         WRITE(968,*) 'e_s(54,0:2) = ',SUM(e_s)
182         WRITE(968,*) 'e_i(54,0:2) = ',SUM(e_i)
183         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
184      ENDIF
185
186         IF( ln_icedyn .AND. .NOT.lk_c1d )   &
187            &                           CALL ice_dyn( kt )            ! -- Ice dynamics
188         !
189         !                          !==  lateral boundary conditions  ==!
190         IF( ln_icethd .AND. ln_bdy )   CALL bdy_ice( kt )            ! -- bdy ice thermo
191         !
192
193      IF(narea == 68) THEN
194         WRITE(968,*) 'max emp ice_stp before ice_var_glo2eqv = ',emp(54,1)
195         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
196         WRITE(968,*) 'sum qlead = ',SUM(qlead)
197         WRITE(968,*) 'a_i(54,1) = ',a_i(54,1)
198      ENDIF
199
200         !                          !==  previous lead fraction and ice volume for flux calculations
201                                        CALL ice_var_glo2eqv          ! h_i and h_s for ice albedo calculation
202                                        CALL ice_var_agg(1)           ! at_i for coupling
203                                        CALL store_fields             ! Store now ice values
204         !
205         !------------------------------------------------------!
206         ! --- Thermodynamical coupling with the atmosphere --- !
207         !------------------------------------------------------!
208         ! It provides the following fields used in sea ice model:
209         !    emp_oce , emp_ice    = E-P over ocean and sea ice                    [Kg/m2/s]
210         !    sprecip              = solid precipitation                           [Kg/m2/s]
211         !    evap_ice             = sublimation                                   [Kg/m2/s]
212         !    qsr_tot , qns_tot    = solar & non solar heat flux (total)           [W/m2]
213         !    qsr_ice , qns_ice    = solar & non solar heat flux over ice          [W/m2]
214         !    dqns_ice             = non solar  heat sensistivity                  [W/m2]
215         !    qemp_oce, qemp_ice,  = sensible heat (associated with evap & precip) [W/m2]
216         !    qprec_ice, qevap_ice
217         !------------------------------------------------------!
218
219      IF(narea == 68) THEN
220         WRITE(968,*) 'max emp ice_stp before ice_sbc_flx = ',emp(54,1)
221         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
222         WRITE(968,*) 'sum qlead = ',SUM(qlead)
223         WRITE(968,*) 'a_i(54,1) = ',a_i(54,1)
224      ENDIF
225
226                                        CALL ice_sbc_flx( kt, ksbc )
227         !----------------------------!
228         ! --- ice thermodynamics --- !
229         !----------------------------!
230
231      IF(narea == 68) THEN
232         WRITE(968,*) 'max emp ice_stp before ice_thd = ',emp(54,1)
233         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
234         WRITE(968,*) 'sum qlead = ',SUM(qlead)
235         WRITE(968,*) 'a_i(54,1) = ',a_i(54,1)
236      ENDIF
237
238         IF( ln_icethd )                CALL ice_thd( kt )            ! -- Ice thermodynamics 
239
240      IF(narea == 68) THEN
241         WRITE(968,*) 'max emp ice_stp before ice_cor = ',emp(54,1)
242         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
243         WRITE(968,*) 'a_i(54,1) = ',a_i(54,1)
244      ENDIF
245   
246         !
247                                        CALL ice_cor( kt , 2 )        ! -- Corrections
248         !
249
250      IF(narea == 68) THEN
251         WRITE(968,*) 'max emp ice_stp before ice_var_glo2eqv = ',emp(54,1)
252         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
253      ENDIF
254
255                                        CALL ice_var_glo2eqv          ! necessary calls (at least for coupling)
256                                        CALL ice_var_agg( 2 )         ! necessary calls (at least for coupling)
257         !
258
259      IF(narea == 68) THEN
260         WRITE(968,*) 'max emp ice_stp before ice_update_flx = ',emp(54,1)
261         WRITE(968,*) 'sum wfx_opw = ',SUM( wfx_opw )
262      ENDIF
263
264                                        CALL ice_update_flx( kt )     ! -- Update ocean surface mass, heat and salt fluxes
265         !
266
267      IF(narea == 68) THEN
268         WRITE(968,*) 'max emp ice_stp before ice_dia = ',emp(54,1)
269      ENDIF
270
271         IF( ln_icediahsb )             CALL ice_dia( kt )            ! -- Diagnostics outputs
272         !
273                                        CALL ice_wri( kt )            ! -- Ice outputs
274         !
275         IF( lrst_ice )                 CALL ice_rst_write( kt )      ! -- Ice restart file
276         !
277         IF( ln_icectl )                CALL ice_ctl( kt )            ! -- alerts in case of model crash
278
279      IF(narea == 68) THEN
280         WRITE(968,*) 'max emp ice_stp at end = ',emp(54,1)
281      ENDIF
282
283         !
284      ENDIF   ! End sea-ice time step only
285
286      !-------------------------!
287      ! --- Ocean time step --- !
288      !-------------------------!
289      IF( ln_icedyn )                   CALL ice_update_tau( kt, ub(:,:,1), vb(:,:,1) )   ! -- update surface ocean stresses
290!!gm   remark, the ocean-ice stress is not saved in ice diag call above .....  find a solution!!!
291      !
292      IF( ln_timing )   CALL timing_stop('ice_stp')
293      !
294   END SUBROUTINE ice_stp
295
296
297   SUBROUTINE ice_init
298      !!----------------------------------------------------------------------
299      !!                  ***  ROUTINE ice_init  ***
300      !!
301      !! ** purpose :   Initialize sea-ice parameters
302      !!----------------------------------------------------------------------
303      INTEGER :: ji, jj, ierr
304      !!----------------------------------------------------------------------
305      IF(lwp) WRITE(numout,*)
306      IF(lwp) WRITE(numout,*) 'Sea Ice Model: SI3 (Sea Ice modelling Integrated Initiative)' 
307      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~'
308      IF(lwp) WRITE(numout,*)
309      IF(lwp) WRITE(numout,*) 'ice_init: Arrays allocation & Initialization of all routines & init state' 
310      IF(lwp) WRITE(numout,*) '~~~~~~~~'
311      !
312      !                                ! Open the reference and configuration namelist files and namelist output file
313      CALL ctl_opn( numnam_ice_ref, 'namelist_ice_ref',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
314      CALL ctl_opn( numnam_ice_cfg, 'namelist_ice_cfg',    'OLD',     'FORMATTED', 'SEQUENTIAL', -1, numout, lwp )
315      IF(lwm) CALL ctl_opn( numoni, 'output.namelist.ice', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, 1 )
316      !
317      CALL par_init                ! set some ice run parameters
318      !
319      !                                ! Allocate the ice arrays (sbc_ice already allocated in sbc_init)
320      ierr =        ice_alloc        ()      ! ice variables
321      ierr = ierr + sbc_ice_alloc    ()      ! surface boundary conditions
322      ierr = ierr + ice1D_alloc      ()      ! thermodynamics
323      !
324      CALL mpp_sum( 'icestp', ierr )
325      IF( ierr /= 0 )   CALL ctl_stop('STOP', 'ice_init : unable to allocate ice arrays')
326      !
327      CALL ice_itd_init                ! ice thickness distribution initialization
328      !
329      CALL ice_thd_init                ! set ice thermodynics parameters (clem: important to call it first for melt ponds)
330      !
331      !                                ! Initial sea-ice state
332      IF( .NOT. ln_rstart ) THEN              ! start from rest: sea-ice deduced from sst
333         CALL ice_istate_init
334         CALL ice_istate
335      ELSE                                    ! start from a restart file
336         CALL ice_rst_read
337      ENDIF
338      CALL ice_var_glo2eqv
339      CALL ice_var_agg(1)
340      !
341      CALL ice_sbc_init                ! set ice-ocean and ice-atm. coupling parameters
342      !
343      CALL ice_dyn_init                ! set ice dynamics parameters
344      !
345      CALL ice_update_init             ! ice surface boundary condition
346      !
347      CALL ice_alb_init                ! ice surface albedo
348      !
349      CALL ice_dia_init                ! initialization for diags
350      !
351      fr_i  (:,:)   = at_i(:,:)        ! initialisation of sea-ice fraction
352      tn_ice(:,:,:) = t_su(:,:,:)      ! initialisation of surface temp for coupled simu
353      !
354      !                                ! set max concentration in both hemispheres
355      WHERE( gphit(:,:) > 0._wp )   ;   rn_amax_2d(:,:) = rn_amax_n  ! NH
356      ELSEWHERE                     ;   rn_amax_2d(:,:) = rn_amax_s  ! SH
357      END WHERE
358
359      IF( ln_rstart )   CALL iom_close( numrir )  ! close input ice restart file
360      !
361   END SUBROUTINE ice_init
362
363
364   SUBROUTINE par_init
365      !!-------------------------------------------------------------------
366      !!                  ***  ROUTINE par_init ***
367      !!
368      !! ** Purpose :   Definition generic parameters for ice model
369      !!
370      !! ** Method  :   Read namelist and check the parameter
371      !!                values called at the first timestep (nit000)
372      !!
373      !! ** input   :   Namelist nampar
374      !!-------------------------------------------------------------------
375      INTEGER  ::   ios                 ! Local integer
376      !!
377      NAMELIST/nampar/ jpl, nlay_i, nlay_s, ln_virtual_itd, ln_icedyn, ln_icethd, rn_amax_n, rn_amax_s,  &
378         &             cn_icerst_in, cn_icerst_indir, cn_icerst_out, cn_icerst_outdir
379      !!-------------------------------------------------------------------
380      !
381      REWIND( numnam_ice_ref )      ! Namelist nampar in reference namelist : Parameters for ice
382      READ  ( numnam_ice_ref, nampar, IOSTAT = ios, ERR = 901)
383901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nampar in reference namelist', lwp )
384      REWIND( numnam_ice_cfg )      ! Namelist nampar in configuration namelist : Parameters for ice
385      READ  ( numnam_ice_cfg, nampar, IOSTAT = ios, ERR = 902 )
386902   IF( ios > 0 )   CALL ctl_nam ( ios , 'nampar in configuration namelist', lwp )
387      IF(lwm) WRITE( numoni, nampar )
388      !
389      IF(lwp) THEN                  ! control print
390         WRITE(numout,*)
391         WRITE(numout,*) '   par_init: ice parameters shared among all the routines'
392         WRITE(numout,*) '   ~~~~~~~~'
393         WRITE(numout,*) '      Namelist nampar: '
394         WRITE(numout,*) '         number of ice  categories                           jpl       = ', jpl
395         WRITE(numout,*) '         number of ice  layers                               nlay_i    = ', nlay_i
396         WRITE(numout,*) '         number of snow layers                               nlay_s    = ', nlay_s
397         WRITE(numout,*) '         virtual ITD param for jpl=1 (T) or not (F)     ln_virtual_itd = ', ln_virtual_itd
398         WRITE(numout,*) '         Ice dynamics       (T) or not (F)                   ln_icedyn = ', ln_icedyn
399         WRITE(numout,*) '         Ice thermodynamics (T) or not (F)                   ln_icethd = ', ln_icethd
400         WRITE(numout,*) '         maximum ice concentration for NH                              = ', rn_amax_n 
401         WRITE(numout,*) '         maximum ice concentration for SH                              = ', rn_amax_s
402      ENDIF
403      !                                        !--- change max ice concentration for roundoff errors
404      rn_amax_n = MIN( rn_amax_n, 1._wp - epsi10 )
405      rn_amax_s = MIN( rn_amax_s, 1._wp - epsi10 )
406      !                                        !--- check consistency
407      IF ( jpl > 1 .AND. ln_virtual_itd ) THEN
408         ln_virtual_itd = .FALSE.
409         IF(lwp) WRITE(numout,*)
410         IF(lwp) WRITE(numout,*) '   ln_virtual_itd forced to false as jpl>1, no need with multiple categories to emulate them'
411      ENDIF
412      !
413      IF( ln_cpl .AND. nn_cats_cpl /= 1 .AND. nn_cats_cpl /= jpl ) THEN
414         CALL ctl_stop( 'STOP', 'par_init: in coupled mode, nn_cats_cpl should be either 1 or jpl' )
415      ENDIF
416      !
417      IF( ln_bdy .AND. ln_icediachk )   CALL ctl_warn('par_init: online conservation check does not work with BDY')
418      !
419      rdt_ice   = REAL(nn_fsbc) * rdt          !--- sea-ice timestep and its inverse
420      r1_rdtice = 1._wp / rdt_ice
421      IF(lwp) WRITE(numout,*)
422      IF(lwp) WRITE(numout,*) '      ice timestep rdt_ice = nn_fsbc*rdt = ', rdt_ice
423      !
424      r1_nlay_i = 1._wp / REAL( nlay_i, wp )   !--- inverse of nlay_i and nlay_s
425      r1_nlay_s = 1._wp / REAL( nlay_s, wp )
426      !
427   END SUBROUTINE par_init
428
429
430   SUBROUTINE store_fields
431      !!----------------------------------------------------------------------
432      !!                  ***  ROUTINE store_fields  ***
433      !!
434      !! ** purpose :  store ice variables at "before" time step
435      !!----------------------------------------------------------------------
436      INTEGER  ::   ji, jj, jl      ! dummy loop index
437      !!----------------------------------------------------------------------
438      !
439      a_i_b (:,:,:)   = a_i (:,:,:)     ! ice area
440      v_i_b (:,:,:)   = v_i (:,:,:)     ! ice volume
441      v_s_b (:,:,:)   = v_s (:,:,:)     ! snow volume
442      sv_i_b(:,:,:)   = sv_i(:,:,:)     ! salt content
443      oa_i_b(:,:,:)   = oa_i(:,:,:)     ! areal age content
444      e_s_b (:,:,:,:) = e_s (:,:,:,:)   ! snow thermal energy
445      e_i_b (:,:,:,:) = e_i (:,:,:,:)   ! ice thermal energy
446      WHERE( a_i_b(:,:,:) >= epsi20 )
447         h_i_b(:,:,:) = v_i_b(:,:,:) / a_i_b(:,:,:)   ! ice thickness
448         h_s_b(:,:,:) = v_s_b(:,:,:) / a_i_b(:,:,:)   ! snw thickness
449      ELSEWHERE
450         h_i_b(:,:,:) = 0._wp
451         h_s_b(:,:,:) = 0._wp
452      END WHERE
453     
454      WHERE( a_ip(:,:,:) >= epsi20 )
455         h_ip_b(:,:,:) = v_ip(:,:,:) / a_ip(:,:,:)   ! ice pond thickness
456      ELSEWHERE
457         h_ip_b(:,:,:) = 0._wp
458      END WHERE
459      !
460      ! ice velocities & total concentration
461      at_i_b(:,:)  = SUM( a_i_b(:,:,:), dim=3 )
462      u_ice_b(:,:) = u_ice(:,:)
463      v_ice_b(:,:) = v_ice(:,:)
464      !
465   END SUBROUTINE store_fields
466
467
468   SUBROUTINE diag_set0
469      !!----------------------------------------------------------------------
470      !!                  ***  ROUTINE diag_set0  ***
471      !!
472      !! ** purpose :  set ice-ocean and ice-atm. fluxes to zeros at the beggining
473      !!               of the time step
474      !!----------------------------------------------------------------------
475      INTEGER  ::   ji, jj      ! dummy loop index
476      !!----------------------------------------------------------------------
477      sfx    (:,:) = 0._wp   ;
478      sfx_bri(:,:) = 0._wp   ;   sfx_lam(:,:) = 0._wp
479      sfx_sni(:,:) = 0._wp   ;   sfx_opw(:,:) = 0._wp
480      sfx_bog(:,:) = 0._wp   ;   sfx_dyn(:,:) = 0._wp
481      sfx_bom(:,:) = 0._wp   ;   sfx_sum(:,:) = 0._wp
482      sfx_res(:,:) = 0._wp   ;   sfx_sub(:,:) = 0._wp
483      !
484      wfx_snw(:,:) = 0._wp   ;   wfx_ice(:,:) = 0._wp
485      wfx_sni(:,:) = 0._wp   ;   wfx_opw(:,:) = 0._wp
486      wfx_bog(:,:) = 0._wp   ;   wfx_dyn(:,:) = 0._wp
487      wfx_bom(:,:) = 0._wp   ;   wfx_sum(:,:) = 0._wp
488      wfx_res(:,:) = 0._wp   ;   wfx_sub(:,:) = 0._wp
489      wfx_spr(:,:) = 0._wp   ;   wfx_lam(:,:) = 0._wp 
490      wfx_snw_dyn(:,:) = 0._wp ; wfx_snw_sum(:,:) = 0._wp
491      wfx_snw_sub(:,:) = 0._wp ; wfx_ice_sub(:,:) = 0._wp
492      wfx_snw_sni(:,:) = 0._wp 
493      wfx_pnd(:,:) = 0._wp
494
495      hfx_thd(:,:) = 0._wp   ;
496      hfx_snw(:,:) = 0._wp   ;   hfx_opw(:,:) = 0._wp
497      hfx_bog(:,:) = 0._wp   ;   hfx_dyn(:,:) = 0._wp
498      hfx_bom(:,:) = 0._wp   ;   hfx_sum(:,:) = 0._wp
499      hfx_res(:,:) = 0._wp   ;   hfx_sub(:,:) = 0._wp
500      hfx_spr(:,:) = 0._wp   ;   hfx_dif(:,:) = 0._wp
501      hfx_err_rem(:,:) = 0._wp
502      hfx_err_dif(:,:) = 0._wp
503      wfx_err_sub(:,:) = 0._wp
504      !
505      afx_tot(:,:) = 0._wp   ;
506      !
507      diag_heat(:,:) = 0._wp ;   diag_sice(:,:) = 0._wp
508      diag_vice(:,:) = 0._wp ;   diag_vsnw(:,:) = 0._wp
509
510      ! SIMIP diagnostics
511      qcn_ice_bot(:,:,:) = 0._wp ; qcn_ice_top(:,:,:) = 0._wp ! conductive fluxes
512      t_si       (:,:,:) = rt0   ! temp at the ice-snow interface
513
514      tau_icebfr (:,:)   = 0._wp   ! landfast ice param only (clem: important to keep the init here)
515      cnd_ice    (:,:,:) = 0._wp   ! initialisation: effective conductivity at the top of ice/snow (ln_cndflx=T)
516      qcn_ice    (:,:,:) = 0._wp   ! initialisation: conductive flux (ln_cndflx=T & ln_cndemule=T)
517      qtr_ice_bot(:,:,:) = 0._wp   ! initialization: part of solar radiation transmitted through the ice needed at least for outputs
518      qsb_ice_bot(:,:)   = 0._wp   ! (needed if ln_icethd=F)
519      !
520      ! for control checks (ln_icediachk)
521      diag_trp_vi(:,:) = 0._wp   ;   diag_trp_vs(:,:) = 0._wp
522      diag_trp_ei(:,:) = 0._wp   ;   diag_trp_es(:,:) = 0._wp
523      diag_trp_sv(:,:) = 0._wp
524
525   END SUBROUTINE diag_set0
526
527#else
528   !!----------------------------------------------------------------------
529   !!   Default option           Dummy module         NO SI3 sea-ice model
530   !!----------------------------------------------------------------------
531CONTAINS
532   SUBROUTINE ice_stp ( kt, ksbc )     ! Dummy routine
533      INTEGER, INTENT(in) ::   kt, ksbc
534      WRITE(*,*) 'ice_stp: You should not have seen this print! error?', kt
535   END SUBROUTINE ice_stp
536   SUBROUTINE ice_init                 ! Dummy routine
537   END SUBROUTINE ice_init
538#endif
539
540   !!======================================================================
541END MODULE icestp
Note: See TracBrowser for help on using the repository browser.