Changeset 6020 for branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim.F90
- Timestamp:
- 2015-12-08T12:39:53+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/icebergs_restart_single_file/NEMOGCM/NEMO/OPA_SRC/BDY/bdyice_lim.F90
r6019 r6020 59 59 !! 60 60 !!---------------------------------------------------------------------- 61 INTEGER, INTENT( in ) :: kt ! Main time step counter 62 INTEGER :: ib_bdy ! Loop index 63 61 INTEGER, INTENT( in ) :: kt ! Main time step counter 62 ! 63 INTEGER :: ib_bdy ! Loop index 64 !!---------------------------------------------------------------------- 65 ! 64 66 #if defined key_lim3 65 67 CALL lim_var_glo2eqv 66 68 #endif 67 69 ! 68 70 DO ib_bdy=1, nb_bdy 69 71 ! 70 72 SELECT CASE( cn_ice_lim(ib_bdy) ) 71 73 CASE('none') … … 76 78 CALL ctl_stop( 'bdy_ice_lim : unrecognised option for open boundaries for ice fields' ) 77 79 END SELECT 78 80 ! 79 81 END DO 80 82 ! 81 83 #if defined key_lim3 82 84 CALL lim_var_zapsmall 83 85 CALL lim_var_agg(1) 84 86 #endif 85 87 ! 86 88 END SUBROUTINE bdy_ice_lim 89 87 90 88 91 SUBROUTINE bdy_ice_frs( idx, dta, kt, ib_bdy ) … … 96 99 !! dimensional baroclinic ocean model with realistic topography. Tellus, 365-382. 97 100 !!------------------------------------------------------------------------------ 98 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices99 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data100 INTEGER, INTENT(in) :: kt ! main time-step counter101 TYPE(OBC_INDEX), INTENT(in) :: idx ! OBC indices 102 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 103 INTEGER, INTENT(in) :: kt ! main time-step counter 101 104 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 102 105 ! 103 106 INTEGER :: jpbound ! 0 = incoming ice 104 107 ! ! 1 = outgoing ice 105 108 INTEGER :: jb, jk, jgrd, jl ! dummy loop indices 106 109 INTEGER :: ji, jj, ii, ij ! local scalar 107 110 REAL(wp) :: zwgt, zwgt1 ! local scalar 108 111 REAL(wp) :: ztmelts, zdh 109 110 !!------------------------------------------------------------------------------ 111 ! 112 IF( nn_timing == 1 ) CALL timing_start('bdy_ice_frs') 112 #if defined key_lim2 && ! defined key_lim2_vp && defined key_agrif 113 USE ice_2, vt_s => hsnm 114 USE ice_2, vt_i => hicm 115 #endif 116 !!------------------------------------------------------------------------------ 117 ! 118 IF( nn_timing == 1 ) CALL timing_start('bdy_ice_frs') 113 119 ! 114 120 jgrd = 1 ! Everything is at T-points here … … 177 183 ! condition on ice thickness depends on the ice velocity 178 184 ! if velocity is outward (strictly), then ice thickness, volume... must be equal to adjacent values 179 jpbound = 0 ; ii = ji; ij = jj;180 185 jpbound = 0 ; ii = ji ; ij = jj 186 ! 181 187 IF( u_ice(ji+1,jj ) < 0. .AND. umask(ji-1,jj ,1) == 0. ) jpbound = 1; ii = ji+1; ij = jj 182 188 IF( u_ice(ji-1,jj ) > 0. .AND. umask(ji+1,jj ,1) == 0. ) jpbound = 1; ii = ji-1; ij = jj 183 189 IF( v_ice(ji ,jj+1) < 0. .AND. vmask(ji ,jj-1,1) == 0. ) jpbound = 1; ii = ji ; ij = jj+1 184 190 IF( v_ice(ji ,jj-1) > 0. .AND. vmask(ji ,jj+1,1) == 0. ) jpbound = 1; ii = ji ; ij = jj-1 185 191 ! 186 192 IF( nn_ice_lim_dta(ib_bdy) == 0 ) jpbound = 0; ii = ji; ij = jj ! case ice boundaries = initial conditions 187 ! do not make state variables dependent on velocity 188 189 193 ! ! do not make state variables dependent on velocity 194 ! 190 195 rswitch = MAX( 0.0_wp , SIGN ( 1.0_wp , at_i(ii,ij) - 0.01 ) ) ! 0 if no ice 191 196 ! 192 197 ! concentration and thickness 193 198 a_i (ji,jj,jl) = a_i (ii,ij,jl) * rswitch 194 199 ht_i(ji,jj,jl) = ht_i(ii,ij,jl) * rswitch 195 200 ht_s(ji,jj,jl) = ht_s(ii,ij,jl) * rswitch 196 201 ! 197 202 ! Ice and snow volumes 198 203 v_i(ji,jj,jl) = ht_i(ji,jj,jl) * a_i(ji,jj,jl) 199 204 v_s(ji,jj,jl) = ht_s(ji,jj,jl) * a_i(ji,jj,jl) 200 205 ! 201 206 SELECT CASE( jpbound ) 202 203 CASE( 0 ) ! velocity is inward204 207 ! 208 CASE( 0 ) ! velocity is inward 209 ! 205 210 ! Ice salinity, age, temperature 206 211 sm_i(ji,jj,jl) = rswitch * rn_ice_sal(ib_bdy) + ( 1.0 - rswitch ) * rn_simin … … 214 219 s_i(ji,jj,jk,jl) = rswitch * rn_ice_sal(ib_bdy) + ( 1.0 - rswitch ) * rn_simin 215 220 END DO 216 217 CASE( 1 ) ! velocity is outward218 221 ! 222 CASE( 1 ) ! velocity is outward 223 ! 219 224 ! Ice salinity, age, temperature 220 225 sm_i(ji,jj,jl) = rswitch * sm_i(ii,ij,jl) + ( 1.0 - rswitch ) * rn_simin … … 228 233 s_i(ji,jj,jk,jl) = rswitch * s_i(ii,ij,jk,jl) + ( 1.0 - rswitch ) * rn_simin 229 234 END DO 230 235 ! 231 236 END SELECT 232 233 ! if salinity is constant, then overwrite rn_ice_sal 234 IF( nn_icesal == 1 ) THEN 235 sm_i(ji,jj,jl) = rn_icesal 237 ! 238 IF( nn_icesal == 1 ) THEN ! constant salinity : overwrite rn_ice_sal 239 sm_i(ji,jj ,jl) = rn_icesal 236 240 s_i (ji,jj,:,jl) = rn_icesal 237 241 ENDIF 238 242 ! 239 243 ! contents 240 244 smv_i(ji,jj,jl) = MIN( sm_i(ji,jj,jl) , sss_m(ji,jj) ) * v_i(ji,jj,jl) … … 255 259 e_i(ji,jj,jk,jl) = e_i(ji,jj,jk,jl) * a_i(ji,jj,jl) * ht_i(ji,jj,jl) * r1_nlay_i 256 260 END DO 257 261 ! 258 262 END DO 259 263 ! 260 264 CALL lbc_bdy_lnk( a_i(:,:,jl), 'T', 1., ib_bdy ) 261 265 CALL lbc_bdy_lnk( ht_i(:,:,jl), 'T', 1., ib_bdy ) … … 263 267 CALL lbc_bdy_lnk( v_i(:,:,jl), 'T', 1., ib_bdy ) 264 268 CALL lbc_bdy_lnk( v_s(:,:,jl), 'T', 1., ib_bdy ) 265 269 ! 266 270 CALL lbc_bdy_lnk( smv_i(:,:,jl), 'T', 1., ib_bdy ) 267 271 CALL lbc_bdy_lnk( sm_i(:,:,jl), 'T', 1., ib_bdy ) … … 276 280 CALL lbc_bdy_lnk(e_i(:,:,jk,jl), 'T', 1., ib_bdy ) 277 281 END DO 278 282 ! 279 283 END DO !jl 280 284 ! 281 285 #endif 282 286 ! 283 IF( nn_timing == 1 ) CALL timing_stop('bdy_ice_frs')287 IF( nn_timing == 1 ) CALL timing_stop('bdy_ice_frs') 284 288 ! 285 289 END SUBROUTINE bdy_ice_frs … … 296 300 !! 2013-06 : C. Rousset 297 301 !!------------------------------------------------------------------------------ 298 !!299 302 CHARACTER(len=1), INTENT(in) :: cd_type ! nature of velocity grid-points 303 ! 300 304 INTEGER :: jb, jgrd ! dummy loop indices 301 305 INTEGER :: ji, jj ! local scalar 302 306 INTEGER :: ib_bdy ! Loop index 303 307 REAL(wp) :: zmsk1, zmsk2, zflag 304 !!------------------------------------------------------------------------------308 !!------------------------------------------------------------------------------ 305 309 ! 306 310 IF( nn_timing == 1 ) CALL timing_start('bdy_ice_lim_dyn') … … 309 313 ! 310 314 SELECT CASE( cn_ice_lim(ib_bdy) ) 311 315 ! 312 316 CASE('none') 313 314 317 CYCLE 315 318 ! 316 319 CASE('frs') 317 320 ! 318 321 IF( nn_ice_lim_dta(ib_bdy) == 0 ) CYCLE ! case ice boundaries = initial conditions 319 ! do not change ice velocity (it is only computed by rheology) 320 322 ! ! do not change ice velocity (it is only computed by rheology) 321 323 SELECT CASE ( cd_type ) 322 323 CASE ( 'U' ) 324 324 ! 325 CASE ( 'U' ) 325 326 jgrd = 2 ! u velocity 326 327 DO jb = 1, idx_bdy(ib_bdy)%nblen(jgrd) … … 328 329 jj = idx_bdy(ib_bdy)%nbj(jb,jgrd) 329 330 zflag = idx_bdy(ib_bdy)%flagu(jb,jgrd) 330 331 ! 331 332 IF ( ABS( zflag ) == 1. ) THEN ! eastern and western boundaries 332 333 ! one of the two zmsk is always 0 (because of zflag) 333 334 zmsk1 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji+1,jj) ) ) ! 0 if no ice 334 335 zmsk2 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji-1,jj) ) ) ! 0 if no ice 335 336 ! 336 337 ! u_ice = u_ice of the adjacent grid point except if this grid point is ice-free (then u_ice = u_oce) 337 338 u_ice (ji,jj) = u_ice(ji+1,jj) * 0.5_wp * ABS( zflag + 1._wp ) * zmsk1 + & … … 345 346 rswitch = MAX( 0.0_wp , SIGN ( 1.0_wp , at_i(ji,jj) - 0.01_wp ) ) ! 0 if no ice 346 347 u_ice(ji,jj) = rswitch * u_ice(ji,jj) 347 348 ENDDO 349 348 ! 349 END DO 350 350 CALL lbc_bdy_lnk( u_ice(:,:), 'U', -1., ib_bdy ) 351 351 ! 352 352 CASE ( 'V' ) 353 354 353 jgrd = 3 ! v velocity 355 354 DO jb = 1, idx_bdy(ib_bdy)%nblen(jgrd) … … 357 356 jj = idx_bdy(ib_bdy)%nbj(jb,jgrd) 358 357 zflag = idx_bdy(ib_bdy)%flagv(jb,jgrd) 359 358 ! 360 359 IF ( ABS( zflag ) == 1. ) THEN ! northern and southern boundaries 361 360 ! one of the two zmsk is always 0 (because of zflag) 362 361 zmsk1 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji,jj+1) ) ) ! 0 if no ice 363 362 zmsk2 = 1._wp - MAX( 0.0_wp, SIGN ( 1.0_wp , - vt_i(ji,jj-1) ) ) ! 0 if no ice 364 363 ! 365 364 ! u_ice = u_ice of the adjacent grid point except if this grid point is ice-free (then u_ice = u_oce) 366 365 v_ice (ji,jj) = v_ice(ji,jj+1) * 0.5_wp * ABS( zflag + 1._wp ) * zmsk1 + & … … 374 373 rswitch = MAX( 0.0_wp , SIGN ( 1.0_wp , at_i(ji,jj) - 0.01 ) ) ! 0 if no ice 375 374 v_ice(ji,jj) = rswitch * v_ice(ji,jj) 376 377 ENDDO 378 375 ! 376 END DO 379 377 CALL lbc_bdy_lnk( v_ice(:,:), 'V', -1., ib_bdy ) 380 378 ! 381 379 END SELECT 382 380 ! 383 381 CASE DEFAULT 384 382 CALL ctl_stop( 'bdy_ice_lim_dyn : unrecognised option for open boundaries for ice fields' ) 385 383 END SELECT 386 387 END DO388 384 ! 385 END DO 386 ! 389 387 IF( nn_timing == 1 ) CALL timing_stop('bdy_ice_lim_dyn') 390 388 ! 391 389 END SUBROUTINE bdy_ice_lim_dyn 392 390
Note: See TracChangeset
for help on using the changeset viewer.