Running WRF for PML UK configuration - pmlmodelling/WRF_installation GitHub Wiki

Testing WRF compilation

We are upgrading WRF suit from WRF 4.1.1, WPS 4.1. I don't know what version of metgrid and real were stored in Ceto. The upgrade will probably require updates to the Vtables and other control files.

GEOGRID.TBL has also been updated but I am not ready to try and re-run this part of the code as I have no experience with it.

The UNGRIB process should have worked with the "old" namelist.wps

This process has been aided by ChatGPT model 03mini

All files needed for a test simulation are stored in scylla

/work/shared/wrf/data

The steps include

  • Preprocess ECMWF or GFS met data
  • Process land terrain and land use for UK domain
  • Launch simulation

The steps in running WRF are summarised as (as the triggers in the WRF ROSE suite part of WCOOF)

write_wps_namelist => run_ungrib => run_metgrid => write_run_namelist => adjust_soil_levels => run_real => run_wrf

Preprocess GFS model output

The first step after downloading the GFS output is to write the WPS namelist

default = 	sed -i "s/start_date.*/start_date = '${YESTERDAY_WPS}','${YESTERDAY_WPS}','${YESTERDAY_WPS}',/g" namelist.wps;
			sed -i "s/end_date.* /end_date   = '${TOMORROW_WPS}','${TOMORROW_WPS}','${TOMORROW_WPS}',/g" namelist.wps;
			sed -i "s/interval_seconds.*/interval_seconds = 10800/g" namelist.wps;
			sed -i "s/opt_metgrid_tbl_path.*/opt_metgrid_tbl_path         = '${ROSE_DATA}'/g" namelist.wps;
			cp namelist.wps ${ROSE_DATAC};

The land use and topography data are in

/users/modellers/pica/Data/WRF/WPS/geog These are from 2013 so could be updated at some point if necessary.

Common WRF templates and scripts can be found in

/data/sthenno1/backup/pica/models/fvcom-projects/mycoast/run/wrf/
/data/sthenno1/backup/pica/models/WRF/pml-uk-wrf/grids/
and in Ceto
~/Models/WRF_common/

With the wps namelist written, we can run metgrid.exe to proccess the GFS downloaded data.

cd /work/shared/wrf/input
cp ../data/ancillary/link_grib.sh ./
cp ../data/ancillary/link_run_files.sh ./
cd /work/shared/wrf/data/GFS
source temp.sh # this builds the files in forecast_data directory
cd /work/shared/wrf/input
bash  link_run_files.sh # This links GFS downloaded files to present directory with 3 letter names (needs variables for time period to consider)
wrf_install # to load relevant modules 

# link with latest Vtable for GFS
ln -s /users/modellers/rito/Code/WPS/ungrib/Variable_Tables/Vtable.GFS ./Vtable
./ungrib.exe # this process the GFS files and converts them to FLX (?)
# copy uptodate METGRID.TBL
cp  /users/modellers/rito/Code/WPS/metgrid/METGRID.TBL.ARW ./METGRID.TBL 
# ln -s ../data/WRF_common/METGRID.TBL ./
ln -s ../data/WRF_common/geo_em.* ./
./metgrid.exe # to perform the interpolation to the specified domain

Next is to adjust the soil levels in the namelist.input file


source adjust_soil.sh 

# and adjust names in met_em files as 
for file in met_em.d03.*; do
    mv "$file" "${file//:/_}"
done
for file in met_em.d01.*; do     mv "$file" "${file//:/_}"; done
for file in met_em.d02.*; do     mv "$file" "${file//:/_}"; done

./real.exe

real.exe failes with the old Vtable and namelist.input. The error is not enough eta levels to reach p_top

I updated METGRID.TBL and namelist.wps to the latest versions in the github. Re-ran ungrib.exe and metgrid.exe. As far as I can tell, the changes haven't created different met_em files than before.

I updated namelist.input with the latest version but keeping the same options except for:

damp_opt                            = 3, # this was 0 before to improve stability
gwd_opt                             = 1,      0,     0, # this wasn't in the namelist before.  I  suspect this makes it more stable
auto_levels_opt                     = 1, # the default is 2. Probably would be a better option but needs e_vert, dzbot or p_top adjusted to work with newest WRF
ghg_input                           = 0,               ! Option to read CAMtr_volume_mixing_ratio files of green house gas values. Default is 1.

WRF expects some additional files found in WRF_common and in ~/Code/WRF/run such as:

cp ~/Code/WRF/run/RRTM_DATA .
cp ~/Code/WRF/run/VEGPARM.TBL .  # the one in WRF_common gave errors
cp ~/Code/WRF/run/LANDUSE.TBL .  # the one in WRF_common didn't give errors but I assume it is safer to use the latest TBL
cp  ~/Code/WRF/run/SOILPARM.TBL ./
cp  ~/Code/WRF/run/GENPARM.TBL ./