Skip to content

Commit

Permalink
Fix bugs for gfortran: fortran interface to self. Refers to https://s…
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyzlj committed Apr 22, 2020
1 parent 5e892f4 commit 9a12d04
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ foreach(F77FILE ${F77SRCS})
if(${_FOUND_LEN72} GREATER -1)
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS /4L72)
else()
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS /4L79)
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS /4L80)
endif()
else()
if(${_FOUND_LEN72} GREATER -1)
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -72)
else()
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -79)
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -80)
endif()
endif()
else() # gfortran tested only
if(${_FOUND_LEN72} GREATER -1)
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -ffixed-line-length-72)
else()
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -ffixed-line-length-79)
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -ffixed-line-length-80)
endif()
endif()
endforeach()
Expand Down Expand Up @@ -59,7 +59,7 @@ if((NOT MSVC) AND (${First_Line_Of_Main_File} MATCHES " include 'modparm.f'
endif ()
# Build main.f first which includes modparm.f (i.e., parm.mod)
add_custom_command(OUTPUT main.o
COMMAND ${CMAKE_Fortran_COMPILER} ${Compile_Flags_List} -ffixed-line-length-79 -c
COMMAND ${CMAKE_Fortran_COMPILER} ${Compile_Flags_List} -ffixed-line-length-80 -c
${CMAKE_CURRENT_SOURCE_DIR}/modparm.f ${CMAKE_CURRENT_SOURCE_DIR}/main.f)
# Build other source files that depend on main.o
foreach(SRCFILE ${F77SRCS} ${F90SRCS})
Expand All @@ -71,7 +71,7 @@ if((NOT MSVC) AND (${First_Line_Of_Main_File} MATCHES " include 'modparm.f'
endif()
# Set compile flag according to Fortran line format. These should be consistent with settings above.
if(${ext} STREQUAL ".f")
set(Format_Flag "-ffixed-line-length-79")
set(Format_Flag "-ffixed-line-length-80")
else()
set(Format_Flag "-ffree-line-length-none")
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/HQDAV.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ SUBROUTINE HQDAV(A,CBW,QQ,SSS,ZCH,ZX,CHW,FPW,jrch)
! adopted from APEX1501 by Jaehak Jeong 2017
! THIS SUBPROGRAM COMPUTES FLOW AREA AND DEPTH GIVEN RATE in a reach

USE PARM
USE PARM, except_this_one => HQDAV

real*8, intent (in out) :: A, ZX, CHW, FPW
real*8, intent (in) :: CBW, QQ, SSS, ZCH
integer, intent (in) :: jrch
Expand Down
2 changes: 1 addition & 1 deletion src/atri.f
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function atri(at1,at2,at3,at4i) result (r_atri)

!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~

use parm
use parm, except_this_one => atri

real*8, intent (in) :: at1, at2, at3
integer, intent (in out) :: at4i
Expand Down
2 changes: 1 addition & 1 deletion src/layersplit.f
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
subroutine layersplit(dep_new)

use parm
use parm, except_this_one => layersplit
integer nly,n,j
integer :: flag
real*8, intent(in):: dep_new
Expand Down
2 changes: 1 addition & 1 deletion src/ndenit.f
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
subroutine ndenit(k,j,cdg,wdn,void)
!! this subroutine computes denitrification

use parm
use parm, except_this_one => ndenit
integer :: k,j
real*8 :: cdg, wdn, void

Expand Down
2 changes: 1 addition & 1 deletion src/regres.f
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ real*8 function regres(k) result (r_regres)

!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~

use parm
use parm, except_this_one => regres

integer, intent (in) :: k
real*8, dimension (5,3) :: beta
Expand Down
2 changes: 1 addition & 1 deletion src/rsedaa.f
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ subroutine rsedaa(years)

!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~

use parm
use parm, except_this_one => rsedaa

real*8, intent (in) :: years
integer :: j
Expand Down
2 changes: 1 addition & 1 deletion src/tair.f
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function tair(hr,jj) result (r_tair)
!! Hydrology-Vrije Universiteit Brussel, Belgium
!! subroutine modified by SLN

use parm
use parm, except_this_one => tair

integer, intent (in) :: jj
real*8, intent(in) :: hr
Expand Down
2 changes: 1 addition & 1 deletion src/vbl.f
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ subroutine vbl(evx,spx,pp,qin,ox,vx1,vy,yi,yo,ysx,vf,vyf,aha)

!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~

use parm
use parm, except_this_one => vbl

real*8, intent (in) :: evx, spx, pp, qin, ox, yi, yo, ysx
real*8, intent (in) :: vf, vyf, aha
Expand Down

0 comments on commit 9a12d04

Please sign in to comment.