[go: up one dir, main page]

Menu

[r34]: / common / defaultmesh.f90  Maximize  Restore  History

Download this file

83 lines (74 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
! defaultmesh , routine for old VSV grid compatibility
! Copyright (C) 1999,2010 Gauthier Delerce
!
! This program is free software; you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation; either version 2, or (at your option)
! any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program; if not, write to the Free Software Foundation,
! Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
!
! Gauthier Delerce <gauthier@delerce.fr>
subroutine defaultmesh
use modvsv
use modgrille
implicit none
integer::num,ix,iy
!real xp(40000),yp(40000)
print*,ibsx,ibsy,isrx,isry,new_default,dxshift,dyshift
if (new_default) then
num=0
do iy=(isry+1)/2,(ny-(isry-1)/2),dyshift
do ix=(isrx+1)/2,(nx-(isrx-1)/2),dxshift
num=num+1
! print*,num
! xp(num)=float(ix)
! yp(num)=float(iy)
end do
end do
allocate(grille(num,7))
mg=num
ng=1
num=0
do iy=(isry+1)/2,(ny-(isry-1)/2),dyshift
do ix=(isrx+1)/2,(nx-(isrx-1)/2),dxshift
num=num+1
! print*,num
grille(num,1)=float(ix)
grille(num,2)=float(iy)
end do
end do
!goto 124
!print*,'writing grid: ',trim(fgrille)
!open(unit=16,file=fgrille,form='formatted',status='replace',err=10)
!write(16,*) 1,num
!do ix=1,num
! write(16,200) grille(ix,1),grille(ix,2)
!end do
!close(16)
print*,'default grid generated '
else
open(unit=16,file=trim(adjustl(fgrille)),form='formatted',status='old',ACTION='READ' )
Print*,'open user grid',fgrille
read(16,*) mg,ng
! print*,mg,ng
num=mg*ng
allocate(grille(num,7))
do ix=1,num
read(16,*) grille(ix,1),grille(ix,2)
end do
close(16)
endif
goto 124
!10 print*,'can not open ',fgrille
!* formats
200 format(f7.2,2x,f7.2)
124 return
end