ESMF_CFIOSdfMod Module

MODULE: ESMF_CFIOSdfMod

Author: GMAO SI-Team

ESMF_CFIOSdfMod - Source file for CFIO.

The module ESMF_CFIOSdfMod provides data type definitions and interface specifications. It provides all the necessary subroutines for users to write/read HDF format output using CF convention.

History

  • Feb2007 Baoyu Yin Modified from ESMF_CFIOSdfMod.F90. This is the SDF module for CFIO.

Uses

  • module~~esmf_cfiosdfmod~~UsesGraph module~esmf_cfiosdfmod ESMF_CFIOSdfMod iso_fortran_env iso_fortran_env module~esmf_cfiosdfmod->iso_fortran_env module~esmf_cfiofilemod ESMF_CFIOFileMod module~esmf_cfiosdfmod->module~esmf_cfiofilemod module~esmf_cfiogridmod ESMF_CFIOGridMod module~esmf_cfiosdfmod->module~esmf_cfiogridmod module~esmf_cfioutilmod ESMF_CFIOUtilMod module~esmf_cfiosdfmod->module~esmf_cfioutilmod module~esmf_cfiovarinfomod ESMF_CFIOVarInfoMod module~esmf_cfiosdfmod->module~esmf_cfiovarinfomod netcdf netcdf module~esmf_cfiosdfmod->netcdf 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_cfioutilmod->iso_fortran_env module~esmf_cfioutilmod->netcdf ESMF_CFIOBaseMod ESMF_CFIOBaseMod module~esmf_cfioutilmod->ESMF_CFIOBaseMod module~esmf_cfiovarinfomod->module~esmf_cfiogridmod module~esmf_cfiovarinfomod->module~esmf_cfioutilmod

Used by

  • module~~esmf_cfiosdfmod~~UsedByGraph module~esmf_cfiosdfmod ESMF_CFIOSdfMod module~esmf_cfiomod ESMF_CFIOMod module~esmf_cfiomod->module~esmf_cfiosdfmod program~test test program~test->module~esmf_cfiosdfmod program~test->module~esmf_cfiomod program~test~10 test program~test~10->module~esmf_cfiosdfmod program~test~10->module~esmf_cfiomod program~test~11 test program~test~11->module~esmf_cfiosdfmod program~test~11->module~esmf_cfiomod program~test~12 test program~test~12->module~esmf_cfiosdfmod program~test~12->module~esmf_cfiomod program~test~14 test program~test~14->module~esmf_cfiosdfmod program~test~14->module~esmf_cfiomod program~test~2 test program~test~2->module~esmf_cfiosdfmod program~test~2->module~esmf_cfiomod program~test~3 test program~test~3->module~esmf_cfiosdfmod program~test~3->module~esmf_cfiomod program~test~4 test program~test~4->module~esmf_cfiosdfmod program~test~4->module~esmf_cfiomod program~test~5 test program~test~5->module~esmf_cfiosdfmod program~test~5->module~esmf_cfiomod program~test~7 test program~test~7->module~esmf_cfiosdfmod program~test~7->module~esmf_cfiomod program~test~8 test program~test~8->module~esmf_cfiosdfmod program~test~8->module~esmf_cfiomod program~test~9 test program~test~9->module~esmf_cfiosdfmod program~test~9->module~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~13 test program~test~13->module~esmf_cfiomod program~test~6 test program~test~6->module~esmf_cfiomod program~utcfio utCFIO program~utcfio->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_CFIOSdfVarRead

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

    ESMF_CFIOSdfVarRead3D_ – 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 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 = -8 vname miss-match rc = -12 error determining default precision rc = -13 error determining variable type rc = -19 unable to identify coordinate variable rc = -38 error from NF90_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (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

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

    ESMF_CFIOSdfVarRead2D_ – 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 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 = -8 vname miss-match rc = -12 error determining default precision rc = -13 error determining variable type rc = -19 unable to identify coordinate variable rc = -38 error from NF90_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (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

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

    ESMF_CFIOSdfVarRead1D_ – 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_CFIOSdfVarReadT

  • private subroutine ESMF_CFIOSdfVarReadT3D_(cfio, vName, field, timeString, cfio2, rc)

    ESMF_CFIOSdfVarReadT3D_ – 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

    character(len=*), intent(in) :: 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_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (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_CFIOSdfVarReadT2D_(cfio, vName, field, timeString, cfio2, rc)

    ESMF_CFIOSdfVarReadT2D_` – 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

    character(len=*), intent(in) :: 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_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -46 error from NV_GET_VARA rc = -48 error from NF90_INQUIRE rc = -52 error from NF90_INQUIRE_VARIABLE rc = -99 must specify date/curTime of timeString

  • private subroutine ESMF_CFIOSdfVarReadT3D__(cfio, vName, date, curTime, field, rc, cfio2)

    ESMF_CFIOSdfVarReadT3D_ – 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(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_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (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_CFIOSdfVarReadT2D__(cfio, vName, date, curTime, field, rc, cfio2)

    ESMF_CFIOSdfVarReadT2D_ – 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(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_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (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_CFIOSdfVarWrite

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

    ESMF_CFIOSdfVarWrite3D_ – 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

    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_VAR_PUT (dimension variable) rc = -40 error from NF90_INQ_VARID rc = -41 error from NF90_INQ_DIMID (lat or lon) rc = -42 error from NF90_INQ_DIMID (lev) rc = -43 error from NF90_INQ_VARID (time variable) rc = -44 error from NF90_GET_ATT (time attribute) rc = -45 error from NF90_VAR_PUT rc = -46 error from NF90_GET_VAR rc = -52 error from NF90_INQUIRE_VARIABLE rc = -53 error from NF90_GET_ATT

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

    ESMF_CFIOSdfVarWrite2D_ – 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

    integer, intent(out), optional :: rc

    Error return code: 0 all is well

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

    ESMF_CFIOSdfVarWrite1D_ – 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


Subroutines

public subroutine ESMF_CFIOSdfFileClose(cfio, rc)

ESMF_CFIOSdfFileClose – close an open CFIO stream.

Arguments

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

CFIO object

integer, intent(out), optional :: rc

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

public subroutine ESMF_CFIOSdfFileCreate(cfio, rc, expid)

ESMF_CFIOSdfFileCreate – 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_VAR_PUT (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

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

ESMF_CFIOSdfFileOpen – 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 ncopn (file open) -40 error from NF90_INQ_VARID -41 error from NF90_INQ_DIMID (lat or lon) -42 error from NF90_INQ_DIMID (lev) -43 error from NF90_INQ_VARID (time variable) -47 error from NF90_INQ_DIMID (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