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.
iceini.F90 in trunk/NEMO/LIM_SRC_3 – NEMO

source: trunk/NEMO/LIM_SRC_3/iceini.F90 @ 862

Last change on this file since 862 was 862, checked in by ctlod, 16 years ago

To ensure the restartability, see ticket:#82

File size: 10.9 KB
Line 
1MODULE iceini
2   !!======================================================================
3   !!                       ***  MODULE iceini   ***
4   !!   Sea-ice model : LIM Sea ice model Initialization
5   !!======================================================================
6#if defined key_lim3
7   !!----------------------------------------------------------------------
8   !!   'key_lim3' :                                   LIM sea-ice model
9   !!----------------------------------------------------------------------
10   !!   ice_init       : sea-ice model initialization
11   !!----------------------------------------------------------------------
12   USE dom_oce
13   USE in_out_manager
14   USE ice_oce         ! ice variables
15   USE flx_oce
16   USE phycst          ! Define parameters for the routines
17   USE ocfzpt
18   USE ice
19   USE limmsh
20   USE limistate
21   USE limrst
22   USE par_ice
23   USE limvar
24
25   IMPLICIT NONE
26   PRIVATE
27
28   !! * Routine accessibility
29   PUBLIC ice_init                 ! called by opa.F90
30   PUBLIC lim_itd_ini
31
32   !! * Share Module variables
33   LOGICAL , PUBLIC  ::     & !!! ** init namelist (namicerun) **
34      ln_limdyn   = .TRUE., & !: flag for ice dynamics (T) or not (F)
35      ln_nicep    = .TRUE.    !: flag for sea-ice points output (T) or not (F)
36   INTEGER , PUBLIC  ::   &  !:
37      nstart ,            &  !: iteration number of the begining of the run
38      nlast  ,            &  !: iteration number of the end of the run
39      nitrun ,            &  !: number of iteration
40      numit                  !: iteration number
41   REAL(wp), PUBLIC  ::   &  !:
42      hsndif = 0.e0    ,  &  !: computation of temp. in snow (0) or not (9999)
43      hicdif = 0.e0    ,  &  !: computation of temp. in ice (0) or not (9999)
44      tpstot           ,  &  !: time of the run in seconds
45      cai    = 1.40e-3 ,  &  !: atmospheric drag over sea ice
46      cao    = 1.00e-3       !: atmospheric drag over ocean
47   REAL(wp), PUBLIC, DIMENSION(2)  ::  &  !:
48      acrit  = (/ 1.e-06 , 1.e-06 /)    !: minimum fraction for leads in
49      !                                   !  north and south hemisphere
50   !!----------------------------------------------------------------------
51   !!   LIM 3.0,  UCL-ASTR-LOCEAN-IPSL (2008)
52   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/LIM_SRC/iceini.F90,v 1.4 2005/03/27 18:34:41 opalod Exp $
53   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
54   !!----------------------------------------------------------------------
55
56CONTAINS
57
58   SUBROUTINE ice_init
59      !!----------------------------------------------------------------------
60      !!                  ***  ROUTINE ice_init  ***
61      !!
62      !! ** purpose :   
63      !!
64      !! History :
65      !!   2.0  !  02-08  (G. Madec)  F90: Free form and modules
66      !!   3.0  !  08-03  (M. Vancop) ITD, salinity, EVP-C
67      !!----------------------------------------------------------------------
68
69      ! Open the namelist file
70      CALL ctlopn(numnam_ice,'namelist_ice','OLD', 'FORMATTED', 'SEQUENTIAL', 1,numout,.FALSE.,1)
71
72      CALL ice_run                    !  read in namelist some run parameters
73                 
74      ! Louvain la Neuve Ice model
75      IF( nacc == 1 ) THEN
76          dtsd2   = nfice * rdtmin * 0.5
77          rdt_ice = nfice * rdtmin
78      ELSE
79          dtsd2   = nfice * rdt * 0.5
80          rdt_ice = nfice * rdt
81      ENDIF
82
83      CALL lim_msh                    ! ice mesh initialization
84     
85      CALL lim_itd_ini                ! initialize the ice thickness
86                                      ! distribution
87      ! Initial sea-ice state
88      IF( .NOT.ln_rstart ) THEN
89         numit = 0
90         numit = nit000 - 1
91         CALL lim_istate              ! start from rest: sea-ice deduced from sst
92         CALL lim_var_agg(1)          ! aggregate category variables in
93                                      ! bulk variables
94         CALL lim_var_glo2eqv         ! convert global variables in equivalent
95                                      ! variables
96      ELSE
97         CALL lim_rst_read            ! start from a restart file
98
99         numit = nit000 - 1
100         CALL lim_var_agg(1)          ! aggregate ice variables
101         CALL lim_var_glo2eqv         ! convert global var in equivalent variables
102      ENDIF
103
104      freeze(:,:) = at_i(:,:)   ! initialisation of sea/ice cover   
105# if defined key_coupled
106      alb_ice(:,:) = albege(:,:)      ! sea-ice albedo
107# endif
108     
109      nstart = numit  + nfice     
110      nitrun = nitend - nit000 + 1 
111      nlast  = numit  + nitrun 
112
113      IF( nstock == 0  )  nstock = nlast + 1
114
115   END SUBROUTINE ice_init
116
117   SUBROUTINE ice_run
118      !!-------------------------------------------------------------------
119      !!                  ***  ROUTINE ice_run ***
120      !!                 
121      !! ** Purpose :   Definition some run parameter for ice model
122      !!
123      !! ** Method  :   Read the namicerun namelist and check the parameter
124      !!       values called at the first timestep (nit000)
125      !!
126      !! ** input   :   Namelist namicerun
127      !!
128      !! history :
129      !!   2.0  !  03-08 (C. Ethe)  Original code
130      !!   3.0  !  08-03 (M. Vancop) LIM3
131      !!-------------------------------------------------------------------
132      NAMELIST/namicerun/ ln_limdyn, acrit, hsndif, hicdif, cai, cao, ln_nicep
133      !!-------------------------------------------------------------------
134
135      !                                           ! Read Namelist namicerun
136      REWIND ( numnam_ice )
137      READ   ( numnam_ice , namicerun )
138      IF(lwp) THEN
139         WRITE(numout,*)
140         WRITE(numout,*) 'ice_run : ice share parameters for dynamics/advection/thermo of sea-ice'
141         WRITE(numout,*) ' ~~~~~~'
142         WRITE(numout,*) '   switch for ice dynamics (1) or not (0)      ln_limdyn   = ', ln_limdyn
143         WRITE(numout,*) '   minimum fraction for leads in the NH (SH)  acrit(1/2)   = ', acrit(:)
144         WRITE(numout,*) '   computation of temp. in snow (=0) or not (=9999) hsndif = ', hsndif
145         WRITE(numout,*) '   computation of temp. in ice  (=0) or not (=9999) hicdif = ', hicdif
146         WRITE(numout,*) '   atmospheric drag over sea ice                           = ', cai
147         WRITE(numout,*) '   atmospheric drag over ocean                             = ', cao
148         WRITE(numout,*) '   Several ice points in the ice or not in ocean.output = ', ln_nicep
149      ENDIF
150     
151   END SUBROUTINE ice_run
152
153   SUBROUTINE lim_itd_ini
154        !!------------------------------------------------------------------
155        !!                ***  ROUTINE lim_itd_ini ***
156        !! ** Purpose :
157        !!            Initializes the ice thickness distribution
158        !! ** Method  :
159        !!            Very simple. Currently there are no ice types in the
160        !!            model...
161        !!
162        !! ** Arguments :
163        !!           kideb , kiut : Starting and ending points on which the
164        !!                         the computation is applied
165        !!
166        !! ** Inputs / Ouputs : (global commons)
167        !!
168        !! ** External :
169        !!
170        !! ** References :
171        !!
172        !! ** History :
173        !!           (12-2005) Martin Vancoppenolle
174        !!
175        !!------------------------------------------------------------------
176        !! * Arguments
177
178       !! * Local variables
179       INTEGER ::   jl,       &   ! ice category dummy loop index
180                    jm            ! ice types    dummy loop index
181
182       REAL(wp)  ::           &  ! constant values
183          zeps      =  1.0e-10,   & !
184          zc1                 ,   & !
185          zc2                 ,   & !
186          zc3                 ,   & !
187          zx1
188
189       WRITE(numout,*) 'lim_itd_ini : Initialization of ice thickness distribution '
190       WRITE(numout,*) '~~~~~~~~~~~~~~~'
191
192!!-- End of declarations
193!!------------------------------------------------------------------------------
194
195!------------------------------------------------------------------------------!
196! 1) Ice thickness distribution parameters initialization   
197!------------------------------------------------------------------------------!
198
199      !- Types boundaries (integer)
200      !----------------------------
201      ice_cat_bounds(1,1) = 1
202      ice_cat_bounds(1,2) = jpl
203
204      !- Number of ice thickness categories in each ice type
205      DO jm = 1, jpm
206         ice_ncat_types(jm) = ice_cat_bounds(jm,2) - ice_cat_bounds(jm,1) + 1 
207      END DO
208
209      !- Make the correspondence between thickness categories and ice types
210      !---------------------------------------------------------------------
211      DO jm = 1, jpm       !over types
212         DO jl = ice_cat_bounds(jm,1), ice_cat_bounds(jm,2) !over thickness categories
213            ice_types(jl) = jm
214         END DO
215      END DO
216
217      WRITE(numout,*) ' Number of ice types jpm =      ', jpm
218      WRITE(numout,*) ' Number of ice categories jpl = ', jpl
219      DO jm = 1, jpm
220         WRITE(numout,*) ' Ice type ', jm
221         WRITE(numout,*) ' Number of thickness categories ', ice_ncat_types(jm)
222         WRITE(numout,*) ' Thickness category boundaries  ', ice_cat_bounds(jm,1:2)
223      END DO
224      WRITE(numout,*) 'Ice type vector', ice_types(1:jpl)
225      WRITE(numout,*)
226
227      !- Thickness categories boundaries
228      !----------------------------------
229      hi_max(:) = 0.0
230      hi_max_typ(:,:) = 0.0
231
232      !- Type 1 - undeformed ice
233      zc1 = 3./REAL(ice_cat_bounds(1,2)-ice_cat_bounds(1,1)+1)
234      zc2 = 10.0*zc1
235      zc3 = 3.0
236
237      DO jl = ice_cat_bounds(1,1), ice_cat_bounds(1,2)
238         zx1 = REAL(jl-1) / REAL(ice_cat_bounds(1,2)-ice_cat_bounds(1,1)+1)
239         hi_max(jl) = hi_max(jl-1) + zc1 + zc2 * (1.0 + TANH ( zc3 * (zx1 - 1.0 ) ) )
240      END DO
241
242      !- Fill in the hi_max_typ vector, useful in other circumstances
243      ! Tricky trick
244      ! hi_max_typ is actually not used in the code and will be removed in a
245      ! next flyspray at this time, the tricky trick will also be removed
246      ! Martin, march 08
247      DO jl = ice_cat_bounds(1,1), ice_cat_bounds(1,2)
248         hi_max_typ(jl,1) = hi_max(jl)
249      END DO
250
251      WRITE(numout,*) ' Thickness category boundaries independently of ice type '
252      WRITE(numout,*) ' hi_max ', hi_max(0:jpl)
253
254      WRITE(numout,*) ' Thickness category boundaries inside ice types '
255      DO jm = 1, jpm
256         WRITE(numout,*) ' Type number ', jm
257         WRITE(numout,*) ' hi_max_typ : ', hi_max_typ(0:ice_ncat_types(jm),jm)
258      END DO
259
260      DO jl = 1, jpl
261         hi_mean(jl) = ( hi_max(jl) + hi_max(jl-1) ) / 2.0
262      END DO
263
264      tn_ice(:,:,:) = t_su(:,:,:)
265
266    END SUBROUTINE lim_itd_ini
267
268#else
269   !!----------------------------------------------------------------------
270   !!   Default option :        Empty module           NO LIM sea-ice model
271   !!----------------------------------------------------------------------
272CONTAINS
273   SUBROUTINE ice_init        ! Empty routine
274   END SUBROUTINE ice_init
275
276   SUBROUTINE lim_itd_ini
277   END SUBROUTINE lim_itd_ini
278#endif
279
280   !!======================================================================
281END MODULE iceini
Note: See TracBrowser for help on using the repository browser.