Skip to content

Commit 813e66f

Browse files
committed
Set units and long_name attributes for BIOS variables
1 parent eea8da2 commit 813e66f

File tree

1 file changed

+200
-0
lines changed

1 file changed

+200
-0
lines changed

Diff for: regrid_aus_05x05_to_005x005.sh

+200
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,22 @@ ncks --overwrite --no-alphabetize -x -v silt \
143143
echo "Append silt variable to output file"
144144
ncks -A -v silt silt.nc ${output_file}
145145

146+
echo "Set silt units attribute"
147+
att_nm='units'
148+
var_nm='silt'
149+
mode='o'
150+
att_type='c'
151+
att_val='1'
152+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
153+
154+
echo "Set silt long_name attribute"
155+
att_nm='long_name'
156+
var_nm='silt'
157+
mode='o'
158+
att_type='c'
159+
att_val='UM soil texture - silt fraction'
160+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
161+
146162
clay_file=${BIOS_PARAM_DIR}/clayfrac1.nc
147163
echo "clay_file: ${clay_file}"
148164

@@ -166,6 +182,22 @@ ncks --overwrite --no-alphabetize -x -v clay \
166182
echo "Append clay variable to output file"
167183
ncks -A -v clay clay.nc ${output_file}
168184

185+
echo "Set clay units attribute"
186+
att_nm='units'
187+
var_nm='clay'
188+
mode='o'
189+
att_type='c'
190+
att_val='1'
191+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
192+
193+
echo "Set clay long_name attribute"
194+
att_nm='long_name'
195+
var_nm='clay'
196+
mode='o'
197+
att_type='c'
198+
att_val='UM soil texture - clay fraction'
199+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
200+
169201
echo "Create sand file"
170202
ncks --overwrite --no-alphabetize silt.nc sand.nc
171203
ncks -A -v clay clay.nc sand.nc
@@ -181,6 +213,22 @@ ncks --overwrite --no-alphabetize -x -v sand \
181213
echo "Append sand variable to output file"
182214
ncks -A -v sand sand.nc ${output_file}
183215

216+
echo "Set sand units attribute"
217+
att_nm='units'
218+
var_nm='sand'
219+
mode='o'
220+
att_type='c'
221+
att_val='1'
222+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
223+
224+
echo "Set sand long_name attribute"
225+
att_nm='long_name'
226+
var_nm='sand'
227+
mode='o'
228+
att_type='c'
229+
att_val='UM soil texture - sand fraction'
230+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
231+
184232
css_file=${BIOS_PARAM_DIR}/csoil1.nc
185233
echo "css_file: ${css_file}"
186234

@@ -204,6 +252,22 @@ ncks --overwrite --no-alphabetize -x -v css \
204252
echo "Append css variable to output file"
205253
ncks -A -v css css.nc ${output_file}
206254

255+
echo "Set css units attribute"
256+
att_nm='units'
257+
var_nm='css'
258+
mode='o'
259+
att_type='c'
260+
att_val='J/kg/K'
261+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
262+
263+
echo "Set css long_name attribute"
264+
att_nm='long_name'
265+
var_nm='css'
266+
mode='o'
267+
att_type='c'
268+
att_val='Soil specific heat capacity'
269+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
270+
207271
sfc_file=${BIOS_PARAM_DIR}/wvol1fc_m3m3.nc
208272
echo "sfc_file: ${sfc_file}"
209273

@@ -227,6 +291,22 @@ ncks --overwrite --no-alphabetize -x -v sfc \
227291
echo "Append sfc variable to output file"
228292
ncks -A -v sfc sfc.nc ${output_file}
229293

294+
echo "Set sfc units attribute"
295+
att_nm='units'
296+
var_nm='sfc'
297+
mode='o'
298+
att_type='c'
299+
att_val='m3 m-3'
300+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
301+
302+
echo "Set sfc long_name attribute"
303+
att_nm='long_name'
304+
var_nm='sfc'
305+
mode='o'
306+
att_type='c'
307+
att_val='VOL SMC AT CRIT PT'
308+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
309+
230310
rhosoil_file=${BIOS_PARAM_DIR}/bulkdens1_kgm3.nc
231311
echo "rhosoil_file: ${rhosoil_file}"
232312

@@ -250,6 +330,22 @@ ncks --overwrite --no-alphabetize -x -v rhosoil \
250330
echo "Append rhosoil variable to output file"
251331
ncks -A -v rhosoil rhosoil.nc ${output_file}
252332

333+
echo "Set rhosoil units attribute"
334+
att_nm='units'
335+
var_nm='rhosoil'
336+
mode='o'
337+
att_type='c'
338+
att_val='kg/m^3'
339+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
340+
341+
echo "Set rhosoil long_name attribute"
342+
att_nm='long_name'
343+
var_nm='rhosoil'
344+
mode='o'
345+
att_type='c'
346+
att_val='SOIL BULK DENSITY'
347+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
348+
253349
bch_file=${BIOS_PARAM_DIR}/b1.nc
254350
echo "bch_file: ${bch_file}"
255351

@@ -278,6 +374,22 @@ ncks --overwrite --no-alphabetize -x -v bch \
278374
echo "Append bch variable to output file"
279375
ncks -A -v bch bch.nc ${output_file}
280376

377+
echo "Set bch units attribute"
378+
att_nm='units'
379+
var_nm='bch'
380+
mode='o'
381+
att_type='c'
382+
att_val='1'
383+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
384+
385+
echo "Set bch long_name attribute"
386+
att_nm='long_name'
387+
var_nm='bch'
388+
mode='o'
389+
att_type='c'
390+
att_val='CLAPP-HORNBERGER B COEFFICIENT'
391+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
392+
281393
hyds_file=${BIOS_PARAM_DIR}/hyk1sat_ms.nc
282394
echo "hyds_file: ${hyds_file}"
283395

@@ -306,6 +418,22 @@ ncks --overwrite --no-alphabetize -x -v hyds \
306418
echo "Append hyds variable to output file"
307419
ncks -A -v hyds hyds.nc ${output_file}
308420

421+
echo "Set hyds units attribute"
422+
att_nm='units'
423+
var_nm='hyds'
424+
mode='o'
425+
att_type='c'
426+
att_val='m/s'
427+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
428+
429+
echo "Set hyds long_name attribute"
430+
att_nm='long_name'
431+
var_nm='hyds'
432+
mode='o'
433+
att_type='c'
434+
att_val='SAT SOIL CONDUCTIVITY'
435+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
436+
309437
ssat_file=${BIOS_PARAM_DIR}/wvol1sat_m3m3.nc
310438
echo "ssat_file: ${ssat_file}"
311439

@@ -334,6 +462,22 @@ ncks --overwrite --no-alphabetize -x -v ssat \
334462
echo "Append ssat variable to output file"
335463
ncks -A -v ssat ssat.nc ${output_file}
336464

465+
echo "Set ssat units attribute"
466+
att_nm='units'
467+
var_nm='ssat'
468+
mode='o'
469+
att_type='c'
470+
att_val='1'
471+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
472+
473+
echo "Set ssat long_name attribute"
474+
att_nm='long_name'
475+
var_nm='ssat'
476+
mode='o'
477+
att_type='c'
478+
att_val='VOL SMC AT SATURATION'
479+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
480+
337481
swilt_file=${BIOS_PARAM_DIR}/wvol1w_m3m3.nc
338482
echo "swilt_file: ${swilt_file}"
339483

@@ -362,6 +506,22 @@ ncks --overwrite --no-alphabetize -x -v swilt \
362506
echo "Append swilt variable to output file"
363507
ncks -A -v swilt swilt.nc ${output_file}
364508

509+
echo "Set swilt units attribute"
510+
att_nm='units'
511+
var_nm='swilt'
512+
mode='o'
513+
att_type='c'
514+
att_val='1'
515+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
516+
517+
echo "Set swilt long_name attribute"
518+
att_nm='long_name'
519+
var_nm='swilt'
520+
mode='o'
521+
att_type='c'
522+
att_val='VOL SMC AT WILTING'
523+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
524+
365525
sucs_file=${BIOS_PARAM_DIR}/psie1_m.nc
366526
echo "sucs_file: ${sucs_file}"
367527

@@ -395,6 +555,22 @@ ncks --overwrite --no-alphabetize -x -v sucs \
395555
echo "Append sucs variable to output file"
396556
ncks -A -v sucs sucs.nc ${output_file}
397557

558+
echo "Set sucs units attribute"
559+
att_nm='units'
560+
var_nm='sucs'
561+
mode='o'
562+
att_type='c'
563+
att_val='m'
564+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
565+
566+
echo "Set sucs long_name attribute"
567+
att_nm='long_name'
568+
var_nm='sucs'
569+
mode='o'
570+
att_type='c'
571+
att_val='SATURATED SOIL WATER SUCTION'
572+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
573+
398574
mvg_file=${BIOS_PARAM_DIR}/nvis5pre1750grp.nc
399575
echo "mvg_file: ${mvg_file}"
400576

@@ -421,6 +597,14 @@ ncks --overwrite --no-alphabetize -x -v mvg \
421597
echo "Append mvg variable to output file"
422598
ncks -A -v mvg mvg.nc ${output_file}
423599

600+
echo "Set mvg long_name attribute"
601+
att_nm='long_name'
602+
var_nm='mvg'
603+
mode='o'
604+
att_type='c'
605+
att_val='NVIS major vegetation group (v5.0)'
606+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
607+
424608
c4frac_file=${BIOS_PARAM_DIR}/c4_grass_frac_cov.nc
425609
echo "c4frac_file: ${c4frac_file}"
426610

@@ -444,6 +628,22 @@ ncks --overwrite --no-alphabetize -x -v c4frac \
444628
echo "Append c4frac variable to output file"
445629
ncks -A -v c4frac c4frac.nc ${output_file}
446630

631+
echo "Set c4frac units attribute"
632+
att_nm='units'
633+
var_nm='c4frac'
634+
mode='o'
635+
att_type='c'
636+
att_val='1'
637+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
638+
639+
echo "Set c4frac long_name attribute"
640+
att_nm='long_name'
641+
var_nm='c4frac'
642+
mode='o'
643+
att_type='c'
644+
att_val='Fractional cover of C4 grass'
645+
ncatted -h -a "${att_nm}","${var_nm}","${mode}","${att_type}","${att_val}" ${output_file}
646+
447647
bios_soil_vars_regex='^clay$|^sand$|^ssat$|^bch$|^css$|^hyds$|^sfc$|^sucs$|^rhosoil$|^silt$|^swilt$'
448648

449649
echo "Add provenance information to BIOS soil parameters"

0 commit comments

Comments
 (0)