Skip to content

Commit

Permalink
Major refactoring of the ALE method implementation:
Browse files Browse the repository at this point in the history
- Separate modules for vertical coordinate data/routines and ALE regridding/remapping.
- Added support for an additional vertical coordinate, vcoord = 'plevel', that uses the ALE method.
- Reference potential densities and pressure levels can optionally be provided via namelist for vcoord = 'cntiso_hybrid' and vcoord = 'plevel'.
- The ALE regridding and remapping has been overhauled to allow more choices to controoled by namelist variables and to make the code more extensible.
  • Loading branch information
matsbn committed Aug 29, 2024
1 parent 269600d commit 5449aa9
Show file tree
Hide file tree
Showing 28 changed files with 1,770 additions and 1,714 deletions.
18 changes: 9 additions & 9 deletions ben02/mod_thermf_ben02.F90
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
! ------------------------------------------------------------------------------
! Copyright (C) 2002-2023 Mats Bentsen, Mehmet Ilicak

! Copyright (C) 2002-2024 Mats Bentsen, Mehmet Ilicak
!
! This file is part of BLOM.

!
! BLOM is free software: you can redistribute it and/or modify it under the
! terms of the GNU Lesser General Public License as published by the Free
! Software Foundation, either version 3 of the License, or (at your option)
! any later version.

!
! BLOM is distributed in the hope that it will be useful, but WITHOUT ANY
! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
! FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
! more details.

!
! You should have received a copy of the GNU Lesser General Public License
! along with BLOM. If not, see <https://www.gnu.org/licenses/>.
! ------------------------------------------------------------------------------
Expand All @@ -25,7 +25,7 @@ module mod_thermf_ben02
nstep_in_day, baclin, &
xmi, l1mi, l2mi, l3mi, l4mi, l5mi
use mod_xc
use mod_vcoord, only: vcoord_type_tag, isopyc_bulkml
use mod_vcoord, only: vcoord_tag, vcoord_isopyc_bulkml
use mod_grid, only: scp2, plat, area
use mod_state, only: dp, temp, saln, p
use mod_swtfrz, only: swtfrz
Expand Down Expand Up @@ -468,7 +468,7 @@ subroutine thermf_ben02(m,n,mm,nn,k1m,k1n)
ricclm(i,j,l3mi),ricclm(i,j,l4mi), &
ricclm(i,j,l5mi),xmi)
sstc = (1.-rice)*max(sstc,tice_f)+rice*tice_f
if (vcoord_type_tag == isopyc_bulkml) then
if (vcoord_tag == vcoord_isopyc_bulkml) then
dpmxl = dp(i,j,1+nn)+dp(i,j,2+nn)
hmxl = dpmxl/onem
tmxl = (temp(i,j,1+nn)*dp(i,j,1+nn) &
Expand Down Expand Up @@ -526,7 +526,7 @@ subroutine thermf_ben02(m,n,mm,nn,k1m,k1n)
sssc = intp1d(sssclm(i,j,l1mi),sssclm(i,j,l2mi), &
sssclm(i,j,l3mi),sssclm(i,j,l4mi), &
sssclm(i,j,l5mi),xmi)
if (vcoord_type_tag == isopyc_bulkml) then
if (vcoord_tag == vcoord_isopyc_bulkml) then
dpmxl = dp(i,j,1+nn)+dp(i,j,2+nn)
hmxl = dpmxl/onem
smxl = (saln(i,j,1+nn)*dp(i,j,1+nn) &
Expand Down Expand Up @@ -737,7 +737,7 @@ subroutine thermf_ben02(m,n,mm,nn,k1m,k1n)
call chksummsk(salrlx,ip,1,'salrlx')
call chksummsk(iagem,ip,1,'iagem')
call chksummsk(ustar,ip,1,'ustar')
if (vcoord_type_tag /= isopyc_bulkml) then
if (vcoord_tag /= vcoord_isopyc_bulkml) then
call chksummsk(t_rs_nonloc, ip, kk+1, 't_rs_nonloc')
call chksummsk(s_rs_nonloc, ip, kk+1, 's_rs_nonloc')
end if
Expand Down
8 changes: 4 additions & 4 deletions cesm/mod_thermf_cesm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module mod_thermf_cesm
nday_of_year, baclin, &
xmi, l1mi, l2mi, l3mi, l4mi, l5mi
use mod_xc
use mod_vcoord, only: vcoord_type_tag, isopyc_bulkml
use mod_vcoord, only: vcoord_tag, vcoord_isopyc_bulkml
use mod_grid, only: scp2, area
use mod_state, only: dp, temp, saln, p
use mod_swtfrz, only: swtfrz
Expand Down Expand Up @@ -211,7 +211,7 @@ subroutine thermf_cesm(m,n,mm,nn,k1m,k1n)
ricclm(i,j,l3mi),ricclm(i,j,l4mi), ricclm(i,j,l5mi),xmi)
sstc = (1.-rice)*max(sstc,tice_f)+rice*tice_f
end if
if (vcoord_type_tag == isopyc_bulkml) then
if (vcoord_tag == vcoord_isopyc_bulkml) then
dpmxl = dp(i,j,1+nn)+dp(i,j,2+nn)
hmxl = dpmxl/onem
tmxl = (temp(i,j,1+nn)*dp(i,j,1+nn) + temp(i,j,2+nn)*dp(i,j,2+nn))/dpmxl+t0deg
Expand Down Expand Up @@ -267,7 +267,7 @@ subroutine thermf_cesm(m,n,mm,nn,k1m,k1n)
sssc = intp1d(sssclm(i,j,l1mi),sssclm(i,j,l2mi), &
sssclm(i,j,l3mi),sssclm(i,j,l4mi),sssclm(i,j,l5mi),xmi)
end if
if (vcoord_type_tag == isopyc_bulkml) then
if (vcoord_tag == vcoord_isopyc_bulkml) then
dpmxl = dp(i,j,1+nn)+dp(i,j,2+nn)
hmxl = dpmxl/onem
smxl = (saln(i,j,1+nn)*dp(i,j,1+nn) + saln(i,j,2+nn)*dp(i,j,2+nn))/dpmxl
Expand Down Expand Up @@ -427,7 +427,7 @@ subroutine thermf_cesm(m,n,mm,nn,k1m,k1n)
call chksummsk(ustar,ip,1,'ustar')
call chksummsk(frzpot,ip,1,'frzpot')
call chksummsk(mltpot,ip,1,'mltpot')
if (vcoord_type_tag /= isopyc_bulkml) then
if (vcoord_tag /= vcoord_isopyc_bulkml) then
call chksummsk(t_rs_nonloc, ip, kk+1, 't_rs_nonloc')
call chksummsk(s_rs_nonloc, ip, kk+1, 's_rs_nonloc')
end if
Expand Down
Loading

0 comments on commit 5449aa9

Please sign in to comment.