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.
iceupdate.F90 in NEMO/branches/UKMO/NEMO_4.0.1_FKOSM_m11715/src/ICE – NEMO

source: NEMO/branches/UKMO/NEMO_4.0.1_FKOSM_m11715/src/ICE/iceupdate.F90 @ 13454

Last change on this file since 13454 was 13454, checked in by dancopsey, 4 years ago

Merge in Catherine Guiavarch's change to implement implicit ice drag to improve stability. Her changes were implemented in:

https://code.metoffice.gov.uk/trac/roses-u/changeset?reponame=&new=161415%40b%2Fv%2F1%2F1%2F4&old=161163%40b%2Fv%2F1%2F1%2F4

File size: 27.6 KB
RevLine 
[8586]1MODULE iceupdate
2   !!======================================================================
3   !!                       ***  MODULE iceupdate   ***
4   !!  Sea-ice :   computation of the flux at the sea ice/ocean interface
5   !!======================================================================
[9604]6   !! History :  4.0  !  2018     (many people)      SI3 [aka Sea Ice cube]
[8586]7   !!----------------------------------------------------------------------
[9570]8#if defined key_si3
[8586]9   !!----------------------------------------------------------------------
[9570]10   !!   'key_si3'                                       SI3 sea-ice model
[8586]11   !!----------------------------------------------------------------------
12   !!   ice_update_alloc : allocate the iceupdate arrays
13   !!   ice_update_init  : initialisation
14   !!   ice_update_flx   : updates mass, heat and salt fluxes at the ocean surface
15   !!   ice_update_tau   : update i- and j-stresses, and its modulus at the ocean surface
16   !!----------------------------------------------------------------------
17   USE oce     , ONLY : sshn, sshb
18   USE phycst         ! physical constants
19   USE dom_oce        ! ocean domain
20   USE ice            ! sea-ice: variables
[9071]21   USE sbc_ice        ! Surface boundary condition: ice   fields
22   USE sbc_oce        ! Surface boundary condition: ocean fields
[8586]23   USE sbccpl         ! Surface boundary condition: coupled interface
24   USE icealb         ! sea-ice: albedo parameters
25   USE traqsr         ! add penetration of solar flux in the calculation of heat budget
26   USE icectl         ! sea-ice: control prints
27   USE bdy_oce , ONLY : ln_bdy
[13454]28   USE zdfdrg , ONLY: ln_drgice_imp
[8586]29   !
30   USE in_out_manager ! I/O manager
31   USE iom            ! I/O manager library
32   USE lib_mpp        ! MPP library
33   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
34   USE lbclnk         ! lateral boundary conditions (or mpp links)
35   USE timing         ! Timing
36
37   IMPLICIT NONE
38   PRIVATE
39
40   PUBLIC   ice_update_init   ! called by ice_init
41   PUBLIC   ice_update_flx    ! called by ice_stp
42   PUBLIC   ice_update_tau    ! called by ice_stp
43
44   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau_oce, vtau_oce   ! air-ocean surface i- & j-stress     [N/m2]
45   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   tmod_io              ! modulus of the ice-ocean velocity   [m/s]
46
47   !! * Substitutions
48#  include "vectopt_loop_substitute.h90"
49   !!----------------------------------------------------------------------
[9598]50   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
[10069]51   !! $Id$
[10068]52   !! Software governed by the CeCILL license (see ./LICENSE)
[8586]53   !!----------------------------------------------------------------------
54CONTAINS
55
56   INTEGER FUNCTION ice_update_alloc()
57      !!-------------------------------------------------------------------
58      !!             ***  ROUTINE ice_update_alloc ***
59      !!-------------------------------------------------------------------
60      ALLOCATE( utau_oce(jpi,jpj), vtau_oce(jpi,jpj), tmod_io(jpi,jpj), STAT=ice_update_alloc )
61      !
[10425]62      CALL mpp_sum( 'iceupdate', ice_update_alloc )
63      IF( ice_update_alloc /= 0 )   CALL ctl_stop( 'STOP', 'ice_update_alloc: failed to allocate arrays' )
[8586]64      !
65   END FUNCTION ice_update_alloc
66
67
68   SUBROUTINE ice_update_flx( kt )
69      !!-------------------------------------------------------------------
70      !!                ***  ROUTINE ice_update_flx ***
71      !! 
72      !! ** Purpose :   Update the surface ocean boundary condition for heat
73      !!                salt and mass over areas where sea-ice is non-zero
74      !!         
75      !! ** Action  : - computes the heat and freshwater/salt fluxes
76      !!                at the ice-ocean interface.
77      !!              - Update the ocean sbc
78      !!     
79      !! ** Outputs : - qsr     : sea heat flux:     solar
80      !!              - qns     : sea heat flux: non solar
81      !!              - emp     : freshwater budget: volume flux
82      !!              - sfx     : salt flux
83      !!              - fr_i    : ice fraction
84      !!              - tn_ice  : sea-ice surface temperature
85      !!              - alb_ice : sea-ice albedo (recomputed only for coupled mode)
86      !!
87      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
88      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
89      !!              These refs are now obsolete since everything has been revised
90      !!              The ref should be Rousset et al., 2015
91      !!---------------------------------------------------------------------
92      INTEGER, INTENT(in) ::   kt   ! number of iteration
93      !
94      INTEGER  ::   ji, jj, jl, jk   ! dummy loop indices
95      REAL(wp) ::   zqmass           ! Heat flux associated with mass exchange ice->ocean (W.m-2)
96      REAL(wp) ::   zqsr             ! New solar flux received by the ocean
97      REAL(wp), DIMENSION(jpi,jpj)     ::   z2d                  ! 2D workspace
98      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zalb_cs, zalb_os     ! 3D workspace
99      !!---------------------------------------------------------------------
[9124]100      IF( ln_timing )   CALL timing_start('ice_update')
[8586]101
102      IF( kt == nit000 .AND. lwp ) THEN
103         WRITE(numout,*)
104         WRITE(numout,*)'ice_update_flx: update fluxes (mass, salt and heat) at the ice-ocean interface'
105         WRITE(numout,*)'~~~~~~~~~~~~~~'
106      ENDIF
107
108      ! --- case we bypass ice thermodynamics --- !
109      IF( .NOT. ln_icethd ) THEN   ! we suppose ice is impermeable => ocean is isolated from atmosphere
[9912]110         qt_atm_oi  (:,:)   = ( 1._wp - at_i_b(:,:) ) * ( qns_oce(:,:) + qsr_oce(:,:) ) + qemp_oce(:,:)
111         qt_oce_ai  (:,:)   = ( 1._wp - at_i_b(:,:) ) *   qns_oce(:,:)                  + qemp_oce(:,:)
[9910]112         emp_ice    (:,:)   = 0._wp
113         qemp_ice   (:,:)   = 0._wp
114         qevap_ice  (:,:,:) = 0._wp
[8586]115      ENDIF
116     
117      DO jj = 1, jpj
118         DO ji = 1, jpi
119
120            ! Solar heat flux reaching the ocean = zqsr (W.m-2)
121            !---------------------------------------------------
[9910]122            zqsr = qsr_tot(ji,jj) - SUM( a_i_b(ji,jj,:) * ( qsr_ice(ji,jj,:) - qtr_ice_bot(ji,jj,:) ) )
[8586]123
[9912]124            ! Total heat flux reaching the ocean = qt_oce_ai (W.m-2)
[8586]125            !---------------------------------------------------
[9912]126            zqmass           = hfx_thd(ji,jj) + hfx_dyn(ji,jj) + hfx_res(ji,jj) ! heat flux from snow is 0 (T=0 degC)
127            qt_oce_ai(ji,jj) = qt_oce_ai(ji,jj) + zqmass + zqsr
[8586]128
129            ! Add the residual from heat diffusion equation and sublimation (W.m-2)
130            !----------------------------------------------------------------------
[9912]131            qt_oce_ai(ji,jj) = qt_oce_ai(ji,jj) + hfx_err_dif(ji,jj) +   &
132               &             ( hfx_sub(ji,jj) - SUM( qevap_ice(ji,jj,:) * a_i_b(ji,jj,:) ) )
[8586]133
134            ! New qsr and qns used to compute the oceanic heat flux at the next time step
135            !----------------------------------------------------------------------------
136            qsr(ji,jj) = zqsr                                     
[9912]137            qns(ji,jj) = qt_oce_ai(ji,jj) - zqsr             
[8586]138
139            ! Mass flux at the atm. surface       
140            !-----------------------------------
141            wfx_sub(ji,jj) = wfx_snw_sub(ji,jj) + wfx_ice_sub(ji,jj)
142
143            ! Mass flux at the ocean surface     
144            !------------------------------------
145            !  case of realistic freshwater flux (Tartinville et al., 2001) (presently ACTIVATED)
146            !  -------------------------------------------------------------------------------------
147            !  The idea of this approach is that the system that we consider is the ICE-OCEAN system
148            !  Thus  FW  flux  =  External ( E-P+snow melt)
149            !       Salt flux  =  Exchanges in the ice-ocean system then converted into FW
150            !                     Associated to Ice formation AND Ice melting
151            !                     Even if i see Ice melting as a FW and SALT flux
152            !       
153            ! mass flux from ice/ocean
154            wfx_ice(ji,jj) = wfx_bog(ji,jj) + wfx_bom(ji,jj) + wfx_sum(ji,jj) + wfx_sni(ji,jj)   &
[8637]155               &           + wfx_opw(ji,jj) + wfx_dyn(ji,jj) + wfx_res(ji,jj) + wfx_lam(ji,jj) + wfx_pnd(ji,jj)
[8586]156
157            ! add the snow melt water to snow mass flux to the ocean
158            wfx_snw(ji,jj) = wfx_snw_sni(ji,jj) + wfx_snw_dyn(ji,jj) + wfx_snw_sum(ji,jj)
159
160            ! mass flux at the ocean/ice interface
161            fmmflx(ji,jj) = - ( wfx_ice(ji,jj) + wfx_snw(ji,jj) + wfx_err_sub(ji,jj) )              ! F/M mass flux save at least for biogeochemical model
162            emp(ji,jj)    = emp_oce(ji,jj) - wfx_ice(ji,jj) - wfx_snw(ji,jj) - wfx_err_sub(ji,jj)   ! mass flux + F/M mass flux (always ice/ocean mass exchange)
163
164
165            ! Salt flux at the ocean surface     
166            !------------------------------------------
167            sfx(ji,jj) = sfx_bog(ji,jj) + sfx_bom(ji,jj) + sfx_sum(ji,jj) + sfx_sni(ji,jj) + sfx_opw(ji,jj)   &
168               &       + sfx_res(ji,jj) + sfx_dyn(ji,jj) + sfx_bri(ji,jj) + sfx_sub(ji,jj) + sfx_lam(ji,jj)
169           
170            ! Mass of snow and ice per unit area   
171            !----------------------------------------
172            snwice_mass_b(ji,jj) = snwice_mass(ji,jj)       ! save mass from the previous ice time step
173            !                                               ! new mass per unit area
[9935]174            snwice_mass  (ji,jj) = tmask(ji,jj,1) * ( rhos * vt_s(ji,jj) + rhoi * vt_i(ji,jj)  ) 
[8586]175            !                                               ! time evolution of snow+ice mass
176            snwice_fmass (ji,jj) = ( snwice_mass(ji,jj) - snwice_mass_b(ji,jj) ) * r1_rdtice
177           
178         END DO
179      END DO
180
181      ! Storing the transmitted variables
182      !----------------------------------
183      fr_i  (:,:)   = at_i(:,:)             ! Sea-ice fraction           
184      tn_ice(:,:,:) = t_su(:,:,:)           ! Ice surface temperature                     
185
186      ! Snow/ice albedo (only if sent to coupler, useless in forced mode)
187      !------------------------------------------------------------------
[8637]188      CALL ice_alb( t_su, h_i, h_s, ln_pnd_alb, a_ip_frac, h_ip, zalb_cs, zalb_os ) ! cloud-sky and overcast-sky ice albedos
[8586]189      !
190      alb_ice(:,:,:) = ( 1._wp - cldf_ice ) * zalb_cs(:,:,:) + cldf_ice * zalb_os(:,:,:)
191      !
192      IF( lrst_ice ) THEN                       !* write snwice_mass fields in the restart file
193         CALL update_rst( 'WRITE', kt )
194      ENDIF
195      !
196      ! output all fluxes
197      !------------------
[8884]198      !
199      ! --- salt fluxes [kg/m2/s] --- !
200      !                           ! sfxice =  sfxbog + sfxbom + sfxsum + sfxsni + sfxopw + sfxres + sfxdyn + sfxbri + sfxsub + sfxlam
[11536]201      IF( iom_use('sfxice'  ) )   CALL iom_put( 'sfxice', sfx     * 1.e-03 )   ! salt flux from total ice growth/melt
202      IF( iom_use('sfxbog'  ) )   CALL iom_put( 'sfxbog', sfx_bog * 1.e-03 )   ! salt flux from bottom growth
203      IF( iom_use('sfxbom'  ) )   CALL iom_put( 'sfxbom', sfx_bom * 1.e-03 )   ! salt flux from bottom melting
204      IF( iom_use('sfxsum'  ) )   CALL iom_put( 'sfxsum', sfx_sum * 1.e-03 )   ! salt flux from surface melting
205      IF( iom_use('sfxlam'  ) )   CALL iom_put( 'sfxlam', sfx_lam * 1.e-03 )   ! salt flux from lateral melting
206      IF( iom_use('sfxsni'  ) )   CALL iom_put( 'sfxsni', sfx_sni * 1.e-03 )   ! salt flux from snow ice formation
207      IF( iom_use('sfxopw'  ) )   CALL iom_put( 'sfxopw', sfx_opw * 1.e-03 )   ! salt flux from open water formation
208      IF( iom_use('sfxdyn'  ) )   CALL iom_put( 'sfxdyn', sfx_dyn * 1.e-03 )   ! salt flux from ridging rafting
209      IF( iom_use('sfxbri'  ) )   CALL iom_put( 'sfxbri', sfx_bri * 1.e-03 )   ! salt flux from brines
210      IF( iom_use('sfxres'  ) )   CALL iom_put( 'sfxres', sfx_res * 1.e-03 )   ! salt flux from undiagnosed processes
211      IF( iom_use('sfxsub'  ) )   CALL iom_put( 'sfxsub', sfx_sub * 1.e-03 )   ! salt flux from sublimation
[8586]212
[8884]213      ! --- mass fluxes [kg/m2/s] --- !
[11536]214      CALL iom_put( 'emp_oce', emp_oce )   ! emp over ocean (taking into account the snow blown away from the ice)
215      CALL iom_put( 'emp_ice', emp_ice )   ! emp over ice   (taking into account the snow blown away from the ice)
[8586]216
[8884]217      !                           ! vfxice = vfxbog + vfxbom + vfxsum + vfxsni + vfxopw + vfxdyn + vfxres + vfxlam + vfxpnd
[11536]218      CALL iom_put( 'vfxice'    , wfx_ice     )   ! mass flux from total ice growth/melt
219      CALL iom_put( 'vfxbog'    , wfx_bog     )   ! mass flux from bottom growth
220      CALL iom_put( 'vfxbom'    , wfx_bom     )   ! mass flux from bottom melt
221      CALL iom_put( 'vfxsum'    , wfx_sum     )   ! mass flux from surface melt
222      CALL iom_put( 'vfxlam'    , wfx_lam     )   ! mass flux from lateral melt
223      CALL iom_put( 'vfxsni'    , wfx_sni     )   ! mass flux from snow-ice formation
224      CALL iom_put( 'vfxopw'    , wfx_opw     )   ! mass flux from growth in open water
225      CALL iom_put( 'vfxdyn'    , wfx_dyn     )   ! mass flux from dynamics (ridging)
226      CALL iom_put( 'vfxres'    , wfx_res     )   ! mass flux from undiagnosed processes
227      CALL iom_put( 'vfxpnd'    , wfx_pnd     )   ! mass flux from melt ponds
228      CALL iom_put( 'vfxsub'    , wfx_ice_sub )   ! mass flux from ice sublimation (ice-atm.)
229      CALL iom_put( 'vfxsub_err', wfx_err_sub )   ! "excess" of sublimation sent to ocean     
[8586]230
[11536]231      IF ( iom_use( 'vfxthin' ) ) THEN   ! mass flux from ice growth in open water + thin ice (<20cm) => comparable to observations 
[8586]232         WHERE( hm_i(:,:) < 0.2 .AND. hm_i(:,:) > 0. ) ; z2d = wfx_bog
233         ELSEWHERE                                     ; z2d = 0._wp
234         END WHERE
[11536]235         CALL iom_put( 'vfxthin', wfx_opw + z2d )
[8586]236      ENDIF
237
[11536]238      !                            ! vfxsnw = vfxsnw_sni + vfxsnw_dyn + vfxsnw_sum
239      CALL iom_put( 'vfxsnw'     , wfx_snw     )   ! mass flux from total snow growth/melt
240      CALL iom_put( 'vfxsnw_sum' , wfx_snw_sum )   ! mass flux from snow melt at the surface
241      CALL iom_put( 'vfxsnw_sni' , wfx_snw_sni )   ! mass flux from snow melt during snow-ice formation
242      CALL iom_put( 'vfxsnw_dyn' , wfx_snw_dyn )   ! mass flux from dynamics (ridging)
243      CALL iom_put( 'vfxsnw_sub' , wfx_snw_sub )   ! mass flux from snow sublimation (ice-atm.)
244      CALL iom_put( 'vfxsnw_pre' , wfx_spr     )   ! snow precip
[8884]245
246      ! --- heat fluxes [W/m2] --- !
247      !                              ! qt_atm_oi - qt_oce_ai = hfxdhc - ( dihctrp + dshctrp )
[11536]248      IF( iom_use('qsr_oce'    ) )   CALL iom_put( 'qsr_oce'    , qsr_oce * ( 1._wp - at_i_b )                               )   !     solar flux at ocean surface
249      IF( iom_use('qns_oce'    ) )   CALL iom_put( 'qns_oce'    , qns_oce * ( 1._wp - at_i_b ) + qemp_oce                    )   ! non-solar flux at ocean surface
250      IF( iom_use('qsr_ice'    ) )   CALL iom_put( 'qsr_ice'    , SUM( qsr_ice * a_i_b, dim=3 )                              )   !     solar flux at ice surface
251      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
252      IF( iom_use('qtr_ice_bot') )   CALL iom_put( 'qtr_ice_bot', SUM( qtr_ice_bot * a_i_b, dim=3 )                          )   !     solar flux transmitted thru ice
253      IF( iom_use('qtr_ice_top') )   CALL iom_put( 'qtr_ice_top', SUM( qtr_ice_top * a_i_b, dim=3 )                          )   !     solar flux transmitted thru ice surface
254      IF( iom_use('qt_oce'     ) )   CALL iom_put( 'qt_oce'     ,      ( qsr_oce + qns_oce ) * ( 1._wp - at_i_b ) + qemp_oce )
255      IF( iom_use('qt_ice'     ) )   CALL iom_put( 'qt_ice'     , SUM( ( qns_ice + qsr_ice ) * a_i_b, dim=3 )     + qemp_ice )
256      IF( iom_use('qt_oce_ai'  ) )   CALL iom_put( 'qt_oce_ai'  , qt_oce_ai * tmask(:,:,1)                                   )   ! total heat flux at the ocean   surface: interface oce-(ice+atm)
257      IF( iom_use('qt_atm_oi'  ) )   CALL iom_put( 'qt_atm_oi'  , qt_atm_oi * tmask(:,:,1)                                   )   ! total heat flux at the oce-ice surface: interface atm-(ice+oce)
258      IF( iom_use('qemp_oce'   ) )   CALL iom_put( 'qemp_oce'   , qemp_oce                                                   )   ! Downward Heat Flux from E-P over ocean
259      IF( iom_use('qemp_ice'   ) )   CALL iom_put( 'qemp_ice'   , qemp_ice                                                   )   ! Downward Heat Flux from E-P over ice
[8884]260
261      ! heat fluxes from ice transformations
[11536]262      !                            ! hfxdhc = hfxbog + hfxbom + hfxsum + hfxopw + hfxdif + hfxsnw - ( hfxthd + hfxdyn + hfxres + hfxsub + hfxspr )
263      CALL iom_put ('hfxbog'     , hfx_bog     )   ! heat flux used for ice bottom growth
264      CALL iom_put ('hfxbom'     , hfx_bom     )   ! heat flux used for ice bottom melt
265      CALL iom_put ('hfxsum'     , hfx_sum     )   ! heat flux used for ice surface melt
266      CALL iom_put ('hfxopw'     , hfx_opw     )   ! heat flux used for ice formation in open water
267      CALL iom_put ('hfxdif'     , hfx_dif     )   ! heat flux used for ice temperature change
268      CALL iom_put ('hfxsnw'     , hfx_snw     )   ! heat flux used for snow melt
269      CALL iom_put ('hfxerr'     , hfx_err_dif )   ! heat flux error after heat diffusion (included in qt_oce_ai)
[8884]270
271      ! heat fluxes associated with mass exchange (freeze/melt/precip...)
[11536]272      CALL iom_put ('hfxthd'     , hfx_thd     )   
273      CALL iom_put ('hfxdyn'     , hfx_dyn     )   
274      CALL iom_put ('hfxres'     , hfx_res     )   
275      CALL iom_put ('hfxsub'     , hfx_sub     )   
276      CALL iom_put ('hfxspr'     , hfx_spr     )   ! Heat flux from snow precip heat content
[8884]277
278      ! other heat fluxes
[11536]279      IF( iom_use('hfxsensib'  ) )   CALL iom_put( 'hfxsensib'  ,     -qsb_ice_bot * at_i_b         )   ! Sensible oceanic heat flux
280      IF( iom_use('hfxcndbot'  ) )   CALL iom_put( 'hfxcndbot'  , SUM( qcn_ice_bot * a_i_b, dim=3 ) )   ! Bottom conduction flux
281      IF( iom_use('hfxcndtop'  ) )   CALL iom_put( 'hfxcndtop'  , SUM( qcn_ice_top * a_i_b, dim=3 ) )   ! Surface conduction flux
[8884]282
[8586]283      ! controls
284      !---------
[9421]285#if ! defined key_agrif
[8586]286      IF( ln_icediachk .AND. .NOT. ln_bdy)   CALL ice_cons_final('iceupdate')                                       ! conservation
[9421]287#endif
[8586]288      IF( ln_icectl                      )   CALL ice_prt       (kt, iiceprt, jiceprt, 3, 'Final state ice_update') ! prints
289      IF( ln_ctl                         )   CALL ice_prt3D     ('iceupdate')                                       ! prints
[9124]290      IF( ln_timing                      )   CALL timing_stop   ('ice_update')                                      ! timing
[8586]291      !
292   END SUBROUTINE ice_update_flx
293
294
295   SUBROUTINE ice_update_tau( kt, pu_oce, pv_oce )
296      !!-------------------------------------------------------------------
297      !!                ***  ROUTINE ice_update_tau ***
298      !! 
299      !! ** Purpose : Update the ocean surface stresses due to the ice
300      !!         
301      !! ** Action  : * at each ice time step (every nn_fsbc time step):
302      !!                - compute the modulus of ice-ocean relative velocity
303      !!                  (*rho*Cd) at T-point (C-grid) or I-point (B-grid)
304      !!                      tmod_io = rhoco * | U_ice-U_oce |
305      !!                - update the modulus of stress at ocean surface
306      !!                      taum = (1-a) * taum + a * tmod_io * | U_ice-U_oce |
307      !!              * at each ocean time step (every kt):
308      !!                  compute linearized ice-ocean stresses as
309      !!                      Utau = tmod_io * | U_ice - pU_oce |
310      !!                using instantaneous current ocean velocity (usually before)
311      !!
312      !!    NB: - ice-ocean rotation angle no more allowed
313      !!        - here we make an approximation: taum is only computed every ice time step
314      !!          This avoids mutiple average to pass from T -> U,V grids and next from U,V grids
315      !!          to T grid. taum is used in TKE and GLS, which should not be too sensitive to this approximaton...
316      !!
317      !! ** Outputs : - utau, vtau   : surface ocean i- and j-stress (u- & v-pts) updated with ice-ocean fluxes
318      !!              - taum         : modulus of the surface ocean stress (T-point) updated with ice-ocean fluxes
319      !!---------------------------------------------------------------------
320      INTEGER ,                     INTENT(in) ::   kt               ! ocean time-step index
321      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pu_oce, pv_oce   ! surface ocean currents
322      !
323      INTEGER  ::   ji, jj   ! dummy loop indices
324      REAL(wp) ::   zat_u, zutau_ice, zu_t, zmodt   ! local scalar
325      REAL(wp) ::   zat_v, zvtau_ice, zv_t, zrhoco  !   -      -
[13454]326      REAL(wp) ::   zflagi                          !   -      -
[8586]327      !!---------------------------------------------------------------------
[9124]328      IF( ln_timing )   CALL timing_start('ice_update_tau')
[8586]329
330      IF( kt == nit000 .AND. lwp ) THEN
331         WRITE(numout,*)
332         WRITE(numout,*)'ice_update_tau: update stress at the ice-ocean interface'
333         WRITE(numout,*)'~~~~~~~~~~~~~~'
334      ENDIF
335
336      zrhoco = rau0 * rn_cio
337      !
338      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN     !==  Ice time-step only  ==!   (i.e. surface module time-step)
339         DO jj = 2, jpjm1                             !* update the modulus of stress at ocean surface (T-point)
340            DO ji = fs_2, fs_jpim1
341               !                                               ! 2*(U_ice-U_oce) at T-point
342               zu_t = u_ice(ji,jj) + u_ice(ji-1,jj) - u_oce(ji,jj) - u_oce(ji-1,jj)   
343               zv_t = v_ice(ji,jj) + v_ice(ji,jj-1) - v_oce(ji,jj) - v_oce(ji,jj-1) 
344               !                                              ! |U_ice-U_oce|^2
345               zmodt =  0.25_wp * (  zu_t * zu_t + zv_t * zv_t  )
346               !                                               ! update the ocean stress modulus
347               taum(ji,jj) = ( 1._wp - at_i(ji,jj) ) * taum(ji,jj) + at_i(ji,jj) * zrhoco * zmodt
348               tmod_io(ji,jj) = zrhoco * SQRT( zmodt )          ! rhoco * |U_ice-U_oce| at T-point
349            END DO
350         END DO
[10425]351         CALL lbc_lnk_multi( 'iceupdate', taum, 'T', 1., tmod_io, 'T', 1. )
[8586]352         !
353         utau_oce(:,:) = utau(:,:)                    !* save the air-ocean stresses at ice time-step
354         vtau_oce(:,:) = vtau(:,:)
355         !
356      ENDIF
357      !
358      !                                      !==  every ocean time-step  ==!
[13454]359      IF ( ln_drgice_imp ) THEN
360         ! Save drag with right sign to update top drag in the ocean implicit
361         ! friction
362         rCdU_ice(:,:) = -r1_rau0 * tmod_io(:,:) * at_i(:,:) * tmask(:,:,1) 
363         zflagi = 0._wp
364      ELSE
365         zflagi = 1._wp
366      ENDIF
[8586]367      !
368      DO jj = 2, jpjm1                                !* update the stress WITHOUT an ice-ocean rotation angle
[9774]369         DO ji = fs_2, fs_jpim1   ! Vect. Opt.   
370            ! ice area at u and v-points
[9782]371            zat_u  = ( at_i(ji,jj) * tmask(ji,jj,1) + at_i (ji+1,jj    ) * tmask(ji+1,jj  ,1) )  &
372               &     / MAX( 1.0_wp , tmask(ji,jj,1) + tmask(ji+1,jj  ,1) )
373            zat_v  = ( at_i(ji,jj) * tmask(ji,jj,1) + at_i (ji  ,jj+1  ) * tmask(ji  ,jj+1,1) )  &
374               &     / MAX( 1.0_wp , tmask(ji,jj,1) + tmask(ji  ,jj+1,1) )
[8586]375            !                                                   ! linearized quadratic drag formulation
[13454]376            zutau_ice   = 0.5_wp * ( tmod_io(ji,jj) + tmod_io(ji+1,jj) ) * ( u_ice(ji,jj) - zflagi * pu_oce(ji,jj) )
377            zvtau_ice   = 0.5_wp * ( tmod_io(ji,jj) + tmod_io(ji,jj+1) ) * ( v_ice(ji,jj) - zflagi * pv_oce(ji,jj) )
[8586]378            !                                                   ! stresses at the ocean surface
379            utau(ji,jj) = ( 1._wp - zat_u ) * utau_oce(ji,jj) + zat_u * zutau_ice
380            vtau(ji,jj) = ( 1._wp - zat_v ) * vtau_oce(ji,jj) + zat_v * zvtau_ice
381         END DO
382      END DO
[10425]383      CALL lbc_lnk_multi( 'iceupdate', utau, 'U', -1., vtau, 'V', -1. )   ! lateral boundary condition
[8586]384      !
[9124]385      IF( ln_timing )   CALL timing_stop('ice_update_tau')
[8586]386     
387   END SUBROUTINE ice_update_tau
388
389
390   SUBROUTINE ice_update_init
391      !!-------------------------------------------------------------------
392      !!                  ***  ROUTINE ice_update_init  ***
393      !!             
[9784]394      !! ** Purpose :   allocate ice-ocean stress fields and read restarts
395      !!                containing the snow & ice mass
[8586]396      !!
397      !!-------------------------------------------------------------------
398      INTEGER  ::   ji, jj, jk               ! dummy loop indices
399      REAL(wp) ::   zcoefu, zcoefv, zcoeff   ! local scalar
400      !!-------------------------------------------------------------------
401      !
402      IF(lwp) WRITE(numout,*)
[9784]403      IF(lwp) WRITE(numout,*) 'ice_update_init: ice-ocean stress init'
[8586]404      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~'
[9124]405      !
[8586]406      !                                      ! allocate ice_update array
407      IF( ice_update_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'ice_update_init : unable to allocate standard arrays' )
408      !
409      CALL update_rst( 'READ' )  !* read or initialize all required files
410      !
411   END SUBROUTINE ice_update_init
412
[9124]413
[8586]414   SUBROUTINE update_rst( cdrw, kt )
415      !!---------------------------------------------------------------------
416      !!                   ***  ROUTINE rhg_evp_rst  ***
417      !!                     
418      !! ** Purpose :   Read or write RHG file in restart file
419      !!
420      !! ** Method  :   use of IOM library
421      !!----------------------------------------------------------------------
[11536]422      CHARACTER(len=*) , INTENT(in) ::   cdrw   ! 'READ'/'WRITE' flag
[8586]423      INTEGER, OPTIONAL, INTENT(in) ::   kt     ! ice time-step
424      !
425      INTEGER  ::   iter   ! local integer
426      INTEGER  ::   id1    ! local integer
427      !!----------------------------------------------------------------------
428      !
429      IF( TRIM(cdrw) == 'READ' ) THEN        ! Read/initialize
430         !                                   ! ---------------
431         IF( ln_rstart ) THEN                   !* Read the restart file
432            !
433            id1 = iom_varid( numrir, 'snwice_mass' , ldstop = .FALSE. )
434            !
435            IF( id1 > 0 ) THEN                       ! fields exist
436               CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass'  , snwice_mass   )
437               CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b )
438            ELSE                                     ! start from rest
439               IF(lwp) WRITE(numout,*) '   ==>>   previous run without snow-ice mass output then set it'
[9935]440               snwice_mass  (:,:) = tmask(:,:,1) * ( rhos * vt_s(:,:) + rhoi * vt_i(:,:) )
[8586]441               snwice_mass_b(:,:) = snwice_mass(:,:)
442            ENDIF
443         ELSE                                   !* Start from rest
444            IF(lwp) WRITE(numout,*) '   ==>>   start from rest: set the snow-ice mass'
[9935]445            snwice_mass  (:,:) = tmask(:,:,1) * ( rhos * vt_s(:,:) + rhoi * vt_i(:,:) )
[8586]446            snwice_mass_b(:,:) = snwice_mass(:,:)
447         ENDIF
448         !
449      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN   ! Create restart file
450         !                                   ! -------------------
451         IF(lwp) WRITE(numout,*) '---- update-rst ----'
452         iter = kt + nn_fsbc - 1             ! ice restarts are written at kt == nitrst - nn_fsbc + 1
453         !
454         CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass'  , snwice_mass   )
455         CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b )
456         !
457      ENDIF
458      !
459   END SUBROUTINE update_rst
460
461#else
462   !!----------------------------------------------------------------------
[9570]463   !!   Default option         Dummy module           NO SI3 sea-ice model
[8586]464   !!----------------------------------------------------------------------
465#endif 
466
467   !!======================================================================
468END MODULE iceupdate
Note: See TracBrowser for help on using the repository browser.