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 @ 1465

Last change on this file since 1465 was 1465, checked in by smasson, 15 years ago

supress ice_oce module, see ticket:448

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