create_time_variable Function

public function create_time_variable(current_time, rc) result(time_var)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Time), intent(in) :: current_time
integer, intent(out), optional :: rc

Return Value type(Variable)


Calls

proc~~create_time_variable~~CallsGraph proc~create_time_variable create_time_variable ESMF_TimeGet ESMF_TimeGet proc~create_time_variable->ESMF_TimeGet none~add_attribute~3 Variable%add_attribute proc~create_time_variable->none~add_attribute~3 proc~mapl_return MAPL_Return proc~create_time_variable->proc~mapl_return proc~mapl_verify MAPL_Verify proc~create_time_variable->proc~mapl_verify none~add_attribute_1d~2 Variable%add_attribute_1d none~add_attribute~3->none~add_attribute_1d~2 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~add_attribute_1d~2->proc~mapl_return none~insert~179 StringAttributeMap%insert none~add_attribute_1d~2->none~insert~179 none~insert_pair~15 StringAttributeMap%insert_pair none~insert~179->none~insert_pair~15

Called by

proc~~create_time_variable~~CalledByGraph proc~create_time_variable create_time_variable proc~bundle_to_metadata bundle_to_metadata proc~bundle_to_metadata->proc~create_time_variable

Source Code

   function create_time_variable(current_time, rc) result(time_var)
      type(Variable) :: time_var
      type(ESMF_Time), intent(in) :: current_time
      integer, optional, intent(out) :: rc

      integer :: status
      character(len=ESMF_MAXSTR) :: iso_time_string

      call ESMF_TimeGet(current_time, timeString=iso_time_string, _RC)
      iso_time_string = "minutes since "//trim(iso_time_string)
      time_var = Variable(type=PFIO_REAL32, dimensions='time')
      call time_var%add_attribute('long_name', 'time')
      call time_var%add_attribute('units', iso_time_string, _RC)

      _RETURN(_SUCCESS)
   end function create_time_variable