10 use netcdf,
only: nf90_inq_dimid, nf90_def_dim, nf90_put_att, &
27 character(len=*),
intent(in) :: var_name
43 character(len=*),
intent(in) :: var_name
74 integer(i_llong),
intent(in) :: addl_fields
75 integer(i_llong) :: size_add
114 character(len=*),
intent(in) :: var_name
115 integer(i_byte),
intent(in) :: var_type
116 integer(i_long) :: var_id
119 call nclayer_error(
"Variable already exists for variable attributes!")
122 print *,
"adding var!" 130 print *,
"done adding var!" 138 character(len=*),
intent(in) :: var_name
139 character(len=*),
intent(in) :: attr_name
140 integer(i_byte),
intent(in) :: attr_value
142 integer(i_long) :: var_index
146 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
149 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
151 //
" (If you did add the variable, make sure you lock" &
153 //
" the definitions before calling varattr!) ")
160 character(len=*),
intent(in) :: var_name
161 character(len=*),
intent(in) :: attr_name
162 integer(i_short),
intent(in) :: attr_value
164 integer(i_long) :: var_index
168 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
171 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
173 //
" (If you did add the variable, make sure you lock" &
175 //
" the definitions before calling varattr!) ")
182 character(len=*),
intent(in) :: var_name
183 character(len=*),
intent(in) :: attr_name
184 integer(i_long),
intent(in) :: attr_value
186 integer(i_long) :: var_index
190 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
193 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
195 //
" (If you did add the variable, make sure you lock" &
197 //
" the definitions before calling varattr!) ")
204 character(len=*),
intent(in) :: var_name
205 character(len=*),
intent(in) :: attr_name
206 real(r_single),
intent(in) :: attr_value
208 integer(i_long) :: var_index
212 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
215 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
217 //
" (If you did add the variable, make sure you lock" &
219 //
" the definitions before calling varattr!) ")
226 character(len=*),
intent(in) :: var_name
227 character(len=*),
intent(in) :: attr_name
228 real(r_double),
intent(in) :: attr_value
230 integer(i_long) :: var_index
234 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
237 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
239 //
" (If you did add the variable, make sure you lock" &
241 //
" the definitions before calling varattr!) ")
248 character(len=*),
intent(in) :: var_name
249 character(len=*),
intent(in) :: attr_name
250 character(len=*),
intent(in) :: attr_value
252 integer(i_long) :: var_index
256 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
259 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
261 //
" (If you did add the variable, make sure you lock" &
263 //
" the definitions before calling varattr!) ")
274 character(len=*),
intent(in) :: var_name
275 character(len=*),
intent(in) :: attr_name
276 integer(i_byte),
dimension(:),
intent(in) :: attr_value
278 integer(i_long) :: var_index
282 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
285 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
287 //
" (If you did add the variable, make sure you lock" &
289 //
" the definitions before calling varattr!) ")
296 character(len=*),
intent(in) :: var_name
297 character(len=*),
intent(in) :: attr_name
298 integer(i_short),
dimension(:),
intent(in) :: attr_value
300 integer(i_long) :: var_index
304 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
307 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
309 //
" (If you did add the variable, make sure you lock" &
311 //
" the definitions before calling varattr!) ")
318 character(len=*),
intent(in) :: var_name
319 character(len=*),
intent(in) :: attr_name
320 integer(i_long),
dimension(:),
intent(in) :: attr_value
322 integer(i_long) :: var_index
326 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
329 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
331 //
" (If you did add the variable, make sure you lock" &
333 //
" the definitions before calling varattr!) ")
340 character(len=*),
intent(in) :: var_name
341 character(len=*),
intent(in) :: attr_name
342 real(r_single),
dimension(:),
intent(in) :: attr_value
344 integer(i_long) :: var_index
348 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
351 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
353 //
" (If you did add the variable, make sure you lock" &
355 //
" the definitions before calling varattr!) ")
362 character(len=*),
intent(in) :: var_name
363 character(len=*),
intent(in) :: attr_name
364 real(r_double),
dimension(:),
intent(in) :: attr_value
366 integer(i_long) :: var_index
370 if (var_index == -1)
call nclayer_error(
"Bug! Variable exists but could not lookup index for attr!")
373 call nclayer_error(
"Can't set attribute for a non-existent variable!" &
375 //
" (If you did add the variable, make sure you lock" &
377 //
" the definitions before calling varattr!) ")
subroutine nc_diag_varattr_short_v(var_name, attr_name, attr_value)
logical function nc_diag_varattr_check_var(var_name)
subroutine nc_diag_varattr_expand(addl_fields)
subroutine nc_diag_varattr_long_v(var_name, attr_name, attr_value)
integer, parameter, public i_byte
subroutine nc_diag_varattr_short(var_name, attr_name, attr_value)
integer, parameter, public i_long
subroutine nc_diag_varattr_rsingle_v(var_name, attr_name, attr_value)
type(diag_varattr), allocatable diag_varattr_store
subroutine nclayer_check(status)
subroutine nc_diag_varattr_rdouble(var_name, attr_name, attr_value)
subroutine nc_diag_varattr_rsingle(var_name, attr_name, attr_value)
subroutine nc_diag_varattr_string(var_name, attr_name, attr_value)
subroutine nc_diag_varattr_long(var_name, attr_name, attr_value)
subroutine nclayer_warning(warn)
integer, parameter, public i_short
subroutine nc_diag_varattr_add_var(var_name, var_type, var_id)
integer(i_short), parameter nlayer_default_ent
subroutine nc_diag_varattr_rdouble_v(var_name, attr_name, attr_value)
subroutine nclayer_error(err)
integer, parameter, public r_double
subroutine nc_diag_varattr_byte_v(var_name, attr_name, attr_value)
integer, parameter, public r_single
integer, parameter, public i_llong
subroutine nc_diag_varattr_byte(var_name, attr_name, attr_value)
integer function nc_diag_varattr_lookup_var(var_name)
subroutine nc_diag_varattr_make_nobs_dim