CMA Grape User Guide

Contents

1. Introduction

  This document describes the procedure to install, compile and perform test case simulation using the mesoscale version of CMA GRAPES, also known as GRAPES_MESO.


  More information and real-time products of GRAPES_MESO from CMA can be accessed from this link: http://www.nmc.gov.cn/publish/nwp/grapes/




2. Installation of GRAPES_MESO

(a) Hardware requirements of GRAPES_MESO

  A minimum of 60 MB of disk space to uncompress, compile and execute GRAPES_MESO codes. The static or constant data require disk space of about 10 GB (440 MB in compressed format). Data volume of the testing case of GRAPES_MESO is about 2 GB.

(b) Software and Operating System Requirements

  Linux or UNIX system with Fortran and C compilers, GrADS (http://www.iges.org/grads/) and MPI (Message Passing Interface) environment.

  The required number of computation nodes and processors, and the disk volumes depend on the size of model coverage and model resolution.

(c) Methods to obtain the codes of GRAPES_MESO

  Source codes and materials of GRAPES_MESO from ACNF are provided for model research and development by registered users of ANCF. Permission must be obtained from CMA if GRAPES_MESO is used for operational activities.

(d) Contents of GRAPES_MESO package from ACNF

The following files can be downloaded from the ACNF web portal:

GRAPES_Meso3.1.0.1.tarSource code archive of GRAPES_MESO
STATIC_DATA.tar.gzStatic / constant data
TEST_DATA.tar Testing data



3. Preparation for Data and Compilation of GRAPES_MESO

(a) Source code

  Upon uncompressing of tarball of GRAPES_MESO (GRAPES_Meso3.1.0.1.tar), the following folders and files will be created under the model root directory named “GRAPES_Meso-3.1.0.1”:

4dvar/data assimilation system (support only 3DVAR mode at present)
data_proc/for processing and conversion of background field data into GRAPES_MESO input format
fcst/main folder for model computation including pre-/post-processing, model dynamics and physics
operation/operational running environment
sh/shell scripts
verify/verification of model forecast results


(b) Model data

  GRAPES_MESO can use the global NWP model forecast outputs from NCEP GFS and CMA T639 systems. For other background data of NWP models, users should convert them into the binary input format of GRAPES_MESO and place the data under the following folder:

fcst/grapes_model/run/bckg_data
Format of GRAPES_MESO inputs can be referred to
fcst/grapes_model/run/bckg_data/bckg.ctl


(c) Data assimilation

  To be provided in future version.


(d) Static / constant data

  GRAPES_MESO use the same static data as WRF


(e) Miscellaneous

  1. path of the NetCDF should be specified in the configuration file: fcst/grapes_model/configure.si
  2. GrADS and wgrib2 are required



4. Compilation

  User can use a master compilation script to build the whole GRAPES_MESO system, or base on user-specific environments to compile corresponding GRAPES_MESO modules


(a) Compilation script

  1. Change directory to sh/, execute compile.sh to build the whole GRAPES_MESO
  2. To remove program binary objects and modules, execute: clean.sh

(b) Compilation of GRAPES_MESO modules step-by-step:

  Assuming only forecast model is needed, follow the steps below:


(i) Using NCEP GFS as model background

cd data_proc/GFS_proc
make

a program executable called “read_for_grapes.exe” will be created if compilation is successful.


(ii) Using CMA T639 as model background

cd data_proc/T639_proc
make

a program executable called “read_for_grapes.exe” will be created under this directory upon successful compilation.


(iii) Building main executable of GRAPES_MESO

cd fcst/grapes_model
compile grapes 1>log_compile.txt 2>&1

If successfully completed, two binary executables “si.exe” and “grapes.exe” will be created under fcst/graphes_model/run. Output logs and errors of compilations can be found in “log_compile.txt”.


(iv) To clean up binary objects and modules, change path to respective directories above and execute: “make clean” or “clean”. Please refer to sh/clean.sh for details.




5. Model Execution

  Users can execute a main driving script to run the whole GRAPES_MESO system, or via individual script to run the respective modules manually. Below is an example of model execution and running on IBM AIX system.

(a) Using the main driving script

Based on NCEP GFS as model background to perform a model simulation for the whole China area of forecast

(i) edit “test.sh” under sh/:

Based on the data/time of the inputs, execute:

./everyday_gfsdata.sh ${DATE} 48 .true. .false.

${DATE} is the forecast initial time 48 is the forecast range in hours first logical argument for generation (.true.) of model static data second logical argument for running (.true.) of variational data assimilation

when running model simulation for the first time, generation of model static data must be conducted; and this could be skipped in the subsequent model runs to save time if the model domain does not change.

(ii) edit everydata_gfsdata.sh under sh/:

- change the paths of data under “Set directory”
- specify the requirement namelist parameters under “Set parameters”, especially on the time interval of model output (“output_interval”) and the time step of model integration (“model_dt”)
- edit “grapes.cmd” under the folder fcst/grapes_model/run/ for the number of nodes and options for job execution

(iii) execute “test.sh” to complete execution of the whole model simulation

Note:

(i) If T639 is used as model background, please change “test.sh” to execute “everyday_t639data.sh”, other parameter settings are similar to those for NCEP GFS
(ii) To change the model coverage, please edit
fcst/grapes_model/run/namelist_grapes_gfsdata.sh


(b) Running model modules step-by-step

(i) compile GRAPES_MESO forecast model

Please refer to Session 4 above.

(ii) Prepare the model background data (take NCEP GFS as example):

- cd data_proc/GFS_proc
- run: grib2bin.sh $begintime ${bckgdata_dir}
where
$begintime is the forecast initial time
${bckgdata_dir} is the location of NCEP_GFS background field data

  

- mv bckg_* fcst/grapes_model/run/bckg_data/
to move the decoded NCEP GFS model data to the destination path above

(iii) Specify namelist.input

- cd fcst/grapes_model/run/
- edit namelist.input

specify model domain, forecast range, time step, output time interval, resolution, model physics options, pre-processing algorithm. Generation of static data must be conducted for the first time of model run, but can be skipped in subsequent cases to save time if model coverage and resolution do not change.

Detailed meaning of options in namelist.input can be referred in:

run/namelist.README

(iv) Execute si.exe

This model pre-processing step is performed using serial executables (si.exe) in the current version, and it can be either submitted via front-end interactive shell environment or through the command file. In case for AIX, the latter can be run using this command line:

llsubmit si.cmd

(v) Execute grapes.exe

Upon completion of si.exe, the forecast model can be executed using “grapes.exe”.

The forecast model is a parallel program executable, the required number of nodes and run-time environment configuration shall be specified first in the command file:

vim grapes.cmd
…
#@node=8
#@tasks_per_node=8
…
#@class=minijob
##@class=smalljob
##@class=middlejob

The above command file example refers to the running of GRAPES model with horizontal resolution at 0.15 degree latitude/longitude and 60 hour of time integration on the CMA IBM cluster. It uses 8 nodes with 8 CPU per node.

If the forecast model can also be run in serial mode by using the following steps:

In the directory fcst/grapes_model:

cp configure.grapes_serial configure.grapes
cp Makefile_serial Makefile

Perform compilation of GRAPES model again: compile grapes 1>log_compile.txt 2>&1

Upon successful building of grapes.exe, the forecast model can be run in serial model.

Under the directory run/printout/, model output log and error messages will be generated when program runs.




6. Visualization

  If model execution successfully completes, the following files of model results, e.g. model forecasts on isobaric levels can be found under: fcst/grapes_model/run/ :-   

post.ctl_2010081512
postvar2010081512

(a) Example of steps using GrADS to plot the results:

Under the directory containing the file postvar:

grads
open post.ctl_2010081512
q file
q dim
set t 3
set lev 500
d h
…

Details on steps using grads to display the data can be referred to the GrADS user manual.




7. Reference and Useful Internet Resources

(i) CMA GRAPES:

  http://www.nmc.gov.cn/publish/nwp/grapes/

(ii) Grid Analysis and Display System (GrADS):

..http://www.iges.org/grads/

(iii) Unidata Network Common Data Form (NetCDF):

..http://www.unidata.ucar.edu/software/netcdf/









- END OF DOCUMENT - WMO RA-II Pilot Project - Asian Consortium on NWP Forecasts (ACNF)