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

Add capability to run diff resolutions for marine anl and background #3238

Merged
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
edbd0c9
resources, no gfs, gdas dev
guillaumevernieres Dec 18, 2024
b565bef
Switch to using updating jedi hashes + soca and jcb-gdas changes for …
Dec 18, 2024
e1a4fd4
Bugfix some resources
Dec 18, 2024
e284329
change paths to hera + add dmpdir
Dec 18, 2024
7c37d0c
fix the DMPDIR specification
Dec 18, 2024
5990348
Merge pull request #9 from shlyaeva/feature/cp4
guillaumevernieres Jan 9, 2025
e95d993
...
guillaumevernieres Jan 9, 2025
8aa849f
Merge branch 'develop' into feature/cp4
guillaumevernieres Jan 9, 2025
fd54e37
low-res bmat works but still wip
guillaumevernieres Jan 15, 2025
4184e87
Merge branch 'develop' into feature/cp4
guillaumevernieres Jan 16, 2025
7c2c058
B geom in analysis task
guillaumevernieres Jan 16, 2025
e62e9d0
use gdas.x for chg res
guillaumevernieres Jan 16, 2025
0699116
norms
guillaumevernieres Jan 16, 2025
d736972
testing hack, revert when new fix files are staged
guillaumevernieres Jan 16, 2025
0c5ed87
fixed wrong exec
guillaumevernieres Jan 16, 2025
29e0c78
bugfix of low res geom
guillaumevernieres Jan 21, 2025
3303119
fixed pynorms
guillaumevernieres Jan 21, 2025
534ab08
removed hack
guillaumevernieres Jan 22, 2025
c62f43a
Merge branch 'develop' into feature/lowres-b
guillaumevernieres Jan 22, 2025
11b4f12
Merge branch 'develop' into feature/lowres-b
guillaumevernieres Jan 27, 2025
c90ba0c
...
guillaumevernieres Jan 27, 2025
9a693bf
...
guillaumevernieres Jan 27, 2025
d93a95c
updated soca fix version
guillaumevernieres Jan 28, 2025
30daf7b
Merge branch 'develop' into feature/lowres-b
guillaumevernieres Feb 3, 2025
46e2637
new gdas.cd #
guillaumevernieres Feb 4, 2025
a392f42
Merge branch 'develop' into feature/lowres-b
guillaumevernieres Feb 4, 2025
ec500a9
Merge branch 'develop' into feature/lowres-b
RussTreadon-NOAA Feb 6, 2025
e68041b
Add changes for ice recentering
Feb 6, 2025
7cb38c9
Update ci/cases/gfsv17/marinehyb.yaml
shlyaeva Feb 6, 2025
635efd1
Merge pull request #10 from shlyaeva/feature/ice_recenter
guillaumevernieres Feb 7, 2025
346861a
updated gdas.cd #
guillaumevernieres Feb 7, 2025
ef90ead
Merge branch 'develop' into feature/lowres-b
RussTreadon-NOAA Feb 10, 2025
01ac2c9
Merge branch 'develop' into feature/lowres-b
aerorahul Feb 10, 2025
c33da06
Merge branch 'develop' into feature/lowres-b
RussTreadon-NOAA Feb 14, 2025
4f35faf
Merge branch 'develop' into feature/lowres-b
RussTreadon-NOAA Feb 14, 2025
b3782c9
Merge branch 'develop' into feature/lowres-b
RussTreadon-NOAA Feb 18, 2025
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
5 changes: 3 additions & 2 deletions ci/cases/gfsv17/C384mx025_3DVarAOWCDA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ arguments:
resdetatmos: 384
resdetocean: 0.25
nens: 0
interval: 6
interval: 0
start: warm
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
idate: 2021063018
edate: 2021070306
#icsdir: /scratch1/NCEPDEV/climate/Jessica.Meixner/cycling/IC_2021063000_V2
icsdir: /work/noaa/da/gvernier/ensda/ictest/1440x1080x75/
#icsdir: /work/noaa/da/gvernier/ensda/ictest/1440x1080x75/
icsdir: /scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/prepics/hybrid-test/
yaml: {{ HOMEgfs }}/ci/cases/gfsv17/marine3dvar.yaml
3 changes: 2 additions & 1 deletion ci/cases/gfsv17/C384mx025_hybAOWCDA.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ arguments:
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
idate: 2021063018
edate: 2021070306
icsdir: /work/noaa/da/gvernier/ensda/ictest/1440x1080x75/
#icsdir: /work/noaa/da/gvernier/ensda/ictest/1440x1080x75/
icsdir: /scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/prepics/hybrid-test/
yaml: {{ HOMEgfs }}/ci/cases/gfsv17/marinehyb.yaml
5 changes: 5 additions & 0 deletions ci/cases/gfsv17/marine3dvar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ base:
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
DO_TEST_MODE: "YES"

prepoceanobs:
use_exp_obs: "YES"
dmpdir_exp: /scratch1/NCEPDEV/da/common/

marineanl:
SOCA_INPUT_FIX_DIR: {{ HOMEgfs }}/fix/gdas/soca/1440x1080x75/soca
SOCA_ANL_GEOM: {{ HOMEgfs }}/fix/gdas/soca/720x540x75/soca
SOCA_OBS_LIST: {{ HOMEgfs }}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml
SOCA_NINNER: 100
7 changes: 6 additions & 1 deletion ci/cases/gfsv17/marinehyb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ base:
FHMAX_GFS: 240
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}

prepoceanobs:
use_exp_obs: "YES"
dmpdir_exp: /scratch1/NCEPDEV/da/common/

marineanl:
SOCA_INPUT_FIX_DIR: {{ HOMEgfs }}/fix/gdas/soca/1440x1080x75/soca
SOCA_NINNER: 20 # revert to ~100 after the memory leak is fixed
SOCA_ANL_GEOM: {{ HOMEgfs }}/fix/gdas/soca/720x540x75/soca
SOCA_NINNER: 100
1 change: 1 addition & 0 deletions parm/config/gfs/config.marineanl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export JCB_ALGO_YAML_VAR=@JCB_ALGO_YAML_VAR@
export MARINE_OBS_YAML_DIR="${PARMgfs}/gdas/soca/obs/config"
export MARINE_OBS_LIST_YAML=@SOCA_OBS_LIST@
export SOCA_INPUT_FIX_DIR=@SOCA_INPUT_FIX_DIR@
export SOCA_ANL_GEOM=@SOCA_ANL_GEOM@
export SOCA_NINNER=@SOCA_NINNER@
export DOMAIN_STACK_SIZE=116640000 #TODO: Make the stack size resolution dependent
export SOCA_ENS_BKG_STAGE_YAML_TMPL="${PARMgfs}/gdas/soca/soca_ens_bkg_stage.yaml.j2"
Expand Down
35 changes: 19 additions & 16 deletions parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -509,23 +509,26 @@ case ${step} in
walltime="00:10:00"
ntasks=1
threads_per_task=1
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
tasks_per_node=${max_tasks_per_node}
memory="24GB"
;;

"prepoceanobs")
walltime="00:10:00"
ntasks=1
threads_per_task=1
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
tasks_per_node=${max_tasks_per_node}
memory="48GB"
;;

"marinebmat")
npes=16
ntasks=16
case ${OCNRES} in
"025") ntasks=480;;
"025")
ntasks=480
memory="256GB"
;;
"050") ntasks=16;;
"100") ntasks=16;;
"500") ntasks=16;;
Expand All @@ -537,15 +540,15 @@ case ${step} in
walltime="00:30:00"
threads_per_task=1
export is_exclusive=True
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
tasks_per_node=$(( max_tasks_per_node / 2 ))
;;

"marineanlvar")
ntasks=16
case ${OCNRES} in
"025")
ntasks=480
memory="96GB"
memory="256GB"
;;
"050")
ntasks=16
Expand All @@ -564,18 +567,18 @@ case ${step} in
exit 4
esac

walltime="00:15:00"
walltime="00:30:00"
threads_per_task=1
export is_exclusive=True
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
tasks_per_node=$(( max_tasks_per_node / 2 ))
;;

"ocnanalecen")
ntasks=16
case ${OCNRES} in
"025")
ntasks=40
memory="96GB"
memory="256GB"
;;
"050")
ntasks=16
Expand All @@ -595,17 +598,17 @@ case ${step} in
esac

walltime="00:10:00"
threads_per_task=1
export is_exclusive=True
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
threads_per_task=1
tasks_per_node=$(( max_tasks_per_node / 2 ))
;;

"marineanlletkf")
ntasks=16
case ${OCNRES} in
"025")
ntasks=480
memory="96GB"
memory="256GB"
;;
"050")
ntasks=16
Expand All @@ -624,18 +627,18 @@ case ${step} in
exit 4
esac

walltime="00:10:00"
threads_per_task=1
walltime="00:30:00"
export is_exclusive=True
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
threads_per_task=1
tasks_per_node=$(( max_tasks_per_node / 2 ))
;;


"marineanlchkpt")
walltime="00:10:00"
ntasks=1
threads_per_task=1
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
tasks_per_node=${max_tasks_per_node}
case ${OCNRES} in
"025")
memory="128GB"
Expand All @@ -659,7 +662,7 @@ case ${step} in
walltime="00:30:00"
ntasks=${max_tasks_per_node}
threads_per_task=1
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
tasks_per_node=${max_tasks_per_node}
;;

"ocnanalvrfy")
Expand Down
1 change: 1 addition & 0 deletions parm/config/gfs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ snowanl:

marineanl:
SOCA_INPUT_FIX_DIR: "${FIXgfs}/gdas/soca/72x35x25/soca"
SOCA_ANL_GEOM: "${FIXgfs}/gdas/soca/72x35x25/soca"
SOCA_OBS_LIST: "${PARMgfs}/gdas/soca/obs/obs_list.yaml" # TODO: This is also repeated in oceanprepobs
SOCA_NINNER: 100
JCB_ALGO_YAML_VAR: "${PARMgfs}/gdas/soca/marine-jcb-3dfgat.yaml.j2"
Expand Down
31 changes: 19 additions & 12 deletions parm/gdas/soca_bmat_jedi_config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,42 @@ soca_diagb:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_soca_diagb.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_diagb
soca_chgres:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jedi_args: ['soca', 'convertstate']
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_chgres
soca_parameters_diffusion_vt:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_soca_error_covariance_toolbox.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_parameters_diffusion_vt
soca_setcorscales:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_soca_setcorscales.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_setcorscales
soca_parameters_diffusion_hz:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_soca_error_covariance_toolbox.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_parameters_diffusion_hz
soca_ensb:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_ens_handler.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_ensb
soca_ensweights:
rundir: '{{ DATA }}'
exe_src: '{{ EXECgfs }}/gdas_socahybridweights.x'
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_ensweights
mpi_cmd: '{{ APRUN_MARINEBMAT }}'
jcb_base_yaml: '{{ PARMgfs }}/gdas/soca/marine-jcb-base.yaml'
jcb_algo: soca_ensweights
10 changes: 7 additions & 3 deletions ush/python/pygfs/task/marine_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,13 @@ def _prep_scratch_dir(self: Task) -> None:
soca_fix_list = parse_j2yaml(self.task_config.SOCA_FIX_YAML_TMPL, self.task_config)
FileHandler(soca_fix_list).sync()

# prepare the MOM6 input.nml
# prepare the deterministic MOM6 input.nml
mdau.prep_input_nml(self.task_config)

# prepare the input.nml for the analysis geometry
mdau.prep_input_nml(self.task_config, output_nml="./anl_geom/mom_input.nml",
simple_geom=True, mom_input="./anl_geom/MOM_input")

# stage the soca utility yamls (gridgen, fields and ufo mapping yamls)
logger.info(f"Staging SOCA utility yaml files from {self.task_config.PARMsoca}")
soca_utility_list = parse_j2yaml(self.task_config.MARINE_UTILITY_YAML_TMPL, self.task_config)
Expand All @@ -206,7 +210,7 @@ def _prep_variational_yaml(self: Task) -> None:
envconfig_jcb['PARMgfs'] = self.task_config.PARMgfs
envconfig_jcb['NMEM_ENS'] = self.task_config.NMEM_ENS
envconfig_jcb['berror_model'] = 'marine_background_error_static_diffusion'
if self.task_config.NMEM_ENS >= 3:
if self.task_config.NMEM_ENS >= 2:
envconfig_jcb['berror_model'] = 'marine_background_error_hybrid_diffusion_diffusion'
envconfig_jcb['DATA'] = self.task_config.DATA
envconfig_jcb['OPREFIX'] = self.task_config.OPREFIX
Expand Down Expand Up @@ -365,7 +369,7 @@ def list_all_files(dir_in, dir_out, wc='*', fh_list=[]):
post_file_list = []

# Make a copy the IAU increment
post_file_list.append([os.path.join(anl_dir, 'inc.nc'),
post_file_list.append([os.path.join(anl_dir, 'ocn.inc.nc'),
os.path.join(com_ocean_analysis, f'{RUN}.t{cyc}z.ocninc.nc')])

domains = ['ocn', 'ice']
Expand Down
13 changes: 11 additions & 2 deletions ush/python/pygfs/task/marine_bmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self, config):

# Create dictionary of Jedi objects
expected_keys = ['gridgen', 'soca_diagb', 'soca_parameters_diffusion_vt', 'soca_setcorscales',
'soca_parameters_diffusion_hz', 'soca_ensb', 'soca_ensweights']
'soca_parameters_diffusion_hz', 'soca_ensb', 'soca_ensweights', 'soca_chgres']
self.jedi_dict = Jedi.get_jedi_dict(self.task_config.JEDI_CONFIG_YAML, self.task_config, expected_keys)

@logit(logger)
Expand Down Expand Up @@ -105,9 +105,13 @@ def initialize(self: Task) -> None:
soca_fix_list = parse_j2yaml(self.task_config.SOCA_FIX_YAML_TMPL, self.task_config)
FileHandler(soca_fix_list).sync()

# prepare the MOM6 input.nml
# prepare the deterministic MOM6 input.nml
mdau.prep_input_nml(self.task_config)

# prepare the input.nml for the analysis geometry
mdau.prep_input_nml(self.task_config, output_nml="./anl_geom/mom_input.nml",
simple_geom=True, mom_input="./anl_geom/MOM_input")

# stage backgrounds
# TODO(G): Check ocean backgrounds dates for consistency
bkg_list = parse_j2yaml(self.task_config.MARINE_DET_STAGE_BKG_YAML_TMPL, self.task_config)
Expand All @@ -127,6 +131,7 @@ def initialize(self: Task) -> None:
# initialize JEDI applications
self.jedi_dict['gridgen'].initialize(self.task_config)
self.jedi_dict['soca_diagb'].initialize(self.task_config)
self.jedi_dict['soca_chgres'].initialize(self.task_config)
self.jedi_dict['soca_parameters_diffusion_vt'].initialize(self.task_config)
self.jedi_dict['soca_setcorscales'].initialize(self.task_config)
self.jedi_dict['soca_parameters_diffusion_hz'].initialize(self.task_config)
Expand Down Expand Up @@ -163,11 +168,15 @@ def execute(self) -> None:
None
"""

# soca grid generation
self.jedi_dict['gridgen'].execute()

# variance partitioning
self.jedi_dict['soca_diagb'].execute()

# Interpolate f009 bkg to analysis geometry
self.jedi_dict['soca_chgres'].execute()

# horizontal diffusion
self.jedi_dict['soca_setcorscales'].execute()
self.jedi_dict['soca_parameters_diffusion_hz'].execute()
Expand Down
11 changes: 8 additions & 3 deletions ush/python/pygfs/utils/marine_da_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def link_executable(task_config: AttrDict, exe_name: str) -> None:


@logit(logger)
def prep_input_nml(task_config: AttrDict) -> None:
def prep_input_nml(task_config: AttrDict,
output_nml: str = "mom_input.nml",
simple_geom: bool = False,
mom_input: str = "MOM_input") -> None:
"""Prepare the mom_input.nml file
"""
# stage input.nml.j2
Expand All @@ -56,9 +59,11 @@ def prep_input_nml(task_config: AttrDict) -> None:
# swap date and stacksize
date_init = [int(s) for s in task_config.MARINE_WINDOW_END.strftime('%Y,%m,%d,%H,%M,%S').split(',')]
input_nml_config = {'domain_stack_size': task_config.DOMAIN_STACK_SIZE,
'date_init': date_init}
'date_init': date_init,
'simple_geom': simple_geom,
'mom_input': mom_input}
jinja_input_nml = jinja.Jinja(mom_input_nml_tmpl, input_nml_config)
jinja_input_nml.save('mom_input.nml')
jinja_input_nml.save(output_nml)


@logit(logger)
Expand Down
2 changes: 1 addition & 1 deletion versions/fix.ver
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export cpl_ver=20230526
export datm_ver=20220805
export gdas_crtm_ver=20220805
export gdas_fv3jedi_ver=20241115
export gdas_soca_ver=20240802
export gdas_soca_ver=20240919
export gdas_gsibec_ver=20240416
export gdas_obs_ver=20240213
export gdas_aero_ver=20240806
Expand Down