01.12.2012 Views

Alternative small scale meteorology input to a chemical transport ...

Alternative small scale meteorology input to a chemical transport ...

Alternative small scale meteorology input to a chemical transport ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

X_CROSS(I,J) = X0 + FLOAT(I)*RESOLN !x of cross points<br />

Y_CROSS(I,J) = Y0 + FLOAT(J)*RESOLN !y of cross points<br />

DELTA(I,J) = (XSSTA(M) - X_CROSS(I,J))**2 !all in meters<br />

& + (YSSTA(M) - Y_CROSS(I,J))**2<br />

C Find the minimum distance from station <strong>to</strong> x/y grid<br />

IF(DELTA(I,J).LT.DELTAMIN) THEN<br />

DELTAMIN = DELTA(I,J)<br />

IMIN = I<br />

JMIN = J<br />

ENDIF<br />

ENDDO<br />

ENDDO<br />

C Assign grid elevation <strong>to</strong> station elevation<br />

ELEV_STA(M) = ELEV(IMIN,JMIN)<br />

ENDDO<br />

C Convert station density <strong>to</strong> sea level<br />

PWR = (GAMMA_A/GAMMA - 1.) !the fac<strong>to</strong>r (gamma_a/gamma-1.)<br />

DO M=1,NSSTA<br />

T0(M) = TEMPK(M) + GAMMA*ELEV_STA(M)<br />

RSTA_0(M)=RHO(M)*((1.-GAMMA*ELEV_STA(M)/T0(M))**(-1.*PWR))<br />

ENDDO<br />

C Inverse squared distance objective analysis<br />

C Loop over the grid points<br />

C Note: X_CROSS(I,J) and Y_CROSS(I,J) already computed above<br />

DO J=1,NY<br />

DO I=1,NX<br />

SUM_DIST2 = 0.0 !Set <strong>to</strong> zero for each cycle<br />

RHO_0(I,J) = 0.0 !Set <strong>to</strong> zero for each cycle<br />

RH_GRD(I,J) = 0.0 !Set <strong>to</strong> zero for each cycle<br />

C Internal loop over the stations<br />

C XSSTA(m),YSSTA(m) are the coordinates of sfc stations<br />

DO M=1,NSSTA<br />

DELTAX2 = (X_CROSS(I,J)-XSSTA(M))*<br />

& (X_CROSS(I,J)-XSSTA(M))<br />

DELTAY2 = (Y_CROSS(I,J)-YSSTA(M))*<br />

& (Y_CROSS(I,J)-YSSTA(M))<br />

D2 = (DELTAX2 + DELTAY2)<br />

C Set minimum squared distance of 0.001<br />

IF (D2.LE.0.001) D2 = 0.001<br />

C Inverse square distance<br />

DIST2 = 1./D2<br />

SUM_DIST2 = SUM_DIST2 + DIST2<br />

RHO_0(I,J) = RHO_0(I,J) + RSTA_0(M)*DIST2<br />

RH_GRD(I,J) = RH_GRD(I,J)+FLOAT(IRH(M))*DIST2<br />

ENDDO<br />

RHO_0(I,J) = RHO_0(I,J)/SUM_DIST2<br />

93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!