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.
icbini.F90 in NEMO/branches/2020/tickets_2494_2375/src/OCE/ICB – NEMO

source: NEMO/branches/2020/tickets_2494_2375/src/OCE/ICB/icbini.F90 @ 13276

Last change on this file since 13276 was 13276, checked in by mathiot, 4 years ago

ticket #2494 and #2375: wrong point type inn lbc_lnk_icb for umask_e and vmask_e (see ticket #2492)

  • Property svn:keywords set to Id
File size: 24.2 KB
Line 
1MODULE icbini
2   !!======================================================================
3   !!                       ***  MODULE  icbini  ***
4   !! Icebergs:  initialise variables for iceberg tracking
5   !!======================================================================
6   !! History :   -   !  2010-01  (T. Martin & A. Adcroft)  Original code
7   !!            3.3  !  2011-03  (G. Madec)  Part conversion to NEMO form ; Removal of mapping from another grid
8   !!             -   !  2011-04  (S. Alderson)  Split into separate modules ; Restore restart routines
9   !!             -   !  2011-05  (S. Alderson)  generate_test_icebergs restored ; new forcing arrays with extra halo ;
10   !!             -   !                          north fold exchange arrays added
11   !!----------------------------------------------------------------------
12   !!----------------------------------------------------------------------
13   !!   icb_init     : initialise icebergs
14   !!   icb_ini_gen  : generate test icebergs
15   !!   icb_nam      : read iceberg namelist
16   !!----------------------------------------------------------------------
17   USE dom_oce        ! ocean domain
18   USE in_out_manager ! IO routines and numout in particular
19   USE lib_mpp        ! mpi library and lk_mpp in particular
20   USE sbc_oce        ! ocean  : surface boundary condition
21   USE sbc_ice        ! sea-ice: surface boundary condition
22   USE iom            ! IOM library
23   USE fldread        ! field read
24   USE lbclnk         ! lateral boundary condition - MPP link
25   !
26   USE icb_oce        ! define iceberg arrays
27   USE icbutl         ! iceberg utility routines
28   USE icbrst         ! iceberg restart routines
29   USE icbtrj         ! iceberg trajectory I/O routines
30   USE icbdia         ! iceberg budget routines
31
32   IMPLICIT NONE
33   PRIVATE
34
35   PUBLIC   icb_init  ! routine called in nemogcm.F90 module
36
37   CHARACTER(len=100)                                 ::   cn_dir = './'   !: Root directory for location of icb files
38   TYPE(FLD_N)                                        ::   sn_icb          !: information about the calving file to be read
39   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)  ::   sf_icb          !: structure: file information, fields read
40                                                                           !: used in icbini and icbstp
41   !! * Substitutions
42#  include "do_loop_substitute.h90"
43   !!----------------------------------------------------------------------
44   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
45   !! $Id$
46   !! Software governed by the CeCILL license (see ./LICENSE)
47   !!----------------------------------------------------------------------
48CONTAINS
49
50   SUBROUTINE icb_init( pdt, kt )
51      !!----------------------------------------------------------------------
52      !!                  ***  ROUTINE dom_init  ***
53      !!
54      !! ** Purpose :   iceberg initialization.
55      !!
56      !! ** Method  : - read the iceberg namelist
57      !!              - find non-overlapping processor interior since we can only
58      !!                have one instance of a particular iceberg
59      !!              - calculate the destinations for north fold exchanges
60      !!              - setup either test icebergs or calving file
61      !!----------------------------------------------------------------------
62      REAL(wp), INTENT(in) ::   pdt   ! iceberg time-step (rn_Dt*nn_fsbc)
63      INTEGER , INTENT(in) ::   kt    ! time step number
64      !
65      INTEGER ::   ji, jj, jn               ! dummy loop indices
66      INTEGER ::   i1, i2, i3               ! local integers
67      INTEGER ::   ii, inum, ivar           !   -       -
68      INTEGER ::   istat1, istat2, istat3   !   -       -
69      CHARACTER(len=300) ::   cl_sdist      ! local character
70      !!----------------------------------------------------------------------
71      !
72      CALL icb_nam               ! Read and print namelist parameters
73      !
74      IF( .NOT. ln_icebergs )   RETURN
75
76      !                          ! allocate gridded fields
77      IF( icb_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'icb_alloc : unable to allocate arrays' )
78      !
79      !                          ! initialised variable with extra haloes to zero
80      uo_e(:,:) = 0._wp   ;   vo_e(:,:) = 0._wp   ;
81      ua_e(:,:) = 0._wp   ;   va_e(:,:) = 0._wp   ;
82      ff_e(:,:) = 0._wp   ;   tt_e(:,:) = 0._wp   ;
83      fr_e(:,:) = 0._wp   ;
84      ! prepration to Nacho work
85      ! e3t_e
86      ! tt3d_e
87      ! uo3d_e
88      ! vo3d_e
89      !
90#if defined key_si3
91      hi_e(:,:) = 0._wp   ;
92      ui_e(:,:) = 0._wp   ;   vi_e(:,:) = 0._wp   ;
93#endif
94      ssh_e(:,:) = 0._wp  ; 
95      !
96      !                          ! open ascii output file or files for iceberg status information
97      !                          ! note that we choose to do this on all processors since we cannot
98      !                          ! predict where icebergs will be ahead of time
99      IF( nn_verbose_level > 0) THEN
100         CALL ctl_opn( numicb, 'icebergs.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
101      ENDIF
102
103      ! set parameters (mostly from namelist)
104      !
105      berg_dt         = pdt
106      first_width (:) = SQRT(  rn_initial_mass(:) / ( rn_LoW_ratio * rn_rho_bergs * rn_initial_thickness(:) )  )
107      first_length(:) = rn_LoW_ratio * first_width(:)
108
109      berg_grid%calving      (:,:)   = 0._wp
110      berg_grid%calving_hflx (:,:)   = 0._wp
111      berg_grid%stored_heat  (:,:)   = 0._wp
112      berg_grid%floating_melt(:,:)   = 0._wp
113      berg_grid%maxclass     (:,:)   = nclasses
114      berg_grid%stored_ice   (:,:,:) = 0._wp
115      berg_grid%tmp          (:,:)   = 0._wp
116      src_calving            (:,:)   = 0._wp
117      src_calving_hflx       (:,:)   = 0._wp
118
119      !                          ! domain for icebergs
120      IF( lk_mpp .AND. jpni == 1 )   CALL ctl_stop( 'icbinit: having ONE processor in x currently does not work' )
121      ! NB: the issue here is simply that cyclic east-west boundary condition have not been coded in mpp case
122      ! for the north fold we work out which points communicate by asking
123      ! lbc_lnk to pass processor number (valid even in single processor case)
124      ! borrow src_calving arrays for this
125      !
126      ! pack i and j together using a scaling of a power of 10
127      nicbpack = 10000
128      IF( jpiglo >= nicbpack )   CALL ctl_stop( 'icbini: processor index packing failure' )
129      nicbfldproc(:) = -1
130
131      DO_2D_11_11
132         src_calving_hflx(ji,jj) = narea
133         src_calving     (ji,jj) = nicbpack * mjg(jj) + mig(ji)
134      END_2D
135      CALL lbc_lnk( 'icbini', src_calving_hflx, 'T', 1._wp )
136      CALL lbc_lnk( 'icbini', src_calving     , 'T', 1._wp )
137
138      ! work out interior of processor from exchange array
139      ! first entry with narea for this processor is left hand interior index
140      ! last  entry                               is right hand interior index
141      jj = nlcj/2
142      nicbdi = -1
143      nicbei = -1
144      DO ji = 1, jpi
145         i3 = INT( src_calving(ji,jj) )
146         i2 = INT( i3/nicbpack )
147         i1 = i3 - i2*nicbpack
148         i3 = INT( src_calving_hflx(ji,jj) )
149         IF( i1 == mig(ji) .AND. i3 == narea ) THEN
150            IF( nicbdi < 0 ) THEN   ;   nicbdi = ji
151            ELSE                    ;   nicbei = ji
152            ENDIF
153         ENDIF
154      END DO
155      !
156      ! repeat for j direction
157      ji = nlci/2
158      nicbdj = -1
159      nicbej = -1
160      DO jj = 1, jpj
161         i3 = INT( src_calving(ji,jj) )
162         i2 = INT( i3/nicbpack )
163         i1 = i3 - i2*nicbpack
164         i3 = INT( src_calving_hflx(ji,jj) )
165         IF( i2 == mjg(jj) .AND. i3 == narea ) THEN
166            IF( nicbdj < 0 ) THEN   ;   nicbdj = jj
167            ELSE                    ;   nicbej = jj
168            ENDIF
169         ENDIF
170      END DO
171      !   
172      ! special for east-west boundary exchange we save the destination index
173      i1 = MAX( nicbdi-1, 1)
174      i3 = INT( src_calving(i1,nlcj/2) )
175      jj = INT( i3/nicbpack )
176      ricb_left = REAL( i3 - nicbpack*jj, wp )
177      i1 = MIN( nicbei+1, jpi )
178      i3 = INT( src_calving(i1,nlcj/2) )
179      jj = INT( i3/nicbpack )
180      ricb_right = REAL( i3 - nicbpack*jj, wp )
181     
182      ! north fold
183      IF( npolj > 0 ) THEN
184         !
185         ! icebergs in row nicbej+1 get passed across fold
186         nicbfldpts(:)  = INT( src_calving(:,nicbej+1) )
187         nicbflddest(:) = INT( src_calving_hflx(:,nicbej+1) )
188         !
189         ! work out list of unique processors to talk to
190         ! pack them into a fixed size array where empty slots are marked by a -1
191         DO ji = nicbdi, nicbei
192            ii = nicbflddest(ji)
193            IF( ii .GT. 0 ) THEN     ! Needed because land suppression can mean
194                                     ! that unused points are not set in edge haloes
195               DO jn = 1, jpni
196                  ! work along array until we find an empty slot
197                  IF( nicbfldproc(jn) == -1 ) THEN
198                     nicbfldproc(jn) = ii
199                     EXIT                             !!gm EXIT should be avoided: use DO WHILE expression instead
200                  ENDIF
201                  ! before we find an empty slot, we may find processor number is already here so we exit
202                  IF( nicbfldproc(jn) == ii ) EXIT
203               END DO
204            ENDIF
205         END DO
206      ENDIF
207      !
208      IF( nn_verbose_level > 0) THEN
209         WRITE(numicb,*) 'processor ', narea
210         WRITE(numicb,*) 'jpi, jpj   ', jpi, jpj
211         WRITE(numicb,*) 'nldi, nlei ', nldi, nlei
212         WRITE(numicb,*) 'nldj, nlej ', nldj, nlej
213         WRITE(numicb,*) 'berg i interior ', nicbdi, nicbei
214         WRITE(numicb,*) 'berg j interior ', nicbdj, nicbej
215         WRITE(numicb,*) 'berg left       ', ricb_left
216         WRITE(numicb,*) 'berg right      ', ricb_right
217         jj = nlcj/2
218         WRITE(numicb,*) "central j line:"
219         WRITE(numicb,*) "i processor"
220         WRITE(numicb,*) (INT(src_calving_hflx(ji,jj)), ji=1,jpi)
221         WRITE(numicb,*) "i point"
222         WRITE(numicb,*) (INT(src_calving(ji,jj)), ji=1,jpi)
223         ji = nlci/2
224         WRITE(numicb,*) "central i line:"
225         WRITE(numicb,*) "j processor"
226         WRITE(numicb,*) (INT(src_calving_hflx(ji,jj)), jj=1,jpj)
227         WRITE(numicb,*) "j point"
228         WRITE(numicb,*) (INT(src_calving(ji,jj)), jj=1,jpj)
229         IF( npolj > 0 ) THEN
230            WRITE(numicb,*) 'north fold destination points '
231            WRITE(numicb,*) nicbfldpts
232            WRITE(numicb,*) 'north fold destination procs  '
233            WRITE(numicb,*) nicbflddest
234            WRITE(numicb,*) 'north fold destination proclist  '
235            WRITE(numicb,*) nicbfldproc
236         ENDIF
237         CALL flush(numicb)
238      ENDIF
239     
240      src_calving     (:,:) = 0._wp
241      src_calving_hflx(:,:) = 0._wp
242
243      ! definition of extended surface masked needed by icb_bilin_h
244      tmask_e(:,:) = 0._wp   ;   tmask_e(1:jpi,1:jpj) = tmask(:,:,1)
245      umask_e(:,:) = 0._wp   ;   umask_e(1:jpi,1:jpj) = umask(:,:,1)
246      vmask_e(:,:) = 0._wp   ;   vmask_e(1:jpi,1:jpj) = vmask(:,:,1)
247      CALL lbc_lnk_icb( 'icbini', tmask_e, 'T', +1._wp, 1, 1 )
248      CALL lbc_lnk_icb( 'icbini', umask_e, 'U', +1._wp, 1, 1 )
249      CALL lbc_lnk_icb( 'icbini', vmask_e, 'V', +1._wp, 1, 1 )
250
251      ! definition of extended lat/lon array needed by icb_bilin_h
252      rlon_e(:,:) = 0._wp     ;  rlon_e(1:jpi,1:jpj) = glamt(:,:) 
253      rlat_e(:,:) = 0._wp     ;  rlat_e(1:jpi,1:jpj) = gphit(:,:)
254      CALL lbc_lnk_icb( 'icbini', rlon_e, 'T', +1._wp, 1, 1 )
255      CALL lbc_lnk_icb( 'icbini', rlat_e, 'T', +1._wp, 1, 1 )
256      !
257      ! definnitionn of extennded ff_f array needed by icb_utl_interp
258      ff_e(:,:) = 0._wp       ;  ff_e(1:jpi,1:jpj) = ff_f(:,:)
259      CALL lbc_lnk_icb( 'icbini', ff_e, 'F', +1._wp, 1, 1 )
260
261      ! assign each new iceberg with a unique number constructed from the processor number
262      ! and incremented by the total number of processors
263      num_bergs(:) = 0
264      num_bergs(1) = narea - jpnij
265
266      ! when not generating test icebergs we need to setup calving file
267      IF( nn_test_icebergs < 0 .OR. ln_use_calving ) THEN
268         !
269         ! maximum distribution class array does not change in time so read it once
270         cl_sdist = TRIM( cn_dir )//TRIM( sn_icb%clname )
271         CALL iom_open ( cl_sdist, inum )                              ! open file
272         ivar = iom_varid( inum, 'maxclass', ldstop=.FALSE. )
273         IF( ivar > 0 ) THEN
274            CALL iom_get  ( inum, jpdom_data, 'maxclass', src_calving )   ! read the max distribution array
275            berg_grid%maxclass(:,:) = INT( src_calving )
276            src_calving(:,:) = 0._wp
277         ENDIF
278         CALL iom_close( inum )                                     ! close file
279         !
280         IF( nn_verbose_level > 0) THEN
281            WRITE(numicb,*)
282            WRITE(numicb,*) '          calving read in a file'
283         ENDIF
284         ALLOCATE( sf_icb(1), STAT=istat1 )         ! Create sf_icb structure (calving)
285         ALLOCATE( sf_icb(1)%fnow(jpi,jpj,1), STAT=istat2 )
286         ALLOCATE( sf_icb(1)%fdta(jpi,jpj,1,2), STAT=istat3 )
287         IF( istat1+istat2+istat3 > 0 ) THEN
288            CALL ctl_stop( 'sbc_icb: unable to allocate sf_icb structure' )   ;   RETURN
289         ENDIF
290         !                                          ! fill sf_icb with the namelist (sn_icb) and control print
291         CALL fld_fill( sf_icb, (/ sn_icb /), cn_dir, 'icb_init', 'read calving data', 'namicb' )
292         !
293      ENDIF
294
295      IF( .NOT.ln_rstart ) THEN
296         IF( nn_test_icebergs > 0 )   CALL icb_ini_gen()
297      ELSE
298         IF( nn_test_icebergs > 0 ) THEN
299            CALL icb_ini_gen()
300         ELSE
301            CALL icb_rst_read()
302            l_restarted_bergs = .TRUE.
303         ENDIF
304      ENDIF
305      !
306      IF( nn_sample_rate .GT. 0 ) CALL icb_trj_init( nitend )
307      !
308      CALL icb_dia_init()
309      !
310      IF( nn_verbose_level >= 2 )   CALL icb_utl_print('icb_init, initial status', nit000-1)
311      !
312   END SUBROUTINE icb_init
313
314
315   SUBROUTINE icb_ini_gen()
316      !!----------------------------------------------------------------------
317      !!                  ***  ROUTINE icb_ini_gen  ***
318      !!
319      !! ** Purpose :   iceberg generation
320      !!
321      !! ** Method  : - at each grid point of the test box supplied in the namelist
322      !!                generate an iceberg in one class determined by the value of
323      !!                parameter nn_test_icebergs
324      !!----------------------------------------------------------------------
325      INTEGER                         ::   ji, jj, ibergs
326      TYPE(iceberg)                   ::   localberg ! NOT a pointer but an actual local variable
327      TYPE(point)                     ::   localpt
328      INTEGER                         ::   iyr, imon, iday, ihr, imin, isec
329      INTEGER                         ::   iberg
330      !!----------------------------------------------------------------------
331
332      ! For convenience
333      iberg = nn_test_icebergs
334
335      ! call get_date(Time, iyr, imon, iday, ihr, imin, isec)
336      ! Convert nemo time variables from dom_oce into local versions
337      iyr  = nyear
338      imon = nmonth
339      iday = nday
340      ihr = INT(nsec_day/3600)
341      imin = INT((nsec_day-ihr*3600)/60)
342      isec = nsec_day - ihr*3600 - imin*60
343
344      ! no overlap for icebergs since we want only one instance of each across the whole domain
345      ! so restrict area of interest
346      ! use tmask here because tmask_i has been doctored on one side of the north fold line
347
348      DO jj = nicbdj, nicbej
349         DO ji = nicbdi, nicbei
350            IF( tmask(ji,jj,1) > 0._wp        .AND.                                       &
351                rn_test_box(1) < glamt(ji,jj) .AND. glamt(ji,jj) < rn_test_box(2) .AND.   &
352                rn_test_box(3) < gphit(ji,jj) .AND. gphit(ji,jj) < rn_test_box(4) ) THEN
353               localberg%mass_scaling = rn_mass_scaling(iberg)
354               localpt%xi = REAL( mig(ji), wp )
355               localpt%yj = REAL( mjg(jj), wp )
356               CALL icb_utl_interp( localpt%xi, localpt%yj, plat=localpt%lat, plon=localpt%lon )   
357               localpt%mass      = rn_initial_mass     (iberg)
358               localpt%thickness = rn_initial_thickness(iberg)
359               localpt%width  = first_width (iberg)
360               localpt%length = first_length(iberg)
361               localpt%year = iyr
362               localpt%day = REAL(iday,wp)+(REAL(ihr,wp)+REAL(imin,wp)/60._wp)/24._wp
363               localpt%mass_of_bits = 0._wp
364               localpt%heat_density = 0._wp
365               localpt%uvel = 0._wp
366               localpt%vvel = 0._wp
367               CALL icb_utl_incr()
368               localberg%number(:) = num_bergs(:)
369               call icb_utl_add(localberg, localpt)
370            ENDIF
371         END DO
372      END DO
373      !
374      ibergs = icb_utl_count()
375      CALL mpp_sum('icbini', ibergs)
376      IF( nn_verbose_level > 0) THEN
377         WRITE(numicb,'(a,i6,a)') 'diamonds, icb_ini_gen: ',ibergs,' were generated'
378      ENDIF
379      !
380   END SUBROUTINE icb_ini_gen
381
382
383   SUBROUTINE icb_nam
384      !!----------------------------------------------------------------------
385      !!                     ***  ROUTINE icb_nam  ***
386      !!
387      !! ** Purpose :   read iceberg namelist and print the variables.
388      !!
389      !! ** input   : - namberg namelist
390      !!----------------------------------------------------------------------
391      INTEGER  ::   jn      ! dummy loop indices
392      INTEGER  ::   ios     ! Local integer output status for namelist read
393      REAL(wp) ::   zfact   ! local scalar
394      !
395      NAMELIST/namberg/ ln_icebergs    , ln_bergdia     , nn_sample_rate      , rn_initial_mass      ,   &
396         &              rn_distribution, rn_mass_scaling, rn_initial_thickness, nn_verbose_write     ,   &
397         &              rn_rho_bergs   , rn_LoW_ratio   , nn_verbose_level    , ln_operator_splitting,   &
398         &              rn_bits_erosion_fraction        , rn_sicn_shift       , ln_passive_mode      ,   &
399         &              ln_time_average_weight          , nn_test_icebergs    , rn_test_box          ,   &
400         &              ln_use_calving , rn_speed_limit , cn_dir, sn_icb      ,                          &
401         &              cn_icbrst_indir, cn_icbrst_in   , cn_icbrst_outdir    , cn_icbrst_out
402      !!----------------------------------------------------------------------
403
404#if defined key_agrif
405      IF(lwp) THEN
406         WRITE(numout,*)
407         WRITE(numout,*) 'icb_nam : AGRIF is not compatible with namelist namberg :  '
408         WRITE(numout,*) '~~~~~~~   definition of rn_initial_mass(nclasses) with nclasses as PARAMETER '
409         WRITE(numout,*)
410         WRITE(numout,*) '   ==>>>   force  NO icebergs used. The namelist namberg is not read'
411      ENDIF
412      ln_icebergs = .false.     
413      RETURN
414#else
415      IF(lwp) THEN
416         WRITE(numout,*)
417         WRITE(numout,*) 'icb_nam : iceberg initialization through namberg namelist read'
418         WRITE(numout,*) '~~~~~~~~ '
419      ENDIF
420#endif   
421      !                             !==  read namelist  ==!
422      READ  ( numnam_ref, namberg, IOSTAT = ios, ERR = 901)
423901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namberg in reference namelist' )
424      READ  ( numnam_cfg, namberg, IOSTAT = ios, ERR = 902 )
425902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namberg in configuration namelist' )
426      IF(lwm) WRITE ( numond, namberg )
427      !
428      IF(lwp) WRITE(numout,*)
429      IF( ln_icebergs ) THEN
430         IF(lwp) WRITE(numout,*) '   ==>>>   icebergs are used'
431      ELSE
432         IF(lwp) WRITE(numout,*) '   ==>>>   No icebergs used'
433         RETURN
434      ENDIF
435      !
436      IF( nn_test_icebergs > nclasses ) THEN
437         IF(lwp) WRITE(numout,*)
438         IF(lwp) WRITE(numout,*) '   ==>>>   Resetting of nn_test_icebergs to ', nclasses
439         nn_test_icebergs = nclasses
440      ENDIF
441      !
442      IF( nn_test_icebergs < 0 .AND. .NOT. ln_use_calving ) THEN
443         IF(lwp) WRITE(numout,*)
444         IF(lwp) WRITE(numout,*) '   ==>>>   Resetting ln_use_calving to .true. since we are not using test icebergs'
445         ln_use_calving = .true.
446      ENDIF
447      !
448      IF(lwp) THEN                  ! control print
449         WRITE(numout,*)
450         WRITE(numout,*) 'icb_nam : iceberg initialization through namberg namelist read'
451         WRITE(numout,*) '~~~~~~~~ '
452         WRITE(numout,*) '   Calculate budgets                                            ln_bergdia       = ', ln_bergdia
453         WRITE(numout,*) '   Period between sampling of position for trajectory storage   nn_sample_rate = ', nn_sample_rate
454         WRITE(numout,*) '   Mass thresholds between iceberg classes (kg)                 rn_initial_mass     ='
455         DO jn = 1, nclasses
456            WRITE(numout,'(a,f15.2)') '                                                                ', rn_initial_mass(jn)
457         ENDDO
458         WRITE(numout,*) '   Fraction of calving to apply to this class (non-dim)         rn_distribution     ='
459         DO jn = 1, nclasses
460            WRITE(numout,'(a,f10.4)') '                                                                ', rn_distribution(jn)
461         END DO
462         WRITE(numout,*) '   Ratio between effective and real iceberg mass (non-dim)      rn_mass_scaling     = '
463         DO jn = 1, nclasses
464            WRITE(numout,'(a,f10.2)') '                                                                ', rn_mass_scaling(jn)
465         END DO
466         WRITE(numout,*) '   Total thickness of newly calved bergs (m)                    rn_initial_thickness = '
467         DO jn = 1, nclasses
468            WRITE(numout,'(a,f10.2)') '                                                                ', rn_initial_thickness(jn)
469         END DO
470         WRITE(numout,*) '   Timesteps between verbose messages                           nn_verbose_write    = ', nn_verbose_write
471
472         WRITE(numout,*) '   Density of icebergs                           rn_rho_bergs  = ', rn_rho_bergs
473         WRITE(numout,*) '   Initial ratio L/W for newly calved icebergs   rn_LoW_ratio  = ', rn_LoW_ratio
474         WRITE(numout,*) '   Turn on more verbose output                          level  = ', nn_verbose_level
475         WRITE(numout,*) '   Use first order operator splitting for thermodynamics    ',   &
476            &                    'use_operator_splitting = ', ln_operator_splitting
477         WRITE(numout,*) '   Fraction of erosion melt flux to divert to bergy bits    ',   &
478            &                    'bits_erosion_fraction = ', rn_bits_erosion_fraction
479
480         WRITE(numout,*) '   Shift of sea-ice concentration in erosion flux modulation ',   &
481            &                    '(0<sicn_shift<1)    rn_sicn_shift  = ', rn_sicn_shift
482         WRITE(numout,*) '   Do not add freshwater flux from icebergs to ocean                ',   &
483            &                    '                  passive_mode            = ', ln_passive_mode
484         WRITE(numout,*) '   Time average the weight on the ocean   time_average_weight       = ', ln_time_average_weight
485         WRITE(numout,*) '   Create icebergs in absence of a restart file   nn_test_icebergs  = ', nn_test_icebergs
486         WRITE(numout,*) '                   in lon/lat box                                   = ', rn_test_box
487         WRITE(numout,*) '   Use calving data even if nn_test_icebergs > 0    ln_use_calving  = ', ln_use_calving
488         WRITE(numout,*) '   CFL speed limit for a berg            speed_limit                = ', rn_speed_limit
489         WRITE(numout,*) '   Writing Iceberg status information to icebergs.stat file        '
490      ENDIF
491      !
492      ! ensure that the sum of berg input distribution is equal to one
493      zfact = SUM( rn_distribution )
494      IF( zfact /= 1._wp .AND. 0_wp /= zfact ) THEN
495         rn_distribution(:) = rn_distribution(:) / zfact
496         IF(lwp) THEN
497            WRITE(numout,*)
498            WRITE(numout,*) '      ==>>> CAUTION:    sum of berg input distribution = ', zfact
499            WRITE(numout,*) '            *******     redistribution has been rescaled'
500            WRITE(numout,*) '                        updated berg distribution is :'
501            DO jn = 1, nclasses
502               WRITE(numout,'(a,f10.4)') '                                   ',rn_distribution(jn)
503            END DO
504         ENDIF
505      ENDIF
506      IF( MINVAL( rn_distribution(:) ) < 0._wp ) THEN
507         CALL ctl_stop( 'icb_nam: a negative rn_distribution value encountered ==>> change your namelist namberg' )
508      ENDIF
509      !
510   END SUBROUTINE icb_nam
511
512   !!======================================================================
513END MODULE icbini
Note: See TracBrowser for help on using the repository browser.