1 | MODULE iceforcing |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE iceforcing *** |
---|
4 | !! Sea-Ice : air-ice forcing fields |
---|
5 | !!===================================================================== |
---|
6 | !! History : 4.0 ! 2017-08 (C. Rousset) Original code |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | #if defined key_lim3 |
---|
9 | !!---------------------------------------------------------------------- |
---|
10 | !! 'key_lim3' : LIM 3.0 sea-ice model |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | USE oce ! ocean dynamics and tracers |
---|
13 | USE dom_oce ! ocean space and time domain |
---|
14 | USE ice ! sea-ice variables |
---|
15 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
16 | USE sbc_ice ! Surface boundary condition: ice fields |
---|
17 | USE usrdef_sbc ! user defined: surface boundary condition |
---|
18 | USE sbcblk ! Surface boundary condition: bulk |
---|
19 | USE sbccpl ! Surface boundary condition: coupled interface |
---|
20 | USE icealb ! ice albedo |
---|
21 | ! |
---|
22 | USE iom ! I/O manager library |
---|
23 | USE in_out_manager ! I/O manager |
---|
24 | USE lbclnk ! lateral boundary condition - MPP link |
---|
25 | USE lib_mpp ! MPP library |
---|
26 | USE lib_fortran ! |
---|
27 | USE timing ! Timing |
---|
28 | |
---|
29 | IMPLICIT NONE |
---|
30 | PRIVATE |
---|
31 | |
---|
32 | PUBLIC ice_forcing_tau ! routine called by icestp.F90 |
---|
33 | PUBLIC ice_forcing_flx ! routine called by icestp.F90 |
---|
34 | |
---|
35 | !! * Substitutions |
---|
36 | # include "vectopt_loop_substitute.h90" |
---|
37 | !!---------------------------------------------------------------------- |
---|
38 | !! NEMO/ICE 4.0 , UCL NEMO Consortium (2017) |
---|
39 | !! $Id: icestp.F90 8319 2017-07-11 15:00:44Z clem $ |
---|
40 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
41 | !!---------------------------------------------------------------------- |
---|
42 | CONTAINS |
---|
43 | |
---|
44 | SUBROUTINE ice_forcing_tau( kt, ksbc, utau_ice, vtau_ice ) |
---|
45 | !!--------------------------------------------------------------------- |
---|
46 | !! *** ROUTINE ice_forcing_tau *** |
---|
47 | !! |
---|
48 | !! ** Purpose : provide surface boundary condition for sea ice (momentum) |
---|
49 | !! |
---|
50 | !! ** Action : It provides the following fields: |
---|
51 | !! utau_ice, vtau_ice : surface ice stress (U- & V-points) [N/m2] |
---|
52 | !!--------------------------------------------------------------------- |
---|
53 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
54 | INTEGER, INTENT(in) :: ksbc ! type of sbc flux ( 1 = user defined formulation, |
---|
55 | ! 3 = bulk formulation, |
---|
56 | ! 4 = Pure Coupled formulation) |
---|
57 | REAL(wp), DIMENSION(jpi,jpj), INTENT(out) :: utau_ice, vtau_ice |
---|
58 | !! |
---|
59 | INTEGER :: ji, jj ! dummy loop index |
---|
60 | REAL(wp), DIMENSION(jpi,jpj) :: zutau_ice, zvtau_ice |
---|
61 | !!---------------------------------------------------------------------- |
---|
62 | |
---|
63 | IF( nn_timing == 1 ) CALL timing_start('ice_forcing_tau') |
---|
64 | |
---|
65 | IF( kt == nit000 .AND. lwp ) THEN |
---|
66 | WRITE(numout,*) |
---|
67 | WRITE(numout,*)'ice_forcing_tau' |
---|
68 | WRITE(numout,*)'~~~~~~~~~~~~~~~' |
---|
69 | ENDIF |
---|
70 | |
---|
71 | SELECT CASE( ksbc ) |
---|
72 | CASE( jp_usr ) ; CALL usrdef_sbc_ice_tau( kt ) ! user defined formulation |
---|
73 | CASE( jp_blk ) ; CALL blk_ice_tau ! Bulk formulation |
---|
74 | CASE( jp_purecpl ) ; CALL sbc_cpl_ice_tau( utau_ice , vtau_ice ) ! Coupled formulation |
---|
75 | END SELECT |
---|
76 | |
---|
77 | IF( ln_mixcpl) THEN ! Case of a mixed Bulk/Coupled formulation |
---|
78 | CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice ) |
---|
79 | DO jj = 2, jpjm1 |
---|
80 | DO ji = 2, jpim1 |
---|
81 | utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) |
---|
82 | vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) |
---|
83 | END DO |
---|
84 | END DO |
---|
85 | CALL lbc_lnk_multi( utau_ice, 'U', -1., vtau_ice, 'V', -1. ) |
---|
86 | ENDIF |
---|
87 | |
---|
88 | IF( nn_timing == 1 ) CALL timing_stop('ice_forcing_tau') |
---|
89 | ! |
---|
90 | END SUBROUTINE ice_forcing_tau |
---|
91 | |
---|
92 | |
---|
93 | SUBROUTINE ice_forcing_flx( kt, ksbc ) |
---|
94 | !!--------------------------------------------------------------------- |
---|
95 | !! *** ROUTINE ice_forcing_flx *** |
---|
96 | !! |
---|
97 | !! ** Purpose : provide surface boundary condition for sea ice (flux) |
---|
98 | !! |
---|
99 | !! ** Action : It provides the following fields used in sea ice model: |
---|
100 | !! fr1_i0 , fr2_i0 = 1sr & 2nd fraction of qsr penetration in ice [%] |
---|
101 | !! emp_oce , emp_ice = E-P over ocean and sea ice [Kg/m2/s] |
---|
102 | !! sprecip = solid precipitation [Kg/m2/s] |
---|
103 | !! evap_ice = sublimation [Kg/m2/s] |
---|
104 | !! qsr_tot , qns_tot = solar & non solar heat flux (total) [W/m2] |
---|
105 | !! qsr_ice , qns_ice = solar & non solar heat flux over ice [W/m2] |
---|
106 | !! dqns_ice = non solar heat sensistivity [W/m2] |
---|
107 | !! qemp_oce, qemp_ice, qprec_ice, qevap_ice = sensible heat (associated with evap & precip) [W/m2] |
---|
108 | !! + some fields that are not used outside this module: |
---|
109 | !! qla_ice = latent heat flux over ice [W/m2] |
---|
110 | !! dqla_ice = latent heat sensistivity [W/m2] |
---|
111 | !! tprecip = total precipitation [Kg/m2/s] |
---|
112 | !! alb_ice = albedo above sea ice |
---|
113 | !!--------------------------------------------------------------------- |
---|
114 | INTEGER, INTENT(in) :: kt ! ocean time step |
---|
115 | INTEGER, INTENT(in) :: ksbc ! flux formulation (user defined, bulk or Pure Coupled) |
---|
116 | ! |
---|
117 | INTEGER :: ji, jj, jl ! dummy loop index |
---|
118 | REAL(wp), DIMENSION(jpi,jpj,jpl) :: zalb_os, zalb_cs ! ice albedo under overcast/clear sky |
---|
119 | REAL(wp), DIMENSION(jpi,jpj) :: zalb ! 2D workspace |
---|
120 | !!---------------------------------------------------------------------- |
---|
121 | ! |
---|
122 | IF( nn_timing == 1 ) CALL timing_start('ice_forcing_flx') |
---|
123 | |
---|
124 | IF( kt == nit000 .AND. lwp ) THEN |
---|
125 | WRITE(numout,*) |
---|
126 | WRITE(numout,*)'ice_forcing_flx' |
---|
127 | WRITE(numout,*)'~~~~~~~~~~~~~~~' |
---|
128 | ENDIF |
---|
129 | |
---|
130 | ! --- cloud-sky and overcast-sky ice albedos --- ! |
---|
131 | CALL ice_alb( t_su, ht_i, ht_s, a_ip_frac, h_ip, ln_pnd_rad, zalb_cs, zalb_os ) |
---|
132 | |
---|
133 | ! albedo depends on cloud fraction because of non-linear spectral effects |
---|
134 | DO jl = 1, jpl |
---|
135 | DO jj = 2, jpjm1 |
---|
136 | DO ji = 2, jpim1 |
---|
137 | !!gm cldf_ice is a real, DOCTOR naming rule: start with cd means CHARACTER passed in argument ! |
---|
138 | alb_ice(ji,jj,jl) = ( 1. - cldf_ice ) * zalb_cs(ji,jj,jl) + cldf_ice * zalb_os(ji,jj,jl) |
---|
139 | END DO |
---|
140 | END DO |
---|
141 | END DO |
---|
142 | CALL lbc_lnk( alb_ice, 'T', 1. ) |
---|
143 | |
---|
144 | SELECT CASE( ksbc ) !== fluxes over sea ice ==! |
---|
145 | ! |
---|
146 | CASE( jp_usr ) !--- user defined formulation |
---|
147 | CALL usrdef_sbc_ice_flx( kt ) |
---|
148 | ! |
---|
149 | CASE( jp_blk ) !--- bulk formulation |
---|
150 | CALL blk_ice_flx( t_su, alb_ice ) ! |
---|
151 | IF( ln_mixcpl ) CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su ) |
---|
152 | IF( nn_limflx /= 2 ) CALL ice_flx_dist( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_limflx ) |
---|
153 | ! |
---|
154 | CASE ( jp_purecpl ) !--- coupled formulation |
---|
155 | CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su ) |
---|
156 | IF( nn_limflx == 2 ) CALL ice_flx_dist( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_limflx ) |
---|
157 | ! |
---|
158 | END SELECT |
---|
159 | |
---|
160 | IF( iom_use('icealb') ) THEN !--- output ice albedo |
---|
161 | WHERE( at_i_b <= epsi06 ) ; zalb(:,:) = rn_alb_oce |
---|
162 | ELSEWHERE ; zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) / at_i_b |
---|
163 | END WHERE |
---|
164 | CALL iom_put( "icealb" , zalb(:,:) ) ! ice albedo |
---|
165 | ENDIF |
---|
166 | |
---|
167 | IF( iom_use('albedo') ) THEN !--- surface albedo |
---|
168 | zalb(:,:) = SUM( alb_ice * a_i_b, dim=3 ) + rn_alb_oce * ( 1._wp - at_i_b ) |
---|
169 | CALL iom_put( "albedo" , zalb(:,:) ) |
---|
170 | ENDIF |
---|
171 | ! |
---|
172 | IF( nn_timing == 1 ) CALL timing_stop('ice_forcing_flx') |
---|
173 | ! |
---|
174 | END SUBROUTINE ice_forcing_flx |
---|
175 | |
---|
176 | |
---|
177 | SUBROUTINE ice_flx_dist( ptn_ice, palb_ice, pqns_ice, pqsr_ice, pdqn_ice, pevap_ice, pdevap_ice, k_limflx ) |
---|
178 | !!--------------------------------------------------------------------- |
---|
179 | !! *** ROUTINE ice_flx_dist *** |
---|
180 | !! |
---|
181 | !! ** Purpose : update the ice surface boundary condition by averaging |
---|
182 | !! and/or redistributing fluxes on ice categories |
---|
183 | !! |
---|
184 | !! ** Method : average then redistribute |
---|
185 | !! |
---|
186 | !! ** Action : |
---|
187 | !!--------------------------------------------------------------------- |
---|
188 | INTEGER , INTENT(in ) :: k_limflx ! =-1 do nothing; =0 average ; |
---|
189 | ! ! = 1 average and redistribute ; =2 redistribute |
---|
190 | REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: ptn_ice ! ice surface temperature |
---|
191 | REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: palb_ice ! ice albedo |
---|
192 | REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pqns_ice ! non solar flux |
---|
193 | REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pqsr_ice ! net solar flux |
---|
194 | REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pdqn_ice ! non solar flux sensitivity |
---|
195 | REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pevap_ice ! sublimation |
---|
196 | REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: pdevap_ice ! sublimation sensitivity |
---|
197 | ! |
---|
198 | INTEGER :: jl ! dummy loop index |
---|
199 | ! |
---|
200 | REAL(wp), DIMENSION(jpi,jpj) :: zalb_m ! Mean albedo over all categories |
---|
201 | REAL(wp), DIMENSION(jpi,jpj) :: ztem_m ! Mean temperature over all categories |
---|
202 | ! |
---|
203 | REAL(wp), DIMENSION(jpi,jpj) :: z_qsr_m ! Mean solar heat flux over all categories |
---|
204 | REAL(wp), DIMENSION(jpi,jpj) :: z_qns_m ! Mean non solar heat flux over all categories |
---|
205 | REAL(wp), DIMENSION(jpi,jpj) :: z_evap_m ! Mean sublimation over all categories |
---|
206 | REAL(wp), DIMENSION(jpi,jpj) :: z_dqn_m ! Mean d(qns)/dT over all categories |
---|
207 | REAL(wp), DIMENSION(jpi,jpj) :: z_devap_m ! Mean d(evap)/dT over all categories |
---|
208 | !!---------------------------------------------------------------------- |
---|
209 | ! |
---|
210 | IF( nn_timing == 1 ) CALL timing_start('ice_flx_dist') |
---|
211 | ! |
---|
212 | SELECT CASE( k_limflx ) !== averaged on all ice categories ==! |
---|
213 | ! |
---|
214 | CASE( 0 , 1 ) |
---|
215 | z_qns_m (:,:) = fice_ice_ave( pqns_ice (:,:,:) ) |
---|
216 | z_qsr_m (:,:) = fice_ice_ave( pqsr_ice (:,:,:) ) |
---|
217 | z_dqn_m (:,:) = fice_ice_ave( pdqn_ice (:,:,:) ) |
---|
218 | z_evap_m (:,:) = fice_ice_ave( pevap_ice (:,:,:) ) |
---|
219 | z_devap_m(:,:) = fice_ice_ave( pdevap_ice(:,:,:) ) |
---|
220 | !!gm faster coding |
---|
221 | ! REAL(wp), DIMENSION(jpi,jpj) :: z1_at_i ! |
---|
222 | ! ... |
---|
223 | ! WHERE ( at_i (:,:) > 0._wp ) ; z1_at_i(:,:) = 1._wp / at_i (:,:) |
---|
224 | ! ELSEWHERE ; z1_at_i(:,:) = 0._wp |
---|
225 | ! END WHERE |
---|
226 | ! z_qns_m (:,:) = SUM( a_i(:,:,:) * pqns_ice (:,:,:) , dim=3 ) * z1_at_i(:,:) |
---|
227 | ! z_qsr_m (:,:) = SUM( a_i(:,:,:) * pqsr_ice (:,:,:) , dim=3 ) * z1_at_i(:,:) |
---|
228 | ! z_dqn_m (:,:) = SUM( a_i(:,:,:) * pdqn_ice (:,:,:) , dim=3 ) * z1_at_i(:,:) |
---|
229 | ! z_evap_m (:,:) = SUM( a_i(:,:,:) * pevap_ice (:,:,:) , dim=3 ) * z1_at_i(:,:) |
---|
230 | ! z_devap_m(:,:) = SUM( a_i(:,:,:) * pdevap_ice(:,:,:) , dim=3 ) * z1_at_i(:,:) |
---|
231 | !! and remove the 2 functions: fice_ice_ave and fice_cell_ave |
---|
232 | !!gm |
---|
233 | DO jl = 1, jpl |
---|
234 | pdqn_ice (:,:,jl) = z_dqn_m (:,:) |
---|
235 | pdevap_ice(:,:,jl) = z_devap_m(:,:) |
---|
236 | pqns_ice (:,:,jl) = z_qns_m (:,:) |
---|
237 | pqsr_ice (:,:,jl) = z_qsr_m (:,:) |
---|
238 | pevap_ice (:,:,jl) = z_evap_m(:,:) |
---|
239 | END DO |
---|
240 | ! |
---|
241 | END SELECT |
---|
242 | ! |
---|
243 | SELECT CASE( k_limflx ) !== redistribution on all ice categories ==! |
---|
244 | CASE( 1 , 2 ) |
---|
245 | ! |
---|
246 | zalb_m(:,:) = fice_ice_ave( palb_ice(:,:,:) ) |
---|
247 | ztem_m(:,:) = fice_ice_ave( ptn_ice (:,:,:) ) |
---|
248 | DO jl = 1, jpl |
---|
249 | pqns_ice (:,:,jl) = pqns_ice (:,:,jl) + pdqn_ice (:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) ) |
---|
250 | pevap_ice(:,:,jl) = pevap_ice(:,:,jl) + pdevap_ice(:,:,jl) * ( ptn_ice(:,:,jl) - ztem_m(:,:) ) |
---|
251 | pqsr_ice (:,:,jl) = pqsr_ice (:,:,jl) * ( 1._wp - palb_ice(:,:,jl) ) / ( 1._wp - zalb_m(:,:) ) |
---|
252 | END DO |
---|
253 | ! |
---|
254 | END SELECT |
---|
255 | ! |
---|
256 | IF( nn_timing == 1 ) CALL timing_stop('ice_flx_dist') |
---|
257 | ! |
---|
258 | END SUBROUTINE ice_flx_dist |
---|
259 | |
---|
260 | !!gm TO BE REMOVED ====>>>>> |
---|
261 | FUNCTION fice_cell_ave ( ptab ) |
---|
262 | !!-------------------------------------------------------------------------- |
---|
263 | !! * Compute average over categories, for grid cell (ice covered and free ocean) |
---|
264 | !!-------------------------------------------------------------------------- |
---|
265 | REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(in) :: ptab |
---|
266 | REAL(wp), DIMENSION(jpi,jpj) :: fice_cell_ave |
---|
267 | INTEGER :: jl |
---|
268 | !!-------------------------------------------------------------------------- |
---|
269 | fice_cell_ave(:,:) = a_i(:,:,1) * ptab (:,:,1) |
---|
270 | DO jl = 2, jpl |
---|
271 | fice_cell_ave(:,:) = fice_cell_ave(:,:) + a_i(:,:,jl) * ptab (:,:,jl) |
---|
272 | END DO |
---|
273 | END FUNCTION fice_cell_ave |
---|
274 | |
---|
275 | |
---|
276 | FUNCTION fice_ice_ave ( ptab ) |
---|
277 | !!-------------------------------------------------------------------------- |
---|
278 | !! * Compute average over categories, for ice covered part of grid cell |
---|
279 | !!-------------------------------------------------------------------------- |
---|
280 | REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(in) :: ptab ! |
---|
281 | REAL(wp), DIMENSION(jpi,jpj) :: fice_ice_ave |
---|
282 | !!-------------------------------------------------------------------------- |
---|
283 | WHERE ( at_i (:,:) > 0.0_wp ) ; fice_ice_ave (:,:) = fice_cell_ave( ptab (:,:,:) ) / at_i (:,:) |
---|
284 | ELSEWHERE ; fice_ice_ave (:,:) = 0.0_wp |
---|
285 | END WHERE |
---|
286 | END FUNCTION fice_ice_ave |
---|
287 | |
---|
288 | !!gm <<<<<<==== end of TO BE REMOVED |
---|
289 | |
---|
290 | #else |
---|
291 | !!---------------------------------------------------------------------- |
---|
292 | !! Default option : Empty module NO LIM sea-ice model |
---|
293 | !!---------------------------------------------------------------------- |
---|
294 | #endif |
---|
295 | |
---|
296 | !!====================================================================== |
---|
297 | END MODULE iceforcing |
---|