|
Last change
on this file since 3510 was
3210,
checked in by jbclement, 23 months ago
|
|
PEM:
- Addition in the deftank of a bash script "modify_startfi_var.sh" to modify the value of a variable in a "startfi.nc".
- Small corrections due to r3206.
JBC
|
-
Property svn:executable set to
*
|
|
File size:
603 bytes
|
| Line | |
|---|
| 1 | #!/bin/bash |
|---|
| 2 | ####################################################################### |
|---|
| 3 | ### Script to modify the value of a variable in a file "startfi.nc" ### |
|---|
| 4 | ####################################################################### |
|---|
| 5 | |
|---|
| 6 | # Name of the file |
|---|
| 7 | name_file="startfi.nc" |
|---|
| 8 | |
|---|
| 9 | # Name of the variable to be modified |
|---|
| 10 | var_name="co2" |
|---|
| 11 | |
|---|
| 12 | # New value for the variable |
|---|
| 13 | new_var=8. |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | ####################################################################### |
|---|
| 17 | # Update the netCDF file |
|---|
| 18 | ncap2 -O -s "$var_name=$new_var" \ |
|---|
| 19 | $name_file $name_file |
|---|
| 20 | |
|---|
| 21 | echo "In \"$name_file\":" |
|---|
| 22 | echo "New $var_name = $new_var" |
|---|
| 23 | echo "Done!" |
|---|
Note: See
TracBrowser
for help on using the repository browser.