11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 use gtool_historyauto_internal, only: initialized, numdims, numvars, &
29 & flag_allvarfixed, gthst_vars, gthstnml, save_mpi_gather, sub_sname
32 use dc_trace, only: beginsub, endsub
34 use dc_message, only: messagenotify
35 use dc_date,
only:
operator(*),
operator(+)
36 use dc_string, only: joinchar
38
39 implicit none
40 logical:: allvar_invalid
41
42
43
44 integer, parameter:: names_limit = 100
45 character(names_limit):: names_invalid
46
47
48
49 character(STRING):: name, units, longname, var_info_str
50 character(TOKEN), pointer:: dims(:) =>null()
51 integer:: msnot_rank
52 integer:: stat, i
53 character(STRING):: cause_c
54 character(*), parameter:: subname = "HistoryAutoAllVarFix"
55 continue
56 call beginsub(subname)
58 cause_c = ""
59
60
61
62
63 if ( .not. initialized ) then
65 cause_c = 'gtool_historyauto'
66 goto 999
67 end if
68
69
70
71
72 if ( flag_allvarfixed ) goto 999
73
74
75
76
77
79 & gthstnml = gthstnml, &
80 & invalid = allvar_invalid, names = names_invalid )
81
82 if ( len_trim(names_invalid) > (names_limit - 5) ) then
83 names_invalid = names_invalid(1:names_limit - 5) // ' ....'
84 end if
85
86 if ( allvar_invalid ) then
88 cause_c = names_invalid
89 call messagenotify( 'W', subname, &
90 & 'names "%c" from NAMELIST "gtool_historyauto_nml" are invalid.', &
91 & c1 = trim(names_invalid) )
92 goto 999
93 end if
94
95
96
97
98 msnot_rank = -1
99 if ( save_mpi_gather ) msnot_rank = 0
100 call messagenotify( 'M', sub_sname, '-------------------------------------------', rank_mpi = msnot_rank )
101 call messagenotify( 'M', sub_sname, '----- Registered variables for output -----', rank_mpi = msnot_rank )
102 call messagenotify( 'M', sub_sname, '-------------------------------------------', rank_mpi = msnot_rank )
103
104 do i = 1, numvars
105 call historyvarinfoinquire( &
106 & varinfo = gthst_vars(i), &
107 & name = name, &
108 & dims = dims, &
109 & longname = longname, &
110 & units = units )
111
112 var_info_str = trim( longname ) // ' [' // &
113 & trim( units ) // '] {' // &
114 & trim( joinchar( dims, ',' ) ) // '}'
115 deallocate( dims )
116
117 call messagenotify( 'M', sub_sname, ' %c (%c)', &
118 & c1 = trim(name), c2 = trim(var_info_str), rank_mpi = msnot_rank )
119
120 end do
121 call messagenotify( 'M', sub_sname, '-----', rank_mpi = msnot_rank )
122
123
124
125
126 if ( .not. flag_allvarfixed ) flag_allvarfixed = .true.
127
128999 continue
129 call storeerror(stat, subname, cause_c = cause_c)
130 call endsub(subname, 'stat=%d', i = (/stat/) )
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public hst_ebadvarname
integer, parameter, public dc_enotinit
integer, parameter, public dc_noerr
Provides kind type parameter values.
integer, parameter, public token
Character length for word, token
integer, parameter, public dp
Double Precision Real number
integer, parameter, public string
Character length for string