Skip to content

Commit 22829bf

Browse files
bug-fix: convert salinity to MSU in MOM6 model_interpolate
fixes #509 The WOD observation converter is in MSU. obs_def_ocean_mod.f90 does not have any non-COMMON_CODE forward operators that depend on salinty. But this unit conversion is something to keep in mind for future forward operators.
1 parent b458fde commit 22829bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

models/MOM6/model_mod.f90

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ module model_mod
4949

5050
use obs_kind_mod, only : get_index_for_quantity, QTY_U_CURRENT_COMPONENT, &
5151
QTY_V_CURRENT_COMPONENT, QTY_LAYER_THICKNESS, &
52-
QTY_DRY_LAND
52+
QTY_DRY_LAND, QTY_SALINITY
5353

5454
use ensemble_manager_mod, only : ensemble_type
5555

@@ -383,6 +383,11 @@ subroutine model_interpolate(state_handle, ens_size, location, qty, expected_obs
383383
! expected_obs = bot_val + lev_fract * (top_val - bot_val)
384384
expected_obs = expected(:,1) + lev_fract(:) * (expected(:,2) - expected(:,1))
385385

386+
if (qty == QTY_SALINITY) then ! convert from PSU (model) to MSU (obersvation)
387+
expected_obs = expected_obs/1000.0_r8
388+
endif
389+
390+
386391
end subroutine model_interpolate
387392

388393

0 commit comments

Comments
 (0)