#FC=ifort
#FC=/zshare/intel_fce_100/bin/ifort

FC=pgf77

#FCARGS=-O2 -w -m64 -warn all -traceback -g -Bdynamic -assume byterecl -openmp -parallel -pg -shared-intel -mcmodel=medium -132 -lcfitsio

FCARGS=-O2 -w -m64 -traceback -g -Bdynamic -pg -Mextend -mcmodel=medium -lcfitsio

#FCARGS_STATIC=-O2 -w -m64 -Bdynamic -assume byterecl -parallel -i-static -shared-intel -mcmodel=medium -132

FCARGS_STATIC=-O2 -w -m64 -fPIC -Bdynamic -assume byterecl -parallel -i-static -shared-intel -fdefault-integer-8 -mcmodel=medium -Wl,--no-relax -132

SMEIIPSTDFILES=adjustjdcar.f aips_wtf.f arrayloc2.f arri4constant.f arri4copy.f arri4zero.f arri4bad.f\
 bread_wso.f blist_wso_noaa.f blist_nso_noaa.f say_fts.f bfield_get.f bread_wso_noaa.f bread_nso_noaa.f write3d_bbt.f\
 bfield_get_3.f adjust_bf.f get_bbtm_3.f write3d_bbtm_HR_3.f write3d_bbtmBE_HR_3.f extractdvdm_3.f t3d_write_bb_3.f\
 arrr4bad.f arrr4constant.f arrr4copy2.f arrr4copy.f arrr4getminmax.f arrr4mask.f arrr4setminmax.f\
 arrr4timesconstant.f arrr4zero.f arrr8copy.f askchar.f aski4.f asklimit.f askr4.f askr8.f mapreadtimes.f\
 askwhatentry.f askwhat.f askwhatprmpt.f askyn.f badi4.f badr4.f badr8.f baskchar.f bgetlun.f\
 bhosname.f bopenfile.f bstr2dbl.f bstr2flt.f cflt2str.f chidelogical.f cint2str.f convertg2d.f\
 copyvtovdn.f ctime2system.f cvswap.f d2c.f date_doy.f dbl2str.f deneq3.f earth8.f earth.f mapreadsingle.f\
 ecliptic_equator8.f ecliptic_equator.f ecliptic_heliographic8.f ecliptic_heliographic.f arrr4step.f\
 eqkepler.f extractdn_intel.f fileselection.f fillmapl.f fillmapols.f fillmaptn.f fillwholet.f\
 fixmodeltdn.f flint8.f flint.f flipflop.f flt2str.f fncwz.f foreignarg.f foreignfile.f arrr4reverse.f\
 gausslookup.f get2dval.f get3dtval.f get4dval.f get4dval3.f compiler.f gridfill.f\
 gridfillweight.f gridsphere2d.f gridsphere3d.f gtoden.f hlngearth.f hosinquire.f hosorbit.f blist_wso.f\
 iarrr4valuepresent.f iaskchar.f iaskwhatentry.f icheckdirectory.f iclean0.f icleannan.f \
 icompress.f idir2file.f ifile2dir.f ifilepath.f ifltarr.f ifullfragment.f igetlun.f igridscan.f\
 ihidelogical.f ilastfragment.f int2str.f iopen_linux.f iosgunzip.f iparentfragment.f ipsfuncq.f\
 iputfilespec.f ireadproxymapn.f isearch_linux.f isetfilespec.f itopfragment.f itrim.f t3d_read_b.f\
 iuniquename.f iwriteproxymapn.f julian8.f julian.f keplerorbit.f local2ut.f locfirst.f\
 locfirstlen.f loclast.f logmod_linux.f lowercase.f mapgrid.f map_tzero.f mk_d2vn.f write3d_infotd3d.f\
 mkdmaptdn0n.f mkdhmodeltd_in.f mkgmodeltdn.f mklosweightsm.f mkpostd.f mkshiftdn0n.f arrr4interpolate.f\
 mktimes.f mkveltd_check.f mkvmaptdn0n.f mkvmodeltd.f mkvobstd.f n_carrington.f t3d_write_bb.f\
 nrhunt.f  nrinterpol.f  nrpolint.f  nrratint.f  nrspline.f  nrsplint.f blistall.f sort2r4.f\
 splinegridx.f splinegridy.f splinex.f spliney.f arrr4dividebyarrr4.f arrr4total.f indexr4.f arrayloc3.f\
 nrzbrent.f osgetdateandtime.f os_linux.f parserepair.f planetorbit.f point_on_los.f \
 rotated.f rotate.f say.f simpson.f t_gst.f igetdefaultdir.f \
 read_smei8.f smeiread.f smei_orbit_info2.f smei_orbit_time2.f\
 sphereweight.f stereoaorbit.f stereoborbit.f stereoorbit.f stop_here.f readghd.f\
 str2flt_checknext.f str2flt.f str2flt_fmtnumbers.f str2str.f sunnewcomb8.f\
 sunnewcomb.f t3d_get_grid.f t3d_marker.f t3d_marker_num.f t3d_write_nv.f thom_wtf.f time1to2.f\
 time2add.f time2carrington.f time2changeunits.f time2convertunits.f time2day8.f time2day.f\
 time2delta.f time2dow.f time2eclipticheliographic.f time2getorigin.f time2hms.f time2jepoch.f\
 time2local2ut.f time2month.f time2monthstr.f time2round.f time2split.f time2standardize.f\
 time2standardorigin.f time2str.f time2sunnewcomb.f time2system.f time2template.f time2to1.f\
 time2units.f time2ydoy.f time2ymd.f timesmooth.f time2twothousand.f writegoodsourceg.f setgipsy.f readgips8.f\
 ulyssesorbit.f uppercase.f veleq3.f wr2darr.f write3d_infotd3dM.f write3d_infotd3dM_HR.f extractdn.f\
 write3d_infotd3dMBE_HR_3.f write3d_infotd3d_3.f write3d_infotd3dM_3.f extractdvd.f\
 readace8_v.f readace8_d.f readace28_v.f readace28_d.f readwind8_v.f readwind8_d.f readcelias8_v.f readcelias8_d.f \
 readcelias8R_v.f readcelias8R_d.f t3d_write_nv_3.f\
 mkpostd_in.f writelosmapvg_in.f mkvmodeltd_in.f mkgmodeltd_in.f mkdmaptdn0n_in.f mkvmaptdn0n_in.f\
 writegoodsourcev.f writegoodsourceb.f writelosmapvg.f writem_scomp8.f xcvarformat.f mk_base_in.f\
 xmap_obs_pos.f xmap_sc_pos8.f xmap_sc_pos.f extractd3d.f readg.f setlog2dir.f readvipsm8.f\

smeiipstd0n_inp_intel: $(IPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0n_inp_intel $(IPSTDFILES) smeiipstd0n_inp_intel.f

smeiipstd0n_inpv20: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0n_inpv20_intel $(SMEIIPSTDFILES) libcfitsio.a smeiipstd0n_inpv20.f
	
smeiipstd0nhr_inpv20: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0nhr_inpv20_intel $(SMEIIPSTDFILES) smeiipstd0nhr_inpv20.f
	
smeiipstd0nvhr_inpv20: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0nvhr_inpv20_intel $(SMEIIPSTDFILES) smeiipstd0nvhr_inpv20.f

smeiipstd0nvhr_inpv24: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0nvhr_inpv24_intel $(SMEIIPSTDFILES) libcfitsio.a smeiipstd0nvhr_inpv24.f
	
smeiipstd0n_inpv24: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0n_inpv24_intel $(SMEIIPSTDFILES) libcfitsio.a smeiipstd0n_inpv24.f

smeiipstd0nvhrpg_inpv24: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0nvhrpg_inpv24_intel $(SMEIIPSTDFILES) libcfitsio.a smeiipstd0nvhrpg_inpv24.f
	
smeiipstd0npg_inpv24: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0npg_inpv24_intel $(SMEIIPSTDFILES) libcfitsio.a smeiipstd0npg_inpv24.f

smeiipstd0nuhr_inpv20: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0nuhr_inpv20_intel $(SMEIIPSTDFILES) smeiipstd0nuhr_inpv20.f
	
smeiipstd0n_old_inpv20: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0n_old_inpv20_intel $(SMEIIPSTDFILES) smeiipstd0n_old_inpv20.f
	
smeiipstd0nhr_old_inpv20: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o smeiipstd0hr_old_inpv20_intel $(SMEIIPSTDFILES) smeiipstd0nhr_old_inpv20.f

test_file: $(SMEIIPSTDFILES)
	$(FC) $(FCARGS) -o test_intel $(SMEIIPSTDFILES) test.f

ipstd_20n_inp_static: $(IPSTDFILES)
	$(FC) $(FCARGS_STATIC) -o ipstd_20n_inp_intel_static $(SMEIIPSTDFILES) ipstd_20n_inp_mag_v23.f
