Warning, /utils/matlab/cs_grid/bk_line/README is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit 4ec37fd8 on 2023-10-03 22:00:32 UTC
323aa12fe2 Jean*0001
0c7ba451ba Jean*0002 %- Feb 12 2013:
0003 needs MDS (binary) grid files (XC,YC,XG,YG & RAC) in dir "./grid_files/"
4ec37fd829 Jean*0004 (read-in using matlab script: MITgcm/utils/matlab/load_grid.m
0005 which also allows to use MNC (NetCDF) grid files by changing "ncdf=0;"
0006 to "ncdf=1;" in all the matlab scripts listed here after).
323aa12fe2 Jean*0007
4ec37fd829 Jean*0008 %-----------------------------------------------------------
0009 NOTE: For the purpose of computing meridional transport, a simpler, more robust
0010 method (based on grid-cell center latitude) is preferred, see "mk_isoLat_bkl.m"
0011 and "use_isoLat_bkl.m" in the directory one level up (i.e., in matlab/cs_grid/).
0012 However, other functions provided here (great-circle section line, basin
0013 mask and separation) have no improved equivalent (yet) in matlab/cs_grid/.
0c7ba451ba Jean*0014
4ec37fd829 Jean*0015 %- define broken-line on the C.S. grid as close as possible to given yLat latitude:
0016 % Method: find the list of grid-cell corner points that stay as close as
0017 % the corresponding target latitude, and collect the connecting grid-cell edges
0018 % (i.e., velocity points) to generate the broken-line.
0019 %- started: Sep 15 2002
0020 % Note: have not been updated to accept compact-format input files
323aa12fe2 Jean*0021
0022 gener_bk_line.m
4ec37fd829 Jean*0023 (use: load_grid.m find_bk_line.m clean_bk_line.m save_bk_line.m grph_bk_line.m)
323aa12fe2 Jean*0024 => write matlab file: isoLat_cube32_59.mat
0025 ( run 1rst time to try ; then set krd=0 and run 2nd time to calculate
0026 all the broken line and write to file)
0027
0c7ba451ba Jean*0028 %- generate array (= bkl_Zon) that give
4ec37fd829 Jean*0029 % the latitude zone (= between 2 broken-line) of each grid mesh (tracer pt),
0030 %- Started: Jul 24 2003
323aa12fe2 Jean*0031
0032 gen_bk_Zon.m
0033 <= read grid_files/isoLat_cube32_59.mat
0034 => write matlab file: isoLat_cs32_59.mat
0035 (contains all the arrays that were in isoLat_cube32_59.mat)
0036
4ec37fd829 Jean*0037 %-----------------------------------------------------------
323aa12fe2 Jean*0038 % define mask of 3 basins (Atlantic , Indian , Pacific)
0039 % and the list of border points (U,V point)
0040 %- Jul 26 2003
4ec37fd829 Jean*0041 % Note: have not been updated to accept compact-format input files
323aa12fe2 Jean*0042
0043 def_API_msk.m
4ec37fd829 Jean*0044 (use: line_sep.m; needs also hFacC,W,S from ocean-set-up, in dir: ./grid_files/ )
323aa12fe2 Jean*0045 => write binary files: maskC_bas.bin maskS_bas.bin maskW_bas.bin
0046 + list of U,V points at the border: => open_basins_section.mat
0047
0048 %- combine "broken-line" + 3 basins
4ec37fd829 Jean*0049 % used to compute the mask of Meridional Stream-Funct. for Atl,Ind,Pac
0050 %- Started: Jul 26 2003
323aa12fe2 Jean*0051
0052 sep_API_basins.m
0053 => write matlab file: sepBas_cs32_60.mat
0054
4ec37fd829 Jean*0055 %-----------------------------------------------------------
0056 %- define a single broken-line on CS-grid that follows as close as possible
0057 % a great-circle line:
0058 %- started: Feb 05 2007
0059 % Note: have not been updated to accept compact-format input files
0060 grt_circ_bkl.m :
0061 uses: load_grid.m rotate_xy.m split_Z_cub.m find_bk_line.m clean_bk_line.m
0062 save_bk_line.m shift_bk_line.m
0063 (+ optional, for plots: grph_CS.m moveHV_colbar.m )
0064
323aa12fe2 Jean*0065 %------------------------------------------------------
4ec37fd829 Jean*0066 % Example on how to use those broken-line files:
0067 % a) to compute & plot Meridional Transport Stream-function
0068 % using broken-line file (i.e., like "isoLat_cs32_59.mat") generated by:
0069 % gener_bk_line.m + gen_bk_Zon.m from this dir.
0070 % b) changing to krd=3, to compute the horizontally integrated transport
0071 % through a Great-Circle section using broken-line file generated by:
0072 % grt_circ_bkl.m from this dir.
0073 %- Started: Jul 2003
0074 % Note: has been updated to accept compact-format input files
0075
0076 use_bk_line.m
0077 %-----------------------------------------------------------