Hi all, Miguel was asking for some explanation of this script, and just so the question does not remain unanswered, I'll quote here the answer that one of our colleagues put togehter for him: Hola Miguel, Here are my guesses for what the script does:
The file pisces_pac_5d_1992_JAN_grid_T.nc is in netCDF format and from what follows, contains data about temperature (votemper). This data is on a grid where the x, y, z, and t-axes usually represent longitude, latitude, depth, and time. The i,j,k,l are indices that count along the x,y,z,t axes. So the sea surface temperature SST is votemper[k=1], and votemper[k=1,l=2] is the SST at the second time.
Part of the latitude-longitude grid lies over the land so the data file must contain "missing values" where there cannot be ocean temperatures. Then "msk" is set to 1 where there is water and 0 where there is land
Looking down on the surface of the region and following along a row so that "i" changes, the values of "msk" change from 0 to 1 or 1 to 0 when you cross a coastline. "mask" computes the difference between "msk" at a point and its value at the next point in the "i" direction. "mask" will be ZERO everywhere except at the closest grid points to the land.
This tells ferret to draw the next plot in the left part of the page.
What is drawn is a color contour map of the surface temperature at the second time step.
This is the surface temperature, but set to ZERO everywhere except at that set of gridpoints closest to shore.
Make the next plot at the right of the page
Again for the second timestep, color contour the surface temperature, but only for the strip of points along the coast.
List "sst_alongcoast" along the second line of latitude. This should be ZERO everywhere except the point closest to shore. So this is a bit of a waste - ignore all the zeros but read the only non-zero value.
Add up all the values of "sst_alongcoast" along a line of latitude. Since all the values are zero except the value at the coast, "csst" will be the SST at the coast.
Make a new color contour plot. This will show coastal SST as a function of latitude and time. The plot will replace the earlier one drawn at the right of the page.
Remove any previous copy of the file named mask_coast_pisces00.nc
Make a new file (in netCDF format) and load it with the "mask" variable, which describes where the nearest-to-shore grid points are located. This file can be read in for use in other jobs. Miguel Gonzales wrote: hello steve: |