我正在尝试使用fortran将Unix脚本写入文件。但是,它不断提醒我我的格式不正确。我已经这样做了很多次,他们都被成功编译了。这一次,我不知道出了什么问题。我已附上我的代码和有关错误的信息,如果有人能指出我的错误,我将不胜感激。谢谢!!!
subroutine get_gmt(max1,min1,max2,min2,max3,min3,max4,min4)
real*4 max1,min1,max2,min2,max3,min3,max4,min4
real*4 dt1,dt2,dt3,dt4
real*4 dtt1,dtt2,dtt3,dtt4
dt1 = (max1-min1)/2000
dt2 = (max1-min1)/8
open(23,file='plot.gmt')
write(23,100) dt1,dt2,min1,max1,min2
& ,max2,min3,max3,min4,max4
100 format('#!/bin/bash', /
& 'rm tmp?.ps tmp?.cpt',//
& 'set dt1= ',f11.5,/
& 'set dt2= ',f11.5,/
& 'set T1= ',f11.5,/
& 'set T2= ',f11.5,/
& 'set T3= ',f11.5,/
& 'set T4= ',f11.5,/
& 'set T5= ',f11.5,/
& 'set T6= ',f11.5,/
& 'set T7= ',f11.5,/
& 'set T8= ',f11.5,/
& 'psbasemap -R0/360/0/90 -JPa3/0
& -P -Ba40/a10 -V -X6.5 -Y24 -K > tmp.ps',/
& 'surface data.dat -Gtmp.grd -I0.05/0.05
& -R -C100 -T0.35 -N10 -V',//
& 'makecpt -Crainbow -T$T1/$T2/$dt1 -Z -V > tmp.cpt',/
& 'makecpt -Crainbow -T$T1/$T2/$dt2 -Z -V > tmp1.cpt',//
& 'psscale -D-1.25/1.5/3/0.4 -Ctmp1.cpt -L -O -K -A >> tmp.ps',//
& 'grdimage tmp.grd -R -JP -O -Ctmp.cpt -V -K >> tmp.ps',//
& 'gawk ''{print $2,$5,0.5*$3}'' result4.dat | psxy
& -R -JP -K -O -B -V -Sc -N -W0.5,red >> tmp.ps',//
& 'psxyz -R0/2/0/2/0/2 -JX2/2 -JZ2 -E135/30 -Sc0.1
& -W4,red -P -Gred -Bx1 -By1 -Bz1 -BWSneZ
& -N -X-6.0 -K -O <<END>> tmp.ps',/
& '0 0 1',/
& '0 0 0',/
& 'END',//
& 'pstext -R -JX -O -K -JZ -E -W4,red -P -B -N <<END>> tmp.ps',/
& '-0.2 0 0 9 0 15 subevent1',/
& '0 0 1.2 9 0 15 subevent2',/
& 'END',//
& 'gawk ''{print $1,$2}'' time.dat |psxy -R0/360/$T1/$T2 -JX3/3 -P -Ba60/a$dt2
& -V -K -O -Sc0.05 -N -X10.5 -P >> tmp.ps',//
& 'gawk ''{print $2,$5}'' result4.dat |psxy -R
& -JX -K -O -B -V -Sa0.15 -N -W0.5,red
& >> tmp.ps',//
& 'gmtset BASEMAP_AXES = WeSN',/
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $1,$2}'' time1.dat |psxy
& -R0/90/$T1/$T2 -JX3/3 -P -Ba15/a$dt2 -V -K -O
& -Sc0.05 -N -X4.5 >> tmp.ps',//
& 'psbasemap -R0/360/0/90 -JPa3/0 -P
& -Ba40/a10 -V -X-9 -Y-5 -K -O >> tmp.ps',/
& 'surface data1.dat -Gtmp1.grd -I0.1/0.1 -R -C100 -T0 -N10 -V',//
& 'makecpt -Crainbow -T$T3/$T4/$dt1 -Z -V > tmp3.cpt',//
& 'makecpt -Crainbow -T$T3/$T4/$dt2 -Z -V > tmp4.cpt',//
& 'psscale -D-1.25/1.5/3/0.4
& -Ctmp4.cpt -L -O -K -A >> tmp.ps',//
& 'grdimage tmp1.grd -R -JP -O -Ctmp3.cpt -V -K >> tmp.ps',//
& 'gawk ''{print $2,$5,0.5*$3}'' result4.dat |
& psxy -R -JP -K -O -B -V
& -Sc -N -W0.5,red >> tmp.ps',//
& 'psxyz -R0/2/0/2/0/2 -JX2/2 -JZ2 -E135/30
& -Sc0.1 -W4,red -P -Gred -BWSneZ -Bx1 -By1
& -Bz1 -N -X-6.0 -K -O <<END>> tmp.ps',/
& '1 0 0',/
& '0 0 0',/
& 'END',//
& 'gmtset BASEMAP_AXES = WeSN',/
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $1,$2}'' time4.dat |psxy
& -R0/360/$T3/$T4 -JX3/3 -P -Ba60/a$dt2 -V -K -P
& -Sc0.05 -N -X10.5 >> tmp.ps',//
& ‘gmtset BASEMAP_AXES = WeSN',/
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $1,$2}'' time3.dat |psxy
& -R0/90/$T3/$T4 -JX3/3 -P -K -Ba15/a$dt2 -V
& -X4.5 -O -Sc0.05 -N >> tmp.ps',//
& 'psbasemap -R0/360/0/90 -JPa3/0 -P
& -Ba40/a10 -V -X6.5 -Y24 -K > tmp1.ps',/
& 'surface data2.dat -Gtmp2.grd
& -I0.1/0.1 -R -C100 -T0 -N10 -V',//
& 'makecpt -Crainbow -T$T5/$T6/$dt1 -Z -V > tmp5.cpt',/
& 'makecpt -Crainbow -T$T5/$T6/$dt2 -Z -V > tmp6.cpt',//
& 'psscale -D-1.25/1.5/3/0.4
& -Ctmp6.cpt -V -K -O -A -L >> tmp1.ps',//
& 'grdimage tmp2.grd -R -JP -O
& -Ctmp5.cpt -V -K >> tmp1.ps',//
& 'gawk ''{print $2,$5,0.5*$3}'' result4.dat |psxy -R
& -JP -K -O -B -V -Sc -N -W0.5,red
& >> tmp1.ps',/
& 'psxyz -R0/2/0/2/0/2 -JX2/2 -JZ2 -E135/30
& -Sc0.1 -W4,red -P -Gred -Bx1 -By1 -Bz1
& -BWSneZ -N -X-6.0 -K -O <<END>>tmp1.ps',/
& '0 1 0',/
& '0 0 0',/
& 'END',//
& 'gmtset BASEMAP_AXES = WeSN',/
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $1,$2}'' time6.dat |psxy -R0/360/$T5/$T6
& -JX3/3 -P -Ba60/a$dt2 -V
& -X10.5 -K -O -Sc0.05 -N >> tmp1.ps',//
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $1,$2}'' time5.dat |psxy -R0/90/$T5/$T6
& -JX3/3 -P -Ba15/a$dt2 -V
& -X4.5 -O -Sc0.05 -N -K >> tmp1.ps',//
& 'psbasemap -R0/360/0/90 -JPa3/0 -P
& -Ba40/a10 -V -X-9 -Y-5 -K -O >> tmp1.ps',/
& 'surface data3.dat -Gtmp3.grd -I0.1/0.1 -R -C100 -T0 -N10 -V',//
& 'makecpt -Crainbow -T$T7/$T8/$dt1 -Z -V > tmp9.cpt',//
& 'makecpt -Crainbow -T$T7/$T8/$dt2 -Z -V > tmp10.cpt',//
& 'psscale -D-1.25/1.5/3/0.4
& -Ctmp10.cpt -L -O -K -A >> tmp2.ps',//
& 'gawk ''{print $2,$5,$3}'' result4.dat |psxy
& -R -JP -K -O -B -V -Sc0.1 -Ctmp9.cpt -N
& -Gblack >> tmp2.ps',//
& 'BASEMAP_AXES = WeSN',/
& 'FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $2,$3}'' result4.dat |psxy
& -R0/360/$T7/$T8 -JX3/3 -P -Ba60/a$dt2 -V
& -X4.5 -K -O -Sc0.05 -N >> tmp2.ps',//
& 'gmtset BASEMAP_AXES = WeSN',/
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
& 'gawk ''{print $5,$3}'' result4.dat |psxy -R0/90/$T7/$T8
& -JX3/3 -P -Ba15/a$dt2 -V
& -X4.5 -O -Sc0.05 -N >> tmp2.ps')
close(23)
end
它报告了许多错误,但是典型的错误如下:
& 'grdimage tmp.grd -R -JP -O -Ctmp.cpt -V -K >> tmp.ps',//
错误:格式说明符G中的(1)需要正宽度
forward_modeling.f:407:6:
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
1
错误:(1)处的续行错误 forward_modeling.f:407:15:
& 'gmtset FONT_ANNOT_PRIMARY 7p',//
1
错误:(1)名称中的字符无效 forward_modeling.f:410:6:
& -JX3/3 -P -Ba15/a$dt2 -V
1
错误:(1)处的续行错误 错误:(1)处无法分类的语句
forward_modeling.f:285:72:
& ,max2,min3,max3,min4,max4
1
错误:未定义(1)处的FORMAT标签100