Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions models/MOM6/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ module model_mod
init_time => fail_init_time, &
init_conditions => fail_init_conditions, &
convert_vertical_obs, adv_1step, &
parse_variables, &
MAX_STATE_VARIABLE_FIELDS
parse_variables_clamp, &
MAX_STATE_VARIABLE_FIELDS_CLAMP

implicit none
private
Expand Down Expand Up @@ -127,7 +127,7 @@ module model_mod
character(len=256) :: ocean_geometry = 'ocean_geometry.nc'
integer :: assimilation_period_days = 1
integer :: assimilation_period_seconds = 0
character(len=vtablenamelength) :: model_state_variables(MAX_STATE_VARIABLE_FIELDS) = ' '
character(len=vtablenamelength) :: model_state_variables(MAX_STATE_VARIABLE_FIELDS_CLAMP) = ' '
character(len=NF90_MAX_NAME) :: layer_name = 'Layer'
logical :: use_pseudo_depth = .false. ! use pseudo depth instead of sum(layer thickness) for vertical location

Expand Down Expand Up @@ -178,7 +178,7 @@ subroutine static_init_model()
! parse_variables converts the character table that was read in from
! model_nml:model_state_variables to a state_var_type that can be passed
! to add_domain
dom_id = add_domain(template_file, parse_variables(model_state_variables))
dom_id = add_domain(template_file, parse_variables_clamp(model_state_variables))

model_size = get_domain_size(dom_id)

Expand Down
21 changes: 15 additions & 6 deletions models/MOM6/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ The namelist options for DART-MOM6 are as follows:
&model_nml
template_file = 'mom6.r.nc',
ocean_geometry = 'ocean_geometry.nc',
static_file = 'c.e22.GMOM.T62_g16.nuopc.001.mom6.static.nc',
model_state_variables = 'Salt ', 'QTY_SALINITY ', 'UPDATE',
'Temp ', 'QTY_POTENTIAL_TEMPERATURE', 'UPDATE',
'u ', 'QTY_U_CURRENT_COMPONENT ', 'UPDATE',
'v ', 'QTY_V_CURRENT_COMPONENT ', 'UPDATE',
'h ', 'QTY_LAYER_THICKNESS ', 'UPDATE',
static_file = 'static.nc',
model_state_variables = 'Salt ', 'QTY_SALINITY ', 'NA', 'NA', 'UPDATE',
'Temp ', 'QTY_POTENTIAL_TEMPERATURE', 'NA', 'NA', 'UPDATE',
'u ', 'QTY_U_CURRENT_COMPONENT ', 'NA', 'NA', 'UPDATE',
'v ', 'QTY_V_CURRENT_COMPONENT ', 'NA', 'NA', 'UPDATE',
'h ', 'QTY_LAYER_THICKNESS ', 'NA', 'NA', 'UPDATE',
assimilation_period_days = 1
assimilation_period_seconds = 0
use_pseudo_depth = .false. ! use pseudo depth instead of sum(layer thickness) for vertical location
Expand All @@ -104,6 +104,15 @@ The namelist options for DART-MOM6 are as follows:
geolat_v(:,:) Latitude of meridional velocity (Cv) point


* ``model_state_variables`` defines the list of model variables from the MOM6 restart file that will be included in the DART state. Each row in the table should have the following fields:

- **NetCDF variable name**: Name of the variable in the MOM6 restart file (e.g., 'Salt').
- **DART Quantity**: The DART quantity associated with the variable (e.g., 'QTY_SALINITY').
- **Clamping lower bound**: Minimum allowed value for the variable when writing out restarts (use 'NA' for no bound).
- **Clamping upper bound**: Maximum allowed value for the variable when writing out restarts (use 'NA' for no bound).
- **UPDATE or NO_COPY_BACK**: Use 'UPDATE' to allow DART to update this variable during assimilation, or 'NO_COPY_BACK' to prevent updates (variable will be read but not written back).


Vertical Coordinate
-------------------

Expand Down
10 changes: 5 additions & 5 deletions models/MOM6/work/input.nml
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@
template_file = 'mom6.r.nc',
static_file = 'mom6.static.nc',
ocean_geometry = 'ocean_geometry.nc',
model_state_variables = 'Salt ', 'QTY_SALINITY ', 'UPDATE',
'Temp ', 'QTY_POTENTIAL_TEMPERATURE', 'UPDATE',
'u ', 'QTY_U_CURRENT_COMPONENT ', 'UPDATE',
'v ', 'QTY_V_CURRENT_COMPONENT ', 'UPDATE',
'h ', 'QTY_LAYER_THICKNESS ', 'UPDATE',
model_state_variables = 'Salt ', 'QTY_SALINITY ', 'NA', 'NA', 'UPDATE',
'Temp ', 'QTY_POTENTIAL_TEMPERATURE', 'NA', 'NA', 'UPDATE',
'u ', 'QTY_U_CURRENT_COMPONENT ', 'NA', 'NA', 'UPDATE',
'v ', 'QTY_V_CURRENT_COMPONENT ', 'NA', 'NA', 'UPDATE',
'h ', 'QTY_LAYER_THICKNESS ', 'NA', 'NA', 'UPDATE',
/

&utilities_nml
Expand Down