Skip to content

Commit

Permalink
Update MOM6 model_mod to fix spelling and clarify units
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonbk committed Jan 7, 2025
1 parent ea32617 commit 1ef07d8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions models/MOM6/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ module model_mod
integer, parameter :: NOT_IN_STATE = 12
integer, parameter :: THICKNESS_NOT_IN_STATE = 13
integer, parameter :: QUAD_LOCATE_FAILED = 14
integer, parameter :: THICKNESS_QUAD_EVALUTATE_FAILED = 15
integer, parameter :: QUAD_EVALUTATE_FAILED = 16
integer, parameter :: THICKNESS_QUAD_EVALUATE_FAILED = 15
integer, parameter :: QUAD_EVALUATE_FAILED = 16
integer, parameter :: QUAD_ON_LAND = 17
integer, parameter :: QUAD_ON_BASIN_EDGE = 18
integer, parameter :: OBS_ABOVE_SURFACE = 20
Expand Down Expand Up @@ -231,6 +231,8 @@ subroutine model_interpolate(state_handle, ens_size, location, qty_in, expected_
real(r8), intent(out) :: expected_obs(ens_size) !< array of interpolated values
integer, intent(out) :: istatus(ens_size)

real(r8), parameter :: concentration_to_ppt = 1000.0

integer :: qty ! local qty
integer :: which_vert, four_ilons(4), four_ilats(4), lev(ens_size,2)
integer :: locate_status, quad_status
Expand Down Expand Up @@ -323,7 +325,7 @@ subroutine model_interpolate(state_handle, ens_size, location, qty_in, expected_
thick_at_x, &
quad_status)
if (quad_status /= 0) then
istatus(:) = THICKNESS_QUAD_EVALUTATE_FAILED
istatus(:) = THICKNESS_QUAD_EVALUATE_FAILED
return
endif

Expand Down Expand Up @@ -358,31 +360,31 @@ subroutine model_interpolate(state_handle, ens_size, location, qty_in, expected_

call state_on_quad(four_ilons, four_ilats, lon_lat_vert, ens_size, lev, lev_fract, interp, state_handle, varid, expected_pot_temp, quad_status)
if (quad_status /= 0) then
istatus(:) = QUAD_EVALUTATE_FAILED
istatus(:) = QUAD_EVALUATE_FAILED
return
endif
call state_on_quad(four_ilons, four_ilats, lon_lat_vert, ens_size, lev, lev_fract, interp, state_handle, get_varid_from_kind(dom_id, QTY_SALINITY), expected_salinity, quad_status)
if (quad_status /= 0) then
istatus(:) = QUAD_EVALUTATE_FAILED
istatus(:) = QUAD_EVALUATE_FAILED
return
endif

pressure_dbars = 0.059808_r8*(exp(-0.025_r8*depth_at_x) - 1.0_r8) &
+ 0.100766_r8*depth_at_x + 2.28405e-7_r8*lon_lat_vert(3)**2
expected_obs = sensible_temp(expected_pot_temp, expected_salinity, pressure_dbars)

case (QTY_SALINITY) ! convert from PSU (model) to MSU (obersvation)
case (QTY_SALINITY) ! convert from g of salt per kg of seawater (model) to kg of salt per kg of seawater (observation)
call state_on_quad(four_ilons, four_ilats, lon_lat_vert, ens_size, lev, lev_fract, interp, state_handle, varid, expected_obs, quad_status)
if (quad_status /= 0) then
istatus(:) = QUAD_EVALUTATE_FAILED
istatus(:) = QUAD_EVALUATE_FAILED
return
endif
expected_obs = expected_obs/1000.0_r8

case default
call state_on_quad(four_ilons, four_ilats, lon_lat_vert, ens_size, lev, lev_fract, interp, state_handle, varid, expected_obs, quad_status)
if (quad_status /= 0) then
istatus(:) = QUAD_EVALUTATE_FAILED
istatus(:) = QUAD_EVALUATE_FAILED
return
endif
end select
Expand Down

0 comments on commit 1ef07d8

Please sign in to comment.