!*************************************************************************************************** !* ut_get_rundt * !* * !* This routine gets the run date-time in UTC. This can be a date-time that was entered on the * !* command line via the -c option, or it can be the system clock time. * !* * !* ut_get_rundt( cldt, irundt, iret ) * !* * !* Input parameters: * !* cldt character*(*) Date-time in UTC from command line: * !* 'SYSTEM' = use the system clock time * !* * !* Output parameters: * !* irundt integer(5) Run date-time in UTC: * !* Index 1 = 4-digit year * !* Index 2 = month * !* Index 3 = day of month * !* Index 4 = hour * !* Index 5 = minute * !* iret integer Return code: * !* 0 = normal return * !* -1 = irundt could not be determined * !** * !* Log: * !* J. Ator/NCEP 06/23 * !*************************************************************************************************** subroutine ut_get_rundt( cldt, irundt, iret ) implicit none character*(*), intent(in) :: cldt integer, intent(out) :: irundt(5), iret integer :: itype, iergtm, ierstn, iercto, ierwlg character :: rundt*12, sysdt*12 iret = -1 ! Get the system time. itype = 1 call css_gtim( itype, sysdt, iergtm ) if ( iergtm /= 0 ) then call dc_wlog( 2, 'SS', iergtm, ' ', ierwlg ) return endif ! If a date-time was entered on the command line, then use it as the run date-time. Otherwise, ! use the system time as the run date-time. if ( cldt == 'SYSTEM' ) then rundt = sysdt else call ti_stan( cldt, sysdt, rundt, ierstn ) if ( ierstn /= 0 ) then call dc_wlog( 2, 'TI', ierstn, ' ', ierwlg ) return endif endif ! Convert the run date-time to integer. call ti_ctoi( rundt, irundt, iercto ) if ( iercto /= 0 ) then call dc_wlog( 2, 'TI', iercto, ' ', ierwlg ) return endif iret = 0 end subroutine ut_get_rundt