Stand With Ukraine

Thursday, October 24, 2013

IT Starz result

Not great but still I think it has to be saved here for my records))

Thursday, August 15, 2013

Correcting netcdf file data and metadata using NCO

Sometimes we get data in netcdf files that do not really conform to the standards used by different tools that were developed for calculating standard properties of the data. Here an example is shown how the files of this type can be easily corrected using NCO and shell:



After having run the script the command `cdo infov fname` should give correct dates, minimum and maximum values (which previously was not the case): Here for comparison I've put the result of the same command on the initial version of the file:

Wednesday, July 24, 2013

Parsing model log file using bash, grep, head, tail and cat ...

In this script you can find an example of using grep with perl regular expressions, mathematical expressions in bash script, array, head and tail and cut (a simplistic text splitting utility for shell).

Friday, May 10, 2013

Bash: select a column from a file

If for example, you have a file with columns separated by spaces and you want to select a column of data from there, say number 9. This is easy to do in shell using the cut command (note that fields are indexed starting from 1):

Sunday, February 10, 2013

make is a very useful tool

I try to use Makefile in my small C or Fortran projects (for java projects I like to use maven with its pom.xml). And the more I get to know it the more I like it. This post shows an example of a Makefile created for a small project that I am trying to maintain and improve. The example demonstrates how to use if, how to compile sources from different directories and gather obtained object files to a common directory, how to avoid caveats using the wildcard function, how to get file name using notdir function. Of course all of this can be found using Google search, StackOverflow and GNU manual, those are my actual sources while creating this make file. Enjoy, and, please, comment if you see ways of improvement.