Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create JCB templates for marine B-matrix #36

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
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
37 changes: 37 additions & 0 deletions algorithm/marine/soca_diagb.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
geometry:
mom6_input_nml: mom_input.nml
fields metadata: ./fields_metadata.yaml

date: '{{ marine_window_end_iso }}'

background:
date: '{{ marine_window_end_iso }}'
basename: ./bkg/
ocn_filename: 'ocean.bkg.f009.nc'
ice_filename: 'ice.bkg.f009.nc'
read_from_file: 1

background error:
datadir: ./staticb/
date: '{{ marine_window_middle_iso }}'
exp: bkgerr_stddev
type: incr

variables:
name: [tocn, socn, uocn, vocn, hocn, ssh, cicen, hicen, hsnon, mom6_mld]

rescale: 2.0 # rescales the filtered std. dev. by "rescale"
min sst: 0.0 # Added to sst bkg. err.
max ssh: 0.0 # Limits the amplitude of the unbalanced bkg err
min depth: 500.0 # zero out the bkg. error. at less than min depth
number of halo points: 4
number of neighbors: 16

simple smoothing:
horizontal iterations: 10
vertical iterations: 1

# TODO(G): Too slow for the below scale
#diffusion:
# horizontal: 500.0e3
# vertical: 3.0
98 changes: 98 additions & 0 deletions algorithm/marine/soca_ensb.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Configuration for the recentering and re-balancing of the ensemble members
geometry:
mom6_input_nml: mom_input.nml
fields metadata: ./fields_metadata.yaml

date: '{{ marine_window_begin_iso }}'

layers variable: [hocn]

increment variables: [tocn, socn, uocn, vocn, ssh, hocn, cicen, hicen, hsnon]

set increment variables to zero: [ssh]

vertical geometry:
date: '{{ marine_window_begin_iso }}'
basename: ./INPUT/
ocn_filename: MOM.res.nc
read_from_file: 3

add recentering increment: false

soca increments: # Could also be states, but they are read as increments
number of increments: '{{ marine_number_ensemble_members }}'
pattern: '%mem%'
template:
date: '{{ marine_window_begin_iso }}'
basename: '{{ enspert_relpath }}/ens/'
ocn_filename: 'ocean.%mem%.nc'
ice_filename: 'ice.%mem%.nc'
read_from_file: 3

steric height:
linear variable changes:
- linear variable change name: BalanceSOCA # Only the steric balance is applied

ensemble mean output:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: ens_mean
type: incr

ssh output:
unbalanced:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: ssh_unbal_stddev
type: incr

steric:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: ssh_steric_stddev
type: incr

total:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: ssh_total_stddev
type: incr

explained variance:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: steric_explained_variance
type: incr

recentering error:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: ssh_recentering_error
type: incr

background error output:
datadir: ./staticb/
date: '{{ marine_window_begin_iso }}'
exp: bkgerr_stddev
type: incr

linear variable change:
linear variable changes:
- linear variable change name: BalanceSOCA

trajectory:
state variables: [tocn, socn, uocn, vocn, ssh, hocn, layer_depth, mld, cicen, hicen, hsnon]
date: '{{ marine_window_begin_iso }}'
basename: ./INPUT/
ocn_filename: MOM.res.nc
ice_filename: cice.res.nc
read_from_file: 1

output increment:
# TODO: Revert this when fms can take more than 128 charactres file names
datadir: '{{ enspert_relpath }}/enspert/'
date: '{{ marine_window_begin_iso }}'
exp: trash
type: incr
output file: 'ocn.pert.steric.%mem%.nc'
pattern: '%mem%'
37 changes: 37 additions & 0 deletions algorithm/marine/soca_ensweights.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
geometry:
mom6_input_nml: mom_input.nml
fields metadata: ./fields_metadata.yaml

date: '{{ marine_window_middle_iso }}'

variables:
ice: [cicen, hicen, hsnon]
ocean: [tocn, socn, uocn, vocn, ssh]

background:
date: '{{ marine_window_begin_iso }}'
basename: ./INPUT/
ocn_filename: MOM.res.nc
ice_filename: cice.res.nc
read_from_file: 1

weights:
# Need to provide weights^2 when reading from file
ice: 0.0025 # 5% of original variance
ocean: 0.0625 # 25% " "
# Apply localized weights to the ocean ens. B
ocean local weights:
- lon: -172.0
lat: 11.0
amplitude: -1.0
length scale: 700.0
- lon: -160.0
lat: 12.0
amplitude: -1.0
length scale: 700.0

output:
datadir: ./
date: '{{ marine_window_middle_iso }}'
exp: ens_weights
type: incr
5 changes: 5 additions & 0 deletions algorithm/marine/soca_gridgen.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
geometry:
geom_grid_file: soca_gridspec.nc
mom6_input_nml: mom_input.nml
fields metadata: fields_metadata.yaml
rossby file: rossrad.nc
37 changes: 37 additions & 0 deletions algorithm/marine/soca_parameters_diffusion_hz.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
geometry: &geom
mom6_input_nml: mom_input.nml
fields metadata: ./fields_metadata.yaml

background:
read_from_file: 1
basename: ./INPUT/
ocn_filename: MOM.res.nc
ice_filename: cice.res.nc
date: '{{ marine_window_end_iso }}'
state variables: [ssh]

background error:
covariance model: SABER
saber central block:
saber block name: diffusion
geometry: *geom
calibration:
normalization:
method: randomization
iterations: 10000

groups:
- horizontal:
model file:
date: '{{ marine_window_end_iso }}'
basename: ./
ocn_filename: ocn.cor_rh.incr.0001-01-01T00:00:00Z.nc
model variable: ssh
write:
filepath: ./staticb/hz_ocean

- horizontal:
as gaussian: true
fixed value: 50000.0
write:
filepath: ./staticb/hz_ice
33 changes: 33 additions & 0 deletions algorithm/marine/soca_parameters_diffusion_vt.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
geometry: &geom
mom6_input_nml: mom_input.nml
fields metadata: ./fields_metadata.yaml

background:
read_from_file: 1
basename: ./INPUT/
ocn_filename: MOM.res.nc
ice_filename: cice.res.nc
date: '{{ marine_window_middle_iso }}'
state variables: [tocn]

background error:
covariance model: SABER
saber central block:
saber block name: diffusion
geometry: *geom
calibration:
normalization:
# NOTE, not actually used here, since the normalization spec is only used for hz
method: randomization #< other option is "brute force"
iterations: 1000 #< in the real world you'll want to use 1e4 or so

groups:
- vertical:
as gaussian: true
model file:
date: '{{ marine_window_middle_iso }}'
basename: ./
ocn_filename: vt_scales.nc
model variable: tocn
write:
filepath: ./staticb/vt_ocean
23 changes: 23 additions & 0 deletions algorithm/marine/soca_setcorscales.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resolution:
mom6_input_nml: mom_input.nml
fields metadata: ./fields_metadata.yaml

date: "0001-01-01T00:00:00Z"

corr variables: [ssh]

scales:
vert layers: 5 # in units of layer
ssh:
rossby mult: 1.00
min grid mult: 2.0

rh output:
datadir: ./
exp: cor_rh
type: incr

rv output:
datadir: ./
exp: cor_rv
type: incr
13 changes: 13 additions & 0 deletions algorithm/marine/soca_vtscales.yaml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gridspec_filename: soca_gridspec.nc
restart_filename: ./INPUT/MOM.res.nc
mld_filename: './staticb/ocn.bkgerr_stddev.incr.{{ marine_window_end_iso }}.nc'
output_filename: ./vt_scales.nc
output_variable_vt: Temp
output_variable_hz: ave_ssh

VT_MIN: 5
VT_MAX: 15

HZ_ROSSBY_MULT: 1.0
HZ_MAX: 200e3
HZ_MIN_GRID_MULT: 2.0
Loading