grib-api-1.14.4/ 0000740 0001750 0001750 00000000000 12642620053 013447 5 ustar alastair alastair grib-api-1.14.4/html/ 0000740 0001750 0001750 00000000000 12642617500 014416 5 ustar alastair alastair grib-api-1.14.4/html/set__pv_8f90-example.html 0000640 0001750 0001750 00000012172 12642617500 021147 0 ustar alastair alastair
00001 ! Copyright 2005-2015 ECMWF 00002 ! This software is licensed under the terms of the Apache Licence Version 2.0 00003 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 00004 ! 00005 ! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by 00006 ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. 00007 ! 00008 ! 00009 ! Description: how to set pv values. 00010 ! 00011 ! 00012 ! Author: Anne Fouilloux 00013 ! 00014 ! 00015 program set_pv 00016 use grib_api 00017 implicit none 00018 integer :: numberOfLevels 00019 integer :: numberOfCoefficients 00020 integer :: outfile, igrib 00021 integer :: i, ios 00022 real, dimension(:),allocatable :: pv 00023 00024 numberOfLevels=60 00025 numberOfCoefficients=2*(numberOfLevels+1) 00026 00027 allocate(pv(numberOfCoefficients)) 00028 00029 ! read the model level coefficients from file 00030 open( unit=1, file="../../data/60_model_levels", & 00031 form="formatted",action="read") 00032 00033 do i=1,numberOfCoefficients,2 00034 read(unit=1,fmt=*, iostat=ios) pv(i), pv(i+1) 00035 if (ios /= 0) then 00036 print *, "I/O error: ",ios 00037 exit 00038 end if 00039 end do 00040 00041 ! print coefficients 00042 !do i=1,numberOfCoefficients,2 00043 ! print *," a=",pv(i)," b=",pv(i+1) 00044 !end do 00045 00046 close(unit=1) 00047 00048 call grib_open_file(outfile, 'out.grib1','w') 00049 00050 ! a new grib message is loaded from file 00051 ! igrib is the grib id to be used in subsequent calls 00052 call grib_new_from_samples(igrib, "reduced_gg_sfc_grib1") 00053 00054 ! set levtype to ml (model level) 00055 call grib_set(igrib,'levtype','ml') 00056 00057 ! set level 00058 call grib_set(igrib,'level',2) 00059 00060 ! set PVPresent as an integer 00061 call grib_set(igrib,'PVPresent',1) 00062 00063 call grib_set(igrib,'pv',pv) 00064 00065 ! write modified message to a file 00066 call grib_write(igrib,outfile) 00067 00068 ! FREE MEMORY 00069 call grib_release(igrib) 00070 deallocate(pv) 00071 00072 call grib_close_file(outfile) 00073 00074 end program set_pv
1.5.3
grib-api-1.14.4/html/multi_8f90-example.html 0000640 0001750 0001750 00000010345 12642617500 020642 0 ustar alastair alastair
00001 ! Copyright 2005-2015 ECMWF 00002 ! This software is licensed under the terms of the Apache Licence Version 2.0 00003 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 00004 ! 00005 ! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by 00006 ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. 00007 ! 00008 ! 00009 ! Description: How to decode grib messages containing multiple 00010 ! fields. Try to turn on and off multi support to 00011 ! see the difference. Default is OFF. 00012 ! For all the tools defalut is multi support ON. 00013 ! 00014 ! 00015 ! Author: Enrico Fucile 00016 ! 00017 ! 00018 program multi 00019 use grib_api 00020 implicit none 00021 00022 integer :: iret 00023 character(len = 256) :: error 00024 integer(kind = 4) :: step 00025 integer :: ifile,igrib 00026 00027 call grib_open_file(ifile, '../../data/multi_created.grib2','r') 00028 00029 ! turn on support for multi fields messages */ 00030 call grib_multi_support_on() 00031 00032 ! turn off support for multi fields messages */ 00033 !call grib_multi_support_off() 00034 00035 call grib_new_from_file(ifile,igrib, iret) 00036 ! Loop on all the messages in a file. 00037 00038 write(*,*) 'step' 00039 do while (iret /= GRIB_END_OF_FILE) 00040 00041 call grib_get(igrib,'step', step) 00042 write(*,'(i3)') step 00043 00044 call grib_new_from_file(ifile,igrib, iret) 00045 00046 end do 00047 call grib_close_file(ifile) 00048 00049 end program multi 00050
1.5.3
grib-api-1.14.4/html/keys__iterator__fortran_8_f-example.html 0000640 0001750 0001750 00000014007 12642617500 024412 0 ustar alastair alastair
00001 C Copyright 2005-2015 ECMWF 00002 C This software is licensed under the terms of the Apache Licence Version 2.0 00003 C which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 00004 C 00005 C In applying this licence, ECMWF does not waive the privileges and immunities granted to it by 00006 C virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. 00007 C 00008 C 00009 C Fortran 77 Implementation: keys_iterator 00010 C 00011 C Description: 00012 C Example on how to use keys_iterator functions and the 00013 C grib_keys_iterator structure to get all the available 00014 C keys in a message. 00015 C 00016 C Author: Enrico Fucile 00017 C 00018 C 00019 C 00020 program keys_iterator 00021 implicit none 00022 include 'grib_api_f77.h' 00023 character*20 name_space 00024 integer kiter,ifile,igrib,iret 00025 character*256 key 00026 character*256 value 00027 character*512 all 00028 integer len,strlen 00029 integer grib_count 00030 len=256 00031 00032 ifile=5 00033 00034 call grib_check(grib_open_file(ifile, 00035 X'../../data/regular_latlon_surface.grib1','r')) 00036 00037 grib_count=0 00038 C Loop on all the messages in a file. 00039 10 iret=grib_new_from_file(ifile,igrib) 00040 if (igrib .eq. -1 ) then 00041 if (iret .ne.0) then 00042 call grib_check(iret) 00043 endif 00044 stop 00045 endif 00046 00047 grib_count=grib_count+1 00048 write(*,'("-- GRIB N.",I4," --")') grib_count 00049 00050 C valid name_spaces are ls and mars 00051 name_space='ls' 00052 C name_space=' ' to get all the keys */ 00053 C name_space=' ' 00054 00055 call grib_check( 00056 Xgrib_keys_iterator_new(igrib,kiter,name_space)) 00057 C call grib_check(grib_keys_iterator_skip_read_only(kiter)) 00058 C call grib_check(grib_keys_iterator_skip_function(kiter)) 00059 C call grib_check(grib_keys_iterator_skip_not_coded(kiter)) 00060 00061 20 if (grib_keys_iterator_next(kiter) .ne. 1) goto 10 00062 00063 call grib_check(grib_keys_iterator_get_name(kiter,key)) 00064 call grib_check(grib_get_string(igrib,key,value)) 00065 all='|' // trim(key)//'|' // ' = ' //'|' // trim(value) // '|' 00066 write(*,*) trim(all) 00067 00068 goto 20 00069 00070 call grib_check(grib_keys_iterator_delete(kiter)) 00071 00072 call grib_check(grib_release(igrib)) 00073 00074 call grib_check(grib_close_file(ifile)) 00075 00076 end 00077
1.5.3
grib-api-1.14.4/html/tabs.css 0000640 0001750 0001750 00000003336 12642617500 016070 0 ustar alastair alastair /* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
DIV.tabs
{
float : left;
width : 100%;
background : url("tab_b.gif") repeat-x bottom;
margin-bottom : 4px;
}
DIV.tabs UL
{
margin : 0px;
padding-left : 10px;
list-style : none;
}
DIV.tabs LI, DIV.tabs FORM
{
display : inline;
margin : 0px;
padding : 0px;
}
DIV.tabs FORM
{
float : right;
}
DIV.tabs A
{
float : left;
background : url("tab_r.gif") no-repeat right top;
border-bottom : 1px solid #84B0C7;
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
DIV.tabs A:hover
{
background-position: 100% -150px;
}
DIV.tabs A:link, DIV.tabs A:visited,
DIV.tabs A:active, DIV.tabs A:hover
{
color: #1A419D;
}
DIV.tabs SPAN
{
float : left;
display : block;
background : url("tab_l.gif") no-repeat left top;
padding : 5px 9px;
white-space : nowrap;
}
DIV.tabs INPUT
{
float : right;
display : inline;
font-size : 1em;
}
DIV.tabs TD
{
font-size : x-small;
font-weight : bold;
text-decoration : none;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
DIV.tabs SPAN {float : none;}
/* End IE5-Mac hack */
DIV.tabs A:hover SPAN
{
background-position: 0% -150px;
}
DIV.tabs LI.current A
{
background-position: 100% -150px;
border-width : 0px;
}
DIV.tabs LI.current SPAN
{
background-position: 0% -150px;
padding-bottom : 6px;
}
DIV.nav
{
background : none;
border : none;
border-bottom : 1px solid #84B0C7;
}
grib-api-1.14.4/html/grib_dump_examples.html 0000640 0001750 0001750 00000002347 12642617500 021162 0 ustar alastair alastair
1.5.3
grib-api-1.14.4/html/get_8f90-example.html 0000640 0001750 0001750 00000021235 12642617500 020267 0 ustar alastair alastair
00001 ! Copyright 2005-2015 ECMWF 00002 ! This software is licensed under the terms of the Apache Licence Version 2.0 00003 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 00004 ! 00005 ! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by 00006 ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. 00007 ! 00008 ! 00009 ! Description: how to get values using keys. 00010 ! 00011 ! Author: Enrico Fucile 00012 ! 00013 ! 00014 program get 00015 use grib_api 00016 implicit none 00017 00018 integer :: ifile 00019 integer :: iret 00020 integer :: igrib 00021 real :: latitudeOfFirstPointInDegrees 00022 real :: longitudeOfFirstPointInDegrees 00023 real :: latitudeOfLastPointInDegrees 00024 real :: longitudeOfLastPointInDegrees 00025 integer :: numberOfPointsAlongAParallel 00026 integer :: numberOfPointsAlongAMeridian 00027 real, dimension(:), allocatable :: values 00028 integer :: numberOfValues 00029 real :: average,min_val, max_val 00030 integer :: is_missing 00031 00032 call grib_open_file(ifile, & 00033 '../../data/reduced_latlon_surface.grib1','r') 00034 00035 ! Loop on all the messages in a file. 00036 00037 ! a new grib message is loaded from file 00038 ! igrib is the grib id to be used in subsequent calls 00039 call grib_new_from_file(ifile,igrib, iret) 00040 00041 LOOP: DO WHILE (iret /= GRIB_END_OF_FILE) 00042 00043 !check if the value of the key is MISSING 00044 is_missing=0; 00045 call grib_is_missing(igrib,'numberOfPointsAlongAParallel', & 00046 is_missing); 00047 if ( is_missing /= 1 ) then 00048 ! get as a integer 00049 call grib_get(igrib,'numberOfPointsAlongAParallel', & 00050 numberOfPointsAlongAParallel) 00051 write(*,*) 'numberOfPointsAlongAParallel=', & 00052 numberOfPointsAlongAParallel 00053 else 00054 write(*,*) 'numberOfPointsAlongAParallel is missing' 00055 endif 00056 ! get as a integer 00057 call grib_get(igrib,'numberOfPointsAlongAMeridian', & 00058 numberOfPointsAlongAMeridian) 00059 write(*,*) 'numberOfPointsAlongAMeridian=', & 00060 numberOfPointsAlongAMeridian 00061 00062 ! get as a real 00063 call grib_get(igrib, 'latitudeOfFirstGridPointInDegrees', & 00064 latitudeOfFirstPointInDegrees) 00065 write(*,*) 'latitudeOfFirstGridPointInDegrees=', & 00066 latitudeOfFirstPointInDegrees 00067 00068 ! get as a real 00069 call grib_get(igrib, 'longitudeOfFirstGridPointInDegrees', & 00070 longitudeOfFirstPointInDegrees) 00071 write(*,*) 'longitudeOfFirstGridPointInDegrees=', & 00072 longitudeOfFirstPointInDegrees 00073 00074 ! get as a real 00075 call grib_get(igrib, 'latitudeOfLastGridPointInDegrees', & 00076 latitudeOfLastPointInDegrees) 00077 write(*,*) 'latitudeOfLastGridPointInDegrees=', & 00078 latitudeOfLastPointInDegrees 00079 00080 ! get as a real 00081 call grib_get(igrib, 'longitudeOfLastGridPointInDegrees', & 00082 longitudeOfLastPointInDegrees) 00083 write(*,*) 'longitudeOfLastGridPointInDegrees=', & 00084 longitudeOfLastPointInDegrees 00085 00086 00087 ! get the size of the values array 00088 call grib_get_size(igrib,'values',numberOfValues) 00089 write(*,*) 'numberOfValues=',numberOfValues 00090 00091 allocate(values(numberOfValues), stat=iret) 00092 ! get data values 00093 call grib_get(igrib,'values',values) 00094 call grib_get(igrib,'min',min_val) ! can also be obtained through minval(values) 00095 call grib_get(igrib,'max',max_val) ! can also be obtained through maxval(values) 00096 call grib_get(igrib,'average',average) ! can also be obtained through maxval(values) 00097 00098 write(*,*)'There are ',numberOfValues, & 00099 ' average is ',average, & 00100 ' min is ', min_val, & 00101 ' max is ', max_val 00102 00103 call grib_release(igrib) 00104 00105 call grib_new_from_file(ifile,igrib, iret) 00106 00107 end do LOOP 00108 00109 call grib_close_file(ifile) 00110 00111 deallocate(values) 00112 end program get
1.5.3
grib-api-1.14.4/html/doxygen.css 0000640 0001750 0001750 00000016322 12642617500 016613 0 ustar alastair alastair
CAPTION { font-weight: bold }
DIV.qindex {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.nav {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navtab {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
TD.navtab {
font-size: 70%;
}
A.qindex {
text-decoration: none;
font-weight: bold;
color: #1A419D;
}
A.qindex:visited {
text-decoration: none;
font-weight: bold;
color: #1A419D
}
A.qindexHL {
text-decoration: none;
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
A.el { text-decoration: none; font-weight: bold }
A.elRef { font-weight: bold }
A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
A.codeRef:link { font-weight: normal; color: #0000FF}
A.codeRef:visited { font-weight: normal; color: #0000FF}
DL.el { margin-left: -1cm }
.fragment {
font-family: monospace, fixed;
font-size: 95%;
}
PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 2px;
margin-right: 8px;
padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
DIV.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
TD.indexkey {
background-color: #e8eef2;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TD.indexvalue {
background-color: #e8eef2;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp { text-align: center; }
IMG.formulaDsp { }
IMG.formulaInl { vertical-align: middle; }
SPAN.keyword { color: #008000 }
SPAN.keywordtype { color: #604020 }
SPAN.keywordflow { color: #e08000 }
SPAN.comment { color: #800000 }
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
.mdescLeft {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplParams {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
color: #606060;
background-color: #FAFAFA;
font-size: 80%;
}
.search { color: #003399;
font-weight: bold;
}
FORM.search {
margin-bottom: 0px;
margin-top: 0px;
}
INPUT.search { font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
TD.tiny { font-size: 75%;
}
.dirtab { padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
TH.dirtab { background: #e8eef2;
font-weight: bold;
}
HR { height: 1px;
border: none;
border-top: 1px solid black;
}
/* Style for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
}
.memnav {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 4px;
background-color: #eef3f5;
border-width: 1px;
border-style: solid;
border-color: #dedeee;
-moz-border-radius: 8px 8px 8px 8px;
}
.memname {
white-space: nowrap;
font-weight: bold;
}
.memdoc{
padding-left: 10px;
}
.memproto {
background-color: #d5e1e8;
width: 100%;
border-width: 1px;
border-style: solid;
border-color: #84b0c7;
font-weight: bold;
-moz-border-radius: 8px 8px 8px 8px;
}
.paramkey {
text-align: right;
}
.paramtype {
white-space: nowrap;
}
.paramname {
color: #602020;
font-style: italic;
white-space: nowrap;
}
/* End Styling for detailed member documentation */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin:0.5em;
}
.directory { font-size: 9pt; font-weight: bold; }
.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }
.directory > h3 { margin-top: 0; }
.directory p { margin: 0px; white-space: nowrap; }
.directory div { display: none; margin: 0px; }
.directory img { vertical-align: -30%; }
grib-api-1.14.4/html/examples.html 0000640 0001750 0001750 00000006711 12642617500 017131 0 ustar alastair alastair
1.5.3
grib-api-1.14.4/html/interfacegrib__api_1_1grib__get.html 0000640 0001750 0001750 00000000000 12642617500 023372 0 ustar alastair alastair grib-api-1.14.4/html/keys__iterator_8f90-example.html 0000640 0001750 0001750 00000012117 12642617500 022532 0 ustar alastair alastair
00001 ! Copyright 2005-2015 ECMWF 00002 ! This software is licensed under the terms of the Apache Licence Version 2.0 00003 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 00004 ! 00005 ! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by 00006 ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. 00007 ! 00008 ! 00009 ! Description: 00010 ! How to use keys_iterator to get all the available 00011 ! keys in a message. 00012 ! 00013 ! Author: Enrico Fucile 00014 ! 00015 ! 00016 program keys_iterator 00017 use grib_api 00018 implicit none 00019 character(len=20) :: name_space 00020 integer :: kiter,ifile,igrib,iret 00021 character(len=256) :: key 00022 character(len=256) :: value 00023 character(len=512) :: all 00024 integer :: grib_count 00025 00026 call grib_open_file(ifile, & 00027 '../../data/regular_latlon_surface.grib1','r') 00028 00029 ! Loop on all the messages in a file. 00030 00031 call grib_new_from_file(ifile,igrib, iret) 00032 00033 do while (iret /= GRIB_END_OF_FILE) 00034 00035 grib_count=grib_count+1 00036 write(*,*) '-- GRIB N. ',grib_count,' --' 00037 00038 ! valid name_spaces are ls and mars 00039 name_space='ls' 00040 00041 call grib_keys_iterator_new(igrib,kiter,name_space) 00042 00043 do 00044 call grib_keys_iterator_next(kiter, iret) 00045 00046 if (iret .ne. 1) exit 00047 00048 call grib_keys_iterator_get_name(kiter,key) 00049 call grib_get(igrib,trim(key),value) 00050 all=trim(key)// ' = ' // trim(value) 00051 write(*,*) trim(all) 00052 00053 end do 00054 00055 call grib_keys_iterator_delete(kiter) 00056 call grib_release(igrib) 00057 call grib_new_from_file(ifile,igrib, iret) 00058 end do 00059 00060 00061 call grib_close_file(ifile) 00062 00063 end program keys_iterator 00064
1.5.3
grib-api-1.14.4/html/grib_dump.html 0000640 0001750 0001750 00000042614 12642617500 017265 0 ustar alastair alastair
>grib_dump -H ../data/reduced_gaussian_model_level.grib1
> grib_dump -D ../data/regular_latlon_surface.grib1
>grib_dump -C ../data/regular_latlon_surface.grib1 #include <grib_api.h> /* This code was generated automatically */ int main(int argc,const char** argv) { grib_handle *h = NULL; size_t size = 0; double* vdouble = NULL; long* vlong = NULL; FILE* f = NULL; const char* p = NULL; const void* buffer = NULL; if(argc != 2) { fprintf(stderr,"usage: %s out\n",argv[0]); exit(1); } h = grib_handle_new_from_samples(NULL,"GRIB1"); if(!h) { fprintf(stderr,"Cannot create grib handle\n"); exit(1); } GRIB_CHECK(grib_set_long(h,"editionNumber",1),0); GRIB_CHECK(grib_set_long(h,"table2Version",128),0); /* 98 = European Center for Medium-Range Weather Forecasts (grib1/0.table) */ GRIB_CHECK(grib_set_long(h,"centre",98),0); GRIB_CHECK(grib_set_long(h,"generatingProcessIdentifier",130),0); GRIB_CHECK(grib_set_long(h,"gridDefinition",255),0); /* 128 = 10000000 (1=1) Section 2 included (2=0) Section 3 omited See grib1/1.table */ GRIB_CHECK(grib_set_long(h,"section1Flags",128),0); /* 167 = 2 metre temperature (K) (grib1/2.98.128.table) */ GRIB_CHECK(grib_set_long(h,"indicatorOfParameter",167),0); /* 1 = Surface (of the Earth, which includes sea surface) (grib1/3.table) */ GRIB_CHECK(grib_set_long(h,"indicatorOfTypeOfLevel",1),0); GRIB_CHECK(grib_set_long(h,"level",0),0); GRIB_CHECK(grib_set_long(h,"yearOfCentury",8),0); GRIB_CHECK(grib_set_long(h,"month",2),0); GRIB_CHECK(grib_set_long(h,"day",6),0); GRIB_CHECK(grib_set_long(h,"hour",12),0); GRIB_CHECK(grib_set_long(h,"minute",0),0); /* 1 = Hour (grib1/4.table) */ GRIB_CHECK(grib_set_long(h,"unitOfTimeRange",1),0); GRIB_CHECK(grib_set_long(h,"P1",0),0); GRIB_CHECK(grib_set_long(h,"P2",0),0); /* 0 = Forecast product valid at reference time + P1 (P1>0) (grib1/5.table) */ GRIB_CHECK(grib_set_long(h,"timeRangeIndicator",0),0); GRIB_CHECK(grib_set_long(h,"numberIncludedInAverage",0),0); GRIB_CHECK(grib_set_long(h,"numberMissingFromAveragesOrAccumulations",0),0); GRIB_CHECK(grib_set_long(h,"centuryOfReferenceTimeOfData",21),0); /* 0 = Unknown code table entry (grib1/0.ecmf.table) */ GRIB_CHECK(grib_set_long(h,"subCentre",0),0); GRIB_CHECK(grib_set_long(h,"decimalScaleFactor",0),0); /* 1 = MARS labelling or ensemble forecast data (grib1/localDefinitionNumber.98.table) */ GRIB_CHECK(grib_set_long(h,"localDefinitionNumber",1),0); /* 1 = Operational archive (mars/class.table) */ GRIB_CHECK(grib_set_long(h,"marsClass",1),0); /* 2 = Analysis (mars/type.table) */ GRIB_CHECK(grib_set_long(h,"marsType",2),0); /* 1025 = Atmospheric model (mars/stream.table) */ GRIB_CHECK(grib_set_long(h,"marsStream",1025),0); p = "0001"; size = strlen(p)+1; GRIB_CHECK(grib_set_string(h,"experimentVersionNumber",p,&size),0); GRIB_CHECK(grib_set_long(h,"perturbationNumber",0),0); GRIB_CHECK(grib_set_long(h,"numberOfForecastsInEnsemble",0),0); GRIB_CHECK(grib_set_long(h,"numberOfVerticalCoordinateValues",0),0); GRIB_CHECK(grib_set_long(h,"pvlLocation",255),0); /* 0 = Latitude/Longitude Grid (grib1/6.table) */ GRIB_CHECK(grib_set_long(h,"dataRepresentationType",0),0); GRIB_CHECK(grib_set_long(h,"Ni",16),0); GRIB_CHECK(grib_set_long(h,"Nj",31),0); GRIB_CHECK(grib_set_long(h,"latitudeOfFirstGridPoint",60000),0); GRIB_CHECK(grib_set_long(h,"longitudeOfFirstGridPoint",0),0); /* 128 = 10000000 (1=1) Direction increments given (2=0) Earth assumed spherical with radius = 6367.47 km (5=0) u and v components resolved relative to easterly and northerly directions See grib1/7.table */ GRIB_CHECK(grib_set_long(h,"resolutionAndComponentFlags",128),0); GRIB_CHECK(grib_set_long(h,"latitudeOfLastGridPoint",0),0); GRIB_CHECK(grib_set_long(h,"longitudeOfLastGridPoint",30000),0); GRIB_CHECK(grib_set_long(h,"iDirectionIncrement",2000),0); GRIB_CHECK(grib_set_long(h,"jDirectionIncrement",2000),0); /* 0 = 00000000 (1=0) Points scan in +i direction (2=0) Points scan in -j direction (3=0) Adjacent points in i direction are consecutive See grib1/8.table */ GRIB_CHECK(grib_set_long(h,"scanningMode",0),0); /* ITERATOR */ /* NEAREST */ GRIB_CHECK(grib_set_long(h,"bitsPerValue",16),0); GRIB_CHECK(grib_set_long(h,"sphericalHarmonics",0),0); GRIB_CHECK(grib_set_long(h,"complexPacking",0),0); GRIB_CHECK(grib_set_long(h,"integerPointValues",0),0); GRIB_CHECK(grib_set_long(h,"additionalFlagPresent",0),0); /* gribSection5 */ /* Save the message */ f = fopen(argv[1],"w"); if(!f) { perror(argv[1]); exit(1); } GRIB_CHECK(grib_get_message(h,&buffer,&size),0); if(fwrite(buffer,1,size,f) != size) { perror(argv[1]); exit(1); } if(fclose(f)) { perror(argv[1]); exit(1); } grib_handle_delete(h); return 0; }
1.5.3
grib-api-1.14.4/html/index.html 0000640 0001750 0001750 00000012551 12642617500 016421 0 ustar alastair alastair
With the grib_api library, that is written entirely in C, some command line tools are provided to give a quick way to manipulate grib data. Moreover a Fortran interface 90 is available giving access to the main features of the C library.
The library is designed to access and modify messages in both editions with the same function calls using a set of Grib API keys to access the coded information ( examples: get.f90 set.f90, get.c, set.c, grib_get, grib_set ).
The keys available for a message are different depending not only on the edition but also and mainly on the type of each message and the information it contains. A list of all the available keys in a message can be obtained dynamically using the library as shown in keys_iterator.c or using the Grib tools as shown in grib_dump or grib_keys.
GRIB API will replace the GRIBEX function and a table of conversion between the numeric encoding of GRIBEX and the alphanumeric keys of GRIB API is provided to help the migration.
To learn how to use the grib_api we recommend the user works through the Grib API examples.
Reference manuals are also provided for the C library (organized in C interface) and for the Fortran 90 interface.
Installation instructions are also provided.
> xlc -o foo foo.c $GRIB_API_INCLUDE $GRIB_API_LIB -lm
> xlf90 -o foo foo.f90 $GRIB_API_INCLUDE $GRIB_API_LIB
> gcc -m32 -o foo foo.c $GRIB_API_INCLUDE $GRIB_API_LIB
> gcc -o foo foo.c $GRIB_API_INCLUDE $GRIB_API_LIB
> use pgf90 > pgf90 -o foo foo.f90 $GRIB_API_INCLUDE $GRIB_API_LIB
1.5.3
grib-api-1.14.4/html/namespacemembers.html 0000640 0001750 0001750 00000000000 12642617500 020603 0 ustar alastair alastair grib-api-1.14.4/html/grib_convert.html 0000640 0001750 0001750 00000005012 12642617500 017767 0 ustar alastair alastair
editionNumber = 2;
if( indicatorOfParameter == 11 && indicatorOfTypeOfLevel == 105)
{
productDefinitionTemplateNumber = 1;
typeOfFirstFixedSurface = 103;
scaleFactorOfFirstFixedSurface = 0;
scaledValueOfFirstFixedSurface = 2;
}
1.5.3
grib-api-1.14.4/html/tools.html 0000640 0001750 0001750 00000005477 12642617500 016463 0 ustar alastair alastair
1.5.3
grib-api-1.14.4/html/modules.html 0000640 0001750 0001750 00000003106 12642617500 016756 0 ustar alastair alastair
1.5.3
grib-api-1.14.4/html/interfacegrib__api_1_1grib__get__element.html 0000640 0001750 0001750 00000000000 12642617500 025242 0 ustar alastair alastair grib-api-1.14.4/html/namespaces.html 0000640 0001750 0001750 00000000000 12642617500 017413 0 ustar alastair alastair grib-api-1.14.4/html/installation.html 0000640 0001750 0001750 00000005151 12642617500 020011 0 ustar alastair alastair
The only required package for a standard installation is jasper which enables the jpeg2000 packing/unpacking algorithm. It is possible to build grib_api without jasper, by using the --disable-jpeg configure option, but to install a fully functional library, its download is recommended.
> gunzip grib_api-X.X.X.tar.gz > tar xf grib_api-X.X.X.tar
> mkdir grib_api_dir
> cd grib_api-X.X.X > ./configure --prefix=grib_api_dir
> make ... > make check ... > make install ...
1.5.3
grib-api-1.14.4/html/interfacegrib__api_1_1grib__find__nearest.html 0000640 0001750 0001750 00000000000 12642617500 025413 0 ustar alastair alastair grib-api-1.14.4/html/copy__message_8f90-example.html 0000640 0001750 0001750 00000010127 12642617500 022323 0 ustar alastair alastair
00001 ! Copyright 2005-2015 ECMWF 00002 ! This software is licensed under the terms of the Apache Licence Version 2.0 00003 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 00004 ! 00005 ! In applying this licence, ECMWF does not waive the privileges and immunities granted to it by 00006 ! virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. 00007 ! 00008 ! 00009 ! Description: how to copy a message in memory 00010 ! 00011 ! 00012 ! Author: Anne Fouilloux 00013 ! 00014 ! 00015 program copy 00016 use grib_api 00017 implicit none 00018 integer :: err, centre 00019 integer(kind=kindOfSize) :: byte_size 00020 integer :: infile,outfile 00021 integer :: igrib_in,iret 00022 integer :: igrib_out 00023 character(len=1), dimension(:), allocatable :: message 00024 00025 00026 call grib_open_file(infile,'../../data/constant_field.grib1','r') 00027 call grib_open_file(outfile,'out.grib1','w') 00028 00029 ! a new grib message is loaded from file 00030 ! igrib is the grib id to be used in subsequent calls 00031 call grib_new_from_file(infile,igrib_in) 00032 00033 call grib_get_message_size(igrib_in, byte_size) 00034 allocate(message(byte_size), stat=err) 00035 00036 call grib_copy_message(igrib_in,message) 00037 00038 call grib_new_from_message(igrib_out, message) 00039 00040 centre=80 00041 call grib_set(igrib_out,"centre",centre) 00042 00043 ! write messages to a file 00044 call grib_write(igrib_out,outfile) 00045 00046 call grib_release(igrib_out) 00047 00048 call grib_release(igrib_in) 00049 00050 call grib_close_file(infile) 00051 call grib_close_file(outfile) 00052 deallocate(message) 00053 00054 end program copy
1.5.3
grib-api-1.14.4/html/tab_r.gif 0000640 0001750 0001750 00000005031 12642617500 016175 0 ustar alastair alastair GIF89a,Õ ö÷ùñô÷öøúüýþúûüùúûøùúêïóïóöÆÕßÒÞæØâéÞçíÝæìåìñèîòô÷ùóöø³ÈÕÁÒÝËÙâÏÜäÖá薴ŹɯÂÍ»ÎÙÃÔÞÂÓÝÈ×àÌÚâÕáèÙäê×âèåìðëðó„°ÇÑÞåÜæëãëïëñôîóõ÷úûûüüÿÿÿþþþ , , ÿ@’pH,ȤrÉl:ŸÐ¨tJZ¯Ø¬v•h<¬pkL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~ÏwVa+‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ “*)^,*ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂö)'ÆÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæÚ¥("ðñòóôõö÷øùúûüýþÿ
H° ÁƒòK"ƒRHœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\éÅu&@€ Á²¦Í›8sêÜɳ§Oÿ–(±€DУH“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯S84± ‰hÓª]˶۷pãÊK·®Ý»xóêÝË·¯ß¿€Ó} âDÌf(^̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹m¹ðCÄHœXͺµë×°cËžM»¶íÛ¸sëÞÍ»·ïßÀƒN÷ÃJ” Á®¹óçУKŸN½ºõëØ³kßν»÷ïàËO¾