/[lmdze]/trunk/IOIPSL/Mathelp/buildop.f
ViewVC logotype

Annotation of /trunk/IOIPSL/Mathelp/buildop.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 104 - (hide annotations)
Thu Sep 4 10:05:52 2014 UTC (9 years, 10 months ago) by guez
File size: 2990 byte(s)
Removed procedure sortvarc0. Called sortvarc with an additional
argument resetvarc instead. (Following LMDZ.) Moved current time
computations and some printing statements from sortvarc to
caldyn. Could then remove arguments itau and time_0 of sortvarc, and
could remove "use dynetat0". Better to keep "dynetat0.f" as a gcm-only
file.

Moved some variables from module ener to module sortvarc.

Split file "mathelp.f" into single-procedure files.

Removed unused argument nadv of adaptdt. Removed dimension arguments
of bernoui.

Removed unused argument nisurf of interfoce_lim. Changed the size of
argument lmt_sst of interfoce_lim from klon to knon. Removed case when
newlmt is false.

dynredem1 is called only once in each run, either ce0l or gcm. So
variable nb in call to nf95_put_var was always 1. Removed variable nb.

Removed dimension arguments of calcul_fluxs. Removed unused arguments
precip_rain, precip_snow, snow of calcul_fluxs. Changed the size of
all the arrays in calcul_fluxs from klon to knon.

Removed dimension arguments of fonte_neige. Changed the size of all
the arrays in fonte_neige from klon to knon.

Changed the size of arguments tsurf and tsurf_new of interfsurf_hq
from klon to knon. Changed the size of argument ptsrf of soil from
klon to knon.

1 guez 104 module buildop_m
2    
3     implicit none
4    
5     contains
6    
7     SUBROUTINE buildop (str, ex_topps, topp, nbops_max, &
8     & missing_val, opps, scal, nbops)
9     !- This subroutine decomposes the input string in the elementary
10     !- functions which need to be applied to the vector of data.
11     !- This vector is represented by X in the string.
12     !- This subroutine is the driver of the decomposition and gets
13     !- the time operation but then call decoop for the other operations
14     !- INPUT
15    
16     !- str : String containing the operations
17     !- ex_toops : The time operations that can be expected
18     !- within the string
19    
20     !- OUTPUT
21    
22     USE errioipsl, ONLY : histerr
23     use decoop_m, only: decoop
24    
25     CHARACTER(LEN=80) :: str
26     CHARACTER(LEN=*) :: ex_topps
27     CHARACTER(LEN=7) :: topp
28     INTEGER :: nbops_max, nbops
29     CHARACTER(LEN=7) :: opps(nbops_max)
30     REAL :: scal(nbops_max), missing_val
31    
32     CHARACTER(LEN=80) :: new_str
33     INTEGER :: leng, ind_opb, ind_clb
34    
35     LOGICAL :: check = .FALSE.
36     !---------------------------------------------------------------------
37     IF (check) WRITE(*, *) 'buildop : Some preliminary cleaning'
38    
39     leng = LEN_TRIM(str)
40     IF ( str(1:1) == '(' .AND. str(leng:leng) == ')' ) THEN
41     str = str(2:leng-1)
42     leng = leng-2
43     ENDIF
44    
45     IF (check) &
46     & WRITE(*, *) 'buildop : Starting to test the various options'
47    
48     IF (leng <= 5 .AND. INDEX(ex_topps, str(1:leng)) > 0) THEN
49     IF (check) WRITE(*, *) 'buildop : Time operation only'
50     nbops = 0
51     topp = str(1:leng)
52     ELSE
53     IF (check) THEN
54     WRITE(*, *) 'buildop : Time operation and something else'
55     ENDIF
56     !--
57     ind_opb = INDEX(str(1:leng), '(')
58     IF (ind_opb > 0) THEN
59     IF (INDEX(ex_topps, str(1:ind_opb-1)) > 0) THEN
60     IF (check) THEN
61     WRITE(*, '(2a)') &
62     & ' buildop : Extract time operation from : ', str
63     ENDIF
64     topp = str(1:ind_opb-1)
65     ind_clb = INDEX(str(1:leng), ')', BACK=.TRUE.)
66     new_str = str(ind_opb+1:ind_clb-1)
67     IF (check) THEN
68     WRITE(*, '(2a, 2I3)') &
69     & ' buildop : Call decoop ', new_str, ind_opb, ind_clb
70     ENDIF
71     CALL decoop (new_str, nbops_max, missing_val, opps, scal, nbops)
72     ELSE
73     CALL histerr(3, 'buildop', &
74     & 'time opperation does not exist', str(1:ind_opb-1), ' ')
75     ENDIF
76     ELSE
77     CALL histerr(3, 'buildop', &
78     & 'some long opperation exists but wihout parenthesis', &
79     & str(1:leng), ' ')
80     ENDIF
81     ENDIF
82    
83     IF (check) THEN
84     DO leng=1, nbops
85     WRITE(*, *) &
86     & 'buildop : i -- opps, scal : ', leng, opps(leng), scal(leng)
87     ENDDO
88     ENDIF
89     !---------------------
90     END SUBROUTINE buildop
91    
92     end module buildop_m

  ViewVC Help
Powered by ViewVC 1.1.21