par 30000 set nodoecho * * This is a program to read in MSU matrices and get 218 locational records * It uses the satlat and satlong data directly rather than matrix positions * * Read in satellite positions read(satposcor) satlat satlon * * t2lt refers to a global sample of 1 month's msu data * msub refers to the 218-column matrix of monthly temps * * Dimension of matrix of t2lt data and msu study data matrix *qq Dim t2lt 72 144 Dim msub 264 218 * * * Initialize year Do #=79,100 gen1 year=#-78 gen1 yy=1978+year * * Initialize month ?Do $=1,12 gen1 month=$ * * * Read t2lt data. File is y#m$.txt and is in a 648x16 block * This command reads in data as a 72x144 block corresponding * to the lat-lon grid * sample 1 72 ?Read(/tmp/msudata/y#/m$.txt) m1-m144 * * This step forms a matrix [m1 m2 --- m144] * representing the 144 lon by 72 lat grid distribution * for that year and month * copy m1-m144 t2lt * * Initialize spatial position (runs from 1 to 218) ?Do !=1,218 gen1 position=! * * * Define satellite position and translate into t2lt position * gen1 lat=satlat:! gen1 lon=satlon:! * * This identifies lat/lon position with row, col in t2lt * bearing in mind that t2lt data start in bottom left corner * of the world gen1 t2c=(lon+178.75)/2.5+1 gen1 t2r=(lat+88.75)/2.5+1 * * This identifies month (1--264) and station (1--218) with * position in msub matrix gen1 msur=month+(year-1)*12 gen1 msuc=! * * Pull out satellite data and put into MSU matrix * copy t2lt msub /frow=t2r;t2r fcol=t2c;t2c trow=msur;msur tcol=msuc;msuc * * Iterate spatial position (!) ?endo * * Iterate month ($) ?endo * * Iterate year (#) =print yy endo * * * Write data into a text matrix for verification sample 1 264 * do #=1,4 copy msub mcol# /fcol=#,# endo write(msu1.4) mcol1-mcol4 * * Write data to a dif file sample 1 264 do #=1,218 copy msub mcol# /fcol=#,# endo write(msudata.dif) mcol1-mcol218 /dif stop