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.
limwri.F90 in branches/2016/v3_6_CMIP6_ice_diagnostics/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2016/v3_6_CMIP6_ice_diagnostics/NEMOGCM/NEMO/LIM_SRC_3/limwri.F90 @ 7536

Last change on this file since 7536 was 7536, checked in by vancop, 7 years ago

Clean limwri.F90

  • Property svn:keywords set to Id
File size: 40.2 KB
Line 
1MODULE limwri
2   !!======================================================================
3   !!                     ***  MODULE  limwri  ***
4   !!         Ice diagnostics :  write ice output files
5   !!======================================================================
6#if defined key_lim3
7   !!----------------------------------------------------------------------
8   !!   'key_lim3'                                      LIM3 sea-ice model
9   !!----------------------------------------------------------------------
10   !!   lim_wri      : write of the diagnostics variables in ouput file
11   !!   lim_wri_state : write for initial state or/and abandon
12   !!----------------------------------------------------------------------
13   USE ioipsl
14   USE dianam          ! build name of file (routine)
15   USE phycst
16   USE dom_oce
17   USE sbc_oce         ! Surface boundary condition: ocean fields
18   USE sbc_ice         ! Surface boundary condition: ice fields
19   USE ice
20   USE dom_ice
21   USE limvar
22   USE in_out_manager
23   USE lbclnk
24   USE lib_mpp         ! MPP library
25   USE wrk_nemo        ! work arrays
26   USE iom
27   USE timing          ! Timing
28   USE lib_fortran     ! Fortran utilities
29
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC lim_wri        ! routine called by lim_step.F90
34   PUBLIC lim_wri_state  ! called by dia_wri_state
35
36   !!----------------------------------------------------------------------
37   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
38   !! $Id$
39   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
40   !!----------------------------------------------------------------------
41CONTAINS
42
43   SUBROUTINE lim_wri( kindic )
44      !!-------------------------------------------------------------------
45      !!  This routine computes the average of some variables and write it
46      !!  on the ouput files.
47      !!  ATTENTION cette routine n'est valable que si le pas de temps est
48      !!  egale a une fraction entiere de 1 jours.
49      !!  Diff 1-D 3-D : suppress common also included in etat
50      !!                 suppress cmoymo 11-18
51      !!  modif : 03/06/98
52      !!-------------------------------------------------------------------
53      INTEGER, INTENT(in) ::   kindic   ! if kindic < 0 there has been an error somewhere
54      !
55      INTEGER  ::  ii, ji, jj, jk, jl  ! dummy loop indices
56      REAL(wp) ::  z1_365
57      REAL(wp) ::  z2da, z2db, ztmp, zrho1, zrho2
58      REAL(wp), POINTER, DIMENSION(:,:,:) ::  zswi2
59      REAL(wp), POINTER, DIMENSION(:,:)   ::  z2d, zswi    ! 2D workspace
60
61      ! Global ice diagnostics (SIMIP)
62      REAL(wp) ::  zdiag_area_nh, &   ! area, extent, volume
63         &         zdiag_extt_nh, &
64         &         zdiag_area_sh, & 
65         &         zdiag_extt_sh, & 
66         &         zdiag_volu_nh, & 
67         &         zdiag_volu_sh 
68
69      ! Strait / passage fluxes (SIMIP)
70      REAL(wp), DIMENSION(4) ::  &                                    ! Strait fluxes for output
71         &         zdiag_area_strait  ,   &                                    ! 1=Fram Strait, 2=CAA, 3= Barents, 4 = Bering
72         &         zdiag_mice_strait  ,   &
73         &         zdiag_msno_strait
74
75      REAL(wp) :: zfarea_u, zfmice_u, zfmsno_u, zfarea_v, zfmice_v, zfmsno_v   ! dummy fluxes
76
77      REAL(wp), DIMENSION(11) :: &
78         &         zui, zuj, zvi, zvj                                          ! strait addresses
79
80      INTEGER  :: Nu, Nv                                                       ! passage size
81
82      INTEGER, PARAMETER :: i_grid = 2                                         ! grid type (eORCA1 = 1, ORCA2 = 2)
83     
84      !!-------------------------------------------------------------------
85
86      IF( nn_timing == 1 )  CALL timing_start('limwri')
87
88      CALL wrk_alloc( jpi, jpj, jpl, zswi2 )
89      CALL wrk_alloc( jpi, jpj     , z2d, zswi )
90
91      !-----------------------------
92      ! Mean category values
93      !-----------------------------
94      z1_365 = 1._wp / 365._wp
95
96      ! brine volume
97      CALL lim_var_bv 
98
99      ! tresholds for outputs
100      DO jj = 1, jpj
101         DO ji = 1, jpi
102            zswi(ji,jj)  = MAX( 0._wp , SIGN( 1._wp , at_i(ji,jj) - epsi06 ) ) ! 1 if ice, 0 if no ice
103         END DO
104      END DO
105      DO jl = 1, jpl
106         DO jj = 1, jpj
107            DO ji = 1, jpi
108               zswi2(ji,jj,jl)  = MAX( 0._wp , SIGN( 1._wp , a_i(ji,jj,jl) - epsi06 ) )
109            END DO
110         END DO
111      END DO
112      !
113      ! fluxes
114      ! pfrld is the lead fraction at the previous time step (actually between TRP and THD)
115      IF( iom_use('qsr_oce') )   CALL iom_put( "qsr_oce" , qsr_oce(:,:) * pfrld(:,:) )                                   !     solar flux at ocean surface
116      IF( iom_use('qns_oce') )   CALL iom_put( "qns_oce" , qns_oce(:,:) * pfrld(:,:) + qemp_oce(:,:) )                   ! non-solar flux at ocean surface
117      IF( iom_use('qsr_ice') )   CALL iom_put( "qsr_ice" , SUM( qsr_ice(:,:,:) * a_i_b(:,:,:), dim=3 ) )                 !     solar flux at ice surface
118      IF( iom_use('qns_ice') )   CALL iom_put( "qns_ice" , SUM( qns_ice(:,:,:) * a_i_b(:,:,:), dim=3 ) + qemp_ice(:,:) ) ! non-solar flux at ice surface
119      IF( iom_use('qtr_ice') )   CALL iom_put( "qtr_ice" , SUM( ftr_ice(:,:,:) * a_i_b(:,:,:), dim=3 ) )                 !     solar flux transmitted thru ice
120      IF( iom_use('qt_oce' ) )   CALL iom_put( "qt_oce"  , ( qsr_oce(:,:) + qns_oce(:,:) ) * pfrld(:,:) + qemp_oce(:,:) ) 
121      IF( iom_use('qt_ice' ) )   CALL iom_put( "qt_ice"  , SUM( ( qns_ice(:,:,:) + qsr_ice(:,:,:) )   &
122         &                                                      * a_i_b(:,:,:),dim=3 ) + qemp_ice(:,:) )
123      IF( iom_use('qemp_oce') )  CALL iom_put( "qemp_oce" , qemp_oce(:,:) ) 
124      IF( iom_use('qemp_ice') )  CALL iom_put( "qemp_ice" , qemp_ice(:,:) ) 
125      IF( iom_use('emp_oce' ) )  CALL iom_put( "emp_oce"  , emp_oce(:,:) )   !emp over ocean (taking into account the snow blown away from the ice)
126      IF( iom_use('emp_ice' ) )  CALL iom_put( "emp_ice"  , emp_ice(:,:) )   !emp over ice   (taking into account the snow blown away from the ice)
127
128      ! velocity
129      IF ( iom_use( "uice_ipa" ) .OR. iom_use( "vice_ipa" ) .OR. iom_use( "icevel" ) ) THEN
130         DO jj = 2 , jpjm1
131            DO ji = 2 , jpim1
132               z2da  = ( u_ice(ji,jj) * umask(ji,jj,1) + u_ice(ji-1,jj) * umask(ji-1,jj,1) ) * 0.5_wp
133               z2db  = ( v_ice(ji,jj) * vmask(ji,jj,1) + v_ice(ji,jj-1) * vmask(ji,jj-1,1) ) * 0.5_wp
134               z2d(ji,jj) = SQRT( z2da * z2da + z2db * z2db )
135           END DO
136         END DO
137         CALL lbc_lnk( z2d, 'T', 1. )
138         CALL iom_put( "uice_ipa"     , u_ice      )       ! ice velocity u component
139         CALL iom_put( "vice_ipa"     , v_ice      )       ! ice velocity v component
140         CALL iom_put( "icevel"       , z2d        )       ! ice velocity module
141      ENDIF
142      !
143      IF ( iom_use( "miceage" ) )       CALL iom_put( "miceage"     , om_i * zswi * z1_365   )  ! mean ice age
144      IF ( iom_use( "icethic_cea" ) )   CALL iom_put( "icethic_cea" , htm_i * zswi           )  ! ice thickness mean
145      IF ( iom_use( "snowthic_cea" ) )  CALL iom_put( "snowthic_cea", htm_s * zswi           )  ! snow thickness mean
146      IF ( iom_use( "micet" ) )         CALL iom_put( "micet"       , ( tm_i  - rt0 ) * zswi )  ! ice mean    temperature
147      IF ( iom_use( "icest" ) )         CALL iom_put( "icest"       , ( tm_su - rt0 ) * zswi )  ! ice surface temperature
148      IF ( iom_use( "icecolf" ) )       CALL iom_put( "icecolf"     , hicol                  )  ! frazil ice collection thickness
149      !
150      CALL iom_put( "isst"        , sst_m               )        ! sea surface temperature
151      CALL iom_put( "isss"        , sss_m               )        ! sea surface salinity
152      CALL iom_put( "iceconc"     , at_i  * zswi        )        ! ice concentration
153      CALL iom_put( "icevolu"     , vt_i  * zswi        )        ! ice volume = mean ice thickness over the cell
154      CALL iom_put( "icehc"       , et_i  * zswi        )        ! ice total heat content
155      CALL iom_put( "isnowhc"     , et_s  * zswi        )        ! snow total heat content
156      CALL iom_put( "ibrinv"      , bvm_i * zswi * 100. )        ! brine volume
157      CALL iom_put( "utau_ice"    , utau_ice*zswi       )        ! wind stress over ice along i-axis at I-point
158      CALL iom_put( "vtau_ice"    , vtau_ice*zswi       )        ! wind stress over ice along j-axis at I-point
159      CALL iom_put( "snowpre"     , sprecip * 86400.    )        ! snow precipitation
160      CALL iom_put( "micesalt"    , smt_i   * zswi      )        ! mean ice salinity
161
162      CALL iom_put( "icestr"      , strength * zswi )    ! ice strength
163      CALL iom_put( "idive"       , divu_i              )    ! divergence
164      CALL iom_put( "ishear"      , shear_i             )    ! shear
165      CALL iom_put( "snowvol"     , vt_s   * zswi       )        ! snow volume
166     
167      CALL iom_put( "icetrp"      , diag_trp_vi * rday  )        ! ice volume transport
168      CALL iom_put( "snwtrp"      , diag_trp_vs * rday  )        ! snw volume transport
169      CALL iom_put( "saltrp"      , diag_trp_smv * rday * rhoic ) ! salt content transport
170      CALL iom_put( "deitrp"      , diag_trp_ei         )        ! advected ice enthalpy (W/m2)
171      CALL iom_put( "destrp"      , diag_trp_es         )        ! advected snw enthalpy (W/m2)
172
173      CALL iom_put( "sfxbog"      , sfx_bog * rday      )        ! salt flux from bottom growth
174      CALL iom_put( "sfxbom"      , sfx_bom * rday      )        ! salt flux from bottom melting
175      CALL iom_put( "sfxsum"      , sfx_sum * rday      )        ! salt flux from surface melting
176      CALL iom_put( "sfxsni"      , sfx_sni * rday      )        ! salt flux from snow ice formation
177      CALL iom_put( "sfxopw"      , sfx_opw * rday      )        ! salt flux from open water formation
178      CALL iom_put( "sfxdyn"      , sfx_dyn * rday      )        ! salt flux from ridging rafting
179      CALL iom_put( "sfxres"      , sfx_res * rday      )        ! salt flux from limupdate (resultant)
180      CALL iom_put( "sfxbri"      , sfx_bri * rday      )        ! salt flux from brines
181      CALL iom_put( "sfxsub"      , sfx_sub * rday      )        ! salt flux from sublimation
182      CALL iom_put( "sfx"         , sfx     * rday      )        ! total salt flux
183
184      ztmp = rday / rhoic
185      CALL iom_put( "vfxres"     , wfx_res * ztmp       )        ! daily prod./melting due to limupdate
186      CALL iom_put( "vfxopw"     , wfx_opw * ztmp       )        ! daily lateral thermodynamic ice production
187      CALL iom_put( "vfxsni"     , wfx_sni * ztmp       )        ! daily snowice ice production
188      CALL iom_put( "vfxbog"     , wfx_bog * ztmp       )        ! daily bottom thermodynamic ice production
189      CALL iom_put( "vfxdyn"     , wfx_dyn * ztmp       )        ! daily dynamic ice production (rid/raft)
190      CALL iom_put( "vfxsum"     , wfx_sum * ztmp       )        ! surface melt
191      CALL iom_put( "vfxbom"     , wfx_bom * ztmp       )        ! bottom melt
192      CALL iom_put( "vfxice"     , wfx_ice * ztmp       )        ! total ice growth/melt
193
194      IF ( iom_use( "vfxthin" ) ) THEN   ! ice production for open water + thin ice (<20cm) => comparable to observations 
195         WHERE( htm_i(:,:) < 0.2 .AND. htm_i(:,:) > 0. ) ; z2d = wfx_bog
196         ELSEWHERE                                       ; z2d = 0._wp
197         END WHERE
198         CALL iom_put( "vfxthin", ( wfx_opw + z2d ) * ztmp )
199      ENDIF
200
201      ztmp = rday / rhosn
202      CALL iom_put( "vfxspr"     , wfx_spr * ztmp       )        ! precip (snow)
203      CALL iom_put( "vfxsnw"     , wfx_snw * ztmp       )        ! total snw growth/melt
204      CALL iom_put( "vfxsub"     , wfx_sub * ztmp       )        ! sublimation (snow/ice)
205      CALL iom_put( "vfxsub_err" , wfx_err_sub * ztmp   )        ! "excess" of sublimation sent to ocean     
206 
207      CALL iom_put( "afxtot"     , afx_tot              )        ! concentration tendency (total)
208      CALL iom_put( "afxdyn"     , afx_dyn              )        ! concentration tendency (dynamics)
209      CALL iom_put( "afxthd"     , afx_thd              )        ! concentration tendency (thermo)
210
211      CALL iom_put ('hfxthd'     , hfx_thd(:,:)         )   
212      CALL iom_put ('hfxdyn'     , hfx_dyn(:,:)         )   
213      CALL iom_put ('hfxres'     , hfx_res(:,:)         )   
214      CALL iom_put ('hfxout'     , hfx_out(:,:)         )   
215      CALL iom_put ('hfxin'      , hfx_in(:,:)          )   
216      CALL iom_put ('hfxsnw'     , hfx_snw(:,:)         )   
217      CALL iom_put ('hfxsub'     , hfx_sub(:,:)         )   
218      CALL iom_put ('hfxerr'     , hfx_err(:,:)         )   
219      CALL iom_put ('hfxerr_rem' , hfx_err_rem(:,:)     )   
220     
221      CALL iom_put ('hfxsum'     , hfx_sum(:,:)         )   
222      CALL iom_put ('hfxbom'     , hfx_bom(:,:)         )   
223      CALL iom_put ('hfxbog'     , hfx_bog(:,:)         )   
224      CALL iom_put ('hfxdif'     , hfx_dif(:,:)         )   
225      CALL iom_put ('hfxopw'     , hfx_opw(:,:)         )   
226      CALL iom_put ('hfxtur'     , fhtur(:,:) * SUM( a_i_b(:,:,:), dim=3 ) ) ! turbulent heat flux at ice base
227      CALL iom_put ('hfxdhc'     , diag_heat(:,:)       )   ! Heat content variation in snow and ice
228      CALL iom_put ('hfxspr'     , hfx_spr(:,:)         )   ! Heat content of snow precip
229
230      !--------------------------------
231      ! Add-ons for SIMIP
232      !--------------------------------
233      zrho1 = ( rau0 - rhoic ) / rau0; zrho2 = rhosn / rau0
234
235      IF  ( iom_use( "icethic"  ) ) CALL iom_put( "icethic"     , htm_i * zswi               )          ! ice thickness
236      IF  ( iom_use( "icepres"  ) ) CALL iom_put( "icepres"     , zswi                       )          ! ice presence (1 or 0)
237      IF  ( iom_use( "snowthic" ) ) CALL iom_put( "snowthic"    , htm_s * zswi               )          ! snow thickness       
238      IF  ( iom_use( "icemass"  ) ) CALL iom_put( "icemass"     , rhoic * vt_i(:,:) * zswi   )          ! ice mass per cell area
239      IF  ( iom_use( "snomass"  ) ) CALL iom_put( "snomass"     , rhosn * vt_s(:,:) * zswi   )          ! snow mass per cell area
240      IF  ( iom_use( "icesnt"   ) ) CALL iom_put( "icesnt"      , ( tm_si - rt0 ) * zswi     )          ! snow-ice interface temperature
241      IF  ( iom_use( "icebot"   ) ) CALL iom_put( "icebot"      , ( t_bo  - rt0 ) * zswi     )          ! ice bottom temperature
242      IF  ( iom_use( "icesmass" ) ) CALL iom_put( "icesmass"    , smt_i * vt_i * rhoic / 1000. * zswi ) ! mass of salt in sea ice per cell area
243      IF  ( iom_use( "icefb"    ) ) CALL iom_put( "icefb"       , ( zrho1 * htm_i(:,:) - zrho2 * htm_s(:,:) ) * zswi ) ! mass of salt in sea ice per cell area
244
245      IF  ( iom_use( "wfxsum"   ) ) CALL iom_put( "wfxsum"      ,   wfx_sum                  )          ! Freshwater flux from sea-ice surface
246      IF  ( iom_use( "dmithd"   ) ) CALL iom_put( "dmithd"      , - wfx_bog - wfx_bom - wfx_sum   &     ! Sea-ice mass change from thermodynamics
247              &                     - wfx_sni - wfx_opw - wfx_res )
248      IF  ( iom_use( "dmidyn"   ) ) CALL iom_put( "dmidyn"      ,   diag_dmi_dyn             )          ! Sea-ice mass change from dynamics
249      IF  ( iom_use( "dmiopw"   ) ) CALL iom_put( "dmiopw"      , - wfx_opw                  )          ! Sea-ice mass change through growth in open water
250      IF  ( iom_use( "dmibog"   ) ) CALL iom_put( "dmibog"      , - wfx_bog                  )          ! Sea-ice mass change through basal growth
251      IF  ( iom_use( "dmisni"   ) ) CALL iom_put( "dmisni"      , - wfx_sni                  )          ! Sea-ice mass change through snow-to-ice conversion
252      IF  ( iom_use( "dmisum"   ) ) CALL iom_put( "dmisum"      , - wfx_sum                  )          ! Sea-ice mass change through surface melting
253      IF  ( iom_use( "dmibom"   ) ) CALL iom_put( "dmibom"      , - wfx_bom                  )          ! Sea-ice mass change through bottom melting
254      IF  ( iom_use( "dmtsub"   ) ) CALL iom_put( "dmtsub"      , - wfx_sub                  )          ! Sea-ice mass change through evaporation and sublimation
255      IF  ( iom_use( "dmsspr"   ) ) CALL iom_put( "dmsspr"      , - wfx_spr                  )          ! snow mass change through snow fall
256      IF  ( iom_use( "dmsssi"   ) ) CALL iom_put( "dmsssi"      ,   wfx_sni*rhosn/rhoic      )          ! snow mass change through snow-to-ice conversion
257
258      IF  ( iom_use( "dmsmel"   ) ) CALL iom_put( "dmsmel"      ,   diag_dms_mel             )          ! snow mass change through melt
259      IF  ( iom_use( "dmsdyn"   ) ) CALL iom_put( "dmsdyn"      ,   diag_dms_dyn             )          ! snow mass change through dynamics
260
261      IF  ( iom_use( "hfxconbo" ) ) CALL iom_put( "hfxconbo"    ,   diag_fc_bo               )          ! bottom conduction flux
262      IF  ( iom_use( "hfxconsu" ) ) CALL iom_put( "hfxconsu"    ,   diag_fc_su               )          ! surface conduction flux
263
264      IF  ( iom_use( "wfxtot"   ) ) CALL iom_put( "wfxtot"      ,   -wfx_ice                 )          ! total freshwater flux from sea ice
265
266      IF  ( iom_use( "dmtxdyn"  ) ) CALL iom_put( "dmtxdyn"     ,   diag_dmtx_dyn            )          ! X-component of sea-ice mass transport
267      IF  ( iom_use( "dmtydyn"  ) ) CALL iom_put( "dmtydyn"     ,   diag_dmty_dyn            )          ! Y-component of sea-ice mass transport
268
269      IF  ( iom_use( "utau_oce" ) ) CALL iom_put( "utau_oce"    ,   diag_utau_oi*zswi        )          ! X-component of ocean stress on sea ice
270      IF  ( iom_use( "vtau_oce" ) ) CALL iom_put( "vtau_oce"    ,   diag_vtau_oi*zswi        )          ! Y-component of ocean stress on sea ice
271
272      IF  ( iom_use( "dssh_dx"  ) ) CALL iom_put( "dssh_dx"     ,   diag_dssh_dx*zswi        )          ! Sea-surface tilt term in force balance (x-component)
273      IF  ( iom_use( "dssh_dy"  ) ) CALL iom_put( "dssh_dy"     ,   diag_dssh_dy*zswi        )          ! Sea-surface tilt term in force balance (y-component)
274
275      IF  ( iom_use( "corstrx"  ) ) CALL iom_put( "corstrx"     ,   diag_corstrx*zswi        )          ! Coriolis force term in force balance (x-component)
276      IF  ( iom_use( "corstry"  ) ) CALL iom_put( "corstry"     ,   diag_corstry*zswi        )          ! Coriolis force term in force balance (y-component)
277
278      IF  ( iom_use( "intstrx"  ) ) CALL iom_put( "intstrx"     ,   diag_intstrx*zswi        )          ! Internal force term in force balance (x-component)
279      IF  ( iom_use( "intstry"  ) ) CALL iom_put( "intstry"     ,   diag_intstry*zswi        )          ! Internal force term in force balance (y-component)
280
281      IF  ( iom_use( "normstr"  ) ) CALL iom_put( "normstr"     ,   diag_sig1   *zswi        )          ! Normal stress
282      IF  ( iom_use( "sheastr"  ) ) CALL iom_put( "sheastr"     ,   diag_sig2   *zswi        )          ! Shear stress
283
284      !--------------------------------
285      ! Global ice diagnostics (SIMIP)
286      !--------------------------------
287      !
288      ! What follows could be a separate routine
289      !
290
291       IF ( iom_use( "NH_icearea" ) .OR. iom_use( "NH_icevolu" ) ) THEN    ! NH ice area
292 
293         WHERE( fcor > 0 ); zswi(:,:) = 1.0e-12; 
294         ELSEWHERE        ; zswi(:,:) = 0.
295         END WHERE
296
297           IF ( iom_use( "NH_icearea" ) ) THEN
298              zdiag_area_nh = glob_sum( at_i(:,:) * zswi(:,:) * e12t(:,:) )
299              CALL iom_put( "NH_icearea", zdiag_area_nh )
300           ENDIF
301           IF ( iom_use( "NH_icevolu" ) ) THEN
302              zdiag_volu_nh = glob_sum( vt_i(:,:) * zswi(:,:) * e12t(:,:) )
303              CALL iom_put( "NH_icevolu", zdiag_volu_nh )
304           ENDIF
305
306      ENDIF
307
308      IF ( iom_use( "NH_iceextt" ) ) THEN                                   ! NH ice extt
309
310         WHERE( fcor > 0 .AND. at_i > 0.15 ); zswi(:,:) = 1.0e-12; 
311         ELSEWHERE                          ; zswi(:,:) = 0.
312         END WHERE
313
314         zdiag_extt_nh = glob_sum( zswi(:,:) * e12t(:,:) )
315         CALL iom_put( "NH_iceextt", zdiag_extt_nh )
316
317      ENDIF
318
319      IF ( iom_use( "SH_icearea" ) .OR. iom_use( "SH_icevolu" ) ) THEN    ! SH ice area  / volume
320
321         WHERE( fcor < 0 ); zswi(:,:) = 1.0e-12; 
322         ELSEWHERE        ; zswi(:,:) = 0.
323         END WHERE
324
325         IF ( iom_use( "SH_icearea" ) ) THEN
326            zdiag_area_sh = glob_sum( at_i(:,:) * zswi(:,:) * e12t(:,:) ) 
327            CALL iom_put( "SH_icearea", zdiag_area_sh )
328         ENDIF
329         IF ( iom_use( "SH_icevolu" ) ) THEN
330            zdiag_volu_sh = glob_sum( vt_i(:,:) * zswi(:,:) * e12t(:,:) )
331            CALL iom_put( "SH_icevolu", zdiag_volu_sh )
332         ENDIF
333
334      ENDIF
335
336      IF ( iom_use( "SH_iceextt" ) ) THEN                                   ! SH ice extt
337
338         WHERE( fcor < 0 .AND. at_i > 0.15 ); zswi(:,:) = 1.0e-12; 
339         ELSEWHERE                          ; zswi(:,:) = 0.
340         END WHERE
341
342         zdiag_extt_sh = glob_sum( zswi(:,:) * e12t(:,:) )
343
344         CALL iom_put( "SH_iceextt", zdiag_extt_sh )
345
346      ENDIF 
347
348      !------------------------
349      ! Fluxes through straits
350      !------------------------
351      !
352      ! This piece of code is quite awful and should probably be a separate routine
353      !
354      ! See Notz et al 2016 for definitions
355      ! 4 Arctic passages are considered (Fram, CAA, Barents, Bering)
356      !
357
358      IF ( iom_use("strait_arfl") .OR. iom_use("strait_mifl") .OR. iom_use("strait_msfl") ) THEN
359
360         zdiag_area_strait(:) = 0._wp
361         zdiag_mice_strait(:) = 0._wp
362         zdiag_msno_strait(:) = 0._wp
363   
364         ! === Fram Strait ===
365         IF ( i_grid == 2 ) THEN     ! ORCA2
366            Nv  = 4
367            zvi(1:Nv) = (/ 133, 134, 135, 136 /)
368            zvj(1:Nv) = (/ 136, 136, 136, 136 /)
369         ENDIF
370   
371         IF ( i_grid == 1 ) THEN    ! eORCA1
372            Nv  = 10
373            zvi(1:Nv) = (/ 268,269,270,271,272,273,274,275,276,277 /)
374            zvj(1:Nv) = (/ 311,311,311,311,311,311,311,311,311,311 /)
375         ENDIF
376   
377         DO ii = 1, Nv
378            ji = zvi(ii)   
379            jj = zvj(ii)
380            zdiag_area_strait(1) = zdiag_area_strait(1)                               & ! --- ice area flux ---
381                &                + at_i(ji,jj-1) * e12t(ji,jj-1) * MAX( v_ice(ji,jj-1), 0.0 )         & ! northwards (positive) flow
382                &                + at_i(ji,jj  ) * e12t(ji,jj)   * MIN( v_ice(ji,jj-1), 0.0 )           ! southwards (negative) flow
383   
384            zdiag_mice_strait(1) = zdiag_mice_strait(1) + rhoic *                     & ! --- ice mass flux  ---
385                &                ( vt_i(ji,jj-1) * e12t(ji,jj-1) * MAX( v_ice(ji,jj-1), 0.0 )         & !
386                &                + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( v_ice(ji,jj-1), 0.0 ) )         !
387   
388            zdiag_msno_strait(1) = zdiag_msno_strait(1) + rhosn *                     & ! --- snow mass flux ---
389                &                ( vt_s(ji,jj-1) * e12t(ji,jj-1) * MAX( v_ice(ji,jj-1), 0.0 )         & 
390                &                + vt_s(ji,jj  ) * e12t(ji,jj)   * MIN( v_ice(ji,jj-1), 0.0 ) ) 
391         END DO
392   
393         ! === Bering Strait ===
394         IF ( i_grid == 1 ) THEN ! eORCA1
395            Nv  = 3
396            zvi(1:Nv) = (/ 113,114,115 /)
397            zvj(1:Nv) = (/ 285,285,285 /)
398         ENDIF
399   
400         IF ( i_grid == 2 ) THEN ! ORCA2
401            Nv  = 2
402            zvi(1:Nv) = (/ 55 , 56 /)
403            zvj(1:Nv) = (/ 122,122 /)
404         ENDIF
405   
406         DO ii = 1, Nv
407            ji = zvi(ii)     
408            jj = zvj(ii)
409            zdiag_area_strait(4) = zdiag_area_strait(4)                               & ! --- ice area flux ---
410                &                + at_i(ji,jj-1) * e12t(ji,jj-1) * MAX( v_ice(ji,jj-1), 0.0 )         & ! northwards (positive) flow
411                &                + at_i(ji,jj  ) * e12t(ji,jj)   * MIN( v_ice(ji,jj-1), 0.0 )           ! southwards (negative) flow
412   
413            zdiag_mice_strait(4) = zdiag_mice_strait(4) + rhoic *                     & ! --- ice mass flux  ---
414                &                ( vt_i(ji,jj-1) * e12t(ji,jj-1) * MAX( v_ice(ji,jj-1), 0.0 )            & !
415                &                + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( v_ice(ji,jj-1), 0.0 ) )            !
416   
417            zdiag_msno_strait(4) = zdiag_msno_strait(4) + rhosn *                     & ! --- snow mass flux ---
418                &                ( vt_s(ji,jj-1) * e12t(ji,jj-1) * MAX( v_ice(ji,jj-1), 0.0 )            & 
419                &                + vt_s(ji,jj  ) * e12t(ji,jj)   * MIN( v_ice(ji,jj-1), 0.0 ) ) 
420         END DO
421   
422         ! === Barents throughflow (eORCA1)
423
424         ! U-flow
425         IF ( i_grid == 1 ) THEN ! 'eORCA1'
426            Nu = 11
427            zui(1:Nu) = (/ 282,283,284,285,286,286,287,288,289,290,292/)
428            zuj(1:Nu) = (/ 308,307,306,305,304,303,302,301,300,299,298/)
429         ENDIF
430         IF ( i_grid == 2 ) THEN ! 'ORCA2'
431            Nu = 5
432            zui(1:Nu) = (/ 141,142,142,143,144 /)
433            zuj(1:Nu) = (/ 134,133,132,131,130 /)
434         ENDIF
435         zfarea_u = 0._wp
436         zfmice_u = 0._wp
437         zfmsno_u = 0._wp
438   
439         DO ii = 1, Nu
440            ji = zui(ii)     
441            jj = zuj(ii)
442            zfarea_u          = zfarea_u                                           & ! --- ice area zonal flux ---
443                &             + at_i(ji-1,jj) * e12t(ji-1,jj) * MAX( u_ice(ji-1,jj), 0.0 )         & ! --- eastward
444                &             + at_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji-1,jj), 0.0 )           ! --- westward
445            zfmice_u          = zfmice_u + rhoic *                                 & ! --- ice mass zonal flux ---
446                &             ( vt_i(ji-1,jj) * e12t(ji-1,jj) * MAX( u_ice(ji-1,jj), 0.0 )         &   
447                &             + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji-1,jj), 0.0 ) )         
448            zfmsno_u          = zfmsno_u + rhosn *                                 & ! --- snow mass zonal flux ---
449                &             ( vt_s(ji-1,jj) * e12t(ji-1,jj) * MAX( u_ice(ji-1,jj), 0.0 )         &   
450                &             + vt_s(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji-1,jj), 0.0 ) )         
451         END DO
452   
453         ! V-flow
454         IF ( i_grid == 1 ) THEN ! 'eORCA1'
455            Nv = 9
456            zvi(1:Nv) = (/ 282,283,284,285,286,287,288,289,290/)
457            zvj(1:Nv) = (/ 308,307,306,305,303,302,301,300,299/)
458         ENDIF
459         IF ( i_grid == 2 ) THEN ! 'ORCA2'
460            Nv = 4
461            zvi(1:Nv) = (/ 140,141,142,143 /)
462            zvj(1:Nv) = (/ 135,134,132,131 /)
463         ENDIF
464         zfarea_v = 0._wp
465         zfmice_v = 0._wp
466         zfmsno_v = 0._wp
467   
468         DO ii  = 1, Nv 
469            ji = zvi(ii)     
470            jj = zvj(ii)
471            zfarea_v          = zfarea_v                                           & ! --- ice area meridian flux ---
472                &             + at_i(ji,jj-1) * e12t(ji,jj-1) * MAX( u_ice(ji,jj-1), 0.0 )         & ! --- eastward
473                &             + at_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji,jj-1), 0.0 )           ! --- westward
474            zfmice_v          = zfmice_v + rhoic *                                 & ! --- ice mass meridian flux ---
475                &             ( vt_i(ji,jj-1) * e12t(ji,jj-1) * MAX( u_ice(ji,jj-1), 0.0 )         & !
476                &             + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji,jj-1), 0.0 ) )         !
477            zfmsno_v          = zfmsno_v + rhosn *                                 & ! --- snow mass meridian flux ---
478                &             ( vt_i(ji,jj-1) * e12t(ji,jj-1) * MAX( u_ice(ji,jj-1), 0.0 )         & !
479                &             + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji,jj-1), 0.0 ) )         !
480         END DO
481   
482         ! Sum U/V contributions
483         zdiag_area_strait(3) = zfarea_u + zfarea_v 
484         zdiag_mice_strait(3) = zfmice_u + zfmice_v
485         zdiag_msno_strait(3) = zfmsno_u + zfmsno_v
486   
487         ! === CAA throughflow ===
488         ! U-flow through Queen Elisabeth Islands and McClure straits
489         IF ( i_grid == 1 ) THEN  ! eORCA1
490            Nu = 8 
491            zui(1:Nu) = (/ 231,231,231,  132,132,132,132,132  /)
492            zuj(1:Nu) = (/ 328,329,330,  318,319,320,321,322  /)
493            zfarea_u = 0._wp
494            zfmice_u = 0._wp
495            zfmsno_u = 0._wp
496     
497            DO ii = 1, Nu
498               ji = zui(ii)     
499               jj = zuj(ii)
500               zfarea_u          = zfarea_u                                           & ! --- ice area zonal flux ---
501                   &             + at_i(ji-1,jj) * e12t(ji-1,jj) * MAX( u_ice(ji-1,jj), 0.0 )         & ! --- eastward
502                   &             + at_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji-1,jj), 0.0 )           ! --- westward
503               zfmice_u          = zfmice_u + rhoic *                                 & ! --- ice mass zonal flux ---
504                   &             ( vt_i(ji-1,jj) * e12t(ji-1,jj) * MAX( u_ice(ji-1,jj), 0.0 )         &   
505                   &             + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji-1,jj), 0.0 ) )         
506               zfmsno_u          = zfmsno_u + rhosn *                                 & ! --- snow mass zonal flux ---
507                   &             ( vt_s(ji-1,jj) * e12t(ji-1,jj) * MAX( u_ice(ji-1,jj), 0.0 )         &   
508                   &             + vt_s(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji-1,jj), 0.0 ) )         
509            END DO
510         ENDIF
511
512         IF ( i_grid == 2 ) THEN   ! ORCA2
513            zfarea_u = 0._wp       ! QEI and McClure straits are not resolved in ORCA2
514            zfmice_u = 0._wp
515            zfmsno_u = 0._wp
516         ENDIF
517   
518         ! V-flow through Nares Strait
519         IF ( i_grid == 1 ) THEN   ! eORCA1
520            Nv = 4
521            zvi(1:Nv) = (/ 254,255,256,257 /)
522            zvj(1:Nv) = (/ 317,317,317,317 /)
523         ENDIF
524         IF ( i_grid == 2 ) THEN   ! ORCA2
525            Nv = 2
526            zvi(1:Nv) = (/ 117,118 /)
527            zvj(1:Nv) = (/ 145,145 /)
528         ENDIF
529         zfarea_v = 0._wp
530         zfmice_v = 0._wp
531         zfmsno_v = 0._wp
532   
533         DO ii = 1, Nv 
534            ji = zvi(ii)     
535            jj = zvj(ii)
536            zfarea_v          = zfarea_v                                           & ! --- ice area meridian flux ---
537                &             + at_i(ji,jj-1) * e12t(ji,jj-1) * MAX( u_ice(ji,jj-1), 0.0 )         & ! --- eastward
538                &             + at_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji,jj-1), 0.0 )           ! --- westward
539            zfmice_v          = zfmice_v + rhoic *                                 & ! --- ice mass meridian flux ---
540                &             ( vt_i(ji,jj-1) * e12t(ji,jj-1) * MAX( u_ice(ji,jj-1), 0.0 )         & !
541                &             + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji,jj-1), 0.0 ) )         !
542            zfmsno_v          = zfmsno_v + rhosn *                                 & ! --- snow mass meridian flux ---
543                &             ( vt_i(ji,jj-1) * e12t(ji,jj-1) * MAX( u_ice(ji,jj-1), 0.0 )         & !
544                &             + vt_i(ji,jj  ) * e12t(ji,jj)   * MIN( u_ice(ji,jj-1), 0.0 ) )         !
545         END DO
546
547         ! Sum U/V contributions
548         zdiag_area_strait(2) = zfarea_u + zfarea_v 
549         zdiag_mice_strait(2) = zfmice_u + zfmice_v
550         zdiag_msno_strait(2) = zfmsno_u + zfmsno_v
551   
552         ! === Write in file
553         IF ( iom_use("strait_arfl") ) CALL iom_put( "strait_arfl", zdiag_area_strait )
554         IF ( iom_use("strait_mifl") ) CALL iom_put( "strait_mifl", zdiag_mice_strait )
555         IF ( iom_use("strait_msfl") ) CALL iom_put( "strait_msfl", zdiag_msno_strait ) 
556
557         WRITE(numout,*) " area flx ", zdiag_area_strait(:)
558         WRITE(numout,*) " mice flx ", zdiag_mice_strait(:)
559         WRITE(numout,*) " msno flx ", zdiag_msno_strait(:)
560
561      ENDIF
562
563      !----------------------------------
564      ! Output category-dependent fields
565      !----------------------------------
566      IF ( iom_use( "iceconc_cat"  ) )  CALL iom_put( "iceconc_cat"      , a_i   * zswi2   )        ! area for categories
567      IF ( iom_use( "icethic_cat"  ) )  CALL iom_put( "icethic_cat"      , ht_i  * zswi2   )        ! thickness for categories
568      IF ( iom_use( "snowthic_cat" ) )  CALL iom_put( "snowthic_cat"     , ht_s  * zswi2   )        ! snow depth for categories
569      IF ( iom_use( "salinity_cat" ) )  CALL iom_put( "salinity_cat"     , sm_i  * zswi2   )        ! salinity for categories
570      ! ice temperature
571      IF ( iom_use( "icetemp_cat"  ) )  CALL iom_put( "icetemp_cat", ( SUM( t_i(:,:,:,:), dim=3 ) * r1_nlay_i - rt0 ) * zswi2 )
572      ! snow temperature
573      IF ( iom_use( "snwtemp_cat"  ) )  CALL iom_put( "snwtemp_cat", ( SUM( t_s(:,:,:,:), dim=3 ) * r1_nlay_s - rt0 ) * zswi2 )
574      ! ice age
575      IF ( iom_use( "iceage_cat"   ) )  CALL iom_put( "iceage_cat" , o_i * zswi2 * z1_365 )
576      ! brine volume
577      IF ( iom_use( "brinevol_cat" ) )  CALL iom_put( "brinevol_cat", bv_i * 100. * zswi2 )
578
579      !     !  Create an output files (output.lim.abort.nc) if S < 0 or u > 20 m/s
580      !     IF( kindic < 0 )   CALL lim_wri_state( 'output.abort' )
581      !     not yet implemented
582     
583      CALL wrk_dealloc( jpi, jpj, jpl, zswi2 )
584      CALL wrk_dealloc( jpi, jpj     , z2d, zswi )
585
586      IF( nn_timing == 1 )  CALL timing_stop('limwri')
587     
588   END SUBROUTINE lim_wri
589
590 
591   SUBROUTINE lim_wri_state( kt, kid, kh_i )
592      !!---------------------------------------------------------------------
593      !!                 ***  ROUTINE lim_wri_state  ***
594      !!       
595      !! ** Purpose :   create a NetCDF file named cdfile_name which contains
596      !!      the instantaneous ice state and forcing fields for ice model
597      !!        Used to find errors in the initial state or save the last
598      !!      ocean state in case of abnormal end of a simulation
599      !!
600      !! History :
601      !!   4.0  !  2013-06  (C. Rousset)
602      !!----------------------------------------------------------------------
603      INTEGER, INTENT( in )   ::   kt               ! ocean time-step index)
604      INTEGER, INTENT( in )   ::   kid , kh_i
605      INTEGER                 ::   nz_i, jl
606      REAL(wp), DIMENSION(jpl) :: jcat
607      !!----------------------------------------------------------------------
608      DO jl = 1, jpl
609         jcat(jl) = REAL(jl)
610      ENDDO
611     
612      CALL histvert( kid, "ncatice", "Ice Categories","", jpl, jcat, nz_i, "up")
613
614      CALL histdef( kid, "sithic", "Ice thickness"           , "m"      ,   &
615      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
616      CALL histdef( kid, "siconc", "Ice concentration"       , "%"      ,   &
617      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
618      CALL histdef( kid, "sitemp", "Ice temperature"         , "C"      ,   &
619      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
620      CALL histdef( kid, "sivelu", "i-Ice speed "            , "m/s"    ,   &
621      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
622      CALL histdef( kid, "sivelv", "j-Ice speed "            , "m/s"    ,   &
623      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
624      CALL histdef( kid, "sistru", "i-Wind stress over ice " , "Pa"     ,   &
625      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
626      CALL histdef( kid, "sistrv", "j-Wind stress over ice " , "Pa"     ,   &
627      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
628      CALL histdef( kid, "sisflx", "Solar flux over ocean"     , "w/m2" ,   &
629      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
630      CALL histdef( kid, "sinflx", "Non-solar flux over ocean" , "w/m2" ,   &
631      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
632      CALL histdef( kid, "isnowpre", "Snow precipitation"      , "kg/m2/s",   &
633      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
634      CALL histdef( kid, "sisali", "Ice salinity"            , "PSU"    ,   &
635      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
636      CALL histdef( kid, "sivolu", "Ice volume"              , "m"      ,   &
637      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
638      CALL histdef( kid, "sidive", "Ice divergence"          , "10-8s-1",   &
639      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt ) 
640
641      CALL histdef( kid, "vfxbog", "Ice bottom production"   , "m/s"    ,   &
642      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
643      CALL histdef( kid, "vfxdyn", "Ice dynamic production"  , "m/s"    ,   &
644      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
645      CALL histdef( kid, "vfxopw", "Ice open water prod"     , "m/s"    ,   &
646      &       jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
647      CALL histdef( kid, "vfxsni", "Snow ice production "    , "m/s"    ,   &
648      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
649      CALL histdef( kid, "vfxres", "Ice prod from limupdate" , "m/s"    ,   &
650      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
651      CALL histdef( kid, "vfxbom", "Ice bottom melt"         , "m/s"    ,   &
652      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
653      CALL histdef( kid, "vfxsum", "Ice surface melt"        , "m/s"    ,   &
654      &      jpi, jpj, kh_i, 1, 1, 1, -99, 32, "inst(x)", rdt, rdt )
655
656      CALL histdef( kid, "sithicat", "Ice thickness"         , "m"      ,   &
657      &      jpi, jpj, kh_i, jpl, 1, jpl, nz_i, 32, "inst(x)", rdt, rdt )
658      CALL histdef( kid, "siconcat", "Ice concentration"     , "%"      ,   &
659      &      jpi, jpj, kh_i, jpl, 1, jpl, nz_i, 32, "inst(x)", rdt, rdt )
660      CALL histdef( kid, "sisalcat", "Ice salinity"           , ""      ,   &
661      &      jpi, jpj, kh_i, jpl, 1, jpl, nz_i, 32, "inst(x)", rdt, rdt )
662      CALL histdef( kid, "sitemcat", "Ice temperature"       , "C"      ,   &
663      &      jpi, jpj, kh_i, jpl, 1, jpl, nz_i, 32, "inst(x)", rdt, rdt )
664      CALL histdef( kid, "snthicat", "Snw thickness"         , "m"      ,   &
665      &      jpi, jpj, kh_i, jpl, 1, jpl, nz_i, 32, "inst(x)", rdt, rdt )
666      CALL histdef( kid, "sntemcat", "Snw temperature"       , "C"      ,   &
667      &      jpi, jpj, kh_i, jpl, 1, jpl, nz_i, 32, "inst(x)", rdt, rdt )
668
669      CALL histend( kid, snc4set )   ! end of the file definition
670
671      CALL histwrite( kid, "sithic", kt, htm_i         , jpi*jpj, (/1/) )   
672      CALL histwrite( kid, "siconc", kt, at_i          , jpi*jpj, (/1/) )
673      CALL histwrite( kid, "sitemp", kt, tm_i - rt0    , jpi*jpj, (/1/) )
674      CALL histwrite( kid, "sivelu", kt, u_ice          , jpi*jpj, (/1/) )
675      CALL histwrite( kid, "sivelv", kt, v_ice          , jpi*jpj, (/1/) )
676      CALL histwrite( kid, "sistru", kt, utau_ice       , jpi*jpj, (/1/) )
677      CALL histwrite( kid, "sistrv", kt, vtau_ice       , jpi*jpj, (/1/) )
678      CALL histwrite( kid, "sisflx", kt, qsr , jpi*jpj, (/1/) )
679      CALL histwrite( kid, "sinflx", kt, qns , jpi*jpj, (/1/) )
680      CALL histwrite( kid, "isnowpre", kt, sprecip        , jpi*jpj, (/1/) )
681      CALL histwrite( kid, "sisali", kt, smt_i          , jpi*jpj, (/1/) )
682      CALL histwrite( kid, "sivolu", kt, vt_i           , jpi*jpj, (/1/) )
683      CALL histwrite( kid, "sidive", kt, divu_i*1.0e8   , jpi*jpj, (/1/) )
684
685      CALL histwrite( kid, "vfxbog", kt, wfx_bog        , jpi*jpj, (/1/) )
686      CALL histwrite( kid, "vfxdyn", kt, wfx_dyn        , jpi*jpj, (/1/) )
687      CALL histwrite( kid, "vfxopw", kt, wfx_opw        , jpi*jpj, (/1/) )
688      CALL histwrite( kid, "vfxsni", kt, wfx_sni        , jpi*jpj, (/1/) )
689      CALL histwrite( kid, "vfxres", kt, wfx_res        , jpi*jpj, (/1/) )
690      CALL histwrite( kid, "vfxbom", kt, wfx_bom        , jpi*jpj, (/1/) )
691      CALL histwrite( kid, "vfxsum", kt, wfx_sum        , jpi*jpj, (/1/) )
692
693      CALL histwrite( kid, "sithicat", kt, ht_i        , jpi*jpj*jpl, (/1/) )   
694      CALL histwrite( kid, "siconcat", kt, a_i         , jpi*jpj*jpl, (/1/) )   
695      CALL histwrite( kid, "sisalcat", kt, sm_i        , jpi*jpj*jpl, (/1/) )   
696      CALL histwrite( kid, "sitemcat", kt, tm_i - rt0  , jpi*jpj*jpl, (/1/) )   
697      CALL histwrite( kid, "snthicat", kt, ht_s        , jpi*jpj*jpl, (/1/) )   
698      CALL histwrite( kid, "sntemcat", kt, tm_su - rt0 , jpi*jpj*jpl, (/1/) )   
699
700      ! Close the file
701      ! -----------------
702      !CALL histclo( kid )
703
704    END SUBROUTINE lim_wri_state
705
706#else
707   !!----------------------------------------------------------------------
708   !!   Default option :         Empty module          NO LIM sea-ice model
709   !!----------------------------------------------------------------------
710CONTAINS
711   SUBROUTINE lim_wri          ! Empty routine
712   END SUBROUTINE lim_wri
713#endif
714
715   !!======================================================================
716END MODULE limwri
Note: See TracBrowser for help on using the repository browser.