ESMF_CFIOVarInfoGet
– get information from a CFIO variable object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_CFIOVarInfo), | intent(in) | :: | varObj |
variable obj |
||
character(len=*), | intent(out), | optional | :: | vName |
variable short name |
|
type(ESMF_CFIOGrid), | intent(out), | optional | :: | grid |
grid |
|
character(len=*), | intent(out), | optional | :: | vTitle |
variable long name |
|
character(len=*), | intent(out), | optional | :: | vUnits |
variable units |
|
logical, | optional | :: | twoDimVar |
True for 2D |
||
real, | intent(out), | optional | :: | validRange(2) |
Variable valid range |
|
real, | intent(out), | optional | :: | amiss |
FILL value |
|
real, | intent(out), | optional | :: | addOffSet | ||
real, | intent(out), | optional | :: | scaleFactor | ||
character(len=*), | intent(out), | optional | :: | standardName | ||
integer, | intent(out), | optional | :: | nVarAttChar | ||
character(len=*), | optional, | pointer | :: | attCharNames(:) | ||
integer, | optional, | pointer | :: | vAttCharCnts(:) |
length of attributes |
|
character(len=*), | optional, | pointer | :: | varAttChars(:) | ||
integer, | intent(out), | optional | :: | nVarAttReal | ||
character(len=*), | optional, | pointer | :: | attRealNames(:) | ||
integer, | optional, | pointer | :: | vAttRealCnts(:) |
length of attributes |
|
real, | optional, | pointer | :: | varAttReals(:,:) | ||
integer, | intent(out), | optional | :: | nVarAttInt | ||
character(len=*), | optional, | pointer | :: | attIntNames(:) | ||
integer, | optional, | pointer | :: | vAttIntCnts(:) |
length of attributes |
|
integer, | optional, | pointer | :: | varAttInts(:,:) | ||
character(len=*), | optional | :: | ordering |
(time, lev, lat, lon) (default) can be any combination of xyzt |
||
character(len=*), | intent(in), | optional | :: | attCharName |
User defined char attribute name |
|
integer, | intent(out), | optional | :: | attCharCnt | ||
character(len=*), | intent(out), | optional | :: | attChar |
User defined char attribute |
|
character(len=*), | intent(in), | optional | :: | attRealName |
User defined real attribute name |
|
integer, | intent(out), | optional | :: | attRealCnt | ||
real, | optional, | pointer | :: | attReal(:) |
User defined real attribute |
|
character(len=*), | intent(in), | optional | :: | attIntName |
User defined int attribute name |
|
integer, | intent(out), | optional | :: | attIntCnt | ||
integer, | optional, | pointer | :: | attInt(:) |
User defined int attribute |
|
real, | intent(out), | optional | :: | packingRange(2) | ||
logical, | optional | :: | timAve |
True for time average |
||
character(len=1), | optional | :: | aveMethod |
‘c’: center, ‘d’: downstream ‘u’: upstream |
||
character(len=MVARLEN), | optional | :: | cellMthd |
Cell methmod units |
||
integer, | optional, | pointer | :: | ChunkSize(:) |
User defined Chunksize int |
|
integer, | intent(out), | optional | :: | rc |
Error return code: |
subroutine ESMF_CFIOVarInfoGet (varObj, vName, grid, vTitle, vUnits, & twoDimVar, validRange, amiss, addOffSet, & scaleFactor, standardName, nVarAttChar, & attCharNames, vAttCharCnts, varAttChars, & nVarAttReal, attRealNames, vAttRealCnts, & varAttReals, nVarAttInt, attIntNames, & vAttIntCnts, varAttInts, ordering, & attCharName, attCharCnt, attChar, attRealName,& attRealCnt, attReal, attIntName, attIntCnt, & attInt, packingRange, timAve, aveMethod, & cellMthd, ChunkSize, rc ) implicit NONE ! ! !INPUT PARAMETERS: ! type(ESMF_CFIOVarInfo), intent(in) :: varObj !! variable obj character(len=*), intent(in), OPTIONAL :: attCharName !! User defined char attribute name character(len=*), intent(in), OPTIONAL :: attRealName !! User defined real attribute name character(len=*), intent(in), OPTIONAL :: attIntName !! User defined int attribute name ! !OUTPUT PARAMETERS: ! character(len=*), intent(out), OPTIONAL :: vName !! variable short name type(ESMF_CFIOGrid), intent(out), OPTIONAL :: grid !! grid character(len=*), intent(out), OPTIONAL :: vTitle !! variable long name character(len=*), intent(out), OPTIONAL :: vUnits !! variable units logical, OPTIONAL :: twoDimVar !! True for 2D logical, OPTIONAL :: timAve !! True for time average character, OPTIONAL :: aveMethod !! 'c': center, 'd': downstream !! 'u': upstream character(len=MVARLEN), OPTIONAL :: cellMthd !! Cell methmod units real, intent(out), OPTIONAL :: validRange(2) !! Variable valid range real, intent(out), OPTIONAL :: packingRange(2) real, intent(out), OPTIONAL :: amiss !! FILL value real, intent(out), OPTIONAL :: addOffSet real, intent(out), OPTIONAL :: scaleFactor character(len=*), intent(out), OPTIONAL :: standardName character(len=*), OPTIONAL :: ordering !! (time, lev, lat, lon) (default) !! can be any combination of xyzt integer, intent(out), OPTIONAL :: nVarAttInt integer, intent(out), OPTIONAL :: nVarAttReal integer, intent(out), OPTIONAL :: nVarAttChar character(len=*), pointer, OPTIONAL :: attCharNames(:) character(len=*), pointer, OPTIONAL :: attRealNames(:) character(len=*), pointer, OPTIONAL :: attIntNames(:) integer, pointer,OPTIONAL::vAttCharCnts(:) !! length of attributes integer, pointer,OPTIONAL::vAttRealCnts(:) !! length of attributes integer, pointer,OPTIONAL::vAttIntCnts(:) !! length of attributes character(len=*), pointer, OPTIONAL :: varAttChars(:) real, pointer, OPTIONAL :: varAttReals(:,:) integer, pointer, OPTIONAL :: varAttInts(:,:) integer, intent(out), OPTIONAL :: attIntCnt integer, intent(out), OPTIONAL :: attRealCnt integer, intent(out), OPTIONAL :: attCharCnt character(len=*), intent(out), OPTIONAL :: attChar !! User defined char attribute real, pointer, OPTIONAL :: attReal(:) !! User defined real attribute integer, pointer, OPTIONAL :: attInt(:) !! User defined int attribute integer, pointer, OPTIONAL :: ChunkSize(:) !! User defined Chunksize int integer, intent(out), OPTIONAL :: rc !! Error return code: !! 0 all is well !! -1 Allocation for attCharNames failed !! -2 Allocation for attRealNames failed !! -3 Allocation for attIntNames failed !! -4 Allocation for vAttCharCnts failed !! -5 Allocation for vAttRealCnts failed !! -6 Allocation for vAttIntCnts failed !! -7 Allocation for varAttChars failed !! -8 Allocation for varAttReals failed !! -9 Allocation for varAttInts failed ! !------------------------------------------------------------------------------ integer :: rtcode = 0 integer :: i if ( present(vName) ) vName = varObj%vName if ( present(grid) ) grid = varObj%grid if ( present(vTitle) ) vTitle = varObj%vTitle if ( present(vUnits) ) vUnits = varObj%vUnits if ( present(twoDimVar) ) twoDimVar = varObj%twoDimVar if ( present(timAve) ) timAve = varObj%timAve if ( present(aveMethod) ) aveMethod = varObj%aveMethod if ( present(cellMthd) ) cellMthd = varObj%cellMthd if ( present(validRange) ) validRange = varObj%validRange if ( present(packingRange) ) packingRange = varObj%packingRange if ( present(amiss) ) amiss = varObj%amiss if ( present(addOffSet) ) addOffSet = varObj%addOffSet if ( present(scaleFactor) ) scaleFactor = varObj%scaleFactor if ( present(standardName) ) standardName = varObj%standardName if ( present(ordering) ) ordering = varObj%ordering if ( present(nVarAttInt) ) nVarAttInt = varObj%nVarAttInt if ( present(nVarAttReal) ) nVarAttReal = varObj%nVarAttReal if ( present(nVarAttChar) ) nVarAttChar = varObj%nVarAttChar ! get all attribute names if ( present(attCharNames) ) then allocate(attCharNames(varObj%nVarAttChar), stat=rtcode) if (err("Allocation for attCharNames failed",rtcode,-1) .lt. 0) then if ( present(rc) ) rc = rtcode return end if attCharNames = varObj%attCharNames end if if ( present(attRealNames) ) then allocate(attRealNames(varObj%nVarAttReal), stat=rtcode) if (err("Allocation for attRealNames failed",rtcode,-2) .lt. 0) then if ( present(rc) ) rc = rtcode return end if attRealNames = varObj%attRealNames end if if ( present(attIntNames) ) then allocate(attIntNames(varObj%nVarAttInt), stat=rtcode) if (err("Allocation for attIntNames failed",rtcode,-3) .lt. 0) then if ( present(rc) ) rc = rtcode return end if attIntNames = varObj%attIntNames end if ! get all attribute counts if ( present(vAttCharCnts) ) then allocate(vAttCharCnts(varObj%nVarAttChar), stat=rtcode) if (err("Allocation for vAttCharCnts failed",rtcode,-4) .lt. 0) then if ( present(rc) ) rc = rtcode return end if vAttCharCnts = varObj%attCharCnts end if if ( present(vAttRealCnts) ) then allocate(vAttRealCnts(varObj%nVarAttReal), stat=rtcode) if (err("Allocation for vAttRealCnts failed",rtcode,-5) .lt. 0) then if ( present(rc) ) rc = rtcode return end if vAttRealCnts = varObj%attRealCnts end if if ( present(vAttIntCnts) ) then allocate(vAttIntCnts(varObj%nVarAttInt), stat=rtcode) if (err("Allocation for vAttIntCnts failed",rtcode,-6) .lt. 0) then if ( present(rc) ) rc = rtcode return end if vAttIntCnts = varObj%attIntCnts end if ! get all attribute data if ( present(varAttChars) ) then allocate(varAttChars(varObj%nVarAttChar), stat=rtcode) if (err("Allocation for varAttChars failed",rtcode,-7) .lt. 0) then if ( present(rc) ) rc = rtcode return end if varAttChars = varObj%varAttChars end if if ( present(varAttReals) ) then allocate(varAttReals(varObj%nVarAttReal,size(varObj%varAttReals) & / varObj%nVarAttReal), stat=rtcode) if (err("Allocation for varAttReals failed",rtcode,-8) .lt. 0) then if ( present(rc) ) rc = rtcode return end if varAttReals = varObj%varAttReals end if if ( present(varAttInts) ) then allocate(varAttInts(varObj%nVarAttInt,size(varObj%varAttInts) & / varObj%nVarAttInt), stat=rtcode) if (err("Allocation for varAttInts failed",rtcode,-9) .lt. 0) then if ( present(rc) ) rc = rtcode return end if varAttInts = varObj%varAttInts end if ! Get Chunk Size if ( present(ChunkSize) ) then if(associated(varObj%ChunkSize)) then allocate( ChunkSize(size(varObj%ChunkSize)), stat = rtcode ) if (err("Allocation for ChunkSize fialed", rtcode, -10) .lt. 0) then if ( present(rc) ) rc = rtcode return end if ChunkSize = varObj%ChunkSize end if end if ! user provides integer attribute name to get its count and data if ( present(attIntName) ) then if ( present(attIntCnt) ) then do i = 1, varObj%nVarAttInt if (trim(attIntName) .eq. trim(varObj%attIntNames(i))) & then attIntCnt = varObj%attIntCnts(i) end if end do end if if ( present(attInt) ) then do i = 1, varObj%nVarAttInt if (trim(attIntName) .eq. trim(varObj%attIntNames(i)))& then allocate(attInt(varObj%attIntCnts(i))) attInt = varObj%varAttInts(i,1:varObj%attIntCnts(i)) end if end do end if end if ! user provides real attribute name to get its count and data if ( present(attRealName) ) then if ( present(attRealCnt) ) then do i = 1, varObj%nVarAttReal if (trim(attRealName) .eq. trim(varObj%attRealNames(i))) & then attRealCnt = varObj%attRealCnts(i) end if end do end if if ( present(attReal) ) then do i = 1, varObj%nVarAttReal if (trim(attRealName) .eq. trim(varObj%attRealNames(i)))& then allocate(attReal(varObj%attRealCnts(i))) attReal = varObj%varAttReals(i,1:varObj%attRealCnts(i)) end if end do end if end if ! user provides char attribute name to get its count and data if ( present(attCharName) ) then if ( present(attCharCnt) ) then do i = 1, varObj%nVarAttChar if (trim(attCharName) .eq. trim(varObj%attCharNames(i))) & then attCharCnt = varObj%attCharCnts(i) end if end do end if if ( present(attChar) ) then do i = 1, varObj%nVarAttChar if (trim(attCharName) .eq. trim(varObj%attCharNames(i)))& then attChar = trim(varObj%varAttChars(i)) end if end do end if end if if ( present(rc) ) rc = rtcode end subroutine ESMF_CFIOVarInfoGet