2016年9月28日水曜日

20160928

When key_my_trc_iceeco is activated, the run stops here (ocean.output):

 trcdit_wr : write NetCDF passive tracer concentrations at            3 time-step
 ~~~~~~~~~

But when I submit the job with "#PBS -l nodes=1:ppn=12" as opposed to proc=12, then the run went one step further:

 trcdit_wr : write NetCDF passive tracer concentrations at            3 time-step
 ~~~~~~~~~
 trcdii_wr : write NetCDF additional arrays at            3 time-step
 ~~~~~~

Actually, I repeated the run with "#PBS -l nodes=1:ppn=12", but this time it did not reproduce the same result as before, but the same result with 'procs=12' case... very strange.



But still being killed due to 174 seg fault and 78 error (not sure what they mean):

forrtl: severe (174): SIGSEGV, segmentation fault occurred

forrtl: error (78): process killed (SIGTERM)

It seems that this happens at the third time step (I tested with "write" statements).

Maybe I need to ask for more procs? Try with procs=24:

The run went bit further.

Now increase vmem=3000mb:

No further progress.. So I don't think it's the lack of memory/processors.

I will look into MY_TRC again..

2016年9月21日水曜日

interpolating sea ice concentration onto NAA grid

1) Download the ice concentration data from  http://nsidc.org/data/G10010

2) I am only interested in satellite data from 1979 to 2013, so extract data only for that time period:
ncea -F -d time,1549,1968 G10010_SIBT1850_v1.1.nc G10010_SIBT1850_v1.1_HH1979_2013.nc

3) Convert the data into NAA grid using SOSIE:
../bin/sosie.x -f namelist.ice2naa

4) Compute the monthly climatology (ref: http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html):
for k in `seq 1 12`; do `echo "ncra -F -d time_counter,$k,420,12 icecon_G10010_SIBT1850_v1.1-naa_icecon.nc4 $k.nc"`; done

5) Concatenate the climatology for each month into a single file (ref: http://research.jisao.washington.edu/data_sets/nco/#example8):
ncrcat -h [0123456789].nc 1[012].nc icecon_mon_clim.nc


2016年9月10日土曜日

Updated python script for Lana DMS climatology csv to netCDF conversion

The script has been updated to:

  • include the time variable to facilitate the SOSIE interpolation.
  • The order of dimensions are set in a way that ferret would recognize them correctly (time, lat, lon) which gets translated in ferret as (L, J, I).
  • NOTE: read_csv function has a flag header, which should be None for my Mac, but 0 for my office computer in order to extract the correct number of data in row (=180). Not sure why, but they behave differently.
  • included the loop to save all 12 months in one file.


Reference used to develop the script: http://qiita.com/okadate/items/954574a95545b06ca257

csv2nc.py

import netCDF4
from pylab import *
from pandas import read_csv

ncout = netCDF4.Dataset('test.nc','w')

fmonth = ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC']

for x in range(12):
data=array(read_csv('../lana_dms_src/DMSclim_'+fmonth[x]+'.csv',header=0))
if x == 0:
dim0 = size(data,0)
dim1 = size(data,1)
lats_out = 89.5 - 1.0*arange(dim0,dtype='float32')
lons_out = -179.5 + 1.0*arange(dim1,dtype='float32')

ncout.createDimension('latitude',dim0)
ncout.createDimension('longitude',dim1)
ncout.createDimension('time',None)

lats = ncout.createVariable('latitude',dtype('float32').char,('latitude',))
lons = ncout.createVariable('longitude',dtype('float32').char,('longitude',))

lats.units = 'degrees_north'
lons.units = 'degrees_east'
lats[:] = lats_out
lons[:] = lons_out

time = ncout.createVariable('time', dtype('int32').char, ('time',))
time.long_name = 'Climatological Month'
time.units = 'days since 1968-05-23 00:00:00'
time[:] = 1 + arange(len(fmonth),dtype='float32')

dms = ncout.createVariable('DMS',dtype('float32').char,('time','latitude','longitude'))
dms.units =  'nmol L-1'

data_all = empty((len(fmonth),dim0,dim1))
data_all[x,:,:] = data
dms[:,:,:] = data_all
ncout.close()

2016年9月8日木曜日

How to convert the original Lana DMS climatology (in the CSV format) into the netcdf format

I used this script (http://stackoverflow.com/q/22933855) as a reference to create my Python script to convert the CSV formatted Lana DMS climatology (http://www.bodc.ac.uk/solas_integration/implementation_products/group1/dms/) into the netCDF format. Here is my script:

import netCDF4
from pylab import *
from pandas import read_csv

ncout = netCDF4.Dataset('test.nc','w')

data=array(read_csv('../dmsclimatology/DMSclim_APR.csv',header=None))
dim0 = size(data,0)
dim1 = size(data,1)
lats_out = 89.5 - 1.0*arange(dim0,dtype='float32')
lons_out = -179.5 + 1.0*arange(dim1,dtype='float32')

ncout.createDimension('latitude',dim0)
ncout.createDimension('longitude',dim1)

lats = ncout.createVariable('latitude',dtype('float32').char,('latitude',))
lons = ncout.createVariable('longitude',dtype('float32').char,('longitude',))

lats.units = 'degrees_north'
lons.units = 'degrees_east'

lats[:] = lats_out
lons[:] = lons_out

dms = ncout.createVariable('DMS',dtype('float32').char,('latitude','longitude'))

dms.units =  'nmol L-1'

dms[:] = data
ncout.close()

If you want to use this script, you would need to make sure you have those three modules and change the file name associated with the read_csv function to your own.

The output looks like this (on the right) and you can confirm that this is consistent with the published figure (on the left). NOTE: the color bar scales are different, so they don't look exactly the same.





2016年6月7日火曜日

k_dmspd

今の所k_dmspdはバクテリアが行うので光が存在する時はほぼ0になるようにしているがこの場合、k_dmspの数値を上げても氷が解けた後の北極の場合光が24時間存在するためdmspdの濃度が思ったよりも下がらない。
dmspd濃度.k_dmsp=3(左)とk_dmspd=13(右)の場合

光によるk_dmspdの影響をもう一度考え直す必要がありそう。細菌は光に対しそこまで柔じゃないのだろう。