The file prep.F must set up the horizontal grid. This requires that the domain boundaries and the model resolution be determined. For a realistic North Atlantic run, the model domain is determined by parameters read in from Prep_parm.tag_root. X0DEG and Y0DEG give the longitude and latitude at the center of the grid cell in the lower left extremity of the model. XRDEG and YRDEG give the distance in degrees from the center of the leftmost cell to the center of the rightmost cell and from the center of the southernmost to the center of the northernmost cell, respectively. Because there are I0 grid cells in the east-west direction, the east-west distance DXDEG across each cell is XRDEG/( I0-1) degrees. The north-south distance DYDEG depends on DXDEG and the parameter DYDX, which is read from the Prep_parm.tag_root. DYDX should be set to either 999 or 1. If DYDX is set to 999, then a uniform grid is used with DYDEG = YRDEG/( J0-1). More commonly, when a spherical grid is used, the north-south extent of each grid cell is taken to be proportional to the cosine of latitude so that dy/dx (= cos(phi) DYDEG / DXDEG) is uniform over the model grid. If DYDX is not equal to 999, then it is adjusted to the value required to make ( J0-1) cells extend precisely over the north-south distance YRDEG.
The grid spacing arrays vary only in the Y-direction. The arrays DX( J0) and DY( J0) give the X and Y grid spaces centered on an A-grid point, and the arrays DXV( JP) and DYV( JP) give the X and Y grid spaces centered on a C-grid advective V velocity point. These are shown in Fig. 4. A warning is warrented here. Because the accuracy of the elliptic solver used in DieCAST is reduced if DY is larger than DX, J0 should be chosen large enough that DY is no greater than DX. If J0 is chosen such that DY is greater than DX, the program will print a warning for the user, but it is up to the user to notice this warning and make appropriate adjustments. Either J0/ I0 should be increased or the domain boundaries should be modified such that YRDEG/ XRDEG is decreased.
After the horizontal grid is established, the value of the Coriolis parameter is determined at the mid-latitude of each row of cells and stored in F( J0).