- Timestamp:
- 2017-01-20T19:40:06+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/v3_6_CMIP6_ice_diagnostics/NEMOGCM/NEMO/LIM_SRC_3/limtrp.F90
r7506 r7597 325 325 ! Diffusion of Ice fields 326 326 !------------------------------------------------------------------------------! 327 !------------------------------------ 328 ! Diffusion of other ice variables 329 !------------------------------------ 330 jm=1 331 DO jl = 1, jpl 332 ! ! Masked eddy diffusivity coefficient at ocean U- and V-points 333 ! DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 334 ! DO ji = 1 , fs_jpim1 ! vector opt. 335 ! pahu(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji ,jj,jl) ) ) ) & 336 ! & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji+1,jj,jl) ) ) ) * ahiu(ji,jj) 337 ! pahv(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji,jj ,jl) ) ) ) & 338 ! & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- a_i(ji,jj+1,jl) ) ) ) * ahiv(ji,jj) 339 ! END DO 340 ! END DO 341 DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 327 IF( nn_ahi0 /= -1 ) THEN 328 329 ! --- Prepare diffusion for variables with categories --- ! 330 ! mask eddy diffusivity coefficient at ocean U- and V-points 331 jm=1 332 DO jl = 1, jpl 333 DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 334 DO ji = 1 , fs_jpim1 ! vector opt. 335 pahu3D(ji,jj,jl) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji ,jj, jl ) ) ) ) & 336 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji+1,jj, jl ) ) ) ) * ahiu(ji,jj) 337 pahv3D(ji,jj,jl) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji, jj, jl ) ) ) ) & 338 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- a_i(ji, jj+1,jl ) ) ) ) * ahiv(ji,jj) 339 END DO 340 END DO 341 342 zhdfptab(:,:,jm)= a_i (:,:, jl); jm = jm + 1 343 zhdfptab(:,:,jm)= v_i (:,:, jl); jm = jm + 1 344 zhdfptab(:,:,jm)= v_s (:,:, jl); jm = jm + 1 345 zhdfptab(:,:,jm)= smv_i(:,:, jl); jm = jm + 1 346 zhdfptab(:,:,jm)= oa_i (:,:, jl); jm = jm + 1 347 zhdfptab(:,:,jm)= e_s (:,:,1,jl); jm = jm + 1 348 ! Sample of adding more variables to apply lim_hdf (ihdf_vars must be increased) 349 ! zhdfptab(:,:,jm) = variable_1 (:,:,1,jl); jm = jm + 1 350 ! zhdfptab(:,:,jm) = variable_2 (:,:,1,jl); jm = jm + 1 351 DO jk = 1, nlay_i 352 zhdfptab(:,:,jm)=e_i(:,:,jk,jl); jm= jm+1 353 END DO 354 END DO 355 ! 356 ! --- Prepare diffusion for open water area --- ! 357 ! mask eddy diffusivity coefficient at ocean U- and V-points 358 DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 342 359 DO ji = 1 , fs_jpim1 ! vector opt. 343 pahu3D(ji,jj,jl) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji ,jj, jl ) ) ) ) & 344 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji+1,jj, jl ) ) ) ) * ahiu(ji,jj) 345 pahv3D(ji,jj,jl) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -a_i(ji, jj, jl ) ) ) ) & 346 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- a_i(ji, jj+1,jl ) ) ) ) * ahiv(ji,jj) 347 END DO 348 END DO 349 350 zhdfptab(:,:,jm)= a_i (:,:, jl); jm = jm + 1 351 zhdfptab(:,:,jm)= v_i (:,:, jl); jm = jm + 1 352 zhdfptab(:,:,jm)= v_s (:,:, jl); jm = jm + 1 353 zhdfptab(:,:,jm)= smv_i(:,:, jl); jm = jm + 1 354 zhdfptab(:,:,jm)= oa_i (:,:, jl); jm = jm + 1 355 zhdfptab(:,:,jm)= e_s (:,:,1,jl); jm = jm + 1 356 ! Sample of adding more variables to apply lim_hdf using lim_hdf optimization--- 357 ! zhdfptab(:,:,jm) = variable_1 (:,:,1,jl); jm = jm + 1 358 ! zhdfptab(:,:,jm) = variable_2 (:,:,1,jl); jm = jm + 1 359 ! 360 ! and in this example the parameter ihdf_vars musb be changed to 8 (necessary for allocation) 361 !---------------------------------------------------------------------------------------- 362 DO jk = 1, nlay_i 363 zhdfptab(:,:,jm)=e_i(:,:,jk,jl); jm= jm+1 364 END DO 365 END DO 366 ! 367 !-------------------------------- 368 ! diffusion of open water area 369 !-------------------------------- 370 ! ! Masked eddy diffusivity coefficient at ocean U- and V-points 371 !DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row 372 ! DO ji = 1 , fs_jpim1 ! vector opt. 373 ! pahu(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji ,jj) ) ) ) & 374 ! & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji+1,jj) ) ) ) * ahiu(ji,jj) 375 ! pahv(ji,jj) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji,jj ) ) ) ) & 376 ! & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- at_i(ji,jj+1) ) ) ) * ahiv(ji,jj) 377 ! END DO 378 !END DO 360 pahu3D(ji,jj,jpl+1) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji ,jj) ) ) ) & 361 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji+1,jj) ) ) ) * ahiu(ji,jj) 362 pahv3D(ji,jj,jpl+1) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji,jj ) ) ) ) & 363 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- at_i(ji,jj+1) ) ) ) * ahiv(ji,jj) 364 END DO 365 END DO 366 ! 367 zhdfptab(:,:,jm)= ato_i (:,:); 368 369 ! --- Apply diffusion --- ! 370 CALL lim_hdf( zhdfptab, ihdf_vars, jpl, nlay_i) 371 372 ! --- Recover properties --- ! 373 jm=1 374 DO jl = 1, jpl 375 a_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 376 v_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 377 v_s (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 378 smv_i(:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 379 oa_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1 380 e_s (:,:,1,jl) = zhdfptab(:,:,jm); jm = jm + 1 381 ! Sample of adding more variables to apply lim_hdf--------- 382 ! variable_1 (:,:,1,jl) = zhdfptab(:,:, jm ) ; jm + 1 383 ! variable_2 (:,:,1,jl) = zhdfptab(:,:, jm ) ; jm + 1 384 DO jk = 1, nlay_i 385 e_i(:,:,jk,jl) = zhdfptab(:,:,jm);jm= jm + 1 386 END DO 387 END DO 388 ato_i (:,:) = zhdfptab(:,:,jm) 389 390 ENDIF 379 391 380 DO jj = 1, jpjm1 ! NB: has not to be defined on jpj line and jpi row381 DO ji = 1 , fs_jpim1 ! vector opt.382 pahu3D(ji,jj,jpl+1) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji ,jj) ) ) ) &383 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji+1,jj) ) ) ) * ahiu(ji,jj)384 pahv3D(ji,jj,jpl+1) = ( 1._wp - MAX( 0._wp, SIGN( 1._wp, -at_i(ji,jj ) ) ) ) &385 & * ( 1._wp - MAX( 0._wp, SIGN( 1._wp,- at_i(ji,jj+1) ) ) ) * ahiv(ji,jj)386 END DO387 END DO388 !389 zhdfptab(:,:,jm)= ato_i (:,:);390 CALL lim_hdf( zhdfptab, ihdf_vars, jpl, nlay_i)391 392 jm=1393 DO jl = 1, jpl394 a_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1395 v_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1396 v_s (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1397 smv_i(:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1398 oa_i (:,:, jl) = zhdfptab(:,:,jm); jm = jm + 1399 e_s (:,:,1,jl) = zhdfptab(:,:,jm); jm = jm + 1400 ! Sample of adding more variables to apply lim_hdf---------401 ! variable_1 (:,:,1,jl) = zhdfptab(:,:, jm ) ; jm + 1402 ! variable_2 (:,:,1,jl) = zhdfptab(:,:, jm ) ; jm + 1403 !-----------------------------------------------------------404 DO jk = 1, nlay_i405 e_i(:,:,jk,jl) = zhdfptab(:,:,jm);jm= jm + 1406 END DO407 END DO408 409 ato_i (:,:) = zhdfptab(:,:,jm)410 411 !------------------------------------------------------------------------------!412 ! limit ice properties after transport413 !------------------------------------------------------------------------------!414 !!gm & cr : MAX should not be active if adv scheme is positive !415 DO jl = 1, jpl416 DO jj = 1, jpj417 DO ji = 1, jpi418 v_s (ji,jj,jl) = MAX( 0._wp, v_s (ji,jj,jl) )419 v_i (ji,jj,jl) = MAX( 0._wp, v_i (ji,jj,jl) )420 smv_i(ji,jj,jl) = MAX( 0._wp, smv_i(ji,jj,jl) )421 oa_i (ji,jj,jl) = MAX( 0._wp, oa_i (ji,jj,jl) )422 a_i (ji,jj,jl) = MAX( 0._wp, a_i (ji,jj,jl) )423 e_s (ji,jj,1,jl) = MAX( 0._wp, e_s (ji,jj,1,jl) )424 END DO425 END DO426 427 DO jk = 1, nlay_i428 DO jj = 1, jpj429 DO ji = 1, jpi430 e_i(ji,jj,jk,jl) = MAX( 0._wp, e_i(ji,jj,jk,jl) )431 END DO432 END DO433 END DO434 END DO435 !!gm & cr436 437 392 ! --- diags --- 438 393 DO jj = 1, jpj
Note: See TracChangeset
for help on using the changeset viewer.