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.
icedyn.F90 in NEMO/branches/2018/dev_r9866_HPC_03_globcom/src/ICE – NEMO

source: NEMO/branches/2018/dev_r9866_HPC_03_globcom/src/ICE/icedyn.F90 @ 10288

Last change on this file since 10288 was 10288, checked in by francesca, 5 years ago

reduce global communications, see #2010

  • Property svn:keywords set to Id
File size: 13.8 KB
Line 
1MODULE icedyn
2   !!======================================================================
3   !!                     ***  MODULE  icedyn  ***
4   !!   Sea-Ice dynamics : master routine for sea ice dynamics
5   !!======================================================================
6   !! history :  4.0  ! 2018  (C. Rousset)  original code SI3 [aka Sea Ice cube]
7   !!----------------------------------------------------------------------
8#if defined key_si3
9   !!----------------------------------------------------------------------
10   !!   'key_si3'                                       SI3 sea-ice model
11   !!----------------------------------------------------------------------
12   !!   ice_dyn       : dynamics of sea ice
13   !!   ice_dyn_init  : initialization and namelist read
14   !!----------------------------------------------------------------------
15   USE phycst         ! physical constants
16   USE dom_oce        ! ocean space and time domain
17   USE ice            ! sea-ice: variables
18   USE icedyn_rhg     ! sea-ice: rheology
19   USE icedyn_adv     ! sea-ice: advection
20   USE icedyn_rdgrft  ! sea-ice: ridging/rafting
21   USE icecor         ! sea-ice: corrections
22   USE icevar         ! sea-ice: operations
23   !
24   USE in_out_manager ! I/O manager
25   USE iom            ! I/O manager library
26   USE lib_mpp        ! MPP library
27   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero)
28   USE lbclnk         ! lateral boundary conditions (or mpp links)
29   USE timing         ! Timing
30
31   IMPLICIT NONE
32   PRIVATE
33
34   PUBLIC   ice_dyn        ! called by icestp.F90
35   PUBLIC   ice_dyn_init   ! called by icestp.F90
36   
37   INTEGER ::              nice_dyn   ! choice of the type of dynamics
38   !                                        ! associated indices:
39   INTEGER, PARAMETER ::   np_dynFULL    = 1   ! full ice dynamics               (rheology + advection + ridging/rafting + correction)
40   INTEGER, PARAMETER ::   np_dynRHGADV  = 2   ! pure dynamics                   (rheology + advection)
41   INTEGER, PARAMETER ::   np_dynADV     = 3   ! only advection w prescribed vel.(rn_uvice + advection)
42   !
43   ! ** namelist (namdyn) **
44   LOGICAL  ::   ln_dynFULL       ! full ice dynamics               (rheology + advection + ridging/rafting + correction)
45   LOGICAL  ::   ln_dynRHGADV     ! no ridge/raft & no corrections  (rheology + advection)
46   LOGICAL  ::   ln_dynADV        ! only advection w prescribed vel.(rn_uvice + advection)
47   REAL(wp) ::   rn_uice          !    prescribed u-vel (case np_dynADV)
48   REAL(wp) ::   rn_vice          !    prescribed v-vel (case np_dynADV)
49   
50   !! * Substitutions
51#  include "vectopt_loop_substitute.h90"
52   !!----------------------------------------------------------------------
53   !! NEMO/ICE 4.0 , NEMO Consortium (2018)
54   !! $Id$
55   !! Software governed by the CeCILL license (see ./LICENSE)
56   !!----------------------------------------------------------------------
57CONTAINS
58
59   SUBROUTINE ice_dyn( kt )
60      !!-------------------------------------------------------------------
61      !!               ***  ROUTINE ice_dyn  ***
62      !!               
63      !! ** Purpose :   this routine manages sea ice dynamics
64      !!
65      !! ** Action : - calculation of friction in case of landfast ice
66      !!             - call ice_dyn_rhg    = rheology
67      !!             - call ice_dyn_adv    = advection
68      !!             - call ice_dyn_rdgrft = ridging/rafting
69      !!             - call ice_cor        = corrections if fields are out of bounds
70      !!--------------------------------------------------------------------
71      INTEGER, INTENT(in) ::   kt     ! ice time step
72      !!
73      INTEGER ::   ji, jj, jl         ! dummy loop indices
74      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   zhmax
75      !!--------------------------------------------------------------------
76      !
77      IF( ln_timing )   CALL timing_start('icedyn')
78      !
79      IF( kt == nit000 .AND. lwp ) THEN
80         WRITE(numout,*)
81         WRITE(numout,*)'ice_dyn: sea-ice dynamics'
82         WRITE(numout,*)'~~~~~~~'
83      ENDIF
84
85      !                     
86      IF( ln_landfast ) THEN            !-- Landfast ice parameterization: define max bottom friction
87         tau_icebfr(:,:) = 0._wp
88         DO jl = 1, jpl
89            WHERE( h_i(:,:,jl) > ht_n(:,:) * rn_gamma )   tau_icebfr(:,:) = tau_icebfr(:,:) + a_i(:,:,jl) * rn_icebfr
90         END DO
91         IF( iom_use('tau_icebfr') )   CALL iom_put( 'tau_icebfr', tau_icebfr ) 
92      ENDIF
93
94      zhmax(:,:,:) = h_i_b(:,:,:)      !-- Record max of the surrounding 9-pts ice thick. (for CALL Hbig)
95      DO jl = 1, jpl
96         DO jj = 2, jpjm1
97            DO ji = 2, jpim1
98!!gm use of MAXVAL here is very probably less efficient than expending the 9 values
99               zhmax(ji,jj,jl) = MAX( epsi20, MAXVAL( h_i_b(ji-1:ji+1,jj-1:jj+1,jl) ) )
100            END DO
101         END DO
102      END DO
103      CALL lbc_lnk( zhmax(:,:,:), 'T', 1. )
104      !
105      !
106      SELECT CASE( nice_dyn )           !-- Set which dynamics is running
107
108      CASE ( np_dynFULL )          !==  all dynamical processes  ==!
109         CALL ice_dyn_rhg   ( kt )                            ! -- rheology 
110         CALL ice_dyn_adv   ( kt )   ;   CALL Hbig( zhmax )   ! -- advection of ice + correction on ice thickness
111         CALL ice_dyn_rdgrft( kt )                            ! -- ridging/rafting
112         CALL ice_cor       ( kt , 1 )                        ! -- Corrections
113
114      CASE ( np_dynRHGADV  )       !==  no ridge/raft & no corrections ==!
115         CALL ice_dyn_rhg   ( kt )                            ! -- rheology 
116         CALL ice_dyn_adv   ( kt )                            ! -- advection of ice
117         CALL Hpiling                                         ! -- simple pile-up (replaces ridging/rafting)
118
119      CASE ( np_dynADV )           !==  pure advection ==!   (prescribed velocities)
120         u_ice(:,:) = rn_uice * umask(:,:,1)
121         v_ice(:,:) = rn_vice * vmask(:,:,1)
122         !!CALL RANDOM_NUMBER(u_ice(:,:))
123         !!CALL RANDOM_NUMBER(v_ice(:,:))
124         CALL ice_dyn_adv   ( kt )                            ! -- advection of ice
125
126      END SELECT
127      !
128      IF( ln_timing )   CALL timing_stop('icedyn')
129      !
130   END SUBROUTINE ice_dyn
131
132
133   SUBROUTINE Hbig( phmax )
134      !!-------------------------------------------------------------------
135      !!                  ***  ROUTINE Hbig  ***
136      !!
137      !! ** Purpose : Thickness correction in case advection scheme creates
138      !!              abnormally tick ice
139      !!
140      !! ** Method  : 1- check whether ice thickness resulting from advection is
141      !!                 larger than the surrounding 9-points before advection
142      !!                 and reduce it if a) divergence or b) convergence & at_i>0.8
143      !!              2- bound ice thickness with hi_max (99m)
144      !!
145      !! ** input   : Max thickness of the surrounding 9-points
146      !!-------------------------------------------------------------------
147      REAL(wp), DIMENSION(:,:,:), INTENT(in) ::   phmax   ! max ice thick from surrounding 9-pts
148      !
149      INTEGER  ::   ji, jj, jl         ! dummy loop indices
150      REAL(wp) ::   zh, zdv
151      !!-------------------------------------------------------------------
152      !
153      CALL ice_var_zapsmall                       !-- zap small areas
154      !
155      DO jl = 1, jpl
156         DO jj = 1, jpj
157            DO ji = 1, jpi
158               IF ( v_i(ji,jj,jl) > 0._wp ) THEN  !-- bound to hmax
159                  !
160                  zh  = v_i (ji,jj,jl) / a_i(ji,jj,jl)
161                  zdv = v_i(ji,jj,jl) - v_i_b(ji,jj,jl) 
162                  !
163                  IF ( ( zdv >  0.0 .AND. zh > phmax(ji,jj,jl) .AND. at_i_b(ji,jj) < 0.80 ) .OR. &
164                     & ( zdv <= 0.0 .AND. zh > phmax(ji,jj,jl) ) ) THEN
165                     a_i (ji,jj,jl) = v_i(ji,jj,jl) / MIN( phmax(ji,jj,jl), hi_max(jpl) )   !-- bound h_i to hi_max (99 m)
166                  ENDIF
167                  !
168               ENDIF
169            END DO
170         END DO
171      END DO 
172      !                                           !-- correct pond fraction to avoid a_ip > a_i
173      WHERE( a_ip(:,:,:) > a_i(:,:,:) )   a_ip(:,:,:) = a_i(:,:,:)
174      !
175   END SUBROUTINE Hbig
176
177
178   SUBROUTINE Hpiling
179      !!-------------------------------------------------------------------
180      !!                  ***  ROUTINE Hpiling  ***
181      !!
182      !! ** Purpose : Simple conservative piling comparable with 1-cat models
183      !!
184      !! ** Method  : pile-up ice when no ridging/rafting
185      !!
186      !! ** input   : a_i
187      !!-------------------------------------------------------------------
188      INTEGER ::   jl         ! dummy loop indices
189      !!-------------------------------------------------------------------
190      !
191      CALL ice_var_zapsmall                       !-- zap small areas
192      !
193      at_i(:,:) = SUM( a_i(:,:,:), dim=3 )
194      DO jl = 1, jpl
195         WHERE( at_i(:,:) > epsi20 )
196            a_i(:,:,jl) = a_i(:,:,jl) * (  1._wp + MIN( rn_amax_2d(:,:) - at_i(:,:) , 0._wp ) / at_i(:,:)  )
197         END WHERE
198      END DO
199      !
200   END SUBROUTINE Hpiling
201
202
203   SUBROUTINE ice_dyn_init
204      !!-------------------------------------------------------------------
205      !!                  ***  ROUTINE ice_dyn_init  ***
206      !!
207      !! ** Purpose : Physical constants and parameters linked to the ice
208      !!      dynamics
209      !!
210      !! ** Method  :  Read the namdyn namelist and check the ice-dynamic
211      !!       parameter values called at the first timestep (nit000)
212      !!
213      !! ** input   :   Namelist namdyn
214      !!-------------------------------------------------------------------
215      INTEGER ::   ios, ioptio   ! Local integer output status for namelist read
216      !!
217      NAMELIST/namdyn/ ln_dynFULL, ln_dynRHGADV, ln_dynADV, rn_uice, rn_vice,  &
218         &             rn_ishlat  ,                                            &
219         &             ln_landfast, rn_gamma , rn_icebfr, rn_lfrelax
220      !!-------------------------------------------------------------------
221      !
222      REWIND( numnam_ice_ref )         ! Namelist namdyn in reference namelist : Ice dynamics
223      READ  ( numnam_ice_ref, namdyn, IOSTAT = ios, ERR = 901)
224901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namdyn in reference namelist', lwp )
225      REWIND( numnam_ice_cfg )         ! Namelist namdyn in configuration namelist : Ice dynamics
226      READ  ( numnam_ice_cfg, namdyn, IOSTAT = ios, ERR = 902 )
227902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namdyn in configuration namelist', lwp )
228      IF(lwm) WRITE( numoni, namdyn )
229      !
230      IF(lwp) THEN                     ! control print
231         WRITE(numout,*)
232         WRITE(numout,*) 'ice_dyn_init: ice parameters for ice dynamics '
233         WRITE(numout,*) '~~~~~~~~~~~~'
234         WRITE(numout,*) '   Namelist namdyn:'
235         WRITE(numout,*) '      Full ice dynamics      (rhg + adv + ridge/raft + corr)  ln_dynFULL   = ', ln_dynFULL
236         WRITE(numout,*) '      No ridge/raft & No cor (rhg + adv)                      ln_dynRHGADV = ', ln_dynRHGADV
237         WRITE(numout,*) '      Advection only         (rn_uvice + adv)                 ln_dynADV    = ', ln_dynADV
238         WRITE(numout,*) '         with prescribed velocity given by   (u,v)_ice = (rn_uice,rn_vice) = (', rn_uice,',', rn_vice,')'
239         WRITE(numout,*) '      lateral boundary condition for sea ice dynamics         rn_ishlat    = ', rn_ishlat
240         WRITE(numout,*) '      Landfast: param (T or F)                                ln_landfast  = ', ln_landfast
241         WRITE(numout,*) '         fraction of ocean depth that ice must reach          rn_gamma     = ', rn_gamma
242         WRITE(numout,*) '         maximum bottom stress per unit area of contact       rn_icebfr    = ', rn_icebfr
243         WRITE(numout,*) '         relax time scale (s-1) to reach static friction      rn_lfrelax   = ', rn_lfrelax
244         WRITE(numout,*)
245      ENDIF
246      !                             !== set the choice of ice dynamics ==!
247      ioptio = 0 
248      !      !--- full dynamics                               (rheology + advection + ridging/rafting + correction)
249      IF( ln_dynFULL   ) THEN   ;   ioptio = ioptio + 1   ;   nice_dyn = np_dynFULL      ;   ENDIF
250      !      !--- dynamics without ridging/rafting and corr   (rheology + advection)
251      IF( ln_dynRHGADV ) THEN   ;   ioptio = ioptio + 1   ;   nice_dyn = np_dynRHGADV    ;   ENDIF
252      !      !--- advection only with prescribed ice velocities (from namelist)
253      IF( ln_dynADV    ) THEN   ;   ioptio = ioptio + 1   ;   nice_dyn = np_dynADV       ;   ENDIF
254      !
255      IF( ioptio /= 1 )    CALL ctl_stop( 'ice_dyn_init: one and only one ice dynamics option has to be defined ' )
256      !
257      !                                      !--- Lateral boundary conditions
258      IF     (      rn_ishlat == 0.                ) THEN   ;   IF(lwp) WRITE(numout,*) '   ===>>>   ice lateral  free-slip'
259      ELSEIF (      rn_ishlat == 2.                ) THEN   ;   IF(lwp) WRITE(numout,*) '   ===>>>   ice lateral  no-slip'
260      ELSEIF ( 0. < rn_ishlat .AND. rn_ishlat < 2. ) THEN   ;   IF(lwp) WRITE(numout,*) '   ===>>>   ice lateral  partial-slip'
261      ELSEIF ( 2. < rn_ishlat                      ) THEN   ;   IF(lwp) WRITE(numout,*) '   ===>>>   ice lateral  strong-slip'
262      ENDIF
263      !                                      !--- NO Landfast ice : set to zero once for all
264      IF( .NOT.ln_landfast )   tau_icebfr(:,:) = 0._wp
265      !
266      CALL ice_dyn_rdgrft_init          ! set ice ridging/rafting parameters
267      CALL ice_dyn_rhg_init             ! set ice rheology parameters
268      CALL ice_dyn_adv_init             ! set ice advection parameters
269      !
270   END SUBROUTINE ice_dyn_init
271
272#else
273   !!----------------------------------------------------------------------
274   !!   Default option         Empty module           NO SI3 sea-ice model
275   !!----------------------------------------------------------------------
276#endif 
277
278   !!======================================================================
279END MODULE icedyn
Note: See TracBrowser for help on using the repository browser.