1 | BEGIN{ |
---|
2 | FS="::" |
---|
3 | toanalyse=0 |
---|
4 | okprintomp=0 |
---|
5 | |
---|
6 | print "! MODULE : livestock_parameters_var " |
---|
7 | print "! " |
---|
8 | print "! CONTACT : orchidee-help _at_ listes.ipsl.fr " |
---|
9 | print "! " |
---|
10 | print "! LICENCE : IPSL (2011) " |
---|
11 | print "! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC " |
---|
12 | print "! " |
---|
13 | print "!>\BRIEF This module contains the variables in function of livestock type (livestock). " |
---|
14 | print "!! " |
---|
15 | print "!! DESCRIPTION: This module contains the declarations for the externalized variables in function of the " |
---|
16 | print "!! livestock type(livestock). \n " |
---|
17 | print "!! The module is already USE in module livestock_parameters. Therefor no need to USE it seperatly except " |
---|
18 | print "!! if the subroutines in module livestock_parameters are not needed.\n " |
---|
19 | print "!! " |
---|
20 | print "!! RECENT CHANGE(S): None " |
---|
21 | print "!! " |
---|
22 | print "!! REFERENCE(S) : None " |
---|
23 | print "!! " |
---|
24 | print "!! SVN : " |
---|
25 | print "!! $HeadURL: $ " |
---|
26 | print "!! $Date: $ " |
---|
27 | print "!! $Revision: $ " |
---|
28 | print "!! \n " |
---|
29 | print "!_ ================================================================================================================================ " |
---|
30 | print " " |
---|
31 | print "MODULE livestock_parameters_var " |
---|
32 | print " " |
---|
33 | print " USE defprec " |
---|
34 | print " " |
---|
35 | print " IMPLICIT NONE " |
---|
36 | |
---|
37 | |
---|
38 | print " INTEGER(i_std), ALLOCATABLE, SAVE, DIMENSION(:) :: livestock_to_lmtc !! Table of conversion : we associate one pft to one metaclass " |
---|
39 | print " !! (1-13, unitless)" |
---|
40 | print "!$OMP THREADPRIVATE(livestock_to_lmtc)" |
---|
41 | print |
---|
42 | print " LOGICAL, SAVE :: l_first_livestock_parameters = .TRUE. !! To keep first call trace of the module (true/false)" |
---|
43 | print "!$OMP THREADPRIVATE(l_first_livestock_parameters)" |
---|
44 | |
---|
45 | } |
---|
46 | { |
---|
47 | if($2!="") |
---|
48 | { |
---|
49 | |
---|
50 | if(toanalyse &&(myvar != "")&& !okprintomp) |
---|
51 | { |
---|
52 | print "!$OMP THREADPRIVATE("myvar")" |
---|
53 | } |
---|
54 | |
---|
55 | okprintomp=0 |
---|
56 | var="echo \""$2"\"|sed -e 's/\=\.\*//'" |
---|
57 | var | getline myvar |
---|
58 | close(var) |
---|
59 | |
---|
60 | var="echo \""myvar"\"|sed -e 's/_lmtc//'" |
---|
61 | var | getline myvar |
---|
62 | close(var) |
---|
63 | |
---|
64 | var="echo \""myvar"\"|sed -e 's/\ //g'" |
---|
65 | var | getline myvar |
---|
66 | close(var) |
---|
67 | |
---|
68 | |
---|
69 | if(myvar=="nlmc") toanalyse=1 |
---|
70 | |
---|
71 | if(myvar=="nlmc") myvar="nlm" |
---|
72 | if(myvar=="LMTC_name") myvar="LIVESTOCK_name" |
---|
73 | |
---|
74 | if(myvar=="nlm") |
---|
75 | { |
---|
76 | declar="echo \""$1"\"|sed -e 's/PARAMETER/SAVE/'" |
---|
77 | declar | getline mydeclar |
---|
78 | close(declar) |
---|
79 | } |
---|
80 | else |
---|
81 | { |
---|
82 | declar="echo \""$1"\"|sed -e 's/PARAMETER/ALLOCATABLE, SAVE/'" |
---|
83 | declar | getline mydeclar |
---|
84 | close(declar) |
---|
85 | } |
---|
86 | declar="echo \""mydeclar"\"|sed -e 's/nlmc/:/'" |
---|
87 | declar | getline mydeclar |
---|
88 | close(declar) |
---|
89 | |
---|
90 | |
---|
91 | comment="echo \""$2"\"|sed -e 's/\\(.*\\)\!!\\(.*\\)/!!\\2/'" |
---|
92 | comment | getline mycomment |
---|
93 | close(comment) |
---|
94 | |
---|
95 | |
---|
96 | if(toanalyse) printf("\n%s %s %s\t%s\n", mydeclar, " :: ",myvar,mycomment) |
---|
97 | } |
---|
98 | else |
---|
99 | { |
---|
100 | comment="echo \""$1"\"|sed -e 's/\ //g'" |
---|
101 | comment | getline mycomment |
---|
102 | close(comment) |
---|
103 | if(substr(mycomment,1,1)=="!") |
---|
104 | { |
---|
105 | if(!okprintomp &&(myvar != "") ) |
---|
106 | { |
---|
107 | print "!$OMP THREADPRIVATE("myvar")" |
---|
108 | okprintomp=1 |
---|
109 | } |
---|
110 | if(toanalyse) print $0 |
---|
111 | } |
---|
112 | else |
---|
113 | { |
---|
114 | comment="echo \""$1"\"|sed -e 's/\\([^!]*\\)\\(.*\\)/\\2/'" |
---|
115 | comment | getline mycomment |
---|
116 | close(comment) |
---|
117 | if(toanalyse &&(mycomment!="")) printf("\t\t\t\t\t\t\t\t%s\n",mycomment) |
---|
118 | } |
---|
119 | } |
---|
120 | } |
---|
121 | END{ |
---|
122 | print "!$OMP THREADPRIVATE("myvar")" |
---|
123 | print "END MODULE livestock_parameters_var" |
---|
124 | } |
---|