*CONTENTS:
1 domian setup with #geogrid;
2 pre-process grib files with #ungrib;
3 running #metgrid.
4 compliment: some utility programs that are distributed with the wps (why use these utility programs)
5 some common mistakes(examples without very good error messages)
*#GEOGRID
*STEP1.1 EDITTING
*edit a file called namelist.wps to define our model domians, which is a fortran namelist file and txt file in nature.
*ps constructure of namelist file, group& is sector of entire description text : 1, &share (shared namelist group) is shared by all wps programs; 2, other namelist groups& whose name matches the program that you will run (eg: &geogrid, before running geogrid program we'll edit geogrid namelist group)
*&share: 1,>wrf_core='ARW';(or 'NMM', not recommended) 2, max _domain(number of domians that the geogrid program is going to process, eg: single domian >max_domian=1;).
*optionally略 设置产生的output文件地址,还有格式
*&geogrid(geogrid namelist record)
*the impression of the contain below:
Part1
>map_projection='lambert';投影;
>truelat=45.0; >truelat=30.0; 真实纬线;
>stand_lon=-105.25; 平行于y轴的标准经线;
ps there is a table (appendix) for map projection with their separate own parameters in page 31
Part2
>ref_lat=40.0; >ref_lon -105.25; reference latitude and longitude which are geometric center几何of domain中心;
Part3
>e_we=220; >e_sn=175; number of grid points(velocity staggered points);
>dx=15000; dy=15000; unit is meter(ignore map scale factors);
Part4 geographical data set
>geog_data_path='/data/static/geog/'; specify the path to geographical data sets (uncompressed) to interpolate (downloaded typically一般 at the same time as when we downloaded the wps source code)
>geog_data_res='default'; specify different sources or resolutions of geographical data, here we simply set it to default.(should match one of the resolutions of data in the GEOGRID.TBL)
*STEP2: issue >./geogrid.exe to run;
*GEOGRID.TBL: aggregation of entries that will be parsed by geogrd暂略
*geogrid.log file, a file records information from the screen when the running geogrid write messages. we can check it to verify if we are successful or search clues about mistakes inherent.
*here is the contain:
1, Parsed 11 entries in geogrid.tbl; the number of entries词目 which parsed解析 in file called geogrid.tbl(now ignore it)
2, Processing domian 1 of 1; how many domians geogrid is processing.
3, processing XLAT and XLONG
processing...
...
!Successful completion!;
*geo_em.d0N.nc, the output of geogrid, ps it is worthy of ncviewing the contains in the nc file to verify if it is reasonable.
?*choice of GEOGRID.TBL, by linking the correct file略 to GEOGRID.TBL in the geogrid directory or specify parameter in the namelist略
?*more details on the meaning and possible values for each variable略
*#UNGRIB
a program pre-processes meteorological data from GRIB files.
STEP1:Editing namelist.wps file
*&share(shared namelist record)
>wrf_core='ARW'; >max_dom=1;
>start_date='2006-04-01_00:00:00';
>end_data ='2006-04-01_12:00:00'; specify the day at which the ungrib program begins/stops processing GRIB data
>interval_seconds=21600; specify the interval (unit second) at which the ungrib program will write out in intermediate files.
*ps can be choosn to be a #higher frequency for interpolate different sources of grid data ( provide at different frequencies) to a common (finer) frequency;
&ungrib:
>prefix='GFS'; this gives prefix of intermediate files to be created by the ungrib.赋予了intermediate file前缀虽然不知道干啥eg: XYZ will give intermediate files named: XYZ: yyyy-mm-dd_hh.
ps can include path information
*STEP2, LINK Vtable
*link or copy the correct Vtable(some in the WPS/ungrib/Variable_Tables directory) into our run directory.
*Vtable: files corresponding to different sources(gfs data, ecmwf data) of grib data, which are provided (in the directory) with the WPS.这个是不是就是伴生grib的描述文件啊
*#mechanism of Vtable: the ungrib expects to find Vtable(with no suffix) in the run directory (先cd进去)是想在run directory里面找Vtable得到关于GRIB文件的内容吧
>ln -s ungrib/Variable_Tables/Vtable.GFS Vtable;
>ls Vtable;
Vtable -> ungrib/Variable_Tables/Vtable.GFS
*STEP3: LINK GRIB
link grib(besides Vtable) to the run directory with expected file names like GRIBFILE.AAA, GRIBFILE.AAB, GRIBFILE.AAC.
>link_grib.csh /data/GRIB/CFS/gfs*; 这是通过cshell脚本-csh运行link函数以处理很多的文件,后面目录是参数
>ls GRIBFILE.*
GRIBFILE.AAA -> /data/GRIB/CFS/gfs_060401_00_00;
*STEP4: RUN UNGRIB
(command line):东西呢?
*contains on the screen and .log file. above the table is some description about time(start and end time corresponding to the namelist sets), format and whatever, the #table below shows:
*ungrib extract pressure from grib file and list it on the first colunm(surface level is denoted as 2001.0 and sea level data is 2013).besides pressure, on the first row, the posterior are names of variable field. the bulk of the table contains symbol 'x' meaning the data exists 'o' meaning the data is absent(out).
*ps, this table is printed to the screen and a log file from when running ungrib.
*STEP5: CHECK
*if the ungrib #successful, we are expected to see a message on the terminal screen and in the log file. if there was an error, check message in ungrib's printout or in the ungribbed.log file.
*ps common errors: 1, incorrect date format specification in the &share namelist, 2, accidentally, symbolic link files are not grib files. or GRIB2 data was used with a version of WPS compiled without GRIB2 library.
*STEP6:OUTCOME
*intermediate files, output files called like GFS:2006-04-01-00, GFS:2006-04-01-06...etc in our run directory, the prefix is what we set in the namelist file.
*#METGRID
*introduction: now we have set up a domian with the geogrid program and preprocess some grib data with the ungrib program. so we can horizontally #interpolate those meteorological fields from grib data into our modle domain using metgrid program.
*STEP1: EDIT
&share: already setted in ungrib program
*#&metgrid:
*>fg_name = 'GFS'; first guess, this is the data set that will be used as the first guess (initial conditions and also boundary conditions).不理解诶是指用对应的GRIB文件作为初始条件吗, typically match the prefix given to ungrib.
*>constants_name='SST:2006-04-01_00'; optional name(所以就是某个intermediate file的名字喽) of an intermediate file with fields to be used for every time period(fields that holds constant for our entire model simulation)
STEP2: scenery when #RUNNING
*Contains on the terminal screen and log filel:
*>Processing domain 1 of 1; is the number of domians that are being processed by the metgridw
*> SST:2006-04-01_00; fields for constant files(given using >constants_name=; in namelist.wps)will be processed first, the horizontal interpolated constant fields will then be replicated for all of time periods.
>Processing 2006-04-01_00;
GFS;
>Processing 2006-04-01_06;
GFS;
>Processing 2006-04-01_12;
GFS;
*metgrid will enter a time loop from start time to end time every interval seconds and for every prefix specified(set in namelist file with fg_name namelist variable), and process that intermediate file with a given prefix at the time period being processed.
*after propossing all time period for one domian(loop), it will process for the next domian.
STEP3: CHECK and OUTPUT
*check if the metgrid run successfully on screen and log file, if not, check the metgrid.log file for indication
*met_em*.nc: the outcomes are a set of netcdf files (for multiple time periods for initial and lateral boundary conditions) in our run directory whose name looks like:
met_em.d01.2006-04-01_00.nc;
met_em.d01.2006-04-01_06.nc;
met_em.d01.2006-04-01_12.nc.
*In order to make these data available in other dorectory, we can move(mv) or link(ln -s) WPS/metgrid output files(listed above) to the current directory(eg: test/em_real), the command line can be:
cd test/real;
ln -s ../../../WPS/met_em.d01.*;
*UTILITIES
*Besides geogrid, ungrib and metgrid, some simple utility programs are distributed with WPS, here is an #introduction:
1checking the contents of intermediate files,
2 listing contents of GRIB1&2 files
3 help locating the model domians
4 computing 3d pressure field for ECMWF data
ps some programs use NCAR Graphics libraries for plotting, you will need to install NCAR graphics first.
*1, plotgrids.ncl: which parses the namelist file (this file is enough) and produces a x11 plot showing the position of all the model domians defined in that namelist(so no need to run geogrid).
*therefore, we can use it to #iteratively refine (take a look and change the namelist.wps and re-run) the location of your domians
*2, rd_intermediate: reads and then lists information about the fields found in an intermediate-format file(ungrib.exe)
*visualize programs
3, int2nc + plotfmt_nc.ncl (a pair)
*int2nc: a compiled program converts an intermediate format file to a nc file;
*ncview: directly visualized .nc file
*nc.ncl an alternative visualize tool (nice publication quality plot)
*4, g1print and g2print: to see a list(on screen) of all of the fields available in either GRIB1 or GRIB2 file. these programs take as a single command line argument viz the name of GRIB file.
*useful eg: if your intermediate file miss a particular level for a field, it can verify the level of the field.
*5, calc_ecmwf_p: compute a three- dimensional pressure geopotential height and relative humidity field for model level european center data.简单说就是通过将一个intermediate file里面的数据计算成如上三个变量,并存到另一个intermediate file。注意由于这两个file的title不一样,所以fg_name需要多设置几个以匹配(具体设置略)
*A COUPLE OF COMMON MISTAKES
*1, provide the metgrid.exe with atmospheric variable fields don't all contain the same number of vertical #levels. >Warning DIM 4, NAME num_metgrid_levels...;
*debug: try setting debug_level in &share namelist and checking metgrid.log for a table showing which fielda are available in each level.
*2, the metgrid.exe will stop if the model domian has grid points not #covered by data
*3, for native vertical coordinate data sets对于原生垂直数据集(eg RUCb,ECMWF), ensure that both pressure and geopotential height fields are available (real.exe need).