How can I obtain 3DVar static B files for a regional MPAS-JEDI?

I am currently using MPAS-JEDI to perform 3DVar data assimilation for a regional forecast, but I am unable to find suitable static BE (background error covariance) files for my domain(15km, 1000km radius domain). The tutorial doesn’t seem to provide instructions for generating background error covariance by myself, and my current computing resources cannot support using ensemble forecasting。

I noticed that the NMC method can be used to generate BE files, but I’m curious whether mpasjedi_error_covariance_toolbox.x supports using regional forecast outputs as input. Additionally,I got fatal error without log*.err file when I run BJ’ programs using regional f48-f24 result cutting from global domain. there seems to be an issue with computing stream functions in regional configurations?

I also noticed some researchers use interpolation methods to downscale coarse-resolution BE (e.g., 60km) to their regional domains. I’d like to seek assistance on this approach.

Hi, @CGC.

Thank you for your interest in MPAS-JEDI. We have a limited resource for user support, especially this B training part. However, we are preparing the hands-on practice and some documentation to generate the static background error statistics in upcoming tutorial in June 2025. The materials and test dataset should be available to generic users after the event.

For your question, mpasjedi_error_covariance_toolbox.x can handle the regional forecast outputs as an input. In this case, however, it can only estimate the univariate B (without cross variable covariance).

Or did you first convert the zonal/meridional winds to stream function and velocity potential in the global mesh, then interpolate (or cut) to your regional mesh ? I have not tried this before, but in principal this will work.

Yes, we can interpolate the B statistics into different horizontal mesh (even regional). We may include this part in the tutorial.

Thank you,
BJ

Hi there, How to generate global BE matrix for a variable 60-15-km domain? I used to run all test runs, but now I wanted to create a good BE for my 60-15-km variable mesh. Thanks, Minghua

Hi @Minghua-UCSD ,

As posted above, we will share the scripts and documentation on generating own B statistics after the upcoming tutorial. In principle, the training should work with a variable mesh.

Thank you,
BJ

Thanks so much BJ. Does the tutorial provide online attendance option? If so, do you mind sharing with me the registration information? Thanks for your time!

Does the tutorial provide online attendance option?

From the information page, it doesn’t seem to provide the online attendance option. --BJ

No problem. I look forward to the updates after the tutorial.

Hi, is the tutorial available?

Hi @CGC (and @Minghua-UCSD ) ,

Sorry for the late reply.

You can find the newly added chapter 9 in the latest mpas-jedi tutorial here: https://www2.mmm.ucar.edu/projects/mpas-jedi/tutorial/202506NCAS

and testdata

https://www2.mmm.ucar.edu/projects/mpas-jedi/tutorial/202506NCAS/testdata/

.

FYI: We are also planning a MPAS-Atmosphere and MPAS-JEDI tutorial in September 2025 (see the announcement from MPAS-Atmosphere and MPAS-JEDI Tutorials | Mesoscale & Microscale Meteorology ).

Thank you,

BJ

Hi BJ,

Thanks a lot for your support. I went through tutorial section 9 to create my own static B Matrix, and I finally managed to get it working. The issue appeared when I tried to use it with 3DVAR DA (with MPAS-JEDI).

On my first attempt, I got an error: “wrong size for dimension nl0” in NICAS read. After looking into the code (type_nicas_blk), I found that the problem was with surface_pressure. The code compares the number of levels in the file with geom%nl0 and it stops if different. In the files, there is only 1 level (which I believe is correct, since surface_pressure is 2D), but geom%nl0 is 55 (the total model levels).

So, why doesn’t the code recognize that surface_pressure has only one level? Why does it try to read more than one level for surface_pressure? Should I generate NICAS files by repeating the same level up to 55 so that all variables have the same number of levels? If so, how can this be done?

Here is one example of a local NICAS file:

ds = Dataset(“mpas_nicas_local_000256-000001.nc”, mode=‘r+’)
surface_pressure = ds.groups[“surface_pressure”]
surface_pressure
<class ‘netCDF4._netCDF4.Group’>
group /surface_pressure:
ncmp: 1
dimensions(sizes): nl0(1)
variables(dimensions):
groups: cmp_1

So nl0 is 1.

Do you have any idea how I could solve this?

Thanks again!

Hi @Eder ,

I am glad to hear that you could go through the tutorial section 9 and generated your own static B.

From the tutorial hands-on material, would you take a look at Bflow_global120km/5_SO.bash file ?

Inside that file, there exist an additional yaml part under saber central block.read key, which is…

        grids:
          - model:
              variables:
              - stream_function
              - velocity_potential
              - temperature
              - spechum
          - model:
              variables:
              - surface_pressure

Your yaml file for 3DVAR DA needs to include this section.

There are some differences between the NICAS files of the pre-generated static B (which is used for the hands-on practice) and section 9.

  • In the pre-generated static B, the NICAS files are generated with all variables together. In this case, surface_pressure also has nl0=55, and NICAS will handle those non-physical levels as missing values. In this case, we don’t need to set grids key in the yaml file.
  • In the section 9, the NICAS files are generated for each variables separately, then merged later. In this case, surface_pressure will contain nl0=1, as you investigated. In this case, we need to set a different set of grids as shown above.

Hope this help other users, too and please be careful on the indentation when you add grids to your yaml file. grids section is the same indentation as drivers section under read.

Thank you,

BJ

Hi BJ,

Thank you very much for your reply. I included the grid section in my YAML file as you suggested, and it worked perfectly. I was able to run 3DVAR DA using my own B matrix. Many thanks!

Glad to hear that @Eder! --BJ

Hi BJ, @byoung-joo

I am looking to generate my own B matrix, but I’ve found that I cannot access the test data mentioned above.

Would it be possible for you to provide the scripts from Chapter 9 of the latest MPAS-JEDI tutorial?

Thank you!

KJ

Hi @KJLin ,

The following is the link for the latest mpas-jedi tutorial.

Hope this helps!

Thank you,
BJ

Hi BJ,

Thanks for sharing !!

KJ

1 Like

Hi BJ, @byoung-joo

I am trying to generate a B Matrix for my regional domain with a uniform resolution of 60 km. In the .yaml file created in 1_run_vbal.bash, is it necessary to change anything?

During the processing step, specifically when running this code, I get the following error:

===================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= PID 3915077 RUNNING AT n19
= EXIT CODE: 9
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES

[proxy:0@n18] HYD_pmcd_pmip_control_cmd_cb (proxy/pmip_cb.c:487): assert (!closed) failed
[proxy:0@n18] HYDT_dmxu_poll_wait_for_event (lib/tools/demux/demux_poll.c:76): callback returned error status
[proxy:0@n18] main (proxy/pmip.c:122): demux engine error waiting for event
srun: error: n18: task 0: Exited with exit code 7
[mpiexec@n18] HYDT_bscu_wait_for_completion (lib/tools/bootstrap/utils/bscu_wait.c:109): one of the processes terminated badly; aborting
[mpiexec@n18] HYDT_bsci_wait_for_completion (lib/tools/bootstrap/src/bsci_wait.c:21): launcher returned error waiting for completion
[mpiexec@n18] HYD_pmci_wait_for_completion (mpiexec/pmiserv_pmci.c:189): launcher returned error waiting for completion
[mpiexec@n18] main (mpiexec/mpiexec.c:260): process manager error waiting for completion

Do you have any idea what this could be, or how I could fix it?

Thanks!

Hi @amandacarolsq ,

The error message doesn’t look familiar to me. B Matrix on the mpas regional mesh is a bit tricky. The provided script/procedure, which assumes the global mesh and multivariate B, might not work.

For regional mesh, univariate B can be obtained with some modification of provided scripts.
In this case, you need to generate the perturbation samples for {zonal wind, meridional wind, T, q, ps}, instead of {stream function, velocity potential, T, q, ps}.
For univariate B, step 1_run_vbal.bash is not required. You can proceed the next steps (i.e., hdiag … nicas), but with variable list of {zonal wind, meridional wind, T, q, ps}.

We may consider adding hands-on examples generating univariate B in future.

Thank you,
BJ

Hi BJ,

Thank you very much for your help! I will try these modifications. Is there any repository that contains the codes used to generate a regional B Matrix?

Hi @amandacarolsq,
Unfortunately, there is no example for regional B generation. Again, we will consider adding those in the foreseeable future.

Thank you,
BJ