Mapping files for atmosphere grid FV 4x5 (72x46) and ocean grid gx3v5 Made by Dani Bundy Coleman (bundy@ucar.edu) on Jun 15, 2005. Machine: tempest.ucar.edu (SGI IRIX) /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615/map_fv4x5_to_gx3v5_aave_da_050615.nc /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615/map_fv4x5_to_gx3v5_bilin_da_050615.nc /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615/map_gx3v5_to_fv4x5_aave_da_050615.nc /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615/map_gx3v5_to_fv4x5_bilin_da_050615.nc existing binary for creating mapping files /fis/cgd/cseg/csm/mapping/makemaps/obj.scrip.IRIX64/scrip script to make mapping files (calls above binary) /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615/scrip_make_mapdata.csh script to make atmosphere grid file (used to make mapping files) /fis/cgd/cms/bundy/mapping/scrip1.4/grids/create_finvol.f_050615 Details follow. ---------------------------------------------------------------------- make atm grid file ---------------------------------------------------------------------- tempest:/fis/cgd/cms/bundy/mapping/scrip1.4/grids% Look at inic file showing coordinates we want % ncdump -h /fs/cgd/csm/inputdata/atm/cam2/inic/fv/cami_0000-09-01_4x5_L26_c031217.nc | less Make a local copy to input to grid-making script % ln -s /fs/cgd/csm/inputdata/atm/cam2/inic/fv/cami_0000-09-01_4x5_L26_c031217.nc . Edit /fis/cgd/cms/bundy/mapping/scrip1.4/grids/create_finvol.f with dimensions, names of file, date. Also modify (see below) for extreme cell walls and cell centers. Build % make create_finvol Run (creates grid file) % create_finvol DLON: 5. DLAT: 4. South: changing center -90., -89. South: changing wall -92., -90. North: changing center 90., 89. North: changing wall 92., 89.900000000000006 Archive script % cp create_finvol.f create_finvol.f_050615 Add attribute % ncatted -O -h -a Created_by,global,a,c,"`whoami`, $cwd/create_finvol,`date`" grid_fv4x5_050615.nc ==> modify extreme/ polar cell walls, cell centers Variation this time: the original try for these files had a problem at the north pole. This manifested in a coupled run as a land point at the north pole. It subtly shows up in the atm_to_ocean_aave_test.nc files: as a partial row of exact zero error1 along the north pole, and as a large-area (twice that of surrounding points) in src_grid_area. To correct this, we want to move the cell wall from 90. to something slightly smaller. At first I'll try 89.9 to make sure it will make a difference, then 89.999999 to see if we can get by with that. We want the smallest difference (from 90.) that solves this problem. I will use this README to take notes; it was originally written for 89.9 and then under the test section will be notes on various trys. ** final selection: moved to 89.9999 as the best possible. See try_89.9... notes below for how that was chosen *** Why we mess with the grid: This is done because the FV grids have a cell center at the north and south poles. However, to do the area averaging, we need a cell wall and we don't want to wrap over the poles. The best solution we've found so far is to define the extreme cell walls at the pole. Then we don't want the cell centers to coincide with the cell walls (it is not clear what effect this would have). So we move the extreme cell centers (that should be at the poles) halfway between the poles and the nearest cell wall. The code to do this might not be bullet proof (create_finvol.f) but it is more automated than it used to be c At poles, move grid walls (S: minlat, N: maxlat) to 90. c and make cell center halfway between 90 and the closest grid wall if ( centerlat .eq. 90 ) then oldmaxlat = in_grid_center_lat(j-1) + half*dlat northcenterlat = ( oldmaxlat + 90.) / 2 write(*,*)'North: changing center',centerlat,northcenterlat centerlat = northcenterlat write(*,*)'North: changing wall ',maxlat,90.0_dbl_kind maxlat = 90.0 endif if ( centerlat .eq. -90 ) then oldminlat = in_grid_center_lat(j+1) - half*dlat southcenterlat = ( oldminlat - 90.) / 2 write(*,*)'South: changing center',centerlat,southcenterlat centerlat = southcenterlat write(*,*)'South: changing wall ',minlat,-90.0_dbl_kind minlat = -90.0 endif Check: compare to inic file /fs/cgd/csm/inputdata/atm/cam2/inic/fv/cami_0000-09-01_4x5_L26_c031217.nc The new center point makes sense: ATM: walls 88 84 centers lat/lon lat = 90 86 82 MAPPING: new walls 89.9 88 84 new centers 89 86 ==> Check centers/corners in grid file against inic fileR Check of polar lats against the values in inic. However, we know we've modified things from inic (since we've moved extreme cell centers in). grid_center_lat -89, -86,... 86, 89, 86, 86 ,... 89, 89, grid_center_lon = 0, 5,...355, 0, grid_corner_lat = -90, -90, -88, -88, -88, -88, -84, -84, 84, 84, 88, 88, 88, 88, 89.9, 89.9, grid_corner_lon = -2.5, 2.5, 2.5, -2.5, 2.5, 7.5, 7.5, 2.5, 347.5, 352.5, 352.5, 347.5, 352.5, 357.5, 357.5, 352.5, ---------------------------------------------------------------------- make mapping files Atm grid into the expected place: % cd /fis/cgd/cms/bundy/mapping/grids % ln -s /fis/cgd/cms/bundy/mapping/scrip1.4/grids/grid_fv4x5_050615.nc . Set up here to run script: % mkdir /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615 % cd /fis/cgd/cms/bundy/mapping/makemaps/fv4x5_gx3v5_050615 % cp ../4x5_gx3v5_050525/*.csh . (this was my latest case) (OR % cp /fis/cgd/cseg/csm/mapping/makemaps/Txx_gxNvM_example_scripts/* .() & ! out.test & As expected, the aave integrals are slightly different now. But it is actually smaller than I expected. From file:./map_fv4x5_to_gx3v5_aave_da_050615.nc Grid1 Integral = 17.990441622916947 Grid2 Integral = 17.990441622916876 From file:./map_gx3v5_to_fv4x5_aave_da_050615.nc Grid1 Integral = 17.990750488362035 Grid2 Integral = 17.990750488362018 Check for the problems: ==> try 89.9 ncview src_grid_area: i=49,j=97 0.000190 i=50,j=97 0.000199 *** i=51,j=97 0.000195 dst_error1: no row of zeros (j=45) ==> try 89.999999 src_grid_area i=49,j=97 0.000177 i=50,j=97 0.000213 i=51,j=97 0.000195 dst_error1: one big error i=28,j=45 2.68 Also visible in dst_array1 ==> try 89.999 i=49,j=97 0.000194679 i=50,j=97 0.000194686 *** i=51,j=97 0.000195624 dst_error1: no row of zeros (j=45) ==> try 89.99999 Same problem as 89.99999 ==> try 89.9999 i=49,j=97 0.00019468 i=50,j=97 0.000194685 *** i=51,j=97 0.000195624 dst_error1: no row of zeros (j=45) This was the best one (I'm not going to go into another digit!!!). -----> other tests