Changeset 14516
- Timestamp:
- 2021-02-21T17:04:21+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/NERC/dev_r11078_OSMOSIS_IMMERSE_Nurser_4.0/src/OCE/ZDF/zdfosm.F90
r14515 r14516 600 600 DO ji = 2, jpim1 601 601 zhbl(ji,jj) = gdepw_n(ji,jj,ibld(ji,jj)) 602 imld(ji,jj) = MAX(3,ibld(ji,jj) - MAX( INT( dh(ji,jj) / e3t_n(ji, jj, ibld(ji,jj) )) , 1 ))602 imld(ji,jj) = MAX(3,ibld(ji,jj) - MAX( INT( dh(ji,jj) / e3t_n(ji, jj, ibld(ji,jj) - 1 )) , 1 )) 603 603 zhml(ji,jj) = gdepw_n(ji,jj,imld(ji,jj)) 604 604 zdh(ji,jj) = zhbl(ji,jj) - zhml(ji,jj) … … 635 635 END DO 636 636 637 !! External gradient 638 CALL zdf_osm_external_gradients( ibld+2, zdtdz_bl_ext, zdsdz_bl_ext, zdbdz_bl_ext ) 637 !! Calculate fairly-well-mixed depth zmld & its index mld_prof + lateral zmld-averaged gradients 639 638 CALL zdf_osm_zmld_horizontal_gradients( zmld, zdtdx, zdtdy, zdsdx, zdsdy, dbdx_mle, dbdy_mle, zdbds_mle ) 639 !! Calculate vertical gradients immediately below zmld 640 640 CALL zdf_osm_external_gradients( mld_prof, zdtdz_mle_ext, zdsdz_mle_ext, zdbdz_mle_ext ) 641 !! calculate max vertical FK flux zwb_fk & set logical descriptors 641 642 CALL zdf_osm_osbl_state_fk( lpyc, lflux, lmle, zwb_fk ) 643 !! recalculate hmle, zmle, zvel_mle, zdiff_mle & redefine mld_proc to be index for new hmle 642 644 CALL zdf_osm_mle_parameters( zmld, mld_prof, hmle, zhmle, zvel_mle, zdiff_mle ) 643 645 ELSE ! ln_osm_mle … … 652 654 END DO 653 655 ENDIF ! ln_osm_mle 656 657 !! External gradient below BL needed both with and w/o FK 658 CALL zdf_osm_external_gradients( ibld+2, zdtdz_bl_ext, zdsdz_bl_ext, zdbdz_bl_ext ) 654 659 655 660 ! Test if pycnocline well resolved … … 669 674 jp_ext(ji,jj) = 0 670 675 ENDIF 671 END DO 672 END DO 673 674 CALL zdf_osm_vertical_average(ibld, jp_ext, zt_bl, zs_bl, zb_bl, zu_bl, zv_bl, zdt_bl, zds_bl, zdb_bl, zdu_bl, zdv_bl ) 676 END DO 677 END DO 678 679 ! Recalculate bl averages using jp_ext & ml averages .... note no rotation of u & v here.. 680 CALL zdf_osm_vertical_average(ibld, jp_ext, zt_bl, zs_bl, zb_bl, zu_bl, zv_bl, zdt_bl, zds_bl, zdb_bl, zdu_bl, zdv_bl ) 675 681 ! jp_ext = ibld-imld+1 676 CALL zdf_osm_vertical_average(imld-1, ibld-imld+1, zt_ml, zs_ml, zb_ml, zu_ml, zv_ml, zdt_ml, zds_ml, zdb_ml, zdu_ml, zdv_ml) 682 CALL zdf_osm_vertical_average(imld-1, ibld-imld+1, zt_ml, zs_ml, zb_ml, zu_ml, zv_ml, zdt_ml, zds_ml, zdb_ml, zdu_ml, zdv_ml) 683 677 684 ! Rate of change of hbl 678 685 CALL zdf_osm_calculate_dhdt( zdhdt ) … … 685 692 lpyc(ji,jj) = .FALSE. 686 693 ENDIF 687 688 694 END DO 695 END DO 689 696 690 697 imld(:,:) = ibld(:,:) ! use imld to hold previous blayer index … … 707 714 ! is external level in bounds? 708 715 716 ! Recalculate BL averages and differences using new BL depth 709 717 CALL zdf_osm_vertical_average( ibld, jp_ext, zt_bl, zs_bl, zb_bl, zu_bl, zv_bl, zdt_bl, zds_bl, zdb_bl, zdu_bl, zdv_bl ) 710 718 ! … … 722 730 dstokes(:,:) = MIN ( dstokes(:,:), hbl(:,:)/3. ) ! Limit delta for shallow boundary layers for calculating flux-gradient terms. 723 731 ! 724 ! Average over the depth of the mixed layer in the convective boundary layer732 ! Average over the depth of the mixed layer in the convective boundary layer 725 733 ! jp_ext = ibld - imld +1 734 ! Recalculate ML averages and differences using new ML depth 726 735 CALL zdf_osm_vertical_average( imld-1, ibld-imld+1, zt_ml, zs_ml, zb_ml, zu_ml, zv_ml, zdt_ml, zds_ml, zdb_ml, zdu_ml, zdv_ml ) 727 ! rotate mean currents and changes onto wind align co-ordinates728 !729 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_ml, zv_ml, zdu_ml, zdv_ml )730 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_bl, zv_bl, zdu_bl, zdv_bl )736 ! rotate mean currents and changes onto wind align co-ordinates 737 ! 738 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_ml, zv_ml, zdu_ml, zdv_ml ) 739 CALL zdf_osm_velocity_rotation( zcos_wind, zsin_wind, zu_bl, zv_bl, zdu_bl, zdv_bl ) 731 740 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 732 741 ! Pycnocline gradients for scalars and velocity … … 1465 1474 DO jk = imld(ji,jj) , ibld(ji,jj) 1466 1475 zznd_pyc = -( gdepw_n(ji,jj,jk) - zhbl(ji,jj) ) / MAX(zdh(ji,jj), 1.e-6) 1467 1468 1476 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 ) 1477 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 ) 1469 1478 END DO 1470 1479 IF ( zdhdt(ji,jj) > 0._wp ) THEN … … 1891 1900 jkb1 = MIN(jkb + 1, mbkt(ji,jj)) 1892 1901 zdtdz(ji,jj) = - ( tsn(ji,jj,jkb1,jp_tem) - tsn(ji,jj,jkb,jp_tem ) ) & 1893 & / e3 t_n(ji,jj,jkb)1902 & / e3w_n(ji,jj,jkb1) 1894 1903 zdsdz(ji,jj) = - ( tsn(ji,jj,jkb1,jp_sal) - tsn(ji,jj,jkb,jp_sal ) ) & 1895 & / e3 t_n(ji,jj,jkb)1904 & / e3w_n(ji,jj,jkb1) 1896 1905 zdbdz(ji,jj) = grav * zthermal * zdtdz(ji,jj) - grav * zbeta * zdsdz(ji,jj) 1897 1906 ELSE … … 1947 1956 zdbdz(ji,jj,jk) = zbgrad * EXP( -zgamma_b * ( znd - zzeta_m )**2 ) 1948 1957 ENDIF 1949 END DO1950 ENDIF ! if no pycnocline pycnocline gradients set to zero1958 END DO 1959 ENDIF ! if no pycnocline pycnocline gradients set to zero 1951 1960 ELSE 1952 1961 ! stable conditions … … 2097 2106 zari = MIN( 1.5 * zdb_bl(ji,jj) / ( zhbl(ji,jj) * ( MAX(zdbdz_bl_ext(ji,jj),0._wp) + zdb_bl(ji,jj)**2 / MAX(4.5 * zwstrc(ji,jj)**2 , 1.e-12 )) ), 0.2d0 ) 2098 2107 ENDIF 2099 ! Relaxation to dh_ref = zari * hbl2108 ! Relaxation to dh_ref = zari * hbl 2100 2109 zddhdt = -a_ddh_2 * ( 1.0 - zdh(ji,jj) / ( zari * zhbl(ji,jj) ) ) * zwb_ent(ji,jj) / zdb_bl(ji,jj) 2101 2110 2102 2111 ELSE IF ( j_ddh(ji,jj) == 0 ) THEN 2103 2112 ! Growing shear layer … … 2244 2253 IF ( ln_osm_mle ) THEN 2245 2254 zhbl_s = zhbl_s + MIN( & 2246 & rn_rdt * ( ( -zwb_ent(ji,jj) - 2.0 * zwb_fk_b(ji,jj) )/ zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), &2247 & e3w_n(ji,jj,jm) )2255 & rn_rdt * ( ( -zwb_ent(ji,jj) - 2.0 * zwb_fk_b(ji,jj) )/ zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), & 2256 & e3w_n(ji,jj,jm) ) 2248 2257 ELSE 2249 zhbl_s = zhbl_s + MIN( &2250 & rn_rdt * ( -zwb_ent(ji,jj) / zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), &2251 & e3w_n(ji,jj,jm) )2258 zhbl_s = zhbl_s + MIN( & 2259 & rn_rdt * ( -zwb_ent(ji,jj) / zdb ) / FLOAT(ibld(ji,jj) - imld(ji,jj) ), & 2260 & e3w_n(ji,jj,jm) ) 2252 2261 ENDIF 2253 2262 2254 ! zhbl_s = MIN(zhbl_s, gdepw_n(ji,jj, mbkt(ji,jj) + 1) - depth_tol)2263 ! zhbl_s = MIN(zhbl_s, gdepw_n(ji,jj, mbkt(ji,jj) + 1) - depth_tol) 2255 2264 IF ( zhbl_s >= gdepw_n(ji,jj,mbkt(ji,jj) + 1) ) THEN 2256 zhbl_s = MIN(zhbl_s, gdepw_n(ji,jj, mbkt(ji,jj) + 1) - depth_tol)2257 lpyc(ji,jj) = .FALSE.2265 zhbl_s = MIN(zhbl_s, gdepw_n(ji,jj, mbkt(ji,jj) + 1) - depth_tol) 2266 lpyc(ji,jj) = .FALSE. 2258 2267 ENDIF 2259 2268 IF ( zhbl_s >= gdepw_n(ji,jj,jm+1) ) jm = jm + 1 … … 2290 2299 ! change zero or one model level. 2291 2300 hbl(ji,jj) = MAX(zhbl_t(ji,jj), gdepw_n(ji,jj,4) ) 2292 2293 2301 ENDIF 2302 zhbl(ji,jj) = gdepw_n(ji,jj,ibld(ji,jj)) 2294 2303 END DO 2295 2304 END DO … … 2364 2373 zdh_ref = 0.2 * hbl(ji,jj) 2365 2374 ENDIF ! IF (dhdt >= 0) 2366 dh(ji,jj) = dh(ji,jj) * EXP( -rn_rdt / ztau ) + zdh_ref * ( 1.0 - EXP( -rn_rdt / ztau ) )2375 dh(ji,jj) = dh(ji,jj) * EXP( -rn_rdt / ztau ) + zdh_ref * ( 1.0 - EXP( -rn_rdt / ztau ) ) 2367 2376 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 2368 ! Alan: this hml is never defined or used -- do we need it?2369 2377 ENDIF 2370 2378 … … 2434 2442 2435 2443 hml(ji,jj) = hbl(ji,jj) - dh(ji,jj) 2436 inhml = MAX( INT( dh(ji,jj) / MAX(e3t_n(ji,jj,ibld(ji,jj) ), 1.e-3) ) , 1 )2444 inhml = MAX( INT( dh(ji,jj) / MAX(e3t_n(ji,jj,ibld(ji,jj)-1), 1.e-3) ) , 1 ) 2437 2445 imld(ji,jj) = MAX( ibld(ji,jj) - inhml, 3) 2438 2446 zhml(ji,jj) = gdepw_n(ji,jj,imld(ji,jj))
Note: See TracChangeset
for help on using the changeset viewer.