2014年2月27日木曜日

今日習ったこと

IPCCレポートでおなじみ、カナダ環境省のカナダ気候モデル・分析センターのCanESM2の場合、1000年間分のシミュレーションを行うのに1年間かかるらしい。

海洋モデルを均衡させるためには4000年分のスピンアップが必要なので4年かかることになる…これにエラーとか加わったらまたやり直し?とか考えるだけで大変だな。。。

アラゴナイトはカルサイト(方解石)より海洋酸性化に敏感。

AMAP(気候変動と北極地域)のビデオはこちらから見れる→http://vimeo.com/amap

pHは地域により季節変動がさまざま。変動が大きいのは湧昇や河口の影響を受ける地域。珊瑚礁が多い地域は日変動が起きる。

2014年2月23日日曜日

モデル開発状況

今日したこと:

  • モデル構図をLucidchartというgoogle driveで扱えるアプリをダウンロードして作成。なかなか使える。
  • closure termをEdmonds & Yool (2002)を参考にして5種類作成。namelistから選択できるようにした。
まだ疑問にあること。その他すべきこと:
  • nitrificationもいくつか試す必要あり。
  • no3とsilicateのrestoringについて理解する必要あり。
  • zo2→nh4について疑問。これはsloppy feedingなのか、それともexcretionなのか?もしexcretionだとしたらgrazingとは比例しないはずなんだが…。
  • プランクトンからアンモニウムへの移動はexcretionとmortalityを両方含めたもの?

2014年2月22日土曜日

沈殿だん&見直し完了。

Ph2, Det, PSiの沈殿パラメタライゼーション完了。ネームリストもアップデートだん。

Steiner et al (2006)で変更された内容をSilicateの深層の値へRestoreする部分以外はimplementation済み。この部分は担当教官に聞く必要あり。NO3も同様。

Nitrificationも変更する必要あり。

変更したら速攻モデル式を論文のmethodsセクションに書くこと。


2014年2月21日金曜日

モデル開発プログレス

今日やったこと:

月曜日に北極海のsecondary productionに詳しい人とミーティングがあるためその準備を兼ねてuvic_ecoの見直し。

Monahan & Denman (2004)とSteiner et al. (2006)に記述されている式と自分のコードを比較して論文のほうに式の順番とか合わせることにした。

今晩のところはP1とP2まで見直し完了。そこでP2とD2の沈殿を書いていなかったことに気づいた。

明日やること:

沈殿(sinking)のコードを書く。

残りのコードの見比べを完了させる。

2014年2月11日火曜日

ncviewをMacにインストールした。

ncviewはnetCDFを扱う人にとってあるとすごく便利なもの。研究室のパソコンには搭載されているんだが自分のmacbookairには入ってない。

公式サイト(上記リンク)ではインストール方法はのってないのでZipファイルをダウンロードしてもどうすればいいのかさっぱり。

でも先日ダウンロードしたMacPortsを使ってコマンドひとつでインストールできた☆

方法は簡単。

MacPortsをインストールしていることを前提に以下のコマンドをターミナルで入力するだけ。

sudo port install ncview

sudoなのでパスワードを入力後、自動ダウンロード&インストール完了。

2014年2月10日月曜日

初両替(¥→$)メモ

インナーハーバーのすぐそばにあるcalforexという両替所。

両替した日時:2014年2月8日午前10:52
両替したレート(円→カナダドル):0.01051
XE.comによる同日時のレート:0.01078
手数料:$3.50

ビクトリア国際空港(ICE - International Currency Exchange)にもあるみたいだし他にも両替できるところGoogle Mapで探したらあったので次はもうちょっと調べてみることにする。

2014年2月2日日曜日

pythonでnetCDF4

macのターミナルでpythonコマンド以外を利用したい場合。。例えばpython2.7やpythonwなど。

そういうときはpythonスクリプトの最初の行に

#!/usr/bin/env python

のかわりに

#!/usr/bin/env python2.7


#!/usr/bin/env pythonw

と入力すればpython以外が扱われる(参照:http://stackoverflow.com/questions/18425379/mac-set-default-python-version-to-3-3)。

これはmac osxのpythonはpython2がデフォルトで搭載されているのでpython3を使いたい人にも便利だと思う。

自分はpython2.7にnetCDF4のモジュールが入っているのでpython2.7を使うことに。

pythonでnetCDFを扱うときは、ターミナルでpython起動後:

import netCDF4

と入力すれば使えるようになる。

その後…

いろいろ調べたり試行錯誤してみたがすんなりとnetcdfを使いこなせるようにならず…。

宿題の期限もあるので結局は慣れてるmatlabを使うことに…

でも、これから地道に勉強していこうと思う。

2014年2月1日土曜日

Pythonを始めた。

matlabは高価で高機能なためそのぶんパソコンのスペースもたくさんとられる。例えば自分のmacbookairに入っていたmatlab 2011はソフトウェアだけで>5GB。

ということでストレージスペースの少ないmacbookairには不向き。

FABMのデベロッパーたちはpythonを推しているらしいので自分もpythonへ移行することに。

以前ブログで話したがmacbookairのターミナル上でpythonを起動してimport PyQt4とするとHomeBrewやMacPortsで二度に渡りPyQt4とPySideをインストールしたにも関わらずエラー文が出てうまくいかなかったがこの原因がわかった。

自分のmacbookairには数種類のpythonがインストールされていた。ターミナルでpythonと売った後にtabを二度打つと:

$ python

python            python2.5-config  python2.7         pythonw2.5
python-config     python2.6         python2.7-config  pythonw2.6
python2.5         python2.6-config  pythonw           pythonw2.7

こんな感じで何種類ものpythonがインストールされてしまっているよう。

そしてもしかしたらPyQt4やPySideといったモジュールはディフォルトのpythonじゃなくて他のバージョンにインストールされているのではないかと考えそれぞれのpythonをターミナルで起動してhelp()→modulesの手順(参照:https://groups.google.com/d/msg/comp.lang.python/TQfB9720m5Q/KIUUrG9wFBsJ)で確認してみるとpython2.7にPyQt4が入っていることがわかった:

$ python2.7
Python 2.7.6 (default, Nov 18 2013, 15:12:51) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help()

Welcome to Python 2.7!  This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://docs.python.org/2.7/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics".  Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given word
such as "spam", type "modules spam".

help> modules

Please wait a moment while I gather a list of all available modules...


** (process:1406): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'

** (process:1406): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'

** (process:1406): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Audio_mac           _lsprof             ftplib              pyexpat
BaseHTTPServer      _markerlib          functools           pygtk
Bastion             _multibytecodec     future_builtins     quopri
CGIHTTPServer       _multiprocessing    gc                  random
Canvas              _osx_support        genericpath         re
Carbon              _pyio               gensuitemodule      readline
CodeWarrior         _random             gestalt             repr
ColorPicker         _scproxy            getopt              resource
ConfigParser        _socket             getpass             rexec
Cookie              _sqlite3            gettext             rfc822
Dialog              _sre                gio                 rlcompleter
DocXMLRPCServer     _ssl                glib                robotparser
EasyDialogs         _strptime           glob                runpy
Explorer            _struct             gobject             sched
FileDialog          _symtable           gps                 select
Finder              _sysconfigdata      grp                 sets
FixTk               _testcapi           gzip                setuptools
FrameWork           _threading_local    hashlib             sgmllib
HTMLParser          _warnings           heapq               sha
IN                  _weakref            hmac                shelve
MacOS               _weakrefset         hotshot             shlex
MimeWriter          abc                 htmlentitydefs      shutil
MiniAEFrame         aepack              htmllib             signal
Nav                 aetools             httplib             sip
Netscape            aetypes             ic                  sipconfig
OSATerminology      aifc                icglue              sipdistutils
PixMapWrapper       antigravity         icopen              site
PyQt4               anydbm              idlelib             smtpd
Queue               applesingle         ihooks              smtplib
ScrolledText        appletrawmain       imaplib             sndhdr
SimpleDialog        appletrunner        imghdr              socket
SimpleHTTPServer    argparse            imp                 sqlite3
SimpleXMLRPCServer  argvemulator        importlib           sre
SocketServer        array               imputil             sre_compile
StdSuites           ast                 inspect             sre_constants
StringIO            asynchat            io                  sre_parse
SystemEvents        asyncore            itertools           ssl
Terminal            atexit              json                stat
Tix                 audiodev            keyword             statvfs
Tkconstants         audioop             lib2to3             string
Tkdnd               autoGIL             libproxy            stringold
Tkinter             base64              libxml2             stringprep
UserDict            bdb                 libxml2mod          strop
UserList            bgenlocations       linecache           struct
UserString          binascii            locale              subprocess
_AE                 binhex              logging             sunau
_AH                 bisect              macerrors           sunaudio
_App                bsddb               macostools          symbol
_CF                 buildtools          macpath             symtable
_CG                 bundlebuilder       macresource         sys
_CarbonEvt          bz2                 macurl2path         sysconfig
_Cm                 cPickle             mailbox             syslog
_Ctl                cProfile            mailcap             tabnanny
_Dlg                cStringIO           markupbase          tarfile
_Drag               cairo               marshal             telnetlib
_Evt                calendar            math                tempfile
_File               cfmfile             md5                 terminalcommand
_Fm                 cgi                 mhlib               termios
_Folder             cgitb               mimetools           test
_Help               chunk               mimetypes           textwrap
_IBCarbon           cmath               mimify              this
_Icn                cmd                 mmap                thread
_LWPCookieJar       code                modulefinder        threading
_Launch             codecs              multifile           time
_List               codeop              multiprocessing     timeit
_Menu               collections         mutex               tkColorChooser
_Mlte               colorsys            netCDF4             tkCommonDialog
_MozillaCookieJar   commands            netCDF4_utils       tkFileDialog
_OSA                compileall          netcdftime          tkFont
_Qd                 compiler            netrc               tkMessageBox
_Qdoffs             contextlib          new                 tkSimpleDialog
_Qt                 cookielib           nis                 toaiff
_Res                copy                nntplib             token
_Scrap              copy_reg            nose                tokenize
_Snd                crypt               ntpath              trace
_TE                 csv                 nturl2path          traceback
_Win                ctypes              numbers             ttk
__builtin__         curses              numpy               tty
__future__          datetime            opcode              turtle
_abcoll             dbhash              operator            types
_ast                dbm                 optparse            unicodedata
_bisect             dbus                os                  unittest
_bsddb              dbus_bindings       os2emxpath          urllib
_builtinSuites      decimal             parser              urllib2
_codecs             difflib             pdb                 urlparse
_codecs_cn          dircache            pickle              user
_codecs_hk          dis                 pickletools         uu
_codecs_iso2022     distutils           pimp                uuid
_codecs_jp          doctest             pipes               videoreader
_codecs_kr          drv_libxml2         pkg_resources       warnings
_codecs_tw          dsextras            pkgutil             wave
_collections        dumbdbm             platform            weakref
_csv                dummy_thread        plistlib            webbrowser
_ctypes             dummy_threading     popen2              whichdb
_ctypes_test        easy_install        poplib              wsgiref
_curses             email               posix               xdrlib
_curses_panel       encodings           posixfile           xml
_dbus_bindings      errno               posixpath           xml2po
_dbus_glib_bindings exceptions          pprint              xmllib
_elementtree        fcntl               profile             xmlrpclib
_functools          filecmp             pstats              xxsubtype
_hashlib            fileinput           pty                 zipfile
_heapq              findertools         pwd                 zipimport
_hotshot            fnmatch             py_compile          zlib
_io                 formatter           pyclbr              
_json               fpformat            pydoc               
_locale             fractions           pydoc_data          

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".

よしこれでPyQt4そしてnetCDF4も使えるということがわかった。一件落着。