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.
limdmp_2.F90 in trunk/NEMOGCM/NEMO/LIM_SRC_2 – NEMO

source: trunk/NEMOGCM/NEMO/LIM_SRC_2/limdmp_2.F90 @ 2528

Last change on this file since 2528 was 2528, checked in by rblod, 13 years ago

Update NEMOGCM from branch nemo_v3_3_beta

  • Property svn:keywords set to Id
File size: 8.8 KB
Line 
1MODULE limdmp_2
2   !!======================================================================
3   !!                       ***  MODULE limdmp_2   ***
4   !!  LIM-2 ice model : restoring Ice thickness and Fraction leads
5   !!======================================================================
6   !! History :   2.0  !  2004-04 (S. Theetten) Original code
7   !!             3.3  !  2010-06 (J.-M. Molines) use of fldread
8   !!----------------------------------------------------------------------
9#if defined key_lim2
10   !!----------------------------------------------------------------------
11   !!   'key_lim2'                                    LIM 2.0 sea-ice model
12   !!----------------------------------------------------------------------
13   !!   lim_dmp_2      : ice model damping
14   !!----------------------------------------------------------------------
15   USE in_out_manager  ! I/O manager
16   USE ice_2           ! ice variables
17   USE sbc_oce, ONLY : nn_fsbc ! for fldread
18   USE dom_oce         ! for mi0; mi1 etc ...
19   USE fldread         ! read input fields
20   
21   IMPLICIT NONE
22   PRIVATE
23
24   PUBLIC   lim_dmp_2     ! called by sbc_ice_lim2
25
26   REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   resto_ice   ! restoring coeff. on ICE   [s-1]
27
28   INTEGER, PARAMETER :: jp_hicif = 1 , jp_frld = 2
29   TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_icedmp    ! structure of ice damping input
30   
31   !! * Substitution
32#  include "vectopt_loop_substitute.h90"
33   !!----------------------------------------------------------------------
34   !! NEMO/LIM 3.3 , UCL-NEMO-consortium (2010)
35   !! $Id$
36   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
37   !!----------------------------------------------------------------------
38CONTAINS
39
40   SUBROUTINE lim_dmp_2( kt )
41      !!-------------------------------------------------------------------
42      !!                   ***  ROUTINE lim_dmp_2  ***
43      !!
44      !! ** purpose : ice model damping : restoring ice thickness and fraction leads
45      !!
46      !! ** method  : the key_tradmp must be used to compute resto(:,:,1) coef.
47      !!---------------------------------------------------------------------
48      INTEGER, INTENT(in) ::   kt   ! ocean time-step
49      !
50      INTEGER  ::   ji, jj         ! dummy loop indices
51      REAL(wp) ::   zfrld, zhice   ! local scalars
52      !!---------------------------------------------------------------------
53      !
54      IF (kt == nit000)  THEN
55         IF(lwp) WRITE(numout,*)
56         IF(lwp) WRITE(numout,*) 'lim_dmp_2 : Ice thickness and ice concentration restoring'
57         IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
58         !
59         ! ice_resto_init create resto_ice (in 1/s) for restoring ice parameters near open boundaries.
60         ! Double check this routine to verify if it corresponds to your config
61         CALL lim_dmp_init
62      ENDIF
63      !
64      IF( ln_limdmp ) THEN   ! ice restoring in this case
65         !
66         CALL fld_read( kt, nn_fsbc, sf_icedmp )
67         !
68!CDIR COLLAPSE
69         hicif(:,:) = MAX( 0._wp,                     &        ! h >= 0         avoid spurious out of physical range
70            &         hicif(:,:) - rdt_ice * resto_ice(:,:,1) * ( hicif(:,:) - sf_icedmp(jp_hicif)%fnow(:,:,1) )  ) 
71!CDIR COLLAPSE
72         hicif(:,:) = MAX( 0._wp, MIN( 1._wp,         &        ! 0<= frld<=1    values which blow the run up
73            &         frld (:,:) - rdt_ice * resto_ice(:,:,1) * ( frld (:,:) - sf_icedmp(jp_frld )%fnow(:,:,1) )  )  )
74         !
75      ENDIF
76      !
77   END SUBROUTINE lim_dmp_2
78
79
80   SUBROUTINE lim_dmp_init
81      !!----------------------------------------------------------------------
82      !!                   ***  ROUTINE lim_dmp_init  ***
83      !!
84      !! ** Purpose :   Initialization for the ice thickness and concentration
85      !!                restoring
86      !!              restoring will be used. It is used to mimic ice open
87      !!              boundaries.
88      !!
89      !! ** Method  :  ?????
90      !!     
91      !! ** Action  :   define resto_ice(:,:,1)
92      !!----------------------------------------------------------------------
93      INTEGER  :: ji, jj, jk       ! dummy loop indices
94      INTEGER  :: irelax, ierror   ! error flag for allocation
95      !
96      REAL(wp) :: zdmpmax, zdmpmin, zfactor, zreltim ! temporary scalar
97      !
98      CHARACTER(len=100)           ::   cn_dir       ! Root directory for location of ssr files
99      TYPE(FLD_N), DIMENSION (2)   ::   sl_icedmp    ! informations about the icedmp  field to be read
100      TYPE(FLD_N)                  ::   sn_hicif     !
101      TYPE(FLD_N)                  ::   sn_frld      !
102      NAMELIST/namice_dmp/ cn_dir, ln_limdmp, sn_hicif, sn_frld
103      !!----------------------------------------------------------------------
104      !
105      ! 1)  initialize fld read structure for input data
106      !     --------------------------------------------
107      ln_limdmp = .false.                 !* set file information (default values)
108      cn_dir    = './'
109      ! (NB: frequency positive => hours, negative => months)
110      !                !    file     ! frequency ! variable ! time intep !  clim   ! 'yearly' or ! weights  ! rotation !
111      !                !    name     !  (hours)  !  name    !   (T/F)    !  (T/F)  !  'monthly'  ! filename ! pairs    !
112      sn_hicif = FLD_N( 'ice_damping ', -1       , 'hicif'  ,  .true.    , .true.  ,  'yearly'   ,  ''      ,  ''      )
113      sn_frld  = FLD_N( 'ice_damping ', -1       , 'frld'   ,  .true.    , .true.  ,  'yearly'   ,  ''      ,  ''      )
114
115      REWIND( numnam_ice )                !* read in namelist_ice namicedmp
116      READ  ( numnam_ice, namice_dmp )
117      !
118      IF ( lwp ) THEN                     !* control print
119         WRITE (numout,*)'     lim_dmp_init : lim_dmp initialization ' 
120         WRITE (numout,*)'       Namelist namicedmp read '
121         WRITE (numout,*)'         Ice restoring (T) or not (F) ln_limdmp =', ln_limdmp 
122         WRITE (numout,*)
123         WRITE (numout,*)'     CAUTION : here hard coded ice restoring along northern and southern boundaries'
124         WRITE (numout,*)'               adapt the lim_dmp_init routine to your needs'
125      ENDIF
126
127      ! 2)  initialise resto_ice    ==>  config dependant !
128      !     --------------------         ++++++++++++++++
129      !
130      IF( ln_limdmp ) THEN                !* ice restoring is used, follow initialization
131         !
132         sl_icedmp ( jp_hicif ) = sn_hicif
133         sl_icedmp ( jp_frld  ) = sn_frld
134         ALLOCATE ( sf_icedmp (2) , resto_ice(jpi,jpj,1), STAT=ierror )
135         IF( ierror > 0 ) THEN
136            CALL ctl_stop( 'lim_dmp_init: unable to allocate sf_icedmp structure or resto_ice array' )   ;   RETURN
137         ENDIF
138         ALLOCATE( sf_icedmp(jp_hicif)%fnow(jpi,jpj,1) , sf_icedmp(jp_hicif)%fdta(jpi,jpj,1,2) )
139         ALLOCATE( sf_icedmp(jp_frld )%fnow(jpi,jpj,1) , sf_icedmp(jp_frld )%fdta(jpi,jpj,1,2) )
140         !                         ! fill sf_icedmp with sn_icedmp and control print
141         CALL fld_fill( sf_icedmp, sl_icedmp, cn_dir, 'lim_dmp_init', 'Ice  restoring input data', 'namicedmp' )
142     
143         resto_ice(:,:,:) = 0._wp
144         !      Re-calculate the North and South boundary restoring term
145         !      because those boundaries may change with the prescribed zoom area.
146         !
147         irelax  = 16                     ! width of buffer zone with respect to close boundary
148         zdmpmax = 10._wp                 ! max restoring time scale  (days) (low restoring)
149         zdmpmin = rdt_ice / 86400._wp    ! min restoring time scale  (days) (high restoring)
150         !                                ! days / grid-point
151         zfactor = ( zdmpmax - zdmpmin ) / REAL( irelax, wp )
152
153         !    South boundary restoring term
154         ! REM: if there is no ice in the model and in the data,
155         !      no restoring even with non zero resto_ice
156         DO jj = mj0(jpjzoom - 1 + 1), mj1(jpjzoom -1 + irelax)
157            zreltim = zdmpmin + zfactor * ( mjg(jj) - jpjzoom + 1 )
158            resto_ice(:,jj,:) = 1._wp / ( zreltim * 86400._wp )
159         END DO
160
161         ! North boundary restoring term
162         DO jj =  mj0(jpjzoom -1 + jpjglo - irelax), mj1(jpjzoom - 1 + jpjglo)
163            zreltim = zdmpmin + zfactor * (jpjglo - ( mjg(jj) - jpjzoom + 1 ))
164            resto_ice(:,jj,:) = 1.e0 / ( zreltim * 86400 )
165         END DO
166      ENDIF
167      !
168   END SUBROUTINE lim_dmp_init
169   
170#else
171   !!----------------------------------------------------------------------
172   !!   Default option         Empty Module                  No ice damping
173   !!----------------------------------------------------------------------
174CONTAINS
175   SUBROUTINE lim_dmp_2( kt )        ! Dummy routine
176      WRITE(*,*) 'lim_dmp_2: You should not see this print! error? ', kt
177   END SUBROUTINE lim_dmp_2
178#endif
179
180   !!======================================================================
181END MODULE limdmp_2
Note: See TracBrowser for help on using the repository browser.