source: IOIPSL/trunk/example/testopp.f90 @ 16

Last change on this file since 16 was 16, checked in by bellier, 16 years ago

JB: add Id (ommited !)

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1PROGRAM testopp
2!-
3!$Id$
4!---------------------------------------------------------------------
5!- This program allows to test the syntaxic analyzer.
6!---------------------------------------------------------------------
7   USE mathelp
8!-
9   IMPLICIT NONE
10!-
11   INTEGER,PARAMETER :: nbopp_max=10
12   REAL,PARAMETER :: missing_val=1.e20
13!- Please list here all the operation you wish to test.
14!- Do not forget to change the value of nbtest.
15   INTEGER,PARAMETER :: nbtest=3
16   CHARACTER(LEN=30),DIMENSION(nbtest) :: test_opp = &
17  &  (/ "t_max(gather(x*2))            ", &
18  &     "(inst(sqrt(max(X,0)*2.0)))    ", &
19  &     "(once)                        " /)
20!-
21   CHARACTER(LEN=80) :: opp
22   CHARACTER(LEN=50) :: ex_topps = 'ave, inst, t_min, t_max, once'
23   REAL,DIMENSION(nbopp_max) :: tmp_scal
24   CHARACTER(LEN=7),DIMENSION(nbopp_max) :: tmp_sopp
25   CHARACTER(LEN=7) :: tmp_topp
26   INTEGER :: nbopp,i,io
27!---------------------------------------------------------------------
28   DO io=1,nbtest
29     opp = test_opp(io)
30     WRITE(*,*) '-------------------------'
31     WRITE(*,*) ' '
32     WRITE(*,*) 'String to be analyzed : ',TRIM(opp)
33     CALL buildop (opp,ex_topps,tmp_topp,nbopp_max,missing_val, &
34    &              tmp_sopp,tmp_scal,nbopp)
35!-
36     WRITE(*,*) 'Time operation : ',TRIM(tmp_topp)
37     WRITE(*,*) 'Other operations  :', nbopp
38     DO i=1,nbopp
39       WRITE(*,*) 'i = ',i,' opp : ',tmp_sopp(i), &
40      &           ' scalar : ',tmp_scal(i)
41     ENDDO
42   ENDDO
43!------------------
44END PROGRAM testopp
Note: See TracBrowser for help on using the repository browser.