string_to_esmf_time Function

public function string_to_esmf_time(input_string, unusable, rc) result(time)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: input_string
class(KeywordEnforcer), intent(in), optional :: unusable
integer, intent(out), optional :: rc

Return Value type(ESMF_Time)


Calls

proc~~string_to_esmf_time~~CallsGraph proc~string_to_esmf_time string_to_esmf_time ESMF_TimeSet ESMF_TimeSet proc~string_to_esmf_time->ESMF_TimeSet proc~mapl_return MAPL_Return proc~string_to_esmf_time->proc~mapl_return proc~mapl_verify MAPL_Verify proc~string_to_esmf_time->proc~mapl_verify proc~string_to_integer_date string_to_integer_date proc~string_to_esmf_time->proc~string_to_integer_date proc~string_to_integer_time string_to_integer_time proc~string_to_esmf_time->proc~string_to_integer_time 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 proc~string_to_integer_date->proc~mapl_return proc~string_to_integer_time->proc~mapl_return

Called by

proc~~string_to_esmf_time~~CalledByGraph proc~string_to_esmf_time string_to_esmf_time none~new_extdataconfig_from_yaml ExtDataConfig%new_ExtDataConfig_from_yaml none~new_extdataconfig_from_yaml->proc~string_to_esmf_time proc~new_extdataoldtypescreator new_ExtDataOldTypesCreator proc~new_extdataoldtypescreator->none~new_extdataconfig_from_yaml

Source Code

   function string_to_esmf_time(input_string,unusable,rc) result(time)
      character(len=*), intent(in) :: input_string
      class(KeywordEnforcer), optional, intent(in) :: unusable
      integer, optional, intent(out) :: rc

      type(ESMF_Time) :: time
      integer :: status
      integer :: tpos
      integer year,month,day,hour,min,sec
      integer :: int_time, int_date
      character(len=:), allocatable :: date_string,time_string
      logical :: have_time

      _UNUSED_DUMMY(unusable)

      tpos = index(input_string,'T')
      if (tpos<=0) then
         have_time = .false.
      else
         have_time = .true.
      end if
    
      if (have_time) then
         time_string = input_string(tpos+1:)
         date_string = input_string(:tpos-1)
         int_time = string_to_integer_time(time_string,_RC)
      else
         date_string = trim(input_string) 
         int_time = 0
      end if
      int_date = string_to_integer_date(date_string,_RC)

      year=int_date/10000
      month=mod(int_date/100,100)
      day=mod(int_date,100)
      hour=int_time/10000
      min=mod(int_time/100,100)
      sec=mod(int_time,100)
      call ESMF_TimeSet(time,yy=year,mm=month,dd=day,h=hour,m=min,s=sec,_RC)
      _RETURN(_SUCCESS)

   end function string_to_esmf_time