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

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

SIMIP outputs, phase 2, commit#5

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