Tuesday, October 21, 2014

[GrADS] Environment Variables 环境变量设置

Beginning with GrADS version 2.0.a8, there is only one choice for GrADS_executable, a single, fully-featured build, which is good.

GADDIR Points to the directory containing the supplemental font and map files in the GrADS release package. If GADDIR is not set, GrADS will look in the default location, /usr/local/lib/grads/.

GASCRP Points to a list of directories containing GrADS utility scripts and user scripts. If more than one directory is specified, acceptable delimiters are a space, a semi-colon, colon, or a comma.


For example:
example% setenv GADDIR /ford1/local/lib/grads
example% setenv GASHP $HOME/grads/shapefiles
example% setenv GASCRP "$HOME/grads/scripts /opt/local/share/grads/library"
example% setenv GAUDFT $HOME/grads/udf/table

Friday, October 17, 2014

[Python] introducing Python environments

python是一门语言,和IDE实现无关。
王玄:
只是看代码的话,就只看VIM
需要逐行debug,就PTVS或者PyCharm这种重型IDE
需要画图,测试idea,就上ipython
因此,总的来说,有几个实现方法。
(1) vim-python。用vim,kate等编辑器写script,然后在shell prompt 跑。
(2) ipython。python的interactive shell,在terminal打开,就像一个软件一样。
$ ipython --pylab
$ ipython -qtconsole  *弹出来的是一个窗口

(3) ipython-notebook。python的web-based interactive shell,可以作为作业、present的一个交互手段,出文图方便。
(4) pycharm。IDE,就像matlab一样,可以语法纠错,可以debug。

pygrads是一个更加奇怪的东西……
pygrads一方面,是一个grads+ipython的interactive shell,在terminal打开,也是像一个软件一样。
$ pygrads
ln[1]:ga-> open/o file.ctl
ln[2]:ga-> xx ts

然后就可以像在grads的prompt里面输入各种命令。区别在于:
A. 命令很多简写、替代,需要查grads-pygrads对应表。
B. pygrads 可以导入导出grads的数据,然后再用python的功能。

pygrads另一方面,它却是一个python的library!!!
>>from grads import *
>>ga = GrADS("Bin=/path/opengrads")
>>ga.open("file.ctl")
>>ts = ga.exp("ts")
画图请import pylab,不然画不了。注意不是matplotlib。
>>from pylab import title, savefig
>>clf()
>>ga.pcolor('data')
>>savefig('test.png')

Monday, October 13, 2014

反演方法

Inversion and Assimilation
反演、同化总是被同时提起,那么这两者到底分别指的是什么?
以碳循环为例。
反演一般即是通过大气二氧化碳浓度的观测数据来估算陆地生态系统碳源碳汇的分布信息。
同化则是指通过各种直接、间接的测量方式来获得观测数据。

Forward model

Friday, October 10, 2014

重整旗鼓再开张

不要纠结于一些类似于step change的技术细节。
好好学习python,这个没有什么learning curve,本应更加适合我这种人,请把过去的畏难情绪一笔勾销!!!
技术不是根本问题,但它是瓶颈问题,请务必重视、提高热情、打好基础、好好攻克!

Wednesday, October 1, 2014

C语言手札

Tutorial
1. integer division truncates: any fractional part is discarded.
(int): 5/9 = 0
2. printf (a standard function can be called by C, ANSI standard)
\t, tab; \n, new line
%d  print as decimal integer,
%6d  a least 6 characters wide
%f  floating point
%6f  6 characters wide
%.2f  2 characters after decimal point
%6.2f at least 6 wide, 2 after decimal point

Memory
variable in C++ is a name for a piece of memory that can be used to store information. When a variable is declared, a piece of that memory is set aside for that variable. 
First, there is no guarantee that your variables will be assigned the same memory address each time your program is run. The first time you run your program, x may be assigned to memory location 140. The second time, it may be assigned to memory location 168. Second, when a variable is assigned to a memory location, the value in that memory location is undefined (in other words, whatever value was there last is still there). A variable that has not been assigned a value is called an uninitialized variable. Uninitialized variables are very dangerous because they cause intermittent problems (due to having different values each time you run the program).
A good rule is to always assign values to variables when they are declared.

Function
Typically, when learning C++, you will write a lot of programs that involve 3 subtasks:
  1. Reading inputs from the user
  2. Calculating a value from the inputs
  3. Printing the calculated value

Compile
When addressing compile errors in your programs, always resolve the first error produced first.

Monday, September 22, 2014

[Inverse Methods]paper reading and discussion

1. 关注数据,图与表格的present方式,是否make sense;
2.继续保持先抓主题框架
3. 更加要深入关心作者如何实现(计算,公式里面对应的每一部分),以及这样实现是否会有什么问题。
4.关注(数据、方法的)不确定性。
5. 注意数据
多读几遍。
目前,1,2,3,4至少是不同形式的四遍。只有以后阅读经验上去了,才会越来越快!

Tuesday, September 16, 2014

写作心得

本来觉得这课就是纯靠自己练习,练习,练习,然后有所提高。

但是读了两篇文章之后确实觉得想法有些改变,尤其关于学生/导师关系。关于socialization我觉得我还是太过保守了,单打独斗,而且好胜心强,不肯求助,导致进步很慢!这个我之前从来没有想过,总是很鄙夷那些抄作业的人,但是有点保守太过,连正常的交流都阻碍了,真的很不应该。我觉得是不是应该和justin多讨论一下??

另外就是在这次写英文文章的时候,有了很多感觉,觉得终于可以像中文写作那样去记录点滴想法,然后按照一定结构组织起来。之前没有觉得自己英语写作具有这个能力了,像GRE写作,托福写作,过去都是停留在脚踩西瓜皮,滑到哪算哪的境地,如今终于打破了语言障碍!欢呼!

由于课业负担太重,这门课只能暂时搁下了。但我会继续在这里更新写作心得。