##########################################################################
# Makefile for updating Model DATA FILES; Read it on your own risk...
# Senya Basin, 1996
##########################################################################

DATA_MAP  = arcdat2.map
MODEL_MAP = arctest3.map

MAKE_PICTURES = 1

##########################################################################
default:
	@pmake help

##########################################################################
tau_HEL.x:	$(DATA_MAP)
	remap -x -c mk_taux.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

tau_HEL.y:	$(DATA_MAP)
	remap -x -c mk_tauy.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

tau_DSL.x:	$(DATA_MAP)
	remap -x -c mk_taux.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

tau_DSL.y:	$(DATA_MAP)
	remap -x -c mk_tauy.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

tau_TRN.x:	$(DATA_MAP)
	remap -x -c mk_taux.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

tau_TRN.y:	$(DATA_MAP)
	remap -x -c mk_tauy.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

tau_HEL75.x:	$(DATA_MAP)
	remap -x -c mk_taux.in -r $> -w $@ -i 4 -o $(MAKE_PICTURES)

tau_HEL75.y:	$(DATA_MAP)
	remap -x -c mk_tauy.in -r $> -w $@ -i 4 -o $(MAKE_PICTURES)

#...........................................................................
temp_LEVs:	$(DATA_MAP)
	remap -x -c mk_temp.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

temp_LEVa:	$(DATA_MAP)
	remap -x -c mk_temp.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

salt_LEVs:	$(DATA_MAP)
	remap -x -c mk_salt.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

salt_LEVa:	$(DATA_MAP)
	remap -x -c mk_salt.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

#...........................................................................
sst_LEV:	$(DATA_MAP)
	remap -x -c mk_sst.in -r $> -w $@ -o $(MAKE_PICTURES)

sss_LEV:	$(DATA_MAP)
	remap -x -c mk_sss.in -r $> -w $@ -o $(MAKE_PICTURES)

#...........................................................................
solr_ERBE:	$(DATA_MAP)
	remap -x -c mk_solr.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

solr_ISCCP:	$(DATA_MAP)
	remap -x -c mk_solr.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

solr_ISCCP_M:	$(DATA_MAP)
	remap -x -c mk_solr.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

solr_OSU:	$(DATA_MAP)
	remap -x -c mk_solr.in -r $> -w $@ -i 4 -o $(MAKE_PICTURES)

#...........................................................................
cld_ISCCP:	$(DATA_MAP)
	remap -x -c mk_cld.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

cld_DSilv:	$(DATA_MAP)
	remap -x -c mk_cld.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

cld_OSU:	$(DATA_MAP)
	remap -x -c mk_cld.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

#...........................................................................
uwnd_ECMWF:	$(DATA_MAP)
	remap -x -c mk_uwnd.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

vwnd_ECMWF:	$(DATA_MAP)
	remap -x -c mk_vwnd.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

wnsp_ECMWF:	$(DATA_MAP)
	remap -x -c mk_wnsp.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

uwnd_DSilv:	$(DATA_MAP)
	remap -x -c mk_uwnd.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

vwnd_DSilv:	$(DATA_MAP)
	remap -x -c mk_vwnd.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

wnsp_DSilv:	$(DATA_MAP)
	remap -x -c mk_wnsp.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

uwnd_TREN:	$(DATA_MAP)
	remap -x -c mk_uwnd.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

vwnd_TREN:	$(DATA_MAP)
	remap -x -c mk_vwnd.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

wnsp_TREN:	$(DATA_MAP)
	remap -x -c mk_wnsp.in -r $> -w $@ -i 3 -o $(MAKE_PICTURES)

#...........................................................................
atem_ECMWF:	$(DATA_MAP)
	remap -x -c mk_atem.in -r $> -w $@ -o $(MAKE_PICTURES)

ahum_ECMWF:	$(DATA_MAP)
	remap -x -c mk_ahum.in -r $> -w $@ -o $(MAKE_PICTURES)

prcp_Oberh:	$(DATA_MAP)
	remap -x -c mk_precip.in -r $> -w $@ -i 1 -o $(MAKE_PICTURES)

prcp_DSilv:	$(DATA_MAP)
	remap -x -c mk_precip.in -r $> -w $@ -i 2 -o $(MAKE_PICTURES)

#...........................................................................
bathymetry:	$(DATA_MAP)
	remap -x -c mk_bath.in -r $> -w $@ -o $(MAKE_PICTURES)

#############################################################################
tau:
	@pmake tau_HEL.x tau_HEL.y tau_DSL.x tau_DSL.y tau_TRN.x tau_TRN.y

ts:
	@pmake temp_LEVs
	...
	@pmake salt_LEVs
	...
	@pmake temp_LEVa
	...
	@pmake salt_LEVa
	...
	@pmake sst_LEV	sss_LEV

winds:
	@pmake uwnd_ECMWF vwnd_ECMWF wnsp_ECMWF
#	@pmake uwnd_DSilv vwnd_DSilv wnsp_DSilv
#	@pmake uwnd_TREN  vwnd_TREN  wnsp_TREN

atm:
	@pmake solr_ERBE solr_ISCCP solr_ISCCP_M solr_OSU
	@pmake cld_ISCCP cld_DSilv cld_OSU
	@pmake atem_ECMWF ahum_ECMWF
	@pmake winds
	@pmake prcp_DSilv prcp_Oberh
bath:
	@pmake bathymetry

#############################################################################
data:
	@pmake tau ts atm bath
	...
	@echo "\nData Files have been upgraded..."	

#############################################################################
help:
	@echo ".   use: 'pmake data'"
	@echo ".                - to update ALL data files according to MAPS"
	@echo ".        'pmake tau' - to update Wind Stress data files"
	@echo ".        'pmake ts'  - to update Temperature & Salinity files"
	@echo ".        'pmake atm' - to update Atmospheric forcing data files"
	@echo ".        'pmake tau' - to update Wind Velocities data files"
	@echo ".        'pmake bath'- to update Bathymetry data files"
	@echo ".        'pmake DATA_MAP=file data'"
	@echo ".                - to update data files according to a DATA MAP"
	@echo ".        'pmake MODEL_MAP=file data'"
	@echo ".                - to update data files according to a MODEL MAP"
	@echo ".   use: 'pmake MAKE_PICTURES=1 data' - to generate PS plots"
	@echo ".\n.   Senya Basin, 1996."	

###############################################################################