DustBunnie
Technical User
Hello FORTRAN Gurus,
I have written a program, which I have used for different study areas. Currently the code has 30 (or more) integer parameters that are used to, read input files, allocate arrays, carry out calculations, and name output files. In the past I have changed the input parameters in an 'include file', recompiled the program and incorporated the 'Include para.inc' statement in every program, subroutine and module. I'd like to write some code that would allow these 30 parameters to be input from an external file so that the code does not have to be recompiled every time I use the program.
First, is this possible? If it were possible, how would I go about it?
All suggestions welcome.
I am using the Intel Visual FORTRAN 9.1 compiler.
I'm enclosing an editted version of the code as it is you give some idea as to what I have been doing.
Thank you for your time.
I have written a program, which I have used for different study areas. Currently the code has 30 (or more) integer parameters that are used to, read input files, allocate arrays, carry out calculations, and name output files. In the past I have changed the input parameters in an 'include file', recompiled the program and incorporated the 'Include para.inc' statement in every program, subroutine and module. I'd like to write some code that would allow these 30 parameters to be input from an external file so that the code does not have to be recompiled every time I use the program.
First, is this possible? If it were possible, how would I go about it?
All suggestions welcome.
I am using the Intel Visual FORTRAN 9.1 compiler.
I'm enclosing an editted version of the code as it is you give some idea as to what I have been doing.
Thank you for your time.
Code:
! Parameters (para.inc)
! --- longitude and latitude of study area
integer, parameter :: nlong=90, nlat=264 ! study area 90 (nlong)columns, 264 (nlat)rows
! --- number of days simulated and number of data by day
integer, parameter :: nday=1, nhour=24 !
Module arrays
! using this to define all arrays that were in common blocks before
implicit none !changing all implicit to none so all will be declared!!!
include 'para.inc' !contains parameters
real(8), Dimension (nlong,nlat,nday,nhour):: wind ! array of 10m wind speeds m/s
End Module arrays
Program main
use arrays
Implicit none
! --- open 'nhour' output files one for every hour
call write_output
! read in the external input files for wind and soil class and veg files
call read_data
! --- beginning of computations
call begin_comp
end program main