- Timestamp:
- 2021-03-02T11:42:20+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14122_HPC-08_Mueller_OSMOSIS_streamlining/src/OCE/ZDF/zdfosm.F90
r14565 r14566 550 550 DO_2D( 0, 0, 0, 0 ) 551 551 zhbl(ji,jj) = gdepw(ji,jj,ibld(ji,jj),Kmm) 552 imld(ji,jj) = MAX(3,ibld(ji,jj) - MAX( INT( dh(ji,jj) / e3t(ji, jj, ibld(ji,jj) , Kmm )) , 1 ))552 imld(ji,jj) = MAX(3,ibld(ji,jj) - MAX( INT( dh(ji,jj) / e3t(ji, jj, ibld(ji,jj) - 1, Kmm )) , 1 )) 553 553 zhml(ji,jj) = gdepw(ji,jj,imld(ji,jj),Kmm) 554 554 zdh(ji,jj) = zhbl(ji,jj) - zhml(ji,jj) … … 582 582 END_2D 583 583 584 !! External gradient 585 CALL zdf_osm_external_gradients( ibld+2, zdtdz_bl_ext, zdsdz_bl_ext, zdbdz_bl_ext ) 584 !! Calculate fairly-well-mixed depth zmld & its index mld_prof + lateral zmld-averaged gradients 586 585 CALL zdf_osm_zmld_horizontal_gradients( zmld, zdtdx, zdtdy, zdsdx, zdsdy, dbdx_mle, dbdy_mle, zdbds_mle ) 586 !! Calculate vertical gradients immediately below zmld 587 587 CALL zdf_osm_external_gradients( mld_prof, zdtdz_mle_ext, zdsdz_mle_ext, zdbdz_mle_ext ) 588 !! Calculate max vertical FK flux zwb_fk & set logical descriptors 588 589 CALL zdf_osm_osbl_state_fk( lpyc, lflux, lmle, zwb_fk ) 590 !! recalculate hmle, zmle, zvel_mle, zdiff_mle & redefine mld_proc to be index for new hmle 589 591 CALL zdf_osm_mle_parameters( zmld, mld_prof, hmle, zhmle, zvel_mle, zdiff_mle ) 590 592 ELSE ! ln_osm_mle … … 597 599 END_2D 598 600 ENDIF ! ln_osm_mle 601 602 !! External gradient below BL needed both with and w/o FK 603 CALL zdf_osm_external_gradients( ibld+2, zdtdz_bl_ext, zdsdz_bl_ext, zdbdz_bl_ext ) 599 604 600 605 ! Test if pycnocline well resolved … … 615 620 END_2D 616 621 622 ! Recalculate bl averages using jp_ext & ml averages .... note no rotation of u & v here.. 617 623 CALL zdf_osm_vertical_average( Kbb, Kmm, & 618 624 & ibld, zt_bl, zs_bl, zb_bl, zu_bl, zv_bl, & … … 648 654 ! is external level in bounds? 649 655 656 ! Recalculate BL averages and differences using new BL depth 650 657 CALL zdf_osm_vertical_average( Kbb, Kmm, & 651 658 & ibld, zt_bl, zs_bl, zb_bl, zu_bl, zv_bl, & … … 663 670 dstokes(:,:) = MIN ( dstokes(:,:), hbl(:,:)/3. ) ! Limit delta for shallow boundary layers for calculating flux-gradient terms. 664 671 ! 665 ! Average over the depth of the mixed layer in the convective boundary layer672 ! Average over the depth of the mixed layer in the convective boundary layer 666 673 ! jp_ext = ibld - imld +1 674 ! Recalculate ML averages and differences using new ML depth 667 675 CALL zdf_osm_vertical_average( Kbb, Kmm, & 668 676 & imld-1, zt_ml, zs_ml, zb_ml, zu_ml, zv_ml, & 669 677 & ibld-imld+1, zdt_ml, zds_ml, zdb_ml, zdu_ml, zdv_ml ) 670 ! rotate mean currents and changes onto wind align co-ordinates671 !672 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_ml, zv_ml, zdu_ml, zdv_ml )673 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_bl, zv_bl, zdu_bl, zdv_bl )678 ! rotate mean currents and changes onto wind align co-ordinates 679 ! 680 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_ml, zv_ml, zdu_ml, zdv_ml ) 681 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_bl, zv_bl, zdu_bl, zdv_bl ) 674 682 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 675 683 ! Pycnocline gradients for scalars and velocity … … 993 1001 DO jk = imld(ji,jj) , ibld(ji,jj) 994 1002 zznd_pyc = -( gdepw(ji,jj,jk,Kmm) - zhbl(ji,jj) ) / MAX(zdh(ji,jj), 1.e-6) 995 996 1003 zviscos(ji,jj,jk) = zvispyc_n_sc(ji,jj) * ( za_cubic + zb_cubic * zznd_pyc + zc_cubic * zznd_pyc**2 + zd_cubic * zznd_pyc**3 ) 1004 zviscos(ji,jj,jk) = zviscos(ji,jj,jk) + zvispyc_s_sc(ji,jj) * ( 1.75 * zznd_pyc - 0.15 * zznd_pyc**2 -0.2 * zznd_pyc**3 ) 997 1005 END DO 998 1006 IF ( zdhdt(ji,jj) > 0._wp ) THEN … … 1338 1346 jkb1 = MIN(jkb + 1, mbkt(ji,jj)) 1339 1347 zdtdz(ji,jj) = - ( ts(ji,jj,jkb1,jp_tem,Kmm) - ts(ji,jj,jkb,jp_tem,Kmm ) ) & 1340 & / e3 t(ji,jj,jkb,Kmm)1348 & / e3w(ji,jj,jkb1,Kmm) 1341 1349 zdsdz(ji,jj) = - ( ts(ji,jj,jkb1,jp_sal,Kmm) - ts(ji,jj,jkb,jp_sal,Kmm ) ) & 1342 & / e3 t(ji,jj,jkb,Kmm)1350 & / e3w(ji,jj,jkb1,Kmm) 1343 1351 zdbdz(ji,jj) = grav * zthermal * zdtdz(ji,jj) - grav * zbeta * zdsdz(ji,jj) 1344 1352 ELSE … … 1634 1642 IF ( ln_osm_mle ) THEN 1635 1643 zhbl_s = zhbl_s + MIN( & 1636 & rn_Dt * ( ( -zwb_ent(ji,jj) - 2.0 * zwb_fk_b(ji,jj) )/ zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), &1637 & e3w(ji,jj,jm,Kmm) )1644 & rn_Dt * ( ( -zwb_ent(ji,jj) - 2.0 * zwb_fk_b(ji,jj) )/ zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), & 1645 & e3w(ji,jj,jm,Kmm) ) 1638 1646 ELSE 1639 zhbl_s = zhbl_s + MIN( &1640 & rn_Dt * ( -zwb_ent(ji,jj) / zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), &1641 & e3w(ji,jj,jm,Kmm) )1647 zhbl_s = zhbl_s + MIN( & 1648 & rn_Dt * ( -zwb_ent(ji,jj) / zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), & 1649 & e3w(ji,jj,jm,Kmm) ) 1642 1650 ENDIF 1643 1651 1644 ! zhbl_s = MIN(zhbl_s, gdepw(ji,jj, mbkt(ji,jj) + 1,Kmm) - depth_tol)1652 ! zhbl_s = MIN(zhbl_s, gdepw(ji,jj, mbkt(ji,jj) + 1,Kmm) - depth_tol) 1645 1653 IF ( zhbl_s >= gdepw(ji,jj,mbkt(ji,jj) + 1,Kmm) ) THEN 1646 zhbl_s = MIN(zhbl_s, gdepw(ji,jj, mbkt(ji,jj) + 1,Kmm) - depth_tol)1647 lpyc(ji,jj) = .FALSE.1654 zhbl_s = MIN(zhbl_s, gdepw(ji,jj, mbkt(ji,jj) + 1,Kmm) - depth_tol) 1655 lpyc(ji,jj) = .FALSE. 1648 1656 ENDIF 1649 1657 IF ( zhbl_s >= gdepw(ji,jj,jm+1,Kmm) ) jm = jm + 1 … … 1680 1688 ! change zero or one model level. 1681 1689 hbl(ji,jj) = MAX(zhbl_t(ji,jj), gdepw(ji,jj,4,Kmm) ) 1682 1683 1690 ENDIF 1691 zhbl(ji,jj) = gdepw(ji,jj,ibld(ji,jj),Kmm) 1684 1692 END_2D 1685 1693 IF( ln_timing ) CALL timing_stop('zdf_osm_th') … … 1754 1762 zdh_ref = 0.2 * hbl(ji,jj) 1755 1763 ENDIF ! IF (dhdt >= 0) 1756 dh(ji,jj) = dh(ji,jj) * EXP( -rn_Dt / ztau ) + zdh_ref * ( 1.0 - EXP( -rn_Dt / ztau ) )1764 dh(ji,jj) = dh(ji,jj) * EXP( -rn_Dt / ztau ) + zdh_ref * ( 1.0 - EXP( -rn_Dt / ztau ) ) 1757 1765 IF ( zdhdt(ji,jj) < 0._wp .and. dh(ji,jj) >= hbl(ji,jj) ) dh(ji,jj) = zdh_ref ! can be a problem with dh>hbl for rapid collapse 1758 ! Alan: this hml is never defined or used -- do we need it?1759 1766 ENDIF 1760 1767 … … 1824 1831 1825 1832 hml(ji,jj) = hbl(ji,jj) - dh(ji,jj) 1826 inhml = MAX( INT( dh(ji,jj) / MAX(e3t(ji,jj,ibld(ji,jj) ,Kmm), 1.e-3) ) , 1 )1833 inhml = MAX( INT( dh(ji,jj) / MAX(e3t(ji,jj,ibld(ji,jj) - 1,Kmm), 1.e-3) ) , 1 ) 1827 1834 imld(ji,jj) = MAX( ibld(ji,jj) - inhml, 3) 1828 1835 zhml(ji,jj) = gdepw(ji,jj,imld(ji,jj),Kmm)
Note: See TracChangeset
for help on using the changeset viewer.