How to convert raw ECHAM5 GRIB files to - CLM

advertisement
How to convert raw ECHAM5 GRIB files to CLM4
conformal int2clm pre-processable NetCDF files
a user manual by
Andreas Dobler
dobler@iau.uni-frankfurt.de
Hans-Jürgen Panitz
panitz@imk.fzk.de
28.04.2008
1
1. Introduction
This manual describes how to convert raw ECHAM5 GRIB files to global NetCDF files. These files
are constructed such that they can be converted with the int2clm tool to CLM forcing data.
2. Versions in use

netcdf library version: 3.6.0-p1 of Apr 25 2005

GRIB library version: 1.0.6 of Jul 31 2007

Climate Data Operators version: 1.0.9.1 of Oct 22 2007

NCO netCDF Operators version: 3.1.6 of Aug 23 2006
3. Application
An example script automatically doing conversion for several years year can be found in Appendix A.
The present application is designed for

int2lm version: 1.7.3_clm_2 from Feb., 05, 2008 and higher

COSMO-CLM version: 4.0 from May, 25, 2007 and higher
The script can be run on the DKRZ front-end (cross) directly. A batch version which can be submitted
to the pre-processing queue at DKRZ is also available (dobler@iau.uni-frankfurt.de,
panitz@imk.fzk.de)
4. Additional input
For successful conversion the following files are needed:

trunc.cdl: Basic structure for the cas-files and dimensions. See Appendix B for an example.

tab.txt: GRIB variable number description (NetCDF name, long name and units). See Appendix C
for an example.

grid.txt: Grid description for the cas-files. See Appendix D for an example.

FR_LAND.grb: Land-sea mask, invariant. Can be generated using the following file archived on
the DKRZ front-end (cross):
/ut/k/k204076/EXP000/run009/echam5_t63/31009_S09/output/output200/31009_S09_200001.01
with 'cdo -r selcode,172 -invertlat -sp2gp -seltimestep,1 file FR_LAND.grb'.
2
5. How it works
Conversion consists of the following steps:
1. ncgen -o trunc.nc trunc.cdl
Generate the NetCDF file trunc.nc from the CDL (network Common Data form Language) file
trunc.cdl.
2. cdo splitday grb-file day_
Split the input ECAHM5 GRIB file into single days. The output file names are day_DD.grb.
3. For each day:
cdo splithour day_DD.grb YYYYMMDD
Split the single days into single time steps (6h). The output file names are
YYYYMMDDhh.grb.
4. For each time step:

cdo dv2uv YYYYMMDDhh.grb YYYYMMDDhh_uv
Convert divergence and vorticity to U and V wind.

cdo selcode,129,130,131,132, 134,141, 193-invertlat -sp2gp YYYYMMDDhh_uv tmp1.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variables FIS, T, U, V, PS, W_SNOW, and W_I

cdo selcode,102,103,210 -invertlat -sp2gp YYYYMMDDhh_uv tmp2.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variables TSI, TSW and FR_SEA_ICE.

cdo selcode,139 -invertlat -sp2gp YYYYMMDDhh_uv tmp3.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variable TSLM1.

cdo expr,"var1=seaice*tsi+tsw-seaice*tsw;" tmp2.grb tmp_t_sea.grb
Calculate sea surface temperature.

cdo expr,"var1=tslm1;" tmp3.grb tmp_t_land.grb
Calculate land surface temperature.

cdo ifthenelse FR_LAND.grb tmp_t_land.grb tmp_t_sea.grb tmp_t_s.grb
Merge land and sea surface temperature according to land-sea mask.

cdo selcode,140,229,207 -invertlat -sp2gp YYYYMMDDhh_uv tmp4.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variables W_SO, WSMAX and T_SO.

cdo setcode,2 -expr,"var2=tsoil-tsoil+ws/wsmx;" tmp4.grb tmp5.grb
Calculate volumetric soil water content and set variable number to 2.

cdo gtc,1 tmp5.grb tmp_vw_so_gtone.grb
Generate mask with volumetric soil water content >1.

cdo ifthenelse tmp_vw_so_gtone.grb tmp_vw_so_gtone.grb tmp5.grb tmp_vw_so_land.grb
3
Limit soil water content to 1.

cdo ifthen FR_LAND.grb tmp_vw_so_land.grb tmp_vw_so.grb
Set soil water content over sea to missing value.

cdo selcode, 207 -invertlat -sp2gp YYYYMMDDhh_uv tmp6.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variable T_SO.

cdo ifthen FR_LAND.grb tmp_ tmp6.grb tmp_t_so.grb
Set soil temperature over sea to missing value
 cdo selcode, 133 -invertlat -sp2gp YYYYMMDDhh_uv tmp7.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variable QV.

cdo gec, 0.0 tmp7.grb tmp_qv_gezero.grb
Generate mask with 1 if QV >= 0., with 0 if QV < 0

cdo ifthenelse tmp_qv_gezero.grb tmp_ tmp7.grb tmp_qv_gezero.grb tmp tmp_qv.grb
nullify negative values of QV.
 cdo selcode, 153 -invertlat -sp2gp YYYYMMDDhh_uv tmp8.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variable QC.

cdo gec, 0.0 tmp8.grb tmp_qc_gezero.grb
Generate mask with 1 if QC >= 0., with 0 if QC < 0

cdo ifthenelse tmp_qc_gezero.grb tmp_ tm8.grb tmp_qc_gezero.grb tmp tmp_qc.grb
nullify negative values of QC.
 cdo selcode, 154 -invertlat -sp2gp YYYYMMDDhh_uv tmp9.grb
Transforms fields with spectral coefficients to Gaussian grids, invert latitude and select
variable QI.

cdo gec, 0.0 tmp9.grb tmp_qi_gezero.grb
Generate mask with 1 if QI >= 0., with 0 if QI < 0

cdo ifthenelse tmp_qi_gezero.grb tmp_ tm9.grb tmp_ic_gezero.grb tmp tmp_qi.grb
nullify negative values of QI.

cdo settaxis,YYYY-MM-DD,hh:00 FR_LAND.grb FR_LAND_timeset.grb
Correct time axis in land-sea mask file.

cdo merge tmp1.grb tmp_qv.grb tmp_qc.grb tmp_qi.grb tmp_t_s.grbtmp_t_so.grb
tmp_vw_so.grb FR_LAND_timeset.grb tmp_merge.grb
Merge variables FIS, T, U, V, QV, PS, W_SNOW, QC, QI, W_I, T_SO, T_S, VW_SO,
FR_LAND to one file.

cdo -r -t tab.txt -f nc remapbil,grid.txt tmp_merge.grb tmp_merge.nc
Convert to a NetCDF file (with a relative time axis) using the GRIB variable number
4
description in tab.txt and set the longitude to span from -180 to 178.125 instead of 0 to
358.125.

cdo setmissval,-1e20 tmp_merge.nc casYYYYMMDDhh.nc
Set missing values to -1e20.

ncrename -d ilev,level1 casYYYYMMDDhh.nc

ncrename -d mlev,level casYYYYMMDDhh.nc

ncrename -d depth,soil1 casYYYYMMDDhh.nc
Rename dimensions in cas-file casYYYYMMDDhh.nc.

ncks -A trunc.nc casYYYYMMDDhh.nc
Append variables and attributes from trunc.nc to cas-file casYYYYMMDDhh.nc.

ncatted -O -a standard_name,T,c,c,"air_temperature" \
-O -a missing_value,T,c,f,-1e20 \
-O -a standard_name,U,c,c,"grid_eastward_wind" \
-O -a missing_value,U,c,f,-1e20 \
-O -a standard_name,V,c,c,"grid_northward_wind" \
-O -a missing_value,V,c,f,-1e20 \
-O -a standard_name,PS,c,c,"surface_air_pressure" \
-O -a missing_value,PS,c,f,-1e20 \
-O -a standard_name,QV,c,c,"specific_humidity" \
-O -a missing_value,QV,c,f,-1e20 \
-O -a standard_name,QC,c,c,"mass_fraction_of_cloud_liquid_water_in_air" \
-O -a missing_value,QC,c,f,-1e20 \
-O -a standard_name,QI,c,c,"mass_fraction_of_cloud_ice_in_air" \
-O -a missing_value,QI,c,f,-1e20 \
-O -a standard_name,FIS,c,c,"surface_geopotential_height" \
-O -a missing_value,FIS,c,f,-1e20 \
-O -a standard_name,T_S,c,c,"temperature_at_bottom_of_snow" \
-O -a missing_value,T_S,c,f,-1e20 \
-O -a standard_name,W_SNOW,c,c,"surface_snow_amount" \
-O -a missing_value,W_SNOW,c,f,-1e20 \
-O -a standard_name,FR_LAND,c,c,"land_area_fraction" \
-O -a missing_value,FR_LAND,c,f,-1e20 \
-O -a standard_name,W_SO_REL,c,c,"relative /scaled to max. field capacity)
volume_fraction_of_soil_moisture" \
-O -a missing_value,W_SO_REL,c,f,-1e20 \
-O -a standard_name,T_SO,c,c,"soil_temperature" \
5
-O -a missing_value,T_SO,c,f,-1e20 \
-O -a standard_name,W_I,c,c,"canopy_water_amount" \
-O -a missing_value,W_I,c,f,-1e20 casYYYYMMDDhh.nc
Change some attributes in cas-file casYYYYMMDDhh.nc.
6
Appendix A: An example script (for SRES scenario A1B)
#!/bin/bash
#Convert raw ECHAM5 GRIB data to global casYYYYMMDDhh.nc NetCDF files
#which can then be converted with int2clm to lafYYYYMMDDhh.nc files used to drive the CLM
model
#INPUT: RAW ECHAM5 GRIB files (e.g. files 31012_S12_200101.01 to 31012_S12_200112.01)
#OUTPUT: Global NetCDF files casYYYYMMDDhh.nc
#
#usage: ECHAM_to_cas_CLM4.sh
#the script can be run on the DKRZ frontend (cross) directly
#adapt the variables in the userdefinition section according to your needs
#
#the following files are needed:
# -trunc.cdl: basic structure for the cas file and its dimensions
# -tab.txt: GRIB var number description (NetCDF name, long name and units)
# -grid.txt: grid description for the cas file
# -FR_LAND.grb: Land sea mask (invariant!).
# Can be generated from file
/ut/k/k204076/EXP000/run009/echam5_t63/31009_S09/output/output200/31009_S09_200001.01
# with e.g. cdo -r selcode,172 -invertlat -sp2gp -seltimestep,1 file FR_LAND.grb
# -and of course the echam5 grib files!
#
#Contact: dobler@iau.uni-frankfurt.de, panitz@imk.fzk.de
#
#Version: 1.0
#Date: 2008-04-28
###########################################################################################
#############################
#
#
Variables in user defintion section
#
# indir:
Directory where to find this script ECHAM_to_cas.sh
# sourcedir: Directory where to find the source data which will be converted to CLM4
compatible format
# targetdir: Directory where the converted data will be stored; don't include the of year;
will be added by the program
#
# remotehost: Name of a remote host to where the converted data can be transferd using scp;
#
to enable this work it is necessary to create a "password free" connection to
the remote host using ssh-keygen
#
see "man ssh-keygen" for further details
#
furthermore it is useful to creat an ssh-agent
#
if you don't want to transfer the converted data to remote host, set
remotehost=dummy
# remotedir: Name of directory on remote host where the data will be stored; Name will be
extended by the number of the corresponding year
#
# archivedir: directory for long-time archiving the data; the data can be gathered by year
and month in a tar-file
#
some editing might be necessary!! Look close to the end of the scripts
# head_archive_file: head of name of tar-file; the filename will be extended by
"cas$year$month"
#
# year_first: first year that will be treated
# year_last : last year that will be treated
# filehead:
header of source data files without number of year; denotes the experiment
no. of ECHAM5
# filetail:
tail of source data files without number of year
#
###########################################################################################
#############################
# nco and cdo are needed
###########################################################################################
#############################
export PATH=$PATH:/pool/ia64/cdo/bin/:/pool/ia64/netcdf/nco/bin
#
7
dummy=dummy
#
###########################################################################
#
# User definition section begin
#
indir=/import/ds9b/ipf2/b/b364034/Programme_Panitz/ECHAM5_to_cas
sourcedir=/ut/3/k204098/EXP000/run012/echam5_t63/31012_S12/output/output
targetdir=$WRKSHR/Daten_Panitz/echam2cas_a1b_1
remotehost=hlrs
remotedir=/nfs/nas/scr/ws/imkclm1-Daten_20080415-0/ECHAM5_T63L31_A1B_1_CLM4_Daten/cas
archivedir=/ut/10/prj/bm0162/b364034/EH5_T63L31_OM-GR1.5L40_A1B_1_CLM4/
head_archive_file=ECHAM5_31012_S12_CLM4
year_first=2036
year_last=2041
#
# Structure of name of Inputfile with global data
# $filehead_$year$month$filetail
#
filehead=31012_S12_
filetail=.01
#
# User definition section end
#
###########################################################################
for ((year=${year_first};year<=${year_last};year++))
do
#
# create the archive directory for the current year
#
archive=${archivedir}/${year}
mkdir -p ${archive}
# loop over years
#
# create the target directory on remote host if desired
#
if [ ${remotehost} != ${dummy} ]
then
ssh ${remotehost} mkdir -p ${remotedir}/${year}
fi
work_dir=${targetdir}_${year}
mkdir -p ${work_dir}
cd ${work_dir}
mkdir -p cas/${year}
mkdir -p tmp
mkdir -p grib/${year}
cp ${indir}/trunc.cdl ${indir}/tab.txt ${indir}/grid.txt ${indir}/FR_LAND.grb .
ncgen -o trunc.nc trunc.cdl
cp ${sourcedir}${year:0:3}/${filehead}${year}* ./grib/${year}/
#
# untar the sourcefile if necessary
#
cd ./grib/${year}/
tar -xvf *.tar
rm *.tar
cd ${work_dir}
#####################################
# all months and days
8
#####################################
for ((i=1;i<13;i++))
do
# loop over month
if(($i <10))
then
month=0$i
else
month=$i
fi
#get number of days in month MM of year YYYY
nod=`cal ${month} ${year} | grep -v '[A-Za-z]' | wc -w`
#####################################
#####################################
# #one day only (debugging)
# cp
/ut/3/k204098/EXP000/run012/echam5_t63/31012_S12/output/output${year:0:3}/31012_S12_${year}
01* ./grib/${year}/
#
#month=01
#let "nod=1"
#for ((i=1;i<2;i++))
#do
#####################################
file=./grib/${year}/${filehead}${year}${month}${filetail}
if [ -s ${file} ]
then
echo
echo File $file will be treated
echo
else
echo File $file does not exist
echo Stop Conversion Program
exit
fi
cdo splitday $file ./tmp/day_
for ((day=1;day<=nod;day++))
do
# loop over days
if ((day < 10))
then
day2=0${day}
else
day2=${day}
fi
date=${year}${month}${day2}
cdo splithour ./tmp/day_${day2}.grb ./tmp/${date}
rm ./tmp/day_${day2}.grb
done # loop over days
for ((t=1;t<=nod*4;t++))
# loop over hours
do
let "hour=($t-1)*6 % 24"
let "day=(($t-1)*6 - hour)/24+1"
if ((hour < 10))
then
hour2=0${hour}
else
9
hour2=${hour}
fi
if ((day < 10))
then
day2=0${day}
else
day2=${day}
fi
d=${year}${month}${day2}${hour2}
cdo dv2uv ./tmp/${d}.grb ./tmp/${d}_uv
#
# T_SO (Code 207) not selected here; select it in an own tmp-file
# QV (Code 133), QC(Code 153) and QI(Code 154) not selected here, they will be selected in
# an own file each
cdo selcode,129,130,131,132,134,141,193 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp1.grb
cdo
cdo
cdo
cdo
selcode,102,103,210 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp2.grb
selcode,139 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp3.grb
expr,"var1=seaice*tsi+tsw-seaice*tsw;" ./tmp/tmp2.grb ./tmp/tmp_t_sea.grb
expr,"var1=tslm1;" ./tmp/tmp3.grb ./tmp/tmp_t_land.grb
cdo ifthenelse FR_LAND.grb ./tmp/tmp_t_land.grb ./tmp/tmp_t_sea.grb ./tmp/tmp_t_s.grb
cdo selcode,140,229,207 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp4.grb
cdo setcode,2 -expr,"var2=tsoil-tsoil+ws/wsmx;" ./tmp/tmp4.grb ./tmp/tmp5.grb
cdo gtc,1 ./tmp/tmp5.grb ./tmp/tmp_vw_so_gtone.grb
cdo ifthenelse ./tmp/tmp_vw_so_gtone.grb ./tmp/tmp_vw_so_gtone.grb ./tmp/tmp5.grb
./tmp/tmp_vw_so_land.grb
#
cdo ifthen FR_LAND.grb ./tmp/tmp_vw_so_land.grb ./tmp/tmp_vw_so.grb
#
# select T_SO (Code 207) here at its own; set T_SO over water to missing value
cdo selcode,207 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp6.grb
cdo ifthen FR_LAND.grb ./tmp/tmp6.grb ./tmp/tmp_t_so.grb
# select QV (Code 133) here at its own; nullify negative values
cdo selcode,133 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp7.grb
cdo gec,0.0 ./tmp/tmp7.grb ./tmp/tmp_qv_gezero.grb
cdo ifthenelse ./tmp/tmp_qv_gezero.grb ./tmp/tmp7.grb ./tmp/tmp_qv_gezero.grb
./tmp/tmp_qv.grb
# select QC (Code 153) here at its own; nullify negative values
cdo selcode,153 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp8.grb
cdo gec,0.0 ./tmp/tmp8.grb ./tmp/tmp_qc_gezero.grb
cdo ifthenelse ./tmp/tmp_qc_gezero.grb ./tmp/tmp8.grb ./tmp/tmp_qc_gezero.grb
./tmp/tmp_qc.grb
# select QI (Code 154) here at its own; nullify negative values
cdo selcode,154 -invertlat -sp2gp ./tmp/${d}_uv ./tmp/tmp9.grb
cdo gec,0.0 ./tmp/tmp9.grb ./tmp/tmp_qi_gezero.grb
cdo ifthenelse ./tmp/tmp_qi_gezero.grb ./tmp/tmp9.grb ./tmp/tmp_qi_gezero.grb
./tmp/tmp_qi.grb
cdo settaxis,${year}-${month}-${day2},${hour2}:00 FR_LAND.grb ./tmp/FR_LAND_timeset.grb
#
# merge also the file with T_SO, QV, QC , and QI
#
cdo merge ./tmp/tmp1.grb ./tmp/tmp_qv.grb ./tmp/tmp_qc.grb ./tmp/tmp_qi.grb
./tmp/tmp_t_s.grb ./tmp/tmp_t_so.grb ./tmp/tmp_vw_so.grb ./tmp/FR_LAND_timeset.grb
./tmp/tmp_merge.grb
cdo -r -t tab.txt -f nc remapbil,grid.txt ./tmp/tmp_merge.grb ./tmp/tmp_merge.nc
cdo setmissval,-1e20 ./tmp/tmp_merge.nc cas${d}.nc
rm -f ./tmp/t*.*
10
rm -f ./tmp/FR_LAND_timeset.grb
ncrename -d ilev,level1 cas${d}.nc
ncrename -d mlev,level cas${d}.nc
ncrename -d depth,soil1 cas${d}.nc
ncks -A trunc.nc cas${d}.nc
ncatted -O -a standard_name,T,c,c,"air_temperature" \
-O -a missing_value,T,c,f,-1e20 \
-O -a standard_name,U,c,c,"grid_eastward_wind" \
-O -a missing_value,U,c,f,-1e20 \
-O -a standard_name,V,c,c,"grid_northward_wind" \
-O -a missing_value,V,c,f,-1e20 \
-O -a standard_name,PS,c,c,"surface_air_pressure" \
-O -a missing_value,PS,c,f,-1e20 \
-O -a standard_name,QV,c,c,"specific_humidity" \
-O -a missing_value,QV,c,f,-1e20 \
-O -a standard_name,QC,c,c,"mass_fraction_of_cloud_liquid_water_in_air" \
-O -a missing_value,QC,c,f,-1e20 \
-O -a standard_name,QI,c,c,"mass_fraction_of_cloud_ice_in_air" \
-O -a missing_value,QI,c,f,-1e20 \
-O -a standard_name,FIS,c,c,"surface_geopotential_height" \
-O -a missing_value,FIS,c,f,-1e20 \
-O -a standard_name,T_S,c,c,"surface temperature" \
-O -a missing_value,T_S,c,f,-1e20 \
-O -a standard_name,W_SNOW,c,c,"surface_snow_amount" \
-O -a missing_value,W_SNOW,c,f,-1e20 \
-O -a standard_name,FR_LAND,c,c,"land_area_fraction" \
-O -a missing_value,FR_LAND,c,f,-1e20 \
-O -a standard_name,W_SO_REL,c,c,"relative (scaled to max. field capacity)
volume_fraction_of_soil_moisture" \
-O -a missing_value,W_SO_REL,c,f,-1e20 \
-O -a standard_name,T_SO,c,c,"soil_temperature" \
-O -a missing_value,T_SO,c,f,-1e20 \
-O -a standard_name,W_I,c,c,"canopy_water_amount" \
-O -a missing_value,W_I,c,f,-1e20 cas${d}.nc
rm -f ./tmp/${d}_uv
rm -f ./tmp/${d}.grb
mv cas${d}.nc cas/${year}
echo
echo File cas${d}.nc finished
echo
done
# loop over hours
cd cas/${year}
liste=$( ls "cas"${year}${month}*".nc" )
#
#
#
for each month copy the converted data to remote host if desired
if [ ${remotehost} != ${dummy} ]
then
nohup scp $liste ${remotehost}:${remotedir}/${year}
fi
#
#
#
#
#
#
#
#
tar the converted data on a monthly base and move the tar-file to the archive
afterwards delete the cas-files in work-directory in order to save storage space
(max. 150GB)
tar -cvf ${head_archive_file}_cas${year}${month}.tar $liste
mv ${head_archive_file}_cas${year}${month}.tar ${archive}
mv $liste ${archive}
11
rm $liste
cd ${work_dir}
done
# loop over month
rm -r trunc.nc trunc.cdl tab.txt grid.txt FR_LAND.grb
rm -rf grib tmp
done #loop over years
12
Appendix B: trunc.cdl
netcdf trunc { // netCDF specifications
dimensions:
lon = 192 ;
lat = 96 ;
level = 31 ;
level1 = 32 ;
time = UNLIMITED ; // (4 currently)
soil1 = 5 ;
bnds = 2 ;
soil = 4 ;
variables:
float lat(lat), lon(lon), ak(level1), bk(level1), soil1(soil1), soil1_bnds(soil1,bnds), soil(soil);
double time(time), time_bnds(time, bnds) ;
// variable attributes
lat:axis = "Y";
lat:standard_name = "latitude";
lat:long_name = "latitude";
lat:units = "degrees_north";
lon:axis = "X";
lon:standard_name = "longitude";
lon:long_name = "longitude";
lon:units = "degrees_east";
ak:axis = "Z" ;
ak:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate";
ak:long_name = "hybrid coordinate (sigma-pressure)" ;
ak:units = "Pa" ;
ak:positive = "down" ;
ak:formula-terms = "ap: ak b: bk" ;
bk:axis = "Z" ;
bk:standard_name = "atmosphere_hybrid_sigma_pressure_coordinate";
bk:long_name = "hybrid coordinate (sigma-pressure)" ;
13
bk:units = "Pa" ;
bk:positive = "down" ;
bk:formula-terms = "ap: ak b: bk" ;
soil1:standard_name = "depth" ;
soil1:long_name = "depth of soil layers" ;
soil1:units = "m" ;
soil1:positive = "down" ;
time:calendar = "standard" ;
data:
lat = -88.57217, -86.72253, -84.86197, -82.99894, -81.13498, -79.27056,
-77.40589, -75.54106, -73.67613, -71.81113, -69.94608, -68.08099,
-66.21587, -64.35073, -62.48557, -60.6204, -58.75521, -56.89001,
-55.02481, -53.1596, -51.29438, -49.42915, -47.56393, -45.69869,
-43.83346, -41.96822, -40.10298, -38.23774, -36.37249, -34.50724,
-32.64199, -30.77674, -28.91149, -27.04624, -25.18099, -23.31573,
-21.45048, -19.58522, -17.71996, -15.8547, -13.98945, -12.12419,
-10.25893, -8.393669, -6.528409, -4.66315, -2.79789, -0.9326299,
0.9326299, 2.79789, 4.66315, 6.528409, 8.393669, 10.25893, 12.12419,
13.98945, 15.8547, 17.71996, 19.58522, 21.45048, 23.31573, 25.18099,
27.04624, 28.91149, 30.77674, 32.64199, 34.50724, 36.37249, 38.23774,
40.10298, 41.96822, 43.83346, 45.69869, 47.56393, 49.42915, 51.29438,
53.1596, 55.02481, 56.89001, 58.75521, 60.6204, 62.48557, 64.35073,
66.21587, 68.08099, 69.94608, 71.81113, 73.67613, 75.54106, 77.40589,
79.27056, 81.13498, 82.99894, 84.86197, 86.72253, 88.57217 ;
lon = -180, -178.125, -176.25, -174.375, -172.5, -170.625, -168.75,
-166.875, -165, -163.125, -161.25, -159.375, -157.5, -155.625, -153.75,
-151.875, -150, -148.125, -146.25, -144.375, -142.5, -140.625, -138.75,
-136.875, -135, -133.125, -131.25, -129.375, -127.5, -125.625, -123.75,
-121.875, -120, -118.125, -116.25, -114.375, -112.5, -110.625, -108.75,
-106.875, -105, -103.125, -101.25, -99.375, -97.5, -95.625, -93.75,
-91.875, -90, -88.125, -86.25, -84.375, -82.5, -80.625, -78.75, -76.875,
-75, -73.125, -71.25, -69.375, -67.5, -65.625, -63.75, -61.875, -60,
-58.125, -56.25, -54.375, -52.5, -50.625, -48.75, -46.875, -45, -43.125,
-41.25, -39.375, -37.5, -35.625, -33.75, -31.875, -30, -28.125, -26.25,
-24.375, -22.5, -20.625, -18.75, -16.875, -15, -13.125, -11.25, -9.375,
-7.5, -5.625, -3.75, -1.875, 0, 1.875, 3.75, 5.625, 7.5, 9.375, 11.25,
13.125, 15, 16.875, 18.75, 20.625, 22.5, 24.375, 26.25, 28.125, 30,
14
31.875, 33.75, 35.625, 37.5, 39.375, 41.25, 43.125, 45, 46.875, 48.75,
50.625, 52.5, 54.375, 56.25, 58.125, 60, 61.875, 63.75, 65.625, 67.5,
69.375, 71.25, 73.125, 75, 76.875, 78.75, 80.625, 82.5, 84.375, 86.25,
88.125, 90, 91.875, 93.75, 95.625, 97.5, 99.375, 101.25, 103.125, 105,
106.875, 108.75, 110.625, 112.5, 114.375, 116.25, 118.125, 120, 121.875,
123.75, 125.625, 127.5, 129.375, 131.25, 133.125, 135, 136.875, 138.75,
140.625, 142.5, 144.375, 146.25, 148.125, 150, 151.875, 153.75, 155.625,
157.5, 159.375, 161.25, 163.125, 165, 166.875, 168.75, 170.625, 172.5,
174.375, 176.25, 178.125 ;
ak = 0, 2000, 4000, 6000, 8000, 9976.13671875, 11820.5390625,
13431.39453125, 14736.35546875, 15689.20703125, 16266.609375,
16465.00390625, 16297.62109375, 15791.59765625, 14985.26953125,
13925.51953125, 12665.29296875, 11261.23046875, 9771.40625, 8253.2109375,
6761.33984375, 5345.9140625, 4050.7177734375, 2911.5693359375,
1954.80517578125, 1195.88989257812, 638.14892578125, 271.62646484375,
72.0635833740234, 0, 0, 0 ;
bk = 0, 0, 0, 0, 0, 0.000390858156606555, 0.00291970069520175,
0.00919413194060326, 0.0203191563487053, 0.0369748584926128,
0.0594876408576965, 0.0878949761390686, 0.122003614902496,
0.161441504955292, 0.205703258514404, 0.254188597202301,
0.306235373020172, 0.36114501953125, 0.41820228099823, 0.476688146591187,
0.535886585712433, 0.595084249973297, 0.65356457233429,
0.710594415664673, 0.765405237674713, 0.817166984081268,
0.864955842494965, 0.907715857028961, 0.944213211536407,
0.972985208034515, 0.992281496524811, 1 ;
soil1 = 0.03, 0.19, 0.78, 2.68, 6.98;
soil1_bnds =
0, 0.06,
0.06, 0.32,
0.32, 1.24,
1.24, 4.12,
4.12, 9.84 ;
time_bnds =
0, 0 ;
15
time = 0;
}
The values for ak, bk, lat, lon and soil1 can be found in the GRIB files. Use e.g., cdo -r -f nc -invertlat
-sp2gp -seltimestep,1 31012_S12_203601.01 tmp.nc and browse the resulting NetCDF file tmp.nc for
the necessary values:

Use ncdump -c tmp.nc for lat, lon and soil levels (subtract 180 in longtitude and divide depth by
100 for soil1)

Use ncdump -v hyai tmp.nc for ak

Use ncdump -v hybi tmp.nc for bk
16
Appendix C: tab.txt
102
TSI
surface temperature of ice
103
TSW
surface temperature of water
129
FIS
surface geopotential height [m2 s-2]
130
T
temperature
131
U
U-component of wind [m s-1]
132
V
V-component of wind [m s-1]
133
QV
specific humidity [kg kg-1]
134
PS
surface pressure
139
TSLM1
surface temperature of land
140
W_SO
soil wetness
141
W_SNOW
surface snow amount [m_H2O]
153
QC
cloud liquid water content [kg kg-1]
154
QI
cloud ice content [kg kg-1]
172
FR_LAND
sea land fraction [1]
193
W_I
canopy water amount [m_H2O]
207
T_SO
soil temperature
210
FR_SEA_ICE
ice cover
229
WSMAX
field capacity of soil
1
T_S
temperature at bottom of snow [K]
2
W_SO_REL
relative volumetric soil water content scales to field capac.
17
Appendix D: grid.txt
gridtype : gaussian
gridsize : 18432
xname
: lon
xlongname : longitude
xunits
yname
: degrees_east
: lat
ylongname : latitude
yunits
: degrees_north
xsize
: 192
ysize
: 96
xfirst
: -180.0
xinc
: 1.875
yvals
: -88.5721685 -86.722531 -84.8619703 -82.9989416 -81.1349768 -79.270559
-77.4058881 -75.5410615 -73.6761323 -71.8111321 -69.9460806 -68.080991
-66.2158721 -64.3507304 -62.4855705 -60.6203959 -58.7552093 -56.8900126
-55.0248075 -53.1595954 -51.2943771 -49.4291537 -47.5639257 -45.6986939
-43.8334586 -41.9682203 -40.1029793 -38.237736 -36.3724906 -34.5072433
-32.6419944 -30.7767441 -28.9114924 -27.0462395 -25.1809856 -23.3157307
-21.450475 -19.5852186 -17.7199615 -15.8547039 -13.9894457 -12.1241871
-10.2589282 -8.39366891 -6.5284094 -4.66314971 -2.79788988 -0.932629968
0.932629968 2.79788988 4.66314971 6.5284094 8.39366891 10.2589282 12.1241871
13.9894457 15.8547039 17.7199615 19.5852186 21.450475 23.3157307 25.1809856
27.0462395 28.9114924 30.7767441 32.6419944 34.5072433 36.3724906 38.237736
40.1029793 41.9682203 43.8334586 45.6986939 47.5639257 49.4291537 51.2943771
53.1595954 55.0248075 56.8900126 58.7552093 60.6203959 62.4855705 64.3507304
66.2158721 68.080991 69.9460806 71.8111321 73.6761323 75.5410615 77.4058881
79.270559 81.1349768 82.9989416 84.8619703 86.722531 88.5721685
The grid description can be obtained via cdo griddes FR_LAND.grb. However, note that therein xfirst
is 0 and thus longitude spans from 0 to 358.125. For int2clm, longitude must be from -180 to 178.125
and thus xfirst set to -180. All other entries can be copied from the output of cdo griddes
FR_LAND.grb.
18
Download