Subroutine runmodel
1074 :
1075 : !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1076 : !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1077 : !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1078 :
1079 : subroutine runmodel (invar, objfun)
1080 : use vom_sce_mod
1081 :
1082 : implicit none
1083 :
1084 : ! * Declarations
1085 : REAL*8, DIMENSION(vom_npar), INTENT(in) :: invar
1086 : REAL*8, INTENT(out) :: objfun
1087 :
1088 : ! * Definitions
1089 : CHARACTER(1) :: bestmark
1090 : CHARACTER(300) :: writeformat
1091 : CHARACTER(len=135) :: msg
1092 : REAL*8, ALLOCATABLE :: tmp_8(:)
1093 :
1094 : nrun = nrun + 1
1095 :
1096 : call transpmodel(invar(:), vom_npar, objfun, 1)
1097 :
1098 : bestmark = ' '
1099 : if (objfun .gt. bestobj) then
1100 : bestmark = '+'
1101 : elseif (objfun .gt. bestincomp) then
1102 : bestmark = '.'
1103 : endif
1104 : if (evolution .ne. 'test') then
1105 : writeformat = '("Run",i6," (",a,"):",t28,"OF =",e12.6,1x,a)'
1106 : write(msg,writeformat) nrun, TRIM(evolution), objfun, bestmark
1107 : write(kfile_progress,*) TRIM(msg)
1108 :
1109 : ! * use temporary variable to prevent warning in ifort
1110 : allocate(tmp_8(nopt))
1111 : tmp_8(:) = invar(optid(:))
1112 : write(kfile_sceout,outformat) tmp_8(:), objfun
1113 : flush(kfile_progress)
1114 : deallocate(tmp_8)
1115 : endif
1116 :
1117 : return
1118 : end subroutine runmodel