From b3d98944b4ddb351b2a61389a3e74b24136a75f1 Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Fri, 1 Dec 2023 08:12:02 +0100 Subject: [PATCH 1/4] Modified the transition between isopycnic and constant pressure interfaces for hybrid vertical coordinate to make it less sensitive to bathymetry variations. --- phy/mod_vcoord.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phy/mod_vcoord.F90 b/phy/mod_vcoord.F90 index 91bfc31e..c988032e 100644 --- a/phy/mod_vcoord.F90 +++ b/phy/mod_vcoord.F90 @@ -622,7 +622,7 @@ subroutine cntiso_regrid_nudge_jslice(p_src, p_dst, i_lb, i_ub, j, j_rs, nn) /(p_src(kl+1,i) - p_src(kl,i)) if (sigmar_1d(kt) > sig_pmin(kt)) then ktzmin = max(2, kt - dktzu) - ktzmax = min(ksmx(i), kdmx(i), kt + dktzl) + ktzmax = min(ksmx(i) + 1, kt + dktzl) if (ktzmin < kt .and. ktzmax - ktzmin > 1) tzfound = .true. exit endif @@ -748,7 +748,7 @@ subroutine cntiso_regrid_nudge_jslice(p_src, p_dst, i_lb, i_ub, j, j_rs, nn) if (d > 0._r8) then do k = ktzmin, ktzmax-1 rk = k - ktzmin + ckt - p_dst(k,i) = a + rk*(b + rk*(c + rk*d)) + p_dst(k,i) = max(p_dst(k,i), a + rk*(b + rk*(c + rk*d))) enddo endif endif From 1875880f98b55e90f49da247bf155f00e1976ff2 Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Fri, 1 Dec 2023 08:18:41 +0100 Subject: [PATCH 2/4] Updated copyright notice. --- phy/mod_vcoord.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phy/mod_vcoord.F90 b/phy/mod_vcoord.F90 index c988032e..1ee46f72 100644 --- a/phy/mod_vcoord.F90 +++ b/phy/mod_vcoord.F90 @@ -1,5 +1,5 @@ ! ------------------------------------------------------------------------------ -! Copyright (C) 2021-2022 Mats Bentsen, Mehmet Ilicak +! Copyright (C) 2021-2023 Mats Bentsen, Mehmet Ilicak ! ! This file is part of BLOM. ! From 3eec39748dabf2180753a978d8d8fa6e82c8d157 Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Fri, 1 Dec 2023 09:19:32 +0100 Subject: [PATCH 3/4] For hybrid vertical coordinate, modified the estimation of neutral slope vector times Brunt-Vaisala frequency in the vicinity of bathymetry to make Eady growth rate estimates more robust. --- phy/mod_cmnfld_routines.F90 | 50 ++++++++++++++++++++++++++----------- phy/mod_difest.F | 16 ++---------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/phy/mod_cmnfld_routines.F90 b/phy/mod_cmnfld_routines.F90 index f8879d07..c8a245ef 100644 --- a/phy/mod_cmnfld_routines.F90 +++ b/phy/mod_cmnfld_routines.F90 @@ -1,5 +1,5 @@ ! ------------------------------------------------------------------------------ -! Copyright (C) 2015-2022 Mats Bentsen, Mehmet Ilicak +! Copyright (C) 2015-2023 Mats Bentsen, Mehmet Ilicak ! ! This file is part of BLOM. ! @@ -825,34 +825,56 @@ subroutine cmnfld_nnslope_cntiso_hybrid(m, n, mm, nn, k1m, k1n) integer, intent(in) :: m, n, mm, nn, k1m, k1n real(r8) :: bfsqm - integer :: i, j, k, l + integer :: i, j, knnsl, k, l call xctilr(nslpx, 1, kk, 2, 2, halo_uv) call xctilr(nslpy, 1, kk, 2, 2, halo_vv) - !$omp parallel do private(k, l, i, bfsqm) + !$omp parallel do private(l, i, knnsl, k, bfsqm) do j = - 1, jj + 2 - do k = 1, kk - do l = 1, isu(j) - do i = max(0, ifu(j, l)), min(ii + 2, ilu(j, l)) - bfsqm = .5_r8*(bfsqf(i - 1, j, k) + bfsqf(i, j, k)) - nnslpx(i, j, k) = sqrt(bfsqm)*nslpx(i, j, k) + do l = 1, isu(j) + do i = max(0, ifu(j, l)), min(ii + 2, ilu(j, l)) + knnsl = 1 + nnslpx(i, j, 1) = 0._r8 + do k = 2, kk + if (p(i , j, k) < p(i - 1, j, kk + 1) .and. & + p(i - 1, j, k) < p(i , j, kk + 1)) then + bfsqm = .5_r8*(bfsqf(i - 1, j, k) + bfsqf(i, j, k)) + nnslpx(i, j, k) = sqrt(bfsqm)*nslpx(i, j, k) + knnsl = k + else + exit + endif enddo + do k = knnsl + 1, kk + nnslpx(i, j, k) = nnslpx(i, j, knnsl) enddo enddo + enddo enddo !$omp end parallel do - !$omp parallel do private(k, l, i, bfsqm) + !$omp parallel do private(l, i, knnsl, k, bfsqm) do j = 0, jj + 2 - do k = 1, kk - do l = 1, isv(j) - do i = max(- 1, ifv(j, l)), min(ii + 2, ilv(j, l)) - bfsqm = .5_r8*(bfsqf(i, j - 1, k) + bfsqf(i, j, k)) - nnslpy(i, j, k) = sqrt(bfsqm)*nslpy(i, j, k) + do l = 1, isv(j) + do i = max(- 1, ifv(j, l)), min(ii + 2, ilv(j, l)) + knnsl = 1 + nnslpy(i, j, 1) = 0._r8 + do k = 2, kk + if (p(i, j , k) < p(i, j - 1, kk + 1) .and. & + p(i, j - 1, k) < p(i, j , kk + 1)) then + bfsqm = .5_r8*(bfsqf(i, j - 1, k) + bfsqf(i, j, k)) + nnslpy(i, j, k) = sqrt(bfsqm)*nslpy(i, j, k) + knnsl = k + else + exit + endif enddo + do k = knnsl + 1, kk + nnslpy(i, j, k) = nnslpy(i, j, knnsl) enddo enddo + enddo enddo !$omp end parallel do diff --git a/phy/mod_difest.F b/phy/mod_difest.F index 6250a5ed..b60533c9 100644 --- a/phy/mod_difest.F +++ b/phy/mod_difest.F @@ -1650,13 +1650,7 @@ subroutine difest_lateral_hyb(m,n,mm,nn,k1m,k1n) egrup(i)=egrlo if (edsprs.or.edanis) then if (eddf2d) then - if (p(i,j,k+1).gt. - . min(p(i-1,j,kk+1),p(i+1,j,kk+1), - . p(i,j-1,kk+1),p(i,j+1,kk+1))) then - q=0. - else - q=max(0.,p(i,j,k+1)-p(i,j,k)) - endif + q=max(0.,p(i,j,k+1)-p(i,j,k)) else q=max(0.,min(p(i,j,kfil(i,j))+dpgrav, . p(i,j,k+1))-p(i,j,k)) @@ -1765,13 +1759,7 @@ subroutine difest_lateral_hyb(m,n,mm,nn,k1m,k1n) c --- --------- anisotrophy if requested. c if (eddf2d) then - if (p(i,j,k+1).gt. - . min(p(i-1,j,kk+1),p(i+1,j,kk+1), - . p(i,j-1,kk+1),p(i,j+1,kk+1))) then - q=0. - else - q=max(0.,p(i,j,k+1)-p(i,j,k)) - endif + q=max(0.,p(i,j,k+1)-p(i,j,k)) else c c --- ----------- Only consider a region below the first physical layer From a0bfb39746f5ced93bef5cfc26af1e9598f59c36 Mon Sep 17 00:00:00 2001 From: Mats Bentsen Date: Fri, 1 Dec 2023 09:23:13 +0100 Subject: [PATCH 4/4] Moved BLOM_VCOORD from run_component_blom to build_component_blom group. --- cime_config/config_component.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f543d3f2..cdcc2057 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -65,8 +65,8 @@ char isopyc_bulkml,cntiso_hybrid isopyc_bulkml - run_component_blom - env_run.xml + build_component_blom + env_build.xml Vertical coordinate type of BLOM