MAPL_IOGetTime Subroutine

public subroutine MAPL_IOGetTime(cf, nymd, nhms, rc)

Arguments

Type IntentOptional Attributes Name
type(FileMetadata), intent(inout) :: cf
integer, intent(out) :: nymd
integer, intent(out) :: nhms
integer, intent(out), optional :: rc

Calls

proc~~mapl_iogettime~~CallsGraph proc~mapl_iogettime MAPL_IOGetTime interface~mapl_assert MAPL_Assert proc~mapl_iogettime->interface~mapl_assert none~get_attribute Variable%get_attribute proc~mapl_iogettime->none~get_attribute none~get_value UnlimitedEntity%get_value proc~mapl_iogettime->none~get_value none~get_variable FileMetadata%get_variable proc~mapl_iogettime->none~get_variable proc~mapl_ncioparsetimeunits MAPL_NCIOParseTimeUnits proc~mapl_iogettime->proc~mapl_ncioparsetimeunits proc~mapl_return MAPL_Return proc~mapl_iogettime->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_iogettime->proc~mapl_verify none~get_attribute->interface~mapl_assert none~get_attribute->proc~mapl_return none~at~85 StringAttributeMap%at none~get_attribute->none~at~85 none~get_value->proc~mapl_return none~get_variable->proc~mapl_return none~get_variable->proc~mapl_verify none~at~189 StringVariableMap%at none~get_variable->none~at~189 at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception none~at_rc~6 StringVariableMap%at_rc none~at~189->none~at_rc~6 none~find~17 StringAttributeMap%find none~at~85->none~find~17 none~find~43 StringVariableMap%find none~at_rc~6->none~find~43

Source Code

  subroutine MAPL_IOGetTime(cf,nymd,nhms,rc)
  type(FileMetadata), intent(inout) :: cf
  integer, intent(out) :: nymd,nhms
  integer, intent(out), optional :: rc

  integer :: status

  class(Variable), pointer :: var
  type(Attribute), pointer :: attr
  class(*), pointer :: units
  integer :: year,month,day,hour,min,sec

  var => cf%get_variable('time',rc=status)
  _VERIFY(status)
  attr => var%get_attribute('units')
  units => attr%get_value()
  select type(units)
  type is (character(*))
     call MAPL_NCIOParseTimeUnits(units,year,month,day,hour,min,sec,status)
  class default
     _FAIL( 'unsupported subclass for units')
  end select
  nymd = year*10000 + month*100 + day
  nhms = hour*10000 + min*100   + sec

  _RETURN(ESMF_SUCCESS)

  end subroutine MAPL_IOGetTime