Nemsio library Jun Wang, Mark Iredell. Introduction nemsio is a package to support input/output in...

11
nemsio library Jun Wang, Mark Iredell

Transcript of Nemsio library Jun Wang, Mark Iredell. Introduction nemsio is a package to support input/output in...

Page 1: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

nemsio library

Jun Wang, Mark Iredell

Page 2: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

Introduction

nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)

Current NEMSIO can handle binary data and GRIB-1 data

NEMSIO has serial version and MPI version

Page 3: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

DATA STRUCTURE A NEMSIO file contains two parts: meta data and

data fields.

Meta data:

Standard model meta data

User defined meta data (optional)

Data fields:

Same dimension for all the fields

Real kind (4 or 8 bytes real)

Same format for all the fields

Page 4: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

Standard meta data required by NEMS model applications such as NMMB and GFS

and NCEP GSI

Total 12 meta data records, can be reduced by users

First 2 meta data are required in all cases:

Gtype, gdatatype, modelname,version, nmeta

Nrec, idate, forecast time, dimention, nframe, nsoil, ntrac,jcap,ncldt,idsl,idvc,idvm,idrt,rlon_min, rlon_max,rlat_min,rlat_max

10 other meta data records: recname, reclevtyp and reclev (meta data 3:5), vcoord,lat,lon,dx,dy,Cpi,Ri

Page 5: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

User defined meta data

extrameta in second standard meta data indicates if there are any user defined meta data

User defined mata data can have 5 data type:

integer, real(4), real(8), logical and character(16)

if extrameta is true, meta data record exists:Nmetavari,nmetavarr,nmetavarl,nmetavarc,nmetavarr8

Nmetaaryi,nmetaaryr,nmetaaryl,nmetaaryc,nmetaaryr8

User defined meta data records holds each meta data’s name, length (for array) and value

Page 6: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

nemsio interfaces –serial version nemsio_init(iret)

nemsio_finalize(iret)

nemsio_open(gfile,gname,'read|write|rdwr',optarg,iret)

nemsio_close(gfile, iret)

nemsio_getfilehead(gfile,optargs,iret)

nemsio_getheadvar(gfile,argname,argval,iret)

nemsio_getrechead(gfile,jrec,vname,vlevtyp,vlev,iret)

nemsio_setfilehead(gfile,optarg,iret)

nemsio_readrec(gfile,jrec,data,nframe,iret)

nemsio_readrecv(gfile,name,levtyp,lev,data,nframe,iret)

nemsio_writerec(gfile,jrec,itr,zhour,data,iret)

nemsio_writerecv(gfile,name,levtyp,lev,itr,zhour,data,iret)

Page 7: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

nemsio parallel versiono Using MPI 2o More efficient for file size ~GB

Page 8: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

nemsio interface – parallel version

nemsio_open(gfile,gfname,gaction,mpi_comm,optargs,iret)

nemsio_denseread(gfile,ista,iend,jsta,jend,data,iret)

nemsio_densewrite(gfile,ista,iend,jsta,jend,data,jrecs,jrece,iret)

Page 9: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

Utilities for nemsio filesnemsio_read: read a nemsio file, list all the

meta data information and maxium/minium of each data field

nemsio_get: get value of a specific meta data variable or a data field

mknmmbctl: create .ctl file from a nemsio file for viewing the data in Grads

nemsio_cvt: convert a nemsio file from big/little endian to little/big endian

Page 10: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

Future work

Add GRIB2 format data type

Add NetCDF data type

Page 11: Nemsio library Jun Wang, Mark Iredell. Introduction  nemsio is a package to support input/output in NOAA Environmental Modeling System (NEMS)  Current.

Documentation

http://www.emc.ncep.noaa.gov/NEMS/nemsio.php