Skip to content

Commit

Permalink
Merge pull request #616 from FESOM/mbutzin_patch_transit
Browse files Browse the repository at this point in the history
Bugfix: Reintroduce the calculation of auxiliary latitude variables for transient tracer…
  • Loading branch information
JanStreffing authored Aug 15, 2024
2 parents a333397 + ae0e3bb commit 5c8b780
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/oce_ale_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ function bc_surface(n, id, sval, nzmin, partit)

module transit_bc_surface_interface
interface
function transit_bc_surface(n, id, sst, sss, a_ice, sval, nzmin, partit)
function transit_bc_surface(n, id, sst, sss, a_ice, sval, nzmin, partit, mesh)
use mod_mesh
USE MOD_PARTIT
USE MOD_PARSUP
integer , intent(in) :: n, id, nzmin
type(t_partit), intent(inout), target :: partit
type(t_mesh), intent(in), target :: mesh
real(kind=WP) :: transit_bc_surface
real(kind=WP), intent(in) :: sst, sss, a_ice, sval
end function
Expand Down Expand Up @@ -896,7 +897,7 @@ subroutine diff_ver_part_impl_ale(tr_num, dynamics, tracers, ice, partit, mesh)
tr(nzmin)= tr(nzmin)+bc_surface(n, tracers%data(tr_num)%ID, trarr(nzmin,n), nzmin, partit)

if ((tracers%data(tr_num)%ID .ge. 6) .and.(tracers%data(tr_num)%ID .le. 40)) then
tr(nzmin)= tr(nzmin)+transit_bc_surface(n, tracers%data(tr_num)%ID, sst(nzmin,n), sss(nzmin,n), a_ice(n), trarr(nzmin,n), nzmin, partit)
tr(nzmin)= tr(nzmin)+transit_bc_surface(n, tracers%data(tr_num)%ID, sst(nzmin,n), sss(nzmin,n), a_ice(n), trarr(nzmin,n), nzmin, partit, mesh)
end if

!_______________________________________________________________________
Expand Down Expand Up @@ -1410,7 +1411,7 @@ FUNCTION bc_surface(n, id, sval, nzmin, partit)
! This function returns a boundary conditions for a specified transient tracer ID and surface node.
! Different to function bc_surface, SST, SSS, and sea ice concentrations are always needed as
! auxiliary variable
FUNCTION transit_bc_surface(n, id, sst, sss, aice, sval, nzmin, partit)
FUNCTION transit_bc_surface(n, id, sst, sss, aice, sval, nzmin, partit, mesh)
use MOD_MESH
USE MOD_PARTIT
USE MOD_PARSUP
Expand All @@ -1424,6 +1425,7 @@ FUNCTION transit_bc_surface(n, id, sst, sss, aice, sval, nzmin, partit)
integer, intent(in) :: n, id, nzmin
real(kind=WP), intent(in) :: sst, sss, aice, sval
type(t_partit),intent(inout), target :: partit
type(t_mesh), intent(in), target :: mesh
REAL(kind=WP) :: transit_bc_surface
character(len=10) :: id_string

Expand All @@ -1432,15 +1434,20 @@ FUNCTION transit_bc_surface(n, id, sst, sss, aice, sval, nzmin, partit)
! --> is_nonlinfs=0.0 for linfs

#if defined (__oasis)
! SLP and wind speed in coupled setups. This is a makeshift solution
! as long as the true values are not provided by the AGCM / OASIS.
press_a = mean_slp
wind_2 = speed_2(stress_atmoce_x(n), stress_atmoce_y(n))
! SLP and wind speed in coupled setups. This is a makeshift solution
! as long as the true values are not provided by the AGCM / OASIS.
press_a = mean_slp
wind_2 = speed_2(stress_atmoce_x(n), stress_atmoce_y(n))
#else
press_a = press_air(n)
wind_2 = u_wind(n)**2 + v_wind(n)**2
press_a = press_air(n)
wind_2 = u_wind(n)**2 + v_wind(n)**2
#endif

! The atmospheric input of bomb 14C, CFC-12, and SF6 depends on latitude. To that effect specify
y_abc = mesh%geo_coord_nod2D(2,n) / rad ! latitude of atmospheric tracer input
yy_nh = (10. - y_abc) * 0.05 ! interpolation weight for tropical tracer values


SELECT CASE (id)

! Boundary conditions for additional (transient) tracers (14C, 39Ar, CFC-12, and SF6)
Expand Down

0 comments on commit 5c8b780

Please sign in to comment.