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_add_pond_lids_prints/src/ICE – NEMO

source: NEMO/branches/UKMO/NEMO_4.0_add_pond_lids_prints/src/ICE/iceupdate.F90 @ 12449

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