Skip to content

Commit

Permalink
modifications to enforce the 80 character "rule"
Browse files Browse the repository at this point in the history
  • Loading branch information
dalekopera committed Jan 28, 2024
1 parent 586e807 commit 8641b77
Show file tree
Hide file tree
Showing 99 changed files with 4,591 additions and 12,923 deletions.
24 changes: 16 additions & 8 deletions include/galahad_blas.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#ifdef GALAHAD_64BIT_INTEGER
#define GALAHAD_BLAS_interface GALAHAD_BLAS_interface_64
#ifdef GALAHAD_NO_UNDERSCORE_64BIT_INTEGER
#define LSAME LSAME64
#define XERBLA XERBLA64
#define DASUM DASUM64
#define DCABS1 DCABS164
#define DDOT DDOT64
#define DNRM2 DNRM264
#define DZNRM2 DZNRM264
#define IDAMAX IDAMAX64
#define ISAMAX ISAMAX64
#define LSAME LSAME64
#define SASUM SASUM64
#define SDOT SDOT64
#define SNRM2 SNRM264
Expand Down Expand Up @@ -55,6 +56,7 @@
#define STRMV STRMV64
#define STRSM STRSM64
#define STRSV STRSV64
#define XERBLA XERBLA64
#define ZCOPY ZCOPY64
#define ZDSCAL ZDSCAL64
#define ZGEMM ZGEMM64
Expand All @@ -68,13 +70,14 @@
#define ZTRMV ZTRMV64
#define ZTRSM ZTRSM64
#elif GALAHAD_DOUBLE_UNDERSCORE_64BIT_INTEGER
#define LSAME LSAME__64
#define XERBLA XERBLA__64
#define DASUM DASUM__64
#define DCABS1 DCABS1__64
#define DDOT DDOT__64
#define DNRM2 DNRM2__64
#define DZNRM2 DZNRM2__64
#define IDAMAX IDAMAX__64
#define ISAMAX ISAMAX__64
#define LSAME LSAME__64
#define SASUM SASUM__64
#define SDOT SDOT__64
#define SNRM2 SNRM2__64
Expand Down Expand Up @@ -122,6 +125,7 @@
#define STRMV STRMV__64
#define STRSM STRSM__64
#define STRSV STRSV__64
#define XERBLA XERBLA__64
#define ZCOPY ZCOPY__64
#define ZDSCAL ZDSCAL__64
#define ZGEMM ZGEMM__64
Expand All @@ -135,13 +139,14 @@
#define ZTRMV ZTRMV__64
#define ZTRSM ZTRSM__64
#elif GALAHAD_NO_SYMBOL_64BIT_INTEGER
#define LSAME LSAME
#define XERBLA XERBLA
#define DASUM DASUM
#define DCABS1 DCABS1
#define DDOT DDOT
#define DNRM2 DNRM2
#define DZNRM2 DZNRM2
#define IDAMAX IDAMAX
#define ISAMAX ISAMAX
#define LSAME LSAME
#define SASUM SASUM
#define SDOT SDOT
#define SNRM2 SNRM2
Expand Down Expand Up @@ -189,6 +194,7 @@
#define STRMV STRMV
#define STRSM STRSM
#define STRSV STRSV
#define XERBLA XERBLA
#define ZCOPY ZCOPY
#define ZDSCAL ZDSCAL
#define ZGEMM ZGEMM
Expand All @@ -202,13 +208,14 @@
#define ZTRMV ZTRMV
#define ZTRSM ZTRSM
#else
#define LSAME LSAME_64
#define XERBLA XERBLA_64
#define DASUM DASUM_64
#define DCABS1 DCABS1_64
#define DDOT DDOT_64
#define DNRM2 DNRM2_64
#define DZNRM2 DZNRM2_64
#define IDAMAX IDAMAX_64
#define ISAMAX ISAMAX_64
#define LSAME LSAME_64
#define SASUM SASUM_64
#define SDOT SDOT_64
#define SNRM2 SNRM2_64
Expand Down Expand Up @@ -256,6 +263,7 @@
#define STRMV STRMV_64
#define STRSM STRSM_64
#define STRSV STRSV_64
#define XERBLA XERBLA_64
#define ZCOPY ZCOPY_64
#define ZDSCAL ZDSCAL_64
#define ZGEMM ZGEMM_64
Expand Down
36 changes: 32 additions & 4 deletions include/galahad_lapack.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifdef GALAHAD_64BIT_INTEGER
#define GALAHAD_LAPACK_interface GALAHAD_LAPACK_interface_64
#ifdef GALAHAD_NO_UNDERSCORE_64BIT_INTEGER
#define ILAENV ILAENV64
#define DISNAN DISNAN64
#define DLADIV DLADIV64
#define DLAISN DLAISN64
Expand All @@ -12,6 +11,14 @@
#define DLANSY DLANSY64
#define DLAPY2 DLAPY264
#define DLAPY3 DLAPY364
#define ILADLC ILADLC64
#define ILADLR ILADLR64
#define ILAENV ILAENV64
#define ILASLC ILASLC64
#define ILASLR ILASLR64
#define ILAZLC ILAZLC64
#define ILAZLR ILAZLR64
#define IPARMQ IPARMQ64
#define SISNAN SISNAN64
#define SLAISN SLAISN64
#define SLAMCH SLAMCH64
Expand Down Expand Up @@ -268,7 +275,6 @@
#define ZLARFG ZLARFG64
#define ZLARFT ZLARFT64
#elif GALAHAD_DOUBLE_UNDERSCORE_64BIT_INTEGER
#define ILAENV ILAENV__64
#define DISNAN DISNAN__64
#define DLADIV DLADIV__64
#define DLAISN DLAISN__64
Expand All @@ -279,6 +285,14 @@
#define DLANSY DLANSY__64
#define DLAPY2 DLAPY2__64
#define DLAPY3 DLAPY3__64
#define ILADLC ILADLC__64
#define ILADLR ILADLR__64
#define ILAENV ILAENV__64
#define ILASLC ILASLC__64
#define ILASLR ILASLR__64
#define ILAZLC ILAZLC__64
#define ILAZLR ILAZLR__64
#define IPARMQ IPARMQ__64
#define SISNAN SISNAN__64
#define SLAISN SLAISN__64
#define SLAMCH SLAMCH__64
Expand Down Expand Up @@ -535,7 +549,6 @@
#define ZLARFG ZLARFG__64
#define ZLARFT ZLARFT__64
#elif GALAHAD_NO_SYMBOL_64BIT_INTEGER
#define ILAENV ILAENV
#define DISNAN DISNAN
#define DLADIV DLADIV
#define DLAISN DLAISN
Expand All @@ -546,6 +559,14 @@
#define DLANSY DLANSY
#define DLAPY2 DLAPY2
#define DLAPY3 DLAPY3
#define ILADLC ILADLC
#define ILADLR ILADLR
#define ILAENV ILAENV
#define ILASLC ILASLC
#define ILASLR ILASLR
#define ILAZLC ILAZLC
#define ILAZLR ILAZLR
#define IPARMQ IPARMQ
#define SISNAN SISNAN
#define SLAISN SLAISN
#define SLAMCH SLAMCH
Expand Down Expand Up @@ -802,7 +823,6 @@
#define ZLARFG ZLARFG
#define ZLARFT ZLARFT
#else
#define ILAENV ILAENV_64
#define DISNAN DISNAN_64
#define DLADIV DLADIV_64
#define DLAISN DLAISN_64
Expand All @@ -813,6 +833,14 @@
#define DLANSY DLANSY_64
#define DLAPY2 DLAPY2_64
#define DLAPY3 DLAPY3_64
#define ILADLC ILADLC_64
#define ILADLR ILADLR_64
#define ILAENV ILAENV_64
#define ILASLC ILASLC_64
#define ILASLR ILASLR_64
#define ILAZLC ILAZLC_64
#define ILAZLR ILAZLR_64
#define IPARMQ IPARMQ_64
#define SISNAN SISNAN_64
#define SLAISN SLAISN_64
#define SLAMCH SLAMCH_64
Expand Down
9 changes: 6 additions & 3 deletions src/apps/sas/sase.F90
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ PROGRAM GALAHAD_SAS_EXAMPLE
! fix l, r, theta and phi, and solve for xi and b

f = 0.0_rp_
a_11 = 0.0_rp_ ; a_12 = 0.0_rp_ ; a_22 = 0.0_rp_ ; r_1 = 0.0_rp_ ; r_2 = 0.0_rp_
a_11 = 0.0_rp_ ; a_12 = 0.0_rp_ ; a_22 = 0.0_rp_
r_1 = 0.0_rp_ ; r_2 = 0.0_rp_
DO i = 1, obs
alpha = 0.0_rp_
DO ip = 1, np
Expand Down Expand Up @@ -475,7 +476,8 @@ PROGRAM GALAHAD_SAS_EXAMPLE
! before finding l, fix l, r, theta and phi, and solve for xi and b

f = 0.0_rp_
a_11 = 0.0_rp_ ; a_12 = 0.0_rp_ ; a_22 = 0.0_rp_ ; r_1 = 0.0_rp_ ; r_2 = 0.0_rp_
a_11 = 0.0_rp_ ; a_12 = 0.0_rp_ ; a_22 = 0.0_rp_
r_1 = 0.0_rp_ ; r_2 = 0.0_rp_
ne = 0
DO i = 1, obs
alpha = DOT_PRODUCT( L, p_l%A%val( ne + 1 : ne + nl ) )
Expand Down Expand Up @@ -558,7 +560,8 @@ PROGRAM GALAHAD_SAS_EXAMPLE
! before finding r, fix l, r, theta and phi, and solve for xi and b

f = 0.0_rp_
a_11 = 0.0_rp_ ; a_12 = 0.0_rp_ ; a_22 = 0.0_rp_ ; r_1 = 0.0_rp_ ; r_2 = 0.0_rp_
a_11 = 0.0_rp_ ; a_12 = 0.0_rp_ ; a_22 = 0.0_rp_
r_1 = 0.0_rp_ ; r_2 = 0.0_rp_
ne = 0
DO i = 1, obs
alpha = DOT_PRODUCT( R, p_r%A%val( ne + 1 : ne + nr ) )
Expand Down
4 changes: 2 additions & 2 deletions src/arc/arcs4.f90
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ PROGRAM GALAHAD_ARC4_EXAMPLE ! GALAHAD 3.3 - 25/07/2021 AT 09:15 GMT
CALL ARC_information( data, inform, status )
IF ( inform%status == 0 ) THEN ! Successful return
WRITE( 6, "( ' ARC: ', I0, ' iterations -', &
& ' optimal objective value =', &
& ES12.4, ', ||g|| =', ES11.4, /, ' Optimal solution = ', ( 5ES12.4 ) )" ) &
& ' optimal objective value =', ES12.4, ', ||g|| =', ES11.4, /, &
' Optimal solution = ', ( 5ES12.4 ) )" ) &
inform%iter, inform%obj, inform%norm_g, X
ELSE ! Error returns
WRITE( 6, "( ' ARC_solve exit status = ', I6 ) " ) inform%status
Expand Down
4 changes: 2 additions & 2 deletions src/bgo/bgoti.F90
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ SUBROUTINE HESSPROD( status, X, userdata, U, V, got_h ) ! Hessian-vector prod
REAL, PARAMETER :: freq = 10.0_rp_
REAL, PARAMETER :: mag = 1000.0_rp_
U( 1 ) = U( 1 ) &
+ ( 2.0_rp_ - mag * freq * freq * COS( freq * X( 1 ) ) ) * V( 1 ) &
+ ( 2.0_rp_ - mag * freq * freq * COS( freq * X( 1 ) ) ) * V( 1 ) &
+ 2.0_rp_ * V( 3 )
U( 2 ) = U( 2 ) + 2.0_rp_ * ( V( 2 ) + V( 3 ) )
U( 3 ) = U( 3 ) + 2.0_rp_ * ( V( 1 ) + V( 2 ) + 2.0_rp_ * V( 3 ) )
Expand Down Expand Up @@ -454,7 +454,7 @@ SUBROUTINE SHESSPROD( status, X, userdata, nnz_v, INDEX_nz_v, V, &
j = INDEX_nz_v( i )
SELECT CASE( j )
CASE( 1 )
P( 1 ) = P( 1 ) + 2.0_rp_ * V( 1 ) &
P( 1 ) = P( 1 ) + 2.0_rp_ * V( 1 ) &
- mag * freq * freq * COS( freq * X( 1 ) ) * V( 1 )
USED( 1 ) = .TRUE.
P( 3 ) = P( 3 ) + 2.0_rp_ * V( 1 )
Expand Down
3 changes: 2 additions & 1 deletion src/blls/blls.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,8 @@ SUBROUTINE eval_ASPROD( status, userdata, V, P, NZ_in, nz_in_start, &
INTEGER ( KIND = ip_ ), OPTIONAL, INTENT( IN ) :: nz_in_start, nz_in_end
INTEGER ( KIND = ip_ ), OPTIONAL, INTENT( INOUT ) :: nz_out_end
INTEGER ( KIND = ip_ ), DIMENSION( : ), OPTIONAL, INTENT( IN ) :: NZ_in
INTEGER ( KIND = ip_ ), DIMENSION( : ), OPTIONAL, INTENT( INOUT ) :: NZ_out
INTEGER ( KIND = ip_ ), DIMENSION( : ), OPTIONAL, &
INTENT( INOUT ) :: NZ_out
END SUBROUTINE eval_ASPROD
END INTERFACE

Expand Down
4 changes: 2 additions & 2 deletions src/blls/bllst.F90
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,14 @@ PROGRAM GALAHAD_BLLS_TEST_PROGRAM
CALL SMT_put( p%Ao%type, 'DENSE_BY_COLUMNS', s )
ALLOCATE( p%Ao%val( o * n ) )
p%Ao%m = o ; p%Ao%n = n
p%Ao%val( : o * n ) = (/ 1.0_rp_, 1.0_rp_, 0.0_rp_, 0.0_rp_, &
p%Ao%val( : o * n ) = (/ 1.0_rp_, 1.0_rp_, 0.0_rp_, 0.0_rp_, &
0.0_rp_, 1.0_rp_, 0.0_rp_, 0.0_rp_, &
0.0_rp_, 0.0_rp_, 1.0_rp_, 1.0_rp_ /)
CASE ( 5 ) ! A dense by rows
CALL SMT_put( p%Ao%type, 'DENSE_BY_ROWS', s )
ALLOCATE( p%Ao%val( o * n ) )
p%Ao%m = o ; p%Ao%n = n
p%Ao%val( : o * n ) = (/ 1.0_rp_, 0.0_rp_, 0.0_rp_, &
p%Ao%val( : o * n ) = (/ 1.0_rp_, 0.0_rp_, 0.0_rp_, &
1.0_rp_, 1.0_rp_, 0.0_rp_, &
0.0_rp_, 0.0_rp_, 1.0_rp_, &
0.0_rp_, 0.0_rp_, 1.0_rp_ /)
Expand Down
4 changes: 2 additions & 2 deletions src/bllsb/bllsbt.F90
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ PROGRAM GALAHAD_BLLSB_EXAMPLE
& F6.1, ' status = ', I6 )" ) status, info%iter, &
info%obj, info%status
ELSE
WRITE( 6, "(I2, ': BLLSB_solve exit status = ', I6 )") status, info%status
WRITE( 6, "(I2, ': BLLSB_solve exit status = ', I6)") status, info%status
END IF
DEALLOCATE( p%Ao%val, p%Ao%col )
CALL BLLSB_terminate( data, control, info )
Expand Down Expand Up @@ -213,7 +213,7 @@ PROGRAM GALAHAD_BLLSB_EXAMPLE
& F6.1, ' status = ', I6 )" ) st, i, info%iter, &
info%obj, info%status
ELSE
WRITE( 6, "( A1, I1,': BLLSB_solve exit status = ', I6 ) " ) &
WRITE( 6, "( A1, I1,': BLLSB_solve exit status = ', I6 ) " ) &
st, i, info%status
END IF
! STOP
Expand Down
2 changes: 1 addition & 1 deletion src/bqp/inbqp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ PROGRAM RUNBQP_DATA_precision
DEALLOCATE( IW )
ALLOCATE( prob%H%row( 0 ), STAT = alloc_stat )
IF ( alloc_stat /= 0 ) THEN
WRITE( out, "( ' whoa there - allocate error ', i6 )" ) alloc_stat ; STOP
WRITE( out, "( ' stop - allocate error ', i6 )" ) alloc_stat ; STOP
END IF

prob%new_problem_structure = .TRUE.
Expand Down
2 changes: 1 addition & 1 deletion src/ccqp/ccqp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,7 @@ SUBROUTINE CCQP_solve( prob, data, control, inform )
inform%nfacts = 1

IF ( ( control%cpu_time_limit >= zero .AND. &
REAL( time_now - time_start, rp_ ) > control%cpu_time_limit ) .OR. &
REAL( time_now - time_start, rp_ ) > control%cpu_time_limit ) .OR.&
( control%clock_time_limit >= zero .AND. &
clock_now - clock_start > control%clock_time_limit ) ) THEN
inform%status = GALAHAD_error_cpu_limit
Expand Down
2 changes: 1 addition & 1 deletion src/cdqp/incdqp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ PROGRAM RUNCDQP_DATA_precision
DEALLOCATE( IW )
ALLOCATE( prob%A%row( 0 ), prob%H%row( 0 ), STAT = alloc_stat )
IF ( alloc_stat /= 0 ) THEN
WRITE( out, "( ' whoa there - allocate error ', i6 )" ) alloc_stat ; STOP
WRITE( out, "( ' stop - allocate error ', i6 )" ) alloc_stat ; STOP
END IF

prob%new_problem_structure = .TRUE.
Expand Down
18 changes: 11 additions & 7 deletions src/check/check.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2036,8 +2036,9 @@ END SUBROUTINE eval_Hv
1008 FORMAT(2X,'J(', I5, ',', I5, ')', 3X, A3, 3X, ES16.9, 2(3X,ES16.9) )
1009 FORMAT(2X,'H(', I5, ',', I5, ')', 3X, A3, 3X, ES16.9, 2(3X,ES16.9) )
1010 FORMAT(/, &
2X,' Component Ok Difference Value Error' ,/,&
2X,'-------------- --- ---------------- ---------------- ----------------' )
2X,' Component Ok Difference Value ', &
' Error', /, 2X, '-------------- --- ----------------', &
' ---------------- ----------------' )
1011 FORMAT(2X,'G( : )', 11X, A3, 2X, ES16.9, 2(3X,ES16.9))
1014 FORMAT(2X,'J(', I5, ', : )', 5X, A3, 2X, ES16.9, 2(3X,ES16.9))
1015 FORMAT(2X,'H(', I5, ', : )', 5X, A3, 2X, ES16.9, 2(3X,ES16.9))
Expand All @@ -2051,11 +2052,14 @@ END SUBROUTINE eval_Hv
T13, '| CONTROL PARAMETERS |',/ &
T13, '-------------------------------------------------------' )
1018 FORMAT(/, &
12X, 'checkG = ', L2, 3x, 'f_available = ', I2, 3x, 'deall_error_fatal = ', L2, /, &
12X, 'checkJ = ', L2, 3x, 'c_available = ', I2, 3x, 'print_level = ', I2, /, &
12X, 'checkH = ', L2, 3x, 'g_available = ', I2, 3x, 'verify_level = ', I2, /, &
12X, 'error = ', I2, 3x, 'J_available = ', I2, 3x, 'out = ', I2, /, &
T27, 'H_available = ', I2 )
12X, 'checkG = ', L2, 3x, 'f_available = ', I2, 3x, &
'deall_error_fatal = ', L2, /, &
12X, 'checkJ = ', L2, 3x, 'c_available = ', I2, 3x, &
'print_level = ', I2, /, &
12X, 'checkH = ', L2, 3x, 'g_available = ', I2, 3x, &
'verify_level = ', I2, /, &
12X, 'error = ', I2, 3x, 'J_available = ', I2, 3x, &
'out = ', I2, /, T27, 'H_available = ', I2 )
1019 FORMAT(/, &
T16, '----------------------------------------------',/, &
T16, '| MATRIX DATA |',/ &
Expand Down
6 changes: 4 additions & 2 deletions src/check/checks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ PROGRAM GALAHAD_check_example
allocate( nlp%H%row(Hne), nlp%H%col(Hne), nlp%H%val(Hne) )
nlp%J%row = (/ 1, 1, 1, 2 /) ; nlp%J%col = (/ 1, 2, 3, 2 /)
nlp%H%row = (/ 2, 3, 3 /) ; nlp%H%col = (/ 2, 2, 3 /)
nlp%X = (/ four, three, two /) ; nlp%X_l = -five ; nlp%X_u = five ; nlp%Y = (/ two, three /)
nlp%X = (/ four, three, two /) ; nlp%X_l = -five ; nlp%X_u = five
nlp%Y = (/ two, three /)
call CHECK_initialize( control ) ; control%print_level = 3
inform%status = 1
call CHECK_verify( nlp, data, control, inform, userdata, funF, funC, funG, funJ, funH )
call CHECK_verify( nlp, data, control, inform, userdata, &
funF, funC, funG, funJ, funH )
call CHECK_terminate( data, control, inform )
END PROGRAM GALAHAD_check_example

Expand Down
Loading

0 comments on commit 8641b77

Please sign in to comment.