Skip to content

Commit 44da8c3

Browse files
committed
Break up some especially long lines (Fortitude/S001)
Long lines are more difficult to read, and may not fit on some developers' terminals. The line continuation character '&' may be used to split a long line across multiple lines, and overly long expressions may be broken down into multiple parts. The maximum line length can be changed using the flag `--line-length=N`. The default maximum line length is 100 characters. This is a fair bit more than the traditional 80, but due to the verbosity of modern Fortran it can sometimes be difficult to squeeze lines into that width, especially when using large indents and multiple levels of indentation. Some lines that are longer than the maximum length may be acceptable, such as long strings or comments. This is to allow for long URLs or other text that cannot be reasonably split across multiple lines. Note that the Fortran standard states a maximum line length of 132 characters, and while some modern compilers will support longer lines, for portability it is recommended to stay beneath this limit.
1 parent dae6a38 commit 44da8c3

File tree

10 files changed

+34
-15
lines changed

10 files changed

+34
-15
lines changed

src/programs/util/ectrans_memory.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ subroutine c_set_logging(logging) bind(c,name="ectrans_memory_set_logging")
114114
integer(c_int), value :: logging
115115
end subroutine
116116

117-
subroutine c_set_logging_fortran_output_unit(output_unit) bind(c, name="ectrans_memory_set_logging_fortran_output_unit")
117+
subroutine c_set_logging_fortran_output_unit(output_unit) bind(c, &
118+
& name="ectrans_memory_set_logging_fortran_output_unit")
118119
use iso_c_binding, only: c_int
119120
integer(c_int), value :: output_unit
120121
end subroutine

src/trans/cpu/internal/suleg_mod.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ SUBROUTINE SULEG
338338
IF( LLP2 ) THEN
339339
WRITE(NOUT,*) 'dual latitudes'
340340
DO JGL= 1, INN
341-
WRITE(NOUT,*) 'dual JGL=',JGL,(180._JPRD/ZPI)*ZINC,(180._JPRD/ZPI)*ASIN(ZLRMUZ2(JGL)),(180._JPRD/ZPI)*ASIN(F%RMU(JGL))
341+
WRITE(NOUT,*) 'dual JGL=',JGL,(180._JPRD/ZPI)*ZINC,(180._JPRD/ZPI)*ASIN(ZLRMUZ2(JGL)),&
342+
& (180._JPRD/ZPI)*ASIN(F%RMU(JGL))
342343
ENDDO
343344
ENDIF
344345

src/trans/gpu/algor/ext_acc.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ module openacc_ext
4141
end type
4242

4343
interface ext_acc_pass
44-
module procedure ext_acc_pass_2d_r4, ext_acc_pass_3d_r4, ext_acc_pass_4d_r4, ext_acc_pass_2d_r8, ext_acc_pass_3d_r8, ext_acc_pass_4d_r8
44+
module procedure ext_acc_pass_2d_r4, ext_acc_pass_3d_r4, ext_acc_pass_4d_r4
45+
module procedure ext_acc_pass_2d_r8, ext_acc_pass_3d_r8, ext_acc_pass_4d_r8
4546
end interface
4647
contains
4748

src/trans/gpu/external/setup_trans.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ SUBROUTINE SETUP_TRANS(KSMAX,KDGL,KDLON,KLOEN,LDSPLIT,PSTRET,&
381381
IF (D%LGRIDONLY) THEN
382382
R%NSMAX=1
383383
R%NTMAX = R%NSMAX
384-
WRITE(NOUT,'(A,I0)') "DEVELOPER WARNING: LDGRIDONLY IS NOT YET IMPLEMENTED CORRECTLY WITH GPU BACKEND. IGNORE AND USE TRUNCATION: ", R%NSMAX
384+
WRITE(NOUT,'(A,I0)') "DEVELOPER WARNING: LDGRIDONLY IS NOT YET IMPLEMENTED CORRECTLY WITH GPU&
385+
& BACKEND. IGNORE AND USE TRUNCATION: ", R%NSMAX
385386
D%LGRIDONLY = .FALSE.
386387
ENDIF
387388
! >>>>>>>>>>>>>

src/trans/gpu/internal/fsc_mod.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ SUBROUTINE FSC(ALLOCATOR,HFSC,PREEL_COMPLEX, KF_FS, KF_UV, KF_SCALARS, KUV_OFFSE
7373
IMPLICIT NONE
7474
REAL(KIND=JPRBT), INTENT(INOUT) :: PREEL_COMPLEX(:)
7575
INTEGER(KIND=JPIM), INTENT(IN) :: KF_FS, KF_UV, KF_SCALARS
76-
INTEGER(KIND=JPIM), INTENT(IN) :: KUV_OFFSET, KSCALARS_OFFSET, KSCALARS_NSDER_OFFSET, KUV_EWDER_OFFSET, KSCALARS_EWDER_OFFSET
76+
INTEGER(KIND=JPIM), INTENT(IN) :: KUV_OFFSET, KSCALARS_OFFSET, KSCALARS_NSDER_OFFSET
77+
INTEGER(KIND=JPIM), INTENT(IN) :: KUV_EWDER_OFFSET, KSCALARS_EWDER_OFFSET
7778
TYPE(BUFFERED_ALLOCATOR), INTENT(IN) :: ALLOCATOR
7879
TYPE(FSC_HANDLE), INTENT(IN) :: HFSC
7980

src/trans/gpu/internal/fscad_mod.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ SUBROUTINE FSCAD(ALLOCATOR,HFSC,PREEL_COMPLEX, KF_FS, KF_UV, KF_SCALARS, KUV_OFF
7474
IMPLICIT NONE
7575
REAL(KIND=JPRBT), INTENT(INOUT) :: PREEL_COMPLEX(:)
7676
INTEGER(KIND=JPIM), INTENT(IN) :: KF_FS, KF_UV, KF_SCALARS
77-
INTEGER(KIND=JPIM), INTENT(IN) :: KUV_OFFSET, KSCALARS_OFFSET, KSCALARS_NSDER_OFFSET, KUV_EWDER_OFFSET, KSCALARS_EWDER_OFFSET
77+
INTEGER(KIND=JPIM), INTENT(IN) :: KUV_OFFSET, KSCALARS_OFFSET, KSCALARS_NSDER_OFFSET
78+
INTEGER(KIND=JPIM), INTENT(IN) :: KUV_EWDER_OFFSET, KSCALARS_EWDER_OFFSET
7879
TYPE(BUFFERED_ALLOCATOR), INTENT(IN) :: ALLOCATOR
7980
TYPE(FSCAD_HANDLE), INTENT(IN) :: HFSC
8081

src/trans/gpu/internal/suleg_mod.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ SUBROUTINE SULEG
330330
IF( LLP2 ) THEN
331331
WRITE(NOUT,*) 'dual latitudes'
332332
DO JGL= 1, INN
333-
WRITE(NOUT,*) 'dual JGL=',JGL,(180._JPRD/ZPI)*ZINC,(180._JPRD/ZPI)*ASIN(ZLRMUZ2(JGL)),(180._JPRD/ZPI)*ASIN(F%RMU(JGL))
333+
WRITE(NOUT,*) 'dual JGL=',JGL,(180._JPRD/ZPI)*ZINC,(180._JPRD/ZPI)*ASIN(ZLRMUZ2(JGL)),&
334+
& (180._JPRD/ZPI)*ASIN(F%RMU(JGL))
334335
ENDDO
335336
ENDIF
336337

src/trans/gpu/internal/trltomad_pack_unpack.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ FUNCTION PREPARE_TRLTOMAD_PACK(ALLOCATOR, KF_FS) RESULT(HTRLTOM_PACK)
4343

4444
REAL(KIND=JPRBT) :: DUMMY
4545

46-
HTRLTOM_PACK%HREEL_COMPLEX = RESERVE(ALLOCATOR, 1_JPIB*KF_FS*D%NLENGTF*C_SIZEOF(DUMMY), "HTRLTOMAD_PACK%HREEL_COMPLEX")
46+
HTRLTOM_PACK%HREEL_COMPLEX = RESERVE(ALLOCATOR, 1_JPIB*KF_FS*D%NLENGTF*C_SIZEOF(DUMMY), &
47+
& "HTRLTOMAD_PACK%HREEL_COMPLEX")
4748
END FUNCTION PREPARE_TRLTOMAD_PACK
4849

4950
SUBROUTINE TRLTOMAD_PACK(ALLOCATOR,HTRLTOM_PACK,PREEL_COMPLEX,FOUBUF_IN,KF_FS)

src/trans/gpu/internal/vdtuvad_mod.F90

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,28 @@ SUBROUTINE VDTUVAD(KFIELD,PEPSNM,PVOR,PDIV,PU,PV)
130130
IF(KM /= 0 .AND. JN >= KM) THEN
131131
! (DO JN=KN,R_NTMAX)
132132

133-
PDIV(II,JI,KMLOC) = -(JN)*PEPSNM(KMLOC,JN+1)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(II,JI-1,KMLOC) - &
140+
& ZKM*F_RLAPIN(JN)*PV(IR,JI,KMLOC) - &
141+
& (JN+1)*PEPSNM(KMLOC,JN)*F_RLAPIN(JN)*PU(II,JI+1,KMLOC)
142+
PVOR(IR,JI,KMLOC) = +(JN)*PEPSNM(KMLOC,JN+1)*F_RLAPIN(JN)*PU(IR,JI-1,KMLOC) + &
143+
& ZKM*F_RLAPIN(JN)*PV(II,JI,KMLOC) - &
144+
& (JN+1)*PEPSNM(KMLOC,JN)*F_RLAPIN(JN)*PU(IR,JI+1,KMLOC)
137145

138146
ELSEIF(KM == 0) THEN
139147
! (DO JN=0,R_NTMAX)
140148

141149
PVOR(II,JI,KMLOC) = 0.0_JPRB
142-
PVOR(IR,JI,KMLOC) = +(JN)*PEPSNM(KMLOC,JN+1)*F_RLAPIN(JN)*PU(IR,JI-1,KMLOC) - (JN+1)*PEPSNM(KMLOC,JN)*F_RLAPIN(JN)*PU(IR,JI+1,KMLOC)
150+
PVOR(IR,JI,KMLOC) = +(JN)*PEPSNM(KMLOC,JN+1)*F_RLAPIN(JN)*PU(IR,JI-1,KMLOC) - &
151+
& (JN+1)*PEPSNM(KMLOC,JN)*F_RLAPIN(JN)*PU(IR,JI+1,KMLOC)
143152
PDIV(II,JI,KMLOC) = 0.0_JPRB
144-
PDIV(IR,JI,KMLOC) = -(JN)*PEPSNM(KMLOC,JN+1)*F_RLAPIN(JN)*PV(IR,JI-1,KMLOC) + (JN+1)*PEPSNM(KMLOC,JN)*F_RLAPIN(JN)*PV(IR,JI+1,KMLOC)
153+
PDIV(IR,JI,KMLOC) = -(JN)*PEPSNM(KMLOC,JN+1)*F_RLAPIN(JN)*PV(IR,JI-1,KMLOC) + &
154+
& (JN+1)*PEPSNM(KMLOC,JN)*F_RLAPIN(JN)*PV(IR,JI+1,KMLOC)
145155
ENDIF
146156
ENDDO
147157
ENDDO

src/transi/transi_module.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ subroutine transi_free(ptr) bind(C,name="transi_free")
446446
use, intrinsic :: iso_c_binding, only: c_ptr
447447
type(c_ptr), intent(in) :: ptr
448448
end subroutine transi_free
449-
subroutine transi_disable_DR_HOOK_ASSERT_MPI_INITIALIZED() bind(C,name="transi_disable_DR_HOOK_ASSERT_MPI_INITIALIZED")
449+
subroutine transi_disable_DR_HOOK_ASSERT_MPI_INITIALIZED() bind(C, &
450+
& name="transi_disable_DR_HOOK_ASSERT_MPI_INITIALIZED")
450451
end subroutine
451452
end interface
452453

0 commit comments

Comments
 (0)