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

How to use the GLDAS data to drive WRF

Naidi R

New member
Hi,all.
I am trying to use the soil temperature and moisture data of GLDAS to replace the soil data of JRA55 to drive wrf.
I downloaded data in grib format(It also provides files in netcdf format) and tried to process these files with ungrib.exe, but I did not find the Vtable file for GLDAS under wps/ungrib/Variable_Tables.
How can I successfully convert the GLDAS file into an intermediate format that metgrid.exe can handle?


GLDAS_NOAH025_3H
  • SoilMoi0_10cm_inst = Soil moisture content (0-10 cm underground) (kg m-2)
  • SoilMoi10_40cm_inst = Soil moisture content (10-40 cm underground) (kg m-2)
  • SoilMoi40_100cm_inst = Soil moisture content (40-100 cm underground) (kg m-2)
  • SoilMoi100_200cm_inst = Soil moisture content (100-200 cm underground) (kg m-2)
  • SoilTMP0_10cm_inst = Soil temperature (0-10 cm underground) (K)
  • SoilTMP10_40cm_inst = Soil temperature (10-40 cm underground) (K)
  • SoilTMP40_100cm_inst = Soil temperature (40-100 cm underground) (K)
  • SoilTMP100_200cm_inst = Soil temperature (100-200 cm underground) (K)



My WPS version is 4.2 , WRF is 4.4


Really appreciate any help on this.
Naidi
 
Hi,all.
I am trying to use the soil temperature and moisture data of GLDAS to replace the soil data of JRA55 to drive wrf.
I downloaded data in grib format(It also provides files in netcdf format) and tried to process these files with ungrib.exe, but I did not find the Vtable file for GLDAS under wps/ungrib/Variable_Tables.
How can I successfully convert the GLDAS file into an intermediate format that metgrid.exe can handle?


GLDAS_NOAH025_3H
  • SoilMoi0_10cm_inst = Soil moisture content (0-10 cm underground) (kg m-2)
  • SoilMoi10_40cm_inst = Soil moisture content (10-40 cm underground) (kg m-2)
  • SoilMoi40_100cm_inst = Soil moisture content (40-100 cm underground) (kg m-2)
  • SoilMoi100_200cm_inst = Soil moisture content (100-200 cm underground) (kg m-2)
  • SoilTMP0_10cm_inst = Soil temperature (0-10 cm underground) (K)
  • SoilTMP10_40cm_inst = Soil temperature (10-40 cm underground) (K)
  • SoilTMP40_100cm_inst = Soil temperature (40-100 cm underground) (K)
  • SoilTMP100_200cm_inst = Soil temperature (100-200 cm underground) (K)



My WPS version is 4.2 , WRF is 4.4


Really appreciate any help on this.
Naidi
Note that:Convert soli moisture to m3/m3.
 
Hi Ming,

Thank you for your reply. I tried to follow the Vtable creation section of the instruction, which states "the meanings of the level fields are dependent on the "Level Type" field and are summarized in the following table"
levelcode_table.png
I checked the GRIB Code and Level Code of soil moisture and soil temperature in the GLDAS.grb file with g1print.exe. The following is the output.

Code:
----------------------------------------------------
 rec GRIB GRIB  Lvl  Lvl  Lvl         Time      Fcst
 Num Code name  Code one  two                   hour
----------------------------------------------------
   1 133            1    0    0  2015-03-01_00:00 + 00
   2 134            1    0    0  2015-03-01_00:00 + 00
   3 135            1    0    0  2015-03-01_00:00 + 00
   4 136            1    0    0  2015-03-01_00:00 + 00
   5 139            1    0    0  2015-03-01_00:00 + 00
   6 140            1    0    0  2015-03-01_00:00 + 00
   7 141            1    0    0  2015-03-01_00:00 + 00
   8 142            1    0    0  2015-03-01_00:00 + 00

***** End-Of-File on C unit   3

The Level Code here is 1 , both level 1 and level 2 are 0, which is different from the Level Code in the table.


I tried to set the vtable like this
Code:
GRIB | Level| Level| Level| metgrid  |  metgrid | metgrid                                  |
Code | Code |   1  |   2  | Name     |  Units   | Description                              |
-----+------+------+------+----------+----------+------------------------------------------+
 133 | 112  |   0  |  10  | SM000010 | kg m-2   | Soil moisture of 0-10 cm ground layer    |
 134 | 112  |  10  |  40  | SM010040 | kg m-2   | Soil moisture of 10-40 cm ground layer   |
 135 | 112  |  40  | 100  | SM040100 | kg m-2   | Soil moisture of 40-100 cm ground layer  |
 136 | 112  |  100 | 200  | SM100200 | kg m-2   | Soil moisture of 100-200 cm ground layer |
 139 | 112  |   0  |  10  | ST000010 | K        | T of 0-10 cm ground layer                |
 140 | 112  |  10  |  40  | ST010040 | K        | T of 10-40 cm ground layer               |
 141 | 112  |  40  | 100  | ST040100 | K        | T of 40-100 cm ground layer              |
 142 | 112  | 100  | 200  | ST100200 | K        | T of 100-200 cm ground layer             |
-----+------+------+------+----------+----------+------------------------------------------+

But the ungrib.log shows that ungrib.exe did not decode my grib file successfully. What do I need to fill in the Level Code in my Vtable?
 

Attachments

  • ungrib.log
    11.1 KB · Views: 5
  • GLDAS_NOAH025_3H.A20150301.0000.021.zip
    3.1 MB · Views: 4
Hi Ming,

Thank you for your reply. I tried to follow the Vtable creation section of the instruction, which states "the meanings of the level fields are dependent on the "Level Type" field and are summarized in the following table"
View attachment 9222
I checked the GRIB Code and Level Code of soil moisture and soil temperature in the GLDAS.grb file with g1print.exe. The following is the output.

Code:
----------------------------------------------------
 rec GRIB GRIB  Lvl  Lvl  Lvl         Time      Fcst
 Num Code name  Code one  two                   hour
----------------------------------------------------
   1 133            1    0    0  2015-03-01_00:00 + 00
   2 134            1    0    0  2015-03-01_00:00 + 00
   3 135            1    0    0  2015-03-01_00:00 + 00
   4 136            1    0    0  2015-03-01_00:00 + 00
   5 139            1    0    0  2015-03-01_00:00 + 00
   6 140            1    0    0  2015-03-01_00:00 + 00
   7 141            1    0    0  2015-03-01_00:00 + 00
   8 142            1    0    0  2015-03-01_00:00 + 00

***** End-Of-File on C unit   3

The Level Code here is 1 , both level 1 and level 2 are 0, which is different from the Level Code in the table.


I tried to set the vtable like this
Code:
GRIB | Level| Level| Level| metgrid  |  metgrid | metgrid                                  |
Code | Code |   1  |   2  | Name     |  Units   | Description                              |
-----+------+------+------+----------+----------+------------------------------------------+
 133 | 112  |   0  |  10  | SM000010 | kg m-2   | Soil moisture of 0-10 cm ground layer    |
 134 | 112  |  10  |  40  | SM010040 | kg m-2   | Soil moisture of 10-40 cm ground layer   |
 135 | 112  |  40  | 100  | SM040100 | kg m-2   | Soil moisture of 40-100 cm ground layer  |
 136 | 112  |  100 | 200  | SM100200 | kg m-2   | Soil moisture of 100-200 cm ground layer |
 139 | 112  |   0  |  10  | ST000010 | K        | T of 0-10 cm ground layer                |
 140 | 112  |  10  |  40  | ST010040 | K        | T of 10-40 cm ground layer               |
 141 | 112  |  40  | 100  | ST040100 | K        | T of 40-100 cm ground layer              |
 142 | 112  | 100  | 200  | ST100200 | K        | T of 100-200 cm ground layer             |
-----+------+------+------+----------+----------+------------------------------------------+

But the ungrib.log shows that ungrib.exe did not decode my grib file successfully. What do I need to fill in the Level Code in my Vtable?
Another way:convert GLDAS data to the Intermediate Format.
I just wonder where did you download GLDAS in grib format? The new GLDAS data are in netcdf.
 
Hi Ming,

Thank you for your reply. I tried to follow the Vtable creation section of the instruction, which states "the meanings of the level fields are dependent on the "Level Type" field and are summarized in the following table"
View attachment 9222
I checked the GRIB Code and Level Code of soil moisture and soil temperature in the GLDAS.grb file with g1print.exe. The following is the output.

Code:
----------------------------------------------------
 rec GRIB GRIB  Lvl  Lvl  Lvl         Time      Fcst
 Num Code name  Code one  two                   hour
----------------------------------------------------
   1 133            1    0    0  2015-03-01_00:00 + 00
   2 134            1    0    0  2015-03-01_00:00 + 00
   3 135            1    0    0  2015-03-01_00:00 + 00
   4 136            1    0    0  2015-03-01_00:00 + 00
   5 139            1    0    0  2015-03-01_00:00 + 00
   6 140            1    0    0  2015-03-01_00:00 + 00
   7 141            1    0    0  2015-03-01_00:00 + 00
   8 142            1    0    0  2015-03-01_00:00 + 00

***** End-Of-File on C unit   3

The Level Code here is 1 , both level 1 and level 2 are 0, which is different from the Level Code in the table.


I tried to set the vtable like this
Code:
GRIB | Level| Level| Level| metgrid  |  metgrid | metgrid                                  |
Code | Code |   1  |   2  | Name     |  Units   | Description                              |
-----+------+------+------+----------+----------+------------------------------------------+
 133 | 112  |   0  |  10  | SM000010 | kg m-2   | Soil moisture of 0-10 cm ground layer    |
 134 | 112  |  10  |  40  | SM010040 | kg m-2   | Soil moisture of 10-40 cm ground layer   |
 135 | 112  |  40  | 100  | SM040100 | kg m-2   | Soil moisture of 40-100 cm ground layer  |
 136 | 112  |  100 | 200  | SM100200 | kg m-2   | Soil moisture of 100-200 cm ground layer |
 139 | 112  |   0  |  10  | ST000010 | K        | T of 0-10 cm ground layer                |
 140 | 112  |  10  |  40  | ST010040 | K        | T of 10-40 cm ground layer               |
 141 | 112  |  40  | 100  | ST040100 | K        | T of 40-100 cm ground layer              |
 142 | 112  | 100  | 200  | ST100200 | K        | T of 100-200 cm ground layer             |
-----+------+------+------+----------+----------+------------------------------------------+

But the ungrib.log shows that ungrib.exe did not decode my grib file successfully. What do I need to fill in the Level Code in my Vtable?
Hi, Naidi.
I met the similar problem with you when I created the Vtable for GLDAS-2. How did you deal with that?
 
Hi Haiqingsong, how can we convert soil moisture from kg/m2 into m3/m3?? Could you please give me some suggestions or mathematical equations??
Thank you.

Best,
Chetan
You just need to divide the soil moisture by the thickness of the soil layer.
 
Hi all,
I have been attempting to utilize GLDAS_NOAH025 data to initialize soil moisture in my 3-way nested domain WRF simulation, but have been running into problems. I am able to run ungrib and metgrid using NAM meteorological inputs and GLDAS_NOAH025 soil moisture/temp fields, but the met_em outputs in my D01 do not look correct.

For example: Soil moisture 0-10cm D01
1702488548398.png

My D03 Soil moisture 0-10cm looks reasonable:
1702488802610.png

These are the steps I have done so far:

1). I downloaded the GLDAS data as netcdf files from GES DISC earth data, then converted soil moisture field units from kg/m^-2 to m^3/m^3 by dividing by the soil layer depth in mm. After this conversion of units, I convert the netcdf to grib format using the cdo tools. After the grb conversions I set the parameter table using these commands (GES DISC):

Setting grb parameter table:
cdo -f grb copy GLDAS_NOAH025.nc4 temporary.grb
cdo setpartabn,GLDAS_NOAH_parmtab.txt temporary.grb GLDAS_NOAH025.grb

2.) After these commands, I do a few other manipulations of the grib file variables to set the grib parameter table "Lvl code", "Lvll 1", and "Lvl 2" fields for the soil moisture and soil temperature variables. The girb file parameter table output is below (WPS/ungrib/g1print.exe file.grb)

1702488093908.png

3.) Once I have GLDAS soil moisture and soil temperature in a grib file with the appropriate parameter table information, I create a Vtable.GLDAS with the WPS/ungrib/Variable_Tables directory.

1702489266634.png

4.) I run WPS (ungrib.exe and metgrid.exe) using the following:

$ln -s ungrib/Variable_Tables/Vtable.NAM Vtable
$ ./link_grib.csh /uufs/chpc.utah.edu/common/home/daq-group4/WRFv4.5_NP/met_analysis_data/NAM/2017*.grb2
$ vi namelist.wps
interval_seconds = 21600,
&ungrib
prefix = 'NAM'
$ ./ungrib.exe

$ ./link_grib.csh /uufs/chpc.utah.edu/common/home/daq-group4/WRFv4.5_NP/SMOIS_test/GLDAS_grb_convert/GLDAS_20170430*.grb
$ ln -sf ungrib/Variable_Tables/Vtable.GLDAS Vtable
$ vi namelist.wps
interval_seconds = 21600,
&ungrib
prefix = 'GLDAS'
$ ./ungrib.exe

&metgrid
fg_name = 'NAM', 'GLDAS'
$ ./metgrid.exe

My metgrid completes successfully and I get met_em file outputs for each domain and date/time, but it seems something goes wrong and the soil moisture/temp fields are not gridded/interpolated correctly in D01.

My namelist.wps, Vtable.GLDAS, ungrib.log, and metgrid.log is attached.

Thanks for any help!
 

Attachments

  • ungrib.log.log
    6.7 KB · Views: 0
  • metgrid.log.log
    437.1 KB · Views: 0
  • namelist.wps.wps
    1,001 bytes · Views: 0
Hi all,
I have been attempting to utilize GLDAS_NOAH025 data to initialize soil moisture in my 3-way nested domain WRF simulation, but have been running into problems. I am able to run ungrib and metgrid using NAM meteorological inputs and GLDAS_NOAH025 soil moisture/temp fields, but the met_em outputs in my D01 do not look correct.

For example: Soil moisture 0-10cm D01
View attachment 11821

My D03 Soil moisture 0-10cm looks reasonable:
View attachment 11822

These are the steps I have done so far:

1). I downloaded the GLDAS data as netcdf files from GES DISC earth data, then converted soil moisture field units from kg/m^-2 to m^3/m^3 by dividing by the soil layer depth in mm. After this conversion of units, I convert the netcdf to grib format using the cdo tools. After the grb conversions I set the parameter table using these commands (GES DISC):

Setting grb parameter table:
cdo -f grb copy GLDAS_NOAH025.nc4 temporary.grb
cdo setpartabn,GLDAS_NOAH_parmtab.txt temporary.grb GLDAS_NOAH025.grb

2.) After these commands, I do a few other manipulations of the grib file variables to set the grib parameter table "Lvl code", "Lvll 1", and "Lvl 2" fields for the soil moisture and soil temperature variables. The girb file parameter table output is below (WPS/ungrib/g1print.exe file.grb)

View attachment 11820

3.) Once I have GLDAS soil moisture and soil temperature in a grib file with the appropriate parameter table information, I create a Vtable.GLDAS with the WPS/ungrib/Variable_Tables directory.

View attachment 11823

4.) I run WPS (ungrib.exe and metgrid.exe) using the following:

$ln -s ungrib/Variable_Tables/Vtable.NAM Vtable
$ ./link_grib.csh /uufs/chpc.utah.edu/common/home/daq-group4/WRFv4.5_NP/met_analysis_data/NAM/2017*.grb2
$ vi namelist.wps
interval_seconds = 21600,
&ungrib
prefix = 'NAM'
$ ./ungrib.exe

$ ./link_grib.csh /uufs/chpc.utah.edu/common/home/daq-group4/WRFv4.5_NP/SMOIS_test/GLDAS_grb_convert/GLDAS_20170430*.grb
$ ln -sf ungrib/Variable_Tables/Vtable.GLDAS Vtable
$ vi namelist.wps
interval_seconds = 21600,
&ungrib
prefix = 'GLDAS'
$ ./ungrib.exe

&metgrid
fg_name = 'NAM', 'GLDAS'
$ ./metgrid.exe

My metgrid completes successfully and I get met_em file outputs for each domain and date/time, but it seems something goes wrong and the soil moisture/temp fields are not gridded/interpolated correctly in D01.

My namelist.wps, Vtable.GLDAS, ungrib.log, and metgrid.log is attached.

Thanks for any help!
Hi @msghiatti ,
I am trying to do what you did here. However, i have encountered a difficulty at step 2. How you manage to manipulate Lvl code, Lvl one, and Lvl two on grib file?
 
@Chetan the process I used to manipulate the Lvl code, Lvl one, and Lvl two in the grb files composed of a few steps. I am not sure the way I did this is the best or most efficient method but I seem to have gotten it to work for me. For reference, I utilized the Climate Data Operating (cdo) tool heavily for this procedure. The cdo tool is a linux command line based tool which has many operations to manipulate and convert netcdf and grib files. The cdo user manual can be found here: https://code.mpimet.mpg.de/projects/cdo/embedded/index.html#x1-570002.1.1

Steps for manipulating Lvl code in grb files:
-------------------------------------------------------
1.) Complete step 1 in my previous post
-------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------------
2.) You need to set GRIB table Level codes and level bounds for soil moisture within GRIB file
------------------------------------------------------------------------------------------------------------------------------

Need to set:
SMOIS level code=112
SMOIS level one = lower_bound
SMOIS level two =upper_bound

-Set SMOIS 0-10cm Level code =112:

cdo -select,name=var133 -setltype,112 GLDAS_NOAH025_3H.A20170430.0000.021.grb GLDAS_zaxis.grb

COMPLETE the above ^^ for all SMOIS Levels

------------------------------------------------------------------------------
3.) Next set SMOIS variables with level types and bounds
------------------------------------------------------------------------------

-Set SMOIS var133 0-10 cm lower_bounds =0 and upper_bounds=10:

cdo setzaxis,myzaxis -genlevelbounds,zbot=0,ztop=10 GLDAS_zaxis133.grb GLDAS_bounds133.grb

This creates a grib file for each SMOIS variable/level type
COMPLETE the above ^^ for all SMOIS variables/levels so you have individual grb files from each SMOIS level

-For Example: Here I set the next level SMOIS var134 10-40 cm lower = 10 and upper = 40:

cdo setzaxis,myzaxis40 -genlevelbounds,zbot=10,ztop=40 GLDAS_zaxis134.grb GLDAS_bounds134.grb

-Continue for all SMOIS variables/parameters etc..

----------------------------------------------------------------------------------------------------------------
4.) Finally, merge all grib files of SMOIS variables made above in the above step ^^
----------------------------------------------------------------------------------------------------------------

cdo merge GLDAS_bounds133.grb GLDAS_bounds134.grb GLDAS_bounds135.grb GLDAS_bounds136.grb GLDAS_combined.grb

The above ^^ creates a grib file with 4 SMOIS levels with the correct level codes and bounds as shown in step 2 in my previous post and shown below:

1707498406409.png

Hope this helps
 
Top