#!/bin/bash

exe=./build/bin/drtp

if [[ ${1} == "benchmark" ]]; then
cat <<- EOF > job.log
	# 输入网格文件
	input-grid = data/benchmark/benchmark_DeltaT
	#grid-para = x,y,z
	# 地磁场平均参数
	mean-geomag = 50/3
EOF
	${exe} job.log && ncview data/benchmark/benchmark_DeltaT_RTP.nc
elif [[ ${1} == "emag" ]]; then
cat <<- EOF > job.log
	# 输入网格文件
	input-grid = data/EMAG2_V3_Cut/EMAG2_V3_Cut
	#grid-para = x,y,z
	# 是否调用geomag计算正常场的倾角与偏角
	call-geomag = no
	# geomag程序地址
	geomag-exe = geomag70_linux/geomag70
	# geomag参数
	geomag-para = 2017,6,15 D M4000.00
	# geomag输出文件
	geomag-output = data/EMAG2_V3_Cut/geomag_EMAG2_V3_Cut.txt
	# IGRF模型
	IGRF = geomag70_linux/IGRF13.COF
	# Taylor展开阶数
	taylor-order = 3
EOF
	${exe} job.log && ncview data/EMAG2_V3_Cut/EMAG2_V3_Cut_DRTP.nc
elif [[ ${1} == "mongolia" ]]; then
cat <<- EOF > job.log
	# 输入网格文件
	input-grid = data/Inner_Mongolia_Cut/air_mag_inner_mongolia_cut.nc
	output-grid = data/Inner_Mongolia_Cut/air_mag_inner_mongolia_cut_DRTP.nc
	grid-para = x,y,deltaT
	# 是否调用geomag计算正常场的倾角与偏角
	call-geomag = yes
	# geomag程序地址
	geomag-exe = geomag70_linux/geomag70
	# geomag参数
	geomag-para = 2019,8,22 D M500
	# geomag输出文件
	geomag-output = data/Inner_Mongolia_Cut/geomag_inner_mongolia_cut.txt
	# IGRF模型
	IGRF = geomag70_linux/IGRF13.COF
	# Taylor展开阶数
	taylor-order = 3
EOF
	${exe} job.log && ncview data/Inner_Mongolia_Cut/air_mag_inner_mongolia_cut_DRTP.nc
fi