ESMF_CFIOFileMod Module

MODULE: ESMF_CFIOFileMod

Author: GMAO SI-Team

ESMF_CFIOFileMod - Source file for CFIO File.

The module ESMF_CFIOFileMod provides ESMF_CFIOFile type definitions and interface specifications.

History

  • Feb2007 Yin Separated from ESMF_CFIOMod

Uses

  • module~~esmf_cfiofilemod~~UsesGraph module~esmf_cfiofilemod ESMF_CFIOFileMod module~esmf_cfiogridmod ESMF_CFIOGridMod module~esmf_cfiofilemod->module~esmf_cfiogridmod module~esmf_cfioutilmod ESMF_CFIOUtilMod module~esmf_cfiofilemod->module~esmf_cfioutilmod module~esmf_cfiovarinfomod ESMF_CFIOVarInfoMod module~esmf_cfiofilemod->module~esmf_cfiovarinfomod module~esmf_cfiogridmod->module~esmf_cfioutilmod iso_fortran_env iso_fortran_env module~esmf_cfiogridmod->iso_fortran_env ESMF_CFIOBaseMod ESMF_CFIOBaseMod module~esmf_cfioutilmod->ESMF_CFIOBaseMod module~esmf_cfioutilmod->iso_fortran_env netcdf netcdf module~esmf_cfioutilmod->netcdf module~esmf_cfiovarinfomod->module~esmf_cfiogridmod module~esmf_cfiovarinfomod->module~esmf_cfioutilmod

Used by

  • module~~esmf_cfiofilemod~~UsedByGraph module~esmf_cfiofilemod ESMF_CFIOFileMod module~esmf_cfiocollectionmod ESMF_CFIOCollectionMod module~esmf_cfiocollectionmod->module~esmf_cfiofilemod module~esmf_cfioeosmod ESMF_CFIOEosMod module~esmf_cfioeosmod->module~esmf_cfiofilemod module~esmf_cfiomod ESMF_CFIOMod module~esmf_cfiomod->module~esmf_cfiofilemod module~esmf_cfiosdfmod ESMF_CFIOSdfMod module~esmf_cfiosdfmod->module~esmf_cfiofilemod module~mapl_cfiomod MAPL_CFIOMod module~mapl_cfiomod->module~esmf_cfiofilemod module~mapl_extdatagridcompmod MAPL_ExtDataGridCompMod module~mapl_extdatagridcompmod->module~esmf_cfiofilemod program~regrid_util Regrid_Util program~regrid_util->module~esmf_cfiofilemod program~test test program~test->module~esmf_cfiofilemod program~test~10 test program~test~10->module~esmf_cfiofilemod program~test~11 test program~test~11->module~esmf_cfiofilemod program~test~12 test program~test~12->module~esmf_cfiofilemod program~test~14 test program~test~14->module~esmf_cfiofilemod program~test~2 test program~test~2->module~esmf_cfiofilemod program~test~3 test program~test~3->module~esmf_cfiofilemod program~test~4 test program~test~4->module~esmf_cfiofilemod program~test~5 test program~test~5->module~esmf_cfiofilemod program~test~7 test program~test~7->module~esmf_cfiofilemod program~test~8 test program~test~8->module~esmf_cfiofilemod program~test~9 test program~test~9->module~esmf_cfiofilemod

Derived Types

type, public ::  ESMF_CFIO

Define a new data type ESMF_CFIO – a CFIO object(file) with file name, CFIO variable objects, time, grid index and global attributes.

Components

Type Visibility Attributes Name Initial
character(len=16), public :: format

output/input format – GrADS or SDF(HDF) default is SDF.

character(len=MLEN), public, pointer :: attCharNames(:) => NULL()

User defined char attribute name

character(len=MLEN), public, pointer :: attChars(:) => NULL()

char attributes

character(len=MLEN), public, pointer :: attIntNames(:) => NULL()

int attribute name

character(len=MLEN), public, pointer :: attRealNames(:) => NULL()

Real attribute name

character(len=MLEN), public :: cfioObjName

name for this CFIO object

character(len=MLEN), public :: comment
character(len=MLEN), public :: contact

Who to contact about the data set

character(len=MLEN), public :: convention

CFIO

character(len=MLEN), public :: expid

Experiment I

character(len=MLEN), public :: fName

file name in this CFIO obj.

character(len=MLEN), public :: fNameTmplt

file name in this CFIO obj.

character(len=MLEN), public :: history
character(len=MLEN), public :: institution
character(len=MLEN), public :: references
character(len=MLEN), public :: source

Source of data, e.g. NASA/GMAO

character(len=MLEN), public :: title

A title for the data set

integer, public, pointer :: attCharCnts(:) => NULL()

length of char attributes

integer, public, pointer :: attIntCnts(:) => NULL()

length of int attributes

integer, public, pointer :: attInts(:,:) => NULL()

global integer attributes

integer, public, pointer :: attRealCnts(:) => NULL()

length of real attributes

integer, public :: begTime

hhmmss

integer, public :: date

yyyymmdd

integer, public :: deflate

gzip compress level

integer, public :: fid

file ID for internal use

integer, public :: mGrids

total number of grids

integer, public :: mVars

total number of variables

integer, public :: nAttChar

Number of char attributes

integer, public :: nAttInt

Number of int attributes

integer, public :: nAttReal

Number of Real attributes

integer, public :: prec

Desired precision of data

integer, public :: sd_id

file ID for EOS

integer, public :: tSteps

total time steps

integer, public :: timeInc

time step increment

integer, public :: vdir

The positive vertical direction

logical, public :: isCyclic

flag for cyclic for input files

logical, public :: isGridSet

True only if grid was passed in

logical, public :: isOpen = .false.

flag to check fName is opened or not

logical, public :: useVertexCoordinates = .false.
real, public :: FormatVersion = 1.0
real, public, pointer :: attReals(:,:) => NULL()

global real attributes

type(ESMF_CFIOGrid), public, pointer :: grids(:) => null()

CFIO variable grid

type(ESMF_CFIOVarInfo), public, pointer :: varObjs(:) => null()

CFIO variable objects

type(cNode), public, pointer :: cList => NULL()
type(iNode), public, pointer :: iList => NULL()
type(rNode), public, pointer :: rList => NULL()

Functions

public function ESMF_CFIOCreate(cfioObjName, rc)

ESMF_CFIOCreate – ESMF_CFIO object constructor

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: cfioObjName
integer, intent(out), optional :: rc

Return Value type(ESMF_CFIO)


Subroutines

public subroutine ESMF_CFIODestroy(cfio, rc)

ESMF_CFIODestroy – destructor for a CFIO object

Arguments

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

public subroutine ESMF_CFIOGet(cfio, cfioObjName, nVars, varObjs, grid, nGrids, grids, fName, title, source, contact, history, convention, institution, references, comment, date, begTime, timeInc, nSteps, prec, attCharNames, nAttChar, attCharCnts, attChars, attRealNames, nAttReal, attRealCnts, attReals, attIntNames, nAttInt, attIntCnts, attInts, attCharName, attCharCnt, attChar, attRealName, attRealCnt, attReal, attIntName, attIntCnt, attInt, isOpen, format, fNameTmplt, rc)

ESMF_CFIOGet – Get meta data from a CFIO object

Read more…

Arguments

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

a CFIO object

character(len=*), intent(out), optional :: cfioObjName

CFIO Obj name

integer, optional :: nVars

number of variable objects

type(ESMF_CFIOVarInfo), optional, pointer :: varObjs(:)

var objects

type(ESMF_CFIOGrid), optional, pointer :: grid
integer, optional :: nGrids

number of grids

type(ESMF_CFIOGrid), optional, pointer :: grids(:)

grid array

character(len=*), intent(out), optional :: fName

File name

character(len=*), intent(out), optional :: title
character(len=*), intent(out), optional :: source

Source of data

character(len=*), intent(out), optional :: contact

Who to contact

character(len=*), intent(out), optional :: history
character(len=*), intent(out), optional :: convention

CFIO or COARDS

character(len=*), intent(out), optional :: institution

File name

character(len=*), intent(out), optional :: references
character(len=*), intent(out), optional :: comment
integer, intent(out), optional :: date

yyyymmdd

integer, intent(out), optional :: begTime

hhmmss

integer, intent(out), optional :: timeInc

time step increment

integer, intent(out), optional :: nSteps

number of time steps

integer, intent(out), optional :: prec

Desired precision of data: 0 = 32 bit; 1 = 64 bit

character(len=*), optional, pointer :: attCharNames(:)

User defined global char attribute names

integer, intent(out), optional :: nAttChar

Number of char attributes

integer, optional, pointer :: attCharCnts(:)

length of attributes

character(len=*), optional, pointer :: attChars(:)

User defined global char attribute

character(len=*), optional, pointer :: attRealNames(:)

User defined global real attribute names

integer, intent(out), optional :: nAttReal

Number of Real attributes

integer, optional, pointer :: attRealCnts(:)

length of attributes

real, optional, pointer :: attReals(:,:)

User defined global real attribute

character(len=*), optional, pointer :: attIntNames(:)

User defined global int attribute names

integer, intent(out), optional :: nAttInt

Number of int attributes

integer, optional, pointer :: attIntCnts(:)

length of attributes

integer, optional, pointer :: attInts(:,:)

User defined global int attribute

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

User defined global char attribute name

integer, intent(out), optional :: attCharCnt
character(len=*), intent(out), optional :: attChar

User defined global char attribute

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

User defined global real attribute name

integer, intent(out), optional :: attRealCnt
real, optional, pointer :: attReal(:)

User defined global real attribute

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

User defined global int attribute name

integer, intent(out), optional :: attIntCnt
integer, optional, pointer :: attInt(:)

User defined global int attribute

logical, intent(out), optional :: isOpen
character(len=*), intent(out), optional :: format
character(len=*), intent(out), optional :: fNameTmplt

File name

integer, intent(out), optional :: rc

Error return code:
0 all is well
-1 can’t allocate memory for grid(s)
-2 can’t allocate memory: varObjs
-3 can’t allocate mem: attCharNames
-4 can’t allocate mem: attRealNames
-5 can’t allocate mem: attIntNames
-6 can’t allocate mem: attCharCnts
-7 can’t allocate mem: attRealCnts
-8 can’t allocate mem: attIntCnts
-9 can’t allocate mem: attChars
-10 can’t allocate mem: attReals
-11 can’t allocate mem: attInts
-12 can’t allocate mem: attInt
rc = -19 unable to identify coordinate 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 = -47 error from NF90_INQ_DIMID or NF90_INQUIRE_DIMENSION (time)
rc = -48 error from NF90_INQUIRE
rc = -53 error from NF90_GET_ATT

public subroutine ESMF_CFIOSet(cfio, cfioObjName, varObjs, grids, grid, fName, title, source, contact, history, convention, institution, references, comment, date, begTime, timeInc, timeString, prec, attCharNames, attCharCnts, attChars, attRealNames, attRealCnts, attReals, attIntNames, attIntCnts, attInts, attCharName, attChar, attRealName, attReal, attIntName, attInt, format, expid, isCyclic, isOpen, nSteps, fNameTmplt, deflate, formatVersion, rc)

ESMF_CFIOSet – Set meta data for a CFIO object

Read more…

Arguments

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

a CFIO object

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

object name

type(ESMF_CFIOVarInfo), optional :: varObjs(:)

variable objects

type(ESMF_CFIOGrid), optional :: grids(:)

grid array

type(ESMF_CFIOGrid), optional :: grid
character(len=*), intent(in), optional :: fName

File name

character(len=*), intent(in), optional :: title
character(len=*), intent(in), optional :: source

Source of data

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

Who to contact

character(len=*), intent(in), optional :: history
character(len=*), intent(in), optional :: convention

CFIO or COARDS

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

File name

character(len=*), intent(in), optional :: references
character(len=*), intent(in), optional :: comment
integer, intent(in), optional :: date

yyyymmdd

integer, intent(in), optional :: begTime

hhmmss

integer, intent(in), optional :: timeInc

time step increment

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

string expression of date and time

integer, intent(in), optional :: prec

Desired precision of data: 0 = 32 bit; 1 = 64 bit

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

User defined global char attribute names

integer, intent(in), optional :: attCharCnts(:)

length of attributes

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

User defined global char attribute

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

User defined global real attribute names

integer, intent(in), optional :: attRealCnts(:)

length of attributes

real, intent(in), optional :: attReals(:,:)

User defined global real attribute

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

User defined global int attribute names

integer, intent(in), optional :: attIntCnts(:)

length of attributes

integer, intent(in), optional :: attInts(:,:)

User defined global int attribute

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

User defined global char attribute name

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

User defined global char attribute

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

User defined global real attribute name

real, intent(in), optional :: attReal(:)

User defined global real attribute

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

User defined global int attribute name

integer, intent(in), optional :: attInt(:)

User defined global int attribute

character(len=*), intent(in), optional :: format
character(len=*), intent(in), optional :: expid
logical, intent(in), optional :: isCyclic
logical, intent(in), optional :: isOpen
integer, intent(in), optional :: nSteps
character(len=*), intent(in), optional :: fNameTmplt

File name

integer, intent(in), optional :: deflate
real, intent(in), optional :: formatVersion
integer, intent(out), optional :: rc

Error return code:
0 all is well
-1 can’t allocate memory for grid(s)
-2 can’t allocate memory: varObjs
-3 can’t allocate mem: attIntCnts
-4 can’t allocate mem: attIntNames
-5 can’t allocate memory: attInts
-6 can’t allocate mem: attRealCnts
-7 can’t allocate mem: attRealNames
-8 can’t allocate memory: attReals
-9 can’t allocate mem: attCharCnts
-10 can’t allocate mem: attCharNames
-11 can’t allocate memory: attChars