PXLSM Soil Nudging

Hello,

I am trying to get the PX soil nudging working for WRF according to this document

It seems like there is a lot of out of date practices on it since it was set up for WRF3.7.1 is there a better document of how to setup and run this. Is this still even a practice in WRF4

1 Like

Nothing is out of date. We use the same practices. For someone that is not familiar with WRF, PX or especially the long-used LittleR observation format it can be very confusing though because of the number of steps. Much like any data assimilation methodology. Be advised, these are for retrospective simulations. If you are running a forecast and think this will just help with the soil properties, it is not applicable.

The document above provides two links. One to Obsgrid (http://www2.mmm.ucar.edu/wrf/src/OBSGRID.tar.gz) and one to get a utility that converts MADIS obs files to LittleR format.

I would simplify things to start and not even worry about the LittleR files. You can run Obsgrid to get a wrfsfdda_d01 file for example that is used by the PX LSM for the soil nudging.

So to be more explicit,

  1. Run WPS geogrid.exe - ungrib.exe - metgrid.exe.

This results in met_em* files for each analysis time (e.g., met_em.d01.2008-02-29_12:00:00.nc)

  1. Compile Obsgrid via link above. Link all of these met_em* files into an Obsgrid run directory. Copy the namelist.oa file from the Obsgrid code and modify to reflect your time period of met_em* files.

  2. Create empty LittleR obs files with name convention like empty:2016-04-19_15 where the 2016-04-19_15 reflect the date and time of day (UTC). Again, this step will just create the soil nudging file that is based on your NOAA Grib file analysis dataset. This will allow the PX LSM soil nudging to work well. You will just have the ability to refine these soil nudging analyses if you provide the full LittleR files.

Once you run Obsgrid and then real.exe for WRF inputs you will have input files wrfbdy_d01 (from real.exe), wrfinput_d01 (from real.exe), wrffdda_d01 (from real.exe), wrflowinp_d01 (from real.exe) and wrfsfdda_d01 (from Obsgrid).

Then you can run WRF. If you want to email me directly I can help refine your namelist.input file. That will be easier if you supply that namelist from your real.exe run.

But these are some of the settings we use for 3D grid nudging (FDDA) and the indirect PX soil nudging.

&fdda
grid_fdda = 1,
grid_sfdda = 1,
pxlsm_soil_nudge = 1,
sgfdda_inname = “wrfsfdda_d01”,
sgfdda_end_h = 9999999,
sgfdda_interval_m = 180,
sgfdda_interval = 10800,
gfdda_inname = “wrffdda_d”,
gfdda_end_h = 999999,
gfdda_interval_m = 180,
fgdt = 0,
if_no_pbl_nudging_uv = 1,
if_no_pbl_nudging_t = 1,
if_no_pbl_nudging_q = 1,
if_zfac_uv = 0,
k_zfac_uv = 13,
if_zfac_t = 0,
k_zfac_t = 13,
if_zfac_q = 0,
k_zfac_q = 13,
guv = 0.0001,
gt = 0.0001,
gq = 0.00001,
guv_sfc = 0.0000,
gt_sfc = 0.0000,
gq_sfc = 0.0000,
if_ramping = 0,
dtramp_min = 60.0,
io_form_gfdda = 2,
rinblw = 250.0
/

1 Like

I can help walk through creating LittleR file, but would like to make sure the process above is in place. As said, using the NOAA analyses like GFS or NAM12 will work just find in PX with no point observations provided in the Obsgrid step. It is just that the reintroduction of surface point obs in the Obsgrid step will lead to a soil nudging file that is a little more tight with respect to the fit to observations so your statistical analysis of model performance would improve some. But just using the NAM12 alone will still give very good results.

Your response was very helpful! We are running retrospective simulations so we are hoping the nudging will help our results. Obsgrid and real.exe ran (seemingly) successful but WRF spit out, “Error trying to read metadata.” I believe the file it listed is from metgrid (I’ve attached a photo). Not sure if it is related to having empty data files that will be fixed when we use LittleR or if there’s a different issue.

Since our scaling is comparatively small (less than 10 km) I think observational nudging, as opposed to 3D grid nudging, is what we need to do for our simulations.

Hi all,

I am trying to run obsgrid. My main aim is to introduce PX Soil Nudging in WRF.

I have two doubts here:

  1. “Create empty LittleR obs files with name convention like empty:2016-04-19_15 where the 2016-04-19_15 reflect the date and time of day (UTC).”
    How to create empty LittleR files? Isn’t the surface and upper air observations essential for running ./obsgrid.exe?
  2. " As said, using the NOAA analyses like GFS or NAM12 will work just find in PX with no point observations provided in the Obsgrid step." Are you talking about the boundary conditions used in ungrib. I am using ERA5 data as the forcing. Will obsgrid work fine with ERA5?

Looking forward to any kind of help or guidance

Thank you

Here is a cshell script to create empty LittleR files for a start and end period as defined below. You need to create a empty file that is copied to other empty files with correct date format.

#!/bin/csh

set dir = /work/MOD3DEV/grc/obs/littleR
set outall = /work/MOD3DEV/grc/WPS4.0/domains/slc4.1.33/OBSGRID

mkdir -p $outall

set begday = 20170101
set endday = 20170223

set day = $begday

while ( $day <= $endday )

set dp1 = date -d "$day +1 days" '+%Y%m%d'

set yyyy = echo $day |cut -b1-4
set mm = echo $day |cut -b5-6
set dd = echo $day |cut -b7-8

set yyp1 = echo $dp1 |cut -b1-4
set mmp1 = echo $dp1 |cut -b5-6
set ddp1 = echo $dp1 |cut -b7-8

foreach hh ( 00 03 06 09 12 15 18 21 )
#foreach hh ( 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 )

set dirday = $yyyy$mm$dd$hh
set fileday = $yyyy-mm-{dd}_$hh

set allofile=$outall/empty.obs:$fileday

echo ‘========================================================================’
echo ‘Combined Little_R file -->’ $allofile

cp /home/grc/scripts/MADIS2LITTLER/emptyfile $allofile

end
set day = date -d "$day 1 days" '+%Y%m%d'
end # day yyyymmdd

exit

1 Like

Other parts of question 1… “Isn’t the surface and upper air observations essential for running ./obsgrid.exe?”

Obsgrid has several purposes. A key purpose is creating the wrfsfdda_d01 file for the Pleim-Xiu LSM indirect soil nudging. Yes, adding LittleR file with actual observations will improve the model evaluation statistics. But observations are not technically needed. You would just end up with the same NAM/GFS/ERA/HRRR analysis that is input to obsgrid. If you just need a wrfsfdda_d01 file to run WRF and think the input analysis is sufficiently accurate doing a reanalysis with complete observations may not be worth the effort. When we use the 3 km HRRR analysis for fine-scale modeling, we don’t think this reanalysis step is required because HRRR used 3D VAR with all observations anyhow. If we are using a 25 km GFS or 12 km NAM for 4 km WRF, we would want to do a reanalysis by providing full obs to Obsgrid so these coarser analyses are reanalyzed on the 4 km grid with surface observations.

2 Likes

Question 2…

Obsgrid is blind to the model analysis used. It uses met_em* files from the WPS Metgrid step. Metgrid reads intermediate files from the ungrib step. ERA can be used with Ungrib and then Metgrid, so Obsgrid has no problems with ERA if done correctly. We don’t a lot of experience with ERA, but it is evidently compatible with WPS. Best of luck.

1 Like

Hi @rgilliam

Thank you for your explanation. I was successfully able to run obsgrid.exe for my simulations. However now I am trying the same with another case (year) and its giving error.

I am facing an issue while running ./obsgrid.exe.


Time Loop Processing, date = 2022-01-21_18:00:00

Using ./empty.obs:2022-01-21_18 as obs input file

Number of observations successfully ingested: 0.
Number of empty observations discarded: 0.
Number of observations discarded outside of domain: 0.

There were no valid observations found within the domain for this time period.


      ERROR EXIT

For sea level pressure, request pressure level 1001 mb.
ERROR_EXIT in error_handler


I am not able to upload any files here.
Here are the details:

&record1
start_year = 2022
start_month = 01
start_day = 16
start_hour = 00
end_year = 2022
end_month = 01
end_day = 22
end_hour = 00
interval = 21600
/
I am getting files till metoa_em.d01.2022-01-21_12:00:00.nc and the obsgrid.exe is giving error at next time step.

How can I solve this.

So it ran for multiple days/hours with no issues with empty observation files correct?

If this is the case, the observations are not the issue. Look at the metem file.

met_em.d01.2022-01-21_18:00:00.nc file and see it if looks different in size and contents as the met_em.d01.2022-01-21_12:00:00.nc file. Especially pressure related fields.

If you put these two files on a google drive or something I can grab, I could take a look as well. I’m not sure I’ve experience this error before. Thanks.

Thank you for the reply.

Please find the files in this link:
https://drive.google.com/drive/folders/1ViixqaPJRH14HVq8F0w9ReJCulA4o29a?usp=drive_link

I just tried another episode from 2021 and obsgrid completed successfully.

I am sharing the log files of both the cases here.

As you pointed out met_em.d01.2022-01-21_18:00:00.nc file has two missing variables including PRES while all other files have PRES.

But then I was able to run wrf successfully with the met_em.d01.2022* files. So how do I fix this.

Kindly have a look and advice.

Looking forward to your help.

So a new 2021 case ran just fine. No issues.

But the 2022 case ran (WRF), but obsgrid did not?? I’m not clear on your specific issue with 2022. Thanks.