module def_sim_lpn
! Author: Toni Pujol
!-----------------------------------------------------------------------
! VERY IMPORTANT: IF YOU HAVE OPENED comparison.f90, PLEASE CLOSE THAT PROJECT BEFORE COMPILING AND EXECUTING THIS PROGRAM (FILE-->CLOSE WORKSPLACE IF YOU USE FORTRAN POWERSTATION 4.0)
! 1. PLEASE COMPILE THIS PROGRAM FIRST, BUT DO NOT EXECUTE IT, 
! 2. COMPILE AND EXECUTE sim_ind_micro.f90 (simulation),
! 3. CLOSE THIS PROJECT (FILE-->CLOSE WORKSPLACE if you use Fortran Powerstation 4.0)
! 4. COMPILE AND EXECTURE comparison.f90 (computation of results)
!   
! Heading for the module subroutines
!
!-----------------------------------------------------------------------
!------------------------------------------------------------------------
! Parameters
!------------------------------------------------------------------------

implicit none

character*11 :: outfilen,outfilep

integer(4) :: nelem,nneig,nboun
integer(4) :: ielem,ineig,iboun
integer(4) :: ltype(18360),lneig(8,18360),lboun(18360),lnele(18360)
integer(4) :: ix,islop,iquad
integer(4) :: iter,itmax
integer(4) :: ipoin,ipoinmind
integer(4) :: lcount(4,18360),lelecont(4,18360,500)
integer(4) :: icount,igen,igenmax
integer(4) :: ielemini
integer(4) :: indp(18360),indn(18360)
integer(4) :: ihor0,iodhor0(25,18360),nhor0(18360)
integer(4) :: ihor1,iodhor1(90,18360),nhor1(18360)
integer(4) :: ihor2,iodhor2(210,18360),nhor2(18360)
integer(4) :: ihor3,iodhor3(350,18360),nhor3(18360)
integer(4) :: ihor4,iodhor4(800,18360),nhor4(18360)
integer(4) :: imetodehoritzontalweight,icoeffp
integer(4) :: ifile,icondini,itask

real*8 :: coord(2,18360)
real*8 :: xorigen,yorigen,xdestin,ydestin,slope
real*8 :: coordraig(2)
real*8 :: xcoord,ycoord,distmin1,distmin2,distcoord,distmind
real*8 :: xelem1,xelem2,xelem3,xelem4,xelem5
real*8 :: yelem1,yelem2,yelem3,yelem4,yelem5
real*8 :: dist24,dist25,dist34,dist35
real*8 :: distmax,popdens(18360)
real*8 :: weight(18360)
real*8 :: varpp1(18360),varpp2(18360)
real*8 :: varpn1(18360),varpn2(18360),varpnhor(18360)
real*8 :: densnmx,denspmx
real*8 :: xohor,yohor,xdhor,ydhor
real*8 :: disthor,distranshormax
real*8 :: distranshor
real*8 :: rnhor0,distranshor0
real*8 :: rnhor1,distranshor1
real*8 :: rnhor2,distranshor2
real*8 :: rnhor3,distranshor3
real*8 :: rnhor4,distranshor4
real*8 :: ctnpepv(18360),ctnpenv(18360),coefhgvisit(18360)
real*8 :: varpi,reflat1,reflat2,vorilat,vorilon,coefn,coefc,coefr
real*8 :: termy,termx,theta,xlon,xlat
real*8 :: ctnpep


real*8 :: rtermn,rtermp,gamma,coeff,coefalfa
real*8 :: coefpnvisit,coefpp

real*8 :: coefvh100,coefvh200,coefvh400,coefvh600,coefvh800

end module def_sim_lpn

!