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.
limdia.F90 in branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/LIM_SRC_3/limdia.F90 @ 2833

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

First attempt to put dynamic allocation on the trunk

  • Property svn:keywords set to Id
File size: 29.8 KB
Line 
1MODULE limdia
2   !!======================================================================
3   !!                       ***  MODULE limdia   ***
4   !!  LIM-3 sea ice model :   diagnostics of ice model
5   !!======================================================================
6   !! History :  3.2  ! 2007-01  (M. Vancoppenolle)  Code adapted from LIM-2
7   !!             -   ! 2008-03  (M. Vancoppenolle)  add lim_dia_init
8   !!----------------------------------------------------------------------
9#if defined key_lim3
10   !!----------------------------------------------------------------------
11   !!   'key_lim3'                                       LIM3 sea-ice model
12   !!----------------------------------------------------------------------
13   !!   lim_dia        : computation and output of the time evolution of keys variables
14   !!   lim_dia_init   : initialization and namelist read
15   !!----------------------------------------------------------------------
16   USE ice             ! LIM-3: sea-ice variable
17   USE par_ice         ! LIM-3: ice parameters
18   USE dom_ice         ! LIM-3: sea-ice domain
19   USE dom_oce         ! ocean domain
20   USE sbc_oce         ! surface boundary condition: ocean fields
21   USE daymod          ! model calendar
22   USE phycst          ! physical constant
23   USE in_out_manager  ! I/O manager
24   USE lib_mpp         ! MPP library
25   
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC lim_dia       ! called by ice_step
30
31   INTEGER, PUBLIC  ::   ntmoy   = 1   !: instantaneous values of ice evolution or averaging ntmoy
32   INTEGER, PUBLIC  ::   ninfo   = 1   !: frequency of ouputs on file ice_evolu in case of averaging
33
34   !                                              !!! Parameters for outputs to files "evolu"
35   INTEGER, PARAMETER ::   jpinfmx = 100           ! maximum number of key variables
36   INTEGER, PARAMETER ::   jpchinf = 5             ! ???
37   INTEGER, PARAMETER ::   jpchsep = jpchinf + 2   ! ???
38
39   INTEGER  ::   nfrinf  = 4         ! number of variables written in one line
40   INTEGER  ::   nferme              ! last time step at which the var. are written on file
41   INTEGER  ::   nvinfo              ! number of total variables
42   INTEGER  ::   nbvt                ! number of time variables
43   INTEGER  ::   naveg               ! number of step for accumulation before averaging
44   REAL(wp) ::   epsi06 = 1.e-6_wp   ! small number
45
46   CHARACTER(len= 8) ::   fmtinf = '1PE13.5 '   ! format of the output values 
47   CHARACTER(len=30) ::   fmtw                  ! formats
48   CHARACTER(len=30) ::   fmtr                  ! ???
49   CHARACTER(len=30) ::   fmtitr                ! ???
50
51   CHARACTER(len=jpchsep), DIMENSION(jpinfmx) ::   titvar   ! title of key variables
52
53   REAL(wp), DIMENSION(jpinfmx) ::   vinfom     ! temporary working space
54   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) ::   aire       ! masked grid cell area
55
56   !! * Substitutions
57#  include "vectopt_loop_substitute.h90"
58   !!----------------------------------------------------------------------
59   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
60   !! $Id$
61   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
62   !!----------------------------------------------------------------------
63CONTAINS
64
65   SUBROUTINE lim_dia
66      !!--------------------------------------------------------------------
67      !!                  ***  ROUTINE lim_dia  ***
68      !!   
69      !! ** Purpose :   Computation and outputs on file ice.evolu
70      !!              the temporal evolution of some key variables
71      !!-------------------------------------------------------------------
72      INTEGER  ::   jv, ji, jj, jl   ! dummy loop indices
73      REAL(wp) ::   zshift_date      ! date from the minimum ice extent
74      REAL(wp) ::   zday, zday_min   ! current day, day of minimum extent
75      REAL(wp) ::   zafy, zamy       ! temporary area of fy and my ice
76      REAL(wp) ::   zindb
77      REAL(wp), DIMENSION(jpinfmx) ::   vinfor           ! temporary working space
78      !!-------------------------------------------------------------------
79
80      ! 0) date from the minimum of ice extent
81      !---------------------------------------
82      zday_min = 273._wp        ! zday_min = date of minimum extent, here September 30th
83      zday = REAL(numit-nit000,wp) * rdt_ice / ( 86400._wp * REAL(nn_fsbc,wp) )
84      !
85      IF( zday > zday_min ) THEN   ;   zshift_date  =  zday - zday_min
86      ELSE                         ;   zshift_date  =  zday - (365.0 - zday_min)
87      ENDIF
88
89      IF( numit == nstart )   CALL lim_dia_init   ! initialisation of ice_evolu file     
90
91      vinfor(1) = REAL(numit)       ! time diagnostics
92      vinfor(2) = nyear
93
94      DO jv = nbvt + 1, nvinfo      ! put everything to zero
95         vinfor(jv) = 0._wp
96      END DO
97
98      !!-------------------------------------------------------------------
99      !! 1) Northern hemisphere
100      !!-------------------------------------------------------------------
101      !! 1.1) Diagnostics independent on age
102      !!------------------------------------
103      DO jj = njeq, jpjm1
104         DO ji = fs_2, fs_jpim1   ! vector opt.
105            IF( tms(ji,jj) == 1 ) THEN
106               vinfor(3)  = vinfor(3)  + at_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !ice area
107               IF (at_i(ji,jj).GT.0.15) vinfor(5) = vinfor(5) + aire(ji,jj) * 1.e-12_wp !ice extent
108               vinfor(7)  = vinfor(7)  + vt_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !ice volume
109               vinfor(9)  = vinfor(9)  + vt_s(ji,jj)*aire(ji,jj) * 1.e-12_wp !snow volume
110               vinfor(15) = vinfor(15) + ot_i(ji,jj) *vt_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !mean age
111               vinfor(29) = vinfor(29) + smt_i(ji,jj)*vt_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !mean salinity
112               ! the computation of this diagnostic is not reliable
113               vinfor(31) = vinfor(31) + vt_i(ji,jj)*( u_ice(ji,jj)*u_ice(ji,jj) + & 
114                  v_ice(ji,jj)*v_ice(ji,jj) )*aire(ji,jj)/1.0e12 
115               vinfor(53) = vinfor(53) + emps(ji,jj)*aire(ji,jj) * 1.e-12_wp !salt flux
116               vinfor(55) = vinfor(55) + fsbri(ji,jj)*aire(ji,jj) * 1.e-12_wp !brine drainage flux
117               vinfor(57) = vinfor(57) + fseqv(ji,jj)*aire(ji,jj) * 1.e-12_wp !equivalent salt flux
118               vinfor(59) = vinfor(59) +(sst_m(ji,jj)+rt0)*at_i(ji,jj)*aire(ji,jj) * 1.e-12_wp  !SST
119               vinfor(61) = vinfor(61) + sss_m(ji,jj)*at_i(ji,jj)*aire(ji,jj) * 1.e-12_wp  !SSS
120               vinfor(65) = vinfor(65) + et_s(ji,jj)/1.0e9*aire(ji,jj) * 1.e-12_wp  ! snow temperature
121               vinfor(67) = vinfor(67) + et_i(ji,jj)/1.0e9*aire(ji,jj) * 1.e-12_wp       ! ice heat content
122               vinfor(69) = vinfor(69) + v_i(ji,jj,1)*aire(ji,jj) * 1.e-12_wp !ice volume
123               vinfor(71) = vinfor(71) + v_i(ji,jj,2)*aire(ji,jj) * 1.e-12_wp !ice volume
124               vinfor(73) = vinfor(73) + v_i(ji,jj,3)*aire(ji,jj) * 1.e-12_wp !ice volume
125               vinfor(75) = vinfor(75) + v_i(ji,jj,4)*aire(ji,jj) * 1.e-12_wp !ice volume
126               vinfor(77) = vinfor(77) + v_i(ji,jj,5)*aire(ji,jj) * 1.e-12_wp !ice volume
127               vinfor(79) = 0.0
128               vinfor(81) = vinfor(81) + emp(ji,jj)*aire(ji,jj) * 1.e-12_wp ! mass flux
129            ENDIF
130         END DO
131      END DO
132
133      DO jl = ice_cat_bounds(1,1), ice_cat_bounds(1,2)
134         DO jj = njeq, jpjm1
135            DO ji = fs_2, fs_jpim1   ! vector opt.
136               IF( tms(ji,jj) == 1 ) THEN
137                  vinfor(11) = vinfor(11) + v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !undef def ice volume
138               ENDIF
139            END DO
140         END DO
141      END DO
142
143      vinfor(13) = 0._wp
144
145      vinfor(15) = vinfor(15) / MAX(vinfor(7),epsi06) ! these have to be divided by total ice volume to have the
146      vinfor(29) = vinfor(29) / MAX(vinfor(7),epsi06) ! right value
147      vinfor(31) = SQRT( vinfor(31) / MAX( vinfor(7) , epsi06 ) )
148      vinfor(67) = vinfor(67) / MAX(vinfor(7),epsi06)
149
150      vinfor(53) = vinfor(53) / MAX(vinfor(5),epsi06) ! these have to be divided by total ice extent to have the
151      vinfor(55) = vinfor(55) / MAX(vinfor(5),epsi06) ! right value
152      vinfor(57) = vinfor(57) / MAX(vinfor(5),epsi06) !
153      vinfor(79) = vinfor(79) / MAX(vinfor(5),epsi06) !
154
155      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(3))) !
156      vinfor(59) = zindb*vinfor(59) / MAX(vinfor(3),epsi06) ! divide by ice area
157      vinfor(61) = zindb*vinfor(61) / MAX(vinfor(3),epsi06) !
158
159      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(9))) !
160      vinfor(65) = zindb*vinfor(65) / MAX(vinfor(9),epsi06) ! divide it by snow volume
161
162
163      DO jl = 1, jpl
164         DO jj = njeq, jpjm1
165            DO ji = fs_2, fs_jpim1   ! vector opt.
166               IF( tms(ji,jj) == 1 ) THEN
167                  vinfor(33) = vinfor(33) + d_v_i_trp(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !ice volume
168                  vinfor(35) = vinfor(35) + d_v_i_thd(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !ice volume
169               ENDIF
170            END DO
171         END DO
172      END DO
173
174      DO jj = njeq, jpjm1
175         DO ji = fs_2, fs_jpim1   ! vector opt.
176            IF( tms(ji,jj) == 1 ) THEN
177               vinfor(37) = vinfor(37) + diag_sni_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp !th growth rates
178               vinfor(39) = vinfor(39) + diag_lat_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp 
179               vinfor(41) = vinfor(41) + diag_bot_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp
180               vinfor(43) = vinfor(43) + diag_dyn_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp 
181               vinfor(45) = vinfor(45) + dv_dt_thd(ji,jj,5)*aire(ji,jj) * 1.e-12_wp
182               vinfor(47) = vinfor(47) + v_newice(ji,jj) *aire(ji,jj) * 1.e-12_wp / rdt_ice ! volume acc in OW
183            ENDIF
184         END DO
185      END DO
186
187      DO jl = 1, jpl
188         DO jj = njeq, jpjm1
189            DO ji = fs_2, fs_jpim1   ! vector opt.
190               IF( tms(ji,jj) == 1 ) THEN
191                  vinfor(63) = vinfor(63) + t_su(ji,jj,jl)*a_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp
192               ENDIF
193            END DO
194         END DO
195      END DO
196      vinfor(63) = vinfor(63) / MAX(vinfor(3),epsi06) ! these have to be divided by total ice area
197
198      !! 1.2) Diagnostics dependent on age
199      !!------------------------------------
200      DO jj = njeq, jpjm1
201         DO ji = fs_2, fs_jpim1   ! vector opt.
202            IF( tms(ji,jj) == 1 ) THEN
203               zafy = 0.0
204               zamy = 0.0
205               DO jl = 1, jpl
206                  IF ((o_i(ji,jj,jl) - zshift_date).LT.0.0) THEN
207                     vinfor(17) = vinfor(17) + a_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp ! FY ice area
208                     vinfor(25) = vinfor(25) + v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp ! FY ice volume
209                     vinfor(49) = vinfor(49) + sm_i(ji,jj,jl)*v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !FY ice salinity
210                     zafy = zafy + a_i(ji,jj,jl)
211                  ENDIF
212                  IF ((o_i(ji,jj,jl) - zshift_date).GT.0.0) THEN
213                     vinfor(19) = vinfor(19) + a_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp    ! MY ice area
214                     vinfor(27) = vinfor(27) + v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp ! MY ice volume
215                     vinfor(51) = vinfor(51) + sm_i(ji,jj,jl)*v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !MY ice salinity
216                     zamy = zamy + a_i(ji,jj,jl)
217                  ENDIF
218               END DO
219               IF ((at_i(ji,jj).GT.0.15).AND.(zafy.GT.zamy)) THEN
220                  vinfor(21) = vinfor(21) + aire(ji,jj) * 1.e-12_wp ! Seasonal ice extent
221               ENDIF
222               IF ((at_i(ji,jj).GT.0.15).AND.(zafy.LE.zamy)) THEN
223                  vinfor(23) = vinfor(23) + aire(ji,jj) * 1.e-12_wp ! Perennial ice extent
224               ENDIF
225            ENDIF
226         END DO
227      END DO
228      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(25))) !=0 if no multiyear ice 1 if yes
229      vinfor(49) = zindb*vinfor(49) / MAX(vinfor(25),epsi06)
230      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(27))) !=0 if no multiyear ice 1 if yes
231      vinfor(51) = zindb*vinfor(51) / MAX(vinfor(27),epsi06)
232
233      !! Fram Strait Export
234      !! 83 = area export
235      !! 84 = volume export
236      !! Fram strait in ORCA2 = 5 points
237      !! export = -v_ice*e1t*ddtb*at_i or -v_ice*e1t*ddtb*at_i*h_i
238      jj = 136 ! C grid
239      vinfor(83) = 0.0
240      vinfor(84) = 0.0
241      DO ji = 134, 138
242         vinfor(83) = vinfor(83) - v_ice(ji,jj) * & 
243            e1t(ji,jj)*at_i(ji,jj)*rdt_ice * 1.e-12_wp
244         vinfor(84) = vinfor(84) - v_ice(ji,jj) * & 
245            e1t(ji,jj)*vt_i(ji,jj)*rdt_ice * 1.e-12_wp
246      END DO
247
248      !!-------------------------------------------------------------------
249      !! 2) Southern hemisphere
250      !!-------------------------------------------------------------------
251      !! 2.1) Diagnostics independent on age
252      !!------------------------------------
253      DO jj = 2, njeqm1
254         DO ji = fs_2, fs_jpim1   ! vector opt.
255            IF( tms(ji,jj) == 1 ) THEN
256               vinfor(4)  = vinfor(4)  + at_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !ice area
257               IF (at_i(ji,jj).GT.0.15) vinfor(6) = vinfor(6) + aire(ji,jj) * 1.e-12_wp !ice extent
258               vinfor(8)  = vinfor(8)  + vt_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !ice volume
259               vinfor(10) = vinfor(10) + vt_s(ji,jj)*aire(ji,jj) * 1.e-12_wp !snow volume
260               vinfor(16) = vinfor(16) + ot_i(ji,jj)*vt_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !mean age
261               vinfor(30) = vinfor(30) + smt_i(ji,jj)*vt_i(ji,jj)*aire(ji,jj) * 1.e-12_wp !mean salinity
262               ! this diagnostic is not well computed (weighted by vol instead
263               ! of area)
264               vinfor(32) = vinfor(32) + vt_i(ji,jj)*( u_ice(ji,jj)*u_ice(ji,jj) + & 
265                  v_ice(ji,jj)*v_ice(ji,jj) )*aire(ji,jj)/1.0e12 !ice vel
266               vinfor(54) = vinfor(54) + at_i(ji,jj)*emps(ji,jj)*aire(ji,jj) * 1.e-12_wp ! Total salt flux
267               vinfor(56) = vinfor(56) + at_i(ji,jj)*fsbri(ji,jj)*aire(ji,jj) * 1.e-12_wp ! Brine drainage salt flux
268               vinfor(58) = vinfor(58) + at_i(ji,jj)*fseqv(ji,jj)*aire(ji,jj) * 1.e-12_wp ! Equivalent salt flux
269               vinfor(60) = vinfor(60) +(sst_m(ji,jj)+rt0)*at_i(ji,jj)*aire(ji,jj) * 1.e-12_wp  !SST
270               vinfor(62) = vinfor(62) + sss_m(ji,jj)*at_i(ji,jj)*aire(ji,jj) * 1.e-12_wp  !SSS
271               vinfor(66) = vinfor(66) + et_s(ji,jj)/1.0e9*aire(ji,jj) * 1.e-12_wp ! snow temperature
272               vinfor(68) = vinfor(68) + et_i(ji,jj)/1.0e9*aire(ji,jj) * 1.e-12_wp ! ice enthalpy
273               vinfor(70) = vinfor(70) + v_i(ji,jj,1)*aire(ji,jj) * 1.e-12_wp !ice volume
274               vinfor(72) = vinfor(72) + v_i(ji,jj,2)*aire(ji,jj) * 1.e-12_wp !ice volume
275               vinfor(74) = vinfor(74) + v_i(ji,jj,3)*aire(ji,jj) * 1.e-12_wp !ice volume
276               vinfor(76) = vinfor(76) + v_i(ji,jj,4)*aire(ji,jj) * 1.e-12_wp !ice volume
277               vinfor(78) = vinfor(78) + v_i(ji,jj,5)*aire(ji,jj) * 1.e-12_wp !ice volume
278               vinfor(80) = 0.0
279               vinfor(82) = vinfor(82) + emp(ji,jj)*aire(ji,jj) * 1.e-12_wp ! mass flux
280            ENDIF
281         END DO
282      END DO
283
284      DO jl = ice_cat_bounds(1,1), ice_cat_bounds(1,2)
285         DO jj = 2, njeqm1
286            DO ji = fs_2, fs_jpim1   ! vector opt.
287               vinfor(12) = vinfor(12) + v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !undef def ice volume
288            END DO
289         END DO
290      END DO
291
292      vinfor(14) = 0.0
293
294      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(8))) 
295      vinfor(16) = zindb * vinfor(16) / MAX(vinfor(8),epsi06) ! these have to be divided by ice vol
296      vinfor(30) = zindb * vinfor(30) / MAX(vinfor(8),epsi06) !
297      vinfor(32) = zindb * SQRT( vinfor(32) / MAX( vinfor(8) , epsi06 ) )
298      vinfor(68) = zindb * vinfor(68) / MAX(vinfor(8),epsi06) !
299
300      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(6))) 
301      vinfor(54) = zindb * vinfor(54) / MAX(vinfor(6),epsi06) ! these have to be divided by ice extt
302      vinfor(56) = zindb * vinfor(56) / MAX(vinfor(6),epsi06) !
303      vinfor(58) = zindb * vinfor(58) / MAX(vinfor(6),epsi06) !
304      vinfor(80) = zindb * vinfor(80) / MAX(vinfor(6),epsi06) !
305      !      vinfor(84) = vinfor(84) / vinfor(6) !
306
307      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(4))) !
308      vinfor(60) = zindb*vinfor(60) / ( MAX(vinfor(4), epsi06) ) ! divide by ice area
309      vinfor(62) = zindb*vinfor(62) / ( MAX(vinfor(4), epsi06) ) !
310
311      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(10))) !
312      vinfor(66) = zindb*vinfor(66) / MAX(vinfor(10),epsi06) ! divide it by snow volume
313
314      DO jl = 1, jpl
315         DO jj = 2, njeqm1
316            DO ji = fs_2, fs_jpim1   ! vector opt.
317               IF( tms(ji,jj) == 1 ) THEN
318                  vinfor(34) = vinfor(34) + d_v_i_trp(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !ice volume
319                  vinfor(36) = vinfor(36) + d_v_i_thd(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !ice volume
320               ENDIF
321            END DO
322         END DO
323      END DO
324
325      DO jj = 2, njeqm1
326         DO ji = fs_2, fs_jpim1   ! vector opt.
327            IF( tms(ji,jj) == 1 ) THEN
328               vinfor(38) = vinfor(38) + diag_sni_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp !th growth rates
329               vinfor(40) = vinfor(40) + diag_lat_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp 
330               vinfor(42) = vinfor(42) + diag_bot_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp
331               vinfor(44) = vinfor(44) + diag_dyn_gr(ji,jj)*aire(ji,jj) * 1.e-12_wp 
332               vinfor(46) = vinfor(46) + dv_dt_thd(ji,jj,5)*aire(ji,jj) * 1.e-12_wp
333               vinfor(48) = vinfor(48) + v_newice(ji,jj) *aire(ji,jj) * 1.e-12_wp / rdt_ice ! volume acc in OW
334            ENDIF
335         END DO
336      END DO
337
338      DO jl = 1, jpl
339         DO jj = 2, njeqm1
340            DO ji = fs_2, fs_jpim1   ! vector opt.
341               IF( tms(ji,jj) == 1 ) THEN
342                  vinfor(64) = vinfor(64) + t_su(ji,jj,jl)*a_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp
343               ENDIF
344            END DO
345         END DO
346      END DO
347      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(4))) !
348      vinfor(64) = zindb * vinfor(64) / MAX(vinfor(4),epsi06) ! divide by ice extt
349      !! 2.2) Diagnostics dependent on age
350      !!------------------------------------
351      DO jj = 2, njeqm1
352         DO ji = fs_2, fs_jpim1   ! vector opt.
353            IF( tms(ji,jj) == 1 ) THEN
354               zafy = 0._wp
355               zamy = 0._wp
356               DO jl = 1, jpl
357                  IF( (o_i(ji,jj,jl) - zshift_date) < 0._wp ) THEN
358                     vinfor(18) = vinfor(18) + a_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp ! FY ice area
359                     vinfor(26) = vinfor(26) + v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp ! FY ice volume
360                     zafy = zafy + a_i(ji,jj,jl)
361                     vinfor(50) = vinfor(50) + sm_i(ji,jj,jl)*v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !FY ice salinity
362                  ENDIF
363                  IF( (o_i(ji,jj,jl) - zshift_date) > 0._wp ) THEN
364                     vinfor(20) = vinfor(20) + a_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp    ! MY ice area
365                     vinfor(28) = vinfor(28) + v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp
366                     vinfor(52) = vinfor(52) + sm_i(ji,jj,jl)*v_i(ji,jj,jl)*aire(ji,jj) * 1.e-12_wp !FY ice salinity
367                     zamy = zamy + a_i(ji,jj,jl)
368                  ENDIF
369               END DO ! jl
370               IF ((at_i(ji,jj).GT.0.15).AND.(zafy.GT.zamy)) THEN
371                  vinfor(22) = vinfor(22) + aire(ji,jj) * 1.e-12_wp ! Seasonal ice extent
372               ENDIF
373               IF ((at_i(ji,jj).GT.0.15).AND.(zafy.LE.zamy)) THEN
374                  vinfor(24) = vinfor(24) + aire(ji,jj) * 1.e-12_wp ! Perennial ice extent
375               ENDIF
376            ENDIF ! tms
377         END DO ! jj
378      END DO ! ji
379      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(26))) !=0 if no multiyear ice 1 if yes
380      vinfor(50) = zindb*vinfor(50) / MAX(vinfor(26),epsi06)
381      zindb      = 1.0 - MAX(0.0,SIGN(1.0,-vinfor(28))) !=0 if no multiyear ice 1 if yes
382      vinfor(52) = zindb*vinfor(52) / MAX(vinfor(28),epsi06)
383
384      !  Accumulation before averaging
385      DO jv = 1, nvinfo
386         vinfom(jv) = vinfom(jv) + vinfor(jv)
387      END DO
388      naveg = naveg + 1 
389
390      ! oututs on file ice_evolu   
391      !MV      IF( MOD( numit , ninfo ) == 0 ) THEN
392      WRITE(numevo_ice,fmtw) ( titvar(jv), vinfom(jv)/naveg, jv = 1, nvinfo )
393      naveg = 0
394      DO jv = 1, nvinfo
395         vinfom(jv) = 0._wp
396      END DO
397      !MV      ENDIF
398      !
399   END SUBROUTINE lim_dia
400
401
402   SUBROUTINE lim_dia_init
403      !!-------------------------------------------------------------------
404      !!                  ***  ROUTINE lim_dia_init  ***
405      !!             
406      !! ** Purpose : Preparation of the file ice_evolu for the output of
407      !!      the temporal evolution of key variables
408      !!
409      !! ** input   : Namelist namicedia
410      !!-------------------------------------------------------------------
411      INTEGER  ::   jv    ! dummy loop indice
412      INTEGER  ::   ierr, ntot , ndeb , irecl   ! local integers
413      REAL(wp) ::   zxx0, zxx1    ! local scalars
414      CHARACTER(len=jpchinf) ::   titinf
415      CHARACTER(len=50)      ::   clname
416      !!
417      NAMELIST/namicedia/fmtinf, nfrinf, ninfo, ntmoy
418      !!-------------------------------------------------------------------
419      !
420      REWIND( numnam_ice )             ! read namicedia namelist
421      READ  ( numnam_ice, namicedia )
422      !
423      IF(lwp) THEN                     ! control print
424         WRITE(numout,*)
425         WRITE(numout,*) 'lim_dia_init : ice parameters for ice diagnostics '
426         WRITE(numout,*) '~~~~~~~~~~~~'
427         WRITE(numout,*) '   format of the output values                                 fmtinf = ', fmtinf
428         WRITE(numout,*) '   number of variables written in one line                     nfrinf = ', nfrinf 
429         WRITE(numout,*) '   Instantaneous values of ice evolution or averaging          ntmoy  = ', ntmoy
430         WRITE(numout,*) '   frequency of ouputs on file ice_evolu in case of averaging  ninfo  = ', ninfo
431      ENDIF
432
433      ALLOCATE( aire(jpi,jpj) , STAT=ierr )      ! masked grid cell area (interior domain only)
434      IF( lk_mpp    )   CALL mpp_sum( ierr )
435      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'lim_dia_init_2 : unable to allocate arrays' )
436      aire(:,:) = area(:,:) * tms(:,:) * tmask_i(:,:)
437
438      ! Titles of ice key variables :
439      titvar(1) = 'NoIt'  ! iteration number
440      titvar(2) = 'T yr'  ! time step in years
441      nbvt      = 2       ! number of time variables
442
443      titvar(3) = 'AI_N'  ! sea ice area in the northern Hemisp.(10^12 km2)
444      titvar(4) = 'AI_S'  ! sea ice area in the southern Hemisp.(10^12 km2)
445      titvar(5) = 'EI_N'  ! sea ice extent (15%) in the northern Hemisp.(10^12 km2)
446      titvar(6) = 'EI_S'  ! sea ice extent (15%) in the southern Hemisp.(10^12 km2)
447      titvar(7) = 'VI_N'  ! sea ice volume in the northern Hemisp.(10^3 km3)
448      titvar(8) = 'VI_S'  ! sea ice volume in the southern Hemisp.(10^3 km3)
449      titvar(9) = 'VS_N'  ! snow volume over sea ice in the northern Hemisp.(10^3 km3)
450      titvar(10)= 'VS_S'  ! snow volume over sea ice in the northern Hemisp.(10^3 km3)
451      titvar(11)= 'VuIN'  ! undeformed sea ice volume in the northern Hemisp.(10^3 km3)
452      titvar(12)= 'VuIS'  ! undeformed sea ice volume in the southern Hemisp.(10^3 km3)
453      titvar(13)= 'VdIN'  ! deformed sea ice volume in the northern Hemisp.(10^3 km3)
454      titvar(14)= 'VdIS'  ! deformed sea ice volume in the southern Hemisp.(10^3 km3)
455      titvar(15)= 'OI_N'  ! sea ice mean age in the northern Hemisp.(years)
456      titvar(16)= 'OI_S'  ! sea ice mean age in the southern Hemisp.(years)
457      titvar(17)= 'AFYN'  ! total FY ice area northern Hemisp.(10^12 km2)
458      titvar(18)= 'AFYS'  ! total FY ice area southern Hemisp.(10^12 km2)
459      titvar(19)= 'AMYN'  ! total MY ice area northern Hemisp.(10^12 km2)
460      titvar(20)= 'AMYS'  ! total MY ice area southern Hemisp.(10^12 km2)
461      titvar(21)= 'EFYN'  ! total FY ice extent northern Hemisp.(10^12 km2) (with more 50% FY ice)
462      titvar(22)= 'EFYS'  ! total FY ice extent southern Hemisp.(10^12 km2) (with more 50% FY ice)
463      titvar(23)= 'EMYN'  ! total MY ice extent northern Hemisp.(10^12 km2) (with more 50% MY ice)
464      titvar(24)= 'EMYS'  ! total MY ice extent southern Hemisp.(10^12 km2) (with more 50% MY ice)
465      titvar(25)= 'VFYN'  ! total undeformed FY ice volume northern Hemisp.(10^3 km3)
466      titvar(26)= 'VFYS'  ! total undeformed FY ice volume southern Hemisp.(10^3 km3)
467      titvar(27)= 'VMYN'  ! total undeformed MY ice volume northern Hemisp.(10^3 km3)
468      titvar(28)= 'VMYS'  ! total undeformed MY ice volume southern Hemisp.(10^3 km3)
469      titvar(29)= 'IS_N'  ! sea ice mean salinity in the northern hemisphere (ppt) 
470      titvar(30)= 'IS_S'  ! sea ice mean salinity in the southern hemisphere (ppt) 
471      titvar(31)= 'IVeN'  ! sea ice mean velocity in the northern hemisphere (m/s)
472      titvar(32)= 'IVeS'  ! sea ice mean velocity in the southern hemisphere (m/s)
473      titvar(33)= 'DVDN'  ! variation of sea ice volume due to dynamics in the northern hemisphere
474      titvar(34)= 'DVDS'  ! variation of sea ice volume due to dynamics in the southern hemisphere
475      titvar(35)= 'DVTN'  ! variation of sea ice volume due to thermo in the   northern hemisphere
476      titvar(36)= 'DVTS'  ! variation of sea ice volume due to thermo in the   southern hemisphere
477      titvar(37)= 'TG1N'  ! thermodynamic vertical growth rate in the northern hemisphere, cat 1 
478      titvar(38)= 'TG1S'  ! thermodynamic vertical growth rate in the souhtern hemisphere, cat 1 
479      titvar(39)= 'TG2N'  ! thermodynamic vertical growth rate in the northern hemisphere, cat 2 
480      titvar(40)= 'TG2S'  ! thermodynamic vertical growth rate in the souhtern hemisphere, cat 2 
481      titvar(41)= 'TG3N'  ! thermodynamic vertical growth rate in the northern hemisphere, cat 3 
482      titvar(42)= 'TG3S'  ! thermodynamic vertical growth rate in the souhtern hemisphere, cat 3 
483      titvar(43)= 'TG4N'  ! thermodynamic vertical growth rate in the northern hemisphere, cat 4 
484      titvar(44)= 'TG4S'  ! thermodynamic vertical growth rate in the souhtern hemisphere, cat 4 
485      titvar(45)= 'TG5N'  ! thermodynamic vertical growth rate in the northern hemisphere, cat 5 
486      titvar(46)= 'TG5S'  ! thermodynamic vertical growth rate in the souhtern hemisphere, cat 5 
487      titvar(47)= 'LA_N'  ! lateral accretion growth rate, northern hemisphere
488      titvar(48)= 'LA_S'  ! lateral accretion growth rate, southern hemisphere
489      titvar(49)= 'SF_N'  ! Salinity FY, NH
490      titvar(50)= 'SF_S'  ! Salinity FY, SH
491      titvar(51)= 'SF_N'  ! Salinity MY, NH
492      titvar(52)= 'SF_S'  ! Salinity MY, SH
493      titvar(53)= 'Fs_N'  ! Total salt flux NH
494      titvar(54)= 'Fs_S'  ! Total salt flux SH
495      titvar(55)= 'FsbN'  ! Salt - brine drainage flux NH
496      titvar(56)= 'FsbS'  ! Salt - brine drainage flux SH
497      titvar(57)= 'FseN'  ! Salt - Equivalent salt flux NH
498      titvar(58)= 'FseS'  ! Salt - Equivalent salt flux SH
499      titvar(59)= 'SSTN'  ! SST, NH
500      titvar(60)= 'SSTS'  ! SST, SH
501      titvar(61)= 'SSSN'  ! SSS, NH
502      titvar(62)= 'SSSS'  ! SSS, SH
503      titvar(63)= 'TsuN'  ! Tsu, NH
504      titvar(64)= 'TsuS'  ! Tsu, SH
505      titvar(65)= 'TsnN'  ! Tsn, NH
506      titvar(66)= 'TsnS'  ! Tsn, SH
507      titvar(67)= 'ei_N'  ! ei, NH
508      titvar(68)= 'ei_S'  ! ei, SH
509      titvar(69)= 'vi1N'  ! vi1, NH
510      titvar(70)= 'vi1S'  ! vi1, SH
511      titvar(71)= 'vi2N'  ! vi2, NH
512      titvar(72)= 'vi2S'  ! vi2, SH
513      titvar(73)= 'vi3N'  ! vi3, NH
514      titvar(74)= 'vi3S'  ! vi3, SH
515      titvar(75)= 'vi4N'  ! vi4, NH
516      titvar(76)= 'vi4S'  ! vi4, SH
517      titvar(77)= 'vi5N'  ! vi5, NH
518      titvar(78)= 'vi5S'  ! vi5, SH
519      titvar(79)= 'vi6N'  ! vi6, NH
520      titvar(80)= 'vi6S'  ! vi6, SH
521      titvar(81)= 'fmaN'  ! mass flux in the ocean, NH
522      titvar(82)= 'fmaS'  ! mass flux in the ocean, SH
523      titvar(83)= 'AFSE'  ! Fram Strait Area export
524      titvar(84)= 'VFSE'  ! Fram Strait Volume export
525      nvinfo = 84
526
527      ! Definition et Ecriture de l'entete : nombre d'enregistrements
528      ndeb   = ( nstart - 1 ) / ninfo
529      IF( nstart == 1 ) ndeb = -1
530
531      nferme = ( nstart - 1 + nitrun) / ninfo
532      ntot   = nferme - ndeb
533      ndeb   = ninfo * ( 1 + ndeb )
534      nferme = ninfo * nferme
535
536      ! definition of formats
537      WRITE( fmtw  , '(A,I3,A2,I1,A)' )  '(', nfrinf, '(A', jpchsep, ','//fmtinf//'))'
538      WRITE( fmtr  , '(A,I3,A,I1,A)'  )  '(', nfrinf, '(', jpchsep, 'X,'//fmtinf//'))'
539      WRITE( fmtitr, '(A,I3,A,I1,A)'  )  '(', nvinfo, 'A', jpchinf, ')'
540
541      ! opening  "ice_evolu" file
542      IF( lk_mpp ) THEN   ;   WRITE(clname,FMT="('ice.evolu_',I4.4)") narea-1
543      ELSE                ;   clname = 'ice.evolu'
544      END IF
545      irecl = ( jpchinf + 1 ) * nvinfo 
546      CALL ctl_opn( numevo_ice, clname, 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL',    &
547         &         irecl, numout, lwp, narea )
548
549      !- ecriture de 2 lignes d''entete :
550      WRITE(numevo_ice,1000) fmtr, fmtw, fmtitr, nvinfo, ntot, 0, nfrinf
551      zxx0 = 0.001 * REAL(ninfo)
552      zxx1 = 0.001 * REAL(ndeb)
553      WRITE(numevo_ice,1111) REAL(jpchinf), 0., zxx1, zxx0, 0., 0., 0
554
555      !- ecriture de 2 lignes de titre :
556      WRITE(numevo_ice,'(A,I8,A,I8,A,I5)')                 &
557         'Evolution chronologique - Experience '//cexper   &
558         //'   de', ndeb, ' a', nferme, ' pas', ninfo
559      WRITE(numevo_ice,fmtitr) ( titvar(jv), jv = 1, nvinfo )
560
561      !--preparation de "titvar" pour l''ecriture parmi les valeurs numeriques :
562      DO jv = 2 , nvinfo
563         titinf     = titvar(jv)(:jpchinf)
564         titvar(jv) = '  '//titinf
565      END DO
566
567      !--Initialisation of the arrays for the accumulation
568      DO jv = 1, nvinfo
569         vinfom(jv) = 0._wp
570      END DO
571      naveg = 0
572
5731000  FORMAT( 3(A20),4(1x,I6) )
5741111  FORMAT( 3(F7.1,1X,F7.3,1X),I3,A ) 
575      !
576   END SUBROUTINE lim_dia_init
577
578#else
579   !!----------------------------------------------------------------------
580   !!   Default option :                             NO LIM-3 sea-ice model
581   !!----------------------------------------------------------------------
582CONTAINS
583   SUBROUTINE lim_dia         ! Empty routine
584   END SUBROUTINE lim_dia
585#endif
586
587   !!======================================================================
588END MODULE limdia
Note: See TracBrowser for help on using the repository browser.