NCEPLIBS-bufr  12.1.0
arallocf.F90 File Reference

Allocate or deallocate Fortran language arrays. More...

Go to the source code of this file.

Functions/Subroutines

subroutine arallocf
 Dynamically allocate Fortran language arrays. More...
 
subroutine ardllocf
 Free all memory that was dynamically allocated during a previous call to subroutine arallocf(). More...
 
subroutine exitbufr
 Free all dynamically-allocated memory, close all logical units that are open within the NCEPLIBS-bufr software, and reset the library to all of its default settings as though it had never been called. More...
 
integer function igetprm (cprmnm)
 Return the current value of a parameter used for allocating one or more internal arrays within the NCEPLIBS-bufr software. More...
 
recursive integer function isetprm (cprmnm, ipval)
 Set a specified parameter to a specified value for use in dynamically allocating one or more internal arrays within the NCEPLIBS-bufr software. More...
 

Detailed Description

Allocate or deallocate Fortran language arrays.

Author
J. Ator
Date
2014-12-04

Definition in file arallocf.F90.

Function/Subroutine Documentation

◆ arallocf()

subroutine arallocf

Dynamically allocate Fortran language arrays.

This subroutine is called internally during the first call to subroutine openbf() from an application program, in order to dynamically allocate internal Fortran language arrays based on parameter values set during one or more previous calls to function isetprm().

All memory allocated within this subroutine can be freed via a subsequent call to subroutine exitbufr().

Author
J. Ator
Date
2014-12-04

Definition at line 18 of file arallocf.F90.

References bort(), moda_mstabs::cbbw, moda_mstabs::cbelem, moda_mstabs::cbmnem, moda_mstabs::cbscl, moda_mstabs::cbsref, moda_mstabs::cbunit, moda_mstabs::cdmnem, moda_s3list::cds3, moda_mstabs::cdseq, moda_rdmtb::ceelem, moda_h4wlc::chh4wlc, moda_rdmtb::cmdscb, moda_rdmtb::cmdscd, moda_s01cm::cmnem, moda_dscach::cnem, moda_rlccmn::crtag, moda_bitmaps::ctco, errwrt(), moda_bitbuf::ibay, moda_mstabs::ibfxyn, moda_tables::ibt, moda_bitmaps::ibtmse, moda_msgmem::icdxts, moda_msgcwd::idate, moda_dscach::idcach, moda_mstabs::idefxy, moda_mstabs::idfxyn, moda_tababd::idna, moda_tababd::idnb, moda_tababd::idnd, moda_idrdm::idrdm, moda_s3list::ids3, moda_rdmtb::iefxyn, moda_nrv203::ienrv, moda_msgmem::ifdxts, moda_msgcwd::inode, moda_nrv203::inodnrv, moda_bitmaps::inodtamc, moda_bitmaps::inodtco, moda_usrint::inv, moda_stbfr::iolun, moda_stbfr::iomsg, moda_msgmem::ipdxm, moda_msgmem::ipmsgs, moda_rlccmn::irbit, moda_tables::irf, moda_rlccmn::irnch, moda_nmikrp::irp, moda_tables::isc, moda_sc3bfr::isc3, moda_stcode::iscodes, moda_tables::iseq, moda_nrv203::isnrv, moda_bitmaps::istbtm, moda_bitmaps::iszbtm, moda_ivttmp::itmp, moda_tables::itp, moda_comprx::ityp, moda_usrtmp::iutmp, moda_ival::ival, moda_s01cm::ivmnem, moda_comprx::iwid, moda_bufrsr::jbay, moda_comprx::jlnode, moda_tables::jmpb, moda_tables::jseq, moda_bufrsr::jsr, moda_tables::jump, moda_comprx::kbit, moda_comprx::kmax, moda_comprx::kmin, moda_comprx::kmis, moda_tables::knt, moda_tables::knti, moda_nmikrp::krp, moda_tables::link, moda_h4wlc::luh4wlc, moda_ufbcpl::luncpy, moda_lushr::lus, moda_comprs::matx, moda_bitbuf::mbay, moda_usrbit::mbit, moda_bitbuf::mbyt, moda_msgmem::mdx, moda_mgwa::mgwa, moda_mgwb::mgwb, moda_bufrmg::msglen, moda_msglim::msglim, moda_msgmem::msgp, moda_msgmem::msgs, moda_bufrmg::msgtxt, moda_unptyp::msgunp, moda_msgcwd::msub, moda_tababd::mtab, moda_msgmem::mxdxm, moda_msgmem::mxdxw, moda_usrbit::nbit, moda_bitmaps::nbtmse, moda_dscach::ndc, moda_mstabs::ndelem, moda_nmikrp::nem, moda_msgcwd::nmsg, moda_usrint::nrfelm, moda_nrv203::nrv, moda_msgcwd::nsub, moda_tababd::ntba, moda_tababd::ntbb, moda_tababd::ntbd, moda_bitmaps::ntco, moda_nulbfr::null, moda_usrint::nval, moda_h4wlc::sth4wlc, moda_tababd::taba, moda_tababd::tabb, moda_tababd::tabd, moda_tables::tag, moda_nrv203::tagnrv, moda_sc3bfr::tamnem, moda_ivttmp::ttmp, moda_tables::typ, moda_usrint::val, moda_tables::vali, moda_ivttmp::vtmp, moda_usrtmp::vutmp, and moda_xtab::xtab.

Referenced by openbf().

◆ ardllocf()

subroutine ardllocf

Free all memory that was dynamically allocated during a previous call to subroutine arallocf().

Author
J. Ator
Date
2014-12-04

Definition at line 592 of file arallocf.F90.

References moda_comprs::catx, moda_mstabs::cbbw, moda_mstabs::cbelem, moda_mstabs::cbmnem, moda_mstabs::cbscl, moda_mstabs::cbsref, moda_mstabs::cbunit, moda_mstabs::cdmnem, moda_s3list::cds3, moda_mstabs::cdseq, moda_rdmtb::ceelem, moda_h4wlc::chh4wlc, moda_rdmtb::cmdscb, moda_rdmtb::cmdscd, moda_s01cm::cmnem, moda_dscach::cnem, moda_rlccmn::crtag, moda_comprx::cstr, moda_bitmaps::ctco, moda_bitbuf::ibay, moda_mstabs::ibfxyn, moda_tables::ibt, moda_bitmaps::ibtmse, moda_msgmem::icdxts, moda_msgcwd::idate, moda_dscach::idcach, moda_mstabs::idefxy, moda_mstabs::idfxyn, moda_tababd::idna, moda_tababd::idnb, moda_tababd::idnd, moda_idrdm::idrdm, moda_s3list::ids3, moda_rdmtb::iefxyn, moda_nrv203::ienrv, moda_msgmem::ifdxts, moda_msgcwd::inode, moda_nrv203::inodnrv, moda_bitmaps::inodtamc, moda_bitmaps::inodtco, moda_usrint::inv, moda_stbfr::iolun, moda_stbfr::iomsg, moda_msgmem::ipdxm, moda_msgmem::ipmsgs, moda_rlccmn::irbit, moda_tables::irf, moda_rlccmn::irnch, moda_nmikrp::irp, moda_tables::isc, moda_sc3bfr::isc3, moda_stcode::iscodes, moda_tables::iseq, moda_nrv203::isnrv, moda_bitmaps::istbtm, moda_bitmaps::iszbtm, moda_ivttmp::itmp, moda_tables::itp, moda_comprx::ityp, moda_usrtmp::iutmp, moda_ival::ival, moda_s01cm::ivmnem, moda_comprx::iwid, moda_bufrsr::jbay, moda_comprx::jlnode, moda_tables::jmpb, moda_tables::jseq, moda_bufrsr::jsr, moda_tables::jump, moda_comprx::kbit, moda_comprx::kmax, moda_comprx::kmin, moda_comprx::kmis, moda_tables::knt, moda_tables::knti, moda_nmikrp::krp, moda_tables::link, moda_h4wlc::luh4wlc, moda_ufbcpl::luncpy, moda_lushr::lus, moda_comprs::matx, moda_bitbuf::mbay, moda_usrbit::mbit, moda_bitbuf::mbyt, moda_msgmem::mdx, moda_mgwa::mgwa, moda_mgwb::mgwb, moda_bufrmg::msglen, moda_msglim::msglim, moda_msgmem::msgp, moda_msgmem::msgs, moda_bufrmg::msgtxt, moda_unptyp::msgunp, moda_msgcwd::msub, moda_tababd::mtab, moda_usrbit::nbit, moda_bitmaps::nbtmse, moda_dscach::ndc, moda_mstabs::ndelem, moda_nmikrp::nem, moda_msgcwd::nmsg, moda_usrint::nrfelm, moda_nrv203::nrv, moda_msgcwd::nsub, moda_tababd::ntba, moda_tababd::ntbb, moda_tababd::ntbd, moda_bitmaps::ntco, moda_nulbfr::null, moda_usrint::nval, moda_h4wlc::sth4wlc, moda_tababd::taba, moda_tababd::tabb, moda_tababd::tabd, moda_tables::tag, moda_nrv203::tagnrv, moda_sc3bfr::tamnem, moda_ivttmp::ttmp, moda_tables::typ, moda_usrint::val, moda_tables::vali, moda_ivttmp::vtmp, moda_usrtmp::vutmp, and moda_xtab::xtab.

Referenced by exitbufr().

◆ exitbufr()

subroutine exitbufr

Free all dynamically-allocated memory, close all logical units that are open within the NCEPLIBS-bufr software, and reset the library to all of its default settings as though it had never been called.

Remarks
  • Calling this subroutine allows an application program to potentially resize arrays and reallocate memory all over again with a new subsequent series of calls to subroutines isetprm() and openbf(). However, if and when this subroutine is called, there is no longer any internal memory available within the NCEPLIBS-bufr software, and the remainder of the library becomes essentially unusable within the application program, unless and until subroutine openbf() is called once again to dynamically allocate new array space. This may be a useful capability for application programs that are finished with using the NCEPLIBS-bufr software and wish to move on to other unrelated tasks without continuing to tie up all of the allocated memory space within the library. Otherwise, and unless there's a need to change parameter sizes following the first call to subroutine openbf(), then there's no need to ever call this subroutine within an application program, since all allocated memory will automatically get freed anyway by the operating system once the application program terminates.
Author
J. Ator
Date
2015-03-02

Definition at line 900 of file arallocf.F90.

References ardllocf(), moda_tablef::cdmf, closbf(), moda_stbfr::iolun, and moda_s01cm::ns01v.

Referenced by bufr_c2f_interface::exitbufr_c().

◆ igetprm()

integer function igetprm ( character*(*), intent(in)  cprmnm)

Return the current value of a parameter used for allocating one or more internal arrays within the NCEPLIBS-bufr software.

Parameters
cprmnm- Parameter
  • 'MXMSGL' = Maximum length (in bytes) of a BUFR message
  • 'MAXSS' = Maximum number of data values in an uncompressed BUFR subset
  • 'MXCDV' = Maximum number of data values that can be written into a compressed BUFR subset
  • 'MXLCC' = Maximum length (in bytes) of a character string that can be written into a compressed BUFR subset
  • 'MXCSB' = Maximum number of subsets that can be written into a compressed BUFR message
  • 'NFILES' = Maximum number of BUFR files that can be accessed for reading or writing at any one time
  • 'MAXTBA' = Maximum number of entries in internal BUFR Table A per BUFR file
  • 'MAXTBB' = Maximum number of entries in internal BUFR Table B per BUFR file
  • 'MAXTBD' = Maximum number of entries in internal BUFR Table D per BUFR file
  • 'MAXMEM' = Maximum number of bytes that can be used to store BUFR messages in internal memory
  • 'MAXMSG' = Maximum number of BUFR messages that can be stored in internal memory
  • 'MXDXTS' = Maximum number of dictionary tables that can be stored for use with BUFR messages in internal memory
  • 'MXMTBB' = Maximum number of master Table B entries
  • 'MXMTBD' = Maximum number of master Table D entries
  • 'MXMTBF' = Maximum number of master Code/Flag entries
  • 'MAXCD' = Maximum number of child descriptors in a Table D descriptor sequence definition
  • 'MAXJL' = Maximum number of entries in the internal jump/link table
  • 'MXS01V' = Maximum number of default Section 0 or Section 1 values that can be overwritten within an output BUFR message
  • 'MXBTM' = Maximum number of bitmaps that can be stored internally for a BUFR subset
  • 'MXBTMSE' = Maximum number of entries that can be set within a bitmap
  • 'MXTAMC' = Maximum number of Table A mnemonics in the internal jump/link table which contain at least one Table C operator with XX >= 21 in their subset definition
  • 'MXTCO' = Maximum number of Table C operators with XX >= 21 in the subset definition of a Table A mnemonic
  • 'MXNRV' = Maximum number of 2-03 reference values in the internal jump/link table
  • 'MXRST' = Maximum number of long character strings that can be read from a compressed subset
  • 'MXH4WLC' = Maximum number of long character strings that can be stored internally
  • 'MXCNEM' = Maximum number of Table A entries that can be cached during Section 3 decoding of BUFR messages
  • 'MAXNC' = Maximum number of descriptors within Section 3 of a BUFR message
  • 'MXNAF' = Maximum number of associated fields that can be in effect at any given time for a Table B descriptor
Returns
igetprm - Value of cprmnm
  • -1 Unknown cprmnm
Author
J. Ator
Date
2014-12-04

Definition at line 1113 of file arallocf.F90.

References errwrt().

Referenced by bufr_c2f_interface::igetprm_c().

◆ isetprm()

recursive integer function isetprm ( character*(*), intent(in)  cprmnm,
integer, intent(in)  ipval 
)

Set a specified parameter to a specified value for use in dynamically allocating one or more internal arrays within the NCEPLIBS-bufr software.

A separate call to this function must be made for each parameter that is to be set to a customized value, and all such calls must be made prior to the first call to subroutine openbf() from within an application program, because that is when all internal arrays are dynamically allocated based on the parameter values in effect at the time. Otherwise, if this function is never called for a particular parameter, then an internal default value for that parameter is used instead.

Parameters
cprmnm- Parameter to be changed from its internal default value:
  • 'MXMSGL' = Maximum length (in bytes) of a BUFR message
  • 'MAXSS' = Maximum number of data values in an uncompressed BUFR subset
  • 'MXCDV' = Maximum number of data values that can be written into a compressed BUFR subset
  • 'MXLCC' = Maximum length (in bytes) of a character string that can be written into a compressed BUFR subset
  • 'MXCSB' = Maximum number of subsets that can be written into a compressed BUFR message
  • 'NFILES' = Maximum number of BUFR files that can be accessed for reading or writing at any one time
  • 'MAXTBA' = Maximum number of entries in internal BUFR Table A per BUFR file
  • 'MAXTBB' = Maximum number of entries in internal BUFR Table B per BUFR file
  • 'MAXTBD' = Maximum number of entries in internal BUFR Table D per BUFR file
  • 'MAXMEM' = Maximum number of bytes that can be used to store BUFR messages in internal memory
  • 'MAXMSG' = Maximum number of BUFR messages that can be stored in internal memory
  • 'MXDXTS' = Maximum number of dictionary tables that can be stored for use with BUFR messages in internal memory
  • 'MXMTBB' = Maximum number of master Table B entries
  • 'MXMTBD' = Maximum number of master Table D entries
  • 'MXMTBF' = Maximum number of master Code/Flag entries
  • 'MAXCD' = Maximum number of child descriptors in a Table D descriptor sequence definition
  • 'MAXJL' = Maximum number of entries in the internal jump/link table
  • 'MXS01V' = Maximum number of default Section 0 or Section 1 values that can be overwritten within an output BUFR message
  • 'MXBTM' = Maximum number of bitmaps that can be stored internally for a BUFR subset
  • 'MXBTMSE' = Maximum number of entries that can be set within a bitmap
  • 'MXTAMC' = Maximum number of Table A mnemonics in the internal jump/link table which contain at least one Table C operator with XX >= 21 in their subset definition
  • 'MXTCO' = Maximum number of Table C operators with XX >= 21 in the subset definition of a Table A mnemonic
  • 'MXNRV' = Maximum number of 2-03 reference values in the internal jump/link table
  • 'MXRST' = Maximum number of long character strings that can be read from a compressed subset
  • 'MXH4WLC' = Maximum number of long character strings that can be stored internally
  • 'MXCNEM' = Maximum number of Table A entries that can be cached during Section 3 decoding of BUFR messages
  • 'MAXNC' = Maximum number of descriptors within Section 3 of a BUFR message
  • 'MXNAF' = Maximum number of associated fields that can be in effect at any given time for a Table B descriptor
ipval- Value to be set for cprmnm
Returns
isetprm - return code:
  • 0 = normal return
  • -1 = Unknown cprmnm
Author
J. Ator
Date
2014-12-04

Definition at line 979 of file arallocf.F90.

References errwrt(), and x84().

Referenced by bufr_c2f_interface::isetprm_c().