Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Soil T layers reversed in wrfinput from met_em files

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.


New member
Hi, I am using ERA-Interim reanalysis data to drive WRF 3.8.1 with Noah LSM. I don't know why the soil T layers are reversed in wrfinput (variable TSLB) from that in met_em (variable ST) files. It confuses me that I don't know which one should be correct. Please see the attached figures for 1990-10-01_00. Was this intentional? if yes, where it was done in the code and why? Screen Shot 2018-12-23 at 12.48.47 AM.png
I checked further. The GRIB file contains four layer soil T named STL1, STL2, STL3, and STL4, each has an indicator of soil depth. They are 0-7, 7-28, 28-100, 100-289 cm. Then in met_em file, there are two sets of soil T. One came directly from GRIB (I think) and have names ST000007, ST007028, ST028100, and ST100289. Obviously they have depth information. The plot show that these are consistent in GRIB and met_em. However, in met_em, there is a derived variable named ST, which has four layers. This ST variable shows reversed layers. The wrfinput TSLB is consistent with GRIB and those separate variables in met_em (I mean ST000007, ...). With a coldest time of year figures, it shows that the wrfinput data is correct, where near surface is colder than deeper layers. see the attached figures (NOTE: the first column in the three-column figure is variable ST in met_em):
Screen Shot 2018-12-24 at 12.51.36 AM.png Screen Shot 2018-12-24 at 1.09.04 AM.png

So, now the following 3 questions remain (if anyone knows where in the code relates to the questions):
1) How was the met_em derived variable ST generated? The METGRIB.TBL has the following lines:
# IF
fill_lev = 10 : ST000010(200100)
fill_lev = 40 : ST010040(200100)
fill_lev = 100 : ST040100(200100)
fill_lev = 200 : ST100200(200100)
fill_lev = 10 : ST000010(200100)
fill_lev = 35 : ST010035(200100)
fill_lev = 100 : ST035100(200100)
fill_lev = 300 : ST100300(200100)
fill_lev = 10 : ST000010(200100)
fill_lev = 200 : ST010200(200100)
fill_lev = 7 : ST000007(200100)
fill_lev = 28 : ST007028(200100)
fill_lev = 100 : ST028100(200100)
fill_lev = 289 : ST100289(200100)

2) How did real.exe choose to use which set of soil T variables to generate input files?
3) Since the wrfinput seems correct, the ST variable in met_em was probably not used, but why it was generated or why it was included in METGRID.TBL?

Thanks for any insights!
I did a test that real.exe do use the derived ST in met_em files to generate TSLB, and reversed the layers.

Another problem, real.exe created TSLB (soil T) with filled value zeros along coastal lines.

Still digging, but hope someone who is more knowledgeable about this to help me out.
met_em doesn't do any vertical interpolation. It simply reads in data from the input file, and horizontally interpolate these data to WRF grids.
REAL program will conduct vertical interpolation to put soil information to the model grids. It will process those data available, for example, if your input is ERA, then the soil data (e.g., ST000007, ST007028, ST028100, and ST100289, etc.) will be processed. ST is derived from the input SOIL T, which could at various levels depending on the input data.
Hi, Ming Chen:
Thanks for the reply and clarification.

In my case, we have four soil layers as from ERA and going into Noah. The layers and corresponding data are:

Layer# depth met_em met_em-derived wrfinput
layer 1: 000-007 cm ST000007 ST(4,:,:) TSLB(1,:,:)
layer 2: 007-028 cm ST007028 ST(3,:,:) TSLB(2,:,:)
layer 3: 028-100 cm ST028100 ST(2,:,:) TSLB(3,:,:)
layer 4: 100-289 cm ST100289 ST(1,:,:) TSLB(4,:,:)

I am just wondering in what part of the programs did it happen that the derived ST dimension for layers is organized as 4,3,2,1, and then where in the REAL made the TSLB layers organized as 1,2,3,4 that corresponds to the ST(4,...) to ST(1,...). If I am to provide a different soil T in addition and similar to the derived ST (at the same layers), how should I arrange the four layers? Do I need to provide layer depth information?
Please take a look at the code "share/module_soil_pre.F", in which you can find subroutine "process_soil_real". All soil data are processed there.