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.
limdyn_2.F90 in branches/2017/dev_r7881_no_wrk_alloc/NEMOGCM/NEMO/LIM_SRC_2 – NEMO

source: branches/2017/dev_r7881_no_wrk_alloc/NEMOGCM/NEMO/LIM_SRC_2/limdyn_2.F90 @ 7910

Last change on this file since 7910 was 7910, checked in by timgraham, 7 years ago

All wrk_alloc removed

  • Property svn:keywords set to Id
File size: 14.4 KB
Line 
1MODULE limdyn_2
2   !!======================================================================
3   !!                     ***  MODULE  limdyn_2  ***
4   !!   Sea-Ice dynamics : 
5   !!======================================================================
6   !! History :  1.0  ! 2001-04  (LIM)  Original code
7   !!            2.0  ! 2002-08  (C. Ethe, G. Madec)  F90, mpp
8   !!            2.0  ! 2003-08  (C. Ethe) add lim_dyn_init
9   !!            2.0  ! 2006-07  (G. Madec)  Surface module
10   !!            3.3  ! 2009-05 (G. Garric, C. Bricaud) addition of the lim2_evp case
11   !!---------------------------------------------------------------------
12#if defined key_lim2
13   !!----------------------------------------------------------------------
14   !!   'key_lim2' :                                  LIM 2.0 sea-ice model
15   !!----------------------------------------------------------------------
16   !!    lim_dyn_2      : computes ice velocities
17   !!    lim_dyn_init_2 : initialization and namelist read
18   !!----------------------------------------------------------------------
19   USE dom_oce          ! ocean space and time domain
20   USE sbc_oce          ! ocean surface boundary condition
21   USE phycst           ! physical constant
22   USE ice_2            ! LIM-2: ice variables
23   USE sbc_ice          ! Surface boundary condition: sea-ice fields
24   USE dom_ice_2        ! LIM-2: ice domain
25   USE limistate_2      ! LIM-2: initial state
26   USE limrhg_2         ! LIM-2: VP  ice rheology
27   USE limrhg           ! LIM  : EVP ice rheology
28   USE lbclnk           ! lateral boundary condition - MPP link
29   USE lib_mpp          ! MPP library
30   USE in_out_manager   ! I/O manager
31   USE prtctl           ! Print control
32   USE lib_fortran      ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
33
34   IMPLICIT NONE
35   PRIVATE
36
37   PUBLIC   lim_dyn_2   ! routine called by sbc_ice_lim
38
39   !! * Substitutions
40#  include "vectopt_loop_substitute.h90"
41   !!----------------------------------------------------------------------
42   !! NEMO/LIM2 3.3 , UCL - NEMO Consortium (2010)
43   !! $Id$
44   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
45   !!----------------------------------------------------------------------
46CONTAINS
47
48   SUBROUTINE lim_dyn_2( kt )
49      !!-------------------------------------------------------------------
50      !!               ***  ROUTINE lim_dyn_2  ***
51      !!               
52      !! ** Purpose :   compute ice velocity and ocean-ice friction velocity
53      !!               
54      !! ** Method  :
55      !!
56      !! ** Action  : - Initialisation
57      !!              - Call of the dynamic routine for each hemisphere
58      !!              - computation of the friction velocity at the sea-ice base
59      !!              - treatment of the case if no ice dynamic
60      !!---------------------------------------------------------------------
61      INTEGER, INTENT(in) ::   kt     ! number of iteration
62      !!
63      INTEGER  ::   ji, jj             ! dummy loop indices
64      INTEGER  ::   i_j1, i_jpj        ! Starting/ending j-indices for rheology
65      REAL(wp) ::   zcoef              ! temporary scalar
66      REAL(wp), DIMENSION(jpj) ::   zind           ! i-averaged indicator of sea-ice
67      REAL(wp), DIMENSION(jpj) ::   zmsk           ! i-averaged of tmask
68      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io   ! ice-ocean velocity
69      !!---------------------------------------------------------------------
70
71
72      IF( kt == nit000 )   CALL lim_dyn_init_2   ! Initialization (first time-step only)
73     
74      IF( ln_limdyn ) THEN
75         !
76         ! Mean ice and snow thicknesses.         
77         hsnm(:,:)  = ( 1.0 - frld(:,:) ) * hsnif(:,:)
78         hicm(:,:)  = ( 1.0 - frld(:,:) ) * hicif(:,:)
79         !
80         !                                     ! Rheology (ice dynamics)
81         !                                     ! ========
82         
83         !  Define the j-limits where ice rheology is computed
84         ! ---------------------------------------------------
85         
86         IF( lk_mpp ) THEN                    ! mpp: compute over the whole domain
87            i_j1 = 1   
88            i_jpj = jpj
89            IF(ln_ctl)   CALL prt_ctl_info( 'lim_dyn  :    i_j1 = ', ivar1=i_j1, clinfo2=' ij_jpj = ', ivar2=i_jpj )
90            IF( lk_lim2_vp )   THEN   ;   CALL lim_rhg_2( i_j1, i_jpj )             !  VP rheology
91            ELSE                      ;   CALL lim_rhg  ( i_j1, i_jpj )             ! EVP rheology
92            ENDIF
93            !
94         ELSE                                 ! optimization of the computational area
95            !
96            DO jj = 1, jpj
97               zind(jj) = SUM( frld (:,jj  ) )   ! = REAL(jpj) if ocean everywhere on a j-line
98               zmsk(jj) = SUM( tmask(:,jj,1) )   ! = 0         if land  everywhere on a j-line
99            END DO
100            !
101            IF( l_jeq ) THEN                     ! local domain include both hemisphere
102               !                                 ! Rheology is computed in each hemisphere
103               !                                 ! only over the ice cover latitude strip
104               ! Northern hemisphere
105               i_j1  = njeq
106               i_jpj = jpj
107               DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
108                  i_j1 = i_j1 + 1
109               END DO
110               IF( lk_lim2_vp )   THEN             ! VP  rheology
111                  i_j1 = MAX( 1, i_j1-1 )
112                  CALL lim_rhg_2( i_j1, i_jpj )
113               ELSE                                ! EVP rheology
114                  i_j1 = MAX( 1, i_j1-2 )
115                  CALL lim_rhg( i_j1, i_jpj )
116               ENDIF
117               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : NH i_j1 = ', i_j1, 'ij_jpj = ', i_jpj
118               !
119               ! Southern hemisphere
120               i_j1  =  1 
121               i_jpj = njeq
122               DO WHILE ( i_jpj >= 1 .AND. zind(i_jpj) == FLOAT(jpi) .AND. zmsk(i_jpj) /=0 )
123                  i_jpj = i_jpj - 1
124               END DO
125               IF( lk_lim2_vp )   THEN             ! VP  rheology
126                  i_jpj = MIN( jpj, i_jpj+2 )
127                  CALL lim_rhg_2( i_j1, i_jpj )
128               ELSE                                ! EVP rheology
129                  i_jpj = MIN( jpj, i_jpj+1 )
130                  CALL lim_rhg( i_j1, i_jpj )
131               ENDIF
132               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : SH i_j1 = ', i_j1, 'ij_jpj = ', i_jpj
133               !
134            ELSE                                 ! local domain extends over one hemisphere only
135               !                                 ! Rheology is computed only over the ice cover
136               !                                 ! latitude strip
137               i_j1  = 1
138               DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
139                  i_j1 = i_j1 + 1
140               END DO
141               i_j1 = MAX( 1, i_j1-1 )
142   
143               i_jpj  = jpj
144               DO WHILE ( i_jpj >= 1  .AND. zind(i_jpj) == FLOAT(jpi) .AND. zmsk(i_jpj) /=0 )
145                  i_jpj = i_jpj - 1
146               END DO
147               i_jpj = MIN( jpj, i_jpj+2 )
148               !
149               IF( lk_lim2_vp )   THEN             ! VP  rheology
150                  i_jpj = MIN( jpj, i_jpj+2 )
151                  CALL lim_rhg_2( i_j1, i_jpj )                !  VP rheology
152               ELSE                                ! EVP rheology
153                  i_j1  = MAX( 1  , i_j1-2  )
154                  i_jpj = MIN( jpj, i_jpj+1 )
155                  CALL lim_rhg  ( i_j1, i_jpj )                ! EVP rheology
156               ENDIF
157               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : one hemisphere: i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
158               !
159            ENDIF
160            !
161         ENDIF
162
163         IF(ln_ctl)   CALL prt_ctl(tab2d_1=u_ice , clinfo1=' lim_dyn  : u_ice :', tab2d_2=v_ice , clinfo2=' v_ice :')
164         
165         ! computation of friction velocity
166         ! --------------------------------
167         SELECT CASE( cp_ice_msh )           ! ice-ocean relative velocity at u- & v-pts
168         CASE( 'C' )                               ! EVP : C-grid ice dynamics
169            zu_io(:,:) = u_ice(:,:) - ssu_m(:,:)           ! ice-ocean & ice velocity at ocean velocity points
170            zv_io(:,:) = v_ice(:,:) - ssv_m(:,:)
171         CASE( 'I' )                               ! VP  : B-grid ice dynamics (I-point)
172            DO jj = 1, jpjm1                               ! u_ice v_ice at I-point ; ssu_m, ssv_m at U- & V-points
173               DO ji = 1, jpim1   ! NO vector opt.         !
174                  zu_io(ji,jj) = 0.5_wp * ( u_ice(ji+1,jj+1) + u_ice(ji+1,jj  ) ) - ssu_m(ji,jj)
175                  zv_io(ji,jj) = 0.5_wp * ( v_ice(ji+1,jj+1) + v_ice(ji  ,jj+1) ) - ssv_m(ji,jj)
176               END DO
177            END DO
178         END SELECT
179
180         ! frictional velocity at T-point
181         zcoef = 0.5_wp * cw
182         DO jj = 2, jpjm1
183            DO ji = 2, jpim1   ! NO vector opt. because of zu_io
184               ust2s(ji,jj) = zcoef * (  zu_io(ji,jj) * zu_io(ji,jj) + zu_io(ji-1,jj) * zu_io(ji-1,jj)   &
185                  &                    + zv_io(ji,jj) * zv_io(ji,jj) + zv_io(ji,jj-1) * zv_io(ji,jj-1)   ) * tms(ji,jj)
186            END DO
187         END DO
188         !
189      ELSE      ! no ice dynamics : transmit directly the atmospheric stress to the ocean
190         !
191         zcoef = SQRT( 0.5 ) / rau0
192         DO jj = 2, jpjm1
193            DO ji = fs_2, fs_jpim1   ! vector opt.
194               ust2s(ji,jj) = zcoef * SQRT(  utau(ji,jj) * utau(ji,jj) + utau(ji-1,jj) * utau(ji-1,jj)   &
195                  &                        + vtau(ji,jj) * vtau(ji,jj) + vtau(ji,jj-1) * vtau(ji,jj-1)   ) * tms(ji,jj)
196            END DO
197         END DO
198         !
199      ENDIF
200      !
201      CALL lbc_lnk( ust2s, 'T',  1. )   ! T-point
202      !
203      IF(ln_ctl)   CALL prt_ctl(tab2d_1=ust2s , clinfo1=' lim_dyn  : ust2s :')
204      !
205      !
206   END SUBROUTINE lim_dyn_2
207
208
209   SUBROUTINE lim_dyn_init_2
210      !!-------------------------------------------------------------------
211      !!                  ***  ROUTINE lim_dyn_init_2  ***
212      !!
213      !! ** Purpose :   Physical constants and parameters linked to the ice
214      !!              dynamics
215      !!
216      !! ** Method  :   Read the namicedyn namelist and check the ice-dynamic
217      !!              parameter values
218      !!
219      !! ** input   :   Namelist namicedyn
220      !!-------------------------------------------------------------------
221      INTEGER  ::   ios                 ! Local integer output status for namelist read
222      NAMELIST/namicedyn/ epsd, alpha,     &
223         &                dm, nbiter, nbitdr, om, resl, cw, angvg, pstar,   &
224         &                c_rhg, etamn, rn_creepl, rn_ecc, ahi0,                  &
225         &                nn_nevp, telast, alphaevp
226      !!-------------------------------------------------------------------
227                   
228      REWIND( numnam_ice_ref )              ! Namelist namicedyn in reference namelist : Ice dynamics
229      READ  ( numnam_ice_ref, namicedyn, IOSTAT = ios, ERR = 901)
230901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicedyn in reference namelist', lwp )
231
232      REWIND( numnam_ice_cfg )              ! Namelist namicedyn in configuration namelist : Ice dynamics
233      READ  ( numnam_ice_cfg, namicedyn, IOSTAT = ios, ERR = 902 )
234902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namicedyn in configuration namelist', lwp )
235      IF(lwm) WRITE ( numoni, namicedyn )
236
237      IF(lwp) THEN                                ! Control print
238         WRITE(numout,*)
239         WRITE(numout,*) 'lim_dyn_init_2: ice parameters for ice dynamics '
240         WRITE(numout,*) '~~~~~~~~~~~~~~'
241         WRITE(numout,*) '       tolerance parameter                              epsd   = ', epsd
242         WRITE(numout,*) '       coefficient for semi-implicit coriolis           alpha  = ', alpha
243         WRITE(numout,*) '       diffusion constant for dynamics                  dm     = ', dm
244         WRITE(numout,*) '       number of sub-time steps for relaxation          nbiter = ', nbiter
245         WRITE(numout,*) '       maximum number of iterations for relaxation      nbitdr = ', nbitdr
246         WRITE(numout,*) '       relaxation constant                              om     = ', om
247         WRITE(numout,*) '       maximum value for the residual of relaxation     resl   = ', resl
248         WRITE(numout,*) '       drag coefficient for oceanic stress              cw     = ', cw
249         WRITE(numout,*) '       turning angle for oceanic stress                 angvg  = ', angvg, ' degrees'
250         WRITE(numout,*) '       first bulk-rheology parameter                    pstar  = ', pstar
251         WRITE(numout,*) '       second bulk-rhelogy parameter                    c_rhg  = ', c_rhg
252         WRITE(numout,*) '       minimun value for viscosity                      etamn  = ', etamn
253         WRITE(numout,*) '       creep limit                                      rn_creepl = ', rn_creepl
254         WRITE(numout,*) '       eccentricity of the elliptical yield curve       rn_ecc = ', rn_ecc
255         WRITE(numout,*) '       horizontal diffusivity coeff. for sea-ice        ahi0   = ', ahi0
256         WRITE(numout,*) '       number of iterations for subcycling              nn_nevp= ', nn_nevp
257         WRITE(numout,*) '       timescale for elastic waves telast = ', telast
258         WRITE(numout,*) '       coefficient for the solution of int. stresses alphaevp = ', alphaevp
259      ENDIF
260      !
261      IF( angvg /= 0._wp .AND. .NOT.lk_lim2_vp ) THEN
262         CALL ctl_warn( 'lim_dyn_init_2: turning angle for oceanic stress not properly coded for EVP ',   &
263            &           '(see limsbc_2 module). We force  angvg = 0._wp'  )
264         angvg = 0._wp
265      ENDIF
266
267      !  Initialization
268      usecc2 = 1.0 / ( rn_ecc * rn_ecc )
269      rhoco  = rau0 * cw
270      angvg  = angvg * rad      ! convert angvg from degree to radian
271      sangvg = SIN( angvg )
272      cangvg = COS( angvg )
273      pstarh = pstar / 2.0
274      !
275      ahiu(:,:) = ahi0 * umask(:,:,1)            ! Ice eddy Diffusivity coefficients.
276      ahiv(:,:) = ahi0 * vmask(:,:,1)
277      !
278   END SUBROUTINE lim_dyn_init_2
279
280#else
281   !!----------------------------------------------------------------------
282   !!   Default option          Empty module       NO LIM 2.0 sea-ice model
283   !!----------------------------------------------------------------------
284CONTAINS
285   SUBROUTINE lim_dyn_2         ! Empty routine
286   END SUBROUTINE lim_dyn_2
287#endif 
288
289   !!======================================================================
290END MODULE limdyn_2
Note: See TracBrowser for help on using the repository browser.