ogpwri Subroutine

private subroutine ogpwri(me, Objval, Numvio, Convio)

WRITE OPTIMIZATION LOG IN PYGMO FORMAT

2023/01/25 | W. MARTENS | NEW

Type Bound

optgra

Arguments

Type IntentOptional Attributes Name
class(optgra), intent(inout) :: me
real(kind=wp), intent(in) :: Objval

OBJECTIVE VALUE

integer(kind=ip), intent(in) :: Numvio

NUMBER OF VIOLATED CONSTRAINTS

real(kind=wp), intent(in) :: Convio

TOTAL CONSTRAINT VIOLATION


Calls

proc~~ogpwri~~CallsGraph proc~ogpwri optgra%ogpwri proc~ogpwri_end optgra%ogpwri_end proc~ogpwri->proc~ogpwri_end proc~ogpwri_start optgra%ogpwri_start proc~ogpwri->proc~ogpwri_start

Called by

proc~~ogpwri~~CalledByGraph proc~ogpwri optgra%ogpwri proc~ogeval optgra%ogeval proc~ogeval->proc~ogpwri proc~ogcorr optgra%ogcorr proc~ogcorr->proc~ogeval proc~ogexec optgra%ogexec proc~ogexec->proc~ogeval proc~ogexec->proc~ogcorr proc~ogopti optgra%ogopti proc~ogexec->proc~ogopti proc~ogopti->proc~ogeval

Source Code

   subroutine ogpwri(me,Objval,Numvio,Convio)

      !! WRITE OPTIMIZATION LOG IN PYGMO FORMAT
      !!
      !! 2023/01/25 | W. MARTENS | NEW

      class(optgra),intent(inout) :: me
      real(wp),intent(in) :: Objval !! OBJECTIVE VALUE
      integer(ip),intent(in) :: Numvio !! NUMBER OF VIOLATED CONSTRAINTS
      real(wp),intent(in) :: Convio !! TOTAL CONSTRAINT VIOLATION

      character(len=2) :: feas

      if ( me%Verbos==0 ) return
      ! Print header
      if ( me%Fevals==0 ) call me%ogpwri_start()
      ! Increase counter for cost function evaluations
      me%Fevals = me%Fevals + 1
      ! Every 50 lines print the column names.
      if ( mod(real(me%Fevals-1.0_wp)/real(me%Verbos),50.0_wp)==0.0_wp ) &
         write (me%Loglup,'(A10,A15,A15,A15,A2)') "objevals:" , "objval:" , "violated:" , "viol. norm:"
      if ( me%Verbos/=0 .and. mod(me%Fevals,me%Verbos)==0.0_wp ) then
         if ( Convio>0.0_wp ) then
            feas = " i"
         else
            feas = "  "
         end if

         ! Write the log line (different format depending on violation size)
         if ( Convio==0.0_wp ) then
            write (me%Loglup,'(I10,F15.4,I15,I15,A2)') me%Fevals , Objval , Numvio , int(Convio) , feas
         elseif ( Convio>1.0e-3_wp ) then
            write (me%Loglup,'(I10,F15.4,I15,F15.6,A2)') me%Fevals , Objval , Numvio , Convio , feas
         else
            write (me%Loglup,'(I10,F15.4,I15,E15.6,A2)') me%Fevals , Objval , Numvio , Convio , feas
         end if
      end if

      ! Write final summary
      if ( me%Pygfla/=0 ) call me%ogpwri_end(Objval,Numvio,Convio)

   end subroutine ogpwri