c kspectrum (http://www.meso-star.com/en_Products.html) - This file is part of kspectrum c Copyright (C) 2008-2015 - Méso-Star - Vincent Eymet c c This file must be used under the terms of the CeCILL license. c This source file is licensed as described in the file COPYING, which c you should have received as part of this distribution. The terms c are also available at c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt c subroutine print_status(i,i_min,i_max,m,band,band_min,band_max, & Nb,ik,nk,pass,Npass,nl_lp,Nk_total,Nk_remain,mtpk) implicit none include 'max.inc' include 'formats.inc' integer strlen,nl,l,Nk_total,Nk_remain integer pass,Npass,nl_lp integer i,i_min,i_max,m,band,band_min,band_max,Nb,ik,nk integer*8 date1,date2 double precision mtpk,time_remain,mtpk_lp character*(Nchar_mx) file_in,line,nlines_file character*(Nchar_mx) command integer*8 day,month,year integer*8 hour,min,sec character*(Nchar_mx) datep_file file_in='./status.txt' command='date > date.txt' call exec(command) open(12,file='./date.txt') read(12,10) line close(12) c time_remain is the remaining computation time to finish current level i if (pass.lt.Npass) then mtpk_lp=mtpk*dble(nl_lp)/dble(Nline_mx) time_remain=mtpk*(Nk_remain-Nk_total)+mtpk_lp*Nk_total else time_remain=mtpk*Nk_remain endif datep_file='./date' call get_date(datep_file,date1) date2=date1+int(time_remain) call convert_date(date2,0,day,month,year,hour,min,sec) nl=0 open(13,file=file_in(1:strlen(file_in)) & ,access='append') write(13,*) line(1:strlen(line)) write(13,*) 'Atmospheric level:',i, & ' [',i_min,' -',i_max,' ]' write(13,*) 'Narrowband :',band, & ' [',band_min,' -',band_max,' ]' write(13,*) 'k :',ik,' /',nk if (pass.gt.1) then write(13,*) 'ETA to next level:', & day,'/',month,' /',year, & ' @ ',hour,':',min,':',sec endif write(13,*) close(13) return end subroutine convert_date(date_epoch,pindex, & day,month,year,hour,min,sec) implicit none include 'max.inc' integer pindex,strlen integer*8 date,date_epoch integer*8 day,month,year integer*8 hour,min,sec character*(Nchar_mx) dfile,string character*(Nchar_mx) command character*3 str3 character*10 str10 c convert epoch date using "epochToDate" script open(40,file='./bash/epoch') write(40,*) date_epoch close(40) open(40,file='./bash/pindex') write(40,*) pindex close(40) call num2str10(date_epoch,str10) call num2str3(pindex,str3) command='./bash/epoch2date.bash '//str10(1:strlen(str10)) & //' '//str3(1:strlen(str3)) c Debug c write(*,*) 'command=',command(1:strlen(command)) c Debug call exec(command) string='./bash/date' call stringp_file_name(pindex,string,dfile) open(41,file=dfile(1:strlen(dfile))) read(41,*) date close(41) year=date/100000/100000 date=date-year*100000*100000 month=date/100000000 date=date-month*100000000 day=date/1000000 date=date-day*1000000 hour=date/10000 date=date-hour*10000 min=date/100 date=date-min*100 sec=date return end