犹豫了一下午要不要写点什么,晚上回来还是决定写点吧。 又到了跨年的时候了,2017在印象中过的无比的快。真的是无比的快。记得之前有人解释说,为什么人越长大越觉得时间快,想想小学中学,一个学期四个月都觉得无比漫长,如今一年毫无感觉就结束了。解释说是基数效应,十岁的时候,多过一年,那是生命的十分之一;而25岁的时候,再过一年,也不过是4%的增幅,跟余额宝年化差不多,自然没感觉。 想到了七年前的这个时候,也是坐在床上,当时用着床上书桌,接着网线,也是用着现在的小Y,当时和烨琪一起倒数跨年,两栋宿舍楼,QQ联系,那时还没确定关系。 如今我也是这种状态,不过在南校;烨琪也和我聊着,不过隔着伶仃洋,用着手机。 后来几年,有几次在学校倒数,东校新天地,南校亲新广场,都有。 去年,我在大洋彼岸,16小时时差,一起跨了两次。
去年对我来说,是一个拐点。 从2016年,慢慢关注经济和金融,过去的2017当然投入了更多。 两本对我影响深刻的书:塔勒布《黑天鹅》,Van Tharp《Trade Your Way to Financial Freedom》,思想上对我影响深刻的,反倒是还没有看的塔勒布那本《反脆弱》。 没错,杠铃策略。 2016年还在迷茫挣扎,2017则是明确了自己不想要的,而杠铃策略,给了我最大的启发。 稳定工作应该是保守的一端,而另一端则是激进的机会搜集和备战。 想清楚这些,很多迷茫都迎刃而解;目标明确,接下来就是按部就班操作,焦虑也少了。 想想10年初的目标,现在实现早没什么问题了;如今,可能更多想到的是如何去平衡责任。
说说目标吧。 Van Tharp的规则意识让我明白交易系统是可以机械化操作的,因此也有了写自己交易系统的想法。人性太难克服,随意性,操作瘾性太强。赌多,输多。年末一段时间算是慢慢改掉了坏毛病,看得少了,动的少了,心情起伏也少了。投资以来,总体没亏,年底借了几个标的涨势,今年算勉强跑赢余额宝。大牛市没赚大钱,不过起码没亏。 所以第一个目标就是动手做一个交易系统,ML要上,我只需要概率而已,剩下的交给时间。 第二个目标是完成确保保守端成立,问题不大,但是塔勒布告诉我,不能掉以轻心。plan B还是要有的。 第三个目标算为第二个目标,同时也是Plan B服务,做一套山东半岛预报系统。 第四个目标,也是为第二个服务,完成最低毕业标准。 ML没法立flag了,边学边用吧。很多书要看,看很多书。看书的确能让人思路大开。
听说新年立flag都完成不了,不过我还是信心满满。 知道自己想要什么,也就平和多了,加油!
中午和rds师兄吃饭,再次得出稀缺大于一切的结论,无论怎样,潮水退去时,有所栖倚才会留出反应时间,这当然是极其珍贵的。
打算做一个山东半岛的预报系统,以后也算投名状。
configure尝试选择20. INTEL (ifort/icc): Xeon (SNB with AVX mods)
之后直接执行编译
./compile -j 8 em_real
执行编译过程卡住。更换15. 不包括avx指令集后成功。
编译wps发现无法编译出ungrib,经过多次测试,分别
yum install libpng-devel
yum install jasper-devel
将devel包安装完整后成功。
Updated 2017-12-31
完整namelist.wps
&share
wrf_core = 'ARW',
max_dom = 4,
start_date = '2018-01-05_12:00:00','2018-01-05_12:00:00','2018-01-05_12:00:00','2018-01-05_12:00:00',
end_date = '2018-01-10_12:00:00','2018-01-10_12:00:00','2018-01-10_12:00:00','2018-01-10_12:00:00',
interval_seconds = 21600
active_grid = .true., .true.,.true.,.true.,
subgrid_ratio_x = 1
subgrid_ratio_y = 1
io_form_geogrid = 2,
opt_output_from_geogrid_path = './',
debug_level = 0
/
&geogrid
parent_id = 1, 1, 2, 3,
parent_grid_ratio = 1, 3, 3, 3,
i_parent_start = 1, 140, 80, 140,
j_parent_start = 1, 80, 50, 110,
s_we = 1, 1, 1, 1,
e_we = 300, 241, 301, 301,
s_sn = 1, 1, 1, 1,
e_sn = 220, 202, 283, 301,
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!
! The default datasets used to produce the HGT_M, GREENFRAC,
! and LU_INDEX/LANDUSEF fields have changed in WPS v3.8. The HGT_M field
! is now interpolated from 30-arc-second USGS GMTED2010, the GREENFRAC
! field is interpolated from MODIS FPAR, and the LU_INDEX/LANDUSEF fields
! are interpolated from 21-class MODIS.
!
! To match the output given by the default namelist.wps.all_options
! in WPS v3.7.1, the following setting for geog_data_res may be used:
!
! geog_data_res = 'gtopo_10m+usgs_10m+nesdis_greenfrac+10m','gtopo_2m+usgs_2m+nesdis_greenfrac+2m',
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
geog_data_res = 'default','default','default','default',
dx = 27000,
dy = 27000,
map_proj = 'lambert',
ref_lat = 37.00,
ref_lon = 110.00,
ref_x = 55.0,
ref_y = 35.0,
truelat1 = 30.0,
truelat2 = 60.0,
stand_lon = 110.0,
geog_data_path = '/home/lzhenn/wrf-surface-data/geog'
opt_geogrid_tbl_path = 'geogrid/'
/
geog_data_res = 'modis_lakes+10m','modis_lakes+2m',
geog_data_res = 'usgs_lakes+10m','usgs_lakes+2m',
&ungrib
out_format = 'WPS',
prefix = 'GFS',
/
&metgrid
fg_name = 'GFS', 'SST'
constants_name = './TAVGSFC'
io_form_metgrid = 2,
opt_output_from_metgrid_path = './',
opt_metgrid_tbl_path = 'metgrid/',
process_only_bdy = 5,
/
&mod_levs
press_pa = 201300 , 200100 , 100000 ,
95000 , 90000 ,
85000 , 80000 ,
75000 , 70000 ,
65000 , 60000 ,
55000 , 50000 ,
45000 , 40000 ,
35000 , 30000 ,
25000 , 20000 ,
15000 , 10000 ,
5000 , 1000
/
&plotfmt
ix = 100
jx = 100
ioff = 30
joff = 30
/
domain设置如下:
设置从HKUST ENVR下载GFS输入文件GFS data archive
测试加入gfs的SST数据,参考
http://www2.mmm.ucar.edu/wrf/OnLineTutorial/DATA/SST/index.html
后发现并不能用,出现segfault,之后更改namelist和,对应GFS数据为SST变量Vtable,以及SST前缀,sst问题解决。
met data生成过程一切顺利。
Updated 2018-01-06
根据俊文和海洋局的配置调整namelist.input设置,过程中发现V3.9提供了经过测试的参数化suite,果断采用。CONUS代表北美大陆配置。
调整后real过程出错
5 --- ERROR: If sst_update /= 0, one of the auxinput4_interval settings must be /= 0
6 --- Set auxinput4_interval_s to the same value as interval_seconds (usually a pretty good guess).
修改后,执行过程出现段错误。
测试修改环境变量。
# set WRF
export WRFIO_NCD_LARGE_FILE_SUPPORT=1
export WRF_EM_CORE=1
export NETCDF4=0
ulimit -s unlimited
ulimit -c unlimited
通过第一断点。新错误:
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE: <stdin> LINE: 431
Problems, we cannot have excluded middle data from WPS
-------------------------------------------
application called MPI_Abort(MPI_COMM_WORLD, 1) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=1
:
system msg for write_line failure : Bad file descriptor
将SST Update设置为0后可以顺利执行完real。
执行过程直接出错,有一个gwd_opt设置为1后可行。
顺利执行,但是积分速度奇慢无比,决定采用180s步长,三层嵌套,速度快了很多。 最终采用的wrf namelist.input
&time_control
run_days = 5,
run_hours = 0,
run_minutes = 0,
run_seconds = 0,
start_year = 2018, 2018, 2018, 2018,
start_month = 01, 01, 01, 01,
start_day = 05, 05, 05, 05,
start_hour = 12, 12, 12, 12,
start_minute = 00, 00, 00, 00,
start_second = 00, 00, 00, 00,
end_year = 2018, 2018, 2018, 2018,
end_month = 01, 01, 01, 01,
end_day = 10, 10, 10, 10,
end_hour = 12, 12, 12, 12,
end_minute = 00, 00, 00, 00,
end_second = 00, 00, 00, 00,
interval_seconds = 21600
input_from_file = .true.,.true.,.true.,.true.,
history_interval = 60, 60, 60, 60,
frames_per_outfile = 1000, 1000, 1000, 1000,
restart = .false.,
restart_interval = 5000,
io_form_history = 2
io_form_restart = 2
io_form_input = 2
io_form_auxinput4 = 0
io_form_boundary = 2
auxinput4_interval = 0
debug_level = 0
/
&domains
time_step = 180,
time_step_fract_num = 0,
time_step_fract_den = 1,
max_dom = 3,
e_we = 300, 241, 301, 301,
e_sn = 220, 202, 283, 301,
e_vert = 39, 39, 39, 39,
p_top_requested = 5000,
num_metgrid_levels = 32,
num_metgrid_soil_levels = 4,
eta_levels = 1.0000, 0.9979, 0.9956, 0.9931,
0.9904, 0.9875, 0.9844, 0.9807,
0.9763, 0.9711, 0.9649, 0.9575,
0.9488, 0.9385, 0.9263, 0.9120,
0.8951, 0.8753, 0.8521, 0.8251,
0.7937, 0.7597, 0.7229, 0.6833,
0.6410, 0.5960, 0.5484, 0.4985,
0.4467, 0.3934, 0.3393, 0.2850,
0.2316, 0.1801, 0.1324, 0.0903,
0.0542, 0.0241, 0.0000
dx = 27000, 9000, 3000, 1000,
dy = 27000, 9000, 3000, 1000,
grid_id = 1, 2, 3, 4,
parent_id = 1, 1, 2, 3,
i_parent_start = 1, 140, 80, 140,
j_parent_start = 1, 80, 50, 110,
parent_grid_ratio = 1, 3, 3, 3,
parent_time_step_ratio = 1, 3, 3, 3,
feedback = 0,
smooth_option = 2
/
&physics
physics_suite = 'CONUS'
cu_physics = 6, 6, 0, 0,
radt = 30, 30, 30, 30,
bldt = 0, 0, 0, 0,
cudt = 5, 5, 5, 5,
icloud = 1,
num_soil_layers = 4,
num_land_cat = 21,
sf_urban_physics = 0, 0, 0, 0,
sst_update = 0,
/
&fdda
/
&dynamics
w_damping = 0,
diff_opt = 1, 1, 1, 1,
km_opt = 4, 4, 4, 4,
diff_6th_opt = 0, 0, 0, 0,
diff_6th_factor = 0.12, 0.12, 0.12, 0.12,
base_temp = 290.
damp_opt = 0,
zdamp = 5000., 5000., 5000.,5000.,
dampcoef = 0.2, 0.2, 0.2 0.2
khdif = 0, 0, 0, 0,
kvdif = 0, 0, 0, 0,
non_hydrostatic = .true., .true., .true..true., ,
moist_adv_opt = 1, 1, 1, 1,
scalar_adv_opt = 1, 1, 1, 1,
gwd_opt = 0,
/
&bdy_control
spec_bdy_width = 5,
spec_zone = 1,
relax_zone = 4,
specified = .true., .false.,.false.,.false.,
nested = .false., .true., .true., .true.,
/
&grib2
/
&namelist_quilt
nio_tasks_per_group = 0,
nio_groups = 1,
/
之后crontab配合自动运行脚本,每晚0:45开始执行,利用12Z数据,积分步长120s,尝试做未来5天预报。 自动运行脚本: ``` bash #!/bin/sh
LID=date -d '1 days ago' +%Y%m%d
LID_NLS=date -d '1 days ago' +%Y-%m-%d
LID_NLE=date -d '-4 days ago' +%Y-%m-%d
# 5 days later, for forecast
WPSDIR=/home/lzhenn/package/WPS WRFDIR=/home/lzhenn/array/lzhenn/WRFV3/run LOGFILE=/home/lzhenn/workspace/wrf-sdpwfe/sys-log/${LID}.log GFSDIR=/home/lzhenn/array/lzhenn/gfs_fcst/$LID
默认进入命令行启动
http://blog.topspeedsnail.com/archives/4922
注意16.04用这句:
$sudo systemctl set-default multi-user.target
这是每次开机默认进入命令行模式的方法。单词关闭用
sudo /etc/init.d/lightdm stop
然后遇到了坑爹的linux预装驱动……需要关掉。(谁说ubuntu少折腾来着……)
驱动安装过程这个链接内容比较详细(卸载系统驱动后机器无法完全启动,但是ssh没问题)
http://blog.csdn.net/u012759136/article/details/53355781
照着来没问题了吧,错了……build driver的时候直接说unable……我去
差了下说我下的版本不对,赶紧去重新找(为啥查到的帖子都是那个340.32版本)
http://www.nvidia.com/content/DriverDownload-March2009/confirmation.php?url=/XFree86/Linux-x86_64/384.98/NVIDIA-Linux-x86_64-384.98.run&lang=us&type=GeForce
这里下载17.11的版本
直接运行安装,居然自带了驱动……去死吧……
后面说我有几个库没装好,记录如下
Missing recommended library: libGLU.so
Missing recommended library: libX11.so
Missing recommended library: libXi.so
Missing recommended library: libXmu.so
搜索下直接apt-get搞定
$ sudo apt-getinstall freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
官方参考
https://devtalk.nvidia.com/default/topic/827410/cuda-setup-and-installation/new-installation-of-cuda-7-toolkit-in-ubuntu-12-04-question-about-missing-recommended-libraries-/
重装一遍cuda测试,一并安装了连同cuda的显卡驱动。没有问题。
http://blog.csdn.net/shiorioxy/article/details/52652831
http://blog.csdn.net/jhszh418762259/article/details/52958287
之后写几个配置
环境变量设置
sudo vim ~/.bashrc
在末尾添加
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-8.0/bin:$PATH
保存退出。
然后刷新。
source ~/.bashrc
动态链接库设置
创建文件:
sudo vim /etc/ld.so.conf.d/cuda.conf
写入:/usr/local/cuda/lib64
保存之后使其立即生效:
sudo ldconfig -v
之后是测试sample,网上教程都是进utility编译,表示直接在根目录下编译了,很长时间……但是似乎没有报错退出。
许久之后,安全完成。