[524] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
[5246] | 4 | subroutine inigrads(if,im & |
---|
| 5 | ,x,fx,xmin,xmax,jm,y,ymin,ymax,fy,lm,z,fz & |
---|
| 6 | ,dt,file,titlel) |
---|
[5297] | 7 | USE gradsdef_mod_h |
---|
[5246] | 8 | implicit none |
---|
[524] | 9 | |
---|
[5246] | 10 | integer :: if,im,jm,lm,i,j,l |
---|
| 11 | real :: x(im),y(jm),z(lm),fx,fy,fz,dt |
---|
| 12 | real :: xmin,xmax,ymin,ymax |
---|
[524] | 13 | |
---|
[5246] | 14 | character(len=*),intent(in) :: file |
---|
| 15 | character(len=*),intent(in) :: titlel |
---|
[524] | 16 | |
---|
[5246] | 17 | ! data unit/66,32,34,36,38,40,42,44,46,48/ |
---|
| 18 | integer :: nf |
---|
| 19 | save nf |
---|
| 20 | data nf/0/ |
---|
[524] | 21 | |
---|
[5246] | 22 | unit(1)=66 |
---|
| 23 | unit(2)=32 |
---|
| 24 | unit(3)=34 |
---|
| 25 | unit(4)=36 |
---|
| 26 | unit(5)=38 |
---|
| 27 | unit(6)=40 |
---|
| 28 | unit(7)=42 |
---|
| 29 | unit(8)=44 |
---|
| 30 | unit(9)=46 |
---|
[524] | 31 | |
---|
[5246] | 32 | if (if.le.nf) stop 'verifier les appels a inigrads' |
---|
[524] | 33 | |
---|
[5246] | 34 | print*,'Entree dans inigrads' |
---|
[524] | 35 | |
---|
[5246] | 36 | nf=if |
---|
| 37 | title(if)=titlel |
---|
| 38 | ivar(if)=0 |
---|
[524] | 39 | |
---|
[5246] | 40 | fichier(if)=trim(file) |
---|
[524] | 41 | |
---|
[5246] | 42 | firsttime(if)=.true. |
---|
| 43 | dtime(if)=dt |
---|
[524] | 44 | |
---|
[5246] | 45 | iid(if)=1 |
---|
| 46 | ifd(if)=im |
---|
| 47 | imd(if)=im |
---|
| 48 | do i=1,im |
---|
| 49 | xd(i,if)=x(i)*fx |
---|
| 50 | if(xd(i,if).lt.xmin) iid(if)=i+1 |
---|
| 51 | if(xd(i,if).le.xmax) ifd(if)=i |
---|
| 52 | enddo |
---|
| 53 | print*,'On stoke du point ',iid(if),' a ',ifd(if),' en x' |
---|
[524] | 54 | |
---|
[5246] | 55 | jid(if)=1 |
---|
| 56 | jfd(if)=jm |
---|
| 57 | jmd(if)=jm |
---|
| 58 | do j=1,jm |
---|
| 59 | yd(j,if)=y(j)*fy |
---|
| 60 | if(yd(j,if).gt.ymax) jid(if)=j+1 |
---|
| 61 | if(yd(j,if).ge.ymin) jfd(if)=j |
---|
| 62 | enddo |
---|
| 63 | print*,'On stoke du point ',jid(if),' a ',jfd(if),' en y' |
---|
[524] | 64 | |
---|
[5246] | 65 | print*,'Open de dat' |
---|
| 66 | print*,'file=',file |
---|
| 67 | print*,'fichier(if)=',fichier(if) |
---|
[524] | 68 | |
---|
[5246] | 69 | print*,4*(ifd(if)-iid(if))*(jfd(if)-jid(if)) |
---|
| 70 | print*,trim(file)//'.dat' |
---|
[524] | 71 | |
---|
[5246] | 72 | OPEN (unit(if)+1,FILE=trim(file)//'.dat' & |
---|
| 73 | ,FORM='unformatted', & |
---|
| 74 | ACCESS='direct' & |
---|
| 75 | ,RECL=4*(ifd(if)-iid(if)+1)*(jfd(if)-jid(if)+1)) |
---|
[524] | 76 | |
---|
[5246] | 77 | print*,'Open de dat ok' |
---|
[524] | 78 | |
---|
[5246] | 79 | lmd(if)=lm |
---|
| 80 | do l=1,lm |
---|
| 81 | zd(l,if)=z(l)*fz |
---|
| 82 | enddo |
---|
[524] | 83 | |
---|
[5246] | 84 | irec(if)=0 |
---|
[524] | 85 | |
---|
[5246] | 86 | print*,if,imd(if),jmd(if),lmd(if) |
---|
| 87 | print*,'if,imd(if),jmd(if),lmd(if)' |
---|
[524] | 88 | |
---|
[5246] | 89 | return |
---|
| 90 | end subroutine inigrads |
---|