2013年11月23日土曜日

Eye Exam・視力検査

大学で加入している医療保険を利用して視力検査をしてメガネを新しく購入した。カレンダーイヤー単位で保険の利用限度は設定されていてEye examは$75、メガネ・コンタクトレンズなどは$200まで毎二年、保険からカバーされることになっている。詳しくはこのブックレット23ページに記述されている。なので今年中に上限を使い果たせばまた二年後に利用できるということ。高い保険料を納めている限りは使えるだけ利用しないとね。

ビクトリア内のショッピングモールにあるメガネ屋さんを回ったっ結果、視力検査はウォルマートが一番安いことがわかった。メガネもブランドとかこだわりないのでウォルマートで購入。

視力検査は85ドル。メガネは一式228㌦(レンズ64.50㌦×2、フレーム99㌦)。

これを保険からひくと自己負担は計$38。ちなみに保険金請求は後なので全額先に自己負担。

視力検査の結果は英語じゃわけわからないのでこちらのウェブサイトで確認した。

ウォルマートのメガネ屋さんの店員さんはとても親切にレンズの種類を説明してくれて保険料を差し引いた自己負担額を正確に教えてくれた。さらにフレーム選びもしてくれてすごく助かった。

2013年11月22日金曜日

Meteo file

meteo.dat is used to calculate surface fluxes in GOTM.

What's in the meteo.dat?

  1. date [yyyy-mm-dd
  2. Time [hh:mm:ss]
  3. zonal wind at 10 m above sea surface (m/s)
  4. meridional wind at 10 m above sea surface (m/s)
  5. Atmospheric pressure at 2 m above sea surface (hPa)
  6. Air temperature at 2 m above sea surface (Celsius)
  7. Relative humidity (%) OR wet bulb temperature (Celsius) OR dew point (Celsius) OR specific humidity (kg/kg)
  8. Cloud cover in 1/10

2013年11月21日木曜日

トロント出張

11月17〜19日の間、研究プロジェクト(NETCARE)の第一回ワークショップのためトロントへ行ってきました。

朝6時半発のフライト(トロントへの直行便はたぶんこの一便)のためシャトルバスでビクトリア空港へ。今回利用したのはYYJ Airport Shuttle。どうやら前の会社(Akal)からこの会社に変わったようです。空港まで片道$29…Akalでは$21で行けていたので残念。しかし聞いてみるとダウンタウン内のホテルからだと片道$24だそうです。15分遅れでSandman Hotel到着。
Sandmanホテルのほうが距離的には近いのに値段が高い。っということを突っ込んで聞いてみるとダウンタウン内ホテルのほうが主要だから〜というような返事が返ってきた。需要が高いから、またはスポンサーになってもらってるんだろうか。とにかく次回利用するとしたら市内バスでダウンタウン内のホテルまで行ってそこから乗ったがいいなと思った。

中部は耕されたプレーリーが広がります。
宿泊先のホテルのすぐそばに建っている教会
トロントピアソン空港到着後、安くダウンタウンへ行きたかったのでバスと地下鉄でホテルまで。行き順は:

  1. 空港一階のバス乗り場から194番のKipling行きのバスに乗車。大人料金$3(学生は$2と書いてあったが学割証みたいなのを提示するみたいなことが書いてあったので大人料金で)。
  2. 15分ぐらい乗車後Kipling駅で降りる(大多数の人がここで降りるのですぐにわかる)。降りたら地下鉄に乗るためエスカレーターで下る(これも大多数について行けばよい)。乗り換えのための切符などは必要ない。
  3. 自分はSpadina駅で降りた。所用約30分。

今回泊まったのは駅からすぐ近く(2ブロックぐらい)のHoliday Inn
Holiday Inn on Bloor Street。ワンベッドルーム。
部屋はきれいで満足。歯ブラシ・歯磨き粉・カミソリなどのは頼めばタダでもらえたらしい。知らずに一階にあるパソコンからの印刷が無料だったので帰りのチケットを印刷した。残念だったところはWifiが遅かったこと(動画ストリーミング)。
バスルームもきれい。

ハードロックカフェ

ダンダススクエアで待ち合わせする人々
ホテル到着後荷物を置いて街の中心地であるダンダススクエアへ。カナダ版タイムズスクエア。

クリスマスライト

ダンダススクエアの向かいにあるイートンセンターというショッピングモールの前にFREE INFO ISLAMという看板を発見→
立ち寄って見ると見覚えのある人が一人誰かと話をしている…
シャイフ・シェハリアだった。NAMFのイマームでセントジョーンズへ今年の1月か2月に来てレクチャーをしてくださった方。まさにイッツ・ア・スモール・ワールドという感じ。元気そうで何より。
いくつかのチームを作って毎日ストリート・ダァワ(路上布教活動)を行っているらしい。ビクトリアでも始めたいと思った。
イートンセンター前でダァワを行うトロント在住のムスリムの方達

Faculty Club
ワークショップはトロント大学で二日間あった。
二階に礼拝室がある建物。Faculty Clubのすぐそば。
町中を走るケーブルカー。

ネットケアミーティング

以下メモ:

Northern Scientific Training Program
カナダ国内の大学院生の北極圏での研究を資金援助。来年度(2014−2015)応募締め切りは12月。よくある質問のページを見てみると対象はカナダ国籍又は永住権を持った学生のみらしい…残念!

AEROCOM
CMIPの大気エアロゾルモデル版のようなもの。現段階では季節性を再現することも難しいらしい。参照:Shindel et al., 2008

Browse et al., 2012
  • seasonal cycle (processes diagram)
  • fixed the "inverse" seasonal cycle problem
Browse et al., 2013
  • complex response of Arctic CCN to sea-ice retreat
Residence time is inversely proportional to particle size of aerosols.
  • small --> live long
  • big --> live short
SSA (Sea Spray Aerosols)

O'Dowd, 2004 (Nature)
  • looked at sea-salt CCN
  • SSA
    • sea salt
    • organic carbon
      • alkaline
      • hydroxyl
      • ...
  • TOC
    • POC ~10% (P,Z,D,B)
    • DOC ~90%
DOCは海洋から生産されるエアロゾルとしては重要か?だとしたらDOCの大気海洋フラックスをモデルに含めたほうがいい。

Ice & mixed-phase clouds
  • Ice nuclei
    • mineral dust
    • BC
    • Biological particles
    • crystalline salts
    • organic glasses
    • particles in oceans
    • others
Levasseur and Gosselin
  • Under-ice Melosira mats 
  • Arctic MLD ~20 m: easy access of DMS for atmosphere.
  • Diatoms don't have DMSPp-lysis!
  • Two types of marine DMS production (Which type does Arctic ecosystem belong to?)
    • Bloom dominated regime (i.e. DMS is proportional to CHL)
    • Stress-forced regime
彼らが興味があるのは北極の海氷上にできるメルトポンド(表面が太陽光で温められて溶けてできた池)らしくDMS濃度が高いと予測。しかしここで疑問に思うのは栄養塩がどこからやってくるのか。海氷下で起こる藻の繁殖もDMSを大量生産すると考えられている。来年&再来年に航海が計画されている。

DGF (Dehydration Greenhouse Feedback)
GEM-MACH (Global Environment Multiscale-Modeling Air quality and Chemistry)

CanAM4.2
  • Prognostic aerosol microphysics (size distribution)
  • Sulphate, sea salt, mineral dust, hydrophobic and hydrophilic black and organic carbon
Steiner et al., 2012: Time-varying S:N ratio
Chang et al., 2011
  • Aerosol compositon and sources in the central Arctic
  • Organic carbon is significant.
Schmale 2013: Sub-Antarctic marine aerosol: dominant contributions from biogenic sources

Pico (0.2-2 um)
Nano (2-20)
Micro (>20)
Among these algae, nanoalgae seems to be the greatest DMS producer.
The impact of DMS on the climate system depends on the response of the microphysics above.

2013年11月15日金曜日

ブランドストーン

Blundstone(ブランドストーン)というブーツを妻に誕生日(二ヶ月ぐらい早いがw)プレゼントとして買ってもらった☆

タスマニアで生まれたブーツらしい。
 
靴ひもはないがすごくフィットして履き心地がいい。靴ひもが嫌いな自分にはちょうどいい♪
靴底のかかとにSPSというのはShock Protection Systemの略でショック吸収的な役割を果たしてくれるそう(詳しくはこちら)。工事現場で働く人用にこれよりも頑丈に作られたタイプもあるらしい。

ちなみに足のサイズはイギリス式で自分は6.5が合った。でも6.5って25cmやん。年を取るにつれてサイズが小さくなってきているような??高校の頃は26.5cm(カナダでサイズ9)を履きよったとけどな。

値段は高いけど毎日使うものだから質のいいが良いと思う。妻が聞いた話では10年持ちする場合もあるらしい。

さぁ自分のは何年持つかな〜☆

2013年11月14日木曜日

subroutine "do" cannot be renamed.

Since yesterday, I started adding parameters and equations in my code. The compilation was successful, but the output of the model simulation was not promising:

The output (z vs t of DMS) was a constant field with initial value. So the calculation was not done. It turns out that the issue arises from the subroutine where you deal with the RHS of the equation:

In my "dms.F90":  

 subroutine do(self,_ARGUMENTS_DO_)
   class (type_uvic_dms),intent(in) :: self
   _DECLARE_ARGUMENTS_DO_

   real(rk) :: dms

   _LOOP_BEGIN_

   _GET_(self%id_dms,dms)
   dms=dms+2
   _SET_ODE_(self%id_dms,self%q)

   _LOOP_END_

   end subroutine do

I used to name this subroutine "do_dms" as I thought it can be customizable. It seems, however, that it cannot be changed. If I changed to something else other than "do", the computation within the subroutine was not done. Not sure why. Anyway, I will just keep the subroutine name as "do" and not worry about it...

2013年11月13日水曜日

Model development in FABM: Create an empty model

Following the FABM documentation (http://sourceforge.net/apps/mediawiki/fabm/index.php?title=Developing_a_new_biogeochemical_model), I started to develop a DMS model.

I prepared the directories (uvic/dms) and appropriate files (uvic/Makefile, uvic/dms/Makefile, and uvic/dms/dms.F90), and modified few of the core files and then compiled the model........

...Hello Error!

Problem:

./doit

make[2]: Entering directory `~/FABM/fabm-git/src/models/uvic'
Makefile:4: *** missing separator.  Stop.

Solution:

This happened because I used 'spaces' instead of 'tab' for Makefiles in 'src/models/uvic/' and 'src/models/uvic/dms' directories.  ---> fixed it by replacing the 'spaces' with 'tabs'.

Problem:

./doit

make[3]: Entering directory `~/FABM/fabm-git/src/models/uvic/dms'
make[3]: *** No rule to make target `/HOME/hakase/FABM/fabm-git/lib/gotm/GFORTRAN/libfabm_prod.a(uvic_dms.o)', needed by `objs'.  Stop.

Solution:

I compared my 'src/models/uvic/dms/Makefile' with 'src/models/gotm/npzd/Makefile', and found few differences between the two files. Thus, I modified my Makefile following the NPZD Makefile.

vi models/uvic/dms/Makefile

include ../../../Rules.make

OBJS = ${LIBFABM}(dms.o)

DOCSRC = dms.F90

all: objs

${OBJS}: $(FABMBASE)

objs: ${OBJS}
        $(MOVE_MODULES_COMMAND)

doc:    $(DOCSRC)
        $(PROTEX) $(DOCSRC) > ../../../../doc/uvic_dms.tex

clean:
        $(RM) *.o *~

Compilation done successfully. Now I have an empty DMS model :)

One thing I noticed after the compilation of FABM.. If you couple FABM with GOTM, the GOTM executable is deleted after the FABM recompilation. Thus the recompilation of GOTM is also required every time you recompile FABM which makes sense. 

The message below is output of GOTM execution with uvic_dms model, which indicates the model is read successfully:

 Initializing biogeochemical model "uvic_dms"...
 model "uvic_dms" initialized successfully.

2013年11月12日火曜日

タックス

今日郵便受けを開けてみるとCanada revenue agencyから郵便が入っとった。

要約すると2012年度のニューファンドランド州からこれまでもらっていたNLHSTCというタックスの一部を返金してくださいとの内容。

どうやら他の州に引っ越した場合はもらえなくなるらしい。

これまで過去六年間はずっとニューファンドランドに居て毎年四月頃になるとタックスリターンというのをオンラインでやっていて、申請すればいくらか給料や学費や保険で支払っていた税金の一部が戻ってくるんだ~という感じで思っていたんだが今回の件で少し理解度が増したような。

とりあえずNLHSTCというのはニューファンドランド在住の所得の少ない人に与えらるための税金らしい。これを今まで自分はもらっていたということがわかった。

カナダはタックスは州が管理しているので州によって税金の種類が違うみたい。今後のタックス支払いのスケジュールみたいなのが同封されていてBC Climate Action Tax Creditという税金が$115.50と表記されていた。多分これは温暖化やco2対策に積極的なブリティッシュコロンビア州ならではの税金ではなかろうか。

通りでこの州のバスはハイブリッドが多いわけだ。この税金が使われているんだろうな。

2013年11月10日日曜日

git FABM

I am not familiar with 'git' command, but GOTM and FABM use git to update the models.

Today, I used 'git pull' to check for updated files on FABM and I could see that there are some updates available at least:

~/FABM/fabm-git$ git pull
remote: Counting objects: 504, done.
remote: Compressing objects: 100% (399/399), done.
remote: Total 405 (delta 265), reused 0 (delta 0)
Receiving objects: 100% (405/405), 596.49 KiB | 618 KiB/s, done.
Resolving deltas: 100% (265/265), completed with 71 local objects.
From git://fabm.git.sourceforge.net/gitroot/fabm/fabm
   ce042d4..75702b8  master     -> origin/master
Updating ce042d4..75702b8
error: Your local changes to the following files would be overwritten by merge:
src/fabm_types.F90
testcases/0d/run.nml
Please, commit your changes or stash them before you can merge.
Aborting

The message seems to tell me that the two files listed (fabm_types.F90 and run.nml) will be overwritten if I 'git merge'. I edited 'fabm_types.F90' so that the model would be compiled successfully, so I wouldn't want to overwrite it. Thus, I decided to rename these files *_old.* so that I don't lose them. Then I 'git pull' again:

~/FABM/fabm-git$ git pull
Updating ce042d4..75702b8
Fast-forward
 compilers/compiler.FTN                             |   16 +
 compilers/vs2010/fabm-0d.vfproj                    |   15 +-
 compilers/vs2010/fabm-gotm.vfproj                  |   15 +-
 include/standard_variables.h                       |  232 +++++++
 src/Makefile                                       |    9 +-
 src/Rules.make                                     |    8 +
 src/drivers/0d/fabm0d.F90                          |   55 +-
 src/drivers/gotm/Makefile                          |   11 +-
 src/drivers/mossco/Makefile                        |    9 +-
 src/fabm.F90                                       |  167 ++++-
 src/fabm_expressions.F90                           |  123 ++++
 src/fabm_library.F90                               |    8 +
 src/fabm_standard_variables.F90                    |  193 +-----
 src/fabm_types.F90                                 |   93 ++-
 src/models/aed/Makefile                            |    6 +-
 src/models/aed/aed_bacteria.F90                    |    4 +-
 src/models/aed/aed_carbon.F90                      |   16 +-
 src/models/aed/aed_chlorophylla.F90                |    8 +-
 src/models/aed/aed_iron.F90                        |    2 +-
 src/models/aed/aed_nitrogen.F90                    |    6 +-
 src/models/aed/aed_organic_matter.F90              |   26 +-
 src/models/aed/aed_oxygen.F90                      |   18 +-
 src/models/aed/aed_pathogens.F90                   |   18 +-
 src/models/aed/aed_phosphorus.F90                  |   30 +-
 src/models/aed/aed_phytoplankton.F90               |  120 ++--
 src/models/aed/aed_sedflux.F90                     |    2 +-
 src/models/aed/aed_silica.F90                      |    4 +-
 src/models/aed/aed_sulfur.F90                      |    2 +-
 src/models/aed/aed_tracer.F90                      |    6 +-
 src/models/aed/aed_util.F90                        |    8 +-
 src/models/aed/aed_viruses.F90                     |    4 +-
 src/models/aed/aed_zooplankton.F90                 |   70 +--
 src/models/au/prey_predator/Makefile               |    2 +
 src/models/au/prey_predator/prey_predator.F90      |    4 +-
 src/models/bb/Makefile                             |    1 +
 src/models/bb/filter_feeder/Makefile               |   26 +
 src/models/bb/filter_feeder/filter_feeder.F90      |  166 +++++
 src/models/bb/passive/Makefile                     |    2 +
 src/models/examples/Makefile                       |    1 +
 src/models/examples/benthic_predator/Makefile      |    2 +
 .../examples/benthic_predator/benthic_predator.F90 |    2 +-
 src/models/examples/duplicator/Makefile            |    2 +
 src/models/examples/mean/Makefile                  |   26 +
 src/models/examples/mean/mean.F90                  |   84 +++
 src/models/examples/npzd/Makefile                  |    2 +
 src/models/examples/npzd/phy.F90                   |   10 +-
 src/models/examples/npzd/zoo.F90                   |    8 +-
 src/models/examples/npzd_f2003/Makefile            |    2 +
 src/models/examples/npzd_f2003/npzd_f2003.F90      |   12 +-
 src/models/gotm/Makefile                           |    1 +
 src/models/{iow => gotm}/ergom/Makefile            |    7 +-
 src/models/{iow => gotm}/ergom/ergom.F90           |  638 +++++++-------------
 src/models/gotm/fasham/Makefile                    |    2 +
 src/models/gotm/fasham/fasham.F90                  |    2 +-
 src/models/gotm/npzd/Makefile                      |    2 +
 src/models/gotm/npzd/npzd.F90                      |   10 +-
 src/models/hzg/omexdia_p/Makefile                  |    2 +
 src/models/hzg/omexdia_p/omexdia_p.F90             |   20 +-
 src/models/iow/Makefile                            |    3 +-
 src/models/iow/spm/Makefile                        |    2 +
 src/models/iow/spm/spm.F90                         |  550 ++++++++++++++---
 src/models/klimacampus/phy_feedback/Makefile       |    2 +
 .../klimacampus/phy_feedback/phy_feedback.F90      |   14 +-
 src/models/metu/mnemiopsis/Makefile                |    2 +
 src/models/metu/mnemiopsis/mnemiopsis.F90          |   24 +-
 src/models/pml/carbonate/Makefile                  |    2 +
 src/models/pml/carbonate/carbonate.F90             |   10 +-
 src/models/pml/ersem/Makefile                      |    2 +
 src/models/pml/ersem/ersem.F90                     |    8 +-
 testcases/0d/run.nml                               |    1 +
 testcases/fabm-bb-filter_feeder.nml                |   84 +++
 .../{fabm-iow-ergom.nml => fabm-gotm-ergom.nml}    |    4 +-
 .../standard_variables/parse_standard_variables.py |   32 +-
 73 files changed, 2062 insertions(+), 1018 deletions(-)
 create mode 100644 compilers/compiler.FTN
 create mode 100644 include/standard_variables.h
 create mode 100644 src/fabm_expressions.F90
 create mode 100644 src/models/bb/filter_feeder/Makefile
 create mode 100644 src/models/bb/filter_feeder/filter_feeder.F90
 create mode 100644 src/models/examples/mean/Makefile
 create mode 100644 src/models/examples/mean/mean.F90
 rename src/models/{iow => gotm}/ergom/Makefile (71%)
 rename src/models/{iow => gotm}/ergom/ergom.F90 (50%)
 mode change 100644 => 100755 src/models/iow/spm/spm.F90
 create mode 100644 testcases/fabm-bb-filter_feeder.nml
 rename testcases/{fabm-iow-ergom.nml => fabm-gotm-ergom.nml} (99%)

This time, it started updating the model right away and gives me all the details about the update.

I wonder how to update the model without losing my own modification in the code(s) being updated...

2013年11月7日木曜日

[solved!] Strange behaviour with GOTM-FABM-NPZD-OWS_PAPA

1) GOTM problem in temperature output

Different results with the same settings between GOTM 4.0.0 and 4.1.0.
Both models do NOT use T restoring (i.e. restoring time is set to some large value, e.g. 1e15), but the results are significantly different (Fig.1 4.0.0 on right 4.1.0 on left).
Figure 1: SST (bottom) and Time series of temperature in top 250 m


Nevertheless, I decided to restore T for 4.1.0 to fix physics. Now, T is restored alright (Fig.2 left), but the corresponding biology looks so strange (Fig.2 right).
Figure 2: Temperature (left) and Phytoplankton in top 250 m in 4.1.0.
  • no swr.dat is present in 4.0.0.
    • This is because heatflux.dat contains both swr (short wave radiation) and qh (surface heat flux) data.
      • In 4.1.0, two variables are stored in different files swr.data and heatflux.dat.
I FOUND it... 'swr_method=0' was the problem. It should be 'swr_method=2'. Otherwise, no insolation, and no biological response.

The newly obtained results look promising! Temperature looks like the one in the Figure 2 without restoring, and the phytoplankton exists in the new run :D

2013年11月6日水曜日

List of registered FABM models by default

In the current version of FABM, there are 9 models available according to '~/FABM/fabm-git/src/fabm.F90':

   subroutine register_models()
!
! !REVISION HISTORY:
!  Original author(s): Jorn Bruggeman
!EOP
!
!-----------------------------------------------------------------------
!BOC
   ! Start with empty arrays with model identifiers and names.
   allocate(modelids  (0))
   allocate(modelnames(0))

   ! Register specific biogeochemical models.
   call register_model(model_container_id,          '')
   call register_model(gotm_npzd_id,                'gotm_npzd')
   call register_model(gotm_fasham_id,              'gotm_fasham')
   call register_model(metu_mnemiopsis_id,          'metu_mnemiopsis')
   call register_model(pml_ersem_id,                'pml_ersem')
   call register_model(pml_carbonate_id,            'pml_carbonate')
   call register_model(examples_benthic_predator_id,'examples_benthic_predator')
   call register_model(iow_ergom_id,                'iow_ergom')
   call register_model(iow_spm_id,                  'iow_spm')
   call register_model(klimacampus_phy_feedback_id, 'klimacampus_phy_feedback')
   ! ADD_NEW_MODEL_HERE - required

   end subroutine register_models

Those in red are the IDs you would define at the beginning of 'fabm.nml'.

Apparently 'au_prey_predator' is not added in the code while the namelist exists. Perhaps this model is under development?

Obviously, to implement a new model, you need to add a new line with your model name in the above code (better description can probably be found here: http://sourceforge.net/apps/mediawiki/fabm/index.php?title=Developing_a_new_biogeochemical_model).

The namelist files for each of these models can be found in '~/FABM/fabm-git/testcases' except for 'pml_ersem' (I couldn't find the namelist for this model).

Some models such as 'pml_carbonate' may be coupled to 'gotm_npzd' as in the case for '~/FABM/fabm-git/testcases/fabm-npzd-carbonate.nml'. In this configuration, an additional parameter is defined in 'gotm_npzd': 

dic_variable='pml_carbonate_dic'

I believe (and I did not check the model code) that this parameter activates the calculation of DIC concentration within the NPZD model, in which the information is passed onto the carbon cycle model to account for the biological pump. 'pml_carbonate' runs on its own, in which case I think it simulates the physicochemical dynamics only.

Setting a GOTM-FABM configuration with 'ows_papa'

Summary
  • 'make' is sufficient ('make run_all' or 'make ows_papa' did not work).

Details

make run_all

make: *** No rule to make target `run_all'.  Stop.

make ows_papa

make: *** No rule to make target `ows_papa'.  Stop.

make

~/editscenario/editscenario.py --skipvalidation -e nml --schemadir=/HOME/hakase/GOTM/gotm-git/gui.py/schemas/scenario/ ows_papa.xml . --targetversion=gotm-4.1.0
Operating on values file with version gotm-4.1.0.
Exporting values to namelist file(s) /HOME/hakase/GOTM/gotm-git/gotm-cases/ows_papa...

running gotm

gotm 2> log.ows_papa
make: *** [run] Error 127

head log.ows_papa

/bin/sh: 1: gotm: not found

ls

airsea.nml     gotmturb.nml      obs.nml       swr.dat
bio.nml        heatflux.dat      ows_papa.xml     swr_file.dat
fabm.nml       heatflux.dat.kb      README       timestamp
filelist       heatflux_file.dat      seagrass.nml     tprof.dat
gotm       log.ows_papa      sprof.dat        t_prof_file.dat
gotm_fabm.nml  Makefile      s_prof_file.dat
gotmmean.nml   momentumflux.dat       sst.dat
gotmrun.nml    momentumflux_file.dat  sst_file.dat

In addition to the namelist files generated by 'make' command, you need to have two namelist files in red above.

In 'fabm.nml', you provide the parameters for your ecosystem model (for this preliminary run, I copied the Fasham (1990) model from '~/FABM/fabm-git/testcases/fabm-gotm-fasham.nml' and renamed it to 'fabm.nml'. If you want to use more than one model at one run, you can combine the multiple namelist files into one (and name it 'fabm.nml'). In such case, make sure that all the models you want to use for the run are defined at the beginning of the file:

&fabm_nml
   models = 'gotm_fasham','gotm_npzd','gotm_npzd'
/

In the above example, three models will be run with one simulation of GOTM (physical model). The NPZD model in red is added twice since I wanted to run the same model with two different sets of parameters (extremely useful for sensitivity experiments). Refer to '0d' test case for further information.

In 'gotm_fabm.nml', you make several model choices (e.g. ODE scheme, advection scheme, etc.). You obtain this file from '~/FABM/fabm-git/testcases/GOTM/gotm_fabm.nml' and paste in your GOTM working directory (in this case, '~/GOTM/gotm-git/gotm-cases/ows_papa'). Make sure that 'fabm_calc' is set to '.true.' to activate the FABM.

GOTM is now coupled to FABM.              Great!

Finally done! gotm-git (4.1.0) setup

Summary

  • In the developer's version (4.1.0) of GOTM, namelist files must be generated with 'make' command as well as specifying appropriate .xml files ('make run_all' will recognize all the .xml files inside the working directory.
  • To do this, you need 'editscenario.py', which can be obtained by executing 'git clone git://git.bolding-burchard.com/editscenario editscenario' (refer to my previous post)
  • After modifying 'gotm-cases/Rule.make' to address the appropriate path for 'editscenario.py', you should be able to 'make run_all' to generate all the appropriate namelist files.
  • You can 'make namelist' to generate the appropriate .nml files, and then 'make run' to run the model.

Step-by-step

After obtaining 'editscenario.py', which is located in '~/editscenario/', I had to modify 'Rule.make' accordingly to address the correct path for this file (there are two places where 'editscenario.py' is called): 

gotm-cases/Rules.make

        ~/editscenario/editscenario.py --skipvalidation -e nml --schemadir=$(SCHEMADIR) $(setup).xml . --targetversion=gotm-$(ver)

...

scenario:

        ~/editscenario/editscenario.py -e zip --schemadir=$(SCHEMADIR) $(setup).xml $(setup).gotmscenario --targetversion=gotm-$(ver)


make run_all

Generating input files for: kepsilon

ln -sf kepsilon.xml channel.xml && make namelist && make run && mv channel.nc kepsilon.nc && mv log.channel log.kepsilon.channel
make[1]: Entering directory `/HOME/hakase/GOTM/gotm-git/gotm-cases/channel'
~/editscenario/editscenario.py --skipvalidation -e nml --schemadir=/HOME/hakase/GOTM/gotm-git/gui.py/schemas/scenario/ channel.xml . --targetversion=gotm-4.1.0
Operating on values file with version gotm-4.1.0.
Exporting values to namelist file(s) /HOME/hakase/GOTM/gotm-git/gotm-cases/channel...
make[1]: Leaving directory `/HOME/hakase/GOTM/gotm-git/gotm-cases/channel'
make[1]: Entering directory `/HOME/hakase/GOTM/gotm-git/gotm-cases/channel'

running gotm

gotm 2> log.channel
make[1]: *** [run] Error 127
make[1]: Leaving directory `/HOME/hakase/GOTM/gotm-git/gotm-cases/channel'
make: *** [kepsilon] Error 2

I don't know what these errors mean. 'running gotm'? Does the 'make' command start the simulation automatically??

Here is what's inside 'log.channel' file:

/bin/sh: 1: gotm: not found

I am not sure what this means. 'gotm' command was not found in /bin/sh directory? obviously??
---Beginning of Update---
I found where it went wrong. I had to add './' in the file "~/GOTM/gotm-git/gotm-cases/Rules.make":

BEFORE:      gotm 2> log.$(name)
AFTER:         ./gotm 2> log.$(name)

The problem solved for this part. However, I then received the following error message:

make

/bin/sh: 1: Syntax error: Unterminated quoted string
make: *** [all] Error 2

Now I noticed (by staring at '~/GOTM/gotm-git/gotm-cases/Rules.make') that, by 'make', it means 'make all' or 'make namelist run'. Then I decided to do 'make namelist' and 'make run' separately. 

Then guess what? No error was produced. Strange! But problem solved! 
---End of Update---

Anyways, ignoring this error, the 'make run_all' command managed to create all the required namelist files:

ls

airsea.nml   filelist   gotmturb.nml  Makefile   seagrass.nml
bio.nml      gotm   kepsilon.xml  MellorYamada.xml
channel.xml  gotmmean.nml  komega.xml obs.nml
doit     gotmrun.nml   log.channel README

Therefore, I can do './gotm' to start the simulation and it did work (no more errors with airsea.nml!).

2013年11月5日火曜日

Words to memorize from Lesson 1

Dog
Heart
Word
Beloved
Muslim
Eye
Helper
Student
Pen

كَلْبٌ
قَلْبٌ
كَلِمَةٌ
حَبِيبٌ
مُسْلِمٌ
عَينٌ
نَاصِرٌ
مُعَلَّمٌ
قَلَمٌ

Plus, the words listed on page 9-10 of 80% Quranic vocabulary.

Getting there... progress in gotm-git set-up (90% done)

So basically, the namelist files from gotm-4.0.0 test cases cannot be used in the developer's version, which is 4.1.0 currently, because they've added extra parameters in namelist. For example, you can compare the airsea.F90 file between the two versions:

gotm-4.0.0/src/airsea/airsea.F90

! !LOCAL VARIABLES:
   namelist /airsea/ calc_fluxes, &
                     meteo_file, &
                     wet_mode, &
                     heat_method, &
                     const_swr,const_heat, &
                     heatflux_file, &
                     momentum_method, &
                     const_tx,const_ty, &
                     momentumflux_file, &
                     p_e_method,const_p_e,p_e_flux_file, &
                     sst_method, sst_file, &
                     sss_method, sss_file

GOTM/gotm-git/src/airsea/airsea.F90

! !LOCAL VARIABLES:
   namelist /airsea/ calc_fluxes, &
                     fluxes_method, &
                     back_radiation_method, &
                     meteo_file, &
                     wind_factor, &
                     hum_method, &
                     heat_method, &
                     rain_impact, &
                     calc_evaporation, &
                     swr_method,const_swr,swr_file,swr_factor, &
                     const_heat, &
                     heatflux_file, &
                     momentum_method, &
                     const_tx,const_ty, &
                     momentumflux_file, &
                     precip_method,const_precip,precip_file,precip_factor,&
                     sst_method, sst_file, &
                     sss_method, sss_file, &
                     ssuv_method

Clearly, more parameters are added in the latter file. Therefore, I cannot copy and paste the namelist files from gotm-4.0.0 to gotm-git.

I found the thread that had the same problem as mine: https://groups.google.com/d/msg/gotm-users/upXzPAq0S8A/MSFggrFvaGwJ

The tricky part was to understand that, in the newer version (4.1.0), namelist files are generated using 'make' command within the specific test case of interest according to: https://groups.google.com/d/msg/gotm-users/2DeMk6R38uo/sHqA1URVmcoJ

By following this instruction, I get the following error after executing:

make run_all

Generating input files for: kepsilon

ln -sf kepsilon.xml channel.xml && make namelist && make run && mv channel.nc kepsilon.nc && mv log.channel log.kepsilon.channel
make[1]: Entering directory `/HOME/hakase/GOTM/gotm-git/gotm-cases/channel'
editscenario.py --skipvalidation -e nml --schemadir=/HOME/hakase/GOTM/gotm-git/gui.py/schemas/scenario/ channel.xml . --targetversion=gotm-4.1.0
make[1]: editscenario.py: Command not found
make[1]: *** [namelist] Error 127
make[1]: Leaving directory `/HOME/hakase/GOTM/gotm-git/gotm-cases/channel'
make: *** [kepsilon] Error 2

The error first tells me that my computer does not recognize "editscenario.py" command. In the later post of the same thread (https://groups.google.com/d/msg/gotm-users/2DeMk6R38uo/nCQjB-tHAcYJ), I 'git clone' the command (or the python file), then got the following error:

~$ git clone git://bbh.homelinux.net/editscenario
Cloning into 'editscenario'...
fatal: unable to connect to bbh.homelinux.net:
bbh.homelinux.net: Name or service not known

According to this thread, the location of 'editscenario' has been moved: https://groups.google.com/d/msg/getm-users/QB5vUPR6kYA/Rd7w9yjXKeYJ

~$ git clone git://git.bolding-burchard.com/editscenario editscenario
Cloning into 'editscenario'...
remote: Counting objects: 8, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 8 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (8/8), 5.42 KiB, done.
Resolving deltas: 100% (2/2), done.

Alright, it works. I downloaded 'editscenario'.

Make a symbolic link to 'editscenario.py' in bin file, following: https://groups.google.com/d/msg/gotm-users/2DeMk6R38uo/nCQjB-tHAcYJ

This is where I stopped for today.

2013年11月1日金曜日

Implementing Fe limitation in NPZD model

gotm-4.0.0/src/extras/bio/bio_npzd.F90

!HakaseA
   REALTYPE                  :: lfe=0.1
!HakaseZ

!HakaseA
!                      rzn,rdn,rpdu,rpdl,rzd,aa,g2
                      rzn,rdn,rpdu,rpdl,rzd,aa,g2,lfe
!HakaseZ

!HakaseA
!Co-limitation (N and Light)
!   fnp=rmax*min(par/iopt*exp(1.-par/iopt),n/(alpha+n))*(p+p0)
!Co-limitation (N, Light, and Fe)
   fnp=rmax*min(par/iopt*exp(1.-par/iopt),n/(alpha+n),lfe)*(p+p0)
!HakaseZ

Recompile the model (make command in 'src' directory)

Edit 'bio_npzd.nml' to add the new parameter (lfe)

!HakaseA
!  lfe=         Iron limitation term                              [ - ]
!HakaseZ

!HakaseA
  lfe=         0.1
!HakaseZ

Run the model

Test runs memo

Run 0: No iron limitation (where I left off. run with modified parameters and initial conditions)
Run 1: lfe=0.1 (Minimum value used in Denman & Pena 1999; DP99 hereafter)
Run 2: lfe=0.35 (Value used in Run 7 of DP99)
Run 3: lfe=0.2 (Simply selected)
Run 4: lfe=0.15 (Mean value of lfe in Run 1 and Run3)