More fixes for NAG compiler, activated by -D__NAG, for iargc, getarg intrinsic

git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@11742 c92efa57-630b-4861-b058-cf58834340f0
This commit is contained in:
giannozz 2015-09-20 09:10:55 +00:00
parent 10fcd8489e
commit c914890b4a
9 changed files with 61 additions and 42 deletions

View File

@ -30,7 +30,8 @@ MODULE command_line_options
USE mp_world, ONLY : root, world_comm
USE io_global, ONLY : meta_ionode
!
IMPLICIT NONE
IMPLICIT NONE
!
SAVE
!
! ... Number of arguments in command line
@ -47,12 +48,16 @@ MODULE command_line_options
CONTAINS
!
SUBROUTINE get_command_line ( input_command_line )
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
IMPLICIT NONE
CHARACTER(LEN=*), OPTIONAL :: input_command_line
INTEGER :: narg
#if !defined(__NAG)
INTEGER :: iargc
! Do not define iargc as external: gfortran doesn't like it
INTEGER :: iargc
#endif
LOGICAL :: read_string
CHARACTER(LEN=256) :: arg
CHARACTER(LEN=6), EXTERNAL :: int_to_char

View File

@ -19,19 +19,18 @@ SUBROUTINE plugin_arguments()
USE io_global, ONLY : stdout
!
USE plugin_flags
!
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
!
IMPLICIT NONE
!
INTEGER :: iiarg, nargs, iargc, i, i0
#if !defined(__NAG)
INTEGER :: iargc
#endif
INTEGER :: iiarg, nargs, i, i0
CHARACTER (len=1), EXTERNAL :: lowercase
CHARACTER (len=256) :: arg
!
!
#if defined(__ABSOFT)
# define getarg getarg_
# define iargc iargc_
#endif
!
nargs = iargc()
! add here more plugins

View File

@ -13,18 +13,18 @@ FUNCTION input_images_getarg( ) RESULT(input_images)
! return N (0 if not found)
!
USE kinds, ONLY : DP
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
!
IMPLICIT NONE
!
INTEGER :: input_images
CHARACTER(len=256) :: myname
INTEGER :: iiarg, nargs, iargc, i, i0
!
!
#if defined(__ABSOFT)
# define getarg getarg_
# define iargc iargc_
#if !defined(__NAG)
INTEGER :: iargc
#endif
INTEGER :: iiarg, nargs, i, i0
!
nargs = iargc()
input_images = 0

View File

@ -47,7 +47,9 @@ PROGRAM Q2QSTAR
USE io_dyn_mat, ONLY : read_dyn_mat_param, read_dyn_mat_header, &
read_dyn_mat, read_dyn_mat_tail, &
write_dyn_mat_header
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
!
IMPLICIT NONE
!
@ -63,7 +65,9 @@ PROGRAM Q2QSTAR
!
COMPLEX(DP),ALLOCATABLE :: phi(:,:,:,:), d2(:,:)
INTEGER :: i,j, icar,jcar, na,nb
#if !defined(__NAG)
INTEGER :: iargc ! intrinsic function
#endif
!
NAMELIST / input / fildyn
!

View File

@ -5,12 +5,12 @@
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
#if defined(__ABSOFT)
# define getarg getarg_
# define iargc iargc_
#endif
!
PROGRAM sumpdos
!
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
!
IMPLICIT NONE
!
! AUTHOR: Andrea Ferretti
@ -21,8 +21,9 @@ PROGRAM sumpdos
! file names are read from stdin
! USAGE: sumpdos <file1> ... <fileN>
!
#if !defined(__NAG)
INTEGER :: iargc ! function giving no of arguments
#endif
INTEGER :: ngrid ! dimension of the energy grid
INTEGER :: nfile ! number of files to sum
INTEGER :: nspin ! number of spin_component

View File

@ -24,10 +24,16 @@ subroutine read_input_and_bcast(filerecon, r_paw)
USE parameters, ONLY : ntypx,lmaxx,lqmax
USE control_flags, ONLY : twfcollect
USE klist, ONLY : nelup, neldw, nelec
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
IMPLICIT NONE
INTEGER :: nargs, ierr, ios, i
INTEGER :: iargc, iiarg
#if !defined(__NAG)
INTEGER :: iargc
#endif
INTEGER :: nargs, iiarg, ierr, ios, i
LOGICAL :: found ! input_file found or not ?
REAL(DP) :: norm, xeps_dot_xk
REAL(DP) :: r_paw(0:lmaxx)

View File

@ -110,7 +110,9 @@ Program manip_spectra
USE kinds, ONLY : DP
USE constants, ONLY : pi
USE edge_energy, ONLY: getE
IMPLICIT NONE
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
! Input
LOGICAL :: shift_spectrum
REAL(kind=dp) :: xe0
@ -121,7 +123,10 @@ Program manip_spectra
LOGICAL :: found
INTEGER :: i, j
INTEGER :: nargs, iiarg, iargc, ierr, ios
#if !defined(__NAG)
INTEGER :: iargc
#endif
INTEGER :: nargs, iiarg, ierr, ios
INTEGER :: nenergy, istart, i0_l2, nenergy_conv
REAL(kind=dp) :: el2, el3, so_splitting, emin_conv, emax_conv, de
REAL(kind=dp) :: Ectr, gamma_hole, gamma_max, ee

View File

@ -5,12 +5,6 @@
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
#if defined(__ABSOFT)
# define getenv getenv_
# define getarg getarg_
# define iargc iargc_
#endif
!
SUBROUTINE get_env ( variable_name, variable_value )
!
! Wrapper for intrinsic getenv - all machine-dependent stuff here
@ -24,7 +18,11 @@ END SUBROUTINE get_env
SUBROUTINE input_from_file( )
!
! This subroutine checks command-line arguments for -i[nput] "file name"
! if "file nname" is present, attach input unit 5 to the specified file
! if "file name" is present, attach input unit 5 to the specified file
!
#if defined(__NAG)
USE F90_UNIX_ENV, ONLY : iargc, getarg
#endif
!
IMPLICIT NONE
!
@ -32,10 +30,11 @@ SUBROUTINE input_from_file( )
CHARACTER (LEN=256) :: input_file
LOGICAL :: found
!
INTEGER :: iiarg, nargs
#if !defined(__NAG)
INTEGER :: iargc
! Do not define iargc as external: gfortran doesn't like it
INTEGER :: iargc
!
#endif
INTEGER :: iiarg, nargs
!
nargs = iargc()
found = .FALSE.

View File

@ -93,10 +93,10 @@ for dir in $dirs; do
$TOPDIR/moduledep.sh $DEPENDS > make.depend
$TOPDIR/includedep.sh $DEPENDS >> make.depend
# handle special cases
sed '/@\/cineca\/prod\/hpm\/include\/f_hpm.h@/d' \
make.depend > make.depend.tmp
sed '/@iso_c_binding@/d;/@ifcore@/d' make.depend.tmp > make.depend
# handle special cases: hardware-specific monitoring tools
sed '/@\/cineca\/prod\/hpm\/include\/f_hpm.h@/d;/@ifcore@/d' make.depend > make.depend.tmp
# handle special cases: modules for C-fortran binding, system utilities
sed '/@iso_c_binding@/d;/@f90_unix_env@/d' make.depend.tmp > make.depend
if test "$DIR" = "Modules"
then