1 | MODULE limupdate1 |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE limupdate1 *** |
---|
4 | !! LIM-3 : Update of sea-ice global variables at the end of the time step |
---|
5 | !!====================================================================== |
---|
6 | !! History : 3.0 ! 2006-04 (M. Vancoppenolle) Original code |
---|
7 | !! 3.5 ! 2014-06 (C. Rousset) Complete rewriting/cleaning |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | #if defined key_lim3 |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | !! 'key_lim3' LIM3 sea-ice model |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! lim_update1 : computes update of sea-ice global variables from trend terms |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
16 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
17 | USE dom_oce |
---|
18 | USE phycst ! physical constants |
---|
19 | USE ice |
---|
20 | USE thd_ice ! LIM thermodynamic sea-ice variables |
---|
21 | USE limitd_th |
---|
22 | USE limvar |
---|
23 | USE prtctl ! Print control |
---|
24 | USE wrk_nemo ! work arrays |
---|
25 | USE timing ! Timing |
---|
26 | USE limcons ! conservation tests |
---|
27 | USE lib_mpp ! MPP library |
---|
28 | USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) |
---|
29 | USE in_out_manager ! I/O manager |
---|
30 | |
---|
31 | IMPLICIT NONE |
---|
32 | PRIVATE |
---|
33 | |
---|
34 | PUBLIC lim_update1 |
---|
35 | |
---|
36 | !! * Substitutions |
---|
37 | # include "vectopt_loop_substitute.h90" |
---|
38 | !!---------------------------------------------------------------------- |
---|
39 | !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011) |
---|
40 | !! $Id$ |
---|
41 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | CONTAINS |
---|
44 | |
---|
45 | SUBROUTINE lim_update1( kt ) |
---|
46 | !!------------------------------------------------------------------- |
---|
47 | !! *** ROUTINE lim_update1 *** |
---|
48 | !! |
---|
49 | !! ** Purpose : Computes update of sea-ice global variables at |
---|
50 | !! the end of the dynamics. |
---|
51 | !! |
---|
52 | !!--------------------------------------------------------------------- |
---|
53 | INTEGER, INTENT(in) :: kt ! number of iteration |
---|
54 | INTEGER :: ji, jj, jk, jl ! dummy loop indices |
---|
55 | REAL(wp) :: zsal |
---|
56 | REAL(wp) :: zvi_b, zsmv_b, zei_b, zfs_b, zfw_b, zft_b |
---|
57 | !!------------------------------------------------------------------- |
---|
58 | IF( nn_timing == 1 ) CALL timing_start('limupdate1') |
---|
59 | |
---|
60 | IF( kt == nit000 .AND. lwp ) THEN |
---|
61 | WRITE(numout,*)'' |
---|
62 | WRITE(numout,*)' lim_update1 ' |
---|
63 | WRITE(numout,*)' ~~~~~~~~~~~ ' |
---|
64 | ENDIF |
---|
65 | |
---|
66 | ! conservation test |
---|
67 | IF( ln_limdiahsb ) CALL lim_cons_hsm(0, 'limupdate1', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) |
---|
68 | |
---|
69 | !---------------------------------------------------- |
---|
70 | ! ice concentration should not exceed amax |
---|
71 | !----------------------------------------------------- |
---|
72 | at_i(:,:) = 0._wp |
---|
73 | DO jl = 1, jpl |
---|
74 | at_i(:,:) = a_i(:,:,jl) + at_i(:,:) |
---|
75 | END DO |
---|
76 | |
---|
77 | DO jl = 1, jpl |
---|
78 | DO jj = 1, jpj |
---|
79 | DO ji = 1, jpi |
---|
80 | IF( at_i(ji,jj) > rn_amax_2d(ji,jj) .AND. a_i(ji,jj,jl) > 0._wp ) THEN |
---|
81 | a_i (ji,jj,jl) = a_i (ji,jj,jl) * ( 1._wp - ( 1._wp - rn_amax_2d(ji,jj) / at_i(ji,jj) ) ) |
---|
82 | oa_i(ji,jj,jl) = oa_i(ji,jj,jl) * ( 1._wp - ( 1._wp - rn_amax_2d(ji,jj) / at_i(ji,jj) ) ) |
---|
83 | ENDIF |
---|
84 | END DO |
---|
85 | END DO |
---|
86 | END DO |
---|
87 | |
---|
88 | !--------------------- |
---|
89 | ! Ice salinity bounds |
---|
90 | !--------------------- |
---|
91 | IF ( nn_icesal == 2 ) THEN |
---|
92 | DO jl = 1, jpl |
---|
93 | DO jj = 1, jpj |
---|
94 | DO ji = 1, jpi |
---|
95 | zsal = smv_i(ji,jj,jl) |
---|
96 | ! salinity stays in bounds |
---|
97 | rswitch = 1._wp - MAX( 0._wp, SIGN( 1._wp, - v_i(ji,jj,jl) ) ) |
---|
98 | smv_i(ji,jj,jl) = rswitch * MAX( MIN( rn_simax * v_i(ji,jj,jl), smv_i(ji,jj,jl) ), rn_simin * v_i(ji,jj,jl) ) |
---|
99 | ! associated salt flux |
---|
100 | sfx_res(ji,jj) = sfx_res(ji,jj) - ( smv_i(ji,jj,jl) - zsal ) * rhoic * r1_rdtice |
---|
101 | END DO |
---|
102 | END DO |
---|
103 | END DO |
---|
104 | ENDIF |
---|
105 | |
---|
106 | !---------------------------------------------------- |
---|
107 | ! Rebin categories with thickness out of bounds |
---|
108 | !---------------------------------------------------- |
---|
109 | IF ( jpl > 1 ) CALL lim_itd_th_reb(1, jpl) |
---|
110 | |
---|
111 | !----------------- |
---|
112 | ! zap small values |
---|
113 | !----------------- |
---|
114 | CALL lim_var_zapsmall |
---|
115 | |
---|
116 | ! ------------------------------------------------- |
---|
117 | ! Diagnostics |
---|
118 | ! ------------------------------------------------- |
---|
119 | DO jl = 1, jpl |
---|
120 | afx_dyn(:,:) = afx_dyn(:,:) + ( a_i(:,:,jl) - a_i_b(:,:,jl) ) * r1_rdtice |
---|
121 | END DO |
---|
122 | |
---|
123 | DO jj = 1, jpj |
---|
124 | DO ji = 1, jpi |
---|
125 | ! heat content variation (W.m-2) |
---|
126 | diag_heat(ji,jj) = - ( SUM( e_i(ji,jj,1:nlay_i,:) - e_i_b(ji,jj,1:nlay_i,:) ) + & |
---|
127 | & SUM( e_s(ji,jj,1:nlay_s,:) - e_s_b(ji,jj,1:nlay_s,:) ) & |
---|
128 | & ) * r1_rdtice |
---|
129 | ! salt, volume |
---|
130 | diag_smvi(ji,jj) = SUM( smv_i(ji,jj,:) - smv_i_b(ji,jj,:) ) * rhoic * r1_rdtice |
---|
131 | diag_vice(ji,jj) = SUM( v_i (ji,jj,:) - v_i_b (ji,jj,:) ) * rhoic * r1_rdtice |
---|
132 | diag_vsnw(ji,jj) = SUM( v_s (ji,jj,:) - v_s_b (ji,jj,:) ) * rhosn * r1_rdtice |
---|
133 | END DO |
---|
134 | END DO |
---|
135 | |
---|
136 | ! conservation test |
---|
137 | IF( ln_limdiahsb ) CALL lim_cons_hsm(1, 'limupdate1', zvi_b, zsmv_b, zei_b, zfw_b, zfs_b, zft_b) |
---|
138 | |
---|
139 | ! ------------------------------------------------- |
---|
140 | ! control prints |
---|
141 | ! ------------------------------------------------- |
---|
142 | IF(ln_ctl) THEN ! Control print |
---|
143 | CALL prt_ctl_info(' ') |
---|
144 | CALL prt_ctl_info(' - Cell values : ') |
---|
145 | CALL prt_ctl_info(' ~~~~~~~~~~~~~ ') |
---|
146 | CALL prt_ctl(tab2d_1=e12t , clinfo1=' lim_update1 : cell area :') |
---|
147 | CALL prt_ctl(tab2d_1=at_i , clinfo1=' lim_update1 : at_i :') |
---|
148 | CALL prt_ctl(tab2d_1=vt_i , clinfo1=' lim_update1 : vt_i :') |
---|
149 | CALL prt_ctl(tab2d_1=vt_s , clinfo1=' lim_update1 : vt_s :') |
---|
150 | CALL prt_ctl(tab2d_1=strength , clinfo1=' lim_update1 : strength :') |
---|
151 | CALL prt_ctl(tab2d_1=u_ice , clinfo1=' lim_update1 : u_ice :', tab2d_2=v_ice , clinfo2=' v_ice :') |
---|
152 | CALL prt_ctl(tab2d_1=u_ice_b , clinfo1=' lim_update1 : u_ice_b :', tab2d_2=v_ice_b , clinfo2=' v_ice_b :') |
---|
153 | |
---|
154 | DO jl = 1, jpl |
---|
155 | CALL prt_ctl_info(' ') |
---|
156 | CALL prt_ctl_info(' - Category : ', ivar1=jl) |
---|
157 | CALL prt_ctl_info(' ~~~~~~~~~~') |
---|
158 | CALL prt_ctl(tab2d_1=ht_i (:,:,jl) , clinfo1= ' lim_update1 : ht_i : ') |
---|
159 | CALL prt_ctl(tab2d_1=ht_s (:,:,jl) , clinfo1= ' lim_update1 : ht_s : ') |
---|
160 | CALL prt_ctl(tab2d_1=t_su (:,:,jl) , clinfo1= ' lim_update1 : t_su : ') |
---|
161 | CALL prt_ctl(tab2d_1=t_s (:,:,1,jl) , clinfo1= ' lim_update1 : t_snow : ') |
---|
162 | CALL prt_ctl(tab2d_1=sm_i (:,:,jl) , clinfo1= ' lim_update1 : sm_i : ') |
---|
163 | CALL prt_ctl(tab2d_1=o_i (:,:,jl) , clinfo1= ' lim_update1 : o_i : ') |
---|
164 | CALL prt_ctl(tab2d_1=a_i (:,:,jl) , clinfo1= ' lim_update1 : a_i : ') |
---|
165 | CALL prt_ctl(tab2d_1=a_i_b (:,:,jl) , clinfo1= ' lim_update1 : a_i_b : ') |
---|
166 | CALL prt_ctl(tab2d_1=v_i (:,:,jl) , clinfo1= ' lim_update1 : v_i : ') |
---|
167 | CALL prt_ctl(tab2d_1=v_i_b (:,:,jl) , clinfo1= ' lim_update1 : v_i_b : ') |
---|
168 | CALL prt_ctl(tab2d_1=v_s (:,:,jl) , clinfo1= ' lim_update1 : v_s : ') |
---|
169 | CALL prt_ctl(tab2d_1=v_s_b (:,:,jl) , clinfo1= ' lim_update1 : v_s_b : ') |
---|
170 | CALL prt_ctl(tab2d_1=e_i (:,:,1,jl) , clinfo1= ' lim_update1 : e_i1 : ') |
---|
171 | CALL prt_ctl(tab2d_1=e_i_b (:,:,1,jl) , clinfo1= ' lim_update1 : e_i1_b : ') |
---|
172 | CALL prt_ctl(tab2d_1=e_i (:,:,2,jl) , clinfo1= ' lim_update1 : e_i2 : ') |
---|
173 | CALL prt_ctl(tab2d_1=e_i_b (:,:,2,jl) , clinfo1= ' lim_update1 : e_i2_b : ') |
---|
174 | CALL prt_ctl(tab2d_1=e_s (:,:,1,jl) , clinfo1= ' lim_update1 : e_snow : ') |
---|
175 | CALL prt_ctl(tab2d_1=e_s_b (:,:,1,jl) , clinfo1= ' lim_update1 : e_snow_b : ') |
---|
176 | CALL prt_ctl(tab2d_1=smv_i (:,:,jl) , clinfo1= ' lim_update1 : smv_i : ') |
---|
177 | CALL prt_ctl(tab2d_1=smv_i_b (:,:,jl) , clinfo1= ' lim_update1 : smv_i_b : ') |
---|
178 | CALL prt_ctl(tab2d_1=oa_i (:,:,jl) , clinfo1= ' lim_update1 : oa_i : ') |
---|
179 | CALL prt_ctl(tab2d_1=oa_i_b (:,:,jl) , clinfo1= ' lim_update1 : oa_i_b : ') |
---|
180 | |
---|
181 | DO jk = 1, nlay_i |
---|
182 | CALL prt_ctl_info(' - Layer : ', ivar1=jk) |
---|
183 | CALL prt_ctl(tab2d_1=t_i(:,:,jk,jl) , clinfo1= ' lim_update1 : t_i : ') |
---|
184 | END DO |
---|
185 | END DO |
---|
186 | |
---|
187 | CALL prt_ctl_info(' ') |
---|
188 | CALL prt_ctl_info(' - Heat / FW fluxes : ') |
---|
189 | CALL prt_ctl_info(' ~~~~~~~~~~~~~~~~~~ ') |
---|
190 | CALL prt_ctl(tab2d_1=sst_m , clinfo1= ' lim_update1 : sst : ', tab2d_2=sss_m , clinfo2= ' sss : ') |
---|
191 | |
---|
192 | CALL prt_ctl_info(' ') |
---|
193 | CALL prt_ctl_info(' - Stresses : ') |
---|
194 | CALL prt_ctl_info(' ~~~~~~~~~~ ') |
---|
195 | CALL prt_ctl(tab2d_1=utau , clinfo1= ' lim_update1 : utau : ', tab2d_2=vtau , clinfo2= ' vtau : ') |
---|
196 | CALL prt_ctl(tab2d_1=utau_ice , clinfo1= ' lim_update1 : utau_ice : ', tab2d_2=vtau_ice , clinfo2= ' vtau_ice : ') |
---|
197 | CALL prt_ctl(tab2d_1=u_oce , clinfo1= ' lim_update1 : u_oce : ', tab2d_2=v_oce , clinfo2= ' v_oce : ') |
---|
198 | ENDIF |
---|
199 | |
---|
200 | IF( nn_timing == 1 ) CALL timing_stop('limupdate1') |
---|
201 | END SUBROUTINE lim_update1 |
---|
202 | #else |
---|
203 | !!---------------------------------------------------------------------- |
---|
204 | !! Default option Empty Module No sea-ice model |
---|
205 | !!---------------------------------------------------------------------- |
---|
206 | CONTAINS |
---|
207 | SUBROUTINE lim_update1 ! Empty routine |
---|
208 | END SUBROUTINE lim_update1 |
---|
209 | |
---|
210 | #endif |
---|
211 | |
---|
212 | END MODULE limupdate1 |
---|