[8586] | 1 | MODULE bdyice |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE bdyice *** |
---|
[9656] | 4 | !! Unstructured Open Boundary Cond. : Open boundary conditions for sea-ice (SI3) |
---|
[8586] | 5 | !!====================================================================== |
---|
| 6 | !! History : 3.3 ! 2010-09 (D. Storkey) Original code |
---|
[9656] | 7 | !! 3.4 ! 2012-01 (C. Rousset) add new sea ice model |
---|
| 8 | !! 4.0 ! 2018 (C. Rousset) SI3 compatibility |
---|
[8586] | 9 | !!---------------------------------------------------------------------- |
---|
[9570] | 10 | #if defined key_si3 |
---|
[8586] | 11 | !!---------------------------------------------------------------------- |
---|
[9656] | 12 | !! 'key_si3' SI3 sea ice model |
---|
[8586] | 13 | !!---------------------------------------------------------------------- |
---|
| 14 | !! bdy_ice : Application of open boundaries to ice |
---|
| 15 | !! bdy_ice_frs : Application of Flow Relaxation Scheme |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
| 17 | USE oce ! ocean dynamics and tracers variables |
---|
[8637] | 18 | USE ice ! sea-ice: variables |
---|
| 19 | USE icevar ! sea-ice: operations |
---|
[9880] | 20 | USE icecor ! sea-ice: corrections |
---|
[8637] | 21 | USE icectl ! sea-ice: control prints |
---|
[8586] | 22 | USE phycst ! physical constant |
---|
| 23 | USE eosbn2 ! equation of state |
---|
| 24 | USE par_oce ! ocean parameters |
---|
| 25 | USE dom_oce ! ocean space and time domain variables |
---|
| 26 | USE sbc_oce ! Surface boundary condition: ocean fields |
---|
| 27 | USE bdy_oce ! ocean open boundary conditions |
---|
| 28 | ! |
---|
| 29 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 30 | USE in_out_manager ! write to numout file |
---|
| 31 | USE lib_mpp ! distributed memory computing |
---|
| 32 | USE lib_fortran ! to use key_nosignedzero |
---|
| 33 | USE timing ! Timing |
---|
| 34 | |
---|
| 35 | IMPLICIT NONE |
---|
| 36 | PRIVATE |
---|
| 37 | |
---|
| 38 | PUBLIC bdy_ice ! routine called in sbcmod |
---|
[9656] | 39 | PUBLIC bdy_ice_dyn ! routine called in icedyn_rhg_evp |
---|
[8586] | 40 | |
---|
| 41 | !!---------------------------------------------------------------------- |
---|
[9598] | 42 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[10069] | 43 | !! $Id$ |
---|
[10068] | 44 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[8586] | 45 | !!---------------------------------------------------------------------- |
---|
| 46 | CONTAINS |
---|
| 47 | |
---|
| 48 | SUBROUTINE bdy_ice( kt ) |
---|
| 49 | !!---------------------------------------------------------------------- |
---|
| 50 | !! *** SUBROUTINE bdy_ice *** |
---|
| 51 | !! |
---|
[9890] | 52 | !! ** Purpose : Apply open boundary conditions for sea ice |
---|
[8586] | 53 | !! |
---|
| 54 | !!---------------------------------------------------------------------- |
---|
| 55 | INTEGER, INTENT(in) :: kt ! Main time step counter |
---|
| 56 | ! |
---|
[11191] | 57 | INTEGER :: jbdy, ir ! BDY set index, rim index |
---|
| 58 | INTEGER :: ibeg, iend ! length of rim to be treated (rim 0 or rim 1) |
---|
| 59 | LOGICAL :: llrim0 ! indicate if rim 0 is treated |
---|
| 60 | LOGICAL, DIMENSION(4) :: llsend1, llrecv1 ! indicate how communications are to be carried out |
---|
[8586] | 61 | !!---------------------------------------------------------------------- |
---|
[11042] | 62 | ! controls |
---|
| 63 | IF( ln_timing ) CALL timing_start('bdy_ice_thd') ! timing |
---|
| 64 | IF( ln_icediachk ) CALL ice_cons_hsm(0,'bdy_ice_thd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation |
---|
[8586] | 65 | ! |
---|
| 66 | CALL ice_var_glo2eqv |
---|
| 67 | ! |
---|
[11191] | 68 | DO ir = 1, 0, -1 ! treat rim 1 before rim 0 |
---|
| 69 | IF( ir == 0 ) THEN ; llrim0 = .TRUE. |
---|
| 70 | ELSE ; llrim0 = .FALSE. |
---|
| 71 | END IF |
---|
| 72 | DO jbdy = 1, nb_bdy |
---|
| 73 | ! |
---|
| 74 | SELECT CASE( cn_ice(jbdy) ) |
---|
| 75 | CASE('none') ; CYCLE |
---|
| 76 | CASE('frs' ) ; CALL bdy_ice_frs( idx_bdy(jbdy), dta_bdy(jbdy), kt, jbdy, llrim0 ) |
---|
| 77 | CASE DEFAULT |
---|
| 78 | CALL ctl_stop( 'bdy_ice : unrecognised option for open boundaries for ice fields' ) |
---|
| 79 | END SELECT |
---|
| 80 | ! |
---|
| 81 | END DO |
---|
[8586] | 82 | ! |
---|
[11191] | 83 | ! Update bdy points |
---|
| 84 | llsend1(:) = .false. |
---|
| 85 | llrecv1(:) = .false. |
---|
| 86 | DO jbdy = 1, nb_bdy |
---|
| 87 | IF( cn_ice(jbdy) == 'frs' ) THEN |
---|
| 88 | llsend1(:) = llsend1(:) .OR. lsend_bdyint(jbdy,1,:,ir) ! possibly every direction, T points |
---|
| 89 | llrecv1(:) = llrecv1(:) .OR. lrecv_bdyint(jbdy,1,:,ir) ! possibly every direction, T points |
---|
| 90 | END IF |
---|
| 91 | END DO ! jbdy |
---|
| 92 | IF( ANY(llsend1) .OR. ANY(llrecv1) ) THEN ! if need to send/recv in at least one direction |
---|
| 93 | ! exchange 3d arrays |
---|
| 94 | CALL lbc_bdy_lnk_multi( 'bdyice', llsend1, llrecv1, a_i , 'T', 1., h_i , 'T', 1., h_s , 'T', 1. & |
---|
| 95 | & , oa_i, 'T', 1., a_ip, 'T', 1., v_ip, 'T', 1. & |
---|
| 96 | & , s_i , 'T', 1., t_su, 'T', 1., v_i , 'T', 1. & |
---|
| 97 | & , v_s , 'T', 1., sv_i, 'T', 1. ) |
---|
| 98 | ! exchange 4d arrays |
---|
| 99 | CALL lbc_bdy_lnk_multi( 'bdyice', llsend1, llrecv1, t_s , 'T', 1., e_s , 'T', 1. ) ! third dimension = 1 |
---|
| 100 | CALL lbc_bdy_lnk_multi( 'bdyice', llsend1, llrecv1, t_i , 'T', 1., e_i , 'T', 1. ) ! third dimension = jpk |
---|
[11067] | 101 | END IF |
---|
[11191] | 102 | END DO ! ir |
---|
[11067] | 103 | ! |
---|
[9880] | 104 | CALL ice_cor( kt , 0 ) ! -- In case categories are out of bounds, do a remapping |
---|
[9885] | 105 | ! ! i.e. inputs have not the same ice thickness distribution (set by rn_himean) |
---|
| 106 | ! ! than the regional simulation |
---|
[9124] | 107 | CALL ice_var_agg(1) |
---|
| 108 | ! |
---|
[11042] | 109 | ! controls |
---|
| 110 | IF( ln_icediachk ) CALL ice_cons_hsm(1,'bdy_ice_thd', rdiag_v, rdiag_s, rdiag_t, rdiag_fv, rdiag_fs, rdiag_ft) ! conservation |
---|
| 111 | IF( ln_icectl ) CALL ice_prt ( kt, iiceprt, jiceprt, 1, ' - ice thermo bdy - ' ) ! prints |
---|
| 112 | IF( ln_timing ) CALL timing_stop ('bdy_ice_thd') ! timing |
---|
[8586] | 113 | ! |
---|
| 114 | END SUBROUTINE bdy_ice |
---|
| 115 | |
---|
| 116 | |
---|
[11191] | 117 | SUBROUTINE bdy_ice_frs( idx, dta, kt, jbdy, llrim0 ) |
---|
[8586] | 118 | !!------------------------------------------------------------------------------ |
---|
| 119 | !! *** SUBROUTINE bdy_ice_frs *** |
---|
| 120 | !! |
---|
[9890] | 121 | !! ** Purpose : Apply the Flow Relaxation Scheme for sea-ice fields |
---|
[8586] | 122 | !! |
---|
| 123 | !! Reference : Engedahl H., 1995: Use of the flow relaxation scheme in a three- |
---|
| 124 | !! dimensional baroclinic ocean model with realistic topography. Tellus, 365-382. |
---|
| 125 | !!------------------------------------------------------------------------------ |
---|
[11191] | 126 | TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices |
---|
| 127 | TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data |
---|
| 128 | INTEGER, INTENT(in) :: kt ! main time-step counter |
---|
| 129 | INTEGER, INTENT(in) :: jbdy ! BDY set index |
---|
| 130 | LOGICAL, INTENT(in) :: llrim0 ! indicate if rim 0 is treated |
---|
[8586] | 131 | ! |
---|
| 132 | INTEGER :: jpbound ! 0 = incoming ice |
---|
| 133 | ! ! 1 = outgoing ice |
---|
[11191] | 134 | INTEGER :: ibeg, iend ! length of rim to be treated (rim 0 or rim 1) |
---|
[9890] | 135 | INTEGER :: i_bdy, jgrd ! dummy loop indices |
---|
| 136 | INTEGER :: ji, jj, jk, jl, ib, jb |
---|
[8586] | 137 | REAL(wp) :: zwgt, zwgt1 ! local scalar |
---|
| 138 | REAL(wp) :: ztmelts, zdh |
---|
[11048] | 139 | REAL(wp), POINTER :: flagu, flagv ! short cuts |
---|
[8586] | 140 | !!------------------------------------------------------------------------------ |
---|
| 141 | ! |
---|
| 142 | jgrd = 1 ! Everything is at T-points here |
---|
[11191] | 143 | IF( llrim0 ) THEN ; ibeg = 1 ; iend = idx%nblenrim0(jgrd) |
---|
| 144 | ELSE ; ibeg = idx%nblenrim0(jgrd)+1 ; iend = idx%nblenrim(jgrd) |
---|
| 145 | END IF |
---|
[8586] | 146 | ! |
---|
| 147 | DO jl = 1, jpl |
---|
[11191] | 148 | DO i_bdy = ibeg, iend |
---|
[9890] | 149 | ji = idx%nbi(i_bdy,jgrd) |
---|
| 150 | jj = idx%nbj(i_bdy,jgrd) |
---|
| 151 | zwgt = idx%nbw(i_bdy,jgrd) |
---|
| 152 | zwgt1 = 1.e0 - idx%nbw(i_bdy,jgrd) |
---|
| 153 | a_i(ji,jj,jl) = ( a_i(ji,jj,jl) * zwgt1 + dta%a_i(i_bdy,jl) * zwgt ) * tmask(ji,jj,1) ! Leads fraction |
---|
| 154 | h_i(ji,jj,jl) = ( h_i(ji,jj,jl) * zwgt1 + dta%h_i(i_bdy,jl) * zwgt ) * tmask(ji,jj,1) ! Ice depth |
---|
| 155 | h_s(ji,jj,jl) = ( h_s(ji,jj,jl) * zwgt1 + dta%h_s(i_bdy,jl) * zwgt ) * tmask(ji,jj,1) ! Snow depth |
---|
[8586] | 156 | |
---|
| 157 | ! ----------------- |
---|
| 158 | ! Pathological case |
---|
| 159 | ! ----------------- |
---|
| 160 | ! In case a) snow load would be in excess or b) ice is coming into a warmer environment that would lead to |
---|
| 161 | ! very large transformation from snow to ice (see icethd_dh.F90) |
---|
| 162 | |
---|
| 163 | ! Then, a) transfer the snow excess into the ice (different from icethd_dh) |
---|
[9935] | 164 | zdh = MAX( 0._wp, ( rhos * h_s(ji,jj,jl) + ( rhoi - rau0 ) * h_i(ji,jj,jl) ) * r1_rau0 ) |
---|
[8586] | 165 | ! Or, b) transfer all the snow into ice (if incoming ice is likely to melt as it comes into a warmer environment) |
---|
[9935] | 166 | !zdh = MAX( 0._wp, h_s(ji,jj,jl) * rhos / rhoi ) |
---|
[8586] | 167 | |
---|
| 168 | ! recompute h_i, h_s |
---|
| 169 | h_i(ji,jj,jl) = MIN( hi_max(jl), h_i(ji,jj,jl) + zdh ) |
---|
[9935] | 170 | h_s(ji,jj,jl) = MAX( 0._wp, h_s(ji,jj,jl) - zdh * rhoi / rhos ) |
---|
[8586] | 171 | |
---|
| 172 | ENDDO |
---|
| 173 | ENDDO |
---|
| 174 | |
---|
| 175 | DO jl = 1, jpl |
---|
[11191] | 176 | DO i_bdy = ibeg, iend |
---|
[9890] | 177 | ji = idx%nbi(i_bdy,jgrd) |
---|
| 178 | jj = idx%nbj(i_bdy,jgrd) |
---|
[11048] | 179 | flagu => idx%flagu(i_bdy,jgrd) |
---|
| 180 | flagv => idx%flagv(i_bdy,jgrd) |
---|
[8586] | 181 | ! condition on ice thickness depends on the ice velocity |
---|
| 182 | ! if velocity is outward (strictly), then ice thickness, volume... must be equal to adjacent values |
---|
[9890] | 183 | jpbound = 0 ; ib = ji ; jb = jj |
---|
[8586] | 184 | ! |
---|
[11049] | 185 | IF( flagu == 1. ) THEN |
---|
[11071] | 186 | IF( ji+1 > jpi ) CYCLE |
---|
[11049] | 187 | IF( u_ice(ji ,jj ) < 0. ) jpbound = 1 ; ib = ji+1 |
---|
| 188 | END IF |
---|
| 189 | IF( flagu == -1. ) THEN |
---|
[11071] | 190 | IF( ji-1 < 1 ) CYCLE |
---|
[11049] | 191 | IF( u_ice(ji-1,jj ) < 0. ) jpbound = 1 ; ib = ji-1 |
---|
| 192 | END IF |
---|
| 193 | IF( flagv == 1. ) THEN |
---|
[11071] | 194 | IF( jj+1 > jpj ) CYCLE |
---|
[11049] | 195 | IF( v_ice(ji ,jj ) < 0. ) jpbound = 1 ; jb = jj+1 |
---|
| 196 | END IF |
---|
| 197 | IF( flagv == -1. ) THEN |
---|
| 198 | IF( jj-1 < 1 ) CYCLE |
---|
| 199 | IF( v_ice(ji ,jj-1) < 0. ) jpbound = 1 ; jb = jj-1 |
---|
| 200 | END IF |
---|
[8586] | 201 | ! |
---|
[9890] | 202 | IF( nn_ice_dta(jbdy) == 0 ) jpbound = 0 ; ib = ji ; jb = jj ! case ice boundaries = initial conditions |
---|
| 203 | ! ! do not make state variables dependent on velocity |
---|
[8586] | 204 | ! |
---|
[9890] | 205 | IF( a_i(ib,jb,jl) > 0._wp ) THEN ! there is ice at the boundary |
---|
[8586] | 206 | ! |
---|
[9890] | 207 | a_i(ji,jj,jl) = a_i(ib,jb,jl) ! concentration |
---|
| 208 | h_i(ji,jj,jl) = h_i(ib,jb,jl) ! thickness ice |
---|
| 209 | h_s(ji,jj,jl) = h_s(ib,jb,jl) ! thickness snw |
---|
[8586] | 210 | ! |
---|
[9888] | 211 | SELECT CASE( jpbound ) |
---|
| 212 | ! |
---|
| 213 | CASE( 0 ) ! velocity is inward |
---|
| 214 | ! |
---|
[9890] | 215 | oa_i(ji,jj, jl) = rn_ice_age(jbdy) * a_i(ji,jj,jl) ! age |
---|
| 216 | a_ip(ji,jj, jl) = 0._wp ! pond concentration |
---|
| 217 | v_ip(ji,jj, jl) = 0._wp ! pond volume |
---|
| 218 | t_su(ji,jj, jl) = rn_ice_tem(jbdy) ! temperature surface |
---|
| 219 | t_s (ji,jj,:,jl) = rn_ice_tem(jbdy) ! temperature snw |
---|
| 220 | t_i (ji,jj,:,jl) = rn_ice_tem(jbdy) ! temperature ice |
---|
| 221 | s_i (ji,jj, jl) = rn_ice_sal(jbdy) ! salinity |
---|
| 222 | sz_i(ji,jj,:,jl) = rn_ice_sal(jbdy) ! salinity profile |
---|
[9888] | 223 | ! |
---|
| 224 | CASE( 1 ) ! velocity is outward |
---|
| 225 | ! |
---|
[9890] | 226 | oa_i(ji,jj, jl) = oa_i(ib,jb, jl) ! age |
---|
| 227 | a_ip(ji,jj, jl) = a_ip(ib,jb, jl) ! pond concentration |
---|
| 228 | v_ip(ji,jj, jl) = v_ip(ib,jb, jl) ! pond volume |
---|
| 229 | t_su(ji,jj, jl) = t_su(ib,jb, jl) ! temperature surface |
---|
| 230 | t_s (ji,jj,:,jl) = t_s (ib,jb,:,jl) ! temperature snw |
---|
| 231 | t_i (ji,jj,:,jl) = t_i (ib,jb,:,jl) ! temperature ice |
---|
| 232 | s_i (ji,jj, jl) = s_i (ib,jb, jl) ! salinity |
---|
| 233 | sz_i(ji,jj,:,jl) = sz_i(ib,jb,:,jl) ! salinity profile |
---|
[9888] | 234 | ! |
---|
| 235 | END SELECT |
---|
[9885] | 236 | ! |
---|
[9888] | 237 | IF( nn_icesal == 1 ) THEN ! if constant salinity |
---|
| 238 | s_i (ji,jj ,jl) = rn_icesal |
---|
| 239 | sz_i(ji,jj,:,jl) = rn_icesal |
---|
| 240 | ENDIF |
---|
[8586] | 241 | ! |
---|
[9888] | 242 | ! global fields |
---|
| 243 | v_i (ji,jj,jl) = h_i(ji,jj,jl) * a_i(ji,jj,jl) ! volume ice |
---|
| 244 | v_s (ji,jj,jl) = h_s(ji,jj,jl) * a_i(ji,jj,jl) ! volume snw |
---|
| 245 | sv_i(ji,jj,jl) = MIN( s_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) ! salt content |
---|
[8586] | 246 | DO jk = 1, nlay_s |
---|
[9935] | 247 | e_s(ji,jj,jk,jl) = rhos * ( rcpi * ( rt0 - t_s(ji,jj,jk,jl) ) + rLfus ) ! enthalpy in J/m3 |
---|
[9888] | 248 | e_s(ji,jj,jk,jl) = e_s(ji,jj,jk,jl) * v_s(ji,jj,jl) * r1_nlay_s ! enthalpy in J/m2 |
---|
| 249 | END DO |
---|
[8586] | 250 | DO jk = 1, nlay_i |
---|
[9935] | 251 | ztmelts = - rTmlt * sz_i(ji,jj,jk,jl) ! Melting temperature in C |
---|
[9888] | 252 | t_i(ji,jj,jk,jl) = MIN( t_i(ji,jj,jk,jl), ztmelts + rt0 ) ! Force t_i to be lower than melting point => likely conservation issue |
---|
| 253 | ! |
---|
[9935] | 254 | e_i(ji,jj,jk,jl) = rhoi * ( rcpi * ( ztmelts - ( t_i(ji,jj,jk,jl) - rt0 ) ) & ! enthalpy in J/m3 |
---|
| 255 | & + rLfus * ( 1._wp - ztmelts / ( t_i(ji,jj,jk,jl) - rt0 ) ) & |
---|
| 256 | & - rcp * ztmelts ) |
---|
[9888] | 257 | e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * v_i(ji,jj,jl) * r1_nlay_i ! enthalpy in J/m2 |
---|
[8586] | 258 | END DO |
---|
| 259 | ! |
---|
[9888] | 260 | ELSE ! no ice at the boundary |
---|
[9885] | 261 | ! |
---|
[9888] | 262 | a_i (ji,jj, jl) = 0._wp |
---|
| 263 | h_i (ji,jj, jl) = 0._wp |
---|
| 264 | h_s (ji,jj, jl) = 0._wp |
---|
| 265 | oa_i(ji,jj, jl) = 0._wp |
---|
| 266 | a_ip(ji,jj, jl) = 0._wp |
---|
| 267 | v_ip(ji,jj, jl) = 0._wp |
---|
| 268 | t_su(ji,jj, jl) = rt0 |
---|
| 269 | t_s (ji,jj,:,jl) = rt0 |
---|
| 270 | t_i (ji,jj,:,jl) = rt0 |
---|
| 271 | |
---|
| 272 | IF( nn_icesal == 1 ) THEN ! if constant salinity |
---|
| 273 | s_i (ji,jj ,jl) = rn_icesal |
---|
| 274 | sz_i(ji,jj,:,jl) = rn_icesal |
---|
| 275 | ELSE ! if variable salinity |
---|
| 276 | s_i (ji,jj,jl) = rn_simin |
---|
| 277 | sz_i(ji,jj,:,jl) = rn_simin |
---|
| 278 | ENDIF |
---|
| 279 | ! |
---|
| 280 | ! global fields |
---|
| 281 | v_i (ji,jj, jl) = 0._wp |
---|
| 282 | v_s (ji,jj, jl) = 0._wp |
---|
| 283 | sv_i(ji,jj, jl) = 0._wp |
---|
| 284 | e_s (ji,jj,:,jl) = 0._wp |
---|
| 285 | e_i (ji,jj,:,jl) = 0._wp |
---|
| 286 | |
---|
[8586] | 287 | ENDIF |
---|
[9888] | 288 | |
---|
[8586] | 289 | END DO |
---|
| 290 | ! |
---|
[9888] | 291 | END DO ! jl |
---|
[8586] | 292 | ! |
---|
| 293 | END SUBROUTINE bdy_ice_frs |
---|
| 294 | |
---|
| 295 | |
---|
| 296 | SUBROUTINE bdy_ice_dyn( cd_type ) |
---|
| 297 | !!------------------------------------------------------------------------------ |
---|
| 298 | !! *** SUBROUTINE bdy_ice_dyn *** |
---|
| 299 | !! |
---|
[9890] | 300 | !! ** Purpose : Apply dynamics boundary conditions for sea-ice. |
---|
[8586] | 301 | !! |
---|
[9890] | 302 | !! ** Method : if this adjacent grid point is not ice free, then u_ice and v_ice take its value |
---|
| 303 | !! if is ice free, then u_ice and v_ice are unchanged by BDY |
---|
| 304 | !! they keep values calculated in rheology |
---|
| 305 | !! |
---|
[8586] | 306 | !!------------------------------------------------------------------------------ |
---|
| 307 | CHARACTER(len=1), INTENT(in) :: cd_type ! nature of velocity grid-points |
---|
| 308 | ! |
---|
[11191] | 309 | INTEGER :: i_bdy, jgrd ! dummy loop indices |
---|
| 310 | INTEGER :: ji, jj ! local scalar |
---|
| 311 | INTEGER :: jbdy, ir ! BDY set index, rim index |
---|
| 312 | INTEGER :: ibeg, iend ! length of rim to be treated (rim 0 or rim 1) |
---|
[8586] | 313 | REAL(wp) :: zmsk1, zmsk2, zflag |
---|
[11071] | 314 | LOGICAL, DIMENSION(4) :: llsend2, llrecv2, llsend3, llrecv3 ! indicate how communications are to be carried out |
---|
[8586] | 315 | !!------------------------------------------------------------------------------ |
---|
[9905] | 316 | IF( ln_timing ) CALL timing_start('bdy_ice_dyn') |
---|
[8586] | 317 | ! |
---|
[11191] | 318 | DO ir = 1, 0, -1 |
---|
| 319 | DO jbdy = 1, nb_bdy |
---|
[8586] | 320 | ! |
---|
[11191] | 321 | SELECT CASE( cn_ice(jbdy) ) |
---|
| 322 | ! |
---|
| 323 | CASE('none') |
---|
| 324 | CYCLE |
---|
| 325 | ! |
---|
| 326 | CASE('frs') |
---|
| 327 | ! |
---|
| 328 | IF( nn_ice_dta(jbdy) == 0 ) CYCLE ! case ice boundaries = initial conditions |
---|
| 329 | ! ! do not change ice velocity (it is only computed by rheology) |
---|
| 330 | SELECT CASE ( cd_type ) |
---|
| 331 | ! |
---|
| 332 | CASE ( 'U' ) |
---|
| 333 | jgrd = 2 ! u velocity |
---|
| 334 | IF( ir == 0 ) THEN ; ibeg = 1 ; iend = idx_bdy(jbdy)%nblenrim0(jgrd) |
---|
| 335 | ELSE ; ibeg = idx_bdy(jbdy)%nblenrim0(jgrd)+1 ; iend = idx_bdy(jbdy)%nblenrim(jgrd) |
---|
[11048] | 336 | END IF |
---|
[11191] | 337 | DO i_bdy = ibeg, iend |
---|
| 338 | ji = idx_bdy(jbdy)%nbi(i_bdy,jgrd) |
---|
| 339 | jj = idx_bdy(jbdy)%nbj(i_bdy,jgrd) |
---|
| 340 | zflag = idx_bdy(jbdy)%flagu(i_bdy,jgrd) |
---|
| 341 | ! i-1 i i | ! i i i+1 | ! i i i+1 | |
---|
| 342 | ! > ice > | ! o > ice | ! o > o | |
---|
| 343 | ! => set at u_ice(i-1) ! => set to O ! => unchanged |
---|
| 344 | IF( zflag == -1. .AND. ji > 1 .AND. ji < jpi ) THEN |
---|
| 345 | IF ( vt_i(ji ,jj) > 0. ) THEN ; u_ice(ji,jj) = u_ice(ji-1,jj) |
---|
| 346 | ELSEIF( vt_i(ji+1,jj) > 0. ) THEN ; u_ice(ji,jj) = 0._wp |
---|
| 347 | END IF |
---|
[11048] | 348 | END IF |
---|
[11191] | 349 | ! | i i+1 i+1 ! | i i i+1 ! | i i i+1 |
---|
| 350 | ! | > ice > ! | ice > o ! | o > o |
---|
| 351 | ! => set at u_ice(i+1) ! => set to O ! => unchanged |
---|
| 352 | IF( zflag == 1. .AND. ji+1 < jpi+1 ) THEN |
---|
| 353 | IF ( vt_i(ji+1,jj) > 0. ) THEN ; u_ice(ji,jj) = u_ice(ji+1,jj) |
---|
| 354 | ELSEIF( vt_i(ji ,jj) > 0. ) THEN ; u_ice(ji,jj) = 0._wp |
---|
| 355 | END IF |
---|
| 356 | END IF |
---|
| 357 | ! |
---|
| 358 | IF( zflag == 0. ) u_ice(ji,jj) = 0._wp ! u_ice = 0 if north/south bdy |
---|
| 359 | ! |
---|
| 360 | END DO |
---|
| 361 | ! |
---|
| 362 | CASE ( 'V' ) |
---|
| 363 | jgrd = 3 ! v velocity |
---|
| 364 | IF( ir == 0 ) THEN ; ibeg = 1 ; iend = idx_bdy(jbdy)%nblenrim0(jgrd) |
---|
| 365 | ELSE ; ibeg = idx_bdy(jbdy)%nblenrim0(jgrd)+1 ; iend = idx_bdy(jbdy)%nblenrim(jgrd) |
---|
[11048] | 366 | END IF |
---|
[11191] | 367 | DO i_bdy = ibeg, iend |
---|
| 368 | ji = idx_bdy(jbdy)%nbi(i_bdy,jgrd) |
---|
| 369 | jj = idx_bdy(jbdy)%nbj(i_bdy,jgrd) |
---|
| 370 | zflag = idx_bdy(jbdy)%flagv(i_bdy,jgrd) |
---|
| 371 | ! ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ! ¨¨¨¨ïce¨¨¨(jj+1)¨¨ ! ¨¨¨¨¨¨ö¨¨¨¨(jj+1) |
---|
| 372 | ! ^ (jj ) ! ^ (jj ) ! ^ (jj ) |
---|
| 373 | ! ice (jj ) ! o (jj ) ! o (jj ) |
---|
| 374 | ! ^ (jj-1) ! ! |
---|
| 375 | ! => set to u_ice(jj-1) ! => set to 0 ! => unchanged |
---|
| 376 | IF( zflag == -1. .AND. jj > 1 .AND. jj < jpj ) THEN |
---|
| 377 | IF ( vt_i(ji,jj ) > 0. ) THEN ; v_ice(ji,jj) = v_ice(ji,jj-1) |
---|
| 378 | ELSEIF( vt_i(ji,jj+1) > 0. ) THEN ; v_ice(ji,jj) = 0._wp |
---|
| 379 | END IF |
---|
[11048] | 380 | END IF |
---|
[11191] | 381 | ! ^ (jj+1) ! ! |
---|
| 382 | ! ice (jj+1) ! o (jj+1) ! o (jj+1) |
---|
| 383 | ! ^ (jj ) ! ^ (jj ) ! ^ (jj ) |
---|
| 384 | ! ________________ ! ____ice___(jj )_ ! _____o____(jj ) |
---|
| 385 | ! => set to u_ice(jj+1) ! => set to 0 ! => unchanged |
---|
| 386 | IF( zflag == 1. .AND. jj < jpj ) THEN |
---|
| 387 | IF ( vt_i(ji,jj+1) > 0. ) THEN ; v_ice(ji,jj) = v_ice(ji,jj+1) |
---|
| 388 | ELSEIF( vt_i(ji,jj ) > 0. ) THEN ; v_ice(ji,jj) = 0._wp |
---|
| 389 | END IF |
---|
| 390 | END IF |
---|
| 391 | ! |
---|
| 392 | IF( zflag == 0. ) v_ice(ji,jj) = 0._wp ! v_ice = 0 if west/east bdy |
---|
| 393 | ! |
---|
| 394 | END DO |
---|
[8586] | 395 | ! |
---|
[11191] | 396 | END SELECT |
---|
[8586] | 397 | ! |
---|
[11191] | 398 | CASE DEFAULT |
---|
| 399 | CALL ctl_stop( 'bdy_ice_dyn : unrecognised option for open boundaries for ice fields' ) |
---|
[8586] | 400 | END SELECT |
---|
| 401 | ! |
---|
[11191] | 402 | END DO ! jbdy |
---|
[8586] | 403 | ! |
---|
[11191] | 404 | SELECT CASE ( cd_type ) |
---|
| 405 | CASE ( 'U' ) |
---|
| 406 | llsend2(:) = .false. ; llrecv2(:) = .false. |
---|
| 407 | DO jbdy = 1, nb_bdy |
---|
| 408 | IF( cn_ice(jbdy) == 'frs' .AND. nn_ice_dta(jbdy) /= 0 ) THEN |
---|
| 409 | llsend2(:) = llsend2(:) .OR. lsend_bdyint(jbdy,2,:,ir) ! possibly every direction, U points |
---|
| 410 | llsend2(1) = llsend2(1) .OR. lsend_bdyext(jbdy,2,1,ir) ! neighbour might search point towards its west bdy |
---|
| 411 | llrecv2(:) = llrecv2(:) .OR. lrecv_bdyint(jbdy,2,:,ir) ! possibly every direction, U points |
---|
| 412 | llrecv2(2) = llrecv2(2) .OR. lrecv_bdyext(jbdy,2,2,ir) ! might search point towards east bdy |
---|
| 413 | END IF |
---|
| 414 | END DO |
---|
| 415 | IF( ANY(llsend2) .OR. ANY(llrecv2) ) THEN ! if need to send/recv in at least one direction |
---|
| 416 | CALL lbc_bdy_lnk( 'bdyice', llsend2, llrecv2, u_ice, 'U', -1. ) |
---|
[11067] | 417 | END IF |
---|
[11191] | 418 | CASE ( 'V' ) |
---|
| 419 | llsend3(:) = .false. ; llrecv3(:) = .false. |
---|
| 420 | DO jbdy = 1, nb_bdy |
---|
| 421 | IF( cn_ice(jbdy) == 'frs' .AND. nn_ice_dta(jbdy) /= 0 ) THEN |
---|
| 422 | llsend3(:) = llsend3(:) .OR. lsend_bdyint(jbdy,3,:,ir) ! possibly every direction, V points |
---|
| 423 | llsend3(3) = llsend3(3) .OR. lsend_bdyext(jbdy,3,3,ir) ! neighbour might search point towards its south bdy |
---|
| 424 | llrecv3(:) = llrecv3(:) .OR. lrecv_bdyint(jbdy,3,:,ir) ! possibly every direction, V points |
---|
| 425 | llrecv3(4) = llrecv3(4) .OR. lrecv_bdyext(jbdy,3,4,ir) ! might search point towards north bdy |
---|
| 426 | END IF |
---|
| 427 | END DO |
---|
| 428 | IF( ANY(llsend3) .OR. ANY(llrecv3) ) THEN ! if need to send/recv in at least one direction |
---|
| 429 | CALL lbc_bdy_lnk( 'bdyice', llsend3, llrecv3, v_ice, 'V', -1. ) |
---|
[11067] | 430 | END IF |
---|
[11191] | 431 | END SELECT |
---|
| 432 | END DO ! ir |
---|
[11067] | 433 | ! |
---|
[9905] | 434 | IF( ln_timing ) CALL timing_stop('bdy_ice_dyn') |
---|
| 435 | ! |
---|
[8586] | 436 | END SUBROUTINE bdy_ice_dyn |
---|
| 437 | |
---|
| 438 | #else |
---|
| 439 | !!--------------------------------------------------------------------------------- |
---|
| 440 | !! Default option Empty module |
---|
| 441 | !!--------------------------------------------------------------------------------- |
---|
| 442 | CONTAINS |
---|
| 443 | SUBROUTINE bdy_ice( kt ) ! Empty routine |
---|
[9927] | 444 | IMPLICIT NONE |
---|
| 445 | INTEGER, INTENT( in ) :: kt |
---|
[8586] | 446 | WRITE(*,*) 'bdy_ice: You should not have seen this print! error?', kt |
---|
| 447 | END SUBROUTINE bdy_ice |
---|
| 448 | #endif |
---|
| 449 | |
---|
| 450 | !!================================================================================= |
---|
| 451 | END MODULE bdyice |
---|