Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compile a fortran program on LINUX !! How to compile a Fortran program with an other script (on LINUX). Descprition : I have a repository

Compile a fortran program on LINUX !!

How to compile a Fortran program with an other script (on LINUX).

Descprition : I have a repository 'package' (lets call it "A") , inside of it, there is 4 other repositories : lets call them B, C, D, & E . I m interested in one of these 4 repositories, the C one. Inside of this 'C' repository, there is 2 repositories 'F' & 'G', 2 other scripts and a little Readme txt . (see the readme to know what it says, and how we should compile and execute our program '.f77' ) The program ".f77" is in the 'F' repository, with other programs '.f77' .

The question is how I should compile and start the program according to the readme text ?

What commands should I use ?

Thanks for help.

Below the pictures of the repositories and scripts.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

1 Package CRP-NW100 ROUTINES Name t | CRP-N2W100 CRP-NW100 op LIBRARY | SUBORION nents N2morse.dat loads Package CRP-NW100 ROUTINES Name DATA ROUTINES | job make_testat ents readme se Package CRP-NW100 ROUTINES Name DATA ROUTINES l job make_testat nents i readme bads eadme Open Save -/Desktop/piscine_fortran/Package/CRP-NW100 1 The program "testat" allows to calculate es 2 the potential for a given value of 3 the coordinates. 4 It is compiled by using the script "make_testat" 5 and started by the command "job testat" 6 which uses the script "job". ... 7 9 At the beginning of each script, a section defines 10 the location of the files. oling 11 Change the argument according to the directory 12 structure on the computer used. Loc 13 14 Please check that the gfortran compiler is correctly 15 set up on your computer or use another compiler. 16 Package CRP-NW100 ROUTINES Size Name 8 items DATA 5 items ROUTINES G job 521 bytes -nts O make_testat 647 bytes readme 480 bytes ads job --/Desktop/piscine_fortran/Package/CRP-NW100 Open Save job readme 1 # Computer dependent settings: 2 3 # Localisation of PES's repository: 5 PESS=~/Desktop/piscine_fortran/Package/CRP-NW100 6. ing 9 # Localization of data files 10 DATA=PESS/DATA 11 12 cp $DATA/hole.dat 13 cp $DATA/bridge.dat . 14 cp $DATA/topp.dat . 15 cp $DATA/topm.dat . 16 cp DATA/brihol.dat . 17 cp $DATA/tophol.dat . 18 cp DATA/topbri.dat . 19 cp $DATA/intrep.dat . 20 21 $1 22 23 rm hole.dat 24 rm bridge.dat 25 rm topp.dat 26 rm topm.dat 27 rm brihol.dat 28 rm tophol.dat 29 rm topbri.dat 30 rm intrep.dat II Package CRP-NW100 ROUTINES Name ecent DATA lome | ROUTINES O job esktop O make_testat ocuments eadme ownloads make_testat -/Desktop/piscine_fortran/Package/CRP-NW100 Open ric Save 2 # Computer dependent settings: 3 4 # Localisation of PES's repository: 6 PESS =~/Desktop/piscine_fortran/Package/CRP- NW100 7 PESS1 =~/Desktop/piscine_fortran/Package in 9 #- |10 # Localization of library routines. 11 # PES specific routines: 12 BIBLI=PESS1/LIBRARY ot 13 # Standard utility routines: 14 ORION=$PESS1/SUBORION 15 16 # Localisation of atom/surface routines. 17 ATOM=$PESS/ROUTINES 18 19 ATOMIC="$ATOM/lectatom.f $ATOM/at3D2.f $ATOM/mur3D2.f" 20 21 PGM="$BIBLI/dplcoft.f $BIBLI/splint.f $BIBLI/origen100.f" 22 23 STD="ORION/dsplin.f $0ORION/tridia.f" 24 25 gfortran $ATOM/testat.f -03 $ATOMIC $PGM $STD -otestat.exe 26 Package CRP-NW100 ROUTINES Name Recent D at3D2.f Home lectatom.f Desktop mur3D2.f O pot3D.f Documents testat.f testat.f Save -/Desktop/piscine_fortran/Package/CRP-NW100/ROUTINES Calculation of potential at a given point IMPLICIT NONE DOUBLE PRECISION delta COMMON/SURF/delta LOGICAL fin INTEGER I,Ntot DOUBLE PRECISION xa,ya,za,v,dvdx,dvdy,dvdz, Zmin,Zmax CALL LECTATOM WRITE(*,*) 'xa,ya (units of delta)?' READ(*,*) xa,ya WRITE(*,*) 'Ntot,Zmin,Zmax (angstrom)' READ(*,*) Ntot,Zmin,Zmax xa=xa*delta ya=ya*delta OPEN(UNIT=1, FILE='SEPN.dat', STATUS= 'UNKNOWN ') DO I=1,Ntot za=Zmin+DFLOAT(I-1)*((Zmax-Zmin)/(DFLOAT(Ntot))) CALL AT3D2(xa,ya,za,v,dvdx,dvdy,dvdz,fin) WRITE(1,*) za,v WRITE(*,*) 'Potential: ',v,' (eV)' WRITE(*, *) 'Derivatives: I Z :',dvdz, X:',dvdx,' Y: ',dvdy, (eV/Ang)' ENDDO END Tab Width: 5 - Ln 6, Col 24 Fortran 95 1 Package CRP-NW100 ROUTINES Name t | CRP-N2W100 CRP-NW100 op LIBRARY | SUBORION nents N2morse.dat loads Package CRP-NW100 ROUTINES Name DATA ROUTINES | job make_testat ents readme se Package CRP-NW100 ROUTINES Name DATA ROUTINES l job make_testat nents i readme bads eadme Open Save -/Desktop/piscine_fortran/Package/CRP-NW100 1 The program "testat" allows to calculate es 2 the potential for a given value of 3 the coordinates. 4 It is compiled by using the script "make_testat" 5 and started by the command "job testat" 6 which uses the script "job". ... 7 9 At the beginning of each script, a section defines 10 the location of the files. oling 11 Change the argument according to the directory 12 structure on the computer used. Loc 13 14 Please check that the gfortran compiler is correctly 15 set up on your computer or use another compiler. 16 Package CRP-NW100 ROUTINES Size Name 8 items DATA 5 items ROUTINES G job 521 bytes -nts O make_testat 647 bytes readme 480 bytes ads job --/Desktop/piscine_fortran/Package/CRP-NW100 Open Save job readme 1 # Computer dependent settings: 2 3 # Localisation of PES's repository: 5 PESS=~/Desktop/piscine_fortran/Package/CRP-NW100 6. ing 9 # Localization of data files 10 DATA=PESS/DATA 11 12 cp $DATA/hole.dat 13 cp $DATA/bridge.dat . 14 cp $DATA/topp.dat . 15 cp $DATA/topm.dat . 16 cp DATA/brihol.dat . 17 cp $DATA/tophol.dat . 18 cp DATA/topbri.dat . 19 cp $DATA/intrep.dat . 20 21 $1 22 23 rm hole.dat 24 rm bridge.dat 25 rm topp.dat 26 rm topm.dat 27 rm brihol.dat 28 rm tophol.dat 29 rm topbri.dat 30 rm intrep.dat II Package CRP-NW100 ROUTINES Name ecent DATA lome | ROUTINES O job esktop O make_testat ocuments eadme ownloads make_testat -/Desktop/piscine_fortran/Package/CRP-NW100 Open ric Save 2 # Computer dependent settings: 3 4 # Localisation of PES's repository: 6 PESS =~/Desktop/piscine_fortran/Package/CRP- NW100 7 PESS1 =~/Desktop/piscine_fortran/Package in 9 #- |10 # Localization of library routines. 11 # PES specific routines: 12 BIBLI=PESS1/LIBRARY ot 13 # Standard utility routines: 14 ORION=$PESS1/SUBORION 15 16 # Localisation of atom/surface routines. 17 ATOM=$PESS/ROUTINES 18 19 ATOMIC="$ATOM/lectatom.f $ATOM/at3D2.f $ATOM/mur3D2.f" 20 21 PGM="$BIBLI/dplcoft.f $BIBLI/splint.f $BIBLI/origen100.f" 22 23 STD="ORION/dsplin.f $0ORION/tridia.f" 24 25 gfortran $ATOM/testat.f -03 $ATOMIC $PGM $STD -otestat.exe 26 Package CRP-NW100 ROUTINES Name Recent D at3D2.f Home lectatom.f Desktop mur3D2.f O pot3D.f Documents testat.f testat.f Save -/Desktop/piscine_fortran/Package/CRP-NW100/ROUTINES Calculation of potential at a given point IMPLICIT NONE DOUBLE PRECISION delta COMMON/SURF/delta LOGICAL fin INTEGER I,Ntot DOUBLE PRECISION xa,ya,za,v,dvdx,dvdy,dvdz, Zmin,Zmax CALL LECTATOM WRITE(*,*) 'xa,ya (units of delta)?' READ(*,*) xa,ya WRITE(*,*) 'Ntot,Zmin,Zmax (angstrom)' READ(*,*) Ntot,Zmin,Zmax xa=xa*delta ya=ya*delta OPEN(UNIT=1, FILE='SEPN.dat', STATUS= 'UNKNOWN ') DO I=1,Ntot za=Zmin+DFLOAT(I-1)*((Zmax-Zmin)/(DFLOAT(Ntot))) CALL AT3D2(xa,ya,za,v,dvdx,dvdy,dvdz,fin) WRITE(1,*) za,v WRITE(*,*) 'Potential: ',v,' (eV)' WRITE(*, *) 'Derivatives: I Z :',dvdz, X:',dvdx,' Y: ',dvdy, (eV/Ang)' ENDDO END Tab Width: 5 - Ln 6, Col 24 Fortran 95

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions