Changeset 7698 for trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
- Timestamp:
- 2017-02-18T10:02:03+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/LIM_SRC_3/limitd_me.F90
r7646 r7698 115 115 REAL(wp), POINTER, DIMENSION(:,:) :: opning ! rate of opening due to divergence/shear 116 116 REAL(wp), POINTER, DIMENSION(:,:) :: closing_gross ! rate at which area removed, not counting area of new ridges 117 REAL(wp), POINTER, DIMENSION(:,:) :: z_ai 117 118 ! 118 119 INTEGER, PARAMETER :: nitermax = 20 … … 122 123 IF( nn_timing == 1 ) CALL timing_start('limitd_me') 123 124 124 CALL wrk_alloc( jpi,jpj, closing_net, divu_adv, opning, closing_gross )125 CALL wrk_alloc( jpi,jpj, closing_net, divu_adv, opning, closing_gross, z_ai ) 125 126 126 127 ! conservation test … … 135 136 ! 136 137 138 !$OMP PARALLEL DO schedule(static) private(jj,ji) 137 139 DO jj = 1, jpj ! Initialize arrays. 138 140 DO ji = 1, jpi … … 192 194 ! closing rate to a gross closing rate. 193 195 ! NOTE: 0 < aksum <= 1 194 closing_gross(:,:) = closing_net(:,:) / aksum(:,:) 196 !$OMP PARALLEL 197 !$OMP DO schedule(static) private(jj,ji) 198 DO jj = 1, jpj 199 DO ji = 1, jpi 200 closing_gross(ji,jj) = closing_net(ji,jj) / aksum(ji,jj) 201 END DO 202 END DO 195 203 196 204 ! correction to closing rate and opening if closing rate is excessive … … 198 206 ! Reduce the closing rate if more than 100% of the open water 199 207 ! would be removed. Reduce the opening rate proportionately. 208 !$OMP DO schedule(static) private(jj,ji,za,zfac) 200 209 DO jj = 1, jpj 201 210 DO ji = 1, jpi … … 216 225 ! would be removed. Reduce the opening rate proportionately. 217 226 DO jl = 1, jpl 227 !$OMP DO schedule(static) private(jj,ji,za,zfac) 218 228 DO jj = 1, jpj 219 229 DO ji = 1, jpi … … 226 236 END DO 227 237 END DO 238 !$OMP END PARALLEL 228 239 229 240 ! 3.3 Redistribute area, volume, and energy. … … 236 247 !-----------------------------------------------------------------------------! 237 248 ! This is in general not equal to one because of divergence during transport 238 asum(:,:) = ato_i(:,:) + SUM( a_i, dim=3 ) 249 !$OMP PARALLEL 250 !$OMP DO schedule(static) private(jj,ji) 251 DO jj = 1, jpj 252 DO ji = 1, jpi 253 asum(ji,jj) = 0._wp 254 z_ai(ji,jj) = 0._wp 255 END DO 256 END DO 257 DO jl = 1, jpl 258 !$OMP DO schedule(static) private(jj,ji) 259 DO jj = 1, jpj 260 DO ji = 1, jpi 261 z_ai(ji,jj) = z_ai(ji,jj) + a_i(ji,jj,jl) 262 END DO 263 END DO 264 END DO 265 !$OMP DO schedule(static) private(jj,ji) 266 DO jj = 1, jpj 267 DO ji = 1, jpi 268 asum(ji,jj) = ato_i(ji,jj) + z_ai(ji,jj) 269 END DO 270 END DO 239 271 240 272 ! 3.5 Do we keep on iterating ??? … … 244 276 245 277 iterate_ridging = 0 278 !$OMP DO schedule(static) private(jj,ji) 246 279 DO jj = 1, jpj 247 280 DO ji = 1, jpi … … 258 291 END DO 259 292 END DO 293 !$OMP END PARALLEL 260 294 261 295 IF( lk_mpp ) CALL mpp_max( iterate_ridging ) … … 289 323 IF( ln_ctl ) CALL lim_prt3D( 'limitd_me' ) 290 324 291 CALL wrk_dealloc( jpi, jpj, closing_net, divu_adv, opning, closing_gross )325 CALL wrk_dealloc( jpi, jpj, closing_net, divu_adv, opning, closing_gross, z_ai ) 292 326 ! 293 327 IF( nn_timing == 1 ) CALL timing_stop('limitd_me') … … 306 340 REAL(wp) :: Gstari, astari, hrmean, zdummy ! local scalar 307 341 REAL(wp), POINTER, DIMENSION(:,:,:) :: Gsum ! Gsum(n) = sum of areas in categories 0 to n 342 REAL(wp), POINTER, DIMENSION(:,:) :: z_ai 308 343 !------------------------------------------------------------------------------! 309 344 310 345 CALL wrk_alloc( jpi,jpj,jpl+2, Gsum, kkstart = -1 ) 346 CALL wrk_alloc( jpi,jpj,z_ai ) 311 347 312 348 Gstari = 1.0/rn_gstar 313 349 astari = 1.0/rn_astar 314 aksum(:,:) = 0.0 315 athorn(:,:,:) = 0.0 316 aridge(:,:,:) = 0.0 317 araft (:,:,:) = 0.0 350 !$OMP PARALLEL 351 !$OMP DO schedule(static) private(jj,ji) 352 DO jj = 1, jpj 353 DO ji = 1, jpi 354 aksum(ji,jj) = 0.0 355 END DO 356 END DO 357 !$OMP END DO NOWAIT 358 DO jl = 1, jpl 359 !$OMP DO schedule(static) private(jj,ji) 360 DO jj = 1, jpj 361 DO ji = 1, jpi 362 athorn(ji,jj,jl) = 0.0 363 aridge(ji,jj,jl) = 0.0 364 araft (ji,jj,jl) = 0.0 365 END DO 366 END DO 367 END DO 368 !$OMP END PARALLEL 318 369 319 370 ! Zero out categories with very small areas 320 371 CALL lim_var_zapsmall 321 372 373 !$OMP PARALLEL 322 374 ! Ice thickness needed for rafting 323 375 DO jl = 1, jpl 376 !$OMP DO schedule(static) private(jj,ji,rswitch) 324 377 DO jj = 1, jpj 325 378 DO ji = 1, jpi … … 336 389 ! Compute total area of ice plus open water. 337 390 ! This is in general not equal to one because of divergence during transport 338 asum(:,:) = ato_i(:,:) + SUM( a_i, dim=3 ) 339 391 392 !$OMP DO schedule(static) private(jj,ji) 393 DO jj = 1, jpj 394 DO ji = 1, jpi 395 asum(ji,jj) = 0._wp 396 z_ai(ji,jj) = 0._wp 397 END DO 398 END DO 399 DO jl = 1, jpl 400 !$OMP DO schedule(static) private(jj,ji) 401 DO jj = 1, jpj 402 DO ji = 1, jpi 403 z_ai(ji,jj) = z_ai(ji,jj) + a_i(ji,jj,jl) 404 END DO 405 END DO 406 END DO 407 !$OMP DO schedule(static) private(jj,ji) 408 DO jj = 1, jpj 409 DO ji = 1, jpi 410 asum(ji,jj) = ato_i(ji,jj) + z_ai(ji,jj) 411 END DO 412 END DO 340 413 ! Compute cumulative thickness distribution function 341 414 ! Compute the cumulative thickness distribution function Gsum, 342 415 ! where Gsum(n) is the fractional area in categories 0 to n. 343 416 ! initial value (in h = 0) equals open water area 344 Gsum(:,:,-1) = 0._wp 345 Gsum(:,:,0 ) = ato_i(:,:) 417 !$OMP DO schedule(static) private(jj,ji) 418 DO jj = 1, jpj 419 DO ji = 1, jpi 420 Gsum(ji,jj,-1) = 0._wp 421 Gsum(ji,jj,0 ) = ato_i(ji,jj) 422 END DO 423 END DO 346 424 ! for each value of h, you have to add ice concentration then 347 425 DO jl = 1, jpl 348 Gsum(:,:,jl) = Gsum(:,:,jl-1) + a_i(:,:,jl) 426 !$OMP DO schedule(static) private(jj,ji) 427 DO jj = 1, jpj 428 DO ji = 1, jpi 429 Gsum(ji,jj,jl) = Gsum(ji,jj,jl-1) + a_i(ji,jj,jl) 430 END DO 431 END DO 349 432 END DO 350 433 351 434 ! Normalize the cumulative distribution to 1 352 435 DO jl = 0, jpl 353 Gsum(:,:,jl) = Gsum(:,:,jl) / asum(:,:) 436 !$OMP DO schedule(static) private(jj,ji) 437 DO jj = 1, jpj 438 DO ji = 1, jpi 439 Gsum(ji,jj,jl) = Gsum(ji,jj,jl) / asum(ji,jj) 440 END DO 441 END DO 354 442 END DO 443 !$OMP END PARALLEL 355 444 356 445 ! 1.3 Compute participation function a(h) = b(h).g(h) (athorn) … … 369 458 IF( nn_partfun == 0 ) THEN !--- Linear formulation (Thorndike et al., 1975) 370 459 DO jl = 0, jpl 460 !$OMP PARALLEL DO schedule(static) private(jj,ji) 371 461 DO jj = 1, jpj 372 462 DO ji = 1, jpi … … 387 477 ! 388 478 zdummy = 1._wp / ( 1._wp - EXP(-astari) ) ! precompute exponential terms using Gsum as a work array 479 !$OMP PARALLEL 389 480 DO jl = -1, jpl 390 Gsum(:,:,jl) = EXP( -Gsum(:,:,jl) * astari ) * zdummy 481 !$OMP DO schedule(static) private(jj,ji) 482 DO jj = 1, jpj 483 DO ji = 1, jpi 484 Gsum(ji,jj,jl) = EXP( -Gsum(ji,jj,jl) * astari ) * zdummy 485 END DO 486 END DO 391 487 END DO 392 488 DO jl = 0, jpl 393 athorn(:,:,jl) = Gsum(:,:,jl-1) - Gsum(:,:,jl) 394 END DO 489 !$OMP DO schedule(static) private(jj,ji) 490 DO jj = 1, jpj 491 DO ji = 1, jpi 492 athorn(ji,jj,jl) = Gsum(ji,jj,jl-1) - Gsum(ji,jj,jl) 493 END DO 494 END DO 495 END DO 496 !$OMP END PARALLEL 395 497 ! 396 498 ENDIF … … 400 502 ! 401 503 DO jl = 1, jpl 504 !$OMP PARALLEL DO schedule(static) private(jj,ji,zdummy) 402 505 DO jj = 1, jpj 403 506 DO ji = 1, jpi … … 412 515 ! 413 516 DO jl = 1, jpl 414 aridge(:,:,jl) = athorn(:,:,jl) 517 !$OMP PARALLEL DO schedule(static) private(jj,ji) 518 DO jj = 1, jpj 519 DO ji = 1, jpi 520 aridge(ji,jj,jl) = athorn(ji,jj,jl) 521 END DO 522 END DO 415 523 END DO 416 524 ! … … 418 526 ! 419 527 DO jl = 1, jpl 420 araft(:,:,jl) = athorn(:,:,jl) 528 !$OMP PARALLEL DO schedule(static) private(jj,ji) 529 DO jj = 1, jpj 530 DO ji = 1, jpi 531 araft(ji,jj,jl) = athorn(ji,jj,jl) 532 END DO 533 END DO 421 534 END DO 422 535 ! … … 449 562 !----------------------------------------------------------------- 450 563 451 aksum(:,:) = athorn(:,:,0) 564 !$OMP PARALLEL 565 !$OMP DO schedule(static) private(jj,ji) 566 DO jj = 1, jpj 567 DO ji = 1, jpi 568 aksum(ji,jj) = athorn(ji,jj,0) 569 END DO 570 END DO 452 571 ! Transfer function 453 572 DO jl = 1, jpl !all categories have a specific transfer function 573 !$OMP DO schedule(static) private(jj,ji,hrmean) 454 574 DO jj = 1, jpj 455 575 DO ji = 1, jpi … … 476 596 END DO 477 597 END DO 598 !$OMP END PARALLEL 478 599 ! 479 600 CALL wrk_dealloc( jpi,jpj,jpl+2, Gsum, kkstart = -1 ) 601 CALL wrk_dealloc( jpi,jpj,z_ai ) 480 602 ! 481 603 END SUBROUTINE lim_itd_me_ridgeprep … … 539 661 ! 1) Compute change in open water area due to closing and opening. 540 662 !------------------------------------------------------------------------------- 663 !$OMP PARALLEL DO schedule(static) private(jj,ji) 541 664 DO jj = 1, jpj 542 665 DO ji = 1, jpi … … 568 691 END DO 569 692 693 !$OMP PARALLEL 694 !$OMP DO schedule(static) private(ij,jj,ji) 570 695 DO ij = 1, icells 571 696 ji = indxi(ij) ; jj = indxj(ij) … … 660 785 !-------------------------------------------------------------------- 661 786 DO jk = 1, nlay_i 787 !$OMP DO schedule(static) private(ij,jj,ji) 662 788 DO ij = 1, icells 663 789 ji = indxi(ij) ; jj = indxj(ij) … … 687 813 DO jl2 = 1, jpl 688 814 ! over categories to which ridged/rafted ice is transferred 815 !$OMP DO schedule(static) private(ij,jj,ji,hL,hR,farea) 689 816 DO ij = 1, icells 690 817 ji = indxi(ij) ; jj = indxj(ij) … … 721 848 ! Transfer ice energy to category jl2 by ridging 722 849 DO jk = 1, nlay_i 850 !$OMP DO schedule(static) private(ij,jj,ji) 723 851 DO ij = 1, icells 724 852 ji = indxi(ij) ; jj = indxj(ij) … … 728 856 ! 729 857 END DO ! jl2 858 !$OMP END PARALLEL 730 859 731 860 END DO ! jl1 (deforming categories) 732 733 861 ! 734 862 CALL wrk_dealloc( jpij, indxi, indxj ) … … 769 897 ! 1) Initialize 770 898 !------------------------------------------------------------------------------! 771 strength(:,:) = 0._wp 899 !$OMP PARALLEL DO schedule(static) private(jj,ji) 900 DO jj = 1, jpj 901 DO ji = 1, jpi 902 strength(ji,jj) = 0._wp 903 END DO 904 END DO 772 905 773 906 !------------------------------------------------------------------------------! … … 781 914 IF( kstrngth == 1 ) THEN 782 915 z1_3 = 1._wp / 3._wp 916 !$OMP PARALLEL 783 917 DO jl = 1, jpl 918 !$OMP DO schedule(static) private(jj,ji) 784 919 DO jj= 1, jpj 785 920 DO ji = 1, jpi … … 810 945 END DO 811 946 812 strength(:,:) = rn_pe_rdg * Cp * strength(:,:) / aksum(:,:) * tmask(:,:,1) 947 !$OMP DO schedule(static) private(jj,ji) 948 DO jj= 1, jpj 949 DO ji = 1, jpi 950 strength(ji,jj) = rn_pe_rdg * Cp * strength(ji,jj) / aksum(ji,jj) * tmask(ji,jj,1) 951 END DO 952 END DO 953 !$OMP END PARALLEL 813 954 ! where Cp = (g/2)*(rhow-rhoi)*(rhoi/rhow) and rn_pe_rdg accounts for frictional dissipation 814 955 ksmooth = 1 … … 818 959 !------------------------------------------------------------------------------! 819 960 ELSE ! kstrngth ne 1: Hibler (1979) form 820 ! 821 strength(:,:) = rn_pstar * vt_i(:,:) * EXP( - rn_crhg * ( 1._wp - at_i(:,:) ) ) * tmask(:,:,1) 961 !$OMP PARALLEL DO schedule(static) private(jj,ji) 962 DO jj= 1, jpj 963 DO ji = 1, jpi 964 ! 965 strength(ji,jj) = rn_pstar * vt_i(ji,jj) * EXP( - rn_crhg * ( 1._wp - at_i(ji,jj) ) ) * tmask(ji,jj,1) 966 END DO 967 END DO 822 968 ! 823 969 ksmooth = 1 … … 830 976 ! CAN BE REMOVED 831 977 IF( ln_icestr_bvf ) THEN 978 !$OMP PARALLEL DO schedule(static) private(jj,ji) 832 979 DO jj = 1, jpj 833 980 DO ji = 1, jpi … … 846 993 IF ( ksmooth == 1 ) THEN 847 994 995 !$OMP PARALLEL 996 !$OMP DO schedule(static) private(jj,ji) 848 997 DO jj = 2, jpjm1 849 998 DO ji = 2, jpim1 … … 859 1008 END DO 860 1009 1010 !$OMP DO schedule(static) private(jj,ji) 861 1011 DO jj = 2, jpjm1 862 1012 DO ji = 2, jpim1 … … 864 1014 END DO 865 1015 END DO 1016 !$OMP END PARALLEL 866 1017 CALL lbc_lnk( strength, 'T', 1. ) 867 1018 … … 874 1025 875 1026 IF ( numit == nit000 + nn_fsbc - 1 ) THEN 876 zstrp1(:,:) = 0._wp 877 zstrp2(:,:) = 0._wp 1027 !$OMP PARALLEL DO schedule(static) private(jj,ji) 1028 DO jj = 1, jpj 1029 DO ji = 1, jpi 1030 zstrp1(ji,jj) = 0._wp 1031 zstrp2(ji,jj) = 0._wp 1032 END DO 1033 END DO 878 1034 ENDIF 879 1035 1036 !$OMP PARALLEL DO schedule(static) private(jj,ji,numts_rm,zp) 880 1037 DO jj = 2, jpjm1 881 1038 DO ji = 2, jpim1
Note: See TracChangeset
for help on using the changeset viewer.