ESMF_CFIOMod Module

MODULE: ESMF_CFIOMod

Author: GMAO SI-Team

ESMF_CFIOMod — Source file for CFIO

The code in this file provides interface specifications

This module provides all the necessary subroutines for users to write/read HDF or GrADS format output using CF convention.

History

  • Jan2004 Baoyu Yin Initial design and prototyping.
  • Apr2004 Baoyu Yin Implementation
  • Sep2004 Baoyu Yin Modified return codes to make it more specific.
  • Sep2004 Baoyu Yin Moved some utility routines to ESMF_CFIOUtil.F90.
  • Sep2004 Baoyu Yin Modified station grid metadata.
  • Sep2004 Baoyu Yin Added ptopUnit to ptop for eta and sigma coordinates.
  • Oct2004 Baoyu Yin Migrated to Halem and fixed some bugs.
  • Oct2004 Baoyu Yin Added timeString to ESMF_CFIOSet and ESMF_CFIOVarWrite. Rearranged the argument order in ESMF_CFIOVarWrite.
  • Jan2005 Baoyu Yin Fixed some memory problems. Fixed scaleFactor and offset problem. Fixed standard_name problem in reading GFIO files.
  • Mar2005 Baoyu Yin Moved some utility routines into ESMF_CFIOUtil.F90 Modified error return codes.
  • Mar2005 Baoyu Yin Added file name template
  • Apr2005 Baoyu Yin Added time interpolation routine VarReadT
  • Apr2006 da Silva Eliminated mpeu dependency.
  • Jun2006 Baoyu Yin Added cyclic option for VarReadT
  • Jun2006 Baoyu Yin Added reading 2D variable with VarReadT
  • Jul2006 da Silva Eliminated read(str,fmt) to parse time; replaced with more robust mod() calculations. Made StrTemplate public.
  • Aug2006 da Silva Added alternative interfaces to VarReadT. Included Baoyu patches in FileOpen() to handle double coordinate variables; previous merge of VarRead() and VarReadT() has been rolled back.
  • Dec2006 da Silva Added ESMF_CFIODownBit() to downgrade precision for better gzipping.
  • Feb2007 Baoyu Yin This is a new wrapper module for handling SDF or GrADS format output.
  • Mar2008 Dan Kokron Replace some code in ESMF_CFIOVarReadT2D__ that prevent time increment larger than 99 hours
  • Jun2008 Dan Kokron Replace read(str,fmt) to parse time in VarReadT3D with call to parseIntTime

Uses

  • module~~esmf_cfiomod~~UsesGraph module~esmf_cfiomod ESMF_CFIOMod ESMF ESMF module~esmf_cfiomod->ESMF iso_fortran_env iso_fortran_env module~esmf_cfiomod->iso_fortran_env module~esmf_cfiofilemod ESMF_CFIOFileMod module~esmf_cfiomod->module~esmf_cfiofilemod module~esmf_cfiogridmod ESMF_CFIOGridMod module~esmf_cfiomod->module~esmf_cfiogridmod module~esmf_cfiosdfmod ESMF_CFIOSdfMod module~esmf_cfiomod->module~esmf_cfiosdfmod module~esmf_cfioutilmod ESMF_CFIOUtilMod module~esmf_cfiomod->module~esmf_cfioutilmod module~esmf_cfiovarinfomod ESMF_CFIOVarInfoMod module~esmf_cfiomod->module~esmf_cfiovarinfomod module~esmf_cfiofilemod->module~esmf_cfiogridmod module~esmf_cfiofilemod->module~esmf_cfioutilmod module~esmf_cfiofilemod->module~esmf_cfiovarinfomod module~esmf_cfiogridmod->iso_fortran_env module~esmf_cfiogridmod->module~esmf_cfioutilmod module~esmf_cfiosdfmod->iso_fortran_env module~esmf_cfiosdfmod->module~esmf_cfiofilemod module~esmf_cfiosdfmod->module~esmf_cfiogridmod module~esmf_cfiosdfmod->module~esmf_cfioutilmod module~esmf_cfiosdfmod->module~esmf_cfiovarinfomod netcdf netcdf module~esmf_cfiosdfmod->netcdf module~esmf_cfioutilmod->iso_fortran_env ESMF_CFIOBaseMod ESMF_CFIOBaseMod module~esmf_cfioutilmod->ESMF_CFIOBaseMod module~esmf_cfioutilmod->netcdf module~esmf_cfiovarinfomod->module~esmf_cfiogridmod module~esmf_cfiovarinfomod->module~esmf_cfioutilmod

Used by

  • module~~esmf_cfiomod~~UsedByGraph module~esmf_cfiomod ESMF_CFIOMod module~esmf_cfiocollectionmod ESMF_CFIOCollectionMod module~esmf_cfiocollectionmod->module~esmf_cfiomod module~esmf_cfioptrvectormod ESMF_CFIOPtrVectorMod module~esmf_cfioptrvectormod->module~esmf_cfiomod module~mapl MAPL module~mapl->module~esmf_cfiomod module~mapl_cfiomod MAPL_CFIOMod module~mapl_cfiomod->module~esmf_cfiomod module~mapl_extdatagridcompmod MAPL_ExtDataGridCompMod module~mapl_extdatagridcompmod->module~esmf_cfiomod program~regrid_util Regrid_Util program~regrid_util->module~esmf_cfiomod program~test test program~test->module~esmf_cfiomod program~test~10 test program~test~10->module~esmf_cfiomod program~test~11 test program~test~11->module~esmf_cfiomod program~test~12 test program~test~12->module~esmf_cfiomod program~test~13 test program~test~13->module~esmf_cfiomod program~test~14 test program~test~14->module~esmf_cfiomod program~test~2 test program~test~2->module~esmf_cfiomod program~test~3 test program~test~3->module~esmf_cfiomod program~test~4 test program~test~4->module~esmf_cfiomod program~test~5 test program~test~5->module~esmf_cfiomod program~test~6 test program~test~6->module~esmf_cfiomod program~test~7 test program~test~7->module~esmf_cfiomod program~test~8 test program~test~8->module~esmf_cfiomod program~test~9 test program~test~9->module~esmf_cfiomod program~utcfio~2 utCFIO program~utcfio~2->module~esmf_cfiomod program~utcfio~3 utCFIO program~utcfio~3->module~esmf_cfiomod program~utdownbit utDownBit program~utdownbit->module~esmf_cfiomod

Interfaces

public interface ESMF_CFIODownBit

  • private subroutine ESMF_CFIODownBit3D_(x, xr, nbits, undef, flops, rc)

    ESMF_CFIODownBit - GRIB-based compression pre-conditioner

    This routine returns a lower precision version of the input array x which retains nbits of precision. See routine ESMF\_CFIODownBit2D for additional details. This version for rank 3 arrays, calls ESMF\_CFIODownBit2D() for each vertical level.

    History

    • 06Dec2006 da Silva Initial version.

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in) :: x(:,:,:)

    input array

    real(kind=REAL32), intent(out) :: xr(:,:,:)

    precision reduced array; can

    if it has same kind

    integer, intent(in) :: nbits

    number of bits per word to retain - no action if nbits<1

    real, intent(in), optional :: undef
    logical, intent(in), optional :: flops

    if true, uses slower float point based algorithm

    integer, intent(out) :: rc

    error code = 0 - all is well /= 0 - something went wrong

  • private subroutine ESMF_CFIODownBit2D_(x, xr, nbits, undef, flops, rc)

    ESMF_CFIODownBit - GRIB-based compression pre-conditioner

    This routine returns a lower precision version of the input array x which retains nbits of precision. Two algorithms are implemented: 1) a fast one writen in C which downgrades precision by shifting xbits = 24 - nbits bits of the mantissa, and 2) a slower float point based algorithm which is the same algorithm as GRIB with fixed number of bits packing. Notice that as in GRIB the scaling factor is forced to be a power of 2 rather than a generic float. Using this power of 2 binary scaling has the advantage of improving the GZIP compression rates.

    This routine returns an array of the same type and kind as the input array, so no data compression has taken place. The goal here is to reduce the entropy in the input array, thereby improving compression rates by the lossless algorithms implemented internally by HDF-4/5 when writing these data to a file. In fact, these GZIP’ed and pre-conditioned files have sizes comparable to the equivalent GRIB file, while being a bonafide self-describing HDF/NetCDF file.

    @note Todo : Perhaps implement GRIB decimal scaling (variable number of bits).

    History

    • 06Dec2006 da Silva Initial version.

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in) :: x(:,:)

    input array

    real(kind=REAL32), intent(out) :: xr(:,:)

    precision reduced array; can share storage with input array if it has same kind

    integer, intent(in) :: nbits

    number of bits per word to retain

    real, intent(in), optional :: undef

    missing value

    logical, intent(in), optional :: flops

    if true, uses slower float point based algorithm

    integer, intent(out) :: rc

    error code = 0 - all is well /= 0 - something went wrong

public interface ESMF_CFIOVarRead

  • private subroutine ESMF_CFIOVarRead3D_(cfio, vName, field, date, curTime, kbeg, kount, xBeg, xCount, yBeg, yCount, timeString, rc)

    ESMF_CFIOVarRead3D_ – Read a variable from an existing file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    real, pointer :: field(:,:,:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: kbeg

    first level to write

    integer, intent(in), optional :: kount

    number of levels to write

    integer, intent(in), optional :: xBeg

    first point for lon

    integer, intent(in), optional :: xCount

    number of points to read

    integer, intent(in), optional :: yBeg

    first point for lat

    integer, intent(in), optional :: yCount

    number of points to read

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    integer, intent(out), optional :: rc

    Error return code: 0 all is well

  • private subroutine ESMF_CFIOVarRead2D_(cfio, vName, field, date, curTime, kbeg, kount, xBeg, xCount, yBeg, yCount, timeString, rc)

    ESMF_CFIOVarRead2D_ – Read a variable from an existing file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    real, pointer :: field(:,:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: kbeg

    first level to write

    integer, intent(in), optional :: kount

    number of levels to write

    integer, intent(in), optional :: xBeg

    first point for lon

    integer, intent(in), optional :: xCount

    number of points to read

    integer, intent(in), optional :: yBeg

    first point for lat

    integer, intent(in), optional :: yCount

    number of points to read

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    integer, intent(out), optional :: rc

    Error return code: 0 all is well

  • private subroutine ESMF_CFIOVarRead1D_(cfio, vName, field, date, curTime, xBeg, xCount, timeString, rc)

    ESMF_CFIOVarRead1D_ – Read a variable from an existing file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    real, pointer :: field(:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: xBeg

    first point for lon

    integer, intent(in), optional :: xCount

    number of points to read

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    integer, intent(out), optional :: rc

    Error return code: 0 all is well

public interface ESMF_CFIOVarReadT

  • private subroutine ESMF_CFIOVarReadT3D_(cfio, vName, field, date, curTime, kbeg, kount, timeString, cfio2, rc)

    ESMF_CFIOVarReadT3D_ – Read a variable from an existing file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    real, pointer :: field(:,:,:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: kbeg

    first level to read

    integer, intent(in), optional :: kount

    number of levels to read

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    type(ESMF_CFIO), intent(inout), optional :: cfio2

    second CFIO obj

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -19 unable to identify coordinate variable rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -46 error from NF90_GET_VAR rc = -48 error from NF90_INQUIRE rc = -52 error from NF90_INQUIRE_VARIABLE rc = -99 must specify date/curTime of timeString

  • private subroutine ESMF_CFIOVarReadT2D_(cfio, vName, field, date, curTime, kbeg, kount, timeString, cfio2, rc)

    ESMF_CFIOVarReadT2D_ – Read a variable from an existing file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    real, pointer :: field(:,:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: kbeg

    first level to read

    integer, intent(in), optional :: kount

    number of levels to read

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    type(ESMF_CFIO), intent(inout), optional :: cfio2

    second CFIO obj

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -19 unable to identify coordinate variable rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -46 error from NF90_GET_VAR rc = -48 error from NF90_INQUIRE rc = -52 error from NF90_INQUIRE_VARIABLE rc = -99 must specify date/curTime of timeString

public interface ESMF_CFIOVarReadT2

  • private subroutine ESMF_CFIOVarReadT3D__(cfio, vName, date, curTime, field, kbeg, kount, rc, cfio2)

    ESMF_CFIOVarReadT3D_ – Read a variable from an existing file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    integer, intent(in) :: date

    yyyymmdd

    integer, intent(in) :: curTime

    hhmmss

    real, pointer :: field(:,:,:)

    array contains data

    integer, intent(in), optional :: kbeg

    first level to read

    integer, intent(in), optional :: kount

    number of levels to read

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -19 unable to identify coordinate variable rc = -20 unable to find variable rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -46 error from NF90_GET_VAR rc = -48 error from NF90_INQUIRE rc = -52 error from NF90_INQUIRE_VARIABLE

    type(ESMF_CFIO), intent(inout), optional :: cfio2

    second CFIO obj

  • private subroutine ESMF_CFIOVarReadT2D__(cfio, vName, date, curTime, field, kbeg, kount, rc, cfio2)

    ESMF_CFIOVarReadT2D_ – Read a variable from an existing file !INTERFACE:

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    variable name

    integer, intent(in) :: date

    yyyymmdd

    integer, intent(in) :: curTime

    hhmmss

    real, pointer :: field(:,:)

    array contains data

    integer, intent(in), optional :: kbeg

    first level to read

    integer, intent(in), optional :: kount

    number of levels to read

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -19 unable to identify coordinate variable rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -46 error from NF90_GET_VAR rc = -48 error from NF90_INQUIRE rc = -52 error from NF90_INQUIRE_VARIABLE

    type(ESMF_CFIO), intent(inout), optional :: cfio2

    second CFIO obj

public interface ESMF_CFIOVarWrite

  • private subroutine ESMF_CFIOVarWrite3D_(cfio, vName, field, date, curTime, kbeg, kount, timeString, doComp, doChunk, rc)

    ESMF_CFIOVarWrite3D_ – Write a variable to a output file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    Variable name

    real, intent(in) :: field(:,:,:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: kbeg

    first level to write

    integer, intent(in), optional :: kount

    number of levels to write

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    logical, intent(in), optional :: doComp

    do compression

    logical, intent(in), optional :: doChunk

    do chunk compression

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -15 data outside of valid range rc = -16 data outside of packing range rc = -17 data outside of pack and valid range rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -45 error from NF90_PUT_VAR rc = -46 error from NF90_GET_VAR rc = -52 error from NF90_INQUIRE_VARIABLE rc = -53 error from NF90_GET_ATT rc = -54 Format is not known

  • private subroutine ESMF_CFIOVarWrite2D_(cfio, vName, field, date, curTime, kbeg, kount, timeString, doComp, doChunk, rc)

    ESMF_CFIOVarWrite2D_ – Write a variable to a output file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    Variable name

    real, intent(in) :: field(:,:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    integer, intent(in), optional :: kbeg

    first level to write

    integer, intent(in), optional :: kount

    number of levels to write

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    logical, intent(in), optional :: doComp

    do compression

    logical, intent(in), optional :: doChunk

    do chunk compression

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -15 data outside of valid range rc = -16 data outside of packing range rc = -17 data outside of pack and valid range rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -45 error from NF90_PUT_VAR rc = -46 error from NF90_GET_VAR rc = -52 error from NF90_INQUIRE_VARIABLE rc = -53 error from NF90_GET_ATT rc = -54 Format is not known

  • private subroutine ESMF_CFIOVarWrite1D_(cfio, vName, field, date, curTime, timeString, rc)

    ESMF_CFIOVarWrite1D_ – Write a variable to a output file

    Arguments

    Type IntentOptional Attributes Name
    type(ESMF_CFIO), intent(inout) :: cfio

    a CFIO obj

    character(len=*), intent(in) :: vName

    Variable name

    real, intent(in) :: field(:)

    array contains data

    integer, intent(in), optional :: date

    yyyymmdd

    integer, intent(in), optional :: curTime

    hhmmss

    character(len=*), intent(in), optional :: timeString

    string expression for date and time

    integer, intent(out), optional :: rc

    Error return code: 0 all is well rc = -2 time is inconsistent with increment rc = -3 number of levels is incompatible with file rc = -4 im is incompatible with file rc = -5 jm is incompatible with file rc = -6 time must fall on a minute boundary rc = -7 error in diffdate rc = -12 error determining default precision rc = -13 error determining variable type rc = -15 data outside of valid range rc = -16 data outside of packing range rc = -17 data outside of pack and valid range rc = -38 error from NF90_PUT_VAR (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) rc = -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -45 error from NF90_PUT_VAR rc = -46 error from NF90_GET_VAR rc = -52 error from NF90_INQUIRE_VARIABLE rc = -53 error from NF90_GET_ATT rc = -54 Format is not known

public interface ESMF_CFIOstrTemplate

  • public subroutine strTemplate_(str, tmpl, class, xid, nymd, nhms, stat)

    strTemplate_ - expanding a format template to a string

    History

    • 03Jun99 - Jing Guo guo@dao.gsfc.nasa.gov - initial prototype/prolog/code
    • 08Jan01 - da Silva: moved uppercase() to outside select() to avoid coredump on Linux/PGI.

    ! uc_class=uppercase(tmpl_class)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(out) :: str
    character(len=*), intent(in) :: tmpl
    character(len=*), intent(in), optional :: class
    character(len=*), intent(in), optional :: xid
    integer, intent(in), optional :: nymd
    integer, intent(in), optional :: nhms
    integer, intent(out), optional :: stat

Subroutines

public subroutine ESMF_CFIOFileClose(cfio, rc)

ESMF_CFIOFileClose – close an open CFIO stream

Arguments

Type IntentOptional Attributes Name
type(ESMF_CFIO), intent(inout) :: cfio
integer, intent(out), optional :: rc

Error return code: 0 all is well -54 error from ncclos (file close)

public subroutine ESMF_CFIOFileCreate(cfio, rc, expid, format)

ESMF_CFIOFileCreate – Create a CFIO output file with meta data

Arguments

Type IntentOptional Attributes Name
type(ESMF_CFIO), intent(inout) :: cfio

a CFIO object

integer, intent(out), optional :: rc

Error return code: 0 all is well -1 Time increment is 0 -2 allocate memory error -3 Num of int/char/real elements and Cnt don’t match -12 error determining default precision -18 incorrect time increment -30 can’t open file -31 error from NF90_DEF_DIM -32 error from NF90_DEF_VAR (dimension variable) -33 error from NF90_PUT_ATT (dimension attribute) -34 error from NF90_DEF_VAR (variable) -35 error from NF90_PUT_ATT (variable attribute) -36 error from NF90_PUT_ATT (global attribute) -37 error from NF90_ENDDEF -38 error from NF90_PUT_VAR (dimension variable) -39 Num of real var elements and Cnt differ -55 error from NF90_REDEF (enter define mode) -56 error from NF90_ENDDEF (exit define mode)

character(len=*), intent(in), optional :: expid

Experiment ID

character(len=*), intent(in), optional :: format

GrADS or SDF

public subroutine ESMF_CFIOFileOpen(cfio, fmode, rc, expid, cyclic)

ESMF_CFIOFileOpen – open a CFIO file, and get CFIO meta data into a cfio Object.

Arguments

Type IntentOptional Attributes Name
type(ESMF_CFIO), intent(inout) :: cfio

a CFIO object

integer, intent(in) :: fmode

0 for READ-WRITE non-zero for READ-ONLY

integer, intent(out), optional :: rc

Error return code: 0 all is well -1 invalid count -2 type mismatch -12 error determining default precision -10 ngatts is incompatible with file -11 character string not long enough -19 unable to identify coordinate variable -36 error from NF90_PUT_ATT (global attribute) -39 error from NF90_OPEN (file open) -40 error from NF90_INQ_VARID -41 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lat or lon) -42 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (lev) -43 error from NF90_INQ_VARID (time variable) -47 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (time) -48 error from NF90_INQUIRE -51 error from NF90_GET_ATT (global attribute) -52 error from NF90_INQUIRE_VARIABLE -53 error from NF90_GET_ATT -57 error from NF90_INQ_ATTNAME -58 error from NF90_INQUIRE_ATTRIBUTE

character(len=*), intent(in), optional :: expid

Experiment ID

logical, intent(in), optional :: cyclic

cyclic input file